@font-face { font-family: "Manrope"; src: url("/fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

/* Warm, caring palette. Semantic colors: teal = normal, honey = borderline, crimson = high, plum = medicines. */
:root {
  --bg: #FBF6F0; --surface: #FFFFFF; --sunk: #F1E7DD; --line: #EADBCD; --soft-line: #F3EAE1;
  --ink: #2B1E17; --muted: #7A6558; --muted-2: #6B574A;
  --primary: #BF4824; --primary-ink: #FFFFFF; --primary-soft: #FFE8DF; --primary-hover: #A63C1C;
  --ok: #0F8A6E; --ok-ink: #0B6E57; --ok-soft: #DFF3EC;
  --warn: #D99A1E; --warn-ink: #9A5F00; --warn-soft: #FFF1D6;
  --bad: #C62F45; --bad-ink: #B02A3E; --bad-soft: #FBE3E6;
  --med: #8A4FB5; --med-ink: #6E3A96; --med-soft: #F3E8FA;
  --cyc: #A8325E; --cyc-soft: #FBE3EC;
  --dark: #3A2A22; --dark-ink: #F7EDE5; --dark-muted: #D3BFB2;
  --map-sea: #E8F1F2; --map-land: #F6EEE4; --map-border: #D9C7B5;
  --glow-1: rgba(255, 180, 138, .45); --glow-2: rgba(242, 196, 120, .3);
  --shadow: 0 1px 2px rgba(91, 50, 20, .06), 0 10px 24px rgba(91, 50, 20, .08);
  --shadow-lg: 0 1px 2px rgba(91, 50, 20, .06), 0 14px 32px rgba(91, 50, 20, .11);
  --f-display: "Manrope", "Segoe UI", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A1411; --surface: #261D18; --sunk: #33271F; --line: #45362C; --soft-line: #382B23;
    --ink: #F4EAE2; --muted: #BFA999; --muted-2: #CDB8A9;
    --primary: #F07A54; --primary-ink: #2A130A; --primary-soft: #4A2A1E; --primary-hover: #FF9672;
    --ok: #4CC4A2; --ok-ink: #7FD9BE; --ok-soft: #173A31;
    --warn: #E8B451; --warn-ink: #F2C877; --warn-soft: #3D3018;
    --bad: #EF6F82; --bad-ink: #F59AA8; --bad-soft: #45222A;
    --med: #B98BE0; --med-ink: #D0AEF0; --med-soft: #33263F;
    --cyc: #E57FA6; --cyc-soft: #43242F;
    --dark: #120D0B; --dark-ink: #F4EAE2; --dark-muted: #BFA999;
    --map-sea: #14201F; --map-land: #2E241E; --map-border: #4A3B30;
    --glow-1: rgba(240, 122, 84, .16); --glow-2: rgba(232, 180, 81, .1);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 32px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 800; line-height: 1.15; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 24px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.num { font-family: var(--f-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
[hidden] { display: none !important; }

/* Ambient glows */
.glow { position: fixed; border-radius: 50%; pointer-events: none; z-index: 0; animation: drift 14s ease-in-out infinite alternate; }
.glow.a { width: 380px; height: 380px; top: -160px; right: -120px; background: radial-gradient(circle, var(--glow-1), transparent 70%); }
.glow.b { width: 320px; height: 320px; bottom: 80px; left: -160px; background: radial-gradient(circle, var(--glow-2), transparent 70%); animation-duration: 18s; animation-direction: alternate-reverse; }

/* Layout */
.app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); box-shadow: 0 4px 18px rgba(91, 50, 20, .06);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; font: 800 18px var(--f-display); color: var(--ink); text-decoration: none; }
.logo { width: 34px; height: 34px; border-radius: 11px; background: var(--primary); display: grid; place-items: center; flex: none; animation: beat 1.8s ease-in-out infinite; }
.topnav { display: none; gap: 4px; }
.topnav a, .chip-link { padding: 9px 15px; border-radius: 999px; color: var(--muted-2); font-weight: 600; font-size: 14px; text-decoration: none; }
.topnav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 800 13px var(--f-display); background: var(--primary-soft); color: var(--primary); flex: none; text-decoration: none; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
main.view { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right)) 110px max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 14px; }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); box-shadow: 0 -6px 20px rgba(91, 50, 20, .08);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 8px max(10px, env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom, 0px)); }
.bottomnav a { min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 14px; }
.bottomnav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.bottomnav a[aria-current="page"] svg { animation: hop .6s ease-out; }
@media (min-width: 960px) {
  .topnav { display: flex; }
  .bottomnav { display: none; }
  main.view { padding-bottom: 40px; }
  .wide-2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
}

/* Cards */
.card { background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; min-width: 0; }
.card.flat { box-shadow: none; background: var(--sunk); animation: none; }
.card.dark { background: var(--dark); color: var(--dark-ink); }
.card.dark .muted { color: var(--dark-muted); }
.card.tight { padding: 12px; }
.stagger > * { animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; }
.stagger > *:nth-child(2) { animation-delay: .06s; } .stagger > *:nth-child(3) { animation-delay: .12s; } .stagger > *:nth-child(4) { animation-delay: .18s; }
.stagger > *:nth-child(5) { animation-delay: .24s; } .stagger > *:nth-child(6) { animation-delay: .3s; } .stagger > *:nth-child(n+7) { animation-delay: .36s; }
.icon-tile { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pill.ok { color: var(--ok-ink); background: var(--ok-soft); } .pill.warn { color: var(--warn-ink); background: var(--warn-soft); }
.pill.bad { color: var(--bad-ink); background: var(--bad-soft); } .pill.med { color: var(--med-ink); background: var(--med-soft); }
.pill.neutral { color: var(--muted-2); background: var(--sunk); } .pill.primary { color: var(--primary-ink); background: var(--primary); }
.t-ok { color: var(--ok-ink); } .t-warn { color: var(--warn-ink); } .t-bad { color: var(--bad-ink); }
.banner { border-radius: 16px; padding: 11px 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.banner.ok { background: var(--ok-soft); color: var(--ok-ink); } .banner.warn { background: var(--warn-soft); color: var(--warn-ink); } .banner.bad { background: var(--bad-soft); color: var(--bad-ink); }
.banner.info { background: var(--sunk); color: var(--muted-2); }

/* Buttons and inputs */
.btn { position: relative; overflow: hidden; min-height: 46px; border: 0; border-radius: 14px; padding: 0 18px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow); transition: transform .15s ease, background .15s ease; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.primary::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 35%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent); animation: shine 3.2s 1.2s ease-in-out infinite; }
.btn.ghost { background: var(--sunk); box-shadow: none; color: var(--muted-2); }
.btn.dark { background: var(--ink); color: var(--bg); box-shadow: none; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 999px; }
.btn.danger { color: var(--bad-ink); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.purple { background: var(--med); color: #fff; box-shadow: none; }
.link-btn { border: 0; background: none; padding: 6px 0; color: var(--primary); font-weight: 700; cursor: pointer; font-size: 14px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
.input, select.input, textarea.input { width: 100%; min-width: 0; border: 1.5px solid var(--line); border-radius: 13px; padding: 11px 12px; background: var(--bg); color: var(--ink); font-size: 16px; font-weight: 400; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); background: var(--surface); }
.input.attention { border-color: var(--warn); background: var(--warn-soft); animation: pulse-warn 1.8s ease-in-out infinite; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--sunk); border-radius: 14px; padding: 4px; gap: 2px; }
.seg button, .seg a { min-height: 38px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; font-size: 13px; color: var(--muted-2); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; padding: 0 6px; text-align: center; }
.seg [aria-pressed="true"], .seg [aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(91, 50, 20, .14); animation: slidepill .4s cubic-bezier(.2, .8, .2, 1); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 5px 11px; background: var(--surface); border: 1px solid var(--line); color: var(--muted-2); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--cyc); border-color: var(--cyc); color: #fff; }
.chip.allergy { color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 40%, transparent); cursor: default; }

/* Tables and lists */
.list { display: flex; flex-direction: column; }
.list > .item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--soft-line); animation: rowin .45s cubic-bezier(.2, .8, .2, 1) both; }
.list > .item:first-child { border-top: 0; }
.item .title { font-weight: 700; font-size: 14px; }
a.item { color: inherit; text-decoration: none; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
table.data th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--bg); padding: 9px 12px; }
table.data td { padding: 10px 12px; border-top: 1px solid var(--soft-line); vertical-align: middle; }
table.data tr { animation: rowin .45s cubic-bezier(.2, .8, .2, 1) both; }
.dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.dot.taken { background: var(--ok); animation: pop .5s ease-out both; }
.dot.next { border: 2px solid var(--med); animation: glow-med 2s ease-in-out infinite; }
.dot.idle { border: 2px dashed var(--line); }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 12px; min-height: 50vh; }
.bubble { max-width: 84%; padding: 11px 14px; border-radius: 20px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-end; background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 6px; box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 25%, transparent); animation: slideR .45s cubic-bezier(.2, .8, .2, 1) both; }
.bubble.assistant { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 6px; box-shadow: var(--shadow); animation: slideL .45s cubic-bezier(.2, .8, .2, 1) both; }
.saved-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; white-space: normal; }
.typing { align-self: flex-start; background: var(--surface); border-radius: 18px; padding: 13px 15px; display: flex; gap: 5px; box-shadow: var(--shadow); }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: dot 1.2s ease-in-out infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
.proposal { display: flex; flex-direction: column; gap: 8px; background: var(--bg); border-radius: 14px; padding: 10px 12px; animation: pop .45s cubic-bezier(.2, .8, .2, 1) both; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 15; padding: 8px max(14px, env(safe-area-inset-left)); display: flex; gap: 8px; align-items: center; max-width: 1180px; margin: 0 auto; }
.composer .box { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; background: var(--surface); border-radius: 999px; padding: 4px 4px 4px 14px; box-shadow: var(--shadow-lg); }
.composer input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; height: 42px; font-size: 16px; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; flex: none; background: var(--sunk); color: var(--ink); text-decoration: none; }
.round.primary { width: 50px; height: 50px; background: var(--primary); color: var(--primary-ink); box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 30%, transparent); animation: breathe 2.6s ease-in-out infinite; }
@media (min-width: 960px) { .composer { bottom: 16px; } }

/* Charts */
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart.line { max-height: 230px; }
svg.chart .axis { fill: var(--muted); font-size: 10px; font-family: var(--f-body); }
.draw { stroke-dasharray: 1000; animation: draw 1.4s .2s ease-out both; }
.ecg { stroke-dasharray: 420; animation: ecg 2.6s linear infinite; }
.bar { height: 7px; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; transform-origin: left; animation: barfill 1.1s .3s cubic-bezier(.2, .8, .2, 1) both; }

.seg.tabs { grid-auto-columns: minmax(max-content, 1fr); overflow-x: auto; scrollbar-width: none; }
.seg.tabs::-webkit-scrollbar { display: none; }
.seg.tabs a { padding: 0 14px; white-space: nowrap; }

/* Healthy-days calendar */
.cal-grid { width: 100%; max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding-bottom: 2px; }
.cal-day { position: relative; aspect-ratio: 1; min-height: 40px; border: 0; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font: 700 14px var(--f-display); color: var(--ink); background: var(--sunk); cursor: pointer; animation: pop .45s cubic-bezier(.2, .8, .2, 1) both; transition: transform .15s ease; }
.cal-day:hover:not(:disabled) { transform: translateY(-2px); }
.cal-day.well { background: var(--ok-soft); color: var(--ok-ink); }
.cal-day.watch { background: var(--warn-soft); color: var(--warn-ink); }
.cal-day.unwell { background: var(--bad-soft); color: var(--bad-ink); }
.cal-day.unwell::after { content: ""; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); }
.cal-day.future { background: transparent; color: var(--muted); border: 1.5px dashed var(--line); cursor: default; animation: none; opacity: .7; }
.cal-day.today { box-shadow: 0 0 0 2.5px var(--primary); animation: pop .45s both, today 2.4s 1s ease-in-out infinite; }
.cal-day.selected { box-shadow: 0 0 0 3px var(--ink); transform: scale(1.06); }
.cal-dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; max-width: 90%; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.cal-fwd .cal-day { animation-name: calfwd; } .cal-back .cal-day { animation-name: calback; }
@keyframes calfwd { from { transform: translateX(40px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes calback { from { transform: translateX(-40px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes today { 0%, 100% { box-shadow: 0 0 0 2.5px var(--primary); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 25%, transparent); } }
@media (min-width: 960px) { .cal-day { min-height: 54px; font-size: 15px; } .cal-dots i { width: 7px; height: 7px; } }

/* Map */
.pin { cursor: pointer; }
.pin .pin-dot { animation: pindrop .55s var(--d, .2s) cubic-bezier(.3, 1.6, .5, 1) both; transform-box: fill-box; transform-origin: center; }
.pin:hover .pin-dot { filter: brightness(1.1); }
.pin-pulse { transform-box: fill-box; transform-origin: center; animation: ping 2s 1s ease-out infinite; pointer-events: none; }
.arc { animation: dash 1.2s linear infinite; }
@keyframes pindrop { from { transform: translateY(-30px) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes dash { to { stroke-dashoffset: -24; } }

/* Modal */
dialog { border: 0; border-radius: 24px; padding: 0; width: min(560px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(30, 18, 12, .45); backdrop-filter: blur(3px); }
dialog[open] { animation: rise .35s cubic-bezier(.2, .8, .2, 1); }
dialog form { padding: 20px; display: flex; flex-direction: column; gap: 12px; max-height: 85vh; overflow-y: auto; }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: rise .35s ease-out; max-width: calc(100vw - 32px); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; }
.ping { position: relative; width: 9px; height: 9px; flex: none; display: inline-block; }
.ping::before, .ping::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; }
.ping::before { animation: ping 1.8s ease-out infinite; }
.scanline { position: absolute; left: 0; right: 0; top: 6px; height: 3px; background: var(--primary); box-shadow: 0 0 10px 3px color-mix(in srgb, var(--primary) 45%, transparent); animation: scan 2.2s ease-in-out infinite; }
.empty { text-align: center; padding: 28px 16px; display: flex; flex-direction: column; gap: 10px; align-items: center; }

@keyframes rise { from { transform: translateY(16px) scale(.98); } to { transform: none; } }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-30px, 24px) scale(1.12); } }
@keyframes beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.12); } 24% { transform: scale(1); } 36% { transform: scale(1.06); } 48% { transform: scale(1); } }
@keyframes ecg { from { stroke-dashoffset: 420; } to { stroke-dashoffset: 0; } }
@keyframes draw { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }
@keyframes barfill { from { transform: scaleX(0); } }
@keyframes pop { 0% { transform: scale(.6); } 65% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes rowin { from { transform: translateX(-12px); } to { transform: none; } }
@keyframes slideL { from { transform: translateX(-20px) scale(.96); } to { transform: none; } }
@keyframes slideR { from { transform: translateX(20px) scale(.96); } to { transform: none; } }
@keyframes slidepill { from { transform: scale(.92); } to { transform: none; } }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-5px); opacity: 1; } }
@keyframes ping { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(300%); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-5px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(52px); } }
@keyframes ring { from { stroke-dashoffset: var(--full, 264); } }
@keyframes needle { from { transform: rotate(0deg); } }
@keyframes glow-med { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--med) 40%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
@keyframes pulse-warn { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 40%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- Passkeys ---- */
.or-line { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 700; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.passkey-btn { width: 100%; min-height: 54px; font-size: 16px; background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--primary) 40%, var(--line)); color: var(--ink); box-shadow: var(--shadow); }
.passkey-btn svg { color: var(--primary); animation: face-scan 2.6s ease-in-out infinite; }
.passkey-btn:hover { border-color: var(--primary); }
@keyframes face-scan { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.12); } 90% { transform: scale(.96); } }
.icon-tile.sm { width: 28px; height: 28px; border-radius: 9px; }
.passkey-offer { align-items: center; flex-wrap: wrap; animation: pop .5s both; }
.passkey-offer > svg { color: var(--primary); flex: none; }
@media (prefers-reduced-motion: reduce) { .passkey-btn svg { animation: none; } }

/* ---- Herzayu logo ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand .mark { width: 36px; height: 36px; flex: none; border-radius: 10px; box-shadow: 0 6px 14px color-mix(in srgb, var(--primary) 28%, transparent); }
.brand span { letter-spacing: -.01em; }
.brand-hero { align-items: center; text-align: center; gap: 4px; }
.lockup { width: min(340px, 88vw); height: auto; overflow: visible; }
.lockup .word { font: 800 54px var(--f-display); letter-spacing: -.025em; }
/* Herz (heart) in ink, ayu (life) in terracotta. */
.lockup .herz { fill: var(--ink); } .lockup .ayu { fill: var(--primary); }
.brand .herz { color: var(--ink); } .brand .ayu { color: var(--primary); }
/* The bright stretch of the heartbeat travels along the line, left to right. */
.ecg-pulse { stroke-dasharray: 24 200; stroke-dashoffset: 24; animation: ecg 2.4s cubic-bezier(.45, .05, .55, .95) infinite; }
.lockup .ecg-pulse { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--primary) 55%, transparent)); }
@keyframes ecg { to { stroke-dashoffset: -100; } }
/* The heart beats (lub-dub) as the pulse passes through the middle. */
.mark-heart { transform-origin: 32px 45px; animation: lubdub 2.4s ease-in-out infinite; }
.mini-heart { transform-box: fill-box; transform-origin: center; animation: lubdub 2.4s ease-in-out infinite; }
@keyframes lubdub { 0%, 38%, 100% { transform: scale(1); } 46% { transform: scale(1.14); } 53% { transform: scale(1); } 60% { transform: scale(1.08); } 68% { transform: scale(1); } }
/* The family gathers when the sign-in page opens. */
.lockup .family > g { transform-box: fill-box; transform-origin: bottom center; animation: gather .7s cubic-bezier(.3, 1.4, .5, 1) both; }
.lockup .family > g:nth-child(2) { animation-delay: .08s; } .lockup .family > g:nth-child(3) { animation-delay: .16s; } .lockup .family > g:nth-child(4) { animation-delay: .24s; }
@keyframes gather { from { opacity: 0; transform: translateY(10px) scale(.6); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ecg-pulse { stroke-dasharray: none; } }

/* ---- Demo ---- */
.demo-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; margin: 0 auto; max-width: 1180px; padding: 9px 16px;
  background: color-mix(in srgb, #E9A23B 22%, var(--surface)); color: var(--ink); font-size: 13px; border-bottom: 1px solid var(--line); }
.demo-bar span { flex: 1; } .demo-bar svg { color: #C27A12; flex: none; }
.demo-welcome { animation: pop .5s both; }
