/* ==========================================================
   Design System: Precision PCB / Laboratory Sheet
   ========================================================== */
:root {
  --bg: #F6F8F7;
  --surface: #FFFFFF;
  --surface-2: #EEF3F0;
  --border: #DDE5E1;
  --ink: #11221D;
  --muted: #4A6059;
  --primary: #0D7A5F;
  --primary-hover: #0A634D;
  --primary-soft: rgba(13, 122, 95, 0.10);
  --amber: #B45309;
  --amber-bg: #FEF3C7;
  --amber-border: #F59E0B;
  --danger: #B91C1C;
  --danger-bg: #FEE2E2;
  --shadow-sm: 0 1px 2px rgba(17, 34, 29, 0.05);
  --shadow-md: 0 8px 24px rgba(17, 34, 29, 0.06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-sans: 'Hind Siliguri', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-en: 'Plus Jakarta Sans', 'Hind Siliguri', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

html[data-theme="dark"] {
  --bg: #0C1412;
  --surface: #13201C;
  --surface-2: #192B26;
  --border: #223832;
  --ink: #EAF3F0;
  --muted: #93ACA4;
  --primary: #2DD4A8;
  --primary-hover: #53E0BA;
  --primary-soft: rgba(45, 212, 168, 0.12);
  --amber: #FBBF24;
  --amber-bg: rgba(251, 191, 36, 0.12);
  --amber-border: rgba(251, 191, 36, 0.45);
  --danger: #F87171;
  --danger-bg: rgba(248, 113, 113, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.4);
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 180ms ease, color 180ms ease;
}

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

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #ffffff;
  padding: 10px 16px;
  z-index: 1000;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 640px) {
  .container {
    padding-inline: 24px;
  }
}

/* ==========================================================
   Topbar
   ========================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding-block: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #06281F;
}

html[data-theme="light"] .brand-mark {
  color: #ffffff;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-weight: 700;
  font-size: 0.96rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-family: var(--font-en);
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.seg-control {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  gap: 2px;
}

.seg-btn {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  min-height: 34px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  transition: border-color 150ms ease, background-color 150ms ease;
}

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

html[data-theme="light"] .icon-sun {
  display: none;
}

html[data-theme="dark"] .icon-moon {
  display: none;
}

.theme-label {
  display: none;
}

@media (min-width: 520px) {
  .theme-label {
    display: inline;
  }
}

/* ==========================================================
   Hero & Live Countdown
   ========================================================== */
.hero {
  position: relative;
  padding-block: 28px 26px;
  border-bottom: 1px solid var(--border);
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 20px 20px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: stretch;
}

@media (min-width: 920px) {
  .hero {
    padding-block: 36px 32px;
  }
  .hero-grid {
    grid-template-columns: 1.25fr 0.95fr;
    gap: 28px;
  }
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.inst-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.hero-title {
  margin: 0 0 8px;
  font-size: clamp(1.55rem, 3.2vw, 2.25rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 1rem;
  max-width: 62ch;
}

.hero-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.meta-chip {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, background-color 150ms ease, border-color 150ms ease;
}

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

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

html[data-theme="dark"] .btn-primary {
  color: #06281F;
}

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

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

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

.btn-ghost {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--border);
  background: var(--surface);
}

/* Countdown Panel */
.countdown-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.countdown-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.countdown-kicker {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--primary);
}

.countdown-tz {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
}

.cd-subject-title {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
}

.cd-subject-meta {
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 2px;
}

.cd-timer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.cd-unit {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 6px;
  text-align: center;
}

.cd-num {
  display: block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-weight: 700;
  line-height: 1.15;
}

.cd-lbl {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 2px;
}

.progress-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.prog-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 5px;
}

.prog-row strong {
  color: var(--ink);
  font-family: var(--font-mono);
}

.prog-track {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.prog-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 260ms ease;
}

.prog-fill.is-prep {
  background: var(--amber);
}

/* ==========================================================
   Main Content Stack
   ========================================================== */
.main-stack {
  padding-block: 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Early Shift Alert Banner */
.alert-banner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--amber-bg);
  border: 1.5px solid var(--amber-border);
}

@media (min-width: 720px) {
  .alert-banner {
    flex-direction: row;
    align-items: center;
  }
}

.alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--amber-border);
  color: #111827;
}

.alert-body {
  flex: 1;
}

.alert-body strong {
  display: block;
  color: var(--amber);
  font-size: 1rem;
  margin-bottom: 2px;
}

.alert-body p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink);
}

.alert-cta {
  align-self: flex-start;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--amber-border);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

@media (min-width: 720px) {
  .alert-cta {
    align-self: center;
  }
}

/* ==========================================================
   Study-Gap Timeline Strip
   ========================================================== */
.timeline-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.leg-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.dot-normal {
  background: var(--primary);
}

.dot-early {
  background: var(--amber);
}

.dot-gap {
  border: 1.5px dashed var(--muted);
}

.timeline-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(84px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

@media (min-width: 960px) {
  .timeline-strip {
    grid-template-columns: repeat(10, 1fr);
    overflow-x: visible;
  }
}

.tl-day {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 76px;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-align: left;
  transition: border-color 150ms ease, transform 150ms ease;
}

.tl-day.is-exam {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  cursor: pointer;
}

.tl-day.is-exam:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.tl-day.is-early {
  background: var(--amber-bg);
  border-color: var(--amber-border);
}

.tl-day.is-gap {
  background: transparent;
  border-style: dashed;
  opacity: 0.85;
}

.tl-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.tl-weekday {
  font-size: 0.72rem;
  color: var(--muted);
}

.tl-code {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 6px;
}

.tl-day.is-early .tl-code {
  color: var(--amber);
}

.tl-gap-tag {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 6px;
}

/* ==========================================================
   Toolbar: Filters, Search & View Toggle
   ========================================================== */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 820px) {
  .toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  min-height: 38px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
}

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

html[data-theme="dark"] .pill-btn.is-active {
  color: #06281F;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding-inline: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  min-width: 220px;
}

.search-box:focus-within {
  border-color: var(--primary);
}

.search-box svg {
  color: var(--muted);
  flex-shrink: 0;
}

.search-box input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
}

.view-toggle {
  display: none;
}

@media (min-width: 760px) {
  .view-toggle {
    display: inline-flex;
  }
}

/* ==========================================================
   Routine Cards Grid
   ========================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 740px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.exam-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.exam-card.is-early {
  border-color: var(--amber-border);
  box-shadow: 0 0 0 1px var(--amber-border);
}

.exam-card.is-highlighted {
  animation: card-flash 1.4s ease;
}

@keyframes card-flash {
  0%, 100% {
    box-shadow: 0 0 0 1px var(--amber-border);
  }
  40% {
    box-shadow: 0 0 0 4px var(--amber-border);
  }
}

.exam-card.is-completed {
  opacity: 0.78;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.date-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.date-cal {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.exam-card.is-early .date-cal {
  background: var(--amber-bg);
  border-color: var(--amber-border);
}

.date-cal-day {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.05;
}

.date-cal-mon {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.date-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.weekday-str {
  font-weight: 700;
  font-size: 0.96rem;
}

.time-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
}

.time-badge.is-early {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

.status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}

.status-pill.is-next {
  background: var(--primary-soft);
  color: var(--primary);
}

.status-pill.is-live {
  background: var(--amber-bg);
  color: var(--amber);
}

.subject-area {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.subject-code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 6px;
}

.gap-chip {
  font-size: 0.78rem;
  color: var(--muted);
}

.subject-bn {
  margin: 2px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
}

.subject-en {
  margin: 0;
  font-family: var(--font-en);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
}

.shared-line {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Prep Checklist inside Card */
.prep-box {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.prep-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prep-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.prep-check input {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
}

.prep-check.is-checked {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  color: var(--ink);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

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

.mini-btn.is-done {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

/* ==========================================================
   Table View
   ========================================================== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.routine-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.routine-table th,
.routine-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.routine-table th {
  background: var(--surface-2);
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--muted);
}

.routine-table tr:last-child td {
  border-bottom: 0;
}

.routine-table tr.is-early-row {
  background: var(--amber-bg);
}

.table-code {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
}

.table-sub-en {
  display: block;
  font-family: var(--font-en);
  font-size: 0.82rem;
  color: var(--muted);
}

/* ==========================================================
   States (Loading, Error, Empty)
   ========================================================== */
.skeleton-card {
  height: 220px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

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

.state-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px 20px;
  text-align: center;
}

.state-box h3 {
  margin: 0 0 6px;
}

.state-box p {
  margin: 0 0 16px;
  color: var(--muted);
}

/* ==========================================================
   Footer & Toast
   ========================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: 22px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 720px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-strong {
  margin: 0;
  font-weight: 700;
  font-size: 0.92rem;
}

.footer-muted {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.84rem;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 60;
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

/* Print-only elements hidden on screen */
.print-only-header,
.print-only-signature {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================
   Print / PDF A4 Layout
   ========================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 14mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .topbar,
  .hero,
  .timeline-section,
  .toolbar,
  #cards-container,
  #loading-state,
  #error-state,
  #empty-state,
  .alert-cta,
  .no-print,
  .site-footer,
  .toast {
    display: none !important;
  }

  .print-only-header {
    display: block !important;
    text-align: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #000000;
  }

  .print-only-header h1 {
    font-size: 16pt;
    margin: 2px 0;
  }

  .print-only-header h2 {
    font-size: 12pt;
    margin: 2px 0 4px;
  }

  .print-gov,
  .print-memo {
    margin: 0;
    font-size: 9.5pt;
  }

  .alert-banner {
    display: flex !important;
    background: #FEF3C7 !important;
    border: 1.5px solid #B45309 !important;
    margin-bottom: 14px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  #table-container {
    display: block !important;
    border: 1px solid #000000 !important;
    border-radius: 0 !important;
  }

  .routine-table th,
  .routine-table td {
    border: 1px solid #333333 !important;
    padding: 8px 10px;
    color: #000000 !important;
  }

  .routine-table tr.is-early-row {
    background: #FEF3C7 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-only-signature {
    display: flex !important;
    justify-content: flex-end;
    margin-top: 34px;
    text-align: center;
    font-size: 10pt;
  }

  .print-only-signature p {
    margin: 2px 0;
  }
}
