/* Shall We? BS 202001 in 45 minutes. Colours and type from design_spec.md section 2.
   No inline styles anywhere (the Content-Security-Policy forbids them). */

:root {
  --ink: #14213D;
  --body: #1F2933;
  --secondary: #3E4C59;
  --muted: #52606D;
  --ground: #FFFFFF;
  --panel: #F4F6F8;
  --line: #D9DEE3;
  --divider: #E4E7EB;
  --input: #9AA5B1;
  --accent: #B5470B;
  --accent-dark: #8A3508;
  --accent-tint: #FBEFE7;
  --accent-on-navy: #F5B386;
  --chip: #E8ECF4;
  --key: #EAF5EC;
  --key-line: #2F7D4A;
  --key-ink: #1E5631;
  --serif: 'IBM Plex Serif', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--body); background: var(--ground); }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
[hidden] { display: none !important; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }
.eyebrow { margin: 0; font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  border-radius: 6px; font: inherit; font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer;
  background: var(--ground); color: var(--ink); border: 1px solid var(--input); }
.button:hover { color: var(--ink); background: var(--panel); }
.button.primary { min-height: 48px; padding: 0 28px; font-size: 16px; font-weight: 600; background: var(--ink); color: #FFFFFF; border: 0; }
.button.primary:hover { background: #22315A; color: #FFFFFF; }
.button.accent { background: var(--accent); color: #FFFFFF; border: 0; font-weight: 600; min-height: 48px; }
.button.accent:hover { background: var(--accent-dark); color: #FFFFFF; }
.button:disabled { opacity: 0.55; cursor: default; }
.button.link { border: 0; background: transparent; padding: 0; min-height: 44px; color: var(--body); text-decoration: underline; }

/* Site header */
.site-header { border-bottom: 1px solid var(--line); background: var(--ground); }
.site-header .wrap { padding-top: 18px; padding-bottom: 18px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.wordmark { display: flex; align-items: baseline; gap: 12px; text-decoration: none; color: var(--ink); }
.wordmark:hover { color: var(--ink); }
.wordmark b { font-family: var(--serif); font-weight: 600; font-size: 24px; letter-spacing: -0.01em; }
.wordmark span { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.site-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; font-size: 15px; }
.site-nav a { color: var(--body); text-decoration: none; }
.site-nav .who { color: var(--muted); }

/* Landing */
.hero { background: var(--panel); border-bottom: 1px solid var(--line); }
.hero .wrap { padding-top: 88px; padding-bottom: 96px; display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.hero-text { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 56px; line-height: 1.08; letter-spacing: -0.02em; color: var(--ink); }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--accent); }
.strap { margin: 0; font-size: 20px; line-height: 1.55; color: var(--secondary); max-width: 620px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.small { margin: 0; font-size: 14px; color: var(--muted); }
.specimen { flex: 1 1 340px; min-width: 0; background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 32px;
  display: flex; flex-direction: column; gap: 22px; box-shadow: 0 1px 2px rgba(20, 33, 61, 0.06); }
.specimen .label { margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.specimen .row { display: flex; align-items: baseline; gap: 16px; border-bottom: 1px solid var(--divider); padding-bottom: 18px; }
.specimen .row:last-child { border-bottom: 0; padding-bottom: 0; }
.specimen .word { font-family: var(--serif); font-size: 44px; min-width: 120px; }
.specimen .shall { font-weight: 600; color: var(--ink); }
.specimen .should { font-weight: 500; font-style: italic; color: var(--muted); }
.specimen .note { font-weight: 500; color: #7B8794; }
.specimen .row span:last-child { font-size: 16px; color: var(--secondary); }
.key-band { background: var(--ink); color: #FFFFFF; }
.key-band .wrap { padding-top: 56px; padding-bottom: 56px; display: flex; flex-wrap: wrap; gap: 32px; align-items: center; }
.key-band .eyebrow { color: var(--accent-on-navy); flex: 0 0 auto; }
.key-band p:last-child { margin: 0; flex: 999 1 560px; min-width: 0; font-family: var(--serif); font-size: 30px; line-height: 1.3; font-weight: 500; }
.section .wrap { padding-top: 88px; padding-bottom: 88px; display: flex; flex-direction: column; gap: 40px; }
.section.tinted { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 36px; color: var(--ink); }
.section .lead { margin: 0; font-size: 18px; line-height: 1.55; color: var(--secondary); max-width: 720px; }
.intro { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 24px; display: flex; flex-direction: column; gap: 8px; background: var(--ground); }
.card h3 { margin: 0; font-size: 18px; font-weight: 600; color: var(--ink); }
.card p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--secondary); }
.outline .wrap { flex-direction: row; flex-wrap: wrap; gap: 56px; }
.outline .intro { flex: 1 1 320px; min-width: 0; }
.parts { flex: 999 1 560px; min-width: 0; margin: 0; padding: 0; list-style: none; background: var(--ground); border: 1px solid var(--line); border-radius: 8px; }
.parts li { display: flex; gap: 20px; align-items: baseline; padding: 18px 24px; border-bottom: 1px solid var(--divider); }
.parts li:last-child { border-bottom: 0; }
.parts .n { font-family: var(--mono); font-size: 14px; color: var(--accent); min-width: 56px; }
.parts .t { flex: 1; font-size: 16px; font-weight: 500; color: var(--ink); }
.parts .m { font-family: var(--mono); font-size: 14px; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; }
.steps div { display: flex; flex-direction: column; gap: 10px; }
.steps .n { font-family: var(--mono); font-size: 14px; color: var(--accent); }
.steps h3 { margin: 0; font-size: 18px; font-weight: 600; color: var(--ink); }
.steps p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--secondary); }
.privacy { border-left: 3px solid var(--accent); padding: 4px 0 4px 20px; max-width: 820px; }
.privacy h3 { margin: 0 0 8px; font-size: 18px; color: var(--ink); }
.privacy p { margin: 0 0 8px; font-size: 15px; line-height: 1.6; color: var(--secondary); }
.site-footer { border-top: 1px solid var(--line); background: var(--ground); }
.site-footer .wrap { padding-top: 32px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 8px; }
.site-footer p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); max-width: 820px; }
.notice { max-width: 560px; margin: 15vh auto; padding: 0 24px; }
.notice h1 { font-family: var(--serif); color: var(--ink); }
.notice p { font-size: 16px; line-height: 1.6; }

/* Course screen */
.course-body { background: var(--panel); min-height: 100vh; display: flex; flex-direction: column; }
.course-header { background: var(--ground); border-bottom: 1px solid var(--line); }
.course-header .bar { max-width: 1360px; margin: 0 auto; padding: 14px 24px; display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.course-header .wordmark b { font-size: 21px; }
.course-header .wordmark span { font-size: 12px; }
.pills { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pills li { font-family: var(--mono); font-size: 12px; padding: 6px 10px; border-radius: 999px; background: var(--ground); color: var(--muted); border: 1px solid var(--line); }
.pills li.done { background: var(--chip); color: var(--ink); border-color: var(--chip); }
.pills li[aria-current="step"] { background: var(--ink); color: #FFFFFF; font-weight: 500; border-color: var(--ink); }
.timer { display: flex; gap: 16px; align-items: center; }
.timer .mono { font-size: 13px; color: var(--muted); }
.phone-only { display: none; }
.course-main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 24px; display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.conversation { flex: 999 1 560px; min-width: 0; background: var(--ground); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; height: calc(100vh - 140px); min-height: 520px; }
.conv-head { padding: 16px 28px; border-bottom: 1px solid var(--divider); display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; }
.conv-head h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 20px; color: var(--ink); }
.conv-head span { font-size: 13px; color: var(--muted); }
.messages { flex: 1; padding: 28px; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; }
.msg { display: flex; gap: 14px; max-width: 680px; }
.msg .avatar { flex: 0 0 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.msg.facilitator .avatar { background: var(--ink); color: #FFFFFF; font-family: var(--serif); font-size: 16px; }
.msg.learner { align-self: flex-end; flex-direction: row-reverse; width: 100%; max-width: 620px; }  /* a definite width, or a short reply collapses to one letter per line */
.msg.learner .avatar { background: var(--divider); color: var(--ink); font-size: 14px; }
.msg .body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.msg .content { display: flex; flex-direction: column; gap: 10px; }
.msg.learner .body { background: var(--panel); border-radius: 10px; padding: 14px 18px; }
.msg .who { font-size: 13px; font-weight: 600; color: var(--ink); }
.msg p, .msg li { margin: 0; font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.msg ul, .msg ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.msg.error p { color: var(--accent-dark); }
.part-banner { align-self: stretch; max-width: 680px; background: var(--ink); color: #FFFFFF; border-radius: 12px; padding: 18px 22px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.part-banner .done { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-on-navy); }
.part-banner .next { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.3; }
.part-banner .meta { font-size: 13px; color: #C9D1E0; }
.part-banner .pips { display: flex; gap: 6px; margin-top: 8px; }
.part-banner .pip { width: 24px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.2); }
.part-banner .pip.done { background: var(--accent-on-navy); }
.part-banner .pip.now { background: #FFFFFF; }
/* Arriving live: rises in, a sweep of light crosses it once, and the new pip pulses. */
@keyframes banner-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes banner-sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes pip-pulse { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25); } }
.part-banner.arrive { animation: banner-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.part-banner.arrive::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.14) 50%, transparent 70%); animation: banner-sweep 1.2s ease-in-out 0.4s both; pointer-events: none; }
.part-banner.arrive .pip.now { animation: pip-pulse 0.9s ease-in-out 0.9s 2; }
@media (prefers-reduced-motion: reduce) {
  .part-banner.arrive, .part-banner.arrive::after, .part-banner.arrive .pip.now { animation: none; }
  .part-banner.arrive::after { display: none; }
}
.attribution { align-self: center; max-width: 620px; border-top: 1px solid var(--divider); padding: 14px 4px 0; display: flex; flex-direction: column; gap: 4px; }
.attribution .label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.attribution p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--muted); }
.msg a.external { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
.msg a.external::after { content: ' ↗'; font-size: 0.85em; }
.msg a.external:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.msg .keypoint { background: var(--key); border-left: 4px solid var(--key-line); border-radius: 6px; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.msg .keypoint .label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--key-ink); }
.msg .keypoint > div { display: flex; flex-direction: column; gap: 8px; }
.chip { border: 0; cursor: pointer; text-align: left; align-self: flex-start; font-family: var(--mono); font-size: 12px; border-radius: 4px; padding: 4px 8px; color: var(--ink); background: var(--chip); }
.chip.panel { color: var(--accent); background: var(--accent-tint); }
span.chip { cursor: default; }
.typing { font-size: 14px; color: var(--muted); }
.reply { border-top: 1px solid var(--divider); padding: 18px 28px 22px; display: flex; flex-direction: column; gap: 10px; }
.reply label { font-size: 13px; font-weight: 600; color: var(--ink); }
.reply .row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.reply textarea { flex: 999 1 400px; min-width: 0; resize: vertical; padding: 12px 14px; border: 1px solid var(--input); border-radius: 8px; font: inherit; font-size: 16px; line-height: 1.5; color: var(--body); }
.reply .button.primary { flex: 0 0 auto; padding: 0 24px; }
.reply .small { font-size: 13px; }

/* Reference panel */
.reference { flex: 1 1 380px; min-width: 0; background: var(--ground); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; height: calc(100vh - 140px); min-height: 520px; }
.tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--divider); padding: 0 12px; }
.tabs button { flex: 0 0 auto; min-height: 48px; padding: 0 14px; background: transparent; border: 0; border-bottom: 3px solid transparent; font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--accent); font-weight: 600; color: var(--ink); }
.tabs .close { margin-left: auto; }
.tabpanel { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.tabpanel h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 18px; color: var(--ink); }
.tabpanel .headline { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tabpanel .count, .tabpanel .clause { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tabpanel .caption { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.tabpanel.dictation p { margin: 0; line-height: 1.55; }
.tabpanel.dictation .steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.5; }
.fundamentals { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.fundamentals li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #EEF0F3; }
.fundamentals .mark { flex: 0 0 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; background: var(--ground); color: var(--muted); border: 1px solid var(--input); }
.fundamentals li.covered .mark { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.fundamentals .text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fundamentals .title { font-size: 15px; font-weight: 600; color: var(--ink); }
.fundamentals .line { font-size: 13px; line-height: 1.5; color: var(--muted); }
/* A fundamental the facilitator has just named: two soft pulses. */
@keyframes fundamental-flash {
  0%, 50%, 100% { background: transparent; box-shadow: none; }
  25%, 75% { background: var(--accent-tint); box-shadow: -10px 0 0 var(--accent-tint), 10px 0 0 var(--accent-tint); }
}
.fundamentals li.flash { animation: fundamental-flash 2.4s ease-in-out; }
@keyframes tab-flash { 0%, 50%, 100% { color: inherit; } 25%, 75% { color: var(--accent); } }
[role="tab"].flash { animation: tab-flash 2.4s ease-in-out; }
/* Diagrams tab */
.diagram-figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.diagram-figure img { display: block; width: 100%; max-width: 480px; height: auto; align-self: center; }
.d-list { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--divider); padding-top: 14px; }
.d-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.d-buttons .chip[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 600; }

.chain { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.chain li { display: flex; flex-direction: column; align-items: stretch; }
.chain .box { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); }
.chain .box.client { background: var(--accent-tint); border-color: var(--accent); }
.chain .top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.chain .name { font-size: 14px; font-weight: 600; color: var(--ink); }
.chain .role { font-size: 12px; color: var(--muted); }
.chain .link { align-self: center; width: 2px; height: 10px; background: var(--input); }
.claim { background: var(--ink); color: #FFFFFF; border-radius: 8px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.claim .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-on-navy); }
.claim .v { font-family: var(--serif); font-size: 17px; line-height: 1.4; }
.arguments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.argument { border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.argument .num { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.argument .title { font-size: 14px; font-weight: 600; color: var(--ink); }
.argument .themes { font-size: 12px; line-height: 1.5; color: var(--muted); }
.completion .kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.completion h2 { font-size: 20px; margin-top: 2px; }
.completion h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.completion .summary { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.completion .summary dt:not(:first-child) { margin-top: 10px; }
.completion .summary dt { font-size: 14px; font-weight: 600; color: var(--ink); }
.completion .summary dd, .completion .text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--secondary); }
.completion .noted { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.55; color: var(--secondary); }
.completion .pre, .completion pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.completion .email { border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; background: var(--panel); }
.completion .email h3 { margin: 0; }
.completion .meta { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; font-size: 14px; }
.completion .meta dt { color: var(--muted); }
.completion .meta dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.completion .status { margin: 0; font-size: 14px; line-height: 1.5; color: var(--secondary); }
.completion .status.sent { color: var(--key-ink); font-weight: 600; }
.completion .status.failed { color: var(--accent-dark); font-weight: 600; }
.completion details summary { cursor: pointer; font-size: 14px; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.completion pre { margin: 10px 0 0; font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--body); background: var(--ground); border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
.progress { height: 4px; background: var(--divider); border-radius: 2px; overflow: hidden; }
.progress div { height: 4px; width: 0; background: var(--accent); }

/* Phone (design/Mobile.dc.html): slim header, panel as a sheet */
@media (max-width: 900px) {
  .hero .wrap { padding-top: 48px; padding-bottom: 56px; gap: 32px; }
  .hero h1 { font-size: 38px; }
  .strap { font-size: 18px; }
  .key-band p:last-child { font-size: 24px; }
  .section .wrap { padding-top: 56px; padding-bottom: 56px; }
  .section h2 { font-size: 28px; }
  .wrap { padding: 0 16px; }
  .course-header .bar { padding: 14px 16px 12px; gap: 10px; }
  .pills, .timer .mono.desktop { display: none; }
  .phone-only { display: flex; }
  .phone-status { width: 100%; flex-direction: column; gap: 10px; }
  .phone-status .line { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--muted); }
  /* An app-like screen, as the design: fixed header, the conversation scrolls, reply at the foot. */
  .course-body { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .course-main { flex: 1; min-height: 0; padding: 0; gap: 0; }
  .conversation { border: 0; border-radius: 0; height: 100%; min-height: 0; }
  .conv-head { padding: 12px 16px; }
  .messages { padding: 18px 16px; gap: 16px; }
  .msg .avatar { display: none; }
  .msg.learner { max-width: 88%; }
  .reply { padding: 12px 16px 20px; }
  .reply textarea { flex-basis: 200px; }
  .reference { position: fixed; inset: 0; z-index: 10; height: auto; border-radius: 0; border: 0; }
  .reference:not(.open) { display: none; }
}
@media (min-width: 901px) {
  .tabs .close { display: none; }
}

/* Thank-you page (design/Thanks.dc.html) */
.thanks-body { background: var(--panel); min-height: 100vh; display: flex; flex-direction: column; }
.thanks-band { background: var(--ink); color: #FFFFFF; }
.thanks-band .wrap { padding-top: 72px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 18px; }
.thanks-band .eyebrow { color: var(--accent-on-navy); }
.thanks-band h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 52px; line-height: 1.1; letter-spacing: -0.02em; }
.thanks-band .lead { margin: 0; font-size: 19px; line-height: 1.55; color: #D9DEE3; max-width: 680px; }
.thanks-main { flex: 1; width: 100%; padding-top: 56px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 32px; }
.thanks-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 24px; }
.thanks-card { background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.thanks-card[hidden] { display: none; }
.thanks-head { display: flex; align-items: center; gap: 14px; }
.thanks-head svg { flex: 0 0 auto; }
.thanks-card h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 26px; color: var(--ink); }
.thanks-card > p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--secondary); }
.thanks-card > p.small { font-size: 14px; color: var(--muted); }
.thanks-card label { font-size: 14px; font-weight: 600; color: var(--ink); }
.thanks-card textarea { resize: vertical; padding: 14px 16px; border: 1px solid var(--input); border-radius: 8px; font: inherit; font-size: 15px; line-height: 1.55; color: var(--body); }
.thanks-card .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.thanks-card .button { text-decoration: none; }
.thanks-reading { margin-top: 24px; background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.thanks-reading h2 { margin: 0; font-family: var(--serif); font-size: 20px; color: var(--ink); }
.papers { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.papers li { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--divider); }
.papers .title { font-weight: 600; font-size: 16px; }
.papers .about { font-size: 14px; color: var(--body); line-height: 1.5; }
.papers .kind { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.thanks-next { background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 28px 32px; display: flex; flex-wrap: wrap; gap: 16px 40px; align-items: center; justify-content: space-between; }
.thanks-next[hidden] { display: none; }
.thanks-next > div { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.thanks-next h2 { margin: 0; font-size: 18px; font-weight: 600; color: var(--ink); }
.thanks-next p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--secondary); }
@media (max-width: 900px) {
  .thanks-band .wrap { padding-top: 48px; padding-bottom: 56px; }
  .thanks-band h1 { font-size: 38px; }
  .thanks-card, .thanks-next { padding: 24px 20px; }
}

/* Sign-in pages (auth.py) and the admin page (admin.py): server-rendered forms */
.notice .small { font-size: 14px; color: var(--muted); }
.signin { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.signin label, .admin label { font-size: 14px; font-weight: 600; color: var(--ink); }
.signin input, .admin input { min-height: 44px; padding: 0 12px; border: 1px solid var(--input); border-radius: 6px; font: inherit; font-size: 16px; color: var(--body); }
.signin .button { align-self: flex-start; }
.admin-body { background: var(--panel); min-height: 100vh; }
.admin { padding-top: 32px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 20px; }
.admin h1 { margin: 0; font-family: var(--serif); color: var(--ink); }
.admin h2 { margin: 0 0 4px; font-size: 18px; color: var(--ink); }
.admin .invite { background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; }
.admin .fields { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin-top: 12px; }
.admin .fields label { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; }
.admin .usage { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.admin .figures { margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.admin .figures div { flex: 1 1 180px; background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.admin .figures dt { font-size: 13px; color: var(--muted); }
.admin .figures dd { margin: 4px 0 0; font-family: var(--mono); font-size: 22px; color: var(--ink); }
.admin .figures dd.small { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.admin .scroll { overflow-x: auto; }
.admin .charts { display: flex; flex-wrap: wrap; gap: 12px; }
.admin .chart { flex: 1 1 320px; min-width: 0; margin: 0; background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.admin .chart figcaption { display: flex; flex-direction: column; gap: 2px; }
.admin .chart svg { display: block; }
.admin .chart details summary { cursor: pointer; }
.stats { width: 100%; border-collapse: collapse; background: var(--ground); border: 1px solid var(--line); font-size: 14px; }
.stats th, .stats td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--divider); white-space: nowrap; }
.stats th { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.stats td + td { font-family: var(--mono); }
.admin-notice { margin: 0; padding: 12px 16px; border-radius: 6px; background: var(--key); color: var(--key-ink); font-size: 15px; }
.admin-notice.failed { background: var(--accent-tint); color: var(--accent-dark); overflow-wrap: anywhere; }
.people { width: 100%; border-collapse: collapse; background: var(--ground); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.people th, .people td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--divider); vertical-align: top; }
.people th { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.people .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.people .actions form { margin: 0; }
@media (max-width: 900px) {
  .people thead { display: none; }
  .people, .people tbody, .people tr, .people td { display: block; width: 100%; }
  .people tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .people td { border: 0; padding: 4px 14px; }
}
