:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #1c1f26;
  --muted: #5d6673;
  --line: #e4e7ec;
  --accent: #1d4ed8;
  --accent-soft: #e8efff;
  --good: #0f7a4a;
  --good-soft: #e8f6ee;
  --bad: #b42318;
  --bad-soft: #fdeceb;
  --warn: #8a5a00;
  --warn-soft: #fff6df;
  --shadow: none;
  --radius: 16px;
  --font: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "WenQuanYi Micro Hei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-width: 320px;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 750; letter-spacing: -0.03em; }
.logo img { width: 28px; height: 28px; display: block; }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.nav a.is-active, .nav a:hover { background: var(--accent-soft); color: var(--accent); }
.header-progress {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.page { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 13px;
}

.hero { padding: 12px 0 8px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
h1, h2, h3, p, li, label, button, a {
  word-break: keep-all;
  overflow-wrap: break-word;
}
h1, h2, h3 { letter-spacing: -0.03em; margin: 0; }
.panel h1 { font-size: 28px; line-height: 1.3; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.2; max-width: 14ch; }
.lede { max-width: 62ch; color: var(--muted); font-size: 18px; }
.hero-actions, .inline-actions, .wizard-actions, .exam-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.mode-grid, .dash-grid, .submode-grid { display: grid; gap: 14px; }
.mode-grid { grid-template-columns: 0.9fr 1.3fr 0.9fr; margin: 22px 0; }
.card .submode-grid { grid-template-columns: 1fr 1fr; }
.dash-grid { grid-template-columns: 1.1fr 1fr 1fr; }
.submode-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 12px; }
.card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { padding: 18px; }
.card h2, .panel h2 { font-size: 20px; }
.card p, .panel p { color: var(--muted); }
.mode-card { display: flex; flex-direction: column; gap: 8px; min-height: 220px; text-decoration: none; }
.mode-card strong { color: var(--ink); font-size: 18px; }
.submode {
  display: block;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
}
.submode.is-soon { background: #f7f8fa; color: var(--muted); }
.badge, .status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
}
.badge.is-soon, .status-pill.is-idle { background: #eef0f3; color: var(--muted); }
.status-pill.is-good { background: var(--good-soft); color: var(--good); }
.status-pill.is-bad { background: var(--bad-soft); color: var(--bad); }

.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  min-height: 44px;
  padding: 10px 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 650;
}
.btn:hover { border-color: #c9d0da; }
.btn-primary { background: var(--accent); border-color: transparent; color: white; }
.btn-primary:hover { background: #1a43c0; }
.btn-ghost { background: transparent; }
.btn-small { padding: 8px 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; background: #f3f5f8; color: var(--muted); }
.btn-primary:disabled { background: #9db0e4; color: #fff; border-color: transparent; }
.progress-track { height: 8px; background: #e7ebf2; border-radius: 999px; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: var(--accent); }
.stack { display: grid; gap: 10px; }
.muted { color: var(--muted); }
.list { margin: 0; padding-left: 18px; }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.recent-list a {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.problem-list, .step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.problem-list { max-height: 180px; overflow: auto; }
.problem-chip, .step-list button, .q-num {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  min-height: 44px;
  min-width: 44px;
  padding: 6px 10px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
}
.chip-num { font-weight: 750; }
.chip-fn { font-size: 11px; font-weight: 700; }
.chip-state, .q-state, .step-list button span { color: var(--muted); font-size: 12px; }
.problem-chip.is-active, .step-list button.is-active, .q-num.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.problem-chip.is-correct { background: var(--good-soft); }
.problem-chip.is-incorrect { background: var(--bad-soft); }
.problem-chip.is-active.is-correct, .problem-chip.is-active.is-incorrect { background: var(--accent-soft); }
.practice-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.practice-filters label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.practice-filters select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0 8px;
}
.step-list button.is-done { background: var(--good-soft); border-color: transparent; }

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.panel { padding: 18px; display: grid; gap: 12px; }
.sheet-panel { min-width: 0; }
.sheet-widget { display: grid; gap: 8px; }
.formula-bar { display: flex; gap: 8px; align-items: center; }
.name-box {
  min-width: 84px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 6px 8px;
  display: grid;
}
.name-label { color: var(--muted); font-size: 11px; }
.name-addr { font-weight: 750; }
.fx-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 750;
  color: var(--accent);
}
.formula-input-wrap { position: relative; flex: 1; min-width: 0; }
.formula-input, .field input, .field select, .wizard-arg input, .wizard-list input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}
.formula-input:focus, .field input:focus, .field select:focus, .wizard-arg input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.fn-suggest {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.fn-suggest li, .wizard-functions button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
}
.fn-suggest li.is-active, .wizard-functions button.is-active, .wizard-functions button:hover { background: var(--accent-soft); }
.fn-suggest span, .wizard-functions span { color: var(--muted); font-size: 13px; }
.sheet-status { margin: 0; color: var(--muted); font-size: 14px; min-height: 2.5em; }
.sheet-grid { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.sheet-grid .handsontable { font-family: inherit; }
.sheet-grid td.cell-locked { background: #f3f5f8; color: #394049; }
.sheet-grid td.cell-guide { background: #dbe7ff; }
.sheet-grid td.cell-target { box-shadow: inset 0 0 0 2px var(--accent); }
.sheet-grid td.cell-formula-target { box-shadow: inset 0 0 0 2px var(--good); }
.sheet-grid td.cell-number { text-align: right; }
.sheet-grid td.cell-error { color: var(--bad); font-weight: 700; }

.banner { border-radius: 12px; padding: 12px 14px; background: var(--accent-soft); }
.banner.is-good { background: var(--good-soft); color: var(--good); }
.banner.is-bad { background: var(--bad-soft); color: var(--bad); }
.banner.is-warn { background: var(--warn-soft); color: var(--warn); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checks li { border-radius: 10px; padding: 8px 10px; background: #f7f8fa; }
.checks li.is-pass { background: var(--good-soft); }
.checks li.is-fail { background: var(--bad-soft); }
.timer { font-variant-numeric: tabular-nums; font-weight: 750; }
.timer.is-urgent { color: var(--bad); }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; color: var(--muted); }
.check-row { display: flex; align-items: center; gap: 8px; }
.chart-layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr) minmax(220px, 280px);
  gap: 16px;
  padding: 16px 20px;
  align-items: start;
}
.chart-box { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; height: 420px; }
.range-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.range-row .field { flex: 1 1 160px; min-width: 0; }
.range-row .field input, .tools-panel .field input, .tools-panel .field select, .tools-panel .field textarea { width: 100%; min-width: 0; }
.form-error { min-height: 1.2em; margin: 0; color: var(--bad); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: right; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.exam-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.question-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.result-score { font-size: 48px; letter-spacing: -0.04em; margin: 0; }

.wizard {
  position: fixed;
  inset: 12px;
  margin: auto;
  width: min(860px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  border: 0;
  border-radius: 18px;
  padding: 0;
  box-shadow: var(--shadow);
}
.wizard::backdrop { background: rgba(20, 24, 31, 0.45); }
.wizard-head, .wizard-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 16px 18px; }
.wizard-head { border-bottom: 1px solid var(--line); }
.wizard-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 420px; }
.wizard-list, .wizard-detail { padding: 16px; display: grid; align-content: start; gap: 10px; }
.wizard-list { border-right: 1px solid var(--line); }
.wizard-functions { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 360px; overflow: auto; }
.wizard-functions button { width: 100%; border: 0; background: transparent; text-align: left; }
.wizard-args { display: grid; gap: 8px; }
.sheet-ribbon { border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); margin-bottom: 8px; min-width: 0; }
.format-dialog-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.qlick-cell-format { max-height: 85vh; overflow-y: auto; width: min(640px, 92vw); }
.sheet-tool-dialog { width: min(600px, 92vw); max-height: 85vh; overflow-y: auto; display: block; }
.sheet-tool-dialog:not([open]) { display: none; }
.sheet-tool-dialog .field { margin: 8px 0; }
.sheet-chart-panel { padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-top: 12px; }
.sheet-chart-canvas { position: relative; height: 300px; min-width: 0; }
.chart-object-stage { position: relative; min-height: 340px; overflow: hidden; }
.chart-object { box-sizing: border-box; padding: 28px 8px 10px; outline: none; }
.chart-object.is-selected { outline: 2px solid #1677ff; outline-offset: -2px; z-index: 2; }
.chart-drag-handle { position: absolute; top: 0; left: 0; right: 0; height: 24px; background: #eaf6ff; color: #102452; cursor: move; touch-action: none; user-select: none; padding: 2px 8px; font-size: 12px; }
.chart-object-actions { position: absolute; top: 0; right: 8px; display: none; gap: 4px; }
.chart-object-actions button { font: inherit; font-size: 12px; cursor: pointer; }
.chart-object.is-selected .chart-object-actions { display: flex; }
.chart-resize-handle { display: none; position: absolute; width: 12px; height: 12px; padding: 0; border: 1px solid #1677ff; background: white; touch-action: none; }
.chart-object.is-selected .chart-resize-handle { display: block; }
.chart-resize-nw { top: 0; left: 0; cursor: nwse-resize; }
.chart-resize-ne { top: 0; right: 0; cursor: nesw-resize; }
.chart-resize-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.chart-resize-se { bottom: 0; right: 0; cursor: nwse-resize; }
.ribbon-color label { display: inline-flex; align-items: center; gap: 2px; }
.ribbon-color-reset { padding: 0 3px; min-width: 18px; border: 0; background: transparent; cursor: pointer; }
.ribbon-color-reset:focus-visible { outline: 2px solid #1d4ed8; }
.study-bar #exam-written-progress { width: 100px; height: 8px; flex: none; }
.ribbon-tabs, .ribbon-commands { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; }
.ribbon-tabs { border-bottom: 1px solid var(--line); }
.ribbon-tabs button { border: 0; border-radius: 6px; padding: 8px 16px; background: transparent; cursor: pointer; color: inherit; }
.ribbon-tabs button[aria-selected="true"] { background: var(--accent-soft); font-weight: 700; }
.ribbon-commands button { white-space: normal; min-height: 36px; }
@media (max-width: 480px) { .ribbon-tabs button { padding: 8px 12px; } .ribbon-commands { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wizard.is-picking { inset: 12px 12px auto; margin: 0 auto; }
.wizard.is-picking .wizard-body { display: none; }
.wizard-original { overflow-wrap: anywhere; white-space: pre-wrap; }
.shortcut-help { width: min(760px, 92vw); max-height: 85vh; border: 1px solid var(--line); border-radius: 14px; padding: 0; }
.shortcut-help::backdrop { background: rgba(20, 24, 31, 0.45); }
.shortcut-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; padding: 0 20px 20px; }
.shortcut-note { padding: 0 20px; }
.shortcut-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.shortcut-list li { display: flex; gap: 12px; justify-content: space-between; font-size: 13px; }
.shortcut-list kbd { white-space: nowrap; background: var(--accent-soft); padding: 2px 5px; border-radius: 4px; }
.wizard-arg { display: grid; gap: 4px; font-size: 13px; }
.syntax { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #f6f7f9; border-radius: 8px; padding: 8px 10px; }
.wizard-preview { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; }
.wizard-error { color: var(--bad); min-height: 1.2em; margin: 0; }
.home-intro { padding: 8px 0 0; }
.home-intro h1 { font-size: clamp(32px, 4vw, 44px); line-height: 1.25; }
.first-tip { margin: 12px 0 0; color: var(--ink); }
.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.choice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
}
.choice h2 { font-size: 22px; }
.choice p { margin: 0; color: var(--muted); }
.choice .btn { align-self: flex-start; }
.soon-note { font-size: 14px; }
.history { margin-top: 40px; display: grid; gap: 12px; }
.continue-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
}

body.study, body.is-exam {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.study .study-main,
body.study .chart-layout,
body.is-exam .exam-screen {
  flex: 1;
  min-height: 0;
}
body.study .study-main,
body.study .chart-layout,
body.is-exam .exam-main {
  overflow: hidden;
}
body.study .task-panel,
body.study .tools-panel,
body.study .chart-stage,
body.is-exam .task-panel,
body.is-exam .sheet-panel {
  max-height: 100%;
  overflow: auto;
}
body.study .sheet-panel { height: 100%; }
body.study .nav, body.is-exam .nav, body.study .site-footer, body.is-exam .site-footer { display: none; }
.study-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.study-bar a { color: var(--accent); font-weight: 700; text-decoration: none; }
.study-bar .timer { margin-left: auto; }
.study-main {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 16px;
  padding: 16px 20px 20px;
  align-items: start;
}
.task-panel { display: grid; gap: 12px; align-content: start; }
.task-panel h1, .task-panel h2 { font-size: 22px; line-height: 1.35; }
.task-panel p { margin: 0; }
.action-bar {
  position: sticky;
  bottom: 0;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
}
.action-bar .question-nav { margin-right: auto; }
.sheet-panel { min-width: 0; overflow-x: auto; }
.sheet-widget { min-width: 640px; }

.chart-stage { min-width: 0; display: grid; gap: 12px; align-content: start; }
.tools-panel { display: grid; gap: 8px; align-content: start; max-height: calc(100vh - 150px); overflow: auto; }
.tools-panel details, .data-fold {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.tools-panel summary, .data-fold summary { cursor: pointer; font-weight: 700; }
.tools-panel details[open] summary, .data-fold[open] summary { margin-bottom: 10px; }

.exam-screen { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.exam-chart { height: 260px; }
.exam-note { margin-top: 12px; }
.exam-main { flex: 1; }
.result-panel { display: grid; gap: 12px; max-width: 720px; }
.score-facts { display: flex; gap: 16px; margin: 0; padding: 0; list-style: none; font-weight: 700; }
.result-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.result-item summary { display: flex; justify-content: space-between; gap: 12px; cursor: pointer; font-weight: 700; }
.confirm-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 0;
  border-radius: 16px;
  padding: 22px;
}
.confirm-dialog::backdrop { background: rgba(20, 24, 31, 0.45); }
.confirm-dialog h2 { font-size: 22px; margin-bottom: 8px; }
.format-tools, .tool-panel { display: grid; gap: 10px; }
.tool-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}
.range-row { display: flex; gap: 6px; align-items: end; }
.range-row .field { flex: 1; min-width: 0; }
.rule-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rule-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fbfcfe;
}
.rule-list p { margin: 0; font-size: 13px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
}
.swatch.is-active, #fmt-bold.is-active, [data-align].is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.swatch-dot { width: 12px; height: 12px; border-radius: 99px; display: inline-block; flex: none; }
.sheet-grid td.qlick-color-ink { color: #1c1f26 !important; }
.sheet-grid td.qlick-color-blue { color: #1d4ed8 !important; }
.sheet-grid td.qlick-color-red { color: #b42318 !important; }
.sheet-grid td.qlick-fill-yellow { background-color: #fff3bf !important; }
.sheet-grid td.qlick-fill-blue { background-color: #e8efff !important; }
.sheet-grid td.qlick-fill-green { background-color: #e8f6ee !important; }
.sheet-grid td.qlick-border-all { box-shadow: inset 0 0 0 2px #1c1f26; }
.sheet-grid td.qlick-border-bottom { box-shadow: inset 0 -2px 0 #1c1f26; }
.confirm-dialog p { margin: 0 0 16px; color: var(--muted); }

@media (max-width: 960px) {
  .mode-grid, .dash-grid, .chart-layout, .workspace, .wizard-body, .submode-grid, .choice-grid, .study-main {
    grid-template-columns: 1fr;
  }
  .site-header { flex-wrap: wrap; padding: 12px; }
  .header-progress { width: 100%; }
  .hero h1 { max-width: none; }
  .tools-panel { max-height: none; }
  .study-bar { flex-wrap: wrap; gap: 8px 16px; }
  .action-bar .question-nav { margin-right: 0; width: 100%; }
  .chart-box { height: 280px; }
  .range-row { align-items: stretch; }
  .action-bar .btn { flex: 1 1 calc(50% - 8px); }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* Learning areas and workbook chrome */
.learning-areas{grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}.area-card{display:block;color:inherit;text-decoration:none;transition:transform .15s,box-shadow .15s}.area-card:hover{transform:translateY(-3px);box-shadow:0 10px 25px #152b4814}.area-number{font-size:13px;font-weight:800;color:var(--accent,#2563eb)}.area-card h2{margin:16px 0 8px}.area-card>span:last-child{display:block;margin-top:24px;color:#2563eb;font-weight:700}.exam-entry{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:24px;margin:24px 0;background:#eff6ff;border:1px solid #dbeafe;border-radius:16px}.exam-entry h2{margin:0}.exam-entry p{margin-bottom:0}.extra-learning{margin:24px 0;padding:16px;border:1px solid #e2e8f0;border-radius:12px}.extra-learning summary,.lesson-group summary,.lesson-tools summary,.lesson-picker summary{cursor:pointer;font-weight:700}.learning-filters{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:24px 0}.learning-filters select{padding:8px;border:1px solid #cbd5e1;border-radius:6px}.lesson-group{border:1px solid #dbe3ee;border-radius:12px;overflow:hidden;margin:16px 0}.lesson-group summary{padding:18px;background:#f8fafc}.lesson-row{display:grid;grid-template-columns:38px minmax(180px,1fr) 120px 60px 76px 60px;align-items:center;gap:14px;padding:17px 20px;border-top:1px solid #e2e8f0;text-decoration:none;color:#334155;font-size:14px}.lesson-row:hover{background:#eff6ff}.lesson-number{font-variant-numeric:tabular-nums;color:#64748b}.lesson-row .is-incorrect{color:#be123c}.lesson-context{margin-bottom:12px}.lesson-context a{font-size:13px}.eyebrow{color:#64748b;font-weight:700;font-size:12px;margin:12px 0 4px}.instruction-target{font-size:13px;background:#eff6ff;padding:10px 12px;border-radius:8px;color:#1e40af}.task-panel #problem-prompt,.task-panel #chart-prompt{white-space:pre-line;line-height:1.8;font-size:15px;color:#172554}.lesson-tools,.lesson-picker{border-top:1px solid #e2e8f0;border-bottom:1px solid #e2e8f0;padding:14px 0;margin:16px 0}.lesson-tools[open]>summary,.lesson-picker[open]>summary{margin-bottom:16px}.help-menu{position:relative;margin-left:auto;flex-shrink:0}.help-menu summary{cursor:pointer;font-size:13px;padding:10px}.help-popover{position:absolute;right:0;top:40px;z-index:1000;background:white;border:1px solid #dbe3ee;border-radius:10px;box-shadow:0 8px 24px #0002;min-width:170px;padding:12px;display:grid;gap:12px}.help-popover a{padding:6px;font-size:13px}.ribbon-commands{flex-wrap:wrap}.ribbon-field{display:inline-flex;align-items:center;gap:5px;font-size:11px;color:#475569}.ribbon-field select{max-width:110px;min-height:30px;border:1px solid #dbe3ee;border-radius:4px;background:white}.ribbon-field input[type=color]{width:30px;height:28px;padding:2px;border:1px solid #dbe3ee}.sheet-tabs{display:flex;align-items:center;background:#f1f5f9;border-top:1px solid #cbd5e1;min-height:30px;padding:0 20px}.sheet-tab{font-size:12px;padding:6px 22px;border-bottom:3px solid #2563eb;background:white;font-weight:700}.formula-value{flex:1;min-width:100px;padding:8px;border:1px solid #cbd5e1;border-radius:4px}.study-main>.task-panel{max-height:calc(100vh - 170px);overflow:auto;position:sticky;top:12px;align-self:start}.chart-layout>.task-panel{align-self:start;position:sticky;top:12px;max-height:calc(100vh - 170px);overflow:auto}
@media(max-width:1100px){.learning-areas{grid-template-columns:repeat(2,minmax(0,1fr))}.lesson-row{grid-template-columns:30px minmax(130px,1fr) 100px 55px 70px 55px;gap:8px}.site-header{flex-wrap:wrap}.nav{overflow:auto;max-width:100%}.ribbon-commands{max-height:150px;overflow:auto}}
@media(max-width:700px){.learning-areas{grid-template-columns:1fr}.exam-entry{align-items:start;flex-direction:column}.lesson-row{grid-template-columns:28px minmax(0,1fr) 60px}.lesson-row span:nth-child(3),.lesson-row span:nth-child(4){display:none}.lesson-row strong{grid-column:2 / 4}.study-main>.task-panel,.chart-layout>.task-panel{position:relative;top:0;max-height:none}.sheet-panel,.chart-stage{min-width:0}.action-bar{flex-wrap:wrap}.help-menu{margin-left:0}}

.file-menu{position:relative;flex-shrink:0}.file-menu summary{cursor:pointer;font-size:13px;padding:10px}.sheet-widget{min-width:0}.sheet-ribbon{min-width:0}.formula-bar{flex-wrap:wrap}.formula-input-wrap{min-width:140px}.lesson-row>span{font-size:12px}.study-main{grid-template-columns:minmax(270px,340px) minmax(0,1fr)}
@media(max-width:850px){body.study{height:auto;min-height:100vh;overflow:auto}body.study .study-main,body.study .chart-layout{overflow:visible;display:grid;grid-template-columns:1fr}body.study .task-panel,body.study .tools-panel,body.study .chart-stage{max-height:none;overflow:visible}body.study .sheet-panel{height:auto;min-height:360px}.study-main>.task-panel,.chart-layout>.task-panel{position:relative;top:0;max-height:none}.study-bar{flex-wrap:wrap;gap:8px}.ribbon-commands{max-height:none}.sheet-tabs{position:relative}}

.problem-instructions{position:sticky;top:0;z-index:3;background:#fff;padding:0 0 14px;border-bottom:1px solid #e2e8f0;max-height:52vh;overflow:auto;display:grid;gap:12px}.problem-instructions h1{margin:0}.problem-instructions .list{margin:0;padding-left:20px}.problem-instructions .lesson-context{margin:0}.task-panel>.lesson-tools{margin-top:0}
@media(max-width:850px){.problem-instructions{position:relative;max-height:none}}

/* Desktop workbook: one viewport, one sheet scroll area, independent task pane. */
@media (min-width: 960px) {
  body[data-input-mode="pc"].workbook-mode .workbook-main > .chart-stage { overflow-y: auto; }
  body[data-input-mode="pc"].workbook-mode .workbook-main .chart-stage > #chart-sheet { flex: 1 0 420px; }
}
body.workbook-mode{height:100dvh;min-height:0;overflow:hidden;display:flex;flex-direction:column;background:#f3f5f8}
.workbook-mode #header{flex:none;z-index:30}.workbook-mode #header>.site-header{display:none}.workbook-titlebar{height:38px;display:flex;align-items:center;gap:10px;padding:0 14px;background:#1d4ed8;color:white}.workbook-brand{display:flex;align-items:center;gap:7px;color:white;text-decoration:none;font-weight:800}.workbook-brand img{width:23px;height:23px}.quick-tool{border:0;background:transparent;color:inherit;padding:5px 9px;border-radius:4px;font-size:12px;cursor:pointer;white-space:nowrap}.quick-tool:hover{background:#ffffff26}.quick-tool:disabled{opacity:.4;cursor:default}.workbook-document{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.workbook-save{font-size:11px;white-space:nowrap;color:#dbeafe}.workbook-save.is-error{color:#fef08a}.workbook-mode .study-bar{height:28px;min-height:28px;padding:2px 12px;font-size:11px;gap:12px;flex:none}.workbook-mode .study-bar .timer{font-variant-numeric:tabular-nums}.workbook-mode .workbook-main{flex:1;display:grid;grid-template-columns:minmax(0,1fr) 5px var(--problem-width,340px);grid-template-rows:minmax(0,1fr);gap:0;padding:0;min-height:0;overflow:hidden;align-items:stretch;width:100%;max-width:none}.workbook-main>.sheet-panel,.workbook-main>.chart-stage{grid-column:1;grid-row:1;min-height:0;min-width:0;overflow:hidden;height:100%;padding:0}.workbook-main>.problem-pane{grid-column:3;grid-row:1;height:100%;max-height:none!important;position:static;min-width:0;overflow:auto!important;padding:16px;background:#fff;display:block;border-left:1px solid #e2e8f0}.workbook-main>.problem-pane>*{margin-bottom:14px}.workbook-mode .problem-instructions{position:static;max-height:none;overflow:visible;padding:0 0 14px}.workbook-mode .problem-pane h1{font-size:19px}.workbook-mode .problem-pane .btn{font-size:12px;padding:6px 10px}.workbook-mode .problem-pane .action-bar{position:static;display:flex;padding:10px 0;gap:6px;border-top:1px solid #e2e8f0;box-shadow:none;justify-content:start}.panel-resizer{grid-column:2;grid-row:1;cursor:col-resize;background:#e2e8f0;touch-action:none}.panel-resizer:hover,.panel-resizer:focus{background:#93c5fd;outline:2px solid #2563eb;outline-offset:-2px}.workbook-main.problem-panel-closed{grid-template-columns:minmax(0,1fr)}.workbook-main.problem-panel-closed>.panel-resizer,.workbook-main.problem-panel-closed>.problem-pane{display:none}.workbook-main .sheet-panel>div{height:100%;min-height:0}.workbook-main .sheet-widget{height:100%;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:white;border-radius:0}.workbook-mode .sheet-grid{flex:1 1 0!important;min-height:0!important;overflow:hidden!important;height:0!important}.workbook-mode .sheet-grid .handsontable{font-size:13px}.workbook-mode .sheet-status{flex:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:10px;line-height:16px;margin:0;padding:0 10px;height:16px;background:#f8fafc;color:#64748b}.workbook-mode .formula-bar{height:35px;min-height:35px;display:flex;flex-wrap:nowrap;padding:3px 7px;gap:3px;background:#fff;border-bottom:1px solid #dbe3ee;flex:none}.workbook-mode .name-box{padding:0;border:0;background:transparent;min-width:92px}.workbook-mode .name-label{display:none}.workbook-mode .name-addr{width:100px;font-size:12px;font-weight:500;padding:4px 7px;border:1px solid #cbd5e1;border-radius:3px;height:27px}.formula-command{border:0;background:transparent;font-size:18px;color:#475569;min-width:27px;cursor:pointer}.formula-command:hover{background:#eff6ff}.workbook-mode .formula-input-wrap{flex:1;min-width:80px}.workbook-mode .formula-input,.workbook-mode .formula-value{height:27px;border:1px solid #cbd5e1;font-size:12px;padding:4px 7px;min-width:40px}.workbook-mode .fx-btn{font-size:16px;min-width:28px;padding:2px 5px}.workbook-mode .sheet-tabs{height:29px;min-height:29px;flex:none;padding:0 10px;background:#f1f5f9;gap:14px;overflow:hidden}.sheet-tabs .selection-summary{margin-left:auto;font-size:11px;white-space:nowrap;color:#475569;overflow:hidden;text-overflow:ellipsis}.sheet-zoom{display:flex;align-items:center;gap:6px;font-size:11px;flex:none}.sheet-zoom input{width:85px}.sheet-zoom output{width:33px}.workbook-mode .sheet-tab{padding:5px 20px;font-size:11px}.hide-gridlines .htCore td:not(.area){border-color:transparent!important}.workbook-mode .sheet-ribbon{flex:none;min-height:0;border:0;border-bottom:1px solid #cbd5e1;background:#f8fafc}.workbook-mode .ribbon-tabs{height:29px;padding:0 8px;gap:2px;border-bottom:1px solid #e2e8f0;display:flex;overflow-x:auto;scrollbar-width:thin}.workbook-mode .ribbon-tabs button{font-size:12px;border:0;border-radius:0;padding:4px 13px;white-space:nowrap;background:transparent;color:#334155}.workbook-mode .ribbon-tabs button[aria-selected=true]{background:white;color:#1d4ed8;box-shadow:inset 0 -2px #1d4ed8}.workbook-mode .ribbon-tabs button:disabled{color:#94a3b8}.workbook-mode .ribbon-commands{height:99px;max-height:none;overflow-x:auto;overflow-y:hidden;display:flex;flex-wrap:nowrap;align-items:stretch;gap:0;padding:3px 6px 1px;scrollbar-width:thin}.ribbon-group{flex:0 0 auto;border-right:1px solid #dbe3ee;padding:0 8px;display:flex;flex-direction:column;min-width:65px;max-width:330px}.ribbon-group-tools{display:flex;flex-flow:column wrap;align-content:start;align-items:start;gap:3px;height:74px;min-width:50px}.ribbon-group-title{text-align:center;font-size:10px;color:#64748b;line-height:17px;height:17px;flex:none}.ribbon-tool{display:flex;align-items:center;gap:4px;border:1px solid transparent;background:transparent;border-radius:3px;min-height:22px;height:22px;font-size:11px;line-height:16px;padding:1px 5px;color:#334155;cursor:pointer;white-space:nowrap}.ribbon-tool:hover{background:#e8efff;border-color:#bfdbfe}.ribbon-tool[aria-pressed=true]{background:#dbeafe;border-color:#93c5fd;color:#1e40af}.ribbon-tool:disabled{opacity:.4;cursor:default}.ribbon-icon{font-size:16px;display:inline-block;text-align:center;min-width:18px;font-family:Arial,sans-serif}.ribbon-large{height:71px;flex-direction:column;justify-content:center;padding:4px 10px}.ribbon-large .ribbon-icon{font-size:30px;line-height:34px}.ribbon-tool[data-command=bold] .ribbon-icon{font-weight:800}.ribbon-tool[data-command=italic] .ribbon-icon{font-style:italic}.ribbon-tool[data-command=underline] .ribbon-icon{text-decoration:underline}.ribbon-group-tools select{height:22px;font-size:11px;padding:0 4px;border:1px solid #cbd5e1;border-radius:3px;background:white;max-width:115px}.ribbon-group-tools select[aria-label=크기]{width:48px}.ribbon-color{display:flex;align-items:center;height:22px;gap:3px;font-size:14px;cursor:pointer}.ribbon-color input{width:28px;height:21px;border:0;background:transparent;padding:0}.ribbon-unavailable{font-size:10px;color:#94a3b8;max-width:90px;white-space:normal;line-height:14px}.ribbon-collapsed .ribbon-commands{display:none!important}.workbook-chart-tools>summary{font-weight:700;cursor:pointer}.workbook-chart-tools .tools-panel{display:block;max-height:none;overflow:visible}.workbook-chart-tools .tools-panel>*{margin:8px 0}.workbook-main>.chart-stage{display:flex;flex-direction:column}.workbook-main .chart-stage>.chart-box{order:2;height:32%;min-height:150px;flex:0 0 32%;border-radius:0;overflow:hidden}.workbook-main .chart-stage>#chart-sheet{order:1;flex:1;min-height:0}.workbook-main .chart-stage>.data-fold{display:none}.workbook-mode #mock-root.exam-screen{display:flex;flex:1;min-height:0;flex-direction:column;width:100%;max-width:none;padding:0}.workbook-mode .exam-main .task-panel #exam-tools{font-size:12px}.workbook-mode .exam-main .question-nav{width:100%}
@media(max-width:900px){.workbook-mode .workbook-main{--problem-width:290px}.workbook-titlebar{gap:3px;padding:0 6px}.workbook-document{max-width:38vw}.ribbon-group{max-width:310px}}
@media(max-width:650px){.workbook-mode .workbook-main{position:relative;grid-template-columns:minmax(0,1fr)}.workbook-main>.problem-pane{position:absolute;right:0;top:0;bottom:0;width:min(88vw,340px);z-index:20;box-shadow:-8px 0 24px #0f172a26}.workbook-main>.panel-resizer{display:none}.workbook-save{display:none}.workbook-mode .study-bar{font-size:10px}.selection-summary{display:none}.workbook-mode .sheet-zoom input{width:55px}.workbook-mode .ribbon-tabs button{padding:4px 9px}.workbook-mode .formula-bar .name-addr{width:76px}.workbook-mode .name-box{min-width:76px}.workbook-document{max-width:30vw}.workbook-mode .sheet-status{height:15px}.workbook-mode .study-bar{overflow:hidden;white-space:nowrap;flex-wrap:nowrap}}

.ribbon-group{width:150px;max-width:none}.ribbon-group[aria-label=클립보드]{width:170px}.ribbon-group[aria-label=글꼴]{width:230px}.ribbon-group[aria-label=맞춤]{width:250px}.ribbon-group[aria-label="표시 형식"]{width:160px}.ribbon-group[aria-label=스타일]{width:140px}.ribbon-group[aria-label=셀]{width:120px}.ribbon-group[aria-label=편집]{width:245px}.ribbon-group[aria-label="정렬 및 필터"]{width:260px}.ribbon-group[aria-label="데이터 도구"]{width:340px}.ribbon-group-tools{flex-flow:row wrap;align-content:start;align-items:center;gap:2px;height:74px}.ribbon-large{float:left;height:70px}.ribbon-group[aria-label=클립보드] .ribbon-group-tools{display:grid;grid-template-rows:repeat(3,22px);grid-auto-flow:column}.ribbon-group[aria-label=클립보드] .ribbon-large{grid-row:1 / 4}.ribbon-tool-label{max-width:110px;overflow:hidden;text-overflow:ellipsis}.ribbon-group[aria-label=글꼴] .ribbon-tool-label,.ribbon-group[aria-label=맞춤] .ribbon-tool-label{display:none}.ribbon-group[aria-label=글꼴] .ribbon-tool,.ribbon-group[aria-label=맞춤] .ribbon-tool{min-width:26px;justify-content:center}.workbook-mode .ribbon-tabs .ribbon-toggle{margin-left:auto;font-size:18px;padding:2px 10px}

.workbook-mode .ribbon-commands .ribbon-tool{min-height:22px;height:22px;white-space:nowrap}.workbook-mode .ribbon-commands .ribbon-large{height:70px;min-height:70px}.workbook-mode .ribbon-tabs{overflow-y:hidden;flex-wrap:nowrap}.workbook-mode .sheet-ribbon{margin:0;border-radius:0}.workbook-mode .sheet-grid{border-radius:0}.workbook-mode .ribbon-group-tools .ribbon-tool-label{white-space:nowrap}

.ribbon-group-tools{overflow:hidden}.ribbon-group[aria-label=클립보드] .ribbon-group-tools{grid-template-columns:44px 70px 28px;grid-template-rows:repeat(3,22px)}.ribbon-group[aria-label=클립보드] [data-command=paste]{grid-column:1;grid-row:1/4}.ribbon-group[aria-label=클립보드] [data-command=cut]{grid-column:2;grid-row:1}.ribbon-group[aria-label=클립보드] [data-command=copy]{grid-column:2;grid-row:2}.ribbon-group[aria-label=클립보드] [data-command=copyFormat]{grid-column:2;grid-row:3}.ribbon-group[aria-label=클립보드] [data-command=pasteFormat]{grid-column:3;grid-row:3}.ribbon-group[aria-label=클립보드] [data-command=pasteFormat] .ribbon-tool-label{display:none}.ribbon-group[aria-label="표시 형식"] .ribbon-tool-label{display:none}.ribbon-group[aria-label="표시 형식"] select{width:100%;max-width:none}.ribbon-group[aria-label=셀] .ribbon-tool{font-size:10px}.ribbon-group[aria-label=셀] .ribbon-unavailable{font-size:9px}

.workbook-mode textarea.formula-input,.workbook-mode textarea.formula-value{resize:none;overflow:auto;line-height:18px;white-space:pre-wrap;font-family:inherit;display:block;width:100%}.workbook-mode textarea.formula-value{flex:1;width:auto}.formula-expand{border:0;background:transparent;color:#475569;cursor:pointer;align-self:flex-start;font-size:16px;padding:0 5px;min-width:24px}.workbook-mode .formula-expanded .formula-bar{height:88px;min-height:88px;align-items:flex-start}.workbook-mode .formula-expanded .formula-input-wrap{height:80px}.workbook-mode .formula-expanded textarea.formula-input,.workbook-mode .formula-expanded textarea.formula-value{height:80px;min-height:80px}.ribbon-tool:focus-visible,.formula-command:focus-visible,.formula-expand:focus-visible,.ribbon-tabs button:focus-visible,.quick-tool:focus-visible{outline:2px solid #f59e0b;outline-offset:-2px}.solution-guidance{border:1px solid #dbe3ee;border-radius:8px;padding:10px;margin-top:12px;font-size:13px}.solution-guidance summary{cursor:pointer;font-weight:700}.solution-guidance p{line-height:1.8;margin-top:10px}.learning-filters{flex-wrap:wrap}

#lab-book,.workbook-sheet-host{height:100%;min-height:0}.workbook-sheet-host[hidden]{display:none!important}.workbook-sheet-buttons{display:flex;gap:2px;flex:none}.workbook-sheet-buttons .sheet-tab{cursor:pointer;border:0;border-bottom:3px solid transparent}.workbook-sheet-buttons .sheet-tab[aria-selected=true]{border-bottom-color:#2563eb;color:#1d4ed8;font-weight:800}

.analytics-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px}.analytics-cards strong{display:block;font-size:28px;margin-top:12px}.learning-links{display:flex;gap:10px;flex-wrap:wrap}#analytics>.panel{margin:20px 0}#analytics progress{width:100%;height:14px}.result-panel .print-result{margin:12px 0}@media print{#header,.result-panel>.inline-actions,.print-result,.exam-note{display:none!important}.result-panel details{break-inside:avoid}.result-panel details>*{display:block!important}.result-panel{box-shadow:none;border:0}}

.wizard-arg.is-active{background:#eff6ff;border-left:3px solid #2563eb;padding-left:8px}.wizard-list>select{width:100%;padding:7px;margin-bottom:8px}.wizard-arg small{font-size:11px}

.workbook-mode textarea.formula-input,.workbook-mode textarea.formula-value{overflow-y:hidden}.workbook-mode .formula-expanded textarea.formula-input,.workbook-mode .formula-expanded textarea.formula-value{overflow-y:auto}

/* Presentation: readable controls, restrained home, compact workbooks. */
.home-intro{background:#fff;border:1px solid var(--line);border-radius:20px;padding:clamp(24px,5vw,58px);margin:12px 0 28px;border-top:5px solid var(--accent)}.home-eyebrow{font-size:12px;letter-spacing:.08em;color:var(--accent);font-weight:800}.home-intro h1{font-size:clamp(32px,4.4vw,52px);line-height:1.3;letter-spacing:-.04em;margin:18px 0}.home-intro .lede{max-width:650px;color:var(--muted);font-size:18px;line-height:1.8}.home-actions{display:flex;gap:12px;flex-wrap:wrap;margin:28px 0 16px}.home-actions .btn{min-height:46px;display:inline-flex;align-items:center}.home-method{font-size:13px;color:var(--muted)}.grading-summary{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;padding:14px;border:1px solid #cbd5e1;border-radius:10px;background:#f8fafc;margin:12px 0}.grading-summary strong{font-size:24px;color:#1e40af}.grading-summary small{flex-basis:100%;color:#64748b;font-size:11px}.checks li{line-height:1.7}.checks .is-fail{border-left:3px solid var(--bad);padding-left:10px}
@media(max-width:1100px) and (min-width:851px){.workbook-mode .workbook-main{grid-template-columns:minmax(0,1fr) 5px min(var(--problem-width,300px),34vw)}.workbook-main>.problem-pane{padding:12px;font-size:13px}}
@media(max-width:850px){.workbook-mode .ribbon-commands{height:102px;min-height:102px;max-height:102px;overflow-x:auto;overflow-y:hidden;display:flex}.workbook-mode .workbook-titlebar{padding:0 8px;gap:4px}.workbook-document{min-width:0}.workbook-save{display:none}.workbook-mode .sheet-panel{min-height:280px}}
@media(max-height:720px){.workbook-mode .ribbon-commands{height:96px;min-height:96px;max-height:96px}.workbook-mode .ribbon-group-tools{min-height:70px}.workbook-mode .study-bar{height:25px;min-height:25px}}

#lesson-search{min-width:180px;flex:1;max-width:400px;padding:9px 12px;border:1px solid #cbd5e1;border-radius:7px}.problem-timing{font-size:12px;margin:4px 0 0}

#courses>.panel{padding:24px;margin:20px 0}.learning-path ol{line-height:2}.learning-path progress{width:100%;height:12px}.diagnostic-banner{display:block;font-size:12px}.learning-path:target{outline:2px solid var(--accent);outline-offset:3px}

#workbench-book{height:100%;min-height:0}#workbench-tools h2{font-size:16px;margin:16px 0 8px}#workbench-tools .btn{font-size:12px;padding:7px 9px}#workbench-grade-buttons{display:flex;gap:6px;flex-wrap:wrap;margin:16px 0}#workbench-feedback{line-height:1.7}

.guide-highlight{outline:3px solid #b45309!important;outline-offset:2px}.live-guide{border:2px solid #1d4ed8;padding:10px;margin:8px 0;background:#eff6ff}.live-guide button:focus-visible,#action-timeline summary:focus-visible{outline:3px solid #b45309}#action-timeline{margin-top:14px;overflow-wrap:anywhere}

.comparison-scroll{overflow-x:auto}.answer-comparison{width:100%;border-collapse:collapse;font-size:12px}.answer-comparison th,.answer-comparison td{padding:7px;border:1px solid var(--line);text-align:left;vertical-align:top;min-width:75px}.answer-comparison [data-verdict=fail] th{border-left:4px solid #b42318}.work-review dd{margin:4px 0 10px;white-space:pre-wrap;overflow-wrap:anywhere}.work-review [data-review-status]:focus{outline:2px solid #1d4ed8}

.review-target-outline{outline:3px dashed #b42318!important;outline-offset:-3px}.live-guide progress{width:100%}[data-review-highlight]:focus-visible,[data-review-retry]:focus-visible{outline:3px solid #1d4ed8}

.comparison-value{white-space:pre-wrap;overflow-wrap:anywhere;max-height:18rem;overflow:auto;font:inherit;margin:0}.answer-comparison td{vertical-align:top}
/* Tablet is an input preference, not a width-only replacement of the PC UI. */
.tablet-tools,.tablet-touch-menu{display:none}.device-mode{font:inherit;font-size:12px;max-width:90px;min-height:30px;border:1px solid #cbd5e1;border-radius:5px;color:#172554;background:white}
body[data-input-mode=tablet] .tablet-tools{display:flex;align-items:center;gap:6px;overflow-x:auto;flex-shrink:0;padding:4px 8px;background:#f8fafc;border-bottom:1px solid #dbe3ee;scrollbar-width:thin}
body[data-input-mode=tablet] .tablet-tools .btn,body[data-input-mode=tablet] .tablet-touch-menu .btn{min-height:44px;min-width:44px;white-space:nowrap;flex-shrink:0}
body[data-input-mode=tablet] .tablet-touch-menu:not([hidden]){display:flex;gap:8px;flex-wrap:wrap;padding:8px;border:2px solid #2563eb;background:#eff6ff}
body[data-input-mode=tablet] .ribbon-tool{min-height:38px;padding:5px 9px}body[data-input-mode=tablet] .ribbon-large{height:auto}body[data-input-mode=tablet] .ribbon-group-tools select{height:36px}body[data-input-mode=tablet] .ribbon-color input{height:34px}body[data-input-mode=tablet] .ribbon-commands{height:auto;max-height:124px;overflow:auto}body[data-input-mode=tablet] .ribbon-tabs button{min-height:40px}
body[data-input-mode=tablet] .quick-tool,body[data-input-mode=tablet] .formula-command,body[data-input-mode=tablet] .fx-btn{min-width:40px;min-height:40px}body[data-input-mode=tablet] .formula-bar{min-height:44px;height:auto}body[data-input-mode=tablet] .problem-pane .btn{min-height:42px}body[data-input-mode=tablet] .problem-pane .action-bar{position:sticky;bottom:0;background:white;z-index:4}
body[data-input-mode=tablet] .sheet-grid{overscroll-behavior:contain}body[data-input-mode=tablet] .problem-pane{overscroll-behavior:contain}
body[data-input-mode=tablet] .btn:focus-visible,body[data-input-mode=tablet] select:focus-visible{outline:3px solid #f59e0b;outline-offset:1px}
@media(min-width:960px){body[data-input-mode=tablet].workbook-mode .workbook-main{grid-template-columns:min(var(--problem-width,340px),36vw) 10px minmax(0,1fr)}body[data-input-mode=tablet] .workbook-main>.problem-pane{grid-column:1;border-left:0;border-right:1px solid #e2e8f0}body[data-input-mode=tablet] .workbook-main>.sheet-panel,body[data-input-mode=tablet] .workbook-main>.chart-stage{grid-column:3}body[data-input-mode=tablet] .workbook-main>.panel-resizer{grid-column:2}body[data-input-mode=tablet] .workbook-main.problem-panel-closed{grid-template-columns:minmax(0,1fr)}body[data-input-mode=tablet] .workbook-main.problem-panel-closed>.sheet-panel,body[data-input-mode=tablet] .workbook-main.problem-panel-closed>.chart-stage{grid-column:1}}
@media(max-width:959px){body[data-input-mode=tablet].workbook-mode .workbook-main{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(120px,32%) minmax(0,1fr)}body[data-input-mode=tablet] .workbook-main>.problem-pane{grid-column:1;grid-row:1;position:static;width:auto;box-shadow:none;border-bottom:1px solid #cbd5e1;padding:10px}body[data-input-mode=tablet] .workbook-main>.sheet-panel,body[data-input-mode=tablet] .workbook-main>.chart-stage{grid-column:1;grid-row:2}body[data-input-mode=tablet] .workbook-main>.panel-resizer{display:none}body[data-input-mode=tablet] .workbook-main.problem-panel-closed{grid-template-rows:minmax(0,1fr)}body[data-input-mode=tablet] .workbook-main.problem-panel-closed>.sheet-panel,body[data-input-mode=tablet] .workbook-main.problem-panel-closed>.chart-stage{grid-row:1}body[data-input-mode=tablet] .workbook-document{max-width:25vw}}
/* Keep status text out of the horizontally scrolling touch controls. */
.tablet-selection-status{display:none}
body[data-input-mode=tablet] .tablet-selection-status:not(:empty){display:block;flex:none;height:22px;line-height:22px;padding:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;background:#eff6ff}
body[data-input-mode=tablet] .tablet-tools{height:54px;max-height:54px;overflow-y:hidden}
body[data-input-mode=tablet].workbook-mode{height:var(--visual-height,100dvh)}
body[data-input-mode=tablet].workbook-mode .sheet-grid{min-height:180px!important;flex-shrink:0!important}
body[data-input-mode=tablet].workbook-mode .sheet-widget{overflow-y:auto}
body[data-input-mode=tablet] .sheet-widget{scroll-padding-top:48px}
body[data-input-mode=tablet] .formula-bar{position:sticky;top:0;z-index:8}
body[data-input-mode=tablet][data-keyboard-open=true] .ribbon-commands{display:none!important}
body[data-input-mode=tablet][data-keyboard-open=true] .tablet-tools[aria-label="태블릿 선택·편집"]{display:none}
@media(max-width:959px){
 body[data-input-mode=tablet].workbook-mode .workbook-main{grid-template-rows:clamp(100px,var(--problem-height,26%),36%) 10px minmax(0,1fr)}
 body[data-input-mode=tablet] .workbook-main>.panel-resizer{display:block;grid-column:1;grid-row:2;cursor:row-resize}
 body[data-input-mode=tablet] .workbook-main>.sheet-panel,body[data-input-mode=tablet] .workbook-main>.chart-stage{grid-row:3;min-height:0}
 body[data-input-mode=tablet] .workbook-main.problem-panel-closed{grid-template-rows:minmax(0,1fr)}
 body[data-input-mode=tablet][data-keyboard-open=true] .workbook-main:not(.problem-panel-closed){grid-template-rows:72px 10px minmax(0,1fr)}
}
.weakness-analysis { overflow-wrap:anywhere; }
#sqlite-learning-summary { grid-template-columns:minmax(0,1fr); }
#sqlite-learning-summary canvas { max-width:100%; }
.weakness-section { margin-block: 20px; }
.weakness-metrics { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%, 240px),1fr)); gap:10px; padding:0; list-style:none; }
.weakness-metrics li { display:grid; gap:4px; padding:12px; border:1px solid #dbeafe; border-radius:10px; background:#f8fbff; }
.weakness-metrics li > span { font-size:.875rem; }
