:root {
  color-scheme: light;
  --paper: #f7f8f2;
  --surface: #fff;
  --ink: #21271d;
  --muted: #505a4a;
  --line: #d8ded2;
  --accent: #37633a;
  --accent-light: #eaf1e6;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.55; }
button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
button:not(:disabled):hover { background: var(--accent-light); }
p, h1, h2, ol { margin: 0; }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-size: 1.625rem; font-weight: 850; letter-spacing: -.07em; }
.brand span { color: var(--accent); }
.event, .section-head span, .footer { color: var(--muted); font-size: .875rem; }
.intro { margin-block: 32px 22px; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; line-height: 1.18; letter-spacing: -.055em; }
.intro p { color: var(--muted); margin-top: 10px; }
.modes { display: flex; gap: 14px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.modes button { background: transparent; border: 0; border-bottom: 3px solid transparent; padding: 10px 18px; font-weight: 700; min-width: 80px; }
.modes button[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.camera, .results { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.camera > .section-head { padding: 12px 16px; }
h2 { font-size: 1rem; font-weight: 750; }
.viewfinder { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; color: #f4f6ed; background: #212920; }
.viewfinder video { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: contain; transform: scaleX(-1); }
.frame { position: absolute; inset: 17% 23%; pointer-events: none; }
.frame i { position: absolute; width: 20px; height: 20px; border: solid #d5e8bf; border-width: 2px 0 0 2px; }
.frame i:nth-child(1) { top: 0; left: 0; }
.frame i:nth-child(2) { top: 0; right: 0; rotate: 90deg; }
.frame i:nth-child(3) { bottom: 0; right: 0; rotate: 180deg; }
.frame i:nth-child(4) { bottom: 0; left: 0; rotate: 270deg; }
.camera-empty { z-index: 1; text-align: center; width: 90%; padding: 12px; }
.camera-empty p { margin-bottom: 14px; }
.actions button, .camera-help button, .primary { border: 1px solid var(--line); background: var(--surface); padding: 8px 11px; border-radius: 7px; min-height: 42px; font-size: .875rem; font-weight: 650; }
.primary { background: #d5e8bf; border-color: #d5e8bf; color: #212920; padding-inline: 16px; }
.camera-help { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; min-height: 66px; }
.camera-help p, .hint { font-size: .9rem; color: var(--muted); }
.camera-help button { flex: none; }
.work-panel, .candidate-panel { padding: 17px 18px; }
.hint { margin-block: 6px 12px; }
.transcript { display: block; min-height: 68px; background: var(--accent-light); color: var(--ink); border-radius: 6px; padding: 9px 13px; font-size: 1.85rem; font-weight: 750; overflow-wrap: anywhere; white-space: pre-wrap; }
.jamo { color: var(--muted); font-size: .875rem; margin: 7px 0 13px; overflow-wrap: anywhere; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.edit-status { color: var(--accent); font-size: .875rem; margin-top: 5px; }
.edit-status:empty { display: none; }
.candidate-panel { border-top: 1px solid var(--line); }
.candidates { list-style: none; padding: 0; margin-top: 8px; }
.candidates li { display: grid; grid-template-columns: 24px 40px minmax(32px, 1fr) 48px; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.candidates li:last-child { border-bottom: 0; }
.rank, .percent { color: var(--muted); font-size: .875rem; }
.percent { text-align: right; font-variant-numeric: tabular-nums; }
.candidate-letter { font-weight: 750; font-size: 1.125rem; }
meter { width: 100%; height: 8px; appearance: none; border: 0; background: #edf0e8; border-radius: 3px; }
meter::-webkit-meter-bar { background: #edf0e8; border: 0; border-radius: 3px; }
meter::-webkit-meter-optimum-value { background: var(--accent); }
meter::-moz-meter-bar { background: var(--accent); }
.practice-word { font-size: 2rem; font-weight: 750; margin-block: 8px; }
.practice-steps { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; padding: 0; }
.practice-steps li { min-width: 36px; padding: 5px 6px; text-align: center; border: 1px solid var(--line); border-radius: 5px; font-weight: 700; }
.practice-steps li[aria-current="step"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.practice-steps li.done { background: var(--accent-light); color: var(--accent); }
.footer { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin-top: 24px; padding-block: 14px 22px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: 3px; }
@media (max-width: 760px) {
  .wrap { width: calc(100% - 28px); }
  .workspace { grid-template-columns: 1fr; gap: 16px; }
  .intro { margin-top: 24px; }
  .viewfinder { aspect-ratio: 4 / 3; max-height: 48vh; }
}
.intro p, .hint, .camera-help p { word-break: keep-all; overflow-wrap: anywhere; }
