:root {
  --bg: #f6f1e8;
  --ink: #201b17;
  --muted: #6b6259;
  --card: #fffaf1;
  --line: #d8cab8;
  --accent: #2f3a2f;
  --accent-2: #b28b55;
  --danger: #9d3d2f;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
.app-shell { max-width: 980px; margin: 0 auto; padding: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 12px 32px rgba(32,27,23,.07); }
.hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 24px; align-items: end; }
h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(2rem, 7vw, 4.4rem); line-height: .92; }
h2 { margin: 0; font-family: Georgia, serif; }
.eyebrow { margin: 0 0 10px; text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; color: var(--muted); }
.lede { max-width: 660px; color: var(--muted); }
.controls { display: grid; gap: 10px; min-width: 230px; }
label { display: grid; gap: 6px; font-weight: 700; font-size: .8rem; color: var(--muted); }
select, button { min-height: 44px; border-radius: 999px; border: 1px solid var(--line); padding: 0 16px; background: white; color: var(--ink); font-weight: 700; }
button { background: var(--accent); color: white; cursor: pointer; }
button.secondary { background: transparent; color: var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }
.progress { margin-top: 14px; padding: 16px; }
.progress-top { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-weight: 700; font-size: .85rem; }
.bar { height: 10px; background: #e9dfd1; border-radius: 999px; overflow: hidden; margin-top: 10px; }
#progressBar { height: 100%; width: 0%; background: var(--accent-2); transition: width .2s; }
.question-card { margin-top: 14px; padding: 18px; }
.pair-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; margin-bottom: 12px; }
.statement-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.statement { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: rgba(255,255,255,.55); display: grid; gap: 12px; }
.statement.selected { outline: 3px solid rgba(178,139,85,.35); }
.statement p { margin: 0; font-size: 1.05rem; line-height: 1.45; }
.score-row { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 3; }
.score-btn, .score-row button { min-width: 56px; min-height: 52px; padding: 0 18px; background: white; color: var(--ink); touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; }
.score-btn.active, .score-row button.active { background: var(--accent-2); color: white; }
.difficulty-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; }
.difficulty-row select { min-height: 36px; }
.nav-row { display: flex; justify-content: space-between; gap: 10px; margin: 14px 0; }
.nav-row button { flex: 1; }
.results, .type-descriptions { padding: 18px; margin-top: 14px; }
.results-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.results-toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; font-family: Georgia, serif; font-size: 1.5rem; font-weight: 700; }
.toggle-hint { font-family: Inter, ui-sans-serif, system-ui, sans-serif; color: var(--muted); font-size: .85rem; font-weight: 700; }
.score-table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.score-table th, .score-table td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; }
.score-table th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.badge { display: inline-block; border-radius: 999px; padding: 4px 10px; background: #eee2cf; color: var(--accent); font-weight: 800; }
.warn { color: var(--danger); font-weight: 800; }
canvas { width: 100%; max-height: 360px; border: 1px solid var(--line); border-radius: 16px; background: #fffdf8; }
.type-list { display: grid; gap: 8px; margin-top: 14px; }
.type-list details { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: rgba(255,255,255,.45); }
.type-list summary { cursor: pointer; font-weight: 900; color: var(--accent); }
.type-list p { margin: 10px 0 0; color: var(--muted); line-height: 1.45; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .statement-grid { grid-template-columns: 1fr; }
  .app-shell { padding: 10px; padding-bottom: 96px; }
  .question-card { padding: 14px; }
  .score-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .score-btn, .score-row button { width: 100%; min-height: 58px; font-size: 1.1rem; }
  .nav-row { position: sticky; bottom: 0; z-index: 10; background: var(--bg); padding: 10px 0; }
}
