:root {
  color-scheme: light;
  --ink: #17352b;
  --muted: #6d7e77;
  --green: #176b4b;
  --green-dark: #10543a;
  --mint: #dff3e9;
  --paper: #fffefa;
  --line: #dce5df;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(173, 222, 199, .42), transparent 28rem),
    radial-gradient(circle at 92% 90%, rgba(241, 210, 151, .28), transparent 25rem),
    #f3f7f1;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, textarea, input { font: inherit; }

.app-shell { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0; }

header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.brand { display: flex; gap: 11px; align-items: center; color: var(--ink); text-decoration: none; font-size: 1.25rem; font-weight: 760; letter-spacing: -.025em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: white; background: var(--green); font-family: Georgia, serif; font-size: 1.35rem; }
.mode-bar { display: flex; gap: 10px; margin-bottom: 18px; }
.deck-picker { display: flex; flex: 1; align-items: center; gap: 8px; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.deck-picker select { width: 100%; min-height: 36px; padding: 0 29px 0 11px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: rgba(255,255,255,.72); font: inherit; font-size: .82rem; font-weight: 700; text-transform: none; letter-spacing: normal; }
.deck-picker select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 75, .1); }
.counter { padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.66); font-size: .86rem; font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.card { padding: clamp(28px, 6vw, 58px); border: 1px solid rgba(23, 53, 43, .1); border-radius: 28px; background: var(--paper); box-shadow: 0 24px 70px rgba(25, 68, 52, .11); }
.status-card { text-align: center; }
.status-card h1 { margin-top: 0; }
.status-card p { color: var(--muted); line-height: 1.6; }
.hidden { display: none !important; }

.eyebrow { margin-bottom: 15px; color: var(--green); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0 0 42px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 6vw, 3.35rem); font-weight: 500; line-height: 1.14; letter-spacing: -.035em; text-wrap: balance; }
label[for="translation-input"] { display: block; margin-bottom: 9px; color: var(--muted); font-size: .88rem; font-weight: 700; }
textarea { width: 100%; min-height: 118px; padding: 17px 18px; resize: vertical; border: 1.5px solid var(--line); border-radius: 15px; outline: none; color: var(--ink); background: #fff; line-height: 1.5; transition: border-color .18s, box-shadow .18s; }
textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(23, 107, 75, .11); }
textarea:disabled { color: var(--muted); background: #f5f7f4; }

.voice-controls { display: flex; align-items: center; gap: 12px; min-height: 39px; margin-top: 10px; }
.mic-button { gap: 8px; min-height: 38px; padding: 0 13px; border: 1px solid var(--line); color: var(--green); background: #fff; font-size: .82rem; }
.mic-button:hover { background: #f2f8f4; }
.mic-button:disabled { cursor: wait; opacity: .65; transform: none; }
.mic-button[aria-pressed="true"] { border-color: #bd4a3e; color: #a7352c; background: #fff2f0; }
.mic-icon { font-size: .64rem; }
.mic-button[aria-pressed="true"] .mic-icon { animation: pulse 1.2s ease-in-out infinite; }
.voice-status { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.verb-hint { margin: 9px 0 0; color: var(--muted); font-size: .86rem; }
.verb-hint strong { color: var(--green); font-size: 1rem; }

@keyframes pulse {
  50% { opacity: .35; transform: scale(.8); }
}

.actions { display: flex; gap: 11px; margin-top: 17px; }
button, .file-button { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 0 21px; border: 0; border-radius: 13px; cursor: pointer; font-weight: 760; transition: transform .15s, background .15s; }
button:hover, .file-button:hover { transform: translateY(-1px); }
.primary, .file-button { color: #fff; background: var(--green); }
.primary:hover, .file-button:hover { background: var(--green-dark); }
.secondary { color: var(--green); background: var(--mint); }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.divider { height: 1px; margin: 35px 0; background: var(--line); }
.answer { scroll-margin-top: 18px; }
.comparison { margin-bottom: 15px; }
.comparison-row { padding: 0; }
.comparison-row + .comparison-row { padding-top: 5px; }
.comparison-row .eyebrow { margin-bottom: 7px; }
.comparison-text { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.6rem, 4vw, 2.25rem); line-height: 1.3; }
.your-answer { color: #7b8984; }
.verb-line { margin: 0 0 20px; color: var(--muted); }
.verb-line strong { color: var(--green); }
.rating-panel { margin-top: 16px; }
.rating-label { margin-bottom: 8px; color: var(--muted); font-size: .78rem; font-weight: 750; text-align: center; }
.rating-buttons { display: flex; gap: 8px; }
.rating-button { flex: 1; gap: 7px; min-width: 0; padding: 0 10px; border: 1px solid var(--line); background: #fff; }
.rating-button kbd { background: transparent; }
.rating-again { color: #9b3e35; background: #fff5f3; }
.rating-barely { color: #80621d; background: #fffaf0; }
.rating-easy { color: var(--green); background: #f1f8f4; }
.session-stats { margin: 9px 0 0; color: var(--muted); font-size: .72rem; text-align: center; }
.problem-summary { margin: 24px 0; text-align: left; }
.problem-summary ol { margin: 0; padding-left: 22px; color: var(--muted); }
.problem-summary li { padding: 5px 0; }
.problem-summary strong { color: var(--ink); font-weight: 700; }
.bucket-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 20px 0; }
.bucket-stat { padding: 10px 6px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf7; text-align: center; }
.bucket-stat strong { display: block; color: var(--ink); font-size: 1.15rem; }
.bucket-stat span { color: var(--muted); font-size: .67rem; }
.hint { margin: 22px 0 0; text-align: center; color: var(--muted); font-size: .78rem; }
kbd { padding: 2px 6px; border: 1px solid #cdd8d1; border-bottom-width: 2px; border-radius: 5px; background: rgba(255,255,255,.7); font-size: .7rem; }
.error { min-height: 1.5em; color: #a43b32 !important; }

@media (max-width: 560px) {
  .app-shell { width: min(100% - 16px, 760px); padding: 10px 0; }
  header { margin-bottom: 7px; }
  .mode-bar { gap: 6px; margin-bottom: 9px; }
  .deck-picker { display: block; font-size: .64rem; }
  .deck-picker span { display: block; margin: 0 0 3px 3px; }
  .deck-picker select { min-height: 32px; padding-left: 8px; font-size: .74rem; }
  .counter { padding: 7px 9px; font-size: .76rem; }
  .card { padding: 22px; border-radius: 21px; }
  .eyebrow { margin-bottom: 9px; }
  h1 { margin-bottom: 20px; font-size: clamp(1.75rem, 8vw, 2.35rem); }
  textarea { min-height: 82px; padding: 12px 14px; }
  .voice-controls { min-height: 36px; margin-top: 7px; }
  .actions { margin-top: 10px; }
  button, .file-button { min-height: 44px; padding-inline: 10px; }
  .actions > * { flex: 1; }
  #reveal-button { flex: 1.6; }
  .divider { margin: 18px 0; }
  .comparison { margin-bottom: 10px; }
  .comparison-row + .comparison-row { padding-top: 4px; }
  .comparison-text { font-size: clamp(1.4rem, 6.5vw, 1.85rem); }
  .verb-line { margin-bottom: 12px; }
  .rating-panel { margin-top: 10px; }
  .rating-buttons { gap: 5px; }
  .rating-button { min-height: 42px; padding-inline: 6px; font-size: .78rem; }
  .rating-button kbd { display: none; }
  .session-stats { margin-top: 6px; }
  .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mic-button[aria-pressed="true"] .mic-icon { animation: none; }
}
