:root {
  --ink: #17211f;
  --muted: #71807d;
  --paper: #f5f7f6;
  --surface: #ffffff;
  --line: #dfe7e4;
  --green: #163f3a;
  --green-2: #2b685f;
  --mint: #dff3ed;
  --amber: #e8a33d;
  --rose: #c95f59;
  --blue: #4f7c9b;
  --shadow: 0 18px 50px rgba(20, 52, 47, 0.08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 85% 5%, #e4f2ed 0, transparent 24rem), var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 30px 18px; color: white; background: linear-gradient(165deg, #173f3a, #0f2e2b 72%); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: #f2cf7b; color: #173f3a; font-weight: 800; font-size: 20px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.45); }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 18px; letter-spacing: .04em; }
.brand span { color: #a9c6bf; font-size: 12px; margin-top: 4px; }
.sidebar nav { display: grid; gap: 7px; }
.nav-item { border: 0; color: #bcd0cb; background: transparent; display: flex; align-items: center; gap: 13px; border-radius: 12px; padding: 13px 15px; text-align: left; font-size: 15px; }
.nav-item > i { width: 20px; font-size: 20px; line-height: 1; text-align: center; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.1); color: white; }
.nav-item.active { box-shadow: inset 3px 0 #f2cf7b; }
.account-state { margin-top: auto; padding: 12px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid rgba(255,255,255,.1); }
.account-state > div { min-width: 0; display: flex; align-items: center; gap: 9px; }
.account-state > div > i { color: #f2cf7b; font-size: 22px; }
.account-state span, .account-state strong, .account-state small { min-width: 0; display: block; }
.account-state strong { overflow: hidden; color: white; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-state small { margin-top: 2px; overflow: hidden; color: #9ebbb5; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.account-state button { width: 32px; height: 32px; flex: 0 0 auto; border: 0; border-radius: 9px; color: #bcd0cb; background: rgba(255,255,255,.07); font-size: 17px; }
.account-state button:hover { color: white; background: rgba(255,255,255,.14); }
.system-state { margin-top: 8px; padding: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; display: flex; align-items: center; gap: 9px; color: #bed0cc; font-size: 12px; }
.system-state i { width: 8px; height: 8px; border-radius: 50%; background: #e5a543; box-shadow: 0 0 0 4px rgba(229,165,67,.14); }
.system-state.ready i { background: #66c39e; }
main { padding: 34px clamp(24px, 5vw, 74px) 80px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.topbar p, .dialog-head p { margin: 0 0 7px; color: var(--green-2); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(27px, 3vw, 38px); letter-spacing: -.04em; }
h2, h3, p { margin-top: 0; }
.primary-button, .ghost-button { min-height: 46px; border-radius: 13px; padding: 0 20px; border: 0; font-weight: 700; }
.primary-button { background: var(--green); color: white; box-shadow: 0 10px 24px rgba(22,63,58,.18); }
.primary-button:hover { background: var(--green-2); transform: translateY(-1px); }
.primary-button:disabled { opacity: .6; transform: none; }
.ghost-button { background: #eef3f1; color: var(--ink); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 25px; }
.metric-card { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.88); box-shadow: var(--shadow); }
.metric-button { width: 100%; color: inherit; text-align: left; cursor: pointer; }
.metric-button:hover { border-color: #aacbc2; transform: translateY(-2px); }
.metric-card span { color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; margin-top: 12px; font-size: 31px; letter-spacing: -.04em; }
.metric-card em { font-style: normal; color: var(--green-2); font-size: 12px; }
.content-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(280px,.75fr); gap: 20px; }
.panel { border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); padding: 22px; min-width: 0; }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font-size: 19px; }
.panel-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.work-detail-actions { display: flex; align-items: center; gap: 9px; }
.work-detail-actions button { display: inline-flex; align-items: center; gap: 6px; }
.danger-text { color: #a8443e; }
.text-button { color: var(--green-2); background: transparent; border: 0; font-weight: 700; padding: 4px; }
.work-list, .weak-list, .wrong-list { display: grid; gap: 10px; }
.work-item { position: relative; overflow: hidden; border: 1px solid transparent; border-radius: 14px; background: #f7f9f8; }
.work-item:hover { border-color: #cfe0db; }
.work-open { width: 100%; display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 13px; padding: 14px; border: 0; color: var(--ink); background: transparent; text-align: left; }
.work-item.deletable .work-open { padding-right: 62px; }
.work-delete { position: absolute; top: 50%; right: 13px; width: 35px; height: 35px; display: grid; place-items: center; transform: translateY(-50%); border: 1px solid transparent; border-radius: 9px; color: #89948f; background: transparent; font-size: 17px; }
.work-delete:hover { color: #a8443e; border-color: #edcfcc; background: #fff0ee; }
.subject-badge { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; }
.subject-badge.math { color: #1c5b50; background: #daf0e9; }
.subject-badge.cn { color: #9b4c47; background: #f8e5e2; }
.subject-badge.en { color: #3f6882; background: #e2edf4; }
.work-open strong, .work-open small { display: block; }
.work-open small { color: var(--muted); margin-top: 5px; }
.work-summary { min-width: 0; }
.work-review-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.work-review-stats em { padding: 4px 7px; border-radius: 7px; color: #52615d; background: #eaf0ee; font-size: 10px; font-style: normal; white-space: nowrap; }
.work-status-stack { display: grid; justify-items: end; gap: 4px; }
.work-status-stack > small { margin: 0; font-size: 10px; }
.status-pill.completed { color: #356383; background: #e6f0f6; }
.status-pill { border-radius: 999px; padding: 6px 10px; color: var(--green-2); background: var(--mint); font-size: 12px; white-space: nowrap; }
.weak-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 0; border-bottom: 1px solid #edf1ef; }
.weak-item:last-child { border-bottom: 0; }
.weak-item span { color: var(--muted); font-size: 12px; }
.progress { grid-column: 1 / -1; height: 6px; border-radius: 9px; overflow: hidden; background: #edf1ef; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e4aa48, #69a990); }
.empty { min-height: 220px; display: grid; place-items: center; text-align: center; padding: 30px; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 18px; margin-bottom: 8px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.wrong-toolbar > div:last-child { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.wrong-toolbar .primary-button { min-height: 42px; display: inline-flex; align-items: center; gap: 7px; }
.filter-group { display: flex; gap: 7px; flex-wrap: wrap; }
.filter-chip { border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; background: white; color: var(--muted); }
.filter-chip.active { background: var(--green); border-color: var(--green); color: white; }
.works-filterbar { margin-bottom: 18px; display: flex; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 14px; background: #f4f7f6; }
.work-center-list { gap: 12px; }
.question-card { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: white; margin-bottom: 16px; box-shadow: 0 10px 30px rgba(20,52,47,.05); }
.question-layout { display: grid; grid-template-columns: minmax(260px,.85fr) minmax(0,1.15fr); }
.question-image { background: #eef2f0; min-height: 300px; display: grid; place-items: center; overflow: hidden; }
.question-image img { width: 100%; height: 100%; object-fit: contain; max-height: 540px; }
.question-body { padding: 24px; }
.question-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.question-meta span { font-size: 12px; border-radius: 999px; padding: 5px 9px; background: #f1f5f3; color: var(--muted); }
.question-text { white-space: pre-wrap; line-height: 1.75; font-size: 16px; }
.answer-row { margin-top: 16px; padding: 13px 0; border-top: 1px solid #edf1ef; line-height: 1.65; }
.answer-row b { color: var(--muted); font-size: 13px; margin-right: 8px; }
.decision-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.decision-actions button { border: 1px solid var(--line); border-radius: 11px; padding: 10px 13px; background: white; }
.decision-actions .wrong-action { color: white; background: var(--rose); border-color: var(--rose); }
.wrong-card { display: grid; grid-template-columns: 54px 1fr auto; gap: 15px; align-items: start; border: 1px solid var(--line); border-radius: 16px; background: white; padding: 18px; }
.wrong-card.selectable { grid-template-columns: 28px 54px 1fr auto; transition: border-color .15s, box-shadow .15s; }
.wrong-card.selectable.selected { border-color: #78a99c; box-shadow: 0 0 0 3px rgba(43,104,95,.09); }
.wrong-select { position: relative; display: block; width: 24px; height: 24px; margin-top: 11px; }
.wrong-select input { position: absolute; z-index: 1; inset: 0; min-height: 0; opacity: 0; cursor: pointer; }.wrong-select span { width: 24px; height: 24px; display: grid; place-items: center; border: 1.5px solid #bdc9c5; border-radius: 7px; color: transparent; background: white; }.wrong-select input:checked + span { color: white; border-color: var(--green-2); background: var(--green-2); }
.wrong-card h3 { margin: 0 0 8px; font-size: 16px; }
.wrong-card p { color: var(--muted); margin-bottom: 7px; line-height: 1.6; }
.wrong-card small { color: var(--muted); }.archive-reason { display: block; margin-top: 6px; color: #8a6b3b; font-size: 11px; font-style: normal; }
.wrong-card-content { min-width: 0; }
.wrong-card-title { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.wrong-card-title button { flex: 0 0 auto; padding: 3px 0; display: inline-flex; align-items: center; gap: 4px; border: 0; color: var(--green-2); background: transparent; font-size: 11px; font-weight: 700; }
.wrong-source { width: fit-content; max-width: 100%; margin: 9px 0 7px; padding: 6px 9px; display: flex; align-items: center; gap: 6px; border-radius: 8px; color: #77531d; background: #fff4dc; font-size: 11px; }
.wrong-source i { color: #b87919; font-size: 14px; }.wrong-source span { color: #a47a3c; }.wrong-source strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.wrong-source time { color: #a47a3c; white-space: nowrap; }
.wrong-advanced-filters { margin: -5px 0 18px; padding: 12px; display: grid; grid-template-columns: minmax(180px,1fr) 155px 155px auto auto; align-items: end; gap: 9px; border: 1px solid var(--line); border-radius: 14px; background: #f8faf9; }
.wrong-advanced-filters label { display: grid; gap: 5px; }.wrong-advanced-filters label span { color: var(--muted); font-size: 10px; font-weight: 700; }.wrong-advanced-filters input { min-width: 0; height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: white; outline: none; }.wrong-advanced-filters input:focus { border-color: var(--green-2); }
.wrong-advanced-filters button { min-height: 39px; padding: 0 13px; border-radius: 9px; }
.pagination { margin: 20px 0 80px; display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--muted); font-size: 12px; }.pagination button { min-height: 38px; padding: 0 13px; display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 10px; color: var(--green); background: white; }.pagination button:disabled { opacity: .4; cursor: default; }
.mastery { min-width: 70px; text-align: right; font-weight: 800; color: var(--green-2); }
.archive-filter { display: inline-flex; align-items: center; gap: 5px; }
.wrong-selection-bar { position: sticky; z-index: 8; left: 0; right: 0; bottom: 18px; width: fit-content; min-width: 520px; margin: 20px auto 0; padding: 10px 12px 10px 18px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid #cddbd7; border-radius: 16px; opacity: 0; transform: translateY(10px); pointer-events: none; color: white; background: rgba(20,55,50,.96); box-shadow: 0 18px 45px rgba(12,37,33,.24); transition: .18s; }
.wrong-selection-bar.show { opacity: 1; transform: none; pointer-events: auto; }.wrong-selection-bar > div { margin-right: 8px; display: flex; align-items: baseline; gap: 5px; }.wrong-selection-bar > div strong { color: #f2cf7b; font-size: 22px; }.wrong-selection-bar > div span { font-size: 12px; }.wrong-selection-bar .ghost-button { min-height: 39px; padding: 0 14px; }.wrong-selection-bar .primary-button { min-height: 39px; padding: 0 15px; display: inline-flex; align-items: center; gap: 6px; color: var(--green); background: #f2cf7b; box-shadow: none; }.wrong-selection-bar .danger-text { color: #9e433e; background: #fbe8e6; }
.coach-workspace { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 14px; height: calc(100vh - 180px); min-height: 500px; }
.coach-session-panel { min-width: 0; overflow: hidden; display: grid; grid-template-rows: auto minmax(0,1fr); border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.72); }
.coach-session-head { padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.coach-session-head p, .coach-current-head p { margin: 0 0 3px; color: var(--muted); font-size: 10px; }.coach-session-head strong { font-size: 14px; }
.coach-session-head button { min-height: 34px; padding: 0 10px; display: inline-flex; align-items: center; gap: 4px; border: 0; border-radius: 9px; color: white; background: var(--green); font-size: 11px; font-weight: 800; }
.coach-session-list { min-height: 0; padding: 8px; overflow: auto; }
.coach-session-item { width: 100%; padding: 12px; display: grid; gap: 4px; border: 1px solid transparent; border-radius: 11px; text-align: left; color: var(--ink); background: transparent; }
.coach-session-item:hover { background: #f2f6f4; }.coach-session-item.active { border-color: #b8d1ca; background: #eaf4f1; }
.coach-session-item strong, .coach-session-item span, .coach-session-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.coach-session-item strong { font-size: 12px; }.coach-session-item span { color: var(--green-2); font-size: 9px; }.coach-session-item small { color: var(--muted); font-size: 10px; }
.coach-layout { min-width: 0; display: grid; grid-template-rows: auto minmax(0,1fr) auto; height: 100%; min-height: 0; }
.coach-current-head { padding-bottom: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.coach-current-head h2 { margin: 0; font-size: 19px; }.coach-current-head > span { padding: 5px 9px; border-radius: 99px; color: var(--green-2); background: var(--mint); font-size: 10px; font-weight: 700; }
.chat-stream { overflow: auto; padding: 8px 2px 20px; }
.message { max-width: 78%; padding: 14px 17px; border-radius: 17px; line-height: 1.7; margin: 10px 0; white-space: pre-wrap; }
.message.assistant { background: #edf5f2; border-bottom-left-radius: 5px; }
.message.user { background: var(--green); color: white; margin-left: auto; border-bottom-right-radius: 5px; }
.quick-prompts { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.quick-prompts button { border: 1px solid #cfe0db; color: var(--green-2); background: white; border-radius: 999px; padding: 8px 12px; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding-top: 15px; border-top: 1px solid var(--line); }
.chat-form textarea { resize: none; min-height: 50px; max-height: 130px; border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px; outline: none; }
.chat-form textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(43,104,95,.1); }
dialog { width: min(620px, calc(100vw - 28px)); border: 0; border-radius: 23px; padding: 0; box-shadow: 0 30px 90px rgba(10,34,30,.28); }
dialog::backdrop { background: rgba(8,25,23,.5); backdrop-filter: blur(4px); }
dialog form { padding: 25px; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 22px; }
.dialog-head h2 { margin: 0; font-size: 26px; }
.icon-button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #eff3f1; font-size: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: grid; gap: 7px; color: #56635f; font-size: 13px; font-weight: 700; }
label.full { grid-column: 1 / -1; }
input, select { width: 100%; min-height: 45px; border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; background: white; color: var(--ink); outline: none; }
input:focus, select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(43,104,95,.1); }
.drop-zone { margin-top: 16px; min-height: 190px; padding: 24px; border: 1.5px dashed #a9c8c0; border-radius: 16px; background: #f5faf8; text-align: center; place-items: center; align-content: center; }
.drop-zone input { position: absolute; opacity: 0; pointer-events: none; }
.drop-zone strong, .drop-zone small, .drop-zone output { display: block; }
.drop-zone small { color: var(--muted); font-weight: 400; }
.drop-zone output { color: var(--green-2); }
.camera-ring { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green-2); font-size: 24px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.dialog-actions .primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.wide-dialog { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.wide-dialog form { max-height: calc(100vh - 32px); overflow-y: auto; }
.page-preview-button { display: inline-flex; align-items: center; gap: 5px; padding: 5px 0; }
.image-preview-dialog { width: min(1100px, calc(100vw - 32px)); max-width: none; background: #f5f7f6; }
.image-preview-shell { padding: 20px; }
.image-preview-head { margin-bottom: 14px; }
.image-preview-head h2 { max-width: min(720px, 70vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-preview-stage { max-height: calc(100vh - 210px); overflow: auto; display: grid; place-items: start center; border: 1px solid var(--line); border-radius: 16px; background: #dfe5e2; }
.image-preview-stage img { display: block; max-width: 100%; height: auto; background: white; }
.image-preview-actions { align-items: center; }
.image-preview-actions > span { margin-right: auto; color: var(--muted); font-size: 12px; }
.image-download-link { min-height: 46px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.intake-steps { display: grid; grid-template-columns: max-content 1fr max-content; align-items: center; gap: 12px; margin: -4px 0 22px; color: #91a09c; font-size: 12px; font-weight: 700; }
.intake-steps > i { height: 1px; background: var(--line); }
.intake-steps span { display: flex; align-items: center; gap: 7px; }
.intake-steps b { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #788682; background: #edf1ef; }
.intake-steps span.active { color: var(--green); }.intake-steps span.active b { color: white; background: var(--green); }
.intake-meta { margin-bottom: 16px; }
.intake-source-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.intake-text-source, .intake-image-source { min-height: 270px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: #fafcfb; }
.intake-text-source > span { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; }
.intake-text-source > span i { grid-row: 1 / 3; color: var(--green-2); font-size: 22px; }
.intake-text-source small, .intake-image-source small { color: var(--muted); font-weight: 400; }
.intake-text-source textarea { width: 100%; min-height: 185px; resize: vertical; border: 0; border-top: 1px solid var(--line); margin-top: 12px; padding: 13px 2px 0; outline: none; color: var(--ink); background: transparent; line-height: 1.65; }
.intake-image-source { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; overflow: hidden; text-align: center; border-style: dashed; border-color: #a7c5bd; cursor: pointer; }
.intake-image-source.dragging { border-color: var(--green); background: #edf7f3; box-shadow: inset 0 0 0 2px rgba(22,63,58,.08); }
.intake-image-source input { position: absolute; opacity: 0; pointer-events: none; }
.intake-upload-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; color: white; background: var(--green-2); font-size: 25px; }
.intake-image-source img { width: 100%; height: 155px; border-radius: 10px; object-fit: contain; background: #edf1ef; }
.intake-image-source img:not([hidden]) ~ .intake-upload-icon { display: none; }
.intake-image-source output { color: var(--green-2); font-size: 11px; }
.privacy-tip { display: flex; align-items: center; gap: 7px; margin: 12px 2px 0; color: var(--muted); font-size: 11px; }
.privacy-tip i { color: var(--green-2); font-size: 16px; }
.intake-result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.intake-result-head strong, .intake-result-head span { display: block; }.intake-result-head span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.intake-preview-list { display: grid; gap: 10px; max-height: 52vh; overflow-y: auto; padding-right: 4px; }
.intake-preview-card { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fafcfb; }
.intake-select { position: relative; display: block; width: 25px; height: 25px; margin-top: 2px; }
.intake-select input { position: absolute; opacity: 0; pointer-events: none; }.intake-select span { width: 25px; height: 25px; display: grid; place-items: center; border: 1.5px solid #b9c7c2; border-radius: 7px; color: transparent; background: white; }.intake-select input:checked + span { color: white; border-color: var(--green-2); background: var(--green-2); }
.intake-card-fields { min-width: 0; display: grid; gap: 10px; }
.intake-card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }.intake-card-title span { color: var(--muted); font-size: 11px; }
.intake-card-fields label { gap: 5px; }.intake-card-fields textarea { width: 100%; min-height: 64px; resize: vertical; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; outline: none; color: var(--ink); background: white; line-height: 1.55; }.intake-card-fields textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(43,104,95,.1); }
.intake-answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.intake-card-fields details { color: var(--muted); font-size: 11px; }.intake-card-fields summary { color: var(--green-2); cursor: pointer; font-weight: 700; }.intake-card-fields details p { margin: 8px 0 0; line-height: 1.6; }
.practice-dialog-intro { margin: -4px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.check-row { display: flex; grid-column: 1 / -1; grid-template-columns: 22px 1fr; align-items: center; gap: 9px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf9; }.check-row input { width: 18px; min-height: 18px; accent-color: var(--green); }
.practice-print-summary { margin-top: 16px; min-height: 58px; padding: 0 16px; display: flex; align-items: center; gap: 10px; border-radius: 13px; color: var(--green); background: var(--mint); }.practice-print-summary > i { font-size: 24px; }.practice-print-summary strong { font-size: 20px; }
.wrong-edit-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(260px,.65fr); gap: 20px; }
.wrong-detail-content { min-width: 0; display: grid; gap: 11px; }
.wrong-detail-block { min-width: 0; padding: 14px 16px; border: 1px solid transparent; border-radius: 13px; }
.wrong-detail-block > span { display: block; margin-bottom: 7px; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.wrong-detail-block > div { overflow-wrap: anywhere; color: #27322f; font-size: 14px; line-height: 1.75; white-space: pre-wrap; }
.wrong-detail-block.question { border-color: #c9ddd7; background: #f1f8f5; }.wrong-detail-block.question > span { color: #28705f; }.wrong-detail-block.question > div { font-size: 16px; font-weight: 650; }
.wrong-detail-answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wrong-detail-block.student { border-color: #f0d2ce; background: #fff5f3; }.wrong-detail-block.student > span { color: #ad4d45; }
.wrong-detail-block.correct { border-color: #c8e1d5; background: #eef8f3; }.wrong-detail-block.correct > span { color: #287251; }
.wrong-detail-block.solution { border-color: #d8dded; background: #f5f6fb; }.wrong-detail-block.solution > span { color: #536596; }
.wrong-detail-block.analysis { border-color: #eeddbb; background: #fff9ed; }.wrong-detail-block.analysis > span { color: #93621d; }
.wrong-detail-block.strategy { border-color: #d8d2eb; background: #f8f5fd; }.wrong-detail-block.strategy > span { color: #715c9b; }
.wrong-detail-meta { display: flex; flex-wrap: wrap; gap: 7px; }.wrong-detail-meta span { padding: 5px 9px; border-radius: 99px; color: #4f625d; background: #edf2f0; font-size: 10px; font-weight: 700; }
.wrong-topic-editor { min-height: 48px; padding: 7px 8px 7px 12px; display: grid; grid-template-columns: auto minmax(120px,1fr) auto; align-items: center; gap: 9px; border: 1px solid #d8e2de; border-radius: 11px; background: #fafcfb; }.wrong-topic-editor label { display: flex; align-items: center; gap: 5px; color: #52605c; font-size: 10px; font-weight: 800; white-space: nowrap; }.wrong-topic-editor label i { color: var(--green-2); font-size: 15px; }.wrong-topic-editor input { min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; outline: none; }.wrong-topic-editor input:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(43,104,95,.08); }.wrong-topic-editor button { min-height: 34px; padding: 0 11px; }
.math-rich .katex, .wrong-detail-block .katex { font-size: 1.08em; }.wrong-detail-block .katex-display { margin: .45em 0; overflow-x: auto; overflow-y: hidden; text-align: left; }
.wrong-edit-images { min-width: 0; }.wrong-edit-images > div:first-child strong, .wrong-edit-images > div:first-child span { display: block; }.wrong-edit-images > div:first-child span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.wrong-edit-image-list { margin-top: 11px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wrong-edit-image-card { position: relative; min-width: 0; }.wrong-edit-preview { width: 100%; padding: 0; overflow: hidden; display: block; border: 1px solid var(--line); border-radius: 10px; background: #eef2f0; }.wrong-edit-preview img { width: 100%; height: 115px; display: block; object-fit: cover; }.wrong-edit-preview span { padding: 6px; display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--green-2); background: white; font-size: 10px; }.wrong-edit-image-card em { position: absolute; left: 6px; top: 6px; padding: 3px 6px; border-radius: 6px; color: white; background: rgba(20,55,50,.82); font-size: 9px; font-style: normal; }.wrong-image-delete { position: absolute; right: 6px; top: 6px; width: 27px; height: 27px; display: grid; place-items: center; border: 0; border-radius: 7px; color: white; background: rgba(174,67,59,.9); }
.wrong-edit-upload { min-height: 100px; margin-top: 10px; padding: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px dashed #9cbeb5; border-radius: 11px; color: var(--green-2); background: #f5faf8; cursor: pointer; }.wrong-edit-upload input { position: absolute; opacity: 0; pointer-events: none; }.wrong-edit-upload i { font-size: 24px; }.wrong-edit-upload span { color: var(--muted); font-size: 10px; font-weight: 400; }.wrong-edit-no-image { min-height: 105px; display: grid; place-items: center; align-content: center; gap: 5px; border-radius: 10px; color: var(--muted); background: #f4f7f6; font-size: 10px; }.wrong-edit-no-image i { font-size: 25px; }
.wrong-image-upload-button { width: 100%; margin-top: 8px; justify-content: center; }.wrong-image-upload-button:disabled { opacity: .48; cursor: not-allowed; }
.wrong-ai-editor { margin-top: 18px; padding: 16px; border: 1px solid #b9d6ce; border-radius: 15px; background: linear-gradient(135deg,#eff8f5,#f9fbfa); }
.wrong-ai-editor-head { display: flex; align-items: flex-start; gap: 10px; }.wrong-ai-editor-head > i { color: var(--green-2); font-size: 23px; }.wrong-ai-editor-head strong, .wrong-ai-editor-head span { display: block; }.wrong-ai-editor-head span { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.wrong-ai-editor textarea { width: 100%; min-height: 82px; margin-top: 12px; padding: 12px 13px; resize: vertical; border: 1px solid #aacbc2; border-radius: 11px; color: var(--ink); background: white; outline: none; font: inherit; line-height: 1.6; }.wrong-ai-editor textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(43,104,95,.1); }
.wrong-ai-editor .dialog-actions { align-items: center; }.ai-edit-safety { margin-right: auto; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
#toast { position: fixed; z-index: 30; right: 24px; bottom: 24px; background: #152d29; color: white; padding: 13px 17px; border-radius: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; box-shadow: var(--shadow); }
#toast.show { opacity: 1; transform: translateY(0); }
.mobile-nav { display: none; }
.skeleton { height: 88px; border-radius: 15px; background: linear-gradient(90deg,#edf1ef 25%,#f8faf9 45%,#edf1ef 65%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -100% 0; } }

/* PC review workbench */
body.review-mode { height: 100vh; overflow: hidden; }
.review-mode .app-shell { height: 100vh; min-height: 0; overflow: hidden; }
.review-mode main { min-height: 0; padding: 22px 24px 28px; height: 100vh; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.review-mode .topbar { margin-bottom: 16px; }
.review-mode .topbar h1 { font-size: 25px; }
.review-mode .topbar .primary-button { display: none; }
.review-mode #view-root { min-height: 0; height: 100%; overflow: hidden; }
.review-page { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; height: 100%; min-height: 0; }
.review-contextbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 42px; }
.review-work-tabs, .review-page-tabs { display: flex; align-items: center; gap: 7px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.review-work-tabs { margin-right: auto; }
.review-back-button { flex: 0 0 auto; min-height: 36px; padding: 0 11px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 10px; color: var(--green); background: rgba(255,255,255,.88); font-size: 11px; font-weight: 800; }
.review-back-button:hover { border-color: #a9c8c0; background: #f3f8f6; }
.review-work-tabs::-webkit-scrollbar, .review-page-tabs::-webkit-scrollbar { display: none; }
.review-work-tabs button, .review-page-tabs button { border: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,.88); border-radius: 10px; min-height: 36px; padding: 0 12px; white-space: nowrap; }
.review-work-tabs button { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.review-work-tabs button span { min-width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 99px; background: #edf1ef; font-size: 11px; }
.review-work-tabs button.active, .review-page-tabs button.active { color: white; background: var(--green); border-color: var(--green); }
.review-work-tabs button.active span { color: var(--green); background: white; }
.review-workbench { min-height: 0; height: 100%; display: grid; grid-template-columns: minmax(520px, 1fr) minmax(360px, 410px); gap: 12px; overflow: hidden; }
.review-canvas-panel, .review-inspector { min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #d9e1de; border-radius: 18px; background: white; box-shadow: 0 14px 38px rgba(20,52,47,.07); }
.review-canvas-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.review-canvas-toolbar { min-height: 58px; padding: 9px 14px 9px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.review-canvas-toolbar strong, .review-canvas-toolbar span { display: block; }
.review-canvas-toolbar strong { font-size: 14px; }
.review-canvas-toolbar > div:first-child span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.canvas-tools { display: flex; align-items: center; gap: 5px; }
.canvas-tools button, .review-help { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: #44514e; background: white; font-size: 17px; }
.canvas-tools button:hover, .review-help:hover { color: var(--green); border-color: #a9c8c0; background: #f3f8f6; }
.canvas-tools output { min-width: 42px; text-align: center; color: var(--muted); font-size: 11px; }
.tool-separator { width: 1px; height: 22px; margin: 0 4px; background: var(--line); }
.paper-viewport { min-height: 0; overflow: auto; padding: 30px; background: #e8edeb; scrollbar-color: #aab8b3 transparent; }
.paper-sheet { position: relative; width: min(100%, 880px); margin: 0 auto; background: white; box-shadow: 0 14px 34px rgba(23,33,31,.16); transform-origin: center top; transition: transform .18s ease; }
.paper-page { position: absolute; left: 50%; top: 50%; transform-origin: center; }
.paper-page > img { display: block; width: 100%; height: 100%; object-fit: fill; user-select: none; }
.paper-box-layer { position: absolute; inset: 0; }
.paper-question-box { position: absolute; min-width: 36px; min-height: 30px; padding: 0; border: 2px solid rgba(255,255,255,.94); outline: 1px solid rgba(23,33,31,.34); border-radius: 7px; background: transparent; box-shadow: 0 2px 9px rgba(23,33,31,.14); color: white; text-align: left; transition: border-color .16s, box-shadow .16s; }
.paper-question-box > span { position: absolute; top: -14px; left: -12px; min-width: 28px; height: 28px; padding: 0 7px; display: grid; place-items: center; border: 2px solid white; border-radius: 99px; color: white; background: #687672; font-style: normal; font-size: 12px; font-weight: 800; box-shadow: 0 3px 10px rgba(23,33,31,.2); transform: rotate(var(--counter-rotation, 0deg)); }
.paper-question-box > em { position: absolute; right: 5px; bottom: 5px; padding: 3px 7px; border-radius: 6px; color: white; background: rgba(23,33,31,.72); font-size: 9px; font-style: normal; font-weight: 700; white-space: nowrap; opacity: 0; transition: opacity .15s; transform: rotate(var(--counter-rotation, 0deg)); }
.paper-question-box:hover > em, .paper-question-box.active > em { opacity: 1; }
.paper-question-box.wrong { border-color: #ef786d; background: transparent; outline-color: #c85a50; }
.paper-question-box.wrong > span { background: #d95f54; }
.paper-question-box.correct { border-color: #64b792; background: transparent; outline-color: #3b8f69; }
.paper-question-box.correct > span { background: #3f9870; }
.paper-question-box.partial, .paper-question-box.uncertain { border-color: #e4af55; background: transparent; outline-color: #bd7c1d; }
.paper-question-box.partial > span, .paper-question-box.uncertain > span { background: #d58a28; }
.paper-question-box.selected { border-color: #5a8fd3; outline-color: #2f67ad; background: transparent; box-shadow: inset 0 0 0 3px rgba(61,122,198,.14), 0 0 0 3px rgba(61,122,198,.17), 0 4px 14px rgba(23,68,123,.18); }
.paper-question-box.selected > span { background: #3d7ac6; }
.paper-question-box.active { z-index: 2; box-shadow: 0 0 0 4px rgba(255,255,255,.88), 0 0 0 6px #254e48; }
.canvas-empty { min-height: 420px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); }
.canvas-empty i { font-size: 32px; }
.review-legend { min-height: 42px; display: flex; align-items: center; gap: 17px; padding: 0 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.review-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; background: #89948f; }
.legend-dot.ai-wrong { background: #d95f54; }.legend-dot.ai-correct { background: #3f9870; }.legend-dot.ai-uncertain { background: #d58a28; }.legend-dot.chosen { background: #3d7ac6; }
.review-inspector { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.review-inspector-head { padding: 17px 18px 12px; display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.review-inspector-head p { margin: 0 0 4px; color: var(--green-2); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.review-inspector-head h2 { margin: 0; font-size: 18px; }
.review-inspector-head h2 span { color: var(--rose); }
.review-quick-actions { display: grid; grid-template-columns: 1fr; gap: 7px; padding: 0 18px 12px; }
.review-quick-actions button { min-height: 36px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; color: #465550; background: #f7f9f8; font-size: 12px; font-weight: 700; }
.review-quick-actions button:hover { border-color: #a9c8c0; background: #f0f7f4; }
.review-question-list { min-height: 0; overflow-y: auto; padding: 0 12px 16px; scrollbar-color: #c3cec9 transparent; }
.review-page-empty { min-height: 240px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 24px; color: var(--muted); text-align: center; }
.review-page-empty i { color: var(--green-2); font-size: 30px; }
.review-page-empty strong { color: var(--ink); }
.review-page-empty span { max-width: 250px; font-size: 12px; line-height: 1.6; }
.review-question { margin: 0 0 8px; border: 1px solid var(--line); border-radius: 12px; background: white; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.review-question:hover { border-color: #b9cbc5; }
.review-question.active { border-color: #86aaa1; box-shadow: 0 5px 17px rgba(22,63,58,.08); }
.review-question.selected { border-color: #8bb1dd; }
.review-question-summary { min-height: 65px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px; }
.review-order { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: #52615d; background: #edf2f0; font-size: 12px; font-weight: 800; }
.review-question.ai-detected-wrong { border-color: #efaaa3; background: #fffafa; }
.review-question.ai-detected-wrong .review-order { color: white; background: #d95f54; }
.review-add-wrong, .wrongbook-added { min-height: 32px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border-radius: 8px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.review-add-wrong { color: #315f55; border: 1px solid #b8d0c9; background: #eef7f4; }
.review-add-wrong.recommended { color: white; border-color: #c95249; background: #d95f54; }
.review-add-wrong:disabled { opacity: .65; cursor: wait; }
.wrongbook-added { border: 0; color: #2f67ad; background: #e7f0fb; cursor: pointer; }
.wrongbook-added:hover { color: #a83f38; background: #fcedeb; }
.wrong-evidence { color: #a83f38 !important; background: #fcedeb !important; }
.question-check { display: block; position: relative; width: 24px; height: 24px; }
.question-check input { position: absolute; opacity: 0; pointer-events: none; }
.question-check span { width: 24px; height: 24px; display: grid; place-items: center; border: 1.5px solid #bdc9c5; border-radius: 7px; color: transparent; background: white; transition: .15s; }
.question-check input:focus-visible + span { outline: 3px solid rgba(61,122,198,.22); }
.question-check input:checked + span { color: white; border-color: #3d7ac6; background: #3d7ac6; }
.question-summary-button { min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.question-summary-button > strong, .question-summary-button > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.question-summary-button strong { color: var(--ink); font-size: 13px; }
.question-summary-button > span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.review-ai-tag { padding: 4px 6px; border-radius: 6px; color: #6d6251; background: #faf0dc; font-size: 9px; white-space: nowrap; }
.review-ai-tag.high { color: #386958; background: #e7f3ee; }.review-ai-tag.low { color: #a44f48; background: #fae7e4; }
.review-question-detail { display: none; padding: 4px 13px 14px 44px; border-top: 1px solid #edf1ef; }
.review-question.active .review-question-detail { display: block; }
.review-meta-row { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; }
.review-meta-row span { padding: 3px 7px; border-radius: 99px; color: var(--muted); background: #f1f5f3; font-size: 9px; }
.review-question-text { max-height: 150px; margin: 11px 0 0; overflow: auto; color: #27322f; font-size: 12px; line-height: 1.65; white-space: pre-wrap; }
.review-question-text .katex, .review-answers .katex, .ai-solution .katex { white-space: nowrap; }
.review-answers { margin: 11px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.review-answers > div { min-width: 0; padding: 8px 9px; border-radius: 8px; background: #f6f8f7; }
.review-answers dt { color: var(--muted); font-size: 9px; }.review-answers dd { margin: 4px 0 0; max-height: 52px; overflow: auto; font-size: 11px; line-height: 1.5; white-space: pre-wrap; }
.ai-solution { margin-top: 9px; border-top: 1px solid #edf1ef; padding-top: 8px; color: var(--muted); font-size: 11px; }
.ai-solution summary { color: var(--green-2); cursor: pointer; font-weight: 700; }.ai-solution p { margin: 8px 0 0; line-height: 1.6; }
.review-decisions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 11px; }
.review-decisions button { min-width: 0; min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 8px; color: #4c5955; background: white; font-size: 11px; font-weight: 700; }
.review-decisions button:hover { background: #f6f8f7; }.review-decisions button.active.correct { color: #287251; border-color: #6eb995; background: #e9f6f0; }.review-decisions button.active.wrong { color: #a83f38; border-color: #e0847c; background: #fcedeb; }.review-decisions button.active.uncertain { color: #94611e; border-color: #e1b164; background: #fff5e6; }
.review-decisions kbd { padding: 1px 4px; border: 1px solid #dfe5e2; border-radius: 4px; color: #87928e; background: #f5f7f6; font-size: 8px; font-family: inherit; }
.review-submitbar { min-height: 72px; padding: 11px 14px 11px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); background: #fbfcfc; }
.review-result-counts { display: flex; align-items: center; gap: 14px; }
.review-result-counts span { display: grid; gap: 1px; color: var(--muted); font-size: 9px; font-weight: 700; white-space: nowrap; }
.review-result-counts strong { color: #3d7ac6; font-size: 21px; line-height: 1; }
.review-submitbar .primary-button { min-height: 39px; padding: 0 15px; display: flex; align-items: center; gap: 6px; border-radius: 10px; font-size: 12px; }
.review-spin { animation: review-spin .8s linear infinite; } @keyframes review-spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .review-workbench { grid-template-columns: minmax(440px, 1fr) 350px; }
  .paper-viewport { padding: 22px; }
}

@media (max-width: 900px) {
  body.review-mode { height: auto; overflow: auto; }
  .review-mode .app-shell { height: auto; min-height: 100vh; overflow: visible; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  main { padding: 24px 17px 96px; }
  .topbar { align-items: flex-end; margin-bottom: 22px; }
  .topbar .primary-button { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 17px; }
  .content-grid { grid-template-columns: 1fr; }
  .works-filterbar { align-items: stretch; flex-direction: column; }
  .question-layout { grid-template-columns: 1fr; }
  .question-image { min-height: 220px; }
  .mobile-nav { position: fixed; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; left: 0; right: 0; bottom: 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); padding: 9px 2px; font-size: 12px; }
  .mobile-nav button.active { color: var(--green); font-weight: 800; }
  .mobile-nav .mobile-upload { width: 48px; height: 48px; margin: -22px auto 0; border-radius: 16px; color: white; background: var(--green); font-size: 27px; box-shadow: 0 9px 24px rgba(22,63,58,.25); }
  .coach-workspace { height: auto; min-height: calc(100vh - 180px); grid-template-columns: 1fr; }
  .coach-session-panel { max-height: 210px; }
  .coach-layout { height: 62vh; min-height: 480px; }
  .message { max-width: 90%; }
  .review-mode main { height: auto; min-height: 100vh; overflow: visible; padding: 18px 12px 96px; display: block; }
  .review-mode .topbar { display: none; }
  .review-mode #view-root { height: auto; overflow: visible; }
  .review-page { height: auto; min-height: calc(100vh - 116px); }
  .review-contextbar { align-items: stretch; flex-direction: column; }
  .review-workbench { grid-template-columns: 1fr; }
  .review-canvas-panel { min-height: 62vh; }
  .review-inspector { max-height: none; }
  .review-question-list { max-height: 70vh; }
  .intake-source-grid { grid-template-columns: 1fr; }
  .intake-text-source, .intake-image-source { min-height: 220px; }
  .image-preview-shell { padding: 14px; }
  .image-preview-stage { max-height: calc(100vh - 235px); }
  .image-preview-actions { flex-wrap: wrap; }
  .image-preview-actions > span { width: 100%; }
  .wrong-selection-bar { min-width: 0; width: calc(100% - 8px); flex-wrap: wrap; bottom: 78px; }
  .wrong-advanced-filters { grid-template-columns: 1fr 1fr; }.wrong-advanced-filters label:first-child { grid-column: 1 / -1; }
  .wrong-edit-grid { grid-template-columns: 1fr; }
  .wrong-detail-answer-grid { grid-template-columns: 1fr; }
  .wrong-ai-editor .dialog-actions { align-items: stretch; flex-direction: column; }.ai-edit-safety { margin-right: 0; }
}

@media (max-width: 520px) {
  .topbar p { font-size: 12px; }
  h1 { font-size: 27px; }
  .metric-card strong { font-size: 27px; }
  .form-grid { grid-template-columns: 1fr; }
  label.full { grid-column: auto; }
  .wrong-card { grid-template-columns: 46px 1fr; }
  .wrong-card.selectable { grid-template-columns: 28px 46px 1fr; }.wrong-card.selectable .mastery { grid-column: 3; }
  .mastery { grid-column: 2; text-align: left; }
  .wrong-toolbar { align-items: stretch; flex-direction: column; }.wrong-toolbar > div:last-child { justify-content: space-between; }
  .wrong-card-title { display: block; }.wrong-card-title button { margin-bottom: 6px; }.wrong-source { flex-wrap: wrap; }
  .wrong-advanced-filters { grid-template-columns: 1fr; }.wrong-advanced-filters label:first-child { grid-column: auto; }
  .intake-answer-grid { grid-template-columns: 1fr; }
}
