:root {
  --background: hsl(0 0% 100%);
  --foreground: hsl(240 10% 3.9%);
  --card: hsl(0 0% 100%);
  --card-foreground: hsl(240 10% 3.9%);
  --popover: hsl(0 0% 100%);
  --popover-foreground: hsl(240 10% 3.9%);
  --primary: hsl(240 5.9% 10%);
  --primary-foreground: hsl(0 0% 98%);
  --secondary: hsl(240 4.8% 95.9%);
  --secondary-foreground: hsl(240 5.9% 10%);
  --muted: hsl(240 4.8% 95.9%);
  --muted-foreground: hsl(240 3.8% 46.1%);
  --accent: hsl(240 4.8% 95.9%);
  --accent-foreground: hsl(240 5.9% 10%);
  --destructive: hsl(0 84.2% 60.2%);
  --destructive-foreground: hsl(0 0% 98%);
  --border: hsl(240 5.9% 90%);
  --input: hsl(240 5.9% 90%);
  --ring: hsl(240 5.9% 10%);
  --radius: 0.5rem;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --font-serif: 'Merriweather', Georgia, serif;
}

.dark {
  --background: hsl(240 10% 3.9%);
  --foreground: hsl(0 0% 98%);
  --card: hsl(240 10% 3.9%);
  --card-foreground: hsl(0 0% 98%);
  --popover: hsl(240 10% 3.9%);
  --popover-foreground: hsl(0 0% 98%);
  --primary: hsl(0 0% 98%);
  --primary-foreground: hsl(240 5.9% 10%);
  --secondary: hsl(240 3.7% 15.9%);
  --secondary-foreground: hsl(0 0% 98%);
  --muted: hsl(240 3.7% 15.9%);
  --muted-foreground: hsl(240 5% 64.9%);
  --accent: hsl(240 3.7% 15.9%);
  --accent-foreground: hsl(0 0% 98%);
  --destructive: hsl(0 62.8% 30.6%);
  --destructive-foreground: hsl(0 0% 98%);
  --border: hsl(240 3.7% 15.9%);
  --input: hsl(240 3.7% 15.9%);
  --ring: hsl(240 4.9% 83.9%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-color: var(--border);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Typography ─── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--foreground);
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

p {
  color: var(--muted-foreground);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--muted-foreground);
  text-decoration: underline;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

/* ─── Layout ─── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-sm {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-md {
  max-width: 768px;
  margin: 0 auto;
  padding: 0 1rem;
}

main {
  flex: 1;
  padding: 2rem 0;
}

/* ─── Header ─── */
.header {
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo:hover {
  color: var(--muted-foreground);
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--foreground);
  text-decoration: none;
}

/* ─── Dark Mode Toggle ─── */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  color: var(--muted-foreground);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--secondary);
  color: var(--foreground);
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  background: none;
  color: var(--foreground);
}

.btn:hover {
  text-decoration: none;
}

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

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

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

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

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

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

.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
}

.btn-ghost:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.btn-destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.btn-destructive:hover {
  opacity: 0.9;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}

.btn-icon {
  padding: 0.5rem;
}

/* ─── Cards ─── */
.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card-header {
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.card-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.card-content {
  margin-bottom: 1.5rem;
}

.card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ─── Forms ─── */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.form-label .optional {
  font-weight: 400;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  margin-left: 0.25rem;
}

.form-input {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  transition: all 0.15s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 2px var(--ring);
}

.form-input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.5;
}

.form-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ─── Tables ─── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

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

.table th {
  padding: 0.75rem 1rem;
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
}

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

.table tr:hover td {
  background: var(--accent);
}

/* ─── Alerts ─── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: hsl(142 76% 36% / 0.1);
  color: hsl(142 76% 36%);
  border: 1px solid hsl(142 76% 36% / 0.2);
}

.alert-error {
  background: hsl(0 84% 60% / 0.1);
  color: hsl(0 84% 60%);
  border: 1px solid hsl(0 84% 60% / 0.2);
}

.alert-info {
  background: hsl(217 91% 60% / 0.1);
  color: hsl(217 91% 60%);
  border: 1px solid hsl(217 91% 60% / 0.2);
}

.alert-warning {
  background: hsl(38 92% 50% / 0.1);
  color: hsl(38 92% 50%);
  border: 1px solid hsl(38 92% 50% / 0.2);
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-success {
  background: hsl(142 76% 36% / 0.1);
  color: hsl(142 76% 36%);
}

.badge-error {
  background: hsl(0 84% 60% / 0.1);
  color: hsl(0 84% 60%);
}

/* ─── Separator ─── */
.separator {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* ─── Item Rows ─── */
.item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--muted);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

@media (max-width: 640px) {
  .item-row {
    grid-template-columns: 1fr;
  }
}

/* ─── Running Total ─── */
.running-total {
  display: flex;
  gap: 1.5rem;
  padding: 1rem;
  background: var(--muted);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.running-total-item {
  flex: 1;
}

.running-total-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.running-total-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
}

/* ─── Hero ─── */
.hero {
  text-align: center;
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

/* ─── Section ─── */
.section {
  padding: 3rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-description {
  font-size: 1rem;
  color: var(--muted-foreground);
  max-width: 600px;
  margin: 0 auto;
}

/* ─── Step List ─── */
.step-list {
  list-style: none;
  padding: 0;
}

.step-item {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.step-item:last-child {
  border-bottom: none;
}

.step-number {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 9999px;
}

.step-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.step-content p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* ─── Loading ─── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 3rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* ─── Utility ─── */
.hidden {
  display: none !important;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted-foreground); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

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

.fade-in {
  animation: fadeIn 0.2s ease-out;
}

/* ─── Print ─── */
@media print {
  .header,
  .footer,
  .theme-toggle,
  .btn {
    display: none !important;
  }
}

/* ─── Mobile ─── */
@media (max-width: 640px) {
  .hero-title {
    font-size: 1.5rem;
  }
  
  .section-title {
    font-size: 1.25rem;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  
  .running-total {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* Landing page */
body.landing-page {
  --font-sans: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', 'Fira Code', monospace;
  --landing-serif: 'Fraunces', Georgia, serif;
  --landing-bg: #f5eddf;
  --landing-bg-deep: #e5d7c4;
  --landing-paper: #fff9ed;
  --landing-paper-strong: #fff3dc;
  --landing-ink: #23170f;
  --landing-muted: #756655;
  --landing-faint: #9b8b79;
  --landing-line: rgba(57, 42, 27, 0.17);
  --landing-heavy-line: rgba(57, 42, 27, 0.28);
  --landing-accent: #c6532d;
  --landing-accent-hover: #9f3d1f;
  --landing-accent-soft: rgba(198, 83, 45, 0.11);
  --landing-accent-wash: rgba(198, 83, 45, 0.18);
  --landing-shadow: 0 28px 80px rgba(63, 44, 24, 0.18);
  --landing-soft-shadow: 0 18px 50px rgba(63, 44, 24, 0.12);
  --landing-focus: rgba(198, 83, 45, 0.45);
  --background: var(--landing-bg);
  --foreground: var(--landing-ink);
  --card: var(--landing-paper);
  --card-foreground: var(--landing-ink);
  --primary: var(--landing-accent);
  --primary-foreground: #fffaf2;
  --secondary: rgba(255, 249, 237, 0.72);
  --secondary-foreground: var(--landing-ink);
  --muted: rgba(35, 23, 15, 0.06);
  --muted-foreground: var(--landing-muted);
  --accent: var(--landing-accent-soft);
  --accent-foreground: var(--landing-ink);
  --border: var(--landing-line);
  --ring: var(--landing-accent);
  background:
    radial-gradient(circle at 14% 8%, rgba(198, 83, 45, 0.16), transparent 28rem),
    radial-gradient(circle at 85% 16%, rgba(35, 23, 15, 0.08), transparent 24rem),
    linear-gradient(135deg, var(--landing-bg), #fbf4e9 46%, var(--landing-bg-deep));
  color: var(--landing-ink);
  font-size: 1rem;
}

.dark body.landing-page {
  --landing-bg: #18120d;
  --landing-bg-deep: #0f0b08;
  --landing-paper: #251b14;
  --landing-paper-strong: #302116;
  --landing-ink: #fff4e4;
  --landing-muted: #ccbda9;
  --landing-faint: #a9957c;
  --landing-line: rgba(255, 244, 228, 0.15);
  --landing-heavy-line: rgba(255, 244, 228, 0.27);
  --landing-accent: #ec7650;
  --landing-accent-hover: #ff8a64;
  --landing-accent-soft: rgba(236, 118, 80, 0.13);
  --landing-accent-wash: rgba(236, 118, 80, 0.2);
  --landing-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  --landing-soft-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --landing-focus: rgba(236, 118, 80, 0.52);
  --primary-foreground: #160e09;
  --secondary: rgba(255, 244, 228, 0.08);
  --muted: rgba(255, 244, 228, 0.08);
}

body.landing-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(35, 23, 15, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 23, 15, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.dark body.landing-page::before {
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 244, 228, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 244, 228, 0.06) 1px, transparent 1px);
}

.landing-page a:focus-visible,
.landing-page button:focus-visible {
  outline: 3px solid var(--landing-focus);
  outline-offset: 4px;
}

.landing-page .btn {
  border-radius: 0.85rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.landing-page .btn-primary {
  border-color: rgba(35, 23, 15, 0.1);
  box-shadow: 0 12px 26px var(--landing-accent-wash);
}

.landing-page .btn-primary:hover {
  background: var(--landing-accent-hover);
  color: var(--primary-foreground);
  transform: translateY(-1px);
}

.landing-main {
  padding: 0;
  overflow: hidden;
}

.landing-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.landing-header {
  background:
    linear-gradient(90deg, rgba(255, 249, 237, 0.96), rgba(255, 243, 220, 0.96));
  border-bottom: 1px solid var(--landing-line);
}

.dark .landing-header {
  background:
    linear-gradient(90deg, rgba(24, 18, 13, 0.98), rgba(28, 20, 14, 0.98));
}

.landing-header-content {
  max-width: 1180px;
}

.landing-logo {
  color: var(--landing-ink);
  font-family: var(--landing-serif);
  font-size: 1.22rem;
  letter-spacing: -0.03em;
}

.logo-mark {
  display: inline-flex;
  width: 2.1rem;
  height: 2.1rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--landing-heavy-line);
  border-radius: 0.7rem;
  background: var(--landing-paper);
  color: var(--landing-accent);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: -0.08em;
  box-shadow: inset 0 -8px 18px rgba(198, 83, 45, 0.08);
}

.landing-nav .nav-link {
  color: var(--landing-muted);
  font-weight: 700;
}

.landing-nav .nav-link:hover {
  color: var(--landing-ink);
}

.landing-page .theme-toggle {
  color: var(--landing-muted);
}

.landing-page .theme-toggle:hover {
  background: var(--landing-accent-soft);
  color: var(--landing-ink);
}

.landing-hero {
  position: relative;
  padding: clamp(4rem, 8vw, 7.5rem) 0 clamp(3rem, 7vw, 6rem);
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(460px, 1.1fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: center;
}

.hero-copy {
  max-width: 35rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--landing-accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 1.8rem;
  height: 1px;
  background: currentColor;
}

.hero-copy h1,
.section-copy h2,
.section-heading h2,
.closing-receipt h2 {
  color: var(--landing-ink);
  font-family: var(--landing-serif);
  font-weight: 700;
  letter-spacing: -0.055em;
}

.hero-copy h1 {
  max-width: 11ch;
  margin-bottom: 1.25rem;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.92;
}

.hero-lede {
  max-width: 34rem;
  color: var(--landing-muted);
  font-size: clamp(1.05rem, 2vw, 1.24rem);
  line-height: 1.68;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 2rem;
}

.hero-note {
  color: var(--landing-muted);
  font-weight: 700;
}

.hero-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.hero-proof div {
  padding: 0.9rem;
  border: 1px solid var(--landing-line);
  background: rgba(255, 249, 237, 0.55);
  box-shadow: inset 0 -18px 34px rgba(198, 83, 45, 0.04);
}

.dark .hero-proof div {
  background: rgba(255, 244, 228, 0.04);
}

.hero-proof dt {
  color: var(--landing-ink);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hero-proof dd {
  color: var(--landing-muted);
  font-size: 0.9rem;
}

.bill-stage {
  position: relative;
  min-height: 690px;
}

.stage-orbit {
  position: absolute;
  inset: 4rem 1.5rem 3rem 1.5rem;
  border: 1px solid var(--landing-line);
  border-radius: 999px;
  transform: rotate(-11deg);
}

.stage-orbit::before,
.stage-orbit::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: var(--landing-accent);
}

.stage-orbit::before {
  width: 0.65rem;
  height: 0.65rem;
  top: 12%;
  right: 10%;
}

.stage-orbit::after {
  width: 0.45rem;
  height: 0.45rem;
  left: 12%;
  bottom: 20%;
  opacity: 0.7;
}

.receipt-card,
.split-card,
.share-card,
.order-slip,
.equal-split-ticket,
.flow-list,
.moment-card,
.closing-receipt {
  border: 1px solid var(--landing-line);
  background: var(--landing-paper);
  color: var(--landing-ink);
  box-shadow: var(--landing-soft-shadow);
}

.receipt-card {
  position: relative;
  overflow: hidden;
  padding: 1.55rem;
  border-radius: 1.1rem 1.1rem 0.75rem 0.75rem;
}

.receipt-card::after,
.closing-receipt::after {
  content: "";
  position: absolute;
  right: 1.4rem;
  bottom: 1.15rem;
  left: 1.4rem;
  height: 2rem;
  opacity: 0.12;
  background: repeating-linear-gradient(90deg, var(--landing-ink) 0 3px, transparent 3px 7px, var(--landing-ink) 7px 9px, transparent 9px 14px);
  pointer-events: none;
}

.receipt-perf {
  position: absolute;
  top: -1px;
  right: 0;
  left: 0;
  height: 0.9rem;
  background:
    radial-gradient(circle at 0.55rem -0.04rem, var(--landing-bg) 0 0.42rem, transparent 0.45rem) repeat-x;
  background-size: 1.35rem 0.9rem;
}

.hero-receipt {
  position: absolute;
  top: 1.4rem;
  left: 0.3rem;
  z-index: 2;
  width: min(440px, 82%);
  min-height: 560px;
  transform: rotate(-2.25deg);
  box-shadow: var(--landing-shadow);
}

.receipt-head,
.split-card header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--landing-heavy-line);
}

.receipt-head h2,
.split-card h3 {
  margin-top: 0.15rem;
  color: var(--landing-ink);
  font-family: var(--landing-serif);
  font-size: 1.45rem;
  line-height: 1;
}

.receipt-kicker {
  color: var(--landing-accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.receipt-stamp {
  display: inline-flex;
  align-items: center;
  min-width: max-content;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--landing-accent-wash);
  border-radius: 0.55rem;
  background: var(--landing-accent-soft);
  color: var(--landing-accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.receipt-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  color: var(--landing-faint);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  border-bottom: 1px solid var(--landing-line);
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.79rem;
}

.receipt-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.receipt-table th {
  padding: 0.7rem 0;
  color: var(--landing-faint);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.receipt-table td {
  padding: 0.72rem 0;
  vertical-align: top;
  border-top: 1px solid var(--landing-line);
}

.receipt-table .amount {
  text-align: right;
}

.landing-page .item-name {
  display: block;
  color: var(--landing-ink);
  font-weight: 700;
}

.landing-page .item-note {
  display: block;
  margin-top: 0.1rem;
  color: var(--landing-faint);
  font-size: 0.7rem;
}

.person-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0.16rem 0.2rem 0;
  padding: 0.24rem 0.42rem;
  border: 1px solid var(--landing-line);
  border-radius: 0.5rem;
  background: rgba(35, 23, 15, 0.04);
  color: var(--landing-ink);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
}

.dark .person-chip {
  background: rgba(255, 244, 228, 0.05);
}

.person-chip.active {
  border-color: var(--landing-accent-wash);
  background: var(--landing-accent-soft);
  color: var(--landing-accent);
}

.person-chip.muted {
  opacity: 0.42;
}

.shared-row td {
  background: linear-gradient(90deg, var(--landing-accent-soft), transparent 62%);
}

.calculation-strip {
  display: grid;
  gap: 0.48rem;
  margin: 1rem 0 0;
  padding: 0.9rem 0 3rem;
  border-top: 1px dashed var(--landing-heavy-line);
  font-family: var(--font-mono);
  font-size: 0.73rem;
}

.calculation-strip div,
.equal-warning,
.mini-ledger div,
.totals-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.calculation-strip span,
.mini-ledger span {
  color: var(--landing-faint);
}

.calculation-strip strong,
.mini-ledger strong {
  color: var(--landing-ink);
}

.discount-line strong {
  color: var(--landing-accent);
}

.equal-warning {
  position: absolute;
  right: 1.25rem;
  bottom: 1.15rem;
  left: 1.25rem;
  z-index: 1;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--landing-heavy-line);
  border-radius: 0.72rem;
  background: var(--landing-ink);
  color: var(--landing-paper);
  font-size: 0.75rem;
  font-weight: 700;
}

.equal-warning strong {
  color: var(--landing-paper);
  font-family: var(--font-mono);
}

.split-card {
  position: absolute;
  top: 17.8rem;
  right: 0;
  z-index: 4;
  width: min(355px, 62%);
  padding: 1.15rem;
  border-radius: 1.1rem;
  transform: rotate(1.6deg);
  box-shadow: var(--landing-shadow);
}

.split-card header {
  display: block;
  padding-bottom: 0.85rem;
}

.split-card h3 {
  font-size: 1.22rem;
}

.totals-list {
  list-style: none;
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.totals-list li {
  color: var(--landing-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.totals-list strong {
  min-width: 4.6rem;
  color: var(--landing-ink);
  text-align: right;
}

.total-track {
  overflow: hidden;
  flex: 1;
  height: 0.46rem;
  border-radius: 999px;
  background: rgba(35, 23, 15, 0.08);
}

.dark .total-track {
  background: rgba(255, 244, 228, 0.11);
}

.total-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--landing-accent);
}

.share-card {
  position: absolute;
  right: 2.1rem;
  bottom: 2.1rem;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  width: min(390px, 76%);
  padding: 0.95rem;
  border-radius: 1rem;
  transform: rotate(-1.2deg);
  box-shadow: var(--landing-shadow);
}

.share-icon {
  display: inline-flex;
  width: 2.55rem;
  height: 2.55rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.8rem;
  background: var(--landing-accent);
  color: var(--primary-foreground);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
}

.share-card p {
  margin-bottom: 0.1rem;
  color: var(--landing-ink);
  font-weight: 800;
}

.share-card strong,
.share-card span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.share-card strong {
  color: var(--landing-accent);
}

.share-card span {
  margin-top: 0.3rem;
  color: var(--landing-muted);
}

.landing-section {
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.section-copy {
  max-width: 34rem;
}

.section-copy h2,
.section-heading h2,
.closing-receipt h2 {
  margin-bottom: 1rem;
  font-size: clamp(2.35rem, 5vw, 4.9rem);
  line-height: 0.98;
}

.section-copy p,
.section-heading p:not(.eyebrow),
.closing-receipt p {
  color: var(--landing-muted);
  font-size: 1.05rem;
  line-height: 1.72;
}

.problem-section {
  position: relative;
  border-top: 1px solid var(--landing-line);
  border-bottom: 1px solid var(--landing-line);
  background:
    linear-gradient(90deg, rgba(255, 249, 237, 0.44), rgba(198, 83, 45, 0.06)),
    repeating-linear-gradient(0deg, transparent 0 35px, rgba(57, 42, 27, 0.04) 35px 36px);
}

.dark .problem-section {
  background:
    linear-gradient(90deg, rgba(255, 244, 228, 0.04), rgba(236, 118, 80, 0.06)),
    repeating-linear-gradient(0deg, transparent 0 35px, rgba(255, 244, 228, 0.04) 35px 36px);
}

.problem-layout {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.problem-board {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 1rem;
  align-items: stretch;
}

.order-slip,
.equal-split-ticket {
  position: relative;
  padding: 1.25rem;
  border-radius: 0.9rem;
}

.order-slip::before {
  content: "";
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  left: 0.75rem;
  border: 1px dashed var(--landing-line);
  pointer-events: none;
}

.order-slip h3 {
  margin: 0.6rem 0 0.35rem;
  color: var(--landing-ink);
  font-family: var(--landing-serif);
  font-size: 1.65rem;
}

.order-slip p {
  color: var(--landing-muted);
}

.order-slip strong {
  display: block;
  margin-top: 1.15rem;
  color: var(--landing-accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.slip-label {
  color: var(--landing-faint);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.small-slip {
  transform: rotate(-1.5deg);
}

.shared-slip {
  margin-top: 2.25rem;
  transform: rotate(1.25deg);
}

.large-slip {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 0.7fr 1fr;
  gap: 1rem;
  align-items: end;
  transform: rotate(-0.55deg);
}

.equal-split-ticket {
  grid-column: span 2;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  align-items: center;
  background: var(--landing-ink);
  color: var(--landing-paper);
  box-shadow: var(--landing-shadow);
}

.equal-split-ticket span {
  color: var(--landing-paper);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.74;
}

.equal-split-ticket strong {
  color: var(--landing-paper);
  font-family: var(--landing-serif);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 0.95;
  text-align: right;
}

.equal-split-ticket p {
  grid-column: 1 / -1;
  color: var(--landing-paper);
  opacity: 0.72;
}

.section-heading {
  max-width: 56rem;
  margin-bottom: 2rem;
}

.flow-list {
  list-style: none;
  overflow: hidden;
  border-radius: 1.25rem;
  background:
    linear-gradient(90deg, var(--landing-paper-strong), var(--landing-paper));
  box-shadow: var(--landing-shadow);
}

.flow-list li {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) minmax(11rem, 17rem);
  gap: 1.5rem;
  align-items: center;
  padding: clamp(1.1rem, 2vw, 1.55rem);
  border-bottom: 1px solid var(--landing-line);
}

.flow-list li:last-child {
  border-bottom: 0;
}

.flow-number {
  color: var(--landing-accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.flow-list h3 {
  margin-bottom: 0.3rem;
  color: var(--landing-ink);
  font-family: var(--landing-serif);
  font-size: 1.55rem;
}

.flow-list p {
  color: var(--landing-muted);
}

.flow-preview {
  justify-self: end;
  width: min(100%, 17rem);
  padding: 0.85rem;
  border: 1px solid var(--landing-line);
  border-radius: 0.85rem;
  background: rgba(255, 249, 237, 0.7);
  color: var(--landing-ink);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: inset 0 -16px 28px rgba(198, 83, 45, 0.04);
}

.dark .flow-preview {
  background: rgba(255, 244, 228, 0.05);
}

.receipt-mini,
.total-mini {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip-row span,
.split-mini span,
.link-mini {
  color: var(--landing-accent);
}

.chip-row span {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--landing-accent-wash);
  border-radius: 0.55rem;
  background: var(--landing-accent-soft);
}

.split-mini,
.link-mini {
  display: grid;
  gap: 0.25rem;
}

.moments-section {
  border-top: 1px solid var(--landing-line);
}

.moments-layout {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: clamp(2rem, 6vw, 4rem);
  align-items: start;
}

.moments-grid {
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: 1rem;
}

.moment-card {
  padding: 1.35rem;
  border-radius: 1.1rem;
}

.moment-card h3 {
  color: var(--landing-ink);
  font-family: var(--landing-serif);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.05;
}

.moment-card p {
  margin-top: 0.7rem;
  color: var(--landing-muted);
}

.moment-featured {
  grid-row: span 2;
  min-height: 28rem;
  background:
    linear-gradient(180deg, var(--landing-paper), var(--landing-paper-strong));
  box-shadow: var(--landing-shadow);
}

.moment-visual {
  margin-bottom: 1.25rem;
  padding: 1rem;
  border: 1px dashed var(--landing-heavy-line);
  border-radius: 0.9rem;
  background:
    repeating-linear-gradient(0deg, transparent 0 2.1rem, var(--landing-line) 2.1rem 2.15rem);
}

.dish-line {
  display: block;
  margin-bottom: 4.8rem;
  color: var(--landing-accent);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 800;
}

.calculation-moment {
  transform: translateY(1.25rem);
}

.mini-ledger {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--landing-heavy-line);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.edit-moment {
  background: var(--landing-ink);
  color: var(--landing-paper);
}

.edit-moment h3,
.edit-moment p {
  color: var(--landing-paper);
}

.edit-moment p {
  opacity: 0.76;
}

.edit-pill,
.message-preview {
  margin-top: 1.1rem;
  padding: 0.8rem;
  border: 1px solid rgba(255, 249, 237, 0.16);
  border-radius: 0.8rem;
  background: rgba(255, 249, 237, 0.08);
  color: var(--landing-paper);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
}

.message-preview {
  border-color: var(--landing-line);
  background: rgba(198, 83, 45, 0.08);
  color: var(--landing-ink);
}

.message-preview span,
.message-preview strong {
  display: block;
}

.message-preview span {
  color: var(--landing-muted);
  font-weight: 700;
}

.message-preview strong {
  margin-top: 0.2rem;
  color: var(--landing-accent);
}

.closing-section {
  padding: clamp(3.5rem, 7vw, 6.5rem) 0;
  border-top: 1px solid var(--landing-line);
}

.closing-receipt {
  position: relative;
  overflow: hidden;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 5vw, 3.5rem) 4.5rem;
  border-radius: 1.2rem 1.2rem 0.85rem 0.85rem;
  text-align: center;
  box-shadow: var(--landing-shadow);
}

.closing-receipt .eyebrow {
  justify-content: center;
}

.closing-receipt .eyebrow::after {
  content: "";
  width: 1.8rem;
  height: 1px;
  background: currentColor;
}

.closing-receipt .btn {
  margin-top: 1.6rem;
}

.closing-total {
  position: absolute;
  right: 1.4rem;
  bottom: 1.25rem;
  left: 1.4rem;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  color: var(--landing-faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-footer {
  border-top-color: var(--landing-line);
  color: var(--landing-muted);
}

.landing-footer a {
  color: var(--landing-ink);
  font-weight: 800;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-receipt,
  .split-card,
  .share-card,
  .order-slip,
  .equal-split-ticket,
  .moment-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .bill-stage:hover .hero-receipt {
    transform: rotate(-1.25deg) translateY(-3px);
  }

  .bill-stage:hover .split-card {
    transform: rotate(0.7deg) translateY(-4px);
  }

  .bill-stage:hover .share-card {
    transform: rotate(-0.4deg) translateY(-3px);
  }
}

@media (max-width: 980px) {
  .hero-layout,
  .problem-layout,
  .moments-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .section-copy {
    max-width: 48rem;
  }

  .hero-copy h1 {
    max-width: 12ch;
  }

  .bill-stage {
    min-height: 675px;
  }

  .hero-receipt {
    left: 4%;
  }

  .split-card {
    right: 4%;
  }

  .share-card {
    right: 10%;
  }
}

@media (max-width: 760px) {
  .landing-nav .nav-link {
    display: none;
  }

  .landing-hero {
    padding-top: 3.5rem;
  }

  .hero-proof,
  .problem-board,
  .moments-grid {
    grid-template-columns: 1fr;
  }

  .large-slip,
  .equal-split-ticket {
    grid-column: auto;
  }

  .large-slip {
    display: block;
  }

  .shared-slip,
  .calculation-moment {
    margin-top: 0;
    transform: none;
  }

  .flow-list li {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .flow-preview {
    justify-self: stretch;
    width: 100%;
  }

  .moment-featured {
    grid-row: auto;
    min-height: auto;
  }

  .dish-line {
    margin-bottom: 2.5rem;
  }
}

@media (max-width: 560px) {
  .landing-shell {
    width: min(100% - 1.25rem, 1180px);
  }

  .landing-header-content {
    padding: 0 0.75rem;
  }

  .landing-logo {
    font-size: 1.02rem;
  }

  .landing-nav {
    gap: 0.45rem;
  }

  .landing-nav .btn-sm {
    padding: 0.35rem 0.62rem;
    font-size: 0.72rem;
  }

  .landing-page .theme-toggle {
    padding: 0.45rem;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-proof {
    gap: 0.55rem;
  }

  .bill-stage {
    display: grid;
    gap: 1rem;
    min-height: auto;
  }

  .stage-orbit {
    display: none;
  }

  .hero-receipt,
  .split-card,
  .share-card {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    transform: none;
  }

  .hero-receipt {
    min-height: auto;
    padding-bottom: 1.25rem;
  }

  .receipt-card::after {
    display: none;
  }

  .calculation-strip {
    padding-bottom: 0;
  }

  .equal-warning {
    position: static;
    margin-top: 1rem;
  }

  .receipt-head {
    display: block;
  }

  .receipt-stamp {
    margin-top: 0.75rem;
  }

  .receipt-table {
    font-size: 0.72rem;
  }

  .receipt-table th:nth-child(2),
  .receipt-table td:nth-child(2) {
    display: none;
  }

  .share-card {
    grid-template-columns: 1fr;
  }

  .equal-split-ticket {
    grid-template-columns: 1fr;
  }

  .equal-split-ticket strong {
    text-align: left;
  }

  .order-slip,
  .equal-split-ticket,
  .moment-card {
    padding: 1.05rem;
  }

  .closing-total {
    flex-wrap: wrap;
  }
}
