:root {
  --bg: #f7f8fc;
  --paper: #fff;
  --ink: #202033;
  --text: #424459;
  --muted: #686b80;
  --line: #e9eaf2;
  --accent: #6d4aff;
  --accent-hover: #5b37e5;
  --accent-soft: #f0ecff;
  --success: #16805a;
  --success-soft: #edf9f3;
  --error: #c83f50;
  --error-soft: #fff1f3;
  --radius: 14px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; -webkit-font-smoothing: antialiased; }
body:has(dialog[open]) { overflow: hidden; }
.mobile-brand, .mobile-practice-tools, .mobile-editor-toggle { display: none; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; border: 0; background: none; }
button:disabled { cursor: default; opacity: .45; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, label[tabindex]:focus-visible {
  outline: 3px solid #b7a7ff;
  outline-offset: 3px;
}
a { color: inherit; text-decoration: none; }
svg { width: 19px; height: 19px; flex-shrink: 0; vertical-align: middle; }
button svg { pointer-events: none; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }
input, textarea, select { border: 1px solid #dedfea; border-radius: 8px; background: #fff; color: var(--text); }
input, select { height: 42px; padding: 0 12px; }
input::placeholder, textarea::placeholder { color: #85879a; }
select {
  width: 100%; appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23737588' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
textarea { width: 100%; resize: vertical; padding: 14px; line-height: 1.85; }

/* Navigation */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 216px; background: var(--paper);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  padding: 27px 16px 22px; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 11px; margin: 0 12px 44px; color: var(--ink); font-size: 26px; font-weight: 750; letter-spacing: 1px; }
.brand small { display: block; font-size: 10px; font-weight: 400; color: var(--muted); margin-top: 4px; letter-spacing: 1.5px; }
.brand-symbol {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 42px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff;
  font-size: 25px; font-weight: 500; letter-spacing: 11px; text-indent: 10px;
}
.brand-symbol i { position: absolute; width: 6px; height: 6px; left: 18px; top: 19px; background: #dcd4ff; border-radius: 50%; }
.workspace-label { margin: 0 16px 13px; color: #7b7d90; font-size: 11px; }
.nav-item {
  width: 100%; height: 46px; display: flex; align-items: center; gap: 12px;
  margin-bottom: 7px; padding: 0 15px; border-radius: 9px;
  color: #66697f; text-align: left; font-size: 14px; transition: background .15s, color .15s;
}
.nav-item > span:first-child { display: flex; }
.nav-item:hover { background: #f8f7fd; color: var(--accent); }
.nav-item.active { color: #6040d8; background: var(--accent-soft); font-weight: 600; }
.nav-item.active:hover { background: #eae4ff; }
.nav-count { margin-left: auto; font-size: 11px; color: #77788c; background: #f3f4f9; padding: 2px 7px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.nav-item.active .nav-count { background: #e2d9ff; color: #6040d8; }
.nav-active-dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; margin-left: auto; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--line); padding-top: 16px; }
.guide-link { display: flex; align-items: center; width: 100%; gap: 8px; padding: 10px 8px; font-size: 12px; color: #5f6178; }
.guide-link svg { width: 17px; height: 17px; color: #7f70ac; }
.guide-link > span:last-child { margin-left: auto; color: #9092a4; }
.guide-link:hover { color: var(--accent); }
.local-indicator { display: flex; align-items: center; gap: 6px; font-size: 10px; color: #717588; margin: 18px 8px 10px; }
.local-indicator i { height: 5px; width: 5px; border-radius: 50%; background: #34a47e; }
.version { font-size: 10px; color: #848699; margin-left: 8px; }
.main-shell { margin-left: 216px; }
.topbar { height: 68px; display: flex; justify-content: space-between; align-items: center; padding: 0 36px; border-bottom: 1px solid var(--line); background: #fff; }
.breadcrumb { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); }
.breadcrumb span { color: #c4c5d2; }
.breadcrumb strong { color: #47485f; font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.today { font-size: 11px; color: #7b7e92; }

/* Buttons and shared surfaces */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 11px 18px; border-radius: 8px; font-size: 13px; font-weight: 550; white-space: nowrap; transition: background .15s, transform .15s; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button svg { width: 16px; height: 16px; }
.button.primary, .button.dark { background: var(--accent); color: #fff; }
.button.primary:hover:not(:disabled), .button.dark:hover:not(:disabled) { background: var(--accent-hover); }
.button.secondary { border: 1px solid #dedfea; background: #fff; color: #585b72; }
.button.secondary:hover:not(:disabled) { background: #f7f5ff; border-color: #c6b8ff; color: var(--accent); }
.button.small { min-height: 36px; font-size: 12px; padding: 8px 14px; }
.button.wide { width: 100%; }
.text-button { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #6b6291; padding: 0; line-height: 1.7; }
.text-button:hover { color: var(--accent); }
.text-button svg { width: 14px; height: 14px; }
.icon-button { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #7e8094; border-radius: 6px; }
.icon-button:hover:not(:disabled) { background: #f2efff; color: var(--accent); }
kbd { font-family: inherit; font-size: 10px; padding: 1px 5px; border: 1px solid #dfe0eb; border-radius: 4px; background: #fff; color: var(--muted); margin-left: 4px; }

/* Overview: compact, with the practice surface immediately below */
#main-content { max-width: 1512px; margin: auto; padding: 27px 36px 18px; }
.page-intro { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.eyebrow { font-size: 9px; letter-spacing: 1.6px; color: #8a79b9; margin-bottom: 5px; font-weight: 600; }
h1 { font-size: 27px; font-weight: 650; letter-spacing: .2px; line-height: 1.5; color: var(--ink); }
.page-intro p { margin-top: 5px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.intro-badge { display: flex; align-items: center; gap: 7px; color: #6e638b; font-size: 11px; padding: 8px 12px; background: #f0edfa; border-radius: 6px; margin-left: 15px; white-space: nowrap; }
.intro-badge svg { width: 15px; height: 15px; color: #8871c1; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 25px; }
.stat-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 17px 19px 14px; min-height: 113px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #6c6e83; }
.stat-icon { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; position: absolute; right: 18px; top: 18px; }
.stat-icon svg { width: 16px; height: 16px; }
.violet { color: #7652dd; background: #f1ecff; }
.blue { color: #497fcd; background: #edf4ff; }
.green { color: #27886a; background: #ecf8f2; }
.red { color: #c86579; background: #fff0f4; }
.stat-value { margin-top: 9px; font-size: 29px; line-height: 1.15; font-weight: 650; letter-spacing: -.3px; font-variant-numeric: tabular-nums; color: #28283f; }
.stat-card:first-child .stat-value { color: #6a48df; }
.stat-value small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 7px; }
.stat-caption { margin-top: 8px; font-size: 10px; color: var(--muted); line-height: 1.5; }

/* Practice workspace */
.practice-grid { display: grid; grid-template-columns: minmax(0, 1fr) 276px; gap: 22px; align-items: start; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 23px; margin-bottom: 13px; }
.section-heading h2 { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; color: #33354d; }
.heading-mark { display: inline-block; width: 3px; height: 14px; border-radius: 2px; background: var(--accent); }
.section-heading > span { color: #766398; background: #eeeaf9; border-radius: 5px; padding: 4px 8px; font-size: 10px; }
.question-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 3px 16px #27204f03; }
.question-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 25px; border-bottom: 1px solid #f0eff6; }
.question-tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.question-type { color: #6948ce; background: #f0ebff; padding: 5px 9px; border-radius: 5px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.chapter-tag { color: var(--muted); font-size: 11px; line-height: 1.6; }
.no-answer-tag { color: #92611f; background: #fff6e5; font-size: 10px; border-radius: 4px; padding: 4px 7px; }
.bookmark-button { display: flex; align-items: center; justify-content: center; flex-shrink: 0; height: 30px; width: 30px; border-radius: 7px; color: #8e8fa3; }
.bookmark-button svg { width: 17px; height: 17px; }
.bookmark-button:hover { background: #f4f0ff; color: var(--accent); }
.bookmark-button.saved { color: var(--accent); background: #f0ebff; }
.bookmark-button.saved svg { fill: #e1d7ff; }
.question-body { padding: 23px 26px 27px; }
.question-position { color: #9192a6; font-size: 11px; letter-spacing: .5px; margin-bottom: 11px; }
.question-position strong { color: var(--accent); font-size: 21px; font-weight: 600; letter-spacing: -.4px; margin-right: 3px; }
.question-title { margin-bottom: 23px; color: #27283e; font-size: 18px; font-weight: 550; line-height: 1.85; overflow-wrap: anywhere; white-space: pre-wrap; }
.question-hint { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 5px; }
.options { display: flex; flex-direction: column; gap: 12px; }
.option { position: relative; display: flex; align-items: flex-start; gap: 14px; width: 100%; min-height: 52px; padding: 13px 16px; border: 1px solid #e4e5ef; border-radius: 9px; text-align: left; background: #fff; color: #4a4c63; font-size: 14px; line-height: 1.8; transition: background .15s, border-color .15s, box-shadow .15s; white-space: pre-wrap; overflow-wrap: anywhere; }
.option:hover:not(:disabled) { background: #faf9ff; border-color: #b8a5ff; }
.option:disabled { opacity: 1; cursor: default; }
.option-letter { flex-shrink: 0; min-width: 25px; height: 25px; display: flex; align-items: center; justify-content: center; border: 1px solid #e4e4ee; border-radius: 6px; background: #f8f8fc; color: #7b7c91; font-size: 12px; line-height: 1; white-space: nowrap; }
.option > span:nth-child(2) { flex: 1; min-width: 0; }
.option.selected { background: #f4f0ff; border-color: #8a6aff; color: #5835c9; box-shadow: 0 0 0 1px #8a6aff; }
.option.selected .option-letter { background: var(--accent); border-color: var(--accent); color: #fff; }
.option.correct { background: var(--success-soft); border-color: #72bc9b; color: #176a4e; }
.option.correct .option-letter { background: #22946b; border-color: #22946b; color: #fff; }
.option.incorrect { background: var(--error-soft); border-color: #e7a2ad; color: #b73547; }
.option.incorrect .option-letter { background: #d95c70; border-color: #d95c70; color: #fff; }
.option-state { margin-left: auto; padding-left: 5px; flex-shrink: 0; font-size: 16px; }
.answer-panel { margin-top: 22px; border: 1px solid #d5eadf; background: #f2faf6; border-radius: 9px; padding: 17px 19px; }
.answer-panel.wrong { border-color: #f1d6db; background: #fff5f6; }
.answer-panel.unknown { background: #f7f7fc; border-color: #e3e3f0; }
.answer-status { display: flex; align-items: center; gap: 8px; color: #177450; font-weight: 550; font-size: 14px; line-height: 1.7; }
.answer-panel.wrong .answer-status { color: #bd4055; }
.answer-panel.unknown .answer-status { color: #686383; }
.answer-detail { color: #5c6d66; font-size: 12px; margin-top: 8px; line-height: 1.9; }
.answer-row { display: flex; align-items: baseline; gap: 16px; margin-top: 7px; }
.answer-row > span { min-width: 58px; }
.answer-row strong { font-size: 14px; font-weight: 600; letter-spacing: 1px; }
.reference-answer strong { color: var(--success); }
.ungraded-caption { font-size: 11px; margin-top: 6px; color: var(--muted); }
.question-edit-button { margin-left: auto; display: flex; align-items: center; gap: 5px; color: #827594; font-size: 11px; padding: 6px; border-radius: 6px; white-space: nowrap; }
.question-edit-button svg { width: 13px; height: 13px; }
.question-edit-button:hover { background: var(--accent-soft); color: var(--accent); }
.answer-panel.wrong .answer-detail { color: #8c6670; }
.answer-panel.unknown .answer-detail { color: #77748c; }
.explanation { margin-top: 13px; padding-top: 12px; border-top: 1px solid #d9e9e0; color: #536b5f; font-size: 13px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.explanation strong { font-weight: 600; margin-right: 8px; }
.explanation > strong { display: block; margin: 0 0 5px; }
.answer-panel.wrong .explanation { border-color: #eedbe0; color: #7e626e; }
.answer-panel.unknown .explanation { border-color: #e2e1ee; color: #716e88; }
.question-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 25px; background: #fcfbff; border-top: 1px solid #eeedf6; }
.question-source { max-width: 43%; color: var(--muted); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.question-source span { display: block; color: var(--muted); font-size: 10px; }
.question-controls { display: flex; gap: 8px; align-items: center; }
.question-controls .button { min-height: 39px; padding: 10px 15px; font-size: 12px; }
.question-controls .icon-button { width: 34px; height: 39px; border: 1px solid #e3e2ed; background: #fff; border-radius: 7px; }
.practice-bottom { display: flex; align-items: center; justify-content: space-between; padding: 15px 2px; gap: 10px; font-size: 11px; color: #7d7e93; }
.practice-bottom > span { display: flex; align-items: center; gap: 5px; }
.practice-bottom svg { height: 13px; width: 13px; color: #8b82a5; }
.practice-bottom .text-button { font-size: 11px; color: #7b7893; }
.practice-aside { padding-top: 36px; display: flex; flex-direction: column; gap: 16px; }
.panel { padding: 21px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #9290a9; }
.panel-title h2 { color: #3a394f; font-size: 14px; font-weight: 600; }
.panel-title svg { width: 16px; height: 16px; }
.panel-title > strong { color: #80768f; font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.panel-description { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.8; margin-bottom: 18px; }
.field-label { display: block; color: #66657d; font-size: 12px; margin: 17px 0 8px; }
.settings-panel select { height: 38px; font-size: 12px; color: #55546e; background-color: #fff; }
.mode-toggle { display: flex; gap: 3px; padding: 3px; border-radius: 8px; background: #f6f5fa; border: 1px solid #efedf6; margin-bottom: 18px; }
.mode-toggle button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 31px; border-radius: 5px; font-size: 12px; color: #88839a; }
.mode-toggle button svg { width: 14px; height: 14px; }
.mode-toggle button.active { background: #fff; color: #6a45d9; box-shadow: 0 1px 4px #32244d0b; font-weight: 500; }
.settings-panel .button { justify-content: space-between; min-height: 39px; padding: 10px 13px; font-size: 12px; }
.session-progress { margin: 14px 0 15px; }
.progress-track { height: 5px; border-radius: 4px; background: #eeebf6; overflow: hidden; margin-bottom: 10px; }
.progress-track > div { height: 100%; width: 0; background: #8968f3; border-radius: 4px; transition: width .2s; }
.session-progress small { color: var(--muted); font-size: 10px; }
.question-map { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; max-height: 236px; overflow-y: auto; padding: 3px; margin: -3px; scrollbar-width: thin; scrollbar-color: #d8d1ec transparent; }
.question-map-item { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; min-height: 29px; padding: 3px 1px; border: 1px solid #e7e4ef; border-radius: 6px; color: #737086; background: #fff; font-size: 11px; font-variant-numeric: tabular-nums; }
.question-map-item:hover { border-color: #a48ce9; color: var(--accent); }
.question-map-item.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.question-map-item.correct { color: #197454; background: #e6f6ee; border-color: #c4e7d4; }
.question-map-item.wrong { color: #c44356; background: #fff0f2; border-color: #f2cdd4; }
.question-map-item.ungraded { color: #5f6484; background: #eff1fa; border-color: #dee1f0; }
.question-map-item.correct.current, .question-map-item.wrong.current, .question-map-item.ungraded.current { outline: 2px solid var(--accent); outline-offset: 1px; }
.question-map-pagination { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin-top: 8px; color: #888099; font-size: 10px; }
.question-map-pagination button { display: flex; width: 26px; height: 26px; align-items: center; justify-content: center; }
.question-map-pagination svg { width: 14px; height: 14px; }
.question-map-empty { grid-column: 1 / -1; font-size: 11px; color: #868198; line-height: 1.9; }
.answer-legend { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-top: 1px solid #f0edf5; margin-top: 15px; padding-top: 12px; color: var(--muted); font-size: 10px; }
.answer-legend > span { display: flex; align-items: center; gap: 4px; }
.answer-legend i { width: 7px; height: 7px; border-radius: 2px; }
.legend-current { background: var(--accent); }
.legend-correct { background: #70bd97; }
.legend-wrong { background: #e28a98; }
.legend-pending { background: #fff; border: 1px solid #ccc6d9; }
.import-tip { display: flex; gap: 12px; padding: 17px; border: 1px solid #e9e2fb; border-radius: 12px; background: #f1edfc; }
.tip-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 29px; height: 29px; border-radius: 8px; background: #e6ddfa; color: #8660cd; }
.tip-icon svg { width: 15px; height: 15px; }
.import-tip h3 { color: #62517f; font-size: 12px; font-weight: 550; line-height: 1.8; }
.import-tip p { font-size: 10px; line-height: 1.85; color: var(--muted); margin-top: 5px; }
.import-tip .text-button { color: #7854b3; font-size: 10px; margin-top: 9px; }
.page-footer { display: flex; justify-content: space-between; gap: 14px; border-top: 1px solid #e6e4ef; margin-top: 25px; padding: 18px 0 10px; font-size: 10px; color: var(--muted); }
.page-footer > span:last-child { color: var(--muted); }
.session-complete { text-align: center; padding: 28px 24px 24px; border-bottom: 1px solid #e5def6; background: #f5f1ff; }
.session-complete > span { font-size: 28px; color: #a58bdc; }
.session-complete h3 { font-size: 18px; font-weight: 550; color: #624195; margin: 8px 0; }
.session-complete p { color: #8a7a9f; font-size: 12px; line-height: 1.9; }
.session-complete .button { margin-top: 16px; font-size: 12px; }

/* Question bank collection */
.library-heading { margin-bottom: 18px; }
.search-field { display: flex; align-items: center; gap: 8px; max-width: 470px; margin-bottom: 22px; padding-left: 13px; background: #fff; border: 1px solid #e4e0ed; border-radius: 9px; color: #9b92ac; }
.search-field input { background: none; border: 0; min-width: 0; flex: 1; font-size: 12px; }
.bank-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.bank-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 23px; }
.bank-card-top { display: flex; align-items: flex-start; gap: 13px; }
.bank-card-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 42px; height: 42px; background: #f0eaff; color: #916dd4; border-radius: 11px; }
.bank-card h3 { color: var(--ink); font-size: 16px; font-weight: 550; line-height: 1.7; overflow-wrap: anywhere; }
.bank-card-meta { margin-top: 5px; font-size: 11px; color: var(--muted); line-height: 1.7; }
.bank-card-chapters { margin: 18px 0; min-height: 42px; color: var(--muted); font-size: 12px; line-height: 1.9; overflow-wrap: anywhere; }
.bank-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 9px; border-top: 1px solid var(--line); padding-top: 16px; }
.bank-card-tools { display: flex; gap: 13px; }
.bank-card-tools button { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.bank-card-tools svg { height: 14px; width: 14px; }
.bank-card-tools button:hover { color: var(--accent); }
.empty-state { display: flex; align-items: center; flex-direction: column; gap: 16px; padding: 62px 25px; text-align: center; line-height: 1.9; }
.empty-state > svg { height: 36px; width: 36px; color: #ae99cd; }
.empty-state h3 { font-size: 18px; font-weight: 550; color: #675279; }
.empty-state p { font-size: 12px; color: var(--muted); max-width: 360px; }
.empty-state .button { margin-top: 6px; }
.bank-list > .empty-state { grid-column: 1 / -1; border: 1px dashed #d8cfe7; background: #fff; border-radius: 12px; }

/* Import and help dialogs */
.modal { width: min(720px, calc(100vw - 40px)); max-height: 90vh; padding: 32px; border: 1px solid #e8e1f1; border-radius: 16px; color: var(--text); box-shadow: 0 24px 95px #23133730; overscroll-behavior: contain; }
.modal::backdrop { background: #21152d66; backdrop-filter: blur(4px); }
.modal h2 { padding-right: 20px; color: var(--ink); font-size: 23px; font-weight: 600; line-height: 1.7; }
.modal-eyebrow { margin-bottom: 7px; color: #9b85b5; font-size: 9px; letter-spacing: 1.5px; }
.modal-subtitle { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.9; }
.modal-close-form { position: absolute; top: 15px; right: 16px; }
.import-tabs { display: flex; gap: 25px; margin: 24px 0 20px; border-bottom: 1px solid var(--line); }
.import-tabs button { padding: 0 3px 12px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; }
.import-tabs button.active { color: #7950b3; border-color: var(--accent); }
.drop-zone { display: flex; justify-content: center; align-items: center; flex-direction: column; gap: 11px; min-height: 168px; padding: 28px 18px; background: #faf8ff; border: 1px dashed #d0bde9; border-radius: 10px; cursor: pointer; }
.drop-zone:hover, .drop-zone.dragover { background: #f2eaff; border-color: #a17ace; }
.upload-symbol { display: flex; align-items: center; justify-content: center; height: 40px; width: 40px; margin-bottom: 3px; border-radius: 11px; color: #9271b8; background: #f0e6fd; }
.upload-symbol svg { height: 21px; width: 21px; }
.drop-zone strong { max-width: 100%; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.drop-zone > span:last-child { font-size: 11px; color: var(--muted); line-height: 1.9; text-align: center; }
.file-help { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; line-height: 1.9; color: var(--muted); margin-top: 12px; }
.file-help .text-button { font-size: 11px; white-space: nowrap; }
.paste-help { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.import-name-field input { width: 100%; font-size: 12px; }
.modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; }
.modal-footer > div { display: flex; gap: 8px; }
.modal-footer .button { font-size: 12px; }
.feedback { border-radius: 8px; padding: 13px 16px; margin-top: 18px; font-size: 12px; line-height: 1.9; color: #65795f; background: #f0f7ee; white-space: pre-line; overflow-wrap: anywhere; }
.feedback.error { color: #ae4c61; background: #fdf0f3; }
.feedback.warning { color: #9b752e; background: #fff8e9; }
.preview-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--muted); margin: 22px 0 15px; }
.preview-summary strong { font-size: 14px; font-weight: 550; color: #78528f; }
.preview-question { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.preview-question summary { padding: 13px 15px; cursor: pointer; font-size: 12px; color: var(--text); line-height: 1.8; overflow-wrap: anywhere; }
.preview-question-content { padding: 0 17px 14px; font-size: 12px; line-height: 1.9; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-question-content strong { color: #79548e; }
.preview-bank-title { color: #785e87; font-size: 12px; font-weight: 600; margin: 18px 0 10px; }
.guide-steps { display: flex; flex-direction: column; gap: 21px; list-style: none; padding: 0; margin: 25px 0 20px; }
.guide-steps li { display: flex; align-items: flex-start; gap: 15px; }
.guide-steps li > span { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 31px; height: 31px; border-radius: 8px; background: #f1eafb; color: #a384bc; font-size: 11px; }
.guide-steps h3 { font-size: 13px; font-weight: 550; color: var(--ink); line-height: 1.8; }
.guide-steps p { font-size: 12px; color: var(--muted); line-height: 1.9; margin-top: 5px; }
.guide-note { margin-top: 10px; padding: 10px 12px; border-radius: 7px; background: #fbf6e9; color: #a28b55; font-size: 11px; line-height: 1.9; }
.format-example { padding: 17px 20px; border-radius: 8px; background: #f7f2fc; color: var(--text); font-family: inherit; font-size: 12px; line-height: 1.9; white-space: pre-wrap; }
.guide-footnote { font-size: 11px; color: var(--muted); line-height: 1.9; }
.helper-details { margin-top: 20px; }
.helper-details p { font-size: 11px; line-height: 1.9; color: var(--muted); margin-bottom: 10px; }
.helper-details textarea { background: #f9f4ff; font-size: 11px; }
.confirm-modal { max-width: 440px; padding: 28px; }
.confirm-modal h2 { font-size: 19px; }
.confirm-modal p { font-size: 12px; line-height: 2; color: var(--muted); margin-top: 12px; }
.confirm-modal .modal-footer { justify-content: flex-end; }
.toast { position: fixed; bottom: 28px; left: calc(50% + 108px); transform: translateX(-50%); max-width: 90vw; border: 1px solid #4d3e64; border-radius: 9px; padding: 12px 20px; background: #332445; color: #f5f0fc; font-size: 12px; line-height: 1.7; box-shadow: 0 5px 30px #281b4020; z-index: 1000; }

/* Bank editor: draft changes are committed together. */
.editor-modal { width: min(1120px, calc(100vw - 56px)); max-height: 94vh; height: min(920px, 94vh); padding: 0; overflow: hidden; }
.editor-modal[open] { display: flex; flex-direction: column; }
.editor-header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 27px 12px; }
.editor-header h2 { font-size: 21px; }
.editor-header .modal-eyebrow { font-size: 8px; margin-bottom: 2px; }
.editor-bank-name { display: flex; align-items: center; gap: 14px; padding: 0 27px 19px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.editor-bank-name .field-label { margin: 0; white-space: nowrap; }
.editor-bank-name input { width: min(480px, 65%); height: 37px; font-size: 13px; }
#editor-save-status { color: #8a7c9b; font-size: 11px; margin-left: auto; white-space: nowrap; }
.editor-workspace { display: grid; grid-template-columns: 255px minmax(0, 1fr); flex: 1; min-height: 0; overflow: hidden; }
.editor-sidebar { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 18px 14px 8px; background: #fbfaff; border-right: 1px solid var(--line); }
.editor-search { display: flex; align-items: center; gap: 7px; padding-left: 10px; background: #fff; border: 1px solid #e5dfef; border-radius: 7px; color: #998aa9; }
.editor-search svg { width: 15px; height: 15px; }
.editor-search input { min-width: 0; width: 100%; border: 0; padding: 0 9px 0 0; height: 35px; font-size: 11px; background: none; }
.editor-list-caption { display: flex; align-items: center; justify-content: space-between; padding: 14px 5px 10px; font-size: 11px; color: #8f819d; }
.editor-list-caption .text-button { font-size: 11px; }
#editor-question-list { flex: 1; min-height: 0; overflow-y: auto; padding: 3px; margin: -3px; scrollbar-width: thin; scrollbar-color: #ddd2ed transparent; }
.editor-list-item { display: flex; width: 100%; gap: 9px; align-items: flex-start; text-align: left; border-radius: 8px; border: 1px solid transparent; margin: 0 0 5px; padding: 11px 9px; }
.editor-list-item > span { display: flex; justify-content: center; align-items: center; min-width: 23px; height: 23px; background: #f0ecf7; border-radius: 5px; font-size: 10px; color: #867193; }
.editor-list-item div { min-width: 0; }
.editor-list-item strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 400; font-size: 11px; line-height: 1.8; color: #655572; overflow-wrap: anywhere; }
.editor-list-item small { display: block; font-size: 9px; line-height: 1.7; color: #94839f; margin-top: 3px; }
.editor-list-item:hover { background: #f5f0fd; }
.editor-list-item.active { background: #f0eaff; border-color: #e1d5fa; }
.editor-list-item.active > span { background: var(--accent); color: #fff; }
.editor-list-item.active strong { color: #624098; }
.editor-list-pages { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 5px; color: #9986a7; font-size: 10px; flex-shrink: 0; }
.editor-list-pages svg { width: 14px; height: 14px; }
.editor-list-empty { font-size: 11px; color: var(--muted); padding: 20px 7px; line-height: 1.8; }
.editor-question-pane { min-height: 0; overflow-y: auto; padding: 22px 28px; scrollbar-width: thin; scrollbar-color: #ddd2ed transparent; }
.editor-question-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; gap: 14px; }
.editor-question-heading h3 { font-size: 14px; font-weight: 550; color: #51425f; }
.editor-question-heading .text-button { font-size: 11px; }
.danger-text { color: #b76379; }
.danger-text:hover { color: #c43955; }
.editor-meta-fields { display: grid; grid-template-columns: 185px minmax(0, 1fr); gap: 16px; }
.editor-meta-fields input { width: 100%; }
.editor-question-pane input, .editor-question-pane select, .editor-question-pane textarea { font-size: 12px; }
.editor-question-pane textarea { padding: 10px 12px; }
.editor-question-pane > input { width: 100%; }
.editor-question-pane .field-label { font-size: 12px; color: #6e5c7e; margin-top: 19px; }
.required { color: #ab8bbb; }
.editor-options-heading { display: flex; align-items: baseline; justify-content: space-between; }
.editor-options-heading .field-label { margin-bottom: 4px; }
.editor-options-heading .text-button { font-size: 10px; }
.editor-field-hint { color: #9a85a6; font-size: 10px; line-height: 1.7; margin-bottom: 11px; }
.editor-option-row { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 10px; }
.editor-option-row textarea { flex: 1; min-width: 0; min-height: 46px; }
.editor-answer-choice { display: flex; align-items: center; gap: 7px; padding-top: 11px; color: #886f9b; font-size: 12px; cursor: pointer; }
.editor-answer-choice input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.editor-option-row .icon-button { margin-top: 7px; width: 25px; }
.editor-option-row .icon-button svg { width: 14px; height: 14px; }
.editor-add-option { font-size: 11px; margin: 1px 0 4px 37px; }
.editor-question-navigation { display: flex; justify-content: space-between; margin-top: 22px; padding-top: 19px; border-top: 1px solid var(--line); }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 17px 24px; border-top: 1px solid var(--line); background: #fcfbff; flex-shrink: 0; }
.editor-footer p { font-size: 10px; line-height: 1.8; color: #8c7799; max-width: 540px; }
.editor-repair-label { cursor: pointer; font-size: 11px; margin-top: 8px; }
.editor-footer-actions { display: flex; gap: 9px; flex-shrink: 0; }
.editor-footer .button { font-size: 12px; }
#editor-feedback { margin: 0; border-radius: 0; padding: 10px 24px; font-size: 11px; max-height: 82px; overflow-y: auto; flex-shrink: 0; }
@media (max-width: 1000px) {
  .editor-modal { width: calc(100vw - 32px); }
  .editor-workspace { grid-template-columns: 215px minmax(0, 1fr); }
  .editor-question-pane { padding: 18px 21px; }
  .editor-footer { padding: 15px 19px; gap: 16px; }
  .editor-meta-fields { grid-template-columns: 155px minmax(0, 1fr); }
  .editor-footer p { font-size: 9px; }
}

/* Desktop window sizes */
@media (min-width: 1600px) {
  #main-content { padding-top: 32px; }
  .practice-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; }
  .question-body { padding: 27px 32px 32px; }
  .question-top, .question-footer { padding-left: 32px; padding-right: 32px; }
  .question-title { font-size: 19px; }
  .option { font-size: 15px; min-height: 55px; }
}
@media (max-width: 1190px) {
  .sidebar { width: 190px; padding: 26px 12px 22px; }
  .brand { margin-left: 9px; font-size: 25px; }
  .nav-item { font-size: 13px; padding: 0 13px; gap: 11px; }
  .main-shell { margin-left: 190px; }
  .topbar { padding: 0 26px; }
  #main-content { padding: 25px 26px 18px; }
  .practice-grid { grid-template-columns: minmax(0, 1fr) 246px; gap: 18px; }
  .panel { padding: 18px; }
  .question-body { padding: 22px; }
  .question-top, .question-footer { padding-left: 22px; padding-right: 22px; }
  .question-title { font-size: 17px; }
  .stats-grid { gap: 12px; }
  .stat-card { padding: 15px; }
  .stat-icon { right: 13px; top: 15px; width: 26px; height: 26px; }
  .stat-value { font-size: 27px; }
  .question-source { max-width: 34%; font-size: 10px; }
  .question-source span { font-size: 9px; }
  .question-controls { gap: 6px; }
  .question-controls .button { padding: 9px 11px; font-size: 11px; }
  .answer-legend { gap: 8px; font-size: 9px; }
  .question-map { gap: 6px; }
  .guide-link { font-size: 11px; }
  .local-indicator, .version { font-size: 9px; }
  .toast { left: calc(50% + 95px); }
}
@media (max-width: 1000px) {
  .practice-grid { grid-template-columns: minmax(0, 1fr); }
  .practice-aside { padding-top: 0; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .settings-panel { grid-column: 1; grid-row: 1 / span 2; }
  .answer-sheet { grid-column: 2; grid-row: 1; }
  .import-tip { grid-column: 2; grid-row: 2; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 14px; min-height: 113px; }
  .stat-top { font-size: 11px; }
  .stat-icon { position: static; width: 24px; height: 24px; margin: -3px 0 -3px 4px; }
  .stat-icon svg { width: 14px; height: 14px; }
  .stat-caption { font-size: 9px; }
  .stat-value { font-size: 25px; }
  .intro-badge { display: none; }
  .bank-list { grid-template-columns: 1fr; }
  .question-source { max-width: 43%; font-size: 11px; }
  .question-source span { font-size: 10px; }
  .question-controls .button { padding: 10px 14px; font-size: 12px; }
  .today { display: none; }
  .answer-legend { font-size: 10px; gap: 10px; }
  .page-footer > span:last-child { max-width: 60%; line-height: 1.8; text-align: right; }
}
/* Phone layout: one column, bottom navigation, expandable practice tools. */
@media (max-width: 760px), (max-width: 1000px) and (pointer: coarse) and (max-height: 520px) {
  html { scroll-padding-top: 16px; }
  body { -webkit-text-size-adjust: 100%; }
  input, select, textarea,
  .settings-panel select, .search-field input, .import-name-field input,
  .editor-bank-name input, .editor-search input,
  .editor-question-pane input, .editor-question-pane select, .editor-question-pane textarea,
  .helper-details textarea { font-size: 16px; }
  input, select, .settings-panel select { min-height: 44px; }
  .sidebar {
    inset: auto 0 0; width: auto; padding: 7px max(8px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-right: 0; border-top: 1px solid var(--line); z-index: 20;
    box-shadow: 0 -4px 20px #27204f05;
  }
  .sidebar > .brand, .workspace-label, .sidebar-bottom { display: none; }
  #navigation { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .nav-item {
    position: relative; flex-direction: column; justify-content: center; gap: 5px;
    height: 52px; margin: 0; padding: 5px 0; font-size: 11px; border-radius: 9px;
  }
  .nav-item svg { width: 20px; height: 20px; }
  .nav-active-dot { display: none; }
  .nav-count { position: absolute; top: 1px; left: calc(50% + 8px); margin: 0; padding: 1px 4px; font-size: 9px; line-height: 1.3; max-width: 45px; overflow: hidden; }
  .main-shell { margin-left: 0; padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .topbar { height: auto; min-height: 66px; gap: 12px; padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); }
  .mobile-brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 21px; font-weight: 700; letter-spacing: 1px; }
  .mobile-brand .brand-symbol { width: 32px; height: 34px; border-radius: 9px; font-size: 21px; letter-spacing: 8px; text-indent: 8px; }
  .mobile-brand .brand-symbol i { width: 5px; height: 5px; left: 14px; top: 15px; }
  .breadcrumb { display: none; }
  .topbar-actions { margin-left: auto; }
  .topbar .button { min-height: 42px; padding: 10px 13px; font-size: 12px; }
  #main-content { padding: 20px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); }
  .page-intro { margin-bottom: 17px; }
  .eyebrow { font-size: 8px; }
  h1 { font-size: 24px; }
  .page-intro p { font-size: 12px; line-height: 1.8; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
  .stat-card { padding: 13px 14px; min-height: 100px; }
  .stat-top { font-size: 11px; }
  .stat-value { font-size: 25px; margin-top: 7px; }
  .stat-caption { margin-top: 5px; font-size: 10px; }
  .practice-grid { gap: 12px; }
  .practice-main { grid-column: 1; grid-row: 2; min-width: 0; }
  .practice-grid:has(.mobile-panel-open) .practice-main { grid-row: 3; }
  .mobile-practice-tools { display: flex; gap: 10px; grid-column: 1; grid-row: 1; }
  .mobile-practice-tools > button {
    display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #665780; font-size: 12px;
  }
  .mobile-practice-tools > button:first-child { flex: 1; }
  .mobile-practice-tools > button[aria-expanded="true"] { color: var(--accent); border-color: #c7b9ff; background: var(--accent-soft); }
  .mobile-practice-tools svg { width: 15px; height: 15px; }
  #mobile-progress-text { margin-left: auto; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
  [data-practice-panel] > span:last-child svg, .mobile-editor-toggle > span:last-child svg { width: 13px; height: 13px; transition: transform .15s; }
  [data-practice-panel][aria-expanded="true"] > span:last-child svg, .mobile-editor-toggle[aria-expanded="true"] > span:last-child svg { transform: rotate(180deg); }
  .practice-aside { display: none; }
  .practice-aside.mobile-panel-open { display: contents; }
  .practice-aside .panel { display: none; }
  .practice-aside .panel.mobile-open { display: block; grid-column: 1; grid-row: 2; min-width: 0; padding: 18px; }
  .practice-aside .import-tip { display: none; }
  .settings-panel .panel-description { font-size: 12px; margin-bottom: 10px; }
  .settings-panel .mode-toggle button { min-height: 40px; font-size: 13px; }
  .settings-panel .button { min-height: 44px; font-size: 13px; }
  .question-map { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; max-height: 260px; }
  .question-map-item { min-height: 40px; aspect-ratio: auto; font-size: 12px; }
  .question-map-pagination button { width: 44px; height: 44px; }
  .question-map-pagination { font-size: 12px; }
  .answer-legend { font-size: 11px; }
  .section-heading { margin-bottom: 10px; }
  .question-top { padding: 10px 14px; gap: 5px; flex-wrap: wrap; }
  .question-tags { flex: 1 1 130px; gap: 6px; min-width: 0; }
  .chapter-tag { overflow-wrap: anywhere; }
  .question-edit-button { min-height: 44px; padding: 8px; margin-left: 0; font-size: 11px; }
  .bookmark-button { width: 40px; height: 44px; }
  .question-body { padding: 18px 16px 20px; }
  .question-title { font-size: 17px; margin-bottom: 19px; line-height: 1.9; }
  .options { gap: 11px; }
  .option { padding: 12px; min-height: 52px; gap: 10px; font-size: 15px; }
  .option-state { padding-left: 0; }
  .answer-panel { padding: 15px; }
  .answer-status { font-size: 13px; align-items: flex-start; }
  .answer-status svg { margin-top: 2px; }
  .answer-row { gap: 12px; }
  .answer-row strong { min-width: 0; overflow-wrap: anywhere; }
  .explanation { font-size: 14px; }
  .question-footer { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px; }
  .question-source { max-width: none; font-size: 11px; }
  .question-source span { font-size: 10px; }
  .question-controls { width: 100%; gap: 8px; }
  .question-controls .button { flex: 1; min-width: 0; min-height: 46px; padding: 11px 10px; font-size: 13px; }
  .question-controls .icon-button { width: 46px; height: 46px; flex-shrink: 0; }
  #show-shortcuts { display: none; }
  .practice-bottom { padding: 11px 2px; }
  .bank-card { padding: 18px; min-width: 0; }
  .bank-card-top > div:last-child { min-width: 0; }
  .bank-card-footer { flex-wrap: wrap; gap: 10px; }
  .bank-card-footer > .button { min-height: 44px; }
  .bank-card-tools { flex-wrap: wrap; gap: 6px; }
  .bank-card-tools button { min-height: 44px; padding: 0 5px; font-size: 12px; }
  .library-heading { align-items: center; }
  .library-heading .button { min-height: 44px; font-size: 11px; padding: 10px; }
  .search-field { max-width: none; margin-bottom: 15px; }
  .page-footer { flex-direction: column; gap: 5px; margin-top: 18px; padding-bottom: 5px; font-size: 10px; }
  .page-footer > span:last-child { max-width: none; text-align: left; }
  .empty-state { padding: 40px 20px; }
  .empty-state h3 { font-size: 17px; }
  .modal { width: calc(100% - 24px); max-width: 600px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 24px 18px; border-radius: 14px; overflow-y: auto; overflow-wrap: anywhere; }
  .modal h2 { padding-right: 26px; font-size: 20px; }
  .modal-eyebrow { padding-right: 26px; font-size: 8px; letter-spacing: 1px; }
  .modal-subtitle { font-size: 12px; }
  .modal-close-form { top: 9px; right: 8px; }
  .modal-close-form .icon-button, .editor-header .icon-button { width: 44px; height: 44px; }
  .import-tabs { margin: 18px 0 16px; gap: 20px; }
  .import-tabs button { min-height: 44px; padding: 9px 4px; }
  .drop-zone { min-height: 150px; padding: 20px 14px; text-align: center; }
  .file-help { flex-direction: column; gap: 4px; }
  .file-help .text-button { min-height: 36px; }
  .modal-footer { align-items: stretch; flex-direction: column; gap: 12px; margin-top: 18px; padding-top: 14px; }
  .modal-footer > div { flex-wrap: wrap; }
  .modal-footer .button { min-height: 44px; flex: 1; }
  .modal-footer > .text-button { min-height: 40px; }
  .guide-steps li { gap: 10px; }
  .guide-steps li > div { min-width: 0; }
  .format-example { padding: 14px; overflow-wrap: anywhere; }
  .confirm-modal .modal-footer { flex-direction: row; }
  .toast { left: 50%; width: max-content; max-width: calc(100% - 32px); bottom: calc(86px + env(safe-area-inset-bottom)); padding: 12px 16px; }
  .editor-modal { width: 100%; max-width: none; max-height: 100vh; max-height: 100dvh; height: 100vh; height: 100dvh; margin: 0; border: 0; border-radius: 0; padding: 0; overflow: hidden; }
  .editor-header { padding: max(12px, env(safe-area-inset-top)) 16px 8px; gap: 10px; }
  .editor-header h2 { font-size: 20px; }
  .editor-bank-name { padding: 0 16px 10px; gap: 8px; flex-wrap: wrap; }
  .editor-bank-name .field-label { font-size: 11px; }
  .editor-bank-name input { flex: 1; width: auto; min-width: 0; }
  #editor-save-status { width: 100%; text-align: right; font-size: 10px; }
  .mobile-editor-toggle { display: flex; align-items: center; gap: 8px; padding: 10px 16px; min-height: 44px; border-bottom: 1px solid var(--line); background: #fbfaff; color: #6f5099; font-size: 12px; flex-shrink: 0; }
  .mobile-editor-toggle svg { width: 16px; height: 16px; }
  #editor-list-toggle-label { margin-left: auto; }
  .editor-workspace { display: block; overflow-y: auto; overscroll-behavior: contain; min-width: 0; }
  .editor-sidebar { display: none; border-right: 0; padding: 14px 16px; height: 100%; }
  .editor-modal.mobile-list-open .editor-sidebar { display: flex; }
  .editor-modal.mobile-list-open .editor-question-pane { display: none; }
  .editor-search input { height: 44px; }
  .editor-list-caption { padding-top: 6px; padding-bottom: 5px; }
  .editor-list-caption .text-button { min-height: 44px; }
  .editor-list-item { min-height: 52px; }
  .editor-list-item strong { font-size: 13px; }
  .editor-list-item small { font-size: 11px; }
  .editor-list-pages .icon-button { height: 44px; width: 44px; }
  .editor-question-pane { padding: 12px 16px 20px; overflow: visible; }
  .editor-question-heading { gap: 8px; }
  .editor-question-heading .text-button { min-height: 44px; }
  .editor-meta-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .editor-question-pane .field-label { margin-top: 13px; }
  .editor-option-row { gap: 6px; }
  .editor-answer-choice { align-self: stretch; padding: 0; min-width: 44px; min-height: 44px; gap: 5px; }
  .editor-answer-choice input { width: 18px; height: 18px; min-height: 0; }
  .editor-option-row .icon-button { min-width: 34px; width: 34px; height: 44px; margin-top: 0; }
  .editor-option-row textarea { padding: 10px; }
  .editor-options-heading .text-button, .editor-add-option { min-height: 40px; }
  .editor-question-navigation .button { min-height: 44px; }
  .editor-footer { flex-direction: column; align-items: stretch; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); gap: 6px; }
  .editor-footer p { font-size: 10px; }
  .editor-repair-label { min-height: 32px; margin-top: 2px; }
  .editor-footer-actions .button { min-height: 44px; flex: 1; }
  #editor-feedback { max-height: 68px; padding: 8px 16px; }
}
@media (max-width: 360px) {
  #main-content { padding-left: 12px; padding-right: 12px; }
  .stat-card { padding: 12px; }
  .stat-caption { font-size: 9px; }
  .question-body { padding-left: 13px; padding-right: 13px; }
  .question-top { padding-left: 10px; padding-right: 10px; }
  .question-tags { flex-basis: 100px; }
  .question-edit-button { padding: 5px; }
  .bookmark-button { width: 34px; }
}
@media (max-width: 760px) and (max-height: 520px), (max-width: 1000px) and (pointer: coarse) and (max-height: 520px) {
  .editor-header { padding-top: 4px; padding-bottom: 2px; }
  .editor-header .modal-eyebrow, .editor-footer p { display: none; }
  .editor-bank-name { padding-bottom: 5px; flex-wrap: nowrap; }
  #editor-save-status { display: none; }
  .editor-footer { flex-direction: row; align-items: center; padding-top: 6px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .editor-footer-actions { flex: 1; }
  .editor-repair-label { font-size: 10px; }
  .editor-modal.mobile-list-open .editor-sidebar {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 44px minmax(52px, 1fr) 44px; gap: 6px 12px; padding: 8px 16px;
  }
  .editor-sidebar .editor-search { grid-column: 1; grid-row: 1; }
  .editor-list-caption { grid-column: 2; grid-row: 1; padding: 0; gap: 12px; }
  #editor-question-list { grid-column: 1 / -1; grid-row: 2; }
  .editor-list-pages { grid-column: 1 / -1; grid-row: 3; padding: 0; }
  .editor-modal.mobile-list-open .editor-footer > div:first-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
