/* td-theme.css: the shared look from the final mockups (2026-11-09).
   One stage colour per part of the product, the nav with coloured dots,
   buttons, the footer, and the sign-in box. Pages opt in by linking this
   file and setting <body data-stage="…">. The homepage and Dashboard keep
   their own page colours but share the menu: <body data-nav="home"> or
   <body data-nav="dashboard"> turns on just the header rules below
   (2026-11-10). The Day Planner keeps its own look (it now redirects to the
   Dashboard); the sign-in box is shared everywhere. */
:root {
  --td-ink: #241F2E;
  --td-cream: #FBF7F0;
  --td-muted: #5E5468;          /* 4.5:1+ on every stage colour */
  --td-coral: #C24F47;          /* primary buttons (white text 4.5:1+) */
  --td-coral-ink: #A33C35;      /* eyebrows, link hover */
  --td-line: rgba(36,31,46,.18);
  /* Stage colours: page grounds and their dots */
  --td-discovery: #FAF1D6;  --td-discovery-dot: #E2B35F;
  --td-planning: #DCEFE6;   --td-planning-dot: #6FB08F;
  --td-alignment: #E7EEF2;  --td-alignment-dot: #7F9DB5;
  --td-dashboard: #EEE9F6;  --td-dashboard-dot: #A99BD6;
  --td-coaching: #F6E2E8;   --td-coaching-dot: #D08BA4;
  --td-pricing: #FCE6D3;    --td-pricing-dot: #E9A06B;
  /* Card colours, where options need to stand apart */
  --td-card-1: #FBE3DF; --td-card-2: #ECE6F7; --td-card-3: #FFF4D6; --td-card-4: #E3EDF6; --td-card-5: #E1F1E8;
  --td-stage: var(--td-cream);
}
body[data-stage="discovery"] { --td-stage: var(--td-discovery); }
body[data-stage="planning"]  { --td-stage: var(--td-planning); }
body[data-stage="alignment"] { --td-stage: var(--td-alignment); }
body[data-stage="dashboard"] { --td-stage: var(--td-dashboard); }
body[data-stage="coaching"]  { --td-stage: var(--td-coaching); }
body[data-stage="pricing"]   { --td-stage: var(--td-pricing); }
body[data-stage] { background: var(--td-stage); color: var(--td-ink); }

/* ── Nav ── */
.td-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 10px 24px; background: var(--td-cream); border-bottom: 1.5px solid var(--td-ink); position: relative; z-index: 5; }
.td-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; text-decoration: none; color: var(--td-ink); min-height: 44px; }
.td-logo { width: 36px; height: 36px; border-radius: 10px; background: var(--td-ink); color: var(--td-cream); display: grid; place-items: center; font-weight: 600; font-size: 15px; transform: rotate(-3deg); }
.td-pill { font-family: "DM Mono", monospace; font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1.5px solid var(--td-ink); }
.td-links { display: flex; flex-wrap: wrap; gap: 0 18px; align-items: center; font-size: 14px; }
.td-links a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--td-ink); min-height: 44px; opacity: 1; font-size: 14px; font-weight: 400; }
.td-links a:hover { color: var(--td-coral-ink); }
.td-links a.on, .td-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 7px; text-decoration-thickness: 2px; }
.td-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--td-ink); flex: none; }
.td-dot.discovery { background: var(--td-discovery-dot); } .td-dot.planning { background: var(--td-planning-dot); }
.td-dot.alignment { background: var(--td-alignment-dot); } .td-dot.pricing { background: var(--td-pricing-dot); }
.td-dot.coaching { background: var(--td-coaching-dot); } .td-dot.dashboard { background: var(--td-dashboard-dot); }
.td-pill.discovery { background: var(--td-discovery-dot); } .td-pill.planning { background: var(--td-planning-dot); }
.td-pill.alignment { background: var(--td-alignment-dot); } .td-pill.pricing { background: var(--td-pricing-dot); }
.td-pill.coaching { background: var(--td-coaching-dot); } .td-pill.dashboard { background: var(--td-dashboard-dot); }

/* ── Type ── */
.td-eyebrow { font-family: "DM Mono", monospace; font-weight: 500; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--td-coral-ink); margin: 0; }
.td-h1 { font-family: "Instrument Serif", serif; font-weight: 400; font-size: clamp(38px, 5vw, 56px); line-height: 1.02; letter-spacing: -.01em; margin: 0; }
.td-h2 { font-family: "Instrument Serif", serif; font-weight: 400; font-size: clamp(28px, 3vw, 34px); line-height: 1.08; margin: 0; }
.td-lede { font-size: 17px; line-height: 1.6; color: var(--td-muted); margin: 0; }
.td-muted { color: var(--td-muted); }

/* ── Cards and buttons ── */
.td-card { border: 2px solid var(--td-ink); border-radius: 18px; box-shadow: 6px 6px 0 var(--td-ink); padding: 26px; background: #fff; box-sizing: border-box; }
.td-btn, .td-btn2 { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 2px solid var(--td-ink); font-family: "DM Mono", monospace; font-weight: 500; font-size: 14px; text-decoration: none; cursor: pointer; box-sizing: border-box; }
.td-btn { background: var(--td-coral); color: #fff; box-shadow: 3px 3px 0 var(--td-ink); }
.td-btn:hover { color: #fff; filter: brightness(.95); }
.td-btn.ink { background: var(--td-ink); color: var(--td-cream); }
.td-btn2 { background: #fff; color: var(--td-ink); box-shadow: 4px 4px 0 var(--td-ink); }
.td-btn[disabled], .td-btn2[disabled] { opacity: .6; cursor: default; }

/* ── Footer ── */
.td-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; padding: 22px 24px; border-top: 1.5px solid var(--td-line); font-size: 13px; color: var(--td-muted); background: var(--td-cream); }
.td-foot a { color: var(--td-muted); }

@media (max-width: 640px) {
  .td-nav { padding: 8px 16px; }
  .td-links { gap: 0 14px; font-size: 13.5px; }
}

/* ── Sign in / Create account (the box on every page that has one) ── */
#login-overlay .login-card { background: #fff; border: 2px solid var(--td-ink); border-radius: 18px; box-shadow: 6px 6px 0 var(--td-ink); padding: 26px 26px 22px; max-width: 440px; text-align: left; font-family: "Space Grotesk", system-ui, sans-serif; color: var(--td-ink); }
#login-overlay .login-card h2 { font-family: "Instrument Serif", serif; font-weight: 400; font-size: 34px; line-height: 1.05; margin: 0 0 6px; }
#login-overlay .login-sub { color: var(--td-muted); font-size: 14.5px; line-height: 1.5; margin: 0 0 16px; }
#login-overlay .td-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 4px; border: 2px solid var(--td-ink); border-radius: 999px; margin: 0 0 16px; }
#login-overlay .td-seg button { min-height: 42px; border-radius: 999px; border: none; background: transparent; color: var(--td-ink); font-family: "DM Mono", monospace; font-size: 14px; cursor: pointer; margin: 0; box-shadow: none; width: auto; padding: 0 8px; }
#login-overlay .td-seg button[aria-pressed="true"] { background: var(--td-ink); color: #fff; }
#login-overlay .td-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
#login-overlay .td-field label { font-size: 14px; font-weight: 600; }
#login-overlay .td-role { appearance: none; -webkit-appearance: none; width: 100%; min-height: 48px; padding: 0 40px 0 14px; border-radius: 12px; border: 2px solid var(--td-ink); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23241F2E' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; font: inherit; font-size: 16px; font-weight: 500; color: var(--td-ink); cursor: pointer; }
#login-overlay .td-role-hint { font-size: 13px; line-height: 1.5; color: var(--td-muted); }
#login-overlay .login-card input[type="text"], #login-overlay .login-card input[type="email"], #login-overlay .login-card input[type="password"] { min-height: 48px; padding: 0 14px; border-radius: 12px; border: 2px solid #CFC8D6; background: var(--td-cream); font-size: 16px; margin-bottom: 12px; }
#login-overlay .login-card input:focus { outline: 3px solid rgba(194,79,71,.3); border-color: var(--td-ink); }
#login-overlay .consent-block { background: var(--td-cream); border: 1.5px solid var(--td-ink); border-radius: 12px; }
#login-overlay .consent-block .consent-heading { color: var(--td-ink); }
#login-overlay #login-btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; border-radius: 999px; border: 2px solid var(--td-ink); background: var(--td-coral); color: #fff; font-family: "DM Mono", monospace; font-size: 14px; box-shadow: 3px 3px 0 var(--td-ink); cursor: pointer; }
#login-overlay .login-toggle { display: none; }
#login-overlay .login-error { font-size: 13.5px; }

/* ── The app pages' header (Discovery, Planning, Alignment) ──
   Same markup as before (logo, brand + stage, nav links, account menu),
   restyled to the mockups' nav: a stage pill and a coloured dot per link. */
:is(body[data-stage], body[data-nav]) > header { height: auto; min-height: 64px; padding: 10px 24px; background: var(--td-cream); border-bottom: 1.5px solid var(--td-ink); }
:is(body[data-stage], body[data-nav]) > header .logo { width: 36px; height: 36px; border-radius: 10px; }
:is(body[data-stage], body[data-nav]) > header .brand-wrap { align-items: center; gap: 10px; }
:is(body[data-stage], body[data-nav]) > header .brand { font-weight: 700; font-size: 17px; }
:is(body[data-stage], body[data-nav]) > header .brand-sub { font-family: "DM Mono", monospace; font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1.5px solid var(--td-ink); color: var(--td-ink); background: var(--td-cream); }
body[data-stage="discovery"] > header .brand-sub { background: var(--td-discovery-dot); }
body[data-stage="planning"] > header .brand-sub { background: var(--td-planning-dot); }
body[data-stage="alignment"] > header .brand-sub { background: var(--td-alignment-dot); }
body[data-nav="dashboard"] > header .brand-sub { background: var(--td-dashboard-dot); }
:is(body[data-stage], body[data-nav]) > header .header-nav { gap: 0 18px; }
:is(body[data-stage], body[data-nav]) > header .nav-link { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; font-size: 14px; font-weight: 400; opacity: 1; color: var(--td-ink); }
:is(body[data-stage], body[data-nav]) > header .nav-link:hover { color: var(--td-coral-ink); }
:is(body[data-stage], body[data-nav]) > header .nav-link::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--td-ink); flex: none; background: var(--td-cream); }
:is(body[data-stage], body[data-nav]) > header .nav-link[href^="/discovery"]::before { background: var(--td-discovery-dot); }
:is(body[data-stage], body[data-nav]) > header .nav-link[href^="/planning"]::before { background: var(--td-planning-dot); }
:is(body[data-stage], body[data-nav]) > header .nav-link[href^="/alignment"]::before { background: var(--td-alignment-dot); }
:is(body[data-stage], body[data-nav]) > header .nav-link[href^="/pricing"]::before { background: var(--td-pricing-dot); }
:is(body[data-stage], body[data-nav]) > header .nav-link.current, body[data-stage="discovery"] > header .nav-link[href^="/discovery"], body[data-stage="planning"] > header .nav-link[href^="/planning"], body[data-stage="alignment"] > header .nav-link[href^="/alignment"] { text-decoration: underline; text-underline-offset: 7px; text-decoration-thickness: 2px; }
:is(body[data-stage], body[data-nav]) > header #auth-status { font-size: 14px; font-weight: 600; opacity: 1; min-height: 44px; display: inline-flex; align-items: center; }

/* 2026-11-09: "Forgot your password?" in the sign-in box. */
#login-overlay .td-forgot { display: block; margin: -4px 0 10px auto; padding: 4px 0; background: none; border: 0; color: var(--td-coral-ink, #A33C35); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
#login-overlay .td-forgot[hidden] { display: none; }

/* The Dashboard's "Home" link has no stage, so no dot (2026-11-10). */
:is(body[data-stage], body[data-nav]) > header .nav-link[href="/"]::before { display: none; }

/* ── BR-28 (Beta Readiness, 29 Nov 2026): one selected state everywhere ──
   A picked chip or option button is filled ink with a check mark; a picked
   card has a thick ink border, the hard shadow and a check badge; a point on
   a rating scale (stars, 1 to 5) is filled ink with no check. "body" makes
   these win over each page's own older colours without editing them all. */
body .chip.active, body .gl-choice.selected, body .gl-chip.selected, body .gl-chip[aria-pressed="true"],
body .skill-chip.selected, body .obstacle-chip.selected, body .domain-btn.selected,
body .land-chip.on, body .pc-chip.on, body .pc-door.on, body .prog-level.on, body .ax-gp.on,
body .blockers-picker label:has(> input[type="checkbox"]:checked), body .support-picker label:has(> input[type="checkbox"]:checked),
body .likert-btn.selected, body .star-btn.active {
  background: var(--ink, #241F2E) !important; color: var(--cream, #FBF7F0) !important; border-color: var(--ink, #241F2E) !important; transform: none;
}
body .chip.active::before, body .gl-choice.selected::before, body .gl-chip.selected::before, body .gl-chip[aria-pressed="true"]::before,
body .skill-chip.selected::before, body .obstacle-chip.selected::before, body .domain-btn.selected::before,
body .land-chip.on::before, body .pc-chip.on::before, body .pc-door.on::before, body .prog-level.on::before, body .ax-gp.on::before {
  content: "\2713\00a0"; font-weight: 700;
}
body .value-card.selected, body .priority-card.selected, body .image-card.selected, body .goal-card.selected,
body .route-card.chosen, body .pace-card.chosen {
  border: 3px solid var(--ink, #241F2E) !important; box-shadow: 5px 5px 0 var(--ink, #241F2E) !important; position: relative; outline: none;
}
body .value-card.selected::after, body .priority-card.selected::after, body .goal-card.selected::after,
body .route-card.chosen::after, body .pace-card.chosen::after {
  content: "\2713"; position: absolute; top: -10px; right: -10px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink, #241F2E); color: var(--cream, #FBF7F0); display: grid; place-items: center; font-size: 14px; font-weight: 700; line-height: 26px; text-align: center;
}
body .value-card.selected { color: var(--ink, #241F2E) !important; background: var(--card, #fff) !important; }

/* BR-27 (29 Nov 2026): one style for what a change does, everywhere a change
   is previewed (Alignment, Sandbox, Dashboard): the old value muted and struck
   through, the new value bold on green. */
body .pc-was, body .rt-was, body .ax-was { color: var(--muted, #5E5468); text-decoration: line-through; margin-right: 4px; }
body .pc-new, body .rt-new, body .ax-new { font-weight: 700; background: #DCEFE6; color: #1F5A3A; padding: 1px 6px; border-radius: 5px; }

/* BR-28 (29 Nov 2026): True's questions in the serif face. The Discovery
   question headings keep their own size; a question inside a chat bubble or
   panel grows a little so it reads as the thing to answer. */
body .td-ask, body .form-q-label, body .land-q, body .goal-compact-ask { font-family: "Instrument Serif", serif; font-weight: 400; letter-spacing: 0; }
body .td-ask, body .land-q, body .goal-compact-ask { font-size: 1.3em; line-height: 1.3; }
body .bubble .td-ask { display: block; white-space: pre-wrap; }

/* BR-28: checklists are numbered, so a person can say "the second one". */
body .td-numbered { counter-reset: td-n; }
body .td-numbered > label, body .td-numbered > li { counter-increment: td-n; }
body .td-numbered > label::before, body .td-numbered > li::before { content: counter(td-n) "."; flex: none; min-width: 1.4em; padding-top: .3em; font-family: "DM Mono", monospace; font-size: 12px; font-weight: 500; color: var(--muted, #5E5468); }
body .td-numbered > li::before { display: inline-block; margin-right: 4px; padding-top: 0; }
