:root {
  --bg: #f7f5f0;
  --paper: #ffffff;
  --ink: #23262b;
  --muted: #6b6f76;
  --line: #e4e0d6;
  --accent: #3f6b5c;
  --accent-soft: #e7efeb;
  --client: #f1eee7;
  --warn: #8a4b14;
  --radius: 14px;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
.sr { position: absolute; left: -9999px; }
[hidden] { display: none !important; }
.top { display: flex; align-items: center; justify-content: space-between; max-width: 820px; margin: 0 auto; padding: 18px 20px 0; }
.brand { font-family: var(--serif); font-size: 18px; color: var(--accent); letter-spacing: .2px; }
main { max-width: 820px; margin: 0 auto; padding: 12px 20px 60px; }
h1 { font-family: var(--serif); font-weight: normal; font-size: 30px; line-height: 1.25; margin: 18px 0 8px; }
h2 { font-family: var(--serif); font-weight: normal; font-size: 21px; margin: 28px 0 6px; }
.lead { color: var(--muted); max-width: 640px; }
.muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 1.5px; font-size: 12px; color: var(--accent); margin: 24px 0 0; }
button { font: inherit; border: 0; border-radius: 999px; padding: 10px 20px; background: var(--accent); color: #fff; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button.link { background: none; color: var(--accent); padding: 4px 0; text-decoration: underline; }
.notice { background: #fff6e8; border: 1px solid #f0d9b5; color: var(--warn); padding: 12px 16px; border-radius: var(--radius); margin-top: 16px; }
.error { background: #fdecec; border: 1px solid #f3c4c4; color: #8a1f1f; padding: 10px 14px; border-radius: var(--radius); margin-top: 12px; }

/* choose */
.code-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 0; }
.code-box label { font-size: 14px; color: var(--muted); }
.code-error { font-size: 14px; color: var(--warn); width: 100%; }
.code-box input { font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; min-width: 200px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 20px 0; }
.card h2 { margin-top: 0; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.tag { background: var(--accent-soft); color: var(--accent); font-size: 13px; padding: 2px 10px; border-radius: 999px; }
.card .focus { margin: 6px 0; }
.lengths { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 4px; }
.lengths label { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 14px; }
.lengths input { margin-right: 6px; }
.lengths label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* practice */
.frame { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 12px 0 18px; position: sticky; top: 0; z-index: 2; }
.frame-title { font-family: var(--serif); font-size: 19px; }
.frame-row span, .frame-more summary { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.frame-row p { margin: 2px 0 6px; }
.frame-more summary { cursor: pointer; }
.frame-more p { margin: 6px 0; font-size: 15px; }
.progress { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.bar { flex: 1; height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.turns { display: flex; flex-direction: column; gap: 14px; }
.turn { max-width: 88%; }
.turn .who { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 2px; }
.turn .num { color: #b3b0a7; margin-left: 6px; }
.turn .text { padding: 12px 16px; border-radius: var(--radius); white-space: pre-wrap; }
.turn.client .text { background: var(--client); }
.turn.helper { align-self: flex-end; }
.turn.helper .who { text-align: right; }
.turn.helper .text { background: var(--paper); border: 1px solid var(--line); }
.turn .text em { color: var(--muted); }
.typing .text { color: var(--muted); font-style: italic; }
.composer { margin-top: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.composer textarea { width: 100%; border: 0; resize: vertical; font: inherit; outline: none; background: transparent; }
.composer-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.spacer { flex: 1; }

/* summary */
.sum-section { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 16px 0; }
.sum-section h2 { margin: 0 0 6px; font-size: 19px; }
.sum-section p { margin: 6px 0; }
.moment { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; margin: 14px 0; }
.moment .q { margin: 2px 0; }
.moment .q b { font-weight: 600; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .8px; margin-right: 6px; }
.moment .lvl { font-size: 12px; color: var(--accent); }
.alt { font-family: var(--serif); font-size: 17px; background: var(--accent-soft); padding: 10px 14px; border-radius: 10px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0; }
.usage { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; margin-top: 10px; font-size: 14px; }
.usage summary { cursor: pointer; color: var(--accent); }
.usage table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.usage th, .usage td { text-align: right; padding: 4px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.usage th:first-child, .usage td:first-child, .usage th:nth-child(2), .usage td:nth-child(2) { text-align: left; }
.usage tfoot td { font-weight: 600; border-bottom: 0; }
.sum-section .note { color: var(--muted); font-size: 14px; margin: -2px 0 8px; }
.ref { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
.transcript { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; margin: 16px 0; }
.transcript summary { cursor: pointer; color: var(--accent); }
.transcript .turns { margin-top: 12px; }
.turn.flash .text { outline: 2px solid var(--accent); }
.hint { white-space: nowrap; }
.loading { color: var(--muted); font-style: italic; padding: 30px 0; }
@media (max-width: 560px) { h1 { font-size: 25px; } .turn { max-width: 100%; } .usage { overflow-x: auto; } .hint { display: none; } }
