:root {
  /* Ireland / academic palette */
  --primary-50: #f0f9ff;
  --primary-100: #e0f2fe;
  --primary-200: #bae6fd;
  --primary-300: #7dd3fc;
  --primary-400: #38bdf8;
  --primary-500: #0ea5e9;
  --primary-600: #0284c7;
  --primary-700: #0369a1;
  --primary-800: #075985;
  --primary-900: #0c4a6e;

  --accent-50: #fffbeb;
  --accent-100: #fef3c7;
  --accent-200: #fde68a;
  --accent-300: #fcd34d;
  --accent-400: #fbbf24;
  --accent-500: #f59e0b;
  --accent-600: #d97706;
  --accent-700: #b45309;

  /* Semantic colors */
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.12);
  --error: #ef4444;
  --error-soft: rgba(239, 68, 68, 0.12);
  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, 0.12);

  /* Status colors (v2) */
  --status-open: #3b82f6;
  --status-open-soft: rgba(59, 130, 246, 0.12);
  --status-progress: #f59e0b;
  --status-progress-soft: rgba(245, 158, 11, 0.12);
  --status-done: #10b981;
  --status-done-soft: rgba(16, 185, 129, 0.12);
  --status-late: #ef4444;
  --status-late-soft: rgba(239, 68, 68, 0.12);
  --status-draft: #64748b;
  --status-draft-soft: rgba(100, 116, 139, 0.12);

  /* Light theme (default) */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-input: #f1f5f9;
  --bg-hover: #f1f5f9;
  --bg-active: #e2e8f0;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #f8fafc;

  --border-color: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(15, 23, 42, 0.15);
  --border-focus: var(--primary-500);

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 20px rgba(14, 165, 233, 0.25);
  --shadow-glow-accent: 0 0 20px rgba(245, 158, 11, 0.3);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --header-height: 4rem;
  --sidebar-width: 16rem;
  --max-content-width: 1400px;
}

[data-theme="dark"] {
  --bg-body: #020617;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #1e293b;
  --bg-input: #1e293b;
  --bg-hover: #1e293b;
  --bg-active: #334155;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --border-color: rgba(148, 163, 184, 0.12);
  --border-hover: rgba(148, 163, 184, 0.2);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.55), 0 8px 10px -6px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 30px rgba(14, 165, 233, 0.35);
  --shadow-glow-accent: 0 0 30px rgba(245, 158, 11, 0.4);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light dark;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* Animated gradient background for auth pages */
.page-auth {
  background:
    radial-gradient(ellipse at 10% 20%, rgba(14, 165, 233, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 50%),
    var(--bg-body);
  position: relative;
  overflow-x: hidden;
}

.page-auth::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(14, 165, 233, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(245, 158, 11, 0.06) 0%, transparent 40%);
  animation: aurora 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes aurora {
  0%, 100% { opacity: 0.6; transform: translateX(0) scale(1); }
  33% { opacity: 1; transform: translateX(2%) scale(1.05); }
  66% { opacity: 0.8; transform: translateX(-2%) scale(0.98); }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin: 0 0 var(--space-md);
  color: var(--text-secondary);
}

a {
  color: var(--primary-700);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-800);
}

[data-theme="dark"] a {
  color: var(--primary-400);
}

[data-theme="dark"] a:hover {
  color: var(--primary-300);
}

.btn,
.logo,
.nav-toggle,
.theme-toggle,
.chat-item,
.course-card,
.lecture-row,
.week-card {
  text-decoration: none;
}

p a,
.tips-list a,
.import-tips a {
  text-decoration: underline;
}

/* Layout utilities */
.container {
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

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

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

.section-title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-md);
}

.lecture-card-title,
.deadline-title,
.course-card-title {
  font-size: var(--text-lg);
  font-weight: 600;
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}

.card-glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .card-glass {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.15);
}

.card-header,
.card-body,
.card-footer {
  padding: var(--space-lg);
}

.card-header {
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.card-footer {
  border-top: 1px solid var(--border-color);
}

/* Skeleton loaders */
.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-hover) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-md);
  animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty states */
.empty-state-lg {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-muted);
}

.empty-state-lg svg {
  width: 4rem;
  height: 4rem;
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.625rem 1.25rem;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.5;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-400) 0%, var(--primary-500) 100%);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
  transform: translateY(-1px);
  color: white;
  text-decoration: none;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-500) 0%, var(--accent-600) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-accent:hover {
  background: linear-gradient(135deg, var(--accent-400) 0%, var(--accent-500) 100%);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
  transform: translateY(-1px);
  color: white;
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.btn-ghost.nav-active {
  background: var(--primary-100);
  color: var(--primary-700);
  font-weight: 600;
}

[data-theme="dark"] .btn-ghost.nav-active {
  background: var(--primary-900);
  color: var(--primary-100);
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: var(--text-base);
  border-radius: var(--radius-xl);
}

.btn-block {
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:hover {
  border-color: var(--border-hover);
}

.form-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
  background: var(--bg-surface);
}

[data-theme="dark"] .form-input:focus {
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.25rem 0.75rem;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: #92400e; }
.badge-error { background: var(--error-soft); color: var(--error); }
.badge-info { background: var(--info-soft); color: var(--info); }

/* Status badges (v2) */
.badge-open { background: var(--status-open-soft); color: var(--status-open); }
.badge-progress { background: var(--status-progress-soft); color: var(--status-progress); }
.badge-done { background: var(--status-done-soft); color: var(--status-done); }
.badge-late { background: var(--status-late-soft); color: var(--status-late); }
.badge-draft { background: var(--status-draft-soft); color: var(--status-draft); }

[data-theme="dark"] .badge-warning { color: #fbbf24; }

/* Alerts / toasts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-bottom: var(--space-lg);
  animation: slideIn 300ms ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-error { background: var(--error-soft); border-color: rgba(239, 68, 68, 0.2); color: var(--error); }
.alert-success { background: var(--success-soft); border-color: rgba(16, 185, 129, 0.2); color: var(--success); }
.alert-warning { background: var(--warning-soft); border-color: rgba(245, 158, 11, 0.2); color: var(--warning); }
.alert-info { background: var(--info-soft); border-color: rgba(59, 130, 246, 0.2); color: var(--info); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-slow);
}

[data-theme="dark"] .site-header {
  background: rgba(2, 6, 23, 0.8);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  color: var(--text-primary);
}

.logo-mark {
  width: 2.25rem;
  height: 2.25rem;
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-500) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: var(--text-sm);
  box-shadow: var(--shadow-glow);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .header-actions {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
  }

  .header-actions.open {
    display: flex;
  }

  .header-actions .btn,
  .header-actions .text-small-muted {
    justify-content: flex-start;
    width: 100%;
  }
}

/* Main content */
.main-content {
  padding: var(--space-xl) 0;
  min-height: calc(100vh - var(--header-height));
}

.page-title {
  margin-bottom: var(--space-xs);
}

.page-subtitle {
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

/* Theme toggle */
.theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--bg-hover);
  transform: rotate(15deg);
}

/* Loading shimmer */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-input) 25%,
    var(--bg-hover) 50%,
    var(--bg-input) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Spinner */
.spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Footer (v2) */
.site-footer {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.footer-copy {
  margin: 0;
}

.footer-links {
  display: flex;
  gap: var(--space-md);
}

.footer-links a {
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* Mobile nav helpers */
.hide-mobile {
  display: inline;
}

@media (max-width: 1024px) {
  .hide-mobile {
    display: none;
  }
}

/* Command palette (v2) */
.command-palette {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.command-palette[hidden] {
  display: none;
}

.command-palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.command-palette-panel {
  position: relative;
  width: min(640px, calc(100% - var(--space-xl)));
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.command-palette-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

.command-palette-input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: var(--text-lg);
  color: var(--text-primary);
  outline: none;
}

.command-palette-input::placeholder {
  color: var(--text-muted);
}

.command-palette-hint {
  font-size: var(--text-xs);
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-muted);
}

.command-palette-results {
  max-height: 50vh;
  overflow-y: auto;
}

.command-palette-group {
  padding: var(--space-sm) 0;
}

.command-palette-group-title {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.command-palette-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
}

.command-palette-item:hover,
.command-palette-item[aria-selected="true"] {
  background: var(--bg-hover);
}

.command-palette-item mark {
  background: var(--accent-200);
  color: inherit;
  border-radius: var(--radius-sm);
}

.command-palette-empty {
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  color: var(--text-muted);
}

.command-palette-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-lg);
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--border-color);
  background: var(--bg-input);
}

.command-palette-footer kbd {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

/* Print */
@media print {
  .site-header,
  .theme-toggle,
  .no-print {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ── v2: keyboard shortcuts overlay ── */
.shortcuts-overlay {
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: rgba(2, 6, 23, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.shortcuts-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg, 0 20px 50px rgba(0,0,0,0.25));
    padding: var(--space-xl);
    max-width: 420px;
    width: 100%;
}

.shortcuts-panel h2 {
    margin: 0 0 var(--space-lg);
    font-size: var(--text-lg);
}

.shortcuts-list {
    list-style: none;
    margin: 0 0 var(--space-lg);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.shortcuts-list li {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.shortcuts-list kbd {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: var(--text-xs);
    color: var(--text-primary);
}

/* ── v2: install banner + offline indicator ── */
.install-banner {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    background: var(--bg-secondary);
    border: 0;
    border-bottom: 1px solid var(--border);
    padding: var(--space-sm) var(--space-lg);
    width: 100%;
    max-width: none;
}

.install-banner span {
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.install-banner-close {
    background: none;
    border: none;
    font-size: var(--text-lg);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 var(--space-xs);
}

.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1500;
    background: var(--warning, #f59e0b);
    color: #1f2937;
    text-align: center;
    padding: var(--space-xs);
    font-size: var(--text-sm);
    font-weight: 600;
}

/* ── v2: display-none utility ──
   Must override component display rules (e.g. .shortcuts-overlay{display:flex})
   regardless of stylesheet order — hence the body-prefixed selector. */
.display-none,
body .display-none {
    display: none;
}

/* ── @ai: accessibility polish — reduced motion + visible focus ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: var(--space-md);
  background: var(--primary-600);
  color: var(--text-inverse);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  z-index: 2000;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-sm);
}
