/* Fleet Control - Control Room.
   A dark operations wall: ink backgrounds, Space Grotesk for words, JetBrains
   Mono for every number, and Seartec's petal colours doing the status work.
   No inline styles anywhere in the templates; anything dynamic is a class or a
   data attribute that static/js/main.js reads. */

:root {
  --accent: #0066FF;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  /* The accent as text.  A tenant's /theme/<slug>.css sets the exact shade that
     reads on this theme; this is the fallback where no tenant theme loads. */
  --accent-text: color-mix(in srgb, var(--accent) 62%, #fff);
  --ink: #0B121B;
  --panel: #0E1620;
  --raised: #14202B;
  --hover: #172433;
  --line: #1B2734;
  --line-strong: #263646;
  --text: #E8EEF4;
  --text-dim: #A8BAC8;
  --muted: #7A8390;
  --ok: #6DC148;
  --warn: #F2A900;
  --warn-ink: #1B1200;
  --error: #E5002B;
  --info: #00AFD6;
  --offline: #A8BAC8;
  --unknown: #3E5062;
  --cyan: #00AFD6;
  --magenta: #E5399E;
  --yellow: #F2C230;
  --black: #E8EEF4;
  --nav-ink: #ffffff;
  --radius: 12px;
  /* PrintFleet's typeface.  A tenant on another sets these in /theme/<slug>.css. */
  --font: "Poppins", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  --display: "Poppins", "Segoe UI", system-ui, sans-serif;
}

/* Ledger: the light mode.  Warm paper, slate ink, hairline tables, Plus Jakarta Sans
   for page titles.  Same components, different room.  Switched by the toggle
   in the top bar; static/js/theme.js applies it before first paint. */
:root[data-theme="light"] {
  --accent: #0066FF;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-text: color-mix(in srgb, var(--accent) 88%, #000);
  --ink: #FBFAF7;
  --panel: #FFFFFF;
  --raised: #F4F2EC;
  --hover: #EEEBE3;
  --line: #E6E2DA;
  --line-strong: #D5D0C5;
  --text: #1F2328;
  --text-dim: #5B6068;
  --muted: #7A8390;
  --ok: #3B7A1E;
  --warn: #B47A00;
  --warn-ink: #ffffff;
  --error: #C9001F;
  --info: #0B7A93;
  --offline: #8A97A6;
  --unknown: #C9C4BA;
  --black: #1F2328;
  --nav-ink: #1F2328;
}
:root[data-theme="light"] .flash-success { background: #EAF6E2; border-color: #C6E5B3; color: #2F6A16; }
:root[data-theme="light"] .flash-danger { background: #FDE8EC; border-color: #F5BEC8; color: #A9001F; }
:root[data-theme="light"] .flash-warning { background: #FFF3D6; border-color: #F1D89A; color: #7A5300; }
:root[data-theme="light"] .notice-error { border-color: #F5BEC8; }
:root[data-theme="light"] .notice-warn { border-color: #F1D89A; }
:root[data-theme="light"] .notice-info { border-color: #BCE8F3; }
:root[data-theme="light"] .avatar { color: #fff; }
:root[data-theme="light"] .bars-svg rect.is-future { fill: var(--line); }
/* Page and sign-in titles in both themes: the display face, heavy and tight. */
:root .topbar-title { font-family: var(--display); font-weight: 800; letter-spacing: -0.025em; }
:root .topbar-title .muted, :root .topbar-title .badge { font-family: var(--font); letter-spacing: 0; }
:root .login-title { font-family: var(--display); font-weight: 800; letter-spacing: -0.025em; }
:root[data-theme="light"] .card { box-shadow: none; }
:root[data-theme="light"] .stat-n { font-weight: 500; }
:root[data-theme="light"] .table th { border-bottom: 2px solid var(--text); }
:root[data-theme="light"] .tile { background: var(--panel); border: 1px solid var(--line); border-top-width: 3px; }
:root[data-theme="light"] .top { background: var(--panel); }
:root[data-theme="light"] .login-bg { background: #FBFAF7; }
:root[data-theme="light"] .login-box { background: rgba(255,255,255,.94); box-shadow: 0 30px 60px -24px rgba(31,35,40,.35); }
:root[data-theme="light"] .login-legal { color: #4F5862; background: rgba(255,255,255,.82); box-shadow: 0 6px 18px -8px rgba(31,35,40,.3); }
:root[data-theme="light"] .code { background: #1F2328; }
@media (orientation: portrait) {
  :root[data-theme="light"] .login-box { background: rgba(255,255,255,.9); }
}
.only-light { display: none; }
:root[data-theme="light"] .only-light { display: inline; }
:root[data-theme="light"] .only-dark { display: none; }
.theme-toggle { color: var(--text-dim); }
.linkish { background: none; border: 0; padding: 0; color: var(--accent-text); font: inherit; cursor: pointer; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { color: color-mix(in srgb, var(--accent-text) 78%, var(--text)); text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 15px; }
h3.sub { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 18px 0 8px; font-weight: 700; }
code, .mono { font-family: var(--mono); font-size: 13px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; color: var(--text); }
.nowrap { white-space: nowrap; }
.num { text-align: right; }
.inline { display: inline; }
.link { font-size: 12px; font-weight: 500; }
.back { color: var(--muted); margin-right: 6px; vertical-align: middle; }
.ic { width: 18px; height: 18px; vertical-align: -4px; flex: none; }
.ic-lg { width: 32px; height: 32px; }

/* ---- shell: top bar, no sidebar ---- */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.top { display: flex; align-items: center; gap: 20px; padding: 0 28px; height: 60px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.top-brand:hover { text-decoration: none; }
.top-logo { height: 26px; max-width: 160px; }
.top-product { display: flex; align-items: center; gap: 8px; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding-left: 14px; border-left: 1px solid var(--line); }
.top-icon { width: 20px; height: 20px; border-radius: 5px; }
.top-nav { display: flex; gap: 2px; margin-left: 8px; }
.top-nav a { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 8px; color: var(--text-dim); font-weight: 500; font-size: 14px; }
.top-nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.top-nav a.is-active { background: var(--hover); color: var(--nav-ink); }
.top-nav .ic { width: 16px; height: 16px; }
/* Drop menus: open on hover and on keyboard focus; on touch the first tap
   opens (main.js adds is-open), the second follows the heading's link. */
.menu { position: relative; }
.menu-head { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 8px; color: var(--text-dim); font-weight: 500; font-size: 14px; }
.menu.is-active > .menu-head { background: var(--hover); color: var(--nav-ink); }
.menu:hover > .menu-head, .menu.is-open > .menu-head, .menu:focus-within > .menu-head { background: var(--hover); color: var(--nav-ink); text-decoration: none; }
.caret { display: inline-block; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -3px 0 0 2px; opacity: .6; }
.menu-panel { display: none; position: absolute; top: calc(100% + 4px); left: 0; min-width: 220px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; padding: 6px; z-index: 30; box-shadow: 0 18px 40px -16px rgba(0,0,0,.8); }
.menu-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.menu:hover > .menu-panel, .menu.is-open > .menu-panel, .menu:focus-within > .menu-panel { display: block; }
.top-nav .menu-panel a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 12px; border-radius: 6px; color: var(--text); font-weight: 400; font-size: 13px; white-space: nowrap; }
.top-nav .menu-panel a .pill { margin-left: auto; }
.top-nav .menu-panel a:hover { background: var(--hover); color: var(--nav-ink); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.top-search { display: flex; align-items: center; gap: 8px; background: var(--hover); border-radius: 8px; padding: 0 10px; width: 260px; color: var(--muted); }
.top-search input { flex: 1; background: transparent; border: 0; color: var(--text); font: inherit; padding: 8px 4px; min-width: 0; }
.top-search input::placeholder { color: var(--muted); }
.top-search input:focus { outline: 0; }
.top-user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.top-user-text { line-height: 1.2; }
.top-user-name { font-weight: 600; font-size: 13px; }
.top-user-role { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.side-note { margin: 0 0 0 8px; padding: 7px 14px; border-radius: 8px; background: var(--accent-soft); color: var(--text-dim); font-size: 12px; line-height: 1.4; align-self: center; text-align: center; }
.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 28px 8px; }
/* The count beside a title sits on the title's baseline, not its middle, with
   room to breathe.  Icons and pills stay centred on the line. */
.topbar-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.topbar-title .muted { font-size: 13px; font-weight: 400; letter-spacing: 0; margin-left: 6px; }
.topbar-title > .back, .topbar-title > .heading-icon, .topbar-title > .badge, .topbar-title > .chip { align-self: center; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
/* No width cap: zoomed out or on a wide monitor the page uses the room it has. */
.content { padding: 8px 28px 40px; }
.version-line { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.activity-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.activity-scroll { max-height: 460px; overflow: auto; }
.activity-detail { overflow-wrap: anywhere; }
.flashes { padding: 0 28px; }
.flash { padding: 10px 14px; border-radius: 8px; margin: 6px 0; font-weight: 500; border: 1px solid; }
.flash-success { background: #12301E; border-color: #1F5A32; color: #9FE080; }
.flash-danger { background: #3A0A14; border-color: #7A1428; color: #FF8AA0; }
.flash-warning { background: #3A2A00; border-color: #6B4A00; color: #FFD36B; }

/* ---- cards, grids ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 16px; }
.card-narrow { max-width: 720px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-2 > .card { margin: 0; }
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.dash > * { min-width: 0; }
.dash > .card { margin: 0; }
.rail { display: flex; flex-direction: column; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--text); }
.stat:hover { text-decoration: none; border-color: var(--line-strong); color: var(--text); }
.stat-n { font-family: var(--mono); font-size: 40px; font-weight: 700; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.stat-l { font-size: 12px; color: var(--text-dim); margin-top: 8px; letter-spacing: .08em; text-transform: uppercase; }
.stat-ok .stat-n { color: var(--ok); }
.stat-warn .stat-n { color: var(--warn); }
.stat-error .stat-n { color: var(--error); }
.stat-offline .stat-n { color: var(--offline); }
.stat-info .stat-n { color: var(--info); }
.notices { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.notice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text-dim); }
.notice > div { flex: 1; }
.notice strong { color: var(--text); }
.notice-error { border-color: #7A1428; }
.notice-error .ic { color: var(--error); }
.notice-warn { border-color: #6B4A00; }
.notice-warn .ic { color: var(--warn); }
.notice-info { border-color: #045F73; }
.notice-info .ic { color: var(--info); }
/* Several notices of one kind fold into one line; Show all opens the list. */
.notice-group > summary { cursor: pointer; list-style: none; }
.notice-group > summary::-webkit-details-marker { display: none; }
.notice-group > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.notice-group .when-open, .notice-group[open] .when-shut { display: none; }
.notice-group[open] .when-open { display: inline; }
.notice-group[open] > summary { border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; }
.notice-group-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 0 18px; padding-left: 12px; border-left: 2px solid var(--line); }
.notice-group-list .notice { padding: 9px 12px; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty.small { padding: 14px; }
.empty .ic { color: var(--unknown); display: block; margin: 0 auto 8px; }
.empty p { margin: 0 0 12px; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line-strong); }
.table th.num { text-align: right; }
.table td.num, .table td.mono, .table td.nowrap { white-space: nowrap; }
.table a.strong, .table .strong a { color: var(--text); }
.table a.strong:hover, .table .strong a:hover { color: var(--accent-text); }
.table td.cell-client { white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-tight td { padding: 8px 8px; }
.table-hover tbody tr:hover { background: var(--raised); }
.row-link { cursor: pointer; }
.is-muted { opacity: .55; }
.w-sev { width: 90px; }
.w-gauge { width: 140px; }
.w-toner { width: 110px; }
.w-num { width: 80px; }
.agent-cell .badge { margin-bottom: 6px; }

/* ---- client tree, breadcrumbs ---- */
/* Scoped to table cells: .table td sets its own padding, and a bare .tree-d1 lost
   to it, so the step never showed. */
.table td.tree-d1 { padding-left: 50px; } .table td.tree-d2 { padding-left: 92px; } .table td.tree-d3 { padding-left: 134px; } .table td.tree-d4 { padding-left: 176px; }
.tree-mark { display: inline-block; width: 12px; height: 12px; border-left: 2px solid var(--line-strong); border-bottom: 2px solid var(--line-strong); margin: 0 8px 2px -20px; vertical-align: middle; border-radius: 0 0 0 3px; }
.crumb { color: var(--text-dim); font-weight: 500; }
.crumb-sep { color: var(--muted); margin: 0 8px; font-weight: 400; }

/* ---- badges, chips ---- */
.chip-admin { cursor: pointer; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: color-mix(in srgb, var(--accent) 38%, #fff); font-family: inherit; }

/* ---- gauges and toner ---- */
.gauge { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; position: relative; }
.gauge-lg { height: 12px; }
.gauge-fill { height: 100%; width: 0; border-radius: 999px; background: var(--text-dim); transition: width .3s ease; }
.gauge-c .gauge-fill { background: var(--cyan); }
.gauge-m .gauge-fill { background: var(--magenta); }
.gauge-y .gauge-fill { background: var(--yellow); }
.gauge-k .gauge-fill { background: var(--black); }
.gauge-none .gauge-fill { background: var(--offline); }
.gauge.is-low { box-shadow: inset 0 0 0 1px var(--warn); }
.gauge.is-critical { box-shadow: inset 0 0 0 1px var(--error); }
.toner { display: flex; gap: 3px; }
.toner .gauge { flex: 1; height: 5px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--text-dim); }
.swatch-c { background: var(--cyan); } .swatch-m { background: var(--magenta); } .swatch-y { background: var(--yellow); } .swatch-k { background: var(--black); }
.supplies { display: flex; flex-direction: column; gap: 12px; }
.supply { display: grid; grid-template-columns: 1fr 200px 56px 130px; align-items: center; gap: 14px; font-size: 13px; }
.supply-v { text-align: right; font-weight: 600; }
.panel-alerts { margin: 0; padding: 0; list-style: none; }
.panel-alerts li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 4px 0; }

/* ---- fleet wall ---- */
.fleet-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow: hidden; border-radius: 10px; padding: 12px; color: var(--text); background: var(--raised); border-top: 3px solid var(--unknown); transition: background .15s, transform .15s; }
.tile:hover { text-decoration: none; background: var(--hover); transform: translateY(-1px); color: var(--text); }
.tile-ok { border-top-color: var(--ok); }
.tile-warn { border-top-color: var(--warn); }
.tile-error { border-top-color: var(--error); }
.tile-offline { border-top-color: var(--offline); opacity: .75; }
.tile-state { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tile-state > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tile-ok .tile-state { color: var(--ok); }
.tile-warn .tile-state { color: var(--warn); }
.tile-error .tile-state { color: var(--error); }
.tile-offline .tile-state { color: var(--offline); }
.tile-name { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .toner { margin-top: 4px; }
.tile-foot { display: flex; justify-content: space-between; font-size: 12px; margin-top: 4px; color: var(--text-dim); }

/* ---- rail lists ---- */
.rail-list { display: flex; flex-direction: column; }
.rail-item { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--text); }
.rail-item:hover { text-decoration: none; color: var(--text); }
.rail-item:first-child { border-top: 0; padding-top: 0; }
.rail-bar { width: 4px; border-radius: 2px; background: var(--muted); flex: none; }
.rail-bar-critical { background: var(--error); }
.rail-bar-warning { background: var(--warn); }
.rail-bar-info { background: var(--info); }
.rail-title { font-size: 13px; font-weight: 500; }
.rail-meta { font-size: 12px; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; }
.bars-svg { width: 100%; height: 90px; display: block; }
.bars-svg rect { fill: var(--accent); }
.bars-svg rect.is-future { fill: var(--line-strong); }
.bars-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.big { font-family: var(--mono); font-size: 28px; font-weight: 700; color: var(--text); white-space: nowrap; }
.big small { font-family: var(--font); font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }

/* ---- device page ---- */
.device-head { display: grid; grid-template-columns: 200px 1fr; gap: 20px 28px; }
.device-photo img { width: 200px; height: 150px; object-fit: contain; border-radius: 10px; background: var(--raised); border: 1px solid var(--line); display: block; }
.device-photo-empty { width: 200px; height: 150px; border-radius: 10px; background: var(--raised); border: 1px dashed var(--line-strong); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--unknown); font-size: 12px; }
.device-id { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 24px; align-content: start; }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 8px; padding: 5px 0; font-size: 13px; min-width: 0; }
.kv > span:last-child, .kv > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv > span:first-child { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding-top: 2px; }
.device-counters { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.counter { text-align: left; min-width: 0; background: var(--raised); border-radius: 10px; padding: 12px 14px; }
.counter .muted.small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.counter-l { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.counter-n { font-family: var(--mono); font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; white-space: nowrap; }
.disclosure-sm summary { font-size: 12px; }
.tab-pane { display: none; }
.tab-pane.is-active { display: block; }
.meter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 20px; }
.meter { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.meter-l { color: var(--text-dim); font-size: 13px; text-transform: capitalize; }
.meter-v { font-weight: 600; }
.ticket { padding: 12px 0; border-bottom: 1px solid var(--line); }
.ticket:last-child { border-bottom: 0; }
.ticket-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.form-tight { margin-top: 8px; gap: 6px; }
.form-tight .grow { flex: 1; min-width: 160px; font: inherit; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--raised); color: var(--text); }
.notes { list-style: none; padding: 0; margin: 12px 0 0; }
.notes li { padding: 10px 0; border-top: 1px solid var(--line); white-space: pre-wrap; }
.rdl-icon { color: var(--muted); }
.rdl-icon:hover { color: var(--accent-text); }
.spark { width: 100%; }
.spark-svg { width: 100%; height: 120px; display: block; }
.spark-svg rect { fill: var(--accent); opacity: .85; }
.spark-svg rect:hover { opacity: 1; }
.token { display: block; flex: 1; min-width: 0; padding: 0; background: transparent; border: 0; word-break: break-all; color: var(--text); font-family: var(--mono); font-size: 13px; }
.code { background: #050A10; color: #E8EEF4; padding: 12px 14px; border-radius: 8px; font-family: var(--mono); font-size: 13px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; border: 1px solid var(--line); }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 6px; }
.logo-preview { display: flex; align-items: center; gap: 16px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; background: var(--raised); }
.logo-preview img { max-height: 48px; max-width: 220px; }

/* ---- forms, buttons ---- */
.form { display: flex; flex-direction: column; gap: 12px; }
/* minmax(0, 1fr): a select's longest option must not widen its column past the card. */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; }
.form-row { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.field > span { font-weight: 500; color: var(--text-dim); font-size: 12px; }
.field-wide { grid-column: 1 / -1; }
.field input, .field select, .field textarea, .select, textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--raised); color: var(--text); min-width: 0; }
.field input:focus, .field select:focus, .field textarea:focus, .select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field input[type="color"] { padding: 2px; height: 38px; width: 80px; }
.field input[type="file"] { padding: 6px; }
.field-inline { flex-direction: row; align-items: center; gap: 8px; }
.field-inline input { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; color: var(--text-dim); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 0; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.filters { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.filters .field-inline { flex: 1; min-width: 240px; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; }
.filters .field-inline input { border: 0; padding: 9px 4px; background: transparent; }
.filters .field-inline input:focus { outline: 0; }
.filters .ic { color: var(--muted); }
.btn { font: inherit; font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: var(--hover); text-decoration: none; color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, #fff); border-color: color-mix(in srgb, var(--accent) 86%, #fff); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--raised); border-color: transparent; }
.btn-danger { color: #FF6B85; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 10px 14px; color: var(--text-dim); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.is-active { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 700; }
/* A phone gets the desktop pages too ("Use the desktop site").  Nothing there may
   make the page wider than the screen: a row of tabs scrolls sideways within
   itself, a wide table scrolls inside its .table-wrap, and columns marked
   col-wide step aside (BACKLOG S13). */
@media (max-width: 800px) {
  .tabs { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: none; white-space: nowrap; }
}
@media (max-width: 640px) {
  .col-wide { display: none; }
}
.disclosure { margin-top: 12px; }
.disclosure summary { cursor: pointer; font-weight: 600; color: var(--accent-text); padding: 6px 0; }
.disclosure .form { margin-top: 10px; }

/* ---- login ---- */
/* Sign-in artwork is 16:10 on desktop and 9:16 on phones, with its words and
   feature icons on the left and decoration on the right.  It always fills the
   screen, anchored left so a narrower window trims decoration rather than
   words, and the sign-in box sits on the right, over the decoration. */
.login { min-height: 100vh; display: grid; place-items: center end; position: relative; background: var(--ink); padding: 24px clamp(24px, 6vw, 120px); color: var(--text); }
.login-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #0B121B; }
.login-bg picture { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.login-bg img { width: 100%; height: 100%; object-fit: cover; object-position: left center; display: block; opacity: 1; }
.login-bg-fill { display: none; }
.login-bg::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 62%, rgba(0,0,0,.22) 100%); }
/* Narrow landscape windows cannot hold the words and the box side by side. */
@media (orientation: landscape) and (max-width: 900px) { .login { place-items: center; padding: 24px; } }
/* Portrait phones: the words are at the top, so the box floats at the bottom.
   The fade is neutral, because the artwork may be dark or light whichever
   theme the visitor chose; the box carries its own background. */
@media (orientation: portrait) {
  .login-bg img { object-position: center top; }
  .login-bg::after { background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.28) 100%); }
  .login { place-items: end center; padding: 16px 16px 24px; }
  .login-box { max-width: 480px; background: rgba(14,22,32,.86); }
  /* The sign-in box sheds its tagline and status dots, so the artwork's feature
     icons above it stay in view.  Other pages keep theirs: they carry instructions. */
  .login-box-signin { padding: 22px 22px 18px; }
  .login-box-signin .login-sub, .login-box-signin .login-foot { display: none; }
}

/* ---- public install help page ---- */
.login-help { place-items: start center; padding: 40px 16px; }
.login-help .login-box.help-box { max-width: 1040px; }
.help-box .login-foot a { font-weight: 600; }

/* ---- install help: what Chrome and Windows show for an unsigned setup program.
   Simplified drawings of their screens, so people recognise what to click.  They
   keep their own colours in both themes, as the real screens do. ---- */
.ih-lead { margin: 0 0 14px; }
.ih-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.ih-step { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.ih-text { display: flex; gap: 10px; align-items: flex-start; }
.ih-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.ih-pic { border-radius: 10px; overflow: hidden; font-family: "Segoe UI", system-ui, sans-serif; font-size: 12px; line-height: 1.35; min-height: 170px; display: flex; flex-direction: column; margin-top: auto; }
.ih-chrome { background: #DEE1E6; color: #1F1F1F; padding-bottom: 12px; }
.ih-chrome-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #F1F3F4; }
.ih-dot { width: 8px; height: 8px; border-radius: 50%; background: #C4C7C5; }
.ih-omni { flex: 1; height: 20px; border-radius: 10px; background: #fff; }
.ih-dl { color: #0B57D0; display: inline-flex; }
.ih-bubble { margin: 8px 10px 0 auto; width: 90%; background: #fff; border-radius: 8px; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .35); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ih-bubble-title { font-weight: 600; }
.ih-row { display: flex; align-items: center; gap: 8px; }
.ih-grow { flex: 1; min-width: 0; }
.ih-file-name { font-weight: 600; overflow-wrap: anywhere; }
.ih-warn { color: #B3261E; display: inline-flex; }
.ih-warn-text { color: #B3261E; }
.ih-btn { display: inline-flex; align-items: center; justify-content: center; padding: 4px 10px; border-radius: 14px; border: 1px solid #C4C7C5; color: #0B57D0; font-weight: 600; white-space: nowrap; }
.ih-arrow .ic { transform: rotate(-90deg); }
.ih-link { color: #0B57D0; font-weight: 600; }
.ih-hot { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.ih-smart { background: #1E4E8C; color: #fff; padding: 16px 16px 12px; gap: 8px; }
.ih-smart-title { font-size: 17px; font-weight: 300; }
.ih-smart .ih-link { color: #fff; text-decoration: underline; font-weight: 400; align-self: flex-start; }
.ih-smart-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; }
.ih-win-btn { display: inline-flex; justify-content: center; padding: 5px 14px; border: 1px solid rgba(255, 255, 255, .7); color: #fff; white-space: nowrap; }
.ih-smart .ih-win-btn.ih-primary { background: #fff; color: #1E4E8C; }
.ih-uac { background: #fff; color: #1F1F1F; border: 1px solid #C8C8C8; }
.ih-uac-head { background: #F3F3F3; padding: 6px 12px; font-size: 11px; }
.ih-uac-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ih-uac-q { font-size: 14px; font-weight: 600; }
.ih-uac-actions { display: flex; gap: 8px; margin-top: auto; }
.ih-uac-actions .ih-win-btn { flex: 1; color: #1F1F1F; border-color: #999; background: #E5E5E5; }
.ih-uac-actions .ih-win-btn.ih-primary { background: #0067C0; border-color: #0067C0; color: #fff; }
.ih-foot { margin-top: 14px; }
@media (prefers-reduced-motion: no-preference) { .ih-hot { animation: ih-pulse 1.8s ease-in-out infinite; } }
@keyframes ih-pulse { 0%, 100% { outline-color: var(--accent); } 50% { outline-color: transparent; } }
.login-box { position: relative; z-index: 1; width: 100%; max-width: 420px; background: rgba(14,22,32,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line-strong); border-radius: 18px; padding: 32px 32px 26px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.7); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-logo { height: 34px; max-width: 220px; }
.login-icon { width: 44px; height: 44px; border-radius: 10px; }
.login-product { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 700; }
.login-title { font-size: 26px; margin: 6px 0 4px; }
.login-sub { color: var(--muted); margin-bottom: 18px; }
.login-forgot { margin: 18px 0 0; }
.login-foot { margin-top: 20px; font-size: 11px; color: var(--muted); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.login-legal { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 1; width: max-content; max-width: calc(100vw - 24px); padding: 7px 16px; border-radius: 999px; text-align: center; font-size: 11px; color: #C9D5DF; background: rgba(11,18,27,.62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 18px -8px rgba(0,0,0,.6); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); } .dot-error { background: var(--error); }

/* ---- responsive ---- */
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .device-head { grid-template-columns: 200px 1fr; }
  .device-id { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-search { width: 180px; }
}
@media (max-width: 800px) {
  .top { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .top-nav { flex-wrap: wrap; margin: 0; order: 3; width: 100%; }
  .top-nav > a span, .menu-head span { display: none; }
  .topbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .topbar-actions { flex-wrap: wrap; }
  .topbar-actions .btn { flex: 1; justify-content: center; }
  .stat-n { font-size: 30px; }
  .device-counters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device-id { grid-template-columns: 1fr; }
  .device-photo img, .device-photo-empty { width: 100%; }
  .card { padding: 14px 14px; }
  .content { padding-bottom: 24px; }
  .menu-panel { left: auto; right: 0; }
  .menu:hover > .menu-panel { display: none; }
  .menu.is-open > .menu-panel { display: block; }
  .top-search { display: none; }
  .top-product { display: none; }
  .content, .topbar, .flashes { padding-left: 14px; padding-right: 14px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .device-head { grid-template-columns: minmax(0, 1fr); }
  .device-id { grid-template-columns: 1fr; }
  .supply { grid-template-columns: 1fr 100px 50px; }
  .supply-d { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .login-box { padding: 22px 20px 18px; border-radius: 16px; }
  .login-icon { width: 36px; height: 36px; border-radius: 8px; }
  .login-logo { height: 26px; }
  .login-title { font-size: 22px; }
  .login-sub { font-size: 13px; }
  .login-legal { display: none; }
  .fleet-wall { grid-template-columns: repeat(2, 1fr); }
  .dash { gap: 12px; }
}

/* ------------------------------------------------------------------ */
/* Pills.  One system for every status, severity, confidence, ticket  */
/* and count marker.  Each variant sets two tokens per theme: --tone   */
/* tints the fill, ring and dot; --tone-ink is the text, chosen for    */
/* at least 4.5:1 against its own fill in both themes.                 */
/* ------------------------------------------------------------------ */
.badge, .chip {
  --tone: #7A8390; --tone-ink: #B9C4CE;
  display: inline-flex; align-items: center; gap: 6px; vertical-align: middle;
  height: 22px; padding: 0 10px 0 8px; border-radius: 999px; border: 0;
  font-family: var(--font); font-size: 11px; line-height: 1; white-space: nowrap;
  color: var(--tone-ink);
  background: color-mix(in srgb, var(--tone) 17%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 42%, transparent), 0 1px 2px rgba(0, 0, 0, .18);
  transition: box-shadow .15s ease, transform .15s ease, background-color .15s ease;
}
.badge { font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.chip { font-weight: 650; letter-spacing: .01em; }
.badge::before, .chip-dot::before {
  content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--tone);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 24%, transparent);
}
.chip:not(.chip-dot) { padding: 0 10px; }
[data-tip].badge, [data-tip].chip, [data-tip].pill { cursor: help; }
.badge[data-tip]:hover, .chip[data-tip]:hover, .badge.tip-on, .chip.tip-on {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--tone) 24%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 70%, transparent), 0 4px 12px -4px color-mix(in srgb, var(--tone) 55%, transparent);
}

.badge-ok, .chip-ok             { --tone: #6DC148; --tone-ink: #9BE37A; }
.badge-warn, .chip-warn         { --tone: #F2A900; --tone-ink: #FFCB52; }
.badge-error, .chip-error       { --tone: #FF3355; --tone-ink: #FF9AAC; }
.badge-info, .chip-info         { --tone: #00AFD6; --tone-ink: #6ADBF3; }
.badge-offline, .chip-offline   { --tone: #A8BAC8; --tone-ink: #CAD6DF; }
.badge-unknown, .chip-muted     { --tone: #5A6E82; --tone-ink: #A3B2C0; }
.badge-accent, .chip-accent     { --tone: var(--accent); --tone-ink: color-mix(in srgb, var(--accent) 45%, #fff); }
:root[data-theme="light"] .badge, :root[data-theme="light"] .chip {
  --tone: #9AA3AD; --tone-ink: #4F5862;
  background: color-mix(in srgb, var(--tone) 14%, #ffffff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 48%, transparent), 0 1px 2px rgba(31, 35, 40, .06);
}
:root[data-theme="light"] .badge[data-tip]:hover, :root[data-theme="light"] .chip[data-tip]:hover,
:root[data-theme="light"] .badge.tip-on, :root[data-theme="light"] .chip.tip-on {
  background: color-mix(in srgb, var(--tone) 22%, #ffffff);
  box-shadow: inset 0 0 0 1px var(--tone), 0 5px 14px -6px color-mix(in srgb, var(--tone) 70%, transparent);
}
:root[data-theme="light"] .badge-ok, :root[data-theme="light"] .chip-ok             { --tone: #4E9A2A; --tone-ink: #285C10; }
:root[data-theme="light"] .badge-warn, :root[data-theme="light"] .chip-warn         { --tone: #E3A000; --tone-ink: #6B4800; }
:root[data-theme="light"] .badge-error, :root[data-theme="light"] .chip-error       { --tone: #E5002B; --tone-ink: #A3001A; }
:root[data-theme="light"] .badge-info, :root[data-theme="light"] .chip-info         { --tone: #0098BC; --tone-ink: #045A6E; }
:root[data-theme="light"] .badge-offline, :root[data-theme="light"] .chip-offline   { --tone: #8A97A6; --tone-ink: #46525F; }
:root[data-theme="light"] .badge-unknown, :root[data-theme="light"] .chip-muted     { --tone: #A7A196; --tone-ink: #5C574F; }
:root[data-theme="light"] .badge-accent, :root[data-theme="light"] .chip-accent     { --tone: var(--accent); --tone-ink: color-mix(in srgb, var(--accent) 62%, #000); }

/* Severity is the loudest pill: a solid gradient, and critical breathes. */
.badge-sev-critical, .badge-sev-warning, .badge-sev-info,
:root[data-theme="light"] .badge-sev-critical, :root[data-theme="light"] .badge-sev-warning, :root[data-theme="light"] .badge-sev-info {
  font-size: 10.5px; padding: 0 10px 0 8px; background: var(--sev-fill); color: var(--sev-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 4px 12px -5px var(--sev-glow);
}
.badge-sev-critical { --sev-fill: linear-gradient(180deg, #D00E33, #A8001C); --sev-ink: #FFFFFF; --sev-glow: rgba(229, 0, 43, .75); --tone: #FFFFFF; }
.badge-sev-warning  { --sev-fill: linear-gradient(180deg, #FFC43A, #F2A900); --sev-ink: #231700; --sev-glow: rgba(242, 169, 0, .7); --tone: #231700; }
.badge-sev-info     { --sev-fill: linear-gradient(180deg, #3CCBEC, #00A7CE); --sev-ink: #00242D; --sev-glow: rgba(0, 175, 214, .65); --tone: #00242D; }
.badge-sev-critical::before { box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); animation: sev-pulse 1.8s ease-out infinite; }
.badge-sev-warning::before, .badge-sev-info::before { box-shadow: none; }
.badge-sev-critical[data-tip]:hover, .badge-sev-warning[data-tip]:hover, .badge-sev-info[data-tip]:hover,
.badge-sev-critical.tip-on, .badge-sev-warning.tip-on, .badge-sev-info.tip-on,
:root[data-theme="light"] .badge-sev-critical[data-tip]:hover, :root[data-theme="light"] .badge-sev-warning[data-tip]:hover, :root[data-theme="light"] .badge-sev-info[data-tip]:hover,
:root[data-theme="light"] .badge-sev-critical.tip-on, :root[data-theme="light"] .badge-sev-warning.tip-on, :root[data-theme="light"] .badge-sev-info.tip-on {
  background: var(--sev-fill); filter: saturate(1.1) brightness(1.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 16px -5px var(--sev-glow);
}
@keyframes sev-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .75); }
  70% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* Connection marker: an icon-only pill. */
.chip-usb { padding: 0 7px; gap: 4px; }
.chip-usb .ic { width: 13px; height: 13px; }

/* Counts: a raised numeral with a ring cut out of whatever sits behind. */
.pill {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; font-weight: 800; line-height: 1; color: #FFFFFF;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #000), color-mix(in srgb, var(--accent) 68%, #000));
  box-shadow: 0 0 0 2px var(--panel), 0 3px 8px -2px color-mix(in srgb, var(--accent) 55%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.pill-muted { color: var(--text); background: var(--raised); box-shadow: 0 0 0 2px var(--panel), inset 0 0 0 1px var(--line-strong); }

/* The tooltip.  One element on <body>, placed by main.js, so a scrolling */
/* table never clips it.  It inverts against the theme to stand out.    */
.fc-tip {
  position: fixed; z-index: 1000; left: 0; top: 0; max-width: min(300px, calc(100vw - 16px));
  padding: 9px 12px; border-radius: 10px; pointer-events: none;
  font-family: var(--font); font-size: 12.5px; line-height: 1.45; font-weight: 500; letter-spacing: 0; text-transform: none;
  color: #0B121B; background: #F4F7FA;
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .6);
  opacity: 0; transform: translateY(4px) scale(.98); transform-origin: var(--tip-origin, 50% 100%);
  transition: opacity .12s ease, transform .12s ease;
}
.fc-tip.is-below { transform: translateY(-4px) scale(.98); }
.fc-tip.is-shown { opacity: 1; transform: none; }
.fc-tip strong { display: block; font-weight: 750; margin-bottom: 2px; }
.fc-tip::after {
  content: ""; position: absolute; left: var(--tip-arrow, 50%); bottom: -5px; width: 10px; height: 10px; margin-left: -5px;
  background: inherit; transform: rotate(45deg); border-radius: 2px;
}
.fc-tip.is-below::after { bottom: auto; top: -5px; }
:root[data-theme="light"] .fc-tip { color: #FFFFFF; background: #1F2328; box-shadow: 0 12px 30px -8px rgba(31, 35, 40, .45); }

@media (prefers-reduced-motion: reduce) {
  .badge, .chip, .fc-tip { transition: none; }
  .badge-sev-critical::before { animation: none; }
  .badge[data-tip]:hover, .chip[data-tip]:hover { transform: none; }
}

/* ---- tenant console and white label ---- */
.heading-icon { width: 30px; height: 30px; border-radius: 8px; }
.console-totals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.console-total { padding: 14px 16px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; }
.console-total .n { font-family: var(--mono); font-weight: 700; font-size: 26px; }
.console-total .l { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 2px; }
.tenant-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.tenant-card { display: flex; flex-direction: column; gap: 14px; padding: 18px 18px 16px; margin: 0; }
.tenant-card.is-muted { opacity: .6; }
.tenant-card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tenant-card-icon { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.tenant-card-title { min-width: 0; flex: 1; }
.tenant-card-name { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tenant-card-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tenant-card-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tenant-card-stat { background: var(--raised); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.tenant-card-stat .n { font-family: var(--mono); font-weight: 700; font-size: 17px; }
.tenant-card-stat .l { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tenant-card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tenant-card-foot > form { display: flex; align-items: center; }
.tenant-card-foot .badge, .tenant-card-foot .chip { vertical-align: 0; }
.tenant-card-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
/* Room for two badges whether a card has one or two, so the stats line up across a row. */
.tenant-card-head { min-height: 56px; }
/* Buttons sit on the card's bottom edge, so cards in a row line up whatever their badges. */
.tenant-card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.tenant-card-actions form { display: inline; margin: 0; }
.wl-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.wl-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.wl-form .card { margin: 0; }
.wl-uploads { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; margin-top: 10px; }
.wl-upload { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); align-items: flex-start; min-width: 0; }
.wl-upload-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wl-upload-body input[type=file] { font-size: 12px; max-width: 100%; }
.wl-thumb { flex: none; width: 96px; height: 64px; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--line-strong); }
.wl-thumb img { max-width: 86%; max-height: 78%; object-fit: contain; }
.wl-thumb-light { background: #FFFFFF; }
.wl-thumb-dark { background: #0B121B; }
.wl-thumb-icon { background: repeating-conic-gradient(#E8E4DC 0% 25%, #F7F5F0 0% 50%) 50% / 16px 16px; }
.wl-thumb-wide img, .wl-thumb-tall img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.wl-thumb-tall { width: 48px; height: 84px; }
.wl-sticky { position: sticky; top: 76px; margin: 0; }
.wl-login { --preview-accent: var(--accent); position: relative; height: 250px; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: flex-end; padding-right: 6%; background: #E9E6DF; }
.wl-login-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; }
.wl-login-card { position: relative; width: 44%; background: rgba(255, 255, 255, .95); border-radius: 12px; padding: 14px 14px 12px; box-shadow: 0 16px 30px -14px rgba(0, 0, 0, .45); color: #1F2328; }
.wl-login-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wl-login-icon { width: 22px; height: 22px; border-radius: 5px; }
.wl-login-logo { height: 16px; max-width: 110px; object-fit: contain; }
.wl-login-product { font-size: 8px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #7A8390; }
.wl-login-title { font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: -.02em; margin: 2px 0; }
.wl-login-sub { font-size: 9px; color: #7A8390; margin-bottom: 8px; }
.wl-login-field { height: 14px; border-radius: 4px; background: #F4F2EC; border: 1px solid #E6E2DA; margin-bottom: 6px; }
.wl-login-btn { height: 18px; border-radius: 5px; background: var(--preview-accent); color: #fff; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.wl-icons { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.wl-icon-tab { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--raised); border-radius: 10px 10px 0 0; border: 1px solid var(--line); border-bottom: 0; font-size: 12px; min-width: 0; }
.wl-icon-tab img { width: 16px; height: 16px; flex: none; }
.wl-icon-tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-icon-home { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; width: 84px; text-align: center; }
.wl-icon-home img { width: 56px; height: 56px; border-radius: 13px; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .4); }
.wl-icon-home span { max-width: 84px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-installer { display: flex; flex-direction: column; gap: 6px; }
.wl-installer code, .installer-facts code { font-size: 12px; overflow-wrap: anywhere; }
.wl-inline-icon { width: 16px; height: 16px; vertical-align: -3px; }
.link-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line); min-width: 0; margin-bottom: 12px; }
.link-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 1100px) {
  .wl-grid { grid-template-columns: minmax(0, 1fr); }
  .wl-sticky { position: static; }
  .console-totals { grid-template-columns: repeat(2, 1fr); }
}

/* ---- copy boxes: the value, and its copy button at the far right ---- */
.copy-box { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; background: var(--raised); border: 1px dashed var(--line-strong); border-radius: 8px; min-width: 0; }
.copy-box .copy-box-btn { flex: none; margin-left: auto; }
.copy-box-code { position: relative; padding: 0; border: 0; background: transparent; align-items: stretch; }
.copy-box-code .code { flex: 1; margin: 0; padding-right: 86px; }
.copy-box-code .copy-box-btn { position: absolute; top: 8px; right: 8px; }
.copy-note { margin: 12px 0 18px; }
.kv-wide { grid-template-columns: 88px minmax(0, 1fr); align-items: center; }

/* Buttons centre their label whatever their width. */
.btn { justify-content: center; text-align: center; }

/* The back arrow sits on the title's centre line. */
.topbar-title .back { display: inline-flex; align-items: center; justify-content: center; margin-right: 0; line-height: 1; }
.topbar-title .back .ic { vertical-align: 0; }

/* Help text under a group of fields gets room to breathe. */
.form-grid + p, .form-grid + .muted, .wl-uploads + p, .field + p.muted { margin-top: 12px; }
/* Copy under a block: a note, caption or count below a card grid, table, text
   box or form always has room above it.  A standing rule (CLAUDE.md): extend
   this, never patch one page with its own margin. */
.content > * + p, .content > * + .muted, .card > :not(.card-head) + p, .table-wrap + p, .table-scroll + p,
.activity-scroll + p, .form + p, .form-row + p, details + p,
.card > :not(.card-head) + .form, .card > :not(.card-head) + form,
.report-result > * + p.report-note, .report-result > .report-chart + .table-wrap, .report-result > .report-chart + .empty,
.modal-pane > * + p, .modal-pane > * + .table, .modal-pane > .table + h3.sub,
.assistant-card > .assistant-table-wrap + *, .assistant-card > .assistant-facts + *, .settings-usage + p { margin-top: 14px; }

/* App icons are dark tiles; on dark panels give them an edge so they stand out. */
:root:not([data-theme="light"]) .tenant-card-icon, :root:not([data-theme="light"]) .heading-icon,
:root:not([data-theme="light"]) .top-icon, :root:not([data-theme="light"]) .login-icon,
:root:not([data-theme="light"]) .wl-icon-home img, :root:not([data-theme="light"]) .wl-login-icon {
  background: #223244;
  box-shadow: 0 0 0 1px rgba(232, 238, 244, .24), 0 6px 16px -6px rgba(0, 0, 0, .7);
}

/* ---- top bar on smaller monitors ---- */
@media (max-width: 1560px) {
  .top { gap: 14px; padding: 0 20px; }
  .top-user-text { display: none; }
  .top-search { width: 210px; }
  .side-note { display: none; }
  .chip-admin { display: inline-block; max-width: 190px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 1360px) {
  .top-product .top-product-name { display: none; }
  .top-product { padding-left: 10px; }
  .top-search { width: 160px; }
  .top-nav a, .menu-head { padding: 8px 9px; }
}
@media (max-width: 1240px) {
  .top-search { width: 130px; }
  .chip-admin { max-width: 130px; }
}

/* ---- profile panel ---- */
[hidden] { display: none !important; }
.avatar-btn { border: 0; padding: 0; cursor: pointer; overflow: hidden; font: inherit; font-weight: 700; font-size: 13px; flex: none; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-btn:focus-visible, .top-user-text:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.top-user-text { cursor: pointer; }
.profile-scrim { position: fixed; inset: 0; background: rgba(5, 10, 16, .45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 60; }
.profile-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -24px 0 48px -24px rgba(0, 0, 0, .5); z-index: 61; transform: translateX(104%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
.profile-panel.is-open { transform: none; visibility: visible; transition: transform .22s ease; }
.profile-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.profile-head h2 { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -.015em; }
.profile-close { font-size: 22px; line-height: 1; width: 34px; height: 34px; padding: 0; }
.profile-body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 18px; }
.profile-photo { display: flex; gap: 16px; align-items: center; padding: 14px; border: 2px dashed var(--line-strong); border-radius: 14px; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.profile-photo:hover, .profile-photo.is-over { border-color: var(--accent); background: var(--accent-soft); }
.profile-photo.is-busy { opacity: .7; }
.profile-photo-frame { width: 76px; height: 76px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 26px; flex: none; overflow: hidden; }
.profile-photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-status { margin-top: 4px; color: var(--text-dim); min-height: 16px; }
.profile-name { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.015em; }
.profile-inline-form { margin-top: 4px; }
.profile-section { border-top: 1px solid var(--line); padding-top: 14px; }
.profile-section .sub { margin-top: 0; }
.profile-forgot { margin-top: -6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.profile-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-footer form { margin: 0; }
body.has-panel { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .profile-panel, .profile-panel.is-open { transition: none; } }

/* The search box gives way first, so the top bar never pushes past the window,
   even for a platform admin working in a tenant with the extra menu and chip. */
/* Wide enough for the whole placeholder when there is room.  When the box has
   to shrink, main.js swaps in the short placeholder rather than cutting it off. */
.top-right { min-width: 0; }
.top-search { flex: 0 1 300px; width: auto; min-width: 120px; }
@media (min-width: 1700px) { .top-search { flex: 0 0 320px; } }
@media (max-width: 1560px) { .top-search { flex-basis: 230px; } }
@media (max-width: 1360px) { .top-search { flex-basis: 170px; } }
@media (max-width: 1240px) { .top-search { flex-basis: 140px; min-width: 96px; } }

/* The leave chip is the quick way out of a tenant, so it is never cut off.
   It says less as the window narrows instead of trailing into an ellipsis.
   Declared after the older breakpoint rules so it overrides their max-width. */
.chip-admin { max-width: none; overflow: visible; text-overflow: clip; white-space: nowrap; flex: none; }
.chip-admin-mid, .chip-admin-short { display: none; }
@media (max-width: 1560px) { .chip-admin-long { display: none; } .chip-admin-mid { display: inline; } }
@media (max-width: 1240px) { .chip-admin-mid { display: none; } .chip-admin-short { display: inline; } }

/* Narrow desktops: menus become icons, so a platform admin working in a
   tenant still fits the extra Platform menu and the leave chip. */
@media (max-width: 1100px) {
  .top-nav > a span, .menu-head span { display: none; }
}

/* ---- agent setup page ---- */
.setup-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.setup-hero { display: flex; flex-direction: column; gap: 20px; }
.setup-steps { display: flex; flex-direction: column; gap: 14px; }
.setup-step { display: flex; gap: 14px; align-items: flex-start; }
.setup-num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-text); font-family: var(--display); font-weight: 800; font-size: 16px; }
.setup-download { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 10px; }
.btn-lg .ic { width: 20px; height: 20px; }
.setup-note { margin: 0; }
.setup-more { border-top: 1px solid var(--line); padding: 12px 0; }
.setup-more:first-of-type { border-top: 0; padding-top: 0; }
.setup-more summary { cursor: pointer; font-weight: 600; }
.setup-more[open] summary { margin-bottom: 10px; }
@media (max-width: 1100px) { .setup-grid { grid-template-columns: minmax(0, 1fr); } }

.agent-cell { min-width: 140px; }
.agent-cell .strong { white-space: nowrap; }
.card-gap { margin-top: 18px; }

/* ---- sortable headings ---- */
.th-sort { font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.th-sort:hover { color: var(--text); }
.th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.table th.num .th-sort { flex-direction: row-reverse; }
.th-arrow { display: inline-flex; flex-direction: column; gap: 2px; }
.th-arrow::before, .th-arrow::after { content: ''; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; opacity: .35; }
.th-arrow::before { border-bottom: 4px solid currentColor; }
.th-arrow::after { border-top: 4px solid currentColor; }
.table th.is-asc, .table th.is-desc { color: var(--text); }
.table th.is-asc .th-arrow::before, .table th.is-desc .th-arrow::after { opacity: 1; border-bottom-color: var(--accent); border-top-color: var(--accent); }
.table th.is-asc .th-arrow::after, .table th.is-desc .th-arrow::before { opacity: .12; }

/* ---- view switches ---- */
.view-bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.view-bar-inline { margin: 0 0 0 auto; }
.card-head + .view-bar { margin-top: -4px; }
.view-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--raised); }
.view-btn { font: inherit; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.view-btn .ic { width: 15px; height: 15px; }
.view-btn:hover { color: var(--text); }
.view-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.view-btn.is-active { background: var(--hover); color: var(--accent-text); box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
:root[data-theme="light"] .view-btn.is-active { background: var(--panel); box-shadow: 0 1px 2px rgba(20, 30, 40, .12); }
.tile-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tile-sort select { font: inherit; font-weight: 600; color: var(--text); background: var(--raised); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.fleet-wall-compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.fleet-wall-compact .tile { padding: 9px 10px; gap: 3px; }
.fleet-wall-compact .tile-meta, .fleet-wall-compact .toner { display: none; }
.fleet-wall-compact .tile-foot { margin-top: 2px; font-size: 11px; }
@media (max-width: 800px) { .view-btn span { display: none; } .view-bar-inline { margin-left: 0; } }

/* ---- dashboard view ---- */
.wall-bar { margin: 0 0 14px; }
.scope-bar .wall-bar { margin: 0 0 0 auto; }
@media (max-width: 800px) { .scope-bar .wall-bar { margin-left: 0; } }
.widgets { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.widget { grid-column: span 4; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 14px; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 20px; }
.widget::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 0%, transparent) 65%); opacity: .7; }
.widget.w-4 { grid-column: span 4; }
.widget.w-6 { grid-column: span 6; }
.widget.w-8 { grid-column: span 8; }
.widget.w-12 { grid-column: span 12; }
@media (max-width: 1280px) { .widget, .widget.w-4, .widget.w-6 { grid-column: span 6; } .widget.w-8, .widget.w-12 { grid-column: span 12; } }
@media (max-width: 820px) { .widget, .widget.w-4, .widget.w-6 { grid-column: span 12; } }
.widget-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.widget-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
.widget-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.widget-head .link { white-space: nowrap; padding-top: 2px; }
/* Moving and sizing widgets (the Wall widgets section of main.js). */
.widgets-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 0 0 12px; }
.widgets-bar p { margin: 0; }
.widget-head > div:first-child { flex: 1; min-width: 0; }
.widget-tools { display: inline-flex; gap: 2px; margin: -4px -8px 0 0; flex: none; opacity: .35; transition: opacity .15s ease; }
.widget:hover .widget-tools, .widget:focus-within .widget-tools, .widget.is-dragging .widget-tools { opacity: 1; }
.widget-tool { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.widget-tool:hover { background: var(--hover); color: var(--text); }
.widget-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; opacity: 1; }
.widget-grip { cursor: grab; touch-action: none; }
.widget-grip .ic { width: 16px; height: 16px; }
.widget-size-mark { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.widget-size-mark i { display: block; width: 3px; height: 12px; border-radius: 1px; background: currentColor; opacity: .25; }
.w-4 .widget-size-mark i:nth-child(-n+1), .w-6 .widget-size-mark i:nth-child(-n+2),
.w-8 .widget-size-mark i:nth-child(-n+3), .w-12 .widget-size-mark i { opacity: 1; }
.widget.is-dragging { position: fixed; z-index: 80; margin: 0; pointer-events: none; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .55), 0 0 0 2px var(--accent); transform: rotate(-.6deg) scale(1.01); animation: none; }
.widget.is-dragging .widget-grip { cursor: grabbing; }
.widget.widget-placeholder { padding: 0; border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); border-radius: var(--radius); background: var(--accent-soft); animation: none; }
body.is-dragging-widget, body.is-dragging-widget * { cursor: grabbing !important; user-select: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { .widget.is-dragging { transform: none; } }
@media (hover: none) { .widget-tools { opacity: 1; } }
.widget-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px 8px; text-align: center; font-size: 13px; color: var(--muted); }
.widget-empty .ic { color: var(--unknown); }
.widget-empty p { margin: 0; max-width: 290px; }
.widget-note { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; color: var(--text-dim); }
.widget-note .ic { width: 15px; height: 15px; color: var(--info); }
.kpis { display: flex; flex-wrap: wrap; gap: 10px 30px; }
.kpi { display: flex; flex-direction: column; min-width: 0; }
.kpi-n { font-family: var(--mono); font-size: 24px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; color: var(--text); }
.kpi-of { font-size: 15px; color: var(--muted); font-weight: 500; }
.kpi-l { margin-top: 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-svg .axis { fill: var(--muted); font-family: var(--mono); font-size: 11px; }
.chart-svg .hit { fill: transparent; }
.chart-svg .col:hover .hit, .chart-svg .col.tip-on .hit { fill: var(--raised); }
.seg-mono { fill: var(--text-dim); }
.seg-colour { fill: var(--accent); }
.seg-unsplit { fill: var(--unknown); }
.seg-empty { fill: var(--line-strong); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-dim); }
.key { display: inline-flex; align-items: center; gap: 6px; }
.key::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--unknown); }
.key-mono::before { background: var(--text-dim); }
.key-colour::before { background: var(--accent); }
.key-exact::before { background: var(--ok); }
.key-derived::before { background: var(--warn); }
.key-total_only::before { background: var(--offline); }
.donut-wrap { flex: 1; display: flex; align-items: center; gap: 22px; }
.donut { position: relative; flex: none; width: 150px; height: 150px; }
.donut svg { width: 100%; height: 100%; display: block; overflow: visible; }
.donut-track { fill: none; stroke: var(--raised); stroke-width: 12; }
.donut-seg { fill: none; stroke-width: 12; cursor: default; transition: stroke-width .15s ease; }
.donut-seg:hover, .donut-seg.tip-on { stroke-width: 15; }
.donut-ok { stroke: var(--ok); }
.donut-warn { stroke: var(--warn); }
.donut-error { stroke: var(--error); }
.donut-offline { stroke: var(--offline); }
.donut-unknown { stroke: var(--unknown); }
.donut-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-n { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--text); }
.donut-centre small { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.legend-list { flex: 1; min-width: 0; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.legend-list a { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; font-size: 13px; color: var(--text); }
.legend-list a:hover { background: var(--raised); text-decoration: none; color: var(--text); }
.legend-list .mono { margin-left: auto; font-weight: 700; }
.legend-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--unknown); }
.legend-dot-ok { background: var(--ok); }
.legend-dot-warn { background: var(--warn); }
.legend-dot-error { background: var(--error); }
.legend-dot-offline { background: var(--offline); }
.w-list { display: flex; flex-direction: column; }
.w-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); color: var(--text); }
.w-row:first-child { border-top: 0; padding-top: 2px; }
a.w-row:hover { text-decoration: none; color: var(--text); }
a.w-row:hover .w-name { color: var(--accent-text); }
.w-row-flat { padding: 8px 0; }
.w-main { min-width: 0; }
.w-name { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.w-name .chip { font-size: 10px; }
.w-meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-val { font-family: var(--mono); font-size: 13px; font-weight: 700; text-align: right; white-space: nowrap; }
.w-val small { display: block; font-family: var(--font); font-size: 11px; font-weight: 400; color: var(--muted); }
.w-sub { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.w-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.w-bar-lg { height: 10px; border-radius: 5px; }
.hbar-fill { width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.hbar-fill.is-critical { background: var(--error); }
.hbar-fill.is-low { background: var(--warn); }
.hbar-fill.is-good { background: var(--ok); }
.hbar-c { background: var(--cyan); }
.hbar-m { background: var(--magenta); }
.hbar-y { background: var(--yellow); }
.hbar-k { background: var(--black); }
.hbar-info { background: var(--info); }
.hbar-brand { background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #fff)); }
.tiles-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--raised); color: var(--text); }
a.mini:hover { background: var(--hover); text-decoration: none; color: var(--text); }
.mini .kpi-n { font-size: 22px; }
.mini .kpi-l { margin-top: 2px; font-size: 10px; }
.mini-critical .kpi-n { color: var(--error); }
.mini-warn .kpi-n { color: var(--warn); }
.mini-info .kpi-n { color: var(--info); }
.mini-ok .kpi-n { color: var(--ok); }
.mini-quiet .kpi-n { color: var(--muted); }
.stack { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; background: var(--raised); }
.stack-part { width: 0; height: 100%; transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.stack-exact { background: var(--ok); }
.stack-derived { background: var(--warn); }
.stack-total_only { background: var(--offline); }
.stack-none { background: var(--unknown); }
:root[data-theme="light"] .widget::before { opacity: .85; }
@media (prefers-reduced-motion: no-preference) {
  .widget { animation: fc-rise .45s cubic-bezier(.2, .8, .2, 1) both; }
  .widgets .widget:nth-child(2) { animation-delay: 40ms; }
  .widgets .widget:nth-child(3) { animation-delay: 80ms; }
  .widgets .widget:nth-child(4) { animation-delay: 110ms; }
  .widgets .widget:nth-child(5) { animation-delay: 140ms; }
  .widgets .widget:nth-child(n+6) { animation-delay: 170ms; }
  .chart-svg .seg { transform-box: fill-box; transform-origin: 50% 100%; animation: fc-grow .6s cubic-bezier(.2, .8, .2, 1) both; }
  .donut svg { animation: fc-turn .8s cubic-bezier(.2, .8, .2, 1) both; }
}
@keyframes fc-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fc-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes fc-turn { from { opacity: 0; transform: rotate(-70deg) scale(.92); } to { opacity: 1; transform: none; } }

/* ---- site scan settings ---- */
.scan-choice .checks { padding: 2px 0 6px; }
.scan-choice textarea { width: 100%; min-height: 72px; resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.5; color: var(--text); background: var(--raised); border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px; }
.scan-choice textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-help { display: block; margin-top: 6px; font-size: 12px; line-height: 1.45; color: var(--muted); }

/* ---- small form polish ---- */
.btn-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 0 0 14px; }
.form-note { margin: 12px 0 0; line-height: 1.5; }
.select-sm, .input-sm { font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--raised); color: var(--text); }
.select-sm { min-width: 112px; cursor: pointer; }
.select-sm:focus, .input-sm:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.input-sm.w-num { width: 84px; }
.unit-input { display: inline-flex; align-items: center; gap: 8px; }
.unit-input > span { font-size: 12px; color: var(--muted); }
.th-help { border-bottom: 1px dotted currentColor; cursor: help; }
.table input[type="checkbox"], .check input { accent-color: var(--accent); width: 16px; height: 16px; }
.site-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); }
@media (max-width: 1100px) { .site-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- wall scope: one account, with or without its branches ---- */
.scope-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: -4px 0 16px; }
.scope-pick { margin: 0; }
.scope-select { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); }
.scope-select:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.scope-select .ic { width: 16px; height: 16px; color: var(--muted); flex: none; }
.scope-select select { font: inherit; font-size: 13px; font-weight: 600; color: var(--text); background: transparent; border: 0; padding: 9px 6px; min-width: 210px; cursor: pointer; }
.scope-select select:focus { outline: none; }
.scope-toggle { display: inline-flex; align-items: center; gap: 10px; padding: 7px 10px 7px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); color: var(--text-dim); font-size: 13px; font-weight: 600; transition: background .2s, border-color .2s, color .2s; }
.scope-toggle:hover { text-decoration: none; color: var(--text); border-color: var(--muted); }
.scope-toggle .ic { width: 16px; height: 16px; color: var(--muted); transition: color .2s; }
.scope-toggle.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.scope-toggle.is-on .ic { color: var(--accent-text); }
.switch-track { position: relative; flex: none; width: 34px; height: 20px; border-radius: 10px; background: var(--line-strong); transition: background .2s; }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .2s; }
.scope-toggle.is-on .switch-track { background: var(--accent); }
.scope-toggle.is-on .switch-knob { transform: translateX(14px); }

/* ---- tenant console figures open their views ---- */
.tenant-card-stat-form { display: contents; }
button.tenant-card-stat { font: inherit; color: inherit; text-align: left; border: 0; cursor: pointer; width: 100%; transition: background .15s, transform .15s; }
button.tenant-card-stat:hover { background: var(--hover); transform: translateY(-1px); }
button.tenant-card-stat:focus-visible, .badge-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a.console-total { color: var(--text); }
a.console-total:hover { text-decoration: none; border-color: var(--line-strong); color: var(--text); }
.badge-button { font: inherit; cursor: pointer; }

/* ---- site page: agents on top, settings folded beneath ---- */
.site-stack { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.site-stack > .card { margin: 0; }
.site-settings-head { justify-content: flex-start; align-items: center; flex-wrap: wrap; }
.site-settings-head:last-child { margin-bottom: 0; }
.site-settings-head h2 { margin: 0; }
.site-settings-summary { flex: 1; min-width: 220px; font-size: 12px; color: var(--muted); }
.site-settings .site-notes { margin-bottom: 0; color: var(--text-dim); white-space: pre-line; }
.btn-icon { padding: 5px 7px; }
.btn-icon .ic { width: 16px; height: 16px; }
.v3-fields { display: contents; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.table td.agent-host { white-space: nowrap; }

/* ---- tenant console on a phone: labelled tabs, not bare icons ---- */
@media (max-width: 800px) {
  .top-nav-console { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .top-nav-console > a { flex-direction: column; justify-content: center; gap: 4px; padding: 8px 4px; font-size: 12px; text-align: center; }
  .top-nav-console > a span { display: inline; }
  .top-nav-console .side-note { grid-column: 1 / -1; }
}

/* ---- live status pills: a ring grows from the dot and fades ---- */
.badge-live::before { animation: live-pulse 2.4s ease-out infinite; }
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tone) 65%, transparent); }
  70% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--tone) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tone) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .badge-live::before { animation: none; } }

/* ---- cross-tenant lists from the tenant console ---- */
.fleet-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.fleet-bar .tabs { margin-bottom: 0; border-bottom: 0; }
.table-scroll { overflow-x: auto; }
a.console-total { transition: border-color .15s ease, transform .15s ease; }
a.console-total:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ---- sign-in artwork per theme: the platform has a dark portrait ---- */
:root[data-theme="light"] .login-bg-dark { display: none; }
:root:not([data-theme="light"]) .login-bg-light { display: none; }

/* ---- the platform's sign-in box sits in the middle; a tenant's stays on the
   right over its own artwork.  Phones keep it at the bottom either way. ---- */
@media (orientation: landscape) { .login.login-centre { place-items: center; } }

/* ---- quick sign out beside the avatar ---- */
.top-logout { display: inline-flex; margin: 0; }
.top-user-name, .top-user-role { white-space: nowrap; }
.top-logout .btn { padding: 6px 8px; }

/* ---- powered by, under every tenant page ---- */
.app-foot { padding: 0 28px 28px; color: var(--muted); font-size: 12px; }

/* ---- client tree: a + or - on every parent account ---- */
.tree-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tree-tools { display: flex; gap: 8px; }
.tree-toggle.acct-toggle { display: inline-block; margin: 0 8px 0 0; vertical-align: middle; }
/* The same drawn plus and minus as the account navigator (.acct-toggle). */
.acct-toggle[aria-expanded="true"]::after { transform: rotate(0deg); }
.tree-toggle-space { display: inline-block; width: 30px; }

/* ---- a choice between a few options, each with a line saying what it means ---- */
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field > legend { font-weight: 500; color: var(--text-dim); font-size: 12px; padding: 0; margin-bottom: 6px; }
fieldset.field > .check + .check { margin-top: 6px; }
fieldset.field input[type="radio"] { padding: 0; border: 0; background: none; accent-color: var(--accent); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--raised); cursor: pointer; }
.choice input[type="radio"] { margin: 3px 0 0; }
.choice-body { display: flex; flex-direction: column; gap: 2px; }
.choice-body strong { font-size: 13px; color: var(--text); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- filter builder: templates/_filter_builder.html, drawn by main.js ---- */
.fb { display: flex; flex-direction: column; gap: 12px; }
.fb-label { font-weight: 500; color: var(--text-dim); font-size: 12px; }
.fb-scope { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.fb-scope-opts { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.fb-scope-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.fb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-dim); }
.fb-rows { display: flex; flex-direction: column; gap: 8px; }
.fb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); }
.fb-row.has-problem { border-color: var(--warn); }
.fb-row-n { font-family: var(--mono); font-size: 11px; color: var(--muted); min-width: 16px; text-align: right; }
.fb-none { margin: 0; }
.fb-value { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; flex: 1 1 220px; min-width: 0; }
.fb .select-sm, .fb-input, .fb-textarea { font: inherit; font-size: 13px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--text); min-width: 0; max-width: 100%; }
.fb-input { flex: 1 1 160px; }
.fb-number { flex: 0 1 130px; }
.fb-textarea { flex: 1 1 100%; resize: vertical; }
.fb-word { color: var(--muted); font-size: 13px; }
.fb-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12px; cursor: pointer; background: var(--panel); color: var(--text); }
.fb-chip input { accent-color: var(--accent); margin: 0; }
.fb-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.fb-checklist { display: flex; flex-direction: column; gap: 4px; max-height: 168px; overflow-y: auto; flex: 1 1 100%; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); }
.fb-remove { margin-left: auto; font-size: 18px; line-height: 1; padding: 4px 9px; }
.fb input:focus, .fb select:focus, .fb textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.fb-preview { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.fb-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.fb-count strong { font-size: 15px; color: var(--text); }
.fb.is-loading .fb-count strong { opacity: .6; }
.fb-problems { margin: 0; padding: 8px 12px 8px 30px; border-radius: 8px; border: 1px solid var(--warn); color: var(--text); font-size: 13px; }
.fb-devices { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 16px; font-size: 13px; }
.fb-devices li { display: flex; flex-direction: column; min-width: 0; }
.fb-devices li > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-devices:empty { display: none; }
.filters > .filter-panel { flex: 1 1 100%; margin: 4px 0 0; }
.fb + .form-actions { margin-top: 16px; }
@media (max-width: 640px) {
  .fb-row > .fb-field, .fb-row > .fb-op { flex: 1 1 40%; }
}

/* ---- alerts: the list and the five step form ---- */
.alerts-intro { max-width: 900px; margin: 0 0 16px; }
.btn-on { color: var(--ok); border-color: var(--ok); }
.step-n { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-right: 10px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; vertical-align: 2px; }
.alert-summary { display: flex; flex-direction: column; gap: 8px; border-color: var(--accent); }
.alert-summary .alert-sentence { margin: 0; font-size: 16px; line-height: 1.55; color: var(--text); }
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.check-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.field-pair { display: flex; gap: 8px; }
.field-pair input { flex: 1 1 90px; min-width: 0; }
.field .checks + span { margin-top: 6px; }
.alert-form .check .muted { margin-left: 4px; }

/* ---- device list templates: tools, the column picker, supplies bars, print ---- */
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 12px; }
.list-tools > .muted { margin-right: auto; }
.list-tools + .template-panel { margin-top: 0; }
.col-list { list-style: none; margin: 0; padding: 0; columns: 240px 3; column-gap: 24px; }
.col-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 0 2px 8px; border-radius: 8px; break-inside: avoid; }
.col-item:hover { background: var(--raised); }
.col-move { display: inline-flex; gap: 2px; }
.col-move .btn { padding: 3px 6px; color: var(--text-dim); }
.col-move .ic { width: 14px; height: 14px; }
.col-move .ic-up { transform: rotate(-90deg); }
.col-move .ic-down { transform: rotate(90deg); }
.supply-bars { display: grid; gap: 4px; min-width: 320px; }
.supply-bar { display: grid; grid-template-columns: minmax(90px, 140px) minmax(70px, 1fr) 42px max-content; align-items: center; gap: 8px; font-size: 12px; }
.supply-bar > .muted { white-space: nowrap; }
.supply-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supply-bar-pct { text-align: right; }
.supply-bar .gauge { height: 7px; }
@media print {
  .top, .filters, .list-tools, .template-panel, .notices, .bulk-bar, .view-bar, .flash, .flashes, .app-foot, .w-pick, .th-arrow, .rdl-icon,
  .report-form, .topbar-actions, [data-print] { display: none !important; }
  body, .main, .content, .card { background: #ffffff !important; color: #000000 !important; box-shadow: none !important; }
  .card { border: 0 !important; padding: 0 !important; }
  .table-wrap { overflow: visible !important; }
  .table th, .table td, .muted { color: #000000 !important; }
}

/* ---- buttons at the end of a table row ---- */
.row-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; align-items: center; }
.row-actions form { margin: 0; display: inline-flex; }

/* ---- a destructive action, kept at the bottom of its page and folded away ---- */
.card-danger { border-color: color-mix(in srgb, #E5002B 35%, var(--line)); }
.card-danger h2 { color: #E5002B; }

/* ---- managed star: filled amber when managed (billed), an outline when not ---- */
.star-form { display: inline-flex; margin: 0; }
.star { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); vertical-align: middle; }
button.star { cursor: pointer; }
button.star:hover, button.star:focus-visible { background: var(--hover); color: #F2A900; outline: 0; }
.star .ic { width: 18px; height: 18px; }
.star.is-on { color: #F2A900; }
.star.is-on .ic { fill: currentColor; }
.star.is-busy { opacity: .5; pointer-events: none; }
.tile-star { display: inline-flex; color: #F2A900; margin-right: 5px; vertical-align: -1px; }
.tile-star .ic { width: 13px; height: 13px; fill: currentColor; }
.w-star, .w-pick { width: 40px; text-align: center; }
.w-pick input { cursor: pointer; }
.bulk-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); }
.bulk-count { font-weight: 600; margin-right: auto; }
.topbar-title > .star-form, .topbar-title > .star { align-self: center; }

/* ---- install link page: the download for one site ---- */
.install-card { display: flex; flex-direction: column; gap: 12px; margin: 0 0 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--accent-soft); }
.install-card-title { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.install-card form { margin: 0; }

/* ---- profile panel, compact enough to fit a 90 percent zoom without scrolling ---- */
.profile-head { padding: 12px 18px; }
.profile-body { padding: 14px 18px 18px; gap: 12px; }
.profile-photo { padding: 10px 12px; gap: 12px; }
.profile-photo-frame { width: 58px; height: 58px; font-size: 20px; }
.profile-name { font-size: 18px; }
.profile-section { padding-top: 10px; }
.profile-panel .form { gap: 8px; }
.profile-panel h3.sub { margin: 2px 0 2px; }
.profile-panel .field { gap: 3px; }
.profile-panel .field input { padding: 7px 10px; }
.profile-panel .form-actions { margin-top: 2px; }
.profile-forgot { margin-top: -4px; }

/* ---- account navigator (templates/_account_nav.html, drawn by main.js) ---- */
.acct-btn { font: inherit; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--raised); color: var(--text); cursor: pointer; min-width: 0; }
.acct-btn:hover { border-color: var(--accent); }
.acct-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.acct-btn .ic { width: 16px; height: 16px; color: var(--accent-text); }
.acct-btn-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1560px) { .acct-btn-name { max-width: 120px; } }
@media (max-width: 1240px) { .acct-btn-name { display: none; } }
.acct-scrim { position: fixed; inset: 0; background: rgba(5, 10, 16, .5); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 70; }
.acct-nav { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); width: min(960px, calc(100vw - 32px)); height: min(720px, calc(100vh - 88px)); min-width: min(560px, calc(100vw - 32px)); min-height: min(380px, calc(100vh - 88px)); max-width: calc(100vw - 16px); max-height: calc(100vh - 64px); resize: both; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); z-index: 71; overflow: hidden; }
body.has-acct-nav { overflow: hidden; }
.acct-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px 20px; }
.acct-head h2 { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -.015em; margin-right: auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-close { width: 34px; height: 34px; padding: 0; }
@media (min-width: 801px) { .acct-head { cursor: move; touch-action: none; user-select: none; } .acct-head h2 { cursor: move; } }
.acct-nav.is-dragging { box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .65); }
.acct-search { display: flex; align-items: center; gap: 8px; margin: 0 20px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--raised); color: var(--muted); }
.acct-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.acct-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; padding: 11px 2px; }
.acct-search input:focus { outline: 0; }
.acct-index { display: flex; flex-wrap: wrap; gap: 1px; padding: 12px 16px 4px; }
.acct-letter { flex: none; font: inherit; font-size: 12px; font-weight: 600; min-width: 23px; padding: 4px 4px; border: 0; border-radius: 6px; background: transparent; color: var(--text-dim); cursor: pointer; }
.acct-letter:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.acct-letter:disabled { color: var(--line-strong); cursor: default; }
.acct-letter.is-active { background: var(--accent); color: var(--accent-ink); }
.acct-letter:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.acct-letter-word { padding: 4px 10px; }
.acct-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px 20px 8px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); min-height: 38px; }
.acct-crumbs button { font: inherit; border: 0; background: transparent; color: var(--accent-text); cursor: pointer; padding: 2px 4px; border-radius: 5px; }
.acct-crumbs button:hover { background: var(--accent-soft); }
.acct-crumbs .acct-crumb-here { color: var(--text); font-weight: 600; padding: 2px 4px; }
.acct-crumbs .acct-crumb-sep { opacity: .5; }
.acct-tree-tools { margin-left: auto; display: inline-flex; gap: 4px; }
.acct-tree-row { gap: 2px; }
.acct-toggle { flex: none; position: relative; width: 22px; height: 22px; margin-left: 6px; padding: 0; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel); color: var(--text-dim); cursor: pointer; }
.acct-toggle::before, .acct-toggle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; margin: -1px 0 0 -5px; border-radius: 1px; background: currentColor; }
.acct-toggle::after { transform: rotate(90deg); transition: transform .15s ease; }
.acct-toggle.is-open::after { transform: rotate(0deg); }
.acct-toggle:hover { border-color: var(--accent); color: var(--accent-text); }
.acct-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.acct-toggle-leaf { border-color: transparent; background: transparent; cursor: default; }
.acct-toggle-leaf::before, .acct-toggle-leaf::after { content: none; }
.acct-tree-row.acct-depth-1 { padding-left: 26px; } .acct-tree-row.acct-depth-2 { padding-left: 52px; }
.acct-tree-row.acct-depth-3 { padding-left: 78px; } .acct-tree-row.acct-depth-4 { padding-left: 104px; }
.acct-tree-row.acct-depth-5 { padding-left: 130px; } .acct-tree-row.acct-depth-6 { padding-left: 156px; }
.acct-name-line { display: flex; align-items: center; gap: 8px; }
.acct-name-line .acct-toggle { margin-left: 0; }
.acct-table td.acct-tree-cell.acct-depth-1 { padding-left: 34px; } .acct-table td.acct-tree-cell.acct-depth-2 { padding-left: 58px; }
.acct-table td.acct-tree-cell.acct-depth-3 { padding-left: 82px; } .acct-table td.acct-tree-cell.acct-depth-4 { padding-left: 106px; }
.acct-table td.acct-tree-cell.acct-depth-5 { padding-left: 130px; } .acct-table td.acct-tree-cell.acct-depth-6 { padding-left: 154px; }
.acct-table td.acct-tree-cell .acct-sub { padding-left: 30px; }
@media (prefers-reduced-motion: reduce) { .acct-toggle::after { transition: none; } }
@media (max-width: 800px) {
  .acct-tree-row.acct-depth-1 { padding-left: 14px; } .acct-tree-row.acct-depth-2 { padding-left: 28px; }
  .acct-tree-row.acct-depth-3, .acct-tree-row.acct-depth-4, .acct-tree-row.acct-depth-5, .acct-tree-row.acct-depth-6 { padding-left: 42px; }
}
.acct-body { flex: 1; overflow-y: auto; padding: 6px 10px 10px; min-height: 160px; }
.acct-empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.acct-list { list-style: none; margin: 0; padding: 0; }
.acct-row { display: flex; align-items: center; gap: 6px; border-radius: 10px; }
.acct-row.is-cursor, .acct-row:hover { background: var(--hover); }
.acct-row.is-here .acct-name { color: var(--accent-text); }
.acct-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 9px 10px; color: var(--text); text-decoration: none; border-radius: 10px; }
.acct-open:hover { text-decoration: none; color: var(--text); }
.acct-table a:hover { color: var(--accent-text); }
.acct-open:focus-visible, .acct-deeper:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.acct-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 14px; flex: none; }
.acct-text { min-width: 0; }
.acct-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-name mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; }
.acct-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-deeper { font: inherit; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding: 8px 10px; margin-right: 4px; border: 0; border-radius: 8px; background: transparent; color: var(--text-dim); cursor: pointer; white-space: nowrap; }
.acct-deeper:hover { background: var(--accent-soft); color: var(--accent-text); }
.acct-deeper .ic { width: 16px; height: 16px; }
.acct-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.acct-table th { white-space: nowrap; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line-strong); position: sticky; top: -6px; background: var(--panel); }
.acct-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.acct-table tr.is-cursor, .acct-table tbody tr:hover, .acct-table tr.is-cursor td, .acct-table tbody tr:hover td { background: var(--hover); }
.acct-table a { color: var(--text); font-weight: 600; }
.acct-table .acct-sub, .acct-table .acct-name { white-space: normal; }
.acct-table .acct-deeper { margin: 4px 0 0 -10px; }
.acct-cell-label { display: none; }
.acct-agent { display: flex; align-items: baseline; gap: 6px; }
.acct-agent + .acct-agent { margin-top: 3px; }
.acct-agent .dot { flex: none; margin-right: 0; }
.dot-off { background: var(--offline); }
.acct-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 20px; border-top: 1px solid var(--line); }
.acct-foot kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--raised); color: var(--text-dim); }
@media (max-width: 800px) {
  .acct-nav { top: 0 !important; left: 0 !important; transform: none !important; width: 100vw !important; min-width: 0; min-height: 0; max-width: none; max-height: none; height: 100% !important; border-radius: 0; border: 0; resize: none; }
  .acct-head { padding: 12px 10px 10px 14px; gap: 8px; }
  .acct-head h2 { font-size: 16px; }
  .acct-search { margin: 0 14px; }
  .acct-index { flex-wrap: nowrap; overflow-x: auto; padding: 10px 12px 4px; }
  .acct-crumbs { padding: 8px 14px; }
  .acct-keys { display: none; }
  .acct-table thead { display: none; }
  .acct-table tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .acct-table td { display: block; border-bottom: 0; padding: 2px 10px; }
  .acct-cell-label { display: inline; color: var(--muted); }
}

/* ---- pop-ups with tabs ([data-modal], shared behaviour in main.js) ---- */
.modal-scrim { position: fixed; inset: 0; background: rgba(5, 10, 16, .5); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 70; }
.modal { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 96px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); z-index: 71; overflow: hidden; }
.modal-wide { width: min(880px, calc(100vw - 32px)); }
body.has-modal { overflow: hidden; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 12px 22px; }
.modal-title { flex: 1; min-width: 0; }
.modal-title h2 { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -.015em; }
.modal-title .muted { margin-top: 2px; overflow-wrap: anywhere; }
.modal-close { width: 34px; height: 34px; padding: 0; flex: none; }
.modal-tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.modal-tabs::-webkit-scrollbar { display: none; }
.modal-tabs button { flex: none; font: inherit; font-size: 14px; font-weight: 500; padding: 10px 12px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--text-dim); cursor: pointer; }
.modal-tabs button:hover { color: var(--text); }
.modal-tabs button.is-active { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 700; }
.modal-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px 6px 0 0; }
.modal-body { flex: 1; overflow-y: auto; padding: 18px 22px 20px; }
.modal-lead { color: var(--text-dim); margin-bottom: 16px; }
.modal-checks { margin-top: 12px; }
.modal-files, .modal-agents { list-style: none; margin: 0; padding: 0; }
.modal-files li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.modal-files a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.modal-files .ic { width: 15px; height: 15px; }
.modal-agents li { padding: 4px 0; }
.modal-agents .dot { margin-right: 6px; }
.modal-agents + .table { margin-top: 12px; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); }
.modal-foot > .muted { margin-right: auto; }
@media (max-width: 800px) {
  .modal, .modal-wide { top: 0; left: 0; transform: none; width: 100vw; max-height: none; height: 100%; border-radius: 0; border: 0; }
  .modal-head { padding: 12px 10px 10px 14px; }
  .modal-tabs { padding: 0 8px; }
  .modal-body { padding: 16px 14px; }
  .modal-foot { padding: 10px 14px; }
  .modal-body .table { display: block; overflow-x: auto; }
}

/* ---- reports: the library, the builder and a result ---- */
.report-intro { max-width: 900px; margin: 0 0 16px; }
.report-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.report-kind { display: flex; flex-direction: column; gap: 6px; margin: 0; color: var(--text); transition: border-color .15s ease, transform .15s ease; }
.report-kind:hover { text-decoration: none; color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.report-kind:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.report-kind-cat { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--accent-text); }
.report-kind-name { font-family: var(--display); font-size: 16px; font-weight: 700; }
.report-kind-go { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 600; color: var(--accent-text); display: inline-flex; align-items: center; gap: 2px; }
.report-kind-go .ic { width: 15px; height: 15px; }
.report-form > .card { margin-bottom: 16px; }
.report-form .card-head + p { margin-top: -4px; }
.report-actions { margin-top: 18px; flex-wrap: wrap; }
.report-summary { margin: 0 0 12px; }
.report-meta { margin: 0 0 10px; }
.report-table .report-group th { text-align: left; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--text); background: var(--raised); padding: 8px 10px; }
.report-table .report-subtotal td { font-weight: 600; color: var(--text-dim); border-bottom: 1px solid var(--line-strong); }
.report-table .report-total td { font-weight: 700; color: var(--text); border-top: 2px solid var(--line-strong); border-bottom: 0; }
.report-chart { margin: 0 0 4px; display: grid; gap: 6px; }
.report-chart figcaption { margin-bottom: 4px; }
.report-bar { display: grid; grid-template-columns: minmax(120px, 240px) minmax(80px, 1fr) max-content; align-items: center; gap: 10px; font-size: 13px; }
.report-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-bar-track { height: 10px; }
.report-bar .gauge-fill { display: block; background: var(--accent); }
.report-bar-track { display: block; }
.report-bar-track.is-low, .report-bar-track.is-critical { box-shadow: none; }
.report-bar-value { text-align: right; min-width: 60px; }
@media (max-width: 800px) {
  .report-bar { grid-template-columns: minmax(90px, 120px) minmax(60px, 1fr) max-content; }
}
@media print {
  .report-table .report-group th { background: #eeeeee !important; color: #000000 !important; }
  .report-bar .gauge-fill { background: #555555 !important; }
}

/* ---- first-run tour (templates/_tour.html) ---- */
.tour { position: fixed; inset: 0; z-index: 90; }
.tour-scrim { position: absolute; inset: 0; }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 2px var(--accent), 0 0 0 9999px rgba(5, 10, 16, .58); pointer-events: none; transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease; }
.tour-spot.is-off { left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; box-shadow: 0 0 0 9999px rgba(5, 10, 16, .58); }
.tour-card { position: fixed; width: min(360px, calc(100vw - 32px)); padding: 18px 20px 14px; background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); outline: none; opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease, left .25s ease, top .25s ease; }
.tour-card.is-in { opacity: 1; transform: none; }
.tour-card::before { content: ""; position: absolute; left: calc(var(--tour-arrow, 50%) - 7px); width: 14px; height: 14px; background: var(--panel); border: 1px solid var(--line-strong); transform: rotate(45deg); }
.tour-card.is-below::before { top: -8px; border-right: 0; border-bottom: 0; }
.tour-card:not(.is-below)::before { bottom: -8px; border-left: 0; border-top: 0; }
.tour-card.is-centred::before { display: none; }
.tour-count { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); font-weight: 600; }
.tour-title { margin: 4px 0 6px; font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -.015em; }
.tour-body { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.55; }
.tour-dots { display: flex; gap: 5px; margin-top: 14px; }
.tour-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); transition: width .2s ease, background .2s ease; }
.tour-dot.is-on { width: 18px; border-radius: 3px; background: var(--accent); }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.tour-nav { display: flex; gap: 8px; }
.tour-skip { color: var(--muted); }
.profile-tour { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.profile-tour p { margin: 0; }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-card, .tour-dot { transition: none; } }

/* ---- help centre (templates/help) ---- */
.help-hero { text-align: center; padding: 34px 16px 30px; margin-bottom: 18px; border-radius: 18px; background: radial-gradient(120% 140% at 50% 0%, var(--accent-soft), transparent 70%), var(--panel); border: 1px solid var(--line); }
.help-hero-title { font-family: var(--display); font-weight: 800; font-size: clamp(24px, 4vw, 34px); letter-spacing: -.02em; margin: 0; }
.help-hero-sub { color: var(--text-dim); margin: 6px 0 18px; }
.help-search { display: flex; align-items: center; gap: 8px; max-width: 620px; margin: 0 auto; padding: 6px 6px 6px 14px; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 12px; }
.help-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.help-search .ic { width: 18px; height: 18px; color: var(--muted); flex: none; }
.help-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; padding: 8px 0; outline: none; }
.help-block { margin-top: 22px; }
.help-block-title { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -.015em; margin: 0 0 12px; }
.help-tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.help-task { display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 16px; margin: 0; color: inherit; transition: transform .15s ease, border-color .15s ease; }
.help-task:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }
.help-task-poster { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--raised); }
.help-task-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.help-task-play { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .5); }
.help-task-play .ic { width: 20px; height: 20px; margin-left: 3px; fill: currentColor; }
.help-task-title { font-weight: 700; font-size: 15px; margin-top: 6px; }
.help-task-sub { color: var(--text-dim); font-size: 13px; }
.help-task-meta { color: var(--muted); font-size: 12px; margin-top: auto; }
.help-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.help-section { margin: 0; }
.help-section-title { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.help-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.help-list a { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 8px; color: inherit; }
.help-list a:hover { background: var(--hover); text-decoration: none; }
.help-list-title { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.help-list-title .ic { width: 14px; height: 14px; color: var(--accent-text); fill: currentColor; }
.help-list-sub { color: var(--text-dim); font-size: 13px; }
.help-list-compact a { padding: 7px 8px; }
.help-results { margin-bottom: 8px; }
.help-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.help-article { margin: 0; padding: 28px 32px 30px; }
.help-kicker, .help-panel-kicker { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); font-weight: 600; }
.help-title { font-family: var(--display); font-weight: 800; font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -.02em; margin: 6px 0 8px; }
.help-lede { font-size: 16px; color: var(--text-dim); margin: 0 0 18px; }
.help-body { line-height: 1.65; font-size: 15px; }
/* Words keep a reading width; pictures and videos use the article's full width. */
.help-body > :not(figure):not(.help-shots-pair) { max-width: 72ch; }
.help-body > figure { max-width: 960px; }
.help-body h2 { font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.015em; margin: 26px 0 8px; }
.help-body h3 { font-size: 15px; margin: 18px 0 6px; }
.help-body p, .help-body ul, .help-body ol { margin: 0 0 12px; }
.help-body ul, .help-body ol { padding-left: 22px; }
.help-body li + li { margin-top: 5px; }
.help-body ol.help-steps { list-style: none; padding: 0; counter-reset: step; }
.help-body ol.help-steps > li { position: relative; padding: 2px 0 2px 42px; counter-increment: step; }
.help-body ol.help-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 13px; }
.help-body ol.help-steps > li + li { margin-top: 12px; }
.help-body strong { font-weight: 600; }
.help-path { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 1px 8px; border-radius: 6px; background: var(--raised); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; }
.help-path-sep { display: inline-block; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-top: 1.5px solid var(--muted); transform: rotate(45deg); margin: 0 3px 0 1px; }
.help-shot, .help-video { margin: 16px 0 18px; }
.help-shot img, .help-video video { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line-strong); box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .45); background: var(--raised); }
.help-shot figcaption, .help-video figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.help-video figcaption .ic { width: 13px; height: 13px; fill: currentColor; color: var(--accent-text); }
.help-note { display: flex; gap: 10px; padding: 12px 14px; margin: 14px 0; border-radius: 10px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); font-size: 14px; }
.help-note .ic { width: 18px; height: 18px; flex: none; color: var(--accent-text); margin-top: 2px; }
.help-note strong { display: block; }
.help-related { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.help-related h2 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.help-side { margin: 0; position: sticky; top: 16px; }
.help-side-title { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.help-side ul { list-style: none; margin: 0; padding: 0; }
.help-side li a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text-dim); font-size: 14px; }
.help-side li a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.help-side li a.is-active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.help-side-all { display: block; margin-top: 10px; padding: 0 10px; font-size: 13px; }
.help-panel { z-index: 63; }
.help-scrim { z-index: 62; }
.help-panel-search { display: flex; align-items: center; gap: 8px; margin: 12px 20px 0; padding: 0 12px; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 10px; }
.help-panel-search:focus-within { border-color: var(--accent); }
.help-panel-search .ic { width: 16px; height: 16px; color: var(--muted); }
.help-panel-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; padding: 9px 0; outline: none; }
.help-panel-body { gap: 10px; }
.help-panel-title { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -.015em; margin: 0; }
.help-body-compact { font-size: 14px; line-height: 1.6; }
.help-body-compact h2 { font-size: 16px; margin-top: 18px; }
.help-panel-open { align-self: flex-start; }
.help-panel-more { border-top: 1px solid var(--line); padding-top: 12px; }
.help-panel-foot { padding: 12px 20px; border-top: 1px solid var(--line); }
.help-panel-foot a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.help-panel-foot .ic { width: 16px; height: 16px; }
.help-toggle .ic { width: 18px; height: 18px; }
.profile-tour-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1000px) { .help-layout { grid-template-columns: minmax(0, 1fr); } .help-side { position: static; } .help-article { padding: 20px 18px 22px; } }
.help-shots-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 560px; }
.help-shots-pair .help-shot { margin: 16px 0 8px; }

/* The fleet assistant's panel (templates/assistant).  Chips and bubbles follow the accent. */
.assistant-panel { z-index: 63; width: min(460px, 100vw); }
.assistant-scrim { z-index: 62; }
.assistant-head-actions { display: flex; align-items: center; gap: 4px; }
.assistant-body { gap: 14px; background: var(--ink); }
.assistant-greeting, .assistant-thread, .assistant-exchange { display: flex; flex-direction: column; gap: 10px; }
.assistant-thread { gap: 18px; }
.assistant-bubble { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.assistant-bubble p { margin: 0; }
.assistant-bubble p + p { margin-top: 6px; }
.assistant-bubble-bot { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.assistant-bubble-person { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.assistant-follow { padding-left: 2px; }
.assistant-chip { font: inherit; font-size: 13px; padding: 6px 11px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); color: var(--text); cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.assistant-chip:hover, .assistant-chip:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); outline: none; }
.assistant-card { padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); border-top-left-radius: 4px; }
.assistant-card.is-refused { border-style: dashed; }
.assistant-card-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); font-weight: 600; }
.assistant-summary { margin: 4px 0 0; font-weight: 600; font-size: 14px; line-height: 1.45; }
.assistant-card > .muted { margin: 4px 0 0; }
.assistant-summary.is-ai { font-weight: 400; font-size: 14.5px; white-space: pre-line; }
.assistant-table-wrap { margin-top: 10px; overflow-x: auto; }
.assistant-table { font-size: 13px; }
.assistant-table th, .assistant-table td:not(.is-name) { white-space: nowrap; }
.assistant-table td.is-name { min-width: 96px; }
.assistant-table td:first-child a { font-weight: 600; }
.assistant-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 10px 0 0; font-size: 13px; }
.assistant-facts dt { color: var(--muted); font-size: 11px; }
.assistant-facts dd { margin: 0; overflow-wrap: anywhere; }
.assistant-reads { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.assistant-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 13px; font-weight: 600; }
.assistant-articles { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.assistant-articles a { display: inline-flex; align-items: center; gap: 6px; }
.assistant-articles .ic { width: 14px; height: 14px; }
.assistant-card > .assistant-chips { margin-top: 10px; }
.assistant-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.assistant-rate { display: inline-flex; gap: 2px; flex: none; }
.assistant-thumb { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.assistant-thumb .ic { width: 15px; height: 15px; }
.assistant-thumb:hover { background: var(--hover); color: var(--text); }
.assistant-thumb.is-on { color: var(--accent-text); background: var(--accent-soft); }
.assistant-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.assistant-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: assistant-dot 1s infinite ease-in-out; }
.assistant-typing i:nth-child(2) { animation-delay: .15s; }
.assistant-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes assistant-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .assistant-typing i { animation: none; } }
.assistant-note { margin: 0; }
.assistant-ask { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel); }
.assistant-ask input { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--text); outline: none; }
.assistant-ask input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.assistant-ask .btn .ic { width: 16px; height: 16px; }
.assistant-roles { display: flex; flex-direction: column; gap: 8px; }
.settings-usage { margin-top: 6px; }

/* The service desk board (templates/service).  Cards take the accent when dragged. */
.chip-sm { font-size: 11px; padding: 1px 7px; }
.desk-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 12px 16px; margin: 0 0 14px; }
.desk { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.desk + p { margin-top: 14px; }
.desk-col { display: flex; flex-direction: column; min-height: 240px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.desk-col-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.desk-cards { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 0 0 12px 12px; transition: background-color .15s ease; }
.desk-cards.is-over { background: var(--accent-soft); }
.desk-empty { margin: 6px 2px; }
.desk-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 11px; background: var(--raised); border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: 9px; cursor: grab; }
.desk-card.sev-critical { border-left-color: var(--error); }
.desk-card.sev-warning { border-left-color: var(--warn); }
.desk-card.is-dragging { opacity: .5; border-color: var(--accent); }
.desk-card.is-busy { opacity: .6; }
.desk-card-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.desk-card-title { font-weight: 600; font-size: 14px; line-height: 1.35; color: var(--text); }
.desk-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.avatar-xs { width: 22px; height: 22px; font-size: 10px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.desk-card-move { display: block; margin-top: 4px; }
.desk-part { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.job-order .kv + p, .job-order form + p { margin-top: 12px; }
.job-order-form { margin-top: 12px; }
.route-orders { margin-top: 16px; }
.route-orders .inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.route-orders .inline-form .field { flex: 1; min-width: 220px; }
/* Service target clocks (services/service_targets.py): on target, near it, past it. */
.desk-clock { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; color: var(--text-dim); background: var(--panel); border: 1px solid var(--line); }
.desk-clock .ic { width: 13px; height: 13px; }
.desk-clock.is-amber { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.desk-clock.is-red, .desk-clock.is-missed { color: var(--error); border-color: color-mix(in srgb, var(--error) 55%, transparent); background: color-mix(in srgb, var(--error) 12%, transparent); }
.desk-clock.is-met { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.pill-late { color: #fff; background: var(--error); white-space: nowrap; }
/* Queue tabs scroll sideways on a phone rather than wrapping each label. */
.desk-tabs { overflow-x: auto; scrollbar-width: thin; }
.desk-tabs a { white-space: nowrap; flex: none; }
.job-clock { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; white-space: normal; }
.kv > .job-clock { overflow: visible; }
.job-targets .kv + p { margin-top: 12px; }
.target-rows { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.target-row { padding-top: 12px; border-top: 1px solid var(--line); }
.target-row-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; }
.target-pair { display: flex; gap: 6px; align-items: stretch; }
.target-pair input { width: 72px; flex: none; }
.target-pair .select { flex: 1; min-width: 0; }
.target-rows + p { margin-top: 14px; }
.target-fieldset { border: 0; padding: 0; margin: 14px 0 12px; min-width: 0; }
.target-fieldset legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.target-days { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.target-warn { display: flex; flex-direction: column; gap: 10px; }
.target-warn .card-head + p { margin-top: 0; }
/* Client emails (templates/service/emails.html): words on the left, the email as
   the client sees it on the right, always on white like the real thing. */
.ce-fields { display: flex; flex-direction: column; gap: 8px; }
.ce-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ce-chip { cursor: pointer; font-family: var(--mono, monospace); }
.ce-stage { margin-top: 14px; }
.ce-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.ce-edit { display: flex; flex-direction: column; gap: 12px; }
.ce-edit .btn { align-self: flex-start; }
.ce-edit textarea { min-height: 190px; }
.ce-preview { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ce-preview-head { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.ce-preview-mail { position: relative; padding: 18px 20px 6px; background: #ffffff; color: #14202b; border: 1px solid #e3e8ee; border-radius: 12px; overflow: hidden; }
.ce-preview-bar { position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--accent); }
.ce-preview-product { display: block; font-size: 16px; color: #14202b; }
.ce-preview-stage { margin: 12px 0 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #8a97a6; }
.ce-preview-body p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: #14202b; overflow-wrap: anywhere; }
.ce-stage + .form-actions { margin-top: 16px; }
@media (max-width: 760px) { .ce-grid { grid-template-columns: minmax(0, 1fr); } }
.desk-card-move .select { width: 100%; }
.job-form { margin-top: 14px; gap: 12px; }
.job-form-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.job-incident { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.job-incident .badge { flex: none; }
.kv > .job-incident { white-space: normal; overflow: visible; }
@media (max-width: 700px) { .job-form-pair { grid-template-columns: 1fr; } }
.job-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.job-history li { display: flex; flex-direction: column; gap: 2px; padding-left: 12px; border-left: 2px solid var(--line-strong); }
.route-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.route { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.route.is-off { opacity: .65; }
.route-words p { margin: 4px 0 0; }
.route-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px; }
.route-actions form { margin: 0; }
.route-form .card + .card { margin-top: 14px; }
@media (max-width: 700px) { .route { flex-direction: column; } .desk { grid-template-columns: repeat(5, minmax(240px, 82vw)); } }

/* ---- costs for the TCO report, on a device's settings and an account (BACKLOG S2) ---- */
.cost-fields { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 14px; margin: 0; min-width: 0; }
.cost-fields legend { padding: 0 6px; font-weight: 600; font-size: 13px; color: var(--text); }
.cost-fields > p { margin: 0 0 10px; }
.cost-fields .form-grid { margin: 0; }
