:root {
  --paper: #FBFAF7;
  --card: #FFFFFF;
  --ink: #17181B;
  --ink-2: #5A5F66;
  --ink-3: #6A7079;
  --line: #E6E3DC;
  --brand: #C4202B;
  --brand-ink: #8E1219;
  --sun: #F2B92C;
  --sky: #1E5AA8;
  --leaf: #237841;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23,24,27,.05), 0 12px 32px -18px rgba(23,24,27,.22);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

/* the id selectors below beat the UA [hidden] rule, so make it explicit */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; max-width: 100%; }
svg { max-width: 100%; }
svg[viewBox] { height: auto; }
#result > *, .block > *, .viewer-card, .info, .steps, .step { min-width: 0; max-width: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand); }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- header ---------- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: rgba(251,250,247,.9);
  backdrop-filter: saturate(1.2) blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.site-head .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: -.015em; font-size: 17px;
  color: var(--ink); text-decoration: none;
}
.brand .mark { width: 26px; height: 26px; display: block; }
.brand span b { color: var(--brand); }
.site-head nav { margin-left: auto; display: flex; gap: 22px; font-size: 14px; }
@media (max-width: 560px) {
  .site-head .wrap { gap: 12px; }
  .site-head nav { gap: 14px; font-size: 13px; }
  .site-head nav a:last-child { display: none; }
  .brand span { font-size: 16px; }
  h1 { font-size: 34px; }
  .hero { padding-top: 34px; }
  .promptbar { border-radius: 16px; padding: 10px; flex-direction: column; gap: 8px; }
  .promptbar input { padding: 4px 6px; }
  .promptbar button { width: 100%; padding: 12px; }
  .lede { font-size: 16px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
.site-head nav a { color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.site-head nav a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding: 58px 0 26px; position: relative; }
.hero-photo {
  position: absolute; top: -18px; right: -4vw; bottom: 0; width: min(54vw, 700px);
  height: calc(100% + 18px); object-fit: cover; object-position: 70% center;
  z-index: 0; opacity: .95; pointer-events: none;
}
/* paper-coloured veil so the headline and the small print stay readable over the photo */
.hero-veil {
  position: absolute; top: -18px; right: -4vw; bottom: 0; width: min(54vw, 700px);
  height: calc(100% + 18px); z-index: 0; pointer-events: none;
  background:
    linear-gradient(90deg, var(--paper) 0%, rgba(251,250,247,.55) 26%, rgba(251,250,247,0) 52%),
    linear-gradient(0deg, var(--paper) 0%, rgba(251,250,247,0) 22%),
    linear-gradient(180deg, var(--paper) 0%, rgba(251,250,247,0) 14%);
}
.hero > *:not(.hero-photo):not(.hero-veil) { position: relative; z-index: 1; }
@media (max-width: 900px) { .hero-photo { display: none; } }
@media (min-width: 1180px) {
  /* bleed the photo to the viewport edge instead of stopping at the content width */
  .hero-photo, .hero-veil { right: calc((100vw - 1120px) / -2 - 2px); }
}

.kit-photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; margin-bottom: 12px; }

.band { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 28px; align-items: center; padding: 34px 0 8px; }
.band img { width: 100%; height: 100%; max-height: 320px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
@media (max-width: 780px) { .band { grid-template-columns: minmax(0, 1fr); } .band img { max-height: 220px; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 14px;
}
h1 {
  font-size: clamp(30px, 4.6vw, 50px);
  line-height: 1.05;
  letter-spacing: -.035em;
  margin: 0 0 14px;
  max-width: 16ch;
}
.lede { font-size: 18px; color: var(--ink-2); max-width: 58ch; margin: 0 0 26px; }

.promptbar {
  display: flex; gap: 8px; background: var(--card);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 7px 7px 18px; box-shadow: var(--shadow);
  max-width: 680px;
}
.promptbar .prompt-field { position: relative; flex: 1 1 auto; display: flex; }
.promptbar textarea {
  flex: 1 1 auto; width: 100%; resize: none; overflow: auto; min-height: 48px; max-height: 160px;
  border: 0; background: transparent; font: inherit; line-height: 1.35; color: inherit;
  padding: 10px 64px 10px 12px; outline: none;
}
.promptbar .prompt-count {
  position: absolute; right: 10px; bottom: 8px; font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-3); pointer-events: none;
}
.promptbar .prompt-count.over { color: #b3261e; }
.promptbar input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16.5px; color: var(--ink); min-width: 0;
}
.promptbar input::placeholder { color: var(--ink-3); }
.promptbar button {
  border: 0; border-radius: 999px; background: var(--ink); color: #fff;
  font: inherit; font-weight: 600; padding: 11px 22px; cursor: pointer;
  transition: transform .08s ease, background .15s ease;
}
.promptbar button:hover { background: var(--brand); }
.promptbar button:active { transform: scale(.98); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; max-width: 720px; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  border-radius: 999px; padding: 6px 13px; font-size: 13.5px; cursor: pointer;
  transition: all .14s ease;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); transform: translateY(-1px); }

/* ---------- result ---------- */
#result { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 22px; padding: 26px 0 10px; }
@media (max-width: 860px) { #result { grid-template-columns: minmax(0, 1fr); } }
.viewer-card, .info { min-width: 0; }

.viewer-card > div > svg, .viewer-card svg { max-width: 100%; max-height: 560px; height: auto; }
.viewer-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
#viewer { cursor: grab; touch-action: none; display: flex; justify-content: center; padding: 6px; overflow: hidden; }
#viewer:active { cursor: grabbing; }
/* thinking bar */
.think { width: 100%; max-width: 560px; }
.think-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.think-title { font-weight: 600; }
.think-time { font-variant-numeric: tabular-nums; color: var(--muted, #8a9098); }
.think-stages { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 8px; padding: 0; font-size: 13px; color: var(--muted, #8a9098); }
.think-stages li::before { content: '\25CB'; margin-right: 5px; font-size: 10px; }
.think-stages li.is-on { color: var(--ink, #17181b); }
.think-stages li.is-on::before { content: '\25CF'; color: #c4202b; }
.think-stages li.is-done::before { content: '\2713'; color: #2e7d32; }
.think-stages li.is-fail::before { content: '\2715'; color: #b3261e; }
/* A stage that reports what it found ("4 images, chose wikimedia/…") wraps onto its own line under
   its label: the detail is the proof, and truncating it would make it decoration. */
.think-stages li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; max-width: 100%; }
.think-detail { flex: 1 1 100%; margin-left: 15px; font-size: 12px; opacity: .78; font-variant-numeric: tabular-nums; }
.think-track { height: 3px; border-radius: 3px; background: rgba(23,24,27,.10); overflow: hidden; }
.think-fill { display: block; height: 100%; width: 8%; background: #c4202b; border-radius: 3px; transition: width .18s ease-out; }

/* The trace under the model: the same stage list the API returned, plus the judge's score, the
   geometry hash and the photograph's licence. */
.design-trace { margin: 12px 0 16px; padding: 12px 14px; border: 1px solid rgba(23,24,27,.10); border-radius: 10px; background: #fff; font-size: 13px; }
.trace-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 8px; }
.trace-score { color: #2e7d32; font-weight: 600; font-variant-numeric: tabular-nums; }
.trace-hash { margin-left: auto; font-size: 11px; color: #8a9098; background: rgba(23,24,27,.05); padding: 1px 5px; border-radius: 4px; }
.trace-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.trace-list li { display: grid; grid-template-columns: 148px 1fr auto; gap: 10px; align-items: baseline; color: #5a5f66; }
.trace-list li.is-fail .t-stage { color: #b3261e; }
.t-ms { font-variant-numeric: tabular-nums; color: #8a9098; font-size: 12px; }
.t-detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trace-credit { margin: 8px 0 0; font-size: 12px; color: #8a9098; }
.trace-credit a { color: inherit; text-decoration: underline; }
@media (max-width: 560px) { .trace-list li { grid-template-columns: 1fr auto; } .t-detail { grid-column: 1 / -1; white-space: normal; } }

#viewer svg { display: block; width: 100%; max-width: 100%; height: auto; }

/* A slow breathing shadow under the model: it reads as studio lighting rather than a gimmick, and
   stops entirely for anyone who asked for reduced motion. */
/* Heartbeat: two quick beats, then rest — reads as the model being alive rather than a loading
   spinner. Small enough that it never distracts from the build itself. */
@keyframes heartbeat {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 8px 16px rgba(23,24,27,0.12)); }
  6%       { transform: scale(1.012); filter: drop-shadow(0 14px 26px rgba(23,24,27,0.20)); }
  12%      { transform: scale(1); filter: drop-shadow(0 8px 16px rgba(23,24,27,0.12)); }
  18%      { transform: scale(1.008); filter: drop-shadow(0 12px 22px rgba(23,24,27,0.17)); }
  26%, 100%{ transform: scale(1); filter: drop-shadow(0 8px 16px rgba(23,24,27,0.12)); }
}
#viewer svg { animation: heartbeat 2.6s ease-in-out infinite; transform-origin: 50% 60%; }
@media (prefers-reduced-motion: reduce) { #viewer svg { animation: none !important; } }
@media (prefers-reduced-motion: reduce) { #viewer svg { animation: none; } }
.viewer-tools {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px;
  border-top: 1px solid var(--line); background: #FCFBF9;
}
.tool {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 8px; padding: 6px 11px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.tool:hover { color: var(--ink); border-color: var(--ink-3); }
.tool.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

.info h2 { font-size: 26px; letter-spacing: -.02em; margin: 2px 0 6px; }
.info .meta { color: var(--ink-2); font-size: 14.5px; margin: 0 0 18px; }
.stats { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats li {
  background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px;
}
.stats .k { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.stats .v { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }

/* The piece count the model actually reached, as a figure rather than a footnote. */
.pieces-figure {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 12px 14px; border-radius: 12px;
  background: #F4F1EA; border: 1px solid var(--line);
}
.pieces-figure b { font-size: 34px; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pieces-figure span { font-size: 13px; color: var(--ink-2); }

/* The requirement checklist: one row per detail the prompt asked for. */
.requirements { margin: 0 0 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.req-title {
  font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3);
  margin: 0 0 10px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.req-title .req-score { text-transform: none; letter-spacing: 0; color: var(--ink-2); font-size: 12.5px; }
.req-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.req { display: grid; grid-template-columns: 86px 1fr; gap: 10px; align-items: start; }
.req-tag {
  font: 700 9.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em;
  text-align: center; border-radius: 4px; border: 1px solid currentColor; padding: 1px 0;
}
.req.is-pass .req-tag { color: #166a3a; background: #EAF5EE; }
.req.is-fail .req-tag { color: #b3261e; background: #FBECEB; }
.req.is-unverified .req-tag { color: #8a6212; background: #FBF3E3; }
.req-body { display: flex; flex-direction: column; gap: 2px; }
.req-body b { font-size: 14px; font-weight: 600; }
.req-body small { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.req-body em { font-style: normal; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.req-note { font-size: 12.5px; color: var(--ink-3); margin: 12px 0 0; line-height: 1.45; }
.paywall-short { font-size: 13px; margin: -4px 0 12px; color: var(--ink-2); }
.paywall-short b { color: var(--ink); }

.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 10px; padding: 10px 15px; font-size: 14.5px; font-weight: 600;
  text-decoration: none; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
  font-family: inherit;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); color: #fff; }
.btn:hover { border-color: var(--ink-3); }

.kit {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  background: linear-gradient(180deg, #FFFDF7, #FFF8EA);
}
.kit h3 { margin: 0 0 6px; font-size: 15.5px; }
.kit p { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.kit .price { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.kit .price small { font-size: 12.5px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }

.adslot {
  margin-top: 18px; border: 1px dashed var(--line); border-radius: 10px;
  min-height: 132px; display: grid; place-items: center; color: var(--ink-3);
  font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase;
}
/* an empty dashed box reads as unfinished: only show the slot once an ad unit is configured */
.adslot:empty, .adslot[hidden] { display: none; }

/* ---------- sections ---------- */
section.block { padding: 40px 0 8px; }
h2.section { font-size: 24px; letter-spacing: -.02em; margin: 0 0 6px; }
p.section-sub { color: var(--ink-2); margin: 0 0 20px; max-width: 62ch; }

#parts-body { overflow-x: auto; }
table.parts { width: 100%; min-width: 420px; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 14.5px; }
table.parts th { text-align: left; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FCFBF9; }
table.parts td { padding: 9px 14px; border-bottom: 1px solid #F2EFE9; vertical-align: middle; }
table.parts tr:last-child td { border-bottom: 0; }
table.parts tfoot td { background: #FCFBF9; font-weight: 600; border-top: 1px solid var(--line); }
td.num { font-variant-numeric: tabular-nums; font-weight: 650; width: 64px; }
td.col { color: var(--ink-2); }
.pid { color: var(--ink-3); font: 12px var(--mono); }
.pname { font-weight: 550; }
.sw { display: inline-block; width: 13px; height: 13px; border-radius: 3px; border: 1px solid rgba(0,0,0,.22); vertical-align: -2px; margin-right: 6px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: minmax(0, 1fr); } }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.step header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.stepnum { font-weight: 700; font-size: 14px; }
.steplayer { font-size: 12px; color: var(--ink-3); }
.stepart { display: flex; justify-content: center; }
.stepart svg { width: 100%; max-width: 100%; height: auto; }
.stepcallout { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12.5px; color: var(--ink-2); }
.stepcallout li { display: flex; align-items: center; gap: 4px; }
/* manual plan additions: real part thumbnails, the elevation dial and the step total */
.th { display: inline-block; flex: none; }
.stepside { display: grid; gap: 10px; margin-top: 6px; }
.stepside .dial { align-self: flex-start; }
.steptotal { font-size: 12px; color: var(--ink-3); }
.fits { margin: 0; font-size: 12.5px; font-weight: 600; }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 760px) { .how { grid-template-columns: 1fr; } }
.how article { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.how h3 { margin: 0 0 6px; font-size: 16px; }
.how p { margin: 0; color: var(--ink-2); font-size: 14.5px; }

.note { font-size: 13px; color: var(--ink-2); margin-top: 10px; }

footer.site {
  margin-top: 60px; border-top: 1px solid var(--line); padding: 28px 0 46px;
  font-size: 13px; color: var(--ink-3);
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
footer.site a { color: var(--ink-2); }
footer.site .spacer { flex: 1 }

.loading { color: var(--ink-3); font-size: 14px; padding: 24px 0; }
.err { background: #FFF1F1; border: 1px solid #F3C9C9; color: #8E1219; border-radius: 10px; padding: 12px 14px; font-size: 14.5px; }

/* print: manual pages only */
@media print {
  body { background: #fff; }
  .site-head, .hero, #result, #parts, #how, footer.site, .chips, h2.section, p.section-sub { display: none !important; }
  #manual { display: block !important; }
  #manual .steps { display: block; }
  #manual .step { break-after: page; page-break-after: always; border: 0; padding: 0; }
  #manual .stepart svg { width: 92mm; height: auto; }
  #manual .step header { font-size: 12pt; }
  #manual .stepcallout { font-size: 9pt; }
  #manual::before { content: attr(data-title); display: block; font-size: 16pt; font-weight: 700; margin-bottom: 6mm; }
}

/* AI design lock + loading */
.lock {
  margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg,#FFFDF7,#FFF4E3); padding: 20px;
}
.lock strong { display: block; font-size: 16px; margin-bottom: 6px; }
.lock p { margin: 0 0 14px; color: var(--ink-2); font-size: 14.5px; }

#result, #parts, #manual { scroll-margin-top: 84px; }

/* ---------- colour lab, recents, daily ---------- */
.colour-lab-wrap { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); background: #FCFBF9; flex-wrap: wrap; }
.colour-lab-label { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.colour-lab { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch {
  width: 24px; height: 24px; border-radius: 6px; border: 1px solid rgba(23,24,27,.18);
  cursor: pointer; padding: 0; transition: transform .1s ease, box-shadow .1s ease;
}
.swatch:hover { transform: translateY(-1px); }
.swatch.is-on { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }

#recent { margin-top: 10px; align-items: center; }
.recent-label { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-right: 4px; }
.muted { color: var(--ink-3); font-variant-numeric: tabular-nums; }

#daily { padding: 22px 0 4px; }
.daily-card {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  background: linear-gradient(180deg,#FFFDF7,#FFF8EA);
}
.daily-card strong { font-size: 15px; }
.daily-card .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); display: block; }

/* ---------- faq ---------- */
.faq { max-width: 74ch; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 15.5px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--ink-3); font-weight: 400; }
.faq details[open] summary::after { content: '−'; }
.faq p { margin: 10px 0 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }

/* ---------- piece budget + bucket ---------- */
.budget-field { display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 0 12px; border-left: 1px solid var(--line); }
.budget-field label { font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.budget-field input {
  width: 74px; border: 0; padding: 0; font: inherit; font-size: 15px; font-weight: 600;
  background: transparent; color: var(--ink); outline: none; -moz-appearance: textfield;
}
.budget-field input::-webkit-outer-spin-button, .budget-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.budget-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.budget-hint { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-right: 2px; }
.budget-row .chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

.bucket { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.bucket-label { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.bucket-count b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bucket-bar { flex: 1; min-width: 120px; height: 6px; background: #EAE6DE; border-radius: 99px; overflow: hidden; }
.bucket-bar i { display: block; height: 100%; background: var(--red); border-radius: 99px; }

.manual-locked { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: 22px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 18px; max-width: 820px; }
.manual-cover { background: #FCFBF9; border-radius: 10px; padding: 10px; display: flex; justify-content: center; }
.manual-copy h3 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.01em; }
.manual-copy p { margin: 0 0 10px; color: var(--ink-2); font-size: 14.5px; }
.manual-facts { font-size: 12.5px !important; color: var(--ink-3) !important; }
.manual-unavailable { font-size: 12.5px !important; color: var(--ink-3) !important; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #faf9f6; }
@media (max-width: 720px) { .manual-locked { grid-template-columns: minmax(0,1fr); } }

/* ---------- plans, billing toggle, account meter, tweak bar ---------- */
.pricing-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.billing-toggle { display: flex; gap: 6px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 99px; }
.billing-toggle .chip { border: 0; background: transparent; padding: 7px 13px; }
.billing-toggle .chip.is-on { background: var(--ink); color: #fff; }
.billing-toggle .chip.is-on .chip-save { background: rgba(255,255,255,.18); color: #fff; }
.chip-save { margin-left: 5px; font-size: 10.5px; letter-spacing: .03em; background: #F6E7E8; color: var(--red); border-radius: 99px; padding: 1px 7px; }

.pricing-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 18px; align-items: stretch; }
@media (max-width: 1040px) { .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .pricing-grid { grid-template-columns: minmax(0, 1fr); } }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 15px; }
.plan-card.is-featured { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.plan-card h3 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.plan-price { font-size: 27px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 13px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; }
.plan-sub { font-size: 12px; color: var(--red); min-height: 16px; }
.plan-card ul { margin: 2px 0 10px; padding-left: 15px; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.plan-card li { margin: 3px 0; }
.plan-card .btn { margin-top: auto; width: 100%; text-align: center; }
.plan-badge { position: absolute; top: -9px; right: 12px; background: var(--red); color: #fff; font-size: 10.5px; letter-spacing: .04em; padding: 2px 8px; border-radius: 99px; }

.bucket-pdfs { color: var(--ink-3); }
.bucket-plan { margin-left: auto; font-size: 12.5px; color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--line); }
.bucket-plan:hover { color: var(--ink); }

.tweak-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.tweak-label { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.tweak-bar input { flex: 1; min-width: 200px; font: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.tweak-bar .btn { padding: 9px 14px; font-size: 13.5px; }
.tweak-note { font-size: 11.5px; color: var(--ink-3); }
.tweak-note code { font-size: 11px; background: #F2EFE9; border-radius: 4px; padding: 1px 5px; }

.paywall { margin-top: 10px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.paywall .btn { padding: 7px 12px; font-size: 13px; }

.bucket-credits { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bucket-k { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.paywall-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.paywall-stack .note { margin: 2px 0 0; }

/* ---------- build job panel: ten real stages, each with its own milliseconds ---------- */
/* The bar is the server's count of finished stages, never a clock. A stage that is still running is
   named with the detail the engine wrote (a build attempt, a repair count), and a stage that ran out
   of budget says "degraded" instead of disappearing. */
.think[data-job] .think-meta { display: flex; gap: 10px; align-items: baseline; font-size: 12px; color: var(--muted, #8a9098); font-variant-numeric: tabular-nums; }
.think[data-job] .think-stage { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.think[data-job] .think-stages { display: block; margin: 12px 0 10px; }
.think[data-job] .think-stages li {
  display: grid; grid-template-columns: 12px 1fr auto; grid-template-areas: "dot label ms" ". detail detail";
  gap: 1px 8px; padding: 3px 0; font-size: 13px; align-items: baseline;
}
.think[data-job] .think-stages li::before { content: none; }
.think[data-job] .think-dot { grid-area: dot; width: 7px; height: 7px; border-radius: 50%; border: 1px solid rgba(23,24,27,.28); margin-top: .45em; }
.think[data-job] .think-label { grid-area: label; }
.think[data-job] .think-ms { grid-area: ms; font-size: 12px; color: var(--muted, #8a9098); font-variant-numeric: tabular-nums; }
.think[data-job] .think-detail { grid-area: detail; margin-left: 0; font-size: 12px; opacity: .72; }
.think[data-job] li.is-pending { color: var(--muted, #8a9098); }
.think[data-job] li.is-on { color: var(--ink, #17181b); font-weight: 600; }
.think[data-job] li.is-on .think-dot { background: #c4202b; border-color: #c4202b; animation: think-pulse 1.15s ease-in-out infinite; }
.think[data-job] li.is-done .think-dot { background: #2e7d32; border-color: #2e7d32; }
.think[data-job] li.is-degraded .think-dot { background: #b26a00; border-color: #b26a00; }
.think[data-job] li.is-degraded .think-label::after { content: ' (degraded)'; font-weight: 400; font-size: 11px; color: #b26a00; }
.think[data-job] li.is-fail .think-dot { background: #b3261e; border-color: #b3261e; }
.think[data-job] .think-note { margin: 8px 0 0; font-size: 12px; color: var(--muted, #8a9098); }
@keyframes think-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.7); opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .think[data-job] li.is-on .think-dot { animation: none; } }
