/* ═══════════════════════════════════════════
   Design System
═══════════════════════════════════════════ */
:root {
  --primary: #1e293b;
  --primary-light: #334155;
  --primary-dim: rgba(30, 41, 59, 0.04);
  --accent: #10b981;
  --accent-light: #34d399;
  --accent-dim: rgba(16, 185, 129, 0.1);
  --cream: #f8fafc;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --border: rgba(0, 0, 0, 0.06);
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --green: #10b981;
  --green-dim: rgba(16, 185, 129, 0.1);
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.1);
  --red: #ef4444;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  --radius: 20px;
  --radius-sm: 12px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════
   Navbar
═══════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-top: 2px solid #000000;
  border-bottom: 2px solid #000000;
  box-shadow: none;
}

/* Force Newspaper Style for Navbar even with global SaaS variables */
.navbar .nav-btn,
.navbar .nav-logo {
  border-radius: 0 !important;
  text-transform: uppercase;
  font-weight: 900;
}

.nav-inner {
  max-width: 100%;
  margin: 0;
  padding: 0;
  height: 62px; /* Set to match border thickness precisely */
  display: flex;
  align-items: stretch;
}

.nav-logo {
  display: flex;
  align-items: center;
  padding: 0 32px;
  text-decoration: none;
  color: #000000;
  font-weight: 900;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border-right: 2px solid #000000;
  background: #ffffff;
}

.nav-date-wrapper {
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-right: 1px solid #000000;
  cursor: pointer;
  transition: background 0.1s ease;
  position: relative;
  background: #ffffff;
}

.nav-date-wrapper:hover {
  background: #f0f0f0;
}

.calendar-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 42px;
  background: #000000;
  color: #ffffff;
  border-radius: 4px;
  margin-right: 12px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: 1px solid #000;
}

.calendar-tab-month {
  background: #ef4444; /* Small red header like a physical calendar */
  width: 100%;
  font-size: 0.55rem;
  font-weight: 900;
  text-align: center;
  padding: 2px 0;
  text-transform: uppercase;
}

.calendar-tab-day {
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
  padding: 4px 0;
  flex: 1;
  display: flex;
  align-items: center;
}

.nav-date-info {
  display: flex;
  flex-direction: column;
}

.nav-date-dayname {
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #000000;
}

.nav-date-full {
  font-size: 0.65rem;
  font-weight: 500;
  color: #666666;
}

.nav-debt-widget {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding: 0 20px;
  border-left: 2px solid #000;
  cursor: help;
  position: relative;
  min-width: 100px;
}

.debt-lbs {
  font-weight: 900;
  font-size: 1rem;
  line-height: 1;
}

.debt-lbs.surplus {
  color: #dc2626;
}

.debt-lbs.deficit {
  color: #16a34a;
}

.debt-since {
  font-size: 0.55rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #666;
  margin-top: 2px;
  letter-spacing: 0.05em;
}

.nav-debt-widget:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  right: 10px;
  background: #000;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  width: 220px;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  margin-top: 10px;
}

#navDatePicker {
  position: absolute;
  top: 100%;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.nav-links {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1;
}

.nav-btn {
  background: transparent;
  border: none;
  border-right: 1px solid #000000;
  color: #000000;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 0 32px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  transition: all 0.1s ease;
  border-radius: 0;
}

.nav-btn:hover {
  background: #f0f0f0;
}

.nav-btn.active {
  background: #000000;
  color: #ffffff;
}

.nav-btn.active::after {
  display: none;
}

/* ═══════════════════════════════════════════
   Layout
═══════════════════════════════════════════ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 120px;
}

.page {
  display: none;
}

.page.active {
  display: block;
  min-height: calc(100vh - 66px);
  margin-top: 0 !important;
  padding: 0 !important;
}

/* ═══════════════════════════════════════════
   Newspaper Bulletin Header
   ═══════════════════════════════════════════ */
.news-headline-bulletin {
  grid-column: 1 / -1; /* Spans full width across sidebars */
  grid-row: 1;
  padding: 32px 0;
  margin-bottom: 24px;
  border-top: 3px solid #000;
  border-bottom: 3px solid #000;
  text-align: center;
  background: #ffffff;
}

.bulletin-eyebrow {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #000000;
  margin-bottom: 8px;
}

.bulletin-text {
  font-family: inherit; /* Maybe swap to serif if available */
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  color: #000000;
  line-height: 0.95;
  margin: 12px 0;
}

.bulletin-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #000;
  padding-top: 8px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #000;
}

/* ═══════════════════════════════════════════
   Health GPA Hero Card
   ═══════════════════════════════════════════ */
.gpa-hero-card {
  background: white;
  border: 1px solid #000;
  padding: 40px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  position: relative;
  overflow: hidden;
}

.gpa-hero-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(circle at 2px 2px, rgba(0,0,0,0.03) 1px, transparent 0);
  background-size: 24px 24px;
  pointer-events: none;
}

.gpa-container {
  display: flex;
  flex-direction: column;
  border-right: 2px solid #000;
}

.gpa-label {
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0.2em;
  color: var(--text-3);
  text-transform: uppercase;
}

.gpa-number {
  font-family: inherit; /* Maybe swap to Serif */
  font-size: 6rem;
  font-weight: 900;
  line-height: 1;
  color: #000;
  margin: 10px 0;
}

.gpa-trend {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--green);
}

.gpa-trend.down {
  color: var(--red);
}

.gpa-stats-grid {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.gpa-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-grade {
  font-family: serif;
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 8px;
  color: #000;
}

.stat-label {
  font-size: 0.55rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.gpa-major-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #000;
  color: #fff;
  padding: 4px 12px;
  font-size: 0.65rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 4px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

/* Splash Page */
.splash-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  text-align: center;
  padding: 24px;
}

.splash-content {
  max-width: 480px;
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.splash-logo {
  font-size: 5rem;
  margin-bottom: 24px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

.splash-page h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.splash-page p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 40px;
  line-height: 1.5;
}

.splash-footer {
  margin-top: 60px;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* User Profile in Nav */
.user-profile {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0 24px;
  background: #ffffff;
  margin-left: auto;
  border-left: 2px solid #000000;
}

#userAvatar {
  width: 32px;
  height: 32px;
  border-radius: 0;
  border: 1px solid #000000;
  object-fit: cover;
}

.user-profile:hover {
  background: #f0f0f0;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 12px;
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  width: 240px;
  padding: 16px;
  display: none;
  z-index: 200;
  color: var(--text);
  border: 1px solid var(--border);
}

.user-dropdown.active {
  display: block;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-info {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

#userName {
  font-weight: 700;
  font-size: 0.95rem;
}

#userEmail {
  font-size: 0.75rem;
  color: var(--text-3);
}

.user-dropdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

.user-dropdown button {
  width: 100%;
  padding: 10px;
  background: var(--surface2);
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  color: var(--red);
}

.user-dropdown button:hover {
  background: #fff5f5;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-header h2 {
  font-size: 1.2rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-hint {
  font-size: 0.8rem;
  color: var(--text-3);
}

.card-date {
  font-size: 0.8rem;
  color: var(--text-3);
  font-weight: 500;
}

/* ═══════════════════════════════════════════
   Dashboard Hero
═══════════════════════════════════════════ */
.dashboard-hero {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  margin-top: 10px; /* Reduced from 32px since we added the bulletin */
  margin-bottom: 20px;
}

.dash-row-full {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

.full-width-card {
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .dash-row-full {
    grid-template-columns: 1fr;
  }
}

/* Calorie Ring */
.calorie-ring-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ring-label-top {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ring-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring-wrap canvas {
  position: absolute;
  top: 0;
  left: 0;
}

.ring-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.goal-edit-btn {
  background: var(--primary-dim);
  border: none;
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.goal-edit-btn:hover {
  background: var(--primary);
  color: white;
}

.ring-number {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--primary);
}

/* Stats Column */
.stats-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.hero-lower-row {
  display: flex;
  gap: 20px;
  height: 100%;
}

.mini-stat {
  padding: 12px 16px !important;
  text-align: center;
  flex-direction: column !important;
  justify-content: center;
  gap: 4px !important;
}

.stat-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: #fff;
}

.stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-lbl {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
}

.btn-link {
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(80, 0, 0, 0.3);
  transition: var(--transition);
}

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

.accountability-body {
  padding: 24px 0;
  text-align: center;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#weightResult {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}

#weightDelta {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 20px;
}

#projectionStats {
  display: flex;
  justify-content: center;
  gap: 16px;
  background: var(--primary-dim);
  padding: 12px 20px;
  border-radius: 16px;
  width: fit-content;
}

.p-stat {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.4;
}

.p-stat strong {
  display: block;
  font-size: 0.95rem;
  color: var(--primary);
}

.accountability-controls {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

.accountability-controls .form-group {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.accountability-controls label {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.05em;
  margin-bottom: 0;
  display: inline-block;
}


/* Macro Summary Card */
.macro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
}

.macro-card {
  padding: 24px !important;
}

.macro-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.macro-icon {
  font-size: 1.2rem;
  padding: 8px;
  background: var(--surface2);
  border-radius: 12px;
}

.macro-label {
  font-weight: 800;
  font-size: 1.1rem;
}

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

.macro-main {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.macro-sub {
  font-size: 0.85rem;
  color: var(--text-3);
  margin-top: 4px;
}

.macro-ring-container {
  width: 70px;
  height: 70px;
}

.circular-chart {
  width: 100%;
  height: 100%;
}

.circle-bg {
  stroke: var(--primary-dim);
  fill: none;
  stroke-width: 3.5;
}

.circle {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: var(--transition);
}

.percentage {
  fill: var(--text);
  font-family: inherit;
  font-size: 0.6em;
  text-anchor: middle;
  font-weight: 950;
}

.circular-chart.primary .circle {
  stroke: var(--primary);
}

.circular-chart.amber .circle {
  stroke: var(--amber);
}

.circular-chart.green .circle {
  stroke: var(--green);
}

.macro-lbl {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-top: 2px;
}

/* Chart */
.chart-card {
  margin-bottom: 20px;
}

.chart-container,
.chart-wrap {
  height: 250px;
  position: relative;
  width: 100%;
}

.chart-empty-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  text-align: center;
  color: var(--text-2);
  pointer-events: none;
  border-radius: var(--radius-sm);
}

.chart-empty-overlay p {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin: 0;
  color: var(--text);
}

.chart-empty-overlay small {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 4px;
}

.chart-empty-overlay .empty-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  filter: grayscale(1);
  opacity: 0.5;
}

/* Bottom Row */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
}

/* Meals list */
.meals-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meal-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
}

.meal-entry:hover {
  border-color: rgba(80, 0, 0, 0.2);
}

.meal-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  background: var(--surface2);
}

.meal-entry-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meal-entry-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.meal-entry-meta {
  font-size: 0.78rem;
  color: var(--text-3);
}

.meal-entry-macros {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 4px;
}

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

.meal-cal-badge {
  background: var(--primary-dim);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.meal-delete-btn {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.4;
  transition: var(--transition);
  padding: 2px 4px;
}

.meal-delete-btn:hover {
  opacity: 1;
  color: var(--red);
}

.meal-entry-items {
  display: none;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.8;
}

.meal-entry.expanded .meal-entry-items {
  display: block;
}

/* Shortcuts */
.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.shortcut-item:hover {
  border-color: rgba(80, 0, 0, 0.3);
  background: var(--primary-dim);
}

.shortcut-name {
  font-size: 0.88rem;
  font-weight: 600;
}

.shortcut-cal {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 2px;
}

.shortcut-actions {
  display: flex;
  gap: 6px;
}

.shortcut-log-btn {
  background: var(--primary);
  color: white;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

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

.shortcut-del-btn {
  background: none;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.shortcut-del-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ═══════════════════════════════════════════
   Menu Page
═══════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 180px;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
}

.filter-select,
.filter-date {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--surface2);
  color: var(--text);
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.filter-select:focus,
.filter-date:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(80, 0, 0, 0.1);
}

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

.period-pill {
  flex: 1;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  color: var(--text-2);
}

.period-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.period-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 600;
}

.filter-go {
  align-self: flex-end;
  white-space: nowrap;
  flex: 0;
}

/* Loading */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  gap: 20px;
  color: var(--text-2);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-state p {
  font-size: 0.95rem;
}

.loading-state .loading-big {
  font-size: 2.5rem;
}

.loading-state .loading-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

/* Station block */
.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.menu-header h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.menu-header .btn-ghost {
  opacity: 0.5;
  transition: var(--transition);
}

.menu-header .btn-ghost:hover {
  opacity: 1;
  background: var(--primary-dim);
  color: var(--primary);
}

.station-block {
  margin-bottom: 40px;
}

.station-block {
  margin-bottom: 50px;
}

.menu-intro {
  margin-top: 2rem;
}

.force-refresh-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  border: 1px solid var(--border) !important;
  color: var(--text-3) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.force-refresh-btn:hover {
  background: var(--primary-dim) !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
  transform: rotate(180deg);
  box-shadow: 0 0 0 4px var(--primary-dim);
}

.force-refresh-btn:active {
  transform: rotate(360deg) scale(0.9);
}

.station-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.station-name {
  font-size: 1.8rem;
  font-weight: 950;
  text-transform: uppercase;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}

.station-wait-pill {
  background: var(--primary-dim);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.wait-reporter-inline {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.reporter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
}

.reporter-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.wait-label-mini {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--primary);
}

.wait-slider-mini {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 100px;
  outline: none;
}

.wait-slider-mini::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
}

/* Menu item card */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

/* Spotlight Styles */
.spotlight-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text-2);
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 8px 16px;
  border-radius: 100px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.spotlight-btn i {
  color: var(--text-3);
  transition: color 0.3s;
}

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

.spotlight-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(80, 0, 0, 0.25);
}

.spotlight-btn.active i {
  color: var(--amber);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(1); filter: drop-shadow(0 0 0px #fff); }
  50% { transform: scale(1.2); filter: drop-shadow(0 0 5px var(--amber)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0px #fff); }
}

.menu-item.spotlight-highlight {
  border: 2px solid var(--green);
  background: linear-gradient(to bottom right, #ffffff, #f0fdf4);
  transform: scale(1.02);
  z-index: 10;
}

.menu-item.spotlight-dim {
  opacity: 0.45;
  filter: grayscale(0.8);
  transform: scale(0.96);
}

.menu-item.spotlight-dim-soft {
  opacity: 0.7;
  filter: grayscale(0.3);
}

.menu-item.spotlight-modifier {
  border: 1px dashed var(--green);
  background: rgba(16, 185, 129, 0.02);
}

.menu-item.spotlight-dim:hover {
  opacity: 1;
  filter: grayscale(0);
  transform: scale(1);
}

.station-dimmed {
  opacity: 0.7;
}

.spotlight-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 950;
  letter-spacing: 0.05em;
  z-index: 20;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 4px;
}

.spotlight-badge.recommend {
  background: var(--green);
  color: white;
}

.spotlight-badge.modifier {
  background: white;
  color: var(--green);
  border: 1px solid var(--green);
}

.spotlight-badge.heavy {
  background: var(--text-2);
  color: white;
}

/* GPA Specific item badges */
.item-gpa-badge {
  font-family: serif;
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--text);
  margin-left: auto;
  min-width: 32px;
  text-align: right;
}

.grade-A { color: var(--green); }
.grade-B { color: #059669; }
.grade-C { color: var(--amber); }
.grade-D { color: #b45309; }
.grade-F { color: var(--red); }

.menu-item {
  max-width: 380px; /* Prevent awkward stretching if items are few */
  width: 100%;
  background: #ffffff;
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.menu-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
  border-color: var(--primary);
}

.menu-item.selected {
  background: #f8fafc;
  border: 2px solid var(--primary);
  box-shadow: 0 10px 15px -3px rgba(80, 0, 0, 0.1);
}

.menu-item.selected::after {
  content: '✓';
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 900;
  box-shadow: 0 0 10px rgba(80, 0, 0, 0.3);
  z-index: 30;
}

.item-flags {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.flag-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  line-height: 1.2;
}

.flag-red {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.flag-green {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.flag-purple {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.item-serving-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  visibility: hidden;
  opacity: 0;
  transition: var(--transition);
  transform: translateY(5px);
  gap: 16px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  padding: 4px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

.increment-toggle {
  display: flex;
  background: var(--surface2);
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--border);
  gap: 2px;
}

.inc-btn {
  background: transparent;
  border: none;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-3);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.inc-btn:hover {
  color: var(--primary);
  background: rgba(80, 0, 0, 0.05);
}

.inc-btn.active {
  background: var(--primary);
  color: white;
}

.menu-item.selected .item-serving-controls {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.step-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #f1f5f9;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  transition: all 0.2s ease;
}

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

.serving-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 24px;
  text-align: center;
  background: transparent;
  border: none;
  outline: none;
  width: 32px;
  padding: 0;
  font-family: inherit;
}

/* Hide number spinners */
.serving-val::-webkit-inner-spin-button,
.serving-val::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.serving-val {
  -moz-appearance: textfield;
  appearance: textfield;
}

.item-name {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.02em;
}

.menu-item.selected .item-name,
.menu-item.selected .item-cal {
  color: var(--text);
}

.item-cal {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.05em;
  line-height: 1;
}

.item-macros-preview {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.item-macro {
  flex: 1;
  background: var(--surface2);
  padding: 6px 4px;
  border-radius: 8px;
  font-size: 0.7rem;
  text-align: center;
  color: var(--text-2);
}

.item-macro strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text);
}

.menu-item.selected .item-macro {
  background: rgba(255, 255, 255, 0.5);
}

.item-cal-unit {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-3);
  margin-left: 2px;
}

.item-portion {
  font-size: 0.72rem;
  color: var(--text-3);
}

.badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-VG {
  background: #d1fae5;
  color: #065f46;
}

.badge-V {
  background: #fef3c7;
  color: #92400e;
}

.badge-GF {
  background: #dbeafe;
  color: #1e40af;
}

.badge-PR {
  background: #ede9fe;
  color: #5b21b6;
}

.badge-CF {
  background: #d1fae5;
  color: #065f46;
}

/* Log bar */
.log-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: calc(100% - 48px);
  max-width: 700px;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(16px);
  }
}

.log-bar-inner {
  background: rgba(26, 26, 26, 0.75);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: white;
  border-radius: 24px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
}

.macro-val {
  font-size: 0.85rem;
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.macro-val strong {
  font-size: 1rem;
}

.macro-divider {
  opacity: 0.2;
  margin: 0 4px;
}

.log-bar-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.log-bar-info span {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.9;
  white-space: nowrap;
}

.log-cal-badge {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-bar-actions {
  display: flex;
  gap: 10px;
}

.log-goal-pct {
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  flex-shrink: 0;
  width: 120px;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* Station Navigation Controls */
.station-nav-controls {
  position: fixed;
  bottom: 100px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 60;
}

.station-nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(80, 0, 0, 0.4);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  font-size: 1.2rem;
}

.station-nav-btn:hover {
  transform: translateY(-5px) scale(1.1);
  background: var(--primary-light);
  box-shadow: 0 8px 25px rgba(80, 0, 0, 0.5);
}

.station-nav-btn:active {
  transform: scale(0.95);
}

@media (max-width: 768px) {
  .station-nav-controls {
    bottom: 120px; /* Higher on mobile to avoid log bar overlap */
    right: 16px;
  }
  .station-nav-btn {
    width: 42px;
    height: 42px;
  }
}

/* ═══════════════════════════════════════════
   Buttons
═══════════════════════════════════════════ */
.btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

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

.btn-success {
  background: var(--green);
  color: white;
}

.btn-success:hover {
  filter: brightness(1.1);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.22);
}

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

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

/* ═══════════════════════════════════════════
   Modals
═══════════════════════════════════════════ */

/* ── Auth Splash ────────────────────────────── */

#page-login {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top right, #6a0000, #3a0000);
  overflow: hidden;
}

#page-login.active {
  display: flex;
}

.auth-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3rem 2.5rem;
  border-radius: 32px;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.6);
  max-width: 420px;
  width: 90%;
  text-align: center;
  animation: authEntry 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  color: white;
}

@keyframes authEntry {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.auth-logo-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.2));
}

.auth-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  background: linear-gradient(to bottom, #ffffff, #dcdcdc);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

.auth-btn-wrapper {
  display: flex;
  justify-content: center;
  min-height: 50px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: none;
  place-items: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s;
}

.modal-backdrop.open {
  display: grid;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: calc(100% - 48px);
  max-width: 520px;
  animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-sm {
  max-width: 380px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
}

.form-input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--surface2);
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(80, 0, 0, 0.1);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-3);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  cursor: pointer;
}

.checkbox-row input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* Log summary in modal */
.log-summary {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.85rem;
  line-height: 1.8;
  border: 1px solid var(--border);
}

.log-summary-total {
  font-weight: 800;
  color: var(--primary);
  font-size: 1rem;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════
   Empty state
═══════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 16px;
  text-align: center;
}

.empty-icon {
  font-size: 2rem;
}

.empty-state p {
  font-size: 0.88rem;
  color: var(--text-3);
  max-width: 240px;
}

/* ═══════════════════════════════════════════
   Toast
═══════════════════════════════════════════ */
.toast {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: white;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 16px 28px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  display: none;
  min-width: 320px;
  max-width: 500px;
  text-align: center;
  border-top: 4px solid var(--primary);
  animation: toastPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  display: block;
}

@keyframes toastPop {
  from {
    opacity: 0;
    transform: translate(-50%, -30px);
  }
}

/* ═══════════════════════════════════════════
   Responsive
═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .stats-col {
    flex-direction: row;
  }

  .stat-card {
    flex: 1;
  }

  .bottom-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 20px 16px 100px;
  }

  .stats-col {
    flex-direction: column;
  }

  .filter-bar {
    flex-direction: column;
    gap: 12px;
  }

  .filter-go {
    width: 100%;
    justify-content: center;
  }
}

.scraping-container {
  max-width: 400px;
  margin: 40px auto;
  padding: 30px;
  background: var(--surface);
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border);
}

.scraping-step {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.scraping-step-text {
  font-size: 0.95rem;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.scraping-step-label {
  font-size: 0.75rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.scraping-indicator {
  width: 100%;
  height: 4px;
  background: rgba(80, 0, 0, 0.05);
  border-radius: 2px;
  margin: 20px 0;
  overflow: hidden;
  position: relative;
}

.scraping-indicator::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  animation: scrape-slide 2s infinite ease-in-out;
}

@keyframes scrape-slide {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

@keyframes pulse-step {
  0% {
    opacity: 0.8;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.02);
  }

  100% {
    opacity: 0.8;
    transform: scale(1);
  }
}

/* ═══════════════════════════════════════════
   Badges & Macros
═══════════════════════════════════════════ */
.item-badges {
  display: flex;
  gap: 4px;
  margin: 4px 0 8px;
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  display: inline-block;
}

.badge-VG {
  background: #dcfce7;
  color: #166534;
}

.badge-V {
  background: #fef9c3;
  color: #854d0e;
}

.badge-GF {
  background: #fee2e2;
  color: #991b1b;
}

.badge-PR {
  background: #dbeafe;
  color: #1e40af;
}

.macro-goal-label {
  font-size: 0.7rem;
  color: var(--text-3);
  margin-top: 4px;
}

.macro-progress {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 0;
}

.macro-progress-bar {
  height: 100%;
  transition: width 1s ease-out;
}

.macro-progress-bar.protein {
  background: var(--primary);
}

.macro-progress-bar.fat {
  background: var(--amber);
}

.macro-progress-bar.carb {
  background: var(--green);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: 90%;
  max-width: 450px;
  background: white;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 15px 20px;
  background: var(--surface2);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-3);
}

.analytics-card {
  grid-column: span 2;
  margin-top: 20px;
  position: relative;
}

@media (max-width: 768px) {
  .analytics-card {
    grid-column: span 1;
  }
}

/* ═══════════════════════════════════════════
   Tradeoff Timeline (Day Optimizer)
   ═══════════════════════════════════════════ */
.tradeoff-card {
  margin-top: 20px;
}
.tradeoff-container {
  padding: 10px 0 20px;
}
.bucket-track {
  display: flex;
  width: 100%;
  height: 48px;
  background: var(--surface2);
  border-radius: 24px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.1);
  overflow: hidden;
  align-items: stretch;
}
.bucket-fill {
  height: 100%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: white;
  font-weight: 800;
  font-size: 0.9rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.bucket-fill.breakfast { background: var(--primary); }
.bucket-fill.lunch { background: var(--green); }
.bucket-fill.dinner { background: var(--amber); }
.bucket-fill.snack { background: var(--purple, #8b5cf6); }

.bucket-remaining {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 16px;
  color: var(--text-2);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.tradeoff-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.tradeoff-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-2);
}
.tradeoff-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}

/* Shortcuts Styling */
.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface);
}

.shortcut-item:hover {
  border-color: var(--primary);
  background: var(--primary-dim);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.shortcut-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.shortcut-meta {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 2px;
}

.shortcut-action {
  color: var(--primary);
  font-size: 0.8rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--primary);
  border-radius: 50%;
}

/* ═══════════════════════════════════════════
   Add Tracker & Dashboard Expansion
   ═══════════════════════════════════════════ */
.add-tracker-card {
  border: 2px dashed var(--border) !important;
  background: var(--surface2) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-align: center;
  min-height: 180px;
  transition: var(--transition);
  box-shadow: none !important;
}

.add-tracker-card:hover {
  border-color: var(--primary) !important;
  background: var(--primary-dim) !important;
  transform: translateY(-4px);
}

.add-tracker-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.add-icon {
  font-size: 2.2rem;
  color: var(--primary);
  opacity: 0.4;
  transition: var(--transition);
}

.add-tracker-card:hover .add-icon {
  opacity: 1;
  transform: scale(1.1);
}

.add-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tracker-option-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}

.tracker-option-btn:hover {
  border-color: var(--primary);
  background: var(--primary-dim);
  transform: translateX(4px);
}

.option-icon {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border-radius: 12px;
}

.option-info {
  display: flex;
  flex-direction: column;
}

.option-label {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

.option-desc {
  font-size: 0.75rem;
  color: var(--text-3);
}

/* Smart Advisor Styling */
.smart-advisor {
  animation: fadeIn 0.4s ease-out;
}

#advisorSuggestion strong {
  color: var(--primary);
  font-weight: 800;
}

/* Dynamic Card Header Controls */
.macro-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.macro-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.macro-remove-btn {
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  opacity: 0;
  transition: var(--transition);
}

.dynamic-card:hover .macro-remove-btn {
  opacity: 1;
}

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

/* ═══════════════════════════════════════════
   Wait Time UI & Menu Styling
═══════════════════════════════════════════ */
#menuContent h3 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0.5rem 0 1.5rem;
  color: var(--text-3);
  opacity: 0.8;
  display: block;
}


.wait-time-container {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 2rem;
  padding: 1.5rem !important;
  border: 1px solid var(--border);
  background: white;
  border-radius: var(--radius);
  /* Explicitly override display: none when JS calls it */
}

.wait-time-status {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.wait-time-icon {
  font-size: 1.8rem;
  color: var(--primary);
  background: var(--primary-dim);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.wait-time-info {
  display: flex;
  flex-direction: column;
}

.wait-time-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 2px;
}

.wait-time-value {
  font-size: 2rem;
  font-weight: 950;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.wait-time-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-3);
  font-weight: 600;
}

.wait-time-reporter {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

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

#waitSliderText {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
}

/* Custom Range Input */
#waitTimeSlider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  outline: none;
  margin: 8px 0;
}

#waitTimeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 4px solid white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.8rem;
  border-radius: 8px;
}
.wait-reporter-inline {
  padding: 12px 16px !important;
  margin-bottom: 12px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: none !important;
}

.reporter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  width: 100%;
}

.reporter-label {
  font-size: 0.85rem;
  color: var(--text-2);
  font-weight: 500;
}

.reporter-label strong {
  color: var(--text);
  font-weight: 700;
}

.reporter-btn {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  padding: 4px 10px;
  border: 1.5px solid var(--primary);
  opacity: 0.8;
  transition: all 0.2s ease;
}

.reporter-btn:hover {
  opacity: 1;
  background: var(--primary);
  color: white;
}

.reporter-controls {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  animation: slideDownFade 0.3s ease-out;
}

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

.wait-slider-mini {
  width: 100%;
  margin: 12px 0;
  accent-color: var(--primary);
}

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

.wait-label-mini {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
}

/* ═══════════════════════════════════════════
   Newspaper Edge Columns Styling
   ═══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Old+Standard+TT:ital,wght@0,400;0,700;1,400&display=swap');

.news-clipping {
  border-bottom: 0.5px solid #000;
  padding-bottom: 20px;
  font-family: 'Old Standard TT', serif;
  animation: slideDownFade 0.5s ease forwards;
}

.clipping-header {
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
  border-bottom: 2px solid #000;
  display: inline-block;
  padding-bottom: 2px;
}

.clipping-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 12px;
  text-transform: none;
  letter-spacing: -0.02em;
}

.clipping-text {
  font-size: 0.85rem;
  line-height: 1.4;
  color: #222;
  text-align: justify;
}

.clipping-footer {
  font-size: 0.65rem;
  margin-top: 12px;
  font-style: italic;
  opacity: 0.6;
}

.clipping-list {
  padding-left: 1.2rem;
  font-size: 0.85rem;
  line-height: 1.6;
}

.score-row {
  display: flex;
  justify-content: space-between;
  font-weight: 900;
  font-size: 1.1rem;
  border-top: 1px solid #000;
  padding-top: 4px;
}

.clipping-pushed {
  border-bottom: none;
}

/* Container Adjustments for Newspaper Layout */
.newspaper-layout {
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  grid-template-rows: auto 1fr;
  min-height: calc(100vh - 66px);
  background: #ffffff; /* White sheet for sidebars */
  width: 100%;
  border-bottom: 2px solid #000;
  margin-top: -2px !important;
  padding: 0 !important;
  border-top: 1px solid #000;
}

@media (max-width: 1400px) {
  .newspaper-layout {
    grid-template-columns: 260px 1fr 260px;
  }
}

@media (max-width: 1250px) {
  .newspaper-layout {
    grid-template-columns: 1fr; /* Stacked layout or center only */
  }
}

.newspaper-sidebar {
  width: 300px;
  background: transparent; /* Inherit from white parent layout */
  flex-shrink: 0;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 5;
  height: auto;
  margin: 0;
  padding-top: 0;
}

.newspaper-sidebar.left {
  border-left: none;
  grid-column: 1;
  grid-row: 2;
}

.newspaper-sidebar.right {
  grid-column: 3;
  grid-row: 2;
  border-right: none;
}

@media (max-width: 1250px) {
    /* Sidebars hidden, everything stacks on column 1 */
    .newspaper-sidebar.left, .newspaper-sidebar.right {
        display: none;
    }
}

.newspaper-column {
  position: sticky;
  top: 66px; /* Offset to precisely sit below navbar border */
  padding: 0 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.newspaper-column::-webkit-scrollbar {
  width: 0;
}

.newspaper-layout .container {
  grid-column: 2;
  grid-row: 2;
  flex: 1;
  min-width: 0;
  max-width: none;
  padding: 0 40px 120px;
  background: var(--cream); /* Dashboard grey center */
  border-left: 1px solid rgba(0,0,0,0.1);
  border-right: 1px solid rgba(0,0,0,0.1);
}

@media (max-width: 1250px) {
    .newspaper-layout .container {
        grid-column: 1 / -1;
    }
}

.meals-card.full-width-card {
    margin-top: 32px; /* Push the first card down, borders stay flush */
}

@media (max-width: 1250px) {
  .newspaper-sidebar {
    display: none;
  }
}

.newspaper-sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.02;
  pointer-events: none;
  background-image: url("https://www.transparenttextures.com/patterns/natural-paper.png");
}

#newspaper-photo, #newspaper-caption {
  transition: opacity 0.5s ease-in-out;
}


/* ═══════════════════════════════════════════
   Bulk Actions & Selection
═══════════════════════════════════════════ */
.header-left {
  display: flex;
  flex-direction: column;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.2s ease-out;
}

.bulk-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  padding: 4px 0 4px 10px;
}

.bulk-count-group {
    background: var(--primary-dim);
    display: flex;
    align-items: center;
    gap: 4px;
    border-radius: 100px;
    padding-right: 6px;
}

.meal-checkbox-wrapper {
  margin-right: 12px;
  display: flex;
  align-items: center;
}

.meal-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.aggregate-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.aggregate-stat-card {
  background: var(--surface2);
  padding: 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--border);
}

.aggregate-stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
}

.aggregate-stat-lbl {
  font-size: 0.75rem;
  color: var(--text-3);
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 4px;
}

.copy-container {
  position: relative;
  background: #1e293b;
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
}

.code-block {
  color: #f8fafc;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  margin: 0;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.1) !important;
  color: white !important;
  border: none !important;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Selection Feedback */
.meal-entry.selected {
  border: 2px solid var(--primary) !important;
  background: rgba(80, 0, 0, 0.07) !important;
}

.meal-entry.selected .meal-entry-header {
  background: var(--primary-dim);
}

.meal-entry-header-left {
    flex: 1;
    display: flex;
    align-items: center;
}



.bulk-clear-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
    padding: 2px 6px;
    display: flex;
    align-items: center;
    border-radius: 50%;
}

.bulk-clear-btn:hover {
    opacity: 1;
    background: rgba(80, 0, 0, 0.1);
}

/* ═══════════════════════════════════════════
   INSIGHT ENGINE — Causation-Style Widgets
═══════════════════════════════════════════ */

.insights-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.insight-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.insight-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.insight-card-wide {
    grid-column: 1 / -1;
}

.insight-eyebrow {
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.insight-badge {
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 6px 14px;
    border-radius: 100px;
    background: var(--surface2);
    color: var(--text-2);
    border: 1px solid var(--border);
    white-space: nowrap;
    transition: all 0.3s ease;
}

.insight-badge.danger {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.25);
}

.insight-body {
    margin-top: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insight-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.82rem;
    color: var(--text-2);
    line-height: 1.5;
    margin-top: auto;
}

.insight-callout i {
    color: var(--accent);
    font-size: 0.9rem;
    margin-top: 1px;
    flex-shrink: 0;
}

/* ── Danger Day Heatmap ─────────── */
.day-heatmap {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    height: 110px;
    padding: 0 4px;
}

.heatmap-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    height: 100%;
}

.heatmap-bar-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    min-height: 0;
}

.heatmap-bar {
    width: 100%;
    background: var(--primary-dim);
    border-radius: 6px 6px 0 0;
    min-height: 6px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(30, 41, 59, 0.1);
    overflow: hidden;
}

.heatmap-bar.danger {
    background: linear-gradient(180deg, #fca5a5 0%, #ef4444 100%);
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.25);
    animation: dangerPulse 2s ease-in-out infinite;
}

@keyframes dangerPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.2); }
    50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.45); }
}

.heatmap-skull {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
}

.heatmap-label {
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-3);
}

.heatmap-label.danger-label {
    color: #dc2626;
    font-weight: 900;
}

.heatmap-val {
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--text-3);
}

/* ── Meal Timing Bars ─────────── */
.timing-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timing-bar-row {
    display: grid;
    grid-template-columns: 110px 1fr 110px;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.timing-bar-row:hover {
    background: var(--surface2);
}

.timing-bar-row.timing-top {
    background: rgba(16, 185, 129, 0.04);
}

.timing-period-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-2);
}

.timing-emoji { font-size: 1.1rem; }

.timing-track {
    height: 8px;
    background: var(--surface2);
    border-radius: 100px;
    overflow: hidden;
}

.timing-fill {
    height: 100%;
    border-radius: 100px;
    background: var(--primary-dim);
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(30,41,59,0.1);
}

.timing-fill.top {
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-color: var(--accent);
}

.timing-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.timing-pct {
    font-size: 0.85rem;
    font-weight: 900;
    color: var(--text-2);
}

.timing-pct.top-pct {
    color: var(--accent);
}

.timing-cal {
    font-size: 0.65rem;
    color: var(--text-3);
}

/* ── Culprit Analysis ─────────── */
.culprit-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.culprit-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    transition: background 0.15s ease;
}

.culprit-row:hover { background: var(--surface2); }

.culprit-rank {
    font-size: 1.1rem;
    text-align: center;
}

.culprit-info {
    min-width: 0;
}

.culprit-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.culprit-bar-track {
    height: 5px;
    background: var(--surface2);
    border-radius: 100px;
    overflow: hidden;
}

.culprit-bar-fill {
    height: 100%;
    border-radius: 100px;
    background: rgba(30,41,59,0.15);
    transition: width 0.5s ease;
}

.culprit-bar-fill.top {
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.culprit-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 90px;
}

.culprit-pct {
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--text-2);
}

.culprit-pct.top-pct { color: #dc2626; }

.culprit-cal {
    font-size: 0.65rem;
    color: var(--text-3);
}

.culprit-avg {
    font-size: 0.6rem;
    color: var(--text-3);
    font-style: italic;
}

/* ── Macro-Cal Split Bars ─────── */
.macro-cal-split {
    border-top: 1px dashed var(--border);
    padding-top: 16px;
}

.split.msb-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-3);
    margin-bottom: 4px;
}

.msb-reason {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 12px;
    opacity: 0.9;
}

.split-bar-row {
    display: grid;
    grid-template-columns: 56px 1fr 38px;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.split-name {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.split-name.protein { color: var(--primary); }
.split-name.carbs   { color: var(--amber); }
.split-name.fat     { color: var(--green); }

.split-bar-track {
    height: 8px;
    background: var(--surface2);
    border-radius: 100px;
    overflow: hidden;
}

.split-bar-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.5s ease;
}

.split-bar-fill.protein { background: var(--primary); }
.split-bar-fill.carbs   { background: var(--amber); }
.split-bar-fill.fat     { background: var(--green); }

.split-pct {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-2);
    text-align: right;
}

@media (max-width: 900px) {
    .insights-section {
        grid-template-columns: 1fr;
    }
    .insight-card-wide {
        grid-column: auto;
    }
}

/* ─── Insight section layout restructure ─── */
.insights-section {
    display: flex !important;
    flex-direction: column;
    gap: 20px;
}

.insights-top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .insights-top-row { grid-template-columns: 1fr; }
}

.insight-heatmap-card {
    width: 100%;
    box-sizing: border-box;
}

/* ─── GitHub-style heatmap grid ─── */
.meal-heatmap-container {
    overflow-x: auto;
    padding-bottom: 4px;
}

.hm-grid-wrap {
    display: inline-flex;
    flex-direction: column;
    gap: var(--hm-gap, 3px);
    min-width: 100%;
}

.hm-header-row,
.hm-data-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--hm-gap, 3px);
}

.hm-row-lbl {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-3);
    text-align: right;
    padding-right: 10px;
    flex-shrink: 0;
    white-space: nowrap;
    min-width: var(--hm-label, 80px);
    width: var(--hm-label, 80px);
}

.hm-col-date {
    width: var(--hm-cell, 18px);
    min-width: var(--hm-cell, 18px);
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-3);
    text-align: center;
    line-height: 1;
    overflow: visible;
    white-space: nowrap;
}

.hm-col-today {
    color: var(--primary);
    font-weight: 900;
}

.hm-cell {
    width: var(--hm-cell, 18px);
    height: var(--hm-cell, 18px);
    min-width: var(--hm-cell, 18px);
    min-height: var(--hm-cell, 18px);
    border-radius: 3px;
    border: 1px solid transparent;
    cursor: default;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    flex-shrink: 0;
}

.hm-cell:hover {
    transform: scale(1.35);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    z-index: 10;
    position: relative;
}

.hm-cell-today {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

/* ─── Heatmap Legend ─── */
.hm-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    color: var(--text-3);
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

.hm-legend-label {
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.62rem;
}

.hm-legend-swatch {
    width: 13px;
    height: 13px;
    border-radius: 2px;
    border: 1px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
}

.hm-legend-sep {
    flex: 1;
    min-width: 16px;
}

.hm-legend-text {
    font-size: 0.68rem;
    color: var(--text-2);
    margin-right: 6px;
}

/* ─── Danger Meal Merged Divder ─── */
.danger-meal-divider {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.danger-meal-divider-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* Negotiator Panel */
.negotiator-panel {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 10px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    color: var(--text);
}

.negotiator-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
    background: var(--amber); /* Warning/Negotiator color */
}

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

.negotiator-title {
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--amber);
}

.negotiator-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.negotiator-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-2);
    background: var(--surface2);
    padding: 4px 10px;
    border-radius: 100px;
    font-weight: 600;
}

.negotiator-stat strong {
    color: var(--primary);
    font-weight: 800;
}

.negotiator-swap {
    background: var(--amber-dim);
    border: 1px dashed rgba(245, 158, 11, 0.3);
    padding: 12px;
    border-radius: margin-bottom;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    border-radius: 8px;
}

.negotiator-swap-text {
    font-weight: 700;
    font-size: 0.85rem;
    color: #92400e;
}

.negotiator-swap-btn {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.negotiator-swap-btn:hover {
    background: #d97706;
}

@keyframes slideUpNegotiator {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.negotiator-panel.show {
    animation: slideUpNegotiator 0.3s ease forwards;
}

/* ═══════════════════════════════════════════
   MIRROR PAGE — Dining Hall Twin
═══════════════════════════════════════════ */

/* Hero header */
.mirror-hero {
    text-align: center;
    padding: 52px 24px 36px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 36px;
}

.mirror-eyebrow {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-3);
    margin-bottom: 12px;
}

.mirror-title {
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--primary);
    margin-bottom: 10px;
    line-height: 1.1;
}

.mirror-subtitle {
    font-size: 1rem;
    color: var(--text-2);
    max-width: 560px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.mirror-period-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
}

/* Empty state */
.mirror-empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-2);
}

.mirror-empty-icon { font-size: 3.5rem; margin-bottom: 16px; }
.mirror-empty-state h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
}
.mirror-empty-state p { font-size: 0.9rem; max-width: 380px; margin: 0 auto; line-height: 1.5; }

/* Similarity banner */
.mirror-similarity-banner {
    background: var(--primary);
    border-radius: var(--radius);
    padding: 28px 36px;
    text-align: center;
    color: white;
    margin-bottom: 24px;
}

.msb-inner { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; max-width: 380px; }

.msb-pct {
    font-size: 3.2rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
}

.msb-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
    margin-bottom: 2px;
}

.msb-reason {
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 1; /* full opacity for better visibility */
    color: rgba(255, 255, 255, 0.95); /* make white against dark blue */
    margin-bottom: 12px;
    max-width: 380px;
    line-height: 1.4;
}

.msb-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 100px;
    overflow: hidden;
}

.msb-bar-fill {
    height: 100%;
    background: #10b981;
    border-radius: 100px;
    transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Comparison Card */
.mirror-comparison-card {
    padding: 0 !important;
    overflow: hidden;
    margin-bottom: 24px;
}

.mirror-header-row {
    display: grid;
    grid-template-columns: 1fr 160px 1fr;
    border-bottom: 2px solid var(--border);
}

.mirror-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 24px 24px;
    gap: 10px;
}

.mirror-player.you  { background: rgba(30,41,59,0.03); border-right: 1px solid var(--border); }
.mirror-player.twin { background: rgba(16,185,129,0.04); border-left: 1px solid var(--border); }

.mirror-player-badge {
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    padding: 3px 10px;
    border-radius: 100px;
}

.you-badge  { background: var(--primary); color: white; }
.twin-badge { background: var(--accent); color: white; border: 1px solid rgba(255,255,255,0.2); }

.mirror-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.mirror-player-name {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}

.mirror-player-logs {
    font-size: 0.72rem;
    color: var(--text-3);
    font-weight: 600;
}

/* Center column */
.mirror-center-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.mirror-vs-badge {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text-3); /* darker gray for better visibility on white */
    letter-spacing: 0.1em;
    opacity: 0.8;
}

/* Stat rows */
.mirror-stat-rows { padding: 8px 0; }

.mirror-stat-row {
    display: grid;
    grid-template-columns: 1fr 160px 1fr;
    align-items: center;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}

.mirror-stat-row:hover { background: var(--surface2); }
.mirror-stat-row:last-child { border-bottom: none; }

.mirror-stat-side {
    display: flex;
    align-items: center;
    gap: 12px;
}

.me-side   { flex-direction: row; justify-content: flex-end; }
.twin-side { flex-direction: row; }

.mirror-stat-val {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--primary);
    white-space: nowrap;
    min-width: 56px;
    text-align: right;
}

.twin-side .mirror-stat-val { text-align: left; }

.winner-val { color: #10b981 !important; }

.mirror-bar-track {
    flex: 1;
    height: 8px;
    background: var(--surface2);
    border-radius: 100px;
    overflow: hidden;
    min-width: 60px;
}

.mirror-bar-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.7s cubic-bezier(0.4,0,0.2,1);
}

.me-bar   { background: var(--primary); }
.twin-bar { background: var(--accent);  }

.winner-bar      { background: #10b981 !important; }
.winner-bar-twin { background: #10b981 !important; }

/* Center stat label */
.mirror-center-stat {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    text-align: center;
    line-height: 1.3;
}

/* Bottom insight row */
.mirror-insight-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 0;
}

@media (max-width: 768px) {
    .mirror-insight-row { grid-template-columns: 1fr; }
    .mirror-header-row  { grid-template-columns: 1fr 80px 1fr; }
    .mirror-title       { font-size: 1.8rem; }
    .mirror-stat-row    { padding: 12px 14px; }
}

/* Shared foods */
.mirror-shared-foods { display: flex; flex-direction: column; gap: 8px; }

.mirror-food-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface2);
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.mirror-food-chip:hover { background: var(--primary-dim); }

.mirror-food-num {
    font-size: 0.7rem;
    font-weight: 900;
    color: white;
    background: var(--primary);
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mirror-food-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
    flex: 1;
}

/* Outcome badges */
.mirror-outcome-badge {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    line-height: 1.5;
    font-weight: 600;
}

.outcome-warn    { background: rgba(239,68,68,0.08);   color: #b91c1c; border: 1px solid rgba(239,68,68,0.2); }
.outcome-good    { background: rgba(16,185,129,0.08);  color: #047857; border: 1px solid rgba(16,185,129,0.2); }
.outcome-neutral { background: rgba(245,158,11,0.08);  color: #92400e; border: 1px solid rgba(245,158,11,0.2); }

/* Email domain display */
.mirror-email-display {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 12px;
}

/* Instagram button */
.mirror-ig-btn {
    display: flex !important;
    align-items: center;
    gap: 8px;
    justify-content: center;
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045) !important;
    border: none !important;
    color: white !important;
    font-weight: 800;
    font-size: 0.88rem;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.mirror-ig-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Segmented Control for Modals */
.segmented-control {
  display: flex;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--border);
}

.segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.segment-btn:hover {
  color: var(--text);
  background: rgba(0,0,0,0.03);
}

.segment-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════
   Habit Simulator
═══════════════════════════════════════════ */
.simulator-card {
  overflow: hidden;
}

.simulator-body {
  display: flex;
  gap: 32px;
  min-height: 450px;
}

#simConsequenceNumber {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

#simConsequenceNumber .main-number {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.5rem;
  display: block;
}

#simConsequenceNumber .sub-text {
  font-size: 0.9rem;
  color: var(--text-3);
  font-weight: 600;
}

.sim-baseline-info {
  font-size: 0.75rem;
  color: var(--text-3);
  font-weight: 600;
  margin-bottom: -4px;
}

.sim-new-info {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-2);
  margin-top: 4px;
}

@keyframes flash-green {
  0% { background: transparent; }
  50% { background: rgba(16, 185, 129, 0.2); }
  100% { background: transparent; }
}

@keyframes flash-red {
  0% { background: transparent; }
  50% { background: rgba(239, 68, 68, 0.2); }
  100% { background: transparent; }
}

.flash-green {
  animation: flash-green 0.4s ease-out;
}

.flash-red {
  animation: flash-red 0.4s ease-out;
}

.simulator-chart-col {
  flex: 1;
  position: relative;
  min-height: 300px;
}

.simulator-sidebar {
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.sim-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sim-group label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-2);
  letter-spacing: 0.05em;
}

.sim-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sim-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
}

.sim-slider-row span {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 60px;
  text-align: right;
}

.sim-summary {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}

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

.sim-label {
  font-size: 0.75rem;
  color: var(--text-3);
  font-weight: 600;
}

.sim-val {
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
}

#simDelta {
  color: var(--green);
}

@media (max-width: 1000px) {
  .simulator-body {
    flex-direction: column;
  }
  .simulator-sidebar {
    width: 100%;
  }
}

.sim-pct-caption {
  font-size: 0.65rem;
  color: var(--text-3);
  font-weight: 600;
  margin-top: -4px;
  padding-left: 2px;
}

.tradeoff-card {
  transition: none; /* Avoid flickering during real-time updates */
}

.tradeoff-today-section .bucket-track {
  height: 40px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

/* ── Other Food Search ── */
.global-results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-item {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.result-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary) !important;
    background: var(--primary-dim) !important;
}

.result-info {
    flex: 1;
}

.result-name {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 2px;
    line-height: 1.3;
}

.result-brand {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-macros {
    text-align: right;
    min-width: 80px;
}

.result-macros .val {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}

.result-macros .lbl {
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text-3);
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════
   Shareable Report Card Styling
   ═══════════════════════════════════════════ */

.report-card-export {
  background: #fdfdfb; /* Academic cream paper */
  color: #1a1a1a;
  padding: 60px;
  width: 800px;
  min-height: 1000px;
  margin: 0 auto;
  box-shadow: 0 0 40px rgba(0,0,0,0.1);
  font-family: 'Inter', sans-serif;
  position: relative;
  border: 1px solid #e0e0e0;
}

.report-header {
  border-bottom: 2px solid #1a1a1a;
  padding-bottom: 25px;
  margin-bottom: 40px;
  text-align: center;
}

.uni-header {
  font-weight: 800;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: #500000; /* University maroon */
  margin-bottom: 10px;
}

.report-title {
  font-family: 'Playfair Display', serif;
  font-size: 3.2rem;
  margin: 0;
  color: #1a1a1a;
}

.report-meta {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 25px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.meta-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.meta-value {
  font-weight: 700;
  font-size: 0.95rem;
}

/* GPA Hero Section */
.gpa-hero-section {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 40px;
  background: white;
  border: 4px double #1a1a1a;
  margin-bottom: 50px;
  position: relative;
}

.gpa-seal {
  width: 100px;
  height: 100px;
  border: 2px solid #500000;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #500000;
}

.gpa-seal i {
  font-size: 2rem;
}

.seal-text {
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.gpa-display {
  text-align: center;
}

.gpa-val {
  font-family: 'Playfair Display', serif;
  font-size: 5rem;
  line-height: 1;
  font-weight: 900;
  color: #500000;
}

.gpa-sub {
  font-weight: 800;
  letter-spacing: 0.3em;
  font-size: 0.8rem;
  margin-top: 5px;
}

.gpa-trend-indicator {
  font-size: 0.8rem;
  font-weight: 700;
  color: #166534;
  margin-top: 10px;
}

.gpa-rank-box {
  text-align: center;
}

.rank-letter {
  font-size: 3rem;
  font-weight: 900;
  color: #1a1a1a;
}

.rank-status {
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  color: #666;
  text-transform: uppercase;
}

/* Grid Layout */
.report-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 50px;
}

.section-title {
  font-weight: 900;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1.5px solid #1a1a1a;
  padding-bottom: 8px;
  margin-bottom: 20px;
  color: #1a1a1a;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
}

.report-table th {
  text-align: left;
  font-size: 0.65rem;
  font-weight: 800;
  color: #666;
  padding: 10px 5px;
  border-bottom: 1px solid #eee;
}

.report-table td {
  padding: 15px 5px;
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 1px solid #eee;
}

.grade-pill {
  background: #eee;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 800;
}

.extra-credit-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.extra-item {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: rgba(22, 101, 52, 0.05);
  border-left: 4px solid #16a34a;
  font-size: 0.85rem;
}

.extra-name { font-weight: 700; }
.extra-points { font-weight: 800; color: #166534; }

.reflection-block {
  margin-top: 40px;
  padding: 25px;
  background: #f9f9f9;
  border: 1px solid #eee;
  font-style: italic;
}

.reflection-text {
  font-size: 1rem;
  line-height: 1.6;
  color: #333;
}

/* Side Column Ledger */
.ledger-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ledger-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed #ccc;
}

.ledger-time {
  font-size: 0.7rem;
  font-weight: 800;
  color: #999;
}

.ledger-event {
  font-weight: 700;
  font-size: 0.8rem;
  flex: 1;
  margin: 0 15px;
}

.ledger-grade {
  font-weight: 900;
  color: #500000;
}

.report-footer-seal {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sig-section {
  text-align: center;
  border-top: 1px solid #1a1a1a;
  padding-top: 15px;
  width: 200px;
}

.footer-sig {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-style: italic;
}

.sig-title {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 5px;
}

.report-legal {
  margin-top: 60px;
  font-size: 0.55rem;
  font-weight: 700;
  color: #999;
  text-align: center;
  letter-spacing: 0.1em;
}

/* Grade Colors on Report */
.grade-A { color: #166534; }
.grade-B { color: #854d0e; }
.grade-C { color: #991b1b; }

.empty-extra {
  font-size: 0.8rem;
  color: #999;
  font-style: italic;
}


/* Grade Reasoning Badges */
.grade-reason-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 940;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    font-family: 'Inter', sans-serif;
    margin: 2px 0;
}
.grade-reason-badge.type-good { 
    background: rgba(16, 185, 129, 0.08); 
    color: #10b981; 
    border-color: rgba(16, 185, 129, 0.15);
}
.grade-reason-badge.type-warn { 
    background: rgba(245, 158, 11, 0.08); 
    color: #f59e0b; 
    border-color: rgba(245, 158, 11, 0.15);
}
.grade-reason-badge.type-danger { 
    background: rgba(239, 68, 68, 0.08); 
    color: #ef4444; 
    border-color: rgba(239, 68, 68, 0.15);
}

/* ──── GPA Hero Alignment Fix ──── */
.gpa-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 10px;
}

.gpa-report-btn {
  padding: 12px 30px !important;
  font-size: 0.85rem !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
}

.gpa-report-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.2) !important;
  background: #fdfdfb !important;
}

.gpa-report-btn {
  background: white !important; 
  color: #500000 !important; 
  font-weight: 850 !important; 
  border: none !important; 
  border-radius: 50px !important; 
  display: flex !important; 
  align-items: center !important; 
  gap: 12px !important; 
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
}

.gpa-actions {
    border-top: 1px dashed rgba(0,0,0,0.1) !important;
    padding-top: 25px !important;
}

/* Macro Input Group for external calories */
.macro-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    transition: var(--transition);
}

.macro-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-dim);
}

.macro-input-group input {
    border: none;
    background: transparent;
    width: 35px;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    padding: 0;
    color: var(--text);
}

.macro-input-group input:focus {
    outline: none;
}

.macro-input-group input::-webkit-inner-spin-button,
.macro-input-group input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Aggregate Modal Enhancements */
.aggregate-export-hint {
    margin-top: 15px;
    padding: 12px;
    background: var(--primary-dim);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px dashed rgba(30, 41, 59, 0.2);
}

.export-hint-icon {
    font-size: 1.2rem;
    color: var(--primary);
}

.export-hint-text {
    flex: 1;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-2);
}

.export-hint-btn {
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
