/* Shared product language. Screen-only: printed papers retain their own layout. */
@media screen {
  :root {
    --ink: #24324a; --muted: #627087; --subtle: #627087;
    --blue: #2154d1; --blue-hover: #1743b2; --green: #2154d1;
    --green-dark: #1743b2; --bg: #f3f6fb; --border: #dfe6ef; --line: #dfe6ef;
    --sidebar-width: 216px; --shadow: 0 4px 18px #182c4f06;
    color: var(--ink); background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-synthesis: none;
  }
  body { font-size: 14px; line-height: 1.65; }
  h1, h2, h3, h4 { color: #182c4f; letter-spacing: -.025em; }
  h1 { font-size: 36px; line-height: 1.25; font-weight: 700; }
  h2 { font-size: 21px; font-weight: 650; }
  h3 { font-size: 17px; line-height: 1.55; }
  p { text-wrap: pretty; }
  button, a, input, select, textarea { touch-action: manipulation; }
  :is(button,a,input,select,textarea,summary):focus-visible { outline: 3px solid #2f69e7; outline-offset: 3px; }
  input, textarea, select { border-color: #cdd7e5; border-radius: 9px; }
  input::placeholder, textarea::placeholder { color: #748098; }
  input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }
  .primary, .button, .student-primary, .student-button { min-height: 44px; border-radius: 10px; font-size: 13px; font-weight: 600; }
  .primary, .student-primary { background: var(--blue); color: white; box-shadow: 0 3px 7px #2154d116; }
  .primary:hover, .student-primary:hover { background: var(--blue-hover); }
  .button, .student-button { border-color: #cdd7e5; background: white; }
  .button:hover, .student-button:hover { border-color: #9baccc; background: #f5f8ff; }
  .primary:active, .button:active, .student-primary:active, .student-button:active { transform: translateY(1px); }
  .danger-text { color: #a93c36; }
  .helper, .student-muted { color: var(--muted); line-height: 1.75; }

  /* A navy navigation spine anchors the teacher's tools. */
  .sidebar { background: #182c4f; border: 0; padding: 30px 14px 20px; color: #d6e1f6; }
  .brand { color: #fff; font-size: 30px; gap: 12px; margin-bottom: 42px; }
  .brand-icon { background: #fff; color: #2154d1; border-radius: 11px; box-shadow: none; }
  .brand-caption { color: #b8c8e6; font-size: 10px; margin-top: 8px; }
  .workspace-label { color: #afc0de; font-size: 11px; }
  .nav-item { color: #ccdaf1; min-height: 46px; border-radius: 9px; padding: 11px 13px; }
  .nav-item:hover { background: #ffffff0d; color: #fff; }
  .nav-item.active { background: #fff; color: #1748bb; box-shadow: 0 2px 7px #07152816; font-weight: 650; }
  .nav-label-short { display: none; }
  .nav-count { background: #eaf0ff; color: #2154d1; }
  .sidebar-divider { background: #ffffff1c; margin: 23px 10px; }
  .sidebar-bottom { color: #c9d7ee; border-color: #ffffff20; }
  .local-note, .local-note span, .teacher small { color: #b7c9e5; }
  .teacher { color: #edf4ff; border-color: #ffffff20; }
  .teacher .avatar { background: #ffffff13; color: #fff; }
  .topbar { background: #fff; border-bottom: 1px solid var(--border); height: 72px; padding: 0 36px; }
  .breadcrumb { color: var(--muted); font-size: 12px; }
  .breadcrumb b { color: #24324a; font-weight: 600; }
  .today-date { color: var(--muted); }
  .stage-switch { background: #f0f3f9; padding: 4px; border: 1px solid #e4eaf3; border-radius: 10px; }
  .stage-switch button { min-height: 32px; border-radius: 7px; }
  .stage-switch button.active { color: #2154d1; box-shadow: 0 1px 5px #142f5410; }
  .workspace main { max-width: 1560px; margin: 0 auto; padding: 36px 36px 20px; }
  .page-heading { gap: 20px; margin-bottom: 26px; align-items: center; }
  .heading-copy { max-width: 65ch; }
  .page-title { font-size: 34px; line-height: 1.25; letter-spacing: -.035em; }
  .heading-copy p { font-size: 13px; line-height: 1.8; margin-top: 10px; color: var(--muted); }
  .heading-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
  .heading-more { position: relative; z-index: 4; }
  .heading-more summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
  .heading-more summary::-webkit-details-marker { display: none; }
  .heading-menu { position: absolute; right: 0; top: calc(100% + 8px); padding: 7px; width: 185px; background: #fff; border: 1px solid #dce4f0; border-radius: 12px; box-shadow: 0 10px 35px #182c4f1a; }
  .heading-menu button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px; min-height: 44px; text-align: left; border-radius: 7px; font-size: 13px; }
  .heading-menu button:hover { background: #eef3ff; color: #2154d1; }
  .workspace .question-card:has(.question-more[open]) { position: relative; z-index: 5; overflow: visible; }
  .workspace .question-more[open] { z-index: 5; }
  .workspace .question-more>summary { min-height: 44px; }
  .workspace .question-more .heading-menu { left: 0; right: auto; }
  .workspace .question-more .heading-menu button { padding: 10px 12px; }
  .heading-actions .button, .heading-actions .primary { padding: 10px 14px; font-size: 12px; }
  .heading-actions [data-action=drafts-open] { background: transparent; border-color: transparent; color: var(--muted); }
  .scope-bar { background: none; padding: 0 0 22px; margin-bottom: 0; border: 0; gap: 10px; }
  .scope-bar select { min-height: 42px; background: #fff; border-color: #dce3ed; border-radius: 9px; font-size: 12px; }
  .scope-bar>span { font-size: 12px; color: var(--muted); }

  /* One compact work queue, then the questions. */
  .teacher-today { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; border: 1px solid #dce5f3; border-radius: 12px; padding: 16px 22px; background: #fff; margin: 0 0 20px; box-shadow: none; }
  .teacher-today-heading { display: block; margin: 0; min-width: 90px; }
  .teacher-today-heading h2 { font-size: 16px; margin-bottom: 3px; }
  .teacher-today-heading>span { color: #6a7a93; font-size: 11px; }
  .teacher-today-actions { flex: 1; gap: 0; }
  .teacher-today-actions button { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 50px; border: 0; border-left: 1px solid #e4eaf3; border-radius: 0; padding: 0 18px; background: none; box-shadow: none; }
  .teacher-today-actions button:first-child { padding-left: 0; }
  .teacher-today-actions button:last-child { border-right: 0; }
  .teacher-today-actions button>span { font-size: 12px; color: #4c5d78; }
  .teacher-today-actions strong { font-size: 31px; line-height: 1.3; color: #2154d1; margin: 6px 0; font-variant-numeric: tabular-nums; }
  .teacher-today-actions small { font-size: 11px; color: #6a7890; }
  .teacher-today .helper { flex-basis: 100%; font-size: 11px; margin: 0; min-height: 0; }
  .teacher-today .helper:empty { display: none; }
  .notebook-summary { padding: 0 1px 18px; font-size: 12px; }
  .notebook-summary b { color: #24324a; font-size: 16px; }
  .content-columns { gap: 26px; grid-template-columns: minmax(0,1fr) 235px; }
  .notebook-title { margin-bottom: 19px; align-items: baseline; }
  .notebook-title h2 { font-size: 20px; }
  .notebook-title>span { font-size: 11px; }
  .subject-tabs { gap: 20px; border-bottom: 1px solid #dbe3ef; margin-bottom: 18px; }
  .subject-tabs button { min-height: 44px; border-radius: 0; padding: 8px 0 12px; border-bottom: 2px solid transparent; font-size: 13px; background: none; }
  .subject-tabs button.active { color: #2154d1; border-bottom-color: #2154d1; background: none; }
  .subject-tabs button>span { background: #e8edf7; color: #526580; border-radius: 5px; font-size: 10px; padding: 1px 5px; }
  .search-row { gap: 10px; margin-bottom: 14px; }
  .search-box { border: 1px solid #d6dfed; border-radius: 10px; background: white; }
  .search-box input { min-height: 44px; font-size: 13px; }
  .search-row>select { font-size: 12px; min-width: 0; }
  .library-tools { display: flex; align-items: stretch; gap: 10px; margin-bottom: 12px; }
  .library-tools .search-box { flex: 1; min-width: 0; }
  .library-tools .search-box input { min-width: 0; width: 100%; font-size: 13px; min-height: 44px; }
  .library-filters { position: relative; z-index: 3; }
  .library-filters summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; padding: 10px 13px; }
  .library-filters summary::-webkit-details-marker { display: none; }
  .library-filters summary b { color: #2154d1; }
  .filter-options { position: absolute; top: calc(100% + 8px); right: 0; width: 285px; padding: 18px; border: 1px solid #dce4f0; border-radius: 12px; box-shadow: 0 10px 35px #182c4f1a; background: #fff; display: grid; gap: 12px; }
  .filter-options>label { display: grid; gap: 6px; font-size: 12px; color: #627087; }
  .filter-options select { width: 100%; min-height: 44px; background: #fff; }
  .filter-options .tag-filter-row { display: grid; gap: 7px; padding: 0; margin: 0; }
  .filter-options .tag-filter-row label { font-size: 12px; }
  .filter-options .tag-filter-row>span { display: none; }
  .filter-options .tag-filter-row select { width: 100%; max-width: none; }
  .scope-bar select, .filter-options select {
    appearance: none; -webkit-appearance: none; height: 44px; min-height: 44px; padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23526179' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: right 12px center; background-repeat: no-repeat;
  }
  .list-meta { font-size: 12px; padding: 4px 0 12px; }
  .library-refresh { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; min-height: 36px; }
  .library-refresh .icon { width: 14px; height: 14px; }
  .question-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
  .question-card { background: white; border: 1px solid #dce3ed; border-radius: 13px; padding: 20px; box-shadow: none; min-width: 0; transition: border-color .16s; }
  .question-card:hover { transform: none; border-color: #a9bbdd; box-shadow: 0 3px 14px #18385a07; }
  .card-top { margin-bottom: 14px; }
  .subject-label { font-size: 11px; border-radius: 6px; padding: 4px 7px; }
  .subject-label.math { color: #2154d1; background: #edf2ff; }
  .subject-label.physics { color: #087968; background: #eaf7f3; }
  .subject-label.geography { color: #27684d; background: #edf7ef; }
  .subject-label.chemistry { color: #865126; background: #fff4e9; }
  .question-open h3 { font-size: 17px; line-height: 1.55; font-weight: 650; margin-bottom: 12px; }
  .question-excerpt { font-size: 13px; line-height: 1.95; color: #536179; min-height: 50px; }
  .question-tags { margin: 12px 0 8px; }
  .student-line { padding-top: 9px; margin: 8px 0 0; font-size: 11px; }
  .mini-avatar { color: #35578c; background: #edf2fb; }
  .card-footer { margin-top: 8px; min-height: 36px; font-size: 11px; }
  .question-actions { margin-top: 2px; padding-top: 6px; }
  .question-actions button { min-height: 36px; font-size: 11px; }
  .badge { font-size: 10px; }
  .review-card { background: #e8effb; color: #243b64; border: 1px solid #d9e4f5; border-radius: 14px; padding: 24px 21px; box-shadow: none; }
  .review-card h2 { color: #1e3b69; font-size: 19px; }
  .review-card .eyebrow, .review-card p, .review-hint { color: #546e96; }
  .review-number { color: #2154d1; font-size: 48px; }
  .review-number span { color: #48678f; font-size: 11px; }
  .review-start { background: #2154d1; color: white; min-height: 44px; border-radius: 9px; }
  .side-section { padding: 22px 20px; border: 1px solid #dce4f0; border-radius: 12px; }
  .side-section h3 { font-size: 14px; }
  .progress-overview strong { font-size: 29px; }
  .progress-track { background: #e0e7f3; height: 5px; }
  .library-pages { display: flex; align-items: center; gap: 8px; margin-top: 24px; font-size: 12px; color: var(--muted); }
  .library-pages>span { margin-right: auto; }
  .library-pages .button { font-size: 12px; padding: 8px 14px; }
  .white-panel, .teach-surface, .student-panel { border: 1px solid #dfe6f0; border-radius: 14px; box-shadow: none; }
  .empty-state, .student-empty { padding: 50px 22px; }
  .empty-state h3, .student-empty h3 { font-size: 22px; }
  .page-footer { font-size: 11px; color: #6c7a90; border-color: #dfe6ef; margin-top: 40px; }
  .footer-tools button { min-height: 44px; }
  .ai-provider-card { border-radius: 14px; padding: 22px; box-shadow: none; }
  .ai-provider-mark { background: #edf2fb; color: #295080; }
  .ai-provider-card h3 { font-size: 18px; }
  .ai-api-config { background: #f8faff; border-color: #dfe6f0; }
  .detail-question, .student-rich { line-height: 1.95; font-size: 16px; color: #24324a; }
  dialog { border-radius: 18px; border: 1px solid #dbe3ef; box-shadow: 0 24px 100px #12284930; }
  dialog::backdrop { background: #14294459; backdrop-filter: blur(5px); }
  .modal-heading h2 { font-size: 25px; }
  .modal-heading p { max-width: 68ch; color: #65758d; }
  .modal-actions { background: #fff; border-color: #dfe6f0; }
  .form-grid textarea, .math-field-preview { line-height: 1.9; }
  .form-grid label, .student-form-grid label { color: #526179; }
  .form-error:not(:empty), .student-error { border-radius: 9px; }
  #toast, #student-toast { border-radius: 12px; background: #182c4f; color: #fff; font-size: 13px; box-shadow: 0 6px 22px #10233c20; }

  /* Students use the same visual language, with a simpler reading surface. */
  .student-shell { max-width: 1080px; padding: 0 32px 45px; }
  .student-header { height: 82px; margin-bottom: 32px; border-color: #dbe4f1; }
  .student-brand { color: #182c4f; font-size: 28px; font-weight: 750; letter-spacing: -.04em; }
  .student-brand svg { color: #2154d1; width: 29px; height: 29px; }
  .student-intro h1 { font-size: 32px; line-height: 1.3; font-weight: 700; }
  .student-intro p { color: #627087; font-size: 13px; margin-top: 10px; }
  .student-tabs, .personal-tabs { border-radius: 11px; background: #e8eef8; padding: 4px; gap: 4px; }
  .student-tabs button, .personal-tabs button { min-height: 42px; border-radius: 8px; font-size: 13px; }
  .student-tabs button[aria-selected=true], .personal-tabs button[aria-selected=true] { color: #2154d1; box-shadow: 0 1px 4px #1739660d; }
  .student-panel { padding: 28px; }
  .student-panel-head h2 { font-size: 21px; }
  .student-task h3 { font-size: 18px; font-weight: 650; }
  .student-task p { color: #627087; }
  .student-login { max-width: 440px; margin: 65px auto; }
  .student-login h1 { font-size: 35px; color: #182c4f; }
  .student-login-form { padding: 30px; border-radius: 16px; border-color: #d9e3f1; box-shadow: 0 12px 40px #17366307; }
  .student-login-form input { font-variant-numeric: tabular-nums; font-size: 26px; letter-spacing: .15em; }
  .student-note, .student-pending { background: #edf3fd; border-color: #d9e5f8; color: #486080; }
  .student-back, .student-link-button { min-height: 44px; display: inline-flex; align-items: center; }
  .student-footer { border-top: 1px solid #dfe6ef; padding-top: 24px; font-size: 11px; }
  .student-submit-bar { border-color: #dfe6ef; }
  .student-account { font-size: 12px; }
  .student-rich .katex-display, .detail-question .katex-display { max-width: 100%; overflow: auto hidden; }
}

@media screen and (min-width: 1700px) {
  .question-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media screen and (max-width: 1200px) {
  .workspace main { padding: 28px 24px 20px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { justify-content: flex-start; max-width: none; }
  .content-columns { grid-template-columns: minmax(0,1fr); }
  .right-column { display: none; }
  .ai-provider-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media screen and (max-width: 900px) {
  .sidebar { position: relative; width: 100%; padding: 18px 20px 0; display: block; overflow: visible; }
  .sidebar .brand { margin: 0 0 18px; padding: 0; font-size: 26px; width: fit-content; }
  .brand-icon { width: 36px; height: 36px; border-radius: 9px; }
  .brand-caption { display: inline; margin-left: 12px; font-size: 10px; }
  .sidebar .workspace-label, .sidebar-divider, .sidebar>.nav-item, .sidebar-bottom { display: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 4px; width: 100%; padding: 0; overflow: visible; }
  .sidebar nav .nav-item { min-width: 0; padding: 10px 2px 13px; flex-direction: column; gap: 5px; font-size: 12px; min-height: 66px; border-radius: 9px 9px 0 0; white-space: normal; }
  .sidebar nav .nav-item.active { background: #f3f6fb; color: #2154d1; box-shadow: none; }
  .sidebar nav .nav-count, .sidebar nav .nav-label { display: none; }
  .sidebar nav .nav-label-short { display: block; }
  .teacher-mobile-logout { display: flex; align-items: center; justify-content: center; position: absolute; right: 20px; top: 15px; margin: 0; min-height: 40px; border-radius: 8px; background: #ffffff10; color: #dce6f9; border: 1px solid #ffffff29; font-size: 11px; padding: 8px 11px; }
  .workspace { margin-left: 0; width: 100%; }
  .topbar { height: auto; min-height: 64px; padding: 12px 20px; gap: 10px; flex-wrap: wrap; }
  .topbar-right { margin-left: auto; }
  .today-date { display: none; }
  .workspace main { padding: 26px 20px 16px; }
  .page-title { font-size: 30px; }
  .page-heading { gap: 12px; margin-bottom: 16px; }
  .scope-bar { padding-bottom: 18px; flex-wrap: wrap; }
  .scope-info { display: none; }
  .scope-bar select { flex: 1; width: auto; min-width: 0; }
  .scope-bar>span:first-child { display: none; }
}
@media screen and (max-width: 600px) {
  body { font-size: 14px; }
  .sidebar { padding: 16px 16px 0; }
  .brand-caption { display: none; }
  .teacher-mobile-logout { right: 16px; top: 13px; }
  .topbar { padding: 11px 16px; }
  .breadcrumb { font-size: 11px; }
  .stage-switch button { font-size: 11px; padding: 6px 9px; min-height: 32px; }
  .workspace main { padding: 24px 16px 16px; }
  .heading-copy p { font-size: 12px; margin-top: 9px; }
  .page-title { font-size: 29px; }
  .heading-actions { display: flex; gap: 8px; width: 100%; justify-content: flex-end; }
  .heading-actions [data-action=drafts-open] { grid-column: 1/-1; justify-self: end; min-height: 28px; padding: 0; }
  .heading-actions .button, .heading-actions .primary { min-width: 0; min-height: 44px; padding: 9px 7px; font-size: 12px; }
  .teacher-today { padding: 14px 16px; gap: 8px; border-radius: 12px; }
  .teacher-today-heading h2 { font-size: 14px; }
  .teacher-today-heading>span { display: none; }
  .teacher-today-actions { flex-basis: 100%; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .teacher-today-actions button { flex-direction: column; padding: 0 10px; gap: 0; text-align: left; }
  .teacher-today-actions button:first-child { border-left: 0; }
  .teacher-today-actions strong { font-size: 26px; margin: 0; }
  .teacher-today-actions button>span { font-size: 11px; }
  .teacher-today-actions small { display: none; }
  .teacher-today .helper { font-size: 10px; line-height: 1.6; }
  .notebook-summary { gap: 12px; font-size: 11px; padding-bottom: 12px; }
  main[data-view=notebook] .heading-copy p { display: none; }
  main[data-view=notebook] .heading-actions { position: absolute; right: 0; top: 0; width: auto; }
  main[data-view=notebook] .page-heading { position: relative; padding-bottom: 0; min-height: 44px; margin-bottom: 14px; }
  main[data-view=notebook] .page-title { font-size: 24px; line-height: 44px; }
  main[data-view=notebook] .heading-more>summary { font-size: 0; padding: 10px; min-width: 44px; }
  main[data-view=notebook] .heading-more>summary .icon { width: 19px; height: 19px; }
  main[data-view=notebook] .heading-actions .primary { padding: 10px; font-size: 11px; }
  main[data-view=notebook] .heading-actions .primary .icon { display: none; }
  .library-tools .search-box input { font-size: 16px; }
  .filter-options { width: min(285px,calc(100vw - 32px)); }
  .teacher-today-heading { display: none; }
  .teacher-today { padding: 12px 14px; margin-bottom: 14px; }
  .teacher-today-actions button { min-height: 50px; }
  .notebook-title { margin-bottom: 12px; }
  .notebook-title h2 { font-size: 18px; }
  .subject-tabs { margin-bottom: 13px; }
  .notebook-summary small { display: none; }
  .notebook-title>span { display: none; }
  .subject-tabs { gap: 0; justify-content: space-between; }
  .subject-tabs button { font-size: 12px; min-height: 44px; gap: 5px; }
  .subject-tabs button .icon { width: 15px; height: 15px; }
  .search-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .search-box { grid-column: 1/-1; width: 100%; }
  .search-row select { width: 100%; min-height: 44px; }
  .search-box input { font-size: 16px; }
  .question-grid { grid-template-columns: minmax(0,1fr); }
  .question-card { padding: 19px; border-radius: 12px; }
  .question-open h3 { font-size: 18px; }
  .question-actions button { min-height: 44px; font-size: 12px; }
  .question-actions { padding-top: 3px; margin-top: 2px; }
  .white-panel { padding: 20px 17px; border-radius: 12px; }
  .panel-heading { gap: 10px; flex-wrap: wrap; }
  .panel-heading h2 { font-size: 20px; }
  main[data-view=students] .row-actions { gap: 10px; align-items: center; }
  main[data-view=students] .row-actions button { min-height: 44px; font-size: 12px; padding: 10px 2px; }
  main[data-view=students] .row-actions .danger-text { margin-left: auto; }
  .panel-heading .helper { font-size: 11px; }
  .library-pages { font-size: 11px; gap: 6px; }
  .library-pages .button { padding: 8px 11px; font-size: 11px; }
  .ai-provider-grid { grid-template-columns: minmax(0,1fr); }
  .ai-provider-card { padding: 22px; }
  .page-footer { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
  .footer-tools { display: flex; justify-content: space-between; width: 100%; gap: 10px; }
  .footer-tools button { min-height: 44px; font-size: 12px; }
  dialog { width: calc(100% - 20px); max-width: calc(100% - 20px); max-height: calc(100dvh - 32px); border-radius: 14px; }
  .modal-heading h2 { font-size: 22px; }
  .form-grid input:not([type=checkbox]), .form-grid select, .form-grid textarea, .student-form-grid input, .student-form-grid select, .student-form-grid textarea { font-size: 16px; }
  .modal-actions { gap: 8px; padding-bottom: max(16px,env(safe-area-inset-bottom)); }
  .detail-question { font-size: 15px; }
  .student-shell { padding: 0 16px 24px; }
  .student-header { height: 70px; margin-bottom: 26px; }
  .student-brand { font-size: 26px; }
  .student-account { font-size: 11px; gap: 12px; }
  .student-intro { gap: 18px; margin-bottom: 23px; }
  .student-intro h1 { font-size: 29px; }
  .student-intro p { font-size: 12px; }
  .student-intro .student-photo-actions { flex-direction: row; display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 8px; }
  .student-panel { padding: 21px 17px; border-radius: 12px; }
  .student-panel-head { gap: 12px; flex-wrap: wrap; }
  .student-panel-head h2 { font-size: 20px; }
  .student-tabs button, .personal-tabs button { font-size: 12px; padding: 8px; min-width: 0; }
  .student-primary, .student-button { white-space: normal; line-height: 1.5; padding: 10px 15px; }
  .student-login { margin: 42px auto; }
  .student-login h1 { font-size: 32px; }
  .student-login-form { padding: 24px; }
  .student-rich { font-size: 15px; }
  .student-image-list { gap: 10px; }
}
@media screen and (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
:root { --geometry-border: #dce3ef; }
.geometry-zoom-button { display:block; margin:6px auto 0; padding:6px 12px; min-height:44px; border:1px solid var(--geometry-border); border-radius:8px; background:#fff; color:#3154a5; font:inherit; cursor:pointer; }
.geometry-zoom-dialog { box-sizing:border-box; width:min(960px,96vw); max-height:90dvh; padding:16px; border:1px solid var(--geometry-border); border-radius:16px; background:#fff; color:#182230; overflow:auto; overscroll-behavior:contain; }
.geometry-zoom-dialog::backdrop { background:rgb(17 28 47 / 60%); }
.geometry-zoom-dialog > button { display:block; position:sticky; top:0; margin:0 0 12px auto; min-height:44px; padding:8px 16px; background:#fff; border:1px solid var(--geometry-border); border-radius:8px; color:#182230; font:inherit; }
.geometry-zoom-dialog > img { display:block; width:100%; height:auto; background:white; }
.geometry-tools { grid-column:1/-1; margin:12px 0; padding:12px 0; border-block:1px solid var(--geometry-border); min-width:0; }
.geometry-tools > summary,.geometry-comparison > summary { min-height:44px; padding:10px 0; cursor:pointer; color:#3154a5; font-weight:600; }
.geometry-tools p,.geometry-comparison p { font-size:14px; color:#65748b; line-height:1.6; }
.geometry-tool-row { display:grid; grid-template-columns:minmax(120px,180px) minmax(0,1fr); gap:16px; padding:12px 0; border-top:1px solid var(--geometry-border); }
.geometry-tool-fields { display:grid; gap:10px; min-width:0; align-content:start; }
.geometry-tool-fields label { display:grid; gap:6px; font-size:14px; }
.geometry-tool-fields select,.geometry-tool-fields textarea { box-sizing:border-box; width:100%; max-width:100%; min-height:44px; padding:10px; font-size:16px; border:1px solid var(--geometry-border); border-radius:8px; background:#fff; color:#182230; }
.geometry-tool-actions { display:flex; flex-wrap:wrap; gap:8px; }
.geometry-tool-actions button { min-height:44px; padding:8px 14px; border:1px solid var(--geometry-border); border-radius:8px; background:#fff; color:#3154a5; font:inherit; }
.geometry-tool-actions button:disabled { opacity:.45; }
.geometry-tool-actions [data-geometry-action="remove"] { margin-left:auto; color:#b34343; }
.geometry-comparison { margin-block:12px; min-width:0; }
.geometry-comparison-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:start; }
.geometry-comparison-grid figure { margin:0; min-width:0; }
.geometry-comparison-grid img { max-width:100%; height:auto; }
.geometry-comparison-grid figcaption { margin-bottom:8px; color:#65748b; }
.geometry-tools :focus-visible,.geometry-zoom-button:focus-visible,.geometry-zoom-dialog :focus-visible { outline:3px solid #315fff; outline-offset:3px; }
@media(max-width:520px) { .geometry-tool-row { grid-template-columns:1fr; }.geometry-tool-row > figure { max-width:180px!important; }.geometry-comparison-grid { grid-template-columns:1fr; } }

.hint-editor {padding:16px;border:1px solid var(--line,#d8e1ed);border-radius:12px;background:#f8faff;min-width:0}.hint-editor summary{cursor:pointer;font-weight:600;min-height:32px}.hint-editor label{display:grid;gap:8px;margin-top:12px}.hint-editor textarea{width:100%;min-width:0;font:inherit;font-size:16px;padding:12px;border:1px solid #ccd7e5;border-radius:8px;resize:vertical}.learning-hints li{margin-block:8px}.learning-support{padding:16px;border:1px solid #d8e1ed;border-radius:12px;background:#f8faff}.learning-support button{min-height:44px;margin:6px 8px 6px 0}.learning-support .hint-step{margin-top:12px;border-top:1px solid #d8e1ed;padding-top:12px}.learning-aided{font-size:14px;color:#685323}

/* Teacher reading surfaces: scoped away from student and voice dialogs. */
@media screen {
  .workspace {
    --ink: #1d2b42; --blue: #3157d5; --blue-hover: #2446b6; --bg: #f4f7fb;
    color: var(--ink); background: var(--bg);
  }
  .workspace .question-card { border-color: #dfe5ef; padding: 20px; border-radius: 14px; }
  .workspace .question-card:hover { border-color: #b6c5e6; box-shadow: none; }
  .workspace .question-card:has(.select-question input:checked) { border-color: #3157d5; box-shadow: 0 0 0 2px #3157d51a; }
  .workspace .question-open h3 { color: #1d2b42; margin-bottom: 9px; }
  .workspace .question-excerpt { font-size: 14px; line-height: 1.8; color: #58667d; }
  .workspace .select-question { min-width: 44px; min-height: 44px; margin: -9px -9px -9px auto; justify-content: center; align-items: center; cursor: pointer; }
  .workspace .select-question input { width: 18px; height: 18px; accent-color: #3157d5; }
  .workspace .student-line { font-size: 12px; padding-top: 10px; }
  .workspace .student-line b { font-size: 12px; font-weight: 600; color: #1d2b42; }
  .workspace .question-actions { flex-wrap: wrap; gap: 4px 12px; }
  .workspace .question-actions button { min-height: 44px; padding: 8px 2px; font-size: 12px; }
  .workspace .question-actions .variant-link, .workspace .question-actions .tag-link { color: #3157d5; }
  .workspace .question-card .subject-label.math { color: #3157d5; background: #eef2ff; }

  #modal.detail-dialog { color: #1d2b42; }
  #modal.detail-dialog > .modal-heading { margin-bottom: 18px; gap: 12px; }
  #modal.detail-dialog > .modal-heading h2 { color: #1d2b42; line-height: 1.45; }
  #modal.detail-dialog > .modal-heading p { margin-top: 6px; color: #64738a; }
  #modal.detail-dialog > .modal-heading .icon-button { width: 44px; height: 44px; justify-content: center; align-items: center; }
  #modal.detail-dialog .teacher-detail-toolbar { justify-content: flex-start; align-items: flex-start; gap: 8px; margin-bottom: 20px; }
  #modal.detail-dialog .teacher-detail-toolbar > button,
  #modal.detail-dialog .teacher-detail-more > summary { min-height: 44px; padding: 10px 14px; font-size: 13px; line-height: 1.5; white-space: nowrap; }
  #modal.detail-dialog .teacher-detail-toolbar > .primary { background: #3157d5; box-shadow: none; }
  #modal.detail-dialog .teacher-detail-toolbar > .primary:hover { background: #2446b6; }
  #modal.detail-dialog .teacher-detail-more { position: relative; margin-left: auto; }
  #modal.detail-dialog .teacher-detail-more > summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; }
  #modal.detail-dialog .teacher-detail-more > summary::-webkit-details-marker { display: none; }
  #modal.detail-dialog .teacher-detail-more > summary .icon { width: 16px; height: 16px; }
  #modal.detail-dialog .teacher-detail-more[open] > summary { border-color: #b6c5e6; background: #f4f7fb; }
  #modal.detail-dialog .teacher-detail-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 5; width: 198px; max-width: calc(100vw - 48px); padding: 6px; border: 1px solid #dfe5ef; border-radius: 12px; background: #fff; box-shadow: 0 12px 32px #1d2b4220; }
  #modal.detail-dialog .teacher-detail-menu button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 7px; text-align: left; color: #34435b; font-size: 13px; }
  #modal.detail-dialog .teacher-detail-menu button:hover { background: #f4f7fb; }
  #modal.detail-dialog .teacher-detail-menu button.danger-text { color: #a13c43; border-top: 1px solid #edf0f5; border-radius: 0 0 7px 7px; margin-top: 4px; }
  #modal.detail-dialog > .detail-meta { gap: 10px; margin-bottom: 12px; }
  #modal.detail-dialog > .detail-question { padding: 20px; border-color: #e2e7ef; border-radius: 12px; background: #fff; color: #1d2b42; font-size: 16px; line-height: 1.85; }
  #modal.detail-dialog > .answer-details { border-radius: 12px; border-color: #dfe5ef; }
  #modal.detail-dialog > .answer-details > summary { min-height: 48px; background: #f4f7fb; color: #3157d5; }
  #modal.detail-dialog > .answer-details > div { font-size: 16px; line-height: 1.85; }
}
@media screen and (max-width: 600px) {
  .workspace .question-card { padding: 18px; }
  #modal.detail-dialog { padding: 20px 16px 16px; }
  #modal.detail-dialog > .modal-heading h2 { font-size: 21px; }
  #modal.detail-dialog .teacher-detail-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 7px; }
  #modal.detail-dialog .teacher-detail-toolbar > button,
  #modal.detail-dialog .teacher-detail-more > summary { padding: 10px; }
  #modal.detail-dialog .teacher-detail-more { margin-left: 0; }
  #modal.detail-dialog > .detail-question { padding: 16px; }
  #modal.detail-dialog > .answer-details > div { padding: 16px; }
}
