/**
 * Drilo Core Styles — Night Game Design System
 *
 * Dark-first visual identity with electric lime accent.
 * Single source of truth for Drilo visual styling.
 *
 * Organization:
 * 1. CSS Custom Properties (:root)
 * 2. Bootstrap overrides and polyfills
 * 3. Base styles (body, cards, buttons, forms)
 * 4. Navigation and layout
 * 5. Step indicator
 * 6. HTMX loading and transition styles
 * 7. Compose pages (hamburger menu, drill browser)
 * 8. Canvas page (blocks, timeline, station grid)
 * 9. Runner page (transition cues)
 * 10. Glossary page
 * 11. Station cards (print styles)
 * 12. Micro-feedback widget
 * 13. Responsive overrides
 */

/* =============================================================================
   1. CSS Custom Properties
   ============================================================================= */

:root {
  /* Typography */
  --font-display: 'Barlow', sans-serif;
  --font-ui: 'Inter', sans-serif;
  --font-numeric: 'Roboto Mono', monospace;

  --text-h1: 32px;
  --text-h2: 24px;
  --text-h3: 20px;
  --text-body: 16px;
  --text-label: 14px;
  --text-small: 12px;
  --text-timer-lg: 48px;
  --text-timer-md: 24px;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --tracking-tight: -0.01em;
  --tracking-normal: 0;
  --tracking-wide: 0.05em;

  /* Colors — Backgrounds */
  --color-bg: #0D0D0D;
  --color-surface: #141414;
  --color-card: #1A1A1A;
  --color-card-hover: #222222;
  --color-elevated: #252525;

  /* Colors — Borders */
  --color-border: #2A2A2A;
  --color-border-subtle: #1F1F1F;
  --color-border-ghost: #161616;

  /* Colors — Text */
  --color-text: #F0F0F0;
  --color-text-secondary: #999999;
  --color-text-muted: #828282;
  --color-text-faint: #5F5F5F;

  /* Colors — Accent */
  --color-primary: #A8E10C;
  --color-primary-hover: #B8F01E;
  --color-lime-40: rgba(168, 225, 12, 0.40);
  --color-lime-20: rgba(168, 225, 12, 0.20);
  --color-lime-15: rgba(168, 225, 12, 0.15);
  --color-lime-08: rgba(168, 225, 12, 0.08);
  --color-lime-04: rgba(168, 225, 12, 0.04);

  /* Colors — Semantic */
  --color-positive: #4ADE80;
  --color-positive-hover: #22C55E;
  --color-warning: #FACC15;
  --color-danger: #EF4444;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;

  /* Borders */
  --border: 1px solid var(--color-border);
  --border-heavy: 2px solid var(--color-border);
  --border-active: 2px solid var(--color-primary);
  --border-subtle: 1px solid var(--color-border-subtle);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 100px;

  /* Shadows */
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lime-glow: 0 4px 24px rgba(210, 243, 76, 0.3);
  --shadow-modal: 0 16px 48px rgba(0, 0, 0, 0.5);

  /* Transitions */
  --transition-fast: 200ms ease;
  --transition-normal: 250ms ease;
}

/* =============================================================================
   2. Bootstrap Overrides — Night Game palette
   ============================================================================= */

/* Background color overrides — map Bootstrap bg-* to design palette */
.bg-primary {
  background-color: var(--color-primary) !important;
}

.bg-info {
  background-color: var(--color-primary) !important;
}

.bg-success {
  background-color: var(--color-positive) !important;
}

.bg-danger {
  background-color: var(--color-danger) !important;
}

.bg-warning {
  background-color: var(--color-warning) !important;
}

.bg-secondary {
  background-color: var(--color-text-muted) !important;
}

.bg-light {
  background-color: var(--color-surface) !important;
}

.bg-dark {
  background-color: var(--color-bg) !important;
}

.bg-info-subtle {
  background-color: var(--color-lime-08) !important;
}

.bg-warning-subtle {
  background-color: rgba(250, 204, 21, 0.08) !important;
}

.bg-success-subtle {
  background-color: rgba(74, 222, 128, 0.08) !important;
}

.badge.bg-success-subtle {
  background-color: rgba(74, 222, 128, 0.08) !important;
}

.badge.bg-info-subtle {
  background-color: var(--color-lime-08) !important;
}

/* Text color overrides */
.text-white {
  color: var(--color-text) !important;
}

.text-dark {
  color: var(--color-text) !important;
}

/* Border color overrides — map Bootstrap border-* to palette */
.border-primary {
  border-color: var(--color-primary) !important;
}

.border-info {
  border-color: var(--color-primary) !important;
}

.border-success {
  border-color: var(--color-positive) !important;
}

.border-danger {
  border-color: var(--color-danger) !important;
}

.border-warning {
  border-color: var(--color-warning) !important;
}

.border-secondary {
  border-color: var(--color-border) !important;
}

/* Alert overrides — dark surface with left border accent */
.alert-info {
  background-color: var(--color-lime-08) !important;
  border-color: var(--color-lime-15) !important;
  border-left: 3px solid var(--color-primary) !important;
  color: var(--color-primary) !important;
}

.alert-primary {
  background-color: var(--color-lime-08) !important;
  border-color: var(--color-lime-15) !important;
  border-left: 3px solid var(--color-primary) !important;
  color: var(--color-primary) !important;
}

.alert-success {
  background-color: rgba(74, 222, 128, 0.1) !important;
  border-color: rgba(74, 222, 128, 0.2) !important;
  border-left: 3px solid var(--color-positive) !important;
  color: var(--color-positive) !important;
}

.alert-warning {
  background-color: rgba(250, 204, 21, 0.1) !important;
  border-color: rgba(250, 204, 21, 0.2) !important;
  border-left: 3px solid var(--color-warning) !important;
  color: var(--color-warning) !important;
}

.alert-danger {
  background-color: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
  border-left: 3px solid var(--color-danger) !important;
  color: var(--color-danger) !important;
}

/* Toast override */
.text-bg-success {
  background-color: var(--color-positive) !important;
  color: var(--color-bg) !important;
}

/* Bootstrap bg-opacity modifiers */
.bg-success.bg-opacity-10 {
  background-color: rgba(74, 222, 128, 0.1) !important;
}

.bg-primary.bg-opacity-10 {
  background-color: var(--color-lime-08) !important;
}

.bg-info.bg-opacity-10 {
  background-color: var(--color-lime-08) !important;
}

/* Progress bar overrides */
.progress {
  background-color: var(--color-card) !important;
}

.progress-bar.bg-success {
  background-color: var(--color-positive) !important;
}

.progress-bar.bg-warning {
  background-color: var(--color-warning) !important;
}

.progress-bar.bg-danger {
  background-color: var(--color-danger) !important;
}

.progress-bar.bg-secondary {
  background-color: var(--color-border) !important;
}

/* =============================================================================
   3. Base Styles
   ============================================================================= */

/* Skip link for keyboard accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: var(--color-bg);
  padding: var(--space-sm) var(--space-lg);
  z-index: 9999;
  text-decoration: none;
  font-family: var(--font-ui);
  font-weight: var(--weight-medium);
  border-radius: 0 0 var(--radius-sm) 0;
  transition: top var(--transition-normal);
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--color-positive);
  outline-offset: 2px;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.card {
  box-shadow: none;
  border-radius: var(--radius-lg);
  border: var(--border-subtle);
  background-color: var(--color-card);
}

.card-header {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  background-color: var(--color-surface);
  border-bottom: var(--border-subtle);
}

.btn {
  border-radius: var(--radius-md);
  padding: var(--space-sm) 14px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
  height: 36px;
  transition: var(--transition-fast);
}

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

.btn-sm {
  height: 32px;
  padding: var(--space-xs) var(--space-sm);
  font-size: 12px;
}

.btn-lg {
  height: 40px;
  padding: var(--space-sm) var(--space-lg);
  font-size: 13px;
}

.btn-primary {
  background-color: var(--color-primary);
  border: none;
  color: var(--color-bg);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--color-primary-hover);
  box-shadow: var(--shadow-lime-glow);
  color: var(--color-bg);
}

.btn-success {
  background-color: var(--color-positive);
  border-color: var(--color-positive-hover);
  color: var(--color-bg);
}

.btn-success:hover,
.btn-success:focus {
  background-color: var(--color-positive-hover);
  border-color: var(--color-positive-hover);
  box-shadow: none;
  color: var(--color-bg);
}

.btn-outline-primary {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background-color: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--color-lime-15);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: none;
}

.btn-outline-secondary {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  border-color: var(--color-text-muted);
  color: var(--color-text);
  background: transparent;
  box-shadow: none;
}

.btn-outline-danger {
  color: var(--color-danger);
  border-color: var(--color-danger);
  background-color: transparent;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: var(--color-danger);
  color: var(--color-danger);
  box-shadow: none;
}

.btn-outline-info {
  color: var(--color-primary);
  border-color: var(--color-border);
  background: transparent;
}

.btn-outline-info:hover,
.btn-outline-info:focus {
  background-color: var(--color-lime-08);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: none;
}

.btn-danger {
  background-color: var(--color-danger);
  border-color: var(--color-danger);
  color: var(--color-text);
}

.btn-danger:hover,
.btn-danger:focus {
  opacity: 0.9;
  box-shadow: none;
}

.btn-link {
  text-transform: none;
  letter-spacing: 0;
  font-weight: var(--weight-regular);
  font-size: 14px;
  height: auto;
  color: var(--color-primary);
}

.btn-link:hover {
  color: var(--color-primary-hover);
}

/* Form controls */
.form-control,
.form-select {
  border-radius: var(--radius-sm);
  height: 36px;
  padding: 6px 10px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: var(--weight-regular);
  border: 1px solid var(--color-border);
  background-color: var(--color-card);
  color: var(--color-text);
}

.form-control::placeholder,
.form-select::placeholder {
  color: var(--color-text-faint);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-lime-15);
  background-color: var(--color-card);
  color: var(--color-text);
  outline: none;
}

textarea.form-control {
  height: auto;
}

/* Badge/tag styling — pills on dark */
.badge {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: var(--weight-medium);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

/* Intention/lane tags */
.badge.bg-primary,
.badge.bg-info {
  background: var(--color-lime-08) !important;
  color: var(--color-primary) !important;
  border: none;
}

/* Neutral/format tags */
.badge.bg-secondary,
.badge.bg-light {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--color-text-muted) !important;
  border: none;
}

/* Alert improvements */
.alert {
  border-radius: var(--radius-md);
  background-color: var(--color-card);
}

/* Mono font for time values and numeric data */
.font-mono,
.time-value {
  font-family: var(--font-numeric);
}

/* Text color overrides */
.text-muted {
  color: var(--color-text-secondary) !important;
}

.text-success {
  color: var(--color-positive) !important;
}

.text-danger {
  color: var(--color-danger) !important;
}

.text-warning {
  color: var(--color-warning) !important;
}

.text-primary {
  color: var(--color-primary) !important;
}

.text-info {
  color: var(--color-primary) !important;
}

/* List group items for dark theme */
.list-group-item {
  background-color: var(--color-card);
  border-color: var(--color-border);
  color: var(--color-text);
}

/* Table overrides for dark theme */
.table {
  color: var(--color-text);
  border-color: var(--color-border);
}

.table > :not(caption) > * > * {
  background-color: transparent;
  border-bottom-color: var(--color-border);
}

/* =============================================================================
   4. Navigation and Layout
   ============================================================================= */

.navbar {
  background-color: var(--color-bg) !important;
  border-bottom: var(--border);
  padding: var(--space-sm) 0;
}

.navbar-brand {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: 20px;
  letter-spacing: var(--tracking-tight);
  color: var(--color-text) !important;
}

/* Frame and drill card styling */
.frame-card {
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.frame-card:hover {
  border-color: var(--color-lime-20);
}

.frame-card.selected {
  border: var(--border-active);
  background-color: var(--color-card);
}

.drill-card {
  border-left: 3px solid var(--color-primary);
  transition: border-color var(--transition-fast);
}

.drill-card:hover {
  border-left-color: var(--color-primary-hover);
}

.lane-header {
  background-color: var(--color-surface);
  padding: var(--space-sm) var(--space-md);
  border-radius: 0;
  border-bottom: var(--border-heavy);
  margin-bottom: var(--space-sm);
}

/* Dropdown overrides for dark theme */
.dropdown-menu {
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.dropdown-item {
  color: var(--color-text-secondary);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--color-card-hover);
  color: var(--color-text);
}

.dropdown-divider {
  border-color: var(--color-border);
}

/* Container max-width — brief: 800px content max */
@media (min-width: 768px) {
  .container {
    max-width: 800px;
  }
}

/* =============================================================================
   5. Step Indicator
   ============================================================================= */

.step-indicator {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.step {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0.5rem;
  font-weight: var(--weight-bold);
}

.step.active {
  background-color: var(--color-primary);
  color: var(--color-bg);
}

.step.completed {
  background-color: var(--color-primary);
  color: var(--color-bg);
  position: relative;
}

/* Checkmark indicator for completed steps */
.step.completed::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.25rem;
  font-weight: bold;
}

/* Hide number in completed steps, show checkmark */
.step.completed {
  font-size: 0;
}

.step.pending {
  background-color: transparent;
  color: var(--color-text-faint);
  border: 2px dashed var(--color-border);
}

.step-line {
  flex-grow: 1;
  height: 2px;
  background-color: var(--color-border);
  align-self: center;
  max-width: 60px;
}

/* =============================================================================
   6. HTMX Loading and Transition Styles
   ============================================================================= */

.htmx-request {
  opacity: 0.7;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.htmx-request .htmx-indicator {
  display: inline-block !important;
}

.htmx-indicator {
  display: none;
}

/* Smooth transitions for swapped content */
.htmx-swapping {
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.htmx-settling {
  opacity: 1;
  transition: opacity var(--transition-normal);
}

/* Button loading spinner */
.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin-left: -0.5rem;
  margin-top: -0.5rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spinner 0.6s linear infinite;
}

@keyframes btn-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Fade in animation for new content */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.htmx-added {
  animation: fadeSlideIn 0.2s ease-out;
}

/* =============================================================================
   7. Compose Pages - Hamburger Menu and Navigation
   ============================================================================= */

/* Hide navbar buttons on compose pages - navigation via hamburger menu
   Exception: Show auth buttons on welcome page for discoverability */
body.compose-hide-nav-buttons .navbar .d-flex.align-items-center {
  display: none !important;
}

.compose-nav-wrapper {
  position: relative;
}

.hamburger-btn {
  position: fixed;
  top: 70px;
  left: 16px;
  z-index: 1001;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background-color: var(--color-primary);
  color: var(--color-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lime-glow);
  transition: var(--transition-fast);
}

.hamburger-btn:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
}

.hamburger-btn:focus {
  outline: 2px solid var(--color-positive);
  outline-offset: 2px;
}

.hamburger-icon {
  font-size: 24px;
  line-height: 1;
}

/* Menu Overlay */
.nav-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1002;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-menu-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Slide-out Menu */
.nav-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  max-width: 85vw;
  height: 100%;
  background-color: var(--color-elevated);
  z-index: 1003;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
}

.nav-menu.is-open {
  transform: translateX(0);
}

.nav-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background-color: var(--color-surface);
  border-bottom: var(--border);
  color: var(--color-text);
}

.nav-menu-title {
  font-size: 1.25rem;
  font-weight: bold;
}

.nav-menu-close {
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-normal);
}

.nav-menu-close:hover {
  background-color: var(--color-card-hover);
  color: var(--color-text);
}

.nav-menu-close:focus {
  outline: 2px solid var(--color-positive);
  outline-offset: -2px;
}

.nav-menu-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  flex: 1;
  overflow-y: auto;
}

.nav-menu-item {
  display: flex;
  align-items: center;
  padding: var(--space-lg) 20px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 14px;
  transition: background-color var(--transition-fast);
  min-height: 48px;
}

.nav-menu-item:hover {
  background-color: var(--color-card-hover);
  color: var(--color-primary);
}

.nav-menu-item:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
  background-color: var(--color-card-hover);
}

.nav-menu-item--active {
  background-color: var(--color-lime-08);
  color: var(--color-primary);
  font-weight: var(--weight-semibold);
  border-left: 4px solid var(--color-primary);
  padding-left: 16px;
}


.nav-menu-divider {
  border-top: var(--border);
  margin: var(--space-sm) 0;
}

/* Compose Content Area */
.compose-content {
  padding-left: 0;
  transition: padding-left 0.3s ease;
}

/* Body scroll lock when menu is open */
body.nav-menu-open {
  overflow: hidden;
}

/* =============================================================================
   8. Canvas Page
   ============================================================================= */

/* Canvas section */
.block-card {
  border: none;
  border-left: 2px solid var(--color-border);
  border-radius: 0;
  overflow: visible;
  margin-bottom: var(--space-lg);
  background-color: var(--color-surface);
}

/* Station sections — lime left border for distinction */
.block-card.station-rotation-block {
  border-left: 2px solid var(--color-primary);
}

/* Section header — uppercase, heavy bottom border */
.block-card .block-header {
  background-color: transparent !important;
  color: var(--color-text-secondary) !important;
  padding: var(--space-sm) var(--space-md);
  border-bottom: var(--border-heavy);
}

.block-card .block-header strong {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

/* Section body — tight drill list */
.block-card .block-body {
  padding: var(--space-md);
}

/* Canvas drill items — tight rows */
.block-card .drill-item {
  padding: var(--space-sm) 0;
  margin-bottom: 0;
  border: none;
  border-bottom: var(--border);
  border-radius: 0;
  background-color: transparent;
  transition: background-color var(--transition-fast);
}

.block-card .drill-item:last-child {
  border-bottom: none;
}

.block-card .drill-item:hover {
  background-color: var(--color-card-hover);
}

/* Canvas drill time values — numeric font */
.canvas-time {
  font-family: var(--font-numeric);
  font-size: 13px;
  font-weight: var(--weight-regular);
  letter-spacing: 0.02em;
  color: var(--color-primary);
}

/* Section header buttons */
.block-card .block-header .btn-outline-light {
  color: var(--color-text-secondary);
  border-color: var(--color-border);
  background-color: transparent;
}

.block-card .block-header .btn-outline-light:hover {
  background-color: var(--color-card-hover);
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

.block-card .block-header .btn-outline-light:disabled {
  color: var(--color-border);
  border-color: var(--color-border);
  opacity: 0.5;
}

/* Drag handles — hover-only on desktop, always on mobile */
.canvas-reorder {
  opacity: 1;
}

.canvas-reorder .btn {
  color: var(--color-text-secondary);
  border-color: var(--color-border);
  font-size: 12px;
  padding: 1px 4px;
  line-height: 1;
}

.canvas-reorder .btn:hover {
  color: var(--color-text);
  background-color: var(--color-bg);
}

@media (min-width: 768px) {
  .canvas-reorder {
    opacity: 0;
    transition: opacity var(--transition-fast);
  }

  .drill-item:hover .canvas-reorder,
  .block-header:hover .canvas-reorder {
    opacity: 1;
  }
}

.timeline {
  position: relative;
}

.sticky-top {
  position: sticky;
}

/* Setup notes input — inline between block header and drills */
.setup-notes-section {
  padding: 0 var(--space-md);
}

.setup-notes-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  color: var(--color-text-secondary);
  padding: 4px 0;
  outline: none;
  font-style: italic;
}

.setup-notes-input:focus,
.setup-notes-input.focused {
  border-bottom: 2px solid var(--color-primary);
  font-style: normal;
  color: var(--color-text);
}

.setup-notes-input::placeholder {
  color: var(--color-text-faint);
  font-style: italic;
}

.setup-notes-form {
  margin: 0;
}

/* Station grid layout */
.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-sm);
}

/* Station items — primary left border within the grid */
.station-item {
  border-left: 2px solid var(--color-primary) !important;
  border-bottom: var(--border) !important;
  border-radius: 0 !important;
  background: var(--color-card);
  padding: var(--space-sm) var(--space-md) !important;
}

.station-item:hover {
  background: var(--color-card-hover);
}

/* Fix: Station item header text overlay/collision */
.station-item .d-flex.align-items-center.mb-1 {
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  row-gap: 0.375rem;
}

.station-item strong {
  word-break: break-word;
  min-width: 0;
  flex: 1 1 auto;
}

.station-item .btn-link {
  flex-shrink: 0;
}

/* Fix: Block header text overlay in station mode */
.station-rotation-block .block-header > .d-flex {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.station-rotation-block .block-header > .d-flex > .d-flex:first-child {
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  min-width: 0;
}

.station-rotation-block .block-header .badge {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Station rotation details row */
.station-details {
  font-size: 12px;
  color: var(--color-text-secondary);
  padding-top: var(--space-xs);
  margin-top: var(--space-xs);
  border-top: var(--border);
}

/* Duration banner — text-only, no progress bar */
.duration-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: var(--border-heavy);
  box-shadow: none;
  background-color: var(--color-surface);
  padding: var(--space-sm) 0;
}

/* Setup notes section */
.setup-notes-section {
  background-color: var(--color-bg);
  border-top: var(--border);
  padding: var(--space-sm) var(--space-md);
}

/* Canvas sidebar — text-only validation, no progress bars */
.canvas-validation-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xs) 0;
  border-bottom: var(--border);
}

.canvas-validation-row:last-child {
  border-bottom: none;
}

.canvas-validation-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
}

.canvas-validation-value {
  font-family: var(--font-numeric);
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* Intention/Why collapse */
.canvas-intention {
  background-color: var(--color-bg);
  border-left: 2px solid var(--color-positive);
  padding: var(--space-xs) var(--space-sm);
  margin-top: var(--space-sm);
  border-radius: 0;
}

/* Structure nudges — design system aligned */
.structure-nudge {
  font-size: 13px;
  background-color: var(--color-surface);
  border: var(--border);
  border-left: 2px solid var(--color-warning);
  border-radius: var(--radius-sm);
}

/* =============================================================================
   9. Runner Page - Timer-First Layout
   ============================================================================= */

.runner-container {
  max-width: 600px;
  margin: 0 auto;
}

/* Drill context line (drill name + "Drill X of Y") */
.runner-drill-context {
  font-size: 1rem;
  margin-top: 0.25rem;
}

.runner-drill-name {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
}

/* Practice-wide remaining (secondary, small muted text) */
.runner-practice-remaining {
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

/* Sentiment: two horizontal buttons */
.runner-sentiment-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1rem 0 0;
}

.runner-sentiment-btn {
  min-width: 100px;
  min-height: 70px;
  font-size: 2rem !important;
  border-radius: var(--radius-md);
}

/* Skip link below sentiment buttons */
.runner-skip-link {
  font-size: 0.9rem;
}

/* Sentiment label ("How's this drill going?") */
.runner-sentiment-label {
  font-size: 0.85rem;
}

/* Two-step feedback: selected thumb highlight */
.runner-sentiment-btn.is-selected {
  transform: scale(1.1);
  border: var(--border-active);
}

/* Two-step feedback: dimmed/hidden unselected thumb */
.runner-sentiment-btn.is-dimmed {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Confirmation message below thumbs */
.runner-confirm-message {
  font-size: 14px;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

/* Cancel link: generous tap target */
.runner-cancel-link {
  font-size: 14px;
  padding: var(--space-sm) var(--space-lg);
  min-height: 44px;
  color: var(--color-text-secondary);
  text-decoration: underline;
}

/* Controls row at bottom */
.runner-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: var(--border);
}

/* Transition cue: subtle amber border when drill is ~2 min from planned end */
.drill-card-transition-soon {
  border-color: var(--color-warning) !important;
  border-width: 2px !important;
}

/* Progressive emphasis for Next preview */
.next-preview-emphasis {
  background-color: var(--color-bg) !important;
  border-color: var(--color-text-secondary) !important;
}

.next-preview-emphasis .next-label {
  font-weight: 600 !important;
  color: var(--color-text) !important;
}

/* =============================================================================
   10. Glossary Page
   ============================================================================= */

/* Active state for glossary list items - override Bootstrap default */
.list-group-item-action.active {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}

/* =============================================================================
   11. Station Cards - Print Styles
   ============================================================================= */

@media print {
  .no-print {
    display: none !important;
  }

  .station-card {
    page-break-after: always;
    page-break-inside: avoid;
  }

  .station-card .card {
    border: 2px solid var(--color-primary) !important;
    box-shadow: none !important;
  }
}

.station-card {
  margin-bottom: 2rem;
}

.equipment-list,
.coaching-cues-list {
  list-style-type: none;
  padding-left: 0;
}

.equipment-list li:before {
  content: "✓ ";
  color: var(--color-positive);
  font-weight: bold;
  margin-right: 5px;
}

.coaching-cues-list li {
  margin-bottom: 0.5rem;
}

.rotation-info {
  background-color: var(--color-bg);
  border-left: 2px solid var(--color-warning);
  padding: var(--space-md);
  margin-top: var(--space-md);
}

.safety-notes {
  background-color: var(--color-bg);
  border-left: 2px solid var(--color-danger);
  padding: var(--space-md);
  margin-top: var(--space-md);
}

/* =============================================================================
   12. Drills Browser Page - Lineup-Card List and Composition
   ============================================================================= */

/* Quick-add card styling */
#quick-add-container summary::-webkit-details-marker {
  display: none;
}

#quick-add-container summary::before {
  content: "▶ ";
  font-size: 0.8em;
  transition: transform var(--transition-normal);
}

#quick-add-container details[open] summary::before {
  content: "▼ ";
}

/* Sticky practice panel wrapper */
.practice-panel-sticky {
  position: sticky;
  top: 20px;
  z-index: 100;
}

/* Clickable composition blocks */
.composition-block {
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  transition: border-color var(--transition-fast);
  position: relative;
}

.composition-block:hover {
  background-color: var(--color-card-hover);
  border-color: var(--color-border);
}

.composition-block:focus {
  outline: none;
  border-color: var(--color-positive);
}

/* Active block state */
.composition-block.is-active {
  background-color: var(--color-card-hover);
  border-color: var(--color-positive);
}

.composition-block.is-active .block-name {
  color: var(--color-positive-hover);
}

/* Active block indicator arrow */
.composition-block.is-active::before {
  content: "▶";
  position: absolute;
  left: -16px;
  color: var(--color-positive);
  font-size: 0.75rem;
}

/* Empty block nudge */
.composition-block.is-empty.is-nudge {
  background-color: var(--color-card);
  border-color: var(--color-border);
}

.composition-block.is-empty.is-nudge .block-name {
  font-weight: 600;
  color: var(--color-text);
}

.composition-block.is-empty.is-nudge .block-empty-hint {
  color: var(--color-text-secondary);
  font-style: normal;
}

/* Empty block default state */
.composition-block.is-empty {
  opacity: 0.85;
}

.composition-block.is-empty:hover {
  opacity: 1;
}

/* Block drills list styling when active */
.composition-block.is-active .block-drills {
  border-left-color: var(--color-positive) !important;
}

/* --- Station Slot: Per-station assignment UI --- */

.station-slots {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding-left: var(--space-sm);
  margin-top: var(--space-xs);
}

.station-slot {
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

/* Empty station slot — dashed border, muted text */
.station-slot-empty {
  border: 1px dashed var(--color-border);
  color: var(--color-text-secondary);
}

/* Filled station slot — solid border */
.station-slot-filled {
  border: 1px solid var(--color-border);
  background-color: var(--color-lime-08);
  color: var(--color-text);
}

/* Active target slot — during tap-to-place, lime border */
.station-slot-empty.station-slot-active {
  border: 2px solid var(--color-primary);
  cursor: pointer;
  background-color: var(--color-lime-04);
}

.station-slot-empty.station-slot-active:hover {
  background-color: var(--color-lime-08);
}

/* Selected station slot — coach clicked this specific slot in sidebar */
.station-slot-empty.station-slot-selected {
  border: 2px solid var(--color-primary);
  background-color: var(--color-lime-15);
  font-weight: var(--weight-semibold);
}

/* Station slot remove button — always visible ✕ */
.station-slot-remove {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0 var(--space-xs);
  font-size: 0.8rem;
  line-height: 1;
  transition: color var(--transition-fast);
}

.station-slot-remove:hover {
  color: var(--color-danger);
}

/* Station header with checkmark when all filled */
.station-block-header .station-complete-check {
  color: var(--color-positive);
  font-weight: 600;
}

/* Drill selected state — during tap-to-place, left border accent */
.drill-list-item.is-selected {
  border-left: 2px solid var(--color-primary);
  background-color: var(--color-lime-08);
}

/* Tap-to-place banner */
.tap-to-place-banner {
  font-size: 0.75rem;
  color: var(--color-primary);
  font-weight: 500;
  padding: var(--space-xs) var(--space-sm);
  text-align: center;
  background-color: var(--color-lime-08);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-sm);
  display: none;
}

.tap-to-place-banner.is-visible {
  display: block;
}

/* Non-station add-more slot */
.add-more-slot {
  border: 1px dashed var(--color-border);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  font-style: italic;
  margin-top: var(--space-xs);
}

/* --- Drill List: Vertical lineup-card pattern --- */

.drill-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drill-list-item {
  padding: var(--space-sm) var(--space-md);
  border: var(--border-subtle);
  border-left: 2px solid transparent;
  border-radius: 14px;
  background-color: var(--color-card);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.drill-list-item:hover {
  border-color: var(--color-lime-20);
  transform: translateY(-1px);
  box-shadow: var(--shadow-subtle);
}

/* Selected/added drill — left border accent + lime tint */
.drill-list-item.is-in-practice {
  border-left: 3px solid var(--color-primary);
  background-color: var(--color-lime-04);
}

/* Drill row line 1: name + duration + tag + action */
.drill-row-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  min-height: 20px;
}

.drill-row-name {
  flex: 1;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.drill-row-name a {
  color: inherit;
  text-decoration: none;
}

.drill-row-name a:hover {
  text-decoration: underline;
}

.drill-row-duration {
  font-family: var(--font-numeric);
  font-size: 12px;
  font-weight: var(--weight-regular);
  letter-spacing: 0.02em;
  color: var(--color-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Drill row line 2: description */
.drill-row-description {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  line-height: 1.3;
}

/* Drill row action button — compact, right-aligned */
.drill-row-action {
  flex-shrink: 0;
  margin-left: var(--space-xs);
}

/* Collapsible drill list items — expand/collapse behavior */
.drill-list-item .drill-expanded-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.25s ease-out;
}

.drill-list-item.is-expanded .drill-expanded-content {
  max-height: 800px;
  opacity: 1;
  transition: max-height 0.3s ease-in, opacity 0.25s ease-in;
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: var(--border);
}

/* Expand indicator */
.drill-row-expand {
  color: var(--color-text-secondary);
  font-size: 12px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  display: inline-block;
}

.drill-list-item.is-expanded .drill-row-expand {
  transform: rotate(180deg);
}

/* Hide description when expanded (full description shown in expanded area) */
.drill-list-item.is-expanded .drill-row-description {
  display: none;
}

/* Buttons should not trigger card expansion */
.drill-add-btn,
.drill-link-btn,
.drill-bookmark-btn {
  position: relative;
  z-index: 10;
}

/* Expanded state badges */
.drill-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

/* Coaching preview in expanded state */
.coaching-preview {
  border-left: 2px solid var(--color-positive);
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--color-surface);
  border-radius: 0;
  font-size: 13px;
}

/* Expanded footer actions */
.drill-expanded-actions {
  padding-top: var(--space-sm);
  border-top: var(--border);
  margin-top: var(--space-sm);
}

/* Nav tabs styling */
.nav-tabs {
  border-bottom-color: var(--color-border);
}

.nav-tabs .nav-link {
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 14px;
  padding: var(--space-sm) var(--space-md);
}

.nav-tabs .nav-link.active {
  color: var(--color-primary);
  font-weight: var(--weight-semibold);
  background-color: var(--color-card);
  border-color: var(--color-border) var(--color-border) var(--color-card);
}

/* Over time warnings */
.over-time-warning {
  background-color: var(--color-bg);
  border-color: var(--color-warning);
}

.over-time-danger {
  background-color: var(--color-bg);
  border-color: var(--color-danger);
}

/* Drill browser sidebar card styling */
.drill-sidebar .card-footer {
  background-color: var(--color-surface);
  border-top: var(--border);
}

/* Practice tracker duration text */
.practice-duration-text {
  font-family: var(--font-numeric);
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* =============================================================================
   13. Micro-Feedback Widget
   ============================================================================= */

.micro-feedback-widget {
  display: inline-block;
}

.micro-feedback-widget .btn-group .btn {
  padding: 0.25rem 0.5rem;
  font-size: 1rem;
}

.micro-feedback-thanks {
  color: var(--color-text-secondary);
  font-size: 12px;
}

/* =============================================================================
   14. Responsive Overrides
   ============================================================================= */

/* Hamburger menu responsive adjustments */
@media (max-width: 576px) {
  .hamburger-btn {
    top: 65px;
    left: 12px;
    width: 44px;
    height: 44px;
  }

  .hamburger-icon {
    font-size: 22px;
  }

  .nav-menu {
    width: 260px;
  }

  /* Station rotation mobile adjustments */
  .station-rotation-block .block-header > .d-flex {
    flex-direction: column;
    align-items: flex-start !important;
  }

  .station-rotation-block .block-header > .d-flex > .d-flex:last-child {
    margin-top: 0.5rem;
  }

  /* Drill list mobile adjustments */
  .drill-list-item {
    padding: var(--space-sm);
  }

  .drill-row-name {
    font-size: 13px;
  }

  /* Larger tap target for add button on mobile */
  .drill-add-btn {
    padding: 6px 10px;
    min-height: 36px;
  }
}

@media (max-width: 768px) {
  .duration-banner .progress {
    width: 120px !important;
  }

  .structure-nudge {
    flex-direction: column;
    align-items: flex-start !important;
  }

  .structure-nudge .nudge-actions {
    margin-top: 0.5rem;
    margin-left: 0 !important;
  }
}

/* On larger screens, menu button moves out of content flow */
@media (min-width: 992px) {
  .hamburger-btn {
    top: 75px;
    left: 20px;
  }
}

/* Desktop: drill list adjustments */
@media (min-width: 768px) {
  .drill-list-item {
    padding: var(--space-sm) var(--space-md);
  }
}

/* =============================================================================
   15. Mobile Sticky CTA (Dashboard)
   ============================================================================= */

.mobile-cta-bar {
  z-index: 1000;
  box-shadow: var(--shadow-subtle);
}

/* Ensure content doesn't get hidden behind sticky bar */
.dashboard-content-with-sticky-cta {
  padding-bottom: 80px;
}

@media (min-width: 768px) {
  .dashboard-content-with-sticky-cta {
    padding-bottom: 0;
  }
}

/* =============================================================================
   16. Touch Target Utility
   Minimum 44px per Apple HIG / Material Design guidelines
   ============================================================================= */

.touch-target {
  min-width: 44px;
  min-height: 44px;
}

/* =============================================================================
   17. Runner Timer Row
   ============================================================================= */

.runner-timer-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.runner-timer-display {
  font-family: var(--font-numeric);
  font-size: var(--text-timer-lg);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums; /* Prevents layout shift as digits change */
  line-height: 1.1;
  color: var(--color-primary);
}

/* =============================================================================
   18. Runner Overtime State & Notifications
   ============================================================================= */

.runner-timer-overtime {
  color: var(--color-warning);
}

.runner-overtime-message {
  color: var(--color-primary);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Time-up flash animation: brief scale + color pulse (~1.5s) */
@keyframes timerFlash {
  0%   { transform: scale(1);    color: var(--color-warning); }
  15%  { transform: scale(1.12); color: var(--color-danger); }
  30%  { transform: scale(1);    color: var(--color-warning); }
  50%  { transform: scale(1.08); color: var(--color-danger); }
  70%  { transform: scale(1);    color: var(--color-warning); }
  100% { transform: scale(1);    color: var(--color-warning); }
}

.runner-timer-flash {
  animation: timerFlash 1.5s ease-out;
}

/* =============================================================================
   19. Start Page Progressive Disclosure
   ============================================================================= */

/* Customize toggle button */
.customize-toggle {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color var(--transition-normal);
}

.customize-toggle:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

.customize-toggle:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Arrow rotation indicator */
.customize-arrow {
  display: inline-block;
  font-size: 0.75rem;
  transition: transform var(--transition-normal);
}

/* Duration output styling */
#duration-output {
  color: var(--color-primary);
}

/* =============================================================================
   20. Structure Page HTMX Reorder
   ============================================================================= */

/* Structure block reorder buttons */
.structure-block .btn-group-vertical .touch-target {
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensure touch targets meet minimum size */
.structure-block .touch-target {
  min-width: 44px;
  min-height: 44px;
}

/* Remove button touch target */
.structure-block .btn-outline-danger.touch-target {
  padding: 0.5rem 0.75rem;
  font-size: 1.25rem;
  line-height: 1;
}

/* ===================================================================
   Diagnostic Flow Styles (modal + standalone)
   =================================================================== */

.diag-container { max-width: 480px; margin: 0 auto; padding: 16px 0; }

.diag-heading {
  font-family: var(--font-display);
  font-size: 20px; font-weight: var(--weight-bold); color: var(--color-text);
  letter-spacing: var(--tracking-tight); line-height: 1.2; margin-bottom: 4px;
}
.diag-subtitle {
  font-family: var(--font-ui);
  font-size: 13px; color: var(--color-text-secondary); margin-bottom: 16px;
}
.diag-question {
  font-family: var(--font-display);
  font-size: 16px; font-weight: var(--weight-semibold); color: var(--color-text);
  line-height: 1.2; margin-bottom: 4px; white-space: pre-line;
}
.diag-question-subtitle {
  font-family: var(--font-ui);
  font-size: 13px; color: var(--color-text-secondary); margin-bottom: 12px;
}
.diag-option {
  display: block; width: 100%; text-align: left;
  background: var(--color-card); color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-bottom: 8px;
  font-family: var(--font-ui);
  font-size: 14px; font-weight: var(--weight-regular); line-height: 1.4;
  cursor: pointer; transition: border-color var(--transition-fast);
}
.diag-option:hover {
  border-color: var(--color-primary); color: var(--color-text);
  background: var(--color-card-hover);
}
.diag-back {
  display: inline-block; margin-top: 8px;
  font-family: var(--font-ui);
  font-size: 13px; color: var(--color-text-secondary); text-decoration: none;
  cursor: pointer; border: none; background: none; padding: 0;
}
.diag-back:hover { color: var(--color-primary); }

/* Result card */
.diag-result-card {
  background: var(--color-card); border: 2px solid var(--color-primary);
  border-radius: var(--radius-md); padding: 14px; margin-bottom: 16px;
}
.diag-result-tag {
  font-family: var(--font-numeric);
  font-size: 11px; font-weight: var(--weight-semibold); color: var(--color-text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px;
}
.diag-result-name {
  font-family: var(--font-display);
  font-size: 18px; font-weight: var(--weight-bold); color: var(--color-primary);
  margin-bottom: 12px; line-height: 1.2;
}
.diag-section-label {
  font-family: var(--font-numeric);
  font-size: 11px; font-weight: var(--weight-semibold); color: var(--color-text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px;
}
.diag-section-text {
  font-family: var(--font-ui);
  font-size: 13px; color: var(--color-text); line-height: 1.4;
}
.diag-meta-row { display: flex; gap: 16px; }
.diag-meta-label {
  font-family: var(--font-numeric);
  font-size: 10px; font-weight: var(--weight-semibold); color: var(--color-text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.diag-meta-value {
  font-family: var(--font-numeric);
  font-size: 13px; font-weight: var(--weight-semibold);
}
.diag-meta-value.common { color: var(--color-warning); }
.diag-meta-value.fixable-yes { color: var(--color-positive); }
.diag-meta-value.fixable-partially { color: var(--color-warning); }
.diag-meta-value.fixable-no { color: var(--color-danger); }

/* Diagnostic buttons */
.diag-btn-primary {
  display: block; width: 100%;
  background: var(--color-primary); color: var(--color-bg);
  border: none; border-radius: var(--radius-md);
  padding: 10px 14px; margin-bottom: 8px;
  font-family: var(--font-ui);
  font-size: 13px; font-weight: var(--weight-medium);
  text-transform: uppercase; letter-spacing: 0.04em;
  cursor: pointer; text-align: center; text-decoration: none;
}
.diag-btn-primary:hover { background: var(--color-primary-hover); color: var(--color-bg); box-shadow: var(--shadow-lime-glow); }
.diag-btn-primary:disabled {
  background: var(--color-border); border-color: var(--color-border);
  color: var(--color-text-muted); cursor: not-allowed;
}
.diag-btn-secondary {
  display: block; width: 100%;
  background: transparent; color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 10px 14px; margin-bottom: 8px;
  font-family: var(--font-ui);
  font-size: 13px; font-weight: var(--weight-medium);
  text-transform: uppercase; letter-spacing: 0.04em;
  cursor: pointer; text-align: center;
}
.diag-btn-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); }
.diag-btn-ghost {
  display: block; width: 100%; text-align: center;
  background: transparent; color: var(--color-text-secondary);
  border: none; padding: 8px 14px;
  font-family: var(--font-ui);
  font-size: 13px; cursor: pointer;
}
.diag-btn-ghost:hover { color: var(--color-primary); }

.diag-block-select {
  width: 100%; padding: 8px 12px; margin-bottom: 8px;
  font-family: var(--font-ui); font-size: 13px;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-card); color: var(--color-text);
}

.diag-confirm { color: var(--color-positive); font-size: 13px; font-weight: 600; padding: 8px 0; }
.diag-error { color: var(--color-danger); font-size: 13px; font-weight: 600; padding: 8px 0; }

/* ===================================================================
   Diagnostic Modal
   =================================================================== */

.modal-dialog-diagnostic {
  max-width: 580px;
}
.diagnostic-modal-header {
  background: var(--color-surface);
  padding: var(--space-md) var(--space-lg);
  border-bottom: var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.diagnostic-modal-close {
  background: none; border: none;
  color: var(--color-text-secondary); opacity: 0.7;
  font-size: 22px; line-height: 1; padding: 0;
  cursor: pointer;
}
.diagnostic-modal-close:hover { opacity: 1; color: var(--color-text); }

/* Modal backdrop override */
#diagnosticModal.modal.show ~ .modal-backdrop,
.modal-backdrop.show {
  background-color: #000;
  opacity: 0.7;
}

/* Modal content dark theme */
.modal-content {
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  color: var(--color-text);
}

.modal-header {
  border-bottom-color: var(--color-border);
}

.modal-footer {
  border-top-color: var(--color-border);
}

/* Mobile fullscreen */
@media (max-width: 576px) {
  .modal-dialog-diagnostic {
    max-width: 100%;
    margin: 0;
    min-height: 100vh;
  }
  .modal-dialog-diagnostic .modal-content {
    min-height: 100vh;
    border: none;
    border-radius: 0;
  }
  .diagnostic-modal-header {
    border-radius: 0;
  }
}

/* ===================================================================
   Find Drills Intercept (Step 3)
   =================================================================== */

.find-drills-intercept {
  max-width: 560px;
  margin: 0 auto;
  padding: var(--space-xl) 0;
  text-align: center;
}
.find-drills-heading {
  font-family: var(--font-display);
  font-size: 20px; font-weight: var(--weight-bold); color: var(--color-text);
  letter-spacing: var(--tracking-tight); line-height: 1.2;
  margin-bottom: var(--space-xl);
}
.find-drills-options {
  display: flex; gap: var(--space-lg);
  justify-content: center;
  margin-bottom: var(--space-lg);
}
.find-drills-option {
  flex: 1; max-width: 45%;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-xl) var(--space-lg);
  background: var(--color-card); color: var(--color-text);
  border: 2px solid var(--color-primary); border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 16px; font-weight: var(--weight-semibold);
  text-align: center; text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
}
.find-drills-option:hover {
  background: var(--color-primary); color: var(--color-bg);
  text-decoration: none;
  box-shadow: var(--shadow-lime-glow);
}
.find-drills-hint {
  font-family: var(--font-ui);
  font-size: 13px; color: var(--color-text-secondary);
  margin: 0;
}

/* Mobile: stack buttons */
@media (max-width: 576px) {
  .find-drills-options {
    flex-direction: column;
    align-items: center;
  }
  .find-drills-option {
    max-width: 100%; width: 100%;
  }
}

/* ===================================================================
   Star Button (Diagnostic Result Card)
   =================================================================== */

.diag-btn-star {
  display: block; width: 100%;
  background: transparent; color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 10px 14px; margin-bottom: 8px;
  font-family: var(--font-ui);
  font-size: 13px; font-weight: var(--weight-medium);
  text-transform: uppercase; letter-spacing: 0.04em;
  cursor: pointer; text-align: center;
}
.diag-btn-star:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.diag-btn-star--done {
  background: var(--color-primary); color: var(--color-bg);
  border-color: var(--color-primary);
  cursor: default;
}
.diag-btn-star--done:hover {
  background: var(--color-primary); color: var(--color-bg);
  border-color: var(--color-primary);
}

/* ===================================================================
   Starred Tab (Drill Browser)
   =================================================================== */

.starred-badge {
  font-family: var(--font-numeric);
  font-size: 11px;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0 6px;
}
.starred-unstar-btn {
  background: none; border: none;
  color: var(--color-text-secondary);
  font-size: 16px; line-height: 1;
  padding: 2px 6px; cursor: pointer;
  flex-shrink: 0;
}
.starred-unstar-btn:hover { color: var(--color-danger); }
.starred-empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  color: var(--color-text-secondary);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
}
.starred-empty-state p { margin-bottom: var(--space-sm); }
