/* ==========================================================================
   BNI Referral Desk: ledger-book stylesheet
   Independent and unofficial. System fonts only. No external resources.
   ========================================================================== */

:root {
  color-scheme: light;

  /* seed palette */
  --paper: #F3ECDC;
  --page: #FBF7EC;
  --ink: #1B2A41;
  --vermilion: #B8321F;
  --rule: #D8CCB0;
  --hi: #F2D769;

  /* derived tokens */
  --ink-2: #46536A;        /* muted text, 6.5:1 on paper */
  --ink-soft: #5F6B80;     /* control borders and placeholders */
  --verm-deep: #8E2415;    /* hover and small red text */
  --verm-hover: #A22B1A;
  --paper-deep: #EAE0C8;
  --white: #FFFDF7;
  --rail-ink: #16233A;
  --rail-text: #D6DCE6;

  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --font-label: "American Typewriter", "Courier New", Courier, monospace;

  --u: 1.75rem;
  --rail-w: 6.5rem;
  --gutter: clamp(3.25rem, 5vw, 4.75rem);
  --pad: clamp(1rem, 3.5vw, 3.5rem);

  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4.5rem;

  --noise: 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='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .11 0 0 0 0 .16 0 0 0 0 .25 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  background-image: var(--noise);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, .96rem + .15vw, 1.0625rem);
  line-height: var(--u);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; color: var(--ink); margin: 0; }
p, ul, ol, dl, figure, table, fieldset { margin: 0; }
ul, ol { padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--vermilion); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .2em; }
a:hover { color: var(--ink); }
em { font-style: italic; }
strong { font-weight: 700; }
[hidden] { display: none !important; }

.sr-only, .sr-live {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: .75rem; top: -5rem; z-index: 300;
  background: var(--hi); color: var(--ink); padding: .75rem 1.1rem; min-height: 2.75rem;
  font-family: var(--font-label); font-weight: 700; border: 2px solid var(--ink); border-radius: 4px;
  text-decoration: none;
}
.skip:focus { top: .75rem; }

kbd {
  font-family: var(--font-label); font-size: .85em; padding: .05em .4em; background: var(--white);
  border: 1.5px solid var(--ink); border-radius: 3px; box-shadow: 0 2px 0 var(--ink);
}

/* ==========================================================================
   Binding rail (desktop) and top bar (mobile)
   ========================================================================== */
.site-head {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--rail-w); z-index: 50;
  display: flex; flex-direction: column;
  background:
    linear-gradient(90deg, rgba(0,0,0,.28), rgba(0,0,0,0) 14%, rgba(255,255,255,.04) 70%, rgba(0,0,0,.35)),
    var(--ink);
  color: var(--paper);
  box-shadow: 4px 0 0 rgba(27,42,65,.18), 10px 0 24px -8px rgba(15,26,43,.55);
}
/* stitched binding thread */
.site-head::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: .55rem; width: 0;
  border-right: 2px dashed rgba(243,236,220,.34); pointer-events: none;
}
.bar { display: block; }
.brand {
  display: flex; flex-direction: column; align-items: flex-start; gap: .6rem;
  padding: 1.25rem 1rem 0; color: var(--paper); text-decoration: none;
}
.brand:hover { color: var(--paper); }
.brand-mark { width: 2.75rem; height: 2.75rem; flex: none; }
.brand-text {
  display: flex; flex-direction: column; font-family: var(--font-label); font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; font-size: .75rem; line-height: 1.35;
}
.brand-text span:first-child { color: var(--hi); }
.menu-btn { display: none; }

.site-nav { margin-top: 1.5rem; }
.tabs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.tab {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .15rem;
  min-height: 3.75rem; padding: .55rem .5rem .55rem 1rem; margin-right: .9rem;
  color: var(--paper); text-decoration: none; border-radius: 0 7px 7px 0;
  transition: transform .18s ease, background-color .18s ease;
}
.tab .folio { font-family: var(--font-label); font-size: 1.3rem; line-height: 1; font-weight: 700; letter-spacing: .02em; }
.tab .tab-name { font-family: var(--font-label); font-size: .75rem; line-height: 1.15; color: var(--rail-text); }
.tab:hover { background: rgba(243,236,220,.12); color: var(--paper); transform: translateX(4px); }
.tab[aria-current="page"] {
  background: var(--page); color: var(--ink); margin-right: -.75rem; padding-right: 1.25rem;
  box-shadow: 0 2px 0 rgba(0,0,0,.25), 3px 0 0 var(--rule); transform: none;
}
.tab[aria-current="page"] .tab-name { color: var(--ink-2); }
.tab[aria-current="page"]::before {
  content: ""; position: absolute; left: 0; top: .55rem; bottom: .55rem; width: 4px; background: var(--vermilion);
}
.site-head :focus-visible { outline: 3px solid var(--hi); outline-offset: -3px; }
.site-head .tab[aria-current="page"]:focus-visible { outline-color: var(--ink); }
.rail-note {
  margin-top: auto; padding: 1rem 1rem 1.25rem; font-family: var(--font-label); font-size: .75rem;
  line-height: 1.35; color: var(--rail-text);
}

/* ==========================================================================
   Page and ruled sheet
   ========================================================================== */
.page {
  margin-left: var(--rail-w);
  padding: clamp(.75rem, 2.2vw, 2rem) clamp(.75rem, 3vw, 3rem) 0 clamp(1.25rem, 2.6vw, 2.75rem);
  min-height: 100vh; display: flex; flex-direction: column;
}
.sheet {
  position: relative; width: 100%; max-width: 76rem; margin: 0 auto; flex: none;
  padding: 0 var(--pad) 4.5rem var(--gutter);
  background-color: var(--page);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--u) - 1px), var(--rule) calc(var(--u) - 1px), var(--rule) var(--u));
  background-position: 0 .5rem;
  border-radius: 3px 8px 8px 3px;
  box-shadow:
    1px 0 0 #E4DAC0, 3px 1px 0 var(--page), 4px 1px 0 #E0D5B8, 6px 2px 0 var(--page), 7px 2px 0 #DACEAF,
    0 26px 44px -22px rgba(27,42,65,.5), 0 2px 5px rgba(27,42,65,.2);
  counter-reset: entry;
}
.sheet:focus { outline: none; }
/* the double red margin line */
.sheet::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--gutter) - .9rem); width: 5px;
  border-left: 1.5px solid var(--vermilion); border-right: 1.5px solid var(--vermilion);
  opacity: .72; pointer-events: none;
}

.folio-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap;
  margin: 0 calc(var(--pad) * -1) 2.5rem calc(var(--gutter) * -1);
  padding: .8rem var(--pad) .7rem calc(var(--gutter) - .5rem);
  font-family: var(--font-label); font-size: .8125rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2); background: var(--paper); border-bottom: 4px double var(--ink);
  border-radius: 3px 8px 0 0; position: relative; z-index: 1;
}
.folio-head span:first-child { color: var(--verm-deep); }

/* ---------- typography ---------- */
h1 { font-size: clamp(2.15rem, 1.25rem + 3.6vw, 4rem); line-height: 1.07; letter-spacing: -.015em; text-wrap: balance; }
h2 { font-size: clamp(1.55rem, 1.15rem + 1.4vw, 2.3rem); line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
h3 { font-size: clamp(1.15rem, 1.05rem + .45vw, 1.4rem); line-height: 1.25; }
.eyebrow {
  font-family: var(--font-label); font-size: .8125rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--verm-deep); margin-bottom: .75rem;
}
.lead { font-size: clamp(1.1rem, 1.02rem + .4vw, 1.3rem); line-height: 1.6; max-width: 40rem; margin-top: 1.25rem; }
.hl {
  background-image: linear-gradient(transparent 52%, var(--hi) 52%, var(--hi) 94%, transparent 94%);
  background-repeat: no-repeat; background-size: 100% 100%; padding: 0;
  animation: hl-swipe .9s .5s ease-out both;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
@keyframes hl-swipe { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }

.page-intro { max-width: 52rem; padding-top: .25rem; }
.entry { position: relative; margin-top: 4.5rem; }
.entry:first-of-type { margin-top: 3rem; }
.entry > h2 { position: relative; counter-increment: entry; margin-bottom: 1rem; }
.entry > h2::before {
  content: counter(entry, decimal-leading-zero);
  content: counter(entry, decimal-leading-zero) / "";
  position: absolute; right: 100%; top: .3em; margin-right: 1.3rem;
  font-family: var(--font-label); font-size: .8125rem; font-weight: 700; letter-spacing: .04em; color: var(--verm-deep);
}
.entry-intro { max-width: 44rem; margin-bottom: 1.75rem; }
.prose { max-width: 42rem; }
.prose p + p { margin-top: 1.75rem; }
.aside-note {
  margin-top: 1.75rem; max-width: 44rem; padding: .85rem 1.1rem; background: var(--paper);
  border-left: 5px solid var(--ink); font-size: .975rem; line-height: 1.55;
}

.plain { list-style: none; margin: 0; }
.plain li { position: relative; padding-left: 1.4rem; margin-top: .75rem; line-height: 1.55; }
.plain li::before { content: "\2013"; position: absolute; left: 0; color: var(--vermilion); font-family: var(--font-label); font-weight: 700; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 3rem; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 2rem; }
.two-col h3, .three-col h3 { margin-bottom: .25rem; padding-bottom: .4rem; border-bottom: 3px double var(--ink); }

.steps { list-style: none; counter-reset: step; max-width: 46rem; }
.steps li { counter-increment: step; position: relative; padding: .5rem 0 .5rem 3.4rem; margin-bottom: .75rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: .35rem; width: 2.3rem; height: 2.3rem;
  display: grid; place-items: center; font-family: var(--font-label); font-weight: 700;
  border: 2px solid var(--vermilion); border-radius: 50%; color: var(--verm-deep); background: var(--page);
}

/* ---------- buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 1.5rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.875rem; padding: .55rem 1.2rem; max-width: 100%;
  font-family: var(--font-label); font-size: .875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 4px;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease, color .12s ease;
}
.btn:hover { background: var(--hi); color: var(--ink); transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn--primary { background: var(--vermilion); color: #fff; border-color: var(--verm-deep); box-shadow: 0 3px 0 var(--verm-deep); }
.btn--primary:hover { background: var(--verm-hover); color: #fff; box-shadow: 0 4px 0 var(--verm-deep); }
.btn--primary:active { box-shadow: 0 0 0 var(--verm-deep); }
.btn--ghost { background: var(--page); }
.btn--danger { background: var(--ink); color: var(--paper); }
.btn--danger:hover { background: var(--verm-deep); color: #fff; }
.btn--small { min-height: 2.5rem; padding: .35rem .9rem; font-size: .8125rem; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.btn:disabled, .btn[disabled] {
  background: var(--paper-deep); color: var(--ink-2); border-style: dashed; border-color: var(--ink-soft);
  box-shadow: none; cursor: not-allowed; transform: none;
}

/* ==========================================================================
   Forms
   ========================================================================== */
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.1rem; min-width: 0; }
label { font-family: var(--font-label); font-size: .875rem; font-weight: 700; letter-spacing: .02em; line-height: 1.3; }
input[type="text"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; min-height: 2.75rem; padding: .55rem .75rem;
  background: var(--white); color: var(--ink);
  border: 2px solid var(--ink-soft); border-bottom-color: var(--ink); border-radius: 3px;
  font-size: 1rem; line-height: 1.4;
}
textarea { resize: vertical; min-height: 4.5rem; line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; padding-right: 2.4rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 52%, calc(100% - .8rem) 52%; background-size: .4rem .4rem, .4rem .4rem; background-repeat: no-repeat;
}
::placeholder { color: var(--ink-soft); opacity: 1; }
input:focus, select:focus, textarea:focus { background-color: #FFFBE6; border-color: var(--ink); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 2px; }
.field-hint { font-size: .875rem; line-height: 1.45; color: var(--ink-2); }
.field-hint.is-error { color: var(--verm-deep); font-weight: 700; }
.field--check { flex-direction: row; align-items: center; gap: .6rem; }
.field--check input { width: 1.5rem; height: 1.5rem; flex: none; accent-color: var(--vermilion); margin: 0; }
.field--check label { min-height: 2.75rem; display: flex; align-items: center; cursor: pointer; }
.field--grow { flex: 1 1 12rem; }
.form-msg { min-height: 1.5rem; margin-top: .5rem; font-weight: 700; color: var(--verm-deep); }
.form-msg:empty { min-height: 0; margin: 0; }
.save-status { margin-top: 1rem; font-family: var(--font-label); font-size: .8125rem; color: var(--ink-2); }
input[type="range"] { accent-color: var(--vermilion); width: 100%; min-height: 2.75rem; padding: 0; background: none; border: 0; }

/* segmented radios */
.seg { grid-column: 1 / -1; margin-bottom: 1.1rem; }
.seg legend { font-family: var(--font-label); font-size: .875rem; font-weight: 700; margin-bottom: .35rem; }
.seg-opts { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; background: var(--white); }
.seg-opts input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-opts label {
  display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.875rem; padding: .4rem .75rem; cursor: pointer; text-align: center;
}
.seg-opts label + input + label { border-left: 2px solid var(--ink); }
.seg-opts input:checked + label { background: var(--ink); color: var(--paper); }
.seg-opts input:checked + label::before { content: "\2713"; }
.seg-opts input:focus-visible + label { outline: 3px solid var(--hi); outline-offset: -5px; }
.seg-opts input:not(:checked):focus-visible + label { outline-color: var(--ink); }

/* ==========================================================================
   Shared content components
   ========================================================================== */
/* ledger rows */
.lrows { list-style: none; border-top: 4px double var(--ink); }
.lrow {
  display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) 10rem auto; gap: .75rem 1.5rem; align-items: start;
  padding: 1.5rem .25rem; border-bottom: 1px dashed var(--ink-soft);
}
.lrow-no { font-family: var(--font-label); font-size: 2rem; font-weight: 700; line-height: 1; color: var(--verm-deep); }
.lrow-main h3 { margin-bottom: .35rem; }
.lrow-main h3 a { color: var(--ink); text-decoration-color: var(--vermilion); }
.lrow-main h3 a:hover { color: var(--verm-deep); }
.lrow-main p { max-width: 38rem; }
.lrow-meta { font-family: var(--font-label); font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding-top: .4rem; }
.lrows--simple .lrow { grid-template-columns: 3.5rem minmax(0, 1fr); }

.tag {
  display: inline-block; vertical-align: .15em; padding: 0 .45em; margin-left: .35em; border: 1.5px solid var(--ink);
  font-family: var(--font-label); font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; line-height: 1.5;
  background: var(--paper); color: var(--ink); border-radius: 3px;
}

/* stamp box */
.stampbox {
  position: relative; max-width: 46rem; padding: 1.75rem 1.5rem 1.25rem; margin-top: 1rem;
  background: var(--paper); border: 4px double var(--vermilion); border-radius: 6px; transform: rotate(-.35deg);
}
.stampbox p + p { margin-top: .9rem; }
.stampbox-label {
  position: absolute; top: -.95rem; left: 1.1rem; padding: .1rem .7rem; background: var(--page);
  font-family: var(--font-label); font-size: .8125rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--verm-deep);
  border: 2px solid var(--vermilion); border-radius: 3px; transform: rotate(-1.5deg);
}
.stampbox--big { max-width: 52rem; padding-top: 2rem; }

/* tables */
.table-wrap { width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
caption { text-align: left; font-family: var(--font-label); font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); padding-bottom: .6rem; }
th, td { text-align: left; vertical-align: top; }
thead th {
  font-family: var(--font-label); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink);
  padding: .65rem .75rem; background: var(--paper); border-bottom: 3px double var(--ink); border-top: 2px solid var(--ink);
}
tbody td, tbody th { padding: .9rem .75rem; border-bottom: 1px dashed var(--ink-soft); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.compare-wrap { margin-top: 3rem; }
.compare caption { font-size: .8125rem; }
.compare tbody th { font-family: var(--font-label); font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase; width: 9rem; color: var(--ink); }
.compare td { max-width: 24rem; }
.compare thead th:nth-child(3), .compare td:nth-child(3) { background: rgba(242,215,105,.28); }
.compare thead th:nth-child(3) { background: var(--hi); }

/* ==========================================================================
   Home
   ========================================================================== */
.hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 2rem 3rem; align-items: center; margin-top: 0; padding-top: .25rem; }
.hero h1 { font-size: clamp(2.3rem, 1.2rem + 3.9vw, 4.4rem); }
.hero-copy .btn-row { margin-top: 2rem; }
.pledges { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem .75rem; margin-top: 2rem; }
.pledges li {
  padding: .3rem .8rem; font-family: var(--font-label); font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  border: 2px solid var(--ink); border-radius: 3px; background: var(--paper);
}
.pledges li::before { content: "\2713\00a0"; color: var(--verm-deep); }
.hero-art { margin: 0; }
.hero-svg { width: 100%; height: auto; display: block; overflow: visible; }
.hero-svg .stamp-text, .cy-label { font-family: var(--font-label); }
.hero-stamp { transform-box: fill-box; transform-origin: center; }
.hero-pending .hero-stamp { opacity: 0; }
.hero-ready .hero-stamp { animation: stamp-down .75s cubic-bezier(.2, .9, .3, 1.1) both; }
@keyframes stamp-down {
  0% { opacity: 0; transform: scale(2.6) rotate(-14deg); }
  55% { opacity: 1; transform: scale(.9) rotate(1deg); }
  75% { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* typewriter hero line */
.tw-w { display: inline-block; white-space: nowrap; }
.tw-ch.is-hidden { visibility: hidden; }
.tw-cursor { display: inline-block; position: relative; width: 0; height: 1em; vertical-align: baseline; }
.tw-cursor::after {
  content: ""; position: absolute; left: .04em; bottom: -.08em; width: .07em; height: .95em; background: var(--vermilion);
  animation: caret 1s steps(2, start) infinite;
}
@keyframes caret { to { visibility: hidden; } }

.rhythm { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 2.5rem 3rem; align-items: start; }
.week { list-style: none; border-top: 4px double var(--ink); }
.week li { display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: 1rem; padding: .95rem .5rem; border-bottom: 1px dashed var(--ink-soft); }
.week .day {
  align-self: start; text-align: center; padding: .3rem 0; font-family: var(--font-label); font-weight: 700; font-size: .875rem; letter-spacing: .1em; text-transform: uppercase;
  border: 2px solid var(--ink); border-radius: 4px; background: var(--paper);
}
.week h3 { font-size: 1.15rem; margin-bottom: .1rem; }
.week p { line-height: 1.5; }
.week .is-meeting { background: linear-gradient(90deg, rgba(242,215,105,.55), rgba(242,215,105,.12)); }
.week .is-meeting .day { background: var(--vermilion); color: #fff; border-color: var(--verm-deep); }
.cycle-fig { margin: 0; position: sticky; top: 1.5rem; }
.cycle { width: 100%; max-width: 27rem; height: auto; display: block; margin: 0 auto; }
.cycle-fig figcaption { text-align: center; font-family: var(--font-label); font-size: .8125rem; letter-spacing: .04em; color: var(--ink-2); margin-top: .5rem; }

.principles { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3rem; border-top: 4px double var(--ink); }
.principles li { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 1rem; padding: 1.25rem 0; border-bottom: 1px dashed var(--ink-soft); }
.p-no {
  width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border: 3px double var(--vermilion); border-radius: 50%;
  font-family: var(--font-label); font-weight: 700; font-size: 1.15rem; color: var(--verm-deep); background: var(--page); transform: rotate(-6deg);
}
.principles h3 { margin-bottom: .25rem; }

/* ==========================================================================
   Pitch builder
   ========================================================================== */
.workbench { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 2.5rem; margin-top: 2.5rem; align-items: start; }
.pitch-form { min-width: 0; }
.beat { margin: 0 0 1.5rem; padding: 1rem 1.1rem .25rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 4px; box-shadow: 4px 4px 0 rgba(27,42,65,.22); }
.beat legend {
  display: flex; align-items: center; gap: .6rem; padding: .15rem .8rem .15rem .15rem; margin-left: -.25rem;
  font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; background: var(--page); border: 2px solid var(--ink); border-radius: 999px;
}
.beat-no { display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 .3rem; border-radius: 999px; background: var(--vermilion); color: #fff; font-family: var(--font-label); font-size: .8125rem; }
.beat .field:first-of-type { margin-top: 1rem; }
.pace-row { display: grid; grid-template-columns: minmax(0, 1fr) 6.5rem; gap: .75rem; align-items: center; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.mini-meter { display: none; }

.script-pane { min-width: 0; padding: 1.25rem 1.25rem 1.5rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 6px 6px 0 rgba(27,42,65,.25); }
.pane-top { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1.25rem; align-items: center; }
.ring-wrap { position: relative; width: 9rem; aspect-ratio: 1; }
.ring { width: 100%; height: 100%; display: block; }
.ring-track { stroke: var(--rule); }
.ring-fill { stroke: var(--ink); transition: stroke-dashoffset .5s cubic-bezier(.3, .7, .2, 1), stroke .3s ease; }
.ring.is-over .ring-fill { stroke: var(--vermilion); }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-num { font-family: var(--font-label); font-weight: 700; font-size: 1.9rem; line-height: 1; }
.ring-of { font-family: var(--font-label); font-size: .75rem; color: var(--ink-2); margin-top: .2rem; }
.stats { display: grid; gap: .5rem; }
.stats div { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding-bottom: .35rem; border-bottom: 1px dashed var(--ink-soft); }
.stats dt { font-family: var(--font-label); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.stats dd { margin: 0; font-family: var(--font-label); font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.ring-status { margin-top: 1rem; padding: .6rem .8rem; background: var(--page); border-left: 5px solid var(--ink); font-weight: 700; line-height: 1.45; }
.ring-status.is-over { border-left-color: var(--vermilion); }
.pane-h { font-size: 1.15rem; margin: 1.5rem 0 .6rem; font-family: var(--font-label); text-transform: uppercase; letter-spacing: .1em; font-size: .875rem; color: var(--verm-deep); }
.script-sheet {
  padding: 1rem 1.1rem; background-color: var(--white); border: 2px solid var(--ink); border-radius: 3px; min-height: 8rem;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--u) - 1px), var(--rule) calc(var(--u) - 1px), var(--rule) var(--u));
  background-position: 0 .85rem; font-size: 1.0625rem; line-height: var(--u);
}
.script-sheet p { margin: 0; }
.script-sheet p + p { margin-top: var(--u); }
.script-sheet .beat-tag { display: block; font-family: var(--font-label); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--verm-deep); line-height: 1.2; margin-bottom: .1rem; }
.script-sheet .empty { color: var(--ink-2); }
.copy-status { min-height: 1.5rem; margin-top: .6rem; font-weight: 700; font-size: .9375rem; }
.rehearse { margin-top: .5rem; padding-top: .25rem; border-top: 3px double var(--ink); }
.rehearse-help { font-size: .9375rem; line-height: 1.5; }
.rehearse-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: .9rem; }
.rehearse-clock { font-family: var(--font-label); font-weight: 700; font-size: 2rem; font-variant-numeric: tabular-nums; }
.rehearse-result { margin: .75rem 0; min-height: 1.5rem; line-height: 1.5; }

.beat-table { min-width: 34rem; }
.beat-table tfoot th, .beat-table tfoot td { padding: .8rem .75rem; border-top: 3px double var(--ink); font-weight: 700; }
.beat-table tbody th { font-weight: 700; }
.share { display: block; height: .85rem; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 2px; overflow: hidden; min-width: 6rem; }
.share i { display: block; height: 100%; background: var(--ink); background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgba(251,247,236,.35) 4px 6px); transition: width .4s ease; }
.share.is-long i { background-color: var(--vermilion); }
.empty-row td { color: var(--ink-2); text-align: center; padding: 1.5rem; }

/* ==========================================================================
   Referral ledger
   ========================================================================== */
.footing { margin-top: 2.5rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 4px; box-shadow: 5px 5px 0 rgba(27,42,65,.22); }
.tallies { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.tally { padding: 1rem 1.1rem .9rem; border-right: 1px dashed var(--ink-soft); border-bottom: 1px dashed var(--ink-soft); min-width: 0; }
.tally:nth-child(4n) { border-right: 0; }
.tally dt { font-family: var(--font-label); font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.tally dd { margin: .2rem 0 0; font-family: var(--font-label); font-size: clamp(1.7rem, 1.3rem + 1vw, 2.3rem); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tally p { font-size: .8125rem; line-height: 1.35; color: var(--ink-2); margin-top: .2rem; }
.tally--wide { grid-column: span 2; border-right: 0; }
.tally--full { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
.tally--wide dd { font-size: clamp(1.25rem, 1.05rem + .6vw, 1.6rem); padding-top: .35rem; }
.tally.is-alert dd { display: inline-block; background: var(--hi); padding: 0 .35rem; }
.tally-note { padding: .7rem 1.1rem; font-size: .9375rem; border-top: 3px double var(--ink); color: var(--ink); }

.ledger-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2.5rem; margin-top: 3rem; align-items: start; }
.entry-form-wrap > h2 { margin-bottom: 1.1rem; }
.entry-form { align-items: start; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.1rem; padding: 1.25rem 1.25rem .5rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 4px; box-shadow: 4px 4px 0 rgba(27,42,65,.22); }
.entry-form .field--wide, .entry-form .form-msg, .entry-form .btn-row, .entry-form #thanks-field { grid-column: 1 / -1; }
.entry-form .btn-row { margin: 0 0 1rem; }
.margin-col { display: grid; gap: 1.5rem; }
.margin-panel { padding: 1.1rem 1.25rem 1.25rem; background: var(--white); border: 2px solid var(--ink); border-radius: 4px; border-left: 8px double var(--vermilion); }
.margin-panel h3 { margin-bottom: .6rem; }
.margin-list { list-style: none; display: grid; gap: .5rem; }
.margin-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .75rem; padding: .5rem 0; border-bottom: 1px dashed var(--ink-soft); line-height: 1.4; }
.margin-list .ml-text { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; }
.margin-list .ml-age { display: block; font-family: var(--font-label); font-size: .75rem; color: var(--ink-2); }
.margin-empty { color: var(--ink-2); border-bottom: 0 !important; }
.field--inline { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .5rem; }
.inline-num { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-label); font-weight: 700; }
.inline-num input { width: 5.5rem; }

.book { margin-top: 4rem; }
.book > h2 { margin-bottom: 1rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 0 1rem; align-items: flex-end; padding: 1rem 1rem .1rem; background: var(--paper); border: 2px solid var(--ink); border-bottom: 0; border-radius: 4px 4px 0 0; }
.toolbar .field { flex: 0 1 11rem; }
.toolbar .field--grow { flex: 1 1 14rem; }
.showing { padding: .5rem 1rem; font-family: var(--font-label); font-size: .8125rem; background: var(--paper); border: 2px solid var(--ink); border-top: 1px dashed var(--ink-soft); border-radius: 0; margin-bottom: 0; }
.ledger-table { border: 2px solid var(--ink); border-top: 0; background: var(--white); }
.ledger-table tbody td { padding: 1rem .75rem; }
.ledger-table tbody tr { transition: background-color .4s ease; }
.ledger-table tbody tr.is-new { animation: row-flash 1.6s ease-out; }
@keyframes row-flash { from { background-color: var(--hi); } to { background-color: transparent; } }
.ledger-table .c-date { width: 9.5rem; }
.ledger-table .c-status { width: 12.5rem; }
.ledger-table .c-thanks { width: 10rem; }
.ledger-table .c-actions { width: 6.5rem; }
.row-no { display: block; font-family: var(--font-label); font-size: .75rem; letter-spacing: .08em; color: var(--verm-deep); font-weight: 700; }
.row-date { display: block; font-family: var(--font-label); font-weight: 700; font-size: .9375rem; }
.flow { display: inline-block; margin-top: .3rem; font-family: var(--font-label); font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 0 .4rem; border: 1.5px solid var(--ink); border-radius: 3px; }
.flow--given { background: var(--paper); }
.flow--received { background: var(--ink); color: var(--paper); }
.row-lead { display: block; font-weight: 700; font-size: 1.0625rem; line-height: 1.35; overflow-wrap: anywhere; }
.row-member { display: block; color: var(--ink-2); overflow-wrap: anywhere; }
.row-notes { display: block; margin-top: .3rem; font-size: .9rem; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
.status-select { margin-top: .6rem; min-height: 2.5rem; font-size: .875rem; padding: .3rem 2rem .3rem .5rem; }
.thanks-box { display: flex; align-items: center; gap: .5rem; min-height: 2.5rem; }
.thanks-box input { width: 1.5rem; height: 1.5rem; accent-color: var(--vermilion); margin: 0; }
.thanks-box label { font-size: .8125rem; cursor: pointer; }
.row-value { display: block; margin-top: .25rem; font-family: var(--font-label); font-weight: 700; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; flex-direction: column; gap: .4rem; }
.row-actions .btn { min-height: 2.5rem; padding: .25rem .5rem; font-size: .75rem; box-shadow: 0 2px 0 var(--ink); }
.muted { color: var(--ink-2); }

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; padding: 2.5rem 1.5rem; border: 2px solid var(--ink); border-top: 0; background: var(--white); }
.empty-state svg { width: 7.5rem; height: auto; }
.empty-state p { max-width: 32rem; }
.empty-title { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; }
.book-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1.25rem; }
.clear-wrap { display: inline-flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.clear-confirm { display: inline-flex; flex-wrap: wrap; gap: .6rem; align-items: center; font-weight: 700; }

/* stamps */
.stamp {
  position: relative; display: inline-block; padding: .3rem .7rem .22rem; font-family: var(--font-label); font-size: .875rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; line-height: 1.2; text-align: center; white-space: nowrap;
  border: 3px solid currentColor; border-radius: 4px; background: var(--page); color: var(--ink); transform: rotate(-2.5deg);
  filter: url(#rough);
}
.stamp--passed { color: var(--ink); }
.stamp--contacted { color: var(--ink); border-style: double; border-width: 5px; padding: .2rem .6rem .12rem; }
.stamp--meeting { background: var(--hi); color: var(--ink); border-color: var(--ink); }
.stamp--closed { background: var(--vermilion); color: #fff; border-color: var(--verm-deep); }
.stamp--nofit { background: var(--paper-deep); color: var(--ink-2); border-style: dashed; }
.stamp::after { content: ""; position: absolute; inset: -7px; border: 2px solid var(--ink); border-radius: 8px; opacity: 0; pointer-events: none; }
.stamp.thump { animation: thump .6s cubic-bezier(.2, .85, .3, 1) both; }
.stamp.thump::after { animation: impact .6s ease-out both; }
@keyframes thump {
  0% { transform: rotate(-9deg) scale(2.3); opacity: 0; }
  50% { transform: rotate(-2.5deg) scale(.9); opacity: 1; }
  70% { transform: rotate(-2.5deg) scale(1.06); }
  100% { transform: rotate(-2.5deg) scale(1); opacity: 1; }
}
@keyframes impact { 0%, 45% { opacity: 0; transform: scale(.85); } 55% { opacity: .55; transform: scale(1); } 100% { opacity: 0; transform: scale(1.35); } }
.stamp-key { display: grid; gap: 0; border-top: 4px double var(--ink); max-width: 52rem; }
.stamp-key > div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1.5rem; align-items: center; padding: 1rem .25rem; border-bottom: 1px dashed var(--ink-soft); }
.stamp-key dt { padding: .4rem 0; }
.stamp-key dd { margin: 0; }

/* ==========================================================================
   Toast
   ========================================================================== */
.toast-wrap { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: .5rem; width: min(92vw, 30rem); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .9rem .7rem 1.1rem;
  background: var(--ink); color: var(--paper); border-radius: 6px; border: 2px solid var(--paper); box-shadow: 0 10px 28px -6px rgba(15,26,43,.6);
  font-weight: 700; line-height: 1.4; animation: toast-in .25s ease-out;
}
.toast :focus-visible { outline-color: var(--hi); }
.toast .btn { box-shadow: none; background: var(--hi); border-color: var(--hi); color: var(--ink); min-height: 2.5rem; padding: .3rem .9rem; }
.toast .btn:hover { background: var(--white); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   One-to-ones: deck, hand, agenda
   ========================================================================== */
.deck-controls { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.5rem; }
.chip {
  min-height: 2.75rem; padding: .35rem 1.1rem; font-family: var(--font-label); font-weight: 700; font-size: .875rem; letter-spacing: .04em; cursor: pointer;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px;
}
.chip:hover { background: var(--hi); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip[aria-pressed="true"]::before { content: "\2713\00a0"; }

.deck-area { display: flex; flex-direction: column; align-items: center; }
.deck-stage { position: relative; width: calc(100% - 1.75rem); max-width: 32rem; margin: 1rem auto .5rem; perspective: 1500px; }
.deck-stage::before, .deck-stage::after { content: ""; position: absolute; inset: 0; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; }
.deck-stage::before { transform: rotate(-3.2deg) translate(-8px, 8px); }
.deck-stage::after { transform: rotate(2.6deg) translate(10px, 5px); background: var(--paper-deep); }
.card {
  position: relative; z-index: 1; display: block; width: 100%; height: clamp(22rem, 66vw, 26rem); padding: 0; border: 0; background: none;
  cursor: pointer; text-align: left; font: inherit; color: inherit; -webkit-tap-highlight-color: transparent;
}
.card:focus-visible { outline-offset: 6px; border-radius: 12px; }
.card-inner { position: absolute; inset: 0; transform-style: preserve-3d; -webkit-transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, .7, .2, 1); }
.card.is-flipped .card-inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; display: flex; flex-direction: column; padding: 1.1rem 1.4rem 1rem; border: 2px solid var(--ink); border-radius: 12px;
  -webkit-backface-visibility: hidden; backface-visibility: hidden; box-shadow: 0 3px 0 var(--ink), 0 20px 30px -16px rgba(27,42,65,.55);
}
.face-front {
  background-color: var(--white);
  background-image:
    linear-gradient(var(--vermilion), var(--vermilion)),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--u) - 1px), var(--rule) calc(var(--u) - 1px), var(--rule) var(--u));
  background-repeat: no-repeat, repeat; background-size: 100% 2px, 100% 100%; background-position: 0 3.6rem, 0 .8rem;
}
.face-back { background: var(--ink); color: var(--paper); transform: rotateY(180deg); visibility: hidden; transition: visibility 0s linear .3s; }
.face-front { transition: visibility 0s linear .3s; }
.card.is-flipped .face-back { visibility: visible; }
.card.is-flipped .face-front { visibility: hidden; }
.face-top { display: flex; justify-content: space-between; align-items: center; gap: .75rem; min-height: 2.2rem; }
.face-cat { font-family: var(--font-label); font-weight: 700; font-size: .8125rem; letter-spacing: .14em; text-transform: uppercase; padding: .1rem .6rem; border: 2px solid currentColor; border-radius: 999px; }
.face-front .face-cat { color: var(--verm-deep); }
.face-no { font-family: var(--font-label); font-weight: 700; font-size: .8125rem; letter-spacing: .08em; }
.face-q { flex: 1; display: block; margin-top: 1.9rem; font-family: var(--font-head); font-weight: 700; font-size: clamp(1.25rem, 1.05rem + 1vw, 1.65rem); line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
.face-label { align-self: flex-start; margin-top: 1.6rem; padding: 0 .6rem; background: var(--hi); color: var(--ink); font-family: var(--font-label); font-weight: 700; font-size: .8125rem; letter-spacing: .14em; text-transform: uppercase; border-radius: 3px; }
.face-l { flex: 1; display: block; margin-top: 1rem; font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); line-height: 1.5; overflow-wrap: anywhere; }
.face-foot { font-family: var(--font-label); font-size: .8125rem; letter-spacing: .04em; color: var(--ink-2); }
.face-back .face-foot { color: var(--rail-text); }
.deck-count { margin-top: 1.5rem; font-family: var(--font-label); font-weight: 700; letter-spacing: .06em; font-size: .9375rem; }
.deck-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1rem; }

.hand { margin-top: 3rem; padding: 1.25rem 1.5rem 1.5rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 4px; max-width: 52rem; }
.hand h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .75rem; margin-bottom: .75rem; }
.hand-count { font-family: var(--font-label); font-size: .8125rem; font-weight: 700; letter-spacing: .08em; color: var(--ink-2); }
.hand-list { list-style: none; counter-reset: hand; display: grid; gap: .6rem; margin-bottom: 1rem; }
.hand-list li { counter-increment: hand; display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .6rem .75rem; background: var(--white); border: 1.5px solid var(--ink); border-radius: 3px; }
.hand-list li::before { content: counter(hand); font-family: var(--font-label); font-weight: 700; color: var(--verm-deep); }
.hand-list .h-cat { display: block; font-family: var(--font-label); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.hand-empty { color: var(--ink-2); margin-bottom: 1rem; }

.agenda-bar { display: flex; height: 2.6rem; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; margin-bottom: 1.5rem; max-width: 52rem; background: var(--paper); }
.agenda-bar span { display: flex; align-items: center; justify-content: center; font-family: var(--font-label); font-weight: 700; font-size: .875rem; border-right: 2px solid var(--ink); background: var(--paper); transition: background-color .2s ease, color .2s ease; }
.agenda-bar span:nth-child(even) { background: var(--paper-deep); }
.agenda-bar span:last-child { border-right: 0; }
.agenda-bar span.is-now { background: var(--ink); color: var(--paper); }
.agenda { list-style: none; border-top: 4px double var(--ink); max-width: 52rem; }
.agenda-item { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 1rem; padding: 1rem .5rem; border-bottom: 1px dashed var(--ink-soft); }
.agenda-item.is-now { background: linear-gradient(90deg, rgba(242,215,105,.6), rgba(242,215,105,.15)); box-shadow: inset 5px 0 0 var(--vermilion); }
.ag-time { font-family: var(--font-label); font-weight: 700; color: var(--verm-deep); font-size: 1.05rem; padding-top: .15rem; }
.ag-len { margin-left: .5rem; font-family: var(--font-label); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; }
.agenda-item h3 { margin-bottom: .15rem; }

.timer { margin-top: 2.5rem; max-width: 52rem; }
.timer h3 { margin-bottom: .75rem; }
.timer-face { padding: 1.25rem 1.5rem 1.5rem; background: var(--ink); color: var(--paper); border-radius: 6px; border: 3px solid var(--ink); box-shadow: inset 0 0 0 2px rgba(243,236,220,.3), 6px 6px 0 rgba(27,42,65,.25); }
.timer-part { font-family: var(--font-label); font-weight: 700; font-size: .9375rem; letter-spacing: .08em; text-transform: uppercase; color: var(--hi); }
.timer-clock { margin-top: .25rem; font-family: var(--font-label); font-weight: 700; font-size: clamp(3.2rem, 2rem + 6vw, 5.5rem); line-height: 1.05; font-variant-numeric: tabular-nums; }
.timer-clock.is-over { color: #FFB8AA; }
.timer-sub { font-weight: 700; min-height: 1.75rem; }
.timer-progress { height: .75rem; margin-top: .75rem; border: 2px solid var(--paper); border-radius: 999px; overflow: hidden; }
.timer-progress i { display: block; height: 100%; width: 0; background: var(--hi); }
.timer-total { margin-top: .6rem; font-family: var(--font-label); font-size: .875rem; color: var(--rail-text); }

.phase { padding: 0; }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq-tools { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-top: 2.5rem; padding: 1rem 1.25rem .25rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 4px; }
.faq-tools .field { margin-bottom: .75rem; }
.faq-buttons { display: flex; gap: .6rem; margin-bottom: .75rem; }
.faq-count { margin: .75rem 0 0; font-family: var(--font-label); font-size: .8125rem; color: var(--ink-2); }
.faq-layout { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 2.5rem; margin-top: 2rem; align-items: start; }
.faq-index { position: sticky; top: 1.5rem; }
.faq-index ol { list-style: none; margin-top: .5rem; border-top: 3px double var(--ink); }
.faq-index li { border-bottom: 1px dashed var(--ink-soft); }
.faq-index a { display: block; padding: .6rem .25rem; min-height: 2.75rem; color: var(--ink); text-decoration: none; font-family: var(--font-label); font-weight: 700; font-size: .875rem; }
.faq-index a:hover { background: var(--hi); }
.foot-label { font-family: var(--font-label); font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.faq-group { margin-bottom: 3rem; }
.faq-group > h2 { margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 4px double var(--ink); }
.faq-item { border-bottom: 1px dashed var(--ink-soft); }
.faq-item summary {
  position: relative; display: flex; align-items: center; min-height: 3.5rem; padding: .75rem 3rem .75rem .25rem; cursor: pointer; list-style: none;
  font-family: var(--font-head); font-weight: 700; font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); line-height: 1.35;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: .35rem; top: 50%; margin-top: -1.1rem; width: 2.2rem; height: 2.2rem; display: grid; place-items: center;
  font-family: var(--font-label); font-size: 1.4rem; font-weight: 700; line-height: 1; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper);
}
.faq-item[open] summary::after { content: "\2212"; background: var(--ink); color: var(--paper); }
.faq-item summary:hover { background: rgba(242,215,105,.35); }
.faq-item summary:focus-visible { outline-offset: -3px; }
.faq-a { padding: 0 3rem 1.25rem .25rem; max-width: 44rem; }
.faq-empty { padding: 1.25rem; background: var(--paper); border: 2px dashed var(--ink); font-weight: 700; }
.glossary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3rem; border-top: 4px double var(--ink); }
.glossary > div { padding: 1rem 0; border-bottom: 1px dashed var(--ink-soft); }
.glossary dt { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.glossary dd { margin: .15rem 0 0; }

/* ==========================================================================
   Contact
   ========================================================================== */
.never { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.75rem; }
.never li { padding: .3rem .9rem; border: 3px solid var(--vermilion); border-radius: 4px; color: var(--verm-deep); background: var(--page); font-family: var(--font-label); font-size: .875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; transform: rotate(-1.5deg); }
.never li:nth-child(even) { transform: rotate(1.2deg); }
.never li::before { content: "\2715\00a0"; }
.letter { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 2rem; align-items: start; }
.mail-form { padding: 1.5rem 1.5rem .75rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 4px; box-shadow: 5px 5px 0 rgba(27,42,65,.22); position: relative; }
.mail-form::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 10px; background: repeating-linear-gradient(135deg, var(--vermilion) 0 14px, var(--paper) 14px 22px, var(--ink) 22px 36px, var(--paper) 36px 44px); border-radius: 4px 4px 0 0; }
.mail-form { padding-top: 2.25rem; }
.letter-preview { padding: 1.25rem 1.5rem 1.5rem; background: var(--white); border: 2px solid var(--ink); border-radius: 3px; transform: rotate(.5deg); box-shadow: 0 14px 24px -14px rgba(27,42,65,.45); min-width: 0; }
.letter-preview h3 { margin-bottom: .75rem; font-family: var(--font-label); font-size: .875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--verm-deep); }
.preview-meta { display: grid; gap: .25rem; margin: 0 0 1rem; padding-bottom: .75rem; border-bottom: 3px double var(--ink); }
.preview-meta div { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: .5rem; }
.preview-meta dt { font-family: var(--font-label); font-size: .8125rem; font-weight: 700; color: var(--ink-2); }
.preview-meta dd { margin: 0; overflow-wrap: anywhere; }
.preview-body { margin: 0; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; font-family: var(--font-label); font-size: .9375rem; line-height: 1.55; max-height: 22rem; overflow: auto; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-foot { width: 100%; max-width: 76rem; margin: 3rem auto 0; padding: 2rem var(--pad) 2.5rem var(--gutter); border-top: 4px double var(--ink); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.5rem 2.5rem; }
.foot-name { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; }
.foot-line { font-size: .975rem; line-height: 1.5; margin-top: .25rem; max-width: 22rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin-top: .4rem; }
.foot-links a, .foot-contact a { display: inline-flex; align-items: center; min-height: 2.5rem; font-family: var(--font-label); font-weight: 700; font-size: .875rem; }
.foot-contact p:last-child { margin-top: .4rem; overflow-wrap: anywhere; }
.foot-honest { margin-top: 1.75rem; padding: .7rem 1rem; background: var(--hi); color: var(--ink); font-weight: 700; border: 2px solid var(--ink); border-radius: 4px; line-height: 1.5; }
.foot-indep { margin-top: .9rem; font-size: .9375rem; line-height: 1.55; color: var(--ink-2); max-width: 52rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-height: 640px) and (min-width: 760px) {
  .brand-text, .rail-note { display: none; }
  .tab { min-height: 3.1rem; padding-top: .35rem; padding-bottom: .35rem; }
}

@media (min-width: 1000px) and (min-height: 780px) {
  .script-pane { position: sticky; top: 1rem; }
}

@media (max-width: 1099px) {
  .ledger-grid { grid-template-columns: minmax(0, 1fr); }
  .lrow { grid-template-columns: 3rem minmax(0, 1fr) auto; }
  .lrow-meta { display: none; }
  .tallies { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tally:nth-child(4n) { border-right: 1px dashed var(--ink-soft); }
  .tally:nth-child(2n) { border-right: 0; }
  .tally--wide { grid-column: 1 / -1; border-right: 0; }
  .three-col { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 999px) {
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .mini-meter {
    display: flex; align-items: center; gap: .75rem; position: sticky; top: 3.4rem; z-index: 20; margin: 0 0 1rem; padding: .55rem .8rem;
    background: var(--ink); color: var(--paper); border-radius: 4px; font-family: var(--font-label); font-size: .8125rem; font-weight: 700; box-shadow: 0 6px 14px -8px rgba(15,26,43,.6);
  }
  .mm-bar { flex: 1; min-width: 3rem; height: .6rem; border: 1.5px solid var(--paper); border-radius: 999px; overflow: hidden; }
  .mm-bar i { display: block; height: 100%; width: 0; background: var(--hi); transition: width .3s ease; }
  .mini-meter.is-over .mm-bar i { background: #FFB8AA; }
  .rhythm { grid-template-columns: minmax(0, 1fr); }
  .cycle-fig { position: static; }
  .faq-layout { grid-template-columns: minmax(0, 1fr); }
  .faq-index { position: static; }
  .faq-index ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; }
  .letter { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 899px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-art { max-width: 34rem; }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .principles { grid-template-columns: minmax(0, 1fr); }
  .glossary { grid-template-columns: minmax(0, 1fr); }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }

  /* ledger table becomes stacked cards */
  .ledger-table, .ledger-table tbody { display: block; }
  .ledger-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ledger-table tr { display: block; padding: .75rem .9rem; border-bottom: 3px double var(--ink); }
  .ledger-table tbody td { display: block; padding: .55rem 0; border: 0; width: auto !important; }
  .ledger-table tbody td::before { content: attr(data-label); font-family: var(--font-label); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); display: block; margin-bottom: .3rem; }
  .row-actions { flex-direction: row; }
  .row-actions .btn { flex: 1; }
  .stamp-key > div { grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1rem; }
}

@media (max-width: 759px) {
  :root { --gutter: 2.75rem; --pad: 1rem; }
  body { background-color: var(--page); }
  .site-head {
    position: sticky; top: 0; bottom: auto; left: auto; width: auto; z-index: 100; display: block;
    box-shadow: 0 3px 0 var(--vermilion), 0 10px 20px -10px rgba(15,26,43,.55);
    background: var(--ink);
  }
  .site-head::after { display: none; }
  .bar { display: flex; align-items: center; justify-content: space-between; min-height: 3.25rem; padding: .25rem .75rem .25rem 1rem; }
  .brand { flex-direction: row; align-items: center; padding: 0; gap: .65rem; min-height: 2.75rem; }
  .brand-mark { width: 2rem; height: 2rem; }
  .brand-text { flex-direction: row; gap: .35em; font-size: .8125rem; letter-spacing: .06em; }
  .menu-btn {
    display: inline-flex; align-items: center; gap: .6rem; min-height: 2.75rem; padding: .25rem .9rem; cursor: pointer;
    font-family: var(--font-label); font-weight: 700; font-size: .875rem; letter-spacing: .08em; text-transform: uppercase;
    background: transparent; color: var(--paper); border: 2px solid rgba(243,236,220,.7); border-radius: 4px;
  }
  .menu-btn:hover { background: rgba(243,236,220,.14); }
  .menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 1.15rem; height: 2px; background: var(--paper); position: relative; transition: transform .25s ease, background-color .25s ease; }
  .menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
  .menu-icon::before { top: -6px; }
  .menu-icon::after { top: 6px; }
  .menu-open .menu-icon { background: transparent; }
  .menu-open .menu-icon::before { transform: translateY(6px) rotate(45deg); }
  .menu-open .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }
  .rail-note { display: none; }

  .site-nav { margin: 0; background: var(--rail-ink); border-top: 1px solid rgba(243,236,220,.25); }
  .js .site-nav { max-height: 0; overflow: hidden; visibility: hidden; border-top-width: 0; transition: max-height .35s ease, visibility 0s linear .35s; }
  .js .menu-open .site-nav { max-height: 26rem; visibility: visible; border-top-width: 1px; transition: max-height .35s ease, visibility 0s; }
  .tabs { flex-direction: column; gap: 0; padding: .25rem 0 .5rem; }
  .tab { flex-direction: row; align-items: center; gap: 1rem; min-height: 3.25rem; margin: 0; padding: .4rem 1.25rem; border-radius: 0; border-bottom: 1px solid rgba(243,236,220,.14); }
  .tab .folio { font-size: 1.1rem; min-width: 2rem; }
  .tab .tab-name { font-size: .9375rem; color: var(--paper); }
  .tab:hover { transform: none; }
  .tab[aria-current="page"] { margin: 0; padding-right: 1.25rem; box-shadow: none; }
  .tab[aria-current="page"] .tab-name { color: var(--ink); font-weight: 700; }

  .page { margin-left: 0; padding: 0; }
  .sheet { border-radius: 0; box-shadow: none; max-width: none; }
  .folio-head { border-radius: 0; margin-bottom: 1.75rem; font-size: .75rem; letter-spacing: .1em; }
  .site-foot { padding-left: 1rem; }
  .entry { margin-top: 3.25rem; }
  .entry > h2::before { margin-right: 1.05rem; }
  .lrow { grid-template-columns: 2.75rem minmax(0, 1fr); }
  .lrow .btn { grid-column: 2; justify-self: start; }
  .lrow-no { font-size: 1.5rem; }
  .pane-top { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .stats { width: 100%; }
  .entry-form { grid-template-columns: minmax(0, 1fr); padding: 1rem 1rem .25rem; }
  .toolbar .field { flex: 1 1 8rem; }
  .stamp-key > div { grid-template-columns: minmax(0, 1fr); gap: .35rem; }
  .agenda-item { grid-template-columns: 3.6rem minmax(0, 1fr); gap: .75rem; }
  .week li { grid-template-columns: 3.5rem minmax(0, 1fr); gap: .75rem; }
  .faq-index ol { grid-template-columns: minmax(0, 1fr); }
  .faq-a { padding-right: .25rem; }
  .faq-tools { padding: 1rem 1rem .25rem; }
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .compare, .compare tbody, .compare tr { display: block; }
  .compare tr { padding: .5rem 0 1rem; border-bottom: 3px double var(--ink); }
  .compare tbody th { display: block; width: auto; border: 0; padding: .6rem 0 .2rem; }
  .compare tbody td { display: block; max-width: none; border: 0; padding: .35rem .75rem; margin-top: .35rem; }
  .compare tbody td::before { content: attr(data-label); display: block; font-family: var(--font-label); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
  .compare td:nth-child(2) { background: var(--paper); }
  .compare td:nth-child(3) { background: rgba(242,215,105,.4); }
  .hand { padding: 1rem; }
  .hand-list li { grid-template-columns: 1.5rem minmax(0, 1fr); }
  .hand-list li .btn { grid-column: 2; justify-self: start; }
  .timer-face { padding: 1rem; }
  .letter-preview { transform: none; }
  .deck-buttons .btn { flex: 1 1 8rem; }
}

@media (max-width: 420px) {
  .tallies { grid-template-columns: minmax(0, 1fr); }
  .tally { border-right: 0 !important; }
  .pace-row { grid-template-columns: minmax(0, 1fr) 5.5rem; }
  .btn-row .btn { flex: 1 1 auto; }
}

@media (min-width: 1600px) {
  body { font-size: 1.0625rem; }
}

/* ==========================================================================
   Print
   ========================================================================== */
@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; color: #000; }
  body { font-size: 11.5pt; line-height: 1.5; overflow: visible; }
  .site-head, .skip, .site-foot, .toast-wrap, .folio-head, .btn, .no-print, .mini-meter, .sheet::before { display: none !important; }
  .page { margin: 0; padding: 0; display: block; min-height: 0; }
  .sheet { max-width: none; box-shadow: none; padding: 0; background: #fff; border-radius: 0; }
  a { color: #000; text-decoration: none; }

  body[data-page="pitch"] .sheet > :not(.workbench) { display: none !important; }
  body[data-page="pitch"] .pitch-form, body[data-page="pitch"] .pane-top, body[data-page="pitch"] .ring-status,
  body[data-page="pitch"] .rehearse, body[data-page="pitch"] .copy-status, body[data-page="pitch"] .pane-h { display: none !important; }
  body[data-page="pitch"] .workbench { display: block; margin: 0; }
  body[data-page="pitch"] .script-pane { border: 0; box-shadow: none; padding: 0; background: #fff; }
  body[data-page="pitch"] .script-pane::before { content: "My 60-second pitch"; display: block; font-family: var(--font-head); font-weight: 700; font-size: 20pt; margin-bottom: 10pt; }
  body[data-page="pitch"] .script-sheet { border: 0; background: #fff; font-size: 14pt; line-height: 1.7; padding: 0; }
  body[data-page="pitch"] .script-sheet .beat-tag { display: none; }

  body[data-page="ledger"] .sheet > :not(.footing):not(.book) { display: none !important; }
  body[data-page="ledger"] .book .toolbar, body[data-page="ledger"] .book-actions, body[data-page="ledger"] .save-status,
  body[data-page="ledger"] .status-select, body[data-page="ledger"] .row-actions, body[data-page="ledger"] .c-actions { display: none !important; }
  body[data-page="ledger"] .footing, body[data-page="ledger"] .ledger-table { box-shadow: none; }
  body[data-page="ledger"] .stamp { filter: none; }
  body[data-page="ledger"] tr { break-inside: avoid; }

  body[data-page="one-to-ones"] .sheet > :not(.entry), body[data-page="one-to-ones"] .page-intro { display: none !important; }
  body[data-page="one-to-ones"] .deck-controls, body[data-page="one-to-ones"] .deck-area, body[data-page="one-to-ones"] .entry-intro,
  body[data-page="one-to-ones"] .timer, body[data-page="one-to-ones"] .agenda-bar, body[data-page="one-to-ones"] .hand-list .btn { display: none !important; }
  body[data-page="one-to-ones"] .hand { border: 1px solid #000; background: #fff; }
  body[data-page="one-to-ones"] .entry { margin-top: 14pt; }
  body[data-page="one-to-ones"] .entry > h2::before { display: none; }

  body[data-page="home"] .sheet, body[data-page="faq"] .sheet, body[data-page="contact"] .sheet { padding: 0; }
  .faq-item:not([open]) .faq-a { display: block; }
}

/* ==========================================================================
   Reduced motion: every animation and transition is neutralised and the
   final, static state is shown.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    animation-delay: 0s !important;
    transition: none !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .tab:hover, .btn:hover, .btn:active { transform: none; }
  .tw-cursor { display: none; }
  .hero-pending .hero-stamp { opacity: 1; }
  .hl { background-size: 100% 100%; }
  .card-inner, .card.is-flipped .card-inner { transform: none !important; }
  .face-back { display: none; transform: none; }
  .card.is-flipped .face-front { display: none; }
  .card.is-flipped .face-back { display: flex; }
  .stamp::after { opacity: 0; }
}
