:root {
  --bg-dark: #0d1520;
  --bg-content: #070b11;
  --bg-green: #16273c;
  --line: rgba(255, 255, 255, 0.10);
  --line2: rgba(255, 255, 255, 0.06);
  --blue: #7cc0ff;
  --blue-soft: rgba(124, 192, 255, 0.12);
  --green-soft: rgba(53, 208, 122, 0.13);
  --gold: #ffd58a;
  --gold-light: #ffe3b0;
  --amber: #f5a623;
  --ivory: #eef3fb;
  --muted: #9fb0c8;
  --dim: #6b7c95;
  --good: #35d07a;
  --warn: #ffcf6b;
  --danger: #ff8080;
  --radius: 12px;
  --head-h: 72px;
  --font-head: 'Oswald', 'Arial Narrow', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; background: var(--bg-content); color: var(--ivory); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }

.app { display: grid; grid-template-columns: 240px 1fr; height: 100vh; overflow: hidden; }

.sidebar {
  background: var(--bg-dark);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 0 0 22px;
  height: 100vh; overflow-y: auto;
}
.sidebar__logo {
  display: flex; align-items: center; gap: 11px; flex-shrink: 0;
  height: var(--head-h); padding: 0 22px;
  border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.sidebar__mark {
  width: 38px; height: 38px; border-radius: 9px; flex: 0 0 38px;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 600;
  font-size: 15px; letter-spacing: 1px; color: #08131f;
  background: linear-gradient(160deg, var(--gold-light), var(--gold));
}
.sidebar__title { font-family: var(--font-head); font-size: 17px; font-weight: 600; letter-spacing: 2px; color: var(--gold); }
.sidebar__sub { font-family: var(--font-body); font-size: 10px; color: var(--dim); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 2px; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.sidebar__link {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 8px;
  background: none; border: 0; width: 100%; cursor: pointer; text-align: left;
  font-family: var(--font-body); font-size: 15px; color: var(--muted); transition: all 0.15s;
}
.sidebar__link svg { width: 18px; height: 18px; flex: 0 0 18px; }
.sidebar__link:hover { background: var(--bg-green); color: var(--ivory); }
.sidebar__link.active { background: var(--green-soft); color: var(--good); }
.sidebar__link:focus-visible { outline: 2px solid var(--good); outline-offset: 1px; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--head-h); padding: 0 32px; background: var(--bg-dark); border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.topbar__title { font-family: var(--font-head); font-size: 24px; font-weight: 500; color: var(--ivory); }
.topbar__right { display: flex; align-items: center; gap: 12px; }
.source-pill {
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(255,213,138,0.3); color: var(--gold); background: rgba(255,213,138,0.08);
}
.sysstatus {
  font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  padding: 6px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(111,224,160,0.35); color: var(--good); background: rgba(111,224,160,0.10);
}
.sysstatus.warn { border-color: rgba(255,207,107,0.4); color: var(--warn); background: rgba(255,207,107,0.10); }
.sysstatus.err { border-color: rgba(255,128,128,0.45); color: var(--danger); background: rgba(255,128,128,0.12); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }
.clock { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.link { font-size: 12px; color: var(--dim); }
.link.on { color: var(--good); }

.content { flex: 1; min-height: 0; padding: 14px 20px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

.subbar { display: flex; gap: 6px; padding: 4px; background: var(--bg-dark); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.subbar::-webkit-scrollbar { display: none; }
.p-block[data-part="_subbar"] { min-width: 0; }
.subtab {
  flex: 1; padding: 9px 14px; border: 0; border-radius: 9px; background: transparent;
  color: var(--dim); font-family: var(--font-body); font-weight: 600; font-size: 13px;
  letter-spacing: .02em; cursor: pointer; min-height: 40px; white-space: nowrap;
}
.subtab:hover { color: var(--ivory); }
.subtab.active { background: var(--green-soft); color: var(--good); box-shadow: inset 0 0 0 1px rgba(53,208,122,0.28); }
.p-block.hidden { display: none; }
.p-block[data-part="_subbar"] > .subbar { grid-column: 1 / -1; align-self: start; }
.screen { display: none; gap: 12px; }
.screen.active { display: grid; }
.grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 900px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

.card {
  background: var(--bg-dark); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; transition: border-color 0.15s; min-width: 0;
}
.card:hover { border-color: rgba(124,192,255,0.4); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-title { display: flex; align-items: center; gap: 9px; font-family: var(--font-head); font-size: 15px; font-weight: 600; letter-spacing: 0.5px; color: var(--ivory); text-transform: uppercase; }
.card-title .ic { width: 17px; height: 17px; flex: 0 0 17px; }
.big.good { color: var(--good); }

.metric { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.metric:last-child { border-bottom: 0; }
.metric .label { color: var(--muted); flex-shrink: 0; }
.metric .value { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ivory); min-width: 0; text-align: right; overflow-wrap: anywhere; }
.value.gold { color: var(--gold); } .value.blue { color: var(--blue); }
.value.good { color: var(--good); } .value.warn { color: var(--warn); } .value.danger { color: var(--danger); }
.value.na { color: var(--dim); font-weight: 400; }

.big { font-family: var(--font-head); font-size: 34px; font-weight: 600; line-height: 1; margin: 2px 0 3px; color: var(--ivory); }
.big.blue { color: var(--blue); } .big.gold { color: var(--gold); }
.sub { font-size: 13px; color: var(--muted); }

.seg { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.seg button {
  flex: 1; min-width: 72px; min-height: 46px; border: 1px solid var(--line2); border-radius: 9px;
  background: transparent; color: var(--muted); font-family: var(--font-body);
  font-weight: 600; font-size: 14px; padding: 12px 10px; cursor: pointer; transition: all 0.15s;
}
.seg button:hover { border-color: var(--blue); color: var(--ivory); }
.seg button.active { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); box-shadow: 0 0 16px rgba(124,192,255,0.15); }
.seg button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.row { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.row label { font-size: 13px; color: var(--muted); min-width: 96px; }
input[type=range] { flex: 1; -webkit-appearance: none; appearance: none; height: 28px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.10); }
input[type=range]::-moz-range-track { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.10); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%; background: var(--blue); border: 3px solid var(--bg-dark); box-shadow: 0 0 0 1px var(--blue); }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--blue); border: 3px solid var(--bg-dark); box-shadow: 0 0 0 1px var(--blue); }

.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.chip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--bg-green);
  font-size: 13px; font-weight: 600;
}
.chip .chip-label { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .chip-state { display: flex; align-items: center; gap: 7px; flex-shrink: 0; white-space: nowrap; color: var(--ivory); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); flex: 0 0 9px; }
.chip.on .dot { background: var(--good); box-shadow: 0 0 8px var(--good); }
.chip.alarm { border-color: rgba(255,128,128,0.5); }
.chip.alarm .dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

.banner {
  margin-top: 12px; padding: 11px 13px; border-radius: 8px; font-size: 13px; font-weight: 600;
  border: 1px solid rgba(255,207,107,0.3); color: var(--warn); background: rgba(255,207,107,0.08);
}
.banner.ok { border-color: var(--line); color: var(--muted); background: var(--bg-green); }
.banner.err { border-color: rgba(255,128,128,0.4); color: var(--danger); background: rgba(255,128,128,0.10); }

.log { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; line-height: 1.7; color: #b8ccb8; white-space: pre-wrap; max-height: 340px; overflow-y: auto; }

.gauge { height: 8px; border-radius: 999px; background: var(--bg-green); overflow: hidden; margin-top: 6px; }
.gauge > i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #a9d8ff); transition: width 0.4s; }

.na-badge { font-family: var(--font-body); font-size: 10px; color: var(--dim); border: 1px solid var(--line2); border-radius: 6px; padding: 2px 7px; letter-spacing: 0.5px; }
.mini { font-size: 12px; padding: 7px 13px; border-radius: 7px; border: 1px solid var(--line2); background: transparent; color: var(--muted); cursor: pointer; }
.mini:hover { border-color: var(--blue); color: var(--blue); }
.demo .card-title { color: var(--gold-light); }
.demo-note { font-size: 12px; color: var(--dim); margin-bottom: 10px; }

.topbar__head { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin-right: auto; }
.topbar__subtitle { font-size: 13px; color: var(--good); }
.hamburger { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: 14px; flex-shrink: 0; border: 1px solid var(--line2); border-radius: 10px; background: transparent; color: var(--ivory); cursor: pointer; }
.hamburger svg { width: 22px; height: 22px; }
.hamburger:active { background: var(--bg-green); border-color: var(--good); }
.scrim { display: none; }
.topbar__subtitle.warn { color: var(--warn); }
.topbar__subtitle.err { color: var(--danger); }
.wifi { display: inline-flex; color: var(--dim); }
.wifi svg { width: 19px; height: 19px; }
.wifi.on { color: var(--good); }
.stat-mini { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--good); }
.stat-mini.warn { color: var(--warn); } .stat-mini.danger { color: var(--danger); } .stat-mini.na { color: var(--dim); }
.stat-mini #battMiniVal { color: var(--ivory); }
.stat-mini__bat { position: relative; width: 28px; height: 14px; border: 1.5px solid currentColor; border-radius: 3px; padding: 1.5px; }
.stat-mini__bat::after { content: ''; position: absolute; right: -4px; top: 3.5px; width: 2.5px; height: 5px; background: currentColor; border-radius: 0 1px 1px 0; }
.stat-mini__bat i { display: block; height: 100%; background: currentColor; border-radius: 1px; transition: width 0.5s; }

.ic { width: 18px; height: 18px; flex: 0 0 auto; }

.dash { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dash .span-all { grid-column: 1 / -1; }
.dash .span-2 { grid-column: span 2; }
.net-mini { cursor: pointer; }
.net-mini:hover { border-color: var(--line2); }
.net-go { width: 18px; height: 18px; color: var(--dim); }
.net-go .ic { width: 18px; height: 18px; }
.net-mini .net-top { margin: 0 0 8px; }
.net-q { margin-left: auto; font-size: 12px; font-weight: 600; }
.net-mini .metric-ico { margin-bottom: 6px; }

.bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.07); overflow: hidden; margin: 7px 0; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--muted); transition: width 0.5s; }
.bar.green > i { background: linear-gradient(90deg, #1f9257, var(--good)); }
.bar.blue > i { background: linear-gradient(90deg, #3f86d8, var(--blue)); }
.bar.amber > i { background: linear-gradient(90deg, #cf8618, var(--amber)); }
.bar.danger > i { background: linear-gradient(90deg, #b04a3e, var(--danger)); }

.bat-top { display: flex; align-items: center; gap: 16px; margin: 8px 0 2px; }
.bat-glyph { width: 58px; height: 31px; flex: 0 0 58px; }
.bat-pct { font-family: var(--font-head); font-size: 46px; font-weight: 600; line-height: 1; color: var(--ivory); }
.bat-pct span { font-size: 22px; color: var(--muted); margin-left: 2px; }
.bat-auto { font-family: var(--font-head); font-size: 20px; color: var(--ivory); margin-top: 8px; }
.bat-auto span { font-family: var(--font-body); font-size: 13px; color: var(--muted); margin-left: 6px; }
.tri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); }
.tri-v { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ivory); white-space: nowrap; }
.tri-l { font-size: 11px; color: var(--muted); margin-top: 3px; }

.big-temp { font-family: var(--font-head); font-size: 52px; font-weight: 600; line-height: 1; margin: 6px 0 2px; }
.metric-ico { display: flex; align-items: center; gap: 11px; margin-top: 13px; font-size: 13px; }
.metric-ico .ic, .mi-ic { width: 18px; height: 18px; flex: 0 0 18px; }
.mi-lbl { color: var(--muted); flex: 0 0 auto; min-width: 82px; }
.metric-ico .bar { flex: 1; margin: 0; }
.mi-val { flex: 0 0 auto; font-weight: 600; min-width: 66px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ivory); }
.card-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.card-foot.col { flex-direction: column; gap: 7px; }
.card-foot b { color: var(--ivory); font-weight: 600; }

.donuts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 4px; }
.donut-box { text-align: center; min-width: 0; }
.donut-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.donut-wrap { position: relative; width: 94px; margin: 0 auto; }
.donut { width: 94px; height: 94px; display: block; }
.donut-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 9; }
.donut-fg { fill: none; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 0.6s; }
.donut.blue .donut-fg { stroke: var(--blue); }
.donut.grey .donut-fg { stroke: #9fb0c8; }
.donut-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 23px; font-weight: 600; color: var(--ivory); }
.donut-center span { font-size: 14px; color: var(--muted); margin-left: 1px; }
.donut-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }

.sec-big { font-family: var(--font-head); font-size: 26px; font-weight: 600; text-align: center; margin: 8px 0 3px; }
.sub.center { text-align: center; }
.dot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; margin-top: 12px; }
.dot-row { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ivory); min-width: 0; }
.dot-row .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; background: var(--dim); }
.dot.green { background: var(--good); box-shadow: 0 0 7px rgba(53,208,122,0.55); }
.dot.red { background: var(--danger); box-shadow: 0 0 7px rgba(255,128,128,0.55); }
.dot.off { background: var(--dim); }
.subsection { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }

.net-top { display: flex; align-items: center; gap: 10px; font-size: 15px; margin: 6px 0 4px; color: var(--ivory); }
.net-bars { width: 20px; height: 20px; }
.net-traffic { margin-top: 14px; }
.btn-gold { display: block; width: 100%; margin-top: 15px; padding: 11px; border-radius: 8px; border: 1px solid var(--gold); background: rgba(255,213,138,0.06); color: var(--gold); font-family: var(--font-body); font-weight: 600; font-size: 14px; cursor: pointer; transition: all 0.15s; }
.btn-gold:hover { background: rgba(255,213,138,0.15); }

.weather { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.wx-solar { display: flex; flex-direction: column; gap: 6px; padding-right: 24px; border-right: 1px solid var(--line); }
.wx-yield { display: flex; align-items: baseline; gap: 9px; }
.wx-yield b { font-family: var(--font-head); font-size: 24px; }
.wx-yield span { font-size: 12px; color: var(--muted); }
.wx-stats { display: flex; gap: 28px; flex-wrap: wrap; flex: 1; }
.wx-stat { display: flex; align-items: center; gap: 12px; }
.wx-ic { width: 22px; height: 22px; color: var(--muted); flex: 0 0 22px; }
.wx-ic .ic { width: 22px; height: 22px; }
.wx-v { font-family: var(--font-head); font-size: 19px; font-weight: 600; color: var(--ivory); }
.wx-l { font-size: 12px; color: var(--muted); }

.flow-card { display: flex; flex-direction: column; }
.flow-wrap { position: relative; width: 100%; aspect-ratio: 300 / 196; margin-top: 2px; }
.flow-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.flow-hub { fill: rgba(255,255,255,0.04); stroke: rgba(255,255,255,0.14); stroke-width: 1.5; }
.flow-hub-ic { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; transform: translate(-50%, -50%); color: var(--amber); }
.flow-hub-ic .ic { width: 24px; height: 24px; }
.flow-node { position: absolute; transform: translate(-50%, -50%); text-align: center; width: 108px; }
.n-sun { left: 16%; top: 20%; } .n-grid { left: 84%; top: 20%; }
.n-load { left: 50%; top: 73%; } .n-batt { left: 50%; top: 93%; }
.fn-lbl { font-size: 11px; color: var(--muted); }
.fn-line { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 3px; }
.fn-ic { width: 19px; height: 19px; flex: 0 0 19px; color: var(--muted); }
.fn-ic .ic { width: 19px; height: 19px; }
.fn-val { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ivory); white-space: nowrap; }
.flow { fill: none; stroke: var(--dim); stroke-width: 2.5; stroke-linecap: round; opacity: 0.3; }
.flow.on { opacity: 1; stroke-dasharray: 5 9; animation: flowdash 1s linear infinite; }
.flow.rev { animation-direction: reverse; }
.flow.c-amber { stroke: var(--amber); } .flow.c-blue { stroke: var(--blue); }
.flow.c-green { stroke: var(--good); } .flow.c-ivory { stroke: var(--ivory); }
@keyframes flowdash { to { stroke-dashoffset: -14; } }

.soon .sub { color: var(--muted); line-height: 1.6; }


@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .hamburger { display: flex; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 268px; height: 100vh; transform: translateX(-100%); transition: transform 0.25s ease; z-index: 60; box-shadow: 0 18px 50px rgba(0,0,0,0.55); }
  .app.nav-open .sidebar { transform: translateX(0); }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5); opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 55; }
  .app.nav-open .scrim { opacity: 1; pointer-events: auto; }
}
@media (max-width: 680px) {
  .dash { grid-template-columns: 1fr; }
  .content { padding: 18px 16px; }
  .topbar { padding: 0 16px; }
  .wx-solar { border-right: 0; padding-right: 0; }
}

.content.flush { padding: 0; overflow: hidden; }
.map-screen { display: none; }
.map-screen.active { display: block; position: relative; height: 100%; }
.leaflet-host { position: absolute; inset: 0; z-index: 1; }
.leaflet-container { background: #0a0e14; font-family: var(--font-body); }
.leaflet-container a { color: var(--blue); }
.leaflet-top.leaflet-left { top: 82px; left: 16px; }
.leaflet-bar { border: 0; box-shadow: 0 8px 24px rgba(0,0,0,0.45); overflow: hidden; border-radius: 10px; }
.leaflet-bar a, .leaflet-bar a:hover { width: 44px; height: 44px; line-height: 44px; background: rgba(13,21,32,0.94); color: var(--ivory); border-bottom: 1px solid var(--line); font-size: 20px; }
.leaflet-bar a:last-child { border-bottom: 0; }
.leaflet-control-attribution { background: rgba(10,14,20,0.8) !important; color: var(--muted) !important; font-size: 10px; }
.leaflet-bottom.leaflet-right { bottom: 56px; }

.map-search { position: absolute; top: 16px; left: 16px; z-index: 620; display: flex; align-items: center; gap: 10px; width: min(420px, calc(100% - 32px)); height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(13,21,32,0.94); box-shadow: 0 8px 24px rgba(0,0,0,0.45); }
.map-search .ic { width: 20px; height: 20px; color: var(--muted); }
.map-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--ivory); font-family: var(--font-body); font-size: 15px; }
.map-search input::placeholder { color: var(--muted); }
.map-locate { position: absolute; top: 180px; left: 16px; z-index: 620; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--line); background: rgba(13,21,32,0.94); color: var(--ivory); cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,0.45); }
.map-locate svg { width: 22px; height: 22px; }

.poi-pin { background: none; border: 0; }
.poi-pin__dot { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.85); box-shadow: 0 2px 6px rgba(0,0,0,0.5); }
.poi-pin__dot svg { width: 17px; height: 17px; }
.me-pin { background: none; border: 0; }
.me-dot { display: block; width: 16px; height: 16px; border-radius: 50%; background: #4a9eff; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(74,158,255,0.22), 0 0 12px rgba(74,158,255,0.7); }

.map-filters { position: absolute; left: 0; right: 0; bottom: 0; z-index: 620; display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; background: linear-gradient(180deg, transparent, rgba(7,11,17,0.9) 45%); }
.map-filters::-webkit-scrollbar { height: 0; }
.map-chip { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; height: 40px; padding: 0 14px 0 8px; border-radius: 999px; border: 1px solid var(--line); background: rgba(13,21,32,0.94); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.map-chip.active { border-color: var(--good); color: var(--ivory); background: var(--green-soft); }
.mc-ic { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 24px; }
.mc-ic svg { width: 14px; height: 14px; }

.map-detail { position: absolute; top: 16px; right: 16px; bottom: 16px; width: 328px; z-index: 640; border-radius: 16px; border: 1px solid var(--line); background: rgba(13,21,32,0.97); box-shadow: 0 16px 48px rgba(0,0,0,0.55); overflow-y: auto; transform: translateX(calc(100% + 28px)); transition: transform 0.28s ease; }
.map-detail.open { transform: translateX(0); }
.md-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 0; background: rgba(0,0,0,0.45); color: #fff; cursor: pointer; }
.md-close svg { width: 18px; height: 18px; }
.md-img { height: 148px; border-radius: 16px 16px 0 0; display: flex; align-items: flex-end; padding: 12px; }
.md-img__badge { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(255,255,255,0.85); }
.md-img__badge svg { width: 24px; height: 24px; }
.md-body { padding: 16px 18px 18px; }
.md-name { font-family: var(--font-head); font-size: 20px; font-weight: 600; color: var(--ivory); line-height: 1.15; }
.md-sub { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 13px; }
.md-rate .star { color: #3a4a5a; } .md-rate .star.on { color: var(--amber); } .md-rate b { color: var(--ivory); }
.md-dist { color: var(--muted); font-weight: 600; white-space: nowrap; }
.md-open { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; font-weight: 600; padding-top: 10px; border-top: 1px solid var(--line); }
.md-amens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 8px; margin: 15px 0; }
.md-amen { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); text-align: center; }
.md-amen__ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.md-amen__ic svg { width: 20px; height: 20px; }
.md-rows { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; font-size: 13px; }
.md-row { display: flex; gap: 11px; color: var(--ivory); line-height: 1.4; }
.md-row .ic { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }
.btn-primary { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 6px; padding: 13px; border: 0; border-radius: 10px; background: var(--blue); color: #05131f; font-family: var(--font-body); font-weight: 700; font-size: 14px; cursor: pointer; }
.btn-outline { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; padding: 12px; border: 1px solid var(--line2); border-radius: 10px; background: transparent; color: var(--ivory); font-family: var(--font-body); font-weight: 600; font-size: 14px; cursor: pointer; }
.btn-outline:hover { border-color: var(--blue); }
.btn-outline.is-fav { border-color: var(--gold); color: var(--gold); }
@media (max-width: 560px) {
  .map-detail { top: auto; left: 12px; right: 12px; bottom: 74px; width: auto; max-height: 58%; transform: translateY(calc(100% + 90px)); }
  .map-detail.open { transform: translateY(0); }
}

.esim-screen { display: none; }
.esim-screen.active { display: block; }
.esim-wrap { max-width: 540px; margin: 0 auto; }
.esim-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; font-family: var(--font-head); font-size: 20px; font-weight: 600; color: var(--ivory); }
.esim-head-plain { text-align: center; font-family: var(--font-head); font-size: 20px; font-weight: 600; color: var(--ivory); margin-bottom: 8px; }
.esim-back { width: 40px; height: 40px; flex: 0 0 40px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line2); border-radius: 10px; background: transparent; color: var(--ivory); cursor: pointer; }
.esim-back svg { width: 20px; height: 20px; }
.esim-hero { text-align: center; padding: 20px 0 10px; }
.esim-globe { font-size: 72px; line-height: 1; }
.esim-h1 { font-family: var(--font-head); font-size: 24px; font-weight: 600; letter-spacing: 2px; color: var(--ivory); margin-top: 12px; }
.esim-h2 { font-size: 14px; color: var(--muted); margin-top: 4px; }
.esim-benefits { display: flex; flex-direction: column; gap: 12px; margin: 22px 0; }
.eb { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-dark); }
.eb-ic { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--green-soft); }
.eb-ic svg { width: 20px; height: 20px; }
.eb div { display: flex; flex-direction: column; }
.eb b { color: var(--ivory); font-size: 14px; font-weight: 600; }
.eb span { color: var(--muted); font-size: 12px; }

.esim-search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-dark); margin-bottom: 14px; }
.esim-search .ic { width: 20px; height: 20px; color: var(--muted); }
.esim-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--ivory); font-family: var(--font-body); font-size: 15px; }
.esim-search input::placeholder { color: var(--muted); }
.region-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; }
.region-tabs::-webkit-scrollbar { height: 0; }
.rt { flex: 0 0 auto; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-dark); color: var(--muted); font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.rt.active { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.country-list { display: flex; flex-direction: column; gap: 8px; }
.country-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-dark); cursor: pointer; text-align: left; }
.country-row:hover { border-color: var(--blue); }
.flag { font-size: 26px; line-height: 1; flex: 0 0 auto; width: 34px; text-align: center; }
.cr-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cr-name { color: var(--ivory); font-size: 15px; font-weight: 600; }
.cr-note { color: var(--muted); font-size: 12px; }
.cr-arr { color: var(--dim); font-size: 22px; flex: 0 0 auto; }

.ctry-card { display: flex; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-dark); margin-bottom: 18px; }
.cc-body { flex: 1; min-width: 0; }
.cc-name { color: var(--ivory); font-size: 16px; font-weight: 600; }
.cc-note { color: var(--muted); font-size: 12px; }
.net-badge { flex: 0 0 auto; padding: 5px 11px; border-radius: 999px; background: var(--green-soft); color: var(--good); font-size: 12px; font-weight: 700; }
.esim-label { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 4px 0 12px; }
.plans { display: flex; flex-direction: column; gap: 10px; }
.plan-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg-dark); cursor: pointer; text-align: left; transition: border-color 0.15s; }
.plan-card.sel { border-color: var(--good); background: var(--green-soft); }
.pc-days { font-family: var(--font-head); font-size: 17px; font-weight: 600; color: var(--ivory); }
.pc-data { font-size: 13px; color: var(--muted); margin: 2px 0; }
.pc-note { font-size: 11px; color: var(--dim); max-width: 300px; }
.pc-price { font-family: var(--font-head); font-size: 20px; font-weight: 600; color: var(--good); flex: 0 0 auto; }
.plan-feats { display: flex; flex-wrap: wrap; gap: 14px; margin: 16px 0; font-size: 12px; color: var(--muted); }
.plan-feats span { display: flex; align-items: center; gap: 6px; }
.plan-feats .ic { width: 15px; height: 15px; }

.order { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-dark); margin-bottom: 18px; }
.or-body { flex: 1; min-width: 0; }
.or-name { color: var(--ivory); font-size: 15px; font-weight: 600; }
.or-note { color: var(--muted); font-size: 12px; }
.or-price { font-family: var(--font-head); font-size: 20px; font-weight: 600; color: var(--ivory); }
.pay-methods { display: flex; flex-direction: column; gap: 10px; }
.pay-m { display: flex; align-items: center; gap: 13px; width: 100%; padding: 15px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg-dark); cursor: pointer; text-align: left; }
.pay-m.sel { border-color: var(--blue); background: var(--blue-soft); }
.pm-radio { width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; border: 2px solid var(--line2); }
.pay-m.sel .pm-radio { border-color: var(--blue); box-shadow: inset 0 0 0 4px var(--blue); }
.pm-name { flex: 1; color: var(--ivory); font-size: 14px; font-weight: 600; }
.pm-tag { color: var(--muted); font-size: 12px; font-weight: 700; }
.pay-total { display: flex; align-items: center; justify-content: space-between; margin: 18px 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.pay-total b { font-family: var(--font-head); font-size: 24px; color: var(--ivory); }
.pay-safe { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 12px; font-size: 12px; color: var(--dim); }
.pay-safe .ic { width: 15px; height: 15px; }

.install-hero { text-align: center; padding: 16px 0; }
.ih-chip { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: var(--green-soft); }
.ih-chip svg { width: 42px; height: 42px; }
.ih-title { font-family: var(--font-head); font-size: 20px; font-weight: 600; color: var(--ivory); }
.ih-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.check-list { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.ck { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-dark); color: var(--ivory); font-size: 14px; }
.okmark { color: var(--good); display: inline-flex; }
.okmark svg { width: 20px; height: 20px; }
.okmark.big { width: 72px; height: 72px; border-radius: 50%; background: var(--green-soft); align-items: center; justify-content: center; }
.okmark.big svg { width: 38px; height: 38px; }

.install-ring-wrap { position: relative; width: 150px; margin: 24px auto 20px; }
.install-ring { width: 150px; height: 150px; display: block; }
.ir-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 8; }
.ir-fg { fill: none; stroke: var(--good); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.13s linear; }
.ir-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 34px; font-weight: 600; color: var(--ivory); }
.install-cap { text-align: center; font-size: 15px; color: var(--ivory); line-height: 1.6; }
.install-cap span { font-size: 12px; color: var(--muted); }
.install-steps { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.ist { font-size: 11px; color: var(--dim); padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line2); }
.ist.done { color: var(--good); border-color: var(--good); background: var(--green-soft); }

.esim-success { text-align: center; padding: 24px 0 8px; }
.es-check { display: flex; justify-content: center; margin-bottom: 14px; }
.es-title { font-family: var(--font-head); font-size: 22px; font-weight: 600; color: var(--ivory); }
.es-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.done-card, .manage-top { display: flex; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-dark); margin: 18px 0 12px; }
.dc-body, .mt-body { flex: 1; min-width: 0; }
.dc-name, .mt-name { color: var(--ivory); font-size: 15px; font-weight: 600; }
.dc-note, .mt-op { color: var(--muted); font-size: 12px; }
.tag-on { flex: 0 0 auto; padding: 5px 11px; border-radius: 999px; background: var(--green-soft); color: var(--good); font-size: 12px; font-weight: 700; }
.done-rows { margin-bottom: 18px; }
.dr, .use-row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.dr b, .use-row b { color: var(--ivory); font-weight: 600; }
.manage-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.ms { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-dark); text-align: center; }
.ms-v { font-family: var(--font-head); font-size: 22px; font-weight: 600; color: var(--good); }
.ms-l { font-size: 12px; color: var(--muted); margin-top: 3px; }
.manage-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-dark); margin-top: 10px; color: var(--ivory); font-size: 14px; }
.manage-row span { display: flex; align-items: center; gap: 10px; }
.manage-row .ic { width: 18px; height: 18px; }
.manage-row.link { cursor: pointer; }
.manage-row.link:hover { border-color: var(--blue); }
.toggle { width: 46px; height: 26px; flex: 0 0 46px; border-radius: 999px; background: var(--line2); border: 0; position: relative; cursor: pointer; }
.toggle span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left 0.2s; }
.toggle.on { background: var(--good); }
.toggle.on span { left: 23px; }
.esim-empty { text-align: center; padding: 40px 0; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.esim-empty .ic { width: 40px; height: 40px; }
.btn-primary.disabled { opacity: 0.45; pointer-events: none; }

.set-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 6px 26px; }
.set-gtitle { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.set-label { color: var(--ivory); font-size: 14px; }
.stepper { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.st-btn { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line2); background: transparent; color: var(--ivory); font-size: 20px; line-height: 1; cursor: pointer; }
.st-btn:active { background: var(--bg-green); border-color: var(--blue); }
.st-val { min-width: 70px; text-align: center; font-family: var(--font-head); font-size: 16px; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; }
.chan-row { display: flex; gap: 8px; }
.chan { flex: 1; padding: 12px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-family: var(--font-body); font-weight: 600; font-size: 13px; cursor: pointer; }
.chan.active { border-color: var(--good); color: var(--good); background: var(--green-soft); }
.log-list { display: flex; flex-direction: column; overflow: hidden; }
.log-pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 10px; }
.lp-btn {
  padding: 7px 14px; border: 1px solid var(--line2); border-radius: 8px; background: transparent;
  color: var(--ivory); font-family: var(--font-body); font-weight: 600; font-size: 12px; cursor: pointer; min-height: 34px;
}
.lp-btn:disabled { opacity: .35; cursor: default; }
.lp-pos { font-size: 12px; color: var(--dim); }
.log-row { display: flex; align-items: center; gap: 11px; padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.log-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: var(--good); }
.log-row.err .log-dot { background: var(--danger); } .log-row.warn .log-dot { background: var(--warn); } .log-row.blue .log-dot { background: var(--blue); }
.log-time { color: var(--dim); font-variant-numeric: tabular-nums; flex: 0 0 auto; font-size: 12px; }
.log-msg { color: var(--ivory); }
.log-empty { color: var(--dim); font-size: 13px; padding: 8px 0; }
.log-row .log-msg { flex: 1; min-width: 0; }
.log-msg b { color: var(--ivory); font-weight: 600; }
.log-msg i { font-style: normal; font-size: 12px; }
.log-delta { flex: 0 0 auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-delta b { color: var(--gold); font-weight: 600; }
.log-list { gap: 0; }
.cam-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 2px; }
.cam-tile { display: flex; flex-direction: column; gap: 7px; padding: 0; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg-dark); cursor: pointer; overflow: hidden; }
.cam-tile.sel { border-color: var(--blue); }
.cam-tile.alarm { border-color: var(--danger); }
.cam-view { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; aspect-ratio: 16/9; background: repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 10px, transparent 10px 20px), #0a0e14; color: var(--dim); }
.cam-view .ic { width: 30px; height: 30px; }
.cam-off { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.cam-label { padding: 0 12px 8px; font-size: 13px; font-weight: 600; color: var(--ivory); text-align: left; }
.cam-tile.alarm .cam-label { color: var(--danger); }

.p-main, .p-charts, .p-parts, .p-block { display: contents; }
.chart { position: relative; margin-top: 10px; }
.ch-svg { width: 100%; height: 150px; display: block; overflow: visible; cursor: crosshair; }
.ch-grid { stroke: rgba(255,255,255,0.07); stroke-width: 1; }
.ch-ax { fill: var(--dim); font-size: 10px; font-family: var(--font-body); }
.ch-cursor { position: absolute; top: 12px; bottom: 20px; width: 0; border-left: 1px dashed var(--muted); opacity: 0; pointer-events: none; transition: opacity 0.12s; }
.ch-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; transform: translate(-50%, -50%); opacity: 0; pointer-events: none; box-shadow: 0 0 0 2px var(--bg-dark); transition: opacity 0.12s; }
.ch-tip { position: absolute; top: -6px; left: 0; pointer-events: none; opacity: 0; transition: opacity 0.12s; background: var(--bg-green); border: 1px solid var(--line2); border-radius: 7px; padding: 4px 10px; font-size: 12px; color: var(--ivory); white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,0.5); }
.ch-tip b { font-variant-numeric: tabular-nums; }
.ch-empty { padding: 34px 0; text-align: center; color: var(--dim); font-size: 13px; }
.ch-tabs { display: flex; gap: 6px; }
.ch-tab { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: var(--muted); font-family: var(--font-body); font-size: 12px; font-weight: 600; cursor: pointer; }
.ch-tab.active { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.creds { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.cred-row { display: flex; flex-direction: column; gap: 5px; }
.cred-label { font-size: 12px; color: var(--muted); }
.cred-input { height: 44px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--line2); background: rgba(0,0,0,0.25); color: var(--ivory); font-family: var(--font-body); font-size: 14px; outline: none; }
.cred-input:focus { border-color: var(--blue); }
.cred-input::placeholder { color: var(--dim); }
.cred-btns { display: flex; gap: 10px; }
.cred-btns .btn-outline { flex: 1; }

.notif-cfg { display: grid; grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr); gap: 16px 30px; align-items: start; }
.notif-col { min-width: 0; }
.notif-col .set-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 18px; }
@media (max-width: 1100px) { .notif-col .set-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .notif-cfg { grid-template-columns: minmax(0, 1fr); } }

.modal-scrim { position: fixed; inset: 0; z-index: 820; background: rgba(4,8,14,0.62); display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { width: min(540px, 92vw); background: var(--bg-dark); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,0.6); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-title { font-family: var(--font-head); font-weight: 600; font-size: 16px; letter-spacing: .04em; text-transform: uppercase; color: var(--ivory); }
.modal-x { width: 34px; height: 34px; flex: 0 0 34px; border: 0; border-radius: 9px; background: transparent; color: var(--dim); cursor: pointer; display: grid; place-items: center; }
.modal-x:hover { background: var(--bg-content); color: var(--ivory); }
.modal-x svg { width: 20px; height: 20px; }
.modal-body { padding: 16px 20px 20px; }
.howto-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; color: var(--ivory); font-size: 14px; line-height: 1.45; }
.howto-list li { padding-left: 4px; }

.act-grid { display: flex; align-items: flex-end; gap: 6px; height: 110px; margin-top: 6px; }
.act-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; }
.act-bar { width: 100%; max-width: 34px; border-radius: 4px 4px 2px 2px; background: var(--good); opacity: 0.85; transition: height 0.4s; }
.act-bar.warn { background: var(--warn); } .act-bar.err { background: var(--danger); }
.act-lbl { font-size: 10px; color: var(--dim); font-variant-numeric: tabular-nums; }
.ch-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.ch-legend span { display: flex; align-items: center; gap: 6px; }
.ch-key { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.ch-key.dash { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); }
.card-head .ch-tabs { margin-left: auto; }
.tr-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.tr-pill { font-size: 11px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line2); color: var(--dim); }
.tr-pill.on { border-color: currentColor; }
.tr-pill.on.good { color: var(--good); background: var(--green-soft); }
.tr-pill.on.warn { color: var(--warn); }
.tr-pill.on.danger { color: var(--danger); }
.tr-pill.on.na { color: var(--muted); border-color: var(--muted); }
.big.danger { color: var(--danger); } .big.warn { color: var(--warn); } .big.na { color: var(--dim); }
body.link-lost .content { opacity: 0.55; filter: grayscale(0.4); transition: opacity 0.3s; }
body.link-lost .content::before { content: 'НЕТ СВЯЗИ С CERBO — данные не обновляются'; position: sticky; top: 0; z-index: 30; display: block; margin: -4px 0 14px; padding: 11px 14px; border-radius: 8px; background: rgba(255,128,128,0.14); border: 1px solid var(--danger); color: var(--danger); font-size: 13px; font-weight: 700; text-align: center; }
.notif-stack {
  position: fixed; top: calc(var(--head-h) + 10px); right: 14px; z-index: 3000;
  display: flex; flex-direction: column; gap: 10px;
  width: 360px; max-width: calc(100vw - 28px); max-height: calc(100vh - 28px);
  overflow: hidden; pointer-events: none;
}
.notif {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 12px 12px 14px; border-radius: 12px;
  background: #131c28; border: 1px solid var(--line2); border-left: 3px solid var(--dim);
  box-shadow: 0 14px 36px rgba(0,0,0,0.5);
  opacity: 0; transform: translateX(24px); transition: opacity .22s ease, transform .22s ease;
}
.notif.in { opacity: 1; transform: translateX(0); }
.notif.leaving { opacity: 0; transform: translateX(24px); }
.notif.error { border-left-color: var(--danger); }
.notif.warn { border-left-color: var(--warn); }
.notif.ok { border-left-color: var(--good); }
.notif.info { border-left-color: var(--blue); }
.notif-ic { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 1px; color: var(--muted); }
.notif.error .notif-ic { color: var(--danger); } .notif.warn .notif-ic { color: var(--warn); }
.notif.ok .notif-ic { color: var(--good); } .notif.info .notif-ic { color: var(--blue); }
.notif-ic .ic { width: 20px; height: 20px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 14px; font-weight: 600; color: var(--ivory); line-height: 1.3; overflow-wrap: anywhere; }
.notif-msg { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; overflow-wrap: anywhere; }
.notif-x {
  flex: 0 0 26px; width: 26px; height: 26px; border: 0; border-radius: 7px; cursor: pointer;
  background: transparent; color: var(--dim); display: grid; place-items: center;
}
.notif-x:hover { background: rgba(255,255,255,0.08); color: var(--ivory); }
.notif-x svg { width: 15px; height: 15px; }

.c-blue { color: var(--blue); } .c-green { color: var(--good); } .c-amber { color: var(--amber); }
.c-danger { color: var(--danger); } .c-ivory { color: var(--ivory); } .c-dim { color: var(--dim); }

.mini.on { border-color: var(--good); color: var(--good); }
.mini.danger { border-color: var(--danger); color: var(--danger); }
.mini:disabled { opacity: 0.5; cursor: default; }
.out-foot { margin-top: 14px; font-size: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.out-foot.warn { color: var(--amber); }
.modal-p { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.modal-actions .btn-gold, .modal-actions .btn-ghost { width: auto; margin: 0; padding: 9px 18px; }
.btn-ghost { border-radius: 8px; border: 1px solid var(--line2); background: transparent; color: var(--muted); font-family: var(--font-body); font-weight: 600; font-size: 14px; cursor: pointer; padding: 9px 18px; }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

.iox-dcstrip { font-size: 13px; color: var(--muted); margin: 2px 2px 12px; }
.iox-dcstrip b { color: var(--ivory); }
.iox-boards { display: flex; flex-direction: column; gap: 12px; }
.iox-board { border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; background: rgba(255,255,255,0.015); }
.iox-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--line2); margin-bottom: 11px; }
.iox-badge { width: 38px; height: 38px; border-radius: 9px; background: var(--gold); color: #1b1b1b; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; letter-spacing: 0.5px; flex-shrink: 0; }
.iox-model { font-weight: 700; color: var(--ivory); font-size: 15px; letter-spacing: 0.3px; }
.iox-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.iox-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.iox-colh { font-size: 11px; letter-spacing: 1px; color: var(--dim); text-transform: uppercase; margin-bottom: 9px; }
.iox-term { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 8px 12px; margin-bottom: 6px; border: 1px solid var(--line2); border-radius: 9px; background: rgba(255,255,255,0.02); color: var(--muted); font-family: var(--font-body); font-size: 13px; }
.iox-col > .iox-term:last-child { margin-bottom: 0; }
.iox-term.clickable { cursor: pointer; transition: border-color 0.12s; }
.iox-term.clickable:hover { border-color: var(--blue); }
.iox-term.active { border-color: rgba(120,220,150,0.45); background: rgba(80,200,120,0.06); }
.iox-port { display: flex; align-items: center; gap: 8px; min-width: 40px; }
.iox-led { width: 11px; height: 11px; border-radius: 50%; background: var(--line2); flex-shrink: 0; }
.iox-term.active .iox-led { background: var(--good); box-shadow: 0 0 8px 1px rgba(90,210,130,0.75); }
.iox-pnum { font-weight: 700; color: var(--ivory); font-size: 14px; }
.iox-ticon { display: flex; color: var(--muted); }
.iox-term.active .iox-ticon { color: var(--good); }
.iox-ticon .ic { width: 20px; height: 20px; }
.iox-tname { flex: 1; font-size: 13px; color: var(--ivory); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.iox-st { font-size: 12px; font-weight: 600; color: var(--good); }
.iox-st.na { color: var(--dim); font-weight: 400; }
.iox-tag { font-size: 11px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line2); white-space: nowrap; }
.iox-tag.good { color: var(--good); border-color: rgba(90,210,130,0.4); }
.iox-tag.amber { color: var(--amber); }
.iox-tag.dim { color: var(--dim); }
.iox-pwm { display: flex; align-items: center; gap: 8px; min-width: 92px; }
.iox-pwmbar { flex: 1; height: 6px; border-radius: 4px; background: var(--line2); overflow: hidden; }
.iox-pwmbar i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.iox-pwmv { font-size: 12px; color: var(--muted); min-width: 32px; text-align: right; }

.ocfg-h { font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--dim); margin: 15px 0 9px; }
.ocfg-h:first-child { margin-top: 0; }
.ocfg-funcs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ocfg-func { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line2); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-family: var(--font-body); font-size: 12.5px; text-align: left; }
.ocfg-func:hover { border-color: var(--blue); color: var(--blue); }
.ocfg-func.on { border-color: var(--gold); color: var(--gold); background: rgba(255,213,138,0.06); }
.ocfg-func .ic { width: 18px; height: 18px; flex-shrink: 0; }
.ocfg-func span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ocfg-namerow { display: flex; gap: 8px; }
.ocfg-name { flex: 1; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line2); background: rgba(255,255,255,0.04); color: var(--ivory); font-family: var(--font-body); font-size: 14px; box-sizing: border-box; }
.ocfg-ctrls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ocfg-slider { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.ocfg-slider input { width: 120px; accent-color: var(--blue); }
.ocfg-hint { font-size: 12px; color: var(--dim); margin-top: 14px; line-height: 1.45; }
.in-state { font-size: 20px; font-weight: 700; }
.in-state.good { color: var(--good); } .in-state.amber { color: var(--amber); } .in-state.danger { color: var(--danger); } .in-state.na { color: var(--dim); }
.in-type { font-size: 14px; color: var(--ivory); }

.io-unit { border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; background: rgba(255,255,255,0.015); margin-bottom: 12px; }
.io-unit:last-of-type { margin-bottom: 0; }
.io-unit-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--line2); margin-bottom: 11px; }
.io-grp { margin-bottom: 11px; }
.io-grp:last-child { margin-bottom: 0; }
.io-grph { font-size: 10px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
.io-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 7px; }
.io-chip { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line2); border-radius: 8px; background: rgba(255,255,255,0.02); color: var(--muted); font-family: var(--font-body); font-size: 12px; text-align: left; min-width: 0; }
.io-chip.clickable { cursor: pointer; transition: border-color 0.12s; }
.io-chip.clickable:hover { border-color: var(--blue); }
.io-chip.on { border-color: rgba(120,220,150,0.45); background: rgba(80,200,120,0.06); }
.io-chip.open { border-color: rgba(240,200,120,0.5); background: rgba(230,180,80,0.06); }
.io-chip.alarm { border-color: rgba(240,120,120,0.55); background: rgba(230,90,90,0.08); }
.io-led { width: 9px; height: 9px; border-radius: 50%; background: var(--line2); flex-shrink: 0; }
.io-chip.on .io-led { background: var(--good); box-shadow: 0 0 7px 1px rgba(90,210,130,0.7); }
.io-chip.open .io-led { background: var(--amber); box-shadow: 0 0 7px 1px rgba(240,190,90,0.7); }
.io-chip.alarm .io-led { background: var(--danger); box-shadow: 0 0 7px 1px rgba(240,110,110,0.7); }
.io-cnum { font-weight: 700; color: var(--ivory); font-size: 11px; min-width: 13px; }
.io-cic { display: flex; color: var(--muted); flex-shrink: 0; }
.io-cic .ic { width: 16px; height: 16px; }
.io-cname { flex: 1; color: var(--ivory); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.io-cstate { font-size: 11px; font-weight: 600; white-space: nowrap; }
.io-cstate.na { color: var(--dim); font-weight: 400; }
.io-cstate.good { color: var(--good); }
.io-cstate.amber { color: var(--amber); }
.io-cstate.danger { color: var(--danger); }
.io-tag { font-size: 10px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--line2); white-space: nowrap; }
.io-tag.good { color: var(--good); border-color: rgba(90,210,130,0.4); }
.io-tag.dim { color: var(--dim); }

.asst-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.asst-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 600; font-size: 18px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ivory); }
.asst-title .ic { width: 22px; height: 22px; }
.asst-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.asst-chip { font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 20px; border: 1px solid var(--line2); }
.asst-chip.danger { color: var(--danger); border-color: rgba(240,110,110,0.4); }
.asst-chip.amber { color: var(--amber); border-color: rgba(240,190,90,0.4); }
.asst-chip.blue { color: var(--blue); border-color: rgba(96,165,220,0.4); }
.asst-chip.good { color: var(--good); border-color: rgba(90,210,130,0.4); }
.asst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; align-content: start; }
.asst-card, .asst-empty { display: flex; gap: 13px; padding: 14px 16px; border: 1px solid var(--line2); border-radius: 12px; background: rgba(255,255,255,0.02); }
.asst-card.crit { border-color: rgba(240,110,110,0.45); background: rgba(230,80,80,0.06); }
.asst-card.warn { border-color: rgba(240,190,90,0.4); background: rgba(230,180,80,0.05); }
.asst-ic { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid var(--line2); }
.asst-ic .ic { width: 20px; height: 20px; }
.asst-ic.danger { color: var(--danger); } .asst-ic.amber { color: var(--amber); } .asst-ic.blue { color: var(--blue); } .asst-ic.good { color: var(--good); }
.asst-body { min-width: 0; }
.asst-ct { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ivory); font-size: 15px; }
.asst-cat { font-size: 10px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line2); border-radius: 5px; padding: 1px 6px; font-weight: 500; }
.asst-detail { margin-top: 5px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.asst-empty { align-items: center; }
.asst-foot { margin-top: 16px; font-size: 12px; color: var(--dim); }

.ocfg-note {
  font-size: 12px;
  color: var(--muted, #8b95a5);
  margin: -4px 0 10px;
  line-height: 1.4;
}

.pin-box { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pin-box.busy { opacity: 0.6; pointer-events: none; }
.pin-box.shake { animation: pin-shake .32s ease; }
@keyframes pin-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.pin-note { font-size: 14px; color: var(--muted); text-align: center; line-height: 1.45; }
.pin-dots { display: flex; gap: 12px; min-height: 30px; align-items: center; justify-content: center; margin-top: 6px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--dim); }
.pin-dots i.on { background: var(--gold); border-color: var(--gold); }
.pin-show { font-family: var(--font-head); font-size: 30px; letter-spacing: 4px; color: var(--ivory); }
.pin-err { min-height: 18px; font-size: 13px; color: var(--danger); text-align: center; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; }
.pin-key {
  height: 60px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-green);
  color: var(--ivory); font-family: var(--font-head); font-size: 24px; cursor: pointer;
}
.pin-key:active { background: var(--blue-soft); border-color: var(--blue); }
.pin-key.fn { font-family: var(--font-body); font-size: 20px; color: var(--muted); background: transparent; }
.pin-key.ok { font-family: var(--font-body); font-size: 16px; font-weight: 600; color: var(--gold); border-color: var(--gold); background: rgba(255,213,138,0.06); }

.pair-scrim { position: fixed; inset: 0; z-index: 200; background: var(--bg-content); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.pair-card { width: 100%; max-width: 420px; background: var(--bg-dark); border: 1px solid var(--line); border-radius: 16px; padding: 24px 20px; display: flex; flex-direction: column; gap: 10px; }
.pair-brand { font-family: var(--font-head); letter-spacing: 4px; color: var(--gold); font-size: 14px; text-align: center; }
.pair-title { font-family: var(--font-head); font-size: 24px; color: var(--ivory); text-align: center; }
.pair-text { font-size: 14px; color: var(--muted); text-align: center; line-height: 1.45; }
.pair-hint { font-size: 12.5px; color: var(--dim); text-align: center; line-height: 1.45; margin-bottom: 4px; }
.pair-hint b { color: var(--muted); font-weight: 600; }
.pair-card .cred-input { width: 100%; }
body.unpaired .app { display: none; }
.pair-code-box { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pair-url { font-size: 15px; color: var(--blue); font-weight: 600; overflow-wrap: anywhere; text-align: center; }
.pair-code { font-family: var(--font-head); font-size: 44px; letter-spacing: 6px; color: var(--gold); margin: 6px 0; }
@media (max-width: 420px) { .pin-pad { grid-template-columns: repeat(3, 1fr); width: 100%; } }
.acc-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.acc-main { flex: 1; min-width: 0; }
.acc-name { font-size: 14px; color: var(--ivory); overflow-wrap: anywhere; }
.acc-sub { font-size: 12px; color: var(--dim); margin-top: 2px; overflow-wrap: anywhere; }
.acc-act { flex: 0 0 auto; white-space: nowrap; }
.acc-name .na-badge { white-space: nowrap; }
.pin-show .ph { color: var(--dim); opacity: 0.6; }
.entry-bar { position: fixed; left: 50%; transform: translateX(-50%); top: 10px; z-index: 150; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--bg-dark); box-shadow: 0 10px 30px rgba(0,0,0,0.5); max-width: calc(100vw - 32px); }
.entry-bar.entry { border: 1px solid rgba(255,128,128,0.5); color: var(--danger); }
.entry-bar.exit { border: 1px solid rgba(124,192,255,0.4); color: var(--blue); }
.entry-t { font-size: 14px; font-weight: 600; }
.entry-left { font-family: var(--font-head); font-size: 22px; min-width: 52px; text-align: center; }
.twin-eng { margin: 10px 0 6px; }

.chk { margin-bottom: 18px; }
.chk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chk-summary { margin-top: 12px; font-size: 17px; line-height: 1.5; color: var(--ivory); padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(255,255,255,0.02); }
.chk-summary.crit { border-color: rgba(255,128,128,0.45); background: rgba(255,128,128,0.07); }
.chk-summary.warn { border-color: rgba(255,207,107,0.4); background: rgba(255,207,107,0.05); }
.chk-summary.ok, .chk-summary.info { border-color: rgba(53,208,122,0.3); }
.chk-time { margin-top: 6px; font-size: 12px; color: var(--dim); }
.chk-sub { font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
.chk-todo { margin-top: 14px; }
.chk-todo-i { font-size: 13.5px; line-height: 1.45; padding: 7px 10px; border-left: 3px solid var(--line); margin-bottom: 6px; color: var(--muted); background: rgba(255,255,255,0.02); border-radius: 0 8px 8px 0; }
.chk-todo-i.crit { border-left-color: var(--danger); color: var(--ivory); }
.chk-todo-i.warn { border-left-color: var(--warn); }
.chk-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.chk-sec { padding: 12px 14px; border: 1px solid var(--line2); border-radius: 10px; background: rgba(255,255,255,0.015); min-width: 0; }
.chk-sec.crit { border-color: rgba(255,128,128,0.45); }
.chk-sec.warn { border-color: rgba(255,207,107,0.35); }
.chk-sec-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.chk-ic .ic { width: 18px; height: 18px; }
.chk-sec-t { font-weight: 700; color: var(--ivory); font-size: 14px; flex: 1; min-width: 0; }
.chk-lvl { font-size: 11px; padding: 2px 8px; border-radius: 12px; border: 1px solid var(--line2); color: var(--dim); white-space: nowrap; }
.chk-lvl.good { color: var(--good); border-color: rgba(53,208,122,0.35); }
.chk-lvl.blue { color: var(--good); border-color: rgba(53,208,122,0.35); }
.chk-lvl.amber { color: var(--warn); border-color: rgba(255,207,107,0.4); }
.chk-lvl.danger { color: var(--danger); border-color: rgba(255,128,128,0.45); }
.chk-line { font-size: 13px; line-height: 1.45; color: var(--muted); padding: 2px 0; overflow-wrap: anywhere; }
.chk-tech { font-size: 12px; line-height: 1.45; color: var(--dim); padding: 2px 0 2px 8px; border-left: 2px solid var(--line); margin-top: 4px; overflow-wrap: anywhere; }
.asst-sub { font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--dim); margin: 4px 0 10px; }

@media (max-height: 860px) and (min-width: 1001px) {
  :root { --head-h: 62px; }
  .content { padding: 10px 16px; }
  .card { padding: 11px 13px; }
  .card-head { margin-bottom: 8px; }
  .subsection { margin-top: 10px; padding-top: 9px; }
  .dot-grid { gap: 5px 14px; margin-top: 8px; }
  .card-foot { margin-top: 10px; padding-top: 10px; }
  .flow-wrap { max-width: 290px; margin: 0 auto; }
  .screen { gap: 10px; }
  .dash { gap: 10px; }
}
.dash .span-2.weather { flex-wrap: nowrap; gap: 20px; }
.dash .span-2.weather .wx-solar { padding-right: 18px; flex: 0 0 auto; }
.dash .span-2.weather .wx-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.twin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.twin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 22px; }
.twin-grid > .metric:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
.twin-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.twin-sum-i { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 10px; background: rgba(255,255,255,0.02); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; text-align: left; }
.twin-sum-i b { font-family: var(--font-head); font-size: 24px; color: var(--ivory); }
.twin-sum-i:hover { border-color: var(--blue); }
@media (max-width: 680px) { .twin-grid { grid-template-columns: minmax(0, 1fr); } .twin-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chan-row { flex-wrap: wrap; }
.chan { min-width: 0; white-space: normal; }
.twin-grid .metric .label { flex-shrink: 1; min-width: 0; overflow-wrap: anywhere; }
.twin-grid .metric .value { flex-shrink: 0; max-width: 45%; }
@media (max-width: 860px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dash .span-2 { grid-column: 1 / -1; }
  .dash .span-2.weather { flex-wrap: wrap; }
  .dash .span-2.weather .wx-solar { border-right: 0; padding-right: 0; }
  .dash .span-2.weather .wx-stats { flex: 1 1 100%; }
}
@media (min-width: 1001px) and (max-width: 1199px) {
  .app { grid-template-columns: 84px minmax(0, 1fr); }
  .sidebar__logo { padding: 0; justify-content: center; }
  .sidebar__logo > div:not(.sidebar__mark) { display: none; }
  .sidebar__nav { padding: 0 6px; }
  .sidebar__link { flex-direction: column; gap: 4px; padding: 9px 2px; font-size: 10.5px; text-align: center; justify-content: center; }
  .sidebar__link span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar { padding: 0 20px; }
}
@media (max-height: 760px) and (min-width: 1001px) {
  .flow-wrap { max-width: 250px; }
  .big { font-size: 30px; }
  .card-head { margin-bottom: 6px; }
  .dot-grid { gap: 3px 14px; margin-top: 6px; }
  .subsection { margin-top: 8px; padding-top: 7px; }
}

.asst .chat { display: flex; flex-direction: column; gap: 8px; height: calc(100vh - var(--head-h) - 96px); min-height: 380px; padding: 10px 12px; }
.chat-status { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(124,192,255,0.06); border: 1px solid var(--line); flex-shrink: 0; }
.chat-status:empty { display: none; }
.cs-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); flex: 0 0 9px; }
.cs-dot.ok { background: var(--good); box-shadow: 0 0 8px rgba(90,210,130,0.7); }
.cs-dot.warn { background: var(--warn); }
.cs-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; font-size: 12.5px; color: var(--muted); }
.cs-t b { color: var(--ivory); font-size: 13px; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; overscroll-behavior: contain; }
.chat-empty { margin: auto; display: flex; gap: 14px; align-items: center; max-width: 520px; color: var(--muted); font-size: 13px; }
.chat-empty .ic { width: 34px; height: 34px; flex: 0 0 34px; }
.chat-empty b { display: block; color: var(--ivory); font-size: 15px; margin-bottom: 3px; }
.chat-earlier { text-align: center; font-size: 11.5px; color: var(--dim); }
.cm { display: flex; flex-direction: column; max-width: min(78%, 720px); }
.cm.user { align-self: flex-end; align-items: flex-end; }
.cm.bot { align-self: flex-start; }
.cm.notice { align-self: center; max-width: 90%; font-size: 12px; color: var(--muted); text-align: center; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,0.04); }
.cb { padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; display: flex; flex-direction: column; gap: 8px; }
.cm.user .cb { background: var(--green-soft); color: var(--ivory); border-bottom-right-radius: 4px; }
.cm.bot .cb { background: rgba(255,255,255,0.045); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--ivory); }
.ct { white-space: pre-wrap; overflow-wrap: anywhere; }
.cmeta { font-size: 10.5px; color: var(--dim); margin: 3px 6px 0; }
.cc { border: 1px solid var(--line2); border-radius: 10px; padding: 8px 10px; background: rgba(0,0,0,0.12); display: flex; flex-direction: column; gap: 6px; }
.cc-h { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.cc-h .ic { width: 14px; height: 14px; }
.cc-d { font-size: 12.5px; color: var(--muted); }
.cc-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cc-left { font-size: 11.5px; color: var(--dim); margin-left: 4px; }
.cc-state { font-size: 12.5px; font-weight: 600; }
.cc-v { font-size: 11.5px; font-weight: 600; }
.cc-doc { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.cc-doc b { color: var(--ivory); font-size: 13px; }
.cc-doc:hover { border-color: var(--blue); }
.cc-goto { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; }
.cc-goto .ic { width: 13px; height: 13px; }
.cc-secs { display: flex; gap: 5px; flex-wrap: wrap; }
.cc-sec { font-size: 11px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line2); color: var(--muted); }
.cc-sec.danger { color: var(--danger); border-color: rgba(255,128,128,0.4); }
.cc-sec.amber { color: var(--warn); border-color: rgba(255,207,107,0.4); }
.cc-sec.good { color: var(--good); }
.cc-confirm.pending { border-color: rgba(255,207,107,0.45); background: rgba(255,207,107,0.06); }
.cc-res.ok { border-color: rgba(90,210,130,0.35); }
.cc-res.error { border-color: rgba(255,128,128,0.4); }
.cc-note { font-size: 12px; color: var(--warn); }
.chat-work { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); flex-shrink: 0; }
.chat-work.hidden, .chat-work .hidden { display: none; }
.chat-dots { display: inline-flex; gap: 3px; }
.chat-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); animation: chatdot 1.2s infinite ease-in-out; }
.chat-dots i:nth-child(2) { animation-delay: .15s; } .chat-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes chatdot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-quick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; padding-bottom: 2px; }
.chat-quick::-webkit-scrollbar { display: none; }
.chat-quick .mini { white-space: nowrap; flex-shrink: 0; }
.chat-form { display: flex; gap: 8px; flex-shrink: 0; }
.chat-input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg-content); color: var(--ivory); font: inherit; font-size: 15px; }
.chat-input:focus { outline: none; border-color: var(--blue); }
.chat-send { width: 50px; height: 46px; border-radius: 12px; border: 0; background: var(--green-soft); color: var(--good); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.chat-send .ic { width: 20px; height: 20px; }
.chat-send:disabled { opacity: .4; cursor: default; }
.chat-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 11.5px; flex-shrink: 0; }
.linkbtn { background: none; border: 0; color: var(--dim); font: inherit; font-size: 11.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linkbtn:hover { color: var(--ivory); }
.asst .docs { display: flex; flex-direction: column; gap: 10px; height: calc(100vh - var(--head-h) - 96px); min-height: 380px; }
.docs-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; flex-shrink: 0; }
.docs-q { flex: 1; min-width: 200px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg-content); color: var(--ivory); font: inherit; font-size: 14px; }
.docs-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.doc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.doc-card { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,0.02); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.doc-card b { color: var(--ivory); font-size: 14px; }
.doc-card i { position: absolute; top: 8px; right: 8px; font-style: normal; }
.doc-card:hover { border-color: var(--blue); }
.doc-view { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.doc-view .mini { align-self: flex-start; display: inline-flex; gap: 4px; align-items: center; }
.doc-view .mini .ic { width: 13px; height: 13px; transform: rotate(180deg); }
.doc-view h2 { font-family: var(--font-head); font-size: 22px; color: var(--ivory); font-weight: 600; }
.doc-view h3 { font-size: 15px; color: var(--ivory); margin-bottom: 6px; }
.doc-view p, .doc-view li { font-size: 14px; line-height: 1.55; color: var(--muted); }
.doc-view p + p { margin-top: 6px; }
.doc-view ul { padding-left: 20px; display: flex; flex-direction: column; gap: 3px; margin: 4px 0; }
.doc-view b { color: var(--ivory); }
.doc-sec { padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; }
.doc-sec.hl { border-color: rgba(124,192,255,0.45); background: rgba(124,192,255,0.05); }
.asst .recs .card-head { gap: 10px; flex-wrap: wrap; }
.ai-about { margin-bottom: 10px; line-height: 1.5; }
.ai-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 12px 0; }
.ai-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.ai-form input { height: 40px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line2); background: var(--bg-content); color: var(--ivory); font: inherit; font-size: 14px; }
.ai-card .banner { margin: 8px 0; }
.ai-journal { max-height: 260px; overflow-y: auto; }
@media (max-width: 1000px) { .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  .asst .chat, .asst .docs { height: calc(100dvh - var(--head-h) - 110px); }
  .cm { max-width: 92%; }
  .doc-grid, .ai-form { grid-template-columns: minmax(0, 1fr); }
}
.ai-card { grid-column: 1 / -1; }
.screen.asst { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.screen.asst .chat, .screen.asst .docs { grid-column: 1 / -1; }
.screen.asst .chk, .screen.asst .recs { height: calc(100vh - var(--head-h) - 96px); min-height: 380px; display: flex; flex-direction: column; overflow: hidden; }
.screen.asst .chk .chk-grid { flex: 1; min-height: 0; overflow-y: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.screen.asst .recs .asst-grid { flex: 1; min-height: 0; overflow-y: auto; grid-template-columns: minmax(0, 1fr); align-content: start; }
@media (max-width: 860px) {
  .screen.asst { grid-template-columns: minmax(0, 1fr); }
  .screen.asst .chk, .screen.asst .recs { height: auto; min-height: 0; overflow: visible; }
  .screen.asst .chk .chk-grid { grid-template-columns: minmax(0, 1fr); overflow: visible; }
}
.screen.asst .chk { margin-bottom: 0; }
.screen.asst .chk .chk-summary { font-size: 15px; flex-shrink: 0; }
.screen.asst .chk .chk-todo, .screen.asst .chk .chk-time, .screen.asst .chk .chk-head { flex-shrink: 0; }
.topbar__head { min-width: 0; flex: 1; }
.topbar__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__right { flex-shrink: 0; }
.sysstatus { white-space: nowrap; }
@media (max-width: 680px) {
  .topbar { gap: 10px; }
  .topbar__title { font-size: 20px; }
  .topbar__right { gap: 8px; }
  .sysstatus { font-size: 10px; padding: 5px 8px; }
  .cs-t span { display: none; }
  .chat-status { padding: 6px 10px; }
}
@media (max-width: 420px) {
  .clock { display: none; }
  .topbar__subtitle { display: none; }
}
