/* ==========================================================================
   Project Studio (pages/quote.html)
   ========================================================================== */

.studio-page { --bp-w: 340px; }

.brain-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  opacity: 0;
  transition: opacity 1.6s var(--ease);
}
.brain-canvas.ready { opacity: .75; }

/* ---------- Intro ---------- */
.studio-hero { padding: calc(var(--header-h) + clamp(50px, 8vw, 100px)) 0 40px; position: relative; }
.studio-hero .crumbs { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: .08em; margin-bottom: 18px; }
.studio-hero .crumbs a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.studio-hero .display { max-width: 820px; }
.studio-hero-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 6px 0 30px; color: var(--muted); font-size: .92rem; }
.studio-hero-meta i { color: var(--gold); margin-right: 6px; }
.restore-note {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 24px; padding: 10px 14px; border-radius: 12px;
  background: var(--blue-soft); border: 1px solid rgba(92,147,210,.3); color: #cfe0f5; font-size: .9rem;
}
.restore-note button { background: none; border: 0; color: var(--gold); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* ---------- Layout ---------- */
.studio-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--bp-w); gap: 34px; align-items: start;
  padding-bottom: 120px; max-width: 1280px;
}
.studio-steps { min-width: 0; }

.step-rail {
  position: sticky; top: calc(var(--header-h) + 10px); z-index: 5;
  display: flex; justify-content: space-between; gap: 6px;
  padding: 8px; margin-bottom: 26px;
  background: rgba(10, 15, 30, .94); border: 1px solid var(--line-2); border-radius: 999px;
}
.step-rail a {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 7px 8px; border-radius: 999px; color: var(--muted);
  font-family: var(--font-head); font-size: 13.5px; font-weight: 500;
  transition: background .3s, color .3s;
}
.step-rail .dot {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font: 600 11px var(--font-mono); border: 1px solid var(--line-2); transition: inherit;
}
.step-rail a.done .dot { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
.step-rail a.current { color: #120c00; background: linear-gradient(180deg, #ffcf75, var(--gold)); }
.step-rail a.current .dot { border-color: rgba(0,0,0,.25); color: #120c00; background: rgba(255,255,255,.35); }
@media (max-width: 640px) { .step-rail .lbl { display: none; } .step-rail a.current .lbl { display: inline; } }

.studio-step {
  position: relative;
  background: linear-gradient(180deg, rgba(10,15,30,.9), rgba(8,11,22,.88));
  border: 1px solid var(--line); border-radius: 24px;
  padding: clamp(22px, 4vw, 38px);
  margin-bottom: 26px;
  scroll-margin-top: calc(var(--header-h) + 80px);
  transition: border-color .4s;
}
.studio-step.current { border-color: rgba(240,181,74,.3); }
.step-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 26px; }
.step-no {
  font: 600 13px var(--font-mono); color: var(--gold);
  width: 46px; height: 46px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid rgba(240,181,74,.35); background: var(--gold-soft);
}
.step-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 6px; }
.step-head p { color: var(--muted); margin: 0; }
.step-error { color: #ffb3b3; font-size: .9rem; margin: 16px 0 0; }
.sub-h { font-size: 1rem; margin: 30px 0 12px; }
.sub-h span { color: var(--muted); font: 400 12px var(--font-mono); margin-left: 8px; }

/* ---------- 1. Services ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.svc-card {
  position: relative; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 18px 18px; border-radius: 18px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line-2); color: var(--text);
  font: inherit;
  transition: transform .3s var(--ease), border-color .3s, background .3s, box-shadow .3s;
}
.svc-card:hover { transform: translateY(-3px); border-color: rgba(240,181,74,.45); }
.svc-card .ic {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 21px;
  color: var(--gold); background: var(--gold-soft); border: 1px solid rgba(240,181,74,.25); margin-bottom: 8px;
  transition: transform .4s var(--ease);
}
.svc-card .nm { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; }
.svc-card .bl { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.svc-card .pr { margin-top: auto; padding-top: 10px; font: 500 12px var(--font-mono); color: var(--gold); letter-spacing: .04em; }
.svc-card .tick {
  position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px;
  border: 1px solid var(--line-2); color: transparent; transition: all .3s var(--ease);
}
.svc-card[aria-pressed="true"] {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(240,181,74,.14), rgba(240,181,74,.03));
  box-shadow: 0 0 0 4px var(--gold-soft), 0 20px 40px -20px var(--gold-glow);
}
.svc-card[aria-pressed="true"] .tick { background: var(--gold); border-color: var(--gold); color: #120c00; transform: scale(1.1); }
.svc-card[aria-pressed="true"] .ic { transform: rotate(-8deg) scale(1.06); }
.svc-card.zap::after { /* selection burst */
  content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
  border: 2px solid var(--gold); animation: zap .6s var(--ease) forwards;
}
@keyframes zap { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.08); } }

/* ---------- 2. Idea lab ---------- */
.idea-lab { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 760px) { .idea-lab { grid-template-columns: minmax(0, 1fr); } }

.idea-cloud {
  position: relative; height: 380px; overflow: hidden;
  border-radius: 20px; border: 1px dashed rgba(240,181,74,.3);
  background:
    radial-gradient(circle at 30% 30%, rgba(92,147,210,.14), transparent 55%),
    radial-gradient(circle at 75% 70%, rgba(240,181,74,.10), transparent 55%),
    rgba(0,0,0,.25);
}
@media (max-width: 760px) { .idea-cloud { height: 320px; } }
.cloud-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--muted); font-size: .92rem; text-align: center; padding: 20px;
}
.cloud-empty i { font-size: 34px; color: var(--blue); opacity: .7; }
.cloud-tools { position: absolute; left: 12px; bottom: 12px; right: 12px; z-index: 3; display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 12px; border-radius: 999px; font: 500 12.5px var(--font-head);
  color: var(--text); background: rgba(5,7,13,.8); border: 1px solid var(--line-2);
  transition: border-color .2s, color .2s;
}
.chip-btn:hover { border-color: var(--gold); color: var(--gold); }
.chip-btn.dream[aria-pressed="true"] { color: #120c00; background: linear-gradient(90deg, #f472b6, var(--gold)); border-color: transparent; }

.idea-chip {
  position: absolute; top: 0; left: 0; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px; cursor: grab;
  font: 500 13.5px var(--font-head); color: #fff; white-space: nowrap;
  background: rgba(15, 22, 48, .92);
  border: 1px solid rgba(240,181,74,.4);
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.7), 0 0 18px -6px var(--gold-glow);
  touch-action: none; user-select: none; -webkit-user-select: none;
  will-change: transform;
}
.idea-chip:hover, .idea-chip:focus-visible { border-color: var(--gold); box-shadow: 0 8px 24px -8px rgba(0,0,0,.7), 0 0 26px -4px var(--gold-glow); }
.idea-chip .tier { display: inline-flex; gap: 2px; }
.idea-chip .tier i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); opacity: .25; }
.idea-chip .tier[data-t="S"] i:nth-child(-n+1),
.idea-chip .tier[data-t="M"] i:nth-child(-n+2),
.idea-chip .tier[data-t="L"] i:nth-child(-n+3) { opacity: 1; }
.idea-chip .tier[data-t="I"] { display: none; }
.idea-chip.dream { border-color: rgba(244,114,182,.6); background: linear-gradient(135deg, rgba(60,20,70,.95), rgba(20,22,50,.95)); }
.idea-chip.dream::before { content: "✦"; color: #f9a8d4; }
.idea-chip.materialize .inner { animation: materialize .9s var(--ease) both; }
.idea-chip .inner { display: inline-flex; align-items: center; gap: 8px; }
@keyframes materialize { from { opacity: 0; filter: blur(10px); transform: scale(.4); } to { opacity: 1; filter: none; transform: none; } }
.idea-chip.evaporate { transition: opacity .5s, filter .5s; opacity: 0; filter: blur(8px); pointer-events: none; }
.idea-chip.dragging { position: fixed; z-index: 2000; cursor: grabbing; transform-origin: center; box-shadow: 0 20px 40px -10px rgba(0,0,0,.9), 0 0 30px var(--gold-glow); }

.spark {
  position: absolute; z-index: 1; width: 4px; height: 4px; border-radius: 50%;
  background: #fff6df; box-shadow: 0 0 8px var(--gold);
  pointer-events: none; animation: spark .8s ease-out forwards;
}
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }

.brain-drop {
  position: relative; display: flex; flex-direction: column; min-height: 380px;
  border-radius: 20px; padding: 16px;
  background: linear-gradient(180deg, rgba(240,181,74,.06), rgba(255,255,255,.02));
  border: 1px solid rgba(240,181,74,.25);
  transition: border-color .25s, box-shadow .25s, transform .25s var(--ease);
}
@media (max-width: 760px) { .brain-drop { min-height: 0; } }
.brain-drop.hot { border-color: var(--gold); box-shadow: 0 0 0 5px var(--gold-soft), 0 0 50px -10px var(--gold-glow); transform: scale(1.01); }
.brain-drop.gulp { animation: gulp .45s var(--ease); }
@keyframes gulp { 40% { transform: scale(1.025); } }
.bd-head { display: flex; justify-content: space-between; align-items: center; font: 600 14px var(--font-head); margin-bottom: 12px; }
.bd-head i { color: var(--gold); margin-right: 6px; }
.bd-count { font: 500 12px var(--font-mono); color: #120c00; background: var(--gold); border-radius: 999px; padding: 2px 9px; }
.brain-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; flex: 1; }
.brain-chips li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 12px; border-radius: 999px; font-size: 13px;
  background: rgba(5,7,13,.7); border: 1px solid var(--line-2);
  animation: pop-in .45s var(--ease) both;
}
.brain-chips li.custom { border-color: rgba(92,147,210,.5); }
.brain-chips li.dream { border-color: rgba(244,114,182,.5); }
.brain-chips li button { width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; font-size: 11px; }
.brain-chips li button:hover { background: rgba(255,107,107,.2); color: #ffb3b3; }
@keyframes pop-in { from { opacity: 0; transform: scale(.6); } }
.bd-empty { position: absolute; inset: 56px 16px 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: .9rem; border: 1px dashed var(--line-2); border-radius: 14px; pointer-events: none; }
.bd-empty i { font-size: 24px; color: var(--gold); opacity: .7; }
@media (max-width: 760px) { .bd-empty { position: static; padding: 22px; margin-bottom: 4px; } }
.custom-idea { display: flex; gap: 8px; margin-top: 14px; }
.custom-idea input {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: 12px;
  background: rgba(0,0,0,.35); border: 1px solid var(--line-2); color: var(--text); font: inherit; font-size: .92rem;
}
.custom-idea input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.custom-idea .btn { padding: 0 16px; }

/* ---------- 3. Palettes ---------- */
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.palette-card {
  cursor: pointer; text-align: left; padding: 10px; border-radius: 16px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line-2); color: var(--text); font: inherit;
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.palette-card:hover { transform: translateY(-3px); border-color: rgba(240,181,74,.45); }
.palette-card[aria-checked="true"] { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.palette-card .sw { display: flex; height: 54px; border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.palette-card .sw span { flex: 1; transition: flex .35s var(--ease); }
.palette-card:hover .sw span:nth-child(3), .palette-card[aria-checked="true"] .sw span:nth-child(3) { flex: 2.2; }
.palette-card .nm { font: 600 13px var(--font-head); display: flex; justify-content: space-between; align-items: center; }
.palette-card .nm i { color: var(--gold); opacity: 0; transition: opacity .2s; }
.palette-card[aria-checked="true"] .nm i { opacity: 1; }
.palette-card.custom .sw { background: conic-gradient(from 90deg, #f0b54a, #f472b6, #8b5cf6, #00b4d8, #2d6a4f, #f0b54a); }
.custom-palette { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-top: 16px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); }
.custom-palette label { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); cursor: pointer; }
.custom-palette input[type="color"] { width: 42px; height: 34px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: none; cursor: pointer; }

/* ---------- Chip groups (vibes, industry, size …) ---------- */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-opt {
  cursor: pointer; padding: 8px 14px; border-radius: 999px; font: 500 13.5px var(--font-head);
  color: var(--text); background: rgba(255,255,255,.03); border: 1px solid var(--line-2);
  transition: all .2s;
}
.chip-opt:hover { border-color: rgba(240,181,74,.5); }
.chip-opt[aria-pressed="true"] { color: #120c00; background: var(--gold); border-color: var(--gold); }

.studio-form .field label { margin-bottom: 10px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn-generate { font-size: 17px; padding: 18px 34px; margin-top: 6px; }
.btn-generate[disabled] { opacity: .6; pointer-events: none; }

/* ---------- Blueprint panel ---------- */
.blueprint {
  position: sticky; top: calc(var(--header-h) + 10px);
  max-height: calc(100vh - var(--header-h) - 20px); overflow: auto;
  padding: 20px; border-radius: 22px;
  background: rgba(10, 15, 30, .95); border: 1px solid var(--line-2);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.9);
  scrollbar-width: thin;
}
.bp-head { display: flex; justify-content: space-between; align-items: center; }
.bp-head .eyebrow { margin: 0; }
.bp-close { display: none; background: none; border: 1px solid var(--line-2); color: var(--text); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; }

.bp-mock {
  --p-bg: #0b1020; --p-surface: #151c33; --p-primary: #f0b54a; --p-accent: #5c93d2; --p-text: #e9ecf4;
  margin: 16px 0 18px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2);
  transition: box-shadow .4s;
}
.bp-chrome { display: flex; align-items: center; gap: 5px; padding: 7px 9px; background: #1a1f2e; }
.bp-chrome i { width: 7px; height: 7px; border-radius: 50%; background: #3a3f4f; }
.bp-chrome span { margin-left: 6px; font: 10.5px var(--font-mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-site { background: var(--p-bg); color: var(--p-text); padding: 10px; transition: background .6s, color .6s; min-height: 210px; }
.bp-site * { transition: background .6s, color .6s, border-color .6s; }
.bp-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.bp-nav b { font: 700 11px var(--font-head); color: var(--p-primary); margin-right: auto; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-nav span { width: 18px; height: 4px; border-radius: 2px; background: var(--p-text); opacity: .35; }
.bp-nav .bp-btn { width: 30px; height: 10px; border-radius: 5px; background: var(--p-primary); opacity: 1; }
.bp-hero { padding: 14px 10px; border-radius: 8px; background: linear-gradient(135deg, var(--p-surface), color-mix(in srgb, var(--p-accent) 25%, var(--p-surface))); margin-bottom: 10px; }
.bp-hero .l1 { height: 8px; width: 70%; border-radius: 4px; background: var(--p-text); opacity: .85; margin-bottom: 6px; }
.bp-hero .l2 { height: 5px; width: 50%; border-radius: 3px; background: var(--p-text); opacity: .4; margin-bottom: 10px; }
.bp-hero .bp-cta { display: inline-block; width: 46px; height: 12px; border-radius: 6px; background: var(--p-primary); }
.bp-blocks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bp-block {
  display: flex; align-items: center; gap: 5px; padding: 6px 7px; border-radius: 6px;
  background: var(--p-surface); border: 1px solid color-mix(in srgb, var(--p-text) 12%, transparent);
  font: 500 9.5px var(--font-head); color: var(--p-text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  animation: pop-in .4s var(--ease) both;
}
.bp-block::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--p-accent); flex-shrink: 0; }
.bp-block.more { justify-content: center; color: var(--p-primary); }
.bp-block.more::before { display: none; }

.bp-estimate { padding: 16px; border-radius: 16px; background: linear-gradient(135deg, rgba(240,181,74,.12), rgba(92,147,210,.08)); border: 1px solid rgba(240,181,74,.25); }
.bp-estimate .lbl { font: 500 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.bp-range { font: 700 clamp(1.4rem, 2.2vw, 1.7rem)/1.15 var(--font-head); color: #fff; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.bp-rec, .bp-weeks { color: var(--muted); font-size: .86rem; }
.bp-checks { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 7px; font-size: .9rem; }
.bp-checks li { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.bp-checks li span { margin-left: auto; font: 12px var(--font-mono); color: var(--muted); max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-checks li.ok { color: var(--text); }
.bp-checks li.ok i { color: var(--ok); }
.bp-go { width: 100%; justify-content: center; }
.bp-note { color: var(--muted); font-size: .78rem; margin: 12px 0 0; text-align: center; }

.bp-toggle { display: none; }

@media (max-width: 1080px) {
  .studio-layout { grid-template-columns: 1fr; }
  .blueprint {
    position: fixed; z-index: 1050; left: 0; right: 0; bottom: 0; top: auto;
    max-height: 86vh; border-radius: 24px 24px 0 0;
    transform: translateY(105%); transition: transform .45s var(--ease);
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
  body.bp-open .blueprint { transform: none; }
  body.bp-open { overflow: hidden; }
  .bp-close { display: grid; place-items: center; }
  .bp-toggle {
    position: fixed; z-index: 1040; left: 12px; right: 12px; bottom: 12px;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px 12px 18px; border-radius: 18px; cursor: pointer;
    background: rgba(10, 15, 30, .97); border: 1px solid rgba(240,181,74,.4); color: var(--text);
    box-shadow: 0 20px 40px -14px rgba(0,0,0,.9), 0 0 30px -14px var(--gold-glow);
    font: inherit; text-align: left;
    padding-bottom: calc(12px + env(safe-area-inset-bottom) * .5);
  }
  .bp-toggle .t-lbl { font: 500 10.5px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
  .bp-toggle .t-val { font: 700 15px var(--font-head); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bp-toggle .t-open { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; background: var(--gold); color: #120c00; font: 600 13px var(--font-head); }
  .bp-toggle.bump { animation: gulp .45s var(--ease); }
  .studio-page .site-footer { padding-bottom: 100px; }
}

/* ---------- Compile overlay ---------- */
.compile {
  position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 16px;
  background: rgba(3, 4, 9, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade-in .3s both;
}
.compile[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } }
.compile-box { width: min(560px, 100%); border-radius: 16px; overflow: hidden; background: #070a14; border: 1px solid rgba(240,181,74,.35); box-shadow: 0 0 80px -20px var(--gold-glow); }
.compile-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: rgba(255,255,255,.04); border-bottom: 1px solid var(--line); }
.compile-bar i { width: 9px; height: 9px; border-radius: 50%; background: #3a3f4f; }
.compile-bar i:nth-child(1) { background: #ff5f57; } .compile-bar i:nth-child(2) { background: #febc2e; } .compile-bar i:nth-child(3) { background: #28c840; }
.compile-bar span { margin-left: 8px; font: 12px var(--font-mono); color: var(--muted); }
.compile-log { margin: 0; padding: 18px; min-height: 210px; font: 13px/1.85 var(--font-mono); color: var(--muted); white-space: pre-wrap; }
.compile-log .ok { color: var(--ok); } .compile-log .k { color: var(--gold); }
.compile-progress { height: 3px; background: var(--line); }
.compile-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-2), var(--gold)); box-shadow: 0 0 12px var(--gold); transition: width .5s var(--ease); }

/* ---------- Result: the quote document ---------- */
.quote-result { padding: 30px 0 120px; position: relative; z-index: 1; scroll-margin-top: calc(var(--header-h) + 16px); }
.quote-result:focus { outline: none; }
.quote-doc {
  max-width: 860px; margin: 0 auto; border-radius: 26px; overflow: hidden;
  background: rgba(10, 15, 30, .92); border: 1px solid rgba(240,181,74,.35);
  box-shadow: 0 50px 100px -40px rgba(0,0,0,.95), 0 0 80px -40px var(--gold-glow);
  animation: doc-in 1s var(--ease) both;
}
@keyframes doc-in { from { opacity: 0; transform: translateY(40px) scale(.97); } }
.qd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; padding: clamp(22px, 4vw, 36px); background: linear-gradient(135deg, rgba(240,181,74,.14), transparent 60%); border-bottom: 1px solid var(--line); }
.qd-head img { width: 150px; height: auto; margin-bottom: 14px; }
.qd-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.qd-ref { text-align: right; font: 13px/1.7 var(--font-mono); color: var(--muted); }
.qd-ref b { display: block; color: var(--gold); font-size: 15px; }
@media (max-width: 640px) { .qd-ref { text-align: left; } }
.qd-body { padding: clamp(22px, 4vw, 36px); }
.qd-to { color: var(--muted); margin-bottom: 22px; }
.qd-to b { color: #fff; }
.qd-tiles { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; margin-bottom: 26px; }
@media (max-width: 640px) { .qd-tiles { grid-template-columns: 1fr; } }
.qd-tile { padding: 16px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); }
.qd-tile.main { border-color: rgba(240,181,74,.4); background: linear-gradient(135deg, rgba(240,181,74,.14), rgba(240,181,74,.02)); }
.qd-tile .lbl { font: 500 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.qd-tile.main .lbl { color: var(--gold); }
.qd-tile .v { font: 700 1.35rem/1.25 var(--font-head); color: #fff; margin-top: 6px; }
.qd-tile.main .v { font-size: clamp(1.4rem, 3vw, 1.8rem); }
.qd-table { width: 100%; border-collapse: collapse; margin-bottom: 22px; font-size: .95rem; }
.qd-table th { text-align: left; font: 500 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 0 10px; border-bottom: 1px solid var(--line-2); }
.qd-table th:last-child, .qd-table td:last-child { text-align: right; white-space: nowrap; }
.qd-table td { padding: 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.qd-table td small { display: block; color: var(--muted); font-size: .8rem; }
.qd-look { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 22px; }
.qd-look .sw { display: flex; gap: 6px; }
.qd-look .sw span { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); }
.qd-hint { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--blue-soft); border: 1px solid rgba(92,147,210,.3); color: #cfe0f5; font-size: .9rem; margin-bottom: 18px; }
.qd-status { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; margin-bottom: 18px; font-size: .95rem; }
.qd-status i { font-size: 20px; }
.qd-status.ok { background: rgba(61,220,151,.1); border: 1px solid rgba(61,220,151,.35); color: #b6f5d8; }
.qd-status.warn { background: rgba(254,188,46,.1); border: 1px solid rgba(254,188,46,.35); color: #ffe3a3; }
.qd-status a { color: #fff; text-decoration: underline; }
.qd-disclaimer { color: var(--muted); font-size: .82rem; margin-bottom: 22px; }
.qd-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 520px) { .qd-actions .btn { width: 100%; justify-content: center; } }

/* ---------- Print: just the quote, on white ---------- */
/* Only the quote is printed (display:none removes everything else from the
   flow, so there are no blank pages) and it switches to a light, ink-friendly
   scheme. None of this affects the page on screen. */
@media print {
  @page { size: A4; margin: 12mm; }
  html, body.studio-page { background: #fff !important; color: #1b1f2a; }
  body.studio-page::before { display: none !important; }
  body.studio-page > *:not(main) { display: none !important; }
  body.studio-page main > *:not(#result) { display: none !important; }
  body.studio-page main, .quote-result, .quote-result .container { padding: 0 !important; margin: 0 !important; max-width: none !important; overflow: visible !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .quote-doc {
    --text: #1b1f2a; --muted: #5b6475; --line: #e3e6ee; --line-2: #d3d8e2;
    max-width: none; color: var(--text); background: #fff;
    border: 0; border-radius: 0; box-shadow: none; animation: none; overflow: visible;
  }
  .quote-doc h2, .quote-doc b, .qd-tile .v, .qd-table td { color: #111 !important; }
  .qd-head { padding: 22px 26px; background: #faf5e9 !important; border-bottom-color: var(--line-2); border-radius: 12px; }
  .qd-head img { width: 140px; filter: brightness(.72) saturate(1.2); }
  .qd-ref, .qd-to, .qd-disclaimer, .qd-table td small, .qd-tile .lbl, .qd-table th { color: var(--muted) !important; }
  .qd-ref b, .qd-tile.main .lbl { color: #9a6a12 !important; }
  .qd-body { padding: 22px 26px; }
  .qd-tiles { grid-template-columns: 1.4fr 1fr 1fr !important; }
  .qd-tile { background: #f6f7fa; border-color: var(--line-2); }
  .qd-tile.main { background: #fff6e2; border-color: #ecd096; }
  .qd-hint { background: #eef4fb; border-color: #cddcf0; color: #2c4a6e; }
  .qd-look .sw span { border-color: #c9ced9; }
  .qd-table tr, .qd-tile, .qd-hint, .qd-look { break-inside: avoid; }
  .qd-actions, .qd-status { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .brain-canvas.ready { opacity: .5; }
}

/* Over the always-animating brain canvas a blurred header would be re-rendered
   every frame; a near-solid header looks the same and costs nothing. */
.studio-page .site-header { background: rgba(5, 7, 13, .94) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
