/* ============================================================
   SHALLOW — design system
   Dark. Aquatic. Premium. One coherent material language:
   depth levels, water easings, luminous accents.
   ============================================================ */

:root {
  /* depth palette */
  --abyss: #030710;
  --deep: #061120;
  --mid: #0a1c30;
  --shallows: #10293f;
  --surface-air: #dfe9ee;
  --surface-mist: #c7d7de;

  /* ink */
  --ink-hi: #e9f4f7;
  --ink: #b8ccd6;
  --ink-lo: #7791a0;
  --ink-on-light: #14242e;

  /* accents */
  --glow: #7fe8dc;           /* signature aqua */
  --glow-dim: #3ea99e;
  --warm: #f2a97c;           /* mutual / intimacy */
  --founder: #f6d47c;        /* champagne gold — founder crest */
  --danger: #e77c7c;

  /* materials */
  --membrane: rgba(150, 200, 215, 0.07);       /* translucent panel */
  --membrane-edge: rgba(170, 220, 235, 0.14);
  --membrane-deep: rgba(6, 16, 28, 0.72);

  /* type */
  --font: "Avenir Next", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* radius logic: water has no corners — round everything by depth */
  --r-bubble: 999px;
  --r-panel: 22px;
  --r-el: 14px;

  /* motion */
  --ease-water: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-sink: cubic-bezier(0.55, 0.06, 0.35, 1);
  --t-pop: 180ms;
  --t-move: 420ms;
  --t-env: 900ms;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  background: #010305;
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font-family: inherit; }
svg { display: block; }
button svg, .nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- stage: phone frame on wide screens ---------- */
.stage { height: 100dvh; display: grid; place-items: center; }
.app {
  position: relative; width: 100%; height: 100dvh;
  max-width: 480px; overflow: hidden; background: var(--abyss);
}
@media (min-width: 760px) {
  body {
    background:
      radial-gradient(120% 90% at 50% -10%, #0a1a2a 0%, #030608 60%);
  }
  .app {
    width: 402px; height: min(874px, 94dvh);
    border-radius: 44px;
    box-shadow:
      0 0 0 1px rgba(140, 190, 210, 0.14),
      0 40px 120px rgba(0, 0, 0, 0.8),
      0 0 90px rgba(60, 160, 170, 0.07);
  }
}

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }
.screen[hidden] { display: none; }

/* ============================================================
   ONBOARDING
   ============================================================ */
#scr-onboarding { background: linear-gradient(180deg, var(--abyss), var(--deep) 55%, var(--mid)); }
.ob-water { position: absolute; inset: 0; }
.ob-water canvas { width: 100%; height: 100%; display: block; }

.ob-slides { position: relative; flex: 1; pointer-events: none; }
.ob-slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 44px; text-align: center; gap: 26px;
  opacity: 0; transform: translateY(26px);
  transition: opacity var(--t-env) var(--ease-water), transform var(--t-env) var(--ease-water);
}
.ob-slide.active { opacity: 1; transform: none; }
.ob-slide.passed { opacity: 0; transform: translateY(-26px); }

.wordmark-lockup { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.mark { width: 58px; }
.mark path { fill: none; stroke: var(--glow); stroke-width: 3.2; stroke-linecap: round; }
.wordmark {
  font-size: 30px; font-weight: 500; letter-spacing: 0.42em; margin-right: -0.42em;
  color: var(--ink-hi);
}
.ob-line {
  font-size: 27px; font-weight: 400; line-height: 1.35; color: var(--ink-hi);
  text-wrap: balance;
}
.ob-line-final { font-size: 34px; letter-spacing: 0.01em; }
.ob-sub { display: inline-block; margin-top: 14px; font-size: 16px; color: var(--glow); }

.ob-foot {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 0 32px calc(30px + env(safe-area-inset-bottom));
}
.ob-dots { display: flex; gap: 8px; }
.ob-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(160, 200, 215, 0.25);
  transition: all var(--t-move) var(--ease-water);
}
.ob-dots i.on { background: var(--glow); width: 20px; border-radius: 3px; }

/* ============================================================
   BUTTONS & CONTROLS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 15px 34px; border-radius: var(--r-bubble);
  font-size: 16px; font-weight: 600; letter-spacing: 0.01em;
  transition: transform var(--t-pop) var(--ease-water), box-shadow var(--t-pop), opacity var(--t-pop);
}
.btn:active { transform: scale(0.965); }
.btn-primary {
  background: linear-gradient(180deg, #9df0e5, var(--glow) 55%, #58c8bb);
  color: #06231f;
  box-shadow: 0 6px 26px rgba(90, 220, 205, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-warm {
  background: linear-gradient(180deg, #ffd0aa, var(--warm) 60%, #d98955);
  color: #33180a;
  box-shadow: 0 6px 26px rgba(242, 169, 124, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-wide { width: 100%; }
.btn[disabled] { opacity: 0.35; pointer-events: none; }
.btn-ghost { font-size: 15px; color: var(--ink-lo); padding: 10px 18px; transition: color var(--t-pop); }
.btn-ghost:hover { color: var(--ink); }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink);
  background: var(--membrane);
  border: 1px solid var(--membrane-edge);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform var(--t-pop) var(--ease-water), background var(--t-pop);
}
.icon-btn:active { transform: scale(0.92); }

.chip-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: var(--r-bubble);
  font-size: 13px; font-weight: 600; color: var(--ink);
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform var(--t-pop) var(--ease-water), border-color var(--t-pop);
}
.chip-btn:active { transform: scale(0.94); }
.chip-btn[aria-pressed="true"] { border-color: var(--glow); color: var(--glow); }
.chip-btn svg { width: 18px; height: 18px; }

/* ============================================================
   FACES & PHOTOS
   essence stays the public skin; a photo overlays it where the
   product deliberately reveals the person
   ============================================================ */
.face {
  position: relative; display: inline-block; flex: none;
  border-radius: 50%; overflow: hidden;
}
.face canvas, .face img {
  position: absolute; inset: 0; width: 100% !important; height: 100% !important;
  object-fit: cover; display: block;
}

.photo-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photo-tile {
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-el); overflow: hidden;
  background: var(--membrane); border: 1px solid var(--membrane-edge);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pt-x {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(4, 10, 16, 0.72); color: var(--ink-hi);
  font-size: 17px; line-height: 1; display: grid; place-items: center;
}
.pt-primary {
  position: absolute; left: 6px; bottom: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 8px;
  background: rgba(4, 10, 16, 0.7); color: var(--glow);
}
.pt-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--ink-lo); font-size: 12.5px; font-weight: 600;
  border-style: dashed; cursor: pointer;
  transition: color var(--t-pop), border-color var(--t-pop), transform var(--t-pop) var(--ease-water);
}
.pt-add:hover { color: var(--glow); border-color: var(--glow); }
.pt-add:active { transform: scale(0.96); }
.pt-add svg { width: 22px; height: 22px; }
.photo-fine { font-size: 12px; color: var(--ink-lo); font-weight: 400; line-height: 1.5; margin-top: 2px; }

/* ============================================================
   PROFILE CREATION
   ============================================================ */
#scr-create { background: linear-gradient(180deg, var(--deep), var(--mid)); }
.create-head {
  display: flex; align-items: center; gap: 16px;
  padding: calc(16px + env(safe-area-inset-top)) 20px 8px;
}
.create-progress {
  flex: 1; height: 3px; border-radius: 2px; background: rgba(160, 200, 215, 0.14);
  overflow: hidden;
}
.create-progress i {
  display: block; height: 100%; width: 0;
  background: var(--glow); border-radius: 2px;
  transition: width var(--t-env) var(--ease-water);
}
.create-steps { flex: 1; position: relative; overflow: hidden; }
.create-step {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: 26px 28px calc(28px + env(safe-area-inset-bottom));
  opacity: 0; transform: translateX(40px); pointer-events: none;
  transition: opacity var(--t-move) var(--ease-water), transform var(--t-move) var(--ease-water);
  overflow-y: auto;
}
.create-step.active { opacity: 1; transform: none; pointer-events: auto; }
.create-step.passed { transform: translateX(-40px); }
.cs-title { font-size: 25px; font-weight: 500; color: var(--ink-hi); line-height: 1.3; margin-bottom: 6px; }
.cs-sub { font-size: 14.5px; color: var(--ink-lo); margin-bottom: 26px; line-height: 1.5; }
.cs-body { flex: 1; }
.cs-foot { padding-top: 18px; }

.text-input {
  width: 100%; padding: 15px 4px; font-size: 21px; color: var(--ink-hi);
  background: none; border: 0; border-bottom: 1.5px solid rgba(160, 200, 215, 0.22);
  outline: none; transition: border-color var(--t-pop);
}
.text-input:focus { border-color: var(--glow); }
.text-input::placeholder { color: rgba(120, 150, 165, 0.5); }

.opt-grid { display: flex; flex-direction: column; gap: 10px; }
.opt-grid.two { flex-direction: row; flex-wrap: wrap; }
.opt-card {
  padding: 15px 18px; border-radius: var(--r-el); text-align: left;
  font-size: 15.5px; font-weight: 500; color: var(--ink);
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  transition: all var(--t-pop) var(--ease-water);
}
.opt-grid.two .opt-card { flex: 1 1 40%; text-align: center; }
.opt-card.selected { border-color: var(--glow); color: var(--ink-hi); background: rgba(127, 232, 220, 0.08); }
.opt-card:active { transform: scale(0.97); }

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  padding: 9px 15px; border-radius: var(--r-bubble); font-size: 14px; font-weight: 500;
  color: var(--ink); background: var(--membrane); border: 1px solid var(--membrane-edge);
  transition: all var(--t-pop) var(--ease-water);
}
.chip.selected { border-color: var(--glow); color: #05201c; background: var(--glow); font-weight: 600; }
.chip:active { transform: scale(0.94); }

.essence-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.essence-opt {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  font-size: 13px; color: var(--ink-lo); font-weight: 500;
  transition: transform var(--t-pop) var(--ease-water);
}
.essence-opt canvas {
  width: 76px; height: 76px; border-radius: 50%;
  border: 2px solid transparent;
  transition: all var(--t-pop) var(--ease-water);
}
.essence-opt.selected canvas { border-color: var(--glow); box-shadow: 0 0 26px rgba(127, 232, 220, 0.35); }
.essence-opt.selected { color: var(--ink-hi); }
.essence-opt:active { transform: scale(0.95); }

textarea.area-input {
  width: 100%; min-height: 110px; resize: none;
  padding: 15px; font-size: 16px; line-height: 1.5; color: var(--ink-hi);
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  border-radius: var(--r-el); outline: none;
}
textarea.area-input:focus { border-color: var(--glow); }

/* ============================================================
   SURFACE — above the waterline: bright, calm, minimal
   ============================================================ */
#scr-surface { color: var(--ink-on-light); }
.surface-sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(140% 80% at 50% -20%, #f6fbfc 0%, var(--surface-air) 45%, var(--surface-mist) 78%, #9fb9c4 100%);
}
.surface-body { position: relative; flex: 1; display: flex; flex-direction: column; }
.surface-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(20px + env(safe-area-inset-top)) 24px 0;
}
.surface-brand { font-size: 15px; font-weight: 600; letter-spacing: 0.38em; margin-right: -0.38em; color: #38505c; }
#scr-surface .icon-btn { background: rgba(255, 255, 255, 0.5); border-color: rgba(60, 90, 105, 0.15); color: var(--ink-on-light); }
.me-dot { width: 30px; height: 30px; border-radius: 50%; display: block; }

.surface-center {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 0 34px; text-align: center; margin-bottom: 10dvh;
}
.surface-kicker { font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: #6b8794; }
.surface-venue { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.venue-name { font-size: 30px; font-weight: 500; color: #16303c; }
.venue-meta { font-size: 15px; color: #5c7a88; }

.dive-btn {
  position: relative; width: 156px; height: 156px; border-radius: 50%;
  display: grid; place-items: center;
  background:
    radial-gradient(90% 90% at 32% 26%, #1d4a5c 0%, #0d2c3c 55%, #071d2b 100%);
  color: #d9f6f1;
  box-shadow:
    0 22px 50px rgba(10, 40, 55, 0.35),
    inset 0 2px 4px rgba(190, 240, 250, 0.25),
    inset 0 -14px 28px rgba(0, 0, 0, 0.4);
  transition: transform 300ms var(--ease-water), box-shadow 300ms;
}
.dive-btn:active { transform: scale(0.94); }
.dive-label { position: relative; z-index: 2; font-size: 19px; font-weight: 600; letter-spacing: 0.06em; }
.dive-rings { position: absolute; inset: 0; }
.dive-rings i {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(80, 170, 180, 0.5);
  animation: dive-ring 3.2s var(--ease-water) infinite;
}
.dive-rings i:nth-child(2) { animation-delay: 1.05s; }
.dive-rings i:nth-child(3) { animation-delay: 2.1s; }
@keyframes dive-ring {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.55); opacity: 0; }
}

.surface-hint { font-size: 13.5px; color: #75909d; max-width: 240px; line-height: 1.5; }

.waterline { position: absolute; left: 0; right: 0; bottom: 0; height: 60px; pointer-events: none; }
.waterline svg { width: 100%; height: 100%; }
.waterline path { fill: rgba(13, 44, 60, 0.9); }

/* ============================================================
   SHEETS (dive options, safety, report)
   ============================================================ */
.sheet { position: absolute; inset: 0; z-index: 40; display: flex; align-items: flex-end; }
.sheet::before {
  content: ""; position: absolute; inset: 0;
  background: rgba(2, 6, 12, 0.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity var(--t-move);
}
.sheet.open::before { opacity: 1; }
.sheet[hidden] { display: none; }
.sheet-panel {
  position: relative; width: 100%;
  background: linear-gradient(180deg, rgba(16, 36, 54, 0.96), rgba(8, 20, 33, 0.98));
  border-top: 1px solid var(--membrane-edge);
  border-radius: var(--r-panel) var(--r-panel) 0 0;
  padding: 14px 26px calc(30px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform var(--t-move) var(--ease-water);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.sheet.open .sheet-panel { transform: none; }
.sheet-grip { width: 36px; height: 4px; border-radius: 2px; margin: 0 auto 20px; background: rgba(160, 200, 215, 0.25); }
.sheet-title { font-size: 20px; font-weight: 500; color: var(--ink-hi); margin-bottom: 18px; }
.sheet-fine { font-size: 13px; color: var(--ink-lo); line-height: 1.5; margin-bottom: 18px; }

.install-panel { text-align: center; }
.install-mark {
  width: 76px; height: 76px; margin: 0 auto 16px; padding: 16px 10px;
  display: grid; place-items: center; border-radius: 24px;
  color: var(--glow); background: rgba(127, 232, 220, 0.08);
  border: 1px solid rgba(127, 232, 220, 0.22);
  box-shadow: 0 0 30px rgba(127, 232, 220, 0.08);
}
.install-mark svg { width: 54px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; }
.install-panel .sheet-title { margin-bottom: 8px; }
.install-panel .sheet-fine { max-width: 330px; margin: 0 auto 18px; }
.install-steps {
  margin: 4px 0 20px; padding: 2px 0;
  display: grid; gap: 9px; text-align: left;
}
.install-steps[hidden] { display: none; }
.install-step {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  border-radius: 14px; color: var(--ink); background: var(--membrane);
  border: 1px solid var(--membrane-edge); font-size: 13.5px; line-height: 1.4;
}
.install-step b {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 9px; color: #05201c; background: var(--glow); font-size: 13px;
}
.install-step svg { flex: none; width: 22px; height: 22px; stroke: var(--glow); fill: none; stroke-width: 2; }

.vis-options { display: flex; gap: 12px; margin-bottom: 22px; }
.vis-opt {
  flex: 1; text-align: left; padding: 16px; border-radius: var(--r-el);
  background: var(--membrane); border: 1.5px solid var(--membrane-edge);
  display: flex; flex-direction: column; gap: 5px;
  transition: all var(--t-pop) var(--ease-water);
}
.vis-opt.selected { border-color: var(--glow); background: rgba(127, 232, 220, 0.07); }
.vis-name { font-size: 16px; font-weight: 600; color: var(--ink-hi); }
.vis-opt.selected .vis-name { color: var(--glow); }
.vis-desc { font-size: 12.5px; color: var(--ink-lo); line-height: 1.4; }

.dur-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dur-label { font-size: 14.5px; color: var(--ink); }
.dur-opts { display: flex; gap: 7px; }
.dur-opt {
  padding: 7px 14px; border-radius: var(--r-bubble); font-size: 13.5px; font-weight: 600;
  color: var(--ink-lo); background: var(--membrane); border: 1px solid var(--membrane-edge);
  transition: all var(--t-pop);
}
.dur-opt.selected { color: #05201c; background: var(--glow); border-color: var(--glow); }

/* ============================================================
   DIVE TRANSITION
   ============================================================ */
.dive-transition {
  position: absolute; inset: 0; z-index: 80; pointer-events: none;
  visibility: hidden;
}
.dive-transition.run { visibility: visible; }
.dt-water {
  position: absolute; inset: -2% 0 0;
  background: linear-gradient(180deg,
    rgba(126, 200, 214, 0.9) 0%,
    var(--shallows) 12%,
    var(--mid) 40%,
    var(--deep) 75%,
    var(--abyss) 100%);
  transform: translateY(-102%);
}
.dive-transition.run .dt-water { animation: dt-flood 1.6s var(--ease-sink) forwards; }
.dive-transition.rise .dt-water {
  transform: none;
  animation: dt-drain 1.4s var(--ease-water) forwards;
}
@keyframes dt-flood { to { transform: translateY(0); } }
@keyframes dt-drain { from { transform: translateY(0); } to { transform: translateY(-102%); } }

.dt-bubbles { position: absolute; inset: 0; }
.dt-bubbles i {
  position: absolute; bottom: -30px; width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid rgba(170, 230, 235, 0.5);
  background: radial-gradient(circle at 32% 28%, rgba(220, 250, 250, 0.3), transparent 60%);
  opacity: 0;
}
.dive-transition.run .dt-bubbles i { animation: dt-bub 1.5s ease-out forwards; }
.dt-bubbles i:nth-child(1) { left: 16%; animation-delay: 0.5s; width: 10px; height: 10px; }
.dt-bubbles i:nth-child(2) { left: 30%; animation-delay: 0.72s; }
.dt-bubbles i:nth-child(3) { left: 45%; animation-delay: 0.6s; width: 20px; height: 20px; }
.dt-bubbles i:nth-child(4) { left: 58%; animation-delay: 0.85s; }
.dt-bubbles i:nth-child(5) { left: 70%; animation-delay: 0.66s; width: 9px; height: 9px; }
.dt-bubbles i:nth-child(6) { left: 82%; animation-delay: 0.9s; width: 16px; height: 16px; }
.dt-bubbles i:nth-child(7) { left: 38%; animation-delay: 1s; width: 8px; height: 8px; }
@keyframes dt-bub {
  0% { transform: translateY(0); opacity: 0; }
  20% { opacity: 0.9; }
  100% { transform: translateY(-88dvh); opacity: 0; }
}
.dt-label {
  position: absolute; left: 0; right: 0; top: 46%; text-align: center;
  font-size: 15px; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(210, 240, 245, 0.75);
  opacity: 0;
}
.dive-transition.run .dt-label { animation: dt-label 1.6s ease forwards; }
@keyframes dt-label { 25% { opacity: 0; } 55% { opacity: 1; } 100% { opacity: 0; } }

/* ============================================================
   FIELD — underwater discovery
   ============================================================ */
.underwater {
  background:
    radial-gradient(130% 60% at 50% -8%, rgba(45, 110, 130, 0.32) 0%, transparent 55%),
    linear-gradient(180deg, var(--shallows) 0%, var(--mid) 34%, var(--deep) 68%, var(--abyss) 100%);
}
#field-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }

.field-head {
  position: relative; z-index: 5;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) 20px 0;
  pointer-events: none;
}
.field-head > * { pointer-events: auto; }
.field-loc { display: flex; flex-direction: column; gap: 3px; }
.field-current { font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--glow); }
.field-venue { font-size: 15.5px; color: var(--ink-hi); font-weight: 500; }
.field-venue b { color: var(--glow); font-weight: 600; }
.field-actions { display: flex; gap: 8px; }

.presence { font-variant-numeric: tabular-nums; }
.presence-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--glow);
  box-shadow: 0 0 8px var(--glow);
  animation: presence-breathe 3s ease-in-out infinite;
}
.presence-dot.hidden-mode { background: var(--ink-lo); box-shadow: none; animation: none; }
@keyframes presence-breathe { 50% { opacity: 0.5; } }

.field-empty, .ripple-empty {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 0 40px; pointer-events: none;
}
.fe-title { font-size: 22px; font-weight: 500; color: var(--ink-hi); }
.fe-sub { font-size: 14.5px; color: var(--ink-lo); line-height: 1.6; }

.surface-pill {
  position: absolute; z-index: 6; left: 50%; transform: translateX(-50%);
  bottom: calc(86px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r-bubble);
  font-size: 14px; font-weight: 600; color: var(--ink-hi);
  background: var(--membrane-deep); border: 1px solid var(--membrane-edge);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: transform var(--t-pop) var(--ease-water);
}
.surface-pill:active { transform: translateX(-50%) scale(0.95); }
.surface-pill svg { width: 17px; height: 17px; color: var(--glow); }

/* list view (accessible alternative) */
.field-list {
  position: absolute; inset: 0; z-index: 4; overflow-y: auto;
  padding: calc(92px + env(safe-area-inset-top)) 20px 160px;
  background: rgba(4, 10, 18, 0.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.fl-title { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-lo); margin-bottom: 14px; }
.field-list ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.fl-row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 12px 14px; border-radius: var(--r-el); text-align: left;
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  transition: transform var(--t-pop) var(--ease-water);
}
.fl-row:active { transform: scale(0.98); }
.fl-row canvas { width: 46px; height: 46px; border-radius: 50%; flex: none; }
.fl-info { flex: 1; min-width: 0; }
.fl-info b { display: block; font-size: 16px; color: var(--ink-hi); font-weight: 600; }
.fl-info span { font-size: 13px; color: var(--ink-lo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.fl-state { font-size: 12px; font-weight: 700; color: var(--glow); }
.fl-state.mutual { color: var(--warm); }

/* ============================================================
   PROFILE OVERLAY — bubble becomes the profile
   ============================================================ */
.profile-overlay { position: absolute; inset: 0; z-index: 30; }
.profile-overlay[hidden] { display: none; }
.po-scrim {
  position: absolute; inset: 0; background: rgba(2, 7, 13, 0.5);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity var(--t-move);
}
.profile-overlay.open .po-scrim { opacity: 1; }
.po-card {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  background: var(--deep);
  clip-path: circle(var(--po-r, 40px) at var(--po-x, 50%) var(--po-y, 50%));
  transition: clip-path 620ms var(--ease-water);
  overflow: hidden;
}
.profile-overlay.open .po-card { clip-path: circle(135% at var(--po-x, 50%) var(--po-y, 50%)); }

.po-hero { position: relative; height: 46%; flex: none; }
.po-hero canvas { width: 100%; height: 100%; display: block; }
#po-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 700ms var(--ease-water);
}
#po-photo.loaded { opacity: 1; }
.po-hero-fade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6, 17, 32, 0.25) 0%, transparent 30%, transparent 55%, var(--deep) 100%);
}
.po-close { position: absolute; top: calc(16px + env(safe-area-inset-top)); left: 16px; }
.po-more { position: absolute; top: calc(16px + env(safe-area-inset-top)); right: 16px; }
.po-id { position: absolute; left: 26px; right: 26px; bottom: 6px; }
.po-id h2 { font-size: 32px; font-weight: 500; color: var(--ink-hi); }
.po-sub { font-size: 14px; color: var(--glow); margin-top: 3px; font-weight: 500; }

.po-body { flex: 1; overflow-y: auto; padding: 18px 26px 20px; }
.po-bio { font-size: 16.5px; line-height: 1.55; color: var(--ink); margin-bottom: 20px; }
.po-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.po-tag {
  padding: 7px 13px; border-radius: var(--r-bubble); font-size: 13px; font-weight: 500;
  color: var(--ink); background: var(--membrane); border: 1px solid var(--membrane-edge);
}

.po-deeper-btn {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 13px 0; font-size: 14.5px; font-weight: 600; color: var(--glow);
  border-top: 1px solid rgba(160, 200, 215, 0.12);
}
.po-deeper-btn svg { width: 17px; height: 17px; transition: transform var(--t-move) var(--ease-water); }
.po-deeper.open .po-deeper-btn svg { transform: rotate(180deg); }
.po-deep-content { padding: 6px 0 12px; animation: po-reveal 600ms var(--ease-water); }
@keyframes po-reveal { from { opacity: 0; transform: translateY(14px); } }
.po-strip { display: flex; gap: 10px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.po-strip::-webkit-scrollbar { display: none; }
.po-strip img {
  width: 132px; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: var(--r-el); flex: none;
  border: 1px solid var(--membrane-edge);
}
.po-vitals { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 16px; }
.po-vital {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; color: var(--ink);
}
.po-vital svg {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: var(--ink-lo); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.po-life { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.po-life-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: var(--r-bubble);
  font-size: 13px; color: var(--ink);
  background: var(--membrane); border: 1px solid var(--membrane-edge);
}
.po-life-chip b { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-lo); }

.v-badge {
  display: inline-block; width: 0.72em; height: 0.72em; margin-left: 0.28em;
  vertical-align: baseline; transform: translateY(0.04em);
  color: var(--glow);
}
.v-state { width: 22px; height: 22px; color: var(--glow); flex: none; }

/* founder crest + chip — gold, everywhere the profile appears */
.f-badge {
  display: inline-block; width: 0.72em; height: 0.72em; margin-left: 0.28em;
  vertical-align: baseline; transform: translateY(0.04em);
  color: var(--founder);
}
.po-founder {
  display: inline-block; padding: 2px 9px; border-radius: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--founder); background: rgba(246, 212, 124, 0.14);
  border: 1px solid rgba(246, 212, 124, 0.4);
  vertical-align: 1px;
}
.face.founder {
  box-shadow: 0 0 0 2px var(--founder), 0 0 14px rgba(246, 212, 124, 0.45);
  border-radius: 50%;
}

.po-prompt {
  padding: 16px 18px; border-radius: var(--r-el);
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  margin-bottom: 14px;
}
.po-prompt-q { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-lo); }
.po-prompt-a { font-size: 16.5px; color: var(--ink-hi); line-height: 1.5; margin-top: 7px; }
.po-verified { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-lo); }
.po-verified.on { color: var(--glow); }

.po-foot {
  flex: none; padding: 12px 26px calc(22px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--deep) 40%);
}
.wave-btn .wave-ic { width: 21px; height: 21px; stroke-width: 2; }
.po-stakes { font-size: 12px; color: var(--ink-lo); text-align: center; margin-top: 10px; }
.wave-btn.sent {
  background: var(--membrane); color: var(--glow);
  border: 1px solid rgba(127, 232, 220, 0.4); box-shadow: none;
}
.wave-btn.mutual-state {
  background: linear-gradient(180deg, #ffd0aa, var(--warm) 60%, #d98955);
  color: #33180a;
}

/* ============================================================
   VIEWS (ripples / dives / you)
   ============================================================ */
.view-head { padding: calc(22px + env(safe-area-inset-top)) 26px 6px; position: relative; z-index: 2; }
.view-head h1 { font-size: 26px; font-weight: 500; color: var(--ink-hi); }
.view-sub { font-size: 13.5px; color: var(--ink-lo); margin-top: 3px; }

.ripple-pond { position: relative; height: 160px; flex: none; }
.ripple-pond canvas { width: 100%; height: 100%; display: block; }

.ripple-feed {
  flex: 1; overflow-y: auto; padding: 4px 20px calc(110px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 2;
}
.ripple-item {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 13px 15px; border-radius: var(--r-el);
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  animation: rise-in 600ms var(--ease-water) backwards;
  transition: transform var(--t-pop) var(--ease-water);
}
.ripple-item:active { transform: scale(0.98); }
.ripple-item .face { width: 46px; height: 46px; }
.ripple-item.anon .face canvas, .ripple-item.anon .face img { filter: blur(9px) saturate(1.3); transform: scale(1.15); }
.ri-txt { flex: 1; min-width: 0; }
.ri-txt b { display: block; font-size: 15px; color: var(--ink-hi); font-weight: 600; line-height: 1.35; }
.ri-txt span { font-size: 12.5px; color: var(--ink-lo); }
.ripple-item.unread { border-color: rgba(127, 232, 220, 0.35); }
.ripple-item.warm-item { border-color: rgba(242, 169, 124, 0.4); }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } }

.dive-list {
  list-style: none; flex: 1; overflow-y: auto;
  padding: 10px 20px calc(110px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 2;
}
.dive-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 15px; border-radius: var(--r-el);
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  animation: rise-in 600ms var(--ease-water) backwards;
  transition: transform var(--t-pop) var(--ease-water);
}
.dive-row:active { transform: scale(0.98); }
.dive-row .face { width: 52px; height: 52px; border: 1.5px solid rgba(242, 169, 124, 0.45); }
.dr-info { flex: 1; min-width: 0; }
.dr-info b { display: block; font-size: 16.5px; color: var(--ink-hi); font-weight: 600; }
.dr-info span { display: block; font-size: 13px; color: var(--ink-lo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.dr-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--warm); color: #33180a; }

/* ============================================================
   CHAT — Deep Dive
   ============================================================ */
.chat {
  background:
    radial-gradient(120% 50% at 50% -6%, rgba(120, 80, 50, 0.16) 0%, transparent 55%),
    linear-gradient(180deg, #0d1a2a 0%, var(--deep) 55%, var(--abyss) 100%);
  transition: background 1500ms var(--ease-water);
}
/* the water darkens as the two of you go deeper */
.chat[data-zone="twilight"] {
  background:
    radial-gradient(120% 50% at 50% -6%, rgba(70, 80, 140, 0.2) 0%, transparent 55%),
    linear-gradient(180deg, #0a1526 0%, #071022 55%, #030711 100%);
}
.chat[data-zone="midnight"] {
  background:
    radial-gradient(120% 50% at 50% -6%, rgba(45, 55, 110, 0.18) 0%, transparent 50%),
    linear-gradient(180deg, #060b18 0%, #04070f 55%, #01030a 100%);
}
.chat[data-zone="abyss"] {
  background:
    radial-gradient(100% 40% at 50% 110%, rgba(30, 90, 80, 0.12) 0%, transparent 60%),
    linear-gradient(180deg, #030610 0%, #020409 55%, #000103 100%);
}

/* ---- fauna: what swims at your depth ---- */
.chat-fauna { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.chat-fauna .fa { position: absolute; fill: rgba(130, 180, 205, 0.1); stroke: rgba(130, 180, 205, 0.1); }
.fa-fish { width: 44px; top: 22%; animation: fa-cross 34s linear infinite; }
.fa-jelly { width: 46px; top: 58%; left: 12%; animation: fa-rise 26s ease-in-out infinite; }
.fa-whale { width: 200px; top: 38%; animation: fa-cross 55s linear infinite; animation-delay: -20s; fill: rgba(90, 130, 170, 0.09); stroke: rgba(90, 130, 170, 0.09); }
.fa-angler { width: 64px; top: 72%; animation: fa-cross 44s linear infinite reverse; animation-delay: -10s; fill: rgba(60, 90, 110, 0.14); stroke: rgba(60, 90, 110, 0.14); }
.fa-angler .lure { fill: rgba(150, 255, 230, 0.5); animation: lure-glow 2.4s ease-in-out infinite; }
@keyframes fa-cross { from { transform: translateX(-30vw); } to { transform: translateX(130vw); } }
@keyframes fa-rise { 0% { transform: translateY(12vh); } 50% { transform: translateY(-6vh) translateX(20px); } 100% { transform: translateY(12vh); } }
@keyframes lure-glow { 50% { opacity: 0.25; } }
.chat-head, .chat-scroll, .chat-compose, .depthq-card { position: relative; z-index: 1; }

/* ---- depth gauge ---- */
.depth-gauge {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 7px 11px; border-radius: var(--r-bubble);
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--glow); background: var(--membrane); border: 1px solid var(--membrane-edge);
  transition: transform var(--t-pop) var(--ease-water);
}
.depth-gauge:active { transform: scale(0.94); }
.depth-gauge svg { width: 14px; height: 14px; }

/* ---- zone crossing card (lives in the message flow) ---- */
.zone-crossing {
  position: relative; margin: 18px 8px; padding: 18px 16px 15px;
  text-align: center; border-radius: var(--r-el);
  background: rgba(120, 160, 200, 0.06);
  border: 1px solid rgba(140, 180, 215, 0.16);
  animation: msg-in 700ms var(--ease-water) backwards;
  overflow: hidden;
}
.zone-crossing b { display: block; font-size: 15px; color: var(--ink-hi); letter-spacing: 0.04em; }
.zone-crossing span { display: block; font-size: 12.5px; color: var(--ink-lo); margin-top: 4px; line-height: 1.5; }
.zone-crossing .fa {
  position: static; display: block; margin: 0 auto 8px; animation: none;
  width: 54px; fill: rgba(150, 200, 225, 0.4); stroke: rgba(150, 200, 225, 0.4);
}
.zone-crossing.zc-midnight .fa { width: 120px; }
.zone-crossing.zc-abyss { border-color: rgba(120, 240, 210, 0.25); }
.zone-crossing.zc-abyss .fa .lure { fill: rgba(150, 255, 230, 0.8); }

/* ---- depth question message + card ---- */
.msg.depthq {
  font-style: italic;
  box-shadow: inset 0 0 0 1.5px rgba(6, 40, 36, 0.35);
}
.chat-depthq {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: var(--glow);
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  transition: transform var(--t-pop) var(--ease-water);
}
.chat-depthq:active { transform: scale(0.9); }
.chat-depthq svg { width: 22px; height: 22px; }
.depthq-card {
  margin: 0 16px 8px; padding: 14px 16px; border-radius: var(--r-el);
  background: rgba(16, 36, 54, 0.9); border: 1px solid rgba(127, 232, 220, 0.25);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: rise-in 400ms var(--ease-water);
}
.depthq-zone { font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--glow); }
.depthq-card p { font-size: 15.5px; color: var(--ink-hi); line-height: 1.45; margin: 6px 0 10px; }
.depthq-actions { display: flex; align-items: center; gap: 6px; }

/* ---- daily settle ---- */
.depth-gauge.settled { color: var(--ink-lo); border-color: var(--membrane-edge); }
.depth-gauge.settled svg { opacity: 0.5; }
.depth-today { margin-bottom: 16px; }
.dt-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--ink-lo); margin-bottom: 7px; }
.dt-row b { color: var(--ink-hi); font-variant-numeric: tabular-nums; font-size: 13.5px; }
.dt-bar { height: 5px; border-radius: 3px; background: rgba(160, 200, 215, 0.14); overflow: hidden; }
.dt-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--glow-dim), var(--glow)); transition: width var(--t-move) var(--ease-water); }
.dt-note { font-size: 12px; color: var(--ink-lo); line-height: 1.5; margin-top: 8px; }

/* ---- zone ladder sheet ---- */
.zone-ladder { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.zone-row {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px; border-radius: var(--r-el);
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  opacity: 0.45;
}
.zone-row.reached { opacity: 1; }
.zone-row.current { border-color: rgba(127, 232, 220, 0.45); }
.zone-depth { flex: none; width: 52px; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-lo); }
.zone-row.reached .zone-depth { color: var(--glow); }
.zone-info { flex: 1; min-width: 0; }
.zone-info b { display: block; font-size: 14.5px; color: var(--ink-hi); }
.zone-info small { font-size: 12px; color: var(--ink-lo); line-height: 1.4; }
.zone-you { flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--glow); }
.zone-future {
  position: relative; padding: 15px 16px; border-radius: var(--r-el);
  background: linear-gradient(135deg, rgba(242, 169, 124, 0.08), rgba(127, 232, 220, 0.06));
  border: 1px dashed rgba(242, 169, 124, 0.4);
}
.zone-future-tag {
  position: absolute; top: -9px; left: 14px; padding: 2px 9px; border-radius: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--warm); color: #33180a;
}
.zone-future b { font-size: 15px; color: var(--warm); }
.zone-future p { font-size: 13px; color: var(--ink); line-height: 1.55; margin-top: 5px; }

.dr-depth {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; vertical-align: 2px;
  background: rgba(130, 180, 205, 0.12); color: var(--ink-lo);
}
.dr-depth.zn-twilight { color: #9ab0e8; background: rgba(120, 140, 220, 0.14); }
.dr-depth.zn-midnight { color: #b9a7ef; background: rgba(140, 120, 230, 0.14); }
.dr-depth.zn-abyss { color: var(--glow); background: rgba(127, 232, 220, 0.14); }
.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid rgba(160, 200, 215, 0.1);
}
.chat-id { display: flex; align-items: center; gap: 12px; flex: 1; text-align: left; min-width: 0; }
.chat-id .face { width: 40px; height: 40px; border: 1.5px solid rgba(242, 169, 124, 0.5); }
.chat-id b { display: block; font-size: 16.5px; color: var(--ink-hi); font-weight: 600; }
.chat-ctx { font-size: 12px; color: var(--warm); display: block; margin-top: 1px; }

.chat-scroll { flex: 1; overflow-y: auto; padding: 18px 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.chat-genesis {
  text-align: center; font-size: 12.5px; color: var(--ink-lo); line-height: 1.6;
  padding: 10px 30px 22px;
}
.chat-genesis b { color: var(--warm); font-weight: 600; }
.msg {
  max-width: 78%; padding: 11px 15px; border-radius: 18px;
  font-size: 15.5px; line-height: 1.45; margin-bottom: 7px;
  animation: msg-in 380ms var(--ease-water) backwards;
  overflow-wrap: break-word;
}
@keyframes msg-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
.msg.me {
  align-self: flex-end; color: #08251f;
  background: linear-gradient(180deg, #93eddf, #6fd9cb);
  border-bottom-right-radius: 6px;
}
.msg.them {
  align-self: flex-start; color: var(--ink-hi);
  background: rgba(150, 200, 215, 0.12);
  border: 1px solid rgba(160, 200, 215, 0.1);
  border-bottom-left-radius: 6px;
}
.chat-typing {
  align-self: flex-start; display: flex; gap: 4px; padding: 13px 16px;
  background: rgba(150, 200, 215, 0.1); border-radius: 18px; border-bottom-left-radius: 6px;
  margin-bottom: 7px;
}
.chat-typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink-lo);
  animation: typing 1.1s ease-in-out infinite;
}
.chat-typing i:nth-child(2) { animation-delay: 0.18s; }
.chat-typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes typing { 40% { transform: translateY(-4px); opacity: 1; } 0%, 80%, 100% { opacity: 0.4; } }

.chat-compose {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
}
#chat-input {
  flex: 1; padding: 13px 18px; font-size: 15.5px; color: var(--ink-hi);
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  border-radius: var(--r-bubble); outline: none;
  transition: border-color var(--t-pop);
}
#chat-input:focus { border-color: rgba(127, 232, 220, 0.5); }
#chat-input::placeholder { color: rgba(120, 150, 165, 0.6); }
.chat-send {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #08251f;
  background: linear-gradient(180deg, #93eddf, #6fd9cb);
  transition: transform var(--t-pop) var(--ease-water), opacity var(--t-pop);
}
.chat-send:active { transform: scale(0.9); }

/* ============================================================
   YOU
   ============================================================ */
#scr-you { background: linear-gradient(180deg, var(--mid), var(--deep) 60%, var(--abyss)); }
.you-body { flex: 1; overflow-y: auto; padding: 10px 22px calc(110px + env(safe-area-inset-bottom)); }
.you-card {
  display: flex; align-items: center; gap: 15px;
  padding: 16px; border-radius: var(--r-panel);
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  margin-bottom: 12px;
}
.you-card canvas { width: 62px; height: 62px; border-radius: 50%; flex: none; }
.you-idn { flex: 1; }
.you-idn b { display: block; font-size: 19px; color: var(--ink-hi); font-weight: 600; }
.you-idn span { font-size: 13px; color: var(--ink-lo); }

.you-preview { margin-bottom: 12px; }
.you-edit-panel { display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 16px; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--ink-lo); font-weight: 600; }
.field textarea, .field select {
  font-size: 15px; color: var(--ink-hi); padding: 11px 13px;
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  border-radius: var(--r-el); outline: none; resize: none;
}

.you-h { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-lo); margin: 20px 4px 10px; }
.set-group {
  border-radius: var(--r-panel); overflow: hidden;
  background: var(--membrane); border: 1px solid var(--membrane-edge);
}
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; padding: 14px 16px; text-align: left;
  border-bottom: 1px solid rgba(160, 200, 215, 0.08);
}
.set-row:last-child { border-bottom: 0; }
.set-row > span { font-size: 15px; color: var(--ink-hi); font-weight: 500; display: flex; flex-direction: column; gap: 2px; }
.set-row small { font-size: 12px; color: var(--ink-lo); font-weight: 400; }
.set-row select {
  font-size: 14px; color: var(--ink-hi); padding: 7px 10px;
  background: rgba(150, 200, 215, 0.1); border: 1px solid var(--membrane-edge);
  border-radius: 10px; outline: none;
}
.set-row .danger { color: var(--danger); }
.set-btn:active { background: rgba(150, 200, 215, 0.05); }

.switch { appearance: none; width: 46px; height: 27px; border-radius: 14px; background: rgba(150, 200, 215, 0.18); position: relative; transition: background var(--t-move); flex: none; cursor: pointer; }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: var(--ink-hi);
  transition: transform var(--t-move) var(--ease-water);
}
.switch:checked { background: var(--glow-dim); }
.switch:checked::after { transform: translateX(19px); }

.you-reset { display: block; margin: 22px auto 6px; }
.you-fine { font-size: 12px; color: var(--ink-lo); text-align: center; line-height: 1.6; padding: 0 20px 10px; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: absolute; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; gap: 4px; padding: 7px;
  border-radius: var(--r-bubble);
  background: var(--membrane-deep);
  border: 1px solid var(--membrane-edge);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  transition: transform var(--t-move) var(--ease-water), opacity var(--t-move);
}
.nav.hide { transform: translateX(-50%) translateY(140%); opacity: 0; pointer-events: none; }
.nav-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 68px; padding: 8px 0 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em; color: var(--ink-lo);
  transition: color var(--t-pop), background var(--t-pop);
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn.active { color: var(--glow); background: rgba(127, 232, 220, 0.09); }
.nav-btn .me-dot { width: 22px; height: 22px; opacity: 0.75; }
.nav-btn.active .me-dot { opacity: 1; box-shadow: 0 0 0 1.5px var(--glow); }
.nav-badge {
  position: absolute; top: 5px; right: 15px;
  min-width: 8px; height: 8px; border-radius: 4px;
  background: var(--warm); box-shadow: 0 0 8px rgba(242, 169, 124, 0.7);
}

/* ============================================================
   MUTUAL MOMENT
   ============================================================ */
.mutual { position: absolute; inset: 0; z-index: 60; display: flex; }
.mutual[hidden] { display: none; }
.mutual::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(100% 80% at 50% 40%, rgba(60, 30, 14, 0.5) 0%, rgba(3, 7, 14, 0.94) 70%);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transition: opacity var(--t-env);
}
.mutual.open::before { opacity: 1; }
#mutual-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mutual-body {
  position: relative; margin: auto; display: flex; flex-direction: column; align-items: center;
  gap: 8px; text-align: center; padding: 0 34px;
  opacity: 0; transform: scale(0.92);
  transition: opacity var(--t-env) var(--ease-water) 200ms, transform var(--t-env) var(--ease-water) 200ms;
}
.mutual.open .mutual-body { opacity: 1; transform: none; }
.mutual-orbs { display: flex; margin-bottom: 16px; }
.mutual-orbs .face {
  width: 92px !important; height: 92px !important;
  border: 2px solid rgba(242, 169, 124, 0.65);
  box-shadow: 0 0 44px rgba(242, 169, 124, 0.3);
}
.mutual-orbs .face:first-child { margin-right: -18px; animation: orb-drift-a 5s ease-in-out infinite; }
.mutual-orbs .face:last-child { animation: orb-drift-b 5s ease-in-out infinite; }
@keyframes orb-drift-a { 50% { transform: translate(4px, -5px); } }
@keyframes orb-drift-b { 50% { transform: translate(-4px, 5px); } }
.mutual-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--warm); }
.mutual-name { font-size: 27px; font-weight: 500; color: var(--ink-hi); line-height: 1.3; }
.mutual-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 22px; }

/* ============================================================
   SAFETY / REPORT
   ============================================================ */
.safety-opts, .report-reasons { display: flex; flex-direction: column; gap: 8px; }
.safety-opt, .report-reason {
  width: 100%; text-align: left; padding: 15px 17px; border-radius: var(--r-el);
  font-size: 15.5px; font-weight: 500; color: var(--ink-hi);
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  display: flex; flex-direction: column; gap: 3px;
  transition: transform var(--t-pop) var(--ease-water);
}
.safety-opt:active, .report-reason:active { transform: scale(0.98); }
.safety-opt small { font-size: 12.5px; color: var(--ink-lo); font-weight: 400; }
.safety-opt.danger-opt, .safety-opt.danger-opt small { color: var(--danger); }
.safety-opt.danger-opt small { opacity: 0.75; }

/* ============================================================
   BETA SIGNUP
   ============================================================ */
.preview-chip {
  display: inline-block; margin-left: 9px; padding: 2px 7px; border-radius: 7px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em; font-style: normal;
  background: rgba(20, 60, 75, 0.14); color: #4a707f;
  vertical-align: 2px;
}
.preview-note { margin-top: 14px; }
.beta-form { display: flex; flex-direction: column; gap: 14px; }
.beta-form .field span { font-size: 12.5px; }
.beta-form input[type="text"], .beta-form input[type="email"], .beta-form textarea {
  font-size: 16px; color: var(--ink-hi); padding: 12px 14px; resize: none;
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  border-radius: var(--r-el); outline: none;
}
.beta-form input:focus, .beta-form textarea:focus { border-color: var(--glow); }
.beta-form input::placeholder, .beta-form textarea::placeholder { color: rgba(120, 150, 165, 0.55); }
.beta-form .btn { margin-top: 2px; }
.hp-field { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
.beta-error {
  font-size: 13px; color: var(--danger); line-height: 1.5;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(231, 124, 124, 0.1); border: 1px solid rgba(231, 124, 124, 0.3);
}
.beta-center { text-align: center; }
.beta-done-mark { display: grid; place-items: center; margin: 6px 0 16px; }
.beta-done-mark svg {
  width: 58px; height: 58px; color: var(--glow); fill: none;
  filter: drop-shadow(0 0 22px rgba(127, 232, 220, 0.4));
  animation: verify-pop 700ms var(--ease-water);
}

/* ============================================================
   VERIFICATION
   ============================================================ */
.verify-copy { font-size: 14.5px; line-height: 1.6; color: var(--ink); margin-bottom: 18px; }
.verify-copy b { color: var(--glow); }
.verify-center { text-align: center; }
.verify-center b { color: var(--ink-hi); font-size: 17px; }
.verify-steps { list-style: none; margin: 0 0 22px; display: flex; flex-direction: column; gap: 9px; }
.verify-steps li {
  font-size: 13.5px; color: var(--ink-lo); padding-left: 18px; position: relative;
}
.verify-steps li::before {
  content: ""; position: absolute; left: 2px; top: 7px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--glow); opacity: 0.7;
}
.verify-cam {
  position: relative; width: 210px; height: 210px; margin: 4px auto 16px;
  border-radius: 50%; overflow: hidden; background: var(--abyss);
}
.verify-cam video {
  width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1);
}
.verify-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(127, 232, 220, 0.6);
  box-shadow: 0 0 30px rgba(127, 232, 220, 0.2), inset 0 0 30px rgba(2, 8, 14, 0.4);
  animation: verify-breathe 2.6s ease-in-out infinite;
}
@keyframes verify-breathe { 50% { border-color: rgba(127, 232, 220, 0.25); } }
.verify-proc {
  position: relative; width: 170px; height: 170px; margin: 4px auto 16px;
  border-radius: 50%; overflow: hidden;
}
.verify-selfie { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.85); }
.verify-scan {
  position: absolute; left: 0; right: 0; height: 34%;
  background: linear-gradient(180deg, transparent, rgba(127, 232, 220, 0.28), transparent);
  animation: verify-scan 1.6s ease-in-out infinite alternate;
}
@keyframes verify-scan { from { top: -34%; } to { top: 100%; } }
.verify-done { display: grid; place-items: center; margin: 8px 0 14px; }
.verify-done .v-badge {
  width: 64px; height: 64px; margin: 0;
  filter: drop-shadow(0 0 24px rgba(127, 232, 220, 0.45));
  animation: verify-pop 700ms var(--ease-water);
}
@keyframes verify-pop { 0% { transform: scale(0.4); opacity: 0; } 65% { transform: scale(1.12); } }
#verify-body .btn-ghost.btn-wide { width: 100%; margin-top: 6px; }

/* ---- edit panel extras ---- */
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.field input[type="text"] {
  font-size: 15px; color: var(--ink-hi); padding: 11px 13px;
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  border-radius: var(--r-el); outline: none;
}
.field input[type="text"]:focus { border-color: var(--glow); }
.field-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-lo); }
.prompt-edit {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px; border-radius: var(--r-el);
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  margin-bottom: 10px;
}
.prompt-edit-head { display: flex; gap: 8px; align-items: center; }
.prompt-edit select {
  flex: 1; font-size: 13.5px; color: var(--ink-hi); padding: 8px 10px;
  background: rgba(150, 200, 215, 0.1); border: 1px solid var(--membrane-edge);
  border-radius: 10px; outline: none; min-width: 0;
}
.prompt-edit .pt-x { position: static; flex: none; }
.prompt-edit textarea {
  font-size: 14px; color: var(--ink-hi); padding: 9px 11px; resize: none;
  background: rgba(150, 200, 215, 0.06); border: 1px solid var(--membrane-edge);
  border-radius: 10px; outline: none;
}
.prompt-add { align-self: flex-start; }

/* creation details step */
.details-fields { display: flex; flex-direction: column; gap: 18px; }
.details-fields .field span { font-size: 13px; }
.details-fields .text-input { font-size: 17px; padding: 11px 4px; background: none; border: 0; border-bottom: 1.5px solid rgba(160, 200, 215, 0.22); border-radius: 0; }
.details-fields .text-input:focus { border-color: var(--glow); }

/* ============================================================
   CONSENT & LEGAL
   ============================================================ */
.consent-rows { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.consent-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 15px; border-radius: var(--r-el); cursor: pointer;
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  font-size: 14px; line-height: 1.5; color: var(--ink);
  transition: border-color var(--t-pop);
}
.consent-row:has(.ck:checked) { border-color: rgba(127, 232, 220, 0.45); color: var(--ink-hi); }
.consent-row .ck { position: absolute; opacity: 0; pointer-events: none; }
.ckbox {
  flex: none; width: 22px; height: 22px; margin-top: 1px;
  border-radius: 7px; border: 1.5px solid rgba(160, 200, 215, 0.4);
  position: relative; transition: all var(--t-pop) var(--ease-water);
}
.consent-row .ck:checked + .ckbox {
  background: var(--glow); border-color: var(--glow);
  box-shadow: 0 0 14px rgba(127, 232, 220, 0.35);
}
.ckbox::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px;
  border: solid #05201c; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0);
  transition: transform var(--t-pop) var(--ease-water);
}
.consent-row .ck:checked + .ckbox::after { transform: rotate(45deg) scale(1); }
.doc-link {
  display: inline; padding: 0; font-size: inherit; font-weight: 600;
  color: var(--glow); text-decoration: underline; text-underline-offset: 2px;
  text-decoration-color: rgba(127, 232, 220, 0.4);
}
.set-group .doc-link { text-decoration: none; font-weight: 500; }

.legal-panel { display: flex; flex-direction: column; max-height: 86dvh; }
.legal-version { font-size: 12px; color: var(--ink-lo); margin: -12px 0 14px; }
.legal-body {
  flex: 1; overflow-y: auto; min-height: 0; max-height: 56dvh;
  padding: 2px 2px 18px; margin-bottom: 16px;
  border-top: 1px solid rgba(160, 200, 215, 0.1);
}
.legal-body h3 {
  font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--glow); margin: 20px 0 8px;
}
.legal-body p { font-size: 14.5px; line-height: 1.65; color: var(--ink); margin-bottom: 10px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: absolute; z-index: 70; left: 16px; right: 16px;
  top: calc(14px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 12px;
  padding: 12px 15px; border-radius: 18px;
  background: var(--membrane-deep); border: 1px solid var(--membrane-edge);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
  transform: translateY(-130%); opacity: 0;
  transition: transform var(--t-move) var(--ease-water), opacity var(--t-move);
}
.toast.show { transform: none; opacity: 1; }
.toast canvas { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.toast.anon canvas { filter: blur(6px) saturate(1.3); }
.toast-txt { flex: 1; min-width: 0; }
.toast-txt b { display: block; font-size: 14.5px; color: var(--ink-hi); font-weight: 600; }
.toast-txt span { font-size: 12.5px; color: var(--ink-lo); }
.toast-act {
  font-size: 13px; font-weight: 700; color: var(--glow);
  padding: 8px 12px; border-radius: 10px; background: rgba(127, 232, 220, 0.1);
}

/* ============================================================
   ACCESSIBILITY / MOTION
   ============================================================ */
:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }
/* text fields carry their own focus affordance — the ring would double up */
.text-input:focus-visible, .area-input:focus-visible,
#chat-input:focus-visible, .field textarea:focus-visible, select:focus-visible { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   PROFILE RECOVERY
   ============================================================ */
.recovery-code {
  font-size: 27px; font-weight: 600; letter-spacing: 0.14em; text-align: center;
  color: var(--glow); padding: 20px 12px; margin-bottom: 16px;
  border-radius: var(--r-el); font-variant-numeric: tabular-nums;
  background: var(--membrane); border: 1px solid rgba(127, 232, 220, 0.3);
  word-break: break-all;
}
.recovery-input {
  width: 100%; padding: 15px 16px; margin-bottom: 14px;
  font-size: 21px; font-weight: 600; letter-spacing: 0.12em; text-align: center;
  text-transform: uppercase; color: var(--ink-hi);
  background: var(--membrane); border: 1px solid var(--membrane-edge);
  border-radius: var(--r-el); outline: none;
}
.recovery-input:focus { border-color: var(--glow); }
.recovery-input::placeholder { color: rgba(120, 150, 165, 0.45); letter-spacing: 0.12em; }
#sheet-recovery .btn-ghost.btn-wide { width: 100%; margin-top: 6px; }
.ob-restore { font-size: 13.5px; }

/* welcome-back card for one-tap identity return */
.reclaim-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 15px; margin-bottom: 18px; border-radius: var(--r-el);
  background: var(--membrane); border: 1px solid rgba(127, 232, 220, 0.3);
}
.reclaim-card .face { width: 54px; height: 54px; }
.reclaim-id { min-width: 0; }
.reclaim-id b { display: block; font-size: 17px; color: var(--ink-hi); font-weight: 600; }
.reclaim-id span {
  display: block; font-size: 12.5px; color: var(--ink-lo); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#sheet-reclaim .btn-ghost.btn-wide { width: 100%; margin-top: 6px; }

/* ============================================================
   QR SCANNER
   ============================================================ */
.scan-btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: linear-gradient(180deg, rgba(20, 52, 66, 0.95), rgba(10, 34, 46, 0.98));
  color: #d9f6f1; border: 1px solid rgba(127, 232, 220, 0.35);
  box-shadow: 0 8px 26px rgba(8, 40, 52, 0.45);
  padding: 14px 26px; margin-top: 6px;
}
.scan-btn svg { width: 20px; height: 20px; stroke-width: 1.8; }
.scan-btn-secondary { padding: 10px 18px; font-size: 14px; box-shadow: none; margin-top: 2px; }
.scan-panel { display: flex; flex-direction: column; max-height: 92dvh; }
.scan-stage {
  position: relative; width: min(72vw, 300px); aspect-ratio: 1;
  margin: 4px auto 14px; border-radius: 18px; overflow: hidden;
  background: #020609;
}
.scan-stage video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame {
  position: absolute; inset: 12%; border-radius: 14px;
  border: 2px solid rgba(127, 232, 220, 0.65);
  box-shadow: 0 0 0 200vmax rgba(2, 6, 9, 0.35);
  animation: scan-breathe 2.4s ease-in-out infinite;
}
@keyframes scan-breathe { 50% { border-color: rgba(127, 232, 220, 0.25); } }
.scan-status { text-align: center; min-height: 2.6em; }
.scan-alt { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 4px; }
.scan-alt-btn { cursor: pointer; font-size: 14px; }
.scan-paste { padding: 6px 0 8px; }
.scan-link { text-transform: none; letter-spacing: normal; font-size: 15px; }
#sheet-scan .btn-ghost.btn-wide { width: 100%; margin-top: 4px; }

/* ============================================================
   LEGAL SHEET — full-height, readable, sticky Done
   ============================================================ */
#sheet-legal { align-items: stretch; }
#sheet-legal .sheet-panel.legal-panel {
  display: flex; flex-direction: column;
  height: 100dvh; max-height: 100dvh;
  border-radius: 0;
  padding: calc(14px + env(safe-area-inset-top)) 0 0;
}
.legal-panel .sheet-grip { flex: none; }
.legal-panel .sheet-title {
  flex: none; padding: 4px 24px 2px; font-size: 22px;
}
.legal-version { flex: none; padding: 0 24px; margin: 2px 0 10px !important; }
.legal-panel .legal-body {
  flex: 1; min-height: 0; max-height: none;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 4px 24px 28px; margin-bottom: 0;
  border-top: 1px solid rgba(160, 200, 215, 0.12);
}
.legal-body h3 { font-size: 13.5px; margin: 24px 0 10px; }
.legal-body h3:first-child { margin-top: 14px; }
.legal-body p { font-size: 16px; line-height: 1.7; margin-bottom: 14px; overflow-wrap: break-word; }
.legal-panel #legal-done {
  flex: none; width: auto;
  margin: 10px 20px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 24px rgba(3, 7, 16, 0.6);
}
@media (max-width: 360px) {
  .legal-body p { font-size: 15px; }
  .legal-panel .sheet-title { font-size: 20px; }
}

/* find-my-profile sheet + create-screen escape */
.create-restore { flex: none; font-size: 13px; white-space: nowrap; }
.restore-fields { display: flex; gap: 10px; margin-bottom: 12px; }
.restore-input { text-transform: none; letter-spacing: normal; font-size: 17px; text-align: left; margin-bottom: 0; flex: 1; }
.restore-age { flex: 0 0 92px; text-align: center; }
#sheet-restore .btn-ghost.btn-wide { width: 100%; margin-top: 6px; }
