:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-2: #f0ece2;
  --line: #ddd6c6;
  --text: #2a2620;
  --muted: #7a7265;
  --accent: #8b2e1f;
  --accent-soft: #f3e1d9;
  --chalk-bg: #24463a;
  --chalk-text: #f3f1e7;
  --chalk-line: rgba(243, 241, 231, .25);
  --chalk-blue: #7fb8ff;
  --chalk-yellow: #ffe27a;
  --chalk-green: #a8e07a;
  --chalk-memo: #ffd0a8;
  --shadow: 0 2px 10px rgba(40, 30, 10, .08);
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1916; --surface: #23221e; --surface-2: #2c2a25; --line: #3b3832;
    --text: #ece7dc; --muted: #a39c8e; --accent: #e08b6f; --accent-soft: #3d2a23;
    --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Noto Sans KR', system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 1.6;
  display: flex; flex-direction: column;
}
button { font: inherit; color: inherit; cursor: pointer; }

/* ── 상단 ─────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: relative; z-index: 1100;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  background: var(--accent); color: #fff; border-radius: 8px; font-weight: 900; font-size: 20px;
}
.brand h1 { margin: 0; font-size: 18px; font-weight: 900; letter-spacing: -.02em; }
.brand-sub { margin: 0; font-size: 12px; color: var(--muted); }

.search { position: relative; width: min(360px, 45vw); }
.search input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px;
  list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); max-height: 60vh; overflow: auto;
}
.search-results li { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.search-results li:hover, .search-results li.active { background: var(--accent-soft); }
.search-results .sr-era { font-size: 11px; color: var(--muted); display: block; }
.search-results .sr-empty { color: var(--muted); cursor: default; }

/* ── 레이아웃 ─────────────────────────── */
.layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 440px; min-height: 0; }
/* 화면 배치: map(지도 크게) · split(반반, 기본) · panel(노트 크게) */
body[data-layout="split"] .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
body[data-layout="panel"] .layout { grid-template-columns: minmax(0, 1fr); }
body[data-layout="panel"] .map-wrap { display: none; }
body[data-layout="panel"] .panel { border-left: 0; }
body[data-layout="panel"] .tab-body { padding-left: max(20px, calc((100% - 1100px) / 2)); padding-right: max(20px, calc((100% - 1100px) / 2)); }
body[data-layout="panel"] .chalk { font-size: 15.5px; }

.era-head { display: flex; align-items: center; gap: 12px; }
.era-title { flex: 1; min-width: 0; }
body[data-layout="panel"] .era-head { padding-left: max(20px, calc((100% - 1100px) / 2)); padding-right: max(20px, calc((100% - 1100px) / 2)); }
.layout-switch { margin-left: auto; align-self: center; display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.layout-switch button { border: 0; background: transparent; width: 30px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); }
.layout-switch button:hover { color: var(--text); }
.layout-switch button[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.ls-ic { width: 16px; height: 12px; border: 1.5px solid currentColor; border-radius: 2px; position: relative; display: block; }
.ls-ic::after { content: ''; position: absolute; top: 0; bottom: 0; background: currentColor; }
.ls-map::after { right: 0; width: 4px; }
.ls-split::after { right: 0; width: 50%; opacity: .55; }
.ls-panel::after { left: 0; right: 0; opacity: .55; }
.map-wrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: #b9d3e0; }
.panel {
  background: var(--surface); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
}

/* ── 지도 도구 ─────────────────────────── */
.map-tools { position: absolute; top: 12px; right: 12px; z-index: 900; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; box-shadow: var(--shadow);
  display: inline-flex; align-items: center; gap: 6px; user-select: none;
}
.chip.toggle { cursor: pointer; }
.chip input { accent-color: var(--accent); margin: 0; }

.legend {
  position: absolute; left: 12px; bottom: 24px; z-index: 900;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 10px; font-size: 12.5px; box-shadow: var(--shadow);
  max-width: 220px;
}
.legend:empty { display: none; }
.legend-toggle { border: 0; background: none; padding: 0; font-weight: 700; font-size: 12.5px; display: flex; gap: 6px; width: 100%; justify-content: space-between; }
.legend-body { margin-top: 4px; max-height: 42vh; overflow-y: auto; }
.legend.collapsed .legend-body { display: none; }
.legend-row { display: flex; align-items: center; gap: 7px; line-height: 1.9; }
.legend-sw { width: 14px; height: 14px; border-radius: 3px; flex: none; }
.legend-sw.dashed { background: transparent !important; border: 2px dashed; }
.legend-sep { border-top: 1px solid var(--line); margin: 5px 0; }
.mk-legend { display: inline-block; vertical-align: middle; }

/* ── 타임라인 ─────────────────────────── */
.timeline {
  position: relative; z-index: 1000; flex: none;
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 6px 12px;
}
.timeline ol {
  flex: 1; display: flex; gap: 4px; margin: 0; padding: 2px; list-style: none;
  overflow-x: auto; scrollbar-width: thin; scroll-behavior: smooth;
}
.timeline li button {
  white-space: nowrap; border: 0; background: transparent; border-radius: 9px;
  padding: 6px 11px; font-size: 13px; line-height: 1.3; text-align: left;
}
.timeline li button small { display: block; font-size: 10.5px; color: var(--muted); }
.timeline li button:hover { background: var(--surface-2); }
.timeline li button.active { background: var(--accent); color: #fff; }
.timeline li button.active small { color: rgba(255, 255, 255, .8); }
.timeline li button .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--chalk-green); margin-left: 4px; vertical-align: middle; }
.nav-btn {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); font-size: 20px; line-height: 1;
}
.nav-btn:hover { background: var(--surface-2); }

/* ── 오른쪽 패널 ─────────────────────────── */
.era-head { padding: 16px 20px 6px; }
.era-period { margin: 0; font-size: 12.5px; color: var(--accent); font-weight: 700; }
.era-head h2 { margin: 2px 0 0; font-size: 22px; font-weight: 900; letter-spacing: -.02em; }
.tabs { display: flex; gap: 4px; padding: 8px 20px 0; border-bottom: 1px solid var(--line); }
.tab {
  border: 0; background: transparent; padding: 8px 12px; font-weight: 700; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; background: var(--surface-2); color: var(--muted); text-align: center; }
.badge:empty { display: none; }
.tab-body { flex: 1; overflow-y: auto; padding: 16px 20px 32px; min-width: 0; }

.summary { margin: 0 0 14px; }
.section-title { font-size: 13px; font-weight: 900; color: var(--muted); margin: 18px 0 8px; letter-spacing: .02em; }
.points { margin: 0; padding: 0; list-style: none; }
.points li {
  position: relative; padding: 7px 10px 7px 26px; margin-bottom: 5px;
  background: var(--surface-2); border-radius: 8px; font-size: 14px;
}
.points li::before { content: '★'; position: absolute; left: 8px; top: 7px; color: var(--accent); font-size: 12px; }

.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li {
  display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: start;
  padding: 7px 6px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.event-list li:hover, .event-list li.active { background: var(--accent-soft); }
.event-list .ev-name { font-weight: 700; }
.event-list .ev-desc { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.event-list .ev-year { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ── 마커 ─────────────────────────── */
.mk { display: grid; place-items: center; font-size: 11px; line-height: 1; color: #fff; font-weight: 900; box-shadow: 0 1px 3px rgba(0,0,0,.45); }
.mk-capital { width: 18px; height: 18px; border-radius: 50%; background: #fff; color: #b8860b; border: 2px solid #b8860b; font-size: 12px; }
.mk-battle { width: 16px; height: 16px; background: #c62828; transform: rotate(45deg); border: 2px solid #fff; }
.mk-battle span { transform: rotate(-45deg); }
.mk-site { width: 14px; height: 14px; border-radius: 50%; background: #7a4b2a; border: 2px solid #fff; }
.mk-monument { width: 13px; height: 16px; border-radius: 3px 3px 1px 1px; background: #455a64; border: 2px solid #fff; }
.mk-event { width: 14px; height: 14px; border-radius: 50%; background: #1f6fb2; border: 2px solid #fff; }
.mk.pulse { animation: pulse 1s ease-out 3; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(198, 40, 40, .7); } 100% { box-shadow: 0 0 0 16px rgba(198, 40, 40, 0); } }

.leaflet-tooltip.mk-label {
  background: rgba(255, 255, 255, .92); border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  padding: 1px 6px; font-size: 12px; font-weight: 700; color: #222; font-family: 'Noto Sans KR', sans-serif;
}
.leaflet-tooltip.mk-label::before { display: none; }
.leaflet-tooltip.mk-label { border: 1.5px solid #8a8a8a; border-radius: 999px; padding: 1px 8px; }

/* 콜아웃 이름표 + 연결선 */
.callouts { position: absolute; inset: 0; z-index: 650; pointer-events: none; }
.callouts.zooming { visibility: hidden; }
.callouts.dim { opacity: .12; pointer-events: none; }
.callouts.dim .callout { pointer-events: none; }
.callout-lines { position: absolute; left: 0; top: 0; overflow: visible; }
.callout-lines line { stroke: rgba(40, 40, 40, .75); stroke-width: 1.2; }
.callout-lines line.strong { stroke: #c62828; stroke-width: 1.6; }
.callout {
  position: absolute; pointer-events: auto; cursor: pointer; white-space: nowrap;
  background: rgba(255, 255, 255, .95); color: #222; border: 1.5px solid #8a8a8a; border-radius: 999px;
  padding: 1px 8px; font-size: 12px; font-weight: 700; line-height: 1.5; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  font-family: 'Noto Sans KR', sans-serif;
}
.callout.battle { border-color: #c62828; }
.callout.capital { border-color: #b8860b; }
.callout.major { border: 2px solid #c62828; font-size: 13.5px; font-weight: 900; padding: 2px 10px; }
.callout.hover { background: #fff3c4; z-index: 1; }
.terr-label {
  font-family: 'Noto Sans KR', sans-serif; font-weight: 900; font-size: 17px; white-space: nowrap;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px #fff; transform: translate(-50%, -50%); pointer-events: none;
}
.terr-label.small { font-size: 12.5px; font-weight: 700; }
.river-label {
  font-family: 'Noto Sans KR', sans-serif; font-style: italic; font-size: 11.5px; color: #1d5a86; white-space: nowrap;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff; transform: translate(-50%, -50%); pointer-events: none;
}
.line-label {
  font-family: 'Noto Sans KR', sans-serif; font-size: 11px; font-weight: 700; white-space: nowrap;
  background: rgba(255,255,255,.85); padding: 0 4px; border-radius: 3px; transform: translate(-50%, -50%); pointer-events: none;
}
.arrow-head { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 14px solid currentColor; transform-origin: 50% 50%; }
.leaflet-popup-content { font-family: 'Noto Sans KR', sans-serif; font-size: 13.5px; line-height: 1.55; margin: 10px 14px; }
.pop-title { font-weight: 900; font-size: 15px; }
.pop-img { display: block; width: 250px; height: 150px; object-fit: cover; border-radius: 6px; margin-top: 8px; cursor: zoom-in; }
.pop-year { color: #8b2e1f; font-weight: 700; font-size: 12.5px; }
.pop-tag { display: inline-block; font-size: 11px; background: #eee; border-radius: 4px; padding: 0 5px; margin-left: 4px; color: #555; }

/* ── 판서 노트 (칠판 표) ─────────────────────────── */
.note-card { margin-bottom: 22px; }
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.note-head h3 { margin: 0; font-size: 16px; font-weight: 900; }
.note-actions { display: flex; gap: 6px; }
.note-actions button {
  font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
}
.note-actions button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }

.chalk {
  width: 100%; border-collapse: collapse; background: var(--chalk-bg); color: var(--chalk-text);
  font-size: 14.5px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.chalk table.mini { border-collapse: collapse; margin: 4px 0; }
.chalk table.mini th, .chalk table.mini td { border: 1px solid var(--chalk-line); padding: 5px 12px; text-align: center; min-width: 0; font-weight: 400; }
.chalk table.mini th { color: var(--chalk-yellow); }
.chalk-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.chalk-wrap .chalk { box-shadow: none; }
.chalk td { min-width: 118px; }
.chalk th, .chalk td { border: 1px solid var(--chalk-line); padding: 9px 11px; vertical-align: top; text-align: left; }
.chalk thead th { font-weight: 700; }
.chalk thead td { font-weight: 700; font-size: 15.5px; text-align: center; }
.chalk thead tr:last-child td { color: var(--chalk-yellow); font-size: 16px; }
.chalk th.row-label {
  width: 64px; text-align: center; vertical-align: middle;
  font-size: 14px; font-weight: 700; background: rgba(0, 0, 0, .12);
}
.chalk th.row-label span { white-space: nowrap; }
.chalk td .ln { display: block; }
.chalk td .ln + .ln { margin-top: 4px; }
.chalk u { text-decoration: none; border-bottom: 3px solid var(--chalk-blue); }
.chalk i { font-style: normal; text-decoration: underline wavy var(--chalk-blue); text-underline-offset: 4px; }
.chalk b { color: var(--chalk-yellow); }
.chalk em { font-style: normal; color: var(--chalk-green); }
.chalk .memo { display: inline; font-size: 13px; color: var(--chalk-memo); }
.chalk a.place { color: inherit; text-decoration: none; border-bottom: 1px dotted rgba(255,255,255,.6); cursor: pointer; }
.chalk a.place:hover { color: var(--chalk-yellow); }
.chalk a.place::after { content: '📍'; font-size: 10px; margin-left: 1px; vertical-align: super; opacity: .75; }

/* 암기 모드: 내용 가리기 */
.chalk.quiz thead tr:last-child td { pointer-events: none; }
.chalk.quiz td { position: relative; cursor: pointer; }
.chalk.quiz tr:not(:last-child) td:not(.revealed) > *, .chalk.quiz tbody tr:last-child td:not(.revealed) > * { filter: blur(7px); opacity: .5; pointer-events: none; }
.chalk.quiz tr:not(:last-child) td:not(.revealed)::after, .chalk.quiz tbody tr:last-child td:not(.revealed)::after {
  content: '탭해서 보기'; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 12px; color: var(--chalk-yellow);
}

.note-img { margin-top: 10px; }
.note-img img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); cursor: zoom-in; display: block; }

.empty-notes {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px 18px; text-align: center; color: var(--muted); font-size: 14px;
}
.empty-notes strong { color: var(--text); display: block; margin-bottom: 4px; }

.lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(0, 0, 0, .85); display: grid; place-items: center; cursor: zoom-out; padding: 16px; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 100%; max-height: 100%; }
.lb-imgs { display: flex; gap: 12px; justify-content: center; align-items: center; max-width: 100%; }
.lightbox img { max-width: calc((100vw - 32px - (var(--n, 1) - 1) * 12px) / var(--n, 1)); max-height: calc(100vh - 90px); border-radius: 6px; object-fit: contain; }
.lightbox figcaption { color: #fff; font-size: 15px; text-align: center; }
.lightbox figcaption:empty { display: none; }
.lightbox .lb-missing { display: none; color: #fff; font-size: 15px; margin: 0; padding: 40px 24px; border: 2px dashed rgba(255,255,255,.4); border-radius: 10px; }
.lightbox.missing img { display: none; }
.lightbox.missing .lb-missing { display: block; }
a.artifact { color: inherit; cursor: zoom-in; text-decoration: underline dotted; text-underline-offset: 3px; }
a.artifact::after { content: '🔍'; font-size: 10px; margin-left: 1px; vertical-align: super; opacity: .8; }
a.artifact:hover { color: var(--chalk-yellow); }
.panel a.artifact:hover { color: var(--accent); }
.chalk a.artifact:hover { color: var(--chalk-yellow); }
.lightbox[hidden] { display: none; }

/* ── 모바일 ─────────────────────────── */
@media (max-width: 900px) {
  body { height: auto; min-height: 100%; }
  .layout, body[data-layout] .layout { grid-template-columns: minmax(0, 1fr); }
  .map-wrap { height: 62vh; min-height: 380px; }
  body[data-layout="split"] .map-wrap { height: 42vh; min-height: 300px; }
  body[data-layout="panel"] .tab-body { padding-left: 16px; padding-right: 16px; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .tab-body { overflow: visible; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  .search { width: 100%; }
  .brand-sub { display: none; }
  .legend { bottom: 20px; font-size: 11.5px; padding: 6px 8px; }
  .timeline { position: sticky; top: 0; padding: 6px 8px; }
  .era-head, .tabs, .tab-body { padding-left: 16px; padding-right: 16px; }
  .chalk { font-size: 13.5px; }
  .chalk th, .chalk td { padding: 7px 8px; }
  .chalk th.row-label { width: 50px; font-size: 13px; }
}

/* ── 왕·대통령 ─────────────────────────── */
.stepper {
  position: sticky; top: -16px; z-index: 5; margin: -16px -20px 12px; padding: 10px 20px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.stepper button {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 5px 10px; font-size: 13px; white-space: nowrap;
}
.stepper button:disabled { opacity: .4; cursor: default; }
.stepper .step-now { flex: 1; min-width: 0; text-align: center; font-size: 13px; line-height: 1.35; }
.stepper .step-now b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper .step-now small { color: var(--muted); }
.ruler-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; align-items: center; }
.ruler-tools button {
  font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
}
.ruler-tools button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.ruler-tools .spacer { flex: 1; }
.ruler-list { list-style: none; margin: 0; padding: 0; position: relative; }
.ruler-list::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.ruler { position: relative; padding-left: 26px; margin-bottom: 10px; }
.ruler::before {
  content: ''; position: absolute; left: 1px; top: 14px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--c, #888);
}
.ruler-card {
  border: 1px solid var(--line); border-left: 4px solid var(--c, #888); border-radius: var(--radius);
  padding: 10px 12px; background: var(--surface); cursor: pointer; transition: box-shadow .15s, background .15s;
}
.ruler.current .ruler-card { background: var(--accent-soft); box-shadow: var(--shadow); }
.ruler.current::before { background: var(--c, #888); }
.ruler-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ruler-state { font-size: 11px; font-weight: 700; color: #fff; background: var(--c, #888); border-radius: 4px; padding: 1px 6px; }
.ruler-name { font-weight: 900; font-size: 16px; }
.ruler-reign { font-size: 12px; color: var(--muted); margin-left: auto; }
.ruler-key { font-size: 13px; color: var(--accent); font-weight: 700; margin-top: 2px; }
.ruler-items { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; }
.ruler-items li { margin: 2px 0; }
.ruler-items b { color: var(--accent); }
.ruler-items a.place { color: inherit; border-bottom: 1px dotted var(--muted); cursor: pointer; text-decoration: none; }
.ruler-items a.place:hover { color: var(--accent); }
.ruler-list.quiz .ruler:not(.revealed) .ruler-items { filter: blur(6px); opacity: .5; pointer-events: none; user-select: none; }
.ruler-list.quiz .ruler:not(.revealed) .ruler-card::after { content: '눌러서 정책 보기'; display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
@media (max-width: 900px) {
  .stepper { position: static; margin: -16px -16px 12px; padding: 10px 16px; }
}

/* ── 판서 그래프 (흥망 곡선) ─────────────────────────── */
.curve-wrap { overflow-x: auto; border-radius: var(--radius); background: var(--chalk-bg); box-shadow: var(--shadow); }
.curve { display: block; width: 100%; min-width: 860px; height: auto; font-family: 'Noto Sans KR', sans-serif; }
.curve .axis { stroke: var(--chalk-text); stroke-width: 2; }
.curve .tick { fill: var(--chalk-text); font-size: 15px; }
.curve .tick-circle { fill: none; stroke: var(--chalk-text); stroke-width: 1.5; }
.curve .cap { stroke: var(--chalk-text); stroke-width: 1.5; }
.curve .cap-label { fill: var(--chalk-text); font-size: 15px; paint-order: stroke; stroke: var(--chalk-bg); stroke-width: 8px; }
.curve .curve-line { fill: none; stroke: var(--chalk-blue); stroke-width: 5; stroke-linecap: round; }
.curve .lead { stroke: var(--chalk-text); stroke-width: 1.3; opacity: .85; }
.curve .dot { fill: var(--chalk-text); }
.curve .arrow { stroke: var(--chalk-text); stroke-width: 1.8; }
.curve .ah { fill: var(--chalk-text); }
.curve .clabel { fill: var(--chalk-text); font-size: 15px; }
.curve .clabel.green, .curve .arrow.green { fill: var(--chalk-green); stroke: var(--chalk-green); }
.curve .clabel.green { stroke: none; }
.curve .clabel.orange { fill: var(--chalk-memo); }
.curve .arrow.orange { stroke: var(--chalk-memo); }
.curve .clabel.small { font-size: 13px; }
.cbox {
  position: relative; box-sizing: border-box; height: calc(100% - 10px); margin-top: 10px;
  border: 1.5px solid var(--chalk-text); padding: 12px 10px 6px; color: var(--chalk-text);
  font-size: 14.5px; line-height: 1.5; font-family: 'Noto Sans KR', sans-serif;
}
.cbox-title {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--chalk-bg); padding: 0 8px; font-weight: 700; font-size: 15px; line-height: 20px;
}
.cbox .ln { display: block; }
.cbox u { text-decoration: none; border-bottom: 3px solid var(--chalk-blue); }
.cbox i { font-style: normal; text-decoration: underline wavy var(--chalk-blue); text-underline-offset: 4px; }
.cbox b { color: var(--chalk-yellow); }
.cbox em { font-style: normal; color: var(--chalk-green); }
.cbox .memo { color: var(--chalk-memo); font-size: 13px; }
.cbox a.place { color: inherit; text-decoration: none; border-bottom: 1px dotted rgba(255,255,255,.6); cursor: pointer; }
.cbox a.place:hover { color: var(--chalk-yellow); }
.curve.quiz .cbox { cursor: pointer; }
.curve.quiz .cbox:not(.revealed) .cbox-body { filter: blur(6px); opacity: .5; pointer-events: none; }
.curve.quiz .clabel:not(.revealed) { filter: blur(4px); cursor: pointer; }
.sub-title { font-size: 14px; font-weight: 900; margin: 14px 0 6px; }
.curve-close { display: none; }
.note-card.expanded .curve-wrap {
  position: fixed; inset: 0; z-index: 2600; border-radius: 0; overflow: auto; padding: 48px 16px 16px;
}
.note-card.expanded .curve { min-width: 1100px; max-width: 1500px; margin: 0 auto; }
.note-card.expanded .curve-close {
  display: block; position: fixed; top: 10px; right: 16px; z-index: 2601; border: 1px solid var(--chalk-line);
  background: rgba(0,0,0,.3); color: var(--chalk-text); border-radius: 999px; padding: 5px 14px; font-size: 13px;
}
body.no-scroll { overflow: hidden; }

.note-caption { margin: 0 0 8px; font-size: 14px; }
.note-caption .ln { display: inline; }
.curve .arrow.blue { stroke: var(--chalk-blue); stroke-width: 5; }

/* ── 검색 하이라이트 ─────────────────────────── */
.search-results mark { background: #ffe066; color: #1a1a1a; border-radius: 3px; padding: 0 1px; font-weight: 700; }
.search-results .sr-snip { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
mark.hl { background: #ffe066; color: #1a1a1a; border-radius: 3px; padding: 0 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.chalk mark.hl, .cbox mark.hl { background: #ffe066; color: #1a1a1a; }
mark.hl.hl-first { animation: hl-pulse 1.1s ease-out 3; }
@keyframes hl-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 196, 0, .9); } 100% { box-shadow: 0 0 0 10px rgba(255, 196, 0, 0); } }
.hl-row { outline: 3px solid #ffc400; outline-offset: -3px; }
.ruler.hl-row .ruler-card, li.hl-row { outline: 3px solid #ffc400; outline-offset: 1px; border-radius: 8px; }
.callout.hl { background: #ffe066; border-color: #e0a800; z-index: 2; box-shadow: 0 0 0 3px rgba(255, 196, 0, .45); }
.search { display: flex; flex-direction: column; }
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); z-index: 2;
  border: 0; background: #ffe066; color: #1a1a1a; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 3px 8px;
}
.search-clear[hidden] { display: none; }

/* ── 기출 시험 포인트 ─────────────────────────── */
.gichul-top { margin: -2px 0 8px; font-size: 13px; color: var(--muted); }
.points.gichul li::before { content: none; }
.points.gichul li { padding-left: 50px; }
.points.gichul .freq { position: absolute; left: 10px; top: 9px; font-size: 11px; color: var(--accent); letter-spacing: -1px; }
.points.gichul li.f3 { background: var(--accent-soft); }
.points.gichul b { color: var(--accent); }
.gichul-legend { font-size: 11.5px; color: var(--muted); margin: 4px 0 0; }
.old-points summary { cursor: pointer; list-style: revert; }
.old-points summary::marker { color: var(--muted); }

/* ── 동시대 연표 ─────────────────────────── */
.sync {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 910;
  background: color-mix(in srgb, var(--surface) 95%, transparent); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 8px 12px 6px; font-size: 12px;
}
.sync[hidden] { display: none; }
.sync-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.sync-head b { font-size: 13px; }
.sync-read { flex: 1; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-read b { color: var(--text); }
.sync-read em { font-style: normal; color: #c62828; font-weight: 700; }
.sync-x { border: 0; background: none; color: var(--muted); font-size: 13px; }
.sync-body { position: relative; }
.sync-lane { display: flex; align-items: stretch; height: 22px; }
.sync-lane .sync-name { align-self: center; }
.sync-lane.ev { height: 44px; }
.sync-lane + .sync-lane { margin-top: 3px; }
.sync-name { width: 52px; flex: none; font-weight: 900; font-size: 11px; line-height: 1.2; word-break: keep-all; }
.sync-track { position: relative; flex: 1; height: 100%; border-radius: 4px; background: var(--surface-2); }
.sync-lane.axis .sync-track { background: none; height: 14px; }
.sync-king {
  position: absolute; border: 0; border-radius: 4px; padding: 0 4px; overflow: hidden;
  background: color-mix(in srgb, var(--c) 30%, var(--surface)); border-left: 2px solid var(--c);
  font-size: 10.5px; font-weight: 700; color: var(--text); text-align: left; white-space: nowrap; cursor: pointer;
}
.sync-king:hover { background: color-mix(in srgb, var(--c) 55%, var(--surface)); z-index: 2; overflow: visible; }
.sync-king span { pointer-events: none; }
.sync-ev { position: absolute; top: 5px; width: 10px; height: 10px; margin-left: -5px; border: 2px solid #fff; border-radius: 50%; background: #1f6fb2; padding: 0; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.sync-ev.battle { background: #c62828; transform: rotate(45deg); border-radius: 1px; }
.sync-ev.capital { background: #b8860b; }
.sync-ev:hover { transform: scale(1.4); z-index: 2; }
.sync-ev.battle:hover { transform: rotate(45deg) scale(1.4); }
.sync-tick { position: absolute; top: 0; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.sync-cursor { position: absolute; top: 0; bottom: 14px; width: 0; border-left: 1.5px dashed var(--accent); pointer-events: none; }
body:has(.sync:not([hidden])) .legend { bottom: calc(24px + var(--sync-h, 0px)); }
@media (max-width: 900px) { .sync-name { width: 36px; font-size: 10.5px; } .sync-read { white-space: normal; } }

.sync-evl {
  position: absolute; top: 17px; transform: translateX(-50%); font-size: 10px; font-weight: 700; white-space: nowrap;
  color: var(--text); background: color-mix(in srgb, var(--surface) 85%, transparent); padding: 0 3px; border-radius: 3px; cursor: pointer; line-height: 13px;
}
.sync-evl.r1 { top: 30px; }
.sync-evl.battle { color: #c62828; }
.sync-evl.hide { display: none; }
.sync-ev:hover + .sync-evl, .sync-evl:hover { z-index: 3; }
.sync-body { max-height: 46vh; overflow-y: auto; }

/* ── 연표: 주요 사건 종류 · 기출 빈출 · 이웃 시대 왕 ─────────────────────────── */
.sync-ev.culture { background: #2e7d32; border-radius: 2px; }
.sync-evl { font-weight: 500; }
.sync-evl.culture { color: #2e7d32; }
.sync-evl.star { font-weight: 900; }
.sync-ev.star { width: 12px; height: 12px; margin-left: -6px; top: 4px; }
.sync-read b.star { font-weight: 900; }
.sync-king.ext { opacity: .45; border-left-style: dashed; }
.sync-king.ext:hover { opacity: 1; }

/* ── 왕·대통령: 짧은 카드 · 목록/나란히 전환 · 동시대 표 ─────────────────────────── */
.ruler.compact { margin-bottom: 5px; }
.ruler.compact::before { top: 9px; width: 10px; height: 10px; left: 3px; border-width: 2px; }
.ruler.compact .ruler-card { padding: 5px 12px; }
.ruler.compact .ruler-name { font-size: 14px; font-weight: 700; }
.ruler-list.quiz .ruler.compact .ruler-card::after { content: none; }
.ruler-tools .seg { display: inline-flex; margin-right: 6px; }
.ruler-tools .seg button { border-radius: 0; }
.ruler-tools .seg button:first-child { border-radius: 999px 0 0 999px; }
.ruler-tools .seg button:last-child { border-radius: 0 999px 999px 0; margin-left: -1px; }
.rgrid-help { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
.rgrid-help .ext-sample { opacity: .5; border: 1px dashed var(--line); padding: 0 4px; border-radius: 3px; }
.rgrid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.rgrid { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.rgrid th, .rgrid td { border: 1px solid var(--line); padding: 4px 6px; vertical-align: top; }
.rgrid thead th { position: sticky; top: 0; z-index: 1; background: var(--c, var(--surface-2)); color: #fff; font-size: 13px; }
.rgrid thead th.g-year { background: var(--surface-2); color: var(--muted); }
.rgrid th.g-year { width: 1%; white-space: nowrap; font-size: 11px; font-weight: 500; color: var(--muted); text-align: right; background: var(--surface-2); }
.rgrid td.g-king { border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 9%, var(--surface)); cursor: pointer; min-width: 90px; }
.rgrid td.g-king:hover { background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.rgrid td.g-king.current { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.rgrid td.g-king.ext { opacity: .5; border-left-style: dashed; }
.rgrid td.g-king b { display: block; font-size: 13.5px; }
.rgrid td.g-king small { display: block; color: var(--muted); font-size: 11px; }
.rgrid .g-key { display: block; margin-top: 2px; color: var(--accent); font-weight: 700; font-size: 11.5px; line-height: 1.35; }
.rgrid td.g-empty { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--surface-2) 6px 7px); }

/* ── 기출 시험 포인트: 실제 시험 문장 ─────────────────────────── */
.section-title .ex-all {
  float: right; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer;
}
.section-title .ex-all[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.points.gichul .ex-btn {
  display: inline-block; margin-left: 6px; padding: 0 7px; font-size: 11px; font-weight: 700; line-height: 18px; vertical-align: 1px;
  border: 1px solid var(--accent); border-radius: 999px; background: none; color: var(--accent); cursor: pointer;
}
.points.gichul .ex-btn::after { content: ' ▾'; }
.points.gichul li.ex-open .ex-btn { background: var(--accent); color: #fff; }
.points.gichul li.ex-open .ex-btn::after { content: ' ▴'; }
.ex-box { display: none; margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
li.ex-open > .ex-box { display: block; }
.ex-h { margin: 0 0 4px; font-size: 11.5px; font-weight: 900; color: var(--muted); }
.ex-h + ul { margin-bottom: 8px; }
.ex-box ul { list-style: none; padding: 0; margin: 0; }
.ex-box ul:last-child { margin-bottom: 0; }
.points.gichul .ex-box li { position: static; padding: 3px 0; background: none; border: 0; border-radius: 0; }
.ex-o li q { font-weight: 700; }
.ex-box q { quotes: '“' '”'; }
.ex-meta { display: block; font-size: 11px; color: var(--muted); }
.ex-meta b { color: var(--accent); }
.ex-meta q { color: var(--text); font-weight: 700; }
.ex-q li + li { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 6px; }
.ex-q blockquote { margin: 0; padding-left: 8px; border-left: 3px solid var(--line); line-height: 1.55; color: var(--text); }

/* ── 기출 문장 모아 보기 ─────────────────────────── */
.top-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.top-tools .seg { display: inline-flex; }
.top-tools .seg button { font-size: 12px; padding: 4px 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
.top-tools .seg button:first-child { border-radius: 999px 0 0 999px; }
.top-tools .seg button:last-child { border-radius: 0 999px 999px 0; margin-left: -1px; }
.top-tools .seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.top-help { font-size: 11.5px; color: var(--muted); }
.top-list { list-style: none; margin: 0; padding: 0; }
.top-list li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px; margin-bottom: 5px; background: var(--surface-2); border-radius: 8px; font-size: 14px; }
.top-list li.has-k { box-shadow: inset 3px 0 0 var(--accent); }
.top-list q { quotes: '“' '”'; font-weight: 700; }
.top-list .ex-meta em { font-style: normal; font-weight: 700; color: var(--accent); }
.top-rank { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 900; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.top-list li:nth-child(-n+3) .top-rank { background: var(--accent); border-color: var(--accent); color: #fff; }
.top-more { display: block; width: 100%; margin-top: 2px; padding: 6px; font-size: 12.5px; font-weight: 700; border: 1px dashed var(--line); border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.top-more:hover { color: var(--accent); border-color: var(--accent); }

/* ── 내 오답 노트 (review.html) ─────────────────────────── */
.top-link { flex: none; font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.top-link:hover { border-color: var(--accent); }
body.review-page { display: block; height: auto; min-height: 100%; }
body.review-page .topbar { position: sticky; top: 0; }
.review { max-width: 920px; margin: 0 auto; padding: 18px 16px 48px; }
.r-h { font-size: 17px; font-weight: 900; margin: 28px 0 10px; }
.r-h small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.r-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.r-summary > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-align: center; }
.r-summary b { display: block; font-size: 26px; font-weight: 900; line-height: 1.2; }
.r-summary span { font-size: 12.5px; color: var(--muted); line-height: 1.3; display: block; }
.r-summary .hl { background: var(--accent-soft); border-color: var(--accent); }
.r-summary .hl b { color: var(--accent); }
@media (max-width: 600px) { .r-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.r-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.r-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.r-table th, .r-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.r-table thead th { font-size: 12px; color: var(--muted); background: var(--surface-2); }
.r-table tbody tr:last-child > * { border-bottom: 0; }
.r-table td.nums { white-space: normal; min-width: 220px; }
.r-table .nums span, .on-sample { display: inline-block; min-width: 24px; margin: 1px; padding: 0 4px; border-radius: 4px; text-align: center; font-size: 12px; background: var(--surface-2); color: var(--muted); }
.r-table .nums span.on, .on-sample { background: var(--accent); color: #fff; font-weight: 700; }
.r-bars { list-style: none; margin: 0; padding: 0; }
.r-bars li { display: grid; grid-template-columns: 150px minmax(0, 1fr) 150px; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { position: relative; height: 14px; border-radius: 7px; background: var(--surface-2); overflow: hidden; }
.bar-all, .bar-wr, .bar-tg { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; }
.bar-all { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.bar-wr { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.bar-tg { background: var(--accent); }
.bar-n i { font-style: normal; display: inline-block; min-width: 34px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.r-bars li.weak .bar-name, .r-bars li.weak .bar-n i { color: var(--accent); font-weight: 700; }
.bar-n { text-align: right; color: var(--muted); }
.bar-n b { color: var(--accent); }
@media (max-width: 600px) { .r-bars li { grid-template-columns: 80px minmax(0, 1fr); row-gap: 2px; } .r-bars .bar-n { grid-column: 2; text-align: left; font-size: 12px; } }
.r-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.r-tools .seg { display: inline-flex; }
.r-tools .seg button { font-size: 12.5px; padding: 5px 12px; border: 1px solid var(--line); background: var(--surface-2); }
.r-tools .seg button:first-child { border-radius: 999px 0 0 999px; }
.r-tools .seg button:last-child { border-radius: 0 999px 999px 0; margin-left: -1px; }
.r-tools .seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-check { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.rp-era { margin-bottom: 18px; }
.rp-era h3 { margin: 0 0 8px; font-size: 15px; font-weight: 900; padding-bottom: 4px; border-bottom: 2px solid var(--accent); }
.rp-era h3 a { color: inherit; text-decoration: none; }
.rp-era h3 a:hover { color: var(--accent); }
.rp-era h3 small { font-size: 12px; font-weight: 500; color: var(--muted); }
.rp-point { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.rp-title { font-size: 14.5px; font-weight: 500; line-height: 1.55; }
.rp-title b { color: var(--accent); }
.rp-freq { font-size: 11px; color: var(--accent); margin-right: 6px; letter-spacing: -1px; }
.rp-none { color: var(--muted); font-weight: 700; }
.rp-cnt { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 20px; vertical-align: 1px; }
.rq-list { list-style: none; margin: 8px 0 0; padding: 0; }
.rq { border-top: 1px dashed var(--line); padding: 8px 0 4px; }
.rq-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--muted); }
.rq-no { font-weight: 900; color: var(--text); font-size: 13px; }
.rq-tag { background: var(--surface-2); border-radius: 4px; padding: 0 6px; }
.rq-star { color: var(--accent); letter-spacing: -1px; }
.rq-diff { font-weight: 700; }
.rq-diff.d-하 { color: #2e7d32; }
.rq-diff.d-중 { color: #b26a00; }
.rq-done { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; color: var(--text); font-weight: 700; }
.rq-ex { margin: 6px 0 0; padding-left: 8px; border-left: 3px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.55; }
.rq-ans { margin: 6px 0 0; font-size: 14px; }
.rq-ans span { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; }
.rq-ans q { quotes: '“' '”'; font-weight: 700; }
.rq-why { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.rq.off { opacity: .7; }
.rq.done .rq-ex, .rq.done .rq-ans { opacity: .45; }
.rq.done .rq-ans q { text-decoration: line-through; }
.r-empty { color: var(--muted); }
.r-note { margin-top: 24px; font-size: 12px; color: var(--muted); }

/* 지도 노트: 내 오답이 있는 기출 포인트 */
.points.gichul .my-wrong { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: #c62828; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; vertical-align: 1px; text-decoration: none; }

/* 오답 노트: 문항 전문 · 정답 도출 포인트 */
.rq { padding: 12px 0 8px; }
.rq-stem { margin: 8px 0 6px; font-weight: 900; font-size: 14.5px; }
.rq-body { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 13.5px; line-height: 1.7; }
.rq-body p { margin: 0 0 6px; }
.rq-body p:last-child { margin-bottom: 0; }
.rq-body .rq-cap { font-size: 12px; color: var(--muted); }
.rq-body .rq-say { position: relative; padding: 6px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
mark.clue { background: #ffe27a; color: #2a2620; border-radius: 3px; padding: 0 2px; }
.rq-opts { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.rq-opts li { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 4px; padding: 4px 8px; border-radius: 6px; }
.rq-opts li.ans { background: var(--accent-soft); font-weight: 700; }
.rq-opts li.ans .n { color: var(--accent); }
.rq-opts .n { font-weight: 900; }
.rq-opts .why { grid-column: 2; display: none; font-size: 12px; font-weight: 500; color: var(--muted); }
.rq-opts .why b { color: var(--accent); }
.rq.open .rq-opts .why { display: block; }
.rq-solve { margin-top: 8px; }
.rq-toggle { font-size: 12.5px; font-weight: 700; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--accent); background: none; color: var(--accent); }
.rq.open .rq-toggle { background: var(--accent); color: #fff; }
.rq-solve-body { display: none; margin-top: 8px; padding: 10px 12px; border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--accent-soft); font-size: 13.5px; }
.rq.open .rq-solve-body { display: block; }
.sv-h { margin: 0 0 2px; font-size: 11.5px; font-weight: 900; color: var(--muted); }
.sv-clue { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.sv-how { margin: 0; line-height: 1.7; }
.sv-how b { color: var(--accent); }
.rq.done .rq-body, .rq.done .rq-opts { opacity: .5; }
/* 펼치기 전에는 단서·정답을 숨겨 다시 풀어 볼 수 있게 */
.rq:not(.open) .rq-body mark.clue { background: none; color: inherit; padding: 0; }
.rq:not(.open) .rq-opts li.ans { background: none; font-weight: inherit; }
.rq:not(.open) .rq-opts li.ans .n { color: inherit; }

/* ── 기출 풀기 (quiz.html) ─────────────────────────── */
.top-links { display: flex; gap: 6px; flex: none; }
.q-rounds { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.q-rounds a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: inherit; text-decoration: none; }
.q-rounds a:hover { border-color: var(--accent); }
.q-rounds b { font-size: 17px; font-weight: 900; }
.q-rounds span { font-size: 12.5px; color: var(--muted); }
.q-rounds em { font-style: normal; font-weight: 900; color: var(--accent); }
.q-rounds .q-draft { color: var(--accent); font-weight: 700; }
.q-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.q-top h2 { margin: 0; font-size: 18px; font-weight: 900; }
.q-result { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); }
.q-result > b { font-size: 26px; font-weight: 900; color: var(--accent); }
.q-result .nums { display: flex; flex-wrap: wrap; gap: 3px; }
.q-result .nums a { min-width: 24px; padding: 0 4px; border-radius: 4px; text-align: center; font-size: 12px; font-weight: 700; background: #c62828; color: #fff; text-decoration: none; }
.q-saved { font-size: 12px; color: var(--muted); margin-left: auto; }
.q-list { list-style: none; margin: 0; padding: 0 0 90px; }
.q-card { margin-bottom: 18px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; scroll-margin-top: 80px; }
.q-card.right { border-color: #2e7d32; box-shadow: inset 4px 0 0 #2e7d32; }
.q-card.wrong { border-color: #c62828; box-shadow: inset 4px 0 0 #c62828; }
.q-head { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: #555; margin-bottom: 4px; }
.q-head b { color: #222; }
.q-res { margin-left: auto; font-weight: 900; }
.q-card.right .q-res { color: #2e7d32; }
.q-card.wrong .q-res { color: #c62828; }
.q-card img, .rq-img { display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto; background: #fff; border-radius: 6px; }
.q-opts { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }
.q-opts button { width: 48px; height: 44px; font-size: 22px; border: 1.5px solid #ccc; border-radius: 10px; background: #fafafa; color: #333; }
.q-opts button:hover:not(:disabled) { border-color: var(--accent); }
.q-opts button.pick { background: var(--accent); border-color: var(--accent); color: #fff; }
.q-opts button.ans { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.q-opts button.miss { background: #c62828; border-color: #c62828; color: #fff; text-decoration: line-through; }
.q-opts button:disabled { cursor: default; }
.quiz-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(0,0,0,.08); font-size: 14px; }
.quiz-bar .q-jump { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; min-width: 0; }
.quiz-bar .q-jump a { width: 22px; height: 18px; font-size: 10px; line-height: 18px; text-align: center; border-radius: 3px; background: var(--surface-2); color: var(--muted); text-decoration: none; }
.quiz-bar .q-jump a.on { background: var(--accent); color: #fff; }
.quiz-bar button, .q-btn { padding: 8px 16px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font-weight: 900; text-decoration: none; font-size: 14px; }
.quiz-bar .q-retry { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
@media (max-width: 600px) { .quiz-bar .q-jump { display: none; } .q-opts button { width: 44px; } .top-links .top-link { padding: 5px 9px; font-size: 12px; } }
.rq-img { margin-top: 8px; border: 1px solid var(--line); }
.sv-opts { list-style: none; margin: 0; padding: 0; }
.sv-opts li { display: grid; grid-template-columns: 22px minmax(0, 1fr); padding: 2px 0; }
.sv-opts li.ans { font-weight: 700; color: var(--accent); }
.sv-opts small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.r-table .src { font-size: 11px; color: var(--muted); }

/* ── 기출 풀기: 한 문제씩 · 이미지 속 ①~⑤ 누르기 · 시간 ─────────────────────────── */
.q-top h2 small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.q-top .q-to-result { margin-left: auto; cursor: pointer; }
.q-one { max-width: 760px; margin: 0 auto; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.q-one.right { border-color: #2e7d32; box-shadow: inset 4px 0 0 #2e7d32; }
.q-one.wrong { border-color: #c62828; box-shadow: inset 4px 0 0 #c62828; }
.q-one .q-head { flex-wrap: wrap; }
.q-one.right .q-res { color: #2e7d32; }
.q-one.wrong .q-res { color: #c62828; }
.q-tm { margin-left: auto; font-size: 12.5px; color: #666; }
.q-tm b { color: #222; font-variant-numeric: tabular-nums; }
.q-imgwrap { position: relative; max-width: 720px; margin: 0 auto; }
.q-imgwrap img { display: block; width: 100%; height: auto; }
.q-spot { position: absolute; padding: 0; border: 2px solid transparent; border-radius: 6px; background: transparent; cursor: pointer; }
.q-spot:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.q-spot.pick { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.q-spot.ans { border-color: #2e7d32; background: rgba(46, 125, 50, .16); }
.q-spot.miss { border-color: #c62828; background: rgba(198, 40, 40, .14); }
.q-spot:disabled { cursor: default; }
.q-spot-btn { width: 48px; height: 44px; font-size: 22px; border: 1.5px solid #ccc; border-radius: 10px; background: #fafafa; color: #333; }
.q-spot-btn.pick { background: var(--accent); border-color: var(--accent); color: #fff; }
.q-nav { display: flex; justify-content: center; align-items: center; gap: 8px; max-width: 760px; margin: 12px auto 0; }
.q-nav button { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 14px; }
.q-nav .q-next, .q-nav .q-grade, .q-nav .q-to-result { background: var(--accent); border-color: var(--accent); color: #fff; }
.q-nav button:disabled { opacity: .4; }
.q-nav .q-gridbtn { flex: 1; max-width: 220px; color: var(--muted); }
.q-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; max-width: 760px; margin: 10px auto 0; }
.q-grid button { padding: 6px 0; font-size: 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
.q-grid button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.q-grid button.ok { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.q-grid button.ng { background: #c62828; border-color: #c62828; color: #fff; }
.q-grid button.cur { outline: 2px solid var(--text); outline-offset: 1px; }
.q-grid .wide { grid-column: 1 / -1; padding: 10px; font-size: 14px; font-weight: 900; background: var(--accent); border-color: var(--accent); color: #fff; }
.q-result .tt { font-size: 18px; color: var(--accent); }
.q-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.q-actions button, .q-actions .q-btn { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 13.5px; color: var(--text); text-decoration: none; }
.q-actions .q-review-wrong { background: #c62828; border-color: #c62828; color: #fff; }
.q-actions button:disabled { opacity: .4; }
.q-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
.q-trow { position: relative; display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; overflow: hidden; text-align: left; }
.q-trow > * { position: relative; z-index: 1; }
.q-trow .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--muted); opacity: .5; z-index: 0; }
.q-trow b { width: 22px; }
.q-trow.ok span:nth-child(2) { color: #2e7d32; font-weight: 900; }
.q-trow.ng span:nth-child(2) { color: #c62828; font-weight: 900; }
.q-trow .t { margin-left: auto; font-variant-numeric: tabular-nums; }
.q-trow.slow { background: #fff3e0; border-color: #ffb74d; }
.q-trow.slow .bar { background: #fb8c00; opacity: 1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .q-trow.slow { background: #3a2a14; } }
/* 문제 하나가 화면 높이에 들어오게 (선지까지 한눈에) */
.q-imgwrap { width: fit-content; max-width: 100%; }
.q-imgwrap img { width: auto; max-width: 100%; max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); }
@media (max-width: 600px) { .q-imgwrap img { max-height: none; width: 100%; } }
.rq-time { color: var(--text); font-variant-numeric: tabular-nums; }

/* ── 로그인 ─────────────────────────── */
a.brand-mark { text-decoration: none; }
.auth-box { position: relative; display: flex; align-items: center; }
.auth-box[hidden] { display: none; }
.auth-in { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--text); }
.auth-in:hover { border-color: var(--accent); }
.auth-wait { font-size: 12px; color: var(--muted); }
.auth-me { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--text); max-width: 180px; }
.auth-me img, .auth-ini { width: 24px; height: 24px; border-radius: 50%; flex: none; }
.auth-ini { display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 900; font-size: 12px; }
.auth-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-sync { color: var(--muted); font-size: 12px; }
.auth-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 1300; width: 240px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); font-size: 13px; }
.auth-menu p { margin: 0 0 6px; word-break: break-all; }
.auth-note { color: var(--muted); font-size: 12px; }
.auth-out { width: 100%; padding: 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; }
@media (max-width: 600px) { .auth-name { display: none; } .auth-me { padding-right: 3px; } }

/* ── 첫 화면 (시험 선택) ─────────────────────────── */
.home-mark { background: #2f4f6f; }
.h-hello p { margin: 0; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.h-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.h-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--line); border-top: 4px solid var(--c, var(--accent)); border-radius: var(--radius); background: var(--surface); }
.h-head { display: flex; gap: 12px; align-items: flex-start; }
.h-head h2 { margin: 0; font-size: 17px; font-weight: 900; }
.h-head h2 small { font-size: 12px; font-weight: 700; color: var(--c, var(--accent)); }
.h-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.h-mark { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: var(--c, var(--accent)); color: #fff; font-size: 22px; font-weight: 900; }
.h-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.h-stats li { padding: 6px 4px; border-radius: 8px; background: var(--surface-2); text-align: center; font-size: 12px; color: var(--muted); }
.h-stats b { display: block; font-size: 17px; color: var(--text); }
.h-stats span { display: block; font-size: 11px; }
.h-links { display: flex; flex-wrap: wrap; gap: 6px; }
.h-btn { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 13.5px; font-weight: 700; text-decoration: none; }
.h-btn.main { background: var(--c, var(--accent)); border-color: var(--c, var(--accent)); color: #fff; }
.h-add { border-top-color: var(--line); border-style: dashed; background: none; }
.h-add .h-mark { background: var(--surface-2); color: var(--muted); }
.r-import { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 14px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); font-size: 13.5px; }
.r-import span { flex: 1; min-width: 200px; }
.r-import button { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; }
.r-import button[data-import="no"] { background: none; color: var(--accent); }

/* ── 기출 풀기: 메모 · 채점 후 풀이 ─────────────────────────── */
.q-one { max-width: 1120px; }
.q-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.q-body .q-imgwrap { margin: 0 auto; }
@media (max-width: 900px) { .q-body { grid-template-columns: minmax(0, 1fr); } }
.q-memo { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px dashed #c9c2b2; border-radius: 10px; background: #fbf9f3; color: #333; position: sticky; top: 70px; }
.q-memo.has { border-style: solid; border-color: var(--accent); }
.q-memo-h { margin: 0; font-size: 12.5px; font-weight: 900; color: #555; }
.q-memo-h small { font-weight: 500; color: #999; margin-left: 4px; }
.q-memo label { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; }
.q-memo label > span { flex: none; width: 22px; padding-top: 5px; font-weight: 900; color: #666; text-align: center; }
.q-memo-q { flex-direction: column; }
.q-memo-q > span { width: auto !important; text-align: left !important; padding: 0 !important; font-size: 12px; }
.q-memo textarea, .q-memo input { width: 100%; min-width: 0; padding: 5px 8px; border: 1px solid #ddd6c6; border-radius: 6px; background: #fff; color: #222; font: inherit; font-size: 13px; }
.q-memo textarea { resize: vertical; }
.q-memo textarea:focus, .q-memo input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.q-solve { margin-top: 12px; padding: 12px 14px; border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; background: #fbf3ef; color: #2a2620; font-size: 14px; }
.q-solve .sv-h { color: #7a7265; }
.q-solve .sv-how b { color: #8b2e1f; }
.q-solve .sv-opts li.ans { color: #8b2e1f; }
.q-solve .sv-opts { font-size: 13.5px; }
/* 오답 노트: 메모 · 기록 삭제 */
.rq-memo { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); border-left: 3px solid #f0b400; border-radius: 0 8px 8px 0; background: var(--surface); font-size: 13px; }
.rq-memo .m-q { margin: 0 0 4px; white-space: pre-wrap; }
.rq-memo ul { list-style: none; margin: 0; padding: 0; }
.rq-memo li b { color: var(--muted); margin-right: 4px; }
.r-del { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); font-size: 12px; }
.r-del:hover { border-color: #c62828; color: #c62828; }

/* 선지 메모를 각 선지 바로 옆에 (넓은 화면) */
@media (min-width: 901px) {
  .q-body { display: flex; justify-content: center; align-items: stretch; gap: 10px; }
  .q-body .q-imgwrap { margin: 0; flex: 0 1 auto; }
  .q-memo.aligned { position: relative; flex: 0 0 260px; padding: 0; border: 0; background: none; top: auto; }
  .q-memo.aligned .q-memo-h { position: absolute; top: 0; left: 0; right: 0; }
  .q-memo.aligned .q-memo-q { position: absolute; top: 22px; left: 0; right: 0; height: max(70px, calc(var(--qh) - 30px)); }
  .q-memo.aligned .q-memo-q textarea { flex: 1; height: 100%; resize: none; }
  .q-memo.aligned .q-memo-o { position: absolute; top: var(--t); left: var(--l); width: var(--w); transform: translateY(-50%); padding-right: 4px; }
  .q-memo.aligned .q-memo-o > span { width: 18px; padding-top: 0; align-self: center; font-size: 13px; }
  .q-memo.aligned .q-memo-o input { padding: 3px 6px; font-size: 12.5px; background: #fffef8; border-color: #e3dccb; }
  .q-memo.aligned.has .q-memo-o input:not(:placeholder-shown) { border-color: var(--accent); background: #fff6f2; }
}
.r-scope-note { flex-basis: 100%; margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.r-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); } @media (max-width: 900px) { .r-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } } @media (max-width: 600px) { .r-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 내가 약한 개념 */
.r-weak { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.r-weak .wk { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 9px 12px; }
.r-weak .wk.done { opacity: .55; border-left-color: var(--line); }
.wk-era { font-size: 12px; color: var(--muted); }
.wk-t { font-size: 14px; line-height: 1.5; }
.wk-t b { color: var(--accent); }
.wk-n { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.wk-n b { color: var(--accent); font-size: 14px; }
.wk-qs { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.wk-qs button { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; }
.wk-qs button.off { border-style: dashed; }
.wk-qs button.m { text-decoration: line-through; opacity: .6; }
.wk-qs button:hover { background: var(--accent); color: #fff; }
.rq.flash { outline: 2px solid var(--accent); outline-offset: 2px; transition: outline-color .3s; }
@media (max-width: 600px) { .r-weak .wk { grid-template-columns: minmax(0, 1fr) auto; } .wk-t { grid-column: 1 / -1; grid-row: 2; } .wk-qs { grid-column: 1 / -1; } }
.wk-add { font-size: 13px; padding: 6px 14px; border-radius: 999px; border: 1px dashed var(--accent); background: transparent; color: var(--accent); cursor: pointer; font-weight: 700; }
.wk-add:hover { background: var(--accent-soft); }
.wk-form { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px 12px; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.wk-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.wk-form label small { font-size: 11px; }
.wk-form .wide { grid-column: 2; }
.wk-form label:first-child { grid-row: span 2; }
.wk-form input, .wk-form select, .wk-form textarea { font: inherit; font-size: 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; resize: vertical; }
.wk-form-btns { grid-column: 2; display: flex; gap: 6px; justify-content: flex-end; align-self: end; }
.wk-form-btns button { font-size: 13px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
.wk-form-btns .primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.r-weak .wk.mine { border-left-color: var(--chalk-blue); border-left-width: 4px; }
.wk-mine { color: var(--text); font-weight: 700; }
.wk-memo { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); white-space: pre-wrap; }
.wk-act { align-items: center; gap: 8px; }
.wk-act button { border-color: var(--line); color: var(--muted); }
.wk-act button:hover { background: var(--surface-2); color: var(--text); }
@media (max-width: 600px) { .wk-form { grid-template-columns: minmax(0, 1fr); } .wk-form .wide, .wk-form-btns { grid-column: 1; } .wk-form label:first-child { grid-row: auto; } }
.wk-search { position: relative; }
.wk-linked { font-size: 11.5px; color: var(--accent); font-weight: 700; }
.wk-sug { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; margin: 4px 0 0; padding: 4px; list-style: none; max-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.wk-sug li { padding: 7px 9px; border-radius: 7px; font-size: 13.5px; line-height: 1.5; color: var(--text); cursor: pointer; }
.wk-sug li.on, .wk-sug li[data-pt]:hover { background: var(--accent-soft); }
.wk-sug li.none { color: var(--muted); cursor: default; font-size: 12.5px; }
.wk-sug li b { color: var(--accent); }
.wk-sug u { text-decoration: underline 2px; text-underline-offset: 3px; color: var(--accent); font-weight: 700; }
.r-bars li.r-empty { display: block; }
.wk-sug-era { display: inline-block; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; margin-right: 6px; }
.wk-have { color: var(--muted); }
.wk-refs { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.wk-refs input[name="qsearch"] { font: inherit; font-size: 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; }
.wk-chips, .wk-ptqs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.wk-chips:empty, .wk-ptqs:empty { display: none; }
.wk-chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
.wk-chip.add { background: transparent; color: var(--accent); border-style: dashed; }
.wk-chip.add:hover { background: var(--accent-soft); }
.wk-old { font-size: 11.5px; }
.wk-wr { color: var(--accent); font-weight: 700; }
.wk-qs button.wr { background: var(--accent-soft); }
.wk-memo-row { grid-column: 2 / -1; }
.wk-memo-row .wk-memo { margin: 0; padding: 6px 9px; border-radius: 8px; background: var(--surface-2); color: var(--text); }
.wk-memo-edit { display: flex; flex-direction: column; gap: 6px; }
.wk-memo-edit textarea { font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface-2); border: 1px solid var(--accent); border-radius: 8px; padding: 6px 9px; resize: vertical; }
.wk-memo-edit span { display: flex; gap: 6px; justify-content: flex-end; }
.wk-memo-edit button { font-size: 12.5px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
.wk-memo-edit .primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.wk-qs .wk-memo-btn { border-color: var(--line); color: var(--muted); }
.wk-qs .wk-memo-btn:hover { background: var(--surface-2); color: var(--text); }
.qv { position: fixed; inset: 0; z-index: 2000; background: rgba(20, 15, 10, .55); display: flex; justify-content: center; align-items: flex-start; padding: 24px 16px; overflow-y: auto; }
.qv[hidden] { display: none; }
.qv-box { position: relative; width: min(760px, 100%); background: var(--bg); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.qv-box .rq-done { display: none; }
.qv-x { position: absolute; top: 8px; right: 8px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 15px; cursor: pointer; }
.qv-tag { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: var(--accent); }
body.qv-on { overflow: hidden; }
@media (max-width: 600px) { .wk-memo-row { grid-column: 1 / -1; } .qv { padding: 10px 8px; } }
.r-view { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; }
.r-view-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; align-items: start; }
.r-view-lab { font-size: 12px; color: var(--muted); padding-top: 5px; }
.r-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.r-chips button { font-size: 12.5px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
.r-chips button small { color: var(--muted); font-size: 11px; margin-left: 2px; }
.r-chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.r-chips button[aria-pressed="true"] small { color: rgba(255, 255, 255, .8); }
.r-view-sum { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.r-view-sum b { color: var(--accent); }
.r-link { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.r-link:hover { color: var(--accent); }
.r-table tr.in-view th, .r-table tr.in-view td { background: var(--accent-soft); }
.wk-memo.has-del { position: relative; padding-right: 26px; }
.wk-memo-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 11px; line-height: 20px; cursor: pointer; opacity: .6; }
.wk-memo-x:hover { opacity: 1; background: var(--accent-soft); color: var(--accent); }
.wk-memo-edit .danger { margin-right: auto; color: var(--accent); border-color: var(--accent); background: transparent; }

/* 헷갈림 표시 · 일시정지 */
.q-flag, .q-pause { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid #ccc; background: #fafafa; color: #444; cursor: pointer; white-space: nowrap; }
.q-flag[aria-pressed="true"] { background: #fff3e0; border-color: #fb8c00; color: #e65100; font-weight: 700; }
.q-pause[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.q-one { position: relative; }
.q-pausecover { display: none; }
.q-one.paused .q-pausecover { display: flex; position: absolute; inset: 44px 0 0; z-index: 5; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 18vh; gap: 12px; border-radius: 0 0 var(--radius) var(--radius); background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.q-pausecover p { margin: 0; font-size: 20px; font-weight: 900; color: var(--text); text-align: center; }
.q-pausecover small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
.q-pausecover button { padding: 10px 22px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font-size: 15px; font-weight: 900; cursor: pointer; }
.q-grid button.flag { position: relative; }
.q-grid button.flag::after { content: ''; position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: #fb8c00; box-shadow: 0 0 0 1.5px var(--surface); }
.q-trow .fl { font-size: 11px; }
.q-actions .q-review-flag:not(:disabled) { border-color: #fb8c00; color: #e65100; }
.rq-flag { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; border: 1px solid #fb8c00; background: #fff3e0; color: #e65100; font-weight: 700; cursor: pointer; }
.rq-flag:hover { background: #ffe0b2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rq-flag { background: #3a2a14; color: #ffb74d; } }
.r-summary .fl b { color: #e65100; }
.wk-more { display: block; width: 100%; margin: 0 0 10px; padding: 9px; border-radius: var(--radius); border: 1px dashed var(--line); background: var(--surface); color: var(--accent); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.wk-more:hover { background: var(--accent-soft); }
.r-bars .bar-name.r-link { text-align: left; text-decoration: none; }
.r-bars .bar-name.r-link:hover { text-decoration: underline; }
.rq-time.slow { font-weight: 700; color: #e65100; }
.rq-time.slow small { font-weight: 500; color: var(--muted); }
.rq-slow { list-style: none; padding: 0; }
.rq-slow-pt { margin: 14px 0 4px; font-size: 13.5px; line-height: 1.5; }
.rq-slow-pt b { color: var(--accent); }
.r-tools .seg { flex-wrap: wrap; gap: 4px; }
.r-tools .seg button, .r-tools .seg button:first-child, .r-tools .seg button:last-child { border-radius: 999px; margin-left: 0; }
.auth-sync.err { color: #e65100; font-weight: 900; }
.auth-err { margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: #fff3e0; color: #7a3d00; font-size: 12.5px; line-height: 1.5; }
.auth-err small { color: #8a5a2b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-err { background: #3a2a14; color: #ffcc80; } :root:not([data-theme="light"]) .auth-err small { color: #d9a66a; } }
.sv-opts.ox li { padding: 5px 0; border-top: 1px dashed var(--line); font-weight: 500; color: var(--text); }
.sv-opts.ox li:first-child { border-top: 0; }
.sv-opts.ox b { font-weight: 700; }
.sv-opts.ox small { font-size: 12.5px; line-height: 1.55; color: var(--muted); margin-top: 1px; }
.sv-opts.ox li.ans b, .sv-opts.ox li.ans .n { color: var(--accent); }
.sv-opts.ox li.ans small { color: var(--text); }
.sv-opts.ox em { font-style: normal; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; vertical-align: 1px; }
.sv-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 10px; }
.sv-meta > div { padding: 6px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.sv-meta dt { font-size: 11px; font-weight: 700; color: var(--accent); margin-bottom: 1px; }
.sv-meta dd { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text); word-break: keep-all; }
@media (max-width: 600px) { .sv-meta { grid-template-columns: minmax(0, 1fr); } .sv-meta > div { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: baseline; gap: 6px; } }
.q-solve .sv-meta > div { background: #fff; border-color: #e6d8cf; }
.q-solve .sv-meta dd { color: #2a2620; }
.sv-pick { margin: 0 0 10px; padding: 8px 11px; border-radius: 8px; border: 1px solid #e0a39a; background: #fdecea; color: #5c1f17; font-size: 13.5px; line-height: 1.55; }
.sv-pick p { margin: 0; }
.sv-pick p > b { display: inline-block; margin-right: 6px; font-size: 11.5px; color: #c62828; }
.sv-pick p > span { margin-left: 6px; color: #2e7d32; font-weight: 700; }
.sv-pick .why { margin-top: 3px; font-size: 13px; }
.sv-pick.ok { border-color: #a5d6a7; background: #edf7ee; color: #1b5e20; } .sv-pick.ok p > b { color: #2e7d32; }
.sv-pick.none { border-color: var(--line); background: var(--surface-2); color: var(--muted); }
.sv-opts li.mine > .n, .sv-opts.ox li.mine b { color: #c62828; }
.sv-opts em.mine { background: #c62828; }
.sv-opts em { font-style: normal; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; vertical-align: 1px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rq-solve .sv-pick { background: #3b1f1c; color: #ffd9d3; border-color: #7a3a33; } :root:not([data-theme="light"]) .rq-solve .sv-pick p > b { color: #ff8a80; } :root:not([data-theme="light"]) .rq-solve .sv-pick p > span { color: #81c784; } :root:not([data-theme="light"]) .rq-solve .sv-pick.ok { background: #1f3322; color: #c8e6c9; border-color: #3c6b41; } :root:not([data-theme="light"]) .rq-solve .sv-opts li.mine > .n, :root:not([data-theme="light"]) .rq-solve .sv-opts.ox li.mine b { color: #ff8a80; } }
.q-oldmemo { max-width: 720px; margin: 8px auto 0; padding: 6px 10px; border: 1px dashed #c9c2b2; border-radius: 10px; background: #fbf9f3; color: #555; font-size: 13px; }
.q-oldmemo summary, .rq-oldmemo summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: #8a7a55; }
.rq-oldmemo { margin-top: 6px; }
.rq-oldmemo summary { color: var(--muted); }
.q-oldmemo-item { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #d8d0bd; }
.q-oldmemo-item .d { margin: 0 0 2px; font-size: 11.5px; font-weight: 700; color: #a08f66; }
.q-oldmemo-item .m-q { margin: 0 0 3px; white-space: pre-wrap; }
.q-oldmemo-item ul { list-style: none; margin: 0; padding: 0; }
.q-oldmemo-item li b { margin-right: 4px; color: #999; }
.rq-memo .sv-h small { font-weight: 500; color: var(--muted); margin-left: 4px; }

/* 문제 바로 보기 창 (지도 노트의 기출 포인트·기출 문장에서) */
#qview.qv { z-index: 5000; }
#qview .qv-box { padding: 12px 14px 16px; }
.qv-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.qv-ttl { flex: 1; min-width: 0; }
.qv-ttl b { display: block; font-size: 15px; }
.qv-ttl span { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
#qview .qv-x { position: static; flex: none; }
.qv-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.qv-nav > button { flex: none; font-size: 12.5px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.qv-nav > button:disabled { opacity: .35; cursor: default; }
.qv-tabs { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.qv-tabs button { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); cursor: pointer; }
.qv-tabs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.qv-wrong, .qv-right { font-size: 11.5px; font-weight: 700; padding: 0 8px; border-radius: 999px; line-height: 20px; }
.qv-wrong { background: #c62828; color: #fff; }
.qv-right { background: var(--surface-2); color: var(--muted); }
.qv-solve { margin-left: auto; font-size: 12px; color: var(--accent); }
.qv-wait { margin: 30px 0; text-align: center; color: var(--muted); }
#qview .rq-img { max-width: 100%; }
.ex-r { font: inherit; font-size: 11px; padding: 0 6px; margin: 0 1px; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; line-height: 16px; }
.ex-r:hover { background: var(--accent); color: #fff; }
button.my-wrong { border: 0; cursor: pointer; font-family: inherit; }
button.my-wrong:hover { filter: brightness(1.15); }

/* 오답 노트: 다시 풀기 */
.rt-launch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rt-launch small { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.rt-launch button, .rt-btns button { font: inherit; font-size: 13px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; font-weight: 700; }
.rt-launch button:hover, .rt-btns button:hover { background: var(--accent-soft); }
button.rt-go { font: inherit; font-size: 13.5px; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; font-weight: 700; }
button.rt-go:hover { filter: brightness(1.1); background: var(--accent); }
button.rt-go:disabled { opacity: .4; cursor: default; }
.rq-again { font: inherit; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; }
.rq-again:hover { background: var(--accent); color: #fff; }
.qv-box .rq-again { display: none; }
.rq-retry { font-size: 11.5px; font-weight: 700; padding: 0 8px; border-radius: 999px; line-height: 19px; border: 1px solid #a5d6a7; background: #edf7ee; color: #1b5e20; }
.rq-retry.no { border-color: #e0a39a; background: #fdecea; color: #b71c1c; }
.rt-bar { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-bottom: 8px; }
.rt-bar span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.rt-box .rq { border-top: 0; padding-top: 0; }
.rt-box .rq-img { max-width: 100%; }
.rt-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; position: sticky; bottom: 0; padding: 8px 0; background: var(--bg); }
.rt-opts button { flex: 1 1 44px; min-width: 44px; height: 44px; font: inherit; font-size: 20px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.rt-opts button.dk { flex: 2 1 96px; font-size: 13px; color: var(--muted); }
.rt-opts button:not(:disabled):hover { border-color: var(--accent); background: var(--accent-soft); }
.rt-opts button:disabled { cursor: default; opacity: .55; }
.rt-opts button.ans { opacity: 1; background: #2e7d32; border-color: #2e7d32; color: #fff; font-weight: 700; }
.rt-opts button.mine { opacity: 1; background: #c62828; border-color: #c62828; color: #fff; }
.rt-hint { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.rt-res { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; padding: 9px 12px; border-radius: 8px; font-size: 14px; scroll-margin-top: 8px; border: 1px solid #e0a39a; background: #fdecea; color: #5c1f17; }
.rt-res.ok { border-color: #a5d6a7; background: #edf7ee; color: #1b5e20; }
.rt-res small { color: inherit; opacity: .8; }
.rt-res .rt-go { margin-left: auto; }
.rt-score { margin: 14px 0; text-align: center; font-size: 20px; color: var(--muted); }
.rt-score b { font-size: 40px; color: var(--accent); }
.rt-score span { display: block; font-size: 13px; }
.rt-all { text-align: center; font-weight: 700; }
.rt-list { list-style: none; margin: 4px 0 12px; padding: 0; font-size: 13.5px; }
.rt-list li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.rt-list button { font: inherit; font-size: 12px; padding: 1px 8px; margin-right: 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.rt-list.no button { border-color: #c62828; color: #c62828; }
.rt-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rt-res { background: #3b1f1c; color: #ffd9d3; border-color: #7a3a33; } :root:not([data-theme="light"]) .rt-res.ok { background: #1d3320; color: #c8e6c9; border-color: #3d6b42; } :root:not([data-theme="light"]) .rq-retry { background: #1d3320; color: #c8e6c9; border-color: #3d6b42; } :root:not([data-theme="light"]) .rq-retry.no { background: #3b1f1c; color: #ffb4ab; border-color: #7a3a33; } :root:not([data-theme="light"]) .rt-list.no button { color: #ff8a80; border-color: #ff8a80; } }

/* 오답 노트: 배점별 오답 */
.pt-table td { white-space: normal; vertical-align: top; }
.pt-table td i { font-style: normal; color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.pt-table td small, .pt-table th small { margin-left: 6px; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.pt-table td.weak b, .pt-table td.weak i { color: var(--accent); font-weight: 700; }
.pt-table tr.sum > * { background: var(--surface-2); font-size: 14.5px; }
.pt-nums { display: block; margin-top: 3px; }
.pt-nums span { display: inline-block; min-width: 22px; margin: 1px; padding: 0 4px; border-radius: 4px; text-align: center; font-size: 11.5px; background: var(--surface-2); color: var(--muted); }

/* 오답 노트: 문제로 건너뛴 뒤 보던 곳으로 돌아가기 */
.r-back { position: fixed; right: 16px; bottom: 16px; z-index: 900; font: inherit; font-size: 13.5px; font-weight: 700; padding: 9px 16px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; box-shadow: var(--shadow); cursor: pointer; }
.r-back[hidden] { display: none; }

/* 선지별 포인트: 글씨는 본문과 같은 색 + 선지의 시기·나라·왕 + 다른 회차 출제 */
.sv-opts li, .sv-opts.ox li, .sv-opts small, .sv-opts.ox small { color: inherit; }
.sv-opts.ox small { font-size: 13px; }
.ox-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; font-weight: 500; }
.ox-meta > span { font-size: 12px; line-height: 1.5; padding: 0 7px; border-radius: 6px; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); background: color-mix(in srgb, currentColor 5%, transparent); }
.ox-meta i, .ox-same > i { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--accent); margin-right: 5px; }
.ox-same { display: block; margin-top: 5px; padding: 5px 8px; border-radius: 6px; border: 1px dashed color-mix(in srgb, currentColor 30%, transparent); font-size: 12px; font-weight: 500; line-height: 1.5; }
.ox-same > i { display: block; }
.ox-same-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; padding: 1px 0; }
.ox-same-row button { font: inherit; font-size: 11.5px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; }
.ox-same-row button:hover { background: var(--accent); color: #fff; }
.ox-same-row b { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 999px; }
.ox-same-row b.a { background: #2e7d32; color: #fff; }
.ox-same-row b.x { background: color-mix(in srgb, currentColor 14%, transparent); }
.q-solve .ox-meta i, .q-solve .ox-same > i { color: #8b2e1f; }
.q-solve .ox-same-row button { border-color: #8b2e1f; color: #8b2e1f; }
.q-solve .ox-same-row button:hover { background: #8b2e1f; color: #fff; }
.sv-opts.ox li.ans small { color: inherit; }
.q-solve .sv-opts.ox li, .q-solve .sv-opts.ox small, .q-solve .sv-opts.ox li.ans small { color: #2a2620; }
.q-solve .sv-opts.ox li.ans b, .q-solve .sv-opts.ox li.ans .n { color: #8b2e1f; }
.q-solve .sv-opts.ox em { background: #8b2e1f; }
.q-solve .sv-opts.ox em.mine { background: #c62828; }
.sv-opts.ox li .ox-same .ox-same-row b.a { color: #fff; }
.sv-opts.ox li .ox-same .ox-same-row b.x { color: inherit; }

.rt-launch.rt-resume { border-color: var(--accent); background: var(--accent-soft); }

.sv-opts.ox li .ox-same .ox-same-row em.lz { background: transparent; color: inherit; opacity: .7; border: 1px dashed currentColor; font-weight: 500; font-size: 10.5px; padding: 0 5px; }

/* 구독: 잠금 화면 · 남은 기간 · 구독 관리 */
.pw { position: fixed; inset: 0; z-index: 2500; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(6px); }
body.pw-on { overflow: hidden; }
.pw-box { width: min(440px, 100%); padding: 28px 24px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.pw-mark { width: 52px; height: 52px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 12px; background: var(--accent); color: #fff; font-size: 26px; font-weight: 900; }
.pw-box h2 { margin: 0 0 8px; font-size: 19px; }
.pw-box p { margin: 0 0 16px; line-height: 1.7; color: var(--muted); font-size: 14px; }
.pw-box p b { color: var(--text); }
.pw-go { display: inline-block; font: inherit; font-size: 15px; font-weight: 700; padding: 11px 22px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; }
.pw-go:hover { filter: brightness(1.08); }
.pw-home { display: block; margin-top: 14px; font-size: 13px; color: var(--muted); }
.pw-err { color: #c62828; }
.sub-badge { font-weight: 700; }
.sub-badge.warn { border-color: var(--accent); color: var(--accent); }
.sub-main { max-width: 640px; }
.sub-card, .sub-plan { margin: 16px 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.sub-card h2 { margin: 0 0 6px; font-size: 19px; }
.sub-card p { margin: 0 0 12px; line-height: 1.7; }
.sub-methods { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sub-methods .sv-h { flex-basis: 100%; }
.sub-methods small { flex-basis: 100%; color: var(--muted); font-size: 12.5px; }
.sub-methods button { flex: 1 1 150px; font: inherit; font-size: 15px; font-weight: 700; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
.sub-methods button:disabled { opacity: .5; cursor: default; }
.sub-methods .sub-kakaopay { background: #fee500; border-color: #fee500; color: #191919; }
.sub-methods .sub-naverpay { background: #03c75a; border-color: #03c75a; color: #fff; }
.sub-methods .danger { flex: 0 1 auto; color: #c62828; background: transparent; }
.sub-msg { padding: 8px 12px; border-radius: 8px; background: var(--accent-soft); }
.sub-plan h3 { margin: 0 0 8px; font-size: 15px; }
.sub-plan ul { margin: 0; padding-left: 18px; line-height: 1.8; font-size: 14px; color: var(--muted); }
.sub-todo { color: #c62828; }
.pw-box .pw-mark { color: #fff; margin: 0 auto 10px; line-height: 1; }

/* 오답 노트: 풀었던 시험 전체 보기 */
.fx-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.fx-tools .r-chips button small { font-weight: 400; opacity: .75; }
.fx-table td, .fx-table th { text-align: center; }
.fx-table td.fx-theme, .fx-table td.fx-memo { text-align: left; white-space: normal; }
.fx-table td.fx-memo { min-width: 200px; font-size: 12.5px; color: var(--muted); }
.fx-row { cursor: pointer; }
.fx-row:hover > *, .fx-row.on > * { background: var(--surface-2); }
.fx-row.wr th { color: #c62828; }
.fx-o { color: #2e7d32; } .fx-x { color: #c62828; }
.fx-open > td { padding: 6px 10px 14px; text-align: left; white-space: normal; background: var(--bg); }
.fx-open .rq { border-top: 0; }
.fx-tools .fx-f { padding-left: 8px; border-left: 1px solid var(--line); }

/* 오답 노트: 풀었던 문제 한 문제씩 보기 */
.fv-box { width: min(820px, 100%); }
.fv-filter { margin-bottom: 8px; }
.fv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
.fv-head b { font-size: 16px; color: var(--text); }
.fv-res { font-weight: 700; padding: 1px 10px; border-radius: 999px; }
.fv-res.ok { background: #2e7d32; color: #fff; }
.fv-res.ng { background: #c62828; color: #fff; }
.fv-box .q-imgwrap { background: #fff; border-radius: 8px; overflow: hidden; }
.fv-box .q-spot { cursor: default; }
.fv-box .rq { border-top: 0; padding-top: 4px; }
.fv-note { margin: 8px 0; font-size: 13px; color: var(--muted); }
.fv-box .q-grid button.memo { text-decoration: underline; }
.fx-open-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.fx-open-btns button:not(.rt-go) { font: inherit; font-size: 13px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; font-weight: 700; }
.fx-open-btns button:disabled { opacity: .4; cursor: default; }
.r-table td.r-acts { display: flex; gap: 6px; justify-content: flex-end; }
.r-full { padding: 3px 12px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.r-full:hover { filter: brightness(1.08); }
.r-rounds { overflow-y: auto; overscroll-behavior: contain; }
.r-rounds thead th { position: sticky; top: 0; z-index: 1; }

/* 기출 풀기: 회차별 · 시대별 · 랜덤 모의고사 */
.q-tabs { display: flex; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.q-tabs button { font: inherit; font-size: 14.5px; font-weight: 700; padding: 8px 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.q-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.q-builder { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; gap: 10px; }
.q-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; align-items: start; }
.q-row > .q-make { grid-column: 1 / -1; justify-self: start; }
.q-lab { font-size: 12.5px; font-weight: 700; color: var(--muted); padding-top: 5px; }
.q-desc { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--muted); }
.q-desc b { color: var(--text); }
.q-make { font: inherit; font-size: 15px; font-weight: 700; padding: 10px 20px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
.q-make:disabled { opacity: .45; cursor: default; }
.q-make small { font-weight: 400; opacity: .85; }
.q-rounds li { position: relative; }
.q-setdel { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 11px; cursor: pointer; }
.q-setdel:hover { color: #c62828; border-color: #c62828; }
.q-src { padding: 0 7px; border-radius: 999px; background: #eee; color: #444; font-size: 11.5px; }
.fv-res.mine { background: var(--surface-2); color: var(--text); }
.fv-box .rq-toggle { margin-top: 8px; }
.q-grid[hidden] { display: none; }

/* 선지별 포인트: 정답 선지는 제목만 초록, 내가 골라서 틀린 선지는 제목만 빨강 — 설명·번호는 본문 색 */
.sv-opts li.ans, .sv-opts li.mine, .sv-opts.ox li.ans .n, .sv-opts.ox li.mine .n, .sv-opts.ox li.ans small, .sv-opts.ox li.mine small { color: inherit; }
.sv-opts.ox li.ans > span > b { color: #2e7d32; }
.sv-opts.ox li.mine > span > b { color: #c62828; }
.sv-opts li.ans em:not(.mine), .sv-opts.ox li.ans em:not(.mine) { background: #2e7d32; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sv-opts.ox li.ans > span > b { color: #81c784; }
  :root:not([data-theme="light"]) .sv-opts.ox li.mine > span > b { color: #ff8a80; }
}
:root[data-theme="dark"] .sv-opts.ox li.ans > span > b { color: #81c784; }
:root[data-theme="dark"] .sv-opts.ox li.mine > span > b { color: #ff8a80; }
/* 기출 풀기 풀이 칸은 늘 밝은 바탕 */
.q-solve .sv-opts li.ans, .q-solve .sv-opts li.mine, .q-solve .sv-opts.ox li.ans .n, .q-solve .sv-opts.ox li.mine .n, .q-solve .sv-opts.ox li.ans small, .q-solve .sv-opts.ox li.mine small { color: #2a2620 !important; }
.q-solve .sv-opts.ox li.ans > span > b { color: #2e7d32 !important; }
.q-solve .sv-opts.ox li.mine > span > b { color: #c62828 !important; }
.rq-src { font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent); }
.r-set th small.src { display: block; margin-top: 2px; }
.q-solve-toggle { display: block; margin: 12px auto 0; font: inherit; font-size: 13.5px; font-weight: 700; padding: 7px 18px; border-radius: 999px; border: 1px solid var(--accent); background: none; color: var(--accent); cursor: pointer; }
.q-solve-toggle[aria-expanded="true"] { background: var(--accent); color: #fff; }
.q-res.mine { background: #eee; color: #333; }

/* 기출 풀기: 출제 경향·예측표 */
.tr-wrap { overflow: auto; max-height: 75vh; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tr-table { border-collapse: separate; border-spacing: 0; font-size: 12.5px; min-width: 100%; }
.tr-table th, .tr-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); white-space: nowrap; text-align: center; }
.tr-table thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); font-size: 12px; }
.tr-table .tr-n { position: sticky; left: 0; z-index: 2; background: var(--surface-2); width: 40px; }
.tr-table thead .tr-n { z-index: 4; }
.tr-table td.tr-pred { position: sticky; left: 40px; z-index: 1; background: var(--surface); text-align: left; white-space: normal; min-width: 190px; max-width: 220px; border-right: 2px solid var(--accent); }
.tr-table thead th.tr-pred { left: 40px; z-index: 4; border-right: 2px solid var(--accent); color: var(--accent); }
.tr-pred ol { margin: 3px 0 0; padding-left: 16px; font-size: 12px; line-height: 1.5; }
.tr-pred small { color: var(--muted); font-size: 10.5px; }
.tr-per { display: inline-block; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--c); }
.tr-c { cursor: pointer; background: color-mix(in srgb, var(--c) 16%, var(--surface)); box-shadow: inset 3px 0 0 var(--c); }
.tr-c:hover { background: color-mix(in srgb, var(--c) 32%, var(--surface)); }
.tr-go { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 10px; }
.tr-go small { color: var(--muted); font-size: 12px; }
.tr-topic { font: inherit; font-size: 12px; padding: 0; border: 0; background: none; color: var(--text); text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.tr-topic:hover { color: var(--accent); }

/* 광고 자리: 광고가 켜지기 전에는 보이지 않는다 */
.ad-slot { display: none; }
.ad-slot.on { display: block; margin: 18px 0; padding: 6px 0 10px; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); min-height: 90px; text-align: center; }
.ad-label { display: block; margin-bottom: 4px; font-size: 10.5px; color: var(--muted); letter-spacing: .05em; }
.ad-wrap { padding-top: 0; }
.site-foot { padding-top: 0; font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.7; } .site-foot a { color: var(--muted); }

/* ───── 지텔프 ───── */
.gt-page { --accent: #1f5f8b; --accent-soft: #dcebf5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gt-page { --accent: #7fb3d9; --accent-soft: #1e3140; } }
:root[data-theme="dark"] .gt-page { --accent: #7fb3d9; --accent-soft: #1e3140; }
.gt-tabs { display: flex; gap: 4px; overflow-x: auto; padding-top: 10px; padding-bottom: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.gt-tabs a { flex: none; padding: 9px 14px; font-weight: 700; font-size: 14.5px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; }
.gt-tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.gt-muted { color: var(--muted); font-size: 13.5px; }
.gt-page .g { color: #2e7d32; } .gt-page .r { color: #c62828; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gt-page .g { color: #81c784; } :root:not([data-theme="light"]) .gt-page .r { color: #ff8a80; } }
:root[data-theme="dark"] .gt-page .g { color: #81c784; } :root[data-theme="dark"] .gt-page .r { color: #ff8a80; }
.gt-hero { margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.gt-hero h2 { margin: 0 0 6px; font-size: 20px; }
.gt-hero p { margin: 0 0 12px; }
.gt-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.gt-tbl th, .gt-tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.gt-tbl th { background: var(--surface-2); font-size: 12.5px; color: var(--muted); }
.gt-tbl td:first-child { white-space: nowrap; font-weight: 700; }
.gt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin: 16px 0; }
.gt-card { display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.gt-card:hover { border-color: var(--accent); }
.gt-card h3 { margin: 0 0 4px; font-size: 15px; color: var(--accent); }
.gt-card b { font-size: 22px; }
.gt-card span { font-size: 12.5px; color: var(--muted); }
.gt-card small { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.gt-card em { font-style: normal; color: var(--accent); font-weight: 700; }
.gt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; align-items: center; }
.gt-chips .chip { cursor: pointer; color: var(--text); font-weight: 600; }
.gt-chips .chip small { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.gt-chips .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.gt-chips .chip.on small { color: rgba(255,255,255,.85); }
.gt-chips.small .chip { padding: 4px 10px; font-size: 12.5px; box-shadow: none; }
.gt-tip { margin: 12px 0; padding: 12px 16px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0; font-size: 14px; line-height: 1.65; }
.gt-tip h3 { margin: 0 0 6px; font-size: 15px; } .gt-tip h3 small { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 4px; }
.gt-tip ul { margin: 6px 0; padding-left: 20px; }
.gt-tip i { font-style: normal; color: var(--accent); font-weight: 600; }
.gt-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.gt-bar.center { justify-content: center; }
.gt-btn { padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; font-family: inherit; }
.gt-btn.main { background: var(--accent); border-color: var(--accent); color: #fff; }
.gt-link { border: 0; background: none; color: var(--accent); font-weight: 700; cursor: pointer; padding: 6px 0; font-size: 13.5px; font-family: inherit; }
.gt-qs { display: flex; flex-direction: column; gap: 10px; }
.gt-q { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.gt-q.ok { border-left: 4px solid #2e7d32; } .gt-q.no { border-left: 4px solid #c62828; }
.gt-qt { font-size: 15px; line-height: 1.6; margin-bottom: 8px; }
.gt-qt u { text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 700; }
.gt-blank { display: inline-block; min-width: 70px; border-bottom: 2px solid var(--accent); color: transparent; line-height: 1.1; }
.gt-tag { display: inline-block; padding: 1px 7px; margin-right: 4px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 700; vertical-align: 2px; }
.gt-src { font-size: 12px; font-weight: 700; color: var(--accent); margin-right: 4px; }
.gt-opts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.gt-opts button { width: 100%; text-align: left; padding: 8px 11px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 14px; line-height: 1.45; cursor: pointer; font-family: inherit; }
.gt-opts button i { font-style: normal; color: var(--muted); font-weight: 700; margin-right: 2px; }
.gt-opts button:hover:not(:disabled) { border-color: var(--accent); }
.gt-opts button.pick { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.gt-opts button.ans { border-color: #2e7d32; background: #e6f4e7; color: #1b5e20; font-weight: 700; }
.gt-opts button.miss { border-color: #c62828; background: #fdeaea; color: #b71c1c; text-decoration: line-through; }
.gt-opts button:disabled { cursor: default; }
.gt-ex { margin-top: 8px; font-size: 13.5px; line-height: 1.6; color: var(--text); }
.gt-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 8px 0 14px; }
.gt-set { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.gt-set.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.gt-set small { color: var(--muted); font-size: 12px; } .gt-set b { font-size: 14px; } .gt-set em { font-style: normal; color: var(--accent); font-weight: 700; font-size: 13px; }
.gt-work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 18px; }
.gt-work.listening { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.gt-passage { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 15px; line-height: 1.75; position: sticky; top: 8px; max-height: calc(100vh - 16px); overflow-y: auto; }
.gt-passage h3 { margin: 0 0 8px; font-size: 16px; } .gt-passage h3 small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.gt-passage p { margin: 0 0 10px; }
.gt-player { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.gt-rate { font-size: 13px; color: var(--muted); } .gt-rate select { font-family: inherit; }
.gt-script { margin-top: 8px; font-size: 14px; line-height: 1.65; }
.gt-script.hide { display: none; }
.gt-script p { margin: 0 0 6px; padding: 2px 6px; border-radius: 6px; }
.gt-script p.cur { background: var(--accent-soft); }
.gt-script b { display: inline-block; min-width: 22px; padding: 0 4px; border-radius: 5px; font-size: 12px; text-align: center; color: #fff; }
.gt-script .sp-M { background: #1f5f8b; } .gt-script .sp-F { background: #b0476b; }
.gt-score { font-size: 20px; color: var(--accent); }
.gt-flash { max-width: 520px; margin: 16px auto 0; padding: 26px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: center; cursor: pointer; box-shadow: var(--shadow); }
.gt-word { font-size: 30px; font-weight: 900; margin: 6px 0 10px; } .gt-word small { font-size: 13px; }
.gt-mean { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.gt-syn { font-size: 14.5px; color: var(--muted); margin-bottom: 6px; } .gt-syn b { color: var(--accent); }
.gt-exs { font-size: 14.5px; font-style: italic; }
.gt-opts.vq { grid-template-columns: 1fr; margin: 6px 0 10px; }
.gt-vres { padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 14px; } .gt-vres small { color: var(--muted); }
.gt-search { width: 100%; padding: 9px 12px; margin: 6px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit; box-sizing: border-box; }
.gt-vtbl td:first-child { width: 1%; }
.gt-mocks { display: flex; flex-direction: column; gap: 10px; }
.gt-mock { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.gt-mock > div:first-child b { display: block; font-size: 16px; } .gt-mock small { color: var(--muted); font-size: 12.5px; }
.gt-mock .gt-bar { margin: 0; }
.gt-sc { display: flex; flex-direction: column; } .gt-sc b { font-size: 20px; color: var(--accent); } .gt-sc span { font-size: 13px; }
.gt-mbar { position: sticky; top: 0; z-index: 50; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px -4px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.gt-mbar .gt-chips { margin: 0; }
.gt-time { font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 900; padding: 2px 10px; border-radius: 8px; background: var(--surface-2); }
.gt-time.warn { color: #e65100; } .gt-time.over { color: #fff; background: #c62828; }
.gt-sh { margin: 24px 0 10px; font-size: 16px; } .gt-sh small { font-weight: 500; color: var(--muted); font-size: 12.5px; margin-left: 4px; }
.gt-result { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.gt-total, .gt-secsc { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; }
.gt-total b { font-size: 38px; color: var(--accent); } .gt-secsc b { font-size: 26px; }
.gt-total span, .gt-secsc span { font-size: 13px; color: var(--muted); }
.gt-secsc i { position: absolute; left: 0; bottom: 0; height: 4px; width: var(--w); background: var(--accent); }
.gt-types { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
@media (max-width: 760px) {
  .gt-work, .gt-work.listening { grid-template-columns: 1fr; }
  .gt-passage { position: static; max-height: none; }
  .gt-opts { grid-template-columns: 1fr; }
  .gt-result { grid-template-columns: repeat(3, 1fr); } .gt-total { grid-column: 1 / -1; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .gt-opts button.ans { background: #1d3a20; color: #a5d6a7; }
  :root:not([data-theme="light"]) .gt-opts button.miss { background: #3d1f1f; color: #ff8a80; }
}
:root[data-theme="dark"] .gt-opts button.ans { background: #1d3a20; color: #a5d6a7; }
:root[data-theme="dark"] .gt-opts button.miss { background: #3d1f1f; color: #ff8a80; }
.gt-page main a:not(.gt-btn):not(.gt-card):not(.gt-set):not(.gt-plancard) { color: var(--accent); font-weight: 700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gt-page :is(.gt-chips .chip.on, .gt-btn.main) { color: #0f1d27; } :root:not([data-theme="light"]) .gt-page .gt-chips .chip.on small { color: #0f1d27; } }
:root[data-theme="dark"] .gt-page :is(.gt-chips .chip.on, .gt-btn.main) { color: #0f1d27; } :root[data-theme="dark"] .gt-page .gt-chips .chip.on small { color: #0f1d27; }
.gt-chips[hidden] { display: none; }
.gt-ko { margin-top: -6px !important; padding: 4px 10px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 6px 6px 0; font-size: 13.5px; line-height: 1.6; color: var(--text); }
.gt-script .gt-ko { margin: -2px 0 8px 28px !important; }
.gt-qko { margin-top: 4px; font-size: 13px; color: var(--muted); }
.gt-qs.no-ex .gt-qko { display: none; }
.gt-kobar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 14px; }
.gt-note { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: #fff4e0; color: #5d4300; font-size: 13.5px; line-height: 1.55; text-align: left; }
.gt-note.sm { margin-top: 4px; padding: 4px 8px; font-size: 12.5px; }
.gt-note b { color: inherit; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gt-note { background: #3a2f1a; color: #f3dca8; } }
:root[data-theme="dark"] .gt-note { background: #3a2f1a; color: #f3dca8; }
.gt-confs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.gt-conf { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 14px; line-height: 1.6; }
.gt-conf h3 { margin: 0 0 6px; font-size: 16px; color: var(--accent); } .gt-conf h3 small { color: var(--muted); font-weight: 500; font-size: 12px; }
.gt-conf p { margin: 0 0 6px; }
.gt-conf ul { margin: 0; padding-left: 18px; }
.gt-conf li span { display: block; color: var(--muted); font-size: 12.5px; }
.gt-plancard { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 16px 0 0; padding: 14px 16px; border-radius: var(--radius); background: var(--accent); color: #fff; text-decoration: none; }
.gt-plancard b { font-size: 17px; } .gt-plancard span { flex: 1 1 260px; font-size: 13.5px; opacity: .9; } .gt-plancard em { font-style: normal; font-weight: 700; }
.gt-days { display: flex; flex-direction: column; gap: 8px; }
.gt-day { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.gt-day.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.gt-dayhead { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 12px 14px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; font-family: inherit; font-size: 14px; }
.gt-dayhead b { font-size: 16px; min-width: 52px; }
.gt-dayhead em { font-style: normal; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; }
.gt-dayhead span { flex: 1 1 240px; color: var(--muted); font-size: 13px; }
.gt-dayhead i { font-style: normal; font-size: 12.5px; color: var(--muted); }
.gt-day.done .gt-dayhead i { color: #2e7d32; font-weight: 700; }
.gt-tasks { display: none; list-style: none; margin: 0; padding: 0 10px 10px; }
.gt-day.open .gt-tasks { display: block; }
.gt-tasks li a { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 10px 10px; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); text-decoration: none; }
.gt-tasks li a:hover { border-color: var(--accent); }
.gt-tasks li.main a { border-left: 4px solid var(--accent); }
.gt-tasks b { font-size: 14.5px; } .gt-tasks small { flex: 1 1 180px; color: var(--muted); font-size: 12.5px; } .gt-tasks em { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.gt-chk { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 2px solid var(--line); border-radius: 6px; font-size: 13px; font-weight: 900; color: #fff; }
.gt-tasks li.ok .gt-chk { background: #2e7d32; border-color: #2e7d32; }
.gt-tasks li.ok b { text-decoration: line-through; color: var(--muted); }
.gt-dayban { margin: 6px 0; padding: 10px 14px; border-radius: var(--radius); background: var(--accent-soft); font-size: 14px; }
.gt-dayban a { margin-left: 8px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gt-plancard, :root:not([data-theme="light"]) .gt-dayhead em { color: #0f1d27; } }
:root[data-theme="dark"] .gt-plancard, :root[data-theme="dark"] .gt-dayhead em { color: #0f1d27; }
.gt-flash { position: relative; }
.gt-say { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); font-size: 17px; cursor: pointer; }
.gt-say:hover { border-color: var(--accent); }
.gt-vnav { display: flex; justify-content: space-between; align-items: center; max-width: 520px; margin: 8px auto 0; }
.gt-vans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 520px; margin: 8px auto 0; }
.gt-ans { padding: 14px 10px; border: 0; border-radius: 12px; font-size: 16px; font-weight: 900; color: #fff; cursor: pointer; font-family: inherit; }
.gt-ans.no { background: #c62828; } .gt-ans.yes { background: #2e7d32; }
.gt-ans:hover { filter: brightness(1.1); }
.gt-flash { text-align: left; }
.gt-flash .gt-word, .gt-flash .gt-mean { text-align: center; }
.gt-flash > .gt-muted { text-align: center; }
.gt-flash h4 { margin: 12px 0 4px; font-size: 12.5px; color: var(--accent); letter-spacing: .02em; }
.gt-senses { margin-top: 6px; }
.gt-sense { display: grid; gap: 1px; padding: 8px 10px; margin-bottom: 6px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; font-size: 14px; }
.gt-sense b { font-size: 15px; } .gt-sense small { color: var(--muted); font-size: 12.5px; } .gt-sense i { font-style: italic; } .gt-sense span { color: var(--muted); font-size: 13px; }
.gt-col { font-size: 14px; line-height: 1.6; }
.gt-uses p { margin: 0 0 8px; font-size: 14.5px; font-style: italic; line-height: 1.5; }
.gt-uses p span { display: block; font-style: normal; color: var(--muted); font-size: 13px; }
.gt-fillq { margin: 10px 0 14px; font-size: 18px; line-height: 1.6; text-align: left; }
.gt-fillq .gt-blank { min-width: 90px; }
.gt-hit { color: var(--accent); border-bottom: 2px solid var(--accent); }
.gt-fillko { margin: 8px 0; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--accent-soft); font-size: 13.5px; }
.gt-mean.sm { font-size: 15px; margin: 6px 0; text-align: left; }
.gt-vsent { margin-top: 4px; font-size: 13.5px; font-style: italic; } .gt-vsent span { display: block; font-style: normal; color: var(--muted); font-size: 12.5px; }
.gt-qcard { cursor: default; }
.gt-vans { position: sticky; bottom: 8px; z-index: 5; padding: 6px; border-radius: 14px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(4px); }
.gt-others { margin-top: 10px; } .gt-others h4 { margin: 0 0 6px; }
.gt-oth { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 6px 10px; margin-bottom: 4px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.gt-oth i { font-style: normal; color: var(--muted); } .gt-oth small { color: var(--muted); font-size: 12.5px; }
.gt-oth.ans { border-color: #2e7d32; background: #e6f4e7; color: #1b5e20; } .gt-oth.miss { border-color: #c62828; background: #fdeaea; color: #b71c1c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gt-oth.ans { background: #1d3a20; color: #a5d6a7; } :root:not([data-theme="light"]) .gt-oth.miss { background: #3d1f1f; color: #ff8a80; } }
:root[data-theme="dark"] .gt-oth.ans { background: #1d3a20; color: #a5d6a7; } :root[data-theme="dark"] .gt-oth.miss { background: #3d1f1f; color: #ff8a80; }
.gt-planbar { position: sticky; top: 0; z-index: 40; margin: 10px -4px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.gt-pdays { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.gt-pdays .chip { flex: none; text-decoration: none; }
.gt-pdays .chip.fin { border-color: #2e7d32; }
.gt-tks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.gt-tk { display: inline-flex; flex-direction: column; padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); text-decoration: none; font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.gt-tk small { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.gt-tk.on { border-color: var(--accent); background: var(--accent-soft); }
.gt-tk.ok { border-color: #2e7d32; }
.gt-tk.mock { border-style: dashed; }
#plan-body .gt-sh { margin-top: 6px; }
.gt-q { position: relative; }
.gt-flag { float: right; margin: 0 0 4px 8px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; }
.gt-flag.on { background: #fff4cc; border-color: #e0a800; color: #8a5a00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gt-flag.on { background: #3a3114; color: #ffd866; border-color: #a07a00; } }
:root[data-theme="dark"] .gt-flag.on { background: #3a3114; color: #ffd866; border-color: #a07a00; }
.gt-btn:disabled { opacity: .45; cursor: default; }
.gt-passage u.gt-vw { text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--accent); background: var(--accent-soft); border-radius: 3px; padding: 0 2px; }
.gt-passage u.gt-vw b { font-weight: 900; }
/* 청취: 실제 시험 양식 (지시문 → 소리 → 문제를 2단으로, 선택지는 원형 표시) */
.gt-inst { display: flex; gap: 14px; align-items: center; margin: 14px 0 8px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.gt-snd { flex: none; display: flex; flex-direction: column; align-items: center; font-size: 28px; line-height: 1; } .gt-snd small { font-size: 10px; font-weight: 900; letter-spacing: .06em; color: var(--muted); }
.gt-inst p { margin: 0; font-size: 14.5px; line-height: 1.6; }
.gt-work.listening { display: block; margin-bottom: 18px; }
.gt-work.listening .gt-passage { position: static; max-height: none; margin-bottom: 12px; }
.gt-qs.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 26px; align-items: start; }
.gt-qs.rad .gt-q { background: none; border: 0; border-bottom: 1px dashed var(--line); border-radius: 0; padding: 8px 2px 12px; }
.gt-qs.rad .gt-q.ok, .gt-qs.rad .gt-q.no { border-left: 0; }
.gt-qs.rad .gt-q.ok .gt-qt b { color: #2e7d32; } .gt-qs.rad .gt-q.no .gt-qt b { color: #c62828; }
.gt-qs.rad .gt-opts { grid-template-columns: 1fr; gap: 2px; }
.gt-qs.rad .gt-opts button { border: 0; background: none; padding: 6px 4px; display: flex; gap: 10px; align-items: flex-start; text-decoration: none; }
.gt-qs.rad .gt-opts button i { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 2px solid var(--muted); border-radius: 50%; font-size: 11px; font-weight: 800; color: var(--muted); margin: 0; }
.gt-qs.rad .gt-opts button.pick { background: var(--accent-soft); } .gt-qs.rad .gt-opts button.pick i { background: var(--accent); border-color: var(--accent); color: #fff; }
.gt-qs.rad .gt-opts button.ans { background: none; color: #2e7d32; } .gt-qs.rad .gt-opts button.ans i { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.gt-qs.rad .gt-opts button.miss { background: none; color: #c62828; } .gt-qs.rad .gt-opts button.miss i { background: #c62828; border-color: #c62828; color: #fff; }
@media (max-width: 760px) { .gt-qs.two { grid-template-columns: 1fr; } .gt-inst { flex-direction: column; align-items: flex-start; } }
.gt-bar[hidden] { display: none; }
.gt-pause { margin: 40px auto; max-width: 480px; padding: 34px 24px; border: 2px dashed var(--line); border-radius: 16px; text-align: center; background: var(--surface); }
.gt-pause b { font-size: 22px; } .gt-pause p { margin: 10px 0 18px; color: var(--muted); }
.gt-time.paused { color: var(--muted); opacity: .8; }
.gt-pick { margin: 6px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.gt-pick .gt-chips { margin: 0 0 8px; }
.gt-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.gt-pill { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 34px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); font-weight: 800; font-size: 14px; text-decoration: none; }
.gt-pill i { font-style: normal; font-size: 11px; color: #2e7d32; margin-left: 4px; }
.gt-pill.done { border-color: #2e7d32; }
.gt-pill.on { background: var(--accent); border-color: var(--accent); color: #fff; } .gt-pill.on i { color: #fff; }
.gt-pickcur { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.gt-pickcur b { font-size: 15px; } .gt-pickcur small { color: var(--muted); font-size: 12.5px; }
.gt-pn { margin-left: auto; display: flex; gap: 14px; font-size: 13px; font-weight: 700; } .gt-pn a { color: var(--accent); text-decoration: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gt-pill.on { color: #0f1d27; } :root:not([data-theme="light"]) .gt-pill.on i { color: #0f1d27; } }
:root[data-theme="dark"] .gt-pill.on { color: #0f1d27; } :root[data-theme="dark"] .gt-pill.on i { color: #0f1d27; }
.gt-page main a.gt-pill { color: var(--text); } .gt-page main a.gt-pill.on { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gt-page main a.gt-pill.on { color: #0f1d27; } }
:root[data-theme="dark"] .gt-page main a.gt-pill.on { color: #0f1d27; }
.gt-wcats .chip:disabled { opacity: .4; cursor: default; }
.gt-wcats { position: sticky; top: 0; z-index: 30; padding: 8px 0; background: var(--bg); }

/* ───── 소방공무원 기출 ───── */
.fire-page { --accent: #b3261e; --accent-soft: #fbe4e1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fire-page { --accent: #ff8a80; --accent-soft: #3d2220; } }
:root[data-theme="dark"] .fire-page { --accent: #ff8a80; --accent-soft: #3d2220; }
.fr-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.fr-sum div { padding: 12px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; }
.fr-sum b { display: block; font-size: 22px; } .fr-sum span { font-size: 12px; color: var(--muted); }
.fr-exams { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.fr-exam { padding: 14px; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.fr-exam h3 { margin: 0 0 10px; font-size: 16px; } .fr-exam h3 small { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 4px; }
.fr-subs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fr-sub { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 1px; text-align: left; padding: 8px 10px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); cursor: pointer; font-family: inherit; }
.fr-sub b { font-size: 14px; } .fr-sub small { font-size: 11.5px; color: var(--muted); }
.fr-sub i { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--w, 0%); background: var(--accent); }
.fr-sub:hover { border-color: var(--accent); } .fr-sub.fin { border-color: #2e7d32; } .fr-sub.all { grid-column: 1 / -1; background: var(--accent-soft); border-color: var(--accent); }
.fr-head { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 10px -4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.fr-grid { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.fr-gn { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 32px; padding: 0 6px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; font-family: inherit; }
.fr-gn.done { background: var(--accent-soft); } .fr-gn.cur { border-color: var(--accent); background: var(--accent); color: #fff; } .fr-gn.fl { box-shadow: inset 0 -3px 0 #e0a800; }
.fr-gn.ok { border-color: #2e7d32; background: #e6f4e7; color: #1b5e20; } .fr-gn.no { border-color: #c62828; background: #fdeaea; color: #b71c1c; }
.fr-q { max-width: 760px; margin: 0 auto; }
.fr-qlabel { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 8px 0; } .fr-qlabel .gt-flag { margin-left: auto; float: none; }
.fr-img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.fr-ans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.fr-ans button { padding: 14px 0; border: 2px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); font-size: 24px; cursor: pointer; font-family: inherit; }
.fr-ans button:hover:not(:disabled) { border-color: var(--accent); } .fr-ans button.pick { background: var(--accent); border-color: var(--accent); color: #fff; }
.fr-ans button.right { background: #2e7d32; border-color: #2e7d32; color: #fff; } .fr-ans button.wrong { background: #c62828; border-color: #c62828; color: #fff; text-decoration: line-through; }
.fr-ans button:disabled { cursor: default; }
.fr-fb { margin: 8px 0; padding: 8px 12px; border-radius: 8px; font-size: 14px; } .fr-fb.g { background: #e6f4e7; color: #1b5e20; } .fr-fb.r { background: #fdeaea; color: #b71c1c; }
.fr-list { display: flex; flex-direction: column; gap: 16px; max-width: 760px; margin: 12px 0; }
.fr-item { padding: 12px; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); background: var(--surface); }
.fr-item.ok { border-left-color: #2e7d32; } .fr-item.no { border-left-color: #c62828; }
.fr-solve { padding: 3px 10px; font-size: 12.5px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fr-fb.g, :root:not([data-theme="light"]) .fr-gn.ok { background: #1d3a20; color: #a5d6a7; } :root:not([data-theme="light"]) .fr-fb.r, :root:not([data-theme="light"]) .fr-gn.no { background: #3d1f1f; color: #ff8a80; } :root:not([data-theme="light"]) .fr-gn.cur { color: #1d0b0a; } :root:not([data-theme="light"]) .fr-ans button.pick { color: #1d0b0a; } }
:root[data-theme="dark"] .fr-fb.g, :root[data-theme="dark"] .fr-gn.ok { background: #1d3a20; color: #a5d6a7; } :root[data-theme="dark"] .fr-fb.r, :root[data-theme="dark"] .fr-gn.no { background: #3d1f1f; color: #ff8a80; } :root[data-theme="dark"] .fr-gn.cur, :root[data-theme="dark"] .fr-ans button.pick { color: #1d0b0a; }
@media (max-width: 560px) { .fr-sum { grid-template-columns: repeat(2, 1fr); } .fr-subs { grid-template-columns: 1fr; } .fr-ans button { font-size: 22px; padding: 12px 0; } }
.fr-ans { position: sticky; bottom: 8px; z-index: 20; padding: 8px; border-radius: 14px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(4px); box-shadow: 0 -2px 10px rgba(0,0,0,.18); }
.fr-kinds { margin: 12px 0 4px; } .fr-kinds .chip { font-size: 14px; padding: 7px 16px; }

/* ── 한국사 타자 연습 (typing.html) ── */
.ty-page { --accent: #8b2e1f; --accent-soft: #f3e1d9; --ty-bg: #1b2433; --ty-fg: #f2f4f8; --ty-dim: #5d6a80; --ty-key: #263246; --ty-line: #34415a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ty-page { --accent: #e08b6f; --accent-soft: #3d2a23; } }
:root[data-theme="dark"] .ty-page { --accent: #e08b6f; --accent-soft: #3d2a23; }
.ty-bar { margin: 12px 0 4px; }
.ty-stage { position: relative; background: var(--ty-bg); color: var(--ty-fg); border-radius: 16px; padding: 14px 16px 18px; margin: 10px 0; text-align: center; box-shadow: var(--shadow); }
.ty-empty p { color: #b7c0cf; padding: 40px 0; margin: 0; }
.ty-top { display: flex; justify-content: center; gap: 22px; font-size: 13px; color: #9aa6ba; font-variant-numeric: tabular-nums; }
.ty-top b { color: var(--ty-fg); font-size: 17px; font-weight: 800; margin-right: 2px; }
.ty-media { display: grid; grid-template-columns: 1fr minmax(0, 2.4fr) 1fr; align-items: center; gap: 12px; margin: 14px 0 6px; }
.ty-main { width: 100%; max-height: 320px; object-fit: contain; border-radius: 10px; background: #fff; justify-self: center; }
.ty-side { display: flex; justify-content: center; }
.ty-side img { max-width: 100%; max-height: 130px; object-fit: contain; opacity: .22; filter: grayscale(1); border-radius: 8px; }
.ty-event { max-width: 640px; margin: 22px auto 10px; padding: 18px 20px; border: 1px solid var(--ty-line); border-radius: 12px; }
.ty-event p { margin: 8px 0 0; font-size: 21px; font-weight: 700; line-height: 1.5; word-break: keep-all; }
.ty-badge { display: inline-block; font-size: 12.5px; font-weight: 700; color: #ffcfbf; background: rgba(224, 139, 111, .18); padding: 2px 10px; border-radius: 999px; }
.ty-q { margin: 8px 0 0; font-size: 18px; font-weight: 700; }
.ty-q small { color: #9aa6ba; font-weight: 500; font-size: 13.5px; }
.ty-line { min-height: 64px; margin: 4px 0 6px; font-size: 44px; font-weight: 900; letter-spacing: .02em; line-height: 1.4; word-break: keep-all; }
.ty-line span { color: var(--ty-dim); transition: color .08s; }
.ty-line span.done { color: var(--ty-fg); }
.ty-line span.part { color: #c9d3e3; text-decoration: underline 3px #7fb8ff; text-underline-offset: 8px; }
.ty-line span.bad { color: #ff8a80; text-decoration: underline 3px #ff8a80; text-underline-offset: 8px; }
.ty-line span.hint { color: #7d8aa1; letter-spacing: .15em; }
.ty-in { display: block; width: min(420px, 100%); margin: 0 auto; padding: 10px 14px; border-radius: 10px; border: 1.5px solid var(--ty-line); background: #121a26; color: var(--ty-fg); font: 700 20px 'Noto Sans KR', sans-serif; text-align: center; outline: none; }
.ty-in:focus { border-color: #7fb8ff; }
.ty-in[readonly] { opacity: .5; }
.ty-msg { margin: 8px 0 0; font-weight: 800; }
.ty-msg span { font-weight: 500; color: #b7c0cf; margin-left: 6px; }
.ty-msg.g { color: #81c784; } .ty-msg.r { color: #ff8a80; }
.ty-info { max-width: 640px; margin: 10px auto 0; padding: 10px 14px; border-radius: 10px; background: rgba(255, 255, 255, .06); font-size: 14.5px; color: #dfe5ee; text-align: left; }
.ty-acts { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ty-stage .gt-btn:not(.main) { background: var(--ty-key); border-color: var(--ty-line); color: var(--ty-fg); }
.ty-stage .gt-link { color: #9aa6ba; }
.ty-sum h2 { margin: 6px 0 10px; }
.ty-sum h3 { margin: 18px 0 6px; font-size: 15px; color: #b7c0cf; }
.ty-nums { list-style: none; padding: 0; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 560px; }
.ty-nums li { background: rgba(255, 255, 255, .06); border-radius: 10px; padding: 10px 4px; font-size: 13px; color: #b7c0cf; }
.ty-nums b { font-size: 22px; color: var(--ty-fg); }
.ty-nums span { display: block; font-size: 12px; }
.ty-wrong { list-style: none; padding: 0; margin: 0 auto; max-width: 640px; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.ty-wrong li { display: flex; gap: 10px; align-items: center; background: rgba(255, 255, 255, .05); border-radius: 10px; padding: 8px 10px; }
.ty-wrong img { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 6px; flex: none; }
.ty-wrong b { color: #ffcfbf; } .ty-wrong p { margin: 2px 0 0; font-size: 13.5px; color: #c6cfdd; }
@media (max-width: 640px) {
  .ty-side { display: none; }
  .ty-media { grid-template-columns: 1fr; }
  .ty-main { max-height: 240px; }
  .ty-line { font-size: 32px; min-height: 48px; }
  .ty-event p { font-size: 18px; }
  .ty-nums { grid-template-columns: repeat(2, 1fr); }
}

.ty-meta { display: block; margin-top: 4px; font-size: 12.5px; color: #9aa6ba; }
.ty-meta b { color: #dfe5ee; } .ty-meta em { font-style: normal; color: #ffb4a2; font-weight: 700; }

/* ── 공통 필터 (js/filters.js): 큰 버튼 + 한 줄 선택 상자 ── */
.f-modes { display: flex; width: 100%; max-width: 560px; margin: 8px auto; border: 1.5px solid var(--accent); border-radius: 12px; overflow: hidden; }
.f-modes button { flex: 1; padding: 10px 8px; border: 0; background: var(--surface); color: var(--text); font-size: 15.5px; font-weight: 800; cursor: pointer; line-height: 1.3; }
.f-modes button + button { border-left: 1.5px solid var(--accent); }
.f-modes button small { display: block; margin-top: 1px; font-size: 11.5px; font-weight: 600; opacity: .75; }
.f-modes button.on, .f-modes button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.f-modes button:disabled { opacity: .4; cursor: default; }
.f-modes.wrap { flex-wrap: wrap; max-width: none; border: 0; border-radius: 0; gap: 6px; overflow: visible; justify-content: center; }
.f-modes.wrap button { flex: 0 1 auto; border: 1.5px solid var(--accent); border-radius: 10px; padding: 8px 14px; }
.f-modes.wrap button + button { border-left: 1.5px solid var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .f-modes button:is(.on, [aria-pressed="true"]) { color: #14110e; } }
:root[data-theme="dark"] .f-modes button:is(.on, [aria-pressed="true"]) { color: #14110e; }
.f-filters { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 16px; margin: 6px 0; }
.f-sel { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.f-sel select { max-width: 220px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: 600 13.5px 'Noto Sans KR', sans-serif; }
.f-multi { position: relative; }
.f-multi summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; color: var(--muted); }
.f-multi summary::-webkit-details-marker { display: none; }
.f-multi summary b { color: var(--text); font-weight: 700; font-size: 13.5px; }
.f-multi summary::after { content: '▾'; font-size: 11px; }
.f-multi[open] summary { border-color: var(--accent); }
.f-multi-list { margin: 8px 0 4px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: flex; flex-wrap: wrap; gap: 6px; }
.f-modes[hidden], .f-filters[hidden] { display: none; }
.f-multi[open] { flex-basis: 100%; }
.f-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: 700 13.5px 'Noto Sans KR', sans-serif; cursor: pointer; }
.f-pill small { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.f-pill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.f-pill[aria-pressed="true"] small { color: rgba(255, 255, 255, .85); }
.fv-filter .f-modes { margin: 6px 0; }
.top-tools .f-modes { margin: 0; max-width: 320px; } .top-tools .f-modes button { font-size: 13px; padding: 6px 10px; }

/* 다중 선택 필터(FILTER.multi) 공통: 목록은 다른 필터를 밀어내지 않고 버튼 아래에 떠서 펼쳐진다 */
.f-multi[open] { flex-basis: auto; }
.f-multi-list { position: absolute; top: 100%; left: 0; z-index: 20; width: max-content; max-width: min(92vw, 380px); margin: 4px 0 0; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.f-filters { align-items: flex-start; }
.ty-clues { margin: 6px 0 4px; padding-left: 20px; text-align: left; font-size: 14px; } .ty-clues li { margin: 1px 0; }
/* 다중 선택 필터 공통: 세로 목록 + 항목 옆 체크 상자 (둥근 알약 모양 없음) */
.f-multi-list { flex-direction: column; flex-wrap: nowrap; padding: 4px; gap: 0; min-width: 150px; }
.f-multi-list .r-chips { flex-direction: column; flex-wrap: nowrap; gap: 0; width: 100%; }
.f-multi-list .r-chips button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font-size: 13.5px; }
.f-multi-list .r-chips button:hover { background: var(--surface-2); }
.f-multi-list .r-chips button::before { content: ''; flex: none; width: 16px; height: 16px; box-sizing: border-box; border: 1.5px solid var(--muted); border-radius: 3px; background: var(--surface) center / 12px no-repeat; }
.f-multi-list .r-chips button[aria-pressed="true"] { background: transparent; color: var(--text); font-weight: 700; }
.f-multi-list .r-chips button[aria-pressed="true"]::before { border-color: var(--accent); background-color: var(--accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l3 3 5-6' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.f-multi-list .r-chips button small { margin-left: auto; padding-left: 10px; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.f-multi-list .r-chips button[aria-pressed="true"] small { color: var(--muted); }

/* ── 첫 화면: 소개 · 시험일 D-day ─────────────────────────── */
.h-hero { margin-bottom: 14px; padding: 20px 18px; border-radius: var(--radius); background: #2f4f6f; color: #fff; }
.h-hero h2 { margin: 0; font-size: 21px; font-weight: 900; line-height: 1.35; }
.h-hero > p { margin: 4px 0 14px; font-size: 14px; color: rgba(255, 255, 255, .85); }
.h-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; counter-reset: step; }
.h-steps li { counter-increment: step; padding: 10px 12px; border-radius: 8px; background: rgba(255, 255, 255, .12); font-size: 12.5px; line-height: 1.45; }
.h-steps b { display: block; font-size: 14.5px; }
.h-steps b::before { content: counter(step) '. '; opacity: .7; }
.h-steps span { color: rgba(255, 255, 255, .8); }
@media (max-width: 600px) { .h-steps { grid-template-columns: minmax(0, 1fr); gap: 6px; } .h-steps li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 8px 12px; } .h-hero h2 { font-size: 19px; } }
.h-dday { position: relative; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 12.5px; cursor: pointer; }
.h-dday b { color: var(--accent); font-size: 14px; font-weight: 900; }
.h-dday.empty { border-style: dashed; background: none; color: var(--muted); font-weight: 700; }
.h-dday.soon { border-color: var(--accent); background: var(--accent-soft); }
.h-dday.past { color: var(--muted); }
.h-dday input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.h-dday:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.h-noscript { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
/* 개인정보처리방침·안내 글의 링크는 테마 색 (기본 파란색은 어두운 화면에서 안 보임) */
.privacy a, .sub-plan a { color: var(--accent); }
.privacy li { margin-bottom: 4px; }
