/* =====================================================================
   Camera Lab — liquid glass design system
   Tokens follow the Applekor approach: one "liquid" amount (--lq, 0..1)
   drives glass transparency, blur and rim light; themes swap the glass
   base colour and ink. Views should only use the classes defined here.
   ===================================================================== */
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-d: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --ease: cubic-bezier(.32,.72,0,1);
  --spring: cubic-bezier(.3,1.45,.5,1);
  --ease-in: cubic-bezier(.4,0,1,1);

  --lq: .6;                          /* liquid amount: 0 = solid, 1 = very clear */
  --accent-rgb: 10 132 255;
  --accent: rgb(var(--accent-rgb));
  --ok-rgb: 48 209 88;   --ok: rgb(var(--ok-rgb));
  --warn-rgb: 255 214 10; --warn: rgb(var(--warn-rgb));
  --bad-rgb: 255 69 58;  --bad: rgb(var(--bad-rgb));
  --orange-rgb: 255 159 10;

  /* tile palette (rgb triplets) */
  --t-blue: 10 132 255; --t-indigo: 94 92 230; --t-purple: 191 90 242; --t-pink: 255 55 95;
  --t-red: 255 69 58; --t-orange: 255 159 10; --t-yellow: 255 204 0; --t-green: 48 209 88;
  --t-mint: 0 199 190; --t-teal: 48 176 199; --t-cyan: 100 210 255; --t-gray: 142 142 147; --t-brown: 172 142 104;

  --sidebar-w: 252px;
  --r-xl: 28px; --r-lg: 22px; --r-md: 16px; --r-sm: 12px;

  /* ---- dark theme (default) */
  --ink: #f6f8fc;
  --ink-2: rgb(236 240 250 / .74);
  --ink-3: rgb(228 234 248 / .50);
  --ink-4: rgb(228 234 248 / .30);
  --glass-rgb: 24 26 36;
  --glass-a: calc(.62 - var(--lq) * .38);
  --glass-a-pop: calc(.86 - var(--lq) * .22);
  --blur: calc(38px - var(--lq) * 12px);
  --sat: calc(1.3 + var(--lq) * .6);
  --bb: 1;                           /* backdrop brightness, tuned live by the wallpaper */
  --rim-a: calc(.16 + var(--lq) * .30);
  --rim-b: calc(.04 + var(--lq) * .08);
  --glow-a: calc(var(--lq) * .08);
  --line: rgb(255 255 255 / calc(.07 + var(--lq) * .07));
  --hair: rgb(255 255 255 / .08);
  --fill: rgb(255 255 255 / .08);    /* controls on glass */
  --fill-2: rgb(255 255 255 / .14);
  --well: rgb(0 0 0 / .22);          /* recessed areas */
  --well-line: rgb(255 255 255 / .07);
  --lens-bg: rgb(255 255 255 / .17);
  --shadow: 0 1px 1px rgb(0 0 0 / .18), 0 28px 60px -28px rgb(0 0 0 / .75);
  --shadow-pop: 0 2px 8px rgb(0 0 0 / .3), 0 30px 70px -18px rgb(0 0 0 / .75);
  --spot-on: .07;
  --hero-sh: .3;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --ink: #0d1017;
  --ink-2: rgb(20 24 34 / .72);
  --ink-3: rgb(20 24 34 / .52);
  --ink-4: rgb(20 24 34 / .32);
  --glass-rgb: 250 251 255;
  --glass-a: calc(.80 - var(--lq) * .40);
  --glass-a-pop: calc(.92 - var(--lq) * .18);
  --sat: calc(1.5 + var(--lq) * .8);
  --rim-a: calc(.55 + var(--lq) * .45);
  --rim-b: calc(.10 + var(--lq) * .25);
  --glow-a: calc(var(--lq) * .30);
  --line: rgb(255 255 255 / calc(.40 + var(--lq) * .30));
  --hair: rgb(20 24 34 / .08);
  --fill: rgb(255 255 255 / .55);
  --fill-2: rgb(255 255 255 / .85);
  --well: rgb(20 24 40 / .06);
  --well-line: rgb(20 24 34 / .06);
  --lens-bg: rgb(255 255 255 / .95);
  --shadow: 0 1px 1px rgb(0 0 0 / .03), 0 18px 40px -20px rgb(20 30 70 / .35);
  --shadow-pop: 0 2px 6px rgb(0 0 0 / .05), 0 26px 60px -16px rgb(20 24 60 / .38);
  --spot-on: .45;
  color-scheme: light;
}
/* light glass brightens what's behind it instead of dimming it (no grey haze) */
:root[data-theme="light"] :is(.glass, .card)::before {
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--sat)) brightness(1.05);
  backdrop-filter: blur(var(--blur)) saturate(var(--sat)) brightness(1.05);
}
:root[data-theme="light"] :is(.glass, .card) :is(.glass, .card)::before { -webkit-backdrop-filter: none; backdrop-filter: none; background-color: rgb(255 255 255 / .45); }
:root[data-glass="tinted"] { --glass-a: calc(.80 - var(--lq) * .22); --blur: calc(44px - var(--lq) * 10px); }
:root[data-theme="light"][data-glass="tinted"] { --glass-a: calc(.92 - var(--lq) * .18); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: #0a0f1e;
  font: 14px/1.45 var(--font); letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
::selection { background: rgb(var(--accent-rgb) / .35); }
.i { width: 18px; height: 18px; flex: none; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: var(--ink-4) transparent; }

/* ------------------------------------------------------------ wallpaper */
#wp { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -3; display: block; }
.wp-shade { position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(130% 100% at 50% 40%, transparent 55%, rgb(0 0 0 / .32) 100%); }
:root[data-theme="light"] .wp-shade { background: radial-gradient(130% 100% at 50% 40%, transparent 60%, rgb(0 0 0 / .12) 100%); }
.ring-glow { position: fixed; inset: 0; z-index: 95; pointer-events: none; opacity: 0; transition: opacity .6s;
  box-shadow: inset 0 0 0 2px rgb(255 214 10 / .8), inset 0 0 60px 8px rgb(255 159 10 / .45), inset 0 0 170px 30px rgb(255 55 95 / .22); }
body.ringing .ring-glow { opacity: 1; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }

/* ------------------------------------------------------------ liquid glass */
.glass, .card {
  position: relative; isolation: isolate; border-radius: var(--r-xl); border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / calc(var(--rim-a) * .8)), inset 0 -1px 0 rgb(255 255 255 / var(--rim-b)),
              inset 0 0 32px rgb(255 255 255 / var(--glow-a)), var(--shadow);
}
.glass::before, .card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background-color: rgb(var(--glass-rgb) / var(--glass-a));
  background-image:
    radial-gradient(420px circle at var(--mx, -999px) var(--my, -999px), rgb(255 255 255 / var(--spot, 0)), transparent 62%),
    linear-gradient(165deg, rgb(255 255 255 / calc(var(--glow-a) + .06)), transparent 32%, transparent 74%, rgb(255 255 255 / calc(var(--glow-a) * .5)));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--sat)) brightness(var(--bb));
  backdrop-filter: blur(var(--blur)) saturate(var(--sat)) brightness(var(--bb));
}
.glass::after, .card::after {   /* conic rim light */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.25px; pointer-events: none;
  background: conic-gradient(from var(--rim-angle, 215deg),
    rgb(255 255 255 / var(--rim-a)) 0deg, rgb(255 255 255 / var(--rim-b)) 60deg, rgb(255 255 255 / 0) 120deg,
    rgb(255 255 255 / calc(var(--rim-a) * .55)) 180deg, rgb(255 255 255 / 0) 240deg,
    rgb(255 255 255 / var(--rim-b)) 300deg, rgb(255 255 255 / var(--rim-a)) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: calc(.4 + var(--lq) * .6);
}
.card { padding: 18px 20px 20px; }
.card.tight { padding: 10px; }
.card.flush { padding: 0; overflow: hidden; }
@media (hover: hover) and (pointer: fine) { .glass:hover, .card:hover { --spot: var(--spot-on); } }
/* glass inside glass: no second blur, just a soft layer */
:is(.glass, .card) :is(.glass, .card)::before { -webkit-backdrop-filter: none; backdrop-filter: none; background-color: rgb(var(--glass-rgb) / .3); }
:is(.glass, .card) :is(.glass, .card)::after { display: none; }
.glass-pop {
  position: relative; isolation: isolate; border-radius: 22px; border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgb(255 255 255 / var(--rim-a)), var(--shadow-pop);
}
.glass-pop::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background-color: rgb(var(--glass-rgb) / var(--glass-a-pop));
  -webkit-backdrop-filter: blur(calc(var(--blur) + 14px)) saturate(var(--sat)); backdrop-filter: blur(calc(var(--blur) + 14px)) saturate(var(--sat)); }
.well { background: var(--well); border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--well-line), inset 0 1px 3px rgb(0 0 0 / .12); }
.card-hover { transition: transform .5s var(--spring), box-shadow .3s; cursor: pointer; }
.card-hover:hover { transform: translateY(-3px); }
.card-hover:active { transform: scale(.985); }

/* ------------------------------------------------------------ type */
.h1 { font-family: var(--font-d); font-size: 30px; font-weight: 720; letter-spacing: -.03em; line-height: 1.1; margin: 0; }
.h2 { font-family: var(--font-d); font-size: 19px; font-weight: 690; letter-spacing: -.022em; line-height: 1.2; margin: 0; }
.h3 { font-size: 15px; font-weight: 650; letter-spacing: -.012em; margin: 0; }
.eyebrow { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); }
.note { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }
.note b, .note strong { color: var(--ink-2); font-weight: 640; }
.num { font-variant-numeric: tabular-nums; }
.big { font-family: var(--font-d); font-size: 34px; font-weight: 700; letter-spacing: -.035em; line-height: 1; }
.kbd, kbd { font: 600 10.5px/1 var(--font); padding: 3px 6px; border-radius: 6px; background: var(--fill); box-shadow: inset 0 -1px 0 var(--hair), inset 0 0 0 1px var(--hair); color: var(--ink-2); }

/* ------------------------------------------------------------ layout helpers */
.stack { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.row { display: flex; align-items: center; gap: var(--gap, 8px); flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: var(--gap, 18px); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; }
@media (max-width: 1280px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span-3 { grid-column: span 2; } }
@media (max-width: 760px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: minmax(0, 1fr); } .span-2, .span-3 { grid-column: auto; } .grid.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); --gap: 12px; } .keep-2 > .kpi { min-height: 128px; padding: 14px; } .keep-2 .kpi-value { font-size: 28px; } }

/* ------------------------------------------------------------ buttons */
.btn {
  --bg: var(--fill);
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px; border: 0; border-radius: 999px; cursor: pointer; white-space: nowrap; text-decoration: none;
  font-weight: 600; font-size: 13px; color: var(--ink); background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--hair), inset 0 1px 0 rgb(255 255 255 / calc(var(--rim-a) * .5)), 0 1px 2px rgb(0 0 0 / .12);
  transition: transform .45s var(--spring), background .2s, opacity .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn .i { width: 16px; height: 16px; }
.btn:hover { --bg: var(--fill-2); }
.btn:active { transform: scale(.95); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; transform: none; }
.btn.primary, .btn.danger, .btn.success { color: #fff; }
.btn.primary { background: linear-gradient(180deg, rgb(var(--accent-rgb) / .82), rgb(var(--accent-rgb))); box-shadow: inset 0 1px 0 rgb(255 255 255 / .4), 0 6px 18px -6px rgb(var(--accent-rgb) / .8); }
.btn.danger { background: linear-gradient(180deg, #ff6a5f, #e0281d); box-shadow: inset 0 1px 0 rgb(255 255 255 / .4), 0 6px 18px -6px rgb(255 69 58 / .8); }
.btn.success { background: linear-gradient(180deg, #4cd964, #1fae47); box-shadow: inset 0 1px 0 rgb(255 255 255 / .4), 0 6px 18px -6px rgb(48 209 88 / .8); }
.btn.primary:hover, .btn.danger:hover, .btn.success:hover { filter: brightness(1.08); }
.btn.ghost { --bg: transparent; box-shadow: none; }
.btn.ghost:hover { --bg: var(--fill); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn.icon { width: 36px; padding: 0; } .btn.icon.sm { width: 30px; } .btn.icon.lg { width: 46px; }
.btn.block { width: 100%; }
.btn:focus-visible, .seg button:focus-visible, .switch:focus-visible, .nav a:focus-visible, .input:focus-visible { outline: none; box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .5); }
.rip { position: absolute; pointer-events: none; border-radius: 44% 56% 53% 47% / 55% 45% 55% 45%; background: rgb(255 255 255 / .38);
  transform: scale(0); animation: rip .7s var(--ease) forwards; }
@keyframes rip { 60% { border-radius: 52% 48% 46% 54% / 47% 53% 47% 53%; } to { transform: scale(1) rotate(24deg); opacity: 0; border-radius: 50%; } }

/* ------------------------------------------------------------ chips, dots, badges */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; white-space: nowrap;
  font-size: 11.5px; font-weight: 640; color: var(--ink-2); background: var(--fill); box-shadow: inset 0 0 0 1px var(--hair); }
.chip .i { width: 13px; height: 13px; }
.chip.ok { color: rgb(var(--ok-rgb)); background: rgb(var(--ok-rgb) / .14); }
.chip.warn { color: #c79600; background: rgb(var(--warn-rgb) / .18); }
:root:not([data-theme="light"]) .chip.warn { color: var(--warn); }
.chip.bad { color: rgb(var(--bad-rgb)); background: rgb(var(--bad-rgb) / .14); }
.chip.info { color: var(--accent); background: rgb(var(--accent-rgb) / .14); }
:root[data-theme="light"] .chip.ok { color: #1a7f37; } :root[data-theme="light"] .chip.bad { color: #c4271d; } :root[data-theme="light"] .chip.info { color: rgb(var(--accent-rgb)); filter: brightness(.85); }
.chip.ring { background: var(--warn); color: #241a00; box-shadow: 0 0 22px rgb(255 214 10 / .55); animation: breathe 1.2s infinite; }
/* chips and buttons on top of live video are tinted, not blurred: a backdrop blur there
   would be re-rendered for every video frame of every camera */
.chip.dark { background: rgb(12 14 20 / .62); color: #fff; box-shadow: inset 0 0 0 .5px rgb(255 255 255 / .2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-4); flex: none; display: inline-block; transition: background .3s, box-shadow .3s; }
.dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.dot.off { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.dot.warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.dot.pulse { animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 750; color: #fff; background: var(--bad); }

/* ------------------------------------------------------------ icon tiles + KPI */
.tile { --tile: var(--t-blue); width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff;
  background: radial-gradient(120% 80% at 30% 0, rgb(255 255 255 / .45), transparent 55%), linear-gradient(160deg, color-mix(in srgb, rgb(var(--tile)) 72%, #fff) 0, rgb(var(--tile)) 70%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), inset 0 -1px 1px rgb(0 0 0 / .12), 0 6px 14px -4px rgb(var(--tile) / .6);
  transition: transform .5s var(--spring); }
.tile .i { width: 17px; height: 17px; }
.tile.sm { width: 26px; height: 26px; border-radius: 8px; } .tile.sm .i { width: 14px; height: 14px; }
.tile.lg { width: 44px; height: 44px; border-radius: 13px; } .tile.lg .i { width: 22px; height: 22px; }
.tile.xl { width: 64px; height: 64px; border-radius: 19px; } .tile.xl .i { width: 32px; height: 32px; }
.t-blue { --tile: var(--t-blue); } .t-indigo { --tile: var(--t-indigo); } .t-purple { --tile: var(--t-purple); } .t-pink { --tile: var(--t-pink); }
.t-red { --tile: var(--t-red); } .t-orange { --tile: var(--t-orange); } .t-yellow { --tile: var(--t-yellow); } .t-green { --tile: var(--t-green); }
.t-mint { --tile: var(--t-mint); } .t-teal { --tile: var(--t-teal); } .t-cyan { --tile: var(--t-cyan); } .t-gray { --tile: var(--t-gray); } .t-brown { --tile: var(--t-brown); }
.kpi { overflow: hidden; display: flex; flex-direction: column; gap: 10px; min-height: 150px; }
.kpi::before { background-image:
    radial-gradient(120% 90% at 0 0, rgb(var(--tile, var(--t-blue)) / calc(.10 + var(--lq) * .14)), transparent 62%),
    radial-gradient(90% 70% at 100% 100%, rgb(var(--tile, var(--t-blue)) / calc(.06 + var(--lq) * .08)), transparent 70%),
    radial-gradient(420px circle at var(--mx, -999px) var(--my, -999px), rgb(255 255 255 / var(--spot, 0)), transparent 62%); }
.kpi .kpi-mark { position: absolute; right: -10px; bottom: -14px; width: 92px; height: 92px; color: rgb(var(--tile, var(--t-blue))); opacity: .12; transform: rotate(-12deg); transition: transform .6s var(--ease); pointer-events: none; }
.kpi .kpi-mark .i { width: 100%; height: 100%; stroke-width: 1.4; }
.kpi:hover .kpi-mark { transform: rotate(-4deg) scale(1.08); }
.kpi:hover .tile { transform: scale(1.08) rotate(-4deg); }
.kpi-label { font-size: 12.5px; font-weight: 620; color: var(--ink-2); }
.kpi-value { font-family: var(--font-d); font-size: 34px; font-weight: 720; letter-spacing: -.035em; line-height: 1; margin-top: auto; }
.kpi-sub { font-size: 12px; color: var(--ink-3); font-weight: 540; }

/* odometer digits (core.odometer) */
.odo { display: inline-flex; white-space: nowrap; }
.odo-d { display: inline-block; height: 1em; line-height: 1; overflow: hidden; position: relative; }
.odo-d > span { display: flex; flex-direction: column; transition: transform 1.1s cubic-bezier(.2,1.14,.32,1); }
.odo-d > span > i { font-style: normal; height: 1em; line-height: 1; }

/* ------------------------------------------------------------ segmented + inputs */
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--well); box-shadow: inset 0 0 0 1px var(--well-line), inset 0 1px 2px rgb(0 0 0 / .18); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { position: relative; z-index: 1; border: 0; background: transparent; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); transition: color .25s; }
.seg button .i { width: 14px; height: 14px; }
.seg button.sel { color: var(--ink); }
.seg .lens { position: absolute; z-index: 0; left: 0; top: 3px; height: calc(100% - 6px); border-radius: 999px; pointer-events: none; background: var(--lens-bg);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), inset 0 0 0 .5px rgb(255 255 255 / .25), 0 2px 10px -2px rgb(0 0 0 / .35);
  transition: transform .5s var(--spring), width .5s var(--spring); }
.seg.full { display: flex; } .seg.full button { flex: 1; justify-content: center; }
.seg.lg button { height: 34px; padding: 0 16px; font-size: 13.5px; }

.switch { position: relative; width: 48px; height: 29px; border-radius: 999px; border: 0; cursor: pointer; flex: none; padding: 0;
  background: var(--ink-4); transition: background .3s; box-shadow: inset 0 0 0 1px var(--hair); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 25px; height: 25px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / .3); transition: transform .45s var(--spring), width .3s var(--spring); }
.switch:active::after { width: 30px; }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(19px); }
.switch[aria-checked="true"]:active::after { transform: translateX(14px); }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; cursor: pointer; --fill-pct: 50%; }
.range::-webkit-slider-runnable-track { height: 5px; border-radius: 999px; background: linear-gradient(90deg, var(--accent) var(--fill-pct), var(--ink-4) var(--fill-pct)); }
.range::-moz-range-track { height: 5px; border-radius: 999px; background: linear-gradient(90deg, var(--accent) var(--fill-pct), var(--ink-4) var(--fill-pct)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9.5px; border-radius: 999px; background: #fff; border: .5px solid rgb(0 0 0 / .04);
  box-shadow: 0 1px 2px rgb(0 0 0 / .14), 0 3px 8px rgb(0 0 0 / .18); transition: transform .3s var(--spring); }
.range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 999px; background: #fff; border: 0; box-shadow: 0 1px 2px rgb(0 0 0 / .14), 0 3px 8px rgb(0 0 0 / .18); }
.range:active::-webkit-slider-thumb { transform: scale(1.4, 1.25); background: rgb(255 255 255 / .2); box-shadow: inset 0 1px 1px rgb(255 255 255 / .95), 0 4px 14px rgb(0 0 0 / .2); border: 1px solid rgb(255 255 255 / .9); }

.stepper { display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 2px; border-radius: 999px; background: var(--well); box-shadow: inset 0 0 0 1px var(--well-line); }
.stepper button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; font-size: 17px; color: var(--ink-2); display: grid; place-items: center; }
.stepper button:hover { background: var(--fill-2); color: var(--ink); }
.stepper output { min-width: 46px; text-align: center; font-weight: 680; font-size: 13px; font-variant-numeric: tabular-nums; }

.input { height: 42px; width: 100%; padding: 0 14px; border: 0; border-radius: 14px; outline: 0; background: var(--well); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--well-line), inset 0 1px 3px rgb(0 0 0 / .14); font-size: 14px; transition: box-shadow .2s; }
.input::placeholder { color: var(--ink-3); }
.input:focus { box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / .6), 0 0 0 4px rgb(var(--accent-rgb) / .18); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 620; color: var(--ink-2); }

.meter { height: 6px; border-radius: 999px; overflow: hidden; background: var(--well); }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .8s var(--ease); }

/* ------------------------------------------------------------ lists */
.list { display: flex; flex-direction: column; }
.li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 14px; transition: background .2s; }
.li:hover { background: var(--fill); }
.li .t { min-width: 0; } .li .t b { font-weight: 630; font-size: 13.5px; display: block; }
.li .t span { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .end { text-align: right; font-size: 12px; color: var(--ink-2); font-weight: 560; white-space: nowrap; font-variant-numeric: tabular-nums; }
.li .end small { display: block; color: var(--ink-3); font-size: 11px; font-weight: 500; }
.li-photo { width: 64px; height: 40px; border-radius: 9px; object-fit: cover; box-shadow: inset 0 0 0 1px var(--hair), 0 4px 10px -4px rgb(0 0 0 / .5); background: var(--well); }
.sep { height: 1px; background: var(--hair); margin: 6px 0; border: 0; }
.group-label { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; padding: 12px 10px 4px; }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-3); display: grid; justify-items: center; gap: 10px; font-size: 13px; }
.empty .tile { opacity: .9; }
.skeleton { border-radius: 10px; background: linear-gradient(100deg, var(--fill) 30%, var(--fill-2) 50%, var(--fill) 70%) 0 0 / 250% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: 125% 0; } to { background-position: -125% 0; } }

/* ------------------------------------------------------------ camera feed (built by feeds.js) */
.slot { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: #04060b; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06); isolation: isolate; }
.slot.r-lg { border-radius: 24px; } .slot.r-sm { border-radius: 14px; }
.slot.free { aspect-ratio: auto; height: 100%; }
.feed { position: absolute; inset: 0; }
.feed img { width: 100%; height: 100%; object-fit: cover; display: block; color: transparent; transition: transform 1.4s var(--ease); }
.feed video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; transition: transform 1.4s var(--ease); background: #04060b; }
.feed.hd video { display: block; } .feed.hd img { visibility: hidden; }
.feed img:not([src]), .feed img[src=""] { visibility: hidden; }   /* no broken-image icon while connecting */
.slot.contain .feed img, .slot.contain .feed video { object-fit: contain; }
:is(.ov-small, .ov-main):hover .feed video { transform: scale(1.03); }
.feed::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgb(0 0 0 / .32), transparent 24%, transparent 60%, rgb(0 0 0 / .55)); }
.slot.clean .feed::after { display: none; }
.feed .f-top { position: absolute; z-index: 2; top: 10px; left: 10px; right: 10px; display: flex; align-items: center; gap: 6px; pointer-events: none; }
.feed .f-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.feed .f-live .fl-wait, .feed.nopic .f-live .fl-on { display: none; }          /* no picture yet: "Connecting", not LIVE */
.feed.nopic .f-live .fl-wait { display: inline; }
.feed.nopic .f-live i { background: var(--warn); box-shadow: 0 0 8px var(--warn); animation: blink 1s infinite; }
/* (re)connecting: the LIVE dot turns into a spinner, inside the chip, so it never sits under a
   slot's top-right buttons */
.feed.loading .f-live i { width: 9px; height: 9px; box-sizing: border-box; background: none; box-shadow: none;
  border: 1.5px solid rgb(255 255 255 / .3); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.feed .f-err { position: absolute; z-index: 3; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: rgb(255 255 255 / .8); font-size: 13px; font-weight: 560; text-align: center; padding: 16px; background: radial-gradient(circle, rgb(20 24 36 / .7), rgb(5 7 12 / .92)); }
.feed .f-err .i { width: 30px; height: 30px; color: var(--bad); }
.feed.broken .f-err { display: flex; }
.slot .ov { position: absolute; z-index: 4; }           /* view overlays go in .ov elements */
.slot .ov-bl { left: 14px; bottom: 12px; color: #fff; text-shadow: 0 1px 10px rgb(0 0 0 / .6); pointer-events: none; }
/* a soft scrim under the caption, so it stays readable over a camera's own date/time stamp */
.slot .ov-bl::before { content: ""; position: absolute; z-index: -1; inset: -34px -56px -12px -14px; pointer-events: none;
  background: radial-gradient(ellipse at 0 100%, rgb(0 0 0 / .58), rgb(0 0 0 / .3) 45%, transparent 72%); }
.slot .ov-br { right: 10px; bottom: 10px; display: flex; gap: 6px; }
.slot .ov-tr { right: 10px; top: 10px; display: flex; gap: 6px; }
.slot .ov .btn { --bg: rgb(12 14 20 / .6); color: #fff; box-shadow: inset 0 0 0 .5px rgb(255 255 255 / .25); }
.slot .ov .btn:hover { --bg: rgb(12 14 20 / .78); }
.slot .ov-title { font-family: var(--font-d); font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.slot .ov-sub { font-size: 11.5px; color: rgb(255 255 255 / .75); font-weight: 520; }
.slot .hover-only { opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .5s var(--spring); }
.slot:hover .hover-only, .slot:focus-within .hover-only { opacity: 1; transform: none; }
@media (hover: none) { .slot .hover-only { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ app shell */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 12px; height: calc(100vh - 24px); margin: 12px 0 12px 12px; padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; z-index: 30; border-radius: 30px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 14px; }
.brand .logo { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: none;
  background: radial-gradient(circle at 30% 25%, rgb(255 255 255 / .55), transparent 50%), linear-gradient(145deg, #5e5ce6, #0a84ff 55%, #40c8e0);
  box-shadow: inset 0 0 0 .5px rgb(255 255 255 / .4), 0 6px 16px -5px rgb(10 132 255 / .9); }
.brand b { display: block; font-family: var(--font-d); font-size: 16px; font-weight: 720; letter-spacing: -.02em; }
.brand small { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 540; }
.search-btn { display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 10px; margin: 0 0 10px; border: 0; border-radius: 12px; cursor: pointer; color: var(--ink-3); background: var(--well); box-shadow: inset 0 0 0 1px var(--well-line); font-size: 13px; text-align: left; }
.search-btn:hover { color: var(--ink-2); }
.search-btn .kbd { margin-left: auto; white-space: nowrap; }
.search-btn > span:nth-child(2) { white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.nav-label { font-size: 10.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .09em; padding: 12px 10px 5px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 8px; border-radius: 13px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 13.5px; transition: background .2s, color .2s; }
.nav a:hover { background: var(--fill); color: var(--ink); }
.nav a.sel { background: var(--lens-bg); color: var(--ink); box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), 0 2px 10px -3px rgb(0 0 0 / .35); }
.nav a .tile { width: 26px; height: 26px; border-radius: 8px; } .nav a .tile .i { width: 14px; height: 14px; }
.nav a .badge, .nav a .chip { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.sys { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 16px; background: var(--well); box-shadow: inset 0 0 0 1px var(--well-line); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.sys .dots { display: flex; gap: 4px; }

.main { min-width: 0; padding: 12px 24px 60px 22px; }
.topbar { position: sticky; top: 12px; z-index: 25; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 10px 10px 22px; margin-bottom: 22px; border-radius: 24px; transition: background .3s; }
.topbar .titles { min-width: 0; flex: 1; }
.topbar .titles .h1 { font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .titles .sub { font-size: 12.5px; color: var(--ink-3); font-weight: 520; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .clock { font-weight: 620; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The island sits at the centre of the window, over the top bar. Below ~1560 px the right-hand
   cluster (Home/Away, Door, weather, clock, buttons) would reach under the 360 px ring island, so
   it sheds text step by step: clock, weather label, Door chip words, Home/Away words, theme button
   (Settings has it too). Breakpoints are measured: cluster left edge >= centre + 188 px. */
@media (max-width: 1540px) and (min-width: 761px) { .topbar .clock { display: none; } }
@media (max-width: 1260px) and (min-width: 761px) { .topbar .wx-chip .wx-l { display: none; } }
@media (max-width: 1150px) { #call-chip > span:not(.dot) { display: none; } #call-chip { padding: 0 9px; } #call-chip.ring { padding: 0 7px; } }
@media (max-width: 1030px) and (min-width: 761px) { .topbar .md-btn span { display: none; } .topbar .md-btn { width: 30px; padding: 0; } }
@media (max-width: 940px) and (min-width: 761px) { #theme-btn { display: none; } }
.view { display: none; }
.view.on { display: block; animation: page-rise .46s var(--ease) backwards; }
@keyframes page-rise { from { transform: translateY(14px) scale(.992); } }   /* no opacity: it would suspend the glass blur */
.stagger > * { animation: item-rise .6s var(--ease) backwards; }
.stagger > :nth-child(2) { animation-delay: 45ms; } .stagger > :nth-child(3) { animation-delay: 90ms; }
.stagger > :nth-child(4) { animation-delay: 135ms; } .stagger > :nth-child(5) { animation-delay: 180ms; } .stagger > :nth-child(n+6) { animation-delay: 220ms; }
@keyframes item-rise { from { transform: translateY(16px); } }

/* phone: floating tab bar instead of the sidebar */
.tabbar { display: none; }
@media (max-width: 1100px) { :root { --sidebar-w: 84px; } .sidebar .brand > div, .nav a > span:not(.tile), .nav-label, .search-btn > span, .search-btn .kbd, .sys > span:not(.dots) { display: none; }
  .nav a { justify-content: center; padding: 0; } .search-btn { justify-content: center; } .brand { justify-content: center; } .nav a .badge { position: absolute; top: 2px; right: 6px; } }
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main { padding: 10px 14px 110px; }
  .topbar { top: 8px; padding: 8px 8px 8px 16px; min-height: 56px; margin-bottom: 16px; }
  .topbar .titles .h1 { font-size: 20px; } .topbar .clock { display: none; }
  /* the page name must stay readable: no subtitle, icon-only chips (mode.js does Home/Away) */
  .topbar { gap: 8px; } .topbar .titles { min-width: 120px; } .topbar .titles .sub { display: none; }
  .topbar .wx-chip .num { display: none; }
  .tabbar { display: flex; position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); height: 66px; padding: 6px; border-radius: 30px; justify-content: space-around; }
  .tabbar a { flex: 1; display: grid; justify-items: center; align-content: center; gap: 3px; border-radius: 22px; color: var(--ink-3); text-decoration: none; font-size: 10.5px; font-weight: 650; position: relative; }
  .tabbar a.sel { color: var(--accent); background: var(--lens-bg); }
  .tabbar a .i { width: 22px; height: 22px; }
  .tabbar a .badge { position: absolute; top: 4px; right: calc(50% - 22px); }
}

/* ------------------------------------------------------------ Dynamic Island */
.island { position: fixed; z-index: 90; left: 50%; top: 10px; height: 36px; width: 200px; transform: translateX(-50%); background: #000; color: #fff; border-radius: 22px; overflow: hidden; cursor: default;
  box-shadow: 0 0 0 .5px rgb(255 255 255 / .14), 0 14px 34px -8px rgb(0 0 0 / .7); transition: width .55s var(--spring), height .55s var(--spring), border-radius .55s var(--spring), top .4s var(--ease); }
.island > div { position: absolute; inset: 0; display: flex; align-items: center; gap: 9px; padding: 0 15px; white-space: nowrap; opacity: 0; transform: scale(.92); transition: opacity .25s, transform .45s var(--spring); pointer-events: none; }
.island[data-state="compact"] .isl-compact, .island[data-state="msg"] .isl-msg, .island[data-state="ring"] .isl-ring { opacity: 1; transform: none; pointer-events: auto; transition-delay: .12s; }
.island[data-state="ring"] { height: 68px; border-radius: 32px; }
.isl-compact { justify-content: center; font-size: 12px; font-weight: 620; color: rgb(255 255 255 / .86); }
.isl-compact .dots { display: flex; gap: 4px; }
.isl-msg { font-size: 13px; font-weight: 620; }
.isl-msg .i { width: 17px; height: 17px; }
.isl-ring { padding: 0 10px 0 12px !important; gap: 12px !important; }
.isl-ring .bell { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #241a00;
  background: radial-gradient(circle at 35% 30%, #fff6b0, var(--warn) 55%, #ff9f0a); }
.island[data-state="ring"] .isl-ring .bell { animation: wiggle 1s var(--spring) infinite; }
.isl-ring .bell .i { width: 22px; height: 22px; }
@keyframes wiggle { 0%,60%,100% { transform: rotate(0); } 10%,30% { transform: rotate(-14deg); } 20%,40% { transform: rotate(14deg); } }
.isl-ring b { display: block; font-size: 14px; } .isl-ring small { color: rgb(255 255 255 / .62); font-size: 12px; }
.isl-ring .btn { margin-left: auto; }
@media (max-width: 760px) { .island { top: 6px; } .island:not([data-state="ring"]):not([data-state="msg"]), .island:not([data-state="ring"]):not([data-state="msg"]) * { opacity: 0; pointer-events: none !important; } }

/* ------------------------------------------------------------ popovers, modals, sheets */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgb(0 0 0 / .35); opacity: 0; pointer-events: none; transition: opacity .3s;
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); }
.scrim.on { opacity: 1; pointer-events: auto; }
.modal { position: fixed; z-index: 85; left: 50%; top: 50%; width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 22px;
  transform: translate(-50%, -50%) scale(.94); opacity: 0; pointer-events: none; transition: opacity .25s, transform .5s var(--spring); }
.modal.on { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.modal.wide { width: min(1500px, calc(100vw - 32px)); padding: 10px; }
.alert-ico { margin: 4px auto 14px; }
.modal .alert-title { text-align: center; font-family: var(--font-d); font-size: 18px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
.modal .alert-body { text-align: center; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; margin: 0 0 18px; }
.modal .alert-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu-in { animation: menu-pop .26s var(--spring) backwards; transform-origin: var(--menu-origin, top center); }
@keyframes menu-pop { from { transform: scale(.94); opacity: 0; } }

/* command palette */
.palette { position: fixed; z-index: 86; left: 50%; top: 14vh; width: min(640px, calc(100vw - 28px)); transform: translateX(-50%) scale(.96); opacity: 0; pointer-events: none; transition: opacity .2s, transform .45s var(--spring); }
.palette.on { opacity: 1; pointer-events: auto; transform: translateX(-50%); }
.palette .p-in { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 60px; border-bottom: 1px solid var(--hair); }
.palette .p-in .i { width: 20px; height: 20px; color: var(--ink-3); }
.palette .p-in input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 18px; font-weight: 500; }
.palette .p-in input::placeholder { color: var(--ink-3); }
.palette .p-list { max-height: min(56vh, 460px); overflow: auto; padding: 8px; }
.palette .p-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 13px; cursor: pointer; }
.palette .p-item.sel { background: rgb(var(--accent-rgb) / .9); color: #fff; }
.palette .p-item.sel .faint, .palette .p-item.sel .kbd { color: rgb(255 255 255 / .8); }
.palette .p-item .p-t { flex: 1; min-width: 0; } .palette .p-item .p-t b { display: block; font-weight: 600; font-size: 14px; }
.palette .p-item .p-t span { display: block; font-size: 12px; }
.palette .p-foot { display: flex; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--hair); font-size: 11.5px; color: var(--ink-3); }

/* ------------------------------------------------------------ misc shared widgets */
.hero-clock { font-family: var(--font-d); font-size: clamp(64px, 8vw, 128px); font-weight: 250; letter-spacing: -.045em; line-height: .92; font-variant-numeric: tabular-nums;
  color: #fff; filter: drop-shadow(0 2px 18px rgb(0 0 0 / var(--hero-sh))); }
.hero-clock small { font-size: .22em; letter-spacing: 0; font-weight: 500; margin-left: .2em; }
.on-wall { color: #fff; text-shadow: 0 2px 22px rgb(0 0 0 / calc(var(--hero-sh) + .05)), 0 1px 3px rgb(0 0 0 / calc(var(--hero-sh) * .9)); }
:root[data-theme="light"] .on-wall { color: var(--ink); text-shadow: 0 1px 14px rgb(255 255 255 / .9), 0 0 2px rgb(255 255 255 / .7); }
:root[data-theme="light"] .on-wall .hero-clock { color: #111a33; filter: drop-shadow(0 2px 18px rgb(255 255 255 / .75)); }
.gauge { transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-linecap: round; }
.gauge .track { stroke: var(--ink-4); opacity: .5; }
.gauge .val { transition: stroke-dasharray .9s var(--ease); }
.wave { display: inline-flex; align-items: center; gap: 2.5px; height: 18px; }
.wave i { width: 3px; height: 4px; border-radius: 2px; background: currentColor; }
.wave.on i { animation: wv .9s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: -.15s !important; } .wave i:nth-child(3) { animation-delay: -.3s !important; }
.wave i:nth-child(4) { animation-delay: -.45s !important; } .wave i:nth-child(5) { animation-delay: -.6s !important; }
@keyframes wv { 50% { height: 17px; } }
.caret::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--accent); animation: blink .9s infinite; }
.ai-glow { position: relative; }
.ai-glow::before, .ai-glow::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .5s;
  background: conic-gradient(from var(--a), #0a84ff, #5e5ce6, #bf5af2, #ff375f, #ff9f0a, #ffd60a, #30d158, #40c8e0, #0a84ff); }
.ai-glow.thinking::before, .ai-glow.thinking::after, .ai-glow:focus-within::before { animation: turn 2.4s linear infinite; }
.ai-glow::before { padding: 2px; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.ai-glow::after { z-index: -1; filter: blur(16px); }
.ai-glow:focus-within::before { opacity: .5; }
.ai-glow.thinking::before { opacity: 1; } .ai-glow.thinking::after { opacity: .7; }
@keyframes turn { to { --a: 360deg; } }
.bubble { max-width: 82%; padding: 9px 13px; border-radius: 19px; font-size: 13.5px; line-height: 1.45; animation: pop .5s var(--spring) backwards; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble small { display: block; font-size: 10.5px; font-weight: 680; opacity: .7; margin-bottom: 2px; }
.bubble.me { align-self: flex-end; color: #fff; background: linear-gradient(180deg, rgb(var(--accent-rgb) / .85), rgb(var(--accent-rgb))); border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: var(--fill-2); box-shadow: inset 0 0 0 1px var(--hair); border-bottom-left-radius: 6px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.9); } }
.tip { position: relative; }
.tip[data-tip]:hover::after { content: attr(data-tip); position: absolute; z-index: 50; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 6px 10px; border-radius: 9px; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; color: #fff; background: rgb(20 22 30 / .92); box-shadow: 0 6px 20px rgb(0 0 0 / .35); pointer-events: none; }

html.idle .view *, html.idle .view *::before, html.idle .view *::after { animation-play-state: paused !important; }
html.idle body.ringing .view * { animation-play-state: running !important; }

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