:root {
  --ink: #1f2937; --muted: #6b7280; --bg: #f5f7f9; --card: #ffffff; --line: #e5e7eb;
  --accent: #0d9488; --accent-soft: #ccfbf1; --ok: #15803d; --ok-soft: #dcfce7; --no: #b91c1c; --no-soft: #fee2e2;
  --guess: #fef3c7; --mine: #fde68a; --mine-line: #d97706;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Pretendard", "Malgun Gothic", system-ui, sans-serif; line-height: 1.6; }
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
h1 { color: var(--accent); font-size: 1.4rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 8px; } h3 { font-size: 1rem; margin: 12px 0 6px; }
small { color: var(--muted); font-weight: normal; font-size: .85rem; }
.muted, #status { color: var(--muted); }
.error { color: var(--no); }
button { font: inherit; cursor: pointer; }
button.primary { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; margin-top: 8px; }
button.primary:disabled { background: #9ca3af; cursor: default; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.top .who { color: var(--muted); font-size: .9rem; }
.top nav { margin-left: auto; display: flex; gap: 4px; }
.top nav button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; }
.top nav button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.stepbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 10px; }
.stepbar .badge { padding: 3px 10px; border-radius: 999px; font-weight: bold; font-size: .9rem; background: var(--accent-soft); color: var(--accent); }
.step-easier .badge { background: #e0e7ff; color: #3730a3; }
.step-check .badge { background: #fce7f3; color: #9d174d; }
.stepbar .lv { color: var(--muted); font-size: .9rem; }
.reason { width: 100%; margin: 4px 0 0; color: var(--ink); }

.ptitle { color: var(--muted); font-size: .95rem; font-weight: normal; }
.passage { font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; line-height: 1.85; }
.passage .w { cursor: pointer; border-radius: 3px; }
.passage .w:hover { background: #f3f4f6; }
.passage .guess { background: var(--guess); }
.passage .mine { background: var(--mine); box-shadow: inset 0 -2px 0 var(--mine-line); }
.passage .blank { letter-spacing: 1px; font-weight: bold; }
.hint { color: var(--muted); font-size: .85rem; margin: 10px 0 0; }
.wordinfo { margin: 4px 0 0; min-height: 1.4em; }
.source { color: var(--muted); font-size: .8rem; margin: 4px 0 0; }

.guessbox ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.guessbox li { background: var(--guess); border-radius: 8px; padding: 4px 8px; }
.guessbox li button { margin-left: 4px; border: 1px solid #d1d5db; background: #fff; border-radius: 6px; padding: 0 6px; font-size: .85rem; }
.guessbox li.known { background: #f3f4f6; color: var(--muted); text-decoration: line-through; }

.stem { font-weight: bold; margin: 0 0 8px; }
.choices { list-style: none; padding: 0; margin: 0; }
.choices button { width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; color: var(--ink); }
.choices button .num { color: var(--accent); font-weight: bold; margin-right: 4px; }
.choices button.picked { border-color: var(--accent); background: var(--accent-soft); }
.choices button.right { border-color: var(--ok); background: var(--ok-soft); }
.choices button.wrong { border-color: var(--no); background: var(--no-soft); }
.choices button:disabled { cursor: default; color: var(--ink); }

.verdict { margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-weight: bold; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; }
.verdict.ok { background: var(--ok-soft); color: var(--ok); }
.verdict.no { background: var(--no-soft); color: var(--no); }
.verdict .delta { font-weight: normal; color: var(--ink); font-size: .9rem; }
.explain { margin-top: 10px; border-left: 3px solid var(--accent); padding-left: 12px; }
.explain h3 { margin-top: 0; }
.mk-v { border: 1.5px solid var(--ink); border-radius: 10px; padding: 0 4px; font-weight: bold; }
.mk-core { text-decoration-thickness: 2px; text-underline-offset: 3px; }
.legend { color: var(--muted); font-size: .8rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 8px 0; }
.stats div { background: var(--bg); border-radius: 8px; padding: 10px; text-align: center; color: var(--muted); font-size: .85rem; }
.stats span { display: block; color: var(--ink); font-size: 1.3rem; font-weight: bold; }
table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.list th, table.list td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.list th { color: var(--muted); font-weight: normal; }

/* 단어 체크 */
.checkbox ul { list-style: none; padding: 0; margin: 0; }
.checkbox li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.checkbox li:last-child { border-bottom: 0; }
.checkbox li > b { min-width: 110px; font-family: Georgia, serif; font-size: 1.05rem; }
.checkbox .act button { border: 1px solid #d1d5db; background: #fff; border-radius: 6px; padding: 2px 10px; margin-right: 4px; }
.checkbox .act button[data-a="u"] { border-color: var(--mine-line); }
.checkbox li.known .res { color: var(--ok); }
.checkbox li.unknown { background: var(--guess); border-radius: 6px; padding-left: 6px; }

/* 수능형 지문 모양 */
.given { border: 1.5px solid var(--ink); border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; }
.passage .part { margin: 8px 0 0; }
.passage .summary { margin-top: 12px; border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 8px 10px; }
.passage .summary .arrow { display: block; text-align: center; color: var(--muted); }
.passage .ab { padding: 0 6px; border-bottom: 2px solid var(--ink); }
.passage u.gram { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.passage u.gram > b { font-family: system-ui, sans-serif; font-weight: normal; margin-right: 1px; }
.passage .slot { color: var(--accent); font-family: system-ui, sans-serif; white-space: nowrap; }
.passage p { margin: 0; }
.checkbox .note { margin: 0 0 6px; color: #9a3412; font-size: .9rem; }
.checkbox.strict { border-color: #fdba74; }
.checkbox .act button[data-pick] { margin: 2px 4px 2px 0; }

/* 선생님 검토 */
.st { font-size: .75rem; padding: 1px 8px; border-radius: 999px; font-weight: normal; vertical-align: middle; }
.st-draft { background: #fef3c7; color: #92400e; } .st-approved { background: var(--ok-soft); color: var(--ok); } .st-retired { background: #f3f4f6; color: var(--muted); }
.tlist tbody tr { cursor: pointer; } .tlist tbody tr:hover { background: var(--bg); }
.upload input { margin-left: 6px; }
button.back, .iact button, #savep, .bulk button:not(.primary), .logout { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 12px; }
.iact button.primary, .bulk .primary { margin-top: 0; padding: 6px 14px; background: var(--accent); border-color: var(--accent); color: #fff; }
.iact button.primary:disabled, .bulk .primary:disabled { background: #9ca3af; border-color: #9ca3af; }
.logout { padding: 2px 10px; font-size: .85rem; }
.bulk { margin: 0 0 12px; }
.pform { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 6px 10px; margin-bottom: 8px; }
.pform label, .iedit label { display: block; font-size: .85rem; color: var(--muted); }
.pform input, .pform select, .iedit input:not([type=radio]), .iedit textarea, table.words input { width: 100%; font: inherit; color: var(--ink); padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
.tbody { font-family: Georgia, serif; background: var(--bg); padding: 8px 10px; border-radius: 6px; }
.problems { color: var(--no); margin: 6px 0; padding-left: 18px; font-size: .9rem; }
.item .ihead { margin-bottom: 6px; }
.passage.small { font-size: .95rem; line-height: 1.7; margin: 6px 0; }
.tchoices { list-style: none; padding: 0; margin: 0 0 8px; } .tchoices li { padding: 2px 0; } .tchoices li.ans { color: var(--ok); font-weight: bold; }
.iact { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.iedit { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.iedit label { margin-bottom: 6px; } .iedit .ch { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.checkbox li .act { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 260px; }
.checkbox .act button[data-pick] { margin: 0; }
