/* X10 · the $x10 public register. Ledger paper, bottle-green book cloth, red-violet stamp ink, carbon-blue links.
   Fonts: Public Sans (text, figures) + Courier Prime (typed entries, addresses), self-hosted, SIL OFL 1.1. */

@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/public-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/public-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 400; font-display: swap; src: url("/courier-prime-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 400; font-display: swap; src: url("/courier-prime-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+A720-A7FF; }
@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 700; font-display: swap; src: url("/courier-prime-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 700; font-display: swap; src: url("/courier-prime-700-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+A720-A7FF; }

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --paper: #EAF1E6;        /* ledger paper */
  --paper-2: #DFE9DA;      /* ruled band, zebra, track */
  --sheet: #F4F8F1;        /* a loose sheet laid on the page */
  --rule: #BCCFB6;         /* green ruled line */
  --rule-2: #95B08E;       /* stronger rule */
  --cloth: #1D3A2A;        /* bottle-green book cloth */
  --cloth-2: #274A37;
  --cloth-ink: #E9F1E4;
  --tag-on-cloth: #F3B4C8; /* stamp ink, lightened to read on cloth */
  --cloth-ink-2: #B8CDB9;
  --ink: #13231A;
  --ink-2: #3A5143;
  --ink-3: #4F6656;
  --stamp: #A11E4C;        /* red-violet stamp ink */
  --stamp-wash: rgba(161, 30, 76, .09);
  --carbon: #1D4C9C;       /* carbon-copy blue: links */
  --good: #1C6A39;
  --good-wash: rgba(28, 106, 57, .1);
  --hatch: rgba(161, 30, 76, .22);
  /* data series */
  --line: #1D4C9C;
  --s1: #2C6A47; --s2: #1D4C9C; --s3: #A11E4C; --neutral: #9AAE9C;
  --surface: var(--sheet);
  --text-3: var(--ink-3);

  --f-text: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-type: "Courier Prime", "Courier New", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --spine: 248px;
  --gut: clamp(16px, 3.2vw, 44px);
  --r: 3px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #1A3426; --paper-2: #22412F; --sheet: #1F3B2C;
    --rule: #335A43; --rule-2: #4A7660;
    --cloth: #10261A; --cloth-2: #1B3828; --cloth-ink: #E6F0E2; --cloth-ink-2: #A9C2AD;
    --ink: #E6F0E2; --ink-2: #C2D5C4; --ink-3: #A6BEAB;
    --stamp: #F68DAB; --stamp-wash: rgba(240, 120, 156, .1);
    --carbon: #A3C4FA; --good: #7CCB95; --good-wash: rgba(124, 203, 149, .12); --hatch: rgba(240, 120, 156, .25);
    --line: #A3C4FA; --s1: #6FBF8A; --s2: #8FB5F6; --s3: #F0789C; --neutral: #93AC99;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1A3426; --paper-2: #22412F; --sheet: #1F3B2C;
  --rule: #335A43; --rule-2: #4A7660;
  --cloth: #10261A; --cloth-2: #1B3828; --cloth-ink: #E6F0E2; --cloth-ink-2: #A9C2AD;
  --ink: #E6F0E2; --ink-2: #C2D5C4; --ink-3: #A6BEAB;
  --stamp: #F68DAB; --stamp-wash: rgba(240, 120, 156, .1);
  --carbon: #A3C4FA; --good: #7CCB95; --good-wash: rgba(124, 203, 149, .12); --hatch: rgba(240, 120, 156, .25);
  --line: #A3C4FA; --s1: #6FBF8A; --s2: #8FB5F6; --s3: #F0789C; --neutral: #93AC99;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: var(--rule-2) transparent; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.55 var(--f-text); font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--stamp); color: var(--sheet); }
a { color: var(--carbon); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; color: var(--ink); text-wrap: balance; }
p { margin: 0; }
small { font-size: .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--carbon); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--cloth); color: var(--cloth-ink); padding: 10px 14px; border-radius: var(--r); transition: top .16s var(--ease-out); }
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ frame: spine + page */
.app { display: grid; grid-template-columns: var(--spine) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.spine {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  background: var(--cloth); color: var(--cloth-ink); padding: 22px 0 18px 18px; overflow-y: auto;
  /* faint cloth weave */
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 1px, transparent 1px 3px);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; padding-right: 18px; }
.mark { width: 44px; height: 44px; flex: none; }
.mark rect { fill: none; stroke: currentColor; }
.mark rect:first-child { stroke-width: 2; }
.mark rect + rect { stroke-width: 1; }
.mark text { fill: currentColor; font: 800 15px var(--f-text); text-anchor: middle; letter-spacing: -.02em; }
.brand-name { display: flex; flex-direction: column; font-weight: 800; font-size: 20px; line-height: 1.1; letter-spacing: -.01em; }
.brand-name small { font-weight: 500; font-size: 12.5px; color: var(--cloth-ink-2); letter-spacing: 0; margin-top: 3px; }

/* filing tabs: the active tab is a slip of paper that joins the page */
.tabs { display: flex; flex-direction: column; gap: 2px; margin-top: 34px; }
.tabs a {
  position: relative; display: flex; align-items: center; min-height: 44px; padding: 0 16px;
  color: var(--cloth-ink-2); text-decoration: none; font-weight: 600; font-size: 15px;
  border-radius: var(--r) 0 0 var(--r); transition: background-color .15s ease, color .15s ease;
}
@media (hover: hover) and (pointer: fine) { .tabs a:hover { color: var(--cloth-ink); background: var(--cloth-2); } }
.tabs a.active { background: var(--paper); color: var(--ink); }
.spine-foot { margin-top: auto; padding: 24px 18px 0 0; display: grid; gap: 12px; }
.spine-foot p { font-size: 13.5px; line-height: 1.45; color: var(--cloth-ink-2); }
.spine-foot p b { color: var(--cloth-ink); font-weight: 700; display: block; }
.social { display: flex; gap: 8px; }
.social a { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r); border: 1px solid rgba(233,241,228,.22); color: var(--cloth-ink); transition: background-color .15s ease; }
.social svg { width: 18px; height: 18px; fill: currentColor; }
@media (hover: hover) and (pointer: fine) { .social a:hover { background: var(--cloth-2); } }
.drawer-list .drawer-x { justify-content: space-between; }
.drawer-x svg { width: 20px; height: 20px; fill: var(--ink); flex: none; margin-right: 6px; }
.spine-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.net-tag { font: 700 12px/1 var(--f-type); letter-spacing: .08em; text-transform: uppercase; padding: 6px 8px; border: 1.5px solid currentColor; color: var(--tag-on-cloth); border-radius: 2px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r); border: 1px solid rgba(233,241,228,.22); background: transparent; color: var(--cloth-ink); cursor: pointer; transition: background-color .15s ease; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--cloth-2); } }

.main { min-width: 0; display: flex; flex-direction: column; background-image: repeating-linear-gradient(180deg, transparent 0 31px, color-mix(in srgb, var(--rule) 38%, transparent) 31px 32px); background-attachment: local; }
.folio {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; min-height: 64px;
  padding: 10px var(--gut); background: var(--paper); border-bottom: 3px double var(--rule-2);
}
.folio-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-weight: 700; font-size: 15px; color: var(--ink); }
.folio-reg { font: 400 14px var(--f-type); color: var(--ink-3); white-space: nowrap; }
.folio-sep { color: var(--rule-2); }
.brand-mobile { display: none; color: var(--ink); padding: 0; }
.brand-mobile .mark { width: 38px; height: 38px; }
.quick-search { margin-left: auto; position: relative; width: min(340px, 40vw); }
.quick-search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 17px; height: 17px; fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.quick-search input { width: 100%; height: 44px; padding: 0 12px 0 38px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--sheet); font-size: 15px; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--carbon); outline-offset: 0; }
.mobile-only { display: none; }

main { flex: 1; padding: 0 var(--gut) 56px; }
.page { display: none; }
.page.on { display: block; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  background: var(--cloth); color: var(--cloth-ink); border: 1px solid var(--cloth); border-radius: var(--r);
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, transform .14s var(--ease-out);
}
.btn:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--cloth-2); } }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule-2); }
@media (hover: hover) and (pointer: fine) { .btn.ghost:hover { background: var(--paper-2); } }
.btn.on-cloth { background: var(--cloth-ink); color: var(--cloth); border-color: var(--cloth-ink); }
@media (hover: hover) and (pointer: fine) { .btn.on-cloth:hover { background: #fff; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) main .btn:not(.ghost), :root:not([data-theme="light"]) .folio .btn, :root:not([data-theme="light"]) .drawer .btn { background: var(--cloth-ink); color: var(--cloth); border-color: var(--cloth-ink); } }
:root[data-theme="dark"] main .btn:not(.ghost), :root[data-theme="dark"] .folio .btn, :root[data-theme="dark"] .drawer .btn { background: var(--cloth-ink); color: var(--cloth); border-color: var(--cloth-ink); }
.see { font-weight: 600; font-size: 14.5px; color: var(--carbon); text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color .15s ease; }
@media (hover: hover) and (pointer: fine) { .see:hover { text-decoration-color: currentColor; } }

/* ------------------------------------------------------------------ overview: the register page */
.entry-page { padding-top: clamp(28px, 4.5vh, 48px); padding-bottom: 8px; }
.entry-head { max-width: 980px; }
.entry-head h1 { font-weight: 800; font-size: clamp(34px, 4.6vw, 64px); line-height: 1.02; letter-spacing: -.035em; }
.deck { margin-top: 14px; max-width: 64ch; font-size: clamp(16px, 1.35vw, 18.5px); color: var(--ink-2); }

.ledger {
  position: relative; margin-top: clamp(20px, 3.2vh, 34px); background: var(--sheet);
  border: 1px solid var(--rule-2); border-radius: var(--r);
  box-shadow: 0 1px 0 var(--rule), 0 10px 28px -18px rgba(19, 35, 26, .35);
}
/* the double red margin line of ledger paper */
.ledger::before { content: ""; position: absolute; top: 0; bottom: 0; left: 76px; width: 4px; border-left: 1px solid var(--stamp); border-right: 1px solid var(--stamp); opacity: .45; pointer-events: none; }
.ledger-row {
  display: grid; grid-template-columns: 58px minmax(180px, 1.25fr) minmax(200px, 1.2fr) minmax(220px, 1.35fr);
  align-items: center; gap: 0 20px; min-height: 60px; padding: 8px 24px 8px 18px; border-bottom: 1px solid var(--rule);
}
.ledger-row:last-of-type { border-bottom: 0; }
.ledger-cols { min-height: 40px; border-bottom: 3px double var(--rule-2); font-size: 13px; font-weight: 700; color: var(--ink-3); letter-spacing: .01em; }
.c-no { font: 400 14px var(--f-type); color: var(--stamp); }
.ledger-cols .c-no { font: inherit; color: inherit; }
.c-name { font-weight: 650; font-size: 16px; line-height: 1.32; padding-left: 8px; }
.c-name small { display: block; font-weight: 400; font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }
.ledger-cols > :nth-child(2) { padding-left: 8px; }
.fig { font-weight: 750; font-size: clamp(20px, 1.9vw, 26px); letter-spacing: -.02em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fig small, .value small { font-weight: 500; font-size: .58em; color: var(--ink-3); letter-spacing: 0; margin-left: 2px; }
.c-note { font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.src { font: 400 13px var(--f-type); color: var(--carbon); white-space: nowrap; text-underline-offset: 3px; }
.src::after { content: ""; display: inline-block; width: .62em; height: .62em; margin-left: 4px; vertical-align: .05em; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; }

/* the stamp: double border, red-violet ink, slightly uneven, lands once */
.stamp {
  position: absolute; right: clamp(16px, 4%, 48px); top: -86px; display: grid; justify-items: center; gap: 2px;
  padding: 9px 16px 8px; color: var(--stamp); text-decoration: none; border: 3px double var(--stamp); border-radius: 4px;
  background: color-mix(in srgb, var(--sheet) 82%, transparent); rotate: -7deg;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.75'/%3E%3C/filter%3E%3Crect width='160' height='80' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.75'/%3E%3C/filter%3E%3Crect width='160' height='80' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: stamp-land .26s var(--ease-out) .35s both;
  transition: rotate .2s var(--ease-out);
}
.stamp-big { font-weight: 850; font-size: 22px; letter-spacing: .16em; text-transform: uppercase; line-height: 1; }
.stamp-small { font: 700 11.5px var(--f-type); letter-spacing: .06em; text-transform: uppercase; }
@media (hover: hover) and (pointer: fine) { .stamp:hover { rotate: -4deg; } }
@keyframes stamp-land { from { opacity: 0; transform: scale(1.18); } to { opacity: 1; transform: scale(1); } }

.file-label {
  display: inline-flex; align-items: stretch; min-height: 54px; text-decoration: none; color: var(--ink); background: var(--sheet);
  border: 3px double var(--ink); border-radius: 2px; font-weight: 750; font-size: 16.5px;
  transition: background-color .15s ease, color .15s ease, transform .14s var(--ease-out);
}
.fl-tab { display: flex; align-items: center; padding: 0 14px; font: 700 13px var(--f-type); letter-spacing: .1em; text-transform: uppercase; color: var(--stamp); border-right: 3px double var(--ink); }
.fl-text { display: block; align-self: center; padding: 0 20px; white-space: nowrap; }
.file-label:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .file-label:hover { background: var(--cloth); color: var(--cloth-ink); } .file-label:hover .fl-tab { color: var(--cloth-ink-2); } }
.sign-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 22px; }
.sign-line p { flex: 1 1 280px; max-width: 52ch; font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }
.sign-line p b { color: var(--ink); }
.last-entry { font: 400 13.5px var(--f-type); color: var(--ink-3); }

/* sections below the register */
.sec { padding-top: clamp(40px, 7vh, 72px); }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 3px double var(--rule-2); }
.sec-head h2, .close h2 { font-weight: 800; font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -.025em; line-height: 1.1; }
.sec-head .sub { margin-top: 6px; max-width: 72ch; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--sheet); counter-reset: step; }
.step { padding: 22px 22px 24px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; gap: 12px; counter-increment: step; }
.step:first-child { border-left: 0; }
.step h3 { font-size: 18px; font-weight: 750; letter-spacing: -.01em; line-height: 1.25; }
.step h3::before { content: counter(step, decimal-leading-zero); display: block; font: 400 14px var(--f-type); color: var(--stamp); margin-bottom: 8px; }
.step p { font-size: 14.5px; color: var(--ink-2); line-height: 1.5; flex: 1; }
.split { display: flex; gap: 2px; min-height: 32px; }
.split i { position: relative; min-width: 0; border-radius: 2px; display: flex; align-items: center; overflow: hidden; }
.split i span { padding: 7px 8px; font: 700 12px var(--f-text); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.s-pool { background: var(--s1); }
.s-burn { background: var(--stamp); }
.s-team { background: var(--neutral); }
.s-ref { background: var(--s2); }
.s-team span, .s-team { color: var(--ink) !important; }
:root[data-theme="dark"] .split i span, :root[data-theme="dark"] .s-team span { color: var(--cloth) !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .split i span { color: var(--cloth) !important; } }
.split-key { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--ink-3); }
.split-key span { display: inline-flex; align-items: center; gap: 6px; }
.split-key i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.halves { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.half { padding: 9px 10px; border-radius: 2px; background: var(--good-wash); border: 1px solid var(--good); display: grid; gap: 1px; font-size: 12.5px; color: var(--ink-2); line-height: 1.3; }
.half b { font-size: 13px; color: var(--ink); }
.hatch { background: repeating-linear-gradient(45deg, var(--hatch) 0 2px, transparent 2px 9px), var(--stamp-wash); border-color: var(--stamp); }

.close .grid { align-items: start; }
.close h2 { padding-bottom: 10px; border-bottom: 3px double var(--rule-2); }
.fixed-list { list-style: none; margin: 6px 0 16px; padding: 0; }
.fixed-list li { padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 16px; color: var(--ink-2); }
.fixed-list b { color: var(--ink); font-weight: 750; }
.warning { padding: 22px 24px 24px; border: 2px solid var(--stamp); border-radius: var(--r); background: var(--stamp-wash); display: grid; gap: 12px; }
.warning h3 { font-size: 19px; font-weight: 800; color: var(--stamp); letter-spacing: -.01em; }
.warning p { font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.sig-field { display: flex; align-items: flex-end; height: 40px; border-bottom: 1px solid var(--ink-3); }
.sig-field span { font: 400 12.5px var(--f-type); color: var(--ink-3); padding-bottom: 4px; }
.warning .btn { justify-self: start; }

/* ------------------------------------------------------------------ other pages */
.page-head { padding: clamp(26px, 4vh, 40px) 0 22px; margin-bottom: 22px; border-bottom: 3px double var(--rule-2); }
.page-head h1 { font-weight: 800; font-size: clamp(30px, 3.4vw, 46px); letter-spacing: -.03em; line-height: 1.05; }
.page-intro { margin-top: 10px; max-width: 78ch; font-size: 16px; color: var(--ink-2); }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.grid > .sec-head { margin: 22px 0 0; }
.grid > .ledger { margin-top: 0; }
.grid > .ledger .c-note .meter { max-width: none; }

.sheet { background: var(--sheet); border: 1px solid var(--rule-2); border-radius: var(--r); padding: 20px 22px; min-width: 0; }
.sheet.flush { padding: 0; overflow: hidden; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.sheet-head.pad { padding: 16px 22px 12px; margin: 0; border-bottom: 3px double var(--rule); align-items: center; }
.sheet-head .right { text-align: right; }
.label { font-size: 13.5px; font-weight: 700; letter-spacing: .005em; color: var(--ink-3); }
.value { font-weight: 750; font-size: clamp(24px, 2.2vw, 30px); letter-spacing: -.02em; line-height: 1.2; margin-top: 6px; overflow-wrap: anywhere; }
.value.sm { font-size: 20px; }
.sub { font-size: 14px; color: var(--ink-3); line-height: 1.45; margin-top: 4px; }
.bad-text { color: var(--stamp); font-weight: 600; }

.stats { margin: 10px 0 0; }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.stat:last-child { border-bottom: 0; }
.stat dt { color: var(--ink-2); }
.stat dd { margin: 0; font-weight: 650; text-align: right; }

/* meters: measured against their cap, with a tick every 10% */
.meter { display: block; position: relative; height: 12px; margin-top: 14px; background: var(--paper-2); border: 1px solid var(--rule-2); border-radius: 2px; overflow: hidden; }
.meter::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--rule-2) calc(10% - 1px) 10%); pointer-events: none; }
.meter i { display: block; height: 100%; background: var(--s1); min-width: 2px; transition: width .4s var(--ease-out); }
.c-note .meter { margin: 2px 0 6px; width: 100%; max-width: 260px; }
.meter-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }

/* chips: typed labels, like a clerk's rubber stamp */
.chip { display: inline-flex; align-items: center; padding: 2px 7px; border: 1px solid var(--rule-2); border-radius: 2px; font: 700 12px/1.5 var(--f-type); letter-spacing: .03em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; vertical-align: 1px; }
.chip.good { color: var(--good); border-color: var(--good); background: var(--good-wash); }
.chip.bad { color: var(--stamp); border-color: var(--stamp); background: repeating-linear-gradient(45deg, var(--hatch) 0 2px, transparent 2px 7px), var(--stamp-wash); }
.chip.brand { color: var(--carbon); border-color: var(--carbon); }
.chip.sand { color: var(--ink); border-color: var(--ink-3); }

/* segmented range */
.seg { display: inline-flex; border: 1px solid var(--rule-2); border-radius: var(--r); overflow: hidden; flex: none; }
.seg button { min-width: 48px; min-height: 40px; padding: 0 10px; border: 0; border-left: 1px solid var(--rule-2); background: transparent; font: 700 13px var(--f-type); color: var(--ink-2); cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--cloth); color: var(--cloth-ink); }
:root[data-theme="dark"] .seg button.on { background: var(--cloth-ink); color: var(--cloth); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { background: var(--cloth-ink); color: var(--cloth); } }

/* charts */
.chart { height: 300px; position: relative; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .axis text { font: 400 11.5px var(--f-type); fill: var(--ink-3); }
.chart .gridline { stroke: var(--rule); stroke-width: 1; }
.empty, .empty-state { padding: 22px; color: var(--ink-3); font-size: 14.5px; text-align: center; }
.empty { display: grid; place-items: center; height: 100%; border: 1px dashed var(--rule-2); border-radius: var(--r); }
.tip { position: absolute; z-index: 60; pointer-events: none; opacity: 0; transform: translate(-50%, -100%); padding: 7px 10px; background: var(--cloth); color: var(--cloth-ink); border-radius: var(--r); font-size: 13px; line-height: 1.35; display: grid; gap: 1px; white-space: nowrap; box-shadow: 0 6px 16px -8px rgba(0,0,0,.45); transition: opacity .12s ease; }
.tip span { color: var(--cloth-ink-2); font-size: 12px; }

/* supply stack */
.stack { display: flex; gap: 2px; height: 30px; margin-top: 6px; }
.stack i { display: block; height: 100%; border-radius: 2px; min-width: 3px; }
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 18px; margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.legend > div { display: flex; gap: 8px; align-items: flex-start; }
.legend b { display: block; color: var(--ink); font-weight: 650; }
.sw { width: 11px; height: 11px; border-radius: 2px; flex: none; margin-top: 5px; }

/* tables: ruled ledger lines */
.table-wrap { overflow: auto; max-height: 560px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { position: sticky; top: 0; z-index: 1; background: var(--sheet); text-align: left; font-size: 13px; font-weight: 700; letter-spacing: .005em; color: var(--ink-3); padding: 10px 22px; border-bottom: 1px solid var(--rule-2); white-space: nowrap; }
td { padding: 12px 22px; border-bottom: 1px solid var(--rule); vertical-align: top; color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
td b { color: var(--ink); }
.r { text-align: right; }
td.when { white-space: nowrap; font: 400 13.5px var(--f-type); }
td.when a { color: var(--carbon); }
.addr { font-family: var(--f-type); font-size: 14px; word-break: break-all; }
.faint { color: var(--ink-3); }
tr.clickable { cursor: pointer; transition: background-color .12s ease; }
@media (hover: hover) and (pointer: fine) { tr.clickable:hover td { background: var(--paper); } }
.copy { min-height: 36px; padding: 0 12px; border: 1px solid var(--rule-2); border-radius: var(--r); background: transparent; font: 700 12.5px var(--f-type); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); cursor: pointer; transition: background-color .15s ease, transform .14s var(--ease-out); }
.copy:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .copy:hover { background: var(--paper-2); } }
.show-sm { display: none; }

/* rules */
.rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--sheet); }
.rule-item { padding: 18px 22px 20px; border-bottom: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.rule-item:nth-child(3n + 1) { border-left: 0; }
.rule-item:nth-last-child(-n + 3) { border-bottom: 0; }
.rule-item h3 { font-size: 16px; font-weight: 750; }
.rule-item p { margin-top: 6px; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }

/* campaigns */
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.camp h3 { font-size: 17px; font-weight: 750; line-height: 1.3; }
.camp .task { margin-top: 6px; font-size: 14.5px; color: var(--ink-2); }
.camp-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }

/* forms */
.form { display: grid; gap: 8px; max-width: 560px; }
.form label { font-weight: 650; font-size: 14.5px; margin-top: 6px; }
select, .form input, .search input, textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--paper); font-size: 16px; }
.form .btn { justify-self: start; margin-top: 10px; }
textarea { font: 400 14px/1.5 var(--f-type); resize: vertical; margin-top: 8px; }
.row-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.cli { margin-top: 16px; }
.cli summary { cursor: pointer; font-weight: 650; font-size: 14.5px; min-height: 44px; display: flex; align-items: center; }
.cli .btn { margin-top: 10px; }
.checklist { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: c; }
.checklist li { position: relative; padding: 10px 0 10px 34px; border-bottom: 1px solid var(--rule); font-size: 14.5px; color: var(--ink-2); counter-increment: c; }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before { content: counter(c, decimal-leading-zero); position: absolute; left: 0; top: 10px; font: 400 13.5px var(--f-type); color: var(--stamp); }
.search { display: flex; gap: 10px; }
.search input { flex: 1; }

/* referral profile (cells, not nested cards) */
.profile { margin-top: 18px; display: grid; gap: 14px; }
.profile-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; padding-bottom: 14px; border-bottom: 3px double var(--rule); }
.profile-head h3 { font-size: 22px; font-weight: 800; }
.profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--rule-2); border-radius: var(--r); }
.cell { padding: 14px 18px; border-left: 1px solid var(--rule); min-width: 0; }
.cell:first-child { border-left: 0; }
.cell .value { font-size: 22px; }

/* ------------------------------------------------------------------ footer */
.foot { padding: 22px var(--gut) 28px; border-top: 3px double var(--rule-2); display: grid; gap: 10px; font-size: 13.5px; color: var(--ink-3); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot-links a { font-weight: 600; color: var(--ink-2); min-height: 32px; display: inline-flex; align-items: center; }
.foot-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; font-family: var(--f-type); font-size: 12.5px; }
.foot-meta a { color: inherit; }

/* ------------------------------------------------------------------ the re-ink: a live figure changed (signature interaction) */
.flash { animation: reink 1.1s ease-out; }
@keyframes reink {
  0% { color: var(--stamp); background-color: var(--stamp-wash); }
  100% { color: inherit; background-color: transparent; }
}

/* ------------------------------------------------------------------ mobile tab bar + drawer */
.tabbar { display: none; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(8, 18, 12, .45); opacity: 0; transition: opacity .2s ease; }
.sheet-backdrop.open { opacity: 1; }
.drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: var(--sheet); border-top: 3px double var(--rule-2);
  border-radius: 0; padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .34s var(--ease-drawer);
}
.drawer.open { transform: translateY(0); }
.drawer-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--rule-2); margin: 4px auto 10px; }
.drawer-list { display: grid; }
.drawer-list a, .drawer-list button { display: flex; align-items: center; min-height: 58px; padding: 6px 4px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; color: var(--ink); text-decoration: none; text-align: left; cursor: pointer; width: 100%; }
.drawer-list span { display: grid; }
.drawer-list b { font-weight: 700; font-size: 16px; }
.drawer-list small { color: var(--ink-3); font-size: 13.5px; }
.drawer-list .on b { color: var(--stamp); }
.drawer-cta { width: 100%; margin-top: 14px; }
.drawer-net { margin-top: 10px; text-align: center; font: 400 12.5px var(--f-type); color: var(--ink-3); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(3) { border-left: 0; }
  .step:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .ledger-row { grid-template-columns: 46px minmax(160px, 1.2fr) minmax(170px, 1.1fr) minmax(170px, 1.1fr); gap: 0 14px; }
  .ledger::before { left: 64px; }
}
@media (max-width: 980px) {
  :root { --spine: 0px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .spine { display: none; }
  .brand-mobile { display: inline-flex; }
  .folio-reg, .folio-sep { display: none; }
  .mobile-only { display: inline-flex; }
  .quick-search { width: min(300px, 38vw); }
  main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
  .rules { grid-template-columns: 1fr 1fr; }
  .rule-item:nth-child(3n + 1) { border-left: 1px solid var(--rule); }
  .rule-item:nth-child(2n + 1) { border-left: 0; }
  .rule-item:nth-last-child(-n + 3) { border-bottom: 1px solid var(--rule); }
  .rule-item:nth-last-child(-n + 2) { border-bottom: 0; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--cloth); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 4px;
  }
  .tabbar a, .tabbar button { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 54px; border: 0; border-radius: var(--r); background: transparent; color: var(--cloth-ink-2); text-decoration: none; font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 0; }
  .tabbar svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar .on { background: var(--paper); color: var(--ink); }
}
@media (max-width: 720px) {
  :root { --gut: 16px; }
  .folio { gap: 10px; min-height: 58px; padding-top: 8px; padding-bottom: 8px; }
  .folio-title { font-size: 15px; }
  .quick-search { display: none; }
  .btn-sm.mobile-only { margin-left: auto; }
  .entry-page { padding-top: 22px; }
  .deck { margin-top: 10px; }
  .ledger { margin-top: 54px; }
  .ledger::before { left: 44px; }
  .ledger-cols { display: none; }
  .ledger-row { grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "no name fig" "no note note"; gap: 2px 10px; padding: 11px 14px 11px 10px; min-height: 0; }
  .ledger-row .c-no { grid-area: no; align-self: start; padding-top: 2px; font-size: 12.5px; }
  .ledger-row .c-name { grid-area: name; font-size: 15px; padding-left: 6px; }
  .ledger-row .c-name small { font-size: 12.5px; }
  .ledger-row .c-fig { grid-area: fig; text-align: right; font-size: 17px; align-self: start; padding-top: 1px; }
  .ledger-row .c-note { grid-area: note; padding-left: 6px; font-size: 13px; }
  .stamp { top: -46px; right: 12px; padding: 6px 12px 5px; }
  .stamp-big { font-size: 17px; }
  .stamp-small { font-size: 11px; }
  .entry-page { display: flex; flex-direction: column; }
  .entry-page .ledger { order: 3; }
  .sign-line { order: 2; margin-top: 16px; gap: 8px; }
  .sign-line p { font-size: 13.5px; }
  .file-label { width: 100%; }
  .fl-text { flex: 1; text-align: center; padding: 0 12px; }
  .last-entry { display: none; }
  .steps { grid-template-columns: 1fr; }
  .step { border-left: 0 !important; }
  .step + .step { border-top: 1px solid var(--rule); }
  .rules { grid-template-columns: 1fr; }
  .rule-item { border-left: 0 !important; border-bottom: 1px solid var(--rule) !important; }
  .rule-item:last-child { border-bottom: 0 !important; }
  .profile-grid { grid-template-columns: 1fr; }
  .cell { border-left: 0; border-top: 1px solid var(--rule); }
  .cell:first-child { border-top: 0; }
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  th, td { padding-left: 12px; padding-right: 12px; }
  table { font-size: 13.5px; }
  td { overflow-wrap: anywhere; }
  .sheet { padding: 16px; }
  .sheet-head.pad { padding: 14px 16px 10px; }
  .chart { height: 240px; }
  .search { flex-direction: column; }
  .search .btn { width: 100%; }
  .warning .btn { justify-self: stretch; }
  .camp-grid { grid-template-columns: 1fr; }
  .foot-meta { flex-direction: column; }
}

/* ------------------------------------------------------------------ reduced motion: rest, nothing hidden */
@media (prefers-reduced-motion: reduce) {
  .stamp { animation: stamp-fade .2s ease-out .1s both; }
  .drawer { transition-duration: .01s; }
  .btn:active, .copy:active { transform: none; }
  .meter i { transition: none; }
}
@keyframes stamp-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 420px) {
  .ledger-row { grid-template-columns: 30px minmax(0, 1fr); grid-template-areas: "no name" "no fig" "no note"; }
  .ledger::before { left: 40px; }
  .ledger-row .c-fig { text-align: left; padding-left: 6px; font-size: 19px; }
  .fl-text { font-size: 15.5px; }
}
