/* HOHA web — "Plush, amplified".
   Soft-UI with real light physics: five-layer shadows, an ambient gradient-mesh
   canvas, and one idea carried everywhere — presence is light escaping from
   under the surface. Live things sit in a pressed-in well and glow out of it;
   quiet things sit flush and still.
   Light is the default; dark is opt-in (Menu → Appearance) or follows the OS
   when the member picks "Match system". Names are shared with
   mobile/src/theme.ts so web and app can stay in step. */

:root {
  color-scheme: light;
  /* Dawn Mist */
  --bg: #E7EBF3;
  --bg-2: #DEE3EE;
  --surface: #F1F4FB;      /* raised plush */
  --surface-2: #E6EAF4;    /* recessed plane */
  --surface-3: #F9FBFF;    /* highest / lit plane */
  --glass: rgba(241, 244, 251, .72);
  --glass-border: rgba(255, 255, 255, .72);
  --text: #131829;
  --text-2: #49536B;
  --text-3: #5F6A82;
  --accent: #2F6BFF;
  --accent-deep: #2257DD;  /* ink-safe accent for text on light */
  --accent-2: #4A3CE8;
  --accent-weak: rgba(47, 107, 255, .10);
  --accent-ring: rgba(47, 107, 255, .22);
  --accent-ink: #FFFFFF;
  --live: #0AA6C2;
  --live-ink: #0A6F84;     /* ink-safe cyan for text */
  --live-weak: rgba(10, 166, 194, .13);
  --live-glow: rgba(10, 166, 194, .42);
  --gold: #E8A417;         /* from the logo's "HA" */
  --gold-ink: #85590A;
  --gold-weak: rgba(232, 164, 23, .16);
  --line: rgba(19, 24, 41, .085);
  --line-2: rgba(19, 24, 41, .05);
  --positive: #146B47;
  --positive-dot: #1F9D6B;
  --danger: #BE2C31;
  --warn: #85590A;
  --positive-weak: rgba(31, 157, 107, .14);
  --danger-weak: rgba(190, 44, 49, .10);
  --warn-weak: rgba(232, 164, 23, .16);
  --scrim: rgba(19, 24, 41, .42);
  --vig: rgba(19, 24, 41, .05);

  /* light physics */
  --sh-dark: rgba(147, 161, 190, .44);
  --sh-dark-2: rgba(120, 136, 170, .38);
  --sh-light: rgba(255, 255, 255, .96);
  --raise:
    0 1px 2px rgba(19, 24, 41, .045),
    10px 12px 22px -6px var(--sh-dark),
    24px 28px 52px -22px var(--sh-dark-2),
    -10px -12px 26px var(--sh-light),
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -1px 0 rgba(140, 156, 188, .16);
  --raise-sm:
    0 1px 1.5px rgba(19, 24, 41, .045),
    4px 5px 11px -3px var(--sh-dark),
    -4px -5px 12px var(--sh-light),
    inset 0 1px 0 rgba(255, 255, 255, .85);
  --press:
    inset 3px 4px 9px rgba(143, 159, 190, .55),
    inset -3px -3px 8px rgba(255, 255, 255, .92),
    inset 0 1px 1px rgba(110, 128, 164, .18);
  --press-sm:
    inset 2px 2px 5px rgba(143, 159, 190, .5),
    inset -2px -2px 5px rgba(255, 255, 255, .9);
  --float: 0 32px 74px -28px rgba(19, 24, 41, .44), 0 4px 10px rgba(19, 24, 41, .06);
  --grad-brand: linear-gradient(135deg, #2557E2 0%, #4A3CE8 100%);
  --grad-live: conic-gradient(from 212deg, #0AA6C2, #2F6BFF 38%, #4A3CE8 62%, #0AA6C2);
  --mesh:
    radial-gradient(1180px 720px at 10% -14%, rgba(47, 107, 255, .13), transparent 62%),
    radial-gradient(860px 600px at 96% 2%, rgba(232, 164, 23, .12), transparent 60%),
    radial-gradient(1060px 860px at 82% 104%, rgba(74, 60, 232, .11), transparent 62%),
    radial-gradient(760px 540px at 26% 76%, rgba(10, 166, 194, .09), transparent 66%);
  --grain-op: .4;
  --grain-blend: soft-light;

  --c-pink: #F25C8A; --c-lime: #3FCA87; --c-sky: #4FA9F2; --c-orange: #F2922E;
  --c-violet: #8B7BF0; --c-gray: #AEB4C2; --c-amber: #F0B429;

  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 26px; --r-pill: 999px;
  --font-display: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --topbar-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Evening Mesh — keep in step with the light set above. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0D14;
  --bg-2: #05070C;
  --surface: #171B26;
  --surface-2: #10141D;
  --surface-3: #1F2432;
  --glass: rgba(23, 27, 38, .72);
  --glass-border: rgba(255, 255, 255, .09);
  --text: #EEF1F8;
  --text-2: #A9B2C7;
  --text-3: #8E98AF;
  --accent: #5E8DFF;
  --accent-deep: #83A8FF;
  --accent-2: #9284FF;
  --accent-weak: rgba(94, 141, 255, .17);
  --accent-ring: rgba(94, 141, 255, .3);
  --live: #35E4FF;
  --live-ink: #7CEFFF;
  --live-weak: rgba(53, 228, 255, .13);
  --live-glow: rgba(53, 228, 255, .44);
  --gold: #F5BA40;
  --gold-ink: #F7C96B;
  --gold-weak: rgba(245, 186, 64, .15);
  --line: rgba(255, 255, 255, .085);
  --line-2: rgba(255, 255, 255, .05);
  --positive: #47D39C;
  --positive-dot: #34C690;
  --danger: #FF7377;
  --warn: #F7C96B;
  --positive-weak: rgba(52, 198, 144, .15);
  --danger-weak: rgba(255, 115, 119, .13);
  --warn-weak: rgba(245, 186, 64, .15);
  --scrim: rgba(0, 0, 0, .6);
  --vig: rgba(0, 0, 0, .5);

  --sh-dark: rgba(0, 0, 0, .66);
  --sh-dark-2: rgba(0, 0, 0, .76);
  --sh-light: rgba(255, 255, 255, .05);
  --raise:
    0 1px 2px rgba(0, 0, 0, .5),
    12px 14px 26px -6px var(--sh-dark),
    28px 32px 60px -24px var(--sh-dark-2),
    -10px -12px 24px var(--sh-light),
    inset 0 1px 0 rgba(255, 255, 255, .07),
    inset 0 -1px 0 rgba(0, 0, 0, .4);
  --raise-sm:
    0 1px 2px rgba(0, 0, 0, .45),
    4px 5px 11px -3px var(--sh-dark),
    -4px -5px 12px var(--sh-light),
    inset 0 1px 0 rgba(255, 255, 255, .06);
  --press:
    inset 3px 4px 9px rgba(0, 0, 0, .7),
    inset -3px -3px 8px rgba(255, 255, 255, .045),
    inset 0 1px 1px rgba(0, 0, 0, .5);
  --press-sm:
    inset 2px 2px 5px rgba(0, 0, 0, .65),
    inset -2px -2px 5px rgba(255, 255, 255, .04);
  --float: 0 32px 74px -26px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .06);
  --grad-brand: linear-gradient(135deg, #2A62F0 0%, #5346EE 100%);
  --grad-live: conic-gradient(from 212deg, #35E4FF, #5E8DFF 38%, #9284FF 62%, #35E4FF);
  --mesh:
    radial-gradient(1180px 760px at 8% -12%, rgba(74, 60, 232, .34), transparent 62%),
    radial-gradient(900px 640px at 98% 4%, rgba(232, 124, 23, .13), transparent 58%),
    radial-gradient(1100px 900px at 86% 106%, rgba(10, 166, 194, .22), transparent 62%),
    radial-gradient(820px 620px at 30% 72%, rgba(47, 107, 255, .14), transparent 66%);
  --grain-op: .28;
  --grain-blend: overlay;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.47 var(--font-body);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }

/* Ambient canvas: a slow gradient mesh under everything, plus a whisper of
   grain so the large soft surfaces don't read as flat plastic. */
body::before {
  content: ""; position: fixed; inset: -12%; z-index: -1; pointer-events: none;
  background-image: var(--mesh);
  animation: mesh-drift 44s ease-in-out infinite alternate;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 3; pointer-events: none;
  opacity: var(--grain-op); mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.38'/%3E%3C/svg%3E");
}
@keyframes mesh-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-2.4%, 1.8%, 0) scale(1.07); }
}
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); margin: 0; }
h1 { font-size: 26px; line-height: 32px; font-weight: 700; letter-spacing: -.4px; }
h2 { font-size: 19px; line-height: 25px; font-weight: 650; letter-spacing: -.2px; }
h3 { font-size: 16px; line-height: 22px; font-weight: 600; letter-spacing: -.1px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-weak); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow { font: 600 11px/14px var(--font-body); letter-spacing: 1.3px; text-transform: uppercase; color: var(--text-3); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.handle { color: var(--text-3); font-weight: 500; }
.handle::before { content: "@"; color: var(--accent-2); opacity: .8; }
.error-text { color: var(--danger); font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-tight { display: flex; align-items: center; gap: 6px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { height: 1px; background: var(--line); border: 0; margin: 4px 0; }

/* ---------- icons ---------- */
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 24px; height: 24px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 0; border-radius: var(--r-pill);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14.5px; letter-spacing: -.1px;
  box-shadow: var(--raise-sm);
  cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: var(--press); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: default; transform: none; }
.btn-primary { background: var(--grad-brand); color: var(--accent-ink); box-shadow: 0 10px 24px -10px rgba(47, 107, 255, .75), inset 0 1px 0 rgba(255, 255, 255, .28); }
.btn-primary:active { box-shadow: inset 0 2px 6px rgba(0, 0, 0, .25); }
.btn-quiet { background: transparent; box-shadow: none; color: var(--text-2); }
.btn-quiet:hover { background: var(--accent-weak); color: var(--accent); transform: none; }
.btn-danger { color: var(--danger); }
.btn-danger.btn-solid { background: var(--danger); color: #fff; box-shadow: 0 10px 24px -12px var(--danger); }
.btn-live { color: var(--live); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer;
  transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--accent-weak); color: var(--accent); }
.icon-btn.raised { background: var(--surface); box-shadow: var(--raise-sm); color: var(--text); }
.btn .spinner, .icon-btn .spinner { width: 16px; height: 16px; }

/* ---------- form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); letter-spacing: .1px; }
.field .hint { font-size: 12.5px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--surface); box-shadow: var(--press);
  font-size: 16px; color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235F6A82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--press), 0 0 0 4px var(--accent-weak); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input-mono { font-variant-numeric: tabular-nums; letter-spacing: .12em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 420px) { .grid-2.collapse, .grid-3.collapse { grid-template-columns: 1fr; } }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14.5px; min-height: 32px; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

/* toggle switch */
.switch { position: relative; display: inline-flex; flex: none; width: 50px; height: 30px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--press); transition: background .2s; }
.switch .thumb { position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); box-shadow: var(--raise-sm); transition: transform .22s var(--ease), background .2s; }
.switch input:checked ~ .track { background: var(--accent); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked ~ .thumb { transform: translateX(20px); background: #fff; }
.switch input:focus-visible ~ .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* segmented control */
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--press); flex-wrap: wrap; }
.seg button { min-height: 36px; min-width: 40px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-2); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--accent); box-shadow: var(--raise-sm); }
.seg.fill { display: flex; }
.seg.fill button { flex: 1; }

/* closeness score picker: five soft dots that fill up */
.cs { display: inline-flex; gap: 6px; align-items: center; }
.cs button { width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; background: var(--surface); box-shadow: var(--raise-sm); color: var(--text-2); font: 600 14px var(--font-display); }
.cs button[aria-pressed="true"] { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 14px -6px rgba(47, 107, 255, .8); }
.cs-legend { font-size: 12px; color: var(--text-3); }

/* weekday chips */
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--raise-sm); color: var(--text-2); font-weight: 600; font-size: 13px; cursor: pointer; }
.days button[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: none; }

/* ---------- chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.accent { background: var(--accent-weak); color: var(--accent); }
.chip.live { background: color-mix(in srgb, var(--live) 14%, transparent); color: var(--live); }
.chip.positive { background: var(--positive-weak); color: var(--positive); }
.chip.warn { background: var(--warn-weak); color: var(--warn); }
.chip.danger { background: var(--danger-weak); color: var(--danger); }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); background: var(--accent); color: #fff; font: 700 12px/1 var(--font-body); font-variant-numeric: tabular-nums; }
.badge.live { background: var(--live); color: #04262d; }
.badge.quiet { background: var(--surface-2); color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-3); }
.dot.on { background: var(--positive); }
.dot.live { background: var(--live); box-shadow: 0 0 0 0 var(--live-glow); animation: ping 2.4s var(--ease) infinite; }
.dot.away { background: var(--warn); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 var(--live-glow); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- avatar + presence ring (the signature) ---------- */
.avatar { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 650 16px var(--font-display); color: #fff; overflow: visible; }
.avatar > .face { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--c-sky); color: #06243d; }
.avatar > .face img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.xl { width: 88px; height: 88px; font-size: 30px; }
.avatar .pip { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid var(--surface); background: var(--text-3); }
.avatar .pip.on { background: var(--positive); }
.avatar .pip.live { background: var(--live); }
.avatar .pip.away { background: var(--warn); }

.presence { position: relative; flex: none; width: 54px; height: 54px; border-radius: 50%; padding: 4px; background: conic-gradient(from 210deg, var(--c-gray), var(--surface-2), var(--c-gray)); transition: background .4s; }
.presence .avatar { width: 46px; height: 46px; box-shadow: 0 0 0 3px var(--surface); border-radius: 50%; }
.presence.is-live { background: conic-gradient(from 210deg, var(--live), var(--accent), var(--accent-2), var(--live)); animation: breathe 3.2s ease-in-out infinite; }
.presence.is-away { background: conic-gradient(from 210deg, var(--warn), var(--c-amber), var(--warn)); }
.presence.is-lg { width: 96px; height: 96px; padding: 4px; }
.presence.is-lg .avatar { width: 88px; height: 88px; font-size: 30px; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 var(--live-glow); } 50% { box-shadow: 0 0 22px 2px var(--live-glow); } }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--raise); padding: 18px; }
.card.flat { box-shadow: none; background: var(--surface-2); }
.card.inset { box-shadow: var(--press); }
.hero-card { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 22px; color: #fff; background: var(--grad-brand); box-shadow: 0 22px 44px -22px rgba(47, 107, 255, .9); }
.hero-card::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(45, 226, 255, .45), transparent 65%); pointer-events: none; }
.hero-card h2, .hero-card h1 { color: #fff; }
.hero-card .eyebrow { color: rgba(255, 255, 255, .75); }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.list-item:first-child { border-top: 0; }
.list-item.clickable { cursor: pointer; border-radius: var(--r-sm); margin: 0 -10px; padding: 12px 10px; }
.list-item.clickable:hover { background: var(--accent-weak); }
.list-item .title { font-weight: 600; color: var(--text); }
.list-item .meta { font-size: 13px; color: var(--text-3); }

.section-title { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; }
.section-title h3 { font-size: 14.5px; }
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); font-size: 14px; }
.empty.center { align-items: center; text-align: center; padding: 36px 20px; }
.empty .ico { color: var(--text-3); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; }
.notice.warn { background: var(--warn-weak); color: var(--warn); }
.notice.danger { background: var(--danger-weak); color: var(--danger); }
.notice.info { background: var(--accent-weak); color: var(--accent); }
.notice.live { background: color-mix(in srgb, var(--live) 12%, transparent); color: var(--text); }

.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--r-sm); min-height: 14px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); animation: shimmer 1.4s infinite; }
:root[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--accent-weak); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- accordion boxes (the spec's Home boxes) ---------- */
.box { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--raise); transition: box-shadow .25s; }
.box + .box { margin-top: 16px; }
.box-head { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px 14px 12px 16px; border: 0; background: transparent; border-radius: var(--r-lg); cursor: pointer; text-align: left; color: var(--text); }
.box-head:hover .chev { color: var(--accent); }
.box-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; flex: none; background: var(--accent-weak); color: var(--accent); }
.box-title { font: 650 15.5px/20px var(--font-display); letter-spacing: -.1px; }
.box-summary { font-size: 13.5px; color: var(--text-2); }
.box-head .chev { color: var(--text-3); transition: transform .25s var(--ease), color .2s; }
.box[data-open="true"] .box-head .chev { transform: rotate(180deg); }
.box-body { padding: 4px 16px 18px; display: none; }
.box[data-open="true"] .box-body { display: block; animation: reveal .28s var(--ease); }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }

/* status box collapsed line */
.status-line { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 12px 12px 14px; }
.status-line .who { min-width: 0; flex: 1; cursor: pointer; }
.status-line .name { font: 650 15.5px/20px var(--font-display); letter-spacing: -.1px; }
.status-line .facts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-top: 2px; }
.status-line .facts .sep { color: var(--text-3); }
.status-toggles { display: flex; gap: 6px; flex: none; }
.pill-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: var(--r-pill); border: 0; cursor: pointer; font-weight: 600; font-size: 13px; background: var(--surface-2); color: var(--text-2); box-shadow: var(--raise-sm); }
.pill-toggle[aria-pressed="true"].is-online { background: color-mix(in srgb, var(--positive) 16%, var(--surface-2)); color: var(--positive); }
.pill-toggle[aria-pressed="true"].is-muted { background: var(--warn-weak); color: var(--warn); }
.status-line .facts { gap: 6px; margin-top: 6px; }
.status-line .facts > span { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 9px; border-radius: var(--r-pill); background: var(--surface-2); font-size: 12.5px; font-weight: 550; color: var(--text-2); }
@media (min-width: 561px) {
  /* name and controls on the first line, the facts on their own below */
  .status-line {
    display: grid; align-items: center; column-gap: 12px; row-gap: 3px;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "av who tog chev" "av facts facts facts";
  }
  .status-line .presence { grid-area: av; }
  .status-line .who { grid-area: who; }
  .status-line .status-toggles { grid-area: tog; }
  .status-line > .icon-btn { grid-area: chev; }
  .status-line .facts { grid-area: facts; margin-top: 0; }
}
@media (max-width: 560px) {
  .status-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 12px; }
  .status-line .facts { grid-column: 1 / -1; grid-row: 2; margin-top: 0; }
  .status-toggles { grid-column: 1 / -1; grid-row: 3; }
  .status-toggles .pill-toggle { flex: 1; justify-content: center; min-height: 42px; }
}

/* setting rows inside Status box */
.setting { border-top: 1px solid var(--line); }
.setting:first-child { border-top: 0; }
.setting-head { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 0; border: 0; background: none; cursor: pointer; text-align: left; color: var(--text); }
.setting-head .k { font-weight: 600; font-size: 14.5px; }
.setting-head .v { margin-left: auto; font-size: 13.5px; color: var(--text-2); text-align: right; max-width: 60%; }
.setting-head .chev { color: var(--text-3); transition: transform .2s; }
.setting[data-open="true"] .setting-head .chev { transform: rotate(90deg); }
.setting-body { display: none; padding: 2px 0 16px; }
.setting[data-open="true"] .setting-body { display: block; }

/* option cards (availability etc.) */
.options { display: flex; flex-direction: column; gap: 8px; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); cursor: pointer; border: 1.5px solid transparent; }
.option input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-weak); }
.option .t { font-weight: 600; font-size: 14.5px; }
.option .d { font-size: 13px; color: var(--text-2); }

/* member result card */
.person { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); }
.person + .person { margin-top: 10px; }
.person .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.person .name-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.person .name { font-weight: 650; font-size: 15px; }
.person .facts { display: flex; gap: 6px; flex-wrap: wrap; }
.person .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.person .pick { margin-top: 12px; width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.person.is-picked { outline: 2px solid var(--accent); outline-offset: -2px; }

/* request cards */
.request { padding: 14px; border-radius: var(--r-md); background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.request + .request { margin-top: 10px; }
.request.is-held { opacity: .75; }
.request .shared { display: flex; gap: 6px; flex-wrap: wrap; }
.request .decide { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- app shell ---------- */
.shell { min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  height: calc(var(--topbar-h) + var(--safe-top)); padding: var(--safe-top) 8px 0 12px;
  background: var(--glass); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.logo-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 6px; border: 0; background: none; cursor: pointer; border-radius: var(--r-sm); }
.logo-btn img { height: 30px; width: auto; }
:root[data-theme="dark"] .logo-btn img, :root[data-theme="dark"] .brand-logo { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .55)); }
.topbar .title { font: 650 16px var(--font-display); letter-spacing: -.1px; min-width: 0; }
.topbar .spacer { flex: 1; }

.layout { display: block; }
.sidebar { display: none; }
.center { padding: 18px 16px calc(40px + var(--safe-bottom)); max-width: 680px; margin: 0 auto; }
.detail { display: none; }
body.is-sub .center { display: none; }
body.is-sub .detail { display: block; padding: 18px 16px calc(40px + var(--safe-bottom)); max-width: 680px; margin: 0 auto; }
body.is-room .center, body.is-room .detail, body.is-room .sidebar, body.is-room .topbar { display: none; }
body.is-room .layout { display: block; }

.greeting { margin: 4px 2px 18px; }
.greeting .eyebrow { margin-bottom: 4px; }

/* Tablet: icon rail + wider column */
@media (min-width: 720px) {
  .layout { display: grid; grid-template-columns: 84px minmax(0, 1fr); }
  .sidebar { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; padding: 16px 12px; border-right: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(18px); overflow-y: auto; }
  .sidebar .brand { display: grid; place-items: center; margin: 2px auto 18px; padding: 6px 5px; border-radius: 14px; }
  .sidebar .brand img { width: 62px; }
  .sidebar .nav-label, .sidebar .nav-text, .sidebar .side-foot .who-text { display: none; }
  .nav-item { justify-content: center; }
  .topbar { display: none; }
  .sidebar .side-foot > .nav-item:not([data-signout]):not([data-theme-next]) { display: none; }
  .center, body.is-sub .detail { padding: 26px 28px 60px; max-width: 760px; }
}

/* Laptop: sidebar + Home + detail pane side by side */
@media (min-width: 1100px) {
  .layout { grid-template-columns: 264px minmax(460px, 600px) minmax(420px, 1fr); }
  .sidebar { padding: 20px 16px; }
  .sidebar .brand { place-items: start; margin: 4px 8px 22px; }
  .sidebar .brand img { width: 118px; }
  .sidebar .nav-label, .sidebar .nav-text, .sidebar .side-foot .who-text { display: initial; }
  .sidebar .side-foot > .nav-item { display: flex; }
  .nav-item { justify-content: flex-start; }
  .topbar { display: none; }
  .center { max-width: none; margin: 0; padding: 28px 28px 60px; height: 100dvh; overflow-y: auto; }
  .detail, body.is-sub .detail { display: block; max-width: none; margin: 0; height: 100dvh; overflow-y: auto; padding: 28px 32px 60px; border-left: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 45%, var(--bg)); }
  body.is-sub .center { display: block; }
  body.is-room .layout { display: block; }
  .detail-top .back { display: none; }
}
@media (min-width: 1440px) {
  .layout { grid-template-columns: 280px minmax(520px, 640px) minmax(480px, 1fr); }
}

.nav-label { font: 600 11px/14px var(--font-body); letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-3); margin: 16px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); font-weight: 550; font-size: 14.5px; cursor: pointer; text-align: left; width: 100%; position: relative; }
.nav-item:hover { background: var(--accent-weak); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--surface); color: var(--accent); box-shadow: var(--raise-sm); }
.nav-item .badge { margin-left: auto; }
@media (min-width: 720px) and (max-width: 1099px) { .nav-item .badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; font-size: 10.5px; padding: 0 5px; } }
.side-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 4px; }

.detail-top { display: flex; align-items: center; gap: 8px; margin: -6px 0 18px -10px; }
.detail-top h1 { font-size: 22px; line-height: 28px; }
.detail-empty { height: 100%; display: grid; place-items: center; }
.detail-empty .inner { max-width: 360px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; color: var(--text-2); }
.detail-empty .art { width: 92px; height: 92px; border-radius: 30px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--raise); color: var(--accent); }

/* ---------- drawer (phone menu) ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; visibility: hidden; }
.drawer.open { visibility: visible; }
.drawer .scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .25s; }
.drawer.open .scrim { opacity: 1; }
.drawer .panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 88vw); background: var(--bg); box-shadow: var(--float); transform: translateX(100%); transition: transform .3s var(--ease); display: flex; flex-direction: column; padding: calc(12px + var(--safe-top)) 12px calc(16px + var(--safe-bottom)); overflow-y: auto; }
.drawer.open .panel { transform: none; }
.drawer .panel-head { display: flex; align-items: center; gap: 12px; padding: 4px 4px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }

/* ---------- dialogs, sheets, toasts ---------- */
dialog.modal { border: 0; padding: 0; background: transparent; max-width: min(460px, calc(100vw - 24px)); width: 100%; color: var(--text); }
dialog.modal::backdrop { background: var(--scrim); backdrop-filter: blur(2px); }
dialog.modal .sheet { background: var(--bg); border-radius: var(--r-xl); box-shadow: var(--float); padding: 22px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100dvh - 40px); overflow-y: auto; }
dialog.modal .sheet-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
dialog.modal[open] .sheet { animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@media (max-width: 560px) {
  dialog.modal { max-width: 100vw; margin: auto 0 0; }
  dialog.modal .sheet { border-radius: var(--r-xl) var(--r-xl) 0 0; padding-bottom: calc(22px + var(--safe-bottom)); }
  dialog.modal .sheet-actions .btn { flex: 1; }
}

.toasts { position: fixed; z-index: 90; left: 50%; bottom: calc(20px + var(--safe-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 440px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-md); background: var(--text); color: var(--bg); box-shadow: var(--float); font-size: 14px; font-weight: 500; animation: pop .22s var(--ease); max-width: 100%; }
.toast.error { background: var(--danger); color: #fff; }
.toast .ico { flex: none; }

/* incoming call banner */
.ringer { position: fixed; z-index: 80; top: calc(12px + var(--safe-top)); left: 50%; transform: translateX(-50%); width: min(94vw, 420px); display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-lg); background: var(--grad-brand); color: #fff; box-shadow: 0 24px 50px -18px rgba(47, 107, 255, .9); animation: pop .3s var(--ease); }
.ringer .who { flex: 1; min-width: 0; }
.ringer .btn { min-height: 40px; }

/* ---------- pages (sub views) ---------- */
.page { display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; flex-direction: column; gap: 6px; }
.page-head p { color: var(--text-2); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.profile-head { display: flex; gap: 16px; align-items: center; }
.profile-head .who { min-width: 0; }
.profile-head h1 { font-size: 24px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--press); width: fit-content; max-width: 100%; }
.tabs button { flex: none; min-height: 38px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-2); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--accent); box-shadow: var(--raise-sm); }

/* mail */
.mail-row { display: flex; gap: 12px; padding: 14px 12px; margin: 0 -12px; border-radius: var(--r-md); cursor: pointer; align-items: flex-start; }
.mail-row:hover { background: var(--accent-weak); }
.mail-row .subject { font-weight: 650; }
.mail-row .preview { font-size: 13.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mail-row time { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; font-size: 15px; }
.attach { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.attach audio, .attach video { width: 100%; max-height: 260px; border-radius: var(--r-sm); }

/* ---------- conversation room ---------- */
.room { display: grid; grid-template-rows: auto 1fr auto; min-height: 100dvh; background: var(--bg); }
.room-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-top)) 14px 10px; border-bottom: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 5; }
.room-top .name { font: 650 16px var(--font-display); }
.room-main { display: grid; grid-template-columns: 1fr; min-height: 0; }
.stage { padding: 16px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 240px)); justify-content: center; gap: 14px; }
.stage { justify-content: center; }
@media (min-width: 960px) { .tiles { grid-template-columns: repeat(auto-fit, minmax(200px, 280px)); } }
.tile { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--raise-sm); display: grid; place-items: center; overflow: hidden; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile .label { position: absolute; left: 8px; bottom: 8px; right: 8px; display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: var(--r-pill); background: rgba(10, 11, 14, .55); color: #fff; font-size: 12px; font-weight: 600; backdrop-filter: blur(6px); width: fit-content; max-width: calc(100% - 16px); }
.tile.is-speaking { box-shadow: 0 0 0 3px var(--live), 0 0 24px var(--live-glow); }
.tile .tag { position: absolute; top: 8px; right: 8px; }
.side { display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line); background: var(--surface-2); }
.side .tabs { margin: 12px 12px 0; }
.side-pane { flex: 1; min-height: 280px; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 86%; padding: 9px 12px; border-radius: 16px 16px 16px 6px; background: var(--surface); box-shadow: var(--raise-sm); font-size: 14.5px; overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-end; border-radius: 16px 16px 6px 16px; background: var(--accent-weak); box-shadow: none; }
.bubble .from { font-size: 12px; font-weight: 650; color: var(--accent-2); margin-bottom: 2px; }
.bubble .quote { font-size: 12.5px; color: var(--text-2); border-left: 3px solid var(--accent); padding-left: 8px; margin-bottom: 4px; }
.bubble .acts { display: flex; gap: 2px; margin-top: 4px; opacity: .0; transition: opacity .15s; }
.bubble:hover .acts, .bubble:focus-within .acts { opacity: 1; }
.bubble .acts button { border: 0; background: none; color: var(--text-3); font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.bubble .acts button:hover { color: var(--accent); background: var(--accent-weak); }
.bubble img, .bubble video { border-radius: 10px; max-height: 220px; margin-top: 6px; }
.bubble audio { margin-top: 6px; max-width: 100%; }
.poll-opt { display: flex; justify-content: space-between; gap: 12px; width: 100%; margin-top: 6px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface-2); cursor: pointer; font-weight: 550; }
.poll-opt[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px calc(10px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--surface-2); }
.composer .input { min-height: 44px; }
.dock { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 12px 12px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(16px); }
.dock .ctl { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; border: 0; background: none; cursor: pointer; color: var(--text-2); font-size: 11.5px; font-weight: 600; }
.dock .ctl .knob { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--raise-sm); color: var(--text); transition: background .2s, color .2s; }
.dock .ctl[aria-pressed="true"] .knob { background: var(--accent); color: #fff; box-shadow: none; }
.dock .ctl.end .knob { background: var(--danger); color: #fff; box-shadow: 0 10px 24px -12px var(--danger); }
.dock .ctl.warn .knob { background: var(--warn-weak); color: var(--warn); }
@media (min-width: 960px) {
  .room-main { grid-template-columns: minmax(0, 1fr) 380px; }
  .side { border-top: 0; border-left: 1px solid var(--line); height: calc(100dvh - 64px - 88px); position: sticky; top: 64px; }
}

/* ---------- auth pages ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
.auth-art { display: none; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: calc(28px + var(--safe-top)) 20px calc(28px + var(--safe-bottom)); max-width: 460px; width: 100%; margin: 0 auto; gap: 22px; }
.auth-main .brand-logo { width: 150px; }
.auth-main h1 { font-size: 28px; line-height: 34px; }
.auth-card { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--raise); padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.auth-foot { display: flex; flex-direction: column; gap: 10px; align-items: center; font-size: 14.5px; color: var(--text-2); text-align: center; }
.steps { display: flex; gap: 6px; }
.steps span { height: 4px; flex: 1; border-radius: 4px; background: var(--line); }
.steps span.on { background: var(--grad-brand); }
.pw-rules { display: flex; flex-wrap: wrap; gap: 6px; }
.pw-rules .chip.ok { background: var(--positive-weak); color: var(--positive); }
@media (min-width: 960px) {
  .auth { grid-template-columns: minmax(420px, 1.05fr) minmax(460px, 1fr); }
  .auth-art { display: flex; position: relative; overflow: hidden; flex-direction: column; justify-content: space-between; padding: 44px; background: var(--grad-brand); color: #fff; }
  .auth-art::before { content: ""; position: absolute; width: 60vw; height: 60vw; right: -22vw; bottom: -26vw; border-radius: 50%; background: radial-gradient(circle, rgba(45, 226, 255, .5), transparent 62%); }
  .auth-art::after { content: ""; position: absolute; width: 40vw; height: 40vw; left: -14vw; top: -16vw; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 60%); }
  .auth-art > * { position: relative; z-index: 1; }
  .auth-art .brand-logo { width: 150px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .25)); }
  .auth-art h2 { color: #fff; font-size: 40px; line-height: 46px; letter-spacing: -1px; max-width: 12ch; font-weight: 700; }
  .auth-art p { color: rgba(255, 255, 255, .82); max-width: 40ch; font-size: 16px; line-height: 1.55; }
  .auth-main > a[href="/"] { display: none; }
  .auth-main { padding: 48px; }
}
.drop-in { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.drop-in .seat { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: rgba(255, 255, 255, .14); backdrop-filter: blur(8px); width: fit-content; }
.drop-in .seat .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 650 13px var(--font-display); }
.drop-in .seat:nth-child(2) { margin-left: 44px; }
.drop-in .seat:nth-child(3) { margin-left: 16px; }

/* landing */
.landing { min-height: 100dvh; display: flex; flex-direction: column; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: calc(16px + var(--safe-top)) 20px 16px; max-width: 1120px; width: 100%; margin: 0 auto; }
.landing-nav img { height: 34px; width: auto; }
.landing-hero { flex: 1; display: grid; gap: 36px; align-items: center; padding: 20px 20px 48px; max-width: 1120px; width: 100%; margin: 0 auto; }
.landing-hero h1 { font-size: clamp(40px, 7vw, 76px); line-height: 1.02; letter-spacing: -2px; font-weight: 700; }
.landing-hero h1 em { font-style: normal; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.landing-hero .lede { font-size: 18px; color: var(--text-2); max-width: 46ch; line-height: 1.55; }
.lounge { position: relative; padding: 22px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--raise); display: flex; flex-direction: column; gap: 14px; }
.lounge .room-line { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); }
.faces { display: flex; }
.faces span { width: 30px; height: 30px; border-radius: 50%; margin-left: -8px; border: 2.5px solid var(--surface-2); display: grid; place-items: center; font: 650 11px var(--font-display); }
.faces span:first-child { margin-left: 0; }
@media (min-width: 900px) { .landing-hero { grid-template-columns: 1.15fr .85fr; } }

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

/* ============================================================
   "Plush, amplified" — the layer that carries the direction.
   Loaded last so it refines the primitives above without forking them.
   ============================================================ */

/* ---------- brand plate: the sticker logo gets a lit plate to sit on ---------- */
.sidebar .brand, .topbar .logo-btn, .auth-main > a[href="/"], .landing-nav img {
  background: var(--surface-3);
  box-shadow: var(--raise-sm);
  border-radius: 16px;
  padding: 9px 13px;
}
.sidebar .brand { width: fit-content; transform: rotate(-1.4deg); transition: transform .25s var(--ease); }
.sidebar .brand:hover { transform: rotate(0deg); }
.topbar .logo-btn { padding: 6px 10px; border-radius: 13px; }
.landing-nav img { padding: 7px 11px; }
:root[data-theme="dark"] .sidebar .brand,
:root[data-theme="dark"] .topbar .logo-btn,
:root[data-theme="dark"] .auth-main > a[href="/"],
:root[data-theme="dark"] .landing-nav img {
  background: #F3F5FB;
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .9);
  filter: none;
}
:root[data-theme="dark"] .logo-btn img, :root[data-theme="dark"] .brand-logo { filter: none; }

/* ---------- sidebar / nav ---------- */
.sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .04));
  backdrop-filter: blur(14px) saturate(130%);
}
:root[data-theme="dark"] .sidebar { background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(0, 0, 0, .18)); }
.nav-item { min-height: 46px; border-radius: 14px; font-size: 15px; }
.nav-item .ico { color: var(--text-3); }
.nav-item[aria-current="page"] {
  background: var(--surface); color: var(--accent-deep); font-weight: 600; box-shadow: var(--raise-sm);
}
.nav-item[aria-current="page"] .ico { color: var(--accent-deep); }
.nav-item[aria-current="page"]::before {
  content: ""; width: 4px; height: 20px; border-radius: 4px; margin-left: -7px; margin-right: 1px; flex: none;
  background: var(--grad-brand); box-shadow: 0 0 12px 1px var(--accent-ring);
}
.side-foot > .nav-item:has(.who-text) {
  background: var(--surface); box-shadow: var(--raise-sm); border-radius: 16px; margin-bottom: 6px;
}
.detail { background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0)); backdrop-filter: blur(10px); }
:root[data-theme="dark"] .detail { background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(0, 0, 0, .14)); }

/* ---------- greeting ---------- */
.greeting h1 { font-size: 30px; line-height: 34px; letter-spacing: -1.05px; }
.greeting h1 em {
  font-style: normal;
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.greeting .sub { margin-top: 7px; font-size: 15px; color: var(--text-2); }

/* ---------- presence: the signature ---------- */
.presence {
  position: relative; display: grid; place-items: center; padding: 0;
  width: 56px; height: 56px; border-radius: 50%; background: none; animation: none;
}
.presence::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 212deg, #AEB6C6, #D8DEE9, #AEB6C6);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3.5px));
}
:root[data-theme="dark"] .presence::before { background: conic-gradient(from 212deg, #39405280, #5A6478, #39405280); }
.presence .avatar { width: calc(100% - 13px); height: calc(100% - 13px); }
.presence .avatar .face { box-shadow: 0 0 0 3px var(--surface), inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -8px 14px rgba(0, 0, 0, .08); }
.presence.is-live::before { background: var(--grad-live); }
.presence.is-live::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 18px 2px var(--live-glow);
  animation: breathe 3.6s ease-in-out infinite;
}
.presence.is-away::before { background: conic-gradient(from 212deg, var(--gold), #F2C46B, var(--gold)); }
.presence.is-lg { width: 112px; height: 112px; }
.presence.is-lg::before {
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
}
.presence.is-lg .avatar { width: 92px; height: 92px; }
.presence.is-lg .avatar .face { font-size: 34px; box-shadow: 0 0 0 4px var(--surface), inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 -14px 26px rgba(0, 0, 0, .08); }
.presence.is-lg.is-live::after { box-shadow: 0 0 38px 5px var(--live-glow); }
@keyframes breathe { 0%, 100% { opacity: .5; transform: scale(.985); } 50% { opacity: 1; transform: scale(1.025); } }

.avatar .face { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -6px 12px rgba(0, 0, 0, .07); font-family: var(--font-display); font-weight: 600; }
.avatar .pip { width: 14px; height: 14px; border-width: 3px; }
.dot.on { background: var(--positive-dot); box-shadow: 0 0 0 3px var(--positive-weak); }

/* ---------- the presence well: live things sit in a lit recess ---------- */
.well {
  position: relative; overflow: hidden; border-radius: 18px;
  background: linear-gradient(176deg, var(--surface-2), color-mix(in srgb, var(--surface) 88%, var(--surface-2)));
  box-shadow: var(--press);
}
.well.is-live::before {
  content: ""; position: absolute; left: 0; top: 12%; bottom: 12%; width: 5px;
  border-radius: 0 6px 6px 0;
  background: linear-gradient(180deg, var(--live), var(--accent) 55%, var(--accent-2));
  box-shadow: 0 0 20px 3px var(--live-glow);
}
.well.is-live::after {
  content: ""; position: absolute; left: -40px; top: 50%; width: 200px; height: 200px;
  transform: translateY(-50%); pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, var(--live-glow), transparent 68%); opacity: .5;
}

/* the empty detail pane echoes the presence ring, not a spinner */
.detail-empty .art { display: grid; place-items: center; }
.art-ring {
  position: relative; display: block; width: 46px; height: 46px; border-radius: 50%;
  background: conic-gradient(from 212deg, var(--accent), var(--live), var(--accent));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  opacity: .8;
}
.detail-empty .art::after {
  content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 14px 3px var(--accent-weak);
}

/* your own presence sits in a recess inside the Status card */
.box .status-line.well { width: auto; margin: 8px; padding: 12px 12px 12px 18px; border-radius: 16px; }
.box .status-line.well .name { font-size: 16px; }
@media (max-width: 560px) { .box .status-line.well { margin: 6px; padding: 12px 10px 12px 16px; } }

/* ---------- primitives, refined ---------- */
.btn { font-size: 14.5px; }
.btn:hover { box-shadow: var(--raise); transform: none; }
.btn:active { box-shadow: var(--press-sm); transform: none; }
.btn-primary {
  box-shadow: 0 12px 26px -12px rgba(37, 87, 226, .85), 0 2px 4px rgba(19, 24, 41, .14),
    inset 0 1px 0 rgba(255, 255, 255, .34), inset 0 -1px 0 rgba(0, 0, 0, .18);
}
.btn-primary:hover { box-shadow: 0 18px 34px -12px rgba(37, 87, 226, .9), inset 0 1px 0 rgba(255, 255, 255, .34); }
.btn-quiet:hover { color: var(--accent-deep); }
.btn-live {
  background: linear-gradient(135deg, #0A8FA8, #2557E2); color: #fff;
  box-shadow: 0 12px 26px -12px var(--live-glow), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.icon-btn:hover { color: var(--accent-deep); }
.chip { min-height: 28px; font-size: 13.5px; box-shadow: var(--press-sm); }
.chip.accent { color: var(--accent-deep); box-shadow: none; }
.chip.live { background: var(--live-weak); color: var(--live-ink); box-shadow: none; }
.chip.positive { color: var(--positive); box-shadow: none; }
.chip.warn { background: var(--gold-weak); color: var(--gold-ink); box-shadow: none; }
.chip.danger { box-shadow: none; }
.badge {
  min-width: 24px; height: 24px; background: var(--grad-brand);
  box-shadow: 0 4px 10px -4px rgba(37, 87, 226, .9);
}
.badge.quiet { background: var(--surface-2); color: var(--text-2); box-shadow: var(--press-sm); }
.badge.live { background: linear-gradient(135deg, var(--live), var(--accent)); color: #04262d; }

.box { border-radius: var(--r-xl); }
.box-head { border-radius: var(--r-xl); min-height: 68px; }
.box-icon { width: 40px; height: 40px; border-radius: 13px; background: var(--surface-2); color: var(--accent-deep); box-shadow: var(--press-sm); }
.box[data-open="true"] .box-icon { background: var(--accent-weak); box-shadow: none; }
.box-title { font-size: 16px; }
.card { border-radius: var(--r-xl); }
.card.flat { box-shadow: var(--press-sm); background: var(--surface-2); }
.person, .request { background: var(--surface-2); box-shadow: var(--press-sm); border-radius: var(--r-lg); }
.option { background: var(--surface-2); box-shadow: var(--press-sm); }
.option:has(input:checked) { background: var(--accent-weak); box-shadow: none; border-color: var(--accent); }
.empty { background: var(--surface-2); box-shadow: var(--press-sm); }

.input, .select, .textarea { background: var(--surface-2); box-shadow: var(--press-sm); }
.input:focus, .select:focus, .textarea:focus { box-shadow: var(--press-sm), 0 0 0 4px var(--accent-ring); }
.seg, .tabs { background: var(--surface-2); box-shadow: var(--press-sm); }
.seg button[aria-pressed="true"], .tabs button[aria-selected="true"] { background: var(--surface); color: var(--accent-deep); box-shadow: var(--raise-sm); }
.cs button { box-shadow: var(--raise-sm); }
.cs button[aria-pressed="true"] { background: var(--grad-brand); box-shadow: 0 8px 18px -8px rgba(37, 87, 226, .9); }
.days button { box-shadow: var(--raise-sm); }
.days button[aria-pressed="true"] { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 14px -6px rgba(37, 87, 226, .8); }
.switch input:checked ~ .track { background: var(--grad-brand); }
.pill-toggle { box-shadow: var(--raise-sm); }
.pill-toggle[aria-pressed="true"].is-online { background: var(--positive-weak); color: var(--positive); box-shadow: var(--press-sm); }
.pill-toggle[aria-pressed="true"].is-muted { background: var(--gold-weak); color: var(--gold-ink); box-shadow: var(--press-sm); }

.hero-card { box-shadow: 0 22px 44px -22px rgba(37, 87, 226, .9), inset 0 1px 0 rgba(255, 255, 255, .25); }
dialog.modal .sheet { border-radius: var(--r-xl); }
.toast { border-radius: var(--r-lg); }

/* Rooms keep the cinematic treatment even in light mode: presence is the content. */
.tile { background: var(--surface); box-shadow: var(--raise-sm); }
.tile.is-speaking { box-shadow: 0 0 0 3px var(--live), 0 0 34px var(--live-glow); }
.dock { background: var(--glass); }
.dock .ctl .knob { box-shadow: var(--raise-sm); }
.dock .ctl[aria-pressed="true"] .knob { background: var(--grad-brand); color: #fff; box-shadow: 0 10px 22px -10px rgba(37, 87, 226, .9); }

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .presence.is-live::after { animation: none; }
}
