/* ==========================================================================
   Mila Hayes — private line
   Santa Monica after sunset: Pacific night, pier lights, champagne.
   ========================================================================== */

@font-face {
  font-family: 'Bodoni Moda';
  src: url('/fonts/bodoni-moda.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Bodoni Moda';
  src: url('/fonts/bodoni-moda-italic.woff2') format('woff2');
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Figtree';
  src: url('/fonts/figtree.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Mila's locked identity: Y2K maximalist, hot pink / electric blue / gold, high-key California light */
  --bg: #fff7fb;
  --bg-2: #eef4ff;
  --raised: #ffffff;
  --ink: #1c1236;
  --ink-dim: #6e668f;
  --wash: rgba(28, 18, 54, 0.05);
  --hairline: rgba(28, 18, 54, 0.1);
  --pink: #ff3e9a;
  --pink-deep: #e0247f;
  --pink-soft: #ffd3e8;
  --blue: #2f6bff;
  --blue-soft: #d6e4ff;
  --gold: #d9a441;
  --gold-soft: #f6d98f;
  --chrome: linear-gradient(100deg, #ff3e9a 0%, #b45cff 26%, #2f6bff 50%, #7fd3ff 62%, #f4c860 80%, #ff3e9a 100%);
  --header-bg: linear-gradient(105deg, #ff3e9a 0%, #c04cf0 45%, #2f6bff 100%);
  --header-ink: #ffffff;
  --mila-bg: linear-gradient(180deg, #ffffff 0%, #fff6fb 100%);
  --mila-ink: #1c1236;
  --mila-border: rgba(28, 18, 54, 0.07);
  --user-bg: linear-gradient(180deg, #ff7cba 0%, #ff3e9a 52%, #e0247f 100%);
  --user-ink: #ffffff;
  --glass: rgba(255, 255, 255, 0.74);
  --sheet-bg: rgba(255, 255, 255, 0.94);
  --scrim: rgba(28, 18, 54, 0.35);
  --toast-bg: rgba(28, 18, 54, 0.92);
  --toast-ink: #ffffff;
  --shadow: 0 12px 30px -18px rgba(120, 40, 120, 0.55);
  --glow-a: rgba(255, 62, 154, 0.16);
  --glow-b: rgba(47, 107, 255, 0.14);
  --glow-c: rgba(244, 200, 96, 0.2);
  --spark: #e7b64a;

  --serif: 'Bodoni Moda', 'Didot', 'Bodoni 72', Georgia, serif;
  --sans: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --ease-spring: cubic-bezier(0.2, 0.9, 0.25, 1.15);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --vvh: 100dvh;
  --vvtop: 0px;
}

/* After Dark: the same brand at night. Black, neon pink, gold. */
:root[data-mode='afterdark'] {
  --bg: #14050f;
  --bg-2: #050208;
  --raised: #1f0a19;
  --ink: #ffeaf4;
  --ink-dim: #c89ab4;
  --wash: rgba(255, 234, 244, 0.06);
  --hairline: rgba(255, 234, 244, 0.12);
  --blue: #6a5cff;
  --gold: #ffc766;
  --header-bg: linear-gradient(180deg, rgba(20, 5, 15, 0.9), rgba(20, 5, 15, 0.7));
  --header-ink: #ffeaf4;
  --mila-bg: rgba(255, 234, 244, 0.07);
  --mila-ink: #ffeaf4;
  --mila-border: rgba(255, 62, 154, 0.25);
  --user-bg: linear-gradient(180deg, #ff5aae 0%, #ff2e8e 55%, #c3176a 100%);
  --glass: rgba(20, 5, 15, 0.66);
  --sheet-bg: rgba(31, 10, 25, 0.96);
  --scrim: rgba(0, 0, 0, 0.6);
  --toast-bg: rgba(255, 234, 244, 0.95);
  --toast-ink: #14050f;
  --shadow: 0 12px 34px -14px rgba(255, 62, 154, 0.55);
  --glow-a: rgba(255, 62, 154, 0.24);
  --glow-b: rgba(106, 92, 255, 0.18);
  --glow-c: rgba(255, 199, 102, 0.08);
  --spark: #ffc766;
}

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

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; touch-action: manipulation; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 10px; }
svg { display: block; }

/* App frame follows the visual viewport so the composer sits right above the keyboard;
   with the keyboard closed it simply fills the screen (iOS reports a short height in standalone mode). */
.app {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--vvtop);
  height: var(--vvh);
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    radial-gradient(90% 50% at 100% 0%, var(--glow-a), transparent 60%),
    radial-gradient(80% 45% at 0% 100%, var(--glow-b), transparent 60%),
    radial-gradient(60% 40% at 15% 20%, var(--glow-c), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
.app::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.screen { position: relative; z-index: 1; flex: 1; min-height: 0; width: 100%; max-width: 640px; margin: 0 auto; }

/* Chrome type: Mila's name in the brand's iridescent pink-blue-gold */
.chrome-text {
  background: var(--chrome);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 9s ease-in-out infinite alternate;
}

/* 4-point sparkle */
.spark {
  position: absolute;
  width: 22px;
  height: 22px;
  background: var(--spark);
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9));
  animation: twinkle 3.2s ease-in-out infinite;
  pointer-events: none;
}

/* ==========================================================================
   Onboarding: full-bleed Mila, chrome name, sparkles
   ========================================================================== */

.onboarding {
  overflow-y: auto;
  padding: 0 0 calc(var(--safe-b) + 8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; }
.hero-photo {
  position: relative;
  width: 100%;
  height: min(21svh, 200px);
  overflow: hidden;
  background:
    radial-gradient(60% 40% at 30% 30%, rgba(255, 62, 154, 0.45), transparent 70%),
    radial-gradient(55% 45% at 75% 70%, rgba(47, 107, 255, 0.4), transparent 70%),
    var(--bg);
  -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent 99%);
  mask-image: linear-gradient(to bottom, #000 58%, transparent 99%);
  animation: photo-in 1.4s var(--ease-out) both;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 46%; }
.hero-photo::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: calc(var(--safe-t) + 60px);
  background: linear-gradient(rgba(28, 18, 54, 0.28), transparent);
  z-index: 1;
}
.hero .spark.s1 { top: 22%; left: 12%; width: 26px; height: 26px; animation-delay: 0.4s; }
.hero .spark.s2 { top: 38%; right: 10%; width: 18px; height: 18px; animation-delay: 1.3s; }
.hero .spark.s3 { top: 54%; left: 20%; width: 14px; height: 14px; animation-delay: 2.1s; background: #fff; }
.hero-name {
  position: relative;
  margin: -34px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(44px, 13vw, 60px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 96;
  padding: 0 0.12em 0.08em;
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.9)) drop-shadow(0 10px 24px rgba(180, 60, 160, 0.25));
  animation: rise 1s 0.2s var(--ease-out) both;
}
.hero-line {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-dim);
  animation: rise 1s 0.35s var(--ease-out) both;
}

.onboard-form {
  width: 100%;
  max-width: 380px;
  padding: 12px 22px 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  animation: rise 1s 0.45s var(--ease-out) both;
}
.field { display: block; position: relative; }
.field input, .field select {
  width: 100%;
  height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--raised);
  color: var(--ink);
  font-size: 16px;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: 0 6px 18px -14px rgba(120, 40, 120, 0.6);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder { color: var(--ink-dim); }
.field input:focus, .field select:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 4px var(--pink-soft); }
.field select { text-align-last: center; }
.field select:invalid { color: var(--ink-dim); }
.field-row { border: 0; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; }
.field-legend { padding: 0; margin: 0 0 8px; font-size: 13px; color: var(--ink-dim); width: 100%; text-align: center; }
.form-error { margin: 2px 0 0; font-size: 14px; color: var(--pink-deep); }
.turnstile { display: flex; justify-content: center; }
.fineprint { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-dim); }
.legal-links { display: flex; justify-content: center; gap: 18px; font-size: 12.5px; color: var(--ink-dim); }
.legal-links a { text-decoration: none; }
.legal-links a:hover { color: var(--ink); }

/* ==========================================================================
   Buttons: glossy Y2K candy
   ========================================================================== */

.btn {
  position: relative;
  height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
  transition: transform 0.15s var(--ease-out), filter 0.2s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary {
  color: #fff;
  background: var(--user-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -2px 6px rgba(160, 0, 80, 0.25), 0 12px 26px -12px rgba(224, 36, 127, 0.75);
  text-shadow: 0 1px 1px rgba(150, 0, 70, 0.35);
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 2px 3% 50%;
  border-radius: 999px 999px 60% 60% / 999px 999px 100% 100%;
  background: linear-gradient(rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.btn-ghost { color: var(--ink); border: 1px solid var(--hairline); background: var(--raised); box-shadow: 0 6px 16px -12px rgba(120, 40, 120, 0.5); }
:root[data-mode='afterdark'] .btn-ghost { background: var(--wash); }
.btn-danger { color: #fff; background: linear-gradient(180deg, #ff6f8e, #d8335e); }
.btn-block { width: 100%; }
.link-btn { color: var(--pink-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:root[data-mode='afterdark'] .link-btn { color: var(--pink); }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: inherit;
  transition: background 0.2s, transform 0.15s;
}
.icon-btn:active { transform: scale(0.92); background: rgba(255, 255, 255, 0.18); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[data-label='settings'] svg { fill: currentColor; stroke: none; }

/* ==========================================================================
   Chat: header band
   ========================================================================== */

.chat { display: flex; flex-direction: column; }

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-t) + 4px) 8px 6px 12px;
  color: var(--header-ink);
  background: var(--header-bg);
  box-shadow: 0 10px 30px -18px rgba(90, 30, 140, 0.8);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
}
.topbar::after {
  /* glossy highlight across the band */
  content: '';
  position: absolute;
  inset: 0 0 50%;
  background: linear-gradient(rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
  pointer-events: none;
}
:root[data-mode='afterdark'] .topbar { box-shadow: 0 1px 0 rgba(255, 62, 154, 0.45), 0 12px 30px -16px rgba(255, 62, 154, 0.45); }
:root[data-mode='afterdark'] .topbar::after { display: none; }

.avatar { position: relative; width: 36px; height: 36px; flex: none; border-radius: 50%; z-index: 1; }
.avatar img, .avatar-fallback {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
}
:root[data-mode='afterdark'] .avatar img { border-color: var(--bg); }
.avatar-fallback { display: grid; place-items: center; font-family: var(--serif); font-style: italic; font-size: 21px; color: #fff; background: var(--chrome); }
.has-avatar .avatar-fallback { display: none; }

/* The signature: Mila's living aura */
.aura-ring, .aura-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #fff, var(--gold-soft), #fff, var(--pink-soft), #fff);
  animation: spin 12s linear infinite;
  transition: opacity 0.4s;
}
:root[data-mode='afterdark'] .aura-ring, :root[data-mode='afterdark'] .aura-glow { background: conic-gradient(from 0deg, var(--pink), var(--blue), var(--gold), var(--pink)); }
.aura-ring {
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
}
.aura-glow { inset: -3px; filter: blur(8px); opacity: 0.55; }
.is-typing .aura-ring, .is-typing .aura-glow { animation-duration: 2.2s; }
.is-typing .aura-glow { opacity: 0.95; }

.who { flex: 1; min-width: 0; position: relative; z-index: 1; }
.who-name {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-variation-settings: 'opsz' 28;
  text-shadow: 0 1px 12px rgba(90, 20, 120, 0.25);
}
.ai-badge {
  font-family: var(--sans);
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  text-shadow: none;
}
.status { margin: 1px 0 0; font-size: 12px; opacity: 0.88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-typing .status { opacity: 1; font-weight: 600; }
.topbar .icon-btn { position: relative; z-index: 1; }
.moon.glint { animation: glint 1.6s var(--ease-out) 2; }
:root[data-mode='afterdark'] .moon { color: var(--pink); }
:root[data-mode='afterdark'] .moon svg { fill: currentColor; filter: drop-shadow(0 0 6px var(--pink)); }

/* ==========================================================================
   Chat: thread
   ========================================================================== */

.thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* faint Y2K sparkle wallpaper */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cg fill='%23d9a441' fill-opacity='.11'%3E%3Cpath d='M30 20l2.6 9.4L42 32l-9.4 2.6L30 44l-2.6-9.4L18 32l9.4-2.6z'/%3E%3Cpath d='M130 95l1.6 5.4 5.4 1.6-5.4 1.6-1.6 5.4-1.6-5.4-5.4-1.6 5.4-1.6z'/%3E%3C/g%3E%3Cg fill='%23ff3e9a' fill-opacity='.08'%3E%3Cpath d='M85 140l1.9 6.1 6.1 1.9-6.1 1.9-1.9 6.1-1.9-6.1-6.1-1.9 6.1-1.9z'/%3E%3C/g%3E%3C/svg%3E");
}
:root[data-mode='afterdark'] .thread { background-image: none; }
.thread-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 14px 12px;
}

.day { align-self: center; margin: 18px 0 10px; font-size: 12px; font-weight: 600; color: var(--ink-dim); letter-spacing: 0.02em; }
.notice { align-self: center; max-width: 300px; margin: 10px 0; text-align: center; font-size: 12px; line-height: 1.5; color: var(--ink-dim); }
.notice::before { content: '✦'; display: block; margin-bottom: 2px; color: var(--gold); }

.msg { display: flex; flex-direction: column; max-width: 80%; margin-top: 3px; }
.msg.first { margin-top: 14px; }
.msg.mila { align-self: flex-start; align-items: flex-start; }
.msg.user { align-self: flex-end; align-items: flex-end; }

.bubble {
  position: relative;
  padding: 10px 15px 11px;
  border-radius: 22px;
  font-size: 16px;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
  -webkit-user-select: text;
  touch-action: manipulation;
}
.mila .bubble {
  color: var(--mila-ink);
  background: var(--mila-bg);
  border: 1px solid var(--mila-border);
  box-shadow: var(--shadow);
}
:root[data-mode='afterdark'] .mila .bubble { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: none; }
.user .bubble {
  color: var(--user-ink);
  background: var(--user-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 10px 22px -14px rgba(224, 36, 127, 0.9);
}
.mila:not(.first) .bubble { border-top-left-radius: 8px; }
.mila:not(.last) .bubble { border-bottom-left-radius: 8px; }
.mila.last .bubble { border-bottom-left-radius: 6px; }
.user:not(.first) .bubble { border-top-right-radius: 8px; }
.user:not(.last) .bubble { border-bottom-right-radius: 8px; }
.user.last .bubble { border-bottom-right-radius: 6px; }

.msg .meta { display: none; margin: 5px 6px 0; font-size: 11.5px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.msg.last .meta { display: block; }
.msg.failed .meta { display: block; color: var(--pink-deep); }
.msg.failed .bubble { opacity: 0.6; }

.msg.enter { animation: bubble-in 0.42s var(--ease-spring) both; }
.msg.mila.enter { transform-origin: 0 100%; }
.msg.user.enter { transform-origin: 100% 100%; }

.heart {
  position: absolute;
  right: -8px;
  bottom: -10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--raised);
  border: 1px solid var(--hairline);
  font-size: 12px;
  line-height: 1;
  color: var(--pink);
  box-shadow: var(--shadow);
  animation: pop 0.45s var(--ease-spring) both;
}
.msg.has-heart { margin-bottom: 10px; }

/* Photo from Mila: glossy white frame, tap to open */
.bubble.photo { padding: 5px; overflow: hidden; background: var(--raised); cursor: zoom-in; }
.bubble.photo img {
  display: block;
  width: min(62vw, 260px);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 17px;
  filter: blur(18px) saturate(1.3);
  transform: scale(1.04);
  transition: filter 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.bubble.photo img.loaded { filter: none; transform: none; }

.typing .bubble { padding: 14px 16px; display: flex; gap: 5px; }
.typing .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pink); opacity: 0.5; animation: dot 1.3s ease-in-out infinite; }
.typing .dot:nth-child(2) { animation-delay: 0.16s; }
.typing .dot:nth-child(3) { animation-delay: 0.32s; }

.care-card {
  align-self: flex-start;
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--gold);
  background: var(--raised);
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 320px;
  box-shadow: var(--shadow);
}
.care-card h3 { margin: 0 0 8px; font-size: 14.5px; font-weight: 700; }
.care-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.care-card li { display: flex; justify-content: space-between; gap: 12px; }
.care-card li span { color: var(--ink-dim); }
.care-card a { color: var(--pink-deep); font-weight: 700; text-decoration: none; white-space: nowrap; }
.care-card p { margin: 10px 0 0; color: var(--ink-dim); font-size: 13px; }

.inline-card {
  position: relative;
  align-self: center;
  width: 100%;
  max-width: 340px;
  margin: 20px 0 6px;
  padding: 22px 18px 16px;
  border-radius: 24px;
  border: 1px solid var(--hairline);
  background: var(--raised);
  text-align: center;
  box-shadow: var(--shadow);
  animation: bubble-in 0.5s var(--ease-spring) both;
}
.inline-card::before { content: '✦'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-size: 20px; color: var(--gold); }
.inline-card h3 { margin: 0 0 6px; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 22px; line-height: 1.2; font-variation-settings: 'opsz' 28; }
.inline-card p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; color: var(--ink-dim); }
.inline-card .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.inline-card .btn { height: 42px; padding: 0 18px; font-size: 14.5px; }

.hint {
  align-self: flex-start;
  margin: 8px 0 2px 2px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--pink-soft);
  background: var(--raised);
  color: var(--pink-deep);
  font-size: 13px;
  font-weight: 600;
  animation: fade-in 0.8s var(--ease-out) both;
}
:root[data-mode='afterdark'] .hint { background: transparent; border-color: rgba(255, 62, 154, 0.45); color: var(--pink); }
.hint svg { width: 14px; height: 14px; fill: currentColor; }

.starters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; animation: fade-in 0.8s 0.3s var(--ease-out) both; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--pink-soft);
  background: var(--raised);
  font-size: 14px;
  font-weight: 600;
  color: var(--pink-deep);
  box-shadow: 0 6px 14px -10px rgba(224, 36, 127, 0.6);
  transition: transform 0.15s;
}
.chip:active { transform: scale(0.96); }

.new-pill {
  position: absolute;
  left: 50%;
  bottom: calc(76px + var(--safe-b));
  z-index: 6;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--user-bg);
  box-shadow: var(--shadow);
  animation: rise 0.35s var(--ease-out) both;
}

/* ==========================================================================
   Composer
   ========================================================================== */

.composer {
  position: relative;
  z-index: 5;
  padding: 6px 8px max(calc(var(--safe-b) - 12px), 8px);
  background: var(--glass);
  transition: transform 0.25s var(--ease-out), margin-bottom 0.25s var(--ease-out);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border-top: 1px solid var(--hairline);
}
.kb-open .composer { padding-bottom: 5px; }
.reading .composer { transform: translateY(100%); margin-bottom: calc(-1 * var(--composer-h, 56px)); }
.composer-inner {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 2px 3px 2px 14px;
  border-radius: 19px;
  border: 1px solid var(--hairline);
  background: var(--raised);
  transition: border-color 0.2s, box-shadow 0.2s;
}
:root[data-mode='afterdark'] .composer-inner { background: var(--wash); }
.composer-inner:focus-within { border-color: var(--pink); }
.composer textarea { flex: 1; min-height: 32px; max-height: 120px; padding: 6px 0; border: 0; outline: 0; resize: none; background: transparent; font-size: 16px; line-height: 1.4; color: var(--ink); }
.composer textarea::placeholder { color: var(--ink-dim); }
.composer .icon-btn { color: var(--ink-dim); width: 30px; height: 30px; }
.mic.listening { color: var(--pink); animation: breathe 1.2s ease-in-out infinite; }
.send {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--user-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 6px 16px -6px var(--pink);
  transition: transform 0.25s var(--ease-spring), opacity 0.2s;
}
.send svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.send:disabled { opacity: 0; transform: scale(0.4) rotate(-40deg); pointer-events: none; width: 0; margin-left: -6px; }
.send:active { transform: scale(0.9); }

.locked-bar {
  position: relative;
  z-index: 5;
  padding: 14px 20px calc(var(--safe-b) + 14px);
  text-align: center;
  border-top: 1px solid var(--hairline);
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  animation: rise 0.5s var(--ease-out) both;
}
.locked-bar p { margin: 0 0 4px; font-size: 14.5px; color: var(--ink-dim); }
.locked-bar .link-btn { font-size: 14.5px; }

/* ==========================================================================
   Bottom sheets
   ========================================================================== */

.sheet-host { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.scrim { position: absolute; inset: 0; background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade-in 0.3s var(--ease-out) both; }
.sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(var(--vvh) - var(--safe-t) - 24px);
  display: flex;
  flex-direction: column;
  border-radius: 30px 30px 0 0;
  color: var(--ink);
  background: var(--sheet-bg);
  -webkit-backdrop-filter: blur(30px) saturate(140%);
  backdrop-filter: blur(30px) saturate(140%);
  border: 1px solid var(--hairline);
  border-bottom: 0;
  box-shadow: 0 -30px 80px -20px rgba(60, 20, 90, 0.35);
  animation: sheet-up 0.5s var(--ease-spring) both;
  outline: none;
}
.sheet-host.closing .sheet { animation: sheet-down 0.28s var(--ease-out) both; }
.sheet-host.closing .scrim { animation: fade-out 0.28s var(--ease-out) both; }
.grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--hairline); margin: 10px auto 0; flex: none; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px calc(var(--safe-b) + 24px); }
.sheet-title {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-variation-settings: 'opsz' 48;
}
.sheet-intro { margin: 0 0 20px; color: var(--ink-dim); font-size: 15px; line-height: 1.55; max-width: 44ch; }
.sheet .fineprint { text-align: left; }
.sheet-actions { display: grid; gap: 10px; margin-top: 20px; }

.rows { list-style: none; margin: 0 0 18px; padding: 0; border-top: 1px solid var(--hairline); }
.rows > li { border-bottom: 1px solid var(--hairline); }
.row { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 12px 2px; text-align: left; }
.row .row-main { flex: 1; min-width: 0; }
.row .row-title { display: block; font-size: 16px; }
.row .row-sub { display: block; margin-top: 2px; font-size: 13.5px; color: var(--ink-dim); }
.row .chev { width: 16px; height: 16px; fill: none; stroke: var(--ink-dim); stroke-width: 1.8; stroke-linecap: round; }
.row.danger .row-title { color: var(--pink-deep); }
.row input[type='text'] { flex: 1; min-width: 0; height: 40px; border: 0; border-bottom: 1px solid var(--hairline); background: transparent; font-size: 16px; outline: none; color: var(--ink); }
.row input[type='text']:focus { border-bottom-color: var(--pink); }
.row .small-btn { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--hairline); font-size: 13.5px; font-weight: 600; }

.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(110, 102, 143, 0.3); transition: background 0.25s; }
.switch span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s var(--ease-spring);
}
.switch input:checked + span { background: var(--pink); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--pink); outline-offset: 2px; }

/* Passes: a sunlit chrome ticket and a neon night ticket */
.tickets { display: grid; gap: 12px; }
.ticket {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 18px 18px 18px 20px;
  border-radius: 22px;
  text-align: left;
  color: var(--ink);
  border: 1px solid var(--hairline);
  transition: transform 0.2s var(--ease-out), box-shadow 0.3s;
}
.ticket:active { transform: scale(0.985); }
.ticket.pearl {
  background: linear-gradient(var(--raised), var(--raised)) padding-box, var(--chrome) border-box;
  border: 2px solid transparent;
}
.ticket.velvet {
  color: #ffeaf4;
  background: radial-gradient(120% 100% at 100% 0%, rgba(255, 62, 154, 0.35), transparent 60%), linear-gradient(135deg, #2a0a20, #0c0309 75%);
  border-color: rgba(255, 62, 154, 0.4);
}
.ticket[aria-pressed='true'] { box-shadow: 0 0 0 3px var(--pink), 0 16px 40px -20px rgba(224, 36, 127, 0.7); }
.ticket[disabled] { opacity: 0.55; }
.ticket.plain { background: var(--raised); }
.tier-pick { margin-top: 4px; }
.tier-pick .tickets { gap: 8px; }
.tier-pick .ticket { padding: 12px 14px 12px 16px; border-radius: 18px; }
.tier-pick .ticket-name { font-size: 19px; }
.tier-pick .ticket-desc { font-size: 13px; }
.tier-pick .fineprint { text-align: center; }
.ticket-name { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 24px; line-height: 1.15; font-variation-settings: 'opsz' 28; }
.ticket.velvet .ticket-name { color: #ff9fcd; text-shadow: 0 0 14px rgba(255, 62, 154, 0.6); }
.ticket-price { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; align-self: start; }
.ticket-desc { grid-column: 1 / 2; font-size: 14px; line-height: 1.45; opacity: 0.75; }
.ticket-days { grid-column: 2 / 3; justify-self: end; font-size: 12.5px; opacity: 0.7; }
.ticket-state { grid-column: 1 / -1; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--pink-deep); }
.ticket.velvet .ticket-state { color: #ff9fcd; }

.checkout { margin-top: 18px; animation: rise 0.4s var(--ease-out) both; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--ink-dim); text-align: left; cursor: pointer; }
.check input {
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  border-radius: 7px;
  border: 1.5px solid var(--ink-dim);
  display: grid;
  place-items: center;
  transition: background 0.2s, border-color 0.2s;
}
.check input:checked { background: var(--pink); border-color: var(--pink); }
.check input:checked::after { content: ''; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.pay-line { margin: 16px 0 10px; font-size: 14px; }
.pay-slot { min-height: 50px; }
.pay-slot.gated { opacity: 0.45; }
.demo-pay { width: 100%; height: 48px; border-radius: 999px; background: #ffc439; color: #111; font-weight: 700; }

.notes { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.notes li { padding-left: 18px; position: relative; font-size: 15px; line-height: 1.5; }
.notes li::before { content: '✦'; position: absolute; left: 0; top: 1px; font-size: 11px; color: var(--gold); }

.steps { margin: 0 0 8px; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; font-size: 15px; line-height: 1.5; }
.steps li::before { content: counter(step); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 16px; color: #fff; background: var(--user-bg); }
.share-ico { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.form-grid { display: grid; gap: 10px; }
.form-grid input { width: 100%; height: 50px; padding: 0 18px; border-radius: 16px; border: 1px solid var(--hairline); background: var(--raised); font-size: 16px; outline: none; color: var(--ink); }
.form-grid input:focus { border-color: var(--pink); }

.success { text-align: center; padding: 10px 0; }
.success .seal { width: 84px; height: 84px; margin: 4px auto 16px; border-radius: 50%; padding: 3px; background: var(--chrome); animation: pop 0.7s var(--ease-spring) both; box-shadow: var(--shadow); }
.success .seal img, .success .seal span { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--raised); font-family: var(--serif); font-style: italic; font-size: 30px; }

/* Sheet header photo (After Dark intro, verify) */
.sheet-photo { position: relative; margin: -4px -8px 18px; border-radius: 22px; overflow: hidden; aspect-ratio: 16 / 10; }
.sheet-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.sheet-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(20, 5, 15, 0.55)); }

/* ==========================================================================
   Mila's profile
   ========================================================================== */

.profile { text-align: center; }
.profile-cover { position: relative; width: min(64vw, 250px); margin: 4px auto 16px; padding: 4px; border-radius: 30px; background: var(--chrome); box-shadow: var(--shadow); }
.profile-cover img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 26px; }
.profile-cover .spark { top: -8px; right: -6px; }
.profile-name { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 42px; line-height: 1; letter-spacing: -0.02em; font-variation-settings: 'opsz' 72; padding-bottom: 0.08em; }
.profile-line { margin: 8px 0 2px; font-size: 15px; color: var(--ink-dim); }
.profile-now { margin: 0 0 16px; font-size: 14px; font-weight: 700; color: var(--pink-deep); }
.profile-now::before { content: '✦ '; color: var(--gold); }
.profile-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 22px; }
.profile-links a { padding: 9px 16px; border-radius: 999px; background: var(--raised); border: 1px solid var(--hairline); font-size: 14px; font-weight: 700; text-decoration: none; box-shadow: 0 6px 14px -10px rgba(120, 40, 120, 0.6); }
.gallery-title { margin: 0 0 10px; text-align: left; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 22px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery button { padding: 0; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 5; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease-out); }
.gallery button:active img { transform: scale(1.05); }
.profile .fineprint { text-align: center; margin-top: 16px; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-t) + 20px) 16px calc(var(--safe-b) + 20px);
  background: rgba(10, 5, 20, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fade-in 0.25s var(--ease-out) both;
  cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); animation: bubble-in 0.4s var(--ease-spring) both; }

/* ==========================================================================
   After Dark curtain, toast
   ========================================================================== */

.curtain {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--cx, 80%) var(--cy, 6%), #ffd36b 0%, #ff3e9a 14%, #5a0f3c 40%, #14050f 70%, #050208 100%);
  clip-path: circle(0% at var(--cx, 80%) var(--cy, 6%));
}
.curtain.to-night { animation: curtain-in 0.75s var(--ease-out) forwards; }
.curtain.to-day {
  background: radial-gradient(circle at var(--cx, 80%) var(--cy, 6%), #ffffff 0%, #ffd3e8 22%, #d6e4ff 55%, #fff7fb 100%);
  animation: curtain-in 0.75s var(--ease-out) forwards;
}
.curtain.out { animation: curtain-out 0.6s var(--ease-out) forwards; clip-path: circle(150% at var(--cx) var(--cy)); opacity: 1; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-b) + 92px);
  z-index: 90;
  max-width: min(92vw, 420px);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  color: var(--toast-ink);
  background: var(--toast-bg);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript { padding: 40px; text-align: center; }

/* ==========================================================================
   Keyframes
   ========================================================================== */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sheen { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes twinkle { 0%, 100% { transform: scale(0.4) rotate(0deg); opacity: 0.2; } 50% { transform: scale(1) rotate(45deg); opacity: 1; } }
@keyframes photo-in { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes bubble-in { from { opacity: 0; transform: translateY(10px) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes breathe { 50% { transform: scale(1.12); } }
@keyframes glint { 0%, 100% { filter: none; } 40% { filter: drop-shadow(0 0 8px #fff); } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes curtain-in { from { opacity: 1; clip-path: circle(0% at var(--cx) var(--cy)); } to { opacity: 1; clip-path: circle(150% at var(--cx) var(--cy)); } }
@keyframes curtain-out { from { opacity: 1; } to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .aura-ring, .aura-glow, .spark, .chrome-text { animation: none !important; }
}

@media (min-width: 700px) {
  .chat { border-left: 1px solid var(--hairline); border-right: 1px solid var(--hairline); }
  .sheet { border-radius: 30px; margin-bottom: 24px; border-bottom: 1px solid var(--hairline); }
}


/* Home fits one screen: compact inputs and buttons */
.onboard-form .field input, .onboard-form .field select { height: 46px; }
.onboard-form .btn { height: 46px; }
.onboard-form .tier-pick .fineprint { margin: 0; }
.home-actions { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; }
.home-actions .btn { padding: 0 12px; }
.tier-pick .ticket-state { margin-top: 2px; }

/* Home photo = the app icon: a rounded square with Mila's whole face */
.hero-photo {
  width: min(34vw, 136px);
  height: min(34vw, 136px);
  margin-top: calc(var(--safe-t) + 14px);
  border-radius: 24%;
  -webkit-mask-image: none;
  mask-image: none;
  box-shadow: 0 18px 40px -18px rgba(150, 40, 130, 0.55), 0 0 0 3px rgba(255, 255, 255, 0.85);
}
.hero-photo::before { display: none; }
.hero-photo img { object-position: 50% 50%; }
.hero-name { margin-top: 10px; }
.adult-check { justify-content: center; font-size: 14px; color: var(--ink-dim); }
