/* Legacy Ortho pages that now run inside the Ortho shell (sidebar + top bar).
   Loaded after ortho-readable.css. Each page adds body class "ro-legacy" plus "ro-legacy-<name>".
   These pages were written with a terminal look (Courier New labels); inside the shell they use the same type as the rest of Ortho. */
body.ro-shell-body.ro-legacy .ro-shell-content,
body.ro-shell-body.ro-legacy .ro-shell-content *:not(code):not(pre):not(kbd):not(samp):not(.mono) {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
/* "Back to Rahvan" returned to the Step app; the shell's top bar and platform switch already cover that. */
body.ro-shell-body.ro-legacy-drill #db-back[href="/"] { display: none; } /* only the default "Back to Rahvan"; the Conference and packet views retarget this link to their own parent */
/* ortho-readable.css offsets the Case Workspace page header with "body.ro-shell-body.ro-command header { top: 64px }"; the shell top bar is also a header. */
body.ro-shell-body.ro-legacy-command > header.ro-topbar { top: 0; }
/* The page's own header is not sticky inside the shell (the shell top bar already is); it sits in the flow under it. */
body.ro-shell-body.ro-legacy-command .ro-shell-content > header,
body.ro-shell-body.ro-legacy-tonight .ro-shell-content > header { position: static; top: auto; }

/* Fracture Conference: its own top strip and session list are fixed to the window edge, which is under the shell sidebar and top bar.
   They sit below the shell top bar (85px tall on desktop, 101px at tablet width, 81px on a phone) and to the right of the sidebar. */
body.ro-shell-body.ro-legacy-journal .topbar { top: 85px; left: 112px; }
body.ro-shell-body.ro-legacy-journal .sidebar { top: 137px; left: 112px; }
@media (max-width: 980px) {
  body.ro-shell-body.ro-legacy-journal .topbar { top: 101px; left: 82px; }
  body.ro-shell-body.ro-legacy-journal .sidebar { top: 153px; left: 82px; }
}
@media (max-width: 700px) {
  body.ro-shell-body.ro-legacy-journal .topbar { top: 81px; left: 0; }
  body.ro-shell-body.ro-legacy-journal .sidebar { top: 133px; left: 0; bottom: 62px; }
}
body.ro-shell-body.ro-legacy-journal .topbar { background: #09233f; }
body.ro-shell-body.ro-legacy-journal .top-btn,
body.ro-shell-body.ro-legacy-journal .top-icon { color: #fff !important; }

/* The shell reserves 64px under the top bar, but the bar is 85px tall on desktop (101px at tablet width, 81px on a phone against a 58px reserve),
   so the first lines of these pages sat under it. */
body.ro-shell-body.ro-legacy .ro-shell-content { padding-top: 21px; }
@media (max-width: 980px) { body.ro-shell-body.ro-legacy .ro-shell-content { padding-top: 37px; } }
@media (max-width: 700px) { body.ro-shell-body.ro-legacy .ro-shell-content { padding-top: 23px; } }
/* Classification Atlas: the formula panel keeps its dark box, so its small heading needs a light colour (ortho-readable.css darkens h3). */
body.ro-shell-body.ro-legacy-atlas .formula-panel h3 { color: #9fd4f5 !important; }

/* ortho-readable.css gives buttons and links dark text, which was unreadable on these pages' dark strips and filled buttons. */
body.ro-shell-body.ro-legacy-journal .conf-section-tab[aria-current="page"] { color: #fff !important; }
body.ro-shell-body.ro-legacy-tonight .lecture-nav { background: #fff; border-bottom: 1px solid var(--ro-border, #c5d8ea); }
body.ro-shell-body.ro-legacy-tonight .lecture-tab { color: #3f5879 !important; }
body.ro-shell-body.ro-legacy-tonight .lecture-tab.active { color: #056a9f !important; border-bottom-color: #056a9f; }
body.ro-shell-body.ro-legacy-drill .gchat-send:not(:disabled) { color: #1a0f00 !important; background: #f2b84b; }

/* Classification Lab: readable.css hides this header in shell pages, leaving the page without a visible heading. Keep it (back link, title, subtitle). */
body.ortho-topic-reader.ro-shell-body.ro-legacy-cls .ro-shell-content > header.cls-header { display: block !important; }
/* Filled "Submit All" buttons (Drill Bank fill-in and the Classification Lab drill): white text on the Ortho blue. */
body.ro-shell-body.ro-legacy .fi-btn-submit,
body.ro-shell-body.ro-legacy .cls-drill-submit-btn { background: #0773b0 !important; color: #fff !important; border-color: #05618f !important; }
/* Drill Bank's own floating chips sit above the shell's "+" button so nothing overlaps; the chat sheet hides the "+" so Send is not covered. */
body.ro-shell-body.ro-legacy-drill:has(#gchat-panel.open) .ro-drawer-trigger { display: none; }
@media (max-width: 700px) {
  body.ro-shell-body.ro-legacy-drill .casebook-fab { bottom: calc(140px + env(safe-area-inset-bottom)) !important; right: 14px !important; }
  body.ro-shell-body.ro-legacy-drill .gchat-fab { bottom: calc(190px + env(safe-area-inset-bottom)) !important; right: 14px !important; }
}

/* Classification Atlas: the image lightbox must open above the shell sidebar (z 10030) and top bar (z 10020), or its close button is unreachable. */
body.ro-shell-body.ro-legacy-atlas #lightbox { z-index: 10100; }

/* Drill Bank and Conference Prep overlays (bottom sheets, dialogs, image viewers) were stacked for a page without the shell; lift them above the shell sidebar (10030) and top bar (10020). */
body.ro-shell-body.ro-legacy-drill .cb-backdrop,
body.ro-shell-body.ro-legacy-drill .gchat-backdrop,
body.ro-shell-body.ro-legacy-drill .cc-modal-bg { z-index: 10090; }
body.ro-shell-body.ro-legacy-drill .cb-panel,
body.ro-shell-body.ro-legacy-drill .gchat-panel { z-index: 10095; }
body.ro-shell-body.ro-legacy-drill #lightbox { z-index: 10100; }
body.ro-shell-body.ro-legacy-tonight .img-lightbox { z-index: 10100; }

/* Drill Bank (Fill-In and the other tabs): colour fixes. The pastel section colours (built for a dark page) are fine as the small dot, but the count badges used them as text on white (contrast 1.7 to 2.8); badges now use a dark neutral. The active tab and page links use the shell's darker blue so they pass 4.5:1. */
body.ro-shell-body.ro-legacy .fi-card-badge { color: #334155 !important; background: #e9eef5 !important; }
body.ro-shell-body.ro-legacy .tab-btn.on { color: #05689c; border-bottom-color: #087fc2; }
body.ro-shell-body.ro-legacy .fi-page-link { color: #0b5f91; }
body.ro-shell-body.ro-legacy .filter-chip.on,
body.ro-shell-body.ro-legacy .tag,
body.ro-shell-body.ro-legacy .ob-link-btn { color: #05618f; }
body.ro-shell-body.ro-legacy .cb-badge { background: #38bdf8 !important; color: #050e1c !important; }
/* Filled blue buttons in Conference and the Classification Lab: the shell's generic button rule forces dark text, which is unreadable on the blue fill. */
body.ro-shell-body.ro-legacy .case-open,
body.ro-shell-body.ro-legacy .prompt-reveal { color: #fff !important; }
body.ro-shell-body.ro-legacy .cls-missed-badge { color: #1f3550; }
body .compiled-image-reveal,
body .compiled-image-read > summary { color: #05618f; }
/* Classification Lab drill count badges: inline pastel-on-tint colours fell under 4.5:1 on the light shell */
body.ro-shell-body.ro-legacy .cls-drill-badge { color: #05507a !important; background: #e3f1f9 !important; }
