/* ============================================================
   CENTER — Whole-Home Console (concept)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0e13;
  --bg-2:      #0d1218;
  --panel:     #121922;
  --panel-2:   #16202b;
  --line:      rgba(255,255,255,.07);
  --line-2:    rgba(255,255,255,.12);
  --text:      #e8eef4;
  --muted:     #8b99a8;
  --faint:     #5b6877;
  --accent:    #29d3e6;
  --accent-2:  #1aa8c4;
  --green:     #34d399;
  --amber:     #fbbf24;
  --red:       #f87171;
  --violet:    #a78bfa;
  --blue:      #60a5fa;
  --orange:    #fb923c;
  --pink:      #f472b6;
  --radius:    16px;
  --radius-s:  10px;
  --sidebar-w: 236px;
  --topbar-h:  64px;
  font-size: 15px;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body::before { /* ambient glow */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(41,211,230,.07), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(167,139,250,.05), transparent 60%);
}

#app { display: flex; height: 100vh; position: relative; z-index: 1; }

/* ---------------- Sidebar ---------------- */
#sidebar {
  width: var(--sidebar-w); flex: none; height: 100%;
  background: linear-gradient(180deg, #0c1117, #0a0e13);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 18px 14px;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--accent), #7c5cfc);
  display: grid; place-items: center;
  box-shadow: 0 4px 18px rgba(41,211,230,.35);
}
.brand-mark svg { width: 21px; height: 21px; color: #06141a; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .12em; }
.brand-sub  { font-size: 10.5px; color: var(--muted); letter-spacing: .04em; margin-top: 1px; }

.nav-section { padding: 12px 12px 2px; }
.nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: .14em;
  color: var(--faint); padding: 6px 10px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 8.5px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted);
  font: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-align: left; position: relative;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.045); color: var(--text); }
.nav-item.active { background: rgba(41,211,230,.10); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item .nav-pill {
  margin-left: auto; font-size: 10px; font-weight: 700;
  background: rgba(248,113,113,.16); color: var(--red);
  border-radius: 99px; padding: 1.5px 7px;
}
.sidebar-foot {
  margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--faint); line-height: 1.6;
}
.sidebar-foot b { color: var(--muted); font-weight: 600; }

/* ---------------- Shell / Topbar ---------------- */
#shell { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(10,14,19,.75); backdrop-filter: blur(10px);
}
.tb-title { font-size: 16.5px; font-weight: 650; }
.tb-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tb-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 99px; padding: 7px 13px;
  font-size: 12.5px; color: var(--muted); white-space: nowrap;
}
.tb-chip svg { width: 15px; height: 15px; }
.tb-chip b { color: var(--text); font-weight: 600; }
.tb-chip.ok svg { color: var(--green); }
.tb-clock { font-variant-numeric: tabular-nums; }
.tb-bell { position: relative; }
.tb-bell .dot {
  position: absolute; top: 4px; right: 8px; width: 7px; height: 7px;
  background: var(--red); border-radius: 50%;
  box-shadow: 0 0 0 2.5px var(--bg);
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted); cursor: pointer;
  display: grid; place-items: center; transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.icon-btn svg { width: 17px; height: 17px; }

/* notifications dropdown */
#notif-pop {
  position: absolute; top: 56px; right: 24px; width: 360px; z-index: 60;
  background: var(--panel-2); border: 1px solid var(--line-2);
  border-radius: var(--radius); box-shadow: 0 18px 50px rgba(0,0,0,.55);
  overflow: hidden; display: none;
}
#notif-pop.open { display: block; animation: pop .16s ease; }
#notif-pop .np-head { padding: 13px 16px; font-weight: 650; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.np-item { display: flex; gap: 11px; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.np-item:last-child { border-bottom: 0; }
.np-item .np-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.np-item .np-ico svg { width: 15px; height: 15px; }
.np-item .np-t { color: var(--text); line-height: 1.45; }
.np-item .np-time { color: var(--faint); font-size: 11px; margin-top: 2px; }

/* ---------------- Main page ---------------- */
#page { flex: 1; overflow-y: auto; padding: 24px; scroll-behavior: smooth; }
.page-head { margin-bottom: 18px; display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head .ph-actions { margin-left: auto; display: flex; gap: 8px; }

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-auto   { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.g-auto-s { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 1200px) { .g-3, .g-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 800px)  { .g-2, .g-3, .g-4 { grid-template-columns: 1fr; } .span-2 { grid-column: span 1; } }

/* ---------------- Cards ---------------- */
.card {
  background: linear-gradient(180deg, #131b25, #101620);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  transition: border-color .2s, transform .15s;
}
.card.click { cursor: pointer; }
.card.click:hover { border-color: var(--line-2); transform: translateY(-1px); }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-h .c-ico {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
}
.card-h .c-ico svg { width: 17px; height: 17px; }
.card-h .c-t { font-size: 14px; font-weight: 650; }
.card-h .c-s { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.card-h .c-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.tint-cyan   { background: rgba(41,211,230,.13);  color: var(--accent); }
.tint-green  { background: rgba(52,211,153,.13);  color: var(--green); }
.tint-amber  { background: rgba(251,191,36,.13);  color: var(--amber); }
.tint-red    { background: rgba(248,113,113,.13); color: var(--red); }
.tint-violet { background: rgba(167,139,250,.13); color: var(--violet); }
.tint-blue   { background: rgba(96,165,250,.13);  color: var(--blue); }
.tint-orange { background: rgba(251,146,60,.13);  color: var(--orange); }
.tint-pink   { background: rgba(244,114,182,.13); color: var(--pink); }

.stat-big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-big small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat-cap { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kv { display: flex; justify-content: space-between; font-size: 12.5px; padding: 6.5px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }

/* badges / chips */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 650; letter-spacing: .02em;
  border-radius: 99px; padding: 3.5px 10px;
}
.badge .b-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok    { background: rgba(52,211,153,.13);  color: var(--green); }
.badge.warn  { background: rgba(251,191,36,.13);  color: var(--amber); }
.badge.bad   { background: rgba(248,113,113,.14); color: var(--red); }
.badge.idle  { background: rgba(139,153,168,.13); color: var(--muted); }
.badge.info  { background: rgba(96,165,250,.13);  color: var(--blue); }
.badge.live  { background: rgba(248,113,113,.16); color: var(--red); }
.badge.live .b-dot { animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* buttons */
.btn {
  font: inherit; font-size: 12.5px; font-weight: 600;
  border-radius: 10px; padding: 8px 14px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn:hover { background: #1b2733; }
.btn:active { transform: scale(.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #04181d;
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: rgba(248,113,113,.13); border-color: rgba(248,113,113,.3); color: var(--red); }
.btn.sm { padding: 5.5px 10px; font-size: 11.5px; border-radius: 8px; }
.btn.block { width: 100%; justify-content: center; }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 11.5px; font-weight: 600; color: var(--muted);
  background: transparent; border: 1px solid var(--line-2);
  border-radius: 99px; padding: 5px 12px; cursor: pointer;
  transition: all .15s;
}
.chip:hover { color: var(--text); }
.chip.active { background: rgba(41,211,230,.13); border-color: rgba(41,211,230,.45); color: var(--accent); }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .sl {
  position: absolute; inset: 0; cursor: pointer; border-radius: 99px;
  background: #25303d; transition: background .18s;
}
.switch .sl::before {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  left: 3px; top: 3px; background: #9aa8b6; transition: transform .18s, background .18s;
}
.switch input:checked + .sl { background: var(--accent-2); }
.switch input:checked + .sl::before { transform: translateX(18px); background: #fff; }

/* range slider */
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px;
  background: transparent; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 5px; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent) var(--fill,50%), #25303d var(--fill,50%));
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; margin-top: -5px; box-shadow: 0 1px 6px rgba(0,0,0,.5);
}
input[type=range].warm::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #ffb45e, #fff3e0, #bcd9ff);
}

/* progress bars */
.bar { height: 7px; border-radius: 99px; background: #1d2733; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 99px; background: var(--accent); transition: width .6s ease; }
.bar.thin { height: 5px; }

/* generic row list */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.row:last-child { border-bottom: 0; }
.row .r-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.row .r-ico svg { width: 15px; height: 15px; }
.row .r-main { min-width: 0; flex: 1; }
.row .r-t { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r-s { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.row .r-end { margin-left: auto; text-align: right; flex: none; display: flex; align-items: center; gap: 10px; }
.row .r-val { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 13px; }

/* ---------------- Scenes ---------------- */
.scene-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.scene-btn {
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
  background: linear-gradient(180deg, #141d28, #101723);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 9px;
  transition: border-color .15s, transform .12s;
}
.scene-btn:hover { border-color: var(--line-2); transform: translateY(-1px); }
.scene-btn:active { transform: scale(.98); }
.scene-btn .s-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.scene-btn .s-ico svg { width: 16px; height: 16px; }
.scene-btn .s-t { font-size: 13px; font-weight: 650; }
.scene-btn .s-s { font-size: 11px; color: var(--muted); margin-top: -5px; }

/* ---------------- Home hero ---------------- */
.hero {
  border-radius: var(--radius); border: 1px solid var(--line);
  background:
    radial-gradient(600px 200px at 15% 0%, rgba(41,211,230,.12), transparent 60%),
    linear-gradient(180deg, #141d28, #0f1620);
  padding: 22px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.hero h2 { font-size: 22px; font-weight: 700; }
.hero p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.hero .h-stats { margin-left: auto; display: flex; gap: 28px; flex-wrap: wrap; }
.hero .h-stat .v { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero .h-stat .v small { font-size: 12px; color: var(--muted); font-weight: 500; }
.hero .h-stat .k { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------------- Power flow diagram ---------------- */
.flow-wrap svg { width: 100%; height: auto; display: block; }
.flow-node-label { font-size: 11px; fill: var(--muted); }
.flow-node-val { font-size: 14px; font-weight: 700; fill: var(--text); }
.flow-line { stroke-width: 2; fill: none; stroke-dasharray: 6 7; animation: flowdash 1.1s linear infinite; }
.flow-line.rev { animation-direction: reverse; }
.flow-line.off { animation: none; stroke: #243140 !important; stroke-dasharray: 2 5; }
@keyframes flowdash { to { stroke-dashoffset: -13; } }

/* battery ring */
.ring-wrap { display: flex; align-items: center; gap: 18px; }
.ring { transform: rotate(-90deg); }
.ring .ring-bg { stroke: #1d2733; }
.ring .ring-fg { stroke: var(--green); stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; }
.ring-holder { position: relative; flex: none; }

/* ---------------- Cameras ---------------- */
.cam-tile {
  position: relative; border-radius: 13px; overflow: hidden;
  aspect-ratio: 16/9; border: 1px solid var(--line); cursor: pointer;
  transition: border-color .15s, transform .12s;
}
.cam-tile:hover { border-color: var(--line-2); transform: translateY(-1px); }
.cam-tile.selected { border-color: rgba(41,211,230,.6); box-shadow: 0 0 0 2px rgba(41,211,230,.25); }
.cam-bg { position: absolute; inset: 0; }
.cam-scan {
  position: absolute; inset: 0; opacity: .14; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.09) 0 1px, transparent 1px 3px);
}
.cam-vig { position: absolute; inset: 0; background: radial-gradient(120% 100% at 50% 40%, transparent 55%, rgba(0,0,0,.55)); }
.cam-osd {
  position: absolute; inset: 0; padding: 10px 12px;
  display: flex; flex-direction: column; justify-content: space-between;
  font-size: 11px; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.cam-osd .top, .cam-osd .bot { display: flex; justify-content: space-between; align-items: center; }
.cam-osd .ts { font-variant-numeric: tabular-nums; font-size: 10.5px; opacity: .85; font-family: Consolas, monospace; }
.cam-main { aspect-ratio: 16/8.2; border-radius: var(--radius); }
.cam-main .cam-osd { padding: 14px 16px; font-size: 13px; }

/* clip rows */
.clip-thumb { width: 74px; height: 44px; border-radius: 8px; flex: none; position: relative; overflow: hidden; }
.clip-thumb .dur {
  position: absolute; right: 4px; bottom: 4px; font-size: 9.5px; font-weight: 700;
  background: rgba(0,0,0,.65); border-radius: 5px; padding: 1px 5px;
}
.clip-thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center; color: #fff; opacity: .9;
}
.clip-thumb .play svg { width: 16px; height: 16px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.7)); }

/* ---------------- Thermostat ---------------- */
.thermo { display: flex; align-items: center; gap: 16px; }
.thermo .t-cur { font-size: 36px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.thermo .t-cur small { font-size: 15px; color: var(--muted); font-weight: 500; }
.thermo .t-set { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.t-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font-size: 17px; font-weight: 600;
  cursor: pointer; display: grid; place-items: center; transition: all .12s;
}
.t-btn:hover { background: #1c2835; border-color: var(--accent-2); }
.t-btn:active { transform: scale(.92); }
.t-target { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 42px; text-align: center; }
.t-target small { display: block; font-size: 9.5px; color: var(--faint); font-weight: 600; letter-spacing: .08em; }
.mode-heat { color: var(--orange); } .mode-cool { color: var(--blue); }
.mode-auto { color: var(--green); }  .mode-off { color: var(--muted); }

/* ---------------- Audio ---------------- */
.art {
  width: 52px; height: 52px; border-radius: 10px; flex: none; position: relative; overflow: hidden;
  display: grid; place-items: center; color: rgba(255,255,255,.9);
}
.art svg { width: 20px; height: 20px; }
.eq { display: flex; align-items: flex-end; gap: 2.5px; height: 14px; }
.eq i { width: 3px; border-radius: 2px; background: var(--accent); animation: eqb 1s ease-in-out infinite; }
.eq i:nth-child(1) { height: 60%; animation-delay: 0s; }
.eq i:nth-child(2) { height: 100%; animation-delay: .25s; }
.eq i:nth-child(3) { height: 45%; animation-delay: .5s; }
.eq i:nth-child(4) { height: 80%; animation-delay: .12s; }
@keyframes eqb { 0%,100% { transform: scaleY(.4);} 50% { transform: scaleY(1);} }
.eq.paused i { animation: none; transform: scaleY(.3); background: var(--faint); }

/* ---------------- Misc widgets ---------------- */
.gauge-flow { font-family: Consolas, monospace; }

.tank { width: 64px; height: 96px; border-radius: 10px; border: 1.5px solid var(--line-2);
  position: relative; overflow: hidden; flex: none; background: #121b25; }
.tank .water {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(96,165,250,.75), rgba(41,131,226,.85));
  transition: height .8s ease;
}
.tank .water::before {
  content: ""; position: absolute; top: -4px; left: -20%; width: 140%; height: 8px;
  background: rgba(255,255,255,.18); border-radius: 50%;
}
.tank .pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.6); }

.soc-bar { height: 12px; border-radius: 99px; background: #1d2733; overflow: hidden; position: relative; }
.soc-bar .fill { height: 100%; border-radius: 99px; transition: width .7s; }
.soc-bar .fill.charging::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { from { transform: translateX(-100%);} to { transform: translateX(100%);} }

/* circuit bars */
.circ .bar { margin-top: 6px; }
.circ-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px; }
@media (max-width: 900px) { .circ-grid { grid-template-columns: 1fr; } }

/* coffee */
.coffee-hero { display: flex; gap: 20px; align-items: center; }
.coffee-cup {
  width: 84px; height: 84px; border-radius: 20px; flex: none;
  background: rgba(251,146,60,.12); display: grid; place-items: center; position: relative;
}
.coffee-cup svg { width: 38px; height: 38px; color: var(--orange); }
.steam { position: absolute; top: 8px; display: flex; gap: 5px; opacity: 0; }
.steam i { width: 3px; height: 14px; border-radius: 3px; background: rgba(255,255,255,.4); animation: steam 1.6s ease-in-out infinite; }
.steam i:nth-child(2) { animation-delay: .4s; } .steam i:nth-child(3) { animation-delay: .8s; }
.brewing .steam { opacity: 1; }
@keyframes steam { 0% { transform: translateY(4px) scaleY(.6); opacity: 0;} 50% { opacity: 1;} 100% { transform: translateY(-6px) scaleY(1.1); opacity: 0;} }

/* intercom */
.station {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 12px; text-align: center;
}
.station .st-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; }
.station .st-ico svg { width: 21px; height: 21px; }
.station.calling .st-ico { animation: pulse-ring 1.2s ease-out infinite; }
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(41,211,230,.45); }
  100% { box-shadow: 0 0 0 14px rgba(41,211,230,0); }
}

/* security sensor dots */
.sensor-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sensor-dot.closed { background: var(--green); }
.sensor-dot.open { background: var(--red); box-shadow: 0 0 0 4px rgba(248,113,113,.15); animation: blink 1.6s infinite; }

/* arm mode selector */
.arm-seg { display: flex; background: #121a24; border: 1px solid var(--line-2); border-radius: 12px; padding: 4px; gap: 4px; }
.arm-seg button {
  flex: 1; font: inherit; font-size: 12.5px; font-weight: 650; padding: 9px 0;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer;
  transition: all .15s;
}
.arm-seg button.active.off  { background: rgba(139,153,168,.18); color: var(--text); }
.arm-seg button.active.home { background: rgba(41,211,230,.16); color: var(--accent); }
.arm-seg button.active.away { background: rgba(248,113,113,.16); color: var(--red); }

/* sparkline charts */
.spark { display: block; }
.chart-caption { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); margin-top: 4px; }

/* ---------------- Modal ---------------- */
#modal-root .overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(4,7,10,.7); backdrop-filter: blur(6px); animation: fade .15s ease;
}
.modal {
  width: min(860px, 92vw); background: var(--panel-2);
  border: 1px solid var(--line-2); border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: pop .18s ease;
}
.modal .m-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 650; font-size: 14px; }
.modal .m-head .x { margin-left: auto; }
.modal .m-body { padding: 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }

.player { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; }
.player .p-controls {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
  display: flex; align-items: center; gap: 12px;
}
.player .p-track { flex: 1; height: 4px; border-radius: 99px; background: rgba(255,255,255,.25); overflow: hidden; }
.player .p-track .p-fill { height: 100%; background: var(--accent); width: 0%; }
.player .p-time { font-size: 11px; font-variant-numeric: tabular-nums; font-family: Consolas, monospace; }
.play-big {
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.95); color: #0a0e13; display: grid; place-items: center;
}
.play-big svg { width: 17px; height: 17px; }

/* ---------------- Toasts ---------------- */
#toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: #1a2530; border: 1px solid var(--line-2);
  border-radius: 12px; padding: 11px 16px; font-size: 12.5px; font-weight: 550;
  box-shadow: 0 12px 36px rgba(0,0,0,.5);
  animation: toast-in .22s ease;
}
.toast svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.toast.out { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #232f3c; border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 12px; } .xs { font-size: 11px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.right { margin-left: auto; }
.tnum { font-variant-numeric: tabular-nums; }
.w600 { font-weight: 600; } .w700 { font-weight: 700; }
