/* ============================================================
   REVERRA · Design System
   ============================================================ */
:root {
  --cream: #f4ede1;
  --cream-2: #ede4d3;
  --paper: #faf6ec;
  --bone: #f8f4ea;
  --ink: #1f1b16;
  --ink-2: #2c2620;
  --ink-soft: #4a4239;
  --ink-mute: #8a7f6f;
  --line: #d9cfba;
  --line-soft: #e7ddc8;
  --sage: #5c6f4a;
  --sage-deep: #3d4f30;
  --sage-light: #aabd95;
  --sage-tint: #d6e0c0;
  --terra: #c5613a;
  --terra-deep: #9c4827;
  --terra-light: #e8a07f;
  --terra-tint: #f0cdb6;
  --gold: #b58a3f;
  --gold-light: #ead9b0;
  --plum: #6b3a52;
  --sky: #6e8aa6;
  --good: #5c6f4a;
  --warn: #b58a3f;
  --bad: #9c4827;
  --shadow-sm: 0 1px 2px rgba(31,27,22,.06);
  --shadow: 0 8px 24px -12px rgba(31,27,22,.18), 0 2px 4px rgba(31,27,22,.04);
  --shadow-lg: 0 24px 48px -16px rgba(31,27,22,.22);
  --shadow-xl: 0 40px 80px -20px rgba(31,27,22,.28);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --serif: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { background: var(--cream); scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; }

/* Paper grain background */
.grain::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .1 0 0 0 0 .08 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   LANDING — NAV
   ============================================================ */
.landing { position: relative; min-height: 100vh; }
.landing-inner { position: relative; z-index: 1; }

.lnav {
  position: sticky; top: 0; z-index: 50;
  padding: 14px 24px;
  background: rgba(244,237,225,.85);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  display: flex; align-items: center; justify-content: space-between;
  transition: border-color .2s;
}
.lnav.scrolled { border-bottom-color: var(--line-soft); }
.lnav-brand {
  display: flex; align-items: baseline; gap: 6px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -.02em;
  color: var(--ink);
  font-style: italic;
  text-decoration: none;
}
.lnav-brand b { color: var(--terra); font-weight: 500; }
.lnav-brand .leaf { font-style: normal; font-size: 22px; }
.lnav-links { display: flex; gap: 28px; align-items: center; }
.lnav-links a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color .2s;
}
.lnav-links a:hover { color: var(--terra); }
.lnav-cta {
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
}
.lnav-cta:hover { background: var(--terra); transform: translateY(-1px); }
@media (max-width: 720px) {
  .lnav-links a:not(.lnav-cta) { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero-section {
  padding: 60px 24px 100px;
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 28px;
  animation: fadeUp .6s .1s both;
}
.hero-eyebrow .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px rgba(92,111,74,.2);
}
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 8.5vw, 104px);
  line-height: .96;
  letter-spacing: -.035em;
  margin: 0 0 28px;
  max-width: 14ch;
  animation: fadeUp .7s .15s both;
}
.hero-title em { font-style: italic; color: var(--terra); }
.hero-title .strike {
  position: relative;
  color: var(--ink-mute);
  display: inline-block;
}
.hero-title .strike::after {
  content: "";
  position: absolute;
  left: -4%; right: -4%;
  top: 52%; height: 6px;
  background: var(--terra);
  transform: rotate(-2deg);
  border-radius: 4px;
}
.hero-lede {
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 580px;
  margin: 0 0 36px;
  animation: fadeUp .8s .25s both;
}
.hero-cta-row {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  animation: fadeUp .9s .35s both;
}
.btn-primary {
  padding: 16px 26px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .005em;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all .25s cubic-bezier(.2,.7,.3,1);
  box-shadow: 0 8px 20px -8px rgba(31,27,22,.4);
}
.btn-primary:hover { background: var(--terra); transform: translateY(-2px); box-shadow: 0 16px 28px -10px rgba(197,97,58,.55); }
.btn-primary svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }
.btn-ghost {
  padding: 16px 22px;
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all .2s;
}
.btn-ghost:hover { background: var(--paper); }
.btn-ghost .play {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  display: grid; place-items: center;
  font-size: 10px;
}
.hero-trust {
  margin-top: 40px;
  display: flex; flex-wrap: wrap; gap: 22px;
  align-items: center;
  animation: fadeUp 1s .5s both;
}
.hero-trust-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--ink-mute);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.hero-trust-item svg { width: 14px; height: 14px; stroke: var(--sage); stroke-width: 2; fill: none; }

/* Floating preview card */
.hero-preview {
  position: absolute;
  top: 90px; right: 24px;
  width: 340px;
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-xl);
  transform: rotate(2.5deg);
  animation: floatIn 1.2s .8s both;
}
.hero-preview::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--terra) 0%, transparent 50%);
  opacity: .3;
  z-index: -1;
}
.hp-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(244,237,225,.55);
  margin-bottom: 8px;
}
.hp-line { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.hp-line:last-child { margin-bottom: 0; }
.hp-name { font-family: var(--serif); font-style: italic; font-size: 16px; }
.hp-val { font-family: var(--mono); font-size: 14px; color: var(--terra-light); font-weight: 500; }
.hp-divider { height: 1px; background: rgba(244,237,225,.12); margin: 12px 0; }
.hp-trend {
  margin-top: 14px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: rgba(92,111,74,.18);
  border-radius: 8px;
  font-size: 12px;
  color: var(--sage-light);
}
@media (max-width: 1024px) { .hero-preview { display: none; } }

@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes floatIn { from { opacity: 0; transform: rotate(2.5deg) translateY(40px); } to { opacity: 1; transform: rotate(2.5deg); } }
@keyframes float { 0%, 100% { transform: rotate(2.5deg) translateY(0); } 50% { transform: rotate(2.5deg) translateY(-8px); } }

/* ============================================================
   PRIVACY PROMISE BAR
   ============================================================ */
.promise-bar {
  background: var(--ink);
  color: var(--cream);
  padding: 22px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.promise-bar::before {
  content: "";
  position: absolute;
  top: -50%; left: -10%; right: -10%; bottom: -50%;
  background: radial-gradient(ellipse at center, rgba(197,97,58,.15) 0%, transparent 60%);
  pointer-events: none;
}
.promise-content {
  position: relative;
  display: flex; flex-wrap: wrap; gap: 32px;
  justify-content: center; align-items: center;
  max-width: 1200px; margin: 0 auto;
}
.promise-item {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(244,237,225,.85);
}
.promise-item svg { width: 16px; height: 16px; stroke: var(--terra-light); stroke-width: 2; fill: none; }

/* ============================================================
   "THE LIBRE PROBLEM" SECTION
   ============================================================ */
.section { padding: 100px 24px; max-width: 1180px; margin: 0 auto; }
.section-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 14px;
  font-weight: 500;
}
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -.025em;
  margin: 0 0 22px;
  max-width: 18ch;
}
.section-title em { font-style: italic; color: var(--terra); }
.section-lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 620px;
  margin-bottom: 56px;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 720px) { .compare-grid { grid-template-columns: 1fr; } }

.compare-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  position: relative;
}
.compare-card.them {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-mute);
}
.compare-card.us {
  background: var(--ink);
  color: var(--cream);
  box-shadow: var(--shadow-xl);
}
.compare-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.compare-card.them .compare-tag {
  background: var(--line-soft);
  color: var(--ink-mute);
}
.compare-card.us .compare-tag {
  background: rgba(232,160,127,.18);
  color: var(--terra-light);
}
.compare-headline {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.015em;
  margin: 0 0 24px;
}
.compare-card.them .compare-headline { color: var(--ink-soft); }
.compare-list { list-style: none; padding: 0; margin: 0; }
.compare-list li {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid;
  border-color: inherit;
  font-size: 15px;
  line-height: 1.4;
}
.compare-card.them .compare-list li { border-bottom-color: var(--line-soft); }
.compare-card.us .compare-list li { border-bottom-color: rgba(244,237,225,.1); }
.compare-list li:last-child { border-bottom: none; }
.compare-list .marker {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin-top: 2px;
}
.compare-card.them .marker { background: var(--cream-2); color: var(--ink-mute); }
.compare-card.us .marker { background: var(--sage); color: var(--cream); }
.compare-list .marker svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 3; fill: none; }

/* ============================================================
   FEATURES GRID
   ============================================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 880px) { .features-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .features-grid { grid-template-columns: 1fr; } }

.feature-card {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  transition: all .3s cubic-bezier(.2,.7,.3,1);
  position: relative;
  overflow: hidden;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.feature-card.span2 { grid-column: span 2; }
@media (max-width: 880px) { .feature-card.span2 { grid-column: span 1; } }

.feature-card.dark {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.feature-card.dark:hover { background: var(--ink-2); }

.feature-card.sage {
  background: linear-gradient(135deg, var(--sage-tint) 0%, #e9f0d6 100%);
  border-color: var(--sage-light);
}
.feature-card.terra {
  background: linear-gradient(135deg, var(--terra-tint) 0%, #fae0cf 100%);
  border-color: var(--terra-light);
}
.feature-card.gold {
  background: linear-gradient(135deg, var(--gold-light) 0%, #f3e3b8 100%);
  border-color: #d6c084;
}

.feature-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--cream);
  display: grid; place-items: center;
  margin-bottom: 18px;
  font-size: 22px;
}
.feature-card.dark .feature-icon { background: var(--terra); }
.feature-card.sage .feature-icon { background: var(--sage-deep); }
.feature-card.terra .feature-icon { background: var(--terra-deep); }
.feature-card.gold .feature-icon { background: var(--gold); }

.feature-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -.01em;
  margin: 0 0 8px;
}
.feature-card.dark .feature-title em { color: var(--terra-light); font-style: italic; }
.feature-title em { font-style: italic; color: var(--terra); }
.feature-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.feature-card.dark .feature-desc { color: rgba(244,237,225,.75); }

.feature-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-top: 14px;
  background: rgba(31,27,22,.06);
  color: var(--ink-soft);
}
.feature-card.dark .feature-tag { background: rgba(244,237,225,.1); color: var(--cream); }

/* ============================================================
   "HOW IT WORKS" — 3 STEPS
   ============================================================ */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 40px;
}
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }

.step {
  position: relative;
  padding: 28px 0 0;
  border-top: 1px solid var(--ink);
}
.step-num {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 90px;
  line-height: .8;
  letter-spacing: -.04em;
  color: var(--terra);
  font-style: italic;
  margin-bottom: 14px;
}
.step-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.2;
  margin: 0 0 10px;
}
.step-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testimonials {
  background: var(--ink);
  color: var(--cream);
  padding: 100px 24px;
  position: relative;
  overflow: hidden;
}
.testimonials::before {
  content: "";
  position: absolute;
  top: -20%; right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(197,97,58,.2) 0%, transparent 60%);
  pointer-events: none;
}
.testimonials-inner { max-width: 1180px; margin: 0 auto; position: relative; }
.testimonials .section-eyebrow { color: var(--terra-light); }
.testimonials .section-title { color: var(--cream); }
.testimonials .section-title em { color: var(--terra-light); }
.testimonials .section-lede { color: rgba(244,237,225,.7); }

.tcards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 880px) { .tcards { grid-template-columns: 1fr; } }

.tcard {
  background: rgba(244,237,225,.05);
  border: 1px solid rgba(244,237,225,.12);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
}
.tcard-result {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--sage);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 18px;
  font-weight: 500;
}
.tcard-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.45;
  letter-spacing: -.005em;
  margin: 0 0 22px;
  color: var(--cream);
}
.tcard-author {
  display: flex; align-items: center; gap: 12px;
  padding-top: 18px;
  border-top: 1px solid rgba(244,237,225,.12);
}
.tcard-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--terra);
  color: var(--cream);
  display: grid; place-items: center;
  font-family: var(--serif);
  font-weight: 500;
}
.tcard-name { font-size: 14px; font-weight: 500; }
.tcard-meta {
  font-size: 11px;
  color: rgba(244,237,225,.5);
  font-family: var(--mono);
  letter-spacing: .04em;
}

/* ============================================================
   PRICING
   ============================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 880px;
  margin: 0 auto;
}
@media (max-width: 720px) { .pricing-grid { grid-template-columns: 1fr; } }

.pricing-card {
  padding: 36px 32px;
  border-radius: var(--radius-lg);
  background: var(--paper);
  border: 1px solid var(--line);
  position: relative;
}
.pricing-card.featured {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
  box-shadow: var(--shadow-xl);
  transform: scale(1.02);
}
@media (max-width: 720px) { .pricing-card.featured { transform: none; } }

.pricing-badge {
  position: absolute;
  top: -12px; right: 24px;
  padding: 5px 12px;
  background: var(--terra);
  color: var(--cream);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 500;
}
.pricing-name {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 16px;
}
.pricing-card.featured .pricing-name { color: var(--terra-light); }
.pricing-price {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 64px;
  line-height: 1;
  letter-spacing: -.03em;
  margin: 0 0 4px;
}
.pricing-price small {
  font-size: 16px;
  font-weight: 400;
  color: var(--ink-mute);
  font-family: var(--sans);
}
.pricing-card.featured .pricing-price small { color: rgba(244,237,225,.5); }
.pricing-tagline {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 28px;
  font-style: italic;
}
.pricing-card.featured .pricing-tagline { color: rgba(244,237,225,.7); }

.pricing-features {
  list-style: none; padding: 0; margin: 0 0 32px;
}
.pricing-features li {
  padding: 9px 0;
  display: flex; gap: 10px;
  font-size: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.pricing-card.featured .pricing-features li { border-bottom-color: rgba(244,237,225,.1); }
.pricing-features li:last-child { border-bottom: none; }
.pricing-features .check {
  flex-shrink: 0;
  color: var(--sage);
  margin-top: 2px;
  width: 14px; height: 14px;
}
.pricing-card.featured .check { color: var(--terra-light); }
.pricing-features svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.5; fill: none; }

.pricing-cta {
  width: 100%;
  padding: 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
}
.pricing-cta:hover { background: var(--terra); }
.pricing-card.featured .pricing-cta {
  background: var(--terra);
}
.pricing-card.featured .pricing-cta:hover { background: var(--cream); color: var(--ink); }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
}
.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}
.faq-q {
  display: flex; justify-content: space-between; align-items: flex-start;
  cursor: pointer;
  gap: 16px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -.005em;
  color: var(--ink);
  width: 100%;
  text-align: left;
}
.faq-q .toggle {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  transition: all .2s;
  font-size: 14px;
  background: var(--paper);
}
.faq-item.open .faq-q .toggle { background: var(--ink); color: var(--cream); border-color: var(--ink); transform: rotate(45deg); }
.faq-a {
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s cubic-bezier(.2,.7,.3,1), margin-top .25s;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
}
.faq-item.open .faq-a { max-height: 320px; margin-top: 12px; }

/* ============================================================
   FOOTER + FINAL CTA
   ============================================================ */
.final-cta {
  padding: 100px 24px;
  text-align: center;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%);
}
.final-cta-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -.03em;
  margin: 0 0 20px;
  max-width: 18ch;
  margin-left: auto; margin-right: auto;
}
.final-cta-title em { font-style: italic; color: var(--terra); }
.final-cta-sub {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 540px;
  margin: 0 auto 36px;
}

footer.lfoot {
  background: var(--ink);
  color: rgba(244,237,225,.65);
  padding: 60px 24px 40px;
}
.lfoot-inner {
  max-width: 1180px; margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 720px) { .lfoot-inner { grid-template-columns: 1fr 1fr; } }
.lfoot-brand {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  color: var(--cream);
  margin-bottom: 12px;
}
.lfoot-brand b { color: var(--terra-light); }
.lfoot-tagline { font-size: 13px; line-height: 1.55; max-width: 26ch; }
.lfoot-col h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cream);
  margin: 0 0 16px;
  font-weight: 500;
}
.lfoot-col a {
  display: block;
  padding: 6px 0;
  font-size: 13px;
  color: rgba(244,237,225,.6);
  text-decoration: none;
  transition: color .15s;
}
.lfoot-col a:hover { color: var(--terra-light); }
.lfoot-bottom {
  max-width: 1180px;
  margin: 50px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(244,237,225,.1);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: rgba(244,237,225,.4);
}

/* ============================================================
   AUTH SCREEN
   ============================================================ */
.auth-screen {
  position: fixed; inset: 0;
  background: var(--cream);
  z-index: 200;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}
.auth-screen.active { display: flex; }
.auth-screen::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .1 0 0 0 0 .08 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.auth-inner {
  position: relative; z-index: 1;
  width: 100%; max-width: 460px;
  margin: 0 auto;
  padding: 40px 22px;
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: center;
}
.auth-back {
  position: absolute;
  top: 24px; left: 24px;
  font-size: 13px;
  color: var(--ink-mute);
  text-decoration: none;
  font-weight: 500;
}
.auth-back:hover { color: var(--ink); }
.auth-brand {
  font-family: var(--serif);
  font-weight: 500; font-style: italic;
  font-size: 28px;
  letter-spacing: -.02em;
  margin-bottom: 8px;
  color: var(--ink);
}
.auth-brand b { color: var(--terra); }
.auth-step-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 18px;
}
.auth-title {
  font-family: var(--serif);
  font-weight: 400; font-style: italic;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -.02em;
  margin: 0 0 12px;
}
.auth-title b { font-style: normal; font-weight: 500; color: var(--terra); }
.auth-sub { font-size: 15px; line-height: 1.55; color: var(--ink-soft); margin-bottom: 28px; }

.auth-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.auth-option {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  width: 100%;
  text-align: left;
  transition: all .2s;
}
.auth-option:hover { border-color: var(--ink); transform: translateY(-1px); box-shadow: var(--shadow); }
.auth-option .icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 18px;
}
.auth-option.passkey { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.auth-option.passkey:hover { background: var(--terra); border-color: var(--terra); }
.auth-option .badge {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--sage-tint);
  color: var(--sage-deep);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 500;
}
.auth-option.passkey .badge { background: var(--terra); color: var(--cream); }
.auth-option .meta {
  display: block;
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 400;
  margin-top: 2px;
  font-family: var(--mono);
  letter-spacing: .04em;
}
.auth-option.passkey .meta { color: rgba(244,237,225,.55); }
.auth-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 14px 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.otp-inputs { display: flex; gap: 8px; justify-content: center; margin: 14px 0; }
.otp-inputs input {
  width: 44px; height: 54px;
  text-align: center;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  outline: none;
}
.otp-inputs input:focus { border-color: var(--terra); box-shadow: 0 0 0 3px rgba(197,97,58,.12); }
.auth-notice {
  padding: 14px 16px;
  background: var(--sage-tint);
  border-radius: var(--radius);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--sage-deep);
  margin-top: 18px;
  border: 1px solid var(--sage-light);
}
.auth-notice strong { color: var(--sage-deep); }
.auth-tiny {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--ink-mute);
  text-align: center;
}
.auth-tiny a { color: var(--terra); text-decoration: none; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: none;
  flex-direction: column;
  padding-bottom: 88px;
  background: var(--paper);
  box-shadow: 0 0 60px -20px rgba(31,27,22,.15);
}
.app.active { display: flex; }
@media (min-width: 481px) { .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
header.topbar {
  position: sticky; top: 0; z-index: 50;
  padding: 16px 20px 14px;
  background: rgba(250,246,236,.92);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-mark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -.02em;
  line-height: 1;
  font-style: italic;
}
.brand-mark span { color: var(--terra); }
.brand-tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-left: 4px;
  border-left: 1px solid var(--line);
}
.header-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  display: grid; place-items: center;
  font-size: 16px;
  transition: all .15s;
  position: relative;
}
.icon-btn:hover { background: var(--cream-2); color: var(--ink); }
.icon-btn .indicator {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--terra);
  border: 1.5px solid var(--paper);
}
.icon-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }

nav.bottombar {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: rgba(250,246,236,.96);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--line-soft);
  z-index: 60;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}
.navbtn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  color: var(--ink-mute);
  font-size: 10px;
  font-weight: 500;
  border-radius: 12px;
  transition: all .2s;
}
.navbtn svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.navbtn.active { color: var(--terra); }
.navbtn:active { transform: scale(.95); }

main {
  flex: 1;
  padding: 18px 18px 28px;
  display: flex; flex-direction: column;
  gap: 18px;
}
.view { display: none; flex-direction: column; gap: 18px; animation: fadeViewIn .35s ease; }
.view.active { display: flex; }
@keyframes fadeViewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.card.warm { background: linear-gradient(180deg, #fbf5e7 0%, #f5ecd6 100%); border-color: #e5d8b8; }
.card.sage { background: linear-gradient(180deg, #eef2e3 0%, #e3ead0 100%); border-color: #c8d3a8; }
.card.terra { background: linear-gradient(180deg, #f8e4d6 0%, #f0d0bb 100%); border-color: #e2b08a; }
.card-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -.01em;
  margin: 0 0 6px;
}
.card-title em { font-style: italic; color: var(--terra); }
.card-sub {
  font-size: 12px;
  color: var(--ink-mute);
  font-family: var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.app-hero {
  padding: 22px 20px 24px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, rgba(197,97,58,.18) 0%, transparent 55%),
    linear-gradient(135deg, #2e2820 0%, #3a3024 60%, #4a3a26 100%);
  color: var(--cream);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.app-hero::before {
  content: "";
  position: absolute;
  top: -40px; right: -30px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(231,184,118,.25) 0%, transparent 70%);
  pointer-events: none;
}
.hero-eyebrow-app {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(244,237,225,.55);
  margin-bottom: 6px;
}
.app-hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 10px;
}
.app-hero-title em { font-style: italic; color: var(--terra-light); }
.app-hero-msg { font-size: 14px; line-height: 1.55; color: rgba(244,237,225,.82); max-width: 92%; }
.app-hero-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.hero-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(244,237,225,.25);
  background: rgba(244,237,225,.06);
  font-size: 11px;
  font-weight: 500;
  color: var(--cream);
  display: inline-flex; align-items: center; gap: 5px;
}
.hero-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--terra-light);
  box-shadow: 0 0 0 3px rgba(232,160,127,.18);
}

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; overflow: hidden; }
.metric-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.metric-value {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.02em;
}
.metric-value .unit {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-mute);
  margin-left: 3px;
}
.metric-trend { margin-top: 8px; font-size: 11px; color: var(--ink-soft); }
.metric.good .metric-value { color: var(--sage-deep); }
.metric.warn .metric-value { color: var(--gold); }
.metric.bad  .metric-value { color: var(--terra-deep); }
.metric .bar { margin-top: 10px; height: 4px; background: var(--line-soft); border-radius: 2px; overflow: hidden; }
.metric .bar > span { display: block; height: 100%; background: var(--sage); border-radius: 2px; transition: width .6s ease; }
.metric.warn .bar > span { background: var(--gold); }
.metric.bad  .bar > span { background: var(--terra); }

.charter-section { border-top: 1px solid var(--line-soft); padding-top: 14px; margin-top: 14px; }
.charter-section:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.charter-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.charter-heading h4 { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 17px; }
.charter-time { font-family: var(--mono); font-size: 10px; color: var(--ink-mute); letter-spacing: .1em; }
.charter-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid transparent;
  transition: all .2s;
}
.charter-item:hover { border-color: var(--line); background: var(--cream-2); }
.charter-item.done { opacity: .55; }
.charter-item.done .charter-name { text-decoration: line-through; }
.check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--paper);
  transition: all .2s;
  margin-top: 1px;
}
.charter-item.done .check { background: var(--sage); border-color: var(--sage-deep); color: var(--cream); }
.check svg { width: 12px; height: 12px; opacity: 0; transition: opacity .2s; stroke: currentColor; stroke-width: 2.5; fill: none; }
.charter-item.done .check svg { opacity: 1; }
.charter-body { flex: 1; min-width: 0; }
.charter-name { font-weight: 500; font-size: 14px; line-height: 1.3; margin-bottom: 2px; }
.charter-meta { font-size: 12px; color: var(--ink-mute); line-height: 1.4; }
.charter-meta .tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--line-soft);
  color: var(--ink-soft);
  font-size: 10px;
  font-family: var(--mono);
  margin-right: 4px;
}
.charter-meta .tag.sage { background: var(--sage-tint); color: var(--sage-deep); }
.charter-meta .tag.gold { background: var(--gold-light); color: var(--gold); }
.charter-meta .tag.terra { background: var(--terra-tint); color: var(--terra-deep); }

.chat-wrap { display: flex; flex-direction: column; height: calc(100dvh - 200px); min-height: 420px; }
.chat-log { flex: 1; overflow-y: auto; padding: 4px 2px 12px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; word-wrap: break-word; animation: msgIn .3s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.user { align-self: flex-end; background: var(--ink); color: var(--cream); border-bottom-right-radius: 4px; }
.msg.agent { align-self: flex-start; background: var(--cream-2); border: 1px solid var(--line-soft); border-bottom-left-radius: 4px; }
.msg.agent .msg-name { font-family: var(--serif); font-style: italic; font-size: 12px; color: var(--terra); margin-bottom: 2px; font-weight: 500; }
.msg.agent strong { color: var(--sage-deep); font-weight: 600; }
.msg.agent em { color: var(--terra-deep); }
.msg.agent ul, .msg.agent ol { margin: 6px 0; padding-left: 18px; }
.msg.system { align-self: center; color: var(--ink-mute); font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }
.typing { display: inline-flex; gap: 4px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-mute); animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; transform: scale(.9); } 30% { opacity: 1; transform: scale(1.1); } }

.chat-input { display: flex; gap: 8px; padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; margin-top: 8px; }
.chat-input textarea { flex: 1; resize: none; font-family: var(--sans); font-size: 14px; outline: none; line-height: 1.4; min-height: 22px; max-height: 96px; padding: 8px 6px; border: none; background: transparent; }
.chat-input textarea::placeholder { color: var(--ink-mute); font-style: italic; }
.send-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--terra); color: white; display: grid; place-items: center; flex-shrink: 0; align-self: flex-end; transition: all .2s; }
.send-btn:hover { background: var(--terra-deep); transform: scale(1.05); }
.send-btn:disabled { background: var(--line); cursor: not-allowed; transform: none; }
.send-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }
.quick-replies { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick-reply { padding: 7px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--ink-soft); font-weight: 500; transition: all .2s; }
.quick-reply:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.log-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.log-btn { padding: 14px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-align: left; transition: all .2s; position: relative; }
.log-btn:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); }
.log-btn-emoji { font-size: 24px; display: block; margin-bottom: 4px; }
.log-btn-name { font-family: var(--serif); font-weight: 500; font-size: 14px; color: var(--ink); }
.log-btn-sub { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }
.log-btn .new-badge { position: absolute; top: 8px; right: 8px; padding: 2px 7px; background: var(--terra); color: var(--cream); border-radius: 999px; font-family: var(--mono); font-size: 8px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }

.form-group { margin-bottom: 14px; }
input[type="text"], input[type="number"], input[type="email"], input[type="password"], input[type="date"], select, textarea {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: all .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--terra); box-shadow: 0 0 0 3px rgba(197,97,58,.12); }
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.input-with-unit { position: relative; display: flex; align-items: center; }
.input-with-unit input { padding-right: 56px !important; }
.input-unit-label { position: absolute; right: 12px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--ink-mute); text-transform: uppercase; pointer-events: none; }
.height-row { display: flex; gap: 8px; }
.height-row > div { flex: 1; }
.btn { padding: 12px 20px; border-radius: var(--radius-sm); background: var(--ink); color: var(--cream); font-weight: 500; font-size: 14px; border: 1px solid var(--ink); transition: all .2s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: var(--terra-deep); border-color: var(--terra-deep); }
.btn.secondary { background: var(--paper); color: var(--ink); }
.btn.secondary:hover { background: var(--cream-2); }
.btn.full { width: 100%; }
.btn.terra { background: var(--terra); border-color: var(--terra); }
.btn.terra:hover { background: var(--terra-deep); border-color: var(--terra-deep); }
.btn-row { display: flex; gap: 8px; margin-top: 6px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.modal-bg { position: fixed; inset: 0; background: rgba(31,27,22,.55); backdrop-filter: blur(4px); z-index: 100; display: none; align-items: flex-end; justify-content: center; }
.modal-bg.active { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { width: 100%; max-width: 480px; background: var(--paper); border-top-left-radius: 24px; border-top-right-radius: 24px; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; animation: slideUp .35s cubic-bezier(.2,.7,.3,1); }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.modal-handle { width: 40px; height: 4px; background: var(--line); border-radius: 2px; margin: 0 auto 14px; }
.modal-title { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
.modal-sub { font-size: 13px; color: var(--ink-mute); margin-bottom: 18px; }
label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 6px; }

.onboard { position: fixed; inset: 0; background: var(--cream); z-index: 200; display: none; flex-direction: column; overflow-y: auto; }
.onboard.active { display: flex; }
.onboard-inner { max-width: 480px; width: 100%; margin: 0 auto; padding: 32px 22px 60px; flex: 1; display: flex; flex-direction: column; }
.onboard-step { display: none; flex: 1; flex-direction: column; }
.onboard-step.active { display: flex; animation: fadeViewIn .4s ease; }
.step-count { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: var(--ink-mute); text-transform: uppercase; margin-bottom: 14px; }
.step-title { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 32px; line-height: 1.1; margin: 0 0 8px; letter-spacing: -.02em; }
.step-title b { font-style: normal; font-weight: 500; color: var(--terra); }
.step-msg { font-size: 15px; color: var(--ink-soft); line-height: 1.55; margin-bottom: 22px; }
.step-content { flex: 1; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 13px; color: var(--ink-soft); font-weight: 500; transition: all .15s; user-select: none; }
.chip:hover { border-color: var(--ink); }
.chip.selected { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.onboard-nav { display: flex; gap: 10px; margin-top: 24px; padding-top: 14px; }

.toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--cream); padding: 12px 18px; border-radius: 999px; font-size: 13px; font-weight: 500; z-index: 250; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .3s cubic-bezier(.2,.7,.3,1); max-width: 90%; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--sage-deep); }
.toast.error { background: var(--terra-deep); }

.empty { text-align: center; padding: 40px 20px; color: var(--ink-mute); }
.empty-icon { font-size: 36px; margin-bottom: 8px; opacity: .7; }
.empty-text { font-family: var(--serif); font-style: italic; font-size: 16px; }
.insight { padding: 14px 16px; border-left: 3px solid var(--sage); background: linear-gradient(90deg, rgba(170,189,149,.12) 0%, transparent 100%); border-radius: var(--radius-sm); margin-bottom: 10px; }
.insight.warn { border-color: var(--gold); background: linear-gradient(90deg, rgba(181,138,63,.12) 0%, transparent 100%); }
.insight.terra { border-color: var(--terra); background: linear-gradient(90deg, rgba(197,97,58,.12) 0%, transparent 100%); }
.insight h5 { margin: 0 0 4px; font-family: var(--serif); font-weight: 500; font-style: italic; font-size: 15px; }
.insight p { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.trend-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.trend-row:last-child { margin-bottom: 0; }
.trend-date { font-family: var(--mono); font-size: 10px; color: var(--ink-mute); width: 56px; flex-shrink: 0; }
.trend-bar { flex: 1; height: 18px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.trend-bar > span { display: block; height: 100%; border-radius: 4px; transition: width .6s ease; }
.trend-bar > span.good { background: linear-gradient(90deg, var(--sage-light), var(--sage)); }
.trend-bar > span.warn { background: linear-gradient(90deg, #e2c98f, var(--gold)); }
.trend-bar > span.bad  { background: linear-gradient(90deg, var(--terra-light), var(--terra)); }
.trend-val { font-family: var(--mono); font-size: 11px; width: 90px; text-align: right; flex-shrink: 0; font-weight: 500; }

.badge { padding: 3px 9px; border-radius: 999px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft); display: inline-block; }
.badge.sage { background: var(--sage-tint); border-color: var(--sage-light); color: var(--sage-deep); }
.badge.terra { background: var(--terra-tint); border-color: var(--terra-light); color: var(--terra-deep); }
.badge.gold { background: var(--gold-light); border-color: #d6c084; color: var(--gold); }
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.divider { height: 1px; background: var(--line-soft); margin: 8px 0; }
.disclaimer { font-family: var(--mono); font-size: 10px; color: var(--ink-mute); line-height: 1.55; text-align: center; padding: 14px 20px; border-top: 1px solid var(--line-soft); margin-top: 10px; }
.unit-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--paper); }
.unit-toggle button { padding: 4px 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--ink-mute); text-transform: uppercase; transition: all .15s; }
.unit-toggle button.active { background: var(--ink); color: var(--cream); }

/* Scan UI */
.scan-modal { position: fixed; inset: 0; background: #000; z-index: 250; display: none; flex-direction: column; }
.scan-modal.active { display: flex; }
.scan-header { padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; color: var(--cream); background: linear-gradient(180deg, rgba(0,0,0,.7) 0%, transparent 100%); position: absolute; top: 0; left: 0; right: 0; z-index: 2; }
.scan-close { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.15); backdrop-filter: blur(8px); color: var(--cream); display: grid; place-items: center; font-size: 18px; }
.scan-title { font-family: var(--serif); font-style: italic; font-size: 18px; }
.scan-video-wrap { flex: 1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #111; }
.scan-video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; width: 78%; aspect-ratio: 1; max-width: 360px; border: 2px solid rgba(255,255,255,.4); border-radius: 20px; pointer-events: none; }
.scan-frame::before, .scan-frame::after, .scan-frame > span:first-child, .scan-frame > span:last-child { content: ""; position: absolute; width: 28px; height: 28px; border: 3px solid var(--terra); }
.scan-frame::before { top: -3px; left: -3px; border-right: none; border-bottom: none; border-top-left-radius: 14px; }
.scan-frame::after  { top: -3px; right: -3px; border-left: none; border-bottom: none; border-top-right-radius: 14px; }
.scan-frame > span:first-child { bottom: -3px; left: -3px; border-right: none; border-top: none; border-bottom-left-radius: 14px; }
.scan-frame > span:last-child  { bottom: -3px; right: -3px; border-left: none; border-top: none; border-bottom-right-radius: 14px; }
.scan-hint { position: absolute; top: 80px; left: 0; right: 0; text-align: center; color: var(--cream); font-family: var(--serif); font-style: italic; font-size: 16px; padding: 0 24px; opacity: .9; }
.scan-actions { padding: 24px 24px calc(24px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, #000 60%, transparent); display: flex; gap: 14px; justify-content: center; align-items: center; }
.scan-shutter { width: 72px; height: 72px; border-radius: 50%; background: var(--cream); border: 4px solid rgba(255,255,255,.3); box-shadow: 0 0 0 3px var(--cream); transition: transform .15s; }
.scan-shutter:active { transform: scale(.92); }
.scan-upload-btn { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.15); color: var(--cream); display: grid; place-items: center; }
.scan-upload-btn svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; fill: none; }
.scan-mode-toggle { position: absolute; bottom: 130px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; background: rgba(255,255,255,.12); backdrop-filter: blur(10px); border-radius: 999px; z-index: 3; }
.scan-mode-toggle button { padding: 8px 16px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.6); border-radius: 999px; }
.scan-mode-toggle button.active { background: var(--cream); color: var(--ink); }
.scan-result { position: absolute; inset: 0; background: var(--ink); color: var(--cream); padding: 30px 24px; display: none; flex-direction: column; z-index: 5; overflow-y: auto; }
.scan-result.active { display: flex; }
.scan-result h2 { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 28px; letter-spacing: -.01em; margin: 0 0 18px; }
.scan-result h2 b { color: var(--terra-light); font-weight: 500; font-style: normal; }
.scan-result-img { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius); margin-bottom: 18px; }
.scan-table { background: rgba(244,237,225,.06); border: 1px solid rgba(244,237,225,.12); border-radius: var(--radius); padding: 4px 0; margin-bottom: 18px; }
.scan-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid rgba(244,237,225,.08); }
.scan-row:last-child { border-bottom: none; }
.scan-row-label { font-size: 13px; color: rgba(244,237,225,.7); }
.scan-row-val { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--cream); }
.scan-result .btn { background: var(--terra); border-color: var(--terra); }
.scan-result .btn:hover { background: var(--terra-deep); border-color: var(--terra-deep); }
.scan-loading { position: absolute; inset: 0; background: rgba(0,0,0,.85); backdrop-filter: blur(10px); display: none; flex-direction: column; align-items: center; justify-content: center; z-index: 4; color: var(--cream); text-align: center; gap: 18px; }
.scan-loading.active { display: flex; }
.scan-loading .spinner { width: 48px; height: 48px; border: 3px solid rgba(244,237,225,.25); border-top-color: var(--terra-light); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scan-loading h3 { font-family: var(--serif); font-style: italic; font-size: 22px; margin: 0; }
.scan-loading p { font-size: 13px; color: rgba(244,237,225,.6); font-family: var(--mono); letter-spacing: .08em; margin: 0; }

/* Consent */
.consent-dialog { background: linear-gradient(135deg, #2e2820 0%, #3a3024 60%, #4a3a26 100%); color: var(--cream); padding: 24px; border-radius: var(--radius-lg); max-width: 440px; margin: 8px; }
.consent-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--terra); display: grid; place-items: center; margin-bottom: 16px; font-size: 22px; }
.consent-title { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 24px; letter-spacing: -.01em; margin: 0 0 8px; color: var(--cream); }
.consent-title b { font-style: normal; font-weight: 500; color: var(--terra-light); }
.consent-msg { font-size: 14px; line-height: 1.55; color: rgba(244,237,225,.78); margin-bottom: 18px; }
.consent-payload { background: rgba(0,0,0,.25); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 16px; border: 1px solid rgba(244,237,225,.1); }
.consent-payload .label { font-family: var(--mono); font-size: 9.5px; letter-spacing: .15em; text-transform: uppercase; color: rgba(244,237,225,.5); margin-bottom: 8px; }
.consent-payload .items { font-size: 12.5px; color: rgba(244,237,225,.85); line-height: 1.6; }
.consent-payload .items b { color: var(--terra-light); font-weight: 500; }
.consent-provider { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--terra-light); margin-bottom: 14px; text-transform: uppercase; }
.consent-actions { display: flex; flex-direction: column; gap: 8px; }
.consent-btn { padding: 13px; border-radius: var(--radius-sm); font-weight: 500; font-size: 14px; transition: all .2s; text-align: center; }
.consent-btn.primary { background: var(--terra); color: var(--cream); }
.consent-btn.primary:hover { background: var(--terra-deep); }
.consent-btn.secondary { background: rgba(244,237,225,.1); color: var(--cream); }
.consent-btn.danger { background: transparent; color: rgba(244,237,225,.5); font-size: 12px; padding: 8px; }
.consent-btn.danger:hover { color: var(--cream); }
.consent-remember { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(244,237,225,.65); margin-bottom: 10px; }
.consent-remember input[type="checkbox"] { width: auto; accent-color: var(--terra); }

.ledger-item { padding: 14px; background: var(--cream); border-radius: var(--radius-sm); margin-bottom: 8px; border: 1px solid var(--line-soft); font-size: 13px; }
.ledger-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ledger-action { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 14px; }
.ledger-time { font-family: var(--mono); font-size: 10px; color: var(--ink-mute); letter-spacing: .04em; }
.ledger-payload { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); background: var(--paper); border-radius: 6px; padding: 8px 10px; word-break: break-word; line-height: 1.5; }
.ledger-target { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--terra); margin-top: 6px; }
.flow-bar { padding: 10px 12px; background: var(--paper); border-left: 3px solid var(--sage); border-radius: var(--radius-sm); font-size: 12px; font-family: var(--mono); letter-spacing: .04em; color: var(--ink-soft); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.flow-bar.warn { border-color: var(--gold); }
.flow-bar svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; flex-shrink: 0; }

.device-card { padding: 14px; background: var(--cream); border-radius: var(--radius); margin-bottom: 10px; border: 1px solid var(--line); display: flex; gap: 14px; align-items: center; }
.device-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--paper); display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.device-info { flex: 1; min-width: 0; }
.device-name { font-weight: 500; font-size: 14px; }
.device-status { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--ink-mute); margin-top: 2px; text-transform: uppercase; }
.device-status.online { color: var(--sage-deep); }
.device-status.online::before { content: "●"; color: var(--sage); margin-right: 4px; }
