/* builder.css — site-structure builder (AimBuilder), used by websites.html.
   Scoped under .bld (module root) and .bk-* (wireframe blocks in the preview).
   Light palette only — this module never renders on a dark page. */

.bld { display: grid; grid-template-columns: minmax(280px, 0.9fr) 1.1fr; gap: clamp(24px, 4vw, 48px); align-items: start; }
.bld--mobile { grid-template-columns: 1fr; }

/* ── Questions column ── */
.bld-q { display: flex; flex-direction: column; gap: 18px; }
.bld-row { display: flex; flex-direction: column; gap: 8px; }
.bld-row-label { font-family: 'Geist', sans-serif; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #6a6a7a; }
.bld-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bld-chip {
  border: 1px solid #e6e6ef; background: #ffffff; color: #16161d; border-radius: 999px;
  padding: 9px 16px; font-family: 'Geist', var(--font-body), sans-serif; font-size: 0.86rem; font-weight: 500;
  cursor: pointer; transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.bld-chip:hover { border-color: rgba(91,78,255,0.5); }
.bld-chip[aria-pressed="true"] { background: #5b4eff; border-color: #5b4eff; color: #ffffff; }
.bld-caption { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; color: #4a4a5a; min-height: 1.3em; }

/* Fine-tune switches (desktop) */
.bld-fine { display: none; flex-direction: column; gap: 14px; }
.bld-fine.is-visible { display: flex; }
.bld-group-label { font-family: 'Geist', sans-serif; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #6a6a7a; margin-bottom: 6px; }
.bld-switches { display: flex; flex-direction: column; gap: 6px; }
.bld-sw {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1px solid #e6e6ef; background: #ffffff; border-radius: 12px; padding: 8px 12px;
  cursor: pointer; text-align: left; font-family: 'Geist', var(--font-body), sans-serif; font-size: 0.86rem; color: #16161d;
  transition: border-color 0.2s;
}
.bld-sw:hover { border-color: rgba(91,78,255,0.45); }
.bld-sw-track { width: 30px; height: 18px; border-radius: 999px; background: #d6d6e0; position: relative; flex: none; transition: background 0.2s; }
.bld-sw-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: transform 0.2s;
}
.bld-sw[aria-checked="true"] .bld-sw-track { background: #5b4eff; }
.bld-sw[aria-checked="true"] .bld-sw-track::after { transform: translateX(12px); }
.bld-sw-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }

/* ── Preview column ── */
.bld-p { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.bld-lap {
  background: linear-gradient(180deg, #1f2230 0%, #15171f 100%);
  border-radius: 14px 14px 6px 6px; padding: 10px 10px 0;
  border: 1px solid rgba(255,255,255,0.10); box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}
.bld-lap-bar { display: flex; align-items: center; gap: 5px; margin-bottom: 8px; }
.bld-lap-bar i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.bld-url {
  margin-left: 8px; flex: 1; height: 14px; border-radius: 7px; background: #2b2b36; color: #8a8a99;
  font-size: 9px; line-height: 14px; padding-left: 8px; font-family: ui-monospace, monospace;
}
.bld-scr { background: #ffffff; border-radius: 4px 4px 0 0; height: 380px; overflow-y: auto; position: relative; }
.bld-lap-foot { height: 8px; background: #111118; border-radius: 0 0 10px 10px; margin: 0 -10px; }
.bld-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 24px; color: #8a8a99; font-family: 'Geist', sans-serif; font-size: 0.9rem; pointer-events: none;
}
.bld-nav { display: flex; gap: 6px; padding: 6px 10px; border-bottom: 1px solid #e6e6ef; font-size: 8px; color: #16161d; font-family: 'Geist', sans-serif; }
.bld-nav b { color: #5b4eff; margin-right: auto; font-weight: 700; }
.bld-nav span { padding: 1px 6px; border-radius: 3px; background: #f7f7fb; }

/* Phone frame (mobile mode) */
.bld-ph {
  width: 210px; margin: 0 auto; position: relative;
  background: linear-gradient(180deg, #1a1c24 0%, #0e0f14 100%); border-radius: 30px; padding: 8px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
.bld-ph::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 80px; height: 16px; background: #000; border-radius: 0 0 10px 10px; z-index: 2;
}
.bld-ph .bld-scr { border-radius: 22px; height: 380px; }

/* Bricks (mobile mode) */
.bld-bricks { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.bld-bricks:empty { display: none; }
.bld-brick {
  border: 0; color: #ffffff; border-radius: 8px; padding: 10px 12px;
  font-family: 'Geist', var(--font-body), sans-serif; font-size: 0.82rem; font-weight: 600; cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.22); transition: transform 0.15s;
}
.bld-brick:active { transform: scale(0.96); }

/* CTA under the preview */
.bld-cta { align-self: center; }
.bld-cta[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* ── Wireframe blocks inside the preview ── */
.bk {
  overflow: hidden; max-height: 0; opacity: 0; transform: translateY(-6px); position: relative;
  transition: max-height 0.4s ease, opacity 0.35s ease, transform 0.35s ease;
  border-bottom: 1px solid #f0f0f5;
}
.bk.on { max-height: 140px; opacity: 1; transform: none; }
.bk-in { padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; position: relative; }
.bk-tag { position: absolute; right: 8px; top: 8px; font-size: 7px; font-family: ui-monospace, monospace; color: #ffffff; padding: 2px 6px; border-radius: 3px; letter-spacing: 0.04em; }
.bk-x {
  position: absolute; left: 8px; bottom: 6px; display: none; border: 0; background: #fff1ec; color: #c2410c;
  border-radius: 999px; font-size: 9px; line-height: 1; padding: 3px 7px; cursor: pointer; font-family: 'Geist', sans-serif;
}
.bld--mobile .bk-x { display: inline-block; }
.bk-ln { height: 5px; border-radius: 3px; background: #e6e6ef; }
.bk-ln.t { height: 9px; width: 55%; background: #16161d; }
.bk-ln.s { width: 70%; }
.bk-ln.xs { width: 35%; }
.bk-btn { height: 11px; width: 44px; border-radius: 3px; background: #5b4eff; }
.bk-row3 { display: flex; gap: 5px; }
.bk-row3 > i { flex: 1; height: 28px; border-radius: 3px; background: #f0f0f5; border: 1px solid #e6e6ef; }
.bk-row3 > i.img { background: linear-gradient(135deg, #e9e7ff, #d8d5ff); }
.bk-quote { display: flex; gap: 6px; align-items: center; }
.bk-quote > i { width: 12px; height: 12px; border-radius: 50%; background: #d8d5ff; flex: none; }
.bk-fld { height: 10px; border: 1px solid #e6e6ef; border-radius: 3px; background: #fafafe; }
.bk-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; align-items: center; }
.bk-img { height: 44px; border-radius: 4px; background: linear-gradient(135deg, #5b4eff 0%, #a78bfa 60%, #e9e7ff 100%); }
.bk-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.bk-grid4 > i { height: 24px; border-radius: 3px; background: #f0f0f5; border: 1px solid #e6e6ef; }
.bk-pay { display: flex; gap: 4px; align-items: center; }
.bk-pay > i { height: 10px; width: 24px; border-radius: 2px; background: #e6e6ef; }
.bk-pay > i.g { background: #0a8f7a; width: 36px; }
.bk-faq { height: 8px; border-radius: 3px; background: #f0f0f5; border: 1px solid #e6e6ef; }
.bk-map { height: 28px; border-radius: 3px; background: repeating-linear-gradient(45deg, #eef, #eef 4px, #f7f7fb 4px, #f7f7fb 8px); }

/* Brick "fly-in" (mobile add) */
@keyframes bld-fly {
  0%   { transform: translateY(40px) scale(0.7); opacity: 0; }
  60%  { transform: translateY(-4px) scale(1.02); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.bk.fly { animation: bld-fly 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* ── Motion + viewport ── */
@media (prefers-reduced-motion: reduce) {
  .bk { transition: none; }
  .bk.fly { animation: none; }
}
@media (max-width: 719px) {
  .bld { grid-template-columns: 1fr; }
  .bld-scr { height: 340px; }
}
