/* ============================================================
   NHÀ TÔI — design system v4 "lacquer panel"
   The site is a lacquer panel: đen-cánh-gián ground, rice-paper
   working surface, one gold line that draws the house as the
   journey advances, one cinnabar action colour.
   Display: Fraunces (Vietnamese subset verified). Body: Be Vietnam Pro.
   Instrument class names are stable API for js/ — do not rename.
   ============================================================ */

:root {
  --bg: #F6EFDF;            /* rice paper */
  --bg-2: #EEE4CC;
  --panel: #FCF8EC;
  --deep: #241310;          /* lacquer ground (đen cánh gián) */
  --deep-2: #311B14;        /* raised lacquer panel */
  --ink: #2A1B12;
  --mut: #7B6A54;
  --mut-onlacquer: #C7B197; /* muted text on lacquer */
  --line: #E3D6BA;
  --line-2: #CDBB97;
  --line-onlacquer: #4A3226;
  --gold: #C09A4A;          /* gold leaf — lines on lacquer */
  --gold-ink: #8C6D2B;      /* gold on paper (small-text safe) */
  --lacquer: #A43A26;       /* cinnabar — THE action colour */
  --lacquer-deep: #832C1D;
  --pass: #4E7247;
  --pass-soft: #ECF1E4;
  --warn: #8C6D2B;
  --warn-soft: #F3EBD3;
  --fail: #96382A;
  --fail-soft: #F4E5DE;
  --display: "Fraunces", Georgia, serif;
  --body: "Be Vietnam Pro", "Helvetica Neue", sans-serif;
  --max: 1120px;
  --pad: clamp(1.25rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 1.01rem; line-height: 1.72; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--gold-ink); color: var(--lacquer-deep); }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lacquer); outline-offset: 3px; }

.wrap { width: min(var(--max), calc(100% - var(--pad) * 2)); margin-inline: auto; }

h1, h2 { font-family: var(--display); font-optical-sizing: auto; font-weight: 560; line-height: 1.08; margin: 0; letter-spacing: -0.012em; }
h1 { font-size: clamp(2.25rem, 5vw, 4rem); }
h2 { font-size: clamp(1.55rem, 2.7vw, 2.2rem); line-height: 1.18; }
h3 { font-size: 1.1rem; font-family: var(--body); font-weight: 600; margin: 0; line-height: 1.4; }
p { margin: 0; }
.lede { font-size: 1.06rem; line-height: 1.78; color: var(--mut); max-width: 40rem; }
.en { display: block; font-size: 0.9em; color: var(--mut); font-family: var(--body); font-weight: 400; margin-top: 0.35em; }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.center .lede { margin-inline: auto; }

/* ---------- header: a strip of the lacquer panel, always present ---------- */
.titleblock { position: sticky; top: 0; z-index: 50; background: var(--deep); border-bottom: 1px solid var(--gold); }
.tb-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; width: min(var(--max), calc(100% - var(--pad) * 2)); margin-inline: auto; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand:hover { text-decoration: none; }
.seal { width: 34px; height: 34px; border-radius: 2px; background: var(--lacquer); flex: none; display: grid; place-items: center; color: var(--bg); font-family: var(--display); font-weight: 600; font-size: 0.92rem; font-style: italic; }
.brand-name { font-family: var(--display); font-style: italic; font-weight: 600; font-size: 1.28rem; line-height: 1; color: var(--bg); white-space: nowrap; }
.brand-tag { display: none; }

/* the journey IS the nav: five questions, truthful ticks */
.path { display: flex; align-items: baseline; gap: 0; flex-wrap: nowrap; min-width: 0; }
.path a, .path .is-here { color: var(--mut-onlacquer); text-decoration: none; font-size: 0.87rem; padding: 0.35rem 0; white-space: nowrap; border-bottom: 1.5px solid transparent; }
.path a:hover { color: var(--bg); border-bottom-color: var(--line-onlacquer); }
.path .is-here { color: var(--bg); font-weight: 600; border-bottom-color: var(--gold); }
.path .is-done { color: var(--gold); }
.path .sep { color: var(--line-onlacquer); margin: 0 0.55rem; font-size: 0.8rem; }
.path .aside { margin-left: 1.1rem; padding-left: 1.1rem; border-left: 1px solid var(--line-onlacquer); }

.tb-right { display: flex; align-items: center; gap: 0.9rem; flex: none; }
.tb-cta { background: var(--lacquer); color: #fff !important; padding: 0.55rem 1.05rem; border-radius: 2px; text-decoration: none; font-weight: 500; font-size: 0.9rem; white-space: nowrap; }
.tb-cta:hover { background: var(--lacquer-deep); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-onlacquer); border-radius: 2px; padding: 0.35rem 0.7rem; cursor: pointer; color: var(--bg); font-size: 0.88rem; }
.lang-toggle { display: flex; border: 1px solid var(--line-onlacquer); border-radius: 2px; overflow: hidden; }
.lang-toggle button { background: none; border: none; padding: 0.32rem 0.7rem; font-size: 0.78rem; font-weight: 500; cursor: pointer; color: var(--mut-onlacquer); }
.lang-toggle button.is-on { background: var(--gold); color: var(--deep); }

/* ---------- question band: lacquer, asymmetric, the house draws here ---------- */
.qband { background: var(--deep); color: var(--bg); padding: clamp(2.6rem, 6vw, 4.6rem) 0 clamp(2.4rem, 5vw, 4rem); border-bottom: 1px solid var(--gold); }
.qband-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.qband h1 { color: var(--bg); }
.qband .lede { color: var(--mut-onlacquer); }
.qband .hint { color: var(--mut-onlacquer); }
.qband-copy { display: flex; flex-direction: column; gap: 1.25rem; align-items: flex-start; min-width: 0; }
.qband-copy .btn { margin-top: 0.4rem; }
.qband--tall { min-height: calc(88svh - 66px); display: flex; align-items: center; }
.qband--tall > .wrap { flex: none; width: min(var(--max), calc(100% - var(--pad) * 2)); margin-inline: auto; }
.qband .link-under { color: var(--bg); text-decoration-color: var(--gold); }
.qband .link-under:hover { color: #fff; }

/* the gold house drawing */
.nt-house { width: 100%; max-width: 430px; height: auto; display: block; margin-inline: auto; }
.nt-house path, .nt-house circle, .nt-house line { fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.nt-house .soft { opacity: 0.42; }
.nt-house .ghost { opacity: 0.16; }
.nt-house .dash { stroke-dasharray: 5 6; opacity: 0.5; }
.nt-house .seal-mark { fill: var(--lacquer); stroke: none; }
.nt-house .seal-mark-text { fill: var(--bg); stroke: none; font-family: var(--display); font-style: italic; font-weight: 600; }
.nt-house .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: nt-draw 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.35s forwards; }
@keyframes nt-draw { to { stroke-dashoffset: 0; } }
.nt-house-cap { text-align: center; font-size: 0.82rem; color: var(--mut-onlacquer); margin-top: 0.9rem; }

/* the five-stage strip on the front door (how the journey draws the house) */
.stage-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.4rem; align-items: end; }
.stage-strip a { text-decoration: none; display: flex; flex-direction: column; gap: 0.7rem; color: var(--ink); }
.stage-strip .nt-house { max-width: 100%; }
.stage-strip .nt-house path, .stage-strip .nt-house circle, .stage-strip .nt-house line { stroke: var(--gold-ink); }
.stage-strip .nt-house .seal-mark { fill: var(--lacquer); }
.stage-strip .s-name { font-size: 0.92rem; font-weight: 600; }
.stage-strip .s-q { font-size: 0.85rem; color: var(--mut); line-height: 1.55; }
.stage-strip .s-n { font-family: var(--display); font-size: 0.95rem; color: var(--gold-ink); }
.stage-strip a:hover .s-name { color: var(--lacquer-deep); }

/* ---------- retired chrome kept inert (old classes may linger in vault refs) ---------- */
.journey, .journey-label, .j-node, .j-sep, .steps, .step-pill { display: none !important; }
.eyebrow { font-size: 0.88rem; font-weight: 500; color: var(--gold-ink); }
.qband .eyebrow { color: var(--gold); }
.sample-flag { background: none; padding: 0; font-size: 0.84rem; color: var(--warn); font-style: italic; }
.qband .sample-flag { color: var(--gold); opacity: 0.85; }

/* ---------- sections ---------- */
.sheet { padding: clamp(3.2rem, 8vw, 5.4rem) 0; }
.sheet-alt { background: var(--bg-2); }
.sheet-ink { background: var(--deep); color: var(--bg); }
.sheet-ink .lede, .sheet-ink .en, .sheet-ink p { color: var(--mut-onlacquer); }
.sheet-ink h2 { color: var(--bg); }
.gold-rule { border: none; border-top: 1px solid var(--gold); opacity: 0.5; margin: 0; }

.hero-photo { overflow: hidden; margin: 0; border-bottom: 1px solid var(--gold); }
.hero-photo img { width: 100%; height: clamp(300px, 46vw, 560px); object-fit: cover; }
.photo-cap { display: none; }

/* ---------- buttons ---------- */
.btn { display: inline-block; border: none; cursor: pointer; border-radius: 2px; font-weight: 500; font-size: 1rem; padding: 0.85rem 1.6rem; text-align: center; text-decoration: none; }
.btn-primary { background: var(--lacquer); color: #fff; }
.btn-primary:hover { background: var(--lacquer-deep); color: #fff; }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-ink:hover { color: var(--bg); }
.btn-quiet { background: none; border: 1px solid var(--line-2); color: var(--mut); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.link-under { font-weight: 500; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 0.25em; }

/* ---------- numbered tool rows (index journey list) ---------- */
.tool-rows { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.tool-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 1.6rem; align-items: baseline; padding: 1.8rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.tool-row:hover { background: rgba(164, 58, 38, 0.03); text-decoration: none; }
.tool-row .n { font-family: var(--display); font-size: 1.5rem; color: var(--line-2); }
.tool-row:hover .n { color: var(--gold-ink); }
.tool-row h3 { font-size: 1.3rem; font-family: var(--display); font-weight: 600; margin-bottom: 0.3rem; }
.tool-row p { color: var(--mut); font-size: 0.96rem; max-width: 36rem; }
.tool-row .go { font-size: 0.92rem; font-weight: 500; color: var(--lacquer); white-space: nowrap; }

.process-line { display: flex; flex-wrap: wrap; gap: 0.4rem 2.2rem; counter-reset: pstep; padding: 0; margin: 0; }
.process-line li { list-style: none; counter-increment: pstep; font-size: 0.96rem; color: var(--ink); }
.process-line li::before { content: counter(pstep, decimal-leading-zero); font-size: 0.72rem; color: var(--gold-ink); margin-right: 0.55rem; font-weight: 600; }

/* ---------- boards (plan chooser) ---------- */
.board-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.board { background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 1.6rem; display: flex; flex-direction: column; gap: 0.6rem; text-decoration: none; }
.board .tag { font-size: 0.82rem; font-weight: 500; color: var(--mut); }
.board p { font-size: 0.94rem; line-height: 1.68; color: var(--mut); }
.board .go { margin-top: auto; font-weight: 500; font-size: 0.92rem; color: var(--lacquer); }
.board-empty { border: 1px dashed var(--line-2); background: transparent; }
.board.is-chosen { border-color: var(--gold-ink); box-shadow: inset 0 0 0 1px var(--gold-ink); }
a.board:hover { border-color: var(--gold-ink); }

.yes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.yes { border-top: 2px solid var(--gold-ink); padding-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.yes .k { font-size: 0.84rem; font-weight: 500; color: var(--mut); }
.yes p { font-size: 0.94rem; color: var(--mut); line-height: 1.7; }

/* ---------- FAQ ---------- */
.faq { max-width: 46rem; margin-inline: auto; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 0; font-weight: 500; font-size: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold-ink); }
.faq details[open] summary::after { content: "–"; }
.faq details .a { padding: 0 0 1.15rem; color: var(--mut); font-size: 0.95rem; line-height: 1.75; max-width: 42rem; }

/* ---------- tool pages ---------- */
.tool-head { padding: 2.6rem 0 1.6rem; }
.tool-head h1 { max-width: 36rem; }
.tool-grid { display: grid; grid-template-columns: 370px 1fr; gap: 2rem; align-items: start; padding-bottom: 4rem; }
.tool-grid.flip { grid-template-columns: 1fr 400px; }
.tool-col { display: flex; flex-direction: column; gap: 1.05rem; }

.canvas-panel { background: var(--panel); border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; }
.canvas-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--line); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--mut); text-transform: uppercase; font-weight: 500; }
.canvas-panel-head .num { color: var(--mut); }
.canvas-panel svg { display: block; width: 100%; height: auto; touch-action: none; }

.checks { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); overflow: hidden; }
.check-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 1rem; font-size: 0.92rem; font-weight: 500; border-bottom: 1px solid var(--line); transition: background 0.3s; }
.check-row:last-child { border-bottom: none; }
.check-row .dot { width: 9px; height: 9px; border-radius: 999px; background: var(--line-2); flex: none; }
.check-row .val { margin-left: auto; font-size: 0.8rem; color: var(--mut); font-weight: 400; white-space: nowrap; }
.check-row.is-pass { background: var(--pass-soft); }
.check-row.is-pass .dot { background: var(--pass); }
.check-row.is-fail { background: var(--fail-soft); }
.check-row.is-fail .dot { background: var(--fail); }
.check-row.is-warn { background: var(--warn-soft); }
.check-row.is-warn .dot { background: var(--warn); }
.addr-hit { text-align: left; background: var(--panel); border: 1px solid var(--line-2); border-radius: 2px; padding: 0.55rem 0.9rem; cursor: pointer; font-size: 0.92rem; }
.addr-hit:hover { border-color: var(--lacquer); }
.map-btn { width: 38px; height: 38px; border-radius: 3px; border: none; background: rgba(36, 19, 16, 0.85); color: #F6EFDF; font-size: 1.15rem; font-weight: 600; cursor: pointer; line-height: 1; }
.map-btn:hover { background: var(--lacquer); }

.result-bar { border-radius: 3px; padding: 1.1rem 1.3rem; display: flex; flex-direction: column; gap: 0.5rem; background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.result-bar .headline { font-weight: 600; font-size: 1.02rem; font-family: var(--display); }
.result-bar .sub { font-size: 0.87rem; color: var(--mut); line-height: 1.65; }
.result-bar.is-pass { background: #3E5A38; border-color: #3E5A38; color: #F1F5EC; }
.result-bar.is-pass .headline { color: #fff; }
.result-bar.is-pass .sub { color: #D7E2CE; }

.hint { font-size: 0.84rem; color: var(--mut); line-height: 1.65; }
.saved-note { display: none; background: var(--pass-soft); border: 1px solid var(--pass); border-radius: 3px; padding: 0.9rem 1.1rem; font-size: 0.9rem; }
.saved-note.show { display: block; }

.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.field label { font-weight: 500; font-size: 0.9rem; }
.field input, .field textarea { border: 1px solid var(--line-2); border-radius: 2px; background: var(--panel); padding: 0.7rem 0.85rem; font-size: 0.96rem; width: 100%; min-width: 0; }
.field input:focus, .field textarea:focus { border-color: var(--lacquer); outline: none; }

/* quote */
.q-line { display: flex; align-items: center; gap: 0.85rem; padding: 0.9rem 0.2rem; border-bottom: 1px solid var(--line); }
.q-line label { display: flex; align-items: center; gap: 0.85rem; cursor: pointer; flex: 1; font-weight: 500; font-size: 0.96rem; }
.q-line input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--lacquer); flex: none; }
.q-line .note { display: block; font-weight: 400; font-size: 0.84rem; color: var(--mut); }
.q-line .amt { font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
.q-line .amt .s { display: block; font-size: 0.62rem; letter-spacing: 0.04em; color: var(--warn); text-align: right; font-weight: 500; }
.q-line.is-base { border: 1px dashed var(--line-2); border-radius: 3px; padding: 1.1rem; margin-bottom: 0.6rem; background: var(--panel); }
.q-line.is-found { border-left: 3px solid var(--gold-ink); padding-left: 0.75rem; background: var(--warn-soft); }
.found-note { display: block; font-weight: 500; font-size: 0.82rem; color: var(--gold-ink); margin-top: 0.15rem; }

.summary-card { background: var(--deep); color: var(--bg); border: none; border-radius: 3px; padding: 1.7rem; display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 90px; }
.summary-card .k { font-size: 0.8rem; letter-spacing: 0.02em; color: var(--gold); font-weight: 500; }
.summary-total { font-family: var(--display); font-size: 1.8rem; font-weight: 500; line-height: 1.15; }
.summary-total small { font-size: 0.95rem; color: var(--mut-onlacquer); font-family: var(--body); }
.summary-rows { display: flex; flex-direction: column; gap: 0.5rem; border-top: 1px solid var(--line-onlacquer); padding-top: 0.9rem; }
.summary-rows .r { display: flex; justify-content: space-between; font-size: 0.88rem; color: var(--mut-onlacquer); gap: 1rem; }
.summary-rows .r b { color: var(--bg); font-weight: 600; }

/* money */
.equity-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 1.7rem; display: flex; flex-direction: column; gap: 1.25rem; }
.slider-field { display: flex; flex-direction: column; gap: 0.4rem; }
.slider-field .top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.slider-field label { font-weight: 500; font-size: 0.92rem; }
.slider-field output { font-weight: 600; font-size: 1.02rem; }
input[type="range"] { width: 100%; accent-color: var(--lacquer); height: 28px; cursor: pointer; }
.equity-bar { display: flex; width: 100%; height: 50px; border-radius: 2px; overflow: hidden; }
.equity-bar .seg { display: grid; place-items: center; font-size: 0.74rem; font-weight: 600; color: #fff; min-width: 0; overflow: hidden; white-space: nowrap; transition: flex-basis 0.15s linear; }
.seg-owing { background: #9A8A74; }
.seg-usable { background: var(--pass); }
.seg-buffer { background: var(--line-2); color: var(--mut); }
.equity-read { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--mut); }
.big-read { font-weight: 700; font-size: 1.5rem; color: var(--pass); }
.weekly-read { font-family: var(--display); font-weight: 500; font-size: 2rem; }

.pack-list { display: flex; flex-direction: column; }
.pack-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); font-weight: 500; font-size: 0.92rem; }
.pack-item .pk { width: 20px; height: 20px; border-radius: 999px; flex: none; display: grid; place-items: center; }
.pack-item.done .pk { background: var(--pass); }
.pack-item.done .pk::after { content: "✓"; color: #fff; font-size: 0.7rem; }
.pack-item.wait .pk { border: 1.5px dashed var(--gold-ink); }
.pack-item.you .pk { border: 1.5px solid var(--line-2); }
.pack-item .who { margin-left: auto; font-size: 0.72rem; letter-spacing: 0.03em; color: var(--mut); font-weight: 500; }

/* comfort + band */
.cf-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.cf-btn { border: 1px solid var(--line-2); background: var(--panel); border-radius: 2px; padding: 0.6rem 1.2rem; font-weight: 500; font-size: 0.93rem; cursor: pointer; color: var(--mut); }
.cf-btn:hover { border-color: var(--ink); color: var(--ink); }
.cf-btn.is-on { border-color: var(--lacquer); background: var(--fail-soft); color: var(--lacquer-deep); }
.band-card { display: none; border-radius: 3px; padding: 1.6rem 1.7rem; flex-direction: column; gap: 0.8rem; border: 1px solid var(--line-2); border-left: 3px solid var(--line-2); background: var(--panel); }
.band-card.show { display: flex; }
.band-card h3 { font-size: 1.2rem; font-family: var(--display); font-weight: 600; }
.band-card p { font-size: 0.94rem; line-height: 1.72; color: var(--mut); }
.band-card .band-tag { font-size: 0.8rem; font-weight: 500; color: var(--mut); }
.band-card.band-in { border-left-color: var(--pass); }
.band-card.band-maybe { border-left-color: var(--gold-ink); }
.band-card.band-not { border-left-color: var(--mut); }
.band-card .btn { align-self: flex-start; }

/* the aimed band statement (number page) — a fact with its conditions, never a total */
.aim-band { border: 1px solid var(--gold-ink); border-radius: 3px; padding: 1.4rem 1.6rem; display: flex; flex-direction: column; gap: 0.5rem; background: var(--panel); }
.aim-band .aim-figure { font-family: var(--display); font-size: 1.7rem; font-weight: 560; }
.aim-band .aim-cond { font-size: 0.9rem; color: var(--mut); line-height: 1.7; }

/* waitlist */
.waitlist { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; text-align: left; }
.waitlist form { display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: flex-start; }
.waitlist input { border: 1px solid var(--line-2); border-radius: 2px; background: var(--panel); padding: 0.8rem 1rem; font-size: 1rem; width: 8.5rem; letter-spacing: 0.08em; }
.waitlist input[type="text"] { width: 13rem; letter-spacing: normal; min-width: 0; }
.waitlist input:focus { border-color: var(--lacquer); outline: none; }

/* how page */
.tl { display: flex; flex-direction: column; max-width: 46rem; }
.tl-row { display: grid; grid-template-columns: 110px 1fr; gap: 1.4rem; padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.tl-when { font-size: 0.84rem; font-weight: 500; color: var(--gold-ink); padding-top: 0.25rem; }
.tl-dot { display: none; }
.tl-body h3 { margin-bottom: 0.25rem; font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.tl-body p { color: var(--mut); font-size: 0.94rem; }

.ledger { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.ledger th, .ledger td { text-align: left; padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger th { font-size: 0.78rem; letter-spacing: 0.02em; color: var(--mut); font-weight: 500; }
.ledger td:first-child { font-weight: 500; white-space: nowrap; }
.ledger .empty { color: var(--warn); font-size: 0.85rem; font-weight: 500; }

.doubt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem; text-align: left; }
.gate-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem 1.4rem; counter-reset: gate; padding: 0; margin: 0; }
.gate-list li { list-style: none; font-size: 0.9rem; color: var(--mut); padding: 0.45rem 0; border-bottom: 1px solid var(--line); display: flex; gap: 0.8rem; align-items: baseline; }
.gate-list li::before { counter-increment: gate; content: counter(gate, decimal-leading-zero); font-size: 0.72rem; font-weight: 600; color: var(--gold-ink); }

/* ---------- footer: the panel closes ---------- */
.foot { border-top: 1px solid var(--gold); padding: 3rem 0 2.6rem; margin-top: 3rem; background: var(--deep); color: var(--bg); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 2.5rem; align-items: start; }
.foot .brand-name { color: var(--bg); font-size: 1.15rem; }
.foot p { font-size: 0.88rem; color: var(--mut-onlacquer); line-height: 1.7; }
.foot-links { display: flex; flex-direction: column; gap: 0.45rem; }
.foot-links a { font-size: 0.9rem; text-decoration: none; color: var(--bg); }
.foot-links a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--gold); }
.foot .working { font-size: 0.78rem; color: #A08B72; }
.foot .nt-house { max-width: 150px; margin: 0 0 0.8rem; }

/* ---------- content splits ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.split-tight { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---------- motion ---------- */
.qband-copy > * { animation: rise-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.qband-copy > *:nth-child(1) { animation-delay: 0.05s; }
.qband-copy > *:nth-child(2) { animation-delay: 0.14s; }
.qband-copy > *:nth-child(3) { animation-delay: 0.24s; }
.qband-copy > *:nth-child(4) { animation-delay: 0.34s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-photo img { animation: photo-in 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s backwards; }
@keyframes photo-in { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.65s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.65s cubic-bezier(0.2, 0.8, 0.2, 1); transition-delay: var(--rd, 0s); }
.reveal.in { opacity: 1; transform: none; }
.btn { transition: background 0.18s, transform 0.18s; }
.btn:hover { transform: translateY(-1px); }
.tool-row, .board, .cf-btn { transition: background 0.2s, border-color 0.2s; }
.band-card.show { animation: band-pop 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes band-pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .qband-copy > *, .hero-photo img, .band-card.show { animation: none; }
  .nt-house .draw { animation: none; stroke-dashoffset: 0; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .equity-bar .seg { transition: none; }
}

@media print {
  .titleblock, .foot, .no-print, .qband { display: none !important; }
  body { background: #fff; }
  .tool-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; background: #fff; color: #000; border: 1px solid #000; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .path { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--deep); border-bottom: 1px solid var(--gold); flex-direction: column; align-items: flex-start; padding: 1rem var(--pad); gap: 0.55rem; z-index: 30; }
  .path.open { display: flex; }
  .path .sep { display: none; }
  .path a, .path .is-here { font-size: 1rem; padding: 0.3rem 0; }
  .path .aside { margin-left: 0; padding-left: 0; border-left: none; margin-top: 0.4rem; padding-top: 0.55rem; border-top: 1px solid var(--line-onlacquer); }
  .nav-toggle { display: block; }
}
@media (max-width: 960px) {
  .qband-grid { grid-template-columns: 1fr; gap: 2rem; }
  .qband-house { order: 2; }
  .nt-house { max-width: 330px; margin-inline: 0; }
  .tool-grid, .tool-grid.flip { grid-template-columns: 1fr; }
  .board-grid, .yes-grid { grid-template-columns: 1fr 1fr; }
  .summary-card { position: static; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .tool-row { grid-template-columns: 60px 1fr; }
  .tool-row .go { grid-column: 2; }
  .stage-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.8rem; }
}
@media (max-width: 720px) {
  /* the siting canvas is the payoff — on phones it renders first */
  .tool-grid { display: flex; flex-direction: column; }
  .tool-grid > .canvas-panel { order: -1; }
  /* 375 column: viewport minus paper pad. Wrap, do not clip. */
  .wrap, .tb-inner { width: 100%; max-width: 100%; margin-inline: 0; padding-inline: 1.1rem; }
  /* the door CTA lives in the menu at phone width — the header must never overflow */
  .tb-right .tb-cta { display: none; }
  /* the open ledger scrolls inside its own box, never the page */
  .ledger { display: block; overflow-x: auto; }
  .center { align-items: stretch; width: 100%; max-width: 100%; min-width: 0; }
  .center > *, .qband-copy, .qband-copy > *, .tool-head, .tool-grid, .tool-col, .plan-sheet, h1, .lede { min-width: 0; max-width: 100%; }
  svg, canvas, table { max-width: 100%; }
  h1 { font-size: clamp(1.9rem, 8.5vw, 2.3rem); line-height: 1.12; overflow-wrap: break-word; }
  h1 span { display: block; white-space: normal; }
  .lede, p, .hint { overflow-wrap: break-word; max-width: 100%; }
  .qband--tall { min-height: 0; }
  .qband { padding: 2.2rem 0 2.4rem; }
}
@media (max-width: 640px) {
  .board-grid, .yes-grid, .doubt-grid, .gate-list, .foot-grid, .split, .stage-strip { grid-template-columns: 1fr; }
  .split { gap: 1.6rem; }
  .split-tight { grid-template-columns: 1fr; gap: 0.8rem; }
  .tl-row { grid-template-columns: 1fr; gap: 0.2rem; }
  .stage-strip { gap: 1.5rem; }
  .stage-strip .nt-house { max-width: 190px; margin: 0; }
}
