/* S5 Orbit — design system
   Dark, light, and colour themes. Desktop, tablet, and phone layouts. */

:root {
  --bg: #0b0d0a;
  --sidebar: #0e110d;
  --surface: #131711;
  --surface-2: #171c14;
  --surface-3: #1d231a;
  --line: rgba(233, 245, 214, 0.09);
  --line-strong: rgba(233, 245, 214, 0.16);
  --text: #eef3e6;
  --muted: #98a28c;
  --accent: #c9f56a;
  --accent-ink: #101408;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --ok: #9ee37d;
  --warn: #f2c66d;
  --bad: #f2836f;
  --info: #8fc9ff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --font: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Code', monospace;
  color-scheme: dark;
}

[data-theme='light'] {
  --bg: #f4f2e9;
  --sidebar: #edeade;
  --surface: #fffdf7;
  --surface-2: #f8f5ec;
  --surface-3: #efece1;
  --line: rgba(24, 31, 18, 0.11);
  --line-strong: rgba(24, 31, 18, 0.2);
  --text: #171c13;
  --muted: #69705f;
  --accent: #7bb52e;
  --accent-ink: #0e1408;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --ok: #4f8f2f;
  --warn: #a87312;
  --bad: #b6452f;
  --info: #2d6f9f;
  --shadow: 0 20px 50px rgba(44, 50, 30, 0.14);
  color-scheme: light;
}

[data-theme='colour'] {
  --bg: #171126;
  --sidebar: #1b1430;
  --surface: #221a39;
  --surface-2: #291f44;
  --surface-3: #32264f;
  --line: rgba(240, 230, 255, 0.11);
  --line-strong: rgba(240, 230, 255, 0.2);
  --text: #f5eefc;
  --muted: #b1a4c8;
  --accent: #c9f56a;
  --accent-ink: #14100c;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --ok: #a7e88a;
  --warn: #f6c76b;
  --bad: #ff9a86;
  --info: #a8c8ff;
  --shadow: 0 26px 60px rgba(8, 3, 20, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { letter-spacing: -0.03em; font-weight: 800; }
ul { margin: 0; padding: 0; list-style: none; }
code, pre, .mono { font-family: var(--mono); font-size: 0.92em; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { display: inline-block; vertical-align: middle; flex: none; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.app-root { min-height: 100vh; }

.boot-screen, .fatal {
  min-height: 100vh; display: grid; place-items: center; gap: 14px; text-align: center; padding: 24px;
}
.boot-screen p { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.boot-mark {
  width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--accent);
  position: relative; animation: bootpulse 1.4s ease-in-out infinite;
}
.boot-mark::before, .boot-mark::after {
  content: ''; position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); right: -5px; top: -5px;
}
.boot-mark::after { right: auto; left: -5px; top: auto; bottom: -5px; opacity: 0.5; }
@keyframes bootpulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.92); opacity: 0.65; } }
.fatal-card, .public-error-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 40px; max-width: 520px; display: grid; gap: 12px; justify-items: start; text-align: left;
}
.fatal-card h1, .public-error-card h1 { font-size: 26px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, white); }
.btn-ghost { background: var(--surface); border-color: var(--line); }
.btn-danger { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 34%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 24%, transparent); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center;
  border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.icon-btn.danger:hover { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.linklike { background: none; border: 0; padding: 0; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.linklike:hover { color: var(--accent); }

.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field label b { color: var(--accent); }
.field small, .hint { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.input {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); font-size: 13.5px; outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.select-sm { height: 32px; width: auto; min-width: 130px; font-size: 12px; background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; }
.input[type='color'] { padding: 4px; height: 42px; cursor: pointer; }
.input:disabled { opacity: 0.6; cursor: not-allowed; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-stack { display: grid; gap: 14px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
  font-size: 10.5px; font-weight: 600; text-transform: capitalize; color: var(--muted); white-space: nowrap;
}
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 28%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.badge-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 28%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.badge-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 28%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.chip { display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.4s ease; }
.progress-warn i { background: var(--warn); }
.progress-bad i { background: var(--bad); }
.progress-ok i { background: var(--accent); }

.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none; position: sticky; top: 0; height: 100vh;
  background: var(--sidebar); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px 14px; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 18px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--accent); position: relative; flex: none; display: inline-block; }
.brand-mark::before { content: ''; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); right: -4px; top: -4px; }
.brand-mark::after { content: ''; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); left: -3px; bottom: -3px; opacity: 0.5; }
.brand-copy { display: grid; line-height: 1.15; min-width: 0; }
.brand-copy strong { font-size: 15px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-copy small { font-family: var(--mono); font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.nav { display: grid; gap: 16px; overflow-y: auto; flex: 1; padding-bottom: 10px; }
.nav-group { display: grid; gap: 2px; }
.nav-label { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.14em; color: color-mix(in srgb, var(--muted) 75%, transparent); padding: 0 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 500; transition: background 0.15s ease, color 0.15s ease; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.nav-item.active .icon { color: var(--accent); }
.nav-count { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--muted); background: var(--surface-2); padding: 1px 6px; border-radius: 99px; }
.sidebar-foot { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.workspace-card { display: grid; gap: 1px; padding: 10px 11px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.workspace-card .eyebrow { font-size: 8.5px; }
.workspace-card strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-card small { font-size: 10.5px; color: var(--muted); }
.profile { display: flex; align-items: center; gap: 9px; padding: 4px 2px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; letter-spacing: 0.02em; }
.profile-copy { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.profile-copy strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-copy small { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 62px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 28px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 25; }
.crumb { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; min-width: 0; }
.crumb span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.crumb i { opacity: 0.4; font-style: normal; }
.crumb b { color: var(--text); font-weight: 500; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 4px 9px; }
.live i { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); animation: livedot 2s ease-in-out infinite; }
@keyframes livedot { 50% { opacity: 0.4; } }
.top-select { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); }
.top-select select { background: transparent; border: 0; outline: none; font-size: 11.5px; color: var(--text); max-width: 92px; }
.user-popover { position: relative; }
.user-popover summary { list-style: none; cursor: pointer; display: block; }
.user-popover summary::-webkit-details-marker { display: none; }
.user-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 236px; padding: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); z-index: 40; }
.user-menu-head { display: grid; gap: 1px; padding: 9px 10px 11px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-menu-head strong { font-size: 12.5px; }
.user-menu-head span { font-size: 10.5px; color: var(--muted); }
.user-menu-head small { font-family: var(--mono); font-size: 9px; text-transform: uppercase; color: var(--accent); margin-top: 3px; }
.user-menu a, .user-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: none; font-size: 12.5px; color: var(--muted); text-align: left; }
.user-menu a:hover, .user-menu button:hover { background: var(--surface-2); color: var(--text); }
.content { padding: 30px 32px 64px; max-width: 1520px; width: 100%; margin: 0 auto; flex: 1; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(26px, 2.7vw, 36px); line-height: 1.08; margin: 4px 0 6px; }
.page-head p { color: var(--muted); font-size: 13px; max-width: 640px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 17px; display: grid; gap: 5px; min-width: 0; position: relative; overflow: hidden; }
.stat::after { content: ''; position: absolute; right: -18px; top: -24px; width: 80px; height: 80px; border-radius: 50%; background: var(--accent-soft); filter: blur(8px); pointer-events: none; }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat-spark { color: var(--muted); opacity: 0.6; }
.stat strong { font-size: clamp(26px, 2.6vw, 34px); font-weight: 800; letter-spacing: -0.045em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11.5px; color: var(--muted); min-height: 17px; }
.stat .progress { margin-top: 4px; }
.stat-amber::after { background: color-mix(in srgb, var(--warn) 16%, transparent); }
.stat-coral::after { background: color-mix(in srgb, var(--bad) 16%, transparent); }
.stat-blue::after { background: color-mix(in srgb, var(--info) 16%, transparent); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-width: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 16px 18px 13px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { font-size: 15px; letter-spacing: -0.02em; }
.panel-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.panel-meta { font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.panel-body { padding: 18px; }
.panel-link { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.panel-link:hover { color: var(--accent); }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.split-bottom { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; max-width: 460px; padding: 0 12px; height: 38px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); }
.search-box .input { border: 0; background: transparent; padding: 0; height: auto; box-shadow: none; }
.search-box .input:focus { box-shadow: none; }
.toolbar-select { width: auto; min-width: 170px; height: 38px; }
.toolbar-count { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table.compact { min-width: 0; }
.data-table:has(td[colspan]) { min-width: 0; }
.data-table td[colspan] { padding: 0; }
.data-table.compact th, .data-table.compact td { padding-left: 10px; padding-right: 10px; }
.data-table th { text-align: left; padding: 10px 14px; font-family: var(--mono); font-size: 9.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 12.5px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 0.12s ease; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.cell-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-identity > div { display: grid; min-width: 0; }
.cell-stack { display: grid; min-width: 0; line-height: 1.3; }
.cell-stack strong { font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.cell-stack .cell-sub { max-width: 100%; }
.cell-main { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.cell-main:hover, button.cell-main:hover { color: var(--accent); }
.cell-sub { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.mini-avatar { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 800; flex: none; }
.mini-avatar.blue { background: color-mix(in srgb, var(--info) 80%, white); color: #0b1a26; }
.device-glyph { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--line); color: var(--accent); flex: none; }
.row-actions { display: flex; align-items: center; gap: 2px; justify-content: flex-end; white-space: nowrap; }
.usage-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.usage-cell .progress { flex: 1; }
.usage-cell span { font-family: var(--mono); font-size: 10px; color: var(--muted); width: 34px; text-align: right; }
.metric-inline { display: flex; gap: 14px; flex-wrap: wrap; }
.metric-inline span { display: grid; line-height: 1.2; }
.metric-inline small { font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.metric-inline b { font-family: var(--mono); font-size: 11.5px; font-weight: 500; }
.brand-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.chart-labels { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--mono); font-size: 9px; color: var(--muted); }
.chart-empty { display: grid; place-items: center; color: var(--muted); font-size: 11.5px; border: 1px dashed var(--line); border-radius: 10px; }
.chart-legend { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 11px; color: var(--muted); }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; }
.spark { width: 64px; height: 22px; }
.spark-empty { color: var(--muted); }
.gauge { position: relative; margin: 0 auto; }
.gauge svg { width: 100%; display: block; }
.gauge-value { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; align-items: baseline; justify-content: center; gap: 3px; }
.gauge-value strong { font-size: 24px; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.gauge-value span { font-family: var(--mono); font-size: 9px; color: var(--muted); }
.bar-chart { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 78px 1fr 54px; gap: 8px; align-items: center; font-size: 11px; }
.bar-row span { color: var(--muted); }
.bar-track { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar-row b { text-align: right; font-family: var(--mono); font-size: 10.5px; font-weight: 500; }

.alert-list { display: grid; gap: 2px; padding: 8px; }
.alert-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 9px; }
.alert-row:hover { background: var(--surface-2); }
.alert-row > div { flex: 1; display: grid; min-width: 0; }
.alert-row strong { font-size: 12px; font-weight: 600; }
.alert-row span { font-size: 10.5px; color: var(--muted); }
.alert-row > .icon { color: var(--muted); }
.alert-mark { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--warn); }
.alert-mark.critical { background: var(--bad); }
.alert-mark.warning { background: var(--warn); }
.alert-mark.info { background: var(--info); }
.activity-list { display: grid; gap: 3px; padding: 12px 14px; }
.activity-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; }
.activity-icon { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; color: var(--accent); flex: none; }
.activity-row > div { display: grid; line-height: 1.35; }
.activity-row strong { font-size: 11.5px; font-weight: 600; text-transform: capitalize; }
.activity-row span { font-size: 10px; color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dash-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color 0.16s ease, transform 0.16s ease; }
.dash-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.dash-preview { height: 128px; position: relative; padding: 16px; overflow: hidden; background: var(--surface-2); background-image: radial-gradient(var(--line-strong) 1px, transparent 1px); background-size: 14px 14px; border-bottom: 1px solid var(--line); }
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 38px; gap: 6px; height: 100%; }
.preview-tile { border-radius: 5px; background: var(--surface-3); border: 1px solid var(--line); }
.preview-tile.tile-metric, .preview-tile.tile-gauge { border-left: 2px solid var(--accent); }
.preview-tile.tile-timeseries { grid-column: span 2; background: linear-gradient(180deg, var(--accent-soft), var(--surface-3)); }
.preview-empty { grid-column: span 3; border: 1px dashed var(--line-strong); border-radius: 6px; }
.dash-status { position: absolute; top: 10px; right: 10px; }
.dash-body { padding: 14px 16px; display: grid; gap: 5px; flex: 1; }
.dash-body h3 { font-size: 16px; }
.dash-body p { font-size: 11.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 32px; }
.dash-meta { display: flex; gap: 10px; font-family: var(--mono); font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.dash-actions { display: flex; align-items: center; gap: 4px; padding: 10px 12px; border-top: 1px solid var(--line); }
.dash-actions .btn { margin-right: auto; }

.plan-stack { display: grid; gap: 10px; }
.plan-card { border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px; background: var(--surface-2); }
.plan-card.featured { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.plan-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.plan-card h3 { font-size: 14px; }
.plan-card header strong { font-family: var(--mono); font-size: 16px; }
.plan-card header strong small { font-size: 9px; color: var(--muted); }
.plan-card ul { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 10.5px; color: var(--muted); }
.plan-card li::before { content: '·'; color: var(--accent); margin-right: 5px; }
.channel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.channel-card { border: 1px solid var(--line); border-radius: 11px; padding: 13px; background: var(--surface-2); display: grid; gap: 9px; }
.channel-card.disabled { opacity: 0.6; }
.channel-card header { display: flex; align-items: center; gap: 9px; }
.channel-card header > div { flex: 1; display: grid; min-width: 0; line-height: 1.3; }
.channel-card header strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-card header span { font-size: 10px; color: var(--muted); }
.channel-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); flex: none; }
.channel-card code { font-size: 10px; color: var(--muted); background: var(--surface); padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-card footer { display: flex; align-items: center; gap: 3px; }
.channel-card footer .btn { margin-right: auto; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.profile-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.profile-facts > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; display: grid; gap: 1px; }
.profile-facts span { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.profile-facts b { font-size: 12px; }
.detail-pop summary { cursor: pointer; font-size: 11px; color: var(--muted); }
.detail-pop pre { margin: 8px 0 0; padding: 10px; background: var(--surface-2); border-radius: 7px; font-size: 10px; max-width: 320px; overflow: auto; }

.empty { display: grid; place-items: center; text-align: center; gap: 7px; padding: 40px 20px; grid-column: 1 / -1; }
.empty-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.empty h3 { font-size: 15px; }
.empty p { font-size: 12px; color: var(--muted); max-width: 360px; }
.empty .btn { margin-top: 6px; }
.skeleton-list { display: grid; gap: 10px; }
.skeleton { height: 64px; border-radius: 10px; background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 8px; max-width: min(360px, calc(100vw - 36px)); }
.toast { display: flex; align-items: flex-start; gap: 8px; padding: 11px 13px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: 12px; animation: toastin 0.22s ease; }
.toast .icon { color: var(--accent); margin-top: 1px; }
.toast-bad .icon { color: var(--bad); }
.toast-out { opacity: 0; transform: translateY(6px); transition: all 0.3s ease; }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

.modal-open { overflow: hidden; }
.modal-overlay { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; background: rgba(4, 6, 3, 0.66); backdrop-filter: blur(6px); animation: fadein 0.16s ease; }
@keyframes fadein { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: min(88vh, 860px); display: flex; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow); animation: modalin 0.2s ease; overflow: hidden; }
.modal-wide { width: min(820px, 100%); }
.modal-small { width: min(420px, 100%); }
.modal-form { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; }
.modal-head p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 18px 20px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.modal-error { margin: 0 20px 12px; padding: 9px 11px; border-radius: 8px; background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); font-size: 11.5px; }
@keyframes modalin { from { opacity: 0; transform: translateY(10px) scale(0.99); } }
.key-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 13px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 10px; }
.key-box code { flex: 1; min-width: 200px; font-size: 11px; word-break: break-all; color: var(--accent); }
.code-block { margin: 0; padding: 12px; border-radius: 9px; background: #080a07; color: #d7e8bd; font-size: 10.5px; line-height: 1.6; overflow-x: auto; border: 1px solid var(--line); }
.detail-loading { padding: 24px; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.detail-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.detail-metric { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; display: grid; gap: 1px; }
.detail-metric span { font-size: 9px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.detail-metric strong { font-size: 18px; letter-spacing: -0.03em; }
.detail-metric small { font-family: var(--mono); font-size: 8.5px; color: var(--muted); margin-left: 2px; }
.detail-facts { display: grid; gap: 4px; }
.detail-facts > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 9px; background: var(--surface-2); border-radius: 7px; font-size: 11px; }
.detail-facts span { color: var(--muted); }
.detail-section { border-top: 1px solid var(--line); padding-top: 13px; display: grid; gap: 9px; }
.detail-section header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.detail-section h3 { font-size: 13px; }
.command-form { display: flex; gap: 7px; flex-wrap: wrap; }
.command-form .input { flex: 1; min-width: 120px; height: 36px; }
.command-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.command-row small { margin-left: auto; color: var(--muted); font-size: 10px; }
.mini-table-rows { width: 100%; border-collapse: collapse; }
.mini-table-rows td { padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 11px; }

.studio-meta { display: flex; align-items: center; gap: 12px; margin: -8px 0 14px; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.studio-meta .dirty { color: var(--warn); }
.studio { display: grid; grid-template-columns: 212px minmax(0, 1fr) 286px; gap: 13px; align-items: start; }
.palette, .inspector { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
.palette { padding: 13px; }
.palette-head p { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.palette-list { display: grid; gap: 5px; margin: 12px 0; }
.palette-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px; text-align: left; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); cursor: grab; transition: border-color 0.14s ease, background 0.14s ease; }
.palette-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.palette-item:active { cursor: grabbing; }
.palette-icon { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); flex: none; }
.palette-item > span:nth-child(2) { flex: 1; display: grid; min-width: 0; line-height: 1.3; }
.palette-item strong { font-size: 11px; }
.palette-item small { font-size: 9px; color: var(--muted); }
.palette-item > .icon { color: var(--muted); }
.palette-note { display: flex; gap: 7px; padding: 9px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.palette-note .icon { color: var(--accent); flex: none; }
.canvas-wrap { min-width: 0; }
.canvas-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 4px 8px; font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.canvas-toolbar span:first-child { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.canvas { min-height: 580px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 16px 16px; transition: border-color 0.15s ease; }
.canvas.drop-active { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent-soft); }
.canvas-empty { grid-column: 1 / -1; min-height: 540px; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; color: var(--muted); }
.canvas-empty-mark { width: 54px; height: 54px; border-radius: 14px; border: 1px dashed var(--line-strong); display: grid; place-items: center; color: var(--accent); }
.canvas-empty h3 { color: var(--text); font-size: 15px; }
.canvas-empty p { font-size: 11.5px; max-width: 260px; }
.inspector-head { padding: 14px 14px 11px; border-bottom: 1px solid var(--line); }
.inspector-head h3 { font-size: 14px; margin-top: 2px; }
.inspector-head p { font-size: 10px; color: var(--muted); margin-top: 2px; text-transform: capitalize; }
.inspector-body { padding: 12px 14px 14px; display: grid; gap: 10px; }
.inspector-field { display: grid; gap: 4px; }
.inspector-field label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.inspector-field .input { height: 34px; font-size: 12px; }
.inspector-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.widget-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.widget { background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; display: flex; flex-direction: column; min-height: 142px; position: relative; transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease; }
.widget.span-1 { grid-column: span 1; }
.widget.span-2 { grid-column: span 2; }
.widget.span-3 { grid-column: span 3; }
.widget.span-4 { grid-column: span 4; }
.widget.height-1 { min-height: 142px; }
.widget.height-2 { min-height: 236px; }
.widget.height-3 { min-height: 330px; }
.widget:hover { border-color: var(--line-strong); }
.widget.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.widget.dragging { opacity: 0.45; }
.widget-head { position: relative; display: flex; align-items: center; gap: 7px; min-height: 20px; }
.widget-title { font-size: 11.5px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget-status { margin-left: auto; }
.widget-status .badge { padding: 2px 6px; font-size: 9px; }
.widget-state { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--muted); }
.widget-state.online { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.widget-state.warning { background: var(--warn); }
.widget-state.offline { background: var(--bad); }
.widget-drag { color: var(--muted); cursor: grab; }
.widget-remove { position: absolute; right: 0; top: 50%; transform: translateY(-50%); border: 0; background: var(--panel); color: var(--muted); padding: 2px; display: grid; place-items: center; border-radius: 5px; opacity: 0; transition: opacity 0.15s; }
.widget:hover .widget-remove, .widget.selected .widget-remove, .widget:focus-within .widget-remove { opacity: 1; }
.widget-remove:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.widget-body { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; padding-top: 6px; }
.widget-foot { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding-top: 6px; opacity: 0.8; }
.metric-value { display: flex; align-items: baseline; gap: 5px; }
.metric-value strong { font-size: clamp(30px, 3.4vw, 44px); font-weight: 800; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-value span { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.metric-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; margin-top: 6px; }
.metric-foot > span { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget-placeholder { display: grid; place-items: center; gap: 1px; }
.widget-placeholder strong { font-size: 28px; letter-spacing: -0.04em; }
.widget-placeholder span { font-family: var(--mono); font-size: 9px; color: var(--muted); }
.widget-placeholder small { font-size: 9px; color: var(--muted); margin-top: 4px; }
.health-list { display: grid; gap: 5px; }
.health-list li { display: flex; align-items: center; gap: 7px; font-size: 10.5px; }
.health-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.health-list small { color: var(--muted); font-size: 8.5px; }
.mini-table { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; }
.mini-table > div { display: flex; justify-content: space-between; gap: 5px; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.mini-table span { font-size: 9.5px; color: var(--muted); }
.mini-table strong { font-family: var(--mono); font-size: 10px; font-weight: 500; }
.mini-table small { font-size: 8px; color: var(--muted); margin-left: 1px; }
.switch-widget { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.switch-state { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); }
.switch-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.switch-state i.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 16%, transparent); }
.switch-btn { width: 46px; height: 25px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface-3); padding: 2px; display: flex; transition: background 0.16s ease; }
.switch-btn i { width: 19px; height: 19px; border-radius: 50%; background: var(--muted); transition: transform 0.18s ease, background 0.18s ease; }
.switch-btn.on { background: var(--accent); border-color: transparent; justify-content: flex-end; }
.switch-btn.on i { background: var(--accent-ink); }
.switch-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.switch-widget small { font-size: 8.5px; color: var(--muted); }

.auth { min-height: 100vh; display: grid; grid-template-columns: 1.06fr 0.94fr; background: var(--bg); }
.auth-brand { position: relative; overflow: hidden; padding: 34px 46px; display: flex; flex-direction: column; justify-content: space-between; background: #0c0f0a; color: #eef3e6; border-right: 1px solid rgba(255, 255, 255, 0.07); }
.auth-brand::before { content: ''; position: absolute; inset: 0; background: radial-gradient(900px 500px at 12% 8%, rgba(201, 245, 106, 0.14), transparent 60%), radial-gradient(700px 500px at 88% 92%, rgba(143, 201, 255, 0.1), transparent 60%); }
.auth-top { position: relative; display: flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: 0.02em; z-index: 2; }
.auth-pitch { position: relative; z-index: 2; max-width: 540px; }
.auth-pitch .eyebrow { color: #c9f56a; }
.auth-pitch h1 { font-size: clamp(38px, 5.2vw, 66px); line-height: 0.99; letter-spacing: -0.055em; margin: 14px 0 16px; }
.auth-pitch h1 em { font-style: normal; color: #c9f56a; }
.auth-pitch p { color: #a9b39c; font-size: 13.5px; line-height: 1.65; max-width: 440px; }
.auth-points { display: grid; gap: 8px; margin-top: 22px; }
.auth-points li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #c3cdb5; }
.auth-points .icon { color: #c9f56a; }
.auth-orbit { position: absolute; right: -120px; bottom: -100px; width: 440px; height: 440px; z-index: 1; opacity: 0.55; }
.auth-orbit i { position: absolute; inset: 0; border: 1px solid rgba(201, 245, 106, 0.18); border-radius: 50%; }
.auth-orbit i:nth-child(2) { inset: 55px; }
.auth-orbit i:nth-child(3) { inset: 115px; }
.auth-orbit b { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #c9f56a; top: 26px; left: 50%; box-shadow: 0 0 30px rgba(201, 245, 106, 0.6); }
.auth-foot { position: relative; z-index: 2; font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; color: #6f7a63; text-transform: uppercase; }
.auth-panel { display: grid; place-items: center; padding: 34px; }
.auth-card { width: min(380px, 100%); display: grid; gap: 10px; }
.auth-card h2 { font-size: 28px; letter-spacing: -0.04em; }
.auth-sub { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.auth-card form { display: grid; gap: 12px; }
.login-error { padding: 9px 11px; border-radius: 8px; background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 28%, transparent); font-size: 11.5px; }
.demo-block { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.demo-block > span { font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.demo-list { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-list button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 10px; font-size: 10.5px; color: var(--muted); }
.demo-list button:hover { border-color: var(--accent); color: var(--text); }
.auth-help { font-size: 10.5px; color: var(--muted); margin-top: 14px; }

.public-page { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.public-head { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 26px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.public-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.public-brand > div { display: grid; line-height: 1.2; min-width: 0; }
.public-brand strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.public-brand small { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.public-actions { display: flex; align-items: center; gap: 10px; }
.public-updated { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; }
.public-main { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 30px 26px 50px; }
.public-title { margin-bottom: 20px; }
.public-title h1 { font-size: clamp(24px, 3vw, 34px); margin: 4px 0 5px; }
.public-title p { color: var(--muted); font-size: 12.5px; max-width: 640px; }
.public-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 26px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted); flex-wrap: wrap; }
.public-foot a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.public-foot a:hover { color: var(--accent); }
.public-error { display: grid; place-items: center; padding: 24px; }
.public-error-card { max-width: 460px; }

.mobile-nav { display: none; }
.mobile-more { position: relative; }
.mobile-sheet { position: absolute; right: 8px; bottom: 66px; width: min(240px, calc(100vw - 24px)); padding: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 13px; box-shadow: var(--shadow); display: grid; gap: 2px; }
.sheet-head { display: grid; padding: 8px 9px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.sheet-head strong { font-size: 12.5px; }
.sheet-head span { font-size: 10px; color: var(--muted); }
.mobile-sheet a, .mobile-sheet button { display: flex; align-items: center; gap: 9px; padding: 9px; border: 0; border-radius: 8px; background: none; font-size: 12px; color: var(--muted); text-align: left; }
.mobile-sheet a:hover, .mobile-sheet button:hover { background: var(--surface-2); color: var(--text); }

@media (max-width: 1280px) {
  .studio { grid-template-columns: 196px minmax(0, 1fr) 264px; }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1120px) {
  .sidebar { width: 74px; padding: 16px 10px 12px; }
  .brand { justify-content: center; padding: 2px 0 16px; }
  .brand-copy, .nav-label, .workspace-card, .profile-copy, .profile .icon-btn { display: none; }
  .nav-item { justify-content: center; padding: 0; height: 40px; }
  .nav-item span, .nav-count { display: none; }
  .profile { justify-content: center; }
  .content { padding: 24px 22px 54px; }
  .topbar { padding: 0 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .split-bottom { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .widget-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .widget.span-3, .widget.span-4 { grid-column: span 2; }
  .studio { grid-template-columns: 1fr; }
  .palette, .inspector { position: static; max-height: none; }
  .palette-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .palette-item { align-items: flex-start; }
  .palette-item small { display: none; }
  .palette-note { display: none; }
  .inspector-body { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .inspector-head { border-bottom: 0; }
  .inspector-body .btn { grid-column: 1 / -1; }
  .canvas { min-height: 420px; }
  .canvas-empty { min-height: 380px; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .topbar { height: 56px; padding: 0 14px; }
  .crumb span { max-width: 100px; }
  .top-select { display: none; }
  .live { padding: 4px 7px; font-size: 9px; }
  .live [data-live-label] { display: none; }
  .content { padding: 18px 14px 96px; }
  .page-head { margin-bottom: 18px; gap: 12px; }
  .page-head h1 { font-size: 27px; }
  .page-head p { font-size: 12px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .stats, .stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat { padding: 13px 14px; }
  .stat strong { font-size: 27px; }
  .stat-sub { font-size: 10.5px; }
  .dash-grid, .channel-grid { grid-template-columns: 1fr; }
  .form-grid, .check-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-metrics { grid-template-columns: repeat(2, 1fr); }
  .public-main { padding: 20px 14px 40px; }
  .public-head { padding: 0 14px; height: 58px; }
  .public-updated { display: none; }
  .mobile-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(18px); border-top: 1px solid var(--line); align-items: stretch; }
  .mobile-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 8.5px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
  .mobile-nav-item.active { color: var(--accent); }
  .mobile-nav-item .icon { width: 19px; height: 19px; }
  .mobile-more { flex: 1; display: flex; }
  .mobile-more > summary { flex: 1; list-style: none; cursor: pointer; }
  .mobile-more > summary::-webkit-details-marker { display: none; }
  .mobile-more-icon { display: grid; place-items: center; height: 19px; }
  .toast-root { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .modal-overlay { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-wide { width: 100%; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel { padding: 24px; min-height: 100vh; }
  .auth-card { width: min(400px, 100%); }
  .studio { gap: 10px; }
  .palette-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .palette-item > .icon { display: none; }
  .inspector-body { grid-template-columns: 1fr; }
  .canvas { padding: 8px; min-height: 360px; }
  .widget-grid { gap: 8px; }
  .public-grid { grid-template-columns: 1fr; }
  .widget.span-2, .widget.span-3, .widget.span-4 { grid-column: span 1; }
  .widget.height-2, .widget.height-3 { min-height: 220px; }
}
@media (max-width: 520px) {
  .stats, .stats-3 { grid-template-columns: 1fr; }
  .stat { grid-template-columns: 1fr auto; align-items: center; }
  .stat .eyebrow, .stat-sub { grid-column: 1; }
  .stat strong { grid-row: 1 / span 2; grid-column: 2; font-size: 30px; }
  .stat .progress { grid-column: 1 / -1; }
  .stat::after { display: none; }
  .page-actions .btn { padding: 0 10px; font-size: 12px; }
  .dash-preview { height: 104px; }
  .preview-grid { grid-auto-rows: 32px; }
  .key-box { flex-direction: column; align-items: stretch; }
  .key-box code { min-width: 0; }
  .modal-head, .modal-body, .modal-foot { padding-left: 15px; padding-right: 15px; }
  .modal-error { margin-left: 15px; margin-right: 15px; }
  .detail-metrics { grid-template-columns: 1fr 1fr; }
  .public-title h1 { font-size: 23px; }
  .public-brand small { max-width: 150px; }
  .palette-list { grid-template-columns: 1fr; }
  .palette-item small { display: block; }
  .toolbar-count { width: 100%; margin-left: 0; }
  .search-box { max-width: none; }
}
@media (max-width: 380px) {
  .content { padding-left: 11px; padding-right: 11px; }
  .page-head h1 { font-size: 24px; }
  .btn { height: 36px; }
}

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

/* Feature increment: branding, signup, simulation, alarms, maps and clocks */
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.logo-editor { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.logo-preview { width: 84px; height: 84px; flex: 0 0 84px; display: grid; place-items: center; overflow: hidden; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-editor-fields { flex: 1; min-width: 0; display: grid; gap: 8px; }
.logo-editor-fields .field { margin: 0; }
.logo-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.logo-actions .btn { padding: 0 9px; height: 32px; font-size: 12px; }
.modal-crop { max-width: 500px; width: min(500px, 94vw); }
.crop-stage { position: relative; width: 380px; max-width: 100%; margin: 0 auto; border-radius: 12px; overflow: hidden; background: #101310; touch-action: none; }
.crop-stage canvas { display: block; width: 100%; height: auto; cursor: grab; }
.crop-guide { position: absolute; inset: 0; pointer-events: none; border: 2px solid rgba(255,255,255,.85); box-shadow: 0 0 0 999px rgba(0,0,0,.38) inset; border-radius: 12px; }
.crop-controls { display: flex; align-items: center; gap: 12px; padding: 12px 18px 0; flex-wrap: wrap; }
.crop-controls label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex: 1; }
.crop-controls input[type="range"] { flex: 1; accent-color: var(--accent); }
.auth-signup-page .auth-brand-compact { min-height: 100vh; }
.auth-panel-wide { display: grid; place-items: center; padding: 28px; }
.auth-card-wide { max-width: 560px; }
.signup-types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 14px; }
.signup-type { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface-2); }
.signup-type:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.signup-type input { margin-top: 3px; accent-color: var(--accent); }
.signup-type span { display: grid; gap: 2px; }
.signup-type b { font-size: 12px; }
.signup-type small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.auth-signup { margin-top: 10px; }
.sim-picker { margin-top: 14px; }
.sim-template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.sim-template { display: flex; gap: 8px; align-items: flex-start; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); cursor: pointer; }
.sim-template:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.sim-template input { margin-top: 3px; accent-color: var(--accent); }
.sim-template span { display: grid; gap: 2px; min-width: 0; }
.sim-template b { font-size: 11px; }
.sim-template small { color: var(--muted); font-size: 10px; line-height: 1.3; }
.sim-template em { color: var(--accent); font-size: 9px; font-style: normal; text-transform: uppercase; letter-spacing: .06em; }
.method-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sim-variable-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 16px 0 6px; }
.sim-variable-head p { margin: 3px 0 0; }
.sim-variable-wrap { min-height: 280px; max-height: min(52vh, 460px); overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.sim-variable-table { min-width: 980px; }
.sim-variable-table th { font-size: 9px; padding: 7px 5px; }
.sim-variable-table td { padding: 4px 5px; }
.input-sm { height: 30px; padding: 0 7px; font-size: 11px; }
.connection-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 8px; }
.connection-meta .muted { font-size: 11px; line-height: 1.4; }
.detail-timing { margin-top: 4px; }
.map-canvas { position: relative; overflow: hidden; border-radius: 8px; min-height: 150px; height: 100%; background: #18221d; isolation: isolate; }
.map-tiles { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.map-tiles img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) contrast(1.05); }
.map-marker { position: absolute; transform: translate(-50%, -50%); z-index: 3; display: grid; place-items: center; pointer-events: none; }
.map-marker i { width: 13px; height: 13px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 5px rgba(201,245,106,.22); }
.map-marker b { margin-top: 4px; font-size: 9px; color: #fff; background: rgba(10,14,11,.72); padding: 2px 5px; border-radius: 4px; white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.map-radius { position: absolute; transform: translate(-50%, -50%); z-index: 2; border: 1px solid rgba(201,245,106,.65); border-radius: 50%; background: rgba(201,245,106,.10); pointer-events: none; }
.map-toolbar { position: absolute; right: 7px; top: 7px; z-index: 4; display: grid; gap: 3px; }
.map-toolbar button { width: 25px; height: 25px; border: 1px solid rgba(255,255,255,.35); background: rgba(9,13,10,.72); color: #fff; border-radius: 5px; font-size: 16px; line-height: 1; cursor: pointer; }
.map-toolbar button:hover { background: rgba(9,13,10,.95); }
.map-layers { position: absolute; left: 7px; top: 7px; z-index: 4; }
.map-layers select { background: rgba(9,13,10,.78); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 5px; font-size: 9px; padding: 4px 5px; }
.map-coords { position: absolute; left: 7px; bottom: 6px; z-index: 4; color: #fff; background: rgba(9,13,10,.7); padding: 2px 5px; border-radius: 4px; font-size: 8px; letter-spacing: .02em; }
.clock-widget { display: grid; gap: 3px; align-content: center; height: 100%; min-height: 110px; }
.clock-widget .clock-alias { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.clock-widget strong { font-size: clamp(26px, 4vw, 42px); line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.clock-widget > span:not(.clock-alias) { font-size: 12px; color: var(--text); }
.clock-widget small { font-size: 9px; color: var(--muted); }
.widget-map .widget-body, .widget-clock .widget-body { min-height: 0; }
.widget-map .widget-body { padding: 0; overflow: hidden; }
.widget-map .map-canvas { border-radius: 0; min-height: 100%; }
.widget-clock .widget-body { display: grid; align-items: stretch; }
.callout {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text);
}
.callout > svg { color: var(--accent); flex: 0 0 auto; margin-top: 1px; }
.callout strong { display: block; font-size: 13px; margin-bottom: 3px; }
.callout span { color: var(--muted); font-size: 12px; line-height: 1.45; }
@media (max-width: 900px) {
  .sim-template-grid, .method-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .logo-editor { flex-direction: column; }
  .logo-preview { width: 70px; height: 70px; flex-basis: 70px; }
  .signup-types, .sim-template-grid, .method-grid { grid-template-columns: 1fr; }
  .sim-variable-head { align-items: flex-start; flex-direction: column; }
  .auth-panel-wide { padding: 16px; }
  .crop-stage { width: 100%; }
  .map-canvas { min-height: 190px; }
}

/* Assets, OTA and reports */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(240px, .65fr); gap: 22px; align-items: start; }
.detail-grid h3 { margin: 4px 0; font-size: 16px; }
.relation-list { display: grid; gap: 8px; margin-top: 14px; }
.relation-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.relation-row > div { min-width: 0; flex: 1; }
.relation-row strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relation-add { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); display: grid; gap: 10px; }
.relation-add .field { margin: 0; }
.relation-add .btn { justify-self: start; margin-top: 4px; }
.check-list { display: grid; gap: 8px; max-height: 320px; overflow: auto; padding: 2px; }
.check-list .check { padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); align-items: flex-start; }
.check-list .check span { display: grid; gap: 2px; }
.check-list .check small { color: var(--muted); font-size: 11px; }
.rollout-cell { display: grid; gap: 5px; min-width: 110px; }
.rollout-cell .cell-sub { font-size: 11px; }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .relation-add { order: -1; }
}

@media (max-width: 640px) {
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; justify-content: center; }
  .relation-row { flex-wrap: wrap; }
  .relation-row .icon-btn { margin-left: auto; }
}

/* Audit fixes: truthful connection state, loading skeleton, and phone tables */
.live[data-live-state="live"] { color: var(--ok, #2f7d4f); }
.live[data-live-state="live"] i { background: var(--ok, #2f7d4f); animation: livedot 2s infinite; }
.live[data-live-state="reconnecting"] { color: #9a6412; }
.live[data-live-state="reconnecting"] i { background: #d99a2b; animation: none; }
.live[data-live-state="offline"] { color: var(--bad, #b23b3b); }
.live[data-live-state="offline"] i { background: var(--bad, #b23b3b); animation: none; }
.live [data-live-label] { white-space: nowrap; }
.page-skeleton { display: grid; gap: 18px; padding: 8px 0; }
.skeleton-head { height: 64px; width: min(520px, 72%); }
.skeleton-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.skeleton-row .skeleton { height: 108px; }
.skeleton-panel { height: 340px; }
.cell-state-mobile { display: none; margin-top: 7px; }
@media (max-width: 640px) {
  .live { display: inline-flex !important; }
  .live [data-live-label] { display: none; }
  .live::after { content: attr(data-live-state); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
  .data-table { min-width: 0; width: 100%; }
  .data-table .col-tenant,
  .data-table .col-readings,
  .data-table .col-firmware,
  .data-table .col-plan,
  .data-table .col-devices,
  .data-table .col-messages,
  .data-table .col-allowance,
  .data-table .col-posture,
  .data-table .col-asset-type,
  .data-table .col-parent,
  .data-table .col-children,
  .data-table .col-created,
  .data-table .col-ota-type,
  .data-table .col-ota-size,
  .data-table .col-ota-checksum,
  .data-table .col-updated,
  .data-table .col-message,
  .data-table .col-frequency,
  .data-table .col-recipients,
  .data-table .col-last-run,
  .data-table .col-report-tenant,
  .data-table .col-report-devices,
  .data-table .col-report-alarms,
  .data-table .col-outbox-target,
  .data-table .col-outbox-error { display: none; }
  .data-table .col-state { display: none; }
  .data-table th, .data-table td { padding: 11px 9px; }
  .data-table td .cell-state-mobile { display: inline-flex; }
  .table-wrap { position: relative; }
}

/* Audit fixes: honest delivery state, filters and demo provenance */
.callout-warn { border-color: color-mix(in srgb, #d99a2b 45%, var(--line)); background: color-mix(in srgb, #d99a2b 9%, var(--surface)); }
.channel-health { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.channel-card footer { align-items: center; gap: 8px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.segmented button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 7px; cursor: pointer; }
.segmented button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm, 0 1px 2px rgb(0 0 0 / .08)); }
.demo-note { display: flex; align-items: center; gap: 7px; margin: -6px 0 0; color: var(--muted); font-size: 12px; }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .segmented button { padding: 6px 8px; }
  .panel-foot { flex-wrap: wrap; }
}


/* Managed device gateway */
.gateway-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 18px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}
.gateway-title { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-weight: 650; }
.gateway-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.gateway-chip b { color: var(--text); font-weight: 650; }
.gateway-state {
  display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 99px;
  font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em;
}
.gateway-state.is-live { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.gateway-state.is-down { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.gateway-meta { margin-left: auto; }
.gateway-note {
  display: inline-flex; align-items: flex-start; gap: 6px;
  flex-basis: 100%; color: var(--muted); font-size: 12px; line-height: 1.45;
}
.gateway-note .icon { margin-top: 2px; }
@media (max-width: 720px) {
  .gateway-strip { align-items: flex-start; flex-direction: column; gap: 6px; }
  .gateway-meta { margin-left: 0; }
}

/* Entity actions and typed variables */
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.detail-actions .btn { white-space: nowrap; }
.compact-table td { vertical-align: top; }
.compact-table .cell-sub { display: block; margin-top: 3px; }
.compact-table .mono, .mono { font-family: var(--mono); font-size: 11px; letter-spacing: -0.02em; }
.form-grid .hint, .hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-error { color: var(--bad); }
.cell-sub .mono { opacity: .8; }
.row-actions { white-space: nowrap; }
.row-actions .icon-btn { margin-left: 2px; }
.sim-variable-table { min-width: 980px; }
.sim-variable-table .input-sm { min-width: 74px; }
@media (max-width: 720px) {
  .detail-actions { gap: 6px; }
  .detail-actions .btn { flex: 1 1 auto; justify-content: center; }
  .compact-table { min-width: 760px; }
}

/* Variables & controls: a tall, internally scrolling list instead of a short dialog */
.modal-variables {
  width: min(1040px, 100%);
  height: min(95vh, 860px);
  max-height: 96vh;
}
.modal-variables .modal-form { height: 100%; }
.modal-variables .modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
}
.modal-variables .variables-table-wrap {
  flex: 1 1 auto;
  min-height: 280px;
  max-height: none;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.modal-variables .variables-table-wrap .data-table { min-width: 860px; }
.modal-variables .variables-table-wrap thead th { position: sticky; top: 0; z-index: 2; }
@media (max-width: 720px) {
  .modal-variables { width: 100%; height: 96vh; max-height: 96vh; }
  .modal-variables .variables-table-wrap { min-height: 260px; }
}

/* Device health and diagnostics */
.health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.health-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 12px;
  display: grid;
  gap: 4px;
}
.health-card strong { font-size: 18px; }
.health-card small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.health-card.health-bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.text-bad { color: var(--bad); }
.health-heading { margin: 16px 0 8px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.health-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.health-lists h4 { margin: 0 0 6px; font-size: 13px; }
.health-list { display: grid; gap: 7px; }
.health-list li { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.health-diagnostics { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.health-diagnostics-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; background: var(--surface-2); }
.health-diagnostics-head .health-heading { margin: 0; }
.health-diagnostics pre { margin: 0; padding: 12px; max-height: 220px; overflow: auto; font-size: 11px; line-height: 1.5; white-space: pre-wrap; }
@media (max-width: 760px) {
  .health-grid { grid-template-columns: 1fr 1fr; }
  .health-lists { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .health-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   v2 UI/UX pass — resizable dialogs, interactive trends, theme picker and the
   live waveform preview inside variable setup.
   --------------------------------------------------------------------------- */

body { font-size: calc(14px * var(--font-scale, 1)); }
.btn { font-size: calc(13px * var(--font-scale, 1)); }
.btn-sm { font-size: calc(12px * var(--font-scale, 1)); }
.input { font-size: calc(13.5px * var(--font-scale, 1)); }
.field label { font-size: calc(12px * var(--font-scale, 1)); }
.field small, .hint { font-size: calc(11.5px * var(--font-scale, 1)); }
.nav-item { font-size: calc(13px * var(--font-scale, 1)); }
.data-table td { font-size: calc(12.5px * var(--font-scale, 1)); }
.data-table th { font-size: calc(9.5px * var(--font-scale, 1)); }
.page-head p { font-size: calc(13px * var(--font-scale, 1)); }

/* Dialog chrome ------------------------------------------------------------ */
.modal { position: relative; }
.modal-form { height: 100%; min-height: 0; }
.modal-body { flex: 1 1 auto; min-height: 0; }
.modal.is-resized { max-height: none; }
.modal-resize {
  position: absolute; right: 3px; bottom: 3px; width: 20px; height: 20px;
  cursor: nwse-resize; touch-action: none; border-radius: 4px;
  background:
    linear-gradient(135deg, transparent 0 48%, var(--muted) 49% 56%, transparent 57%) 3px 3px / 12px 12px no-repeat,
    linear-gradient(135deg, transparent 0 62%, var(--muted) 63% 72%, transparent 73%) 8px 8px / 12px 12px no-repeat;
  opacity: .55; transition: opacity .15s ease;
}
.modal-resize:hover, .modal-resize:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 1px; }

/* Trend gadget ------------------------------------------------------------- */
.trend-chart { display: flex; flex-direction: column; gap: 7px; width: 100%; min-width: 0; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 5px 8px; align-items: center; }
.trend-legend-item {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  border: 1px solid var(--line); border-radius: 99px; padding: 3px 8px;
  background: color-mix(in srgb, var(--surface-2) 75%, transparent);
  font-size: 10.5px; line-height: 1.3;
}
.trend-legend-item i { width: 8px; height: 8px; border-radius: 99px; flex: 0 0 auto; }
.trend-legend-item b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.trend-legend-item small { color: var(--muted); font-family: var(--mono); font-size: 9.5px; white-space: nowrap; }
.trend-plot {
  position: relative; width: 100%; min-width: 0;
  border: 1px solid var(--line); border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  overflow: hidden;
}
.trend-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.trend-grid-line { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.trend-y-axis { position: absolute; inset: 0 auto 0 0; width: 50px; pointer-events: none; z-index: 1; }
.trend-y-axis span {
  position: absolute; right: 7px; transform: translateY(-50%);
  color: var(--muted); font-family: var(--mono); font-size: 8.5px;
  background: color-mix(in srgb, var(--surface) 76%, transparent); padding: 0 2px; border-radius: 3px;
}
.trend-x-axis { display: flex; justify-content: space-between; gap: 8px; padding: 0 12px 0 52px; color: var(--muted); font-family: var(--mono); font-size: 8.5px; }
.trend-x-axis span:nth-child(2) { text-align: center; }
.trend-x-axis span:last-child { text-align: right; }
.trend-crosshair { position: absolute; width: 1px; background: var(--line-strong); border-left: 1px dashed color-mix(in srgb, var(--text) 32%, transparent); pointer-events: none; z-index: 3; }
.trend-dots { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.trend-dots i { position: absolute; width: 7px; height: 7px; border-radius: 99px; border: 2px solid var(--surface); transform: translate(-50%, -50%); box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.trend-tooltip {
  position: absolute; z-index: 8; min-width: 175px; max-width: 250px;
  padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 94%, var(--bg));
  box-shadow: 0 12px 32px rgba(0,0,0,.34); pointer-events: none;
}
.trend-tooltip-time { color: var(--muted); font-family: var(--mono); font-size: 8.5px; letter-spacing: .01em; margin-bottom: 5px; }
.trend-tooltip-row { display: flex; align-items: center; gap: 7px; font-size: 10.5px; line-height: 1.7; }
.trend-tooltip-row i { width: 7px; height: 7px; border-radius: 99px; flex: 0 0 auto; }
.trend-tooltip-row span { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-tooltip-row b { margin-left: auto; font-family: var(--mono); font-size: 10px; white-space: nowrap; }
.trend-tooltip-row b small { color: var(--muted); font-size: 8px; }
.trend-empty { display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); font-size: 11px; padding: 18px; text-align: center; }
.trend-fluid { height: 100%; min-height: 120px; }
.trend-fluid .trend-plot { flex: 1 1 auto; min-height: 88px; }
.trend-fluid .trend-legend { flex: 0 0 auto; }
.trend-no-fill .trend-series path { stroke-width: 2; }

/* Trend configuration disclosure inside the gadget dialog */
.modal-trend { width: min(1080px, 100%); height: min(94vh, 900px); }
.modal-trend .modal-body { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; overflow-x: hidden; }
.modal-trend .trend-canvas { flex: 1 1 auto; min-height: 360px; display: flex; }
.modal-trend .trend-canvas > .trend-chart { flex: 1; }
.modal-trend .trend-canvas .trend-plot { flex: 1 1 auto; min-height: 300px; }
.trend-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.trend-modal-head .eyebrow { display: block; margin-bottom: 3px; }
.trend-config { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); overflow: hidden; flex: 0 0 auto; }
.trend-config > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; font-size: 12px; font-weight: 650; list-style: none; }
.trend-config > summary::-webkit-details-marker { display: none; }
.trend-config > summary::before { content: '▸'; color: var(--muted); margin-right: 2px; transition: transform .15s ease; }
.trend-config[open] > summary::before { transform: rotate(90deg); }
.trend-config > summary span { margin-right: auto; }
.trend-config > summary b { color: var(--muted); font-family: var(--mono); font-size: 9.5px; font-weight: 500; }
.trend-config-body { display: grid; gap: 8px; padding: 0 12px 12px; max-height: 250px; overflow: auto; }
.trend-option-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 14px; }
.trend-option { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 4px 5px; border-radius: 7px; }
.trend-option:hover { background: var(--surface); }
.trend-option > input[type='checkbox'] { width: 15px; height: 15px; accent-color: var(--accent); flex: 0 0 auto; }
.trend-option > label { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1; cursor: pointer; font-size: 11px; }
.trend-option > label span:last-child { display: grid; min-width: 0; }
.trend-option > label b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.trend-option > label small { color: var(--muted); font-family: var(--mono); font-size: 8.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-option-dot { width: 9px; height: 9px; border-radius: 99px; flex: 0 0 auto; box-shadow: 0 0 0 1px var(--line-strong); }
.trend-color-input { width: 28px; height: 24px; min-width: 28px; padding: 2px; border-radius: 5px; cursor: pointer; }
.trend-color-input:disabled { opacity: .3; }
.trend-footnote { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; flex: 0 0 auto; }
.trend-footnote .icon { color: var(--accent); }

/* Device health ----------------------------------------------------------- */
.modal-health { width: min(1120px, 100%); height: min(94vh, 920px); }
.modal-health .modal-body {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-auto-rows: auto; gap: 12px; overflow: auto;
  align-content: start;
}
.modal-health .health-grid { grid-column: 1 / -1; margin-bottom: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.health-section {
  display: flex; flex-direction: column; min-height: 275px; min-width: 0;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface);
  overflow: hidden;
}
.health-section-events, .health-section-diagnostics { grid-column: 1 / -1; min-height: 220px; }
.health-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex: 0 0 auto; }
.health-section-head h3 { font-size: 13px; margin: 0; }
.health-section-head p { color: var(--muted); font-size: 10px; margin-top: 2px; line-height: 1.4; }
.health-section-actions { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.health-focus-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.modal-health .modal-body.health-focused { display: flex; flex-direction: column; gap: 0; overflow: hidden; }
.modal-health .modal-body.health-focused .health-grid { display: none; }
.modal-health .modal-body.health-focused .health-section { display: none; }
.modal-health .modal-body.health-focused .health-section.is-focused {
  display: flex; flex: 1 1 auto; min-height: 0; height: 100%; border-radius: 0; border-left: 0; border-right: 0;
}
.modal-health .modal-body.health-focused .health-section.is-focused .health-section-body,
.modal-health .modal-body.health-focused .health-section.is-focused .health-lists {
  flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto;
}
.health-section-body { flex: 1 1 auto; min-height: 190px; max-height: 360px; overflow: auto; }
.health-section-body.table-wrap { max-height: none; }
.health-section-variables .health-section-body { min-height: 210px; }
.health-empty { padding: 18px 14px; }
.health-list { display: grid; gap: 6px; padding: 10px 12px; }
.health-list li { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.health-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.health-name:hover { color: var(--accent); }
.health-list small { color: var(--muted); font-size: 9px; }
.health-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 0 12px 12px; max-height: 300px; }
.health-lists h4 { margin: 8px 0 4px; font-size: 12px; }
.health-section-events .health-list { padding: 0; }
.metric-chip-list { display: flex; flex-wrap: wrap; gap: 4px; }
.metric-chip {
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2);
  padding: 2px 6px; color: var(--muted); font-size: 9.5px; line-height: 1.45;
  transition: border-color .12s ease, color .12s ease;
}
.metric-chip:hover, .metric-chip:focus-visible { border-color: var(--accent); color: var(--text); }
.metric-chip b { color: var(--text); font-family: var(--mono); font-size: 9.5px; }
.health-diagnostics { border: 0; margin: 0; }
.health-diagnostics summary { padding: 10px 12px; cursor: pointer; color: var(--muted); font-size: 11px; }
.health-diagnostics pre { margin: 0 12px 12px; }
.health-section-diagnostics { min-height: 0; }

/* Theme picker ------------------------------------------------------------ */
.theme-picker { display: grid; gap: 12px; }
.theme-preset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.theme-preset {
  position: relative; display: flex; flex-direction: column; gap: 7px;
  padding: 9px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); cursor: pointer; min-width: 0;
  transition: border-color .15s ease, background .15s ease;
}
.theme-preset:hover { border-color: var(--line-strong); }
.theme-preset.is-selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-preset > input { position: absolute; opacity: 0; pointer-events: none; }
.theme-swatch { display: flex; height: 30px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.theme-swatch i { flex: 1; }
.theme-preset-copy { display: grid; gap: 1px; min-width: 0; }
.theme-preset-copy b { font-size: 11.5px; }
.theme-preset-copy small { color: var(--muted); font-size: 9px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.theme-check { position: absolute; top: 4px; right: 6px; color: var(--accent); font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.theme-advanced { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.theme-advanced > summary { cursor: pointer; padding: 9px 11px; font-size: 11.5px; color: var(--muted); }
.theme-advanced-body { display: grid; gap: 10px; padding: 0 11px 11px; }
.theme-custom-toggle { font-size: 11.5px; }
.theme-color-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.theme-color-field { display: grid; gap: 4px; font-size: 10px; color: var(--muted); }
.theme-color-field input { width: 100%; height: 31px; padding: 2px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.theme-type-grid { grid-template-columns: 1fr 1fr; }
.theme-type-grid .input { height: 34px; font-size: 11px; }

/* Live waveform preview in variable setup --------------------------------- */
.modal-variable-editor { width: min(980px, 100%); }
.wave-preview {
  display: grid; gap: 9px; padding: 13px; margin-top: 2px;
  border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 55%, var(--surface-2)), var(--surface-2));
}
.wave-preview[hidden] { display: none; }
.wave-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wave-preview-head h3 { font-size: 14px; margin: 2px 0 2px; }
.wave-preview-head .hint { max-width: 600px; }
.wave-span { display: inline-flex; gap: 3px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.wave-span .btn { height: 26px; padding: 0 7px; font-size: 9.5px; border: 0; background: transparent; }
.wave-span .btn.is-active { background: var(--accent); color: var(--accent-ink); }
.wave-preview-chart { min-height: 248px; }
.wave-preview-empty { display: grid; place-items: center; min-height: 220px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--muted); font-size: 11px; }
.wave-facts { display: flex; flex-wrap: wrap; gap: 5px; }
.wave-fact { display: inline-flex; align-items: baseline; gap: 5px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; background: var(--surface); }
.wave-fact small { color: var(--muted); font-size: 8.5px; text-transform: uppercase; letter-spacing: .05em; }
.wave-fact b { font-family: var(--mono); font-size: 9.5px; font-weight: 500; }
.wave-preview-help { font-size: 10px !important; }

@media (max-width: 900px) {
  .theme-preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-health .modal-body { grid-template-columns: 1fr; }
  .modal-health .health-grid { grid-column: 1; }
  .health-section-events, .health-section-diagnostics { grid-column: 1; }
  .trend-option-list { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .modal-health { height: 96vh; }
  .modal-health .health-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .modal-health .health-card { padding: 8px; gap: 1px; border-radius: 9px; }
  .modal-health .health-card strong { font-size: 13.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .modal-health .health-card small { font-size: 8.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .modal-health .health-card .eyebrow { font-size: 7.5px; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .health-section { min-height: 320px; }
  .health-section-events, .health-section-diagnostics { min-height: 240px; }
  .health-section-body { min-height: 250px; max-height: none; }
  .health-section-head { padding: 9px 10px; }
  .health-section-head p { font-size: 9.5px; }
  .health-lists { grid-template-columns: 1fr; }
  .modal-trend { height: 96vh; }
  .modal-trend .trend-canvas { min-height: 240px; }
  .modal-trend .trend-canvas .trend-plot { min-height: 200px; }
  .modal-trend .modal-body { gap: 8px; }
  .trend-modal-head .hint { display: none; }
  .trend-config-body { max-height: 190px; }
  .trend-legend-item b { max-width: 96px; }
  .modal-variable-editor { height: 96vh; }
  .modal-variable-editor .wave-preview-chart { min-height: 190px; }
  .wave-preview-head { flex-direction: column; }
  .wave-span { width: 100%; }
  .wave-span .btn { flex: 1; }
  .theme-type-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .theme-preset-grid { grid-template-columns: 1fr; }
  .theme-color-grid { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .modal-health .health-grid { grid-template-columns: 1fr 1fr; }
}

/* White-label trial allowance and settings section labels ------------------ */
.trial-card {
  display: grid; gap: 8px; padding: 12px; margin-bottom: 2px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 11px; background: linear-gradient(135deg, var(--accent-soft), var(--surface-2));
}
.trial-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.trial-card-head h3 { font-size: 13px; margin: 2px 0 3px; }
.trial-card-head p { color: var(--muted); font-size: 10.5px; max-width: 520px; line-height: 1.5; }
.trial-meter { height: 7px; border-radius: 99px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.trial-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 65%, var(--info))); transition: width .4s ease; }
.trial-facts { display: flex; flex-wrap: wrap; gap: 5px 14px; color: var(--muted); font-size: 10px; }
.trial-facts b { color: var(--text); font-family: var(--mono); font-size: 11px; }
.trial-card .hint { font-size: 10px; }
.form-section-label { display: grid; gap: 2px; padding-top: 13px; margin-top: 3px; border-top: 1px solid var(--line); }
.form-section-label b { font-size: 12.5px; }
.form-section-label span { color: var(--muted); font-size: 10.5px; line-height: 1.45; }

/* Trend series inspector in the dashboard studio --------------------------- */
.inspector-details { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); overflow: hidden; }
.inspector-details > summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; font-size: 11px; font-weight: 650; list-style: none; }
.inspector-details > summary::-webkit-details-marker { display: none; }
.inspector-details > summary b { color: var(--muted); font-family: var(--mono); font-size: 9px; }
.trend-inspector-body { display: grid; gap: 7px; padding: 0 9px 9px; }
.trend-inspector-body .hint { font-size: 9.5px; }
.trend-series-config {
  display: grid; grid-template-columns: 9px minmax(0, 1fr) 27px 28px;
  grid-template-rows: auto auto; gap: 5px 5px; align-items: center;
  padding: 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2);
}
.trend-series-dot { width: 8px; height: 8px; border-radius: 99px; grid-row: 1 / span 2; }
.trend-series-config select { grid-column: 2; grid-row: 1; height: 29px; font-size: 10px; min-width: 0; }
.trend-series-config input[data-series-prop='label'] { grid-column: 2 / span 3; grid-row: 2; height: 27px; font-size: 9.5px; }
.trend-series-config .trend-color-input { grid-column: 3; grid-row: 1; width: 27px; min-width: 27px; height: 25px; }
.trend-series-config .icon-btn { grid-column: 4; grid-row: 1; width: 27px; height: 27px; }

/* Device detail: tall form and full trend gadget --------------------------- */
.modal-device-detail { width: min(1040px, 100%); height: min(94vh, 900px); }
.modal-device-detail .modal-body { overflow: auto; }
.modal-device-detail .detail-section { padding-bottom: 4px; }
.detail-trend > header { align-items: flex-start; gap: 12px; }
.detail-trend > header > div:first-child { display: grid; gap: 2px; }
.detail-trend-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.detail-trend .trend-chart { margin-top: 8px; }
@media (max-width: 680px) {
  .modal-device-detail { height: 96vh; }
  .detail-trend > header { flex-direction: column; }
  .detail-trend-actions { width: 100%; justify-content: stretch; }
  .detail-trend-actions .select, .detail-trend-actions .btn { flex: 1; min-width: 0; }
}
