/* Activity Atlas — in the style of a macOS app: system font and colors,
   quiet surfaces, one accent (system blue), light and dark appearance. */
:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --sidebar: rgba(236, 236, 240, .82);
  --panel: #ffffff;
  --panel-2: #f2f2f7;
  --panel-3: #e8e8ed;
  --line: rgba(0, 0, 0, .07);
  --line-2: rgba(0, 0, 0, .12);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --faint: #8e8e93;
  --accent: #007aff;
  --accent-soft: rgba(0, 122, 255, .1);
  --accent-text: #ffffff;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --purple: #af52de;
  --teal: #32ade6;
  --indigo: #5856d6;
  --good: #34c759;
  --warn: #c93400;
  --bad: #ff3b30;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161617;
    --sidebar: rgba(30, 30, 32, .86);
    --panel: #1f1f21;
    --panel-2: #2a2a2d;
    --panel-3: #363639;
    --line: rgba(255, 255, 255, .07);
    --line-2: rgba(255, 255, 255, .13);
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --faint: #7c7c82;
    --accent: #0a84ff;
    --accent-soft: rgba(10, 132, 255, .18);
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --purple: #bf5af2;
    --teal: #64d2ff;
    --indigo: #5e5ce6;
    --good: #30d158;
    --warn: #ff9f0a;
    --bad: #ff453a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 13.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
h1 { font: 700 26px/1.2 var(--display); letter-spacing: -.02em; margin: 0; }
h2 { font: 600 15px/1.3 var(--display); letter-spacing: -.01em; margin: 0; }
p { margin: 0; }
a { color: var(--accent); }
strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Controls */
button, select, input { font: inherit; color: inherit; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: var(--accent-text); border: 0; border-radius: 8px;
  padding: 6px 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: filter .12s, background .12s;
}
button:hover { filter: brightness(1.06); }
button:active { filter: brightness(.94); }
button:disabled { opacity: .4; cursor: default; filter: none; }
button.secondary { background: var(--panel); color: var(--text); box-shadow: 0 0 0 .5px var(--line-2), 0 1px 1px rgba(0, 0, 0, .05); }
button.secondary:hover { background: var(--panel-2); filter: none; }
button.danger { background: var(--red); color: #fff; }
button.link { background: none; color: var(--accent); padding: 2px 4px; font-weight: 500; box-shadow: none; }
button.link:hover { text-decoration: underline; filter: none; }
.icon-button { background: var(--panel); color: var(--text); width: 30px; height: 30px; padding: 0; border-radius: 8px; box-shadow: 0 0 0 .5px var(--line-2), 0 1px 1px rgba(0, 0, 0, .05); }
.icon-button:hover { background: var(--panel-2); filter: none; }
input, select {
  background: var(--panel); border: 0; border-radius: 7px; padding: 6px 10px; min-width: 0; color: var(--text);
  box-shadow: 0 0 0 .5px var(--line-2), 0 1px 1px rgba(0, 0, 0, .04);
}
input[type="search"] { min-width: 240px; }
input::placeholder { color: var(--faint); }
input:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible, [role="button"]:focus-visible, tr:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px;
}
label { font-weight: 500; font-size: 12.5px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.message { min-height: 1em; color: var(--muted); font-size: 12.5px; }
.message.error { color: var(--bad); }

/* Brand */
.brand { display: flex; align-items: center; gap: 9px; font: 600 15px/1 var(--display); letter-spacing: -.01em; }
.brand b { font-weight: 600; }
.logo { width: 24px; height: 24px; flex: none; }

/* Sign in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.signin-card {
  width: min(440px, 100%); background: var(--panel); border-radius: 16px; padding: 28px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 0 0 .5px var(--line), 0 10px 40px rgba(0, 0, 0, .1);
}
.signin-card .brand { margin-bottom: 6px; }
.help summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.help ul { padding-left: 18px; color: var(--muted); margin: 8px 0 0; }
.help li { margin: 4px 0; }

/* Shell: sidebar + main */
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px;
  padding: 18px 10px; background: var(--sidebar); border-right: .5px solid var(--line-2);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.sidebar .brand { padding: 2px 10px 18px; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--faint); padding: 6px 10px 4px; }
.tabs { display: flex; flex-direction: column; gap: 2px; }
.tabs button { justify-content: flex-start; gap: 9px; background: none; color: var(--text); padding: 6px 10px; border-radius: 7px; font-weight: 400; }
.tabs button .icon { width: 17px; height: 17px; color: var(--accent); }
.tabs button:hover { background: var(--line); filter: none; }
.tabs button.active { background: var(--line-2); font-weight: 500; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.server-card {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px; text-align: left;
  background: var(--panel); color: var(--text); border-radius: 10px; padding: 10px 12px; font-weight: 400;
  box-shadow: 0 0 0 .5px var(--line);
}
.server-card:hover { background: var(--panel-2); filter: none; }
.server-label { font-size: 11px; font-weight: 600; color: var(--faint); }
.server-line { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.server-address { font: 11px/1.4 var(--mono); color: var(--muted); word-break: break-all; }
.server-meta { font-size: 11px; color: var(--faint); }
.me {
  display: flex; align-items: center; justify-content: flex-start; gap: 9px; padding: 6px 8px; background: none;
  color: var(--text); border-radius: 8px; text-align: left; font-weight: 400;
}
.me:hover { background: var(--line); filter: none; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text strong { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: var(--faint); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { width: 100%; max-width: 1420px; margin: 0 auto; padding: 26px 30px 40px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.view { display: flex; flex-direction: column; gap: 16px; }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.view-head p.muted { margin-top: 3px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.person-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.person-status { display: inline-flex; align-items: center; gap: 6px; }
.person-status:empty { display: none; }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.date-nav { display: inline-flex; align-items: center; gap: 4px; }
.banner { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; color: var(--text); }
.banner.error { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--text); }
.footnote { color: var(--faint); font-size: 12px; max-width: 980px; }

/* Checkboxes and the Live switch */
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12.5px; color: var(--text); font-weight: 400; white-space: nowrap; }
.check input { accent-color: var(--accent); margin: 0; box-shadow: none; padding: 0; }
.switch { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--text); font-size: 12.5px; font-weight: 400; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 32px; height: 19px; border-radius: 999px; background: var(--panel-3); position: relative; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(13px); }
.switch input:focus-visible + .track { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.switch input:disabled + .track { opacity: .4; }

/* Segmented control, like macOS */
.segmented { display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; background: var(--panel-3); }
.segmented button { background: none; color: var(--text); padding: 4px 14px; border-radius: 6px; font-weight: 400; }
.segmented button:hover { filter: none; background: color-mix(in srgb, var(--panel) 40%, transparent); }
.segmented button.active { background: var(--panel); font-weight: 500; box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 .5px var(--line); }

/* Cards */
.card {
  background: var(--panel); border-radius: var(--radius); padding: 18px;
  box-shadow: 0 0 0 .5px var(--line), var(--shadow);
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card-head.padded { padding: 16px 18px 12px; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h2::after { content: " ›"; color: var(--faint); }
details.card[open] > summary h2::after { content: " ⌄"; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.grid-wide { grid-template-columns: minmax(0, 2.1fr) minmax(280px, 1fr); }
.grid.grid-ring { grid-template-columns: minmax(300px, 1fr) minmax(0, 1.9fr); }
.empty { color: var(--muted); padding: 16px; text-align: center; }
.legend-line { color: var(--faint); font-size: 11.5px; text-align: center; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpis.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi {
  background: var(--panel); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: 0 0 0 .5px var(--line), var(--shadow); display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.kpi-top { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12.5px; font-weight: 500; min-width: 0; }
.kpi-top > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.kpi-icon .icon { width: 15px; height: 15px; }
.kpi-icon.cyan { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal); }
.kpi-icon.amber { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.kpi-icon.violet { background: color-mix(in srgb, var(--purple) 16%, transparent); color: var(--purple); }
.kpi-icon.coral { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.kpi strong { font: 600 26px/1.15 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 8px; }
.kpi small { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi.highlight strong { color: var(--accent); }

/* Charts */
.chart { position: relative; height: 240px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.axis-label { fill: var(--faint); font: 10.5px var(--font); font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--panel); stroke: var(--accent); stroke-width: 2; }
.chart-bar { transition: opacity .15s; }
.chart-hit { fill: transparent; }
.chart-now { stroke: var(--red); stroke-width: 1; stroke-dasharray: 2 3; opacity: .8; }
.chart-cursor { stroke: var(--line-2); stroke-width: 1; }
.chart-tip {
  position: absolute; pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); z-index: 3;
  background: var(--panel); color: var(--text); border-radius: 8px; padding: 6px 10px; font-size: 12px; white-space: nowrap;
  box-shadow: 0 0 0 .5px var(--line-2), 0 6px 20px rgba(0, 0, 0, .15);
}
.chart-tip strong { display: block; font-weight: 600; }

/* 24-hour ring */
.ring { display: grid; place-items: center; min-height: 240px; }
.ring .calendar { width: 100%; }
.ring svg { width: min(100%, 290px); height: auto; overflow: visible; }
.ring-track { fill: none; stroke: var(--panel-2); }
.ring-tick { stroke: var(--line-2); stroke-width: 1; }
.ring-tick.major { stroke: var(--faint); stroke-width: 1.2; }
.ring-label { fill: var(--faint); font: 500 10.5px var(--font); }
.ring-inner { fill: none; stroke: var(--line); }
.ring-slot { stroke-width: 3; stroke-linecap: round; }
.ring-value { fill: var(--text); font: 600 26px var(--display); letter-spacing: -.02em; }
.ring-caption { fill: var(--faint); font: 500 10.5px var(--font); }
.ring-sub { fill: var(--muted); font: 11.5px var(--font); }
.ring-hand { stroke: var(--red); stroke-width: 1.5; }
.ring-hand-dot { fill: var(--red); }

/* Week / month calendar */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; align-content: center; min-height: 240px; }
.cal-head { font-size: 11px; font-weight: 500; color: var(--faint); text-align: center; padding-bottom: 2px; }
.cal-cell {
  position: relative; aspect-ratio: 1; min-height: 34px; border-radius: 8px; background: var(--panel-2);
  display: flex; align-items: center; justify-content: center; padding: 0; color: var(--text); font-weight: 400;
}
.cal-cell:hover { background: var(--panel-3); filter: none; }
.cal-cell.blank { visibility: hidden; }
.cal-cell.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-cell.future { opacity: .4; }
.cal-day { position: absolute; top: 3px; left: 6px; font-size: 10.5px; color: var(--faint); }
.cal-bubble { aspect-ratio: 1; border-radius: 50%; background: var(--accent); }
.calendar.week .cal-cell { aspect-ratio: auto; height: 150px; }
.calendar.week .cal-value { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Gauge */
.gauge { display: grid; place-items: center; min-height: 190px; }
.gauge svg { width: min(100%, 290px); height: auto; overflow: visible; }
.gauge-track { fill: none; stroke: var(--panel-2); stroke-width: 16; stroke-linecap: round; }
.gauge-tick { stroke: var(--line-2); stroke-width: 1; }
.gauge-value { fill: var(--text); font: 600 34px var(--display); letter-spacing: -.03em; }
.gauge-caption { fill: var(--faint); font: 500 11px var(--font); }
.gauge-end { fill: var(--faint); font: 10.5px var(--font); }

/* Bars */
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.bar-row .label { overflow: hidden; font-weight: 500; display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-row .label small { color: var(--faint); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.label-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.bar-row .value { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-track { grid-column: 1 / -1; height: 5px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.legend { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--accent); }
.bar-row.clickable { cursor: pointer; }
.bar-row.clickable:hover .label-text { color: var(--accent); }
.bar-row.selected .label-text { color: var(--accent); }
.sub-bars { padding: 4px 0 6px 14px; border-left: 2px solid var(--panel-2); display: flex; flex-direction: column; gap: 10px; }
.sub-bars .bar-track i { opacity: .7; }
.spectrum { display: flex; height: 8px; gap: 2px; border-radius: 999px; overflow: hidden; }
.spectrum i { display: block; height: 100%; min-width: 3px; flex: 1 1 0; }

/* Devices and status */
.device-list { display: flex; flex-direction: column; gap: 8px; }
.device { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; border-radius: 10px; padding: 9px 12px; background: var(--panel-2); }
.device strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; font-weight: 500; }
.device .value { font-weight: 500; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.tracking { background: var(--green); }
.dot.offline { background: var(--faint); opacity: .7; }
.dot.removed, .dot.never_connected { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.dot.online { background: var(--green); }
.dot.local { background: var(--orange); }
.status {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: 999px;
  padding: 2px 9px; font-size: 12px; color: var(--muted); background: var(--panel-2);
}
.status.tracking { color: var(--text); background: color-mix(in srgb, var(--green) 14%, transparent); }

/* Avatars */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font: 600 12px/1 var(--font); color: var(--accent); background: var(--accent-soft); border: 0 !important;
}
.avatar.large { width: 52px; height: 52px; font-size: 18px; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 500; color: var(--faint); padding: 8px 18px; border-bottom: .5px solid var(--line-2); white-space: nowrap; }
.table td { padding: 10px 18px; border-bottom: .5px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.people-table tbody tr { cursor: pointer; }
.people-table tbody tr:hover { background: var(--panel-2); }
.person-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person-name { font-weight: 500; }
.person-meta { color: var(--faint); font-size: 12px; }
.active-cell { min-width: 120px; }
.active-cell .num { display: block; font-weight: 500; text-align: left; }
.mini-track { display: block; height: 4px; border-radius: 999px; background: var(--panel-2); margin-top: 5px; overflow: hidden; }
.mini-track i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.mono-cell { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border-radius: 999px; padding: 2px 9px; font-size: 12px; white-space: nowrap; }
.chip button { padding: 0 2px; background: none; color: var(--faint); font-weight: 600; }
.chip button:hover { color: var(--red); filter: none; }
.chip button.chip-name { color: var(--text); font-weight: 400; padding: 0; }
.chip button.chip-name:hover { color: var(--accent); text-decoration: underline; }
.actions-col { width: 1%; white-space: nowrap; }
.row-actions { display: flex; gap: 2px; flex-wrap: nowrap; justify-content: flex-end; }

/* Task log */
.filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 108px 3px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 10px 6px; border-bottom: .5px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline .swatch { width: 3px; align-self: stretch; min-height: 24px; border-radius: 2px; background: var(--accent); }
.timeline .what { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.timeline .what strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.timeline .what small { color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.task-head strong { min-width: 0; }
.steps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.step { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; color: var(--muted); background: var(--panel-2); white-space: nowrap; }
.step.editing { color: var(--accent); background: var(--accent-soft); }
.step.excluded_sensitive { color: var(--red); }
button.repeat {
  flex: none; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 500;
  background: color-mix(in srgb, var(--orange) 15%, transparent); color: var(--orange);
}
button.repeat.first { background: var(--panel-2); color: var(--muted); }
button.repeat:hover { filter: brightness(1.05); }
.timeline li.brief { opacity: .55; }
.timeline .length { font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline .length.idle { font-weight: 400; color: var(--faint); }
.timeline li.gap { color: var(--faint); }
.timeline li.gap .swatch { background: var(--panel-3); }
.timeline li.gap .length { font-weight: 400; color: var(--faint); }
.timeline li.day-row { cursor: pointer; }
.timeline li.day-row:hover { background: var(--panel-2); }

/* Connection */
.connection { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.connection .item { background: var(--panel-2); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.connection code, .copy-field code { font-family: var(--mono); font-size: 12px; word-break: break-all; color: var(--text); }
.ok { color: var(--good); font-weight: 500; }
.warn { color: var(--warn); font-weight: 500; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }

/* Recording detail */
.detail-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-radius: 10px; background: var(--panel-2); cursor: pointer; color: var(--text); font-weight: 400; font-size: 13px; box-shadow: inset 0 0 0 1px transparent; }
.option:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.option input { margin-top: 3px; accent-color: var(--accent); box-shadow: none; }
.option strong { display: block; font-weight: 600; margin-bottom: 2px; }
.option small { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.option-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.detail-options .message { grid-column: 1 / -1; }

/* Dialog */
dialog {
  border: 0; border-radius: 14px; padding: 0; background: var(--panel); color: var(--text);
  width: min(560px, calc(100vw - 32px)); box-shadow: 0 0 0 .5px var(--line-2), 0 24px 70px rgba(0, 0, 0, .3);
}
dialog::backdrop { background: rgba(0, 0, 0, .25); }
.dialog-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.dialog-body h2 { font-size: 17px; }
#dialog-content { display: flex; flex-direction: column; gap: 12px; color: var(--muted); }
#dialog-content input, #dialog-content select { color: var(--text); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.copy-field { display: flex; gap: 8px; align-items: stretch; background: var(--panel-2); border-radius: 8px; padding: 7px 7px 7px 12px; }
.copy-field code { flex: 1; align-self: center; }
ol.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.invite-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Getting started */
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.setup-steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; border-radius: 10px; padding: 12px; background: var(--panel-2); }
.setup-steps .mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--panel); box-shadow: 0 0 0 .5px var(--line-2); }
.setup-steps li.done .mark { background: var(--green); color: #fff; box-shadow: none; }
.setup-steps .step-text strong { display: block; font-weight: 600; }
.setup-steps .step-text span { color: var(--muted); font-size: 12.5px; word-break: break-word; }
.setup-steps .step-actions { grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* Join page */
.join-card { width: min(560px, 100%); }
.join-card h2 { margin-top: 8px; }
.button-link {
  display: inline-flex; align-items: center; gap: 6px; text-align: center; background: var(--accent); color: var(--accent-text);
  border-radius: 8px; padding: 7px 14px; font-weight: 500; text-decoration: none; align-self: flex-start;
}
.button-link:hover { filter: brightness(1.06); }
.button-link.secondary-link { background: var(--panel); color: var(--text); box-shadow: 0 0 0 .5px var(--line-2); }

/* Wider and narrower windows */
@media (min-width: 1720px) { .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1240px) {
  .grid.grid-wide, .grid.grid-ring { grid-template-columns: minmax(0, 1fr); }
  .grid.three, .connection { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; border-right: 0; border-bottom: .5px solid var(--line-2); }
  .sidebar .brand { padding: 0; }
  .sidebar .brand span, .nav-label, .sidebar-foot { display: none; }
  .tabs { flex-direction: row; overflow-x: auto; flex: 1; }
  main { padding: 18px 16px 32px; }
  .grid, .grid.three, .connection, .detail-options { grid-template-columns: minmax(0, 1fr); }
  .kpis, .kpis.kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timeline li { grid-template-columns: 90px 3px minmax(0, 1fr); }
  .timeline .length { grid-column: 3; }
  input[type="search"] { min-width: 0; flex: 1 1 100%; }
  h1 { font-size: 22px; }
}
@media (max-width: 520px) {
  .tabs button span { display: none; }
  .kpi strong { font-size: 21px; }
}
