:root {
  color-scheme: light;
  --ink: #263238;
  --muted: #6c777c;
  --paper: #f7f5f0;
  --card: #fffefa;
  --line: #ddd9d0;
  --accent: #d45f3a;
  --accent-dark: #a84327;
  --soft: #f0e5d9;
  --success: #2d6b58;
  --shadow: 0 16px 42px rgba(62, 47, 30, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); min-height: 100vh; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.site-header {
  max-width: 920px;
  margin: 0 auto;
  min-height: 72px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { font-weight: 800; letter-spacing: -.04em; text-decoration: none; font-size: 24px; }
.shell { max-width: 720px; margin: 0 auto; padding: 32px 24px 72px; }
.stack { display: grid; gap: 18px; }
.auth-card, .panel, .task-card, .result-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.auth-card { max-width: 430px; margin: 9vh auto 0; padding: 34px; }
.panel, .task-card, .result-card { padding: 26px; }
.eyebrow { color: var(--accent-dark); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(30px, 7vw, 48px); line-height: 1.05; letter-spacing: -.05em; margin-bottom: 14px; }
h2 { font-size: 25px; letter-spacing: -.03em; margin-bottom: 8px; }
h3 { font-size: 17px; margin-bottom: 8px; }
.muted { color: var(--muted); line-height: 1.65; }
.small { font-size: 14px; color: var(--muted); }
.error { color: #9b311e; background: #fbe9e3; padding: 12px 14px; border-radius: 10px; }
.success { color: var(--success); background: #e3f1e9; padding: 12px 14px; border-radius: 10px; }
label { font-weight: 700; font-size: 14px; }
input, textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #bdb8ad;
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
textarea { min-height: 118px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(212, 95, 58, .17); }
.button, .link-button {
  min-height: 44px;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 750;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button { background: var(--soft); color: var(--ink); }
.button.primary { color: white; background: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button:disabled { cursor: wait; opacity: .58; }
.link-button { background: transparent; color: var(--muted); padding: 8px 4px; }
.link-button:hover { color: var(--ink); }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.today-hero { display: grid; gap: 18px; padding: 34px; background: #ead8c5; border-radius: 26px; }
.today-hero h1 { max-width: 560px; margin-bottom: 0; }
.stage-pill { color: var(--accent-dark); font-size: 13px; font-weight: 800; }
.meta-row { display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--muted); font-size: 14px; }
.progress-dots { display: flex; gap: 8px; align-items: center; color: var(--accent); font-size: 22px; }
.progress-dots span { line-height: 1; }
.dialogue { padding: 20px; border-left: 4px solid var(--accent); background: #fbf3eb; border-radius: 12px; }
.ko { font-size: clamp(21px, 5vw, 28px); line-height: 1.55; letter-spacing: .01em; }
.task-intent { font-size: 18px; font-weight: 700; line-height: 1.6; }
.word-bank { display: flex; gap: 8px; flex-wrap: wrap; }
.word { color: var(--accent-dark); background: var(--soft); padding: 5px 9px; border-radius: 8px; font-size: 14px; }
.hint-box { background: #f4efe7; border: 1px dashed #c7b9a5; border-radius: 12px; padding: 14px; }
.feedback-box { border-radius: 12px; padding: 16px; background: #edf5ef; }
.feedback-box.neutral { background: #f4efe7; }
.result-line { display: grid; gap: 5px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.result-line:last-child { border-bottom: 0; }
.answer-label { color: var(--muted); font-size: 13px; }
.score-options { display: grid; gap: 10px; }
.score-option { display: flex; gap: 10px; align-items: flex-start; padding: 13px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.score-option:has(input:checked) { border-color: var(--accent); background: #fff5ed; }
.score-option input { width: auto; min-height: auto; margin-top: 4px; }
.hint-card { margin-top: 12px; }
.practice-layout { display: grid; gap: 16px; }
.practice-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.test-lab { max-width: 920px; }
.lab-heading { display: grid; gap: 10px; padding: 8px 0 12px; }
.lab-heading h1 { margin-bottom: 0; }
.lab-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap: 16px; }
.lab-clock { background: #202d34; border-color: #202d34; color: #f8f5ed; }
.lab-clock .stage-pill { color: #f1b18b; }
.lab-clock .muted, .lab-clock .small { color: #b8c4c5; }
.clock-readout { display: grid; gap: 8px; padding: 18px; border: 1px solid rgba(255,255,255,.15); border-radius: 16px; background: rgba(255,255,255,.07); }
.clock-readout strong { font-size: clamp(23px, 4vw, 34px); line-height: 1.2; letter-spacing: -.04em; }
.lab-entry-links { display: grid; gap: 10px; }
.lab-entry-link { display: grid; gap: 5px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; background: #fff; transition: border-color .15s ease, transform .15s ease; }
.lab-entry-link:hover { border-color: var(--accent); transform: translateY(-1px); }
.lab-entry-link strong { color: var(--accent-dark); }
.lab-timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.lab-timeline-item { display: grid; gap: 10px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #faf9f5; }
.lab-timeline-item.current { border-color: var(--accent); background: #fff5ed; }
.lab-timeline-item.locked { opacity: .64; }
.lab-timeline-item strong, .lab-timeline-item .small { display: block; }
.lab-timeline-item p { margin: 7px 0 0; font-size: 13px; line-height: 1.45; }
.lab-marker { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: var(--muted); font-weight: 800; }
.lab-timeline-item.done .lab-marker { background: var(--success); }
.lab-timeline-item.current .lab-marker { background: var(--accent); }
.lab-note { display: flex; gap: 8px; margin: 0; padding: 15px 17px; color: var(--muted); background: #eee9df; border-radius: 14px; line-height: 1.6; }
.lab-note strong { color: var(--ink); white-space: nowrap; }
.skeleton { border-radius: 16px; background: linear-gradient(100deg, #eeeae3 30%, #f7f4ef 45%, #eeeae3 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton-title { height: 45px; width: 60%; }
.skeleton-card { height: 280px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (max-width: 520px) {
  .site-header { min-height: 60px; padding: 12px 18px; }
  .shell { padding: 22px 16px 64px; }
  .auth-card, .panel, .task-card, .result-card { border-radius: 17px; padding: 20px; }
  .today-hero { padding: 24px 20px; border-radius: 20px; }
  .button-row { align-items: stretch; }
  .button-row .button { flex: 1 1 100%; }
}
@media (max-width: 760px) {
  .lab-grid { grid-template-columns: 1fr; }
  .lab-timeline { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .lab-timeline { grid-template-columns: 1fr; }
  .lab-note { display: grid; gap: 3px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; } }
