/* ============================================================
   THRUMPS HUB - APPLE-GRADE UI / UX DESIGN SYSTEM
   Ultra-clean, Minimalist, High-Value Human Experience
   Inspired by Apple (SF Pro, iOS / macOS Design System)
   ============================================================ */

:root {
  /* Apple Light Mode Palette */
  --bg-app: #F5F5F7;
  --bg-surface: #FFFFFF;
  --bg-subtle: #E8E8ED;
  --bg-subtle-hover: #DEDEDE;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-card-hover: #FAFAFA;

  --border-line: rgba(0, 0, 0, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.04);
  --border-focus: #0071E3;

  /* Typography - San Francisco System Stack */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", Menlo, Monaco, Consolas, monospace;

  /* Text & Ink */
  --ink-primary: #1D1D1F;
  --ink-secondary: #6E6E73;
  --ink-muted: #86868B;

  /* Apple System Accents */
  --apple-blue: #0071E3;
  --apple-blue-hover: #0077ED;
  --apple-blue-soft: #EBF4FE;

  --apple-green: #34C759;
  --apple-green-hover: #2DB84D;
  --apple-green-soft: #EAF8EF;

  --apple-orange: #FF9500;
  --apple-orange-soft: #FFF5E6;

  --apple-red: #FF3B30;
  --apple-red-soft: #FDEEED;

  --apple-purple: #AF52DE;
  --apple-purple-soft: #F6EDFC;

  --apple-teal: #30B0C7;
  --apple-teal-soft: #E6F7FA;

  /* Shadows - Subtle, Diffuse Apple Depth */
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-modal: 0 20px 50px rgba(0, 0, 0, 0.16);

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 980px;
}

/* Apple Space Black / Dark Mode */
[data-theme="dark"] {
  --bg-app: #000000;
  --bg-surface: #1C1C1E;
  --bg-subtle: #2C2C2E;
  --bg-subtle-hover: #3A3A3C;
  --bg-glass: rgba(28, 28, 30, 0.85);
  --bg-card-hover: #242426;

  --border-line: rgba(255, 255, 255, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-focus: #2997FF;

  --ink-primary: #F5F5F7;
  --ink-secondary: #A1A1A6;
  --ink-muted: #86868B;

  --apple-blue: #2997FF;
  --apple-blue-hover: #47A7FF;
  --apple-blue-soft: rgba(41, 151, 255, 0.18);

  --apple-green: #30D158;
  --apple-green-hover: #34E060;
  --apple-green-soft: rgba(48, 209, 88, 0.18);

  --apple-orange: #FF9F0A;
  --apple-orange-soft: rgba(255, 159, 10, 0.18);

  --apple-red: #FF453A;
  --apple-red-soft: rgba(255, 69, 58, 0.18);

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.6);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.8);
}

/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-app);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Main Container */
.app-container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ============================================================
   APPLE TRANSLUCENT NAVBAR
   ============================================================ */
.navbar-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-line);
  margin-bottom: 28px;
}

.navbar {
  max-width: 1260px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--apple-blue);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.25);
}

.brand-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-primary);
  letter-spacing: -0.01em;
}

.subdomain-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-size: 11.5px;
  font-weight: 500;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--apple-green);
}

/* Nav Tabs - Apple Segmented Control */
.nav-tabs {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-full);
  gap: 2px;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: var(--ink-primary);
}

.nav-tab-btn.active {
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Nav Controls */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   BUTTONS & FORM ELEMENTS (Apple Style)
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--apple-blue);
  color: #FFFFFF;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: var(--apple-blue-hover);
  transform: translateY(-0.5px);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-subtle);
  color: var(--ink-primary);
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: var(--bg-subtle-hover);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-green {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--apple-green);
  color: #FFFFFF;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-green:hover {
  background-color: var(--apple-green-hover);
}

.icon-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  color: var(--ink-secondary);
  transition: background 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

/* ============================================================
   PAGE HEADER / HERO (High Value & De-noised)
   ============================================================ */
.page-hero {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--ink-secondary);
  max-width: 680px;
}

/* Segmented Sub-Navbar */
.subnav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.segmented-control {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-full);
  gap: 2px;
}

.segmented-pill {
  background: transparent;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.segmented-pill:hover {
  color: var(--ink-primary);
}

.segmented-pill.active {
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Search Input Apple Style */
.search-input-wrap {
  position: relative;
  min-width: 260px;
  max-width: 380px;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  font-size: 13px;
  pointer-events: none;
}

.apple-search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  padding: 7px 12px 7px 34px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-primary);
  outline: none;
  transition: all 0.15s ease;
}

.apple-search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--apple-blue-soft);
}

/* ============================================================
   WHIMSHEET SCHEDULE HEADER & DATE FILTER CONTROLS
   ============================================================ */
.whimsheet-header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.whimsheet-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.whimsheet-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.whimsheet-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-primary);
  letter-spacing: -0.015em;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--apple-green-soft);
  color: var(--apple-green);
  font-size: 12px;
  font-weight: 600;
}

/* Date Filters Bar (Today, This Weekend, This Week, This Month, All Upcoming) */
.date-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.date-filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
}

.date-pill {
  background: var(--bg-subtle);
  border: none;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.date-pill:hover {
  background: var(--bg-subtle-hover);
  color: var(--ink-primary);
}

.date-pill.active {
  background: var(--apple-blue);
  color: #FFFFFF;
  font-weight: 600;
}

/* Category Filter Chips */
.cat-chips-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.cat-chip {
  background: transparent;
  border: 1px solid var(--border-line);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-chip:hover {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

.cat-chip.active {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: #FFFFFF;
  font-weight: 600;
}

/* ============================================================
   WHIMSHEET SCHEDULE TABLE (Matches Screenshot & Apple Polish)
   ============================================================ */
.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.whimsheet-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.whimsheet-table th {
  background-color: var(--bg-app);
  padding: 12px 16px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-line);
}

.whimsheet-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
  border-bottom: 1px solid var(--border-subtle);
}

.whimsheet-row:hover {
  background-color: var(--bg-card-hover);
}

.whimsheet-row.expanded {
  background-color: var(--apple-blue-soft);
}

.whimsheet-row td {
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--ink-primary);
  vertical-align: middle;
}

.class-title-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink-primary);
}

.expand-chevron {
  display: inline-block;
  font-size: 11px;
  color: var(--ink-muted);
  transition: transform 0.2s ease;
  width: 14px;
  text-align: center;
}

.whimsheet-row.expanded .expand-chevron {
  transform: rotate(90deg);
  color: var(--apple-blue);
}

.source-cell {
  color: var(--ink-secondary);
  font-size: 13px;
}

.start-cell {
  font-weight: 600;
  color: var(--ink-primary);
}

.day-cell {
  color: var(--ink-secondary);
}

.cost-cell {
  font-weight: 600;
  color: var(--ink-primary);
}

/* Expanded Detail Row */
.detail-row td {
  padding: 0;
  background-color: var(--bg-app);
}

.detail-drawer {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px 28px;
  flex: 1;
}

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

.meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.meta-value {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background-color: var(--apple-blue);
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============================================================
   CARDS GRID (Apple Style Responsive)
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.activity-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

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

.card-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
  margin-bottom: 6px;
  line-height: 1.35;
}

.card-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-secondary);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.card-body-text {
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* ============================================================
   DATE ROULETTE CARD (Apple Compact Drawer)
   ============================================================ */
.roulette-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card);
}

.roulette-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.roulette-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.roulette-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.roulette-step-card {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.step-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--apple-blue-soft);
  color: var(--apple-blue);
  width: fit-content;
}

/* ============================================================
   TAB 2: AMAZON BENEFITS (Clean Financial Overview)
   ============================================================ */
.benefits-stats-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}

.stat-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-primary);
  letter-spacing: -0.02em;
}

.benefit-status-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.status-enrolled {
  background: var(--apple-green-soft);
  color: var(--apple-green);
}

.status-considering {
  background: var(--apple-orange-soft);
  color: var(--apple-orange);
}

.status-ignore {
  background: var(--bg-subtle);
  color: var(--ink-muted);
}

/* ============================================================
   TAB 3: SCRAPER (Safari Reader Experience)
   ============================================================ */
.scraper-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card);
}

.url-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.url-input {
  flex: 1;
  background: var(--bg-app);
  border: 1px solid var(--border-line);
  padding: 10px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink-primary);
  outline: none;
  transition: all 0.15s ease;
}

.url-input:focus {
  border-color: var(--border-focus);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--apple-blue-soft);
}

.quick-examples {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-secondary);
  flex-wrap: wrap;
}

.example-chip {
  background: var(--bg-subtle);
  border: none;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-primary);
  cursor: pointer;
  transition: background 0.15s ease;
}

.example-chip:hover {
  background: var(--bg-subtle-hover);
}

.synopsis-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.synopsis-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  margin-bottom: 12px;
}

/* ============================================================
   TAB 4: AUTOMATIONS (Apple System Settings Style)
   ============================================================ */
.settings-group {
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.settings-header {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.settings-desc {
  font-size: 13.5px;
  color: var(--ink-secondary);
  margin-bottom: 16px;
}

/* ============================================================
   MODALS (Apple Style Sheet / Dialog)
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-modal);
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  margin-bottom: 6px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: var(--bg-app);
  border: 1px solid var(--border-line);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink-primary);
  outline: none;
  transition: all 0.15s ease;
}

.form-input:focus {
  border-color: var(--border-focus);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--apple-blue-soft);
}

/* Tab Panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #FFFFFF;
  animation: spin 0.6s linear infinite;
}

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

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--ink-primary);
  color: var(--bg-surface);
  padding: 10px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastSlide 0.2s ease;
}

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

/* Benefit Card & Selects */
.benefit-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.status-select {
  background: var(--bg-subtle);
  border: 1px solid var(--border-line);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.status-select:focus {
  border-color: var(--apple-blue);
}

.status-select.enrolled,
.status-select.claimed {
  background: var(--apple-green-soft);
  color: var(--apple-green);
  border-color: rgba(52, 199, 89, 0.3);
}

.status-select.considering {
  background: var(--apple-orange-soft);
  color: var(--apple-orange);
  border-color: rgba(255, 149, 0, 0.3);
}

/* Synopsis Viewer & Reader Mode (Safari Style) */
.synopsis-viewer {
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.synopsis-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-line);
}

.tldr-box {
  background: var(--bg-app);
  border-left: 3px solid var(--apple-blue);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.insights-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.insight-item {
  background: var(--bg-app);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--border-subtle);
}

.insight-item .icon {
  font-size: 18px;
  line-height: 1;
}

/* Price Chips & Status Badges */
.price-chip-green {
  font-size: 12px;
  font-weight: 700;
  color: var(--apple-green);
  background: var(--apple-green-soft);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.price-chip-free {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-line);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.status-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  width: fit-content;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.status-pill.status-today {
  background: var(--apple-orange-soft);
  color: var(--apple-orange);
  border: 1px solid rgba(255, 149, 0, 0.25);
}

.status-pill.status-active {
  background: var(--apple-green-soft);
  color: var(--apple-green);
  border: 1px solid rgba(52, 199, 89, 0.25);
}

.status-pill.status-tomorrow {
  background: var(--apple-blue-soft);
  color: var(--apple-blue);
  border: 1px solid rgba(0, 113, 227, 0.2);
}

.cat-pill-small {
  font-size: 10.5px;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.btn-green-sm {
  background: var(--apple-green);
  color: #FFFFFF !important;
  border: none;
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-green-sm:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.btn-icon-fav {
  background: none;
  border: 1px solid var(--border-line);
  border-radius: var(--radius-full);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}

.btn-icon-fav:hover {
  background: var(--bg-subtle);
  border-color: var(--apple-red);
}

.btn-icon-fav.active {
  background: var(--apple-red-soft);
  border-color: rgba(255, 59, 48, 0.3);
}

.active-filter-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-left: 4px solid var(--apple-blue);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  margin-top: 14px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ink-primary);
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}

/* ============================================================
   RESPONSIVE DESIGN (Mobile, Tablet, Desktop)
   ============================================================ */
@media (max-width: 900px) {
  .app-container {
    padding: 0 16px 60px;
  }

  .navbar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
    gap: 10px;
  }

  .nav-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    justify-content: flex-start;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 7px 13px;
    font-size: 12.5px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .whimsheet-top-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .search-input-wrap {
    max-width: 100%;
  }

  .subnav-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .date-filter-group {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .date-filter-group::-webkit-scrollbar {
    display: none;
  }

  .date-pill {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .cat-chips-row {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .cat-chips-row::-webkit-scrollbar {
    display: none;
  }

  .cat-chip {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .whimsheet-table {
    min-width: 680px;
  }

  .roulette-result-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .benefits-stats-bar {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-metric {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 10px 12px;
  }
  .stat-metric:last-child {
    border-bottom: none;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 22px;
  }
  .page-subtitle {
    font-size: 13px;
  }
  .page-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }
  .benefits-stats-bar {
    grid-template-columns: 1fr;
  }
  .detail-meta-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

