/* ==========================================================================
   STEP Teacher Hub · Architectural Design System
   Palette grounded in Ministry of Education & Science Uzbekistan (STEP)
   + English Intelligence by Teacher Youness Bennani.
   Strict 2-family typography (Plus Jakarta Sans + Inter) and 3-step body scale.
   ========================================================================== */

:root {
  --bg-page: #f4f6fa;
  --bg-surface: #ffffff;
  --bg-subtle: #ebf0f7;
  --bg-rail: #0b1b3f;
  --bg-rail-hover: #142a5c;
  --bg-rail-active: #1c3876;

  --ink: #0e1a30;
  --ink-muted: #475775;
  --ink-on-dark: #f4f7fc;
  --ink-on-dark-muted: #b6c6e4;

  --line: #dce3ee;
  --line-strong: #bfcbe0;
  --line-dark: rgba(255, 255, 255, 0.14);

  --accent: #1652e5;
  --accent-hover: #1041bd;
  --accent-soft: #e9f0ff;
  --gold: #e89d0c;
  --gold-soft: #fef6e4;

  --status-required: #14663e;
  --status-required-bg: #e7f4ee;
  --status-conditional: #8a5600;
  --status-conditional-bg: #fdf3df;
  --status-optional: #475775;
  --status-optional-bg: #eef2f8;

  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Strict 3-size body scale below H1 */
  --text-heading: 1.375rem; /* 22px */
  --text-body: 1rem;        /* 16px */
  --text-sm: 0.875rem;      /* 14px */

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --rail-w: 272px;
  --topbar-h: 64px;
  --tabbar-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm: 0 1px 2px rgba(11, 27, 63, 0.05);
  --shadow-md: 0 12px 32px rgba(11, 27, 63, 0.08);
  --shadow-lg: 0 24px 64px rgba(11, 27, 63, 0.24);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg-page);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button,
a,
summary {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 300;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
}

h2 {
  font-family: var(--font-display);
  font-size: var(--text-heading);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h3 {
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
}

p {
  max-width: 65ch;
}

/* ==========================================================================
   Architectural Shell: Left Navy Rail + Main Workspace
   ========================================================================== */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-w);
  background: var(--bg-rail);
  color: var(--ink-on-dark);
  display: flex;
  flex-direction: column;
  z-index: 60;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 220ms var(--ease);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--line-dark);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink-on-dark);
  min-width: 0;
}

.brand-crest {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.brand-crest svg {
  width: 42px;
  height: 42px;
  display: block;
}

.brand-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #ffffff;
}

.brand-meta {
  font-size: var(--text-sm);
  color: var(--ink-on-dark-muted);
  line-height: 1.2;
}

.drawer-close {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-on-dark);
  place-items: center;
  flex-shrink: 0;
}

#nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: grid;
  align-content: start;
  gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.nav-group {
  display: grid;
  gap: 3px;
}

.nav-label {
  margin: 0 0 4px 10px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-on-dark-muted);
  letter-spacing: 0;
}

#nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  color: #dbe5f7;
  position: relative;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

#nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.78;
}

#nav a:hover {
  background: var(--bg-rail-hover);
  color: #ffffff;
}

#nav a:hover svg,
#nav a.active svg {
  opacity: 1;
}

#nav a.active {
  background: var(--bg-rail-active);
  color: #ffffff;
  font-weight: 600;
}

#nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
}

.side-colophon {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line-dark);
  background: rgba(5, 13, 33, 0.35);
  display: grid;
  gap: 8px;
}

.side-ei-logo {
  height: 30px;
  width: auto;
  object-fit: contain;
}

.side-credit {
  font-size: var(--text-sm);
  color: var(--ink-on-dark-muted);
  line-height: 1.35;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(11, 27, 63, 0.55);
  backdrop-filter: blur(3px);
}

.drawer-backdrop[hidden] {
  display: none;
}

/* ==========================================================================
   Top Bar & Shell
   ========================================================================== */

.shell {
  margin-left: var(--rail-w);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  padding: 0 36px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(244, 246, 250, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease);
}

.topbar-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
}

.mobile-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.mobile-crest {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.mobile-crest svg {
  width: 30px;
  height: 30px;
  display: block;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  transition: background-color 160ms var(--ease);
}

.search-trigger {
  flex: 1;
  max-width: 460px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-size: var(--text-sm);
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms var(--ease), color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.search-trigger:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.search-trigger-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-kbd {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 7px;
  line-height: 1.4;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.record-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.record-tools[hidden] {
  display: none;
}

.topbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease);
}

.topbar-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tour-launcher {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.tour-launcher:hover {
  background: var(--accent);
  color: #ffffff;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 32px 36px 48px;
}

main:focus {
  outline: none;
}

.loading-state {
  color: var(--ink-muted);
  padding: 40px 0;
}

/* ==========================================================================
   Buttons & Links
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-subtle {
  background: var(--bg-subtle);
  color: var(--ink);
  border-color: transparent;
}

.btn-subtle:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.inline-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.inline-link:hover {
  text-decoration: underline;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

/* ==========================================================================
   Dashboard Masthead & Page Headers (Direct Content Entry, Zero Clutter)
   ========================================================================== */

.masthead {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.masthead-copy p {
  margin-top: 10px;
  color: var(--ink-muted);
  font-size: var(--text-body);
}

.masthead-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.masthead-updated {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.curator-plate {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.curator-plate img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.curator-plate-caption {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-muted);
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}

.page-head p {
  margin-top: 8px;
  color: var(--ink-muted);
}

.page-reviewed {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==========================================================================
   Dashboard Grade Strip & Two-Column Workspace
   ========================================================================== */

.section-block {
  margin-top: 28px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.grade-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.grade-tile {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  gap: 10px;
  transition: border-color 160ms var(--ease), transform 160ms var(--ease), box-shadow 160ms var(--ease);
}

.grade-tile:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.grade-tile-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.grade-tile-title {
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.grade-tile-title:hover {
  color: var(--accent);
}

.grade-tile-count {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.grade-tile-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.book-short {
  flex: 1;
  min-width: 44px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--bg-subtle);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}

.book-short:hover {
  background: var(--accent);
  color: #ffffff;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.38fr 1fr;
  gap: 24px;
  align-items: start;
}

.surface-panel {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.news-list li:first-child {
  padding-top: 4px;
}

.news-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: var(--text-sm);
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.news-meta time {
  color: var(--accent);
  font-weight: 600;
}

.news-list h3 {
  margin-bottom: 6px;
}

.news-list p {
  color: var(--ink-muted);
}

.shortcut-list {
  display: grid;
}

.shortcut-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 10px;
  margin: 0 -10px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  transition: background-color 160ms var(--ease);
}

.shortcut-row:last-of-type {
  border-bottom: 0;
}

.shortcut-row:hover {
  background: var(--bg-page);
}

.shortcut-row:hover .shortcut-title {
  color: var(--accent);
}

.shortcut-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-subtle);
  color: var(--bg-rail);
  display: grid;
  place-items: center;
}

.shortcut-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.shortcut-title {
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: 700;
  transition: color 160ms var(--ease);
}

.shortcut-desc {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.shortcut-arrow {
  color: var(--ink-muted);
  transition: transform 160ms var(--ease), color 160ms var(--ease);
}

.shortcut-row:hover .shortcut-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

.panel-footnote {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

/* ==========================================================================
   Content Grids, Lists, Material Rows, Details
   ========================================================================== */

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.tri-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.grade-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 18px;
}

.grade-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.grade-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.grade-card-sub {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.book-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.book-links .btn {
  justify-content: space-between;
  padding: 0 14px;
}

.grade-folder-row {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.info-panel {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.info-panel p {
  color: var(--ink-muted);
}

.info-panel .actions-row {
  margin-top: auto;
  padding-top: 8px;
}

.material-list {
  margin-top: 6px;
}

.material-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.material-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.material-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.material-title {
  font-weight: 600;
  color: var(--ink);
  font-size: var(--text-body);
}

.material-note {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.material-kind {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.material-row .btn {
  flex-shrink: 0;
}

/* Segmented Filter Controls (Non-button cluster pattern) */
.segmented-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 11px;
  margin-bottom: 20px;
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 8px 14px;
  min-height: 36px;
  border-radius: 8px;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.seg-btn:hover {
  color: var(--ink);
}

.seg-btn.active {
  background: var(--bg-surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* Semantic Status Indicator (Genuine status for official record compliance) */
.status-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  width: fit-content;
}

.status-required {
  background: var(--status-required-bg);
  color: var(--status-required);
}

.status-conditional {
  background: var(--status-conditional-bg);
  color: var(--status-conditional);
}

.status-optional {
  background: var(--status-optional-bg);
  color: var(--status-optional);
}

.update-item {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.update-item p {
  color: var(--ink-muted);
}

details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 4px;
}

details summary {
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::after {
  content: '▾';
  font-size: 0.9em;
  transition: transform 160ms var(--ease);
}

details[open] summary::after {
  transform: rotate(180deg);
}

details > p {
  margin-top: 10px;
  font-size: var(--text-body);
  color: var(--ink-muted);
}

.source-note {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 3px solid var(--gold);
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

/* ==========================================================================
   Records Guide & Interactive Working Template Editor
   ========================================================================== */

.record-facts {
  margin: 4px 0;
  display: grid;
  gap: 10px;
}

.record-fact-row {
  display: grid;
  gap: 2px;
}

.record-facts dt {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.record-facts dd {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.origin {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

#log-editor {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
  scroll-margin-top: 84px;
}

#log-editor > summary {
  font-family: var(--font-display);
  font-size: var(--text-heading);
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-body {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.field-input,
.select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--ink);
  font-size: var(--text-body);
  transition: border-color 160ms var(--ease);
}

.field-input:focus,
.select:focus {
  border-color: var(--accent);
}

.select {
  max-width: 520px;
}

.logmeta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.logmeta label {
  display: grid;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.log-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scroll-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table th {
  text-align: left;
  padding: 11px 10px;
  background: var(--bg-subtle);
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  min-width: 130px;
}

.data-table td {
  padding: 6px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-surface);
}

.data-table tr:nth-child(even) td {
  background: #fafbfd;
}

.log-table input {
  width: 100%;
  min-width: 120px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-surface);
  font-size: var(--text-body);
}

.log-table input:focus {
  border-color: var(--accent);
}

.screen-note {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.form-status {
  font-size: var(--text-sm);
  color: var(--status-required);
  font-weight: 500;
}

/* Search & Custom Links Form */
.inline-search-wrap {
  margin: 14px 0 10px;
}

.resource-form {
  display: grid;
  grid-template-columns: 1fr 1.6fr auto;
  gap: 10px;
  margin-top: 14px;
}

.no-result {
  padding: 20px 0;
  color: var(--ink-muted);
}

/* ==========================================================================
   Pre-Submission Deadline Checklists
   ========================================================================== */

.checklist-shell {
  display: grid;
  gap: 20px;
}

.checklist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.checklist-head p {
  margin-top: 6px;
  color: var(--ink-muted);
}

.checklist-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.checklist-progress-row.complete {
  color: var(--status-required);
}

.checklist-bar {
  height: 8px;
  margin-top: 8px;
  border-radius: 99px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.checklist-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 220ms var(--ease), background-color 220ms var(--ease);
}

.checklist-bar-fill.complete {
  background: var(--status-required);
}

.checklist-items {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  border-top: 1px solid var(--line);
}

.checklist-items li {
  border-bottom: 1px solid var(--line);
}

.checklist-items li:last-child {
  border-bottom: 0;
}

.check-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 6px;
  margin: 0 -6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 140ms var(--ease);
}

.check-row:hover {
  background: var(--bg-page);
}

.check-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.check-copy {
  display: grid;
  gap: 3px;
}

.check-title {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--ink);
  transition: color 150ms var(--ease);
}

.check-detail {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.check-row.done .check-title {
  text-decoration: line-through;
  color: var(--ink-muted);
}

.checklist-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ==========================================================================
   Teacher Q&A Workspace
   ========================================================================== */

.qa-controls {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.qa-search-input {
  max-width: 560px;
}

.qa-list {
  display: grid;
  gap: 12px;
}

.qa-item {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0;
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms var(--ease);
}

.qa-item[open] {
  border-color: var(--accent);
}

.qa-item summary {
  width: 100%;
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink);
  font-size: var(--text-body);
  font-weight: 700;
  font-family: var(--font-display);
  line-height: 1.35;
}

.qa-summary-copy {
  display: grid;
  gap: 4px;
  text-align: left;
}

.qa-topic {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
}

.qa-answer {
  padding: 0 20px 20px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.qa-answer > p:first-child {
  margin-top: 14px;
  color: var(--ink);
}

.qa-action-line {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  border-left: 3px solid var(--accent);
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.qa-action-line strong {
  color: var(--ink);
}

.qa-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
}

/* ==========================================================================
   Footer Colophon with English Intelligence + Teacher Youness Bennani
   ========================================================================== */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--bg-surface);
  padding: 26px 36px;
}

.footer-grid {
  max-width: 1148px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-info {
  display: grid;
  gap: 8px;
}

.footer-note,
.footer-privacy {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.footer-contact-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.footer-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}

.footer-contact-link:hover {
  background: var(--accent);
  color: #ffffff;
}

.footer-brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.footer-ei-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
}

.footer-creator {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

/* ==========================================================================
   Global Command Palette (Instant Teacher Quick-Find)
   ========================================================================== */

.cmd-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(11, 27, 63, 0.54);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: start center;
  padding: min(10vh, 84px) 16px 24px;
}

.cmd-backdrop[hidden] {
  display: none;
}

.cmd-dialog {
  width: min(680px, 100%);
  max-height: min(82vh, 680px);
  background: var(--bg-surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popIn 180ms var(--ease);
}

.cmd-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
}

.cmd-input-row input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: var(--text-body);
  color: var(--ink);
  outline: none;
}

.cmd-close {
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--ink-muted);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: var(--text-sm);
  font-weight: 600;
}

.cmd-results {
  overflow-y: auto;
  padding: 12px 12px 14px;
  display: grid;
  gap: 16px;
}

.cmd-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.cmd-quick-queries {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 10px 4px;
}

.cmd-query-btn {
  border: 1px solid var(--line-strong);
  background: var(--bg-page);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 11px;
  min-height: 36px;
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease);
}

.cmd-query-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.cmd-group-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink-muted);
  padding: 2px 10px 6px;
}

.cmd-list {
  display: grid;
  gap: 3px;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease);
}

.cmd-item:hover,
.cmd-item.selected,
.cmd-item:focus-visible {
  background: var(--accent-soft);
  border-color: #c5d7fc;
  color: var(--ink);
  outline: none;
}

.cmd-item:hover .cmd-item-title,
.cmd-item.selected .cmd-item-title {
  color: var(--accent);
}

.cmd-item-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cmd-item-title {
  font-weight: 600;
  font-size: var(--text-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-item-sub {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-item mark {
  background: #fef0c7;
  color: var(--ink);
  padding: 0 2px;
  border-radius: 3px;
}

.cmd-item-action {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.cmd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-page);
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

/* ==========================================================================
   High-Level Dynamic Spotlight Onboarding Tour
   ========================================================================== */

.tour-layer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: auto;
}

.tour-layer[hidden] {
  display: none;
}

.tour-mask-svg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

#tour-cutout-rect {
  transition: x 300ms var(--ease), y 300ms var(--ease), width 300ms var(--ease), height 300ms var(--ease);
}

.tour-beacon {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 14px;
  border: 2.5px solid var(--gold);
  box-shadow: 0 0 0 5px rgba(232, 157, 12, 0.25), 0 10px 30px rgba(11, 27, 63, 0.22);
  pointer-events: none;
  opacity: 0;
  transition: transform 300ms var(--ease), width 300ms var(--ease), height 300ms var(--ease), opacity 200ms var(--ease);
}

.tour-beacon.visible {
  opacity: 1;
}

.tour-card {
  position: fixed;
  top: 0;
  left: 0;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: visible;
  background: var(--bg-surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 22px 24px 20px;
  box-shadow: var(--shadow-lg);
  transition: transform 280ms var(--ease), opacity 200ms var(--ease);
}

.tour-card:focus {
  outline: none;
}

.tour-card.centered {
  width: min(520px, calc(100vw - 32px));
  padding: 26px 28px 24px;
}

.tour-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--line-strong);
  transform: rotate(45deg);
  display: none;
}

.tour-arrow[data-side="top"] {
  display: block;
  top: -8px;
  border-right: 0;
  border-bottom: 0;
}

.tour-arrow[data-side="bottom"] {
  display: block;
  bottom: -8px;
  border-left: 0;
  border-top: 0;
}

.tour-arrow[data-side="left"] {
  display: block;
  left: -8px;
  border-right: 0;
  border-top: 0;
}

.tour-arrow[data-side="right"] {
  display: block;
  right: -8px;
  border-left: 0;
  border-bottom: 0;
}

.tour-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.tour-steps-track {
  flex: 1;
  display: flex;
  gap: 6px;
}

.tour-step-seg {
  flex: 1;
  height: 6px;
  border: 0;
  padding: 0;
  border-radius: 99px;
  background: var(--bg-subtle);
  cursor: pointer;
  transition: background-color 200ms var(--ease);
}

.tour-step-seg.done {
  background: #9bb7f7;
}

.tour-step-seg.current {
  background: var(--accent);
}

.tour-x {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  color: var(--ink-muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}

.tour-x:hover {
  background: var(--bg-subtle);
  color: var(--ink);
}

.tour-visual:empty {
  display: none;
}

.tour-brand-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-page);
  border: 1px solid var(--line);
}

.tour-brand-banner img.tour-ei-img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.tour-brand-caption {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-muted);
  text-align: right;
}

.tour-counter {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

.tour-title {
  font-family: var(--font-display);
  font-size: var(--text-heading);
  font-weight: 700;
  line-height: 1.22;
  color: var(--ink);
  margin-bottom: 8px;
}

.tour-title:focus {
  outline: none;
}

.tour-detail {
  font-size: var(--text-body);
  color: var(--ink-muted);
  line-height: 1.55;
}

.tour-extra:empty {
  display: none;
}

.tour-extra {
  margin-top: 14px;
}

.tour-tip {
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--bg-page);
  border: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--ink);
}

.tour-launch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tour-launch-tile {
  padding: 12px 10px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease), color 150ms var(--ease);
}

.tour-launch-tile:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.tour-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tour-skip-btn {
  background: none;
  border: 0;
  padding: 6px 2px;
  min-height: 40px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-muted);
}

.tour-skip-btn:hover {
  color: var(--ink);
}

.tour-nav-btns {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tour-nav-btns button:disabled {
  opacity: 0.45;
  cursor: default;
}

/* ==========================================================================
   Mobile Bottom Quick-Nav & Toast
   ========================================================================== */

.mobile-tabbar {
  display: none;
}

#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 250;
  background: var(--bg-rail);
  color: #ffffff;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   Responsive Breakpoints (Tablet & Phone 390x844 Optimized)
   ========================================================================== */

@media (max-width: 1120px) {
  :root {
    --rail-w: 240px;
  }

  .topbar {
    padding: 0 24px;
  }

  main {
    padding: 26px 24px 40px;
  }

  .grade-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .tri-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logmeta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: min(310px, 86vw);
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .drawer-close {
    display: grid;
  }

  .shell {
    margin-left: 0;
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  }

  .topbar {
    height: 60px;
    padding: 0 12px;
    background: var(--bg-rail);
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    gap: 8px;
  }

  .topbar-mobile-brand {
    display: flex;
    flex-shrink: 0;
  }

  .mobile-menu-btn {
    color: #ffffff;
  }

  .mobile-menu-btn:hover {
    background: var(--bg-rail-hover);
  }

  .search-trigger {
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    padding: 0;
    justify-content: center;
    margin-left: auto;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    box-shadow: none;
  }

  .search-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
  }

  .search-trigger-label,
  .search-kbd {
    display: none;
  }

  .topbar-actions {
    margin-left: 0;
    gap: 6px;
  }

  .topbar .record-tools {
    display: none;
  }

  .tour-launcher {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--ink);
    padding: 0 12px;
    min-height: 40px;
  }

  .tour-launcher:hover {
    background: #f5ae23;
    color: var(--ink);
  }

  main {
    padding: 20px 16px 32px;
  }

  .masthead {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-bottom: 20px;
  }

  .curator-plate {
    padding: 14px 16px;
  }

  .curator-plate img {
    height: 32px;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
  }

  .grade-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .split-grid,
  .tri-grid,
  .resource-form {
    grid-template-columns: 1fr;
  }

  .surface-panel,
  .info-panel,
  .grade-card,
  .update-item {
    padding: 18px;
  }

  .site-footer {
    padding: 22px 16px 28px;
  }

  .footer-brand-lockup {
    align-items: flex-start;
  }

  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }

  .mobile-tabbar a,
  .mobile-tabbar button {
    border: 0;
    background: transparent;
    color: var(--ink-muted);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.8125rem; /* 13px minimum */
    font-weight: 600;
    padding: 6px 2px;
  }

  .mobile-tabbar a.active {
    color: var(--accent);
  }

  #toast {
    left: 16px;
    right: 16px;
    bottom: calc(var(--tabbar-h) + 14px);
    text-align: center;
  }

  /* Mobile bottom-docked spotlight tour card */
  .tour-card.mobile-sheet {
    top: auto !important;
    left: 12px !important;
    right: 12px !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    transform: none !important;
    width: auto;
    max-height: 58dvh;
    overflow-y: auto;
    padding: 18px 18px 16px;
    border-radius: 18px;
  }

  .tour-card.mobile-sheet .tour-arrow {
    display: none !important;
  }

  .tour-brand-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .tour-brand-caption {
    text-align: left;
  }

  .tour-launch-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .grade-strip {
    grid-template-columns: 1fr;
  }

  .logmeta {
    grid-template-columns: 1fr;
  }

  .material-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .material-row .btn {
    width: 100%;
  }
}

/* ==========================================================================
   Reduced Motion & Print
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .mobile-tabbar,
  .site-footer,
  .tour-layer,
  .cmd-backdrop,
  #toast,
  .no-print {
    display: none !important;
  }

  .shell {
    margin: 0;
    padding: 0;
  }

  main {
    padding: 0;
    max-width: none;
  }

  .surface-panel,
  .info-panel,
  .grade-card,
  .update-item {
    box-shadow: none;
    break-inside: avoid;
  }
}
/* Editorial refresh for the teacher workspace. Layered masthead with a brief reveal. */
:root {
  --bg-page: #f5f4ee;
  --bg-surface: #fffefb;
  --font-display: 'Source Serif 4', Georgia, serif;
  --font-body: 'Source Sans 3', 'Trebuchet MS', sans-serif;
}
h1, h2, h3 { letter-spacing: -.018em; }
h1, h2 { font-weight: 600; }
.brand-title, .mobile-brand-link, .grade-tile-title { font-family: var(--font-body); }
.brand-crest, .mobile-crest { overflow: hidden; }
.brand-crest img, .mobile-crest img { width: 100%; height: 100%; object-fit: cover; }
.masthead {
  position: relative;
  isolation: isolate;
  grid-template-columns: minmax(0,1fr);
  padding: clamp(22px,4vw,48px);
  border: 1px solid #dedbd1;
}
.masthead-paper, .masthead-rule { position: absolute; pointer-events: none; }
.masthead-paper { inset: 0; z-index: -2; background: #fffdf6; }
.masthead-rule { inset: 0 auto 0 0; width: 4px; z-index: -1; background: #23538a; }
.masthead-copy h1 { font-weight: 600; }
.masthead-copy p { max-width: 56ch; font-size: 1.125rem; }
@media (prefers-reduced-motion: no-preference) and (pointer: fine) {
  .masthead-copy { animation: masthead-reveal 320ms ease-out both; }
}
@keyframes masthead-reveal {
  from { opacity: .75; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#quick-grades .grade-tile, .grade-cards-grid .grade-card {
  border-radius: 7px;
  box-shadow: none;
}
.grade-audio { margin: 12px 0; border-top: 1px solid var(--line); }
.grade-audio summary { padding: 10px 0; cursor: pointer; font-weight: 650; color: var(--accent); }
.grade-audio-count { margin-left: 8px; font-size: .875rem; color: var(--ink-muted); font-weight: 400; }
.grade-audio ul, .help-channels { padding: 0; list-style: none; }
.grade-audio ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px,1fr)); gap: 6px 10px; margin: 0 0 10px; }
.grade-audio a { display: inline-block; padding-block: 4px; }
.help-channels li { display: grid; grid-template-columns: minmax(85px,1fr) 3fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.help-channels li:last-child { border-bottom: 0; }
.holiday-sheet { max-width: 900px; }
.holiday-sheet h1 { margin-block: 0 4px; }
.holiday-sheet h2 { margin-top: 1rem; }
.holiday-table { width: 100%; border-collapse: collapse; margin: 10px 0 18px; text-align: left; }
.holiday-table th, .holiday-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.holiday-table thead { background: var(--bg-subtle); }
.holiday-adjustments { padding-left: 1.3em; }
.holiday-adjustments li { margin-block: 5px; }
.holiday-adjustments strong { display: block; }
.holiday-sources { margin-top: 15px; gap: 14px; }
@media (max-width: 520px) {
  .holiday-table th, .holiday-table td { padding: 7px 5px; font-size: .875rem; }
}
@media print {
  body[data-page="holidays"] .sidebar,
  body[data-page="holidays"] .topbar,
  body[data-page="holidays"] .site-footer,
  body[data-page="holidays"] #mobile-tabbar,
  body[data-page="holidays"] #print-holidays { display: none !important; }
  body[data-page="holidays"] .shell,
  body[data-page="holidays"] main { margin: 0 !important; padding: 0 !important; width: auto; }
  .holiday-sheet { padding: 0; border: 0; font-size: 10.5pt; }
  .holiday-table th, .holiday-table td { padding: 5px 7px; }
  .holiday-table tr, .holiday-adjustments li { break-inside: avoid; }
}
