/* ODP shared UI foundation: tokens, theme, focus, layers, and a11y primitives. */
:root {
  color-scheme: light;
  --odp-color-bg: #f5f8fb;
  --odp-color-bg-soft: #eef4f8;
  --odp-color-surface: #ffffff;
  --odp-color-surface-raised: rgba(255, 255, 255, 0.92);
  --odp-color-text: #10243d;
  --odp-color-muted: #66778d;
  --odp-color-border: rgba(16, 36, 61, 0.14);
  --odp-color-primary: #1e5d88;
  --odp-color-success: #127267;
  --odp-color-warning: #9a6a24;
  --odp-color-danger: #aa3a36;
  --odp-radius-sm: 8px;
  --odp-radius-md: 12px;
  --odp-radius-lg: 18px;
  --odp-radius-xl: 24px;
  --odp-shadow-sm: 0 8px 24px rgba(16, 36, 61, 0.08);
  --odp-shadow-md: 0 18px 50px rgba(16, 36, 61, 0.12);
  --odp-shadow-lg: 0 28px 80px rgba(16, 36, 61, 0.16);
  --odp-focus-ring: 0 0 0 3px rgba(30, 93, 136, 0.24), 0 0 0 6px rgba(255, 255, 255, 0.86);
  --odp-motion-fast: 140ms;
  --odp-motion-med: 220ms;
  --odp-motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --odp-z-base: 0;
  --odp-z-raised: 10;
  --odp-z-sticky: 100;
  --odp-z-overlay: 800;
  --odp-z-dialog: 1000;
  --odp-z-toast: 1100;
  --odp-z-global-frame: 1200;
  --odp-safe-bottom: max(18px, env(safe-area-inset-bottom, 0px));
  --bg: var(--odp-color-bg-soft);
  --surface: var(--odp-color-surface);
  --surface2: #f6f9fc;
  --surface-2: #f6f9fc;
  --surface3: #eaf1f7;
  --border: var(--odp-color-border);
  --border2: rgba(16, 36, 61, 0.18);
  --text: var(--odp-color-text);
  --muted: var(--odp-color-muted);
}

:root[data-theme-resolved="dark"] {
  color-scheme: dark;
  --odp-color-bg: #07131f;
  --odp-color-bg-soft: #0c1d2e;
  --odp-color-surface: #102337;
  --odp-color-surface-raised: rgba(18, 39, 61, 0.94);
  --odp-color-text: #edf6ff;
  --odp-color-muted: #a7b8c9;
  --odp-color-border: rgba(184, 207, 226, 0.22);
  --odp-focus-ring: 0 0 0 3px rgba(158, 231, 245, 0.34), 0 0 0 6px rgba(7, 19, 31, 0.9);
  --bg: #07131f;
  --surface: #102337;
  --surface2: #0c1d2e;
  --surface-2: #0c1d2e;
  --surface3: #18314c;
  --border: rgba(184, 207, 226, 0.22);
  --border2: rgba(184, 207, 226, 0.3);
  --text: #edf6ff;
  --muted: #a7b8c9;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme-resolved]) {
    color-scheme: dark;
  }
}

html {
  background: var(--odp-color-bg);
  text-rendering: optimizeLegibility;
}

body {
  min-width: 0;
  color: var(--text, var(--odp-color-text));
}

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

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--odp-focus-ring);
}

:where([hidden]) {
  display: none !important;
}

:where(.modal-overlay, .student-detail-backdrop)[hidden] {
  display: none !important;
}

body.odp-scroll-locked {
  overflow: hidden;
  touch-action: none;
}

.odp-theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border, var(--odp-color-border));
  border-radius: 999px;
  background: var(--surface, var(--odp-color-surface-raised));
  color: var(--text, var(--odp-color-text));
  box-shadow: var(--shadow-sm, var(--odp-shadow-sm));
  cursor: pointer;
  transition: transform var(--odp-motion-fast) var(--odp-motion-ease), border-color var(--odp-motion-fast) ease, background var(--odp-motion-fast) ease;
}

.odp-theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(30, 93, 136, 0.36);
}

.odp-theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand .odp-theme-toggle,
.sidebar .odp-theme-toggle {
  margin-top: 10px;
}

.sidebar .odp-theme-toggle {
  margin-bottom: 8px;
}

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

.student-dashboard-pages > [data-card][hidden] {
  display: none !important;
}

@container odp-card (max-width: 420px) {
  .entry-card,
  .student-dashboard-card,
  .card {
    border-radius: var(--odp-radius-md);
  }
}

@supports (container-type: inline-size) {
  .entry-list,
  .student-dashboard,
  .main,
  .card {
    container-type: inline-size;
    container-name: odp-card;
  }
}

@supports (view-transition-name: none) {
  :root {
    view-transition-name: root;
  }
}

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