/* Hypatia Teach application theme. Opted in by the Pug layout for teacher/student Learn views only. */
body[data-hypatia-design="modern"] {
  --ht-blue: #146397; --ht-mid: #1b89d1; --ht-light: #4daae8;
  --ht-ink: #293743; --ht-muted: #64707d; --ht-line: #e3e7eb;
  --ht-paper: #fff; --ht-soft: #f7f8fa; --ht-selected: #eaf4fb;
  /* Verdicts: right and wrong, the only things not in the blue family. */
  --ht-correct: #1e7a46; --ht-incorrect: #b42318; --ht-partial: #9a6700; --ht-not-started: #98a2ad;
  --ht-sidebar: 248px; --ht-topbar: 70px;
  /* Type scale. Reading text is 14px or more; 12px is the floor, for labels, badges and counts.
     In px: the app's Bootstrap sets the root to 14px, so 1rem here is 14px, not 16px. */
  --ht-text-xs: 12px; --ht-text-sm: 14px; --ht-text-base: 16px; --ht-text-lg: 18px; --ht-text-xl: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.55; color: var(--ht-ink); background: var(--ht-paper);
  margin: 0; padding: var(--ht-topbar) 0 0 var(--ht-sidebar); min-height: 100vh;
}
body[data-hypatia-design="modern"][data-theme="dark"] {
  --ht-ink: #e4eaf0; --ht-muted: #aebbc5; --ht-line: #3c4852;
  --ht-paper: #20262b; --ht-soft: #191f24; --ht-selected: #233e50; --ht-blue: #8cccf4; --ht-correct: #6fcf97; --ht-incorrect: #f28b82; --ht-partial: #e5b54a; --ht-not-started: #6f7b86;
}
body[data-hypatia-design="modern"] :where(h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6) { color: var(--ht-ink); font-family: inherit; line-height: 1.25; }
body[data-hypatia-design="modern"] :where(h1,.h1) { font-size: 2rem; font-weight: 650; letter-spacing: -.045em; }
body[data-hypatia-design="modern"] :where(h2,.h2) { font-size: 1.55rem; font-weight: 650; letter-spacing: -.025em; }
body[data-hypatia-design="modern"] :where(h3,.h3,h4,.h4) { font-size: 1.4rem; font-weight: 600; letter-spacing: -.02em; }
body[data-hypatia-design="modern"] :where(h5,.h5) { font-size: 1.12rem; font-weight: 600; }
body[data-hypatia-design="modern"] a { color: var(--ht-blue); }
body[data-hypatia-design="modern"] :where(button,input,select,textarea) { font-family: inherit; }
body[data-hypatia-design="modern"] :where(a,button,input,select,textarea):focus-visible { outline: 3px solid var(--ht-light); outline-offset: 3px; }
body[data-hypatia-design="modern"] #contentHeader { display: none; }
body[data-hypatia-design="modern"] #contentAll { width: 100%; min-width: 0; margin: 0; flex: 1 0 auto; padding: 30px 38px 44px; }
body[data-hypatia-design="modern"] #contentAll > :where(.container,.container-lg,.container-fluid,main.container,section) { max-width: 1280px; margin-left: auto; margin-right: auto; }
body[data-hypatia-design="modern"] #contentAll > :where(.container,.container-lg,.container-fluid,main.container) { padding-left: 0; padding-right: 0; }
body[data-hypatia-design="modern"] #contentAll .secondary-navbar { position: static; width: auto; background: transparent !important; color: var(--ht-ink); border: 0; padding: 0 0 26px; margin: 0; min-height: 0; }
/* Bootstrap keeps it sticky (!important) at the classic navbar's 56px: here it stops
   under the top bar instead, opaque, so its buttons stay whole and the page scrolls
   beneath them. (The question editor's tab bar has its own, under its navbar.) */
body[data-hypatia-design="modern"]:not([data-hypatia-editor="true"]) #contentAll .secondary-navbar { top: var(--ht-topbar) !important; z-index: 1020; background: var(--ht-paper) !important; }
body[data-hypatia-design="modern"] .secondary-navbar > .container-fluid { max-width: 1280px; padding: 0 !important; }
body[data-hypatia-design="modern"] .secondary-navbar .row { gap: 14px; padding: 0 !important; margin: 0 !important; }
body[data-hypatia-design="modern"] .secondary-navbar .row > span:last-child { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
body[data-hypatia-design="modern"] .secondary-navbar .breadcrumb { background: none; padding: 0; font-size: var(--ht-text-sm); }
body[data-hypatia-design="modern"] .secondary-navbar :where(.mr-2,.mr-3,.ml-2,.ml-3) { margin-left: 0 !important; margin-right: 0 !important; }
body[data-hypatia-design="modern"] .hypatia-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--ht-sidebar); padding: 15px 14px 14px; display: flex; flex-direction: column; background: var(--ht-soft); border-right: 1px solid var(--ht-line); z-index: 1035; overflow-y: auto; }
body[data-hypatia-design="modern"] .hypatia-brand-row { display: flex; align-items: center; justify-content: center; padding: 0 8px 26px; }
body[data-hypatia-design="modern"] .hypatia-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ht-ink); font-size: 22px; letter-spacing: -.025em; text-decoration: none; white-space: nowrap; }
body[data-hypatia-design="modern"] .hypatia-brand strong { font-weight: 650; }
body[data-hypatia-design="modern"] .hypatia-brand img { width: 40px; height: 40px; }
body[data-hypatia-design="modern"] .hypatia-nav-link { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 10px 12px; margin: 3px 0; border-radius: 9px; text-decoration: none; color: var(--ht-muted); font-size: var(--ht-text-sm); line-height: 1.35; }
body[data-hypatia-design="modern"] .hypatia-nav-link > .fas { width: 20px; text-align: center; font-size: .95rem; }
body[data-hypatia-design="modern"] .hypatia-nav-link:hover { background: var(--ht-line); color: var(--ht-ink); }
body[data-hypatia-design="modern"] .hypatia-nav-link.is-active { background: var(--ht-selected); color: var(--ht-blue); font-weight: 600; }
body[data-hypatia-design="modern"] .hypatia-class-nav { padding-top: 25px; }
body[data-hypatia-design="modern"] .hypatia-nested-class-nav { margin: 2px 0 10px 21px; padding-left: 10px; border-left: 1px solid var(--ht-line); }
body[data-hypatia-design="modern"] .hypatia-nested-class-nav .hypatia-nav-link { gap: 9px; padding: 8px 10px; font-size: var(--ht-text-sm); }
body[data-hypatia-design="modern"] .hypatia-nested-class-nav .hypatia-course-initial { flex-basis: 23px; height: 23px; font-size: var(--ht-text-xs); }
/* Archived classes, after the list: an archive box where a class has its initial. */
body[data-hypatia-design="modern"] .hypatia-nav-archive .hypatia-course-initial { color: var(--ht-muted); font-size: 11px; }
body[data-hypatia-design="modern"] .hypatia-nav-archive.is-active .hypatia-course-initial { color: var(--ht-blue); }
body[data-hypatia-design="modern"] .hypatia-nav-label { margin: 0 12px 10px; font-size: var(--ht-text-xs); color: var(--ht-muted); }
body[data-hypatia-design="modern"] .hypatia-course-initial { flex: 0 0 25px; height: 25px; display: grid; place-items: center; background: var(--ht-paper); border: 1px solid var(--ht-line); border-radius: 7px; font-size: var(--ht-text-xs); color: var(--ht-blue); }
body[data-hypatia-design="modern"] .hypatia-sidebar-bottom { margin-top: auto; padding-top: 25px; }
body[data-hypatia-design="modern"] .hypatia-account { display: flex; align-items: center; gap: 5px; margin-top: 12px; padding: 15px 3px 0; border-top: 1px solid var(--ht-line); }
body[data-hypatia-design="modern"] .hypatia-account-person { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ht-ink); }
body[data-hypatia-design="modern"] .hypatia-account-person > span:last-child { min-width: 0; }
body[data-hypatia-design="modern"] .hypatia-account-person strong { font-size: var(--ht-text-sm); display: block; font-weight: 600; overflow-wrap: anywhere; }
body[data-hypatia-design="modern"] .hypatia-account-person small { display: block; font-size: var(--ht-text-xs); color: var(--ht-muted); }
body[data-hypatia-design="modern"] .hypatia-avatar { flex: 0 0 33px; height: 33px; border-radius: 50%; background: var(--ht-selected); color: var(--ht-blue); display: grid; place-items: center; font-weight: 600; }
body[data-hypatia-design="modern"] .hypatia-icon-button { display: inline-grid; place-items: center; width: 35px; height: 35px; border: 0; border-radius: 8px; background: transparent; color: var(--ht-muted); text-decoration: none; cursor: pointer; flex-shrink: 0; }
body[data-hypatia-design="modern"] .hypatia-icon-button:hover { background: var(--ht-line); color: var(--ht-ink); }
body[data-hypatia-design="modern"] .hypatia-topbar { position: fixed; inset: 0 0 auto var(--ht-sidebar); height: var(--ht-topbar); display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 38px; border-bottom: 1px solid var(--ht-line); background: var(--ht-paper); color: var(--ht-muted); font-size: var(--ht-text-sm); z-index: 1025; }
body[data-hypatia-design="modern"] .hypatia-topbar-start { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* The page's title: its name, with what it belongs to (a class link) under it. */
body[data-hypatia-design="modern"] .hypatia-topbar-heading { display: flex; align-items: center; gap: 6px; min-width: 0; }
body[data-hypatia-design="modern"] .hypatia-topbar-heading-text { min-width: 0; }
body[data-hypatia-design="modern"] .hypatia-topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
body[data-hypatia-design="modern"] .hypatia-topbar-title > :is(h1, strong) { margin: 0; min-width: 0; font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; color: var(--ht-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-hypatia-design="modern"] .hypatia-topbar-title > :not(h1, strong) { flex-shrink: 0; }
body[data-hypatia-design="modern"] .hypatia-topbar-heading p { margin: 3px 0 0; font-size: var(--ht-text-sm); color: var(--ht-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-hypatia-design="modern"] .hypatia-topbar-heading p a { color: inherit; text-decoration: none; }
body[data-hypatia-design="modern"] .hypatia-topbar-heading p a:hover { color: var(--ht-blue); text-decoration: underline; }
/* The way up, on a phone only: there the sidebar and the subtitle are hidden. */
body[data-hypatia-design="modern"] .hypatia-topbar-back { display: none; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 8px; color: var(--ht-muted); text-decoration: none; }
body[data-hypatia-design="modern"] .hypatia-topbar-back:hover { background: var(--ht-line); color: var(--ht-ink); }
@media(max-width:600px) {
  body[data-hypatia-design="modern"] .hypatia-topbar-title > :is(h1, strong) { font-size: 18px; }
  body[data-hypatia-design="modern"] .hypatia-topbar-heading p { display: none; }
  body[data-hypatia-design="modern"] .hypatia-topbar-back { display: inline-grid; }
  /* The name before what sits beside it (a state, an edit button). */
  body[data-hypatia-design="modern"] .hypatia-topbar-title > :not(h1, strong) { display: none !important; }
}
body[data-hypatia-design="modern"] .hypatia-topbar-end { display: flex; align-items: center; gap: 14px; }
/* The design switch, with the feedback link as quiet text under it. */
body[data-hypatia-design="modern"] .hypatia-design-choice { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
body[data-hypatia-design="modern"] .hypatia-design-feedback-link { padding: 0; border: 0; background: none; color: var(--ht-muted); font-size: 12px; line-height: 1.3; white-space: nowrap; cursor: pointer; }
body[data-hypatia-design="modern"] .hypatia-design-feedback-link:hover { color: var(--ht-blue); text-decoration: underline; }
body[data-hypatia-design="modern"] .hypatia-design-feedback-link:focus-visible { outline: 2px solid var(--ht-light); outline-offset: 2px; border-radius: 3px; }
@media(max-width:600px) {
  body[data-hypatia-design="modern"] .hypatia-design-feedback-link { display: none; }
}
/* Its dialog: asked on switching back (data-mode=switch) or for a comment; then thanks. */
body[data-hypatia-design="modern"] #hypatia-design-feedback[data-mode="switch"] .hypatia-feedback-comment-only,
body[data-hypatia-design="modern"] #hypatia-design-feedback[data-mode="comment"] .hypatia-feedback-switch-only,
body[data-hypatia-design="modern"] #hypatia-design-feedback:not(.is-sent) .hypatia-feedback-thanks,
body[data-hypatia-design="modern"] #hypatia-design-feedback.is-sent .hypatia-feedback-form { display: none !important; }
body[data-hypatia-design="modern"] #hypatia-design-feedback fieldset { border: 0; padding: 0; }
body[data-hypatia-design="modern"] #hypatia-design-feedback .modal-body > .hypatia-feedback-form > p { font-size: var(--ht-text-sm); }
body[data-hypatia-design="modern"] .hypatia-mobile-open,body[data-hypatia-design="modern"] .hypatia-mobile-close,body[data-hypatia-design="modern"] .hypatia-sidebar-shade { display: none; }
body[data-hypatia-design="modern"] .hypatia-skip { position: fixed; left: 16px; top: -100px; z-index: 2000; background: var(--ht-paper); color: var(--ht-blue); padding: 12px 20px; border: 2px solid var(--ht-blue); border-radius: 8px; }
body[data-hypatia-design="modern"] .hypatia-skip:focus { top: 12px; }
/* Native Bootstrap controls retain their event hooks and validation. */
body[data-hypatia-design="modern"] .btn { border-radius: 8px; padding: .55rem .9rem; min-height: 39px; font-size: var(--ht-text-sm); font-weight: 550; line-height: 1.3; text-transform: none !important; box-shadow: none; }
body[data-hypatia-design="modern"] .btn-sm { min-height: 33px; padding: .4rem .7rem; font-size: var(--ht-text-sm); }
body[data-hypatia-design="modern"] .btn-primary,body[data-hypatia-design="modern"] .btn-info,body[data-hypatia-design="modern"] .btn-purple,body[data-hypatia-design="modern"] .btn-success { background: var(--ht-blue); color: var(--ht-paper); border-color: var(--ht-blue); }
body[data-hypatia-design="modern"] :where(.btn-outline-primary,.btn-outline-purple,.btn-outline-info,.btn-outline-success,.btn-secondary) { color: var(--ht-ink); background: var(--ht-paper); border-color: var(--ht-line); }
body[data-hypatia-design="modern"] :where(.btn-outline-primary,.btn-outline-purple,.btn-outline-info,.btn-outline-success,.btn-secondary):hover { background: var(--ht-selected); color: var(--ht-blue); border-color: var(--ht-light); }
body[data-hypatia-design="modern"] :where(.btn-danger,.btn-outline-danger) { background: var(--ht-paper); color: var(--ht-ink); border-color: var(--ht-line); }
body[data-hypatia-design="modern"] .btn.disabled,body[data-hypatia-design="modern"] .btn:disabled { opacity: .5; }
body[data-hypatia-design="modern"] .form-control,body[data-hypatia-design="modern"] .custom-select { background: var(--ht-paper); color: var(--ht-ink); border: 1px solid var(--ht-line); border-radius: 8px; font-size: var(--ht-text-sm); min-height: 41px; }
/* The shorthand above clears Bootstrap's arrow on .custom-select: give it back, in the theme's muted colour. */
body[data-hypatia-design="modern"] .custom-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2364707d' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px 16px; padding-right: 38px; }
body[data-hypatia-design="modern"][data-theme="dark"] .custom-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23aebbc5' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); }
body[data-hypatia-design="modern"] .form-control:focus { border-color: var(--ht-light); box-shadow: 0 0 0 3px #4daae820; }
body[data-hypatia-design="modern"] label { font-size: var(--ht-text-sm); font-weight: 500; }
body[data-hypatia-design="modern"] input[type=checkbox],body[data-hypatia-design="modern"] input[type=radio] { accent-color: var(--ht-blue); }
body[data-hypatia-design="modern"] :where(.card,.modal-content) { background: var(--ht-paper); color: var(--ht-ink); border: 1px solid var(--ht-line); border-radius: 13px !important; box-shadow: none; overflow: visible; }
body[data-hypatia-design="modern"] .card-body { padding: 23px; }
body[data-hypatia-design="modern"] :where(.card-header,.card-footer) { background: transparent; border-color: var(--ht-line); padding: 17px 22px; }
body[data-hypatia-design="modern"] .card-header:first-child { border-radius: 13px 13px 0 0; }
body[data-hypatia-design="modern"] .card-title { line-height: 1.35; }
body[data-hypatia-design="modern"] :where(.bg-elevated-card-lightest,.bg-secondary-navbar,.bg-closed,.bg-grading) { background: var(--ht-soft) !important; }
body[data-hypatia-design="modern"] :where(.text-purple,.text-success,.text-danger,.text-primary,.text-primary-dark,.primary-display-color) { color: var(--ht-blue) !important; }
body[data-hypatia-design="modern"] .text-muted { color: var(--ht-muted) !important; }
body[data-hypatia-design="modern"] :where(.badge,.state-column) { border-radius: 6px; font-size: var(--ht-text-xs); font-weight: 500; }
body[data-hypatia-design="modern"] .badge { padding: .35em .6em; }
body[data-hypatia-design="modern"] :where(.badge-primary,.badge-info,.badge-warning,.badge-danger,.badge-success,.badge-purple) { background: var(--ht-selected); color: var(--ht-blue); }
body[data-hypatia-design="modern"] .alert { border: 1px solid var(--ht-line); border-radius: 10px; background: var(--ht-soft); color: var(--ht-ink); font-size: var(--ht-text-sm); }
body[data-hypatia-design="modern"] :where(.dropdown-menu,.popover) { border: 1px solid var(--ht-line); border-radius: 10px; background: var(--ht-paper); color: var(--ht-ink); box-shadow: 0 8px 26px #172f4215; padding: 6px; }
body[data-hypatia-design="modern"] .dropdown-item { border-radius: 6px; padding: 8px 12px; color: var(--ht-ink); font-size: var(--ht-text-sm); text-transform: none !important; }
body[data-hypatia-design="modern"] .dropdown-item:hover { background: var(--ht-selected); color: var(--ht-blue); }
body[data-hypatia-design="modern"] .modal-header { background: transparent !important; padding: 22px 24px; border-bottom: 1px solid var(--ht-line); }
body[data-hypatia-design="modern"] .modal-header .text-white { color: var(--ht-ink) !important; }
body[data-hypatia-design="modern"] .modal-body { padding: 24px; }
body[data-hypatia-design="modern"] .modal-footer { padding: 17px 24px; border-color: var(--ht-line); }
body[data-hypatia-design="modern"] .modal-dialog { min-width: 0; }
body[data-hypatia-design="modern"] :where(.nav-tabs,.nav-pills) { gap: 5px; border-color: var(--ht-line); }
body[data-hypatia-design="modern"] .nav-tabs .nav-link { padding: 12px 16px; border: 0; border-bottom: 2px solid transparent; color: var(--ht-muted); background: transparent; font-size: var(--ht-text-sm); }
body[data-hypatia-design="modern"] .nav-tabs .nav-link.active { color: var(--ht-blue); border-bottom-color: var(--ht-mid); font-weight: 600; }
body[data-hypatia-design="modern"] .table { color: var(--ht-ink); font-size: var(--ht-text-sm); }
body[data-hypatia-design="modern"] .table :where(td,th) { border-color: var(--ht-line); vertical-align: middle; padding: 13px 16px; }
body[data-hypatia-design="modern"] .table thead th { background: var(--ht-soft); color: var(--ht-muted); font-weight: 550; font-size: var(--ht-text-xs); border-bottom-width: 1px; }
body[data-hypatia-design="modern"] .table-striped tbody tr:nth-of-type(odd) { background: transparent; }
body[data-hypatia-design="modern"] .table-hover tbody tr:hover { background: var(--ht-selected); }
body[data-hypatia-design="modern"] .bootstrap-table { border: 1px solid var(--ht-line); border-radius: 12px; padding: 10px 12px 0; background: var(--ht-paper); }
body[data-hypatia-design="modern"] .bootstrap-table .fixed-table-container { border-color: var(--ht-line); }
body[data-hypatia-design="modern"] .fixed-table-toolbar { margin-bottom: 12px; }
body[data-hypatia-design="modern"] .fixed-table-body { font-variant-numeric: tabular-nums; }
body[data-hypatia-design="modern"] .page-item.active .page-link { background: var(--ht-blue); border-color: var(--ht-blue); color: var(--ht-paper); }
/* Class cards and assignment lists use the actual database-backed template data. */
body[data-hypatia-design="modern"][data-hypatia-page="teacher-home"] #contentAll > .card-body { padding: 0; }
body[data-hypatia-design="modern"][data-hypatia-page="teacher-home"] #contentAll > .card-body > .container-lg { padding: 0; max-width: 1280px; }
body[data-hypatia-design="modern"] .hypatia-class-card { transition: border-color .15s ease, box-shadow .15s ease; }
/* Match the inside of the 13px card border without clipping help popovers. */
body[data-hypatia-design="modern"] .hypatia-class-card > .card-body:only-child { border-radius: 12px; }
body[data-hypatia-design="modern"] .hypatia-class-card:hover { border-color: #a9cfe8; box-shadow: 0 5px 18px #1b456508; }
body[data-hypatia-design="modern"] .hypatia-card-mark { display: grid; place-items: center; width: 43px; height: 43px; background: var(--ht-selected); color: var(--ht-blue); border-radius: 10px; font-size: 1.1rem; font-weight: 650; margin-bottom: 18px; }
body[data-hypatia-design="modern"] .hypatia-class-card .card-title { font-size: 1.25rem; color: var(--ht-ink); }
body[data-hypatia-design="modern"] .hypatia-class-card .text-substructure { display: block; padding: 7px 0; color: var(--ht-muted); font-size: var(--ht-text-sm); }
body[data-hypatia-design="modern"] .hypatia-class-card .card-subtitle { color: var(--ht-muted); font-size: var(--ht-text-sm); font-weight: 400; }
body[data-hypatia-design="modern"] .hypatia-card-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--ht-line); }
body[data-hypatia-design="modern"] .hypatia-card-actions > a { font-size: var(--ht-text-sm); font-weight: 550; }
body[data-hypatia-design="modern"] .hypatia-card-actions > a:last-child { margin-left: auto; }
body[data-hypatia-design="modern"] .hypatia-page-intro { margin: 8px 0 0; font-size: var(--ht-text-sm); color: var(--ht-muted); }
body[data-hypatia-design="modern"] .hypatia-empty { padding: 40px 28px; background: var(--ht-soft); border: 1px solid var(--ht-line); border-radius: 12px; color: var(--ht-muted); }
body[data-hypatia-design="modern"] .hypatia-assignment-panel { border: 1px solid var(--ht-line); border-radius: 12px; background: var(--ht-paper); padding: 18px 22px; }
body[data-hypatia-design="modern"] .hypatia-activity-panel { border: 1px solid var(--ht-line); border-radius: 12px; background: var(--ht-paper); padding: 10px 22px 22px; margin-bottom: 25px; }
body[data-hypatia-design="modern"] :where(.list-group-item,.list-group-item-action) { background: var(--ht-paper); color: var(--ht-ink); border-color: var(--ht-line); padding: 17px 12px; }
body[data-hypatia-design="modern"] .list-group-flush > .struct-element { gap: 12px; min-height: 70px; align-items: center; }
body[data-hypatia-design="modern"] .topic-name { font-size: var(--ht-text-sm); font-weight: 550; color: var(--ht-ink); }
body[data-hypatia-design="modern"] :where(.topic-actions,.edit-column,.link-column,.summary-column) { font-size: var(--ht-text-sm); text-transform: none !important; }
body[data-hypatia-design="modern"] .state-column { color: var(--ht-blue); background: var(--ht-selected); padding: 4px 8px; align-self: center; white-space: nowrap; }
body[data-hypatia-design="modern"] .percentage-column { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ht-ink); }
body[data-hypatia-design="modern"] .score-indicator { color: var(--ht-blue) !important; background: var(--ht-selected) !important; border-color: var(--ht-light) !important; }
body[data-hypatia-design="modern"][data-hypatia-page="class"] #contentAll main.container > .card-body { padding: 0; }
body[data-hypatia-design="modern"][data-hypatia-page="class"] #contentAll main.container > .card-body > .container { padding: 0; }
/* Catalog, account and report surfaces. */
body[data-hypatia-design="modern"] .textbook-card > .card { background: var(--ht-paper) !important; border-color: var(--ht-line); }
body[data-hypatia-design="modern"] .textbook-title { color: var(--ht-ink); font-size: 1.12rem; }
body[data-hypatia-design="modern"] .textbook-image { border-radius: 7px; object-fit: contain; }
body[data-hypatia-design="modern"][data-hypatia-page="profile"] #contentAll > .container { max-width: 880px; }
body[data-hypatia-design="modern"][data-hypatia-page="profile"] form#update { background: var(--ht-paper); border: 1px solid var(--ht-line); border-radius: 13px; padding: 26px; }
body[data-hypatia-design="modern"][data-hypatia-page="report"] :where(#summary,#briefing,#result) { color: var(--ht-ink); }
body[data-hypatia-design="modern"][data-hypatia-page="report"] #reviewAccordion .review { margin-bottom: 12px; }
body[data-hypatia-design="modern"] #hypatia-footer { background: var(--ht-paper) !important; border-top: 1px solid var(--ht-line); font-size: var(--ht-text-xs) !important; }
body[data-hypatia-design="modern"] #hypatia-footer .text-white { color: var(--ht-muted) !important; }
/* Inside Google Classroom: no sidebar or top bar (Classroom frames the page). */
body[data-hypatia-design="modern"][data-hypatia-gc="true"]:not([data-hypatia-editor="true"]) { --ht-sidebar: 0px; --ht-topbar: 0px; }
/* Full-width native editors keep their established math/toolbox positioning. */
body[data-hypatia-design="modern"][data-hypatia-editor="true"] { --ht-sidebar: 0px; padding-top: 64px; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] :where(.hypatia-sidebar,.hypatia-topbar,.hypatia-sidebar-shade) { display: none; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #contentHeader { display: block; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #main-nav { background: var(--ht-paper) !important; border-bottom: 1px solid var(--ht-line) !important; box-shadow: none; min-height: 64px; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #main-nav .navbar-brand { color: var(--ht-ink); }
/* The classic navbar's links (the question editor keeps them): in the new design's type, as the sidebar's. */
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #main-nav .navbar-nav { align-items: center; gap: 2px; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #main-nav .navbar-nav .nav-link { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px !important; border-radius: 8px; color: var(--ht-muted); font-size: var(--ht-text-sm); font-weight: 500; line-height: 1.3; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #main-nav .navbar-nav .nav-link:hover { background: var(--ht-line); color: var(--ht-ink); }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #main-nav .navbar-nav .nav-link > .fas { margin: 0 !important; font-size: .9em; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #main-nav .navbar-nav .dropdown-menu { border: 1px solid var(--ht-line); border-radius: 10px; box-shadow: 0 8px 24px #172f4214; font-size: var(--ht-text-sm); }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #nav-logo-hypatia { font-size: 1.08rem; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #nav-logo-teach { color: var(--ht-blue); }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #contentAll { padding: 0; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #contentAll > section { max-width: none; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] :where(#question-holder,.question-container) { border-color: var(--ht-line) !important; background: var(--ht-paper); }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] :where(#action-bar,#feedback-panel,#student-score) { border-color: var(--ht-line); }
/* Help and Report a problem: always there, never louder than the question. */
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #action-bar { background: transparent; }
/* The score and time box beside the question (marks shown, or exam/practice mode):
   compact, with room before Help and Report a problem below it. */
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #progress-tracker { margin-bottom: 20px; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #progress-tracker .info-card { width: auto !important; min-width: 118px; border: 1px solid var(--ht-line); border-radius: 10px; background: var(--ht-paper); overflow: hidden; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #progress-tracker .info-card .card-header { padding: 8px 14px 0 !important; background: transparent !important; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #progress-tracker .info-card .card-body { padding: 0 14px 8px !important; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #progress-tracker .status-title { color: var(--ht-muted); font-size: 11px; font-weight: 600 !important; letter-spacing: .04em; line-height: 1.3; white-space: nowrap; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #progress-tracker .status-text { margin: 2px 0 0 !important; padding: 0 !important; color: var(--ht-ink); font-size: 1.1rem; line-height: 1.35; font-variant-numeric: tabular-nums; }
body[data-hypatia-design="modern"] #action-bar :is(#help-button, #issue-button) { color: var(--ht-muted) !important; font-size: 15px; cursor: pointer; }
body[data-hypatia-design="modern"] #action-bar :is(#help-button, #issue-button) p { font-weight: 500 !important; }
body[data-hypatia-design="modern"] #action-bar :is(#help-button, #issue-button):hover { color: var(--ht-blue) !important; }
body[data-hypatia-design="modern"] #action-bar :is(#help-button, #issue-button):hover p { text-decoration: underline; }
body[data-hypatia-design="modern"][data-hypatia-focus="true"] #action-bar :is(#help-button, #issue-button) { font-size: 14px; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #contentAll .secondary-navbar { padding: 16px 24px; }
@media(max-width:1100px) {
  body[data-hypatia-design="modern"] { --ht-sidebar: 224px; }
  body[data-hypatia-design="modern"] #contentAll { padding-left: 25px; padding-right: 25px; }
  body[data-hypatia-design="modern"] .hypatia-topbar { padding: 0 25px; }
}
@media(max-width:900px) {
  body[data-hypatia-design="modern"] { padding-left: 0; }
  body[data-hypatia-design="modern"] .hypatia-brand-row { justify-content: space-between; }
  body[data-hypatia-design="modern"] .hypatia-sidebar { width: 264px; transform: translateX(-100%); visibility: hidden; transition: transform .18s ease, visibility .18s ease; }
  body[data-hypatia-design="modern"].hypatia-nav-open { overflow: hidden; }
  body[data-hypatia-design="modern"].hypatia-nav-open .hypatia-sidebar { transform: translateX(0); visibility: visible; }
  body[data-hypatia-design="modern"] .hypatia-topbar { left: 0; padding: 0 17px; }
  body[data-hypatia-design="modern"] .hypatia-mobile-open,body[data-hypatia-design="modern"] .hypatia-mobile-close { display: inline-grid; }
  body[data-hypatia-design="modern"] .hypatia-sidebar-shade:not([hidden]) { display: block; position: fixed; inset: 0; background: #172c4166; border: 0; z-index: 1030; }
  body[data-hypatia-design="modern"] #contentAll { padding: 24px 20px 36px; }
  body[data-hypatia-design="modern"] .secondary-navbar .row { align-items: flex-start !important; }
  body[data-hypatia-design="modern"] .list-group-flush > .struct-element { flex-wrap: wrap; }
  body[data-hypatia-design="modern"] .topic-name { min-width: 150px; flex: 1; }
}
@media(max-width:540px) {
  body[data-hypatia-design="modern"] #contentAll { padding-left: 16px; padding-right: 16px; }
  body[data-hypatia-design="modern"] .card-body { padding: 18px; }
  body[data-hypatia-design="modern"] :where(h1,.h1) { font-size: 1.75rem; }
  body[data-hypatia-design="modern"] .modal-dialog { margin: 12px; }
  body[data-hypatia-design="modern"] .modal-body { padding: 18px; }
  body[data-hypatia-design="modern"] .hypatia-activity-panel { padding: 8px 14px 18px; }
  body[data-hypatia-design="modern"] .secondary-navbar .row > span:last-child { gap: 6px; }
}
@media(prefers-reduced-motion:reduce) {
  body[data-hypatia-design="modern"] .hypatia-sidebar { transition: none; }
}
@media print {
  body[data-hypatia-design="modern"] { padding: 0 !important; margin: 0 !important; display: block; background: #fff; color: #000; }
  body[data-hypatia-design="modern"] :where(.hypatia-sidebar,.hypatia-topbar,.hypatia-sidebar-shade,.hypatia-skip,#contentHeader) { display: none !important; }
  body[data-hypatia-design="modern"] #contentAll { padding: 0 !important; width: 100%; }
  body[data-hypatia-design="modern"] .card { box-shadow: none; break-inside: avoid; }
}

/* Native action groups and panels. */
body[data-hypatia-design="modern"] .btn { border-width: 1px; }
body[data-hypatia-design="modern"] .btn[class*="btn-outline-"] { border-color: var(--ht-line); color: var(--ht-ink); background: var(--ht-paper); }
body[data-hypatia-design="modern"] .btn[class*="btn-outline-"]:hover { border-color: var(--ht-light); color: var(--ht-blue); background: var(--ht-selected); }
body[data-hypatia-design="modern"] .hypatia-section-title { margin: 0 0 18px; font-size: 1.1rem; letter-spacing: -.015em; }
body[data-hypatia-design="modern"] .hypatia-activity-panel > .hypatia-section-title { padding-top: 14px; }
body[data-hypatia-design="modern"] .secondary-navbar .btn { white-space: nowrap; }
body[data-hypatia-design="modern"] .secondary-navbar span.dropdown { display: inline-block; }
body[data-hypatia-design="modern"] .secondary-navbar .btn + .btn { margin-left: 6px; }
body[data-hypatia-design="modern"] .plus-button { color: var(--ht-blue); }

body[data-hypatia-design="modern"] { --question-card-bg: var(--ht-soft); --question-text-bg: var(--ht-paper); --question-math-bg: var(--ht-paper); --question-card-border: var(--ht-line); --plus-button-bg: var(--ht-blue); }
body[data-hypatia-design="modern"] label.question-card { border-radius: 12px !important; overflow: hidden; margin-bottom: 24px !important; }
body[data-hypatia-design="modern"] .question-header { padding: 5px 12px; border-bottom: 1px solid var(--ht-line); }
body[data-hypatia-design="modern"] .question-header .btn-link { font-size: var(--ht-text-sm); text-decoration: none; }
body[data-hypatia-design="modern"] .question-text { padding: 22px 10px !important; }
body[data-hypatia-design="modern"] .question-text h5 { font-size: var(--ht-text-sm); color: var(--ht-muted); font-weight: 550; }
body[data-hypatia-design="modern"] .question-text h6 { font-size: 1rem; color: var(--ht-ink); }
body[data-hypatia-design="modern"] .hypatia-assignment-title { margin-bottom: 22px; }
body[data-hypatia-design="modern"][data-hypatia-page="assignment"] .secondary-navbar > .container-fluid > .d-flex { flex-wrap: wrap; gap: 16px; justify-content: space-between !important; align-items: center; }
body[data-hypatia-design="modern"][data-hypatia-page="assignment"] .secondary-navbar .normal-mode-menu { display: inline-flex; flex-wrap: wrap; gap: 7px; }
body[data-hypatia-design="modern"][data-hypatia-page="assignment"] .secondary-navbar .breadcrumb { display: flex !important; margin: 0 !important; max-width: 100%; white-space: normal !important; }
body[data-hypatia-design="modern"][data-hypatia-page="assignment"] .secondary-navbar .font-weight-bold > label { margin-left: 6px !important; }
body[data-hypatia-design="modern"][data-hypatia-page="assignment"] .secondary-navbar .font-weight-bold > label.ml-3 { margin-left: 20px !important; }
body[data-hypatia-design="modern"][data-hypatia-page="assignment"] #addMenuButton { bottom: 28px; right: 30px !important; box-shadow: 0 4px 16px #172f421a; border-radius: 9px; }
body[data-hypatia-design="modern"] .btn-success:disabled,body[data-hypatia-design="modern"] .btn-primary:disabled,body[data-hypatia-design="modern"] .btn-success.disabled,body[data-hypatia-design="modern"] .btn-primary.disabled { background: var(--ht-blue); border-color: var(--ht-blue); color: var(--ht-paper); }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #graphing-calculator-button,body[data-hypatia-design="modern"][data-hypatia-editor="true"] #calculator-button { padding: 0; display: grid; place-items: center; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"] #main-nav .breadcrumb { background: transparent !important; font-size: var(--ht-text-sm); }

body[data-hypatia-design="modern"] { --textbook-bg-0: var(--ht-paper); --textbook-bg-1: var(--ht-paper); --textbook-bg-2: var(--ht-paper); --textbook-request-bg: var(--ht-blue); --textbook-preview-bg: var(--ht-selected); }
body[data-hypatia-design="modern"][data-hypatia-page="catalog"] #contentAll > .card-body { padding: 0; }
body[data-hypatia-design="modern"][data-hypatia-page="catalog"] #contentAll > .card-body > .container-lg { padding: 0; }
body[data-hypatia-design="modern"][data-hypatia-page="catalog"] .row.mt-5 { margin-top: 12px !important; }
body[data-hypatia-design="modern"][data-hypatia-page="catalog"] .row.mt-5 > .col-lg-4 { flex-basis: 50%; max-width: 50%; }
body[data-hypatia-design="modern"][data-hypatia-page="catalog"] .card.mx-4 { margin-left: 0 !important; margin-right: 0 !important; text-align: left !important; overflow: hidden; }
body[data-hypatia-design="modern"][data-hypatia-page="catalog"] .card-body.my-3 { margin: 0 !important; }
body[data-hypatia-design="modern"][data-hypatia-page="catalog"] .textbook-title { margin-top: 0 !important; }
body[data-hypatia-design="modern"][data-hypatia-page="catalog"] #otherTextbook h6 { font-size: var(--ht-text-sm); line-height: 1.6; color: var(--ht-muted); font-weight: 400; }
body[data-hypatia-design="modern"] .btn-request-class { color: var(--ht-paper); }
body[data-hypatia-design="modern"] .btn-preview { color: var(--ht-blue); }
body[data-hypatia-design="modern"][data-hypatia-page="catalog"] .input-group { gap: 8px; }
body[data-hypatia-design="modern"][data-hypatia-page="catalog"] .form-outline { flex: 1; max-width: 430px; }
body[data-hypatia-design="modern"][data-hypatia-page="catalog"] #search-clear { background: var(--ht-paper); border-color: var(--ht-line); color: var(--ht-muted); }
@media(max-width:600px) { body[data-hypatia-design="modern"][data-hypatia-page="catalog"] .row.mt-5 > .col-lg-4 { flex-basis: 100%; max-width: 100%; } }
body[data-hypatia-design="modern"][data-hypatia-page="class"] #contentAll > .card-body { padding: 0; }
body[data-hypatia-design="modern"][data-hypatia-page="class"] #contentAll > .card-body > .container { padding: 0; }
body[data-hypatia-design="modern"][data-hypatia-page="class"] .hypatia-activity-panel { padding: 18px 22px 22px; }
body[data-hypatia-design="modern"][data-hypatia-page="class"] .topic-actions { min-width: 0; flex-wrap: wrap; gap: 10px; margin-left: 0 !important; }
body[data-hypatia-design="modern"][data-hypatia-page="class"] .topic-actions > * { min-width: 0; width: auto; }
body[data-hypatia-design="modern"][data-hypatia-page="class"] .state-column:has(> i:only-child) { background: transparent; padding: 0; }
@media(max-width:600px) {
  body[data-hypatia-design="modern"][data-hypatia-page="class"] .hypatia-activity-panel { padding: 16px; }
  body[data-hypatia-design="modern"][data-hypatia-page="class"] .card-body .card-body { padding: 8px 12px; }
  body[data-hypatia-design="modern"][data-hypatia-page="class"] .topic-name { flex-basis: 100%; }
  body[data-hypatia-design="modern"][data-hypatia-page="class"] .topic-actions { width: 100%; justify-content: flex-start !important; }
  body[data-hypatia-design="modern"][data-hypatia-page="class"] .hypatia-activity-panel .nav-link { padding: 10px 8px; font-size: var(--ht-text-xs); }
  body[data-hypatia-design="modern"][data-hypatia-page="profile"] main > .d-flex:first-child { flex-wrap: wrap; gap: 15px; }
  body[data-hypatia-design="modern"][data-hypatia-page="profile"] form#update { padding: 18px; }
}
body[data-hypatia-design="modern"][data-hypatia-page="class"] #contentAll > .hypatia-activity-panel { padding: 18px 22px 22px; }
body[data-hypatia-design="modern"] .secondary-navbar .text-uppercase,body[data-hypatia-design="modern"] #reportCardTablist .text-uppercase { text-transform: none !important; }
body[data-hypatia-design="modern"] .text-info { color: var(--ht-blue) !important; }
body[data-hypatia-design="modern"] #reportCardTablist .nav-link { padding: 10px 16px; font-size: var(--ht-text-sm); font-weight: 500; color: var(--ht-muted); }
body[data-hypatia-design="modern"] #reportCardTablist .nav-link.active { color: var(--ht-blue) !important; background: var(--ht-selected) !important; border-radius: 8px; }
@media(max-width:600px) { body[data-hypatia-design="modern"][data-hypatia-page="class"] #contentAll > .hypatia-activity-panel { padding: 16px; } }

/* Supporting tools share a horizontal row above answer navigation. */
body[data-hypatia-design="modern"][data-hypatia-editor="true"] {
  --ht-tools-left: max(24px, calc((100vw - 1400px) / 2 + 34px));
  --ht-tools-bottom: calc(var(--toolboxDynamicHeight, 84px) / 1.4 + 104px);
  --ht-draw-width: 88px;
  --ht-tool-gap: 8px;
}
body[data-hypatia-design="modern"][feedback-panel] { --ht-tools-left: max(24px, calc((100vw - 1752px) / 2 + 34px)); }
body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .calculators {
  left: calc(var(--ht-tools-left) + var(--ht-draw-width) + var(--ht-tool-gap)) !important;
  bottom: var(--ht-tools-bottom) !important;
  width: auto; height: auto;
}
body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .calculators > .d-flex { flex-direction: row !important; gap: var(--ht-tool-gap); }
body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .calculators #calculator-button,
body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .calculators #graphing-calculator-button {
  position: relative; inset: auto !important; margin: 0 !important; padding: 0 12px;
  height: 44px; min-height: 44px; min-width: 0; width: 92px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ht-paper); border: 1px solid var(--ht-line); border-radius: 9px;
  color: var(--ht-muted); font-size: 13px; font-weight: 500; line-height: 1;
  box-shadow: 0 1px 3px #172f4207;
}
body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .calculators #calculator-button { order: 1; width: 122px; }
body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .calculators #graphing-calculator-button { order: 2; }
body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .calculators .fa-stack { display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; line-height: 20px; font-size: 18px; }
body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .calculators .fa-stack svg { display: block; width: 20px; height: 20px; }
body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .calculators button i { left: 0; top: 0; width: 20px; height: 20px; line-height: 20px; }
body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .calculators :is(#calculator-button, #graphing-calculator-button):is(:hover, [aria-expanded="true"]) { background: var(--ht-selected); border-color: var(--ht-light); color: var(--ht-blue); }
body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .btn-success { background: var(--ht-blue) !important; border-color: var(--ht-blue) !important; color: var(--ht-paper) !important; }
body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .btn:disabled,
body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .btn.disabled { background: var(--ht-soft) !important; border-color: var(--ht-line) !important; color: var(--ht-muted) !important; opacity: .65 !important; box-shadow: none; }
@media(max-width:600px) {
  body[data-hypatia-design="modern"][data-hypatia-editor="true"] { --ht-tools-left: 16px; --ht-tools-bottom: calc(var(--toolboxDynamicHeight, 84px) / 1.4 + 160px); --ht-draw-width: 76px; --ht-tool-gap: 6px; }
  body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .calculators #calculator-button { width: 108px; }
  body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .calculators #graphing-calculator-button { width: 80px; }
  body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .calculators button.hypatia-solve-tool { padding: 0 8px; font-size: 12px; gap: 6px; }
}

/* Navigation and checking form a single action rail above the maths keyboard. */
body[data-hypatia-design="modern"] .hypatia-answer-actions {
  position: fixed; z-index: 2;
  left: var(--ht-tools-left); right: var(--ht-tools-left);
  bottom: calc(var(--toolboxDynamicHeight, 84px) / 1.4 + 18px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px;
  align-items: center; padding-top: 12px;
  border-top: 1px solid var(--ht-line); background: var(--ht-paper);
}
body[data-hypatia-design="modern"][feedback-panel] .hypatia-answer-actions { right: calc(352px + var(--ht-tools-left)); }
body[data-hypatia-design="modern"] .hypatia-answer-actions > .d-flex,
body[data-hypatia-design="modern"] .hypatia-answer-actions > .d-flex > .fix-button,
body[data-hypatia-design="modern"] .hypatia-answer-actions > .d-flex > .fix-button > .d-flex { display: contents !important; }
body[data-hypatia-design="modern"] .hypatia-answer-actions .btn {
  position: static; margin: 0 !important; min-width: 0; min-height: 44px;
  width: auto; padding: 0 17px; border: 1px solid var(--ht-line); border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 550; line-height: 1.25; white-space: nowrap;
  background: var(--ht-paper); color: var(--ht-ink); box-shadow: 0 1px 3px #172f4207;
}
body[data-hypatia-design="modern"] .hypatia-answer-actions #prev-button { grid-column: 1; grid-row: 1; justify-self: start; }
body[data-hypatia-design="modern"] .hypatia-answer-actions #check-button { grid-column: 2; grid-row: 1; }
body[data-hypatia-design="modern"] .hypatia-answer-actions #submit-button { grid-column: 3; grid-row: 1; min-width: 112px; }
body[data-hypatia-design="modern"] .hypatia-answer-actions .btn-success { background: var(--ht-blue) !important; border-color: var(--ht-blue) !important; color: var(--ht-paper) !important; }
body[data-hypatia-design="modern"] .hypatia-answer-actions .btn:hover:not(:disabled):not(.disabled) { border-color: var(--ht-light); background: var(--ht-selected); color: var(--ht-blue); }
body[data-hypatia-design="modern"] .hypatia-answer-actions .btn-success:hover:not(:disabled):not(.disabled) { filter: brightness(.94); }
body[data-hypatia-design="modern"] .hypatia-answer-actions .btn:focus-visible { outline: 3px solid var(--ht-light); outline-offset: 3px; box-shadow: none; }
body[data-hypatia-design="modern"] .hypatia-answer-actions .hypatia-action-icon { width: 18px; height: 18px; flex: 0 0 18px; }
body[data-hypatia-design="modern"] .hypatia-answer-actions #check-rest { margin-left: 0 !important; font-size: 15px; }
body[data-hypatia-design="modern"] #annotate-message { width: max-content; max-width: calc(100vw - 32px); bottom: calc(var(--ht-tools-bottom) + 60px); }
@media(max-width:600px) {
  body[data-hypatia-design="modern"] .hypatia-answer-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  body[data-hypatia-design="modern"][feedback-panel] .hypatia-answer-actions { right: 16px; }
  body[data-hypatia-design="modern"] .hypatia-answer-actions .btn { width: 100%; padding: 0 10px; font-size: 13px; }
  body[data-hypatia-design="modern"] .hypatia-answer-actions #check-button { grid-column: 1 / -1; grid-row: 1; }
  body[data-hypatia-design="modern"] .hypatia-answer-actions #submit-button { grid-column: 2; grid-row: 1; }
  body[data-hypatia-design="modern"] .hypatia-answer-actions:has(#check-button:not(.d-none)) :is(#prev-button, #submit-button) { grid-row: 2; }
  body[data-hypatia-design="modern"] .hypatia-answer-actions #submit-button.btn-success { grid-column: 1 / -1; grid-row: 1; }
  body[data-hypatia-design="modern"] #annotate-message { bottom: calc(var(--ht-tools-bottom) + 112px); }
}

/* Keep the compact solving header and transient messages within small screens. */
@media(max-width:600px) {
  body[data-hypatia-design="modern"][data-hypatia-editor="true"]:has([data-hypatia-solve-tools]) #navbar-content { flex-wrap: nowrap; gap: 8px; }
  body[data-hypatia-design="modern"][data-hypatia-editor="true"]:has([data-hypatia-solve-tools]) #main-nav { padding: 8px 16px; }
  body[data-hypatia-design="modern"][data-hypatia-editor="true"]:has([data-hypatia-solve-tools]) #main-nav .navbar-brand { margin-right: 0; }
  body[data-hypatia-design="modern"][data-hypatia-editor="true"]:has([data-hypatia-solve-tools]) #main-nav .navbar-brand img { width: 28px; height: 28px; }
  body[data-hypatia-design="modern"][data-hypatia-editor="true"]:has([data-hypatia-solve-tools]) #nav-logo-hypatia { font-size: 14px; }
  body[data-hypatia-design="modern"][data-hypatia-editor="true"]:has([data-hypatia-solve-tools]) #main-nav .info { padding-top: 0 !important; }
  body[data-hypatia-design="modern"][data-hypatia-editor="true"]:has([data-hypatia-solve-tools]) #main-nav .info > .row { margin: 0; }
  body[data-hypatia-design="modern"][data-hypatia-editor="true"]:has([data-hypatia-solve-tools]) #main-nav .info > .row > .col { display: none; }
  body[data-hypatia-design="modern"][data-hypatia-editor="true"]:has([data-hypatia-solve-tools]) #main-nav .col-auto { padding: 0; }
  body[data-hypatia-design="modern"][data-hypatia-editor="true"]:has([data-hypatia-solve-tools]) #main-nav .counter-container { display: inline-flex; gap: 10px; align-items: center; margin: 0 !important; }
  body[data-hypatia-design="modern"][data-hypatia-editor="true"]:has([data-hypatia-solve-tools]) #main-nav .counter-container .btn-group { margin-right: 0 !important; font-size: var(--ht-text-xs); }
  body[data-hypatia-design="modern"][data-hypatia-editor="true"]:has([data-hypatia-solve-tools]) #close-button { min-width: 0; padding: 0 10px; min-height: 44px; }
}

body[data-hypatia-design="modern"] .editor.error .hypatia-answer-actions { display: none !important; }
body[data-hypatia-design="modern"] #main-alerts { width: 400px; max-width: calc(100vw - 32px) !important; right: 16px; padding-right: 0 !important; }

/* Supporting tool panels retain their native calculators and dismiss actions. */
body[data-hypatia-design="modern"] .hypatia-tool-panel:is(#calculator, #graphing-calculator) { top: 80px; left: var(--ht-tools-left); width: fit-content; max-width: calc(100vw - 32px); }
body[data-hypatia-design="modern"] .hypatia-tool-panel .modal-dialog { margin: 0; max-width: calc(100vw - 32px) !important; }
body[data-hypatia-design="modern"] .hypatia-tool-panel .modal-content { overflow: hidden; box-shadow: 0 12px 36px #172f421f; }
body[data-hypatia-design="modern"] .hypatia-tool-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 6px 4px 16px; border-bottom: 1px solid var(--ht-line); background: var(--ht-paper); font-size: 14px; }
body[data-hypatia-design="modern"] .hypatia-tool-panel-header strong { font-weight: 600; }
body[data-hypatia-design="modern"] .hypatia-tool-panel-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; color: var(--ht-muted); background: transparent; }
body[data-hypatia-design="modern"] .hypatia-tool-panel-close:hover { background: var(--ht-selected); color: var(--ht-blue); }
body[data-hypatia-design="modern"] .hypatia-tool-panel-close svg { width: 20px; height: 20px; }
body[data-hypatia-design="modern"] #calculator.hypatia-tool-panel .modal-dialog { width: 280px; }
body[data-hypatia-design="modern"] #calculator.hypatia-tool-panel .calc-container-light { background: var(--ht-paper); border: 0; padding: 14px 16px !important; }
body[data-hypatia-design="modern"] #calculator.hypatia-tool-panel .calc-form { width: 100%; background: var(--ht-soft); border: 1px solid var(--ht-line); border-radius: 8px; box-shadow: none; padding: 4px; }
body[data-hypatia-design="modern"] #calculator.hypatia-tool-panel .calc-form input { width: 100%; color: var(--ht-ink); height: 32px; font-size: 20px; }
body[data-hypatia-design="modern"] #calculator.hypatia-tool-panel .button-row { gap: 8px; margin-top: 8px; }
body[data-hypatia-design="modern"] #calculator.hypatia-tool-panel .calc-button { width: 100%; min-width: 0; height: 44px; border: 1px solid var(--ht-line); border-radius: 8px; background: var(--ht-soft); color: var(--ht-ink); box-shadow: none; top: 0; }
body[data-hypatia-design="modern"] #calculator.hypatia-tool-panel .calc-button.operator-group { background: var(--ht-selected); color: var(--ht-blue); }
body[data-hypatia-design="modern"] #calculator.hypatia-tool-panel .calc-button#equal { background: var(--ht-blue); color: var(--ht-paper); border-color: var(--ht-blue); }
body[data-hypatia-design="modern"] #calculator.hypatia-tool-panel .calc-button:hover { border-color: var(--ht-light); }
body[data-hypatia-design="modern"] #calculator.hypatia-tool-panel .calc-button:focus-visible { outline: 3px solid var(--ht-light) !important; outline-offset: 2px; }
body[data-hypatia-design="modern"] #graphing-calculator.hypatia-tool-panel .modal-dialog { width: 660px; }
body[data-hypatia-design="modern"] #graphing-calculator.hypatia-tool-panel .modal-body { padding: 12px !important; background: var(--ht-paper) !important; }
body[data-hypatia-design="modern"] #graphing-calculator.hypatia-tool-panel iframe { display: block; width: 100%; height: min(400px, calc(100dvh - 280px)); border: 1px solid var(--ht-line); border-radius: 6px; }
body[data-hypatia-design="modern"] [data-hypatia-solve-tools] .calculators .fa-slash { display: none !important; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"]:has([data-hypatia-solve-tools]) #close-button { display: inline-flex; align-items: center; justify-content: center; }
@media(max-width:600px) {
  body[data-hypatia-design="modern"] .hypatia-tool-panel { left: 16px !important; top: 80px !important; }
}

/* Measured solve viewport reservation. The native answer still grows with its
   content and the document scrolls; fixed controls never consume that content. */
html[data-hypatia-solve-layout="ready"] {
  scroll-padding-top: var(--ht-solve-top, 76px);
  scroll-padding-bottom: calc(var(--ht-solve-bottom-reserve, 230px) + 16px);
}
body[data-hypatia-design="modern"][data-hypatia-solve-layout="ready"] #hypatia-container {
  margin-bottom: 0;
  padding-bottom: calc(var(--ht-solve-bottom-reserve, 230px) + 24px);
}
body[data-hypatia-design="modern"][data-hypatia-solve-layout="ready"] #annotate-message {
  bottom: calc(var(--ht-solve-bottom-reserve, 230px) + 12px);
  max-height: max(44px, calc(100dvh - var(--ht-solve-bottom-reserve, 230px) - var(--ht-solve-top, 76px) - 24px));
  overflow-y: auto;
}
@media print {
  body[data-hypatia-design="modern"][data-hypatia-solve-layout="ready"] #hypatia-container { padding-bottom: 0; }
}

/* Compact solving keeps the prompt and the answer together. The native editor
   owns its symbols and drawing controls; these coordinates align both DOMs. */
body[data-hypatia-design="modern"] :where(.hypatia-compact-toggles, .hypatia-solve-rail, #hypatia-solve-tool-menu, #hypatia-focus-toggle) { display: none; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] {
  --ht-compact-rail-height: 60px;
  --ht-tools-bottom: 8px;
  --ht-draw-width: 88px;
  --ht-tool-gap: 8px;
  --ht-draw-span: 96px;
  --ht-calculator-span: 0px;
  --ht-graph-span: 0px;
  --ht-tool-menu-width: 180px;
  --ht-tool-menu-height: 156px;
  padding-top: 56px;
}
body[data-hypatia-design="modern"][data-hypatia-compact="true"]:has(#calculator-button) { --ht-calculator-span: 130px; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"]:has(#graphing-calculator-button) { --ht-graph-span: 100px; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #main-nav { min-height: 56px; height: 56px; padding: 6px var(--ht-tools-left); }
body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #navbar-content { max-width: none; padding: 0 !important; flex-wrap: nowrap; gap: 16px; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #main-nav .navbar-brand { display: inline-flex; align-items: center; flex: 0 0 auto; margin: 0; padding: 0; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #main-nav .navbar-brand img { width: 28px; height: 28px; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #nav-logo-hypatia { margin-bottom: 0; font-size: 15px; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #main-nav .info { min-width: 0; flex: 1 1 auto; padding-top: 0 !important; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #main-nav .info > .row { margin: 0; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #main-nav .info > .row > .col { min-width: 0; padding: 0; overflow: hidden; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #main-nav .breadcrumb { overflow: hidden; font-size: 13px; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #main-nav .col-auto { padding: 0; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #main-nav .counter-container { display: inline-flex; align-items: center; gap: 8px; margin: 0 !important; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #main-nav .counter-container .btn-group { margin: 0 !important; font-size: 13px; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #main-nav .counter-container .dropdown-toggle { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 8px; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #main-nav .counter-container .dropdown-toggle strong { font-weight: 550; }
body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #close-button { min-height: 44px; min-width: 0; padding: 0 12px; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] #top-content > .container-fluid { padding: 0 var(--ht-tools-left); }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] #top-content .details { padding-top: 12px !important; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] #top-content .question-container { padding: 0 !important; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] #question-holder { min-height: 0; padding: 0 0 12px; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-question-support { margin: 0 !important; padding-bottom: 12px; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-question-support:not(:has(#action-bar > :not(.d-none), .mathCounter > :not([style*="display: none"]))) { display: none; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] #action-bar { padding: 0 !important; gap: 8px; }
/* The question on the sidebar's shade, so the white below reads as the answer. */
body[data-hypatia-design="modern"][data-hypatia-compact="true"] #top-content { background: var(--ht-soft); border-bottom: 1px solid var(--ht-line); }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] #top-content :is(.question-container, #question-holder) { background: transparent; }
/* Shown only on paper: what the top bar says on screen (the top bar is not printed). */
@media screen { body[data-hypatia-design="modern"] .hypatia-print-only { display: none !important; } }
/* The assignment banner (closed, past due...) with the same space below as above. */
body[data-hypatia-design="modern"] .hypatia-assignment-banner { margin-bottom: 1rem !important; }
/* Focus hides the question text, not Help and Report a problem below it. */
body[data-hypatia-design="modern"][data-hypatia-compact="true"][data-hypatia-focus="true"] #top-content > .container-fluid > :not(.hypatia-question-support) { display: none !important; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"][data-hypatia-focus="true"] .hypatia-question-support { padding-top: 12px; }

/* The rail's opaque editor-side backing sits beneath the native Draw control.
   Outer backgrounds stay below that shadow root, never above its controls. */
body[data-hypatia-design="modern"][data-hypatia-compact="true"] #editor-buttons { z-index: auto; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-solve-rail { display: block; position: fixed; z-index: 0; inset: auto 0 0; height: var(--ht-compact-rail-height); background: var(--ht-paper); border-top: 1px solid var(--ht-line); pointer-events: none; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-compact-control { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; height: 44px; padding: 0 12px; border: 1px solid var(--ht-line); border-radius: 9px; background: var(--ht-paper); color: var(--ht-muted); font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-compact-control svg { flex: 0 0 20px; width: 20px; height: 20px; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-compact-control:is(:hover, [aria-expanded="true"], [aria-pressed="true"]) { border-color: var(--ht-light); background: var(--ht-selected); color: var(--ht-blue); }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-compact-control:focus-visible { outline: 3px solid var(--ht-light); outline-offset: 2px; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-compact-control:disabled { opacity: .6; cursor: default; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] #hypatia-focus-toggle { display: inline-flex; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-compact-toggles { display: flex; align-items: center; gap: 8px; position: fixed; z-index: 2; left: calc(var(--ht-tools-left) + var(--ht-draw-span) + var(--ht-calculator-span) + var(--ht-graph-span)); bottom: 8px; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] #hypatia-symbols-toggle { width: 100px; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] #hypatia-tools-toggle { display: none; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"][data-hypatia-annotating="true"] .hypatia-compact-toggles { display: none; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] [data-hypatia-solve-tools] .calculators { position: fixed; z-index: 2; left: calc(var(--ht-tools-left) + var(--ht-draw-span)) !important; bottom: 8px !important; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] [data-hypatia-solve-tools] .calculators > .d-flex { flex-direction: row !important; gap: 8px; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] [data-hypatia-solve-tools] .calculators #calculator-button { width: 122px; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] [data-hypatia-solve-tools] .calculators #graphing-calculator-button { width: 92px; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-answer-actions { display: flex; gap: 8px; left: auto; right: var(--ht-tools-left); bottom: 8px; padding: 0; border: 0; background: transparent; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"][feedback-panel] .hypatia-answer-actions { right: var(--ht-tools-left); }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-answer-actions .btn { height: 44px; min-height: 44px; padding: 0 14px; width: auto; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-answer-actions #prev-button { flex: 0 0 44px; width: 44px; padding: 0; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-answer-actions #prev-button > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-answer-actions #submit-button { min-width: 44px; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-answer-actions .btn-success { flex-shrink: 0; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-answer-actions .btn-purple { background: var(--ht-blue) !important; border-color: var(--ht-blue) !important; color: var(--ht-paper) !important; }
body[data-hypatia-design="modern"][data-hypatia-compact="true"] .editor.error :is(.hypatia-compact-toggles, .hypatia-solve-rail, #hypatia-solve-tool-menu, .calculators) { display: none !important; }

@media(max-width:850px) {
  body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] { --ht-tools-left: 16px; }
  body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #main-nav .info > .row > .col { display: none; }
  body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-compact-toggles { left: var(--ht-tools-left); }
  body[data-hypatia-design="modern"][data-hypatia-compact="true"] #hypatia-tools-toggle { display: inline-flex; width: 84px; }
  body[data-hypatia-design="modern"][data-hypatia-compact="true"] [data-hypatia-solve-tools] .calculators { display: none; left: calc(var(--ht-tools-left) + 8px) !important; bottom: 80px !important; }
  body[data-hypatia-design="modern"][data-hypatia-compact="true"] [data-hypatia-solve-tools] .calculators > .d-flex { flex-direction: column !important; gap: 4px; }
  body[data-hypatia-design="modern"][data-hypatia-compact="true"] [data-hypatia-solve-tools] .calculators :is(#calculator-button, #graphing-calculator-button) { width: calc(var(--ht-tool-menu-width) - 16px); padding: 0 12px; justify-content: flex-start; border-color: transparent; box-shadow: none; font-size: 13px; gap: 8px; }
  body[data-hypatia-design="modern"][data-hypatia-compact="true"][data-hypatia-tools-open="true"] [data-hypatia-solve-tools] .calculators { display: block; }
  body[data-hypatia-design="modern"][data-hypatia-compact="true"][data-hypatia-tools-open="true"] #hypatia-solve-tool-menu { display: block; position: fixed; z-index: 0; left: var(--ht-tools-left); bottom: 72px; width: var(--ht-tool-menu-width); height: var(--ht-tool-menu-height); border: 1px solid var(--ht-line); border-radius: 12px; background: var(--ht-paper); box-shadow: 0 8px 28px #172f421a; pointer-events: none; }
  body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-answer-actions #submit-button:has(> svg) { width: 44px; padding: 0; }
  body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-answer-actions #submit-button:has(> svg) > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media(max-width:480px) {
  body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] { --ht-tools-left: 12px; }
  body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #navbar-content { gap: 8px; }
  body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #nav-logo-hypatia { display: none !important; }
  body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #main-nav .counter-container { gap: 4px; }
  body[data-hypatia-design="modern"][data-hypatia-editor="true"][data-hypatia-compact="true"] #main-nav .counter-container .dropdown-toggle { padding: 0 6px; font-size: 12px; }
  body[data-hypatia-design="modern"][data-hypatia-compact="true"] :is(#hypatia-symbols-toggle, #hypatia-tools-toggle, #hypatia-focus-toggle) { width: 44px; padding: 0; }
  body[data-hypatia-design="modern"][data-hypatia-compact="true"] :is(#hypatia-symbols-toggle, #hypatia-tools-toggle) .hypatia-tool-label { display: none; }
  body[data-hypatia-design="modern"][data-hypatia-compact="true"] #hypatia-focus-toggle .hypatia-focus-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-answer-actions { gap: 6px; }
  body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-answer-actions .btn { font-size: 13px; padding: 0 10px; }
  body[data-hypatia-design="modern"][data-hypatia-compact="true"] .hypatia-label-wide { display: none; }
}
@media print {
  body[data-hypatia-design="modern"][data-hypatia-compact="true"] :is(.hypatia-compact-toggles, .hypatia-solve-rail, #hypatia-solve-tool-menu, #hypatia-focus-toggle, .hypatia-answer-actions, .calculators) { display: none !important; }
  body[data-hypatia-design="modern"][data-hypatia-compact="true"][data-hypatia-focus="true"] #top-content > .container-fluid > :not(.hypatia-question-support) { display: flex !important; }
}

/* Drawing mode emphasizes the actual canvas and its native controls.
   SVG mask openings follow their measured bounds; this veil never catches input. */
body[data-hypatia-design="modern"] .hypatia-drawing-shade {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; z-index: 1040; pointer-events: none;
}
body[data-hypatia-design="modern"] .hypatia-drawing-shade[hidden] { display: none !important; }
body[data-hypatia-design="modern"] .hypatia-drawing-shade-fill { fill: #172f42; fill-opacity: .22; }
body[data-hypatia-design="modern"][data-theme="dark"] .hypatia-drawing-shade-fill { fill: #000; fill-opacity: .36; }
/* On phones the pen palette floats above Done; keep its brief notice clear. */
@media(max-width:850px) {
  body[data-hypatia-design="modern"][data-hypatia-compact="true"][data-hypatia-annotating="true"] #annotate-message { bottom: 146px; }
}
@media print {
  body[data-hypatia-design="modern"] .hypatia-drawing-shade { display: none !important; }
}

/* Question navigation keeps progress separate from the current selection. */
body[data-hypatia-design="modern"] #hypatia-question-toggle {
  border: 0; background: transparent; color: var(--ht-blue); font: inherit;
  white-space: nowrap; cursor: pointer;
}
body[data-hypatia-design="modern"] #hypatia-question-toggle .hypatia-question-label { margin-right: 4px; }
body[data-hypatia-design="modern"] #hypatia-question-toggle .counter { font-weight: 600; }
body[data-hypatia-design="modern"] #hypatia-question-toggle .hypatia-question-total { margin-left: 4px; color: var(--ht-muted); }
body[data-hypatia-design="modern"] #hypatia-question-toggle:focus-visible { outline: 3px solid var(--ht-light); outline-offset: 2px; }
body[data-hypatia-design="modern"] #hypatia-question-menu {
  width: 304px; min-width: 0; max-width: calc(100vw - 24px);
  max-height: min(380px, calc(100dvh - 92px)); overflow-y: auto;
  overscroll-behavior: contain; scroll-padding: 6px; padding: 6px;
  border: 1px solid var(--ht-line); border-radius: 12px;
  background: var(--ht-paper); box-shadow: 0 10px 32px #172f421a;
}
body[data-hypatia-design="modern"] :is(#hypatia-question-menu, [data-hypatia-student-menu]) .hypatia-question-item {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center; gap: 12px; width: 100%; min-height: 60px;
  padding: 10px 12px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ht-ink); text-align: left; white-space: normal; cursor: pointer;
}
body[data-hypatia-design="modern"] :is(#hypatia-question-menu, [data-hypatia-student-menu]) .hypatia-question-item > .fa-circle { display: none; }
body[data-hypatia-design="modern"] :is(#hypatia-question-menu, [data-hypatia-student-menu]) .hypatia-question-item:hover { background: var(--ht-soft); }
body[data-hypatia-design="modern"] :is(#hypatia-question-menu, [data-hypatia-student-menu]) .hypatia-question-item[aria-current="step"] { background: var(--ht-selected); }
body[data-hypatia-design="modern"] :is(#hypatia-question-menu, [data-hypatia-student-menu]) .hypatia-question-item:focus-visible { outline: 2px solid var(--ht-light); outline-offset: -2px; }
body[data-hypatia-design="modern"] .hypatia-question-text { display: grid; gap: 2px; }
body[data-hypatia-design="modern"] .hypatia-question-title { font-size: 14px; line-height: 20px; font-weight: 500; }
body[data-hypatia-design="modern"] [aria-current="step"] > .hypatia-question-text .hypatia-question-title { font-weight: 650; }
body[data-hypatia-design="modern"] .hypatia-question-status { min-height: 18px; font-size: 12px; line-height: 18px; color: var(--ht-muted); }
body[data-hypatia-design="modern"] .hypatia-question-current { display: none; font-size: var(--ht-text-xs); font-weight: 600; color: var(--ht-blue); }
body[data-hypatia-design="modern"] [aria-current="step"] > .hypatia-question-current { display: inline; }
body[data-hypatia-design="modern"] .hypatia-question-state-icon { display: flex; color: var(--ht-muted); }
body[data-hypatia-design="modern"] .hypatia-question-state-icon svg { width: 22px; height: 22px; }
/* The report's marks: green check, red ! (to improve), grey empty circle;
   blue clock where results are hidden until the assignment closes. */
body[data-hypatia-design="modern"] :is(.hypatia-question-check, .hypatia-question-clock, .hypatia-question-attention) { display: none; }
body[data-hypatia-design="modern"] [data-question-status="correct"] > .hypatia-question-state-icon { color: var(--ht-correct); }
body[data-hypatia-design="modern"] [data-question-status="correct"] .hypatia-question-check { display: block; }
body[data-hypatia-design="modern"] [data-question-status="improve"] > .hypatia-question-state-icon { color: var(--ht-incorrect); }
/* Not started: a dashed circle, so it is not taken for a radio button. */
body[data-hypatia-design="modern"] [data-question-status="not-started"] > .hypatia-question-state-icon { color: var(--ht-not-started); }
body[data-hypatia-design="modern"] [data-question-status="not-started"] > .hypatia-question-state-icon circle { stroke-dasharray: 2.8 2.85; }
body[data-hypatia-design="modern"] [data-question-status="improve"] .hypatia-question-attention { display: block; }
body[data-hypatia-design="modern"] [data-question-status="answered"] > .hypatia-question-state-icon { color: var(--ht-mid, #1b89d1); }
body[data-hypatia-design="modern"] [data-question-status="answered"] .hypatia-question-clock { display: block; }
body[data-hypatia-design="modern"] [data-question-status="unknown"] > .hypatia-question-state-icon { opacity: .35; }
/* The answer viewer's students: CheckMath timed out, a grey clock as CheckMath shows it. */
body[data-hypatia-design="modern"] [data-question-status="timeout"] > .hypatia-question-state-icon { color: var(--ht-muted); }
body[data-hypatia-design="modern"] [data-question-status="timeout"] .hypatia-question-clock { display: block; }

@media(max-width:480px) {
  body[data-hypatia-design="modern"][data-hypatia-compact="true"] #hypatia-question-menu {
    position: fixed; top: 56px; right: 12px !important; left: auto; margin-top: 0;
  }
}

/* Report marks (+resultMark): green correct; red to improve (partial credit or none); not started stays muted. */
body[data-hypatia-design="modern"] :is(.hypatia-review-status, .hypatia-results-symbol)[data-result-state="c"] { color: var(--ht-correct); }
body[data-hypatia-design="modern"] :is(.hypatia-review-status, .hypatia-results-symbol):is([data-result-state="p"], [data-result-state="i"]) { color: var(--ht-incorrect); }
body[data-hypatia-design="modern"] .hypatia-review-status:not([data-result-state="c"], [data-result-state="p"], [data-result-state="i"]) svg { color: var(--ht-not-started); }
/* The design toggle in the editor's navbar: no room for it on phones, next to the question counter and Close. Every other page has it. */
@media (max-width: 600px) { body[data-hypatia-design="modern"][data-hypatia-editor="true"] .hypatia-design-switch { display: none !important; } }
