/* Axiom. Charcoal stone, bone type, and one crimson that is spent only on proof:
   the lit seam of the mark, the edge of a closed branch, the crown.
   One accent, one radius family, one theme, because a proof board is a lit instrument
   in a dark room and the cascade only reads against dark. */

:root {
  --bg: #14100F;
  --bg-deep: #0B0808;
  --surface: #1D1817;
  --surface-2: #251E1D;
  --surface-3: #2F2624;
  --fg: #F6EEE9;
  --muted: #B3A49C;
  --faint: #9C8D85;
  --hair: #3A302E;
  --hair-soft: rgba(246, 238, 233, 0.09);
  --accent: #E8434E;
  --accent-hi: #FF7078;
  --accent-deep: #A81B2A;
  --accent-wash: rgba(232, 67, 78, 0.14);
  --accent-line: rgba(232, 67, 78, 0.42);
  --bone: #F1E7E1;
  --danger: #FF8F84;

  --lift: 0 16px 34px -22px rgba(0, 0, 0, 0.95), 0 2px 6px -3px rgba(0, 0, 0, 0.55);
  --lift-2: 0 26px 52px -26px rgba(0, 0, 0, 1);
  --edge: inset 0 1px 0 rgba(255, 236, 230, 0.055);
  --ember: 0 0 0 1px var(--accent-line), 0 0 22px -6px rgba(232, 67, 78, 0.55);

  --r: 12px;
  --r-sm: 8px;
  --r-xs: 5px;
  --serif: "EB Garamond", Iowan Old Style, Palatino, Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  --measure: 34rem;
  --ease: cubic-bezier(0.22, 0.68, 0.3, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0; height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  font-variant-numeric: tabular-nums;
  -webkit-user-select: none; user-select: none;
}
input { -webkit-user-select: text; user-select: text; }

/* the world the icon lives in: an ember behind the top of the stone, and the lattice
   the proofs are cut from, both far enough back to never fight the type */
/* One painted layer, no masks: an ember over a lattice that fades into the stone.
   A masked fixed layer is a compositing trap on some devices, so the fade is a
   gradient in the same background stack instead. */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(84% 46% at 50% -6%, rgba(232, 67, 78, 0.20), rgba(232, 67, 78, 0) 68%),
    linear-gradient(180deg, rgba(20, 16, 15, 0) 0%, rgba(17, 13, 12, 0.86) 54%, rgba(11, 8, 8, 1) 100%),
    repeating-linear-gradient(0deg, rgba(246, 238, 233, 0.05) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(90deg, rgba(246, 238, 233, 0.05) 0 1px, transparent 1px 56px),
    linear-gradient(180deg, #1A1413 0%, var(--bg) 42%, var(--bg-deep) 100%);
}

#glyphs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* one stroke language, everywhere */
.ic {
  width: 20px; height: 20px; flex: none; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.mark-sm { width: 34px; height: 34px; display: block; }
.mark-live { width: 100%; height: 100%; display: block; overflow: visible; }

/* The shell is a column: the stage takes what is left and the tab bar sits at the end of
   the flow. A fixed tab bar was painting a ghost of itself at its static position in
   headless capture, and a column costs nothing. */
body { display: flex; flex-direction: column; overflow: hidden; }
#stage { position: relative; flex: 1 1 auto; min-height: 0; }
body.dragging { -webkit-user-select: none; user-select: none; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }
.screen[hidden] { display: none !important; }

.scroller {
  flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(10px + var(--sat, 0px)) 20px 48px;
  max-width: var(--measure); width: 100%; margin: 0 auto;
}
.view.is-in .scroller > * { animation: rise-in 0.42s var(--ease) both; }
.view.is-in .scroller > *:nth-child(2) { animation-delay: 0.045s; }
.view.is-in .scroller > *:nth-child(3) { animation-delay: 0.085s; }
.view.is-in .scroller > *:nth-child(4) { animation-delay: 0.12s; }
.view.is-in .scroller > *:nth-child(n+5) { animation-delay: 0.15s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------- headers ---------------- */
.head { padding: 18px 0 6px; }
.hero { display: flex; align-items: center; gap: 18px; padding: 14px 0 22px; }
.hero-art { width: 88px; height: 88px; flex: none; filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.7)); }
.hero-txt { min-width: 0; flex: 1; }
.hero-n { margin: 2px 0 10px; font-size: 34px; line-height: 1; letter-spacing: -0.02em; }
.hero-n b { font-weight: 600; }
.hero-n span { color: var(--faint); font-size: 17px; letter-spacing: 0; margin-left: 8px; }
.hero-bar { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5); }
.hero-bar i { display: block; height: 4px; border-radius: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  box-shadow: 0 0 10px -1px rgba(232, 67, 78, 0.8);
  transition: width 0.8s var(--ease); }
.head-h { font-size: 32px; line-height: 1.06; margin: 3px 0 0; letter-spacing: -0.022em; text-wrap: balance; }

.bar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(9px + var(--sat, 0px)) 12px 9px;
  border-bottom: 1px solid var(--hair);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--edge), 0 8px 20px -18px rgba(0, 0, 0, 1);
  flex: 0 0 auto; position: relative; z-index: 2;
}
.bar-mid { flex: 1; min-width: 0; text-align: center; }
.bar-title { font-family: var(--serif); font-size: 19px; margin: 0; letter-spacing: -0.008em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-sub { font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--faint); margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon {
  background: var(--surface-3); border: 1px solid var(--hair); border-radius: var(--r-sm);
  color: var(--muted); padding: 8px; cursor: pointer; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--edge); transition: transform 0.12s var(--ease), color 0.14s ease, border-color 0.14s ease;
}
.icon:active { transform: scale(0.94); color: var(--fg); }
.icon.spacer { visibility: hidden; }

/* ---------------- type ---------------- */
.eyebrow, .label, .panel-label, .sat-head, .stat .k, .v-k, .fg-p, .ob-step {
  font-family: var(--sans); font-size: 10.5px; font-weight: 500; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--faint); margin: 0;
}
.h2 { font-size: 21px; font-weight: 600; margin: 34px 0 10px; letter-spacing: -0.012em; text-wrap: balance;
  padding-top: 20px; border-top: 1px solid var(--hair); }
.lead { font-size: 16.5px; color: var(--muted); margin: 4px 0 22px; text-wrap: pretty; }
.help { font-family: var(--sans); font-size: 12.5px; line-height: 1.55; color: var(--faint); margin: 8px 0 0; }
.label { margin: 30px 0 10px; }
.colophon { font-family: var(--sans); font-size: 11.5px; color: var(--faint); letter-spacing: 0.04em;
  margin-top: 36px; line-height: 1.8; }

.btn {
  font-family: var(--sans); font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
  background: var(--bone); color: #16100F; border: 1px solid var(--bone);
  border-radius: var(--r-sm); padding: 10px 18px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: var(--lift);
  transition: transform 0.13s var(--ease), opacity 0.13s ease, box-shadow 0.13s ease;
}
.btn .ic { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px) scale(0.985); box-shadow: none; }
.btn[disabled] { opacity: 0.35; cursor: default; box-shadow: none; }
.btn.ghost { background: var(--surface-3); color: var(--fg); border-color: var(--hair); box-shadow: var(--edge); }
.btn.ghost:active { background: var(--surface-2); }
.btn.small { padding: 8px 13px; font-size: 13px; }
.btn.danger { color: var(--danger); border-color: rgba(255, 143, 132, 0.36); background: transparent; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; border-radius: 4px; }

.inline-note { font-family: var(--sans); font-size: 12.5px; line-height: 1.5; margin: 12px 0 0;
  padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--hair);
  background: var(--surface); color: var(--muted); }
.inline-note.is-bad { border-color: rgba(255, 143, 132, 0.5); color: var(--danger); }
.inline-note.is-ok { border-color: var(--accent-line); color: var(--accent-hi); }
.inline-note[hidden] { display: none !important; }

/* ---------------- onboarding ---------------- */
#onboard { justify-content: flex-start; z-index: 40; padding-top: var(--sat, 0px); }
.ob-art { width: 148px; height: 148px; margin: auto auto 0; flex: 0 0 auto;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.75)); }
.mk-half, .mk-seam { transition: transform 0.7s var(--ease), opacity 0.7s var(--ease); }
.mark-live.is-apart .mk-l { transform: translateX(-6px) translateY(-2px); }
.mark-live.is-apart .mk-r { transform: translateX(6px) translateY(2px); }
.mark-live.is-apart .mk-seam { opacity: 0.25; }
.mark-live .mk-seam { opacity: 1; }
.mark-live.is-shut .mk-seam { animation: seam-flare 0.9s ease-out 1; }
@keyframes seam-flare {
  0% { filter: brightness(2.4) drop-shadow(0 0 10px rgba(255, 90, 90, 0.9)); }
  100% { filter: none; }
}
.ob-track { flex: 0 1 auto; display: flex; overflow: hidden; margin-bottom: auto; }
.ob-card {
  flex: 0 0 100%; display: flex; flex-direction: column; justify-content: flex-start;
  padding: 38px 30px 0; transition: transform 0.38s var(--ease);
}
.ob-step { margin-bottom: 14px; color: var(--accent-hi); }
.ob-line { font-size: 31px; line-height: 1.16; margin: 0 0 14px; letter-spacing: -0.022em; text-wrap: balance; }
.ob-sub { font-family: var(--sans); font-size: 14.5px; line-height: 1.62; color: var(--muted);
  margin: 0; max-width: 26rem; }
.ob-foot { display: flex; align-items: center; justify-content: space-between;
  padding: 20px 30px calc(30px + var(--sab, 0px)); }
.ob-dots { display: flex; gap: 8px; }
.ob-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--surface-3);
  transition: background 0.25s ease, transform 0.25s var(--ease); }
.ob-dot.on { background: var(--accent); transform: scale(1.25); }

/* ---------------- map ---------------- */
.region { margin: 0 0 6px; padding: 20px 18px 16px; border-radius: var(--r);
  background: linear-gradient(168deg, var(--surface-2), var(--surface));
  border: 1px solid var(--hair); box-shadow: var(--lift), var(--edge); position: relative; overflow: hidden; }
.region::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 70% at 100% 0%, var(--accent-wash), transparent 62%); }
.region + .trail { margin: 14px 0 30px; }
.band { height: 42px; margin: 0 0 14px; color: var(--accent); opacity: 0.75; }
.band svg { width: 100%; height: 42px; display: block; }
.band path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rg-name { font-size: 23px; margin: 0 0 3px; letter-spacing: -0.018em; text-wrap: balance; }
.rg-era { font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 11px; }
.rg-blurb { font-size: 15.5px; color: var(--muted); margin: 0 0 12px; text-wrap: pretty; }
.rg-prog { font-family: var(--sans); font-size: 12.5px; color: var(--accent-hi); margin: 0;
  display: flex; align-items: center; gap: 7px; }
.rg-prog .ic { width: 16px; height: 16px; }
/* a locked region is stated in colour, not in opacity, so its text still passes AA */
.region.locked { background: var(--surface); border-style: dashed; }
.region.locked::after { display: none; }
.region.locked .band { opacity: 0.28; color: var(--muted); }
.region.locked .rg-name { color: var(--muted); }
.region.locked .rg-prog { color: var(--muted); }

.trail { position: relative; }
.trail::before { content: ''; position: absolute; left: 22px; top: 16px; bottom: 16px;
  width: 2px; border-radius: 1px;
  background: linear-gradient(180deg, var(--hair), var(--surface-3) 70%, transparent); }
.seal-row { display: flex; align-items: center; gap: 15px; width: 100%; text-align: left;
  background: none; border: 0; padding: 8px 0; cursor: pointer; font: inherit; color: inherit;
  position: relative; animation: rise-in 0.4s var(--ease) both; }
.seal-row:active .seal { transform: scale(0.93); }
.seal {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; position: relative;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  border: 1.5px solid var(--hair); background: var(--surface-2); color: var(--faint);
  box-shadow: var(--lift), var(--edge);
  transition: transform 0.14s var(--ease);
}
.seal .ic { width: 19px; height: 19px; }
.seal-proven { border-color: var(--accent-line); background: linear-gradient(160deg, var(--surface-3), var(--surface));
  color: var(--accent-hi); box-shadow: var(--lift), var(--edge), 0 0 16px -6px rgba(232, 67, 78, 0.7); }
.seal-gold { border-color: rgba(255, 236, 230, 0.55);
  background: linear-gradient(160deg, #FFF8F4, var(--bone) 55%, #C9B7AF);
  color: #17100F; box-shadow: var(--lift), 0 0 20px -6px rgba(241, 231, 225, 0.5); }
.seal.keystone { width: 50px; height: 50px; }
.seal.keystone::after { content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid var(--hair); }
.seal-proven.keystone::after, .seal-gold.keystone::after { border-color: var(--accent-line); }
.seal .cr { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #16100F; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.9); }
.seal .cr .ic { width: 13px; height: 13px; stroke-width: 2; }
.seal-txt { min-width: 0; }
.seal-name { display: block; font-size: 16.5px; line-height: 1.28; }
.seal-sub { display: block; margin-top: 3px; font-family: var(--sans); font-size: 12.5px;
  line-height: 1.45; color: var(--faint); }
.seal-row.done .seal-sub { color: var(--muted); }

/* ---------------- daily ---------------- */
.streak { font-family: var(--sans); font-size: 12px; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--accent-hi); margin: 12px 0 0; }
.envelope { border: 1px solid var(--hair); border-radius: var(--r); padding: 32px 22px 28px;
  text-align: center; margin-top: 22px;
  background: linear-gradient(168deg, var(--surface-2), var(--surface));
  box-shadow: var(--lift), var(--edge); position: relative; overflow: hidden; }
.envelope::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 50% at 50% 0%, var(--accent-wash), transparent 70%); }
.env-seal {
  width: 84px; height: 84px; margin: 0 auto 20px; border-radius: 50%;
  background: radial-gradient(70% 70% at 40% 30%, var(--surface-3), var(--bg-deep));
  border: 1px solid var(--accent-line);
  display: flex; align-items: center; justify-content: center; position: relative;
  box-shadow: var(--lift), 0 0 26px -8px rgba(232, 67, 78, 0.8);
}
.env-seal .mark-sm { width: 52px; height: 52px; }
.env-seal::after { content: ''; position: absolute; inset: -7px; border-radius: 50%;
  border: 1px dashed var(--accent-line); opacity: 0.55; }
.env-seal.crack { animation: crack 0.44s cubic-bezier(0.3, 0, 0.2, 1) both; }
@keyframes crack {
  0% { transform: scale(1) rotate(0deg); }
  32% { transform: scale(1.12) rotate(-6deg); }
  100% { transform: scale(0.2) rotate(16deg); opacity: 0; }
}
.env-tone { font-size: 21px; margin: 0 0 6px; letter-spacing: -0.012em; }
.env-note { font-family: var(--sans); font-size: 13px; color: var(--faint); margin: 0 0 22px; }

.result { border: 1px solid var(--accent-line); border-radius: var(--r); padding: 24px 22px;
  text-align: center; margin-top: 22px;
  background: linear-gradient(168deg, rgba(232, 67, 78, 0.11), var(--surface));
  box-shadow: var(--lift), var(--edge); }
.res-name { font-size: 18px; margin: 0 0 16px; line-height: 1.35; text-wrap: balance; }
.grid { display: inline-block; margin: 2px 0 18px; }
.shape-row { display: flex; gap: 5px; justify-content: center; margin-bottom: 5px; }
.blk { display: block; width: 15px; height: 15px; border-radius: 3px; }
.blk.leaf { background: linear-gradient(160deg, var(--accent-hi), var(--accent-deep));
  box-shadow: 0 0 9px -2px rgba(232, 67, 78, 0.9); }
.blk.mid { border: 1.5px solid var(--hair); background: var(--surface-2); }
.res-score { font-family: var(--sans); font-size: 14px; margin: 0 0 6px; color: var(--fg); }
.crown { font-family: var(--sans); font-size: 13px; line-height: 1.5; margin: 0 0 18px; color: var(--muted); }
.crown-gold { color: var(--accent-hi); font-weight: 500; }

.archive { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 12px 0 6px; }
.arch { border: 1px solid var(--hair); border-radius: var(--r-xs); background: var(--surface);
  padding: 8px 2px 7px; cursor: pointer; font: inherit; color: var(--faint); box-shadow: var(--edge);
  transition: transform 0.12s var(--ease), border-color 0.16s ease; }
.arch:active { transform: scale(0.95); }
.arch .ad { display: block; font-family: var(--sans); font-size: 10px; letter-spacing: 0.05em; }
.arch .am { display: block; font-family: var(--sans); font-size: 15px; margin-top: 3px; color: var(--muted);
  min-height: 20px; line-height: 20px; }
.arch .am .ic { width: 15px; height: 15px; margin: 2px auto 0; }
.arch.done { border-color: var(--accent-line); background: linear-gradient(160deg, var(--accent-wash), var(--surface)); }
.arch.done .am { color: var(--accent-hi); }
/* an unproved day is marked with the app's own solid, drawn small, rather than a dot */
.arch.unset .am::after { content: ''; display: block; width: 8px; height: 8px;
  border: 1px solid var(--hair); transform: rotate(45deg); margin: 6px auto 0; }
.arch.today { border-style: dashed; border-color: var(--accent-line); }

/* ---------------- forge ---------------- */
.forge-row { display: block; width: 100%; text-align: left;
  background: linear-gradient(168deg, var(--surface-2), var(--surface));
  border: 1px solid var(--hair); border-radius: var(--r); padding: 15px 16px 14px; margin-bottom: 10px;
  cursor: pointer; font: inherit; color: inherit; box-shadow: var(--lift), var(--edge);
  animation: rise-in 0.4s var(--ease) both;
  transition: transform 0.13s var(--ease), border-color 0.16s ease; }
.forge-row:active { transform: scale(0.985); border-color: var(--accent-line); }
.fg-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fg-n { font-size: 17.5px; letter-spacing: -0.01em; }
.fg-p { flex: none; }
.fg-b { display: block; font-family: var(--sans); font-size: 12.5px; color: var(--faint); margin: 4px 0 11px; }
.meter { display: block; height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5); }
.meter i { display: block; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent)); transition: width 0.6s var(--ease); }

/* ---------------- satchel ---------------- */
.sat-head { margin: 30px 0 12px; }
.sat-row { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-sm);
  padding: 13px 14px; margin-bottom: 8px; cursor: pointer; font: inherit; color: inherit;
  box-shadow: var(--edge); animation: rise-in 0.4s var(--ease) both;
  transition: transform 0.13s var(--ease), border-color 0.16s ease; }
.sat-row:active { transform: scale(0.985); border-color: var(--accent-line); }
.sat-ic { flex: none; width: 26px; height: 26px; color: var(--accent); }
.sat-tx { min-width: 0; }
.sat-l { display: block; font-size: 16.5px; line-height: 1.35; }
.sat-m { display: block; font-family: var(--sans); font-size: 12px; color: var(--faint); margin-top: 4px; }
.empty { text-align: center; margin-top: 30px; }
.empty p { color: var(--faint); font-size: 16px; margin: 6px 0 0; }
.empty { margin-top: 42px; }
.empty-art { width: 240px; height: 152px; color: var(--accent); opacity: 0.9; margin: 0 auto 14px; display: block; }
.empty-art .e-edge { fill: none; stroke: var(--hair); stroke-width: 2.4; stroke-linecap: round; }

/* ---------------- profile ---------------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.stat { background: linear-gradient(168deg, var(--surface-2), var(--surface));
  border: 1px solid var(--hair); border-radius: var(--r-sm); padding: 14px 14px 13px;
  box-shadow: var(--lift), var(--edge); }
.stat.wide { grid-column: 1 / -1; }
.stat .k { display: block; }
.stat .v { display: block; font-size: 28px; margin-top: 4px; letter-spacing: -0.02em; line-height: 1.1; }
.stat.wide .v { font-size: 40px; color: var(--accent-hi); }
.field { margin-bottom: 18px; }
.field.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
label { display: block; font-size: 16.5px; }
input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--accent); margin-top: 3px; flex: none; }
input[type=time] { font-family: var(--sans); font-size: 15px; background: var(--surface-2); color: var(--fg);
  border: 1px solid var(--hair); border-radius: var(--r-sm); padding: 9px 11px; margin-top: 8px;
  color-scheme: dark; }

/* ---------------- proof board ---------------- */
.statement { flex: 0 0 auto; padding: 12px 18px 13px; border-bottom: 1px solid var(--hair);
  background: linear-gradient(180deg, var(--surface), var(--bg)); position: relative; z-index: 1; }
.st-prose { font-size: 15.5px; line-height: 1.42; margin: 0; color: var(--fg); text-wrap: pretty; }
.st-formal { font-family: var(--sans); font-size: 12.5px; color: var(--faint); margin: 6px 0 0;
  word-break: break-word; letter-spacing: 0.01em; }

.treewrap { flex: 1 1 auto; overflow: auto; -webkit-overflow-scrolling: touch;
  padding: 16px 10px 18px; min-height: 132px; display: flex; justify-content: center; align-items: flex-start;
  position: relative; }
.treewrap::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(246, 238, 233, 0.045) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(246, 238, 233, 0.045) 0 1px, transparent 1px 26px);
  -webkit-mask-image: radial-gradient(72% 62% at 50% 46%, #000 20%, transparent 100%);
  mask-image: radial-gradient(72% 62% at 50% 46%, #000 20%, transparent 100%); }
.treefit { position: relative; flex: 0 0 auto; }
.tree { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.edges { position: absolute; top: 0; left: 0; overflow: visible; }
.edge { fill: none; stroke: var(--hair); stroke-width: 1.5; transition: stroke 0.35s ease, stroke-width 0.35s ease; }
.edge.lit { stroke: var(--accent); stroke-width: 2; }

.node {
  position: absolute; max-width: 190px; padding: 7px 10px; border-radius: var(--r-sm);
  font-family: var(--serif); font-size: 13px; line-height: 1.3; text-align: center;
  border: 1.5px solid var(--hair); background: var(--surface-2); color: var(--muted);
  cursor: default; box-shadow: var(--edge);
  transition: border-color 0.2s ease, background 0.35s ease, transform 0.14s var(--ease), color 0.3s ease;
}
.node.is-open { border-color: var(--muted); color: var(--fg); cursor: pointer;
  background: linear-gradient(168deg, var(--surface-3), var(--surface-2)); box-shadow: var(--lift), var(--edge); }
.node.is-focus { border-color: var(--accent); box-shadow: var(--ember), var(--lift); }
.node.is-mid { background: transparent; border-color: var(--hair); box-shadow: none; }
.node.is-done { border-color: var(--accent-line); color: var(--fg);
  background: linear-gradient(168deg, rgba(232, 67, 78, 0.16), var(--surface)); }
.node .ncap { display: flex; align-items: center; justify-content: center; gap: 4px;
  font-family: var(--sans); font-size: 9px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent-hi); margin-top: 4px; line-height: 1.3; }
.node .ncap .ic { width: 7px; height: 7px; stroke: none; fill: currentColor; }
.node.drop { border-color: var(--accent); border-style: dashed; transform: scale(1.05); }
.node.is-ghost { border-color: var(--accent); border-style: dashed; box-shadow: var(--ember); }
.node.snapped { animation: snap 0.26s var(--ease); }
@keyframes snap { 0% { transform: translateY(-5px) scale(1.03); } 100% { transform: none; } }
.node.lit { border-color: var(--accent-line); color: #17100F;
  background: linear-gradient(160deg, #FFF8F4, var(--bone) 60%, #D5C3BB);
  animation: lit 0.55s ease both; }
.node.lit .ncap { color: #8E1523; }   /* AA against the darkest stop of the bone face */
@keyframes lit {
  0% { box-shadow: 0 0 0 0 rgba(232, 67, 78, 0.55); }
  45% { box-shadow: 0 0 0 10px rgba(232, 67, 78, 0); }
  100% { box-shadow: var(--lift); }
}
/* rule labels wrap rather than run into their neighbours across a wide row */
.rulelab { position: absolute; font-family: var(--sans); font-size: 9.5px; letter-spacing: 0.08em;
  line-height: 1.28; text-transform: uppercase; color: var(--faint); background: var(--bg);
  padding: 1px 5px; max-width: 104px; text-align: center; border-radius: 3px; }

.replaybar { flex: 0 0 auto; border-top: 1px solid var(--hair); background: var(--surface);
  padding: 15px 18px calc(19px + var(--sab, 0px)); }
.replaybar p { margin: 0; font-family: var(--sans); font-size: 13px; color: var(--muted); text-align: center; }

.panel { flex: 0 0 auto; max-height: 50%; overflow-y: auto; -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--hair);
  background: linear-gradient(180deg, var(--surface), var(--bg) 60%);
  box-shadow: 0 -18px 34px -26px rgba(0, 0, 0, 1), var(--edge);
  padding: 14px 16px calc(16px + var(--sab, 0px)); position: relative; z-index: 2; }
.panel-head { margin-bottom: 14px; }
.panel-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.panel-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: 0 0 auto; }
.panel-goal { font-size: 20px; line-height: 1.28; margin: 0; flex: 1 1 auto; min-width: 0;
  letter-spacing: -0.012em; }
.panel-know { font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { font-family: var(--serif); font-size: 13.5px; border: 1px solid var(--hair); border-radius: var(--r-xs);
  padding: 5px 10px; background: var(--surface-2); color: var(--muted); cursor: pointer;
  transition: transform 0.12s var(--ease); }
.chip:active { transform: scale(0.96); }
.chip.live { border-color: var(--accent-line); color: var(--accent-hi); background: var(--accent-wash); }
.chip.pickable { font-size: 15.5px; padding: 9px 13px; color: var(--fg); background: var(--surface-3); }
.panel-label { margin: 18px 0 8px; }
.move, .tile { display: block; width: 100%; text-align: left; border: 1px solid var(--hair);
  border-radius: var(--r-sm); padding: 11px 12px; margin-bottom: 7px;
  background: linear-gradient(168deg, var(--surface-2), var(--surface));
  cursor: pointer; font: inherit; color: inherit; box-shadow: var(--edge);
  transition: transform 0.12s var(--ease), border-color 0.16s ease; }
.move:active, .tile:active { transform: scale(0.985); }
.move { border-left: 2px solid var(--hair); }
.move:active { border-left-color: var(--accent); }
.mv-n, .tl-n { display: block; font-family: var(--serif); font-size: 16px; line-height: 1.28; }
.mv-s, .tl-t { display: block; font-family: var(--sans); font-size: 12px; color: var(--faint); margin-top: 4px; }
.tile { touch-action: none; color: var(--faint); }
.tile .tl-n { color: var(--faint); }
.tile.live { border-color: var(--accent-line); color: var(--fg);
  background: linear-gradient(168deg, rgba(232, 67, 78, 0.15), var(--surface));
  box-shadow: var(--edge), 0 0 18px -10px rgba(232, 67, 78, 0.9); }
.tile.live .tl-n { color: var(--fg); }
.tile.bring { border-style: dashed; border-color: var(--accent-line); color: var(--muted); }
.tile.bring .tl-n { color: var(--muted); }
.tile.bounce, .node.bounce { animation: bounce 0.32s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes bounce { 0%, 100% { transform: none; } 30% { transform: translateX(-6px); } 65% { transform: translateX(5px); } }
.panel-none { font-family: var(--sans); font-size: 13px; color: var(--faint); margin: 0 0 6px; }
.par { font-family: var(--sans); font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--faint); white-space: nowrap; }
.par b { color: var(--fg); font-weight: 500; }

.dragghost { position: fixed; z-index: 60; pointer-events: none; transform: translate(-50%, -150%);
  font-family: var(--serif); font-size: 14.5px; background: var(--bone); color: #16100F;
  padding: 8px 13px; border-radius: var(--r-sm); box-shadow: 0 14px 28px -10px rgba(0, 0, 0, 0.95);
  border: 1px solid var(--accent-line); white-space: nowrap; }

/* ---------------- vignette ---------------- */
#v-vignette .scroller { padding-top: 20px; padding-bottom: calc(48px + var(--sab, 0px)); }
.vg-title { font-size: 32px; line-height: 1.12; margin: 8px 0 20px; letter-spacing: -0.026em; text-wrap: balance; }
.vg-body p { font-size: 17.5px; line-height: 1.66; margin: 0 0 20px; color: var(--fg); text-wrap: pretty; }
.vg-body p:first-child::first-letter { font-size: 50px; float: left; line-height: 0.84; padding: 5px 9px 0 0;
  color: var(--accent-hi); font-weight: 600; }

/* ---------------- tabs ---------------- */
#tabs {
  flex: 0 0 auto; height: calc(62px + var(--sab, 0px));
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: linear-gradient(180deg, var(--surface), var(--bg-deep));
  border-top: 1px solid var(--hair); box-shadow: var(--edge), 0 -14px 30px -24px rgba(0, 0, 0, 1);
  padding-bottom: var(--sab, 0px); padding-top: 9px; align-items: start; z-index: 15;
}
#tabs[hidden] { display: none !important; }
.tab { background: none; border: 0; cursor: pointer; padding: 0; font-family: var(--sans);
  display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--faint);
  transition: color 0.16s ease, transform 0.13s var(--ease); }
.tab span { font-size: 10.5px; letter-spacing: 0.06em; }
.tab .ic { width: 22px; height: 22px; }
.tab:active { transform: scale(0.92); }
.tab.is-on { color: var(--accent-hi); }
.tab.is-on .ic { filter: drop-shadow(0 0 7px rgba(232, 67, 78, 0.6)); }

/* ---------------- sheets and toast ---------------- */
.sheet { position: fixed; inset: 0; display: flex; align-items: flex-end;
  background: linear-gradient(180deg, rgba(8, 5, 5, 0.40), rgba(8, 5, 5, 0.74));
  z-index: 50; animation: fade-in 0.2s ease both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet[hidden] { display: none !important; }
.sheet-panel { background: linear-gradient(180deg, var(--surface-2), var(--surface));
  width: 100%; max-width: var(--measure); margin: 0 auto;
  border-top: 1px solid var(--hair); border-radius: var(--r) var(--r) 0 0;
  padding: 24px 20px calc(26px + var(--sab, 0px));
  box-shadow: var(--lift-2), var(--edge);
  animation: rise 0.28s var(--ease); max-height: 92vh; overflow-y: auto; }
@keyframes rise { from { transform: translateY(26px); opacity: 0.3; } to { transform: none; opacity: 1; } }
.sheet-title { font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 12px; }
.sheet-body { font-size: 17px; line-height: 1.52; margin: 0 0 12px; text-wrap: pretty; }
.sheet-body.ghosted { color: var(--accent-hi); }
#chooserCancel, #hintClose { margin-top: 18px; }

.v-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.v-mark { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.7)); }
.v-eyebrow { font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-hi); margin: 0 0 5px; }
.v-title { font-size: 26px; line-height: 1.14; margin: 0; letter-spacing: -0.024em; text-wrap: balance; }
.v-verify { font-family: var(--sans); font-size: 12px; color: var(--faint); margin: 0 0 18px; }
.v-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.v-nums > div { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-sm);
  padding: 13px 8px; text-align: center; box-shadow: var(--edge); }
.v-n { display: block; font-size: 27px; letter-spacing: -0.02em; }
.v-k { display: block; margin-top: 3px; }
.v-rigor { font-family: var(--sans); font-size: 13px; color: var(--accent-hi); margin: 0 0 5px; }
.v-lemma { font-family: var(--sans); font-size: 12.5px; color: var(--faint); margin: 0; }

.toast { position: fixed; left: 50%; bottom: calc(86px + var(--sab, 0px)); transform: translateX(-50%);
  background: var(--surface-3); color: var(--fg); font-family: var(--sans); font-size: 13.5px;
  padding: 11px 16px; border-radius: var(--r-sm); z-index: 70; max-width: 86vw; text-align: center;
  border: 1px solid var(--hair); box-shadow: var(--lift-2);
  animation: rise 0.22s var(--ease); }
body.on-board .toast { bottom: auto; top: calc(74px + var(--sat, 0px)); }
.toast[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0s !important;
    transition-duration: 0.001ms !important; }
}
