/* avoid-ai-design-ignore: T7 웹폰트를 번들하지 않고 OS 한글 서체를 쓴다 */
:root {
  --brand: #315b4c;
  --brand-strong: #26483c;
  --brand-wash: #e9efeb;
  --paper: #f7f8f6;
  --ink: #1c2724;
  --muted: #56625d;
  --rule: #d6ddd8;
  --rule-strong: #b8c4bd;
  --danger: #a1322b;
  --danger-wash: #f6e3e1;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0 auto; max-width: 720px; padding: 0 16px 48px; word-break: keep-all; line-height: 1.5; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 20px 0 8px; }
.top h1 { margin: 0; font-size: 1.25rem; }
.summary { margin: 0; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }

.tabs { display: flex; border-bottom: 1px solid var(--rule); margin-bottom: 12px; }
.tabs button { flex: 1; padding: 10px 0; border: 0; background: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--brand); }

.filters { display: grid; gap: 10px; margin-bottom: 16px; }
.letters { display: flex; flex-wrap: wrap; gap: 6px; }
.letters button { min-width: 40px; min-height: 36px; padding: 0 10px; border: 1px solid var(--rule-strong); border-radius: 4px; background: #fff; }
.letters button[aria-pressed="true"] { color: #fff; background: var(--brand); border-color: var(--brand); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
label { display: grid; gap: 4px; font-size: .8125rem; color: var(--muted); }
select, input { min-height: 40px; padding: 6px 10px; border: 1px solid var(--rule-strong); border-radius: 4px; background: #fff; }

.counter { margin: 0 0 8px; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.hint { margin: 8px 0 0; color: var(--muted); font-size: .8125rem; }

.card { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; width: 100%; min-height: 240px; padding: 28px 20px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; text-align: center; }
.card:disabled { cursor: default; color: var(--muted); }
.card-front { font-size: clamp(1.375rem, 5vw, 1.875rem); font-weight: 700; }
.card-back { display: grid; gap: 6px; padding-top: 16px; border-top: 1px solid var(--rule); width: 100%; }
.card-back strong { font-size: 1.25rem; color: var(--brand-strong); }
.card-back small, .phrase-list small { color: var(--muted); }

.actions { display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; margin-top: 12px; }
.actions button, .yes, .no, .ghost { min-height: 48px; padding: 0 16px; border-radius: 4px; border: 1px solid var(--rule-strong); background: #fff; }
.yes { color: #fff; background: var(--brand); border-color: var(--brand); }
.yes:hover { background: var(--brand-strong); }
.no { color: var(--danger); border-color: var(--danger); }
.ghost:hover, .no:hover { background: var(--brand-wash); }
button:disabled { opacity: .5; cursor: default; }
.link { margin-top: 12px; padding: 4px 0; border: 0; background: none; color: var(--brand); text-decoration: underline; }
.link.danger { color: var(--danger); }
.small { min-height: 34px !important; padding: 0 10px !important; font-size: .8125rem; }

.quiz-start { display: flex; align-items: end; gap: 12px; }
.prompt { margin: 8px 0 16px; font-size: clamp(1.25rem, 4.5vw, 1.625rem); font-weight: 700; }
.options { display: grid; gap: 8px; }
.option { display: flex; gap: 12px; align-items: center; min-height: 52px; padding: 10px 14px; text-align: left; border: 1px solid var(--rule-strong); border-radius: 4px; background: #fff; }
.option b { color: var(--muted); font-variant-numeric: tabular-nums; }
.option:not(:disabled):hover { background: var(--brand-wash); }
.option.right { border-color: var(--brand); background: var(--brand-wash); font-weight: 700; opacity: 1; }
.option.wrong { border-color: var(--danger); background: var(--danger-wash); opacity: 1; }
.note { min-height: 1.5em; margin: 12px 0; color: var(--muted); }
#quiz-next { width: 100%; }
.score { font-size: 1.25rem; font-weight: 700; }
h2 { font-size: 1rem; margin: 20px 0 8px; }

.wrong-list, .phrase-list { list-style: none; margin: 0 0 16px; padding: 0; }
.wrong-list li, .phrase-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.wrong-list li { flex-direction: column; gap: 2px; }
.phrase-list li > div:first-child { display: grid; gap: 2px; }
.item-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.search { margin-bottom: 8px; }
.search input { width: 100%; }

@media (max-width: 420px) {
  .actions { grid-template-columns: 1fr 1fr; }
  .actions #card-speak { grid-column: 1 / -1; min-height: 40px; }
  .phrase-list li { flex-direction: column; }
}
@media (prefers-reduced-motion: no-preference) {
  .option, .letters button, .tabs button { transition: background-color .15s ease, border-color .15s ease; }
}
/* display를 지정한 요소에서도 hidden 속성이 이기도록 */
[hidden] { display: none !important; }
.actions .yes { color: #fff; background: var(--brand); border-color: var(--brand); }
.actions .yes:hover { background: var(--brand-strong); }
.actions .no { color: var(--danger); border-color: var(--danger); }
