/* =========================================================================
   THE ASCENT — STYLES
   War-college codex: ink, brass, parchment, oxblood. Engraved, not glossy.
   ========================================================================= */

/* ---------- tokens ---------- */
:root {
  --ink: #0b0d0e;
  --ink-2: #0e1214;
  --panel: #131a1d;
  --panel-2: #161e22;
  --panel-3: #1b2429;
  --paper: #e9dfc9;
  --paper-dim: #c3b9a4;
  --muted: #8d938f;
  --brass: #c9a45c;
  --brass-bright: #e2bf7a;
  --brass-dim: #8a6a34;
  --oxblood: #7d2a2f;
  --oxblood-bright: #b5575d;
  --jade: #5f8a6e;
  --jade-bright: #93c0a0;
  --steel: #7f97a8;
  --line: rgba(201, 164, 92, 0.20);
  --line-strong: rgba(201, 164, 92, 0.42);
  --font-display: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
  --font-body: "Spectral", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --rail-w: 236px;
  --radius: 2px;
  --shadow-panel: 0 24px 60px rgba(0, 0, 0, 0.38);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 720px at 82% -12%, rgba(201, 164, 92, 0.10), transparent 62%),
    radial-gradient(1000px 640px at -8% 112%, rgba(125, 42, 47, 0.13), transparent 65%),
    linear-gradient(155deg, #0b0d0e 0%, #090b0c 60%, #0a0c0d 100%);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(233, 223, 201, 0.028) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(90deg, rgba(233, 223, 201, 0.02) 0 1px, transparent 1px 96px);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}
body.modal-open { overflow: hidden; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brass-bright); text-decoration: none; }
::selection { background: rgba(201, 164, 92, 0.28); color: var(--paper); }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--brass);
  color: #14100a;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- type helpers ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--paper);
  letter-spacing: 0.03em;
  line-height: 1.08;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brass);
  line-height: 1.6;
}
.mono { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.hint { color: var(--muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.fine { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  margin-right: 10px;
}

/* ---------- layout ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
body.is-onboarding .app { grid-template-columns: 1fr; }
body.is-onboarding .rail { display: none; }
.stage { padding: 42px clamp(22px, 4.4vw, 64px) 96px; max-width: 1440px; width: 100%; margin: 0 auto; outline: none; }
body.is-onboarding .stage { padding: 0; max-width: none; }
.view { animation: viewIn 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.view > * { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.view > *:nth-child(2) { animation-delay: 0.05s; }
.view > *:nth-child(3) { animation-delay: 0.1s; }
.view > *:nth-child(4) { animation-delay: 0.15s; }
.view > *:nth-child(5) { animation-delay: 0.2s; }
.reading-col { width: 100%; max-width: 900px; margin-left: auto; margin-right: auto; display: flex; flex-direction: column; gap: 22px; }
.boot { min-height: 80vh; display: grid; place-content: center; justify-items: center; gap: 20px; }
.boot__sigil {
  width: 88px; height: 88px; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 44px; color: var(--brass);
  border: 1px solid var(--line-strong); transform: rotate(45deg);
}
.boot__sigil { text-orientation: mixed; }
.boot__sigil::first-letter { transform: rotate(-45deg); }
.boot__line { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); }

/* ---------- rail ---------- */
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 16px 20px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(19, 26, 29, 0.9), rgba(10, 13, 14, 0.96)),
    repeating-linear-gradient(0deg, rgba(233, 223, 201, 0.02) 0 1px, transparent 1px 64px);
  backdrop-filter: blur(6px);
  z-index: 20;
}
.rail__brand { padding: 0 6px 18px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.brand__mark { width: 40px; height: 40px; color: var(--brass); flex: 0 0 auto; }
.brand__name {
  display: flex; flex-direction: column;
  font-family: var(--font-display); font-size: 15px; letter-spacing: 0.22em; color: var(--paper);
  line-height: 1.1;
}
.brand__name span { font-size: 9px; letter-spacing: 0.34em; color: var(--muted); margin-top: 2px; }
.rail__nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.rail__link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  color: var(--paper-dim);
  border-left: 2px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  text-align: left;
}
.rail__icon { color: var(--muted); display: grid; place-items: center; transition: color 0.18s ease; }
.rail__icon .icon { width: 19px; height: 19px; }
.rail__label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; }
.rail__link:hover { background: rgba(201, 164, 92, 0.05); color: var(--paper); }
.rail__link:hover .rail__icon { color: var(--brass); }
.rail__link.is-active { background: linear-gradient(90deg, rgba(201, 164, 92, 0.12), transparent); border-left-color: var(--brass); color: var(--paper); }
.rail__link.is-active .rail__icon { color: var(--brass-bright); }
.rail__foot { display: flex; align-items: center; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.rail__rank { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-align: left; padding: 4px; }
.rail__rank-text { display: flex; flex-direction: column; min-width: 0; }
.rail__rank-text strong { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper); }
.rail__rank-text small { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; color: var(--muted); border: 1px solid transparent; transition: all 0.18s ease; }
.icon-btn:hover { color: var(--brass); border-color: var(--line); }
.icon { width: 20px; height: 20px; display: block; }

/* ---------- page head ---------- */
.page-head { margin-bottom: 30px; }
.page-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.page-head__title { font-size: clamp(34px, 4.2vw, 56px); margin: 8px 0 10px; }
.page-head__main { max-width: 760px; }
.page-sub { color: var(--paper-dim); font-size: 16.5px; max-width: 620px; font-style: italic; }
.page-head__aside { flex: 0 0 auto; }
.page-head__rank { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.page-head__ranktext { max-width: 260px; }
.page-head__rankdesc { font-size: 14.5px; color: var(--paper-dim); margin: 2px 0 4px; }
.page-head__next { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.backlink {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px; padding: 4px 0; transition: color 0.18s ease;
}
.backlink:hover { color: var(--brass-bright); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 13px 20px;
  border: 1px solid var(--line-strong);
  color: var(--paper);
  background: transparent;
  position: relative;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
  cursor: pointer;
  text-align: center;
}
.btn:hover { border-color: var(--brass); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(180deg, #ddbb79, #b98f48);
  border-color: #e6ca91;
  color: #16110a;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(201, 164, 92, 0.16);
}
.btn--primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn--ghost { color: var(--brass-bright); }
.btn--ghost:hover { background: rgba(201, 164, 92, 0.07); }
.btn--quiet { border-color: transparent; color: var(--muted); padding-left: 2px; padding-right: 2px; }
.btn--quiet:hover { color: var(--brass-bright); }
.btn--danger { border-color: rgba(181, 87, 93, 0.45); color: #d99599; }
.btn--danger:hover { background: rgba(125, 42, 47, 0.16); border-color: var(--oxblood-bright); }
.btn--sm { padding: 9px 13px; font-size: 9.5px; letter-spacing: 0.14em; }
.btn--wide { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-row--stack { flex-direction: column; align-items: stretch; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- chips, meta ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--paper-dim);
  border: 1px solid rgba(201, 164, 92, 0.18);
  padding: 6px 9px;
  white-space: nowrap;
}
.chip--brass { color: var(--brass-bright); border-color: var(--line-strong); }
.chip--quiet { border-color: transparent; color: var(--muted); padding-left: 0; }
.chip--disc { color: var(--paper); }
.chip__numeral { font-family: var(--font-display); color: var(--brass); margin-right: 2px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.campaign-tally { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; justify-content: flex-end; text-align: right; }
.campaign-tally strong { font-family: var(--font-display); font-size: 26px; color: var(--brass-bright); font-weight: 500; }
.campaign-tally span { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ---------- cards ---------- */
.card {
  position: relative;
  background: linear-gradient(165deg, rgba(23, 30, 34, 0.94), rgba(14, 18, 21, 0.97));
  border: 1px solid var(--line);
  padding: 26px 28px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}
.card::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(233, 223, 201, 0.035);
  pointer-events: none;
}
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.card__title { font-size: clamp(21px, 2.2vw, 27px); margin: 4px 0 8px; }
.card__lead { color: var(--paper-dim); font-size: 15.5px; margin: 8px 0; }
.card__source { font-size: 12.5px; color: var(--muted); font-style: italic; margin-top: 6px; }
.card--hero {
  padding: 32px 34px;
  border-color: rgba(201, 164, 92, 0.34);
  background:
    radial-gradient(600px 220px at 0% 0%, rgba(201, 164, 92, 0.10), transparent 60%),
    linear-gradient(165deg, rgba(26, 34, 38, 0.97), rgba(14, 18, 21, 0.98));
}
.card--hero::before {
  content: "";
  position: absolute; left: 0; top: 24px; bottom: 24px; width: 2px;
  background: linear-gradient(180deg, transparent, var(--brass), transparent);
}
.empty { padding: 14px 0; }
.empty h3 { font-family: var(--font-display); font-size: 22px; margin: 6px 0 8px; }
.empty p:not(.eyebrow) { color: var(--muted); margin-bottom: 14px; }

/* ---------- seals, meters, chevrons ---------- */
.seal {
  --size: 86px;
  width: var(--size); height: var(--size);
  display: inline-grid; place-items: center;
  position: relative; border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #1c252a, #0c1012 70%);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 0 0 5px rgba(201, 164, 92, 0.05), 0 14px 34px rgba(0, 0, 0, 0.4);
  flex: 0 0 auto;
}
.seal__ring {
  position: absolute; inset: 6px; border-radius: 50%;
  background: conic-gradient(var(--brass) calc(var(--p, 0) * 1%), rgba(201, 164, 92, 0.10) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
}
.seal__numeral { font-family: var(--font-display); font-size: 27px; color: var(--brass-bright); letter-spacing: 0.05em; }
.seal--sm { --size: 46px; }
.seal--sm .seal__numeral { font-size: 15px; }
.chevrons { display: inline-flex; gap: 3px; }
.chevron { width: 9px; height: 5px; border-top: 1.5px solid rgba(201, 164, 92, 0.22); border-left: 1.5px solid rgba(201, 164, 92, 0.22); transform: skewX(-18deg); }
.chevron.is-on { border-color: var(--brass); }
.meter-row { margin: 14px 0; }
.meter-row__head { display: flex; justify-content: space-between; gap: 10px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.meter { display: block; height: 3px; width: 100%; background: rgba(201, 164, 92, 0.12); position: relative; overflow: hidden; margin: 4px 0; }
.meter__fill { display: block; height: 100%; background: linear-gradient(90deg, var(--brass-dim), var(--brass-bright)); }
.meter::after { content: ""; position: absolute; inset: 0; background-image: repeating-linear-gradient(90deg, transparent 0 23%, rgba(11, 13, 14, 0.7) 23% 24%); }
.ring {
  --size: 96px;
  width: var(--size); height: var(--size); border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; align-content: center; position: relative;
  background: radial-gradient(circle at 35% 30%, #1b2328, #0b0f11 75%);
  border: 1px solid var(--line-strong);
}
.ring::before {
  content: ""; position: absolute; inset: 4px; border-radius: 50%;
  background: conic-gradient(var(--jade-bright) calc(var(--p, 0) * 1%), rgba(127, 151, 168, 0.12) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
}
.ring__value { font-family: var(--font-display); font-size: 26px; color: var(--paper); z-index: 1; line-height: 1; }
.ring__label { font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 4px; z-index: 1; }

/* ---------- stamps ---------- */
.stamp {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 8.5px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 6px 10px;
  border: 1.5px double currentColor;
  transform: rotate(-3deg);
  background: rgba(11, 13, 14, 0.35);
  white-space: nowrap;
}
.stamp--brass { color: var(--brass); }
.stamp--jade { color: var(--jade-bright); border-color: rgba(147, 192, 160, 0.5); background: rgba(95, 138, 110, 0.08); }
.stamp--oxblood { color: #d99599; border-color: rgba(181, 87, 93, 0.55); background: rgba(125, 42, 47, 0.1); }
.stamp--steel { color: var(--steel); border-color: rgba(127, 151, 168, 0.4); }
.stamp--sm { font-size: 8px; padding: 4px 7px; }
.stamp--lg { font-size: 12px; letter-spacing: 0.3em; padding: 12px 20px; transform: rotate(-4deg); animation: stampIn 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both; }

/* ---------- onboarding ---------- */
.onboard { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); min-height: 100vh; }
.onboard__left {
  position: relative;
  padding: clamp(36px, 7vh, 84px) clamp(28px, 7vw, 110px);
  display: flex; flex-direction: column; justify-content: center;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(700px 460px at 12% 8%, rgba(201, 164, 92, 0.10), transparent 55%),
    radial-gradient(600px 500px at 80% 100%, rgba(125, 42, 47, 0.12), transparent 60%);
  overflow: hidden;
}
.onboard__left::before {
  content: "";
  position: absolute; inset: 18px; border: 1px solid rgba(201, 164, 92, 0.12); pointer-events: none;
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
}
.onboard__left::after {
  content: "MMXXVI";
  position: absolute; right: 22px; bottom: 16px;
  font-family: var(--font-display); font-size: 11px; letter-spacing: 0.4em; color: rgba(201, 164, 92, 0.3);
  writing-mode: vertical-rl;
}
.onboard__title {
  font-size: clamp(64px, 9vw, 132px);
  line-height: 0.88;
  margin: 18px 0 26px;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #f2e7cd 0%, #d9bd84 55%, #a67f3e 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.4));
}
.onboard__lede { max-width: 560px; color: var(--paper-dim); font-size: 17.5px; line-height: 1.65; }
.onboard__quote {
  margin: 26px 0 30px; padding-left: 18px; border-left: 2px solid var(--brass);
  font-family: var(--font-display); font-size: 16px; letter-spacing: 0.04em; color: var(--brass-bright); font-style: italic;
}
.onboard__discs { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 26px; max-width: 620px; }
.onboard__discs li { display: flex; gap: 12px; align-items: baseline; }
.onboard__numeral { font-family: var(--font-display); color: var(--brass); font-size: 13px; min-width: 20px; }
.onboard__discs strong { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper); font-weight: 500; }
.onboard__discs small { display: block; color: var(--muted); font-size: 13px; font-style: italic; }
.onboard__fine { margin-top: 30px; font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.onboard__right {
  display: flex; align-items: center; justify-content: center;
  padding: clamp(24px, 5vh, 70px) clamp(20px, 4vw, 60px);
  background: linear-gradient(180deg, rgba(18, 24, 27, 0.55), rgba(9, 12, 13, 0.8));
}
.panel--form { width: 100%; max-width: 470px; border: 1px solid var(--line); padding: 34px 32px; background: linear-gradient(165deg, rgba(24, 31, 35, 0.96), rgba(13, 17, 19, 0.98)); box-shadow: var(--shadow-panel); position: relative; animation: rise 0.7s 0.1s ease both; }
.panel--form::after { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(233, 223, 201, 0.04); pointer-events: none; }
.panel__title { font-size: 27px; margin: 8px 0 20px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.field > span, .field legend { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.field em { font-style: italic; text-transform: none; letter-spacing: 0; color: rgba(141, 147, 143, 0.7); }
.field input, .field select, .field textarea, .input {
  width: 100%;
  background: rgba(8, 11, 12, 0.6);
  border: 1px solid var(--line);
  color: var(--paper);
  padding: 11px 13px;
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  border-color: var(--brass); background: rgba(8, 11, 12, 0.85);
  box-shadow: 0 0 0 1px rgba(201, 164, 92, 0.2);
}
.field textarea { resize: vertical; min-height: 44px; }
.field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--brass) 50%), linear-gradient(135deg, var(--brass) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.field--group { border: 1px solid transparent; padding: 0; margin-bottom: 15px; }
.field--group legend { margin-bottom: 9px; }
.field--line { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 10px; margin-bottom: 8px; }
.field--line > span { text-transform: uppercase; font-size: 8.5px; }
.field-row { display: grid; grid-template-columns: 1fr 130px; gap: 12px; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); cursor: pointer; transition: border-color 0.18s ease, background 0.18s ease; }
.check:hover { border-color: var(--line-strong); background: rgba(201, 164, 92, 0.04); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box { width: 15px; height: 15px; border: 1px solid var(--line-strong); flex: 0 0 auto; margin-top: 2px; position: relative; }
.check input:checked + .check__box { background: var(--brass); border-color: var(--brass); }
.check input:checked + .check__box::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 9px; color: #14100a; }
.check__text { display: flex; flex-direction: column; }
.check__text strong { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; color: var(--paper); }
.check__text small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.check--sm { padding: 8px 10px; }
.oath { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 18px; font-size: 13.5px; color: var(--paper-dim); cursor: pointer; }
.oath input { margin-top: 4px; accent-color: var(--brass); }
.input[type="search"] { padding-left: 38px; }

/* ---------- war room ---------- */
.grid { display: grid; gap: 22px; }
.grid--war { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr); align-items: start; }
.col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.next-move__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.next-move__title { font-size: clamp(26px, 2.8vw, 36px); margin: 12px 0 12px; }
.next-move__body { color: var(--paper-dim); font-size: 16px; }
.next-move__foot { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.next-move__reason { display: flex; gap: 10px; align-items: baseline; font-size: 14px; color: var(--muted); margin-top: 14px; }
.next-move__reason span { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass); white-space: nowrap; }
.next-move__goal { margin-top: 10px; font-size: 14px; color: var(--paper-dim); font-style: italic; }
.next-move__goal span { display: block; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); font-style: normal; margin-bottom: 4px; }
.briefing-card__drill { margin: 16px 0; padding: 13px 15px; border: 1px dashed rgba(201, 164, 92, 0.25); background: rgba(201, 164, 92, 0.03); }
.briefing-card__drillname { font-family: var(--font-display); font-size: 19px; margin-top: 4px; }
.filed-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.readiness-card__body { display: flex; gap: 18px; align-items: center; margin-bottom: 6px; }
.readiness-notes { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.readiness-notes li { display: flex; flex-direction: column; font-size: 12.5px; }
.readiness-notes li span { color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; }
.counsel-card__quote { font-family: var(--font-display); font-size: 19px; line-height: 1.5; color: var(--paper); font-style: italic; margin: 12px 0; }
.counsel-card__name { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); margin-bottom: 14px; }
.streak-card__num { font-family: var(--font-display); font-size: 58px; line-height: 1; color: var(--brass-bright); margin: 10px 0 4px; }
.streak-card__num span { display: block; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.streak-card__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.streak-card__stats div { display: flex; flex-direction: column; }
.streak-card__stats strong { font-family: var(--font-display); font-size: 20px; font-weight: 500; color: var(--paper); }
.streak-card__stats span { font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.record { display: flex; flex-direction: column; }
.record__row { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(201, 164, 92, 0.1); }
.record__row:last-child { border-bottom: 0; }
.record__dot { width: 6px; height: 6px; transform: rotate(45deg); background: var(--brass); }
.record__dot--jade { background: var(--jade-bright); }
.record__dot--oxblood { background: var(--oxblood-bright); }
.record__dot--steel { background: var(--steel); }
.record__label { font-size: 14px; color: var(--paper-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record__meta { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.record__time { font-family: var(--font-mono); font-size: 8.5px; color: rgba(141, 147, 143, 0.65); white-space: nowrap; }

/* ---------- map ---------- */
.map-card { overflow: hidden; }
.map-wrap { margin: 8px -10px -6px; }
.map { width: 100%; height: auto; }
.map__field { fill: transparent; }
.map__rings ellipse, .map__rings circle { stroke: rgba(201, 164, 92, 0.12); stroke-width: 1; stroke-dasharray: 2 7; }
.map__compass path { stroke: rgba(201, 164, 92, 0.16); stroke-width: 1; fill: none; }
.map-node { cursor: pointer; transition: transform 0.18s ease; }
.map-node__halo { fill: none; stroke: transparent; stroke-width: 1; transition: stroke 0.2s ease; }
.map-node__base { fill: #0f1517; stroke: rgba(201, 164, 92, 0.28); stroke-width: 1; transition: fill 0.2s ease, stroke 0.2s ease; }
.map-node__progress { fill: none; stroke: var(--brass); stroke-width: 2.5; stroke-linecap: round; }
.map-node__numeral { font-family: var(--font-display); fill: var(--brass-bright); font-size: 14px; letter-spacing: 0.06em; pointer-events: none; }
.map-node__name { font-family: var(--font-mono); fill: var(--paper-dim); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; pointer-events: none; }
.map-node__chamber { font-family: var(--font-body); fill: var(--muted); font-size: 8.5px; font-style: italic; pointer-events: none; }
.map-node:hover .map-node__base { fill: #1a2429; stroke: var(--brass); }
.map-node:hover .map-node__halo { stroke: rgba(201, 164, 92, 0.22); }
.map-node:focus-visible { outline: none; }
.map-node:focus-visible .map-node__halo { stroke: var(--brass); }
.map__centre { cursor: pointer; }
.map__centre circle { fill: #0c1012; stroke: var(--line-strong); stroke-width: 1; }
.map__rank-label { font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.3em; fill: var(--muted); }
.map__rank-name { font-family: var(--font-display); font-size: 13px; letter-spacing: 0.08em; fill: var(--paper); }
.map__rank-merit { font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.12em; fill: var(--brass); }
.map-caption { font-size: 12px; color: var(--muted); text-align: center; margin-top: 6px; font-style: italic; }

/* ---------- campaign ---------- */
.chamber-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 18px; margin-top: 22px; }
.chamber-card {
  position: relative; display: flex; flex-direction: column; gap: 7px; align-items: stretch;
  text-align: left; padding: 22px 22px 18px;
  background: linear-gradient(165deg, rgba(23, 30, 34, 0.94), rgba(13, 17, 19, 0.98));
  border: 1px solid var(--line); transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.chamber-card::after { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(233, 223, 201, 0.035); pointer-events: none; }
.chamber-card:hover { border-color: var(--line-strong); transform: translateY(-3px); background: linear-gradient(165deg, rgba(28, 37, 42, 0.98), rgba(13, 17, 19, 0.99)); }
.chamber-card__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.chamber-card__numeral { font-family: var(--font-display); font-size: 32px; color: var(--brass); line-height: 1; }
.chamber-card__name { font-size: 23px; margin-top: 2px; }
.chamber-card__disc { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.chamber-card__master { font-size: 13px; color: var(--paper-dim); font-style: italic; margin-top: 2px; }
.chamber-card__foot { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.chamber-aside { display: flex; flex-direction: column; gap: 8px; min-width: 180px; }
.chamber-aside .chevrons { margin-bottom: 2px; }
.room-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.room-card {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 15px 16px; text-align: left; border: 1px solid var(--line); background: rgba(8, 11, 12, 0.35);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.room-card:hover { border-color: var(--line-strong); background: rgba(201, 164, 92, 0.04); transform: translateX(2px); }
.room-card.is-locked { opacity: 0.55; cursor: not-allowed; }
.room-card.is-locked:hover { transform: none; border-color: var(--line); }
.room-card__index { font-family: var(--font-display); font-size: 19px; color: var(--brass); border-right: 1px solid var(--line); padding-right: 12px; }
.room-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.room-card__title { font-family: var(--font-display); font-size: 18px; letter-spacing: 0.02em; }
.room-card__meta { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.room-card__arrow { color: var(--brass); font-size: 18px; }
.room-card__lock { color: var(--muted); }
.room-card__lock .icon { width: 17px; height: 17px; }
.trial-card { border-color: rgba(201, 164, 92, 0.3); background: linear-gradient(165deg, rgba(27, 33, 31, 0.96), rgba(13, 17, 19, 0.98)); }
.mission-list { display: flex; flex-direction: column; }
.mission-list__row { border-bottom: 1px solid rgba(201, 164, 92, 0.1); }
.mission-list__row:last-child { border-bottom: 0; }
.mission-list__btn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 2px; text-align: left; }
.mission-list__btn:hover .mission-list__title { color: var(--brass-bright); }
.mission-list__title { font-size: 14.5px; color: var(--paper-dim); flex: 1; transition: color 0.18s ease; }
.mission-list__meta { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.mission-list__xp { font-family: var(--font-mono); font-size: 10px; color: var(--brass); }

/* ---------- master / council ---------- */
.master-card { border-color: var(--line); }
.master-card__mark {
  width: 62px; height: 62px; display: grid; place-items: center; margin: 6px 0 14px;
  font-family: var(--font-display); font-size: 22px; color: var(--brass-bright);
  border: 1px solid var(--line-strong); border-radius: 50%; background: radial-gradient(circle at 32% 28%, #1c252a, #0c1012 70%);
}
.master-card__name { font-size: 25px; }
.master-card__meta { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 4px 0 12px; }
.master-card__quote { font-family: var(--font-display); font-style: italic; font-size: 17px; line-height: 1.5; color: var(--paper); border-left: 2px solid var(--brass); padding-left: 14px; margin: 14px 0; }
.counsel-list { display: flex; flex-direction: column; gap: 2px; margin: 12px 0; }
.counsel-list details { border-bottom: 1px solid rgba(201, 164, 92, 0.1); }
.counsel-list summary { cursor: pointer; padding: 10px 0; font-family: var(--font-display); font-size: 16px; color: var(--paper-dim); list-style: none; position: relative; padding-right: 18px; }
.counsel-list summary::-webkit-details-marker { display: none; }
.counsel-list summary::after { content: "+"; position: absolute; right: 2px; color: var(--brass); font-family: var(--font-mono); }
.counsel-list details[open] summary::after { content: "−"; }
.counsel-list details p { font-size: 14px; color: var(--muted); padding-bottom: 12px; }
.council-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.council-card { border: 1px solid var(--line); background: linear-gradient(165deg, rgba(23, 30, 34, 0.94), rgba(13, 17, 19, 0.98)); padding: 26px; position: relative; }
.council-card::after { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(233, 223, 201, 0.035); pointer-events: none; }
.council-card__head { display: flex; gap: 16px; align-items: center; }
.council-card__mark { width: 58px; height: 58px; flex: 0 0 auto; display: grid; place-items: center; font-family: var(--font-display); font-size: 20px; color: var(--brass-bright); border: 1px solid var(--line-strong); border-radius: 50%; }
.council-card__name { font-size: 24px; }
.council-card__meta { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.council-card__quote { font-family: var(--font-display); font-style: italic; font-size: 16px; line-height: 1.5; color: var(--brass-bright); border-left: 2px solid var(--oxblood); padding-left: 14px; margin: 16px 0 12px; }
.council-card__bio { font-size: 13.5px; color: var(--muted); }

/* ---------- situation / trial ---------- */
.situation-card { border-color: var(--line-strong); background: linear-gradient(165deg, rgba(25, 32, 36, 0.97), rgba(12, 16, 18, 0.99)); }
.situation-card__head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.situation-card__badge { font-family: var(--font-display); font-size: 22px; color: var(--brass); border: 1px solid var(--line); width: 46px; height: 46px; display: grid; place-items: center; }
.situation-card__setup { font-size: 19px; line-height: 1.6; color: var(--paper); }
.situation-card--trial { border-color: rgba(125, 42, 47, 0.5); }
.options { display: flex; flex-direction: column; gap: 11px; margin-top: 6px; }
.option {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; align-items: center;
  text-align: left; padding: 18px 20px; border: 1px solid var(--line);
  background: rgba(8, 11, 12, 0.4); transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.option:hover { border-color: var(--brass); background: rgba(201, 164, 92, 0.06); transform: translateX(3px); }
.option__key { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-strong); font-family: var(--font-display); font-size: 19px; color: var(--brass); }
.option__text { font-size: 15.5px; color: var(--paper-dim); }
.verdict-card { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; border-color: var(--line-strong); }
.verdict-card--best { background: linear-gradient(165deg, rgba(24, 34, 28, 0.96), rgba(12, 16, 18, 0.99)); }
.verdict-card--ok { background: linear-gradient(165deg, rgba(32, 29, 21, 0.96), rgba(12, 16, 18, 0.99)); }
.verdict-card--bad { background: linear-gradient(165deg, rgba(35, 22, 23, 0.96), rgba(12, 16, 18, 0.99)); }
.verdict-card__verdict { font-family: var(--font-display); font-size: 24px; color: var(--paper); }
.verdict-card__choice { font-size: 14px; color: var(--muted); font-style: italic; border-left: 2px solid var(--line-strong); padding-left: 14px; }
.verdict-card__choice span { display: block; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); font-style: normal; margin-bottom: 3px; }
.debrief { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; width: 100%; }
.debrief__name { font-size: 23px; margin: 6px 0 4px; color: var(--brass-bright); }
.debrief__source { font-size: 12px; color: var(--muted); font-style: italic; margin-bottom: 12px; }
.debrief__why { font-size: 15.5px; color: var(--paper-dim); margin-bottom: 14px; }
.debrief__move { font-size: 15px; color: var(--paper); padding: 12px 16px; border-left: 2px solid var(--brass); background: rgba(201, 164, 92, 0.05); }
.debrief__move span { display: block; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass); margin-bottom: 4px; }
.xp-note { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.paths { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.path { border: 1px solid rgba(201, 164, 92, 0.14); padding: 12px 15px; }
.path summary { cursor: pointer; font-size: 14.5px; color: var(--paper-dim); list-style: none; padding-right: 16px; position: relative; }
.path summary::-webkit-details-marker { display: none; }
.path summary::after { content: "+"; position: absolute; right: 0; color: var(--brass); font-family: var(--font-mono); }
.path[open] summary::after { content: "−"; }
.path__key { font-family: var(--font-display); color: var(--brass); margin-right: 10px; }
.path__verdict { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.16em; text-transform: uppercase; margin: 10px 0 5px; }
.path--best .path__verdict { color: var(--jade-bright); }
.path--ok .path__verdict { color: var(--brass); }
.path--bad .path__verdict { color: var(--oxblood-bright); }
.path p:not(.path__verdict) { font-size: 13.5px; color: var(--muted); }
.mission-callout { border-color: rgba(95, 138, 110, 0.35); }

/* ---------- field ---------- */
.filter-bar { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-row--right { align-items: flex-start; }
.chip-btn {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 7px 11px; border: 1px solid var(--line); color: var(--muted);
  transition: all 0.16s ease;
}
.chip-btn:hover { color: var(--paper); border-color: var(--line-strong); }
.chip-btn.is-active { color: #14100a; background: var(--brass); border-color: var(--brass); font-weight: 600; }
.mission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.mission-card { border: 1px solid var(--line); background: linear-gradient(165deg, rgba(23, 30, 34, 0.94), rgba(13, 17, 19, 0.98)); padding: 22px; display: flex; flex-direction: column; position: relative; }
.mission-card::after { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(233, 223, 201, 0.035); pointer-events: none; }
.mission-card.is-filed { opacity: 0.72; }
.mission-card__head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.mission-card__title { font-family: var(--font-display); font-size: 21px; margin-top: 5px; }
.mission-card__xp { font-family: var(--font-mono); font-size: 12px; color: var(--brass-bright); border: 1px solid var(--line-strong); padding: 5px 8px; white-space: nowrap; }
.mission-card__action { font-size: 14.5px; color: var(--paper-dim); margin: 14px 0 10px; }
.mission-card__why { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.mission-card__why span { display: block; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); margin-bottom: 3px; }
.mission-card__proof { display: flex; gap: 10px; align-items: baseline; margin: 6px 0 2px; font-size: 11.5px; color: var(--muted); }
.mission-card__proof span { font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); white-space: nowrap; }
.mission-card__filed { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); font-style: italic; }
.mission-card .btn-row { margin-top: auto; padding-top: 16px; }

/* ---------- codex ---------- */
.codex-tools { position: relative; margin-bottom: 20px; max-width: 520px; }
.codex-tools::before { content: "⌕"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--brass); font-size: 18px; pointer-events: none; }
.codex-list { display: flex; flex-direction: column; gap: 26px; }
.codex-group__head { display: flex; align-items: baseline; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 10px; }
.codex-group__numeral { font-family: var(--font-display); color: var(--brass); font-size: 18px; }
.codex-group__head .card__title { margin: 0; flex: 1; }
.codex-entry { border-bottom: 1px solid rgba(201, 164, 92, 0.1); }
.codex-entry__summary { display: flex; align-items: baseline; gap: 12px; padding: 12px 2px; cursor: pointer; }
.codex-entry__seal { color: var(--brass); font-size: 10px; }
.codex-entry__name { font-family: var(--font-display); font-size: 18px; color: var(--paper-dim); flex: 1; }
.codex-entry[open] .codex-entry__name { color: var(--brass-bright); }
.codex-entry__source { font-size: 11.5px; color: var(--muted); font-style: italic; text-align: right; max-width: 46%; }
.codex-entry__body { padding: 4px 0 16px 22px; }
.codex-entry__one { font-family: var(--font-display); font-size: 17px; color: var(--paper); margin-bottom: 10px; }
.codex-entry__body p:not(.codex-entry__one) { font-size: 13.5px; color: var(--muted); margin-bottom: 7px; }
.codex-entry.is-locked { opacity: 0.55; }
.codex-entry.is-locked .codex-entry__summary { cursor: default; }
.codex-entry__lock { color: var(--muted); display: grid; place-items: center; }
.codex-entry__lock .icon { width: 14px; height: 14px; }
.codex-entry.is-hidden { display: none; }

/* ---------- ranks ---------- */
.rank-list { display: flex; flex-direction: column; }
.rank-row { display: grid; grid-template-columns: 54px 80px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 4px; border-bottom: 1px solid rgba(201, 164, 92, 0.1); position: relative; }
.rank-row:last-child { border-bottom: 0; }
.rank-row__numeral { font-family: var(--font-display); font-size: 21px; color: var(--brass-dim); }
.rank-row__body { display: flex; flex-direction: column; }
.rank-row__body strong { font-family: var(--font-display); font-size: 21px; font-weight: 500; }
.rank-row__body span { font-size: 13.5px; color: var(--muted); font-style: italic; }
.rank-row__req { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); text-align: right; }
.rank-row--passed .rank-row__numeral, .rank-row--passed .rank-row__body strong { color: var(--paper-dim); }
.rank-row--current { background: linear-gradient(90deg, rgba(201, 164, 92, 0.08), transparent); }
.rank-row--current .rank-row__numeral, .rank-row--current .rank-row__body strong { color: var(--brass-bright); }
.rank-row--locked { opacity: 0.55; }
.plain-list { display: flex; flex-direction: column; gap: 12px; }
.plain-list li { font-size: 14px; color: var(--paper-dim); padding-left: 16px; position: relative; }
.plain-list li::before { content: "◆"; position: absolute; left: 0; top: 2px; color: var(--brass-dim); font-size: 8px; }

/* ---------- ledger ---------- */
.grid--ledger { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.85fr); align-items: start; }
.grid--ranks { grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.75fr); align-items: start; }
.grid--chamber { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.85fr); align-items: start; }
.journal-form { margin: 8px 0 18px; }
.journal-form textarea { width: 100%; background: rgba(8, 11, 12, 0.55); border: 1px solid var(--line); padding: 13px; min-height: 82px; resize: vertical; color: var(--paper); font-family: var(--font-body); font-size: 15px; }
.journal-form textarea:focus { border-color: var(--brass); outline: none; }
.journal-form .btn-row { margin-top: 10px; justify-content: flex-end; }
.journal-list { display: flex; flex-direction: column; }
.journal-entry { padding: 13px 0; border-top: 1px solid rgba(201, 164, 92, 0.1); }
.journal-entry time { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.journal-entry p { font-size: 15px; color: var(--paper-dim); margin-top: 4px; }
.journal-entry.is-empty { border-top: 0; color: var(--muted); font-style: italic; font-size: 14px; }
.reality-list { display: flex; flex-direction: column; }
.reality-row { display: grid; grid-template-columns: 120px 70px 1fr; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid rgba(201, 164, 92, 0.1); }
.reality-row time { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.reality-row__scores { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--muted); }
.brief-pre {
  white-space: pre-wrap; font-family: var(--font-mono); font-size: 10px; line-height: 1.7;
  color: var(--paper-dim); background: rgba(8, 11, 12, 0.5); border: 1px solid var(--line);
  padding: 14px; max-height: 240px; overflow: auto; margin: 10px 0;
}

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; animation: fadeIn 0.22s ease both; }
.modal__scrim { position: absolute; inset: 0; background: rgba(4, 6, 7, 0.78); backdrop-filter: blur(4px); }
.modal__panel {
  position: relative; z-index: 1; width: 100%; max-width: 720px; max-height: 88vh; overflow: auto;
  background: linear-gradient(165deg, rgba(25, 32, 36, 0.99), rgba(12, 16, 18, 0.99));
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.3s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}
.modal__panel::after { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(233, 223, 201, 0.04); pointer-events: none; }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 24px 28px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: linear-gradient(180deg, rgba(23, 30, 34, 0.99), rgba(23, 30, 34, 0.94)); z-index: 2; }
.modal__title { font-family: var(--font-display); font-size: 27px; font-weight: 500; letter-spacing: 0.03em; margin-top: 4px; }
.modal__close { color: var(--muted); font-size: 15px; }
.modal__body { padding: 22px 28px 28px; }
.modal-section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.modal-section:last-child { border-bottom: 0; margin-bottom: 0; }
.modal-subtitle { font-size: 23px; margin: 6px 0 8px; }
.modal-lead { font-size: 15.5px; color: var(--paper-dim); margin: 6px 0 10px; }
.modal-why, .modal-proof { font-size: 14px; color: var(--muted); margin: 10px 0; }
.modal-why span, .modal-proof span { display: block; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass); margin-bottom: 4px; }
.steps { counter-reset: step; display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.steps li { display: flex; gap: 12px; font-size: 14.5px; color: var(--paper-dim); counter-increment: step; }
.steps li::before { content: counter(step); font-family: var(--font-mono); font-size: 9px; color: var(--brass); border: 1px solid var(--line); width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; margin-top: 2px; }
.modal-divider { height: 1px; background: var(--line); margin: 18px 0; }
.modal-quote { font-family: var(--font-display); font-size: 17px; font-style: italic; color: var(--paper); border-left: 2px solid var(--brass); padding-left: 14px; margin: 12px 0; }
.timer { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; padding: 14px 16px; border: 1px dashed var(--line); background: rgba(201, 164, 92, 0.03); }
.timer__display { font-family: var(--font-display); font-size: 34px; letter-spacing: 0.1em; color: var(--brass-bright); line-height: 1; }
.timer__bar { height: 2px; background: rgba(201, 164, 92, 0.15); overflow: hidden; }
.timer__bar span { display: block; height: 100%; width: 0; background: var(--brass); transition: width 1s linear; }
.reality-q { border: 0; padding: 0; margin: 0 0 18px; }
.reality-q legend { font-family: var(--font-display); font-size: 18px; margin-bottom: 9px; }
.reality-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.radio { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--paper-dim); border: 1px solid var(--line); padding: 9px 11px; cursor: pointer; }
.radio:hover { border-color: var(--line-strong); }
.radio input { accent-color: var(--brass); }
.radio:has(input:checked) { border-color: var(--brass); background: rgba(201, 164, 92, 0.07); color: var(--paper); }
.mission-form { margin-top: 16px; }

/* ---------- toast ---------- */
.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 150; display: flex; flex-direction: column; gap: 9px; max-width: 360px; pointer-events: none; }
.toast {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 16px 13px 13px;
  background: linear-gradient(165deg, rgba(28, 36, 40, 0.99), rgba(14, 18, 20, 0.99));
  border: 1px solid var(--line-strong); border-left: 2px solid var(--brass);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: translateX(24px); opacity: 0;
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.35s ease;
}
.toast.is-in { transform: translateX(0); opacity: 1; }
.toast.is-out { transform: translateX(20px); opacity: 0; }
.toast--jade { border-left-color: var(--jade-bright); }
.toast--oxblood { border-left-color: var(--oxblood-bright); }
.toast__seal { color: var(--brass); font-size: 12px; margin-top: 2px; }
.toast--jade .toast__seal { color: var(--jade-bright); }
.toast--oxblood .toast__seal { color: var(--oxblood-bright); }
.toast__text { display: flex; flex-direction: column; gap: 2px; }
.toast__text strong { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper); font-weight: 500; }
.toast__text span { font-size: 12.5px; color: var(--muted); }

/* ---------- misc ---------- */
.demo-banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 22px; border: 1px dashed rgba(201, 164, 92, 0.4); background: rgba(201, 164, 92, 0.05); font-size: 12.5px; color: var(--paper-dim); }
.demo-banner__tag { font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass-bright); border: 1px solid var(--line-strong); padding: 4px 7px; white-space: nowrap; }
.demo-banner__x { margin-left: auto; color: var(--muted); padding: 2px 6px; }
.readiness-notes { list-style: none; }
.card:has(.empty) { padding-bottom: 20px; }
.noscript { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.fatal { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 20px; background: rgba(5, 7, 8, 0.96); }
.fatal__panel { max-width: 720px; width: 100%; border: 1px solid var(--oxblood); background: var(--panel); padding: 30px; }
.fatal__title { font-family: var(--font-display); font-size: 34px; margin: 8px 0 12px; }
.fatal__msg { white-space: pre-wrap; font-family: var(--font-mono); font-size: 10px; color: var(--muted); background: rgba(0, 0, 0, 0.4); padding: 14px; max-height: 240px; overflow: auto; }
.fatal__hint { font-size: 14px; color: var(--paper-dim); margin: 14px 0; }

/* ---------- animations ---------- */
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(0.99); } to { opacity: 1; transform: none; } }
@keyframes stampIn { from { opacity: 0; transform: rotate(-10deg) scale(1.35); } to { opacity: 1; transform: rotate(-4deg) scale(1); } }

/* ---------- scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(201, 164, 92, 0.3) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(201, 164, 92, 0.24); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .grid--war, .grid--ledger, .grid--ranks, .grid--chamber { grid-template-columns: 1fr; }
  .col--side { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  .col--side > .card { height: 100%; }
  .page-head__title { font-size: clamp(32px, 5vw, 46px); }
}
@media (max-width: 900px) {
  :root { --rail-w: 0px; }
  .app { grid-template-columns: 1fr; }
  .rail {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto;
    flex-direction: row; align-items: center; gap: 4px;
    padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-right: 0; border-top: 1px solid var(--line);
    background: rgba(12, 16, 18, 0.97); backdrop-filter: blur(14px);
    z-index: 100;
  }
  .rail__brand { display: none; }
  .rail__nav { flex-direction: row; flex: 1; gap: 0; justify-content: space-around; }
  .rail__link { flex-direction: column; gap: 4px; padding: 7px 5px; border-left: 0; border-top: 2px solid transparent; flex: 1; justify-content: center; }
  .rail__label { font-size: 7.5px; letter-spacing: 0.08em; }
  .rail__link.is-active { border-left: 0; border-top-color: var(--brass); background: transparent; }
  .rail__foot { border-top: 0; padding: 0; flex: 0 0 auto; }
  .rail__rank { display: none; }
  .icon-btn { width: 34px; height: 34px; }
  .stage { padding: 26px 18px 108px; }
  .page-head__row { flex-direction: column; align-items: flex-start; gap: 18px; }
  .page-head__aside { width: 100%; }
  .campaign-tally { justify-content: flex-start; text-align: left; }
  .col--side { grid-template-columns: 1fr; }
  .onboard { grid-template-columns: 1fr; }
  .onboard__left { border-right: 0; border-bottom: 1px solid var(--line); padding: 54px 22px 40px; min-height: auto; }
  .onboard__title { font-size: clamp(58px, 17vw, 100px); }
  .onboard__discs { grid-template-columns: 1fr; }
  .onboard__right { padding: 30px 18px 60px; }
  .panel--form { padding: 26px 20px; }
  .reality-options { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .rank-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .rank-row__seal { display: none; }
  .rank-row__req { grid-column: 2; text-align: left; }
  .field--line { grid-template-columns: 76px 1fr; }
  .toast-stack { left: 14px; right: 14px; bottom: 86px; max-width: none; }
  .map-wrap { margin: 4px -18px 0; }
  .modal { padding: 0; align-items: end; }
  .modal__panel { max-width: none; max-height: 92vh; border-left: 0; border-right: 0; border-bottom: 0; animation: sheetIn 0.3s cubic-bezier(0.2, 0.9, 0.2, 1) both; }
  .modal__head, .modal__body { padding-left: 20px; padding-right: 20px; }
  .mission-grid { grid-template-columns: 1fr; }
  .council-grid { grid-template-columns: 1fr; }
  .chamber-grid { grid-template-columns: 1fr 1fr; }
  .situation-card__setup { font-size: 17px; }
  .option { grid-template-columns: 38px minmax(0, 1fr); padding: 15px; gap: 12px; }
  .option__key { width: 36px; height: 36px; font-size: 16px; }
  .option__text { font-size: 14.5px; }
  .journal-form .btn-row { justify-content: flex-start; }
  .reality-row { grid-template-columns: 1fr auto; }
  .reality-row__scores { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .chamber-grid { grid-template-columns: 1fr; }
  .streak-card__stats { grid-template-columns: repeat(3, 1fr); }
  .check-grid, .field-row { grid-template-columns: 1fr; }
  .record__row { grid-template-columns: 9px minmax(0, 1fr) auto; }
  .record__time { display: none; }
  .card { padding: 22px 18px; }
  .card--hero { padding: 24px 20px; }
  .page-head__rank { gap: 12px; }
  .onboard__left::before { inset: 10px; }
  .demo-banner { flex-wrap: wrap; }
  .onboard__title { font-size: clamp(52px, 16vw, 78px); }
}
@keyframes sheetIn { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }

body.no-motion *, body.no-motion *::before, body.no-motion *::after { animation: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

@media print {
  body { background: #fff; color: #111; }
  .rail, .toast-stack, .grain, .demo-banner { display: none !important; }
  .app { display: block; }
  .card { break-inside: avoid; border-color: #999; background: #fff; color: #111; }
}
