/* ============================================================
   Mythox - Builder (s36 SP1)
   100% token-driven (global brand.css tokens) → follows all 4
   palettes + light mode. Calm, premium, never cluttered.
   ============================================================ */

.bld-wrap { max-width: 980px; margin: 0 auto; }

/* ---------------- HERO ---------------- */
.bld-hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 30px; border-radius: var(--radius-lg); border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 92% -20%, var(--gold-soft), transparent 55%),
    linear-gradient(180deg, var(--surface), var(--surface-grad-2));
  margin-bottom: 22px;
}
.bld-hero-in { position: relative; z-index: 1; }
.bld-kicker { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.bld-hero h1 { font-size: clamp(26px, 3.6vw, 38px); margin: 10px 0 8px; }
.bld-hero .sub { color: var(--muted); max-width: 64ch; font-size: 14.5px; }

/* ---------------- LAYOUT BITS ---------------- */
.bld-h2 { font-size: 17px; margin: 26px 0 12px; }
.bld-h3 { font-size: 14px; margin: 22px 0 8px; }
.bld-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.bld-btn2 {
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ivory);
  background: var(--btn-bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
}
.bld-btn2:hover { background: var(--btn-bg-2h); border-color: var(--gold-line); }
.bld-danger {
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--bad, #e5484d);
  background: transparent; border: 1px solid color-mix(in srgb, var(--bad, #e5484d) 45%, transparent);
  border-radius: 10px; padding: 9px 16px; cursor: pointer;
}
.bld-link { background: none; border: none; color: var(--gold); font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; }
.bld-card {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), var(--surface-grad-2));
  padding: 24px; margin-bottom: 18px;
}
.bld-note {
  border: 1px solid var(--gold-line); border-radius: 12px; padding: 14px 16px;
  background: var(--gold-soft); font-size: 13.5px; margin: 16px 0; color: var(--ivory);
}
.bld-import-status {
  display: grid; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  background: linear-gradient(180deg, var(--surface), var(--surface-grad-2));
  margin: 16px 0 4px;
}
.bld-import-status[hidden] { display: none; }
.bld-import-copy b { display: block; font-size: 13.5px; color: var(--ivory); }
.bld-import-copy p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.bld-import-done { border-color: color-mix(in srgb, var(--ok, #46a758) 46%, var(--line)); }
.bld-import-done .bld-import-copy b { color: var(--ok, #46a758); }
.bld-import-error { border-color: color-mix(in srgb, var(--bad, #e5484d) 50%, var(--line)); }
.bld-import-error .bld-import-copy b { color: var(--bad, #e5484d); }
.bld-grow {
  border: 1px solid var(--gold-line); border-radius: 12px; padding: 14px 16px;
  background: var(--gold-soft); margin: 16px 0; display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
}
.bld-grow p { margin: 0; font-size: 13.5px; color: var(--ivory); }
.bld-empty { color: var(--muted); font-size: 14px; padding: 14px 2px; }
.bld-err { color: var(--bad, #e5484d); font-size: 13px; margin-top: 12px; }

/* ---------------- TYPE CHOOSER ---------------- */
.bld-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 6px; align-items: start; }
.bld-type {
  text-align: left; font-family: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  background: linear-gradient(180deg, var(--surface), var(--surface-grad-2)); color: var(--ivory);
  transition: border-color .15s, transform .15s;
}
.bld-type:hover:not(.soon) { border-color: var(--gold-line); transform: translateY(-1px); }
.bld-type.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.bld-type.soon { opacity: .5; cursor: default; }
.bld-type-name { font-weight: 700; font-size: 14px; }
.bld-type-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.bld-type-meta { font-family: var(--mono); font-size: 11px; color: var(--gold); margin-top: 2px; }

.bld-style-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 6px; }
.bld-style-option {
  text-align: left; font-family: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px;
  background: linear-gradient(180deg, var(--surface), var(--surface-grad-2)); color: var(--ivory);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.bld-style-option:hover { border-color: var(--gold-line); transform: translateY(-1px); }
.bld-style-option.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.bld-style-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bld-style-name { font-weight: 700; font-size: 13.5px; }
.bld-style-desc { font-size: 12.3px; color: var(--muted); line-height: 1.45; }
.bld-swatches { display: inline-flex; gap: 3px; flex: 0 0 auto; }
.bld-swatches i { width: 16px; height: 16px; border-radius: 999px; border: 1px solid var(--line); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }

.bld-template-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 6px; }
.bld-template-card, .bld-template-blank {
  text-align: left; font-family: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px;
  background: linear-gradient(180deg, var(--surface), var(--surface-grad-2)); color: var(--ivory);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.bld-template-card:hover, .bld-template-blank:hover { border-color: var(--gold-line); transform: translateY(-1px); }
.bld-template-card.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.bld-template-blank { justify-content: center; min-height: 128px; border-style: dashed; }
.bld-template-preview {
  position: relative; display: block; overflow: hidden; min-height: 76px; aspect-ratio: 16 / 9;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); box-sizing: border-box;
}
.blt-thumb-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px; transition: opacity .18s ease; box-sizing: border-box;
}
.blt-thumb {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .18s ease; background: var(--surface-2);
}
.bld-template-preview.blt-thumb-ready .blt-thumb { opacity: 1; visibility: visible; }
.bld-template-preview.blt-thumb-ready .blt-thumb-fallback { opacity: 0; }
.bld-template-fonts { font-family: var(--mono); font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.bld-template-glyph {
  width: 54px; height: 36px; flex: 0 0 auto; display: grid; gap: 3px;
  border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: var(--ink-2, var(--surface));
}
.bld-template-glyph i { display: block; min-width: 0; min-height: 0; border-radius: 3px; background: color-mix(in srgb, var(--ivory) 14%, transparent); border: 1px solid var(--line); }
.bld-template-glyph-marquee { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 6px; }
.bld-template-glyph-marquee i:first-child { grid-column: 1 / -1; }
.bld-template-glyph-bento { grid-template-columns: 1.4fr .9fr; grid-template-rows: 1fr 1fr; }
.bld-template-glyph-bento i:first-child { grid-row: 1 / -1; }
.bld-template-glyph-split { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.bld-template-glyph-split i:nth-child(n+3) { display: none; }
.bld-template-glyph-editorial { grid-template-columns: 1fr; grid-template-rows: 10px 5px 5px 5px; }
.bld-template-glyph-manifesto { grid-template-columns: 1fr; grid-template-rows: 16px 4px 4px 4px; }
.bld-template-glyph-gallery { grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; }
.bld-template-glyph-gallery i:first-child { grid-column: span 2; }

.bld-ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 6px; align-items: start; }
.bld-idea {
  text-align: left; font-family: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  background: linear-gradient(180deg, var(--surface), var(--surface-grad-2)); color: var(--ivory);
  transition: border-color .15s, transform .15s;
}
.bld-idea:hover { border-color: var(--gold-line); transform: translateY(-1px); }
.bld-idea.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.bld-idea-name { font-weight: 700; font-size: 13px; }
.bld-idea-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* ---------------- INTAKE ---------------- */
.bld-label { display: block; font-size: 13px; font-weight: 600; margin: 18px 0 8px; }
.bld-design-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin: 18px 0 8px; font-size: 13px;
}
.bld-design-row .bld-label { margin: 0; }
.bld-design-summary { color: var(--muted); margin-left: auto; }
.bld-design-summary.on { color: var(--ivory); }
.bld-customize {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  background: var(--surface-2);
}
.bld-customize[hidden] { display: none; }
.bld-goal {
  width: 100%; min-height: 92px; resize: vertical; font-family: inherit; font-size: 14.5px;
  color: var(--ivory); background: var(--ink-2, var(--surface)); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; box-sizing: border-box;
}
.bld-goal:focus { outline: none; border-color: var(--gold-line); }
.bld-price-line { font-size: 13px; color: var(--muted); margin-top: 12px; }
.bld-price-line b { color: var(--ivory); }

/* ---------------- CONNECT ---------------- */
.bld-steps-list { margin: 10px 0 14px; padding-left: 20px; font-size: 13.5px; color: var(--ivory-soft); display: grid; gap: 6px; }
.bld-conn-form { display: flex; gap: 10px; flex-wrap: wrap; }
.bld-token {
  flex: 1; min-width: 220px; font-family: var(--mono); font-size: 13px; color: var(--ivory);
  background: var(--ink-2, var(--surface)); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.bld-conn-on { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.bld-ok { color: var(--ok, #46a758); font-weight: 700; }
.bld-hint { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bld-details { margin-top: 14px; font-size: 13px; color: var(--muted); }
.bld-details summary { cursor: pointer; font-weight: 600; color: var(--ivory-soft); }
.bld-details p { margin: 8px 0 0; line-height: 1.55; }

/* ---------------- JOB LIST ---------------- */
.bld-jobs { display: grid; gap: 10px; }
.bld-job {
  display: grid; grid-template-columns: minmax(120px, auto) 1fr auto; gap: 6px 16px; align-items: center;
  text-align: left; font-family: inherit; cursor: pointer;
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px;
  background: linear-gradient(180deg, var(--surface), var(--surface-grad-2)); color: var(--ivory);
  transition: border-color .15s;
}
.bld-job:hover { border-color: var(--gold-line); }
.bld-job-name { font-weight: 700; font-size: 13.5px; }
.bld-job-goal { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bld-job-url { grid-column: 1 / -1; font-family: var(--mono); font-size: 11.5px; color: var(--gold); }
.bld-status { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.bld-st-delivered { color: var(--ok, #46a758); }
.bld-st-awaiting_plan_approval, .bld-st-needs_user_input, .bld-st-paused_cap { color: var(--gold); }
.bld-st-failed_refundable, .bld-st-failed_nonrefundable { color: var(--bad, #e5484d); }

/* ---------------- PLAN ---------------- */
.bld-goal-echo { color: var(--muted); font-size: 13.5px; font-style: italic; margin: 4px 0 16px; }
.bld-design-card {
  border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 16px 0 18px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}
.bld-design-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.bld-design-head span, .bld-design-grid span {
  display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.bld-design-head b {
  color: var(--gold); font-family: var(--mono); font-size: 11px; text-transform: uppercase;
}
.bld-design-inspo { margin: 0 0 14px; color: var(--ivory); font-size: 14px; line-height: 1.5; }
.bld-design-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.bld-design-grid > div { min-width: 0; border-top: 1px solid var(--line); padding-top: 9px; }
.bld-design-grid b { display: block; color: var(--ivory); font-size: 13px; margin-top: 5px; line-height: 1.35; overflow-wrap: anywhere; }
.bld-design-swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 9px; }
.bld-design-swatch {
  display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; gap: 1px 8px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 9px; background: var(--ink-2, var(--surface));
}
.bld-design-swatch i { grid-row: 1 / 3; width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--line); }
.bld-design-swatch b { font-size: 11.5px; color: var(--ivory); text-transform: capitalize; }
.bld-design-swatch em { font-size: 11px; color: var(--muted); font-style: normal; overflow-wrap: anywhere; }
.bld-plan-steps { padding-left: 22px; display: grid; gap: 10px; font-size: 14px; }
.bld-plan-steps li b { display: block; }
.bld-plan-steps li span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.bld-notes { display: grid; gap: 8px; }
.bld-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; cursor: pointer; }
.bld-check input { margin-top: 3px; accent-color: var(--gold); }

/* The agreement that credits are spent now and are not returned on a cancel. Deliberately looks
   heavier than the optional improvement checkboxes above it: this one costs money, and it is the
   last thing read before the button. */
.bld-accept { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.55;
  cursor: pointer; margin: 14px 0 4px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.35); background: rgba(212, 175, 55, 0.06); }
.bld-accept input { margin-top: 3px; accent-color: var(--gold); flex: none; }
.bld-accept > span { min-width: 0; }

.bld-changes { margin-top: 16px; display: grid; gap: 10px; }

/* ---------------- PROGRESS ---------------- */
.bld-status-line { font-size: 14px; margin-bottom: 14px; }
/* live "still working" progress: a bar + a counter that always moves */
.bld-prog { margin: 4px 0 16px; }
.bld-prog-bar { height: 8px; border-radius: 999px; background: var(--line, rgba(255,255,255,.08)); overflow: hidden; }
.bld-prog-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--gold, #C9A227); transition: width .6s ease; }
.bld-prog.indet .bld-prog-bar > i { width: 40% !important; animation: bldIndet 1.3s ease-in-out infinite; }
@keyframes bldIndet { 0% { margin-left: -42%; } 100% { margin-left: 102%; } }
.bld-prog-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--muted); }
.bld-prog-time b { color: var(--gold, #C9A227); font-variant-numeric: tabular-nums; }
.bld-prog-hint { margin-top: 6px; font-size: 12px; color: var(--muted); opacity: .8; }
@media (prefers-reduced-motion: reduce) { .bld-prog.indet .bld-prog-bar > i { animation: none; } }
.bld-steps-ui { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 7px; }
.bld-step { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.bld-step-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.bld-step-done { color: var(--ivory); }
.bld-step-done .bld-step-dot { background: var(--ok, #46a758); }
.bld-step-running { color: var(--ivory); }
.bld-step-running .bld-step-dot { background: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }
.bld-step-failed .bld-step-dot { background: var(--bad, #e5484d); }
.bld-feed {
  max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px;
  background: var(--ink-2, var(--surface)); padding: 12px 14px; display: grid; gap: 7px;
}
.bld-ev { font-size: 13px; line-height: 1.5; color: var(--ivory-soft); }
.bld-ev-warn { color: var(--warn, #f5a623); }
.bld-ev-error { color: var(--bad, #e5484d); }
.bld-ev-done { color: var(--ok, #46a758); font-weight: 600; }
.bld-ask { margin-top: 16px; display: grid; gap: 10px; font-size: 13.5px; }
.bld-ask.bld-bad p { color: var(--bad, #e5484d); }

/* ---------------- DELIVERED ---------------- */
.bld-done h3 { font-size: 22px; margin: 0 0 12px; }
.bld-live-link {
  display: inline-block; font-family: var(--mono); font-size: 15px; color: var(--gold);
  text-decoration: none; border: 1px solid var(--gold-line); border-radius: 12px;
  padding: 12px 18px; background: var(--gold-soft); word-break: break-all;
}
.bld-live-link:hover { border-color: var(--gold); }
.bld-sub2 { color: var(--muted); font-size: 13px; margin-top: 14px; }
.bld-preview-shell.is-locked .bld-ws-framebox::before {
  content: "MYTHOX FREE PREVIEW";
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: grid; place-items: center;
  color: rgba(120,120,120,.18); font-weight: 900; font-size: clamp(24px, 5vw, 54px);
  letter-spacing: .16em; transform: rotate(-24deg); text-align: center;
}
.bld-preview-shell.is-locked .bld-ws-framebox::after {
  content: "Upgrade to download or publish";
  position: absolute; right: 14px; bottom: 14px; z-index: 3; pointer-events: none;
  border: 1px solid var(--gold-line); border-radius: 999px; padding: 7px 12px;
  background: color-mix(in srgb, var(--surface) 92%, black); color: var(--gold);
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.bld-manage-preview { margin: 18px 0; }
.bld-manage-preview .bld-ws-preview-head { padding-top: 0; }
.bld-manage-preview .bld-ws-framebox { min-height: 420px; border-radius: 14px; }
.bld-integrations { margin-top: 18px; }
.bld-integrations h3 { margin-top: 0; }
.bld-minihead { font-size: 12px; margin: 18px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-family: var(--mono); }
.bld-integ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.bld-integ-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  display: grid; gap: 12px; align-content: start;
}
.bld-integ-copy h4 { margin: 0 0 6px; font-size: 14px; color: var(--ivory); }
.bld-integ-copy p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.bld-active-integrations { display: grid; gap: 8px; }
.bld-integ-active {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink-2, var(--surface));
}
.bld-integ-active b { display: block; font-size: 13.5px; color: var(--ivory); }
.bld-integ-active span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.bld-integ-form { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 2px; }
.bld-integ-input { width: 100%; box-sizing: border-box; }

/* build list: dismiss (X) failed builds + clear-all + delete a live product */
.bld-job-row { display: flex; align-items: stretch; gap: 8px; }
.bld-job-row > .bld-job { flex: 1; min-width: 0; }
.bld-job-x { flex: 0 0 auto; width: 42px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0; transition: color .15s, border-color .15s, background .15s; }
.bld-job-x:hover { color: #ff6b6b; border-color: #ff6b6b; background: rgba(255,107,107,.08); }
.bld-clear-row { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.bld-clear-all { background: transparent; border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 9px; cursor: pointer; transition: color .15s, border-color .15s; }
.bld-clear-all:hover { color: #ff6b6b; border-color: #ff6b6b; }
.bld-danger { background: transparent; border: 1px solid rgba(255,107,107,.45); color: #ff6b6b; font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 11px; cursor: pointer; transition: background .15s; }
.bld-danger:hover { background: rgba(255,107,107,.1); }

@media (max-width: 640px) {
  .bld-hero { padding: 22px; }
  .bld-job { grid-template-columns: 1fr; }
}
