/* ===================================================================== VPN panel — light theme */
:root {
  color-scheme: light;
  --bg: #f3f5fb;
  --bg-grad: radial-gradient(1100px 700px at 0% 0%, #e4e9ff 0%, rgba(228, 233, 255, 0) 60%),
             radial-gradient(900px 600px at 100% 0%, #f6e8ff 0%, rgba(246, 232, 255, 0) 55%),
             radial-gradient(1000px 700px at 50% 110%, #e3f4ff 0%, rgba(227, 244, 255, 0) 60%),
             linear-gradient(180deg, #f6f7fc, #f1f3fa);
  --header: rgba(255, 255, 255, .86);
  --surface: #ffffff; --surface-2: #f8f9fc; --surface-3: #f1f3f7;
  --card: #ffffff;
  --card-solid: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e7eaf0;
  --line-2: #d6dbe4;
  --line-3: #c4cad6;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-2: #eef0ff;
  --accent-border: #dfe3ff;
  --ring: #e0e7ff;
  --violet: #7c3aed;
  --apple: #4b5563;
  --grad: linear-gradient(135deg, #4f46e5, #7c3aed);
  --ok: #059669; --ok-bg: #e7f8f1; --ok-border: #c6eedd;
  --bad: #dc2626; --bad-bg: #fdecec; --bad-border: #f3c4c4;
  --warn: #b45309; --warn-bg: #fff6e0; --warn-border: #f6d48f;
  --tx: #4f46e5; --rx: #c7cbf7; --dim-bg: #f1f3f7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-hover: 0 4px 12px rgba(16, 24, 40, .08), 0 2px 4px rgba(16, 24, 40, .05);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
/* dark theme: a soft slate, not black */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #23283a;
  --bg-grad: radial-gradient(1100px 700px at 0% 0%, rgba(99, 102, 241, .22) 0%, rgba(99, 102, 241, 0) 60%),
             radial-gradient(900px 600px at 100% 0%, rgba(168, 85, 247, .16) 0%, rgba(168, 85, 247, 0) 55%),
             radial-gradient(1000px 700px at 50% 110%, rgba(56, 189, 248, .10) 0%, rgba(56, 189, 248, 0) 60%),
             linear-gradient(180deg, #262b3f, #212536);
  --header: rgba(42, 47, 66, .9);
  --surface: #2c3246; --surface-2: #333a50; --surface-3: #3a4159;
  --card: #2c3246;
  --card-solid: #2c3246;
  --text: #eceef6;
  --muted: #a7adc2;
  --faint: #868da5;
  --line: #3b4259;
  --line-2: #4a5270;
  --line-3: #5a6384;
  --accent: #8f95ff;
  --accent-hover: #a7abff;
  --accent-2: rgba(143, 149, 255, .16);
  --accent-border: rgba(143, 149, 255, .3);
  --ring: rgba(143, 149, 255, .35);
  --violet: #c4a1ff;
  --apple: #d1d5e0;
  --ok: #4ade9a; --ok-bg: rgba(74, 222, 154, .13); --ok-border: rgba(74, 222, 154, .3);
  --bad: #ff8080; --bad-bg: rgba(255, 128, 128, .13); --bad-border: rgba(255, 128, 128, .35);
  --warn: #fbbf4d; --warn-bg: rgba(251, 191, 77, .13); --warn-border: rgba(251, 191, 77, .35);
  --tx: #8f95ff; --rx: #565c99; --dim-bg: #363d55;
  --shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .14);
  --shadow-hover: 0 6px 18px rgba(0, 0, 0, .28), 0 2px 4px rgba(0, 0, 0, .18);
}
:root[data-theme="dark"] .btn.primary { color: #14162b; }
:root[data-theme="dark"] .btn.primary:hover { color: #14162b; }
:root[data-theme="dark"] .pager .btn.on { color: #14162b; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg-grad) fixed, var(--bg); color: var(--text);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #dcdcfd; }
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-hover); }
h1 { font-size: 24px; margin: 0 0 16px; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.01em; font-weight: 650; }
.mt { margin-top: 10px; } .mt2 { margin-top: 24px; }
.muted { color: var(--muted); } .bad-text { color: var(--bad); } .small { font-size: 13px; } .strong { font-weight: 600; }
.mono { font-family: ui-monospace, "JetBrains Mono", SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.r { text-align: right; }

/* ===================================================================== header */
header.top {
  display: flex; align-items: center; gap: 20px; padding: 10px 28px; min-height: 60px;
  background: var(--header); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.brand { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 10px; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #10b981; display: inline-block; box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }
.top nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.top nav a { padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 500; transition: color .15s, background .15s; }
.top nav a:hover { color: var(--text); background: var(--dim-bg); }
.top nav a.on { color: var(--accent); background: var(--accent-2); }
.top nav a.hnav { color: var(--violet); }
.nav-pill { display: none; }
.logout { margin: 0; }
main { max-width: 1240px; margin: 0 auto; padding: 26px 28px 70px; animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ===================================================================== cards & tiles */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; min-width: 0; box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid2 > .card { margin-bottom: 18px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); transition: box-shadow .2s, border-color .2s; }
.tile:hover { box-shadow: var(--shadow-hover); border-color: var(--line-2); }
.tile .k { color: var(--muted); font-size: 13px; font-weight: 500; }
.tile .v { font-size: 28px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .v.sm { font-size: 19px; }
.tile .s { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ===================================================================== tables */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
table.users td { white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; transition: color .15s; }
th.sortable:hover, th.sortable.on { color: var(--accent); }
th.sortable i { font-style: normal; }

/* ===================================================================== pills, badges */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--dim-bg); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.ok::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.dim { opacity: .75; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; text-align: center; }
.badge.warn { background: #f59e0b; color: #fff; font-weight: 700; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--dim-bg); color: var(--muted); }

/* ===================================================================== buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-3); color: var(--text); }
.btn:active { background: var(--surface-3); }
.btn:focus-visible { outline: 3px solid var(--ring); outline-offset: 1px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, .3); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.danger { color: var(--bad); border-color: var(--bad-border); background: var(--surface); }
.btn.danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { color: var(--bad); background: var(--bad-bg); }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; transition: color .15s; }
button.link:hover { color: var(--text); }

/* ===================================================================== forms */
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 9px 12px; width: 100%; margin-top: 5px; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--line-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
input[type=radio], input[type=checkbox] { width: auto; margin: 0 6px 0 0; accent-color: var(--accent); box-shadow: none; }
label { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.stack-form { display: grid; gap: 13px; }
.row-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row-form .grow, .grow { flex: 1; min-width: 160px; }
.row-form > .btn { margin-bottom: 0; }
label.opt { display: flex; align-items: center; gap: 4px; color: var(--text); font-size: 14px; font-weight: 400; margin: 3px 0; cursor: pointer; flex-wrap: wrap; }

/* ===================================================================== flash / notices */
.flash { padding: 11px 16px; border-radius: 12px; margin-bottom: 16px; background: var(--accent-2); color: var(--accent); border: 1px solid var(--accent-border); transition: opacity .4s, max-height .4s, margin .4s, padding .4s; max-height: 200px; overflow: hidden; }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.flash.error { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-border); }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.flash.hide { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin-bottom: 0; border-width: 0; }
.apply { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--warn-bg); border-color: var(--warn-border); flex-wrap: wrap; }

/* ===================================================================== toolbar & segmented tabs */
.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input { max-width: 280px; margin: 0; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; padding: 3px; border-radius: 11px; background: var(--dim-bg); width: fit-content; max-width: 100%; }
.tab { border: 0; background: transparent; color: var(--muted); border-radius: 8px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; text-decoration: none; transition: color .15s, background .15s, box-shadow .15s; }
.tab:hover { color: var(--text); }
.tab span { opacity: .6; margin-left: 3px; font-variant-numeric: tabular-nums; }
.tab.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, .1), 0 1px 2px rgba(16, 24, 40, .06); }
.tab.on span { opacity: .55; }
.seg-thumb { display: none; }

/* ===================================================================== meters & bars */
.meter { height: 6px; border-radius: 4px; background: var(--dim-bg); overflow: hidden; margin: 6px 0; min-width: 80px; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s var(--ease); }
.meter.hot span { background: var(--bad); }

.chart { position: relative; }
.chart-peak { position: absolute; right: 0; top: -32px; font-size: 12px; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 180px; border-bottom: 1px solid var(--line); }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0; }
.bar .stack { display: flex; flex-direction: column-reverse; height: 100%; justify-content: flex-start; }
.bar .stack span { display: block; width: 100%; transition: opacity .15s; }
.bar .tx { background: var(--tx); border-radius: 0 0 3px 3px; }
.bar .rx { background: var(--rx); border-radius: 3px 3px 0 0; }
.bar:hover .stack span { opacity: .8; }
.bar .lbl { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.legend { display: flex; gap: 16px; margin-top: 28px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend i.tx { background: var(--tx); } .legend i.rx { background: var(--rx); }

.hbar { position: relative; min-width: 150px; height: 26px; background: var(--dim-bg); border-radius: 7px; overflow: hidden; display: flex; align-items: center; }
.hbar span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-2); border-radius: 7px; }
.hbar b { position: relative; z-index: 1; padding: 0 10px; font-size: 13px; line-height: 26px; font-weight: 600; white-space: nowrap; }
table.top td { vertical-align: middle; }
table.top td.r, table td.r { white-space: nowrap; }
table.top .grow-col { width: 220px; }

/* ===================================================================== notifications bell */
.bell-wrap { position: relative; }
.bell { position: relative; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 8px; border-radius: 10px; display: flex; transition: color .15s, background .15s; }
.bell:hover { color: var(--text); background: var(--dim-bg); }
.bell.ring svg { animation: wiggle .7s ease; transform-origin: 50% 2px; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(7deg); } 80% { transform: rotate(-3deg); } }
.bell-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; box-shadow: 0 0 0 2px var(--surface); }
.bell-panel { position: absolute; right: 0; top: 46px; width: 390px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(16, 24, 40, .14); z-index: 20; overflow: hidden; animation: drop .15s ease-out; }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.bell-list { max-height: 430px; overflow-y: auto; }
.bell-foot { display: block; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.pad { padding: 16px; }
.note { display: block; padding: 11px 16px 11px 18px; border-bottom: 1px solid var(--line); color: var(--text); border-left: 3px solid transparent; transition: background .12s; }
a.note:hover { background: var(--surface-2); color: var(--text); }
.note.unread { background: var(--accent-2); }
.note.lvl-warn { border-left-color: #f59e0b; }
.note.lvl-bad { border-left-color: var(--bad); }
.note.lvl-ok { border-left-color: #10b981; }
.note-t { font-weight: 600; font-size: 14px; }
.note-b { font-size: 13px; color: var(--muted); margin-top: 3px; }
.note-m { font-size: 12px; color: var(--faint); margin-top: 5px; }
.notes .note { border: 1px solid var(--line); border-left-width: 3px; border-radius: 10px; margin-bottom: 9px; }

/* ===================================================================== misc components */
.mini { margin-bottom: 34px; }
.mini-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.mini-bars { height: 90px; gap: 1px; }
.rule-form { display: grid; gap: 10px; padding: 16px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--surface-2); }
.rule-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rule-line select, .rule-line input { width: auto; margin: 0; }
.rule-line input.num { width: 80px; }
.rule-line .btn { margin-left: auto; }
form.inline { display: inline; }
tr.dim-row td { opacity: .5; }
h3.sub { font-size: 12px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.events { list-style: none; margin: 0; padding: 0; }
.events li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.events li:last-child { border-bottom: 0; }
ul.plain { margin: 0; padding-left: 18px; } ul.plain li { margin-bottom: 6px; }
.crumbs { margin: 0 0 8px; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--text); }
.head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.head h1 { margin: 0; }
.head .btn { margin-left: auto; }
details > summary { cursor: pointer; }
details.group { border-bottom: 1px solid var(--line); padding: 11px 0; }
details.group summary { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
details.group[open] summary { margin-bottom: 8px; }
.danger-zone { border-color: var(--bad-border); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.pager-links { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.pager .btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ===================================================================== login */
.login { max-width: 380px; margin: 14vh auto 0; }
.login h1 { display: flex; align-items: center; gap: 12px; justify-content: center; font-size: 26px; }
.login .card { padding: 26px; box-shadow: 0 10px 30px rgba(16, 24, 40, .08); }

/* ===================================================================== responsive */
@media (max-width: 860px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  main { padding: 18px 16px 48px; }
  header.top { padding: 8px 16px; gap: 10px; flex-wrap: wrap; row-gap: 4px; }
  .top .brand { flex: 1; }
  .top nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a { white-space: nowrap; flex: none; }
  .toolbar input { max-width: none; }
  .tile .v { font-size: 22px; }
  .tabs { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===================================================================== device icons */
.devs { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 7px; cursor: help; }
td.devcell { vertical-align: middle; width: 1%; white-space: nowrap; }
td.devcell .devs { margin-left: -6px; }
.devs.multi { background: var(--warn-bg); box-shadow: inset 0 0 0 1px var(--warn-border); }
.dev { position: relative; display: inline-flex; width: 16px; height: 16px; color: var(--faint); }
.dev svg { width: 16px; height: 16px; }
.dev sup { position: absolute; right: -6px; top: -6px; font-size: 9px; font-weight: 700; color: #b45309; }
.dev-ios, .dev-mac { color: var(--apple); } .dev-android { color: #3ddc84; } .dev-win { color: #0078d4; } .dev-linux { color: #6b7280; }
.devs.multi .dev { opacity: 1; }
.dev-inline { vertical-align: -3px; margin-right: 4px; }

/* device lock */
.nowrap { white-space: nowrap; }
/* blocked device in the users list: red pad behind the icon (dashed = only some apps of that type) */
.dev.dev-locked, .dev.dev-locked-part { box-sizing: content-box; padding: 3px; margin: -3px 0; border-radius: 6px; }
.dev.dev-locked { background: var(--bad); color: #fff; }
.dev.dev-locked-part { background: var(--bad-bg); box-shadow: inset 0 0 0 1.5px var(--bad); }
tr.dev-blocked td { background: var(--bad-bg); }
tr.dev-blocked td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
form.inline { display: inline; margin: 0; }
.lock-btn { display: inline-flex; padding: 6px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--faint); cursor: pointer; transition: color .15s, background .15s, border-color .15s; }
.lock-btn svg { width: 16px; height: 16px; }
.lock-btn:hover { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-border); }
.lock-btn.on { color: var(--bad); background: var(--surface); border-color: var(--bad-border); }
.lock-btn.on:hover { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-border); }

/* ===================================================================== theme toggle */
.theme-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 8px; border-radius: 10px; display: flex; transition: color .15s, background .15s; }
.theme-btn:hover { color: var(--text); background: var(--dim-bg); }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
header.top { backdrop-filter: saturate(140%) blur(8px); -webkit-backdrop-filter: saturate(140%) blur(8px); }


/* ===================================================================== 24x7 heatmap */
.hm-wrap { display: flex; flex-direction: column; gap: 10px; }
.hm-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.hm-meta .pill b { color: var(--text); margin-left: 2px; }
.hm-grid { display: flex; flex-direction: column; gap: 3px; min-width: 540px; }
.hm-head, .hm-row { display: grid; grid-template-columns: 28px repeat(24, 1fr) 74px; gap: 3px; align-items: center; }
.hm-day-lbl { font-size: 12px; font-weight: 600; color: var(--muted); }
.hm-hr { font-size: 10px; color: var(--faint); text-align: center; font-variant-numeric: tabular-nums; }
.hm-sum-lbl { font-size: 11px; font-weight: 600; color: var(--muted); text-align: right; text-transform: uppercase; }
.hm-sum { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hm-cell { height: 18px; border-radius: 4px; background: var(--dim-bg); }
.hm-cell.lvl-1 { background: var(--accent-2); }
.hm-cell.lvl-2 { background: var(--rx); }
.hm-cell.lvl-3 { background: var(--accent); opacity: .7; }
.hm-cell.lvl-4 { background: var(--accent); }
.hm-legend { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.hm-legend .hm-cell { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }


/* share bar: one 100% bar split into segments + legend (categorical palette, fixed order) */
:root { --sv0: #a3a8b5; --sv1: #2a78d6; --sv2: #eb6834; --sv3: #1baf7a; --sv4: #eda100;
        --sv5: #e87ba4; --sv6: #008300; --sv7: #6250d6; --sv8: #e34948; }
:root[data-theme="dark"] { --sv0: #6b7290; --sv1: #3987e5; --sv2: #d95926; --sv3: #199e70; --sv4: #c98500;
        --sv5: #d55181; --sv6: #0ca30c; --sv7: #9085e9; --sv8: #e66767; }
.sv0 { background: var(--sv0); } .sv1 { background: var(--sv1); } .sv2 { background: var(--sv2); }
.sv3 { background: var(--sv3); } .sv4 { background: var(--sv4); } .sv5 { background: var(--sv5); }
.sv6 { background: var(--sv6); } .sv7 { background: var(--sv7); } .sv8 { background: var(--sv8); }
.share-bar { display: flex; gap: 2px; height: 16px; margin: 4px 0 14px; }
.share-bar span { flex-basis: 0; min-width: 3px; transition: opacity .15s; }
.share-bar span:first-child { border-radius: 4px 0 0 4px; }
.share-bar span:last-child { border-radius: 0 4px 4px 0; }
.share-bar span:only-child { border-radius: 4px; }
.share-bar:hover span { opacity: .55; }
.share-bar span:hover { opacity: 1; }
.share-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px 22px;
                grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.sites-brief .share-legend { grid-template-columns: 1fr; }
.share-legend li { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.share-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; align-self: center; }
.share-legend .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-legend b { font-weight: 600; white-space: nowrap; }
.share-legend .pc { width: 34px; text-align: right; flex: none; }

.rule-form input.tm { width: 7.5em; }
.rule-line.days { gap: 4px 14px; }
label.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
label.chk input { width: auto; margin: 0; }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.warn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
