:root {
  --bg: #080714;
  --bg-2: #100d26;
  --panel: rgba(18, 15, 40, 0.74);
  --panel-hi: rgba(28, 23, 60, 0.82);
  --stroke: rgba(255, 255, 255, 0.085);
  --stroke-hi: rgba(255, 255, 255, 0.16);
  --ink: #f5f2ff;
  --ink-2: #bdb8dc;
  --ink-3: #8f8ab0;
  --pink: #ff4f93;
  --pink-deep: #d92e6c;
  --blue: #318af0;
  --blue-hi: #6aaeff;
  --sun: #ffcc4d;
  --ok: #3ee0a1;
  --warn: #ffb547;
  --bad: #ff5a6e;
  --grad: linear-gradient(120deg, #ff4f93 0%, #d92e6c 38%, #6f5cff 70%, #318af0 100%);
  --grad-text: linear-gradient(100deg, #ff7ab0 0%, #ffd1e3 34%, #ffe08a 52%, #8cc4ff 78%, #4f9dff 100%);
  --r-xl: 30px;
  --r-lg: 22px;
  --r-md: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: Inter, Heebo, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --display: Syncopate, Inter, system-ui, sans-serif;
  --wrap: 1180px;
  --pad: clamp(18px, 4vw, 40px);
  --dock-h: 0px;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font: 400 16px/1.6 var(--font);
  color: var(--ink);
  background:
    radial-gradient(60vw 50vh at 85% 8%, rgba(49, 138, 240, 0.18), transparent 70%),
    radial-gradient(55vw 45vh at 10% 30%, rgba(217, 46, 108, 0.16), transparent 70%),
    var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue-hi); outline-offset: 3px; border-radius: 10px; }
::selection { background: rgba(255, 79, 147, 0.4); color: #fff; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; top: 12px; inset-inline-start: 12px; z-index: 200;
  padding: 12px 18px; border-radius: 999px; background: #fff; color: #111;
  font-weight: 600; text-decoration: none; transform: translateY(-160%);
  transition: transform 0.3s var(--ease);
}
.skip:focus { transform: none; }

/* ---------- 3D scene ---------- */

#scene {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  display: block; pointer-events: none;
}

.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: 0.05;
  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");
}

.page { position: relative; z-index: 2; }

/* ---------- Loader ---------- */

#loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: radial-gradient(closest-side at 50% 44%, transparent 0 46%, rgba(8, 7, 20, 0.55) 100%);
  transition: opacity 0.9s var(--ease), visibility 0.9s;
}
html.is-ready #loader { opacity: 0; visibility: hidden; pointer-events: none; }

.ld-stage { position: relative; width: min(78vw, 440px); aspect-ratio: 1; margin-top: -12vh; }

.ld-fallback {
  position: absolute; inset: 18%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, #fff 0 4%, rgba(255, 255, 255, 0.6) 9%, transparent 26%),
    radial-gradient(circle at 70% 75%, rgba(49, 138, 240, 0.95), transparent 60%),
    radial-gradient(circle at 30% 70%, rgba(255, 79, 147, 0.95), transparent 62%),
    #3a1b5e;
  box-shadow: 0 0 80px rgba(255, 79, 147, 0.45), 0 0 140px rgba(49, 138, 240, 0.35);
  animation: breathe 3.2s var(--ease) infinite alternate;
  will-change: transform;
  display: none;
}
html.no-webgl.is-ready .ld-fallback { animation: none; }
html.no-webgl .ld-fallback { display: block; }

.ld-copy {
  position: absolute; left: 50%; bottom: max(9vh, 64px);
  transform: translateX(-50%);
  width: min(88vw, 420px);
  text-align: center;
}

.ld-brand {
  margin: 0;
  font: 700 clamp(18px, 4.6vw, 26px)/1 var(--display);
  letter-spacing: 0.32em;
  padding-inline-start: 0.32em;
  direction: ltr;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.ld-status {
  min-height: 1.6em;
  margin: 14px 0 18px;
  font-size: 14px; color: var(--ink-2); letter-spacing: 0.02em;
  transition: opacity 0.35s var(--ease);
}

.ld-meter {
  display: flex; align-items: center; gap: 14px;
  font: 700 11px/1 var(--display); letter-spacing: 0.18em; color: var(--ink-3);
}
.ld-bar { flex: 1; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.ld-bar i {
  display: block; height: 100%; width: 100%;
  transform-origin: left; transform: scaleX(var(--p01, 0));
  background: var(--grad);
  box-shadow: 0 0 14px rgba(255, 79, 147, 0.8);
}
[dir="rtl"] .ld-bar i { transform-origin: right; }
.ld-pct { min-width: 4ch; text-align: end; font-variant-numeric: tabular-nums; color: var(--ink); }

/* page reveal */
.page > * { transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
html:not(.is-ready) .page > * { opacity: 0; transform: translateY(24px); }
.dock { transition: opacity 0.8s var(--ease) 0.3s, transform 0.8s var(--ease) 0.3s; }
html:not(.is-ready) .dock { opacity: 0; transform: translateY(30px); pointer-events: none; }

/* ---------- Layout ---------- */

.wrap { width: min(100% - var(--pad) * 2, var(--wrap)); margin-inline: auto; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  padding: 14px 0;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), padding 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.topbar.is-stuck {
  padding: 10px 0;
  background: rgba(8, 7, 20, 0.92);
  border-bottom-color: var(--stroke);
}
@media (hover: hover) and (pointer: fine) {
  .topbar.is-stuck {
    background: rgba(8, 7, 20, 0.72);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
            backdrop-filter: blur(16px) saturate(150%);
  }
}
.topbar .wrap { display: flex; align-items: center; gap: 24px; }

.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; min-height: 44px;
}
.brand { flex-shrink: 0; }
.brand img {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 12px;
  box-shadow: 0 0 0 1px var(--stroke-hi), 0 8px 24px rgba(255, 79, 147, 0.35);
}
.brand-word { font: 700 13px/1 var(--display); letter-spacing: 0.22em; white-space: nowrap; }
.brand-word b { color: var(--blue-hi); font-weight: 700; }

.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 600; color: var(--ink-2);
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav a:hover, .nav a.is-active { color: var(--ink); background: rgba(255, 255, 255, 0.06); }

/* ---------- Buttons ---------- */

.btn {
  --h: 52px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 26px;
  border: 0; border-radius: 999px;
  font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background-position 0.6s var(--ease), opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn img { width: 22px; height: 22px; flex: none; }
[dir="rtl"] svg.arrow { transform: scaleX(-1); }

.btn-primary {
  color: #fff;
  background: var(--grad);
  background-size: 180% 100%;
  box-shadow: 0 10px 30px -8px rgba(255, 79, 147, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover { background-position: 100% 0; transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(49, 138, 240, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35); }

.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px var(--stroke-hi);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); }

.btn-sm { --h: 44px; padding: 0 18px; font-size: 14px; }

.btn-text {
  min-height: 44px; padding: 0 6px; border: 0; background: none;
  color: var(--ink-3); font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  transition: color 0.2s;
}
.btn-text:hover { color: var(--pink); }

.btn.is-busy::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  min-height: min(calc(100svh - 72px), 900px);
  padding: clamp(24px, 6vh, 72px) 0 clamp(48px, 8vh, 96px);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 26px; padding: 8px 16px; padding-inline-start: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px var(--stroke-hi);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.pulse::after, .sos-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: rgba(62, 224, 161, 0.6);
  animation: ripple 2s var(--ease) infinite;
  will-change: transform, opacity;
}

.display {
  margin: 0;
  font-size: clamp(2.5rem, 5.6vw, 4.9rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.display .d-line { display: block; }
.grad-3d {
  display: inline-block;
  padding-block: 0.04em 0.12em;
  background: var(--grad-text);
  background-size: 200% 100%;
  background-position: 35% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter:
    drop-shadow(0 1px 0 rgba(255, 140, 190, 0.55))
    drop-shadow(0 2px 0 rgba(217, 46, 108, 0.55))
    drop-shadow(0 4px 0 rgba(111, 92, 255, 0.4))
    drop-shadow(0 18px 28px rgba(0, 0, 0, 0.55));
}

.lead {
  max-width: 34em;
  margin: 26px 0 34px;
  font-size: clamp(16px, 1.45vw, 19px);
  line-height: 1.65;
  color: var(--ink-2);
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-stats {
  display: flex; flex-wrap: wrap; gap: clamp(18px, 3vw, 40px);
  margin: 44px 0 0; padding: 26px 0 0; list-style: none;
  border-top: 1px solid var(--stroke);
}
.hero-stats b {
  display: block;
  font: 700 clamp(18px, 2vw, 24px)/1.1 var(--display);
  letter-spacing: 0.04em;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-stats span { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-3); }

.hero-orb {
  position: relative;
  width: 100%; max-width: 560px; aspect-ratio: 1;
  justify-self: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
html.no-webgl .hero-orb::before {
  content: ""; position: absolute; inset: 20%; border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, #fff 0 4%, rgba(255, 255, 255, 0.6) 9%, transparent 26%),
    radial-gradient(circle at 70% 75%, rgba(49, 138, 240, 0.95), transparent 60%),
    radial-gradient(circle at 30% 70%, rgba(255, 79, 147, 0.95), transparent 62%), #3a1b5e;
  box-shadow: 0 0 80px rgba(255, 79, 147, 0.4);
}

.chip {
  position: absolute;
  display: flex; align-items: center; gap: 10px;
  padding: 10px; padding-inline-end: 16px;
  border-radius: 18px;
  background: rgba(22, 17, 48, 0.88);
  box-shadow: inset 0 0 0 1px var(--stroke-hi), 0 18px 40px -12px rgba(0, 0, 0, 0.6);
  font-size: 13px; line-height: 1.25; white-space: nowrap;
  animation: floaty 6s ease-in-out infinite alternate;
  will-change: translate;
}
.chip img { width: 36px; height: 36px; }
.chip b { display: block; font-weight: 600; color: var(--ink); }
.chip span { color: var(--ink-3); font-size: 12px; }
.chip.c1 { top: 12%; left: -2%; }
.chip.c2 { top: 48%; right: -4%; animation-delay: -2s; }
.chip.c3 { bottom: 8%; left: 8%; animation-delay: -4s; }

/* ---------- Section heads ---------- */

.section { padding: clamp(56px, 10vh, 120px) 0 0; }

.s-head { display: grid; gap: 14px; max-width: 760px; margin-bottom: clamp(28px, 5vh, 48px); }
.kicker {
  display: inline-flex; align-items: center; gap: 12px;
  margin: 0;
  font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--pink);
}
.kicker .num { font: 700 12px/1 var(--display); letter-spacing: 0.1em; color: var(--ink-3); }
.kicker::after { content: ""; width: 48px; height: 1px; background: linear-gradient(90deg, var(--pink), transparent); }
[dir="rtl"] .kicker::after { background: linear-gradient(270deg, var(--pink), transparent); }

.s-title {
  margin: 0;
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  font-weight: 600; line-height: 1.06; letter-spacing: -0.04em;
}
.s-title .grad-3d { filter: drop-shadow(0 2px 0 rgba(217, 46, 108, 0.5)) drop-shadow(0 12px 22px rgba(0, 0, 0, 0.5)); }
.s-text { margin: 0; max-width: 40em; color: var(--ink-2); font-size: clamp(15px, 1.3vw, 17px); }

/* ---------- Tool tiles ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.tile {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 176px; padding: 22px;
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--stroke);
  text-decoration: none;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease), box-shadow 0.4s var(--ease), background 0.4s var(--ease);
  overflow: hidden;
}
.tile::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 79, 147, 0.18), transparent 60%);
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.tile:hover { background: var(--panel-hi); box-shadow: inset 0 0 0 1px rgba(255, 79, 147, 0.35), 0 24px 50px -24px rgba(255, 79, 147, 0.55); }
.tile:hover::before { opacity: 1; }
.tile img {
  width: 54px; height: 54px; margin-bottom: auto;
  transform: translateZ(40px);
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.45));
  transition: transform 0.5s var(--ease);
}
.tile:hover img { transform: translateZ(60px) scale(1.08) rotate(-4deg); }
.tile h3 { margin: 18px 0 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.tile p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-3); }
.tile .tag {
  position: absolute; top: 18px; inset-inline-end: 18px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--blue-hi); background: rgba(49, 138, 240, 0.14);
}

/* ---------- Panels ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.span-2 { grid-column: span 2; }

.panel {
  position: relative;
  display: flex; flex-direction: column;
  padding: clamp(22px, 3vw, 34px);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(30, 25, 64, 0.78), rgba(15, 12, 34, 0.78));
  box-shadow: inset 0 0 0 1px var(--stroke), 0 30px 60px -40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  isolation: isolate;
}
.panel::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 100%) var(--my, 0%), rgba(111, 92, 255, 0.14), transparent 60%);
}
.panel::after {
  content: ""; position: absolute; left: 10%; right: 10%; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}

.p-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.p-ico {
  width: 64px; height: 64px; flex: none;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.5));
  transition: translate 0.5s var(--ease), rotate 0.5s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .panel:hover .p-ico { animation: bob 2.4s ease-in-out infinite alternate; }
}
.p-kicker { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.p-title { margin: 0; font-size: clamp(20px, 2vw, 26px); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
.p-text { margin: 0 0 22px; color: var(--ink-2); font-size: 15px; max-width: 46em; }
.badge {
  margin-inline-start: auto; align-self: flex-start; white-space: nowrap;
  padding: 5px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--sun); background: rgba(255, 204, 77, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 204, 77, 0.25);
}
.badge.ai { color: var(--blue-hi); background: rgba(49, 138, 240, 0.12); box-shadow: inset 0 0 0 1px rgba(49, 138, 240, 0.3); }

/* ---------- Forms ---------- */

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .input { flex: 1 1 220px; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.field { display: grid; gap: 8px; }
.field > span { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }

.input {
  width: 100%; min-height: 52px; padding: 14px 18px;
  border: 0; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.11);
  font-size: 16px; color: var(--ink);
  transition: box-shadow 0.25s var(--ease), background 0.25s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: #7c779c; }
.input:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.input:focus { outline: none; background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px var(--pink), 0 0 0 4px rgba(255, 79, 147, 0.16); }
textarea.input { min-height: 112px; resize: vertical; line-height: 1.55; }
select.input {
  padding-inline-end: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23bdb8dc' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center;
}
[dir="rtl"] select.input { background-position: left 18px center; }
select.input.grow { flex: 1 1 180px; width: auto; }
select.input option { background: #16122f; color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip-btn {
  min-height: 40px; padding: 0 16px;
  border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px var(--stroke-hi);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  transition: all 0.25s var(--ease);
}
.chip-btn:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--pink); }
.chip-btn[aria-pressed="true"], .chip-btn.is-on {
  color: #fff; background: var(--grad); box-shadow: 0 8px 22px -10px rgba(255, 79, 147, 0.9);
}

.seg {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 5px; border-radius: 999px; gap: 4px;
  background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--stroke);
}
.seg button {
  min-height: 42px; padding: 0 16px; border: 0; border-radius: 999px;
  background: none; font-size: 14px; font-weight: 600; color: var(--ink-2);
  transition: all 0.3s var(--ease);
}
.seg button[aria-pressed="true"] { color: #fff; background: var(--grad); box-shadow: 0 8px 20px -10px rgba(255, 79, 147, 0.9); }

details.more { margin-top: 12px; }
details.more summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-size: 14px; font-weight: 600; color: var(--blue-hi); cursor: pointer; list-style: none;
}
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(49, 138, 240, 0.16); transition: transform 0.3s var(--ease); }
details.more[open] summary::before { transform: rotate(45deg); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }

/* ---------- Output ---------- */

.out {
  margin-top: 18px; padding: 20px 22px;
  border-radius: var(--r-lg);
  background: rgba(8, 7, 20, 0.55);
  box-shadow: inset 0 0 0 1px var(--stroke);
  color: var(--ink);
  font-size: 15px; line-height: 1.7;
  white-space: pre-wrap; overflow-wrap: anywhere;
  animation: rise 0.5s var(--ease);
}
.out:empty { display: none; }
.out.is-ai { position: relative; padding-top: 44px; }
.out.is-ai::before {
  content: "BabyCare AI"; position: absolute; top: 16px; inset-inline-start: 22px;
  font: 700 10px/1 var(--display); letter-spacing: 0.22em;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.out.is-error { box-shadow: inset 0 0 0 1px rgba(255, 90, 110, 0.4); color: #ffc2ca; }
.out.is-note { box-shadow: inset 0 0 0 1px rgba(255, 204, 77, 0.3); color: #ffe7ad; }
.out .caret { display: inline-block; width: 8px; height: 1.1em; margin-inline-start: 2px; vertical-align: -0.15em; background: var(--pink); animation: blink 0.9s steps(2) infinite; }

.disclaimer { margin: 14px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-3); }

/* ---------- Diary ---------- */

.history { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; max-height: 300px; overflow-y: auto; }
.history:empty::before {
  content: attr(data-empty);
  display: block; padding: 22px; border-radius: var(--r-md);
  text-align: center; font-size: 14px; color: var(--ink-3);
  border: 1px dashed var(--stroke-hi);
}
.h-item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 12px 8px; padding-inline-start: 14px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  animation: rise 0.4s var(--ease);
}
.h-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 10px rgba(255, 79, 147, 0.6); }
.h-text { min-width: 0; }
.h-text b { display: block; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.h-text time { font-size: 12px; color: var(--ink-3); }
.h-del {
  width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; color: var(--ink-3);
  display: grid; place-items: center; transition: all 0.2s;
}
.h-del:hover { color: var(--bad); background: rgba(255, 90, 110, 0.1); }
.p-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; color: var(--ink-3); }

/* ---------- Fever ---------- */

.fever-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(18px, 3vw, 34px); align-items: start; }
.gauge, .gauge-scale { direction: ltr; }
.gauge {
  position: relative; height: 14px; margin: 26px 0 10px; border-radius: 999px;
  background: linear-gradient(90deg, #3ea8ff 0%, #3ee0a1 28%, #ffcc4d 50%, #ff8a3d 68%, #ff3d6e 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15), 0 0 30px -6px rgba(255, 90, 110, 0.4);
}
.gauge-knob {
  position: absolute; top: 50%; left: var(--t, 30%);
  width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.18), 0 6px 18px rgba(0, 0, 0, 0.5);
  transition: left 0.9s var(--ease);
}
.gauge-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.verdict {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 18px; padding: 16px 18px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--stroke);
  font-weight: 600; line-height: 1.45;
}
.verdict::before { content: ""; flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--c, var(--ok)); box-shadow: 0 0 14px var(--c, var(--ok)); }
.verdict:empty { display: none; }
.doses { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.dose {
  padding: 18px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--stroke);
  animation: rise 0.5s var(--ease);
}
.dose h4 { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.dose .big { font: 700 26px/1.1 var(--display); letter-spacing: 0.02em; }
.dose .big small { font: 600 13px var(--font); color: var(--ink-3); letter-spacing: 0; }
.dose p { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.dose.para .big { color: #d6b8ff; }
.dose.ibu .big { color: var(--blue-hi); }

/* ---------- Drop zone / media ---------- */

.drop {
  position: relative;
  display: grid; place-items: center; gap: 8px;
  min-height: 150px; padding: 22px;
  border-radius: var(--r-lg);
  border: 1.5px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.025);
  text-align: center; cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
}
.drop:hover, .drop.is-over { border-color: var(--pink); background: rgba(255, 79, 147, 0.06); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop img.icon { width: 48px; height: 48px; }
.drop b { font-weight: 600; }
.drop span { font-size: 13px; color: var(--ink-3); }
.drop .thumb { max-height: 200px; border-radius: 14px; object-fit: contain; }

.cam {
  display: none; width: 100%; max-height: 320px; margin-top: 12px;
  border-radius: var(--r-lg); background: #000; object-fit: cover;
  box-shadow: inset 0 0 0 1px var(--stroke);
}
.cam.is-on { display: block; }

/* ---------- Sounds ---------- */

.sounds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sound {
  position: relative;
  display: grid; justify-items: center; gap: 10px;
  padding: 18px 8px 16px; border: 0; border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--stroke);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  transition: all 0.35s var(--ease);
}
.sound img { width: 46px; height: 46px; transition: transform 0.4s var(--ease); filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.45)); }
.sound:hover img { transform: translateY(-4px) scale(1.06); }
.sound[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(160deg, rgba(255, 79, 147, 0.28), rgba(49, 138, 240, 0.22));
  box-shadow: inset 0 0 0 1px rgba(255, 79, 147, 0.55), 0 18px 40px -18px rgba(255, 79, 147, 0.8);
}
.eq { display: flex; gap: 3px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; height: 30%; border-radius: 2px; background: currentColor; opacity: 0.5; }
.sound[aria-pressed="true"] .eq i { opacity: 1; background: var(--pink); animation: eq 0.9s ease-in-out infinite alternate; }
.sound[aria-pressed="true"] .eq i:nth-child(2) { animation-delay: -0.3s; }
.sound[aria-pressed="true"] .eq i:nth-child(3) { animation-delay: -0.6s; }
.sound[aria-pressed="true"] .eq i:nth-child(4) { animation-delay: -0.15s; }
.sound.is-loading .eq { opacity: 0.4; }

.sleep-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 18px; }
.vol { display: flex; align-items: center; gap: 12px; flex: 1 1 200px; font-size: 13px; color: var(--ink-3); }
input[type="range"] {
  flex: 1; height: 44px; background: none; -webkit-appearance: none; appearance: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--pink) var(--v, 70%), rgba(255, 255, 255, 0.12) var(--v, 70%)); }
[dir="rtl"] input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(270deg, var(--pink) var(--v, 70%), rgba(255, 255, 255, 0.12) var(--v, 70%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--pink); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 79, 147, 0.3); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 79, 147, 0.3); }
.countdown { font: 700 13px/1 var(--display); letter-spacing: 0.1em; color: var(--sun); font-variant-numeric: tabular-nums; }

/* ---------- Cry ---------- */

.cry-stage { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.rec {
  position: relative;
  width: 112px; height: 112px; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad);
  box-shadow: 0 18px 40px -12px rgba(255, 79, 147, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.3s var(--ease);
}
.rec:hover { transform: scale(1.04); }
.rec img { width: 54px; height: 54px; }
.rec::before, .rec::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255, 79, 147, 0.5); opacity: 0;
}
.rec.is-rec::before { animation: ring 1.6s var(--ease) infinite; opacity: 1; }
.rec.is-rec::after { animation: ring 1.6s var(--ease) 0.8s infinite; opacity: 1; }
.rec-info { display: grid; gap: 10px; min-width: 0; }
.wave { width: 100%; height: 64px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--stroke); }
.rec-status { font-size: 14px; color: var(--ink-2); }
.rec-status b { font: 700 13px var(--display); color: var(--pink); letter-spacing: 0.08em; }

.bars { display: grid; gap: 12px; margin-top: 18px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 46px; gap: 12px; align-items: center; font-size: 14px; }
.bar-row .track { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.bar-row .fill { height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width 1.1s var(--ease); }
.bar-row:first-child .fill { box-shadow: 0 0 16px rgba(255, 79, 147, 0.8); }
.bar-row .pct { text-align: end; font: 700 12px var(--display); color: var(--ink-2); }
.metrics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.metric { padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); font-size: 12px; color: var(--ink-3); }
.metric b { color: var(--ink); font-weight: 600; }

/* ---------- Feeding guide ---------- */

.guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.g-card { padding: 18px; border-radius: var(--r-md); background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--stroke); animation: rise 0.5s var(--ease) both; }
.g-card:nth-child(2) { animation-delay: 0.06s; }
.g-card:nth-child(3) { animation-delay: 0.12s; }
.g-card h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pink); }
.g-card ul { margin: 0; padding-inline-start: 18px; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.g-card li + li { margin-top: 6px; }
.g-card li::marker { color: var(--blue-hi); }

/* ---------- Toy verdict ---------- */

.toy-verdict { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; white-space: normal; }
.toy-verdict.safe { color: var(--ok); background: rgba(62, 224, 161, 0.12); }
.toy-verdict.care { color: var(--warn); background: rgba(255, 181, 71, 0.12); }
.toy-verdict.danger { color: var(--bad); background: rgba(255, 90, 110, 0.12); }

/* ---------- Nearby ---------- */

.near-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.near-btn {
  display: grid; justify-items: start; gap: 10px;
  padding: 18px; border: 0; border-radius: var(--r-lg); text-align: start; text-decoration: none;
  background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--stroke);
  font-weight: 600; font-size: 15px; transition: all 0.3s var(--ease);
}
.near-btn img { width: 40px; height: 40px; }
.near-btn small { font-weight: 400; font-size: 12px; color: var(--ink-3); }
.near-btn:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px rgba(49, 138, 240, 0.5), 0 18px 34px -18px rgba(49, 138, 240, 0.8); }
.near-btn.sos { background: linear-gradient(160deg, rgba(255, 90, 110, 0.2), rgba(255, 90, 110, 0.06)); box-shadow: inset 0 0 0 1px rgba(255, 90, 110, 0.4); }
.near-btn.sos b { font: 700 22px/1 var(--display); color: #ff8b9a; }
.map-wrap { display: none; margin-top: 14px; }
.map-wrap.is-on { display: block; animation: rise 0.5s var(--ease); }
.map-wrap.no-map #map { display: none; }
.map-wrap.no-map .places { margin-top: 0; }
#map { width: 100%; height: 380px; border-radius: var(--r-lg); background: #0f0c24; box-shadow: inset 0 0 0 1px var(--stroke); }
.places { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.places li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); font-size: 14px; }
.places li span { color: var(--ink-3); font-size: 12.5px; }
.places a { color: var(--blue-hi); font-weight: 600; text-decoration: none; white-space: nowrap; }

/* ---------- Chat ---------- */

.chat { display: grid; grid-template-rows: auto 1fr auto; }
.chat-feed {
  display: flex; flex-direction: column; gap: 10px;
  height: 380px; overflow-y: auto; padding: 18px;
  border-radius: var(--r-lg);
  background: rgba(8, 7, 20, 0.5); box-shadow: inset 0 0 0 1px var(--stroke);
  scroll-behavior: smooth;
}
.msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; max-width: 86%; animation: rise 0.35s var(--ease); }
.msg .ava {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600; color: #fff;
  background: hsl(var(--h, 330) 70% 55%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.msg .bubble { padding: 10px 14px; border-radius: 4px 18px 18px 18px; background: rgba(255, 255, 255, 0.06); font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.msg .who { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.msg.self { margin-inline-start: auto; grid-template-columns: minmax(0, 1fr) 36px; }
.msg.self .ava { order: 2; }
.msg.self .bubble { border-radius: 18px 4px 18px 18px; background: linear-gradient(135deg, rgba(255, 79, 147, 0.5), rgba(111, 92, 255, 0.45)); }
[dir="rtl"] .msg .bubble { border-radius: 18px 4px 18px 18px; }
[dir="rtl"] .msg.self .bubble { border-radius: 4px 18px 18px 18px; }
.chat-form { display: grid; grid-template-columns: 180px 1fr auto; gap: 10px; margin-top: 14px; }
.chat-empty { margin: auto; color: var(--ink-3); font-size: 14px; }

/* ---------- Translator ---------- */

.lang-bar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-bottom: 12px; }
.swap {
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--stroke-hi);
  transition: transform 0.45s var(--ease);
}
.swap:hover { transform: rotate(180deg); }
.icon-btn {
  width: 52px; height: 52px; flex: none; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--stroke-hi);
  transition: all 0.3s var(--ease);
}
.icon-btn img { width: 28px; height: 28px; }
.icon-btn.is-rec { background: rgba(255, 79, 147, 0.25); box-shadow: inset 0 0 0 1px var(--pink), 0 0 0 6px rgba(255, 79, 147, 0.15); }
.out-tools { display: flex; gap: 6px; margin-top: 10px; }

/* ---------- Notifications ---------- */

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-radius: var(--r-md); background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--stroke); }
.switch-row b { display: block; font-weight: 600; }
.switch-row span { font-size: 13px; color: var(--ink-3); }
.switch {
  position: relative; flex: none; width: 58px; height: 34px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); transition: background 0.35s var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 4px; inset-inline-start: 4px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); transition: transform 0.4s var(--ease);
}
.switch[aria-checked="true"] { background: var(--grad); }
.switch[aria-checked="true"]::after { transform: translateX(24px); }
[dir="rtl"] .switch[aria-checked="true"]::after { transform: translateX(-24px); }
.reminders { margin-top: 16px; }
.reminders p { margin: 0 0 10px; font-size: 13px; color: var(--ink-3); }
.switch-row span { display: block; margin-top: 2px; }
.nt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.nt-vax { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.nt-vax input, .ck-row input { width: 20px; height: 20px; margin: 0; accent-color: var(--pink); }
.nt-custom { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 8px; margin-bottom: 12px; }
.nt-custom .input { min-height: 44px; padding: 10px 14px; }
.nt-custom input[type="time"] { color-scheme: dark; }
.nt-list { display: grid; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.nt-list li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) 36px; align-items: center; gap: 12px;
  padding: 8px 8px 8px 14px; padding-inline: 14px 8px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--stroke);
  font-size: 14px;
}
.nt-list b { font-weight: 600; color: var(--ink); white-space: nowrap; }
.nt-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.nt-x {
  display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.06); color: var(--ink-2); cursor: pointer;
}
.nt-x:hover { background: rgba(255, 90, 110, 0.18); color: #fff; }
@media (max-width: 480px) {
  .nt-custom { grid-template-columns: 1fr auto; }
  .nt-custom #ntText { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Footer ---------- */

.footer { margin-top: clamp(72px, 12vh, 140px); padding: 40px 0 calc(40px + var(--dock-h)); border-top: 1px solid var(--stroke); }
.footer .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: start; }
.sos-note {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 20px; border-radius: var(--r-lg);
  background: rgba(255, 90, 110, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 90, 110, 0.25);
  font-size: 14px; color: #ffd0d6; line-height: 1.55;
}
.sos-note img { width: 36px; height: 36px; flex: none; }
.sos-note a { color: #fff; font-weight: 600; }
.foot-meta { display: grid; gap: 10px; justify-items: end; text-align: end; font-size: 13px; color: var(--ink-3); }
.foot-meta a { text-decoration: none; color: var(--ink-2); }
.foot-meta a:hover { color: var(--pink); }
.eco { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--stroke-hi); font-weight: 600; }
.eco i { font: 700 10px/1 var(--display); font-style: normal; letter-spacing: 0.2em; color: var(--ink); }

/* ---------- Language switch + SOS ---------- */

.lang {
  display: inline-flex; gap: 2px; padding: 3px; margin-inline-start: 4px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--stroke);
  direction: ltr;
}
.lang button {
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%;
  background: none; cursor: pointer;
  transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.lang button[aria-pressed="true"] { background: var(--grad); box-shadow: 0 6px 16px -8px rgba(255, 79, 147, 0.9); }

/* Glossy sphere flag: the art is flat SVG, depth comes from layered light and shadow. */
.flag {
  position: relative; display: block; flex: none; width: 28px; height: 28px; border-radius: 50%;
  box-shadow: 0 4px 8px -3px rgba(0, 0, 0, 0.75), 0 1px 2px rgba(0, 0, 0, 0.4);
  filter: saturate(0.6) brightness(0.82);
  transition: transform 0.3s var(--ease), filter 0.3s var(--ease);
}
.flag img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.flag::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.85) 0, rgba(255, 255, 255, 0.25) 18%, transparent 42%),
    radial-gradient(circle at 50% 50%, transparent 52%, rgba(0, 0, 0, 0.32) 100%);
  box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.35), inset 0 2px 2px rgba(255, 255, 255, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.lang button:hover .flag, :is(.lang button, .lg-lang a):focus-visible .flag { filter: none; transform: translateY(-1px); }
.lang button[aria-pressed="true"] .flag, .lg-lang a[aria-current] .flag { filter: none; transform: scale(1.06); }
@media (prefers-reduced-motion: reduce) { .flag { transition: none; } }

.sos-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 999px; cursor: pointer;
  font: 700 12px/1 var(--display); letter-spacing: 0.16em; color: #fff;
  background: linear-gradient(135deg, #ff5a6e, #d92e6c);
  box-shadow: 0 10px 26px -10px rgba(255, 90, 110, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  position: relative;
  animation: sosBreath 2.4s ease-in-out infinite;
  transition: translate 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
/* Halo and sonar ring animate only opacity/transform so they stay on the compositor. */
.sos-btn::before, .sos-btn::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.sos-btn::before { box-shadow: 0 0 18px 4px rgba(255, 60, 90, 0.85), 0 0 42px 10px rgba(255, 40, 80, 0.35); animation: sosGlow 2.4s ease-in-out infinite; }
.sos-btn::after { box-shadow: 0 0 0 2px rgba(255, 110, 130, 0.9); animation: sosRing 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite; }
.sos-btn:hover { translate: 0 -1px; box-shadow: 0 14px 30px -10px rgba(255, 90, 110, 1); }
.sos-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px 1px #fff; animation: sosBlink 1.2s steps(1, end) infinite; }
.sos-dot::after { background: rgba(255, 255, 255, 0.7); animation-duration: 1.2s; }

.sos-dlg {
  width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 0; border-radius: var(--r-xl);
  color: var(--ink); background: linear-gradient(180deg, #1d1033, #0f0b24);
  box-shadow: inset 0 0 0 1px rgba(255, 90, 110, 0.35), 0 40px 100px rgba(0, 0, 0, 0.7);
  overflow: auto; overscroll-behavior: contain;
}
.sos-dlg[open] { animation: rise 0.4s var(--ease); }
.sos-dlg::backdrop { background: rgba(4, 3, 12, 0.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sos-inner { padding: clamp(18px, 4vw, 30px); }
.sos-head { display: flex; align-items: center; gap: 14px; }
.sos-head img { width: 52px; height: 52px; flex: none; }
.sos-head h2 { margin: 0; font-size: clamp(20px, 3.4vw, 26px); line-height: 1.2; letter-spacing: -0.02em; }
.sos-head p { margin: 4px 0 0; font-size: 13px; color: var(--ink-3); }
.sos-close {
  margin-inline-start: auto; flex: none; display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.06); color: var(--ink); cursor: pointer;
}
.sos-close:hover { background: rgba(255, 255, 255, 0.12); }
.sos-calls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0 14px; }
.sos-call {
  display: grid; gap: 4px; padding: 16px 18px; border-radius: var(--r-lg); text-decoration: none;
  background: linear-gradient(135deg, #ff5a6e, #c41f55); color: #fff;
  box-shadow: 0 16px 34px -18px rgba(255, 90, 110, 1);
}
.sos-call b { font: 700 clamp(22px, 4vw, 30px)/1 var(--display); letter-spacing: 0.04em; direction: ltr; unicode-bidi: isolate; }
.sos-call span { font-size: 13px; opacity: 0.92; }
.sos-call.alt { background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--stroke-hi); }
.sos-call.alt b { font-size: clamp(18px, 3vw, 22px); color: var(--sun); }
.sos-hint { margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }
.sos-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sos-grid button {
  min-height: 52px; padding: 10px 12px; border: 0; border-radius: var(--r-md); cursor: pointer;
  background: rgba(255, 255, 255, 0.05); color: var(--ink); font: 600 13px/1.3 var(--font); text-align: start;
  box-shadow: inset 0 0 0 1px var(--stroke);
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.sos-grid button:hover { background: rgba(255, 90, 110, 0.1); }
.sos-grid button.is-on { background: rgba(255, 90, 110, 0.16); box-shadow: inset 0 0 0 1.5px #ff5a6e; }
.sos-guide:not(:empty) { margin-top: 16px; }
.sos-guide .out { margin-top: 0; }

/* ---------- Baby profile ---------- */

.baby-card {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--stroke);
}
.baby-card[hidden], .profile-form[hidden] { display: none; }
.baby-ava {
  flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px;
  font: 700 22px/1 var(--display); color: #fff; background: var(--grad);
  box-shadow: 0 12px 26px -12px rgba(255, 79, 147, 0.9);
}
.baby-ava[data-sex="g"] { background: linear-gradient(135deg, #ff7ab0, #d92e6c); }
.baby-ava[data-sex="b"] { background: linear-gradient(135deg, #6aaeff, #318af0); }
.baby-meta { display: grid; gap: 2px; min-width: 0; }
.baby-meta b { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.baby-meta span { font-size: 14px; color: var(--ink-2); }
.baby-card .btn { margin-inline-start: auto; }
.profile-form { display: grid; gap: 14px; }
.profile-form .p-text { margin: 0; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sex-seg { justify-self: start; }
.month-tip { display: grid; gap: 10px; margin-top: 14px; }
.month-tip:empty { display: none; }
.tip-vax {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md);
  background: rgba(49, 138, 240, 0.1); box-shadow: inset 0 0 0 1px rgba(106, 174, 255, 0.25);
}
.tip-vax img { flex: none; }
.tip-vax div { display: grid; gap: 2px; font-size: 14px; }
.tip-vax span { color: var(--ink-2); }
.tip-dev, .kb-card {
  border-radius: var(--r-md); background: rgba(255, 255, 255, 0.035); box-shadow: inset 0 0 0 1px var(--stroke);
}
.tip-dev summary, .kb-card summary {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 14px;
  cursor: pointer; list-style: none; font-size: 14px; line-height: 1.4;
}
.tip-dev summary::-webkit-details-marker, .kb-card summary::-webkit-details-marker { display: none; }
.tip-dev summary::after, .kb-card summary::after {
  content: ""; flex: none; width: 8px; height: 8px; margin-inline-start: auto;
  border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3);
  transform: rotate(45deg) translateY(-2px); transition: transform 0.25s var(--ease);
}
.tip-dev[open] summary::after, .kb-card[open] summary::after { transform: rotate(-135deg); }
.tip-dev > :not(summary), .kb-card .kb-body { padding: 0 16px 14px; }
.tip-dev .kb-list, .tip-dev .kb-p { margin-inline: 16px; }
.p-end { margin-top: 14px; }

/* ---------- Vaccines ---------- */

.vax { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 470px; overflow: auto; padding-inline-end: 4px; }
.vx {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--stroke);
  transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.vx-check {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; margin-top: 1px;
  border: 0; border-radius: 12px; cursor: pointer; color: transparent;
  background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1.5px var(--stroke-hi);
  transition: all 0.25s var(--ease);
}
.vx-check:hover { box-shadow: inset 0 0 0 1.5px var(--ok); }
.vx-body { display: grid; gap: 3px; min-width: 0; flex: 1; }
.vx-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.vx-head b { font-weight: 600; }
.vx-head time { font-size: 12px; color: var(--ink-3); }
.vx-tag { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.vx-tag.done { color: var(--ok); background: rgba(62, 224, 161, 0.12); }
.vx-tag.late { color: var(--bad); background: rgba(255, 90, 110, 0.14); }
.vx-tag.next { color: var(--sun); background: rgba(255, 204, 77, 0.14); }
.vx-names { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.vx-hint { padding: 12px 4px 4px; font-size: 13px; color: var(--ink-3); }
.vx.is-done { opacity: 0.72; }
.vx.is-done .vx-check { color: #071a12; background: var(--ok); box-shadow: none; }
.vx.is-late { box-shadow: inset 0 0 0 1px rgba(255, 90, 110, 0.35); }
.vx.is-next { background: rgba(255, 204, 77, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 204, 77, 0.35); }

/* ---------- Day tracker ---------- */

.tk-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tk-stat {
  display: grid; gap: 4px; padding: 16px; border-radius: var(--r-lg); min-width: 0;
  background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--stroke);
}
.tk-stat span { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.tk-stat b { font-size: 22px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-stat small { font-size: 12px; color: var(--ink-2); }
.tk-stat.feed b { color: #ff9cc4; }
.tk-stat.sleep b { color: var(--blue-hi); }
.tk-stat.diaper b { color: var(--sun); }
.tk-day { margin: 18px 0 16px; }
.tk-track {
  position: relative; height: 26px; border-radius: 10px; overflow: hidden;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px calc(100% / 24)), rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px var(--stroke);
}
.tk-seg { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; }
.tk-seg.s { background: linear-gradient(90deg, #318af0, #6aaeff); opacity: 0.85; }
.tk-seg.f { width: 4px; margin-inline-start: -2px; background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.tk-seg.d { width: 4px; margin-inline-start: -2px; top: 9px; bottom: 9px; background: var(--sun); }
.tk-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-inline-start: -1px; background: #fff; box-shadow: 0 0 10px #fff; z-index: 1; }
.tk-hours { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tk-actions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.tk-btn {
  position: relative; display: grid; justify-items: center; gap: 6px; min-height: 86px; padding: 12px 6px;
  border: 0; border-radius: var(--r-lg); cursor: pointer;
  background: rgba(255, 255, 255, 0.045); color: var(--ink); font: 600 13px/1.2 var(--font); text-align: center;
  box-shadow: inset 0 0 0 1px var(--stroke);
  transition: transform 0.2s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.tk-btn img { width: 34px; height: 34px; transition: transform 0.3s var(--ease); }
.tk-btn:hover { background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px var(--stroke-hi); }
.tk-btn:hover img { transform: translateY(-2px) scale(1.06); }
.tk-btn:active { transform: scale(0.97); }
.tk-btn.is-live { background: linear-gradient(135deg, rgba(255, 79, 147, 0.3), rgba(49, 138, 240, 0.25)); box-shadow: inset 0 0 0 1.5px var(--pink); }
.tk-btn.is-live::after { content: ""; position: absolute; top: 10px; inset-inline-end: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: dotPulse 1.6s ease-in-out infinite; }
.tk-bottle { margin-top: 10px; }
.tk-bottle[hidden] { display: none; }
.tk-live { display: grid; gap: 8px; margin-top: 12px; }
.tk-live:empty { display: none; }
.tk-run {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: var(--r-lg); background: linear-gradient(135deg, rgba(255, 79, 147, 0.14), rgba(49, 138, 240, 0.12));
  box-shadow: inset 0 0 0 1px rgba(255, 79, 147, 0.35);
}
.tk-run div { display: grid; gap: 2px; font-size: 14px; min-width: 0; }
.tk-run div span { font-size: 12px; color: var(--ink-2); }
.tk-clock { font: 700 20px/1 var(--display); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; direction: ltr; }
.tk-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; max-height: 300px; overflow: auto; }
.tk-item { display: flex; align-items: center; gap: 12px; padding: 8px 6px; padding-inline-start: 10px; border-radius: var(--r-md); }
.tk-item:hover { background: rgba(255, 255, 255, 0.035); }
.tk-item img { flex: none; }
.tk-item div { display: grid; gap: 1px; min-width: 0; flex: 1; font-size: 14px; }
.tk-item time { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tk-empty { padding: 14px 10px; font-size: 14px; color: var(--ink-3); }

/* ---------- Growth ---------- */

.growth-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.gr-result { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 14px; }
.gr-result:empty { display: none; }
.gr-pill {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 10px; padding: 12px 14px;
  border-radius: var(--r-md); background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--stroke);
}
.gr-pill span { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.gr-pill b { font-size: 17px; grid-column: 1; }
.gr-pill small { grid-row: 1; grid-column: 2; font-size: 13px; font-weight: 700; }
.gr-pill em { grid-column: 2; font-style: normal; font-size: 12px; text-align: end; }
.gr-pill.ok small, .gr-pill.ok em { color: var(--ok); }
.gr-pill.edge { box-shadow: inset 0 0 0 1px rgba(255, 204, 77, 0.35); }
.gr-pill.edge small, .gr-pill.edge em { color: var(--sun); }
.gr-pill.out { box-shadow: inset 0 0 0 1px rgba(255, 90, 110, 0.45); }
.gr-pill.out small, .gr-pill.out em { color: var(--bad); }
.gr-note { margin: 0; font-size: 13px; color: var(--sun); }
.gr-chart-wrap { display: grid; gap: 10px; min-width: 0; }
.gr-chart-wrap .seg { justify-self: start; }
.gr-chart {
  width: 100%; height: auto; direction: ltr; border-radius: var(--r-lg);
  background: rgba(8, 7, 20, 0.45); box-shadow: inset 0 0 0 1px var(--stroke);
}
.gr-chart .gl { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.gr-chart text { fill: var(--ink-3); font: 500 11px var(--font); }
.gr-chart .ty { text-anchor: end; }
.gr-chart .tx { text-anchor: middle; }
.gr-chart .tu { font-weight: 700; fill: var(--ink-2); }
.gr-chart .tm { text-anchor: end; }
.gr-chart .b3 { fill: rgba(106, 174, 255, 0.09); }
.gr-chart .b15 { fill: rgba(106, 174, 255, 0.16); }
.gr-chart .med { fill: none; stroke: var(--blue-hi); stroke-width: 2; stroke-dasharray: 5 5; }
.gr-chart .me { fill: none; stroke: url(#grg); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.gr-chart .pt { fill: var(--pink); stroke: #fff; stroke-width: 2.5; filter: drop-shadow(0 0 6px rgba(255, 79, 147, 0.8)); }
.gr-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 12px; color: var(--ink-3); }
.gr-legend i { display: inline-block; width: 18px; height: 10px; border-radius: 4px; }
.gr-legend i:not(:first-child) { margin-inline-start: 6px; }
.gr-legend .l50 { height: 0; border-top: 2px dashed var(--blue-hi); border-radius: 0; }
.gr-legend .l15 { background: rgba(106, 174, 255, 0.32); }
.gr-legend .l3 { background: rgba(106, 174, 255, 0.14); }
.gr-legend .lme { height: 4px; background: linear-gradient(90deg, #ff4f93, #6aaeff); }
.g-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.g-list li { display: flex; align-items: center; gap: 12px; padding: 8px 6px; padding-inline-start: 12px; border-radius: var(--r-md); }
.g-list li:hover { background: rgba(255, 255, 255, 0.035); }
.g-list div { display: grid; gap: 2px; flex: 1; min-width: 0; font-size: 14px; }
.g-list time { font-size: 12px; color: var(--ink-3); }

/* ---------- Voice input ---------- */

.ta-wrap { position: relative; }
.ta-wrap textarea { padding-inline-end: 62px; }
.ta-mic {
  position: absolute; bottom: 10px; inset-inline-end: 10px; display: grid; place-items: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, 0.07); color: var(--ink);
  transition: background 0.25s var(--ease), transform 0.2s var(--ease);
}
.ta-mic:hover { background: rgba(255, 79, 147, 0.2); }
.ta-mic.is-rec { background: var(--pink); animation: ring 1.4s infinite; }
.ta-mic[hidden] { display: none; }

/* ---------- Offline library ---------- */

.lib-search {
  display: flex; align-items: center; gap: 12px; padding: 6px 6px; padding-inline-start: 16px;
  border-radius: 999px; background: rgba(8, 7, 20, 0.55); box-shadow: inset 0 0 0 1px var(--stroke-hi);
  transition: box-shadow 0.25s var(--ease);
}
.lib-search:focus-within { box-shadow: inset 0 0 0 1.5px var(--pink), 0 0 0 4px rgba(255, 79, 147, 0.14); }
.lib-search img { flex: none; }
.lib-search input {
  flex: 1; min-width: 0; min-height: 48px; border: 0; outline: 0; background: none;
  color: var(--ink); font: 500 16px var(--font);
}
.lib-search input::placeholder { color: var(--ink-3); }
.lib-cats { display: flex; gap: 8px; margin: 14px 0 16px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.lib-cats::-webkit-scrollbar { display: none; }
.lib-cats .chip-btn { flex: none; }
.lib-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: start; }
.kb-card.urgent { box-shadow: inset 0 0 0 1px rgba(255, 90, 110, 0.35); }
.kb-card summary b { font-weight: 600; min-width: 0; }
.kb-card[open] { background: rgba(255, 255, 255, 0.055); }
.kb-body { font-size: 14.5px; line-height: 1.65; color: var(--ink); animation: rise 0.35s var(--ease); }
.kb-cat {
  flex: none; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-2); background: rgba(255, 255, 255, 0.07);
}
.kb-cat.health { color: #ff9aa7; background: rgba(255, 90, 110, 0.14); }
.kb-cat.digestion, .kb-cat.feeding { color: #ffb0cf; background: rgba(255, 79, 147, 0.12); }
.kb-cat.sleep { color: var(--blue-hi); background: rgba(49, 138, 240, 0.14); }
.kb-cat.solids { color: #ffd98a; background: rgba(255, 204, 77, 0.12); }
.kb-cat.development { color: #a99bff; background: rgba(111, 92, 255, 0.16); }
.kb-cat.safety { color: #ffbf73; background: rgba(255, 181, 71, 0.14); }
.kb-cat.skin { color: #7fe8c0; background: rgba(62, 224, 161, 0.12); }
.kb-cat.family { color: #9ccfff; background: rgba(106, 174, 255, 0.12); }
.lib-empty { grid-column: 1 / -1; margin: 0; padding: 18px; text-align: center; color: var(--ink-3); font-size: 14px; }
.lib-more { justify-content: center; margin-top: 14px; }

/* ---------- Offline answer cards ---------- */

.out.is-kb { white-space: normal; box-shadow: inset 0 0 0 1px rgba(62, 224, 161, 0.28); }
.kb-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.kb-chip {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ok); background: rgba(62, 224, 161, 0.12);
}
.kb-title { margin: 0 0 8px; font-size: 17px; line-height: 1.35; letter-spacing: -0.01em; }
.kb-p { margin: 0 0 8px; }
.kb-list { margin: 0 0 10px; padding-inline-start: 20px; display: grid; gap: 4px; }
.kb-list li::marker { color: var(--pink); }
.kb-list li.lvl-danger { color: #ffc2ca; }
.kb-list li.lvl-danger::marker { color: var(--bad); }
.kb-list li.lvl-care { color: #ffe7ad; }
.kb-list li.lvl-care::marker { color: var(--warn); }
.kb-doc {
  display: grid; gap: 4px; margin-top: 12px; padding: 12px 14px; border-radius: var(--r-md);
  background: rgba(255, 204, 77, 0.07); box-shadow: inset 0 0 0 1px rgba(255, 204, 77, 0.25); font-size: 14px;
}
.kb-doc b { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sun); }
.kb-doc.is-urgent { background: rgba(255, 90, 110, 0.09); box-shadow: inset 0 0 0 1px rgba(255, 90, 110, 0.4); }
.kb-doc.is-urgent b { color: #ff8a98; }
.kb-rel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.kb-rel > span, .kb-rel-t { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.kb-rel .chip-btn { min-height: 38px; font-size: 13px; text-align: start; }
.kb-rel-t { margin: 14px 0 8px; }

/* ---------- Phrasebook ---------- */

.tr-main { margin: 0 0 6px; font-size: 20px; font-weight: 600; line-height: 1.4; }
.tr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tr-phrase {
  display: grid; gap: 2px; width: 100%; padding: 10px 14px; border: 0; border-radius: var(--r-md); cursor: pointer;
  background: rgba(255, 255, 255, 0.04); color: var(--ink); font: 400 14px/1.45 var(--font); text-align: start;
  box-shadow: inset 0 0 0 1px var(--stroke); transition: background 0.2s var(--ease);
}
.tr-phrase:hover { background: rgba(255, 255, 255, 0.08); }
.tr-phrase span { color: var(--ink-3); font-size: 13px; }

/* ---------- Small bits ---------- */

.badge.live { color: var(--ok); background: rgba(62, 224, 161, 0.12); }
.link { color: var(--pink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:hover { color: #ff9cc4; }
.report { display: none; }

/* ---------- Account button ---------- */

.acct-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 3px; padding-inline-end: 14px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--stroke);
  color: var(--ink); font: 600 13px/1 var(--font);
  transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.acct-btn:hover { background: rgba(255, 255, 255, 0.09); box-shadow: inset 0 0 0 1px var(--stroke-hi); }
.acct-btn + .lang { margin-inline-start: 0; }
.acct-ava {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--grad) center / cover no-repeat; color: #fff; font: 700 14px/1 var(--display);
  box-shadow: 0 6px 16px -8px rgba(255, 79, 147, 0.9);
}
.acct-ava.has-photo, .baby-ava.has-photo, .kid-ava.has-photo { background-size: cover; background-position: center; color: transparent; }
.acct-label { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-sync { position: absolute; inset-block-start: 3px; inset-inline-start: 31px; width: 10px; height: 10px; border-radius: 50%; display: none; box-shadow: 0 0 0 2px var(--bg); }
.acct-sync.is-ok { display: block; background: var(--ok); }
.acct-sync.is-busy { display: block; background: var(--sun); animation: blink 0.8s infinite alternate; }
.acct-sync.is-off { display: block; background: var(--ink-3); }

/* ---------- Sheets (account, record editor) ---------- */

.sheet {
  width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 0; border-radius: var(--r-xl);
  color: var(--ink); background: linear-gradient(180deg, #1a1236, #0d0a22);
  box-shadow: inset 0 0 0 1px var(--stroke-hi), 0 40px 100px rgba(0, 0, 0, 0.7);
  overflow: auto; overscroll-behavior: contain;
}
.sheet.rec-dlg { width: min(760px, calc(100vw - 24px)); }
.sheet[open] { animation: rise 0.4s var(--ease); }
.sheet::backdrop { background: rgba(4, 3, 12, 0.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet-inner { display: grid; gap: 16px; padding: clamp(18px, 4vw, 30px); }
.sheet-head { display: flex; align-items: center; gap: 14px; }
.sheet-head img { width: 48px; height: 48px; flex: none; }
.sheet-head h2 { margin: 0; font-size: clamp(20px, 3.4vw, 26px); line-height: 1.2; letter-spacing: -0.02em; }
.sheet-head p { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pink); }
.sheet-h { margin: 6px 0 -4px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
#acctGuest, #acctUser { display: grid; gap: 16px; }
#acctGuest[hidden], #acctUser[hidden] { display: none; }

.acct-perks { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.acct-perks li {
  position: relative; padding: 12px 14px; padding-inline-start: 44px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--stroke); font-size: 14px; color: var(--ink-2);
}
.acct-perks li::before {
  content: ""; position: absolute; inset-inline-start: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%;
  background: var(--grad); -webkit-mask: radial-gradient(circle, #000 34%, transparent 36%), linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.acct-tabs { justify-self: stretch; }
.acct-tabs button { flex: 1; }
.acct-tabs button[aria-selected="true"], .rec-bar .seg button[aria-selected="true"] { color: #fff; background: var(--grad); box-shadow: 0 8px 20px -10px rgba(255, 79, 147, 0.9); }
.acct-form { display: grid; gap: 14px; }
.acct-form .reg-only { display: none; }
.acct-form.is-reg .reg-only { display: grid; }
.acct-form .seg { justify-self: start; }
.acct-del { display: grid; gap: 12px; margin-top: 12px; padding: 16px; border-radius: var(--r-md); background: rgba(255, 90, 110, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 90, 110, 0.35); }
.acct-del[hidden] { display: none; }
.acct-del .actions { margin-top: 0; }
.btn-danger { color: #fff; background: #e5364f; box-shadow: 0 10px 24px -12px rgba(229, 54, 79, 0.9); }
.btn-danger:hover { background: #f0425b; }
.acct-err { margin: 0; min-height: 1.2em; font-size: 14px; color: var(--bad); }
.acct-err:empty { display: none; }
.acct-go { justify-self: stretch; }
.acct-fine { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }

.acct-me { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--stroke); }
.acct-me > div { display: grid; gap: 2px; min-width: 0; }
.acct-me b { font-size: 16px; }
.acct-me span { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.acct-ava.lg { width: 48px; height: 48px; font-size: 18px; }
.acct-ava[data-role="dad"] { background: linear-gradient(135deg, #6aaeff, #318af0); }
.acct-state { margin-inline-start: auto; flex: none; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ok); background: rgba(62, 224, 161, 0.1); }
.acct-state[data-state="busy"] { color: var(--sun); background: rgba(255, 204, 77, 0.1); }
.acct-state[data-state="off"] { color: var(--ink-3); background: rgba(255, 255, 255, 0.06); }

.acct-kids { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.acct-kid { display: flex; align-items: center; gap: 6px; border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--stroke); }
.acct-kid.is-active { box-shadow: inset 0 0 0 1.5px var(--pink); background: rgba(255, 79, 147, 0.07); }
.acct-kid-pick { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; min-width: 0; }
.acct-kid-meta { display: grid; gap: 2px; min-width: 0; }
.acct-kid-meta b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-kid-meta small { font-size: 13px; color: var(--ink-3); }
.acct-kid-on { margin-inline-start: auto; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: var(--grad); }
.acct-kid-del { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-inline-end: 6px; border: 0; border-radius: 50%; background: none; color: var(--ink-3); cursor: pointer; }
.acct-kid-del:hover { color: var(--bad); background: rgba(255, 90, 110, 0.1); }
.acct-empty { padding: 14px; font-size: 14px; color: var(--ink-3); }
#acAddKid { justify-self: start; }

.fam-code { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); background: linear-gradient(120deg, rgba(255, 79, 147, 0.12), rgba(49, 138, 240, 0.12)); box-shadow: inset 0 0 0 1px var(--stroke-hi); }
.fam-code > div { display: grid; gap: 4px; }
.fam-code span { font-size: 12px; color: var(--ink-3); }
.fam-code b { font: 700 22px/1 var(--display); letter-spacing: 0.22em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; unicode-bidi: isolate; }
.fam-code .btn { margin-inline-start: auto; }
.fam-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fam-list li { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; padding-inline: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); font-size: 13px; }
.fam-list small { color: var(--ink-3); }
.fam-ava { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--grad); font: 700 11px/1 var(--display); color: #fff; }

/* ---------- Profile: photo, children ---------- */

.kids { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.kids[hidden] { display: none; }
.kids::-webkit-scrollbar { display: none; }
.kid {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 3px; padding-inline-end: 14px;
  border: 0; border-radius: 999px; cursor: pointer; background: rgba(255, 255, 255, 0.05); color: var(--ink-2); font: 600 13px/1 var(--font);
  box-shadow: inset 0 0 0 1px var(--stroke); transition: all 0.25s var(--ease);
}
.kid[aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--pink); background: rgba(255, 79, 147, 0.08); }
.kid-add { padding-inline-end: 3px; }
.kid-ava {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  font: 700 14px/1 var(--display); color: #fff; background: var(--grad) center / cover no-repeat;
}
.acct-kid .kid-ava { width: 46px; height: 46px; border-radius: 16px; }
.kid-ava[data-sex="g"]:not(.has-photo) { background: linear-gradient(135deg, #ff7ab0, #d92e6c); }
.kid-ava[data-sex="b"]:not(.has-photo) { background: linear-gradient(135deg, #6aaeff, #318af0); }
.kid-add .kid-ava { background: rgba(255, 255, 255, 0.08); color: var(--ink); font: 400 20px/1 var(--font); }
.baby-ava { background-size: cover; background-position: center; }
.baby-meta small { font-size: 12.5px; color: var(--ink-3); }
.baby-meta small[hidden] { display: none; }

.photo-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.photo-pick { display: inline-flex; align-items: center; gap: 14px; cursor: pointer; }
.photo-prev {
  flex: none; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 24px;
  background: rgba(255, 255, 255, 0.05) center / cover no-repeat; box-shadow: inset 0 0 0 1.5px var(--stroke-hi);
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.photo-pick:hover .photo-prev, .photo-pick:focus-within .photo-prev { box-shadow: inset 0 0 0 1.5px var(--pink), 0 0 0 4px rgba(255, 79, 147, 0.16); transform: scale(1.03); }
.photo-prev.has { box-shadow: 0 14px 30px -14px rgba(255, 79, 147, 0.9), inset 0 0 0 2px rgba(255, 255, 255, 0.3); }
.photo-prev.has img { display: none; }
.photo-cta { display: grid; gap: 2px; }
.photo-cta b { font-size: 15px; }
.photo-cta small { font-size: 12.5px; color: var(--ink-3); }
#stageSeg { justify-self: start; }
.field[hidden] { display: none; }

/* ---------- Medical record ---------- */

.rec-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rec-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rec-scan { cursor: pointer; }
.rec-scan:focus-within { outline: 2px solid var(--pink); outline-offset: 2px; }
.rec-body { display: grid; gap: 10px; }
.rec-empty {
  display: grid; gap: 6px; padding: 26px 20px; border-radius: var(--r-lg); text-align: center;
  background: radial-gradient(120% 140% at 50% 0%, rgba(62, 224, 161, 0.1), transparent 60%), rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px var(--stroke);
}
.rec-empty b { font-size: 17px; }
.rec-empty span { font-size: 14px; color: var(--ink-3); max-width: 46ch; margin-inline: auto; }

.rec-card { border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.035); box-shadow: inset 0 0 0 1px var(--stroke); overflow: hidden; }
.rec-card:not(.is-closed).is-ill { box-shadow: inset 0 0 0 1px rgba(255, 181, 71, 0.4); background: linear-gradient(180deg, rgba(255, 181, 71, 0.07), rgba(255, 255, 255, 0.02) 60%); }
.rec-card:not(.is-closed).is-hosp { box-shadow: inset 0 0 0 1px rgba(255, 90, 110, 0.45); background: linear-gradient(180deg, rgba(255, 90, 110, 0.09), rgba(255, 255, 255, 0.02) 60%); }
.rec-head { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 12px 16px; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.rec-head img { width: 40px; height: 40px; flex: none; }
.rec-meta { display: grid; gap: 2px; min-width: 0; flex: 1; }
.rec-meta b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-meta small { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, 0.07); color: var(--ink-2); white-space: nowrap; }
.rec-chip.live { color: #fff; background: linear-gradient(135deg, #ff5a6e, #d92e6c); }
.rec-card.is-ill .rec-chip.live { background: linear-gradient(135deg, #ffb547, #ff7a45); color: #2a1400; }
.rec-chip.ok { color: var(--ok); background: rgba(62, 224, 161, 0.12); }
.rec-chip.hot { color: #ffd2d8; background: rgba(255, 90, 110, 0.2); }
.rec-inner { display: grid; gap: 14px; padding: 0 16px 16px; }
.rec-syms { display: flex; flex-wrap: wrap; gap: 6px; }
.rec-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.rec-facts > div { padding: 12px 14px; border-radius: var(--r-md); background: rgba(255, 255, 255, 0.04); }
.rec-facts > div:first-child { grid-column: 1 / -1; }
.rec-facts > div.is-flag { grid-column: 1 / -1; background: rgba(255, 90, 110, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 90, 110, 0.35); }
.rec-facts dt { margin-bottom: 4px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.rec-facts dd { margin: 0; font-size: 14px; line-height: 1.5; white-space: pre-line; }
.rec-facts ul { margin: 0; padding-inline-start: 18px; }
.rec-docs { display: flex; gap: 8px; overflow-x: auto; }
.rec-doc { flex: none; display: block; width: 92px; height: 120px; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--stroke-hi); }
.rec-doc img { width: 100%; height: 100%; object-fit: cover; }
.rec-days { display: grid; gap: 8px; padding-inline-start: 14px; border-inline-start: 2px solid rgba(255, 255, 255, 0.08); }
.rec-days-empty { margin: 0; font-size: 13.5px; color: var(--ink-3); }
.rec-day-h { display: flex; align-items: baseline; gap: 10px; position: relative; }
.rec-day-h::before { content: ""; position: absolute; inset-inline-start: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 3px var(--bg-2); }
.rec-day-h b { font-size: 14px; }
.rec-day-h span { font-size: 12.5px; color: var(--ink-3); }
.rec-day { display: grid; gap: 6px; margin: 0 0 6px; padding: 0; list-style: none; }
.rec-day li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.rec-day time { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.rec-note { display: grid; grid-template-columns: 1fr 96px auto; gap: 8px; }
.rec-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rec-help[hidden] { display: none; }

.rec-sum-k { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.rec-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.rec-stat { display: grid; gap: 4px; padding: 16px; border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--stroke); }
.rec-stat b { font: 700 clamp(26px, 4vw, 34px)/1 var(--display); background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rec-stat span { font-size: 13px; color: var(--ink-3); }
.rec-bars, .rec-follow { display: grid; gap: 8px; padding: 16px; border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.03); }
.rec-bars h4, .rec-follow h4 { margin: 0 0 4px; font-size: 14px; }
.rec-bar-row { display: grid; grid-template-columns: 140px 1fr 28px; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.rec-track { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.rec-track i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.rec-bar-row b { text-align: end; font-variant-numeric: tabular-nums; }
.rec-follow ul { margin: 0; padding-inline-start: 18px; font-size: 14px; color: var(--ink-2); display: grid; gap: 4px; }
.rec-allergy { margin: 0; padding: 12px 14px; border-radius: var(--r-md); background: rgba(255, 181, 71, 0.1); color: var(--warn); font-size: 14px; font-weight: 600; }

.rec-form textarea { min-height: 64px; resize: vertical; }
.rec-symset { margin: 0; padding: 0; border: 0; }
.rec-symset legend { margin-bottom: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.rec-form-act { display: flex; align-items: center; gap: 8px; }
.rec-form-act .grow { flex: 1; }
.btn-text.danger { color: var(--bad); }
.scan-sum { display: flex; gap: 14px; padding: 12px; border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--stroke); }
.scan-sum img { flex: none; width: 84px; height: 110px; object-fit: cover; border-radius: 10px; }
.scan-sum > div { display: grid; gap: 4px; align-content: start; min-width: 0; }
.scan-sum b { font-size: 15px; }
.scan-sum span { font-size: 13px; color: var(--ink-3); }
.scan-sum summary { margin-top: 4px; font-size: 13px; cursor: pointer; color: var(--blue-hi); }
.scan-sum pre { max-height: 180px; overflow: auto; margin: 6px 0 0; padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.3); font: 12px/1.5 var(--font); white-space: pre-wrap; }

.scan-wait { justify-items: center; text-align: center; padding-block: 34px; }
.scan-frame { position: relative; width: 180px; height: 236px; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 60px -24px rgba(49, 138, 240, 0.7), inset 0 0 0 1px var(--stroke-hi); }
.scan-frame img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.6) brightness(0.9); }
.scan-beam { position: absolute; inset-inline: 0; top: 0; height: 36%; background: linear-gradient(180deg, transparent, rgba(255, 79, 147, 0.35) 70%, rgba(255, 255, 255, 0.9) 100%); animation: scanBeam 1.8s var(--ease) infinite alternate; mix-blend-mode: screen; }
@keyframes scanBeam { from { transform: translateY(-100%); } to { transform: translateY(280%); } }
.scan-wait b { font-size: 18px; }
.scan-step { font-size: 14px; color: var(--ink-3); min-height: 1.4em; }
.scan-bar { width: min(280px, 80%); }
.scan-bar i { transform-origin: left; transform: scaleX(0.06); transition: transform 0.4s var(--ease); }
[dir="rtl"] .scan-bar i { transform-origin: right; }

/* ---------- Install banner ---------- */

.install {
  position: fixed; inset-inline: 12px; bottom: calc(16px + var(--dock-h)); z-index: 70;
  display: flex; align-items: center; gap: 12px; max-width: 560px; margin-inline: auto; padding: 12px; padding-inline-end: 8px;
  border-radius: 24px; background: rgba(20, 16, 44, 0.97);
  box-shadow: inset 0 0 0 1px var(--stroke-hi), 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 79, 147, 0.12);
  transform: translateY(24px); opacity: 0; transition: transform 0.5s var(--ease), opacity 0.5s var(--ease);
}
.install[hidden] { display: none; }
.install.is-on { transform: none; opacity: 1; }
.install-ico { flex: none; width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 10px 24px -10px rgba(255, 79, 147, 0.9); }
.install-copy { display: grid; gap: 3px; min-width: 0; flex: 1; }
.install-copy b { font-size: 15px; }
.install-copy span { font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.install-copy .ios-share { display: inline-block; vertical-align: -3px; margin-inline: 2px; color: var(--blue-hi); }
.install-copy .kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 6px; background: rgba(255, 255, 255, 0.1); font-size: 13px; color: var(--ink); }
.ck {
  position: fixed; inset-inline: 12px; bottom: calc(16px + var(--dock-h)); z-index: 80;
  max-width: 760px; margin-inline: auto;
  border-radius: 24px; background: rgba(20, 16, 44, 0.98);
  box-shadow: inset 0 0 0 1px var(--stroke-hi), 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 79, 147, 0.12);
  transform: translateY(24px); opacity: 0; transition: transform 0.45s var(--ease), opacity 0.45s var(--ease);
}
.ck[hidden] { display: none; }
.ck.is-on { transform: none; opacity: 1; }
.ck-in { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; padding: 16px 18px; }
.ck-ico { width: 44px; height: 44px; align-self: start; }
.ck-copy { display: grid; gap: 6px; min-width: 0; }
.ck-copy h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.ck-copy p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.ck-copy .ck-why { color: #ffd6e6; }
.ck-copy .ck-now { font-size: 12.5px; color: var(--ink-3); }
.ck-links { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.ck-links a { color: var(--blue-hi); font-weight: 600; text-decoration: none; }
.ck-links a:hover { text-decoration: underline; }
.ck-btns { display: grid; gap: 8px; }
.ck-btns .btn { min-width: 132px; }
.ck-erase { grid-column: 2 / -1; justify-self: start; min-height: 36px; padding: 0; }
@media (max-width: 640px) {
  .ck-in { grid-template-columns: auto minmax(0, 1fr); padding: 14px; }
  .ck-ico { width: 36px; height: 36px; }
  .ck-btns { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .ck-btns .btn { min-width: 0; }
  .ck-erase { grid-column: 1 / -1; }
}
.foot-legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; padding-top: 18px; border-top: 1px solid var(--stroke); font-size: 13px; }
.foot-legal a { display: inline-flex; align-items: center; min-height: 36px; color: var(--ink-2); text-decoration: none; }
.foot-legal a:hover { color: var(--pink); }
.foot-legal .btn-text { min-height: 36px; padding: 0; font-size: 13px; }
.install-act { display: flex; align-items: center; gap: 4px; flex: none; }
.install-act .btn[hidden] { display: none; }
.install-x { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--ink-3); cursor: pointer; }
.install-x:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.install-link { font-size: 13px; }
.install-link[hidden] { display: none; }
html.is-app .install-link { display: none; }

@media (max-width: 1180px) {
  .acct-btn { padding-inline-end: 3px; }
  .acct-label { display: none; }
  .nav { gap: 0; }
  .nav a { padding-inline: 10px; }
}
@media (max-width: 1080px) and (min-width: 721px) {
  .brand-word { display: none; }
  .topbar .wrap { gap: 14px; }
}
@media (max-width: 860px) and (min-width: 721px) {
  .nav { gap: 0; }
  .nav a { padding-inline: 8px; font-size: 13px; }
  .sos-btn { padding: 0 12px; }
}
@media (max-width: 800px) and (min-width: 721px) {
  .topbar .wrap { gap: 10px; }
  .nav a:last-child { display: none; }
}
@media (max-width: 560px) {
  .brand-word { display: none; }
}

@media (max-width: 720px) {
  .acct-btn { padding-inline-end: 3px; }
  .acct-label { display: none; }
  .acct-btn + .lang { margin-inline-start: 0; }
  .acct-btn { margin-inline-start: auto; }
  .rec-bar { flex-direction: column; align-items: stretch; }
  .rec-bar .seg { justify-self: stretch; }
  .rec-bar .seg button { flex: 1; }
  .rec-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .rec-actions .rec-scan { grid-column: 1 / -1; }
  .rec-facts { grid-template-columns: 1fr; }
  .rec-stats { grid-template-columns: 1fr 1fr; }
  .rec-note { grid-template-columns: 1fr 84px; }
  .rec-note .btn { grid-column: 1 / -1; }
  .rec-bar-row { grid-template-columns: 110px 1fr 24px; }
  .fam-code b { font-size: 18px; letter-spacing: 0.16em; }
  .rec-form .fields.two { grid-template-columns: 1fr; }
  .acct-form .fields.two { grid-template-columns: 1fr; }
  .sheet { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto auto 0; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .install { inset-inline: 10px; }
}

/* ---------- Print: doctor report ---------- */

@media print {
  html.printing body > *:not(#report) { display: none !important; }
  html.printing, html.printing body { background: #fff !important; color: #111 !important; }
  html.printing body::before, html.printing body::after { display: none !important; }
  #report { display: block; padding: 0; font: 12pt/1.5 Inter, Heebo, Arial, sans-serif; color: #111; }
  #report h1 { margin: 0 0 4pt; font-size: 20pt; }
  #report h2 { margin: 16pt 0 6pt; padding-bottom: 3pt; font-size: 13pt; border-bottom: 1px solid #ccc; }
  #report ul { margin: 0; padding-inline-start: 16pt; }
  #report li { margin: 2pt 0; }
  #report .rep-date { margin: 0 0 8pt; color: #555; }
  #report .rep-foot { margin-top: 18pt; font-size: 9pt; color: #666; }
}

/* ---------- Mobile dock ---------- */

.dock { display: none; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--dock-h)); z-index: 90;
  padding: 12px 20px; border-radius: 999px;
  background: rgba(24, 20, 52, 0.94); box-shadow: inset 0 0 0 1px var(--stroke-hi), 0 18px 40px rgba(0, 0, 0, 0.5);
  font-size: 14px; font-weight: 600;
  transform: translate(-50%, 140%); opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.45s var(--ease);
  pointer-events: none;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Reveal ---------- */

.rv { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.rv.is-in { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ripple { from { transform: scale(1); opacity: 0.9; } 80%, to { transform: scale(3.4); opacity: 0; } }
@keyframes dotPulse { 50% { opacity: 0.3; } }
@keyframes sosBreath { 0%, 100% { scale: 1; } 50% { scale: 1.06; } }
@keyframes sosGlow { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes sosRing { 0% { transform: scale(1); opacity: 0.9; } 70%, 100% { transform: scale(1.22, 1.6); opacity: 0; } }
@keyframes sosBlink { 0% { opacity: 1; } 50% { opacity: 0.15; } }
@keyframes breathe { from { transform: scale(0.94); } to { transform: scale(1.04); } }
@keyframes floaty { from { translate: 0 -6px; } to { translate: 0 8px; } }
@keyframes bob { from { translate: 0 2px; rotate: -3deg; } to { translate: 0 -4px; rotate: 3deg; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes blink { to { opacity: 0; } }
@keyframes eq { from { height: 20%; } to { height: 100%; } }
@keyframes ring { from { box-shadow: 0 0 0 0 rgba(255, 79, 147, 0.55); } to { box-shadow: 0 0 0 34px rgba(255, 79, 147, 0); } }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav a { padding-inline: 10px; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 8px; text-align: start; }
  .hero-orb { order: -1; max-width: 400px; width: 82%; margin-bottom: -18px; }
  .grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .fever-grid { grid-template-columns: 1fr; }
  .footer .wrap { grid-template-columns: 1fr; }
  .foot-meta { justify-items: start; text-align: start; }
  .growth-grid { grid-template-columns: 1fr; }
  .tk-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lib-results { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --dock-h: calc(72px + env(safe-area-inset-bottom)); }
  html { scroll-padding-top: 76px; }
  .nav { display: none; }
  .lang { margin-inline-start: auto; }
  .topbar .wrap { gap: 10px; }
  .tk-stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .tk-stat { padding: 12px; }
  .tk-stat b { font-size: 17px; }
  .tk-stat small { font-size: 11px; }
  .tk-run { grid-template-columns: auto 1fr auto; }
  .tk-run .btn { grid-column: 1 / -1; }
  .gr-result { grid-template-columns: 1fr 1fr 1fr; }
  .sos-grid { grid-template-columns: 1fr 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { min-height: 150px; padding: 16px; }
  .tile img { width: 46px; height: 46px; }
  .tile h3 { font-size: 15px; margin-top: 14px; }
  .tile p { font-size: 12.5px; }
  .tile .tag { top: 14px; inset-inline-end: 14px; }
  .fields { grid-template-columns: 1fr 1fr; }
  .fields .field:first-child { grid-column: span 2; }
  .fields.two .field:first-child { grid-column: auto; }
  .sos-calls { grid-template-columns: 1fr; }
  .lib-search input { font-size: 16px; }
  .sounds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide { grid-template-columns: 1fr; }
  .near-actions { grid-template-columns: 1fr 1fr; }
  .near-actions .sos { grid-column: span 2; }
  .chat-form { grid-template-columns: 1fr auto; }
  .chat-form #chatName { grid-column: span 2; }
  .chat-feed { height: 340px; }
  .cry-stage { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .rec-info { width: 100%; }
  .bar-row { grid-template-columns: 110px 1fr 42px; font-size: 13px; }
  .hero { gap: 8px; }
  .hero-orb { width: 74%; max-width: 310px; margin-bottom: 38px; }
  .eyebrow { margin-bottom: 18px; }
  .lead { margin: 18px 0 26px; }
  .hero-stats { margin-top: 32px; }
  .chip { gap: 8px; padding: 7px; padding-inline-end: 12px; border-radius: 15px; font-size: 12px; animation-duration: 7s; }
  .chip img { width: 28px; height: 28px; }
  .chip span { font-size: 11px; }
  .chip.c1, .chip.c2 { top: auto; bottom: -12%; }
  .chip.c1 { left: -15%; right: auto; }
  .chip.c2 { right: -15%; left: auto; }
  .chip.c3 { display: none; }
  .doses { grid-template-columns: 1fr; }
  .p-ico { width: 54px; height: 54px; }
  .badge { display: none; }

  .dock {
    position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 60;
    display: grid; grid-template-columns: repeat(6, 1fr);
    padding: 6px; border-radius: 24px;
    background: rgba(14, 11, 32, 0.95);
    box-shadow: inset 0 0 0 1px var(--stroke-hi), 0 18px 40px rgba(0, 0, 0, 0.55);
  }
  .dock a {
    display: grid; justify-items: center; gap: 2px;
    min-height: 54px; padding: 6px 2px; border-radius: 18px;
    text-decoration: none; font-size: 10px; font-weight: 600; color: var(--ink-3);
    min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: all 0.3s var(--ease);
  }
  .dock img { width: 26px; height: 26px; transition: transform 0.35s var(--ease); }
  .dock a.is-active { color: var(--ink); background: rgba(255, 255, 255, 0.07); }
  .dock a.is-active img { transform: translateY(-2px) scale(1.1); }
}

@media (max-width: 380px) {
  .brand-word { display: none; }
  .tk-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gr-result { grid-template-columns: 1fr; }
  .display { font-size: 2.2rem; }
  .bar-row { grid-template-columns: 92px 1fr 40px; }
  .seg button { padding: 0 10px; font-size: 13px; }
  .lang-bar { grid-template-columns: 1fr 44px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .rv { opacity: 1; transform: none; }
}
