.latex-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.page-latex .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.latex-workspace > .panel { min-width: 0; padding: 22px; }
.latex-workspace .latex-editor { min-width: 0; }
.latex-workspace .latex-split { display: block; }
.latex-workspace .latex-source-pane { border: 0; }
.latex-workspace .latex-preview { display: none; }
.latex-workspace .CodeMirror { height: 580px; max-height: none; }
.latex-source-panel > textarea { width: 100%; min-height: 580px; font-family: monospace; }
.editor-main-actions { margin: 0 0 18px; }
.editor-tools { border-top: 1px solid var(--line, #d6dfd8); margin-top: 22px; padding-top: 18px; }
.editor-tools summary { cursor: pointer; min-height: 44px; font-weight: 600; }
.editor-tools .field { margin-block: 18px; }
.editor-tools input[type=file] { max-width: 100%; }
.pdf-preview { width: 100%; height: 660px; border: 1px solid var(--line, #d6dfd8); background: #f3f4f1; }
.pdf-publish { border-top: 1px solid var(--line, #d6dfd8); margin-top: 20px; padding-top: 8px; }
.pdf-publish p { font-size: 13px; line-height: 1.6; color: var(--muted); }
.compiler-error { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; font-size: 12px; }
.account-avatar { border-radius: 50%; object-fit: cover; margin-bottom: 8px; }
.profile-link { display: block; min-height: 32px; padding-block: 6px; font-size: 12px; }
.teacher-notes { margin-block: 20px; }
.teacher-notes summary { min-height: 44px; cursor: pointer; padding-block: 12px; }
.teacher-note { border-top: 1px solid var(--line, #d6dfd8); padding-block: 14px; }
@media (max-width: 1100px) { .latex-workspace { gap: 12px; } .latex-workspace > .panel { padding: 16px; } }
@media (max-width: 767px) { .latex-workspace { grid-template-columns: minmax(0, 1fr); } .latex-workspace .CodeMirror, .latex-source-panel > textarea { height: 380px; min-height: 380px; } .pdf-preview { height: 500px; } .editor-main-actions > * { flex: 1 1 auto; min-height: 44px; } .profile-link { min-height: 44px; } }

/* A readable workbench inside the illuminated book, not a second dashboard. */
.workshop-tabs { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 24px; border-bottom: 1px solid var(--line); }
.workshop-tabs a { display: inline-flex; align-items: center; gap: 9px; min-height: 48px; padding: 10px 6px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; }
.workshop-tabs a[aria-current] { color: var(--primary); border-color: var(--berry); font-weight: 600; }
.workshop-tabs a > span { display: inline-grid; place-items: center; width: 25px; height: 25px; font-size: 12px; border: 1px solid var(--line); border-radius: 50%; }
.workshop-tabs a[aria-current] > span { background: var(--primary); color: white; border-color: var(--primary); }
.workshop-commandbar { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 14px 0; }
.workshop-commandbar kbd { font: 400 11px "Golos", sans-serif; opacity: .85; padding-left: 6px; white-space: nowrap; }
.workshop-note { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 12px 0 24px; }
.latex-source-panel .editor-tools { margin: 0 0 16px; padding: 0; border-top: 0; border-bottom: 1px solid var(--line); }
.editor-tools summary { display: list-item; font-size: 13px; padding: 10px 0; }
.editor-tools[open] { padding-bottom: 18px; }
.editor-tool-row { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.editor-tool-row .field { margin: 0; }
.editor-capabilities { color: var(--muted); font-size: 12px; margin: 16px 0 0; }
.page-latex .latex-workspace .CodeMirror { height: clamp(380px, 62vh, 720px) !important; }
.page-latex .page-header { margin-bottom: 16px; }
.page-latex .running-head { min-height: 56px; margin-bottom: 12px; }
.page-latex .page-header { padding-bottom: 10px; margin-bottom: 10px; }
.page-latex .page-header .back-link { margin-bottom: 6px; font-size: 12px; }
.page-latex .page-header .eyebrow { display: none; }
.page-latex .page-header h1 { font-size: 25px; margin-bottom: 6px; }
.page-latex .page-header p { margin-bottom: 0; }
.page-latex .workshop-tabs { margin-bottom: 8px; }
.page-latex .workshop-note { margin: 4px 0 16px; }
.page-latex .workshop-commandbar { padding: 8px 0; position: sticky; top: 0; z-index: 8; background: var(--surface); border-bottom: 1px solid var(--line); }
.page-latex .latex-workspace > .panel { padding: 16px; }
.page-latex .latex-workspace h2 { font-size: 19px; margin-bottom: 0; }
.page-latex .latex-workspace .section-heading { margin-bottom: 12px; }
.page-latex.editor-focused .running-head, .page-latex.editor-focused .page-header,
.page-latex.editor-focused .workshop-tabs, .page-latex.editor-focused .workshop-note,
.page-latex.editor-focused .page-colophon { display: none; }
.page-latex.editor-focused .app-main { padding-top: 10px; }
.page-latex.editor-focused .latex-workspace { margin-top: 12px; }
.page-latex.editor-focused .latex-workspace .CodeMirror { height: max(340px, calc(100vh - 360px)) !important; }
.compose-sources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.compose-sources > a { display: flex; flex-direction: column; align-items: start; padding: 20px; min-height: 160px; border: 1px solid var(--line); border-top: 3px solid var(--gold); text-decoration: none; background: var(--field); color: var(--text); border-radius: 3px; }
.compose-sources > a:hover { border-color: var(--primary); box-shadow: 0 4px 12px #29203c12; }
.compose-sources strong { font-family: Literata, serif; font-size: 17px; margin: 2px 0 12px; }
.compose-sources .eyebrow { font-size: 11px; }
.compose-sources a > span:last-child { color: var(--muted); font-size: 13px; }
.composition-panel { padding: 24px; }
.composition-list { list-style: none; padding: 0; margin: 0; }
.composition-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 20px; padding: 22px 0; border-top: 1px solid var(--line); }
.composition-number label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.composition-number input { width: 64px; min-height: 44px; padding: 8px; text-align: center; }
.composition-content { min-width: 0; }
.composition-content .latex-content { max-height: 280px; overflow: auto; }
.composition-actions { display: grid; grid-template-columns: 44px 44px; align-content: start; gap: 8px; }
.composition-actions .button { padding: 8px; min-width: 44px; min-height: 44px; }
.composition-actions a, .composition-actions .link-button { grid-column: 1 / -1; text-align: center; font-size: 12px; min-height: 44px; }
.composition-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 11px; color: var(--muted); }
.danger-link { color: var(--danger); }
.composition-savebar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.tex-import-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.tex-import-list { display: grid; gap: 16px; }
.tex-import-item { min-width: 0; }
.tex-import-item .latex-content { max-height: 350px; overflow: auto; }
.tex-select, .tex-option { display: flex; align-items: start; gap: 12px; min-height: 44px; cursor: pointer; }
.tex-select input, .tex-option input { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 4px; accent-color: var(--primary); }
.tex-option { padding: 12px 0; }
.tex-option small { display: block; color: var(--muted); margin-top: 6px; font-size: 12px; }
.tex-confirm-actions { margin: 24px 0; }
.tex-confirm-actions > button { margin: 12px 0; }
.tex-input-panel { margin-top: 28px; min-width: 0; }
.tex-input-panel .field { margin: 20px 0; }
.tex-input-panel input[type=file] { max-width: 100%; }
.tex-input-panel .latex-editor-document .CodeMirror { height: 400px !important; }
.tex-import-warnings ul { padding-left: 22px; margin: 10px 0 0; }
@media (max-width: 1279px) { .compose-sources { gap: 10px; } .compose-sources > a { padding: 16px; } .composition-item { gap: 12px; } }
@media (max-width: 767px) {
  .workshop-tabs { gap: 0 10px; font-size: 12px; }
  .workshop-tabs a:last-child { flex-basis: 100%; }
  .workshop-commandbar, .workshop-commandbar .button-row { align-items: stretch; }
  .workshop-commandbar > *, .workshop-commandbar .button-row > * { flex: 1 1 auto; }
  .workshop-commandbar kbd { display: none; }
  .compose-sources { grid-template-columns: 1fr; gap: 10px; }
  .compose-sources > a { min-height: 0; padding: 16px; }
  .compose-sources .eyebrow { margin-bottom: 2px; }
  .compose-sources strong { margin-bottom: 6px; }
  .composition-panel { padding: 16px; }
  .composition-item { grid-template-columns: 54px minmax(0, 1fr); gap: 14px; }
  .composition-number input { width: 54px; }
  .composition-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; }
  .composition-actions a, .composition-actions .link-button { flex: 1; }
  .composition-savebar > * { width: 100%; }
  .page-latex .latex-workspace .CodeMirror { height: 390px !important; }
  .tex-import-item .section-heading { align-items: start; gap: 8px; flex-wrap: wrap; }
}
