/* =====================================================
   CincaiKira — Design System
   White & Pastel · Red CTAs · Rounded · Friendly
   ===================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Backgrounds */
  --bg-base:      #ffffff;
  --bg-subtle:    #fafafa;
  --bg-surface:   #ffffff;
  --bg-card:      #ffffff;
  --bg-elevated:  #f3f4f6;

  /* Brand Red */
  --red-600:  #c70810;
  --red-500:  #e50914;
  --red-400:  #f43f47;
  --red-100:  #fee2e4;
  --red-50:   #fff1f2;

  /* Pastel accents */
  --pastel-red:    #fff1f2;
  --pastel-yellow: #fffbeb;
  --pastel-green:  #f0fdf4;
  --pastel-blue:   #eff6ff;
  --pastel-orange: #fff7ed;

  /* Text */
  --text-primary:   #111827;
  --text-secondary: #4b5563;
  --text-muted:     #9ca3af;
  --text-inverse:   #ffffff;

  /* Borders */
  --border:        #e5e7eb;
  --border-strong: #d1d5db;
  --border-red:    rgba(229,9,20,0.25);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-red: 0 4px 14px rgba(229,9,20,0.25);

  /* Status */
  --green-500: #22c55e;
  --green-400: #4ade80;
  --green-100: #dcfce7;
  --amber-500: #f59e0b;
  --amber-100: #fef3c7;
  --blue-500:  #3b82f6;
  --blue-100:  #dbeafe;

  /* Radius */
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-2xl:  24px;
  --radius-full: 999px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 64px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16,1,0.3,1);
  --ease-in:  cubic-bezier(0.4,0,1,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Ensure HTML hidden attribute is never overridden by component CSS */
[hidden] { display: none !important; }
html { height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; }
button { font-family: inherit; cursor: pointer; }
a { text-decoration: none; color: inherit; }
input, select, textarea { font-family: inherit; }

/* ---------- App Shell ---------- */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-subtle);
}

/* =====================================================
   NAVIGATION
   ===================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

/* Brand */
.nav__brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
.nav__brand-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* Center nav links */
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
  justify-content: center;
}
.nav__link {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav__link:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav__link.active { background: var(--red-50); color: var(--red-500); font-weight: 600; }

/* Right actions */
.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}
.nav__tdt-logo {
  height: 28px;
  width: auto;
  opacity: 0.8;
}
.nav__divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

/* Quota badge */
.nav__quota-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 10px;
  background: var(--pastel-red);
  border: 1px solid var(--border-red);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--red-500);
}
.quota-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-500);
}

/* User state */
.nav__user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.nav__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.nav__username {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Mobile hamburger */
.nav__menu-btn {
  display: none;
  background: none;
  border: none;
  padding: var(--space-2);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
}
.nav__menu-btn:hover { background: var(--bg-elevated); }

/* =====================================================
   VIEWS
   ===================================================== */
.view { display: none; flex-direction: column; flex: 1; }
.view.view--active { display: flex; }

/* =====================================================
   LANDING — HERO
   ===================================================== */
.view--landing {
  background: var(--bg-surface);
}

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: var(--space-16) var(--space-6) var(--space-10);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.hero__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.hero__title {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
}
.hero__title--red { color: var(--red-500); }

.hero__subtitle {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 440px;
  margin-bottom: var(--space-8);
}

.hero__cta { margin-bottom: var(--space-5); }

.hero__meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.hero__meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

.hero__artwork {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__artwork img {
  width: 100%;
  max-width: 520px;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
}

/* =====================================================
   LANDING — FEATURES
   ===================================================== */
.features {
  background: var(--bg-subtle);
  padding: var(--space-12) var(--space-6);
}
.features__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.feature-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  flex-shrink: 0;
}
.feature-card--scan   .feature-card__icon { background: var(--pastel-red);    color: var(--red-500); }
.feature-card--split  .feature-card__icon { background: var(--pastel-yellow); color: #d97706; }
.feature-card--assign .feature-card__icon { background: var(--pastel-green);  color: #16a34a; }
.feature-card--share  .feature-card__icon { background: var(--pastel-blue);   color: var(--blue-500); }

.feature-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}
.feature-card__desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* =====================================================
   LANDING — HOW IT WORKS
   ===================================================== */
.how-it-works {
  padding: var(--space-12) var(--space-6);
  background: var(--bg-surface);
}
.how-it-works__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.section-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.section-sub {
  font-size: 15px;
  color: var(--text-secondary);
}
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-8);
  position: relative;
}
.step {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}
.step__number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--red-500);
  color: white;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}
.step__desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* =====================================================
   FLOW STEPPER
   ===================================================== */
.stepper-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) var(--space-6);
  position: sticky;
  top: var(--nav-height);
  z-index: 50;
}
.stepper {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.stepper::-webkit-scrollbar { display: none; }
.stepper__step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  flex-shrink: 0;
}
.stepper__step:first-child { padding-left: 0; }
.stepper__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.stepper__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.2s;
}
.stepper__connector {
  flex: 1;
  height: 1px;
  background: var(--border);
  min-width: 24px;
  max-width: 60px;
}

/* Active state */
.stepper__step--active .stepper__dot {
  background: var(--red-500);
  border-color: var(--red-500);
  color: white;
}
.stepper__step--active .stepper__label {
  color: var(--red-500);
  font-weight: 700;
}

/* Completed state */
.stepper__step--done .stepper__dot {
  background: var(--green-100);
  border-color: var(--green-500);
  color: var(--green-500);
}
.stepper__step--done .stepper__label { color: var(--green-500); }
.stepper__step--done .stepper__connector { background: var(--green-500); }

/* =====================================================
   SCAN VIEW
   ===================================================== */
.view--scan { background: var(--bg-subtle); }

.scan-layout {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  width: 100%;
}

.scan-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-10) var(--space-8);
}

.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-12) var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg-subtle);
  gap: var(--space-3);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--red-400);
  background: var(--pastel-red);
}
.upload-zone__icon {
  width: 64px;
  height: 64px;
  background: var(--pastel-red);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red-500);
  margin-bottom: var(--space-2);
}
.upload-zone__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}
.upload-zone__sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* Upload buttons row */
.upload-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

/* Preview */
.upload-preview {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
  text-align: center;
}
.upload-preview img {
  max-height: 280px;
  width: 100%;
  object-fit: contain;
  padding: var(--space-4);
}
.upload-preview__meta {
  padding: var(--space-3) var(--space-4);
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* Sample receipts */
.scan-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-6) 0;
  color: var(--text-muted);
  font-size: 13px;
}
.scan-divider::before, .scan-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.sample-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.sample-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-3);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg-surface);
}
.sample-card:hover {
  border-color: var(--red-400);
  background: var(--pastel-red);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.sample-card__icon {
  font-size: 28px;
  margin-bottom: var(--space-2);
}
.sample-card__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.sample-card__sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Processing steps */
.processing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-10) var(--space-8);
}
.processing-steps { list-style: none; display: flex; flex-direction: column; gap: var(--space-3); }
.processing-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  transition: all 0.3s;
}
.processing-step--active { background: var(--pastel-red); }
.processing-step--done { background: var(--green-100); }
.processing-step__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-surface);
  color: var(--text-muted);
}
.processing-step--active .processing-step__icon { background: var(--red-100); color: var(--red-500); }
.processing-step--done   .processing-step__icon { background: var(--green-100); color: var(--green-500); }
.processing-step__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  flex: 1;
}
.processing-step--active .processing-step__label { color: var(--red-500); font-weight: 600; }
.processing-step--done   .processing-step__label { color: var(--green-500); }

/* =====================================================
   REVIEW VIEW
   ===================================================== */
.view--review { background: var(--bg-subtle); }

.review-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-6);
  align-items: start;
}

.review-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.review-card__header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.review-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.review-card__meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Receipt items */
.receipt-items { }
.receipt-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.receipt-item:last-child { border-bottom: none; }
.receipt-item:hover { background: var(--bg-subtle); }
.receipt-item__check {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-xs);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.receipt-item__check.checked {
  background: var(--red-500);
  border-color: var(--red-500);
  color: white;
}
.receipt-item__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.receipt-item__qty {
  font-size: 12px;
  color: var(--text-muted);
}
.receipt-item__controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}
.qty-btn:hover { border-color: var(--red-400); color: var(--red-500); }
.qty-display {
  font-size: 13px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}
.receipt-item__amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
  min-width: 64px;
}
.receipt-item__amount--editable {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  width: 80px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
}
.confidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
}
.confidence-badge--low { background: var(--amber-100); color: #92400e; }

/* Receipt totals */
.receipt-totals {
  padding: var(--space-5) var(--space-6);
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.receipt-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
}
.receipt-total-row--grand {
  padding-top: var(--space-3);
  border-top: 2px solid var(--border);
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: var(--space-1);
}
.receipt-total-row--grand .receipt-total-row__amount {
  color: var(--red-500);
}

/* Add custom item */
.btn-add-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  width: 100%;
  background: none;
  border: none;
  border-top: 1px dashed var(--border);
  color: var(--red-500);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-add-item:hover { background: var(--pastel-red); }

/* =====================================================
   SPLIT PANEL (right side of review)
   ===================================================== */
.split-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: calc(var(--nav-height) + 72px + var(--space-6));
}
.split-panel__header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
}
.split-panel__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

/* Mode tabs */
.split-tabs {
  display: flex;
  gap: var(--space-1);
  background: var(--bg-elevated);
  padding: 3px;
  border-radius: var(--radius-md);
}
.split-tab {
  flex: 1;
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.split-tab.active {
  background: var(--bg-surface);
  color: var(--red-500);
  box-shadow: var(--shadow-xs);
}

/* Friends list */
.friends-section {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
}
.friends-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.friend-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  transition: border-color 0.15s;
}
.friend-row:hover { border-color: var(--border-strong); }
.friend-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pastel-red);
  color: var(--red-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.friend-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.friend-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.friend-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  line-height: 0;
}
.friend-remove:hover { background: var(--red-50); color: var(--red-500); }

/* Add friend */
.add-friend-row {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* Split results */
.split-results-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
}
.split-result-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}
.split-result-row__name { flex: 1; font-size: 14px; font-weight: 600; }
.split-result-row__amount { font-size: 15px; font-weight: 800; color: var(--red-500); }

.split-panel__actions {
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-top: 1px solid var(--border);
}

/* Reconciliation */
.reconciliation-check {
  padding: var(--space-3) var(--space-6);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.reconciliation-check--ok { color: var(--green-500); }
.reconciliation-check--err { color: var(--red-500); }

/* =====================================================
   SHARE VIEW
   ===================================================== */
.view--share { background: var(--bg-subtle); }
.share-layout {
  max-width: 540px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  width: 100%;
}
.share-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.share-header {
  background: var(--red-500);
  padding: var(--space-6);
  color: white;
  text-align: center;
}
.share-header__title { font-size: 18px; font-weight: 800; }
.share-header__sub { font-size: 13px; opacity: 0.8; margin-top: 4px; }

.share-results {
  padding: var(--space-4) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}
.share-row__name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.share-row__amount { font-size: 15px; font-weight: 800; color: var(--red-500); }
.share-actions {
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-top: 1px solid var(--border);
}

/* =====================================================
   AD DOCK
   ===================================================== */
.ad-dock {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: var(--space-3) var(--space-6);
  container-type: inline-size;
}
.ad-dock__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: var(--space-3);
  overflow: hidden;
}
.ad-card {
  flex: 1 1 260px;
  min-width: 0;
  max-width: 420px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: stretch;
  min-height: 88px;
  position: relative;
  transition: box-shadow 0.2s;
}
.ad-card:hover { box-shadow: var(--shadow-sm); }
.ad-card__sponsored {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ad-card__image {
  width: 100px;
  object-fit: cover;
  flex-shrink: 0;
}
.ad-card__content {
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}
.ad-card__brand {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ad-card__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-card__sub {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-card__cta {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--red-500);
  color: white;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  margin-top: var(--space-1);
  width: fit-content;
  text-decoration: none;
}

/* Hide 2nd+ ad at small container widths */
@container (max-width: 559px) {
  .ad-card:not(:first-child) { display: none; }
}
@container (min-width: 560px) and (max-width: 839px) {
  .ad-card:nth-child(n+3) { display: none; }
}

/* =====================================================
   TOAST
   ===================================================== */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  pointer-events: none;
}
.toast {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  pointer-events: auto;
  animation: toastIn 0.25s var(--ease-out);
  box-shadow: var(--shadow-lg);
  max-width: 380px;
  text-align: center;
  white-space: nowrap;
}
.toast--success { background: #111827; color: #4ade80; }
.toast--error   { background: #111827; color: #fb7185; }
.toast--warning { background: #111827; color: #fbbf24; }
.toast--info    { background: #111827; color: #e4e4e7; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  backdrop-filter: blur(4px);
}
/* IMPORTANT: [hidden] alone (display:none) is overridden by display:flex above.
   This selector has higher specificity and restores correct hidden behaviour. */
.modal-overlay[hidden] { display: none !important; }
.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-8);
  max-width: 480px;
  width: 100%;
  position: relative;
  animation: modalIn 0.2s var(--ease-out);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }
.modal__close {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.modal__close:hover { background: var(--red-50); color: var(--red-500); }
.modal__title { font-size: 18px; font-weight: 800; margin-bottom: var(--space-5); color: var(--text-primary); }
.modal__body { color: var(--text-secondary); font-size: 14px; }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
  line-height: 1;
}

.btn--hero {
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  background: var(--red-500);
  color: white;
  box-shadow: var(--shadow-red);
}
.btn--hero:hover {
  background: var(--red-400);
  box-shadow: 0 6px 20px rgba(229,9,20,0.35);
  transform: translateY(-1px);
}
.btn--hero:active { transform: none; }

.btn--primary {
  background: var(--red-500);
  color: white;
}
.btn--primary:hover {
  background: var(--red-400);
  box-shadow: var(--shadow-red);
}
.btn--primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.btn--secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn--secondary:hover { background: var(--border); }

.btn--ghost {
  background: none;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn--ghost:hover { background: var(--bg-elevated); color: var(--text-primary); }

.btn--outline-red {
  background: none;
  color: var(--red-500);
  border: 1px solid var(--border-red);
}
.btn--outline-red:hover { background: var(--pastel-red); }

.btn--sm  { padding: 7px 14px; font-size: 13px; }
.btn--lg  { padding: 13px 28px; font-size: 15px; }
.btn--full { width: 100%; }
.btn--icon {
  padding: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* =====================================================
   FORM ELEMENTS
   ===================================================== */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus {
  border-color: var(--red-400);
  box-shadow: 0 0 0 3px rgba(229,9,20,0.1);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select { appearance: none; cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: var(--space-1); }

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-6);
  gap: var(--space-3);
}
.empty-state__icon {
  font-size: 48px;
  margin-bottom: var(--space-2);
}
.empty-state__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.empty-state__sub {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 320px;
}

/* =====================================================
   UTILITY
   ===================================================== */
.text-red    { color: var(--red-500); }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 13px; }
.font-bold   { font-weight: 700; }
.font-800    { font-weight: 800; }
.flex        { display: flex; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2       { gap: var(--space-2); }
.gap-3       { gap: var(--space-3); }
.w-full      { width: 100%; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__menu-btn { display: flex; }

  .hero {
    grid-template-columns: 1fr;
    padding: var(--space-8) var(--space-5);
    gap: var(--space-8);
    text-align: center;
  }
  .hero__subtitle { margin: 0 auto var(--space-8); }
  .hero__cta { display: flex; justify-content: center; }
  .hero__meta { justify-content: center; }
  .hero__artwork { order: -1; }
  .hero__artwork img { max-width: 340px; }

  .review-layout {
    grid-template-columns: 1fr;
  }
  .split-panel {
    position: static;
  }
}

@media (max-width: 600px) {
  .nav__inner { padding: 0 var(--space-4); gap: var(--space-3); }
  .nav__brand-name { font-size: 15px; }
  .hero { padding: var(--space-6) var(--space-4); }
  .hero__title { font-size: 34px; }
  .features, .how-it-works { padding: var(--space-8) var(--space-4); }
  .scan-layout { padding: var(--space-5) var(--space-4); }
  .scan-card { padding: var(--space-6) var(--space-5); }
  .review-layout { padding: var(--space-5) var(--space-4); }
  .sample-grid { grid-template-columns: repeat(3, 1fr); }
  .upload-actions { flex-direction: column; }
  .ad-dock { padding: var(--space-3) var(--space-4); }
}

@media (max-width: 400px) {
  .sample-grid { grid-template-columns: 1fr 1fr; }
}
