/* Rema panel. Shared look; screen-specific rules go below their own heading. */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1c1f24;
  --muted: #5d6573;
  --border: #d9dde3;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --danger: #c62828;
  --ok: #2e7d32;
  --warn: #9a6200;
  --series-1: #2a78d6; /* chart line; validated against --surface in both modes */
  --radius: 8px;
  color-scheme: light dark;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1d2026;
    --text: #e6e8eb;
    --muted: #9aa3b0;
    --border: #2e333b;
    --accent: #4c8dff;
    --danger: #ef6b6b;
    --ok: #66bb6a;
    --warn: #f0b44c;
    --series-1: #3987e5;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

h1 { font-size: 1.4rem; margin: 0 0 1rem; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
[hidden] { display: none !important; }

button {
  font: inherit;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}
button.secondary { background: transparent; color: var(--text); border-color: var(--border); }
button:disabled { opacity: 0.6; cursor: progress; }

input {
  font: inherit;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

label { display: grid; gap: 0.3rem; font-weight: 500; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.loading, .notice { padding: 2rem; text-align: center; color: var(--muted); }
.notice.error, .form-error { color: var(--danger); }
.form-error { margin: 0; }
.form-error::first-letter { text-transform: uppercase; }

/* ---- shell ---- */

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.6rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.menu { display: flex; gap: 0.25rem; flex: 1; }
.menu a {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
}
.menu a:hover { color: var(--text); }
.menu a[aria-current="page"] { color: var(--text); background: var(--bg); font-weight: 600; }
.account { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.who { display: grid; text-align: right; line-height: 1.2; }
.who small { color: var(--muted); }

#screen { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

/* ---- login ---- */

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(360px, 100%); display: grid; gap: 1rem; }
.login-card h1 { margin: 0; font-size: 1.8rem; }
.login-card .muted { margin: -0.75rem 0 0.5rem; }

/* ---- stations ---- */

.empty { text-align: center; padding: 3rem 1.5rem; }
.empty p { margin: 0.25rem 0; }

.screen-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-bottom: 1rem; }
.screen-head h1 { margin: 0; }
.station-search { flex: 0 1 22rem; margin-left: auto; }

.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); }
table.list th, table.list td { text-align: left; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--border); }
table.list th { font-weight: 600; color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.station-id { white-space: nowrap; letter-spacing: 0.02em; }
.state { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.state::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: currentColor; }
.state.online { color: var(--ok); }
.state.offline { color: var(--muted); }
.station-list.stale { opacity: 0.45; }

/* ---- fleet health (summary, meters, alerts) ---- */

.fleet-summary, .stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.fleet-summary.stale, .reading.stale, .charts.stale { opacity: 0.45; }
.stat {
  display: grid;
  gap: 0.15rem;
  align-content: start;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
}
.stat-label { color: var(--muted); font-size: 0.85rem; }
.stat-value { font-size: 1.4rem; font-weight: 600; overflow-wrap: anywhere; }
.stat-sub { font-size: 0.85rem; overflow-wrap: anywhere; }
.stat.text .stat-value { font-size: 1.1rem; line-height: 1.3; overflow-wrap: break-word; }
.stat.online .stat-value { color: var(--ok); }
.stat.alert { border-color: var(--danger); }
.stat.alert .stat-value { color: var(--danger); }
.stat.alert .stat-value::before, .stat.warn .stat-value::before { content: "! "; }
.stat.warn .stat-value { color: var(--warn); }

.state-cell { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
.tag.warn { margin-left: 0; color: var(--warn); border-color: currentColor; white-space: nowrap; }
.tag.alert { margin-left: 0; color: var(--danger); border-color: currentColor; white-space: nowrap; }
table.stations td.user { overflow-wrap: anywhere; min-width: 7rem; }
table.stations tr.alert td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

.meter-cell { position: relative; display: inline-grid; grid-template-columns: auto auto; align-items: center; gap: 0.15rem 0.4rem; white-space: nowrap; }
.meter-cell .meter { grid-column: 1 / -1; }
.meter-cell:has(.meter-name) { grid-template-columns: auto auto; }
.meter-name { color: var(--muted); }
.meter-value { font-variant-numeric: tabular-nums; }
.meter {
  display: block;
  width: 4.5rem;
  height: 4px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--series-1) 18%, transparent);
  overflow: hidden;
}
.meter-fill { display: block; height: 100%; border-radius: 2px; background: var(--series-1); }
.meter-cell.full .meter-value, .meter-cell.full .meter-name { color: var(--danger); font-weight: 600; }
.meter-cell.full .meter-value::after { content: " !"; }
.meter-cell.full .meter { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.meter-cell.full .meter-fill { background: var(--danger); }

/* ---- station detail ---- */

.back { margin: 0 0 0.75rem; }
.back a { text-decoration: none; }
.head-actions { margin-left: auto; display: flex; gap: 0.5rem; }
.station-summary { margin: -0.5rem 0 0.5rem; }
.station-alert {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
}
.station-alert p { margin: 0; }
.station-alert p + p { margin-top: 0.4rem; }
.station-alert strong { color: var(--danger); }
.form-message.ok { color: var(--ok); }
.form-message.warn { color: var(--danger); }
.small { font-size: 0.85rem; }

.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin: 1rem 0 1.25rem; overflow-x: auto; }
.tabs button {
  background: transparent;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.5rem 0.9rem;
  white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

/* minmax(0, …): a wide table scrolls in its .table-wrap instead of
   widening the page */
.tab-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
.detail-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.detail-card { padding: 1.1rem 1.25rem; min-width: 0; }
.detail-card h2 { font-size: 1rem; margin: 0 0 0.75rem; }
.detail-card > p { margin: 0 0 0.75rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
/* break-word, not anywhere: short words stay whole and the table scrolls in
   its .table-wrap instead */
.tab-panel table.list td { overflow-wrap: break-word; }

.tab-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.program-search { flex: 0 1 22rem; }
.program-count { margin: 0; }

@media (max-width: 640px) {
  .facts { grid-template-columns: 1fr; gap: 0.1rem; }
  .facts dd { margin-bottom: 0.5rem; }
  .program-search { flex-basis: 100%; }
}

/* ---- station detail: metrics tab ---- */

.metrics-tab h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.reading-note, .reading .hint { margin: -0.25rem 0 0.75rem; font-size: 0.85rem; }

.volumes { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 0.6rem; }
.volume { display: grid; grid-template-columns: 2.5rem minmax(6rem, 16rem) 1fr; align-items: center; gap: 0.75rem; }
.volume .meter { width: 100%; height: 8px; border-radius: 4px; }
.volume .meter-fill { border-radius: 4px; }
.volume-text { font-variant-numeric: tabular-nums; }
.volume.full .meter { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.volume.full .meter-fill { background: var(--danger); }
.volume-alert { color: var(--danger); }

.charts-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin: 0.5rem 0 0.75rem; }
.charts-head h2 { margin: 0; }
.segmented { display: inline-flex; }
.segmented button { padding: 0.35rem 0.8rem; font-size: 0.9rem; border-radius: 0; }
.segmented button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.segmented button:last-child { border-radius: 0 var(--radius) var(--radius) 0; margin-left: -1px; }
.segmented button[aria-pressed="true"] { background: var(--bg); border-color: var(--accent); font-weight: 600; position: relative; }
.charts { display: grid; gap: 0.75rem; }

/* ---- charts (lib/chart.js) ---- */

.chart {
  position: relative;
  margin: 0;
  padding: 0.75rem 1rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; margin-bottom: 0.25rem; }
.chart-title { font-weight: 600; }
.chart-stats { color: var(--muted); font-size: 0.85rem; }
.chart-plot { position: relative; touch-action: pan-y; }
.chart-plot svg { display: block; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.chart-label { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-empty { fill: var(--muted); font-size: 13px; }
.chart-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--series-1); opacity: 0.1; }
.chart-dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart-cross { stroke: var(--muted); stroke-width: 1; shape-rendering: crispEdges; }
.chart-tip {
  position: absolute;
  top: 2.4rem;
  transform: translateX(-50%);
  padding: 0.3rem 0.55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.12);
  font-size: 0.85rem;
  white-space: nowrap;
  pointer-events: none;
}
.chart-tip span { color: var(--muted); }

/* ---- organizing the fleet: list filters, group, notes, edit dialog ---- */

.list-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin: 0 0 1rem; }
.group-filter { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 400; color: var(--muted); }
.list-filters select, textarea {
  font: inherit;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.list-filters select { max-width: min(18rem, 60vw); }
select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table.stations td.name .tag { white-space: nowrap; }
.notice button { margin-top: 0.75rem; }
.station-group { margin-left: 0; }
.head-actions { flex-wrap: wrap; justify-content: flex-end; }
.station-notes {
  margin: 0 0 0.75rem;
  max-width: 75ch;
  padding: 0.5rem 0.8rem;
  border-left: 3px solid var(--border);
  background: var(--surface);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
dialog.station-edit { width: min(34rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); color: var(--text); }
dialog.station-edit::backdrop { background: rgb(0 0 0 / 0.45); }
dialog.station-edit h2 { font-size: 1.1rem; margin: 0 0 1rem; }
dialog.station-edit .settings-form { max-width: none; }
dialog.station-edit textarea { width: 100%; resize: vertical; }

/* ---- fleet programs ---- */

.fleet-program-search { flex: 0 1 22rem; margin-left: auto; }
.fleet-program-list, .program-facts { margin-top: 0.75rem; }
table.list th.num, table.list td.num { text-align: right; white-space: nowrap; }
/* program names and versions from stations may be long and unbroken */
table.fleet-programs td, td.versions { overflow-wrap: break-word; }
td.versions { min-width: 8rem; }
.program-name { overflow-wrap: anywhere; }
.program-facts { margin-bottom: 1.25rem; }

@media (max-width: 640px) {
  .fleet-program-search { flex-basis: 100%; }
}

/* ---- settings ---- */

.settings-section { margin-bottom: 1.25rem; }
.settings-section h2 { font-size: 1.1rem; margin: 0 0 1rem; }
.settings-section h3 { font-size: 1rem; margin: 1.5rem 0 0.75rem; }
.settings-form { display: grid; gap: 0.9rem; max-width: 420px; }
.settings-form .hint { margin: -0.4rem 0 0; font-size: 0.85rem; }
.settings-section select {
  font: inherit;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.form-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.form-message { margin: 0.5rem 0 0; min-height: 1.45em; }
.form-message:empty { min-height: 0; margin: 0; }
button.danger { color: var(--danger); }
.tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
}
/* relative: keeps absolutely placed content (.visually-hidden) in the scroll box */
.table-scroll { overflow-x: auto; position: relative; }
table.users td { vertical-align: middle; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem; }
.row-actions button { padding: 0.3rem 0.7rem; font-size: 0.9rem; }
.reset-row td { background: var(--bg); }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem; }
.inline-form label { flex: 1 1 220px; max-width: 320px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- settings: agent install ---- */

.agent-install .hint { margin: 0.35rem 0 0.6rem; font-size: 0.85rem; }
.agent-install h3:first-of-type { margin-top: 1.25rem; }
.install-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.9rem 1.25rem; margin: 0; }
.install-facts dt { font-weight: 600; padding-top: 0.35rem; }
.install-facts dd { margin: 0; min-width: 0; }
.fact-value { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.fact-value code, .command pre {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
.fact-value code { padding: 0.3rem 0.5rem; }
.command { display: flex; align-items: flex-start; gap: 0.5rem; }
.command pre { flex: 1; min-width: 0; margin: 0; padding: 0.6rem 0.75rem; white-space: pre-wrap; font-size: 0.85rem; }
button.copy, .fact-value button, a.button { padding: 0.3rem 0.7rem; font-size: 0.9rem; white-space: nowrap; }
a.button {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}
a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
table.downloads td { vertical-align: middle; }
.download-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.download-links .form-error { flex-basis: 100%; font-size: 0.85rem; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 0.5rem 1rem; padding: 0.6rem 1rem; }
  .menu { order: 3; flex-basis: 100%; overflow-x: auto; }
  #screen { padding: 1rem; }
  .station-search { flex-basis: 100%; }
  table.list th, table.list td { padding: 0.5rem; }
  table.list th { white-space: normal; }
  .install-facts { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
  .install-facts dd + dt { margin-top: 0.6rem; }
  .command { flex-direction: column; align-items: stretch; }
  .command button.copy { align-self: flex-start; }
  .fleet-summary { grid-template-columns: repeat(2, 1fr); }
  .volume { grid-template-columns: 2.5rem 1fr; }
  .volume-text { grid-column: 2; }
  dialog.station-edit { padding: 1rem; }
}

/* ---- agent updates (lib/agentupdate.js, screens/settings/agent-update.js) ---- */

.update-situation { font-weight: 600; }
.update-situation.ok { color: var(--ok); }
.update-situation.warn { color: var(--warn); }
.update-situation.failed { color: var(--danger); }
.update-situation.busy { color: var(--accent); }
.update-situation.muted { color: var(--muted); font-weight: 400; }
.detail-grid.alone { grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.agent-card .agent-note { margin: 0.6rem 0 0; }
.agent-card .form-actions { margin-top: 0.9rem; }
.tag.outdated { margin-left: 0; white-space: nowrap; }
.tag.outdated.failed { color: var(--danger); border-color: currentColor; }
.agent-update .hint { margin: 0.35rem 0 0.6rem; font-size: 0.85rem; }
.agent-update .install-facts { margin-bottom: 0.5rem; }
.tag.signed { margin-left: 0; color: var(--ok); border-color: currentColor; }
.update-warning {
  margin: 0.75rem 0;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
}
.update-warning p { margin: 0; }
.update-warning strong { color: var(--warn); }
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
label.check input { width: auto; margin: 0; }
.update-counts { margin: 0 0 0.5rem; }

/* ---- remote session ---- */

/* In the stations list. */
.session-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; }
.tag.in-session { margin-left: 0; color: var(--accent); border-color: var(--accent); }
.open-session { white-space: nowrap; }
/* In the station detail's header, beside its buttons. */
a.button-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
}

/* The session's own tab takes the whole window. */
body.session-mode .topbar { display: none; }
body.session-mode #screen { max-width: none; padding: 0; }

.session {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
}
.session-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  padding: 0.4rem 0.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.session-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.75rem; min-width: 0; }
.session-title strong { overflow-wrap: anywhere; }
.session-status { color: var(--muted); font-size: 0.9rem; }
.session-status[data-state="connected"] { color: var(--ok); }
.session-tools { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-left: auto; }
.session-tools button { padding: 0.3rem 0.65rem; font-size: 0.9rem; }
.session-tools button:disabled { cursor: not-allowed; }
.session-tools button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.session-tools button.has-news::after {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}
.session-clipboard {
  display: grid;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.session-clipboard textarea {
  font: inherit;
  width: 100%;
  resize: vertical;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}
.session-clipboard-note { margin: 0; font-size: 0.85rem; }
.session-stage { position: relative; flex: 1; min-height: 0; background: #202124; }
.session-screen { position: absolute; inset: 0; }
.session-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  overflow: auto;
  background: rgb(0 0 0 / 0.55);
}
.session-message { width: min(440px, 100%); display: grid; gap: 0.75rem; }
.session-message h2 { margin: 0; font-size: 1.15rem; }
.session-message p { margin: 0; }
.session-login label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: normal; }
.session-login label.check input { width: auto; margin: 0; }
.session-detail { overflow-wrap: anywhere; }
.session-detail::first-letter { text-transform: uppercase; }

@media (max-width: 640px) {
  .session-tools { margin-left: 0; }
}

/* ---- audit (lib/audit.js: the audit screen and the station's sessions tab) ---- */

.audit-intro { margin: -0.5rem 0 1rem; }
table.audit td { vertical-align: top; }
table.audit td.when { white-space: nowrap; }
/* break-word: station and account names may be long, but short words stay
   whole and the table scrolls in its .table-wrap instead; an address too */
table.audit td.station, table.audit td.operator { overflow-wrap: break-word; min-width: 7rem; }
table.audit td.ip { white-space: nowrap; }
table.audit td.outcome { min-width: 10rem; }
table.audit .tag { white-space: nowrap; }
.outcome-label { font-weight: 600; white-space: nowrap; }
.outcome-label.running { color: var(--accent); }
.outcome-label.failed { color: var(--danger); }
table.audit tr.failed td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.reason { color: var(--muted); overflow-wrap: break-word; }
.reason::first-letter { text-transform: uppercase; }
.audit-more-row { margin: 0.75rem 0 0; text-align: center; }
.audit-more-row:has(> [hidden]) { display: none; }
