/* Members app. Apple-grade: grouped lists, large titles, glass bar, rounded surfaces, hairlines. */
body { background: var(--bg-alt); }
.shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; grid-template-columns: 1fr; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--s2); padding: 0 var(--gutter); background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); min-height: 3.25rem; }
.brand { font-weight: 600; font-size: 1.0625rem; color: var(--text); letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.spacer { flex: 1; }
.icon-btn { width: var(--tap); height: var(--tap); display: inline-grid; place-items: center; background: transparent; border: 0; color: var(--text-muted); border-radius: 50%; cursor: pointer; transition: background var(--t-fast) var(--ease), color var(--t-fast); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.menu-btn { margin-left: calc(var(--s2) * -1); }

.side { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(20rem, 86vw); transform: translateX(-102%); transition: transform var(--t-med) var(--ease); background: var(--bg); padding: var(--s4) var(--s3); overflow-y: auto; box-shadow: var(--shadow-lg); }
.side.open { transform: none; }
.scrim { position: fixed; inset: 0; background: oklch(0.1 0.003 260 / .4); z-index: 35; }
.side h2 { font-size: .75rem; font-weight: 600; letter-spacing: 0; color: var(--text-muted); margin: var(--s5) var(--s3) var(--s1); line-height: 1.2; }
.side a.nav { display: grid; grid-template-columns: 1.9rem 1fr auto; align-items: center; gap: var(--s1); min-height: 2.5rem; padding: 0 var(--s3); color: var(--text); border-radius: var(--r2); font-size: .9375rem; transition: background var(--t-fast) var(--ease); }
.side a.nav:hover { background: var(--surface-2); text-decoration: none; }
.side a.nav .n { font-size: .8125rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.side a.nav[aria-current="page"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.side a.nav[aria-current="page"] .n { color: var(--accent-ink); opacity: .8; }
.side a.nav .done { color: var(--good); font-weight: 700; }
.side a.nav.soon { color: var(--text-muted); }
.side .whoami { margin: var(--s5) var(--s3) 0; padding-top: var(--s4); border-top: 1px solid var(--line); font-size: .8125rem; color: var(--text-muted); overflow-wrap: anywhere; }

#view { padding: var(--s6) var(--gutter) var(--s9); max-width: 58rem; width: 100%; margin-inline: auto; outline: none; }
.loading { color: var(--text-muted); }
@media (min-width: 64rem) {
  .shell { grid-template-columns: 17.5rem 1fr; }
  .top { grid-column: 1 / -1; }
  .menu-btn { display: none; }
  .side { position: sticky; top: 3.25rem; height: calc(100vh - 3.25rem); transform: none; grid-row: 2; box-shadow: none; width: auto; border-right: 1px solid var(--line); }
  .scrim { display: none; }
  #view { grid-row: 2; padding-top: var(--s7); }
}

/* large titles, like iOS */
.large-title { font-size: clamp(2.1rem, 1.7rem + 1.8vw, 2.9rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; margin: 0 0 var(--s2); }
.title-sub { color: var(--text-muted); max-width: var(--measure); margin-bottom: var(--s5); }

/* home */
.meter { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: var(--s4) 0 var(--s2); max-width: 22rem; }
.meter > span { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 999px; transform-origin: 0 50%; transition: transform var(--t-med) var(--ease); }
.facts-line { font-size: .875rem; color: var(--text-muted); margin: var(--s4) 0 var(--s6); }
.group-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; margin: var(--s7) 0 var(--s3); line-height: 1.15; }
.index { list-style: none; margin: 0 0 var(--s5); padding: 0; background: var(--surface); border-radius: var(--r3); overflow: hidden; box-shadow: 0 1px 0 var(--line); }
.index li + li a { box-shadow: inset 0 1px 0 var(--line); }
.index a { display: grid; grid-template-columns: 2.6rem 1fr auto auto; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); color: var(--text); min-height: 3.5rem; transition: background var(--t-fast) var(--ease); }
.index a:hover { background: var(--surface-2); text-decoration: none; }
.index a::after { content: "›"; color: var(--text-muted); font-size: 1.4rem; line-height: 1; opacity: .6; }
.index .no { font-weight: 600; font-size: .9375rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.index b { font-weight: 600; display: block; line-height: 1.25; }
.index small { display: block; color: var(--text-muted); font-size: .875rem; line-height: 1.35; margin-top: 1px; }
.index .meta { display: flex; gap: var(--s2); align-items: center; white-space: nowrap; }
.index .soon b { color: var(--text-muted); font-weight: 500; }
@media (max-width: 40rem) { .index .meta .chip:not(.warn):not(.ok) { display: none; } }

/* lessons: a reading sheet */
.lesson { max-width: var(--measure); background: var(--surface); border-radius: var(--r4); padding: clamp(1.5rem, 1rem + 3vw, 3.5rem); box-shadow: var(--shadow); }
.lesson h1 { font-size: clamp(2rem, 1.6rem + 1.8vw, 2.9rem); letter-spacing: -0.035em; line-height: 1.06; margin-top: var(--s2); }
.lesson h2 { font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem); margin-top: var(--s7); max-width: none; letter-spacing: -0.026em; }
.lesson h3 { font-size: 1.25rem; margin-top: var(--s6); letter-spacing: -0.018em; }
.lesson li { margin-bottom: var(--s2); }
.lesson li::marker { color: var(--accent); }
.lesson input[type=checkbox] { width: 1.1rem; min-height: 0; accent-color: var(--accent); margin-right: .4rem; }
.lesson hr { border: 0; border-top: 1px solid var(--line); margin: var(--s6) 0; }
.lesson table { min-width: 32rem; }
.lesson blockquote { margin: var(--s5) 0; padding: var(--s3) var(--s5); background: var(--bg-alt); border-radius: var(--r3); font-weight: 500; }
.lesson blockquote p { margin: 0; }
.sheetmeta { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.lesson-actions { display: flex; gap: var(--s3); flex-wrap: wrap; margin: var(--s7) 0 var(--s5); }
.pager { display: grid; gap: var(--s3); grid-template-columns: 1fr 1fr; margin: var(--s5) 0; max-width: var(--measure); }
.pager a { display: block; padding: var(--s4); background: var(--surface); border-radius: var(--r3); color: var(--text); min-height: var(--tap); box-shadow: 0 1px 0 var(--line); transition: background var(--t-fast); }
.pager a:hover { background: var(--surface-2); text-decoration: none; }
.pager a small { display: block; color: var(--text-muted); font-size: .8125rem; }
.pager a b { font-weight: 600; }
.pager a.next { text-align: right; }
.titleblock { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: .8125rem; color: var(--text-muted); }
.report { font-size: .8125rem; color: var(--text-muted); margin-top: var(--s3); }

/* tools */
.tool { max-width: 52rem; }
.tool .cols { display: grid; gap: var(--s4); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 48rem) { .tool .cols { grid-template-columns: 1fr 1fr; } }
.panel { background: var(--surface); border-radius: var(--r3); padding: var(--s5); box-shadow: 0 1px 0 var(--line); }
.field { margin-bottom: var(--s4); }
.out { background: var(--surface); border-radius: var(--r3); padding: var(--s5); box-shadow: var(--shadow); }
.out .big { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.4rem, 2rem + 1.6vw, 3.4rem); line-height: 1; letter-spacing: -0.04em; margin: var(--s2) 0; font-variant-numeric: tabular-nums; }
.out dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: var(--s2) var(--s4); font-size: .9375rem; }
.out dt { color: var(--text-muted); } .out dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.out .math { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: .8125rem; color: var(--text-muted); line-height: 1.6; font-variant-numeric: tabular-nums; }
.verdict { display: inline-flex; padding: .25em .85em; border-radius: 999px; font-weight: 600; font-size: .875rem; }
.verdict.ok { color: var(--good); background: color-mix(in oklch, var(--good) 14%, transparent); }
.verdict.warn { color: var(--caution); background: color-mix(in oklch, var(--caution) 16%, transparent); }
.verdict.stop { color: var(--danger); background: color-mix(in oklch, var(--danger) 13%, transparent); }
.pre { white-space: pre-wrap; font-size: .9375rem; font-variant-numeric: tabular-nums; background: var(--bg-alt); border-radius: var(--r2); padding: var(--s4); }
.truckprev { background: var(--bg-alt); border-radius: var(--r2); padding: var(--s4); overflow: hidden; }

/* vault */
.vault-doc { position: relative; background: var(--surface); border-radius: var(--r4); padding: var(--s6) var(--s5); overflow: hidden; box-shadow: var(--shadow); }
.vault-doc .wm { position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: .09; }
.vault-doc .content { position: relative; z-index: 1; max-width: 46rem; background: transparent; box-shadow: none; padding: 0; }
.vault-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s4); }
.toast { position: fixed; bottom: var(--s5); left: 50%; transform: translateX(-50%); background: oklch(0.2 0.004 260 / .94); color: oklch(0.97 0.002 260); padding: var(--s3) var(--s5); border-radius: 999px; z-index: 90; font-weight: 500; font-size: .9375rem; box-shadow: var(--shadow-lg); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }

/* fine print and sources */
.fine-list { list-style: none; margin: var(--s5) 0 0; padding: 0; background: var(--surface); border-radius: var(--r3); max-width: 50rem; overflow: hidden; }
.fine-list li { padding: var(--s5); }
.fine-list li + li { box-shadow: inset 0 1px 0 var(--line); }
.fine-list h3 { font-size: 1.2rem; margin-bottom: var(--s2); letter-spacing: -0.02em; }
.fine-list p { margin-bottom: var(--s2); max-width: 60ch; }
.fine-list .cite { font-size: .8125rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.filters { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface-2); border-radius: 999px; margin-bottom: var(--s5); }
.filters button { min-height: 2.25rem; padding: 0 var(--s4); border-radius: 999px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: .9375rem; font-weight: 500; cursor: pointer; transition: background var(--t-fast); }
.filters button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px oklch(0.2 0 0 / .18); font-weight: 600; }
#view .tablewrap table { background: var(--surface); border-radius: var(--r3); overflow: hidden; }

/* search (inline page) */
.searchbar { max-width: 40rem; }
.searchbar input { min-height: 3.25rem; border-radius: 14px; font-size: 1.0625rem; padding-left: var(--s5); background: var(--surface); border-color: transparent; box-shadow: 0 1px 0 var(--line); }
.results { list-style: none; margin: var(--s4) 0 0; padding: 0; max-width: 40rem; background: var(--surface); border-radius: var(--r3); overflow: hidden; }
.results li + li a { box-shadow: inset 0 1px 0 var(--line); }
.results a { display: block; padding: var(--s3) var(--s4); color: var(--text); }
.results a:hover { background: var(--surface-2); text-decoration: none; }
.results small { display: block; color: var(--text-muted); }

@media print {
  .top, .side, .scrim, .vault-actions, .lesson-actions, .pager, .report, .titleblock, .toast { display: none !important; }
  .shell { display: block; } #view { max-width: none; padding: 0; }
  body { background: white; color: black; }
  .vault-doc { box-shadow: none; padding: 0; }
  .vault-doc .wm { opacity: .12; }
}

/* guided structure */
.navgroup { margin: 0 0 var(--s1); }
.navgroup > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r2); font-size: .875rem; font-weight: 600; line-height: 1.3; min-height: 2.5rem; align-items: center; }
.navgroup > summary::-webkit-details-marker { display: none; }
.navgroup > summary::before { content: "›"; color: var(--text-muted); font-size: 1.1rem; transition: transform var(--t-fast, .15s) ease; }
.navgroup[open] > summary::before { transform: rotate(90deg); }
.navgroup > summary:hover { background: var(--surface-2); }
.navgroup .pn, .group-title .pn { color: var(--accent); font-weight: 600; }
.navgroup .pc { margin-left: auto; color: var(--text-muted); font-weight: 500; font-size: .8125rem; font-variant-numeric: tabular-nums; }
.navgroup a.nav { margin-left: var(--s3); }
.picks { display: grid; gap: var(--s3); grid-template-columns: 1fr; margin-bottom: var(--s5); }
@media (min-width: 40rem) { .picks { grid-template-columns: 1fr 1fr; } }
.pick { display: block; padding: var(--s4) var(--s5); background: var(--surface); border-radius: var(--r3); color: var(--text); box-shadow: 0 1px 0 var(--line); min-height: 4.5rem; }
.pick:hover { background: var(--surface-2); text-decoration: none; }
.pick b { display: block; font-weight: 600; }
.pick span { color: var(--text-muted); font-size: .9375rem; }
.box { margin-bottom: var(--s3); }
.box > summary { cursor: pointer; padding: var(--s3) var(--s4); background: var(--surface); border-radius: var(--r3); font-weight: 600; min-height: 3rem; display: flex; align-items: center; }
.box[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.box[open] .index { border-top-left-radius: 0; border-top-right-radius: 0; margin-bottom: var(--s3); }
.related { margin-top: var(--s7); padding: var(--s4) var(--s5); background: var(--surface); border-radius: var(--r3); }
.relatedlinks { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.relatedlinks a { padding: .45rem .9rem; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: .9375rem; }
.relatedlinks a:hover { text-decoration: none; background: var(--line); }
.navgroup .pn { white-space: nowrap; }

/* plain-language helpers */
button.gl { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: help; border-bottom: 1.5px dotted var(--text-muted); border-radius: 0; display: inline; min-height: 0; }
button.gl:hover { border-bottom-color: var(--accent); color: var(--accent); }
.plainbox { background: color-mix(in oklch, var(--accent) 8%, var(--surface)); border-radius: var(--r3); padding: var(--s4) var(--s5); margin: var(--s4) 0 var(--s5); }
.plainbox p { margin: .35rem 0 0; }
.plainbox .label { margin: 0; }
.welcome { background: var(--surface); border-radius: var(--r4, var(--r3)); padding: var(--s5); margin-bottom: var(--s5); box-shadow: 0 1px 0 var(--line); }
.welcome h2 { font-size: 1.35rem; letter-spacing: -0.02em; margin: .25rem 0 var(--s3); }
.welcome ol { margin: 0 0 var(--s3); padding-left: 1.25rem; }
.welcome li { margin: .25rem 0; }
.promptbox { position: relative; margin: var(--s3) 0 var(--s5); }
.promptbox pre { background: var(--surface-2); border-radius: var(--r3); padding: var(--s4) var(--s5); padding-right: 6.5rem; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font); font-size: .9375rem; line-height: 1.55; }
.promptbox pre code { font-family: inherit; white-space: pre-wrap; background: none; padding: 0; }
.copyprompt { position: absolute; top: var(--s3); right: var(--s3); padding: .4rem .9rem; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; min-height: 2.25rem; }
.copyprompt:hover { filter: brightness(1.08); }
.gloss { margin: var(--s4) 0 0; }
.gloss .gi { padding: var(--s3) 0; box-shadow: inset 0 -1px 0 var(--line); }
.gloss dt { font-weight: 700; }
.gloss dd { margin: .2rem 0 0; color: var(--text-muted); }
.steps-help { list-style: none; margin: var(--s4) 0; padding: 0; display: grid; gap: var(--s3); }
.steps-help li { display: grid; grid-template-columns: 2.5rem 1fr; gap: var(--s3); background: var(--surface); border-radius: var(--r3); padding: var(--s4); }
.steps-help p { margin: .2rem 0 0; color: var(--text-muted); }
.stepn { width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; }
.faq-help p { margin: 0 0 var(--s4); }
@media print { .copyprompt { display: none !important; } }

/* guided calculators */
.wiz { max-width: 36rem; background: var(--surface); border-radius: var(--r4, var(--r3)); padding: var(--s6) var(--s5); box-shadow: 0 1px 0 var(--line); }
.wiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s2); }
.wiz-q { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.9rem); letter-spacing: -0.025em; line-height: 1.2; margin: var(--s4) 0 var(--s2); font-weight: 700; }
.wiz-help { color: var(--text-muted); margin: 0 0 var(--s4); max-width: 34rem; }
.wiz-input { display: flex; align-items: center; gap: var(--s2); background: var(--bg); border: 2px solid var(--line); border-radius: var(--r3); padding: 0 var(--s4); min-height: 3.75rem; margin: var(--s4) 0; }
.wiz-input:focus-within { border-color: var(--accent); }
.wiz-input input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); outline: none; padding: var(--s3) 0; }
.wiz-input .wpre, .wiz-input .wsuf { color: var(--text-muted); font-size: 1.25rem; font-weight: 600; }
.wiz-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s4) 0 var(--s3); }
.wiz-alt { color: var(--text-muted); font-size: .9375rem; margin: var(--s3) 0 0; }
.wiz-more { margin: var(--s3) 0; }
.wiz-more summary { cursor: pointer; color: var(--accent); font-weight: 600; min-height: 2.5rem; display: flex; align-items: center; }
.wiz-more p, .wiz-more .math { color: var(--text-muted); margin: var(--s2) 0 0; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 2.25rem; }
.wiz-headline { font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2.1rem); letter-spacing: -0.03em; line-height: 1.2; margin: var(--s3) 0 var(--s3); font-weight: 700; }
.wiz-facts { margin: var(--s4) 0; display: grid; grid-template-columns: 1fr auto; gap: var(--s2) var(--s4); font-size: .9375rem; }
.wiz-facts dt { color: var(--text-muted); } .wiz-facts dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.wiz-h3 { font-size: 1.1rem; margin: var(--s5) 0 var(--s2); }
.wiz-next { margin: 0 0 var(--s3); padding-left: 1.25rem; } .wiz-next li { margin: .4rem 0; }
.wiz-review .field { margin-bottom: var(--s5); } .wiz-review label { font-weight: 600; display: block; margin-bottom: var(--s1); }
.wiz-review .wiz-input { margin: var(--s2) 0; min-height: 3.25rem; } .wiz-review .wiz-input input { font-size: 1.25rem; }
@media (max-width: 40rem) { .wiz { padding: var(--s5) var(--s4); border-radius: var(--r3); } }
