/* ==========================================================================
   Third Horizon Concierge - "Horizon Line" design system
   Shared by the client Desk and the Front Desk. Vanilla CSS, no build step.
   Palette: navy, gold, soft white, warm ivory. Fraunces for voice, Montserrat for UI.
   ========================================================================== */

/* ---------- Fonts (self-hosted) ---------- */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/Montserrat-Regular.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/Montserrat-Medium.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/Montserrat-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/Montserrat-Bold.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/Montserrat-Italic.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/Fraunces-Regular.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/Fraunces-Medium.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/Fraunces-SemiBold.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  --navy: #0B1F33;
  --navy-deep: #0F172A;
  --navy-2: #132A44;          /* raised dark surface */
  --charcoal: #334155;
  --gold: #D4AF37;
  --gold-ink: #7A6218;        /* gold as text on light surfaces (AA) */
  --gold-soft: rgba(212, 175, 55, .16);
  --gold-line: rgba(212, 175, 55, .55);
  --white: #FFFFFF;
  --soft: #F4F5F7;
  --ivory: #F7F3EB;
  --ivory-2: #EFE9DC;
  --line-light: rgba(15, 23, 42, .12);
  --line-dark: rgba(244, 245, 247, .14);
  --mineral: #7FA6B8;
  --mineral-ink: #3E6A7D;
  --success: #4F7A5A;
  --success-soft: rgba(79, 122, 90, .12);
  --error: #A4432E;
  --error-soft: rgba(164, 67, 46, .10);
  --text: #0F172A;
  --text-2: #334155;
  --text-3: #5B6472;
  --text-on-dark: #F4F5F7;
  --text-on-dark-2: rgba(244, 245, 247, .72);

  --font-ui: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;

  --radius: 6px;
  --radius-sm: 4px;
  --rail-w: 260px;
  --measure: 64ch;
  --dur-fast: 220ms;
  --dur-std: 400ms;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --shadow-card: 0 1px 2px rgba(11, 31, 51, .06), 0 8px 24px rgba(11, 31, 51, .06);
  --hit: 44px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.th-body {
  margin: 0;
  background: var(--soft);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
@media (min-width: 900px) { body.th-body { font-size: 17px; } }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: var(--navy); text-decoration: underline; text-decoration-color: var(--gold-line); text-underline-offset: .18em; }
a:hover { text-decoration-color: var(--gold); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; color: var(--text); letter-spacing: -.005em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2vw, 2.6rem); }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.9rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; max-width: var(--measure); }
small, .th-small { font-size: .875rem; color: var(--text-2); }
hr.th-rule { border: 0; height: 1px; background: var(--gold-line); margin: 1.5rem 0; }
strong { font-weight: 600; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.th-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.th-skip { position: absolute; left: 1rem; top: -3rem; background: var(--navy); color: var(--text-on-dark); padding: .6rem 1rem; border-radius: var(--radius); z-index: 50; text-decoration: none; }
.th-skip:focus { top: 1rem; }

/* ---------- Eyebrow ---------- */
.th-eyebrow {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin: 0 0 .6rem;
  display: block;
}
.th-on-dark .th-eyebrow, .th-cover .th-eyebrow { color: var(--gold); }

/* ---------- Shell / layout ---------- */
.th-shell { display: flex; flex-direction: column; min-height: 100vh; }
@media (min-width: 900px) { .th-shell { flex-direction: row; } }
.th-main { flex: 1 1 auto; min-width: 0; width: 100%; padding: 1.25rem 1rem 5rem; }
@media (min-width: 900px) {
  .th-main { padding: 2.5rem 3rem 6rem; margin-left: var(--rail-w); }
}
.th-main-inner { max-width: 880px; margin: 0 auto; }

/* ---------- Rail ---------- */
.th-rail {
  background: var(--navy);
  color: var(--text-on-dark);
  position: relative;
}
.th-rail-logo { padding: 0; }
.th-rail-logo img { width: 190px; height: auto; }
.th-rail-list { list-style: none; margin: 0; padding: 0; }
.th-rail-item { margin: 0; }
.th-rail-link {
  display: flex; align-items: center; gap: .8rem;
  width: 100%; min-height: var(--hit);
  padding: .55rem .75rem;
  background: transparent; border: 0; border-left: 2px solid transparent;
  color: var(--text-on-dark-2);
  font: inherit; font-size: .92rem; font-weight: 500; text-align: left;
  cursor: pointer; border-radius: 0;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.th-rail-link:hover { color: var(--text-on-dark); background: rgba(244, 245, 247, .04); }
.th-rail-link[aria-current="step"] { color: var(--text-on-dark); border-left-color: var(--gold); background: rgba(212, 175, 55, .08); }
.th-rail-link[disabled], .th-rail-link[aria-disabled="true"] { cursor: not-allowed; color: rgba(244, 245, 247, .4); }
.th-rail-link:focus-visible { outline-offset: -3px; }
.th-rail-num { font-size: .7rem; letter-spacing: .12em; font-weight: 600; color: rgba(244, 245, 247, .62); width: 1.3rem; flex: 0 0 auto; }
.th-rail-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.th-rail-title { display: block; }
.th-rail-eta { display: block; font-size: .72rem; color: rgba(244, 245, 247, .68); margin-top: .1rem; }
.th-rail-foot { padding: 1rem 1.25rem; font-size: .78rem; color: var(--text-on-dark-2); border-top: 1px solid var(--line-dark); }
.th-rail-foot a { color: var(--text-on-dark); }
.th-rail-foot .th-btn-link { color: var(--text-on-dark-2); padding: 0; min-height: auto; }

/* Status dot */
.th-dot {
  width: 10px; height: 10px; border-radius: 999px; flex: 0 0 auto;
  border: 1.5px solid rgba(244, 245, 247, .45); background: transparent;
}
.th-dot[data-status="active"] { border-color: var(--gold); background: var(--gold-soft); }
.th-dot[data-status="done"] { border-color: var(--gold); background: var(--gold); }
.th-dot[data-status="skipped"] { border-style: dashed; }
.th-light .th-dot, .th-status .th-dot { border-color: rgba(15, 23, 42, .35); }
.th-status .th-dot[data-status="done"], .th-status .th-dot[data-status="active"] { border-color: var(--gold); }

/* Desktop: fixed left rail */
@media (min-width: 900px) {
  .th-rail { position: fixed; inset: 0 auto 0 0; width: var(--rail-w); display: flex; flex-direction: column; overflow-y: auto; }
  .th-rail-logo { padding: 1.75rem 1.25rem 1rem; }
  .th-rail-list { padding: .5rem .5rem 1rem; flex: 1 1 auto; }
  .th-rail-link { padding: .55rem .9rem; }
  .th-rail-progress { display: none; }
}
/* Mobile: top progress line */
@media (max-width: 899px) {
  .th-rail { position: sticky; top: 0; z-index: 20; padding: .75rem 1rem .6rem; }
  .th-rail-logo { display: flex; align-items: center; justify-content: space-between; }
  .th-rail-logo img { width: 130px; }
  .th-rail-list { display: flex; gap: .35rem; overflow-x: auto; margin-top: .6rem; padding-bottom: .2rem; scrollbar-width: none; }
  .th-rail-list::-webkit-scrollbar { display: none; }
  .th-rail-item { flex: 0 0 auto; }
  .th-rail-link { padding: .35rem .6rem; font-size: .8rem; border-left: 0; border-bottom: 2px solid transparent; }
  .th-rail-link[aria-current="step"] { border-left: 0; border-bottom-color: var(--gold); background: transparent; }
  .th-rail-eta, .th-rail-foot { display: none; }
  .th-rail-num { display: none; }
  .th-rail-progress { height: 2px; background: rgba(244, 245, 247, .12); margin-top: .5rem; }
  .th-rail-progress > span { display: block; height: 100%; background: var(--gold); transition: width var(--dur-std) var(--ease); }
}

/* ---------- Station (content transitions) ---------- */
.th-station { animation: th-slide var(--dur-std) var(--ease) both; }
@keyframes th-slide { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.th-station-head { margin-bottom: 1.25rem; }
.th-station-head h1 { margin-bottom: .2em; }
.th-station-lede { color: var(--text-2); max-width: var(--measure); }

/* ---------- Cover (dark, with horizon arc) ---------- */
.th-cover {
  position: relative; overflow: hidden;
  background: var(--navy); color: var(--text-on-dark);
  border-radius: var(--radius);
  padding: clamp(2rem, 3vw + 1rem, 3.5rem) clamp(1.25rem, 3vw + .5rem, 3rem);
  margin-bottom: 1.5rem;
  isolation: isolate;
}
.th-cover::before {
  content: ""; position: absolute; inset: auto -10% -42% -10%; height: 120%;
  background: url("../img/horizon-arc.svg") no-repeat center bottom / 100% auto;
  opacity: .14; pointer-events: none; z-index: -1;
}
.th-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11, 31, 51, 0) 40%, rgba(11, 31, 51, .35) 100%);
  z-index: -1; pointer-events: none;
}
.th-cover h1, .th-cover h2 { color: var(--white); font-weight: 500; }
.th-cover p { color: var(--text-on-dark-2); }
.th-cover .th-cover-lede { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.5; color: var(--text-on-dark); }
.th-cover-meta { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--gold-line); }
.th-cover-meta dt { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--gold); margin-bottom: .2rem; }
.th-cover-meta dd { margin: 0; color: var(--text-on-dark); font-size: .95rem; }
.th-cover .th-btn-primary { background: var(--gold); color: var(--navy); }
.th-cover .th-btn-primary:hover { background: #E0BD4E; }
.th-cover .th-btn-ghost { color: var(--text-on-dark); border-color: var(--line-dark); }
.th-cover .th-btn-ghost:hover { border-color: var(--gold); }
.th-cover-logo { width: 170px; margin-bottom: 1.5rem; }

/* ---------- Card ---------- */
.th-card {
  position: relative;
  background: var(--ivory);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
  overflow: hidden;
  isolation: isolate;
}
.th-card-strip {
  position: relative; height: 112px; overflow: hidden;
  border-bottom: 1px solid var(--gold);
}
.th-card-strip img { width: 100%; height: 100%; object-fit: cover; object-position: center 55%; filter: saturate(.85); }
.th-card-strip::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11, 31, 51, .82) 0%, rgba(11, 31, 51, .35) 45%, rgba(11, 31, 51, 0) 100%);
}
.th-card-strip .th-card-strip-label {
  position: absolute; left: 1.5rem; bottom: .9rem; z-index: 1;
  color: var(--gold); font-size: .7rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
}
.th-card-strip-tall { height: 140px; }
.th-card-body { padding: 1.5rem; position: relative; z-index: 1; }
@media (min-width: 900px) { .th-card-body { padding: 2rem; } }
.th-card-body > :last-child { margin-bottom: 0; }
.th-card-body h2:first-child, .th-card-body h3:first-child { margin-top: 0; }
/* faint washed image behind a paper card */
.th-card-wash::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: var(--wash, url("../img/arch-3.webp"));
  background-size: cover; background-position: center;
  opacity: .07; filter: grayscale(1) sepia(.5);
}
.th-card-plain { background: var(--white); }
.th-card-dark { background: var(--navy); color: var(--text-on-dark); border-color: transparent; }
.th-card-dark h2, .th-card-dark h3 { color: var(--white); }
.th-card-dark p { color: var(--text-on-dark-2); }
.th-card-foot { padding: 1rem 1.5rem; border-top: 1px solid var(--line-light); background: var(--ivory-2); font-size: .9rem; color: var(--text-2); }

/* ---------- Concierge voice ---------- */
.th-voice {
  position: relative;
  font-family: var(--font-display);
  font-size: 1.1rem; line-height: 1.55; font-weight: 400;
  color: var(--text);
  background: var(--ivory);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.5rem 1.1rem 1.4rem;
  margin: 0 0 1.5rem;
  max-width: 68ch;
}
.th-voice p { max-width: none; margin-bottom: .7em; }
.th-voice-sign { font-family: var(--font-ui); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--gold-ink); margin-top: .9rem; }
.th-card .th-voice { background: transparent; padding-left: 1.2rem; margin-bottom: 1.25rem; }
.th-cover .th-voice { background: rgba(244, 245, 247, .04); color: var(--text-on-dark); }
.th-cover .th-voice-sign { color: var(--gold); }

/* ---------- You might be wondering ---------- */
.th-wonder { margin: 0 0 1.5rem; border-top: 1px solid var(--line-light); }
.th-wonder-title { padding: 1rem 0 .35rem; }
.th-wonder details { border-bottom: 1px solid var(--line-light); }
.th-wonder summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: .75rem;
  min-height: var(--hit); padding: .6rem 0; font-weight: 500; font-size: .95rem; color: var(--text);
}
.th-wonder summary::-webkit-details-marker { display: none; }
.th-wonder summary::before {
  content: ""; width: 8px; height: 8px; flex: 0 0 auto;
  border-right: 1.5px solid var(--gold-ink); border-bottom: 1.5px solid var(--gold-ink);
  transform: rotate(-45deg); transition: transform var(--dur-fast) var(--ease); margin-left: .2rem;
}
.th-wonder details[open] summary::before { transform: rotate(45deg); }
.th-wonder details > div { padding: 0 0 1rem 1.55rem; color: var(--text-2); font-size: .95rem; max-width: var(--measure); }

/* ---------- Escape line ---------- */
.th-escape { font-size: .88rem; color: var(--text-3); margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line-light); }

/* ---------- Forms ---------- */
.th-form { max-width: 720px; }
.th-fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; min-width: 0; }
.th-fieldset legend { padding: 0; margin-bottom: .75rem; font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; }
.th-grid { display: grid; gap: 1rem 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .th-grid-2 { grid-template-columns: 1fr 1fr; } .th-grid-3 { grid-template-columns: 1fr 1fr 1fr; } .th-span-2 { grid-column: span 2; } }
.th-field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; min-width: 0; }
.th-grid .th-field { margin-bottom: 0; }
.th-label { font-size: .82rem; font-weight: 600; color: var(--text); letter-spacing: .01em; }
.th-hint { font-size: .82rem; color: var(--text-3); }
.th-input, .th-select, .th-textarea {
  width: 100%; min-height: var(--hit);
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--white);
  border: 1px solid rgba(15, 23, 42, .28);
  border-radius: var(--radius-sm);
  padding: .55rem .8rem;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.th-input::placeholder, .th-textarea::placeholder { color: #7C8592; }
.th-input:hover, .th-select:hover, .th-textarea:hover { border-color: var(--charcoal); }
.th-input:focus, .th-select:focus, .th-textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 2px var(--gold); }
.th-input[aria-invalid="true"], .th-textarea[aria-invalid="true"] { border-color: var(--error); }
.th-textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }
.th-select { appearance: none; -webkit-appearance: none; padding-right: 2.4rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--charcoal) 50%), linear-gradient(135deg, var(--charcoal) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 50%, calc(100% - .75rem) 50%; background-size: .35rem .35rem; background-repeat: no-repeat; }
.th-input-sm { font-size: .95rem; }
.th-input-code { font-family: var(--font-display); font-size: 2rem; letter-spacing: .5em; text-align: center; padding-left: 1.2em; max-width: 14rem; }
.th-check, .th-radio { display: flex; align-items: flex-start; gap: .7rem; min-height: var(--hit); padding: .5rem 0; cursor: pointer; font-size: .97rem; }
.th-check input, .th-radio input { width: 20px; height: 20px; margin: .15rem 0 0; accent-color: var(--navy); flex: 0 0 auto; cursor: pointer; }
.th-choice-row { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
/* segmented toggle (self / other) */
.th-seg { display: inline-flex; border: 1px solid rgba(15, 23, 42, .28); border-radius: var(--radius-sm); overflow: hidden; }
.th-seg label { position: relative; min-height: var(--hit); display: flex; align-items: center; padding: 0 1.1rem; cursor: pointer; font-size: .92rem; font-weight: 500; color: var(--text-2); background: var(--white); transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.th-seg label + label { border-left: 1px solid rgba(15, 23, 42, .2); }
.th-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.th-seg input:checked + span { color: var(--white); }
.th-seg label:has(input:checked) { background: var(--navy); color: var(--white); }
.th-seg label:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: -2px; }
.th-error { color: var(--error); font-size: .85rem; }
.th-form-msg { margin: 1rem 0 0; font-size: .95rem; padding: .8rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line-light); background: var(--white); color: var(--text-2); max-width: none; }
.th-form-msg[data-kind="error"] { border-color: rgba(164, 67, 46, .4); background: var(--error-soft); color: var(--error); }
.th-form-msg[data-kind="success"] { border-color: rgba(79, 122, 90, .4); background: var(--success-soft); color: var(--success); }
.th-form-msg[data-kind="info"] { border-color: rgba(127, 166, 184, .6); background: rgba(127, 166, 184, .12); color: var(--mineral-ink); }
.th-form-msg:empty { display: none; }

/* ---------- Buttons ---------- */
.th-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--hit); padding: .6rem 1.4rem;
  font: inherit; font-size: .92rem; font-weight: 600; letter-spacing: .02em;
  border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; position: relative;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.th-btn::after { content: ""; position: absolute; left: 1.4rem; right: 1.4rem; bottom: .45rem; height: 1px; background: var(--gold); opacity: 0; transform: scaleX(.6); transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.th-btn:hover::after { opacity: 1; transform: none; }
.th-btn-primary { background: var(--navy); color: var(--white); }
.th-btn-primary:hover { background: var(--navy-2); }
.th-btn-ghost { background: transparent; color: var(--navy); border-color: rgba(15, 23, 42, .3); }
.th-btn-ghost:hover { border-color: var(--navy); background: rgba(15, 23, 42, .03); }
.th-btn-ghost::after { display: none; }
.th-btn-link { background: transparent; color: var(--navy); padding: .3rem .2rem; border: 0; text-decoration: underline; text-decoration-color: var(--gold-line); text-underline-offset: .2em; font-weight: 500; }
.th-btn-link:hover { text-decoration-color: var(--gold); }
.th-btn-link::after { display: none; }
.th-btn-sm { min-height: 36px; padding: .35rem .9rem; font-size: .82rem; }
.th-btn[disabled], .th-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.th-btn[disabled]::after { display: none; }
.th-btn[data-busy="true"] { color: transparent; }
.th-btn[data-busy="true"]::before { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor; border-color: var(--gold) var(--gold) transparent transparent; border-radius: 999px; animation: th-spin 800ms linear infinite; color: var(--gold); }
@keyframes th-spin { to { transform: rotate(360deg); } }
.th-actions { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; margin-top: 1.5rem; }
.th-actions-end { justify-content: flex-end; }

/* ---------- Status ---------- */
.th-status { display: inline-flex; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 600; letter-spacing: .04em; color: var(--text-2); white-space: nowrap; }
.th-status .th-dot { width: 9px; height: 9px; }
.th-status[data-status="done"], .th-status[data-status="signed"], .th-status[data-status="received"], .th-status[data-status="complete"], .th-status[data-status="paid"], .th-status[data-status="chosen"] { color: var(--success); }
.th-status[data-status="done"] .th-dot, .th-status[data-status="signed"] .th-dot, .th-status[data-status="received"] .th-dot, .th-status[data-status="complete"] .th-dot, .th-status[data-status="paid"] .th-dot, .th-status[data-status="chosen"] .th-dot { background: var(--gold); border-color: var(--gold); }
.th-status[data-status="active"] .th-dot, .th-status[data-status="awaiting"] .th-dot, .th-status[data-status="open"] .th-dot, .th-status[data-status="started"] .th-dot, .th-status[data-status="issued"] .th-dot { border-color: var(--gold); background: var(--gold-soft); }
.th-status[data-status="changes_requested"] { color: var(--mineral-ink); }
.th-status[data-status="changes_requested"] .th-dot { border-color: var(--mineral); background: rgba(127, 166, 184, .3); }
.th-status[data-status="not_available"] .th-dot, .th-status[data-status="linked"] .th-dot, .th-status[data-status="skipped"] .th-dot { border-style: dashed; }

/* ---------- Lists / rows ---------- */
.th-list { list-style: none; margin: 0; padding: 0; }
.th-row { display: flex; align-items: center; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--line-light); }
.th-row:first-child { border-top: 0; }
.th-row-main { flex: 1 1 auto; min-width: 0; }
.th-row-title { font-weight: 600; display: block; }
.th-row-sub { display: block; font-size: .85rem; color: var(--text-3); }
.th-row-actions { display: flex; gap: .5rem; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.th-row-link { display: flex; align-items: center; gap: 1rem; width: 100%; padding: .9rem 0; background: none; border: 0; border-top: 1px solid var(--line-light); font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 0; }
.th-row-link:first-child { border-top: 0; }
.th-row-link:hover .th-row-title { color: var(--gold-ink); }
.th-row-link[disabled] { cursor: default; opacity: .6; }
.th-row-link[disabled]:hover .th-row-title { color: inherit; }
.th-row-chev { width: 8px; height: 8px; border-right: 1.5px solid var(--charcoal); border-top: 1.5px solid var(--charcoal); transform: rotate(45deg); flex: 0 0 auto; margin-right: .3rem; }

/* ---------- Table ---------- */
.th-table-wrap { overflow-x: auto; }
.th-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.th-table th, .th-table td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--line-light); vertical-align: top; }
.th-table th { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--text-3); border-bottom-color: var(--gold-line); }
.th-table td.th-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.th-kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.5rem; margin: 0; font-size: .95rem; }
.th-kv dt { color: var(--text-3); font-size: .82rem; font-weight: 600; padding-top: .15rem; }
.th-kv dd { margin: 0; word-break: break-word; }
@media (max-width: 480px) { .th-kv { grid-template-columns: 1fr; gap: .15rem; } .th-kv dd { margin-bottom: .6rem; } }

/* ---------- Document reader ---------- */
.th-doc-summary ul { padding-left: 1.1rem; }
.th-doc-summary li { margin-bottom: .4rem; }
.th-doc-summary li::marker { color: var(--gold); }
.th-doc-paper {
  background: var(--white); border: 1px solid var(--line-light); border-radius: var(--radius);
  max-height: 60vh; overflow-y: auto; padding: 2rem clamp(1.25rem, 4vw, 3rem);
  font-size: .95rem; line-height: 1.65; color: var(--text);
  box-shadow: inset 0 -24px 24px -24px rgba(11, 31, 51, .15);
}
.th-doc-paper h1, .th-doc-paper h2, .th-doc-paper h3 { font-family: var(--font-display); }
.th-doc-paper h1 { font-size: 1.6rem; }
.th-doc-paper h2 { font-size: 1.2rem; margin-top: 1.6em; }
.th-doc-paper table { width: 100%; border-collapse: collapse; }
.th-doc-paper td, .th-doc-paper th { border-bottom: 1px solid var(--line-light); padding: .4rem .5rem; text-align: left; font-size: .9rem; }
.th-doc-paper p, .th-doc-paper ul, .th-doc-paper ol { max-width: none; }
.th-doc-paper .band td { border: 0; vertical-align: middle; }
.th-doc-paper .band .logo img { max-width: 200px; }
.th-doc-paper .band-right { text-align: right; font-weight: 500; }
.th-doc-paper .band-right span { display: block; font-size: .8rem; color: var(--text-3); font-weight: 400; }
.th-doc-paper .strip img { width: 100%; height: 90px; object-fit: cover; border-bottom: 1px solid var(--gold); }
.th-doc-paper .eyebrow { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--gold-ink); }
.th-doc-paper .sig-block td { vertical-align: top; }
.th-doc-sign { border-top: 1px solid var(--gold-line); margin-top: 1.5rem; padding-top: 1.25rem; }
.th-doc-sign .th-input-sig { font-family: var(--font-display); font-style: italic; font-size: 1.35rem; }
.th-doc-meta { font-size: .85rem; color: var(--text-3); }
.th-doc-change { margin-top: 1.5rem; border-top: 1px solid var(--line-light); padding-top: .5rem; }
.th-doc-change summary { cursor: pointer; min-height: var(--hit); display: flex; align-items: center; font-weight: 500; font-size: .95rem; list-style: none; }
.th-doc-change summary::-webkit-details-marker { display: none; }
.th-doc-change summary::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--gold); margin-right: .7rem; }
.th-signed-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; padding: 1rem 1.25rem; border: 1px solid rgba(79, 122, 90, .35); background: var(--success-soft); border-radius: var(--radius); margin-bottom: 1.25rem; }
.th-signed-banner .th-status { color: var(--success); }
.th-sha { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; color: var(--text-3); word-break: break-all; }

/* ---------- Upload ---------- */
.th-upload-drop {
  border: 1.5px dashed rgba(15, 23, 42, .3); border-radius: var(--radius);
  padding: 1.25rem; text-align: center; background: var(--white);
  color: var(--text-2); font-size: .92rem; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  min-height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
}
.th-upload-drop:hover, .th-upload-drop[data-over="true"] { border-color: var(--gold); background: var(--ivory); }
.th-upload-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.th-upload-drop strong { color: var(--navy); }
.th-upload-progress { height: 3px; background: var(--line-light); margin-top: .6rem; border-radius: 2px; overflow: hidden; }
.th-upload-progress > span { display: block; height: 100%; background: var(--gold); transition: width var(--dur-fast) linear; }
.th-upload-item { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; font-size: .9rem; border-top: 1px solid var(--line-light); }
.th-upload-item:first-child { border-top: 0; }
.th-upload-item .th-dot { border-color: var(--gold); background: var(--gold); width: 8px; height: 8px; }
.th-upload-item-size { color: var(--text-3); font-size: .8rem; margin-left: auto; white-space: nowrap; }
.th-docreq { border-top: 1px solid var(--line-light); padding: 1.25rem 0; }
.th-docreq:first-child { border-top: 0; padding-top: 0; }
.th-docreq-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: .6rem; }
.th-docreq-head h3 { margin: 0; font-size: 1.1rem; flex: 1 1 auto; }
.th-docreq-why { color: var(--text-2); font-size: .92rem; margin-bottom: .8rem; }
.th-docreq-alt { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .6rem; }
.th-docreq-panel { margin-top: .75rem; padding: 1rem; background: var(--white); border: 1px solid var(--line-light); border-radius: var(--radius); }

/* ---------- Slots ---------- */
.th-slots { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin: 1rem 0 1.5rem; }
.th-slot {
  display: flex; flex-direction: column; align-items: flex-start; gap: .15rem;
  min-height: var(--hit); padding: .8rem 1rem;
  background: var(--white); border: 1px solid rgba(15, 23, 42, .25); border-radius: var(--radius);
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.th-slot:hover { border-color: var(--navy); }
.th-slot[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold); }
.th-slot-day { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--text-3); }
.th-slot-time { font-family: var(--font-display); font-size: 1.15rem; }

/* ---------- Toast ---------- */
.th-toast-host { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; width: min(92vw, 520px); }
.th-toast {
  pointer-events: auto;
  background: var(--navy); color: var(--text-on-dark);
  border-left: 3px solid var(--gold); border-radius: var(--radius);
  padding: .8rem 1.1rem; font-size: .92rem; box-shadow: 0 8px 24px rgba(11, 31, 51, .25);
  animation: th-toast-in var(--dur-fast) var(--ease) both; width: 100%;
}
.th-toast[data-kind="error"] { border-left-color: var(--error); }
.th-toast[data-leaving="true"] { animation: th-toast-out var(--dur-fast) var(--ease) both; }
@keyframes th-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes th-toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Misc components ---------- */
.th-note { font-size: .92rem; color: var(--text-2); padding: .9rem 1.1rem; border-left: 2px solid var(--gold); background: var(--white); border-radius: 0 var(--radius) var(--radius) 0; margin: 1rem 0; max-width: var(--measure); }
.th-steps-three { counter-reset: th; list-style: none; padding: 0; margin: 1rem 0 0; }
.th-steps-three li { position: relative; padding-left: 2.4rem; margin-bottom: .9rem; counter-increment: th; }
.th-steps-three li::before { content: counter(th); position: absolute; left: 0; top: .05rem; width: 1.6rem; height: 1.6rem; border-radius: 999px; border: 1px solid var(--gold); color: var(--gold-ink); font-size: .75rem; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.th-summary-grid { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .th-summary-grid { grid-template-columns: 1fr 1fr; } }
.th-summary-item { display: flex; align-items: flex-start; gap: .75rem; padding: .8rem 1rem; background: var(--white); border: 1px solid var(--line-light); border-radius: var(--radius); }
.th-summary-item .th-status { margin-top: .15rem; }
.th-summary-item-text { font-size: .92rem; }
.th-summary-item-text strong { display: block; }
.th-roster-row { display: grid; gap: .5rem; grid-template-columns: 1fr; align-items: end; margin-bottom: .75rem; }
@media (min-width: 640px) { .th-roster-row { grid-template-columns: 1.2fr 1fr 1.4fr auto; } }
.th-roster-row .th-field { margin: 0; }
.th-empty { color: var(--text-3); font-size: .95rem; padding: 1rem 0; }
.th-center { text-align: center; }
.th-mt { margin-top: 1.5rem; }
.th-mb-0 { margin-bottom: 0; }
.th-tag { display: inline-block; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; padding: .2rem .5rem; border: 1px solid var(--gold-line); border-radius: var(--radius-sm); color: var(--gold-ink); vertical-align: middle; }
.th-bank { font-variant-numeric: tabular-nums; }

/* ---------- Standalone pages (OTP, login, delegate, signer, checkin) ---------- */
.th-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--soft); }
.th-page-head { background: var(--navy); padding: 1.25rem 1.5rem; position: relative; overflow: hidden; }
.th-page-head::before { content: ""; position: absolute; inset: auto -10% -120% -10%; height: 200%; background: url("../img/horizon-arc.svg") no-repeat center bottom / 100% auto; opacity: .1; pointer-events: none; }
.th-page-head img { width: 170px; position: relative; }
.th-page-main { flex: 1 1 auto; padding: 2rem 1rem 4rem; width: 100%; max-width: 720px; margin: 0 auto; }
.th-page-main-wide { max-width: 900px; }
.th-page-foot { padding: 1.25rem 1.5rem; font-size: .8rem; color: var(--text-3); text-align: center; border-top: 1px solid var(--line-light); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .th-station { animation: none; }
}

/* ---------- Print ---------- */
@media print {
  .th-rail, .th-toast-host, .th-escape, .th-wonder, .th-actions { display: none !important; }
  .th-main { margin: 0; padding: 0; }
  .th-card { box-shadow: none; break-inside: avoid; }
}
