/* The System Builder. Desktop: tray | live preview | panel. Phones: one pane at a time with a bottom bar. */
.bld { padding: calc(var(--hdr) + 22px) 0 28px; position: relative; }
.bld__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px 32px; flex-wrap: wrap; margin-bottom: 18px; }
.bld__h { font-size: clamp(1.7rem, 2.8vw, 2.7rem); }
.bld__h em { display: inline; }
.bld__steps { display: flex; gap: 4px; padding: 4px; background: #fff; border: 1px solid var(--line); }
.bld__steps button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 0; background: none; font-weight: 600; color: var(--muted); }
.bld__steps b { width: 24px; height: 24px; display: grid; place-items: center; background: var(--tint); color: var(--cobalt-d); font-size: .82rem; }
.bld__steps button[aria-selected="true"] { background: var(--ink); color: #fff; }
.bld__steps button[aria-selected="true"] b { background: var(--cobalt); color: #fff; }
.bld__stage { display: grid; grid-template-columns: 280px minmax(0, 1fr) 340px; gap: 14px; height: calc(100svh - var(--hdr) - 120px); min-height: 600px; max-height: 860px; }
.bld__tray, .bld__panel { background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.bld__tray-top { padding: 12px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.bld__search { height: 44px; }
.bld__search input { width: 100%; font-size: .95rem; }
.bld__filter .field select { padding-top: 10px; padding-bottom: 10px; font-size: .95rem; }
.bld__list { flex: 1; overflow-y: auto; padding: 8px 10px 14px; display: grid; gap: 6px; align-content: start; scrollbar-width: thin; }
.bld__group { font: 600 .78rem/1 var(--fb); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 10px 4px 4px; }
.bld__tile { display: grid; grid-template-columns: 38px 1fr 26px; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--line); background: #fff; text-align: left; color: var(--ink); transition: border-color .2s, background .2s, transform .2s var(--ease); }
.bld__tile .tile__ic { width: 38px; height: 38px; grid-row: auto; }
.bld__tile b { display: block; font: 700 .94rem/1.25 var(--fd); }
.bld__tile small { display: block; color: var(--muted); font-size: .84rem; line-height: 1.35; }
.bld__tile:hover { border-color: var(--cobalt); transform: translateX(2px); }
.bld__plus { width: 26px; height: 26px; display: grid; place-items: center; background: var(--tint); color: var(--cobalt-d); font-style: normal; transition: background .2s, transform .3s var(--ease); }
.bld__tile.is-in { background: #F2F4FF; border-color: #C6D0FF; }
.bld__tile.is-in .bld__plus { background: var(--mint-t); color: #fff; transform: rotate(45deg); }

.bld__preview { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 10px; }
.bld__pbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.bld__viewas { display: inline-flex; align-items: center; gap: 3px; padding: 3px; background: #fff; border: 1px solid var(--line); font-size: .9rem; }
.bld__viewas span { padding: 0 8px; color: var(--muted); }
.bld__viewas button { min-height: 38px; padding: 0 10px; border: 0; background: none; font-weight: 600; color: var(--muted); }
.bld__viewas button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.bld__point { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--ink); background: #fff; font-weight: 600; }
.bld__point[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); }
.bld__app { --app-accent: #3A5BFF; flex: 1; min-height: 0; display: grid; grid-template-columns: 200px minmax(0, 1fr); background: #F3F5FB; box-shadow: 0 30px 60px -36px rgba(16,20,42,.5); clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.bld__side { background: #121735; color: #C5CBEA; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; }
.bld__biz { display: flex; gap: 9px; align-items: center; padding: 4px 6px 14px; color: #fff; font: 700 .9rem/1.2 var(--fb); }
.bld__logo { width: 30px; height: 30px; flex: none; background: var(--app-accent); clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); display: grid; place-items: center; overflow: hidden; }
.bld__logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.bld__nav { display: grid; gap: 2px; }
.bld__navbtn { position: relative; display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 9px; border: 0; background: none; color: inherit; font: 500 .86rem/1.2 var(--fb); text-align: left; }
.bld__navbtn .ic { width: 16px; height: 16px; flex: none; opacity: .85; }
.bld__navbtn:hover { background: rgba(255,255,255,.06); color: #fff; }
.bld__navbtn.is-on { background: var(--app-accent); color: #fff; }
.bld__badge { margin-left: auto; min-width: 20px; height: 20px; display: grid; place-items: center; background: var(--amber); color: var(--ink); font: 700 .72rem/1 var(--fb); font-style: normal; }
.bld__empty-nav { padding: 10px 8px; font-size: .84rem; color: #8E96C2; }
.bld__main { position: relative; min-width: 0; min-height: 0; display: flex; }
.bld__main.is-pointing { cursor: crosshair; }
.bld__main.is-pointing .bld__kit { outline: 3px dashed var(--amber); outline-offset: -3px; }
.bld__main.is-pointing .bld__kit * { cursor: crosshair !important; }
.bld__kit { flex: 1; --kit-h: calc(100% - 40px); clip-path: none; box-shadow: none; }
.bld__kit .kit__body { height: calc(100% - 40px); }
.bld__kit { --a: var(--app-accent); }
.bld__welcome { margin: auto; max-width: 560px; padding: 30px; text-align: center; display: grid; gap: 16px; justify-items: center; }
.bld__ghost { display: grid; grid-template-columns: repeat(3, 54px); gap: 8px; }
.bld__ghost i { height: 40px; border: 1.5px dashed #B9C0D9; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); animation: ghostp 2.4s ease-in-out infinite; }
.bld__ghost i:nth-child(2n) { animation-delay: .4s; } .bld__ghost i:nth-child(3n) { animation-delay: .8s; }
@keyframes ghostp { 50% { background: rgba(58,91,255,.08); border-color: var(--cobalt); } }
.bld__starts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.bld__or { color: var(--muted); font-size: .95rem; }
.bld__or a, .bld__linkbtn { color: var(--cobalt-d); font-weight: 600; }
.bld__linkbtn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; min-height: 32px; text-decoration: underline; text-underline-offset: 3px; }
.bld__pins { position: absolute; inset: 0; pointer-events: none; }
.bld__pin { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; display: grid; place-items: center; background: var(--amber); color: var(--ink); font: 800 .8rem/1 var(--fb); box-shadow: 0 0 0 4px rgba(255,178,30,.35); pointer-events: auto; }
.bld__pop { position: absolute; z-index: 20; width: min(300px, 90%); padding: 14px; background: #fff; box-shadow: 0 20px 50px rgba(16,20,42,.35); display: grid; gap: 8px; pointer-events: auto; border-top: 4px solid var(--amber); font-size: .95rem; }
.bld__pop textarea { width: 100%; border: 1px solid #B9C0D9; padding: 8px 10px; font-size: .95rem; }
.bld__pop div { display: flex; gap: 6px; }
.bld__pointhint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: inline-flex; gap: 8px; align-items: center; padding: 10px 14px; background: var(--ink); color: #fff; font-weight: 600; font-size: .9rem; pointer-events: none; white-space: nowrap; }
.bld__pointhint .ic { color: var(--amber); }
.bld__price { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 14px; padding: 12px 16px; background: var(--ink); color: #fff; }
.bld__price span { color: var(--muted-d); font-size: .9rem; }
.bld__price b { font: 800 1.4rem/1 var(--fd); font-stretch: 108%; font-variant-numeric: tabular-nums; text-align: right; }
.bld__price small { grid-column: 1 / -1; color: #AEB6E4; font-size: .86rem; }

.bld__panel { overflow-y: auto; overflow-x: hidden; }
.bld__panel .field, .bld__panel select, .bld__panel input { min-width: 0; max-width: 100%; }
.bld__card { min-width: 0; }
.bld__got { flex-wrap: wrap; }
.bld__card { padding: 18px; display: grid; gap: 14px; align-content: start; }
.bld__card > p { color: var(--muted); font-size: .96rem; }
.bld__label { font-weight: 600; font-size: .92rem; margin-top: 4px; }
.bld__selname { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; }
.bld__selname .tile__ic { width: 40px; height: 40px; grid-row: auto; }
.bld__selname b { font: 750 1.15rem/1.2 var(--fd); }
.bld__rm { display: inline-flex; gap: 6px; align-items: center; min-height: 36px; padding: 0 8px; border: 0; background: none; color: var(--muted); font-size: .86rem; }
.bld__rm:hover { color: var(--rose); }
.bld__vars { display: grid; gap: 6px; }
.bld__var { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); background: #fff; text-align: left; color: var(--ink); transition: border-color .2s, background .2s; }
.bld__var b { display: block; font-size: .94rem; }
.bld__var small { display: block; color: var(--muted); font-size: .84rem; line-height: 1.4; }
.bld__check { width: 22px; height: 22px; border: 2px solid #B9C0D9; display: grid; place-items: center; color: #fff; }
.bld__check .ic { width: 14px; height: 14px; opacity: 0; }
.bld__var.is-on { border-color: var(--cobalt); background: #F4F6FF; }
.bld__var.is-on .bld__check { background: var(--cobalt); border-color: var(--cobalt); }
.bld__var.is-on .bld__check .ic { opacity: 1; }
.bld__var.is-showing { box-shadow: inset 4px 0 0 var(--amber); }
.bld__feats, .bld__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bld__feats .chip, .bld__chips .chip { font-size: .86rem; min-height: 34px; }
.bld__card .cp { margin-top: 4px; padding: 14px; }
.bld__card .cp__row { grid-template-columns: 1fr; }
.bld__notes { display: grid; gap: 6px; margin-top: 8px; }
.bld__notes li { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 8px 10px; background: #FFF7E3; border-left: 3px solid var(--amber); font-size: .9rem; }
.bld__notes button { border: 0; background: none; color: var(--muted); width: 28px; height: 28px; display: grid; place-items: center; }
.bld__swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bld__swatches button { width: 34px; height: 34px; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 1px var(--line); }
.bld__swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.bld__custom input { width: 44px; height: 38px; border: 0; padding: 0; background: none; }
.bld__drop { position: relative; display: grid; justify-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed #B9C0D9; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.bld__drop .ic { width: 34px; height: 34px; color: var(--cobalt); }
.bld__drop small { color: var(--muted); }
.bld__drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.bld__drop.is-over, .bld__drop:hover { border-color: var(--cobalt); background: var(--tint); }
.bld__got { display: flex; gap: 8px; align-items: flex-start; }
.bld__got .ic { color: var(--mint-t); margin-top: 3px; }
.bld__maps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.bld__maps .field select { padding-top: 10px; padding-bottom: 10px; font-size: .92rem; }
.bld__peek { overflow-x: auto; border: 1px solid var(--line); }
.bld__peek table { border-collapse: collapse; font-size: .82rem; width: 100%; }
.bld__peek th, .bld__peek td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.bld__peek th { background: var(--paper); }
.bld__form { display: grid; gap: 12px; }
.bld__form .btn { width: 100%; }
.bld__mobilebar { display: none; }

.bld-how__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.bld-how h2 { margin: 16px 0 8px; }
.bld-how p { color: var(--muted); }
@media (max-width: 900px) { .bld-how__grid { grid-template-columns: 1fr; } }

@media (max-width: 1240px) { .bld__stage { grid-template-columns: 250px minmax(0, 1fr) 300px; } .bld__app { grid-template-columns: 170px minmax(0, 1fr); } }
@media (max-width: 1000px) {
  .bld { padding-bottom: 90px; }
  .bld__steps { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bld__steps button { width: 100%; white-space: nowrap; font-size: .95rem; padding: 0 10px; }
  .bld__pbar { display: grid; grid-template-columns: minmax(0, 1fr); }
  .bld__viewas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bld__viewas span { display: none; }
  .bld__viewas button { padding: 0 4px; font-size: .875rem; white-space: nowrap; min-height: 44px; }
  .bld__point { justify-content: center; }
  .bld__starts .chip { min-height: 44px; }
  .bld__stage { display: block; height: auto; max-height: none; min-height: 0; }
  .bld__stage > [data-pane] { display: none; }
  .bld[data-m="tray"] [data-pane="tray"], .bld[data-m="panel"] [data-pane="panel"] { display: flex; max-height: none; }
  .bld[data-m="preview"] [data-pane="preview"] { display: flex; }
  .bld__list { max-height: none; overflow: visible; }
  .bld__app { height: 520px; grid-template-columns: 1fr; }
  .bld__side { display: none; }
  .bld__mobilebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; display: grid; grid-template-columns: repeat(3, auto) 1fr; gap: 4px; align-items: center; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--ink); color: #fff; }
  .bld__mobilebar button { display: grid; justify-items: center; gap: 2px; min-height: 48px; min-width: 64px; padding: 4px 8px; border: 0; background: none; color: #B9C0E6; font: 600 .78rem/1 var(--fb); }
  .bld__mobilebar button[aria-pressed="true"] { color: #fff; background: rgba(255,255,255,.08); }
  .bld__mobilebar p { text-align: right; }
  .bld__mobilebar b { display: block; font: 800 1.1rem/1 var(--fd); }
  .bld__mobilebar small { color: #AEB6E4; font-size: .78rem; }
}
