/* Does It Civ?: a study bench for the Federal Rules.
   Layout: topic rail on the left; on analyzer pages, facts on the left and the live ruling on the right. */
:root {
  /* Law-library palette: bound-reporter spine green, gilt stamping, buckram red, and highlighter marks. */
  --paper: #f1f2ee;      /* cool library paper */
  --sheet: #ffffff;
  --sheet-2: #f7f7f3;
  --ink: #1d1b18;
  --ink-soft: #5c5750;
  --line: #d8d6cd;
  --spine: #1e3d30;      /* reporter-spine green */
  --spine-ink: #efe6cc;
  --gilt: #c4a253;
  --seal: #7b2230;       /* buckram red: links, primary actions */
  --seal-soft: #f5e7e7;
  --pass: #1d5e36; --pass-bg: #e3f1e2; --hl-pass: #b7eba0;
  --fail: #9b1d2c; --fail-bg: #f8e3e4; --hl-fail: #ffb5c6;
  --warn: #6f5200; --warn-bg: #fbf1cf; --hl-warn: #ffe76a;
  --info: #5c5750; --info-bg: #ecebe5;
  --focus: #7b2230;
  --shadow: 0 1px 2px rgba(29, 27, 24, .06), 0 6px 18px rgba(29, 27, 24, .05);
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --serif: 'Libre Caslon Text', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --display: 'Libre Caslon Display', 'Libre Caslon Text', Georgia, serif;
  --step--1: .8125rem; --step-0: 1rem; --step-1: 1.1875rem; --step-2: 1.4375rem; --step-3: 2.125rem; --step-4: 3rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121a16; --sheet: #18221d; --sheet-2: #1d2823; --ink: #ece7da; --ink-soft: #aaa496; --line: #2e3b34;
    --spine: #0c1511; --spine-ink: #eadfbf; --gilt: #d2b062;
    --seal: #e6a0a8; --seal-soft: #33201f;
    --pass: #8fd9a4; --pass-bg: #18291e; --hl-pass: rgba(120, 220, 110, .32);
    --fail: #f3a0ac; --fail-bg: #331b1f; --hl-fail: rgba(255, 110, 150, .32);
    --warn: #ecc95e; --warn-bg: #2f2814; --hl-warn: rgba(255, 220, 60, .30);
    --info: #aaa496; --info-bg: #222c27; --focus: #e6a0a8; --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121a16; --sheet: #18221d; --sheet-2: #1d2823; --ink: #ece7da; --ink-soft: #aaa496; --line: #2e3b34;
  --spine: #0c1511; --spine-ink: #eadfbf; --gilt: #d2b062;
  --seal: #e6a0a8; --seal-soft: #33201f;
  --pass: #8fd9a4; --pass-bg: #18291e; --hl-pass: rgba(120, 220, 110, .32);
  --fail: #f3a0ac; --fail-bg: #331b1f; --hl-fail: rgba(255, 110, 150, .32);
  --warn: #ecc95e; --warn-bg: #2f2814; --hl-warn: rgba(255, 220, 60, .30);
  --info: #aaa496; --info-bg: #222c27; --focus: #e6a0a8; --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--step-0)/1.55 var(--sans); }
a { color: var(--seal); text-underline-offset: .18em; }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; line-height: 1.2; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--sheet); padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: 1rem; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- top bar & shell ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .7rem 16px; background: var(--spine); color: var(--spine-ink); border-bottom: 3px double var(--gilt); }
.brand { display: flex; align-items: baseline; gap: .9rem; text-decoration: none; color: var(--spine-ink); flex-wrap: wrap; }
.brand-q { font: 400 1.375rem/1 var(--display); color: var(--gilt); letter-spacing: .01em; }
.brand-sub { font: 400 italic var(--step--1) var(--serif); color: var(--spine-ink); opacity: .85; }
.menu { display: none; font: 600 var(--step--1) var(--sans); background: transparent; color: var(--spine-ink); border: 1px solid var(--gilt); border-radius: 6px; padding: .4rem .75rem; cursor: pointer; }
.shell { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: calc(100vh - 3rem); }
.nav { border-right: 1px solid var(--line); padding: 1.25rem 1rem 2rem; display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 3rem; align-self: start; max-height: calc(100vh - 3rem); overflow-y: auto; }
.nav-group { display: flex; flex-direction: column; gap: .125rem; }
.nav-stage { font: 400 italic var(--step--1) var(--serif); color: var(--ink-soft); margin: 0 0 .25rem .5rem; }
.nav a { color: var(--ink); text-decoration: none; padding: .35rem .5rem; border-radius: 5px; font-size: .9375rem; }
.nav a:hover { background: var(--sheet-2); }
.nav a.active { background: var(--seal-soft); color: var(--seal); font-weight: 600; box-shadow: inset 3px 0 0 var(--seal); border-radius: 0 5px 5px 0; }
.nav-foot { margin-top: auto; font-size: var(--step--1); color: var(--ink-soft); }
.theme select { margin-left: .25rem; }
main { min-width: 0; outline: none; }
.page { padding-block: 2rem 4rem; padding-inline: clamp(16px, 3vw, 2.5rem); max-width: 84rem; }

@media (max-width: 960px) {
  .menu { display: inline-block; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { position: fixed; inset: 3rem 0 0 0; top: calc(3rem + env(safe-area-inset-top, 0px)); background: var(--sheet); z-index: 15; transform: translateX(-100%); transition: transform .2s ease; max-height: none; border-right: 0; padding-inline: 16px; }
  body.nav-open .nav { transform: none; }
  .brand-sub { display: none; }
}

/* ---------- buttons & fields ---------- */
.btn, .btn-quiet, .btn-add { font: 600 .9375rem/1.2 var(--sans); border-radius: 6px; cursor: pointer; padding: .55rem .9rem; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.btn { background: var(--seal); color: var(--sheet); border: 1px solid var(--seal); }
.tool-tabs button.active { background: var(--spine); color: var(--spine-ink); border-color: var(--spine); }
.btn:hover { filter: brightness(1.08); }
.btn-quiet { background: transparent; color: var(--seal); border: 1px solid var(--line); }
.btn-quiet:hover { background: var(--sheet-2); }
.btn-add { background: transparent; color: var(--seal); border: 1px dashed var(--line); }
.btn-add:hover { border-color: var(--seal); }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field > label, fieldset > legend { font-weight: 600; font-size: .9rem; }
input[type=text], input[type=number], input[type=date], select {
  font: inherit; font-size: .9375rem; color: var(--ink); background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; padding: .45rem .55rem; width: 100%; min-width: 0;
}
input[type=number] { font-variant-numeric: tabular-nums; }
input:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
.hint { color: var(--ink-soft); font-size: var(--step--1); font-weight: 400; }
.check { display: flex; gap: .55rem; align-items: flex-start; }
.check input { margin-top: .3rem; width: 1rem; height: 1rem; accent-color: var(--seal); flex: none; }
.check label { display: flex; flex-direction: column; gap: .1rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.yesno legend, .radios legend { display: flex; flex-direction: column; gap: .15rem; margin-bottom: .4rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: .35rem .8rem; font-size: .875rem; cursor: pointer; border-right: 1px solid var(--line); background: var(--sheet); }
.seg label:last-child { border-right: 0; }
.seg input:checked + label { background: var(--seal); color: var(--sheet); }
.seg input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: -3px; }
.radio { display: flex; gap: .55rem; align-items: flex-start; padding: .2rem 0; }
.radio input { margin-top: .3rem; accent-color: var(--seal); flex: none; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .75rem 1rem; }

/* ---------- home ---------- */
.hero { display: grid; gap: 1.25rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.hero h1 { font: 400 clamp(3rem, 8vw, 5.75rem)/.95 var(--display); letter-spacing: -.01em; }
.lede { font: 400 var(--step-1)/1.5 var(--serif); max-width: 40rem; color: var(--ink-soft); }
.demo { background: var(--sheet); border: 1px solid var(--line); border-radius: 10px; padding: clamp(1rem, 3vw, 1.75rem); display: grid; gap: 1.25rem; box-shadow: var(--shadow); max-width: 60rem; }
.demo-sentence { font: 400 clamp(1.125rem, 2.2vw, 1.375rem)/2.1 var(--serif); }
.demo-sentence select, .demo-sentence .inline-num { width: auto; display: inline-block; font: 600 1rem var(--sans); padding: .2rem .4rem; margin: 0 .15rem; vertical-align: baseline; border-color: var(--seal); color: var(--seal); background: var(--seal-soft); }
.demo-sentence .inline-num { width: 7.5rem; }
.demo-out { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem 1.25rem; align-items: baseline; border-top: 1px solid var(--line); padding-top: 1rem; }
.demo-verdict { font: 400 var(--step-3)/1 var(--display); padding: .02em .2em .06em; border-radius: .12em .3em .18em .25em; }
.demo-why { font-size: .9375rem; }
.demo-out .btn { grid-column: 1 / -1; justify-self: start; }
.paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; padding-block: 2rem; }
.path { display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; padding: 1.25rem 0; border-top: 3px double var(--ink); }
.path h2 { font: 400 var(--step-2) var(--display); }
.path p { color: var(--ink-soft); flex: 1; }
.stages h2 { font: 400 var(--step-3) var(--display); margin-bottom: 1rem; }
.stage-list { list-style: none; counter-reset: stage; padding: 0; margin: 0; display: grid; gap: 1.25rem; }
.stage-list > li { counter-increment: stage; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 0 .75rem; }
.stage-list > li::before { content: counter(stage, upper-roman) '.'; font: 400 var(--step-2)/1 var(--display); color: var(--seal); grid-row: span 2; }
.stage-list h3 { font-size: var(--step-0); font-weight: 600; margin-bottom: .35rem; }
.stage-list ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.stage-list ul li { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; }
.stage-list ul a { font-weight: 600; }
.stage-list ul span { color: var(--ink-soft); font-size: .9375rem; }
.disclaimer { margin-top: 2.5rem; color: var(--ink-soft); font-size: var(--step--1); max-width: 44rem; }

/* ---------- topic pages ---------- */
.topic-head { display: grid; gap: .4rem; margin-bottom: 1.25rem; }
.authority { font: 400 italic .9375rem var(--serif); color: var(--ink-soft); }
.topic-head h1 { font: 400 clamp(2rem, 4vw, 2.75rem)/1.08 var(--display); }
.ask { font: 400 var(--step-1)/1.45 var(--serif); color: var(--ink-soft); max-width: 44rem; }
.tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--line); margin-top: .75rem; overflow-x: auto; }
.tabs a { padding: .55rem 0; text-decoration: none; color: var(--ink-soft); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--seal); }
.tool-tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.tool-tabs button { font: 600 .875rem var(--sans); background: var(--sheet); color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .85rem; cursor: pointer; }

.workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 1.75rem; align-items: start; }
.facts { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.ruling-col { position: sticky; top: 4rem; max-height: calc(100vh - 5rem); overflow-y: auto; min-width: 0; padding-bottom: 2rem; }
.col-title { font: 400 var(--step-2)/1.2 var(--display); color: var(--ink); }
.mobile-verdict { display: none; }
@media (max-width: 1100px) {
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .ruling-col { position: static; max-height: none; overflow: visible; }
  .mobile-verdict { display: block; position: fixed; left: 0; right: 0; bottom: 0; padding: .6rem 16px calc(.6rem + env(safe-area-inset-bottom, 0px)); background: var(--sheet); border-top: 1px solid var(--line); z-index: 10; }
  .mobile-verdict a { color: var(--ink); text-decoration: none; font-weight: 600; display: flex; gap: .5rem; align-items: center; }
  .page { padding-bottom: 6rem; }
}

.panel { background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .85rem; }
.panel > h3 { font: 400 var(--step-2) var(--display); }
.panel h4 { font-size: .9375rem; margin-top: .4rem; }
.builder { display: flex; flex-direction: column; gap: 1rem; }
.cards { display: flex; flex-direction: column; gap: .75rem; }
.card { border: 1px solid var(--line); border-radius: 6px; padding: .8rem .9rem; display: flex; flex-direction: column; gap: .7rem; background: var(--sheet-2); }
.card.member { background: var(--sheet); }
.card-head { display: flex; gap: .5rem; align-items: center; }
.card-head .name { font-weight: 600; }
.type-fields { display: flex; flex-direction: column; gap: .75rem; }
.sub { border-left: 2px solid var(--line); padding-left: .85rem; display: flex; flex-direction: column; gap: .7rem; }
.place { display: flex; flex-direction: column; gap: .35rem; }
.events { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.events li { display: flex; gap: .5rem; }
.empty { color: var(--ink-soft); font-style: italic; }
.note { background: var(--warn-bg); color: var(--ink); border-radius: 6px; padding: .7rem .9rem; font-size: .9375rem; }
.more-fields > summary { cursor: pointer; color: var(--seal); font-weight: 600; font-size: .9rem; }
.more-fields[open] { display: flex; flex-direction: column; gap: .7rem; }
.case-controls { display: flex; flex-direction: column; gap: .5rem; }
.case-title { display: flex; align-items: center; gap: .5rem; font-weight: 600; flex: 1 1 14rem; }
.checks { display: grid; gap: .35rem; }
.preset-note { font: 400 italic .9375rem/1.5 var(--serif); color: var(--ink-soft); border-left: 3px solid var(--seal); padding-left: .75rem; }
table.mini { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.mini th, table.mini td { text-align: left; padding: .35rem .3rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.mini input[type=date] { padding: .25rem .3rem; }

/* ---------- the ruling ---------- */
.ruling { background: var(--sheet); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.verdict { padding: 1.25rem 1.4rem 1.2rem; border-bottom: 1px solid var(--line); display: grid; gap: .3rem; }
.verdict-q { font-size: var(--step--1); color: var(--ink-soft); font-weight: 600; }
.verdict-a { font: 400 clamp(2.75rem, 5.5vw, 3.75rem)/1 var(--display); justify-self: start; padding: .02em .22em .06em; margin-left: -.18em; border-radius: .12em .3em .18em .25em; }
.verdict-h { font: 400 var(--step-1)/1.45 var(--serif); }
.v-yes .verdict-a, .demo-verdict.v-yes { color: var(--ink); background: linear-gradient(100deg, transparent .2em, var(--hl-pass) .3em, var(--hl-pass) calc(100% - .25em), transparent calc(100% - .1em)) 0 62% / 100% 70% no-repeat; }
.v-no .verdict-a, .demo-verdict.v-no { color: var(--ink); background: linear-gradient(100deg, transparent .2em, var(--hl-fail) .3em, var(--hl-fail) calc(100% - .25em), transparent calc(100% - .1em)) 0 62% / 100% 70% no-repeat; }
.v-depends .verdict-a, .demo-verdict.v-depends { color: var(--ink); background: linear-gradient(100deg, transparent .2em, var(--hl-warn) .3em, var(--hl-warn) calc(100% - .25em), transparent calc(100% - .1em)) 0 62% / 100% 70% no-repeat; }
.v-incomplete .verdict-a { color: var(--ink-soft); }
.verdict-q { font-style: italic; font-family: var(--serif); font-weight: 400; }

.rail { list-style: none; margin: 0; padding: 1rem 1.4rem 1.25rem; display: flex; flex-direction: column; }
.rail.nested { padding: .5rem 0 0; }
.step { position: relative; display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: .75rem; padding-bottom: 1rem; }
.step::before { content: ''; position: absolute; left: calc(.75rem - 1px); top: 1.6rem; bottom: .2rem; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.mark { width: 1.5rem; height: 1.5rem; border-radius: 3px 6px 4px 7px; display: grid; place-items: center; font: 700 .8125rem/1 var(--sans); }
.st-pass > .mark { background: var(--hl-pass); color: var(--ink); }
.st-fail > .mark { background: var(--hl-fail); color: var(--ink); }
.st-warn > .mark { background: var(--hl-warn); color: var(--ink); }
.st-info > .mark, .st-skip > .mark { background: var(--info-bg); color: var(--info); }
.step-body { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.step-body > h4 { font-size: .9688rem; font-weight: 600; line-height: 1.35; padding-top: .1rem; }
.st-skip > .step-body > h4 { color: var(--ink-soft); font-weight: 500; }
.apply { font-size: .9375rem; }
.st-skip > .step-body > .apply { color: var(--ink-soft); }
.why > summary { cursor: pointer; font-size: var(--step--1); color: var(--seal); font-weight: 600; }
.why[open] { display: flex; flex-direction: column; gap: .55rem; padding-bottom: .25rem; }
.rule { margin: 0; font: 400 .9688rem/1.6 var(--serif); border-left: 3px solid var(--line); padding: .1rem 0 .1rem .8rem; }
.flip { font-size: .9rem; background: var(--seal-soft); border-radius: 6px; padding: .5rem .7rem; }
.cites { display: flex; flex-wrap: wrap; gap: .35rem; }
.cite { font-size: var(--step--1); border-radius: 4px; }
.cite-law { background: var(--info-bg); padding: .2rem .45rem; font-variant-numeric: tabular-nums; }
.cite-case { background: var(--seal-soft); padding: .2rem .45rem; max-width: 100%; }
.cite-case > summary { cursor: pointer; }
.cite-case[open] { flex-basis: 100%; }
.cite-case p { font: 400 .875rem/1.5 var(--serif); margin-top: .35rem; }
.math > summary { cursor: pointer; font-size: var(--step--1); color: var(--ink-soft); }
.math ol, .free-out ol, .dl ol { margin: .35rem 0 0; padding-left: 1.2rem; font-size: var(--step--1); color: var(--ink-soft); display: grid; gap: .2rem; }
.badge { display: inline-block; font: 700 var(--step--1)/1 var(--sans); padding: .3rem .5rem; border-radius: 4px; min-width: 4.75rem; text-align: center; }
.badge.v-yes { background: var(--pass-bg); color: var(--pass); }
.badge.v-no { background: var(--fail-bg); color: var(--fail); }
.badge.v-depends { background: var(--warn-bg); color: var(--warn); }
.badge.v-incomplete { background: var(--info-bg); color: var(--info); }

/* ---------- workshop report ---------- */
.report { display: flex; flex-direction: column; gap: .6rem; margin-top: .75rem; }
.report-row { background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; }
.report-row > summary { cursor: pointer; padding: .8rem 1rem; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .25rem .8rem; align-items: start; }
.r-label { font-weight: 600; }
.r-sub { font-weight: 400; color: var(--ink-soft); margin-left: .4rem; }
.r-head { grid-column: 2; color: var(--ink-soft); font-size: .9rem; }
.report-row[open] > .ruling { border-radius: 0; box-shadow: none; border-inline: 0; }
.report-row > p { padding: .6rem 1rem .9rem; }

/* ---------- learn ---------- */
.learn { display: flex; flex-direction: column; gap: 2rem; max-width: 46rem; }
.learn h2 { font: 400 var(--step-3) var(--display); margin-bottom: .75rem; }
.prose { display: flex; flex-direction: column; gap: 1rem; font: 400 1.0625rem/1.7 var(--serif); }
.framework { padding-left: 1.4rem; margin: 0; display: grid; gap: .6rem; }
.framework li::marker { font-weight: 700; color: var(--seal); }
.traps { padding-left: 1.2rem; margin: 0; display: grid; gap: .5rem; }
.case-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }
.case-list li { border-left: 3px solid var(--line); padding-left: .85rem; }
.case-name { font-weight: 600; }
.case-list li > p:last-child { font: 400 .9688rem/1.55 var(--serif); color: var(--ink-soft); }
.cta-row { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- practice ---------- */
.practice { display: flex; flex-direction: column; gap: 1rem; }
.score { font-weight: 600; color: var(--seal); min-height: 1.5em; }
.hypos { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1.25rem; max-width: 52rem; }
.hypo { background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .8rem; }
.hypo h3 { font: 400 var(--step-2) var(--display); display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.hypo-topic { font: 400 var(--step--1) var(--sans); color: var(--ink-soft); }
.fact-pattern { font: 400 1.0625rem/1.65 var(--serif); }
.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice { background: var(--sheet); color: var(--ink); border-color: var(--line); }
.choice:hover { border-color: var(--seal); color: var(--seal); filter: none; }
.hypo-result { display: flex; flex-direction: column; gap: .75rem; }
.hypo-result:empty { display: none; }
.call { font-weight: 600; }
.call.right { color: var(--pass); }
.call.wrong { color: var(--fail); }

/* ---------- deadlines ---------- */
.dl-controls { max-width: 52rem; margin-bottom: 1.5rem; }
.free-date { font: 400 var(--step-3) var(--display); }
.dl-group { margin-bottom: 1.75rem; }
.dl-group h2 { font: 400 var(--step-2) var(--display); margin-bottom: .6rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); }
table.dl { border-collapse: collapse; width: 100%; min-width: 44rem; font-size: .9375rem; }
table.dl th { text-align: left; font-size: var(--step--1); color: var(--ink-soft); font-weight: 600; padding: .6rem .8rem; border-bottom: 1px solid var(--line); background: var(--sheet-2); }
table.dl td { padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.dl tr:last-child td { border-bottom: 0; }
table.dl td.num { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
table.dl td.num summary { cursor: pointer; }
table.dl td.num ol { white-space: normal; max-width: 22rem; font-weight: 400; }
.share input { font-size: var(--step--1); }

.toast { position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: .65rem 1rem; border-radius: 8px; display: flex; gap: .75rem; align-items: center; z-index: 60; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast .btn-quiet { color: var(--paper); border-color: var(--ink-soft); }

/* ---------- compact form: facts written as sentences with fill-in blanks ---------- */
.facts { gap: .9rem; }
.builder { gap: .25rem; }
.blk { display: flex; flex-direction: column; gap: .35rem; padding-block: .35rem .8rem; border-bottom: 1px solid var(--line); }
.blk:last-child { border-bottom: 0; }
.blk-h { font: 400 italic 1rem/1.3 var(--serif); color: var(--ink-soft); margin-top: .35rem; }
.line { font: 400 1rem/2.05 var(--serif); }
.line.hint { font: 400 var(--step--1)/1.5 var(--sans); }

select.in, input[type].in {
  display: inline-block; width: auto; max-width: 100%; vertical-align: baseline;
  font: 500 .9375rem/1.3 var(--sans); color: var(--seal); background: var(--seal-soft);
  border: 0; border-bottom: 1.5px solid var(--seal); border-radius: 3px 3px 0 0;
  padding: .12rem .3rem; margin: 0; field-sizing: content;
}
select.in { padding-right: 1.1rem; }
input[type].in-text { min-width: 7ch; width: 11em; field-sizing: content; }
input[type].in-name { font-weight: 600; color: var(--ink); background: transparent; border-bottom-style: dashed; border-bottom-color: var(--line); }
input[type].in-num { width: 7.5em; min-width: 6ch; font-variant-numeric: tabular-nums; }
input[type].in-date { width: auto; }
input[type].in-event { min-width: 10ch; }
select.in:hover, input[type].in:hover { border-bottom-color: var(--ink); }

.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.row-item { padding-block: .3rem .45rem; border-top: 1px dotted var(--line); display: flex; flex-direction: column; gap: .1rem; }
.row-item:first-child { border-top: 0; }
.members { list-style: none; margin: 0; padding-left: .9rem; border-left: 2px solid var(--line); display: flex; flex-direction: column; }
.member { font: 400 .9688rem/2 var(--serif); }
.nested { padding-left: .9rem; }

button.x { font-size: 0; background: none; border: 0; color: var(--ink-soft); cursor: pointer; padding: 0 .3rem; margin-left: .3rem; vertical-align: middle; border-radius: 4px; }
button.x::before { content: '\00d7'; font: 400 1.15rem/1 var(--sans); }
button.x:hover { color: var(--fail); background: var(--fail-bg); }
.adds { display: flex; flex-wrap: wrap; gap: .4rem; }
button.add { font: 600 .8125rem/1 var(--sans); color: var(--seal); background: transparent; border: 1px dashed var(--line); border-radius: 999px; padding: .4rem .7rem; cursor: pointer; }
button.add:hover { border-color: var(--seal); }
button.add-sm { padding: .15rem .45rem; margin-left: .3rem; }
.dlist { display: inline; }
.chip { display: inline-flex; align-items: center; margin-right: .3rem; }

.more > summary { display: inline-block; cursor: pointer; font: 600 var(--step--1)/1.6 var(--sans); color: var(--seal); list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before { content: '+ '; }
.more[open] > summary::before { content: '\2212 '; }
.more-body { display: flex; flex-direction: column; gap: .4rem; padding: .35rem 0 .3rem .8rem; border-left: 2px solid var(--line); margin-top: .2rem; font-size: .9375rem; }
.more-line { display: block; font-size: .9375rem; line-height: 2; }
.tag { align-self: flex-start; font: 600 .75rem/1 var(--sans); color: var(--ink-soft); background: var(--info-bg); border-radius: 4px; padding: .25rem .45rem; }
.qs { display: flex; flex-direction: column; }

.yesno { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .9rem; padding: .3rem 0; border-bottom: 1px dotted var(--line); }
.yesno:last-child { border-bottom: 0; }
.yn-q { flex: 1 1 15rem; font-size: .9375rem; line-height: 1.4; }
.yesno .seg label { padding: .2rem .65rem; font-size: .8125rem; }

.kids > summary { cursor: pointer; font: 600 var(--step--1)/1.6 var(--sans); color: var(--seal); }
.step { padding-bottom: .75rem; }

.case-controls .row { gap: .25rem .9rem; }
input[type].case-name { flex: 1 1 12rem; width: auto; min-width: 0; border: 0; background: transparent; padding: 0; font: 400 1.5rem/1.2 var(--display); color: var(--ink); }
input[type].case-name:focus-visible { outline: 2px solid var(--focus); }
button.link { background: none; border: 0; padding: .2rem 0; font: 600 .875rem var(--sans); color: var(--seal); cursor: pointer; text-decoration: underline; text-underline-offset: .2em; text-decoration-color: var(--line); }
button.link:hover { text-decoration-color: currentColor; }

.case-fold { border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); }
.case-fold > summary { cursor: pointer; padding: .6rem .85rem; font-size: .9375rem; line-height: 1.45; }
.fold-label { font-weight: 600; }
.fold-act { color: var(--seal); font-weight: 600; white-space: nowrap; }
.case-fold[open] > summary .fold-act { display: none; }
.case-fold[open] > div { padding: .25rem .85rem .75rem; }

.panel { padding: .9rem 1rem; gap: .55rem; }
.panel > h3 { font-size: var(--step-1); }
.line .place, .more-line .place, .member .place { display: inline; }
@supports (field-sizing: content) {
  input[type].in-text, input[type].in-num { width: auto; }
  input[type].in-text { min-width: 4ch; }
}
