/* Elements that set display (flex, grid) would otherwise ignore the hidden attribute. */
[hidden] {
  display: none !important;
}

:root {
  /* Colours: light by default (2026-11-10), the app's kit (mobile/lib/core/theme.dart,
     Palette.light); the dark set below is chosen in the Account menu (html[data-theme="dark"],
     public/common.js). Every colour on the pages is one of these. */
  --bg: #f5f7fb;
  --bg-glow: #e6edf8;
  --panel: #ffffff;
  --panel-soft: #eef2f8;
  --text: #13203a;
  --muted: #5b6b8c;
  --primary: #0e7fc7;
  --on-primary: #ffffff;
  --violet: #5b4ce0;
  --success: #13936f;
  --warning: #b36b00;
  --danger: #d1304a;
  --border: rgba(19, 32, 58, 0.10);
  /* The same colours as r, g, b, for see-through shades: rgba(var(--primary-rgb), 0.15). */
  --primary-rgb: 14, 127, 199;
  --success-rgb: 19, 147, 111;
  --warning-rgb: 179, 107, 0;
  --danger-rgb: 209, 48, 74;
  --muted-rgb: 91, 107, 140;
  --violet-rgb: 91, 76, 224;
  --panel-rgb: 255, 255, 255;
  --on-primary-rgb: 255, 255, 255;
  /* The ink for see-through overlays on this theme's surfaces (dark ink on light, white on dark). */
  --light-rgb: 19, 32, 58;
  --shadow-rgb: 19, 32, 58;
  --chrome-rgb: 250, 251, 254;
  /* Chart series: categorical slots 1-2, validated for CVD and contrast on --panel. */
  --series-real: #2f6fd6;
  --series-cdn: #c94f1f;
  --series-3: #138a5f;
  /* WhatsApp's own green, on its buttons only. */
  --whatsapp: #25d366;

  /* Corners */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 16px;
  --radius-2xl: 18px;
  --radius-pill: 999px;

  /* Text sizes */
  --text-xs: 12px;
  --text-sm: 12px;
  --text-md: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 24px;

  /* Spacing (gaps, padding, margins): steps of 2px */
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 10px;
  --space-6: 12px;
  --space-7: 14px;
  --space-8: 16px;
  --space-9: 18px;
  --space-10: 20px;
}

/* The dark set (Account → Dark theme; public/common.js): the same tokens, dark (Palette.dark). */
:root[data-theme="dark"] {
  --bg: #0b1020;
  --bg-glow: #122444;
  --panel: #111a2f;
  --panel-soft: #16233f;
  --text: #edf3ff;
  --muted: #9aa8c7;
  --primary: #5cc8ff;
  --on-primary: #071120;
  --violet: #8d7dff;
  --success: #31d0aa;
  --warning: #ffbf69;
  --danger: #ff5d73;
  --border: rgba(var(--light-rgb), 0.08);
  --primary-rgb: 92, 200, 255;
  --success-rgb: 49, 208, 170;
  --warning-rgb: 255, 191, 105;
  --danger-rgb: 255, 93, 115;
  --muted-rgb: 154, 168, 199;
  --violet-rgb: 141, 125, 255;
  --panel-rgb: 17, 26, 47;
  --on-primary-rgb: 7, 17, 32;
  --light-rgb: 255, 255, 255;
  --shadow-rgb: 0, 0, 0;
  --chrome-rgb: 9, 13, 25;
  --series-real: #3987e5;
  --series-cdn: #d95926;
  --series-3: #199e70;
}

* {
  box-sizing: border-box;
}

/* The whole site a step smaller than the browser's 16px (headings in rem follow). */
html {
  font-size: 15px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-size: var(--text-base);
  /* Easier on the eyes over a day's work: more space between lines, smoother letters. */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-family: 'Inter', 'Noto Kufi Arabic', sans-serif;
  background: radial-gradient(circle at top, var(--bg-glow) 0%, var(--bg) 48%);
  color: var(--text);
}

button, input, select, textarea {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: rgba(var(--chrome-rgb), 0.92);
  border-inline-end: 1px solid var(--border);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  margin-bottom: var(--space-8);
}

/* The company's logo (Rules & names → The company), or NetPulse's mark (public/logo-96.png). */
.brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(var(--light-rgb), 0.08);
}
.brand > div {
  min-width: 0;
}
/* The company's name, NetPulse small under it (public/common.js applyBrand). */
.brand-name {
  font-size: var(--text-lg);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-product {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand h1,
.topbar h2,
.panel h3 {
  margin: 0;
}

.brand p,
.eyebrow,
.panel-header span,
.client-meta,
.muted {
  color: var(--muted);
}

/* The menu scrolls on its own; the user box stays at the bottom. */
.nav {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-inline: calc(-1 * var(--space-4));
  padding-inline: var(--space-4);
}

.nav-item {
  /* A link (right-click: open in a new tab), drawn as a menu row. */
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(var(--light-rgb), 0.78);
  border-radius: var(--radius-sm);
  padding: var(--space-6) var(--space-7);
  text-align: start;
  font: inherit;
  font-size: var(--text-md);
  line-height: 1.3;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.nav-item:hover {
  background: rgba(var(--light-rgb), 0.05);
  color: var(--text);
}

/* The page you are on: a tinted row with an accent bar at its start. */
.nav-item.active {
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}

[dir="rtl"] .nav-item.active {
  box-shadow: inset -3px 0 0 var(--primary);
}

.content {
  padding: 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 var(--space-4);
  text-transform: uppercase;
  font-size: var(--text-sm);
  letter-spacing: 0.12em;
}

.status-pill {
  background: rgba(var(--success-rgb), 0.12);
  color: var(--success);
  border: 1px solid rgba(var(--success-rgb), 0.35);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-9);
  margin-bottom: 28px;
}

/* A card as the app draws it (mobile/lib/core/theme.dart cardTheme): flat, a hairline border,
   soft corners, the lightest of shadows to lift it off the page. */
.summary-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.04), 0 8px 24px rgba(var(--shadow-rgb), 0.06);
}

.summary-card {
  padding: var(--space-10);
}

.summary-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 18px;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-value {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
}

.summary-footnote {
  margin-top: 10px;
  font-size: var(--text-sm);
  color: var(--muted);
}

.panel {
  padding: var(--space-10);
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2) var(--space-6);
  margin-bottom: 16px;
}

.panel-header span {
  font-size: var(--text-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
}

/* Rows in the kit's rhythm (the list row: 12px tall padding, 16px at the sides, a hairline under
   each); column headings as the kit's section labels. */
th, td {
  text-align: start;
  padding: var(--space-6) var(--space-6);
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}

th {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

tbody:not(.static-rows) tr {
  cursor: pointer;
  transition: background 0.18s ease;
}

tbody:not(.static-rows) tr:hover {
  background: rgba(var(--light-rgb), 0.04);
}

/* A small word in colour: the kit's chip (mobile/lib/core/kit.dart KitChip). */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.3;
}

.badge.online {
  background: rgba(var(--success-rgb), 0.12);
  color: var(--success);
}

.badge.offline {
  background: rgba(var(--danger-rgb), 0.12);
  color: var(--danger);
}

.client-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: var(--space-4) var(--space-9);
  font-size: var(--text-base);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-8);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.badge.idle {
  background: rgba(var(--muted-rgb), 0.12);
  color: var(--muted);
}

.status-pill.warning {
  background: rgba(var(--warning-rgb), 0.12);
  color: var(--warning);
  border-color: rgba(var(--warning-rgb), 0.35);
}

.small {
  font-size: var(--text-sm);
}

.error-text {
  color: var(--danger);
}

.table-scroll {
  overflow-x: auto;
}

#client-table-body td,
#alert-table-body td,
#router-table-body td {
  white-space: nowrap;
}

.client-link {
  font-weight: 600;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(var(--primary-rgb), 0.4);
  text-underline-offset: 3px;
}

tbody:not(.static-rows) tr:hover .client-link {
  color: var(--primary);
}

/* Consumption levels use the status colors, always with a text label. */
.badge.level-full {
  background: rgba(var(--danger-rgb), 0.14);
  color: var(--danger);
}

/* "warning" is asked for on tickets, stock, the cash book and the customer page: it had no
   style of its own and showed as bare bold text. */
.badge.level-middle,
.badge.warning {
  background: rgba(var(--warning-rgb), 0.14);
  color: var(--warning);
}

.badge.level-normal {
  background: rgba(var(--success-rgb), 0.12);
  color: var(--success);
}

.badge.level-unlimited {
  background: rgba(var(--violet-rgb), 0.16);
  color: var(--violet);
}

.summary-card.level-unlimited {
  border-top: 3px solid var(--violet);
}

.section-title {
  margin: var(--space-4) 0 var(--space-6);
  font-size: 1rem;
}

.stat-grid-6 {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.card-button {
  text-align: start;
  color: inherit;
  cursor: pointer;
}

.card-button:hover {
  border-color: rgba(var(--primary-rgb), 0.4);
}

.summary-card.level-full {
  border-top: 3px solid var(--danger);
}

.summary-card.level-middle {
  border-top: 3px solid var(--warning);
}

.summary-card.level-normal {
  border-top: 3px solid var(--success);
}

.stacked-panel {
  margin-bottom: 18px;
}

.usage-rules {
  margin: -14px 0 24px;
  line-height: 1.5;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-count {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: var(--on-primary);
  font-size: var(--text-sm);
  font-weight: 700;
  text-align: center;
}

.nav-count[hidden] {
  display: none;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  margin-bottom: 14px;
}

.toolbar input {
  flex: 1 1 220px;
}

input,
select,
textarea {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  line-height: 1.35;
}

/* One height for a box and the button beside it. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
select {
  min-height: 36px;
}

/* Where the keyboard is: a clear ring (keyboard only, not on a mouse click). */
:focus-visible {
  outline: 2px solid rgba(var(--primary-rgb), 0.7);
  outline-offset: 2px;
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: var(--text-md);
}

.pager div {
  display: flex;
  gap: var(--space-4);
}

.pager .pager-jump {
  width: auto;
  min-width: 0;
}

.btn {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-7);
  min-height: 36px;
  line-height: 1.3;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

/* Icons inside buttons: one size, lined up with the words. */
.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:not(:disabled):hover {
  border-color: rgba(var(--light-rgb), 0.22);
}

/* The one main action of a place is filled, as the app's FilledButton; the rest stay quiet. */
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.btn.primary:not(:disabled):hover {
  border-color: var(--primary);
  filter: brightness(1.07);
}

.btn.small-btn {
  padding: var(--space-2) var(--space-5);
  min-height: 30px;
  font-size: var(--text-sm);
}

.btn.danger {
  background: rgba(var(--danger-rgb), 0.12);
  border-color: rgba(var(--danger-rgb), 0.4);
  color: var(--danger);
}

.badges {
  display: flex;
  gap: var(--space-3);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.diag-summary {
  margin: var(--space-2) 0;
  font-size: var(--text-base);
}

table.compact th,
table.compact td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-md);
}

.toast {
  position: fixed;
  z-index: 1100;
  inset-inline-end: 20px;
  bottom: 20px;
  max-width: 420px;
  padding: var(--space-6) var(--space-8);
  border-radius: var(--radius-md);
  /* Inverted, as the app's snackbar: the theme's ink as the ground, its ground as the ink. */
  background: var(--text);
  color: var(--bg);
  border: 0;
  border-inline-start: 4px solid var(--primary);
  box-shadow: 0 12px 32px rgba(var(--shadow-rgb), 0.25);
}

.toast.success {
  border-inline-start-color: var(--success);
}

.toast.error {
  border-inline-start-color: var(--danger);
}

.toast.warning {
  border-inline-start-color: var(--warning);
}

.client-meta.single {
  grid-template-columns: 1fr;
}

.quota {
  display: grid;
  gap: var(--space-3);
  margin-top: 10px;
  font-size: var(--text-base);
}

.quota-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.quota-label strong {
  color: var(--text);
}

.quota-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--panel-soft);
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  border-radius: var(--radius-pill);
}

.quota-fill.ok {
  background: var(--success);
}

.quota-fill.warning {
  background: var(--warning);
}

.quota-fill.danger {
  background: var(--danger);
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.traffic-status {
  margin-inline-start: 6px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.chart-legend {
  display: flex;
  gap: var(--space-8);
  font-size: var(--text-md);
  color: var(--muted);
}

.legend-item,
.tooltip-row,
.direction-values span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.legend-item strong,
.tooltip-row strong,
.direction-values strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.dash-key {
  display: inline-block;
  width: 16px;
  border-top: 2px dashed var(--text);
  opacity: 0.7;
}

.chart-wrap {
  /* Charts and their time axis always read left (past) to right (now), in Arabic too. */
  position: relative;
  min-height: 200px;
  touch-action: none;
  direction: ltr;
}

.chart-wrap svg {
  display: block;
}

.chart-wrap .grid {
  stroke: rgba(var(--light-rgb), 0.06);
}

.chart-wrap .baseline {
  stroke: rgba(var(--light-rgb), 0.18);
}

.chart-wrap .axis-label {
  fill: var(--muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.chart-wrap .series-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-wrap .series-area {
  fill-opacity: 0.45;
}

.chart-wrap .limit-line {
  fill: none;
  stroke: var(--text);
  stroke-opacity: 0.7;
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

.chart-wrap .limit-label {
  fill: var(--text);
  font-size: var(--text-xs);
  font-weight: 600;
}

.chart-wrap .crosshair {
  stroke: rgba(var(--light-rgb), 0.35);
  stroke-width: 1;
}

.chart-wrap .crosshair-dot {
  stroke: var(--panel);
  stroke-width: 2;
}

.chart-tooltip {
  position: absolute;
  top: 8px;
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(var(--shadow-rgb), 0.35);
  font-size: var(--text-sm);
  color: var(--muted);
  pointer-events: none;
  white-space: nowrap;
}

.chart-tooltip[hidden] {
  display: none;
}

.tooltip-time {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Boards ---------- */

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.row-actions {
  text-align: end;
  white-space: nowrap;
}

.board-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-6);
  padding: var(--space-8);
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(var(--light-rgb), 0.02);
}

.board-form[hidden] {
  display: none;
}

.board-form label {
  display: grid;
  gap: var(--space-3);
  font-size: var(--text-md);
  color: var(--muted);
}

.board-form .check {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.board-form-checks,
.board-form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-8);
}

/* ---------- Client window ---------- */

.client-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.client-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-8);
  margin-bottom: 20px;
}

.client-header h2 {
  margin: 0;
  overflow-wrap: anywhere;
}

.client-stack {
  display: grid;
  gap: var(--space-9);
}

/* Two columns that stack independently, so a long panel on one side never leaves gaps on the other. */
.client-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-9);
  align-items: start;
}

.client-col {
  display: grid;
  gap: var(--space-9);
  min-width: 0;
}

/* Wide tables scroll inside their panel instead of stretching the column. */
.client-col > * {
  min-width: 0;
}

.diagnostics-panel .actions {
  margin-bottom: 0;
}

.panel-title {
  margin: 0 0 var(--space-6);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.panel-title.spaced {
  margin-top: 20px;
}

.chart-head h3 {
  font-size: 1rem;
}

.chart-head .chart-legend {
  flex-wrap: wrap;
}

.direction {
  margin-top: 16px;
}

.direction-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-8);
  margin-bottom: 6px;
}

.direction-head h5 {
  margin: 0;
  font-size: var(--text-md);
}

.direction-values {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-8);
  font-size: var(--text-md);
  color: var(--muted);
}

.full-now {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: 0 0 var(--space-6);
  font-size: var(--text-base);
}

.alert-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
  font-size: var(--text-md);
}

.panel-title .small {
  text-transform: none;
  letter-spacing: 0;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0 0 var(--space-7);
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
}

.filter-tab:not(.active):hover {
  background: var(--panel-soft);
  color: var(--text);
}

.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.filter-tab.active .tab-count {
  background: rgba(var(--on-primary-rgb), 0.22);
}

.tab-count {
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgba(var(--light-rgb), 0.08);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.panel-note {
  margin: -6px 0 12px;
  line-height: 1.5;
}

.cell-quota {
  display: grid;
  gap: var(--space-2);
  min-width: 150px;
  white-space: nowrap;
}

#pr-body td {
  white-space: nowrap;
}

.meta-row span {
  flex-shrink: 0;
}

.meta-row strong {
  min-width: 0;
  text-align: end;
  overflow-wrap: anywhere;
}

.field-edit {
  margin-inline-start: var(--space-4);
  opacity: 0.6;
}

.field-edit:hover,
.field-edit:focus-visible {
  opacity: 1;
}

.field-edit-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-4);
}

.field-edit-form input {
  min-width: 0;
  flex: 1 1 180px;
}

.unlimited-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: 14px;
}

.unlimited-control:empty {
  display: none;
}

.unlimited-state {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-inline-end: auto;
  font-size: var(--text-base);
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-6);
}

.field-picker {
  margin-bottom: 14px;
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(var(--light-rgb), 0.02);
}

.field-picker[hidden] {
  display: none;
}

.picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: 10px;
}

.picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--space-3) var(--space-7);
  font-size: var(--text-md);
}

.picker-list .check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

#diagnostics:empty {
  display: none;
}

#diagnostics {
  margin-top: 12px;
}

@media (max-width: 980px) {
  /* minmax: a wide table scrolls in its own box instead of widening the page. */
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .summary-grid,
  .stat-grid-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .content,
  .client-page {
    padding: var(--space-9) var(--space-8);
  }

  .client-columns {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-5);
  }
}

/* ---------- Right-to-left ---------- */

[dir="rtl"] .eyebrow,
[dir="rtl"] .summary-label,
[dir="rtl"] th,
[dir="rtl"] .section h5,
[dir="rtl"] .panel-title {
  letter-spacing: 0;
}

/* ---------- Sign-in ---------- */

.auth-page {
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: var(--space-9);
}

.auth-card .brand {
  margin-bottom: 0;
}

.auth-head {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: var(--space-6);
}
/* The sign-in page: the company's logo large and in the middle above the box, its name under
   it, and "Powered by NetPulse" small beneath the name. */
.auth-wrap {
  width: min(420px, 100%);
  display: grid;
  gap: var(--space-8);
}
.auth-wrap .auth-card {
  position: relative;
  width: 100%;
}
/* The language button sits beside the box's title, not on a line of its own. */
.auth-wrap .auth-head {
  position: absolute;
  top: var(--space-8);
  inset-inline-end: var(--space-8);
}
.auth-brand {
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 0;
  text-align: center;
}
.auth-brand .brand-mark {
  width: 128px;
  height: 128px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}
.auth-brand .brand-name {
  margin: 0;
  font-size: var(--text-2xl);
  white-space: normal;
}
.auth-brand .brand-product {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.auth-card h2 {
  margin: 0;
  font-size: 1.25rem;
}

.auth-form {
  display: grid;
  gap: var(--space-7);
}

.auth-form[hidden] {
  display: none;
}

.auth-form label {
  display: grid;
  gap: var(--space-3);
  font-size: var(--text-base);
  color: var(--muted);
}

.auth-form .btn {
  padding: 11px 14px;
}

.error-text[hidden] {
  display: none;
}

/* ---------- Signed-in user ---------- */

.user-box {
  margin-top: auto;
  padding-top: var(--space-7);
  border-top: 1px solid var(--border);
  display: grid;
  gap: var(--space-5);
}

.user-who {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-width: 0;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: var(--radius-pill);
  background: rgba(var(--primary-rgb), 0.16);
  color: var(--primary);
  font-size: var(--text-md);
  font-weight: 800;
}

.user-text {
  min-width: 0;
}

.user-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-actions {
  display: flex;
  gap: var(--space-3);
}

/* The account menu: opens upward from the bottom of the sidebar. */
.user-menu {
  position: relative;
}

.user-menu > summary {
  list-style: none;
  cursor: pointer;
}

.user-menu > summary::-webkit-details-marker {
  display: none;
}

.user-menu-list {
  position: absolute;
  bottom: calc(100% + var(--space-3));
  inset-inline-start: 0;
  z-index: 30;
  display: grid;
  min-width: 200px;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(var(--shadow-rgb), 0.45);
}

.user-menu-item {
  display: block;
  padding: var(--space-5) var(--space-6);
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: var(--text-md);
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.user-menu-item:hover {
  background: rgba(var(--light-rgb), 0.06);
}

.user-menu-item.danger {
  color: var(--danger);
}

a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* ---------- Users & audit ---------- */

.notice {
  display: grid;
  gap: var(--space-3);
  margin-bottom: 16px;
  padding: var(--space-7) var(--space-8);
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--primary-rgb), 0.4);
  background: rgba(var(--primary-rgb), 0.08);
}

.notice[hidden] {
  display: none;
}

.temp-password {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--text-lg);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-xs);
  background: var(--panel-soft);
  user-select: all;
}

.user-form .perm-area {
  grid-column: 1 / -1;
}

.perm-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-6);
}

.perm-group {
  margin: 0;
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: grid;
  align-content: start;
  gap: var(--space-3);
}

.perm-group legend {
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--muted);
}

.perm-group .check {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-md);
  color: var(--text);
}

#user-table-body td {
  white-space: nowrap;
}

.audit-details {
  max-width: 420px;
  font-size: var(--text-sm);
  color: var(--muted);
  overflow-wrap: anywhere;
}

tr.audit-warning td {
  background: rgba(var(--danger-rgb), 0.06);
}

/* ---------- Developer page ---------- */

.dev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-9);
  align-items: start;
}

.dev-card.dev-bad {
  border-color: rgba(var(--danger-rgb), 0.5);
}

/* ---------- Billing ---------- */

.nav-group {
  margin: var(--space-7) var(--space-2) var(--space-1);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.nav-group:first-child {
  margin-top: 0;
}

[dir="rtl"] .nav-group {
  letter-spacing: 0;
}

/* A short value kept on one line (a profile with its price). */
td.nowrap {
  white-space: nowrap;
}

th.num,
td.num {
  font-variant-numeric: tabular-nums;
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.compact-grid {
  margin-bottom: 16px;
}

.compact-grid .summary-value {
  font-size: 1.4rem;
}

/* Names and addresses wrap; amounts, statuses, profiles and dates stay on one line. */
#bills-body td,
#customers-body td {
  min-width: 70px;
}

/* Profile columns stay on one line; addresses get room to wrap. */
#bills-body td:nth-child(7),
#customers-body td:nth-child(6) {
  white-space: nowrap;
}

#bills-body td:nth-child(8),
#customers-body td:nth-child(8) {
  min-width: 160px;
}

#bills-body .badge,
#customers-body .badge,
#billing .badge {
  white-space: nowrap;
}

#billing table.compact td {
  white-space: nowrap;
}

.owed {
  color: var(--danger);
}

.owes-now {
  margin: 0 0 var(--space-6);
  font-size: 15px;
}

.owes-now strong {
  font-size: 1.3rem;
  color: var(--danger);
}

.owes-now.paid-up {
  color: var(--success);
  font-weight: 600;
}

/* ---------- Collector app (collect.html), phone first ---------- */

.collect-page {
  min-height: 100dvh;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

.collect-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

/* In the Android app (public/tech.js): the app's top bar is the header. */
.in-app .collect-header {
  display: none;
}

.collect-who {
  display: grid;
  min-width: 0;
}

.collect-who strong,
.collect-who span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collect-header-actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

.collect-main {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-8);
}

.collect-main h2 {
  font-size: var(--text-xl);
  margin: var(--space-2) 0 var(--space-6);
}

.collect-banner {
  margin: 0;
  padding: var(--space-5) var(--space-8);
  font-size: var(--text-base);
  background: var(--panel-soft);
  border-bottom: 1px solid var(--border);
}

.collect-banner.warn {
  color: var(--warning);
}
.collect-banner.error {
  color: var(--danger);
}
.collect-banner.ok {
  color: var(--success);
  border: 1px solid rgba(var(--success-rgb), 0.4);
  border-radius: var(--radius-sm);
}

.collect-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-4);
  margin-bottom: 12px;
}

.collect-card {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--border);
  min-width: 0;
}

.collect-card strong {
  font-size: 17px;
  overflow-wrap: anywhere;
}

.collect-card.accent {
  border-color: rgba(var(--primary-rgb), 0.45);
}

.collect-search {
  display: grid;
  gap: var(--space-4);
  margin-bottom: 10px;
}

.collect-search input[type="search"] {
  width: 100%;
  font-size: var(--text-lg);
  padding: var(--space-6);
  box-sizing: border-box;
}

.collect-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-base);
}

.collect-toggle input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.collect-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.collect-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-6);
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  text-align: start;
  font: inherit;
  box-sizing: border-box;
}

button.collect-item {
  cursor: pointer;
}
button.collect-item:active {
  background: var(--panel-soft);
}

.collect-item-main {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.collect-item-main > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collect-item-amount {
  display: grid;
  justify-items: end;
  gap: var(--space-2);
  flex-shrink: 0;
  font-weight: 700;
  font-size: var(--text-base);
}

.collect-empty {
  padding: var(--space-8);
  text-align: center;
}

.collect-more {
  width: 100%;
  margin-top: 10px;
  padding: var(--space-6);
}

.collect-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--panel);
  border-top: 1px solid var(--border);
}

.collect-nav button {
  padding: var(--space-7) var(--space-2);
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.collect-nav button.active {
  color: var(--primary);
}

body.sheet-open {
  overflow: hidden;
}

.collect-sheet {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.collect-sheet-head {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.collect-sheet-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collect-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom));
  display: grid;
  align-content: start;
  gap: var(--space-6);
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.collect-details {
  display: grid;
  gap: var(--space-4);
}

.collect-detail {
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  font-size: var(--text-base);
}

.collect-detail > span:last-child {
  text-align: end;
  min-width: 0;
  overflow-wrap: anywhere;
}

.collect-form {
  display: grid;
  gap: var(--space-6);
}

.collect-form label {
  display: grid;
  gap: var(--space-3);
  font-size: var(--text-base);
}

.collect-form label.collect-toggle {
  display: flex;
}

.collect-form input:not([type="checkbox"]),
.collect-form select {
  width: 100%;
  font-size: var(--text-xl);
  padding: var(--space-6);
  box-sizing: border-box;
}

.cb-clickable {
  cursor: pointer;
}
.cb-clickable:hover {
  border-color: rgba(var(--primary-rgb), 0.6);
}
.cb-tree-node {
  margin: var(--space-3) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.cb-tree-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-5);
  width: 100%;
  padding: var(--space-4) var(--space-5);
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.cb-tree-head span {
  flex: 1;
  text-align: start;
}
.cb-tree-head::before {
  content: "▸";
  margin-inline-end: var(--space-3);
  color: var(--muted);
}
.cb-tree-node.open > .cb-tree-head::before {
  content: "▾";
}
.cb-tree-body {
  display: none;
  padding: 0 var(--space-5) var(--space-4);
}
.cb-tree-node.open > .cb-tree-body {
  display: block;
}
.cb-tree-month.is-ahead {
  border-color: rgba(var(--warning-rgb), 0.6);
}
.collector-pots {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin: var(--space-4) 0;
}
.collector-pot {
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.collector-pot.pot-stock,
.collector-pot.pot-visit {
  border-color: rgba(var(--warning-rgb), 0.6);
}
.collect-breakdown {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.collect-bd-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: 0.92em;
}
.collect-bd-row b {
  white-space: nowrap;
}
.collect-bd-row.is-charge span {
  color: var(--warning);
}
/* Setup: the company's own papers and speed test server, one field a row. */
#setup-papers-form {
  display: grid;
  gap: var(--space-4);
  max-width: 44rem;
}
#setup-papers-form label {
  display: grid;
  gap: var(--space-1);
}
#setup-papers-form label > span:first-child {
  font-weight: 600;
}
#setup-papers-form input,
#setup-papers-form select {
  width: 100%;
}
/* Waiting lists above a page's list (ui.js setUpFoldPanels): count, search, Hide, Show all. */
.fold-tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-inline-start: auto;
}
.fold-count:not(:empty) {
  min-width: 1.8em;
  padding: 0 0.5em;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  text-align: center;
  line-height: 1.6;
}
.fold-search {
  width: min(16em, 40vw);
}
.fold-more {
  margin-top: var(--space-2);
}
.bta-decided {
  margin-top: var(--space-3);
}
.bta-decided > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: var(--text-sm);
}
.bta-panel.is-folded > :not(.panel-header) {
  display: none;
}
.bta-panel.is-folded .panel-header {
  margin-bottom: 0;
}
/* Bills page: what a bill owing more than its month is made of, under Remaining. */
.bill-lines {
  list-style: none;
  margin: var(--space-1) 0 0;
  padding: 0;
  font-size: 0.82em;
  color: var(--muted);
}
.bill-lines li {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: var(--space-2);
  white-space: nowrap;
}
.bill-lines b {
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
}
.bill-lines li.is-next span {
  font-style: italic;
}
/* "What is this payment for?" (less than the whole bill): each part ticked by its row. */
.collect-parts-ask {
  display: grid;
  gap: var(--space-1);
}
.collect-bd-row input[data-part] {
  margin-inline-end: var(--space-2);
  vertical-align: middle;
}
.collect-due {
  display: grid;
  gap: var(--space-1);
}

.collect-due strong {
  font-size: var(--text-2xl);
  color: var(--warning);
}

.collect-quick {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.collect-remaining {
  margin: 0;
  font-weight: 600;
}

.collect-remaining.good {
  color: var(--success);
}
.collect-remaining.bad {
  color: var(--danger);
}

.collect-submit {
  padding: var(--space-7);
  font-size: var(--text-lg);
}

.collect-slip {
  display: grid;
  gap: var(--space-6);
}

.collect-slip-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.collect-slip-actions .btn {
  padding: var(--space-7);
}

.collect-slip-preview {
  width: 100%;
  max-width: 360px;
  justify-self: center;
  background: #fff;
  border-radius: var(--radius-xs);
}

.collect-page .toast {
  inset-inline: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  max-width: none;
  z-index: 20;
}

.collect-detail a {
  color: var(--primary);
}

/* The radius state beside a customer's name (public/status-dots.js), as the radius colours it. */
.state-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-inline-end: var(--space-3);
  border-radius: var(--radius-pill);
  background: rgba(var(--muted-rgb), 0.25);
  vertical-align: middle;
  flex: none;
}
.state-since {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-inline-end: var(--space-3);
  white-space: nowrap;
}
.state-dot[data-tone="online"] {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(var(--success-rgb), 0.18);
}
/* Each state has its own shape too, not only its colour (colour-blind users, bright screens):
   online a full dot, offline a ring, stopped a bar, expired a diamond. */
.state-dot[data-tone="offline"] {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--danger);
}
.state-dot[data-tone="stopped"] {
  height: 3px;
  border-radius: 1px;
  background: var(--muted);
}
.state-dot[data-tone="expired"] {
  border-radius: 1px;
  transform: rotate(45deg) scale(0.85);
  background: var(--warning);
}

.extra-roles {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-7);
  margin: 0;
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.extra-roles legend {
  padding: 0 var(--space-3);
  font-size: var(--text-md);
  color: var(--muted);
}
.extra-roles .muted {
  flex-basis: 100%;
}

.tm-handover-less {
  display: grid;
  gap: var(--space-4);
  margin: var(--space-4) 0;
  padding: var(--space-5) var(--space-6);
  border: 1px solid rgba(var(--warning-rgb), 0.5);
  border-radius: var(--radius-sm);
}
.tm-handover-less legend {
  padding: 0 var(--space-3);
  color: var(--warning);
  font-weight: 600;
}

.stat-table td,
.stat-table th {
  vertical-align: top;
}

/* ---------- Work schedule (the office) ---------- */
.sch-week td,
.sch-week th {
  white-space: nowrap;
}
.sch-cell {
  display: grid;
  gap: var(--space-2);
  min-width: 112px;
}
.sch-cell input {
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-3) var(--space-4);
}
#sch-waiting h4 {
  margin: var(--space-6) 0 var(--space-3);
}

/* ---------- The technician's phone app (tech.html) ---------- */

.tech-page {
  font-size: var(--text-lg);
}

.tech-big {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  min-height: 52px;
  width: 100%;
  font-size: var(--text-lg);
  font-weight: 700;
  box-sizing: border-box;
  text-decoration: none;
}

.tech-page .collect-nav {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}

.tech-page .collect-nav button {
  padding-inline: var(--space-1);
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tech-stock {
  display: grid;
  gap: var(--space-4);
}

.tech-fab {
  position: fixed;
  inset-inline-end: 16px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 6;
  min-height: 52px;
  padding-inline: var(--space-9);
  border-radius: var(--radius-pill);
  font-size: var(--text-lg);
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(var(--shadow-rgb), 0.45);
}

/* Solid, so the tickets under it do not show through. */
.tech-page .btn.primary.tech-fab {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

/* The second floating button (Collect a bill), at the other side, solid too. */
.tech-page .btn.tech-fab-second {
  inset-inline-end: auto;
  inset-inline-start: 16px;
  background: var(--success);
  border-color: var(--success);
  color: var(--on-primary);
}

/* Room under the last ticket for the floating button. */
.tech-page #tech-list {
  padding-bottom: 72px;
}

.tech-modes {
  margin: var(--space-4) 16px 0;
  max-width: 608px;
}

@media (min-width: 640px) {
  .tech-modes {
    margin-inline: auto;
  }
}

.tech-shift {
  display: grid;
  gap: var(--space-3);
  margin-bottom: 12px;
  padding: var(--space-6);
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--border);
}

.tech-shift strong {
  font-size: var(--text-xl);
}

.tech-shift.on {
  border-color: rgba(var(--success-rgb), 0.55);
}

.tech-shift.break {
  border-color: rgba(var(--warning-rgb), 0.55);
}

.tech-cash {
  display: grid;
  gap: var(--space-1);
  margin-bottom: 12px;
  padding: var(--space-6);
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid rgba(var(--primary-rgb), 0.45);
}

.tech-cash strong {
  font-size: var(--text-xl);
}

.tech-cash:has(span + strong + span) {
  cursor: pointer;
}

.tech-segments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: var(--space-2);
  padding: var(--space-2);
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--border);
}

.tech-segments button {
  min-height: 44px;
  padding-inline: var(--space-2);
  font-size: var(--text-md);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tech-segments button.active {
  background: var(--primary);
  color: var(--on-primary);
}

.tech-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: var(--space-5);
}

.tech-card {
  display: grid;
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--border);
  border-inline-start: 5px solid var(--muted);
  overflow: hidden;
}

.tech-card.good {
  border-inline-start-color: var(--success);
}
.tech-card.warn {
  border-inline-start-color: var(--warning);
}
.tech-card.info {
  border-inline-start-color: var(--primary);
}
.tech-card.bad {
  border-inline-start-color: var(--danger);
}

.tech-card-main {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-6);
  background: none;
  border: 0;
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.tech-card-main:active {
  background: var(--panel-soft);
}

.tech-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.tech-card-topic {
  font-size: var(--text-lg);
}

.tech-card-who {
  font-weight: 600;
}

.tech-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  padding: 0 var(--space-6) var(--space-6);
}

.tech-card-actions .btn {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
}

.tech-pill {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-pill);
  font-size: var(--text-md);
  font-weight: 700;
  background: rgba(var(--muted-rgb), 0.16);
  color: var(--muted);
}

.tech-pill.good {
  background: rgba(var(--success-rgb), 0.16);
  color: var(--success);
}
.tech-pill.warn {
  background: rgba(var(--warning-rgb), 0.16);
  color: var(--warning);
}
.tech-pill.info {
  background: rgba(var(--primary-rgb), 0.16);
  color: var(--primary);
}
.tech-pill.bad {
  background: rgba(var(--danger-rgb), 0.16);
  color: var(--danger);
}

.tech-head {
  display: grid;
  gap: var(--space-4);
}

.tech-head-topic {
  font-size: var(--text-xl);
}

.tech-head-who {
  font-size: var(--text-lg);
  font-weight: 700;
}

.tech-warn {
  margin: 0;
  color: var(--warning);
}

.tech-quick,
.tech-flow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.tech-flow .tech-big:only-child {
  grid-column: 1 / -1;
}

.tech-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.tech-tile {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: var(--space-3);
  min-height: 84px;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

a.tech-tile {
  text-decoration: none;
}

.tech-tile:active {
  background: var(--panel-soft);
}

.tech-tile.accent {
  border-color: rgba(var(--primary-rgb), 0.55);
}

.tech-tile-icon {
  font-size: var(--text-2xl);
  line-height: 1;
}

.tech-login {
  display: grid;
  gap: var(--space-4);
  border-color: rgba(var(--primary-rgb), 0.45);
}

.tech-section {
  margin: var(--space-4) 0 0;
  font-size: var(--text-lg);
}

.tech-thread {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.tech-entry {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-sm);
  background: var(--panel);
  overflow-wrap: anywhere;
}

.tech-photo {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.tech-photo-preview {
  width: 100%;
  max-height: 50vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.tech-install {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
  border-color: rgba(var(--primary-rgb), 0.45);
}

.tech-install p {
  margin: 0;
}

.tech-charge {
  display: grid;
  gap: var(--space-4);
}

.tech-charge.to-confirm .collect-item {
  border-color: rgba(var(--warning-rgb), 0.6);
}

.tech-charge-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.tech-charge-actions .btn {
  min-height: 44px;
  font-weight: 700;
}

.tech-voided {
  opacity: 0.5;
  text-decoration: line-through;
}

.tech-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.tech-equipment-row {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: var(--space-4);
}

.tech-picker {
  display: grid;
  gap: var(--space-4);
}

.tech-picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.tech-picker-list button {
  display: grid;
  gap: var(--space-1);
  width: 100%;
  min-height: 48px;
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.tech-picked {
  margin: 0;
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--success-rgb), 0.5);
  background: rgba(var(--success-rgb), 0.08);
}

.tech-form-sheet {
  z-index: 15;
}

.tech-more {
  display: grid;
  gap: var(--space-5);
}

.danger-outline {
  color: var(--danger);
  border-color: rgba(var(--danger-rgb), 0.5);
}

.tech-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  vertical-align: middle;
}

.tk-photo img {
  display: block;
  max-width: 240px;
  max-height: 180px;
  margin-top: var(--space-3);
  border-radius: var(--radius-sm);
  object-fit: cover;
}

/* ---------- Collectors' cash (dashboard) ---------- */

a.nav-item {
  text-decoration: none;
}

#collectors-body tr {
  cursor: pointer;
}

#collectors-body tr.selected td {
  background: rgba(var(--primary-rgb), 0.08);
}

.handover-form {
  align-items: center;
  flex-wrap: wrap;
  margin: var(--space-8) 0;
}

.handover-form input {
  min-width: 140px;
  flex: 1;
}

.collector-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-10);
}

.collector-columns > * {
  min-width: 0;
}

.collector-columns h4 {
  margin: 0 0 var(--space-4);
}

tr.voided td {
  opacity: 0.55;
  text-decoration: line-through;
}

tr.voided td:nth-child(3) {
  text-decoration: none;
}

#collections-body tr {
  cursor: pointer;
}

/* ---------- Billing overview ---------- */

.bo-toolbar {
  align-items: center;
  margin-bottom: 16px;
}

.bo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-8);
  margin-top: 16px;
}

.bo-grid > .panel {
  min-width: 0;
}

.bo-grid h3 {
  margin: 0 0 var(--space-2);
  font-size: 15px;
}

.bo-wide {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .bo-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.bchart {
  position: relative;
  width: 100%;
  margin-top: 8px;
}

.bchart svg {
  display: block;
  overflow: visible;
}

.bchart-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.bchart-axis {
  fill: var(--muted);
  font-size: var(--text-xs);
  direction: ltr;
}

.bchart-cross {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.chart-tip {
  position: absolute;
  z-index: 3;
  min-width: 160px;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(var(--shadow-rgb), 0.35);
  font-size: var(--text-sm);
  pointer-events: none;
  display: grid;
  gap: var(--space-2);
}

.chart-tip-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.chart-tip-row strong {
  margin-inline-start: auto;
  padding-inline-start: 12px;
}

.hbars {
  display: grid;
  gap: var(--space-4);
  margin-top: 10px;
}

.hbar {
  display: grid;
  grid-template-columns: minmax(80px, 160px) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-5);
  font-size: var(--text-md);
}

.hbar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hbar-track {
  height: 10px;
  border-radius: 5px;
  background: var(--panel-soft);
  overflow: hidden;
}

.hbar-fill {
  display: block;
  height: 100%;
  border-radius: 0 4px 4px 0;
}

[dir="rtl"] .hbar-fill {
  border-radius: 4px 0 0 4px;
}

.hbar-value {
  font-weight: 600;
  white-space: nowrap;
}

.bo-heat td,
.bo-heat th {
  white-space: nowrap;
}

/* ---------- Connections ---------- */

.conn-intro {
  margin: 0 0 var(--space-8);
  max-width: 900px;
}

#view-connections > .panel + .panel {
  margin-top: 16px;
}

.conn-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
}

.conn-card {
  padding: var(--space-7);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
  border: 1px solid var(--border);
  min-width: 0;
}

.conn-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.conn-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.conn-accounts {
  list-style: none;
  margin: var(--space-6) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

/* An account: its name and access on one line, its buttons wrapping under them when the card is
   narrow (zoomed in, small screens), never sticking out of the card. */
.conn-accounts li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}

.conn-accounts li > span:first-child {
  font-weight: 600;
}

.conn-accounts li .badge,
.conn-accounts li .btn {
  white-space: nowrap;
}

.conn-accounts li .muted.small {
  flex: 1 1 100%;
  order: 3;
}

.conn-accounts li .btn {
  order: 4;
}

.board-form > p {
  grid-column: 1 / -1;
  margin: 0;
}

/* ---------- Resellers ---------- */

.rs-toolbar {
  align-items: center;
  margin-bottom: 12px;
}

#rs-body tr {
  cursor: pointer;
}

#rs-body tr.selected td {
  background: rgba(var(--primary-rgb), 0.08);
}

#rs-body tr.rs-own td {
  opacity: 0.7;
}

#view-resellers > .panel {
  margin-top: 16px;
}

.rs-forms {
  margin: var(--space-8) 0;
}

.rs-settings summary {
  cursor: pointer;
  color: var(--muted);
  margin: var(--space-4) 0;
}

.rs-credit {
  color: var(--success);
}

#rs-customers tr {
  cursor: pointer;
}

/* ---------- NetSub ↔ Radius ---------- */

.cs-issues {
  flex-wrap: wrap;
  margin: var(--space-6) 0;
}

.cs-issues .filter-tab strong {
  margin-inline-start: 4px;
}

.cs-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-inline-end: 6px;
  background: var(--muted);
}

.cs-dot.level-full {
  background: var(--danger);
}
.cs-dot.level-middle {
  background: var(--warning);
}

#cs-body tr {
  cursor: pointer;
}

/* ---------- Monthly invoicing ---------- */
.inv-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-8);
}

.inv-facts {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-6) 0;
}

.inv-facts div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}

.inv-facts dt {
  color: var(--muted);
}
.inv-facts dd {
  margin: 0;
  font-weight: 600;
  text-align: end;
}

.inv-warning {
  color: var(--warning, #f5b455);
}

/* ---------- New customers ---------- */
.ob-form {
  margin-bottom: 16px;
}
.ob-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-6);
}
.ob-grid label {
  display: grid;
  gap: var(--space-2);
  font-size: var(--text-md);
  color: var(--muted);
}
.ob-grid input, .ob-grid select {
  width: 100%;
}
.ob-first {
  grid-column: 1 / -1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-8);
}
.ob-first legend {
  color: var(--muted);
  font-size: var(--text-md);
  padding: 0 var(--space-2);
}
.ob-first .radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: inherit;
  font-size: var(--text-base);
  white-space: normal;
}
.ob-first input[type='radio'] {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
}
/* The first month: two questions, one row each (this month / the money), then the amount. */
.ob-first .ob-q {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: start;
  gap: var(--space-3) var(--space-4);
  width: 100%;
}
.ob-first .ob-q-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-8);
}
@media (max-width: 640px) {
  .ob-first .ob-q {
    grid-template-columns: 1fr;
  }
}
.ob-first .ob-q[hidden] {
  display: none;
}
.ob-first .ob-q-title {
  color: var(--muted);
  font-size: var(--text-md);
}
.ob-first .radio[hidden] {
  display: none;
}
.ob-first-amount {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  max-width: 420px;
}
.ob-first-amount[hidden] {
  display: none;
}
.ob-note {
  grid-column: 1 / -1;
}
.ob-buttons {
  display: flex;
  gap: var(--space-4);
  margin-top: 14px;
  flex-wrap: wrap;
}
/* ---------- Calls ---------- */
.calls-find input {
  flex: 1 1 320px;
  font-size: var(--text-lg);
}
.calls-results {
  list-style: none;
  margin: 0 0 var(--space-8);
  padding: 0;
  display: grid;
  gap: var(--space-3);
}
.calls-result {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-1) var(--space-6);
  text-align: start;
  background: var(--panel, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-5) var(--space-6);
  color: inherit;
  cursor: pointer;
}
.calls-result > span:nth-child(3):not(.search-address) {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
}
/* The address under the name (common.js addressLine): always in the text column. */
.calls-result > .search-address {
  grid-column: 1;
}
.calls-noresult {
  padding: var(--space-4) var(--space-2);
}
.calls-repeat {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.calls-repeat-item {
  display: grid;
  gap: var(--space-1);
  text-align: start;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-6);
}
.calls-note {
  max-width: 320px;
}
.call-form {
  display: grid;
  gap: var(--space-4);
  margin-bottom: 12px;
}
/* The button keeps its own width on a computer; full width only on a phone. */
@media (min-width: 700px) {
  .call-form > .btn {
    justify-self: start;
    min-width: 140px;
  }
}
.call-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.call-form-row > * {
  flex: 1 1 140px;
}
.call-form textarea {
  width: 100%;
  resize: vertical;
  font: inherit;
}
.call-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-5);
}
.call-list li {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.call-list li.voided {
  opacity: 0.55;
}
.call-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  align-items: center;
}
.call-note {
  margin: var(--space-3) 0 var(--space-1);
  white-space: pre-wrap;
}
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}
.link-btn.small {
  font-size: var(--text-sm);
}

/* ---------- Tickets ---------- */
tr.clickable {
  cursor: pointer;
}
tr.clickable:hover td {
  background: var(--panel-soft);
}
tr.voided {
  opacity: 0.5;
}
.strike {
  text-decoration: line-through;
}
.tk-form {
  margin-bottom: 16px;
}
.tk-customer {
  position: relative;
}
.tk-found {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  z-index: 5;
  margin-top: 4px;
  background: var(--panel);
  border-radius: var(--radius-sm);
}
.tk-head .panel-header span {
  display: inline-flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.tk-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-6) var(--space-9);
  margin: var(--space-4) 0 var(--space-6);
}
.tk-facts > div {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}
.tk-facts strong {
  overflow-wrap: anywhere;
}
.tk-facts select {
  width: 100%;
}
.tk-resolution {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin: 0 0 var(--space-3);
}
.tk-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: var(--space-8);
  align-items: start;
}
@media (max-width: 960px) { .tk-columns { grid-template-columns: 1fr; } }
.tk-thread {
  margin-bottom: 12px;
}
.tk-entry.status .call-head > span:first-child, .tk-entry.assign .call-head > span:first-child, .tk-entry.charge .call-head > span:first-child, .tk-entry.system .call-head > span:first-child {
  font-size: var(--text-md);
  color: var(--muted);
}
.tk-charge-form {
  display: grid;
  gap: var(--space-5);
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.tk-mode {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.tk-charge-form[data-mode="list"] .tk-mode [data-mode="list"], .tk-charge-form[data-mode="outside"] .tk-mode [data-mode="outside"] {
  background: var(--panel-soft);
  border-color: var(--primary);
  color: var(--primary);
}
.tk-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-5);
}
.tk-charge-form[data-mode="list"] .tk-outside-fields, .tk-charge-form[data-mode="outside"] .tk-list-fields {
  display: none;
}
.tk-charge-form label {
  display: grid;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--muted);
  min-width: 0;
}
.tk-charge-form label input, .tk-charge-form label select {
  width: 100%;
  min-width: 0;
  color: var(--text);
  font-size: var(--text-base);
}
.tk-wide {
  grid-column: 1 / -1;
}
.tk-charge-hint {
  width: 100%;
  margin: 0;
}

/* ---------- Maintenance ---------- */
.mt-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-6);
}
.mt-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6) var(--space-7);
  display: grid;
  gap: var(--space-3);
}
.mt-card h4 {
  margin: 0;
}
.mt-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  font-size: var(--text-md);
}
.num-input {
  width: 110px;
}
#mt-items input[name="name"], #mt-topics input[name="name"] {
  width: 100%;
  min-width: 160px;
}
/* Receiving a technician's cash (maintenance money): held, received, summary side by side. */
.tm-receive {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-5);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}
.tm-receive-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
}
.tm-receive-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
}
.tm-receive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-5);
}
.tm-receive-card {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.tm-receive-card h5 {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tm-held {
  width: 100%;
  border-collapse: collapse;
}
.tm-held th,
.tm-held td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  text-align: start;
}
.tm-held .num {
  text-align: end;
  white-space: nowrap;
}
.tm-held-total th,
.tm-held-total td {
  border-bottom: 0;
  font-weight: 700;
}
.tm-money {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: var(--space-3);
  font-weight: 600;
}
.tm-money input {
  font-size: var(--text-lg);
  text-align: end;
}
.tm-receive-sum dl {
  display: grid;
  gap: var(--space-3);
  margin: 0;
}
.tm-receive-sum dl > div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-xs);
}
.tm-receive-sum dt {
  color: var(--muted);
}
.tm-receive-sum dd {
  margin: 0;
  font-weight: 700;
  text-align: end;
}
.tm-receive-sum .is-less {
  background: rgba(var(--warning-rgb), 0.12);
}
.tm-receive-sum .is-over {
  background: rgba(var(--danger-rgb), 0.12);
}
.tm-receive-sum .is-even {
  background: rgba(var(--success-rgb), 0.12);
}
.tm-why {
  display: grid;
  gap: var(--space-3);
}
.tm-why-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.tm-receive-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.tm-receive-foot input {
  flex: 1 1 240px;
}

#view-ticketMoney a, #view-maintenance a, #view-cashbook a, #ticket-list a {
  color: var(--primary);
}

/* ---------- Menu sections ---------- */

.nav-section {
  display: grid;
  gap: var(--space-2);
}
.nav-section .nav-group {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  width: 100%;
  margin: 0;
  padding: var(--space-6) var(--space-5);
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: start;
  font: inherit;
  font-size: var(--text-base);
  line-height: 1.3;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-section .nav-group:hover {
  background: rgba(var(--light-rgb), 0.04);
  color: var(--text);
}
.nav-section.open .nav-group {
  color: var(--text);
}
.nav-section .nav-group > span:first-of-type {
  flex: 1;
}
/* Each group's line icon. */
.nav-icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}
.nav-section.open .nav-icon {
  color: var(--primary);
  opacity: 1;
}
/* A subgroup: a small heading over its pages; hidden when none of its pages are allowed. */
.nav-subgroup {
  display: grid;
  gap: var(--space-1);
}
.nav-subgroup:not(:has(.nav-item:not([hidden]))) {
  display: none;
}
.nav-sub {
  padding: var(--space-5) var(--space-7) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(var(--muted-rgb), 0.75);
}
[dir="rtl"] .nav-sub {
  letter-spacing: 0;
}
.nav-section-count {
  font-size: var(--text-xs);
  letter-spacing: 0;
}
.nav-chevron {
  width: 8px;
  height: 8px;
  border-inline-end: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex: none;
}
[dir="rtl"] .nav-chevron {
  transform: rotate(45deg);
}
.nav-section.open .nav-chevron {
  transform: rotate(45deg);
}
[dir="rtl"] .nav-section.open .nav-chevron {
  transform: rotate(-45deg);
}
.nav-items {
  display: none;
  gap: var(--space-1);
  padding-bottom: var(--space-5);
  padding-inline-start: var(--space-5);
  margin-inline-start: var(--space-7);
  border-inline-start: 1px solid var(--border);
}
.nav-section.open .nav-items {
  display: grid;
}
.nav-items .nav-item {
  padding: var(--space-5) var(--space-7);
}
/* The dashboard: one page, at the top, drawn like a group's heading. */
.nav-top {
  margin-bottom: var(--space-3);
}
.nav-item.nav-home {
  justify-content: flex-start;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-5);
  font-size: var(--text-base);
  font-weight: 600;
}
.nav-item.nav-home.active .nav-icon {
  color: var(--primary);
  opacity: 1;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}
.sidebar-head .brand {
  margin-bottom: 0;
}
.menu-toggle {
  display: none;
}
/* Narrow screens: the sidebar is a bar at the top; the menu opens under the Menu button. */
@media (max-width: 980px) {
  .shell > .sidebar,
  .cp-shell > .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    max-height: 100dvh;
    padding: var(--space-6) var(--space-8);
    overflow-y: auto;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .sidebar:not(.menu-open) .nav,
  .sidebar:not(.menu-open) .user-box {
    display: none;
  }
  .sidebar .brand-mark {
    width: 34px;
    height: 34px;
  }
}

/* ---------- Customer page ---------- */

/* Boxes keep their own height: on a short tab nothing stretches to fill the window. */
.cp {
  max-width: 1240px;
  display: grid;
  align-content: start;
  gap: var(--space-8);
}
.cp-hero {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 1.6fr);
  gap: 18px 28px;
  align-items: start;
  align-content: start;
  border-top: 3px solid var(--primary);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), rgba(var(--violet-rgb), 0.05) 45%, transparent), var(--panel);
}
.cp-identity {
  display: flex;
  gap: var(--space-8);
  align-items: flex-start;
  min-width: 0;
}
.cp-avatar {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-2xl);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  color: var(--on-primary);
  font-weight: 800;
  font-size: 22px;
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.25);
}
.cp-who {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}
.cp-who h2 {
  margin: 0;
  font-size: var(--text-2xl);
  overflow-wrap: anywhere;
}
.cp-fullname {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-lg);
}
.cp-fullname:empty {
  display: none;
}
.cp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.cp-chips:empty {
  display: none;
}
.cp-board {
  margin: 0;
}
.cp-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-6) var(--space-9);
  margin: 0;
}
.cp-facts div {
  min-width: 0;
}
.cp-facts dt {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 3px;
}
[dir="rtl"] .cp-facts dt {
  letter-spacing: 0;
  font-size: var(--text-sm);
}
.cp-facts dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.cp-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5) var(--space-7);
  align-items: flex-start;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.cp-group {
  display: grid;
  gap: var(--space-2);
}
.cp-group-label {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* Nothing live to show: no radius user and not online. */
.cp-missing:not(.cp-online) .cp-live {
  display: none;
}
/* The Billing tab's facts: a label over its value, side by side, not one long line each. */
.bill-facts {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--space-6) var(--space-8);
  margin: var(--space-6) 0 var(--space-8);
}
.bill-facts .meta-row strong {
  text-align: start;
}
.bill-facts .meta-row {
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: var(--space-1);
  padding-bottom: 0;
  border-bottom: 0;
}
#qt-summary {
  grid-template-columns: repeat(auto-fill, minmax(170px, 220px));
}
#qt-more {
  margin-top: var(--space-5);
}
.cp-group-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.cp-hero .secret-note,
.cp-hero .company-items-note {
  grid-column: 1 / -1;
  margin: 0;
}
.cp-facts .cp-fact-wide {
  grid-column: span 2;
}
/* The whole address, always (region - sub-region - the detailed address). */
.cp-address {
  white-space: normal;
  overflow-wrap: anywhere;
}
.cp-phone {
  display: block;
}
.cp-actions .btn {
  text-decoration: none;
}
.cp-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-3);
  background: rgba(var(--chrome-rgb), 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.cp-tabs button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.cp-tabs button:hover {
  color: var(--text);
  background: var(--panel-soft);
}
.cp-tabs button.active {
  color: var(--on-primary);
  background: var(--primary);
}
.cp-tabs button[hidden] {
  display: none;
}
.cp-tab-count:empty {
  display: none;
}
.cp-tab-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: rgba(var(--light-rgb), 0.12);
  font-size: var(--text-sm);
  text-align: center;
}
.cp-tabs button.active .cp-tab-count {
  background: rgba(var(--on-primary-rgb), 0.18);
}
.cp-pane {
  display: grid;
  align-content: start;
  gap: var(--space-8);
  min-width: 0;
}
.cp-pane[hidden] {
  display: none;
}
.cp-directions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-9);
}
.cp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-8);
  align-items: start;
}
.cp-grid > *, .cp-pane > * {
  min-width: 0;
}
.cp-diag {
  border-color: rgba(var(--primary-rgb), 0.35);
}
@media (max-width: 900px) {
  .cp-hero {
    grid-template-columns: 1fr;
  }
  .cp-directions {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .cp-avatar {
    width: 52px;
    height: 52px;
    font-size: var(--text-xl);
    border-radius: var(--radius-lg);
  }
  .cp-who h2 {
    font-size: 20px;
  }
  .cp-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cp-actions .btn {
    flex: 1 1 auto;
  }
  .cp-spacer {
    display: none;
  }
}

#client-body {
  display: grid;
  align-content: start;
  gap: var(--space-8);
}

/* ---------- Continuous ping ---------- */
.ping-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-9);
  align-items: baseline;
  margin-bottom: 10px;
}
.ping-bars {
  display: flex;
  align-items: flex-end;
  gap: var(--space-1);
  height: 70px;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  overflow: hidden;
}
.ping-bar {
  flex: 1 1 0;
  max-width: 14px;
  min-width: 3px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
}
.ping-bar.lost {
  height: 100%;
  background: var(--danger);
  opacity: 0.6;
}
.ping-log {
  margin-top: 10px;
  max-height: 260px;
  overflow-y: auto;
}
.btn.active-action {
  border-color: var(--danger);
  color: var(--danger);
}

/* ---------- Connection history ---------- */
.ch-controls {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.ch-days {
  display: inline-flex;
  gap: var(--space-1);
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.ch-days button {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: var(--text-md);
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.ch-days button.active {
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}
.ch-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-5);
  margin: var(--space-6) 0 var(--space-8);
}
.ch-card {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}
.ch-card span {
  font-size: var(--text-sm);
  color: var(--muted);
}
.ch-card strong {
  font-size: var(--text-xl);
}
.ch-card small {
  font-size: var(--text-sm);
  color: var(--muted);
}
.ch-card.warn {
  border-color: rgba(var(--warning-rgb), 0.5);
}
.ch-card.warn strong {
  color: var(--warning);
}
.ch-card.good strong {
  color: var(--success);
}
.ch-timeline {
  display: grid;
  gap: var(--space-2);
  margin-bottom: 14px;
}
.ch-row, .ch-axis {
  display: grid;
  grid-template-columns: 96px 1fr 34px;
  gap: var(--space-5);
  align-items: center;
}
.ch-label {
  font-size: var(--text-sm);
  color: var(--muted);
  white-space: nowrap;
}
.ch-track {
  position: relative;
  height: 16px;
  border-radius: 5px;
  background: rgba(var(--light-rgb), 0.04);
  border: 1px solid var(--border);
  overflow: hidden;
}
.ch-seg {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 3px;
  background: var(--primary);
  opacity: 0.85;
}
.ch-seg.open {
  background: var(--success);
}
.ch-seg.short {
  background: var(--danger);
  opacity: 1;
  min-width: 3px;
}
.ch-count {
  font-size: var(--text-sm);
  text-align: end;
  color: var(--muted);
}
.ch-count.many {
  color: var(--warning);
  font-weight: 700;
}
.ch-hours {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.ch-legend {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: var(--space-3) 0 0;
}
.ch-key {
  display: inline-block;
  width: 14px;
  height: 8px;
  border-radius: 2px;
  background: var(--primary);
}
.ch-key.short {
  background: var(--danger);
}
.ch-short-row td {
  color: var(--danger);
}
@media (max-width: 620px) { .ch-row, .ch-axis { grid-template-columns: 64px 1fr 26px; gap: var(--space-3); } .ch-controls { flex-wrap: wrap; } }

/* ---------- Cash book ---------- */
.cb-actions {
  flex: 1 0 100%;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) 0;
}
.cb-balances {
  display: grid;
  gap: var(--space-6);
  margin-bottom: 16px;
}
.cb-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-6);
}
.cb-row-held {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.cb-row-title {
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm);
  color: var(--muted);
}
.cb-empty-pots {
  margin: 0;
}
.cb-toolbar {
  align-items: center;
  margin-top: 16px;
}
.cb-toolbar input[type="month"] {
  flex: 0 0 190px;
}
.cb-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding-inline-end: var(--space-5);
}
.cb-group + .cb-group {
  padding-inline-start: var(--space-5);
  border-inline-start: 1px solid var(--border);
}
.cb-group-name {
  font-size: var(--text-sm);
  color: var(--muted);
}
.cb-report-btn {
  margin-inline-start: auto;
}
#view-cashbook > .panel + .panel {
  margin-top: 16px;
}
.cb-pot {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: var(--space-7) var(--space-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
}
.cb-pot-name {
  font-size: var(--text-sm);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
[dir="rtl"] .cb-pot-name {
  letter-spacing: 0;
}
.cb-pot strong {
  font-size: 19px;
}
.cb-pot.warn {
  border-color: rgba(var(--warning-rgb), 0.5);
}
.cb-pot.warn strong {
  color: var(--warning);
}
.cb-form {
  margin-bottom: 16px;
}
.cb-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-8);
  margin-bottom: 16px;
}
.cb-line {
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.cb-given details > summary {
  cursor: pointer;
  padding: var(--space-3) 0;
  color: var(--muted);
}
.cb-given details > .cb-line {
  padding-inline-start: var(--space-6);
}
.cb-line.total {
  border-bottom: 0;
  padding-top: 10px;
}
td.cb-out {
  color: var(--danger);
}
.cb-categories summary {
  cursor: pointer;
  font-weight: 600;
}
.cb-categories input[name="name"] {
  width: 100%;
  min-width: 180px;
}
.cp2-rate {
  display: inline-flex;
  gap: var(--space-3);
  align-items: center;
}
.cp2-rate input {
  width: 110px;
}
.tk-own span {
  display: inline-flex;
  gap: var(--space-4);
  align-items: center;
  color: var(--text);
  font-size: var(--text-base);
}
.tk-own input[type="checkbox"] {
  width: auto;
  min-height: 0;
}

.cb-customer {
  position: relative;
}
.cb-picked {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--text);
}
.cb-picked[hidden] {
  display: none;
}

.cb-later {
  color: var(--warning);
}

.cp-notice {
  border-color: rgba(var(--warning-rgb), 0.45);
}
.cp-notice p {
  margin: var(--space-3) 0;
}
.cp-steps {
  margin: var(--space-3) 0 0;
  padding-inline-start: 20px;
  display: grid;
  gap: var(--space-2);
}

.be-fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: end;
  padding: var(--space-3) 0;
}
.be-fields label {
  display: grid;
  gap: 3px;
  font-size: var(--text-sm);
  color: var(--muted);
}
.be-fields input {
  width: 120px;
}
.be-reason input {
  width: 220px;
}
.be-buttons {
  display: inline-flex;
  gap: var(--space-3);
}

/* The NetPulse logo goes home. */
.sidebar .brand {
  cursor: pointer;
  border-radius: var(--radius-md);
}
.sidebar .brand:hover .brand-mark {
  filter: brightness(1.1);
}
.sidebar .brand:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

/* ---------- Client window: the menu beside the customer's page ---------- */
.cp-shell {
  grid-template-columns: 240px minmax(0, 1fr);
}
.cp-shell .client-page {
  margin: 0;
  max-width: none;
  width: 100%;
}
.cp-shell .sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
@media (max-width: 980px) {
  .cp-shell {
    grid-template-columns: 1fr;
  }
  .cp-shell .sidebar {
    position: static;
    height: auto;
  }
}

/* ---------- Regions page ---------- */
.rg-add {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}
.rg-add input {
  min-width: 220px;
}
.rg-actions {
  display: flex;
  gap: var(--space-5);
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.rg-actions select {
  max-width: 200px;
}
.danger-link {
  color: var(--danger);
}

/* ---------- Charged by days (public/service-form.js) and the Periods ending page ---------- */
.sc-kinds {
  margin-bottom: 10px;
}
.sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-6);
  margin: var(--space-5) 0;
}
.sc-grid label, .sc-note {
  display: grid;
  gap: var(--space-2);
}
.sc-quote {
  margin: var(--space-3) 0;
}
.sc-quote p {
  margin: 0 0 var(--space-2);
  color: var(--text);
  font-weight: 600;
}
.sc-pieces {
  margin: 0;
  padding-inline-start: 18px;
}
.ob-period {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 8px;
}
.pe-radius-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-inline-start: 6px;
  border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: inherit; font-weight: 700; }
.pe-radius-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.pe-check {
  display: inline-flex;
  gap: var(--space-3);
  align-items: center;
  font-size: 0.85em;
  white-space: nowrap;
}
/* Change the last day (public/periods.js): the choices one under the other, the preview plain. */
/* The amount in Change the last day / Change amount, with its round button beside it. */
.pe-ld-amount { display: flex; gap: var(--space-3, 8px); align-items: center; }
.pe-ld-amount input { flex: 1; min-width: 0; }
.pe-ld-choice {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}
.pe-ld-choice input[type="radio"],
.pe-ld-choice input[type="checkbox"] {
  width: auto;
}
.pe-ld-preview p {
  margin: 0;
}
.sc-grid select, .sc-grid input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.ob-first .ob-period {
  flex: 1 1 100%;
  width: 100%;
}
.pe-settings {
  margin-top: 16px;
}
.pe-settings-row {
  display: flex;
  gap: var(--space-6);
  align-items: flex-end;
  flex-wrap: wrap;
}
.pe-settings-row label {
  display: grid;
  gap: var(--space-2);
  width: 160px;
}
.pe-settings-row input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.dev-job-detail {
  max-width: 340px;
  overflow-wrap: anywhere;
}
.ob-price {
  display: flex;
  gap: var(--space-3);
}
.ob-price input {
  flex: 1 1 auto;
  min-width: 0;
}
.ob-price select {
  flex: 0 0 80px;
}

/* ---------- Take a payment: customers or resellers (office) ---------- */
.collect-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin: var(--space-5) 0;
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.collect-mode button {
  border: 0;
  border-radius: 9px;
  padding: var(--space-5);
  background: transparent;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
}
.collect-mode button.active {
  background: var(--primary);
  color: var(--on-primary);
}
.in-line {
  margin-bottom: 6px;
}
.in-line select {
  flex: 1 1 auto;
}
.in-line input {
  flex: 0 0 110px;
}

/* ---------- Dialogs (public/ui.js) ---------- */

.np-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 64px rgba(var(--shadow-rgb), 0.5);
}

.np-dialog::backdrop {
  background: rgba(var(--shadow-rgb), 0.45);
}

.np-dialog-form {
  display: grid;
  gap: var(--space-7);
  padding: var(--space-10);
}

.np-dialog-form h3 {
  margin: 0;
  font-size: 17px;
}

.np-dialog-message {
  margin: 0;
  line-height: 1.5;
  white-space: pre-line;
}

/* A dropdown in a dialog sits under its label, full width, as the text fields do. */
.np-dialog-field select {
  display: block;
  width: 100%;
  margin-top: var(--space-2);
}
.np-dialog-field input,
.np-dialog-field textarea {
  width: 100%;
}

.np-dialog-error {
  margin: 0;
  color: var(--danger);
  font-size: var(--text-md);
}

.np-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-4);
}

/* ---------- Resellers each role sees (Users page) ---------- */

.role-resellers {
  display: grid;
  gap: var(--space-4);
}

.role-resellers-row {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr auto;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
}

.role-resellers-choices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-8);
}

@media (max-width: 640px) {
  .role-resellers-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Reports (Accounting) ---------- */

.rep-title {
  margin: var(--space-6) 0 var(--space-4);
}

.rep-sub {
  margin: var(--space-8) 0 var(--space-4);
}

.rep-totals {
  font-weight: 600;
}

.rep-date {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* Printing a report: the report only, black on white, every row. */
@media print {
  body {
    background: #fff;
    color: #000;
  }

  .sidebar,
  .topbar,
  .no-print,
  .toast,
  .conn-intro {
    display: none !important;
  }

  .shell,
  .content,
  .panel {
    display: block;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }

  .table-scroll {
    overflow: visible;
  }

  table {
    font-size: var(--text-xs);
  }

  th,
  td {
    color: #000;
    border-color: #999;
  }

  .muted {
    color: #333;
  }
}

/* ---------- Downloads (Administration) ---------- */

.dl-groups {
  display: grid;
  gap: var(--space-8);
}

.dl-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
}

.dl-item {
  display: grid;
  align-content: start;
  gap: var(--space-4);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}

.dl-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
}

.dl-item ol {
  margin: var(--space-2) 0 0;
  padding-inline-start: var(--space-10);
}

@media (max-width: 640px) {
  .dl-items {
    grid-template-columns: 1fr;
  }
}

/* ---------- Drops (short sessions by VLAN) ---------- */

.dr-groups {
  display: grid;
  gap: var(--space-8);
}

.dr-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
  margin-bottom: var(--space-4);
}

/* ---------- Reseller page (public/reseller.html) ---------- */

.reseller-page {
  display: grid;
  /* One column no wider than the screen: the wide table scrolls inside its panel. */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
  width: min(1200px, 100%);
  align-self: start;
}

.reseller-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.reseller-page .summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.reseller-head .brand {
  margin-bottom: 0;
  color: inherit;
  text-decoration: none;
}

/* ---------- Get the app (public/apps.html) ---------- */

.apps-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
  width: min(760px, 100%);
  justify-items: center;
}

.apps-card {
  width: 100%;
}

.apps-page .brand {
  color: inherit;
  text-decoration: none;
}
/* Get the app: the company on top as on the sign-in page; the box's title with its two small
   buttons beside it; the upload form's fields each inside their own column. */
.apps-brand .brand-mark {
  width: 88px;
  height: 88px;
}
.apps-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
}
.apps-head h2 {
  margin: 0;
}
.apps-head p {
  margin: var(--space-1) 0 0;
}
.apps-top-actions {
  display: flex;
  gap: var(--space-3);
}
/* The page's address as a QR code, for a phone to scan from a computer (not shown on the phone). */
.pre-line {
  white-space: pre-line;
}
/* Costs & margin: the switch between each charge and by customer. */
.pc-switch {
  max-width: 360px;
  margin: var(--space-4) 0;
}
/* Connections: the company's reseller name on each radius. */
.conn-own {
  margin-top: var(--space-6);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}
.conn-own .meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-top: var(--space-3);
}
/* The radius a customer is on, after his username (only where the company has several). */
.radius-tag {
  display: inline-block;
  margin-inline-start: var(--space-2);
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  vertical-align: middle;
}
.apps-scan {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  margin-top: var(--space-6);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}
.apps-scan p {
  margin: var(--space-2) 0 0;
}
.apps-qr {
  flex: 0 0 132px;
  line-height: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.apps-qr svg {
  width: 132px;
  height: 132px;
}
@media (max-width: 700px) {
  .apps-scan {
    display: none;
  }
}
.apps-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
  margin: var(--space-6) 0 var(--space-8);
  padding: var(--space-7);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}
.apps-form > label {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
  font-size: var(--text-md);
  color: var(--muted);
}
.apps-form > label > input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.apps-form input[type="file"] {
  background: var(--panel);
}
.apps-form .apps-wide {
  grid-column: 1 / -1;
}
.apps-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
}
@media (max-width: 620px) {
  .apps-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

.apps-list {
  display: grid;
  gap: var(--space-4);
}

.apps-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}

.apps-help ol {
  margin: var(--space-4) 0 0;
  padding-inline-start: var(--space-10);
  display: grid;
  gap: var(--space-3);
}

.apps-roles {
  grid-column: 1 / -1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

#apps-roles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-8);
}

#apps-roles label {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: var(--space-3);
}

#apps-form label {
  align-self: start;
}

/* Stock page forms: each field with its label above. */
/* Forms of labelled fields (stock, spending, suppliers, handovers): a grid of even columns,
   each label over its field, the button at the end of the last row. */
/* Messages: Send keeps a button's width on a computer. */
@media (min-width: 700px) {
  .nf-send > .btn {
    justify-self: start;
    align-self: flex-start;
    width: auto;
    min-width: 140px;
  }
}
/* Every page: boxes that follow each other never touch (found touching on Bills, Collectors,
   Stop unpaid and a dozen more). Low weight, so a page's own spacing wins. */
:where(section[id^="view-"]) > :where(.panel) ~ :where(.panel),
:where(#mt-config) > * + * {
  margin-top: 16px;
}
/* Stock: space between the boxes of a tab; the summary's cards fit one row. */
#view-stock > .panel + .panel,
#view-stock > .panel + details.panel {
  margin-top: 16px;
}
/* Stock on hand by item, and one item's card. */
.stk-onhand-bar {
  align-items: center;
}
.stk-onhand-bar input[type="search"] {
  flex: 1 1 260px;
  max-width: 380px;
  min-width: 0;
}
.stk-onhand-bar select {
  flex: 0 1 240px;
  min-width: 0;
}
.stk-onhand-bar .inline-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  white-space: nowrap;
}
.stk-onhand-bar .inline-check input {
  flex: none;
  width: auto;
}
#stk-moves .link-btn {
  text-align: start;
}
.stk-onhand-row {
  cursor: pointer;
}
.stk-onhand-row:hover,
.stk-onhand-row.active {
  background: rgba(var(--primary-rgb), 0.06);
}
.stk-onhand-row .badge {
  margin-inline-start: var(--space-3);
}
.stk-onhand tfoot td {
  border-top: 2px solid var(--border);
  color: var(--muted);
}
.stk-item-card {
  border-color: rgba(var(--primary-rgb), 0.5);
}
.stk-where-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.stk-where {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}
.stk-where.short {
  border-color: rgba(var(--danger-rgb), 0.5);
}
td.stk-in {
  color: var(--success);
  font-weight: 600;
}
td.stk-out {
  color: var(--danger);
  font-weight: 600;
}
.stc-week {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-7);
}
.stc-week .nowrap {
  white-space: nowrap;
}
#stk-items-old {
  margin-top: var(--space-5);
}
#str-cards {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}
.stk-form label.inline-check {
  flex-direction: row;
  align-items: center;
  align-self: end;
  gap: var(--space-3);
  padding-bottom: 10px;
}
.stk-form label.inline-check > input {
  width: auto;
  flex: none;
}
.stk-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  align-items: end;
  gap: var(--space-6) var(--space-7);
}
.stk-form label { display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-md); color: var(--muted); min-width: 0; }
.stk-form label[hidden] { display: none; }
.stk-form label > input,
.stk-form label > select {
  flex: none;
  width: 100%;
  box-sizing: border-box;
}
.stk-form > .btn {
  justify-self: start;
  min-height: 38px;
  padding-inline: var(--space-9);
}
.stk-short { color: var(--danger, #c0392b); font-weight: 600; }

/* Totals under a table. */
tfoot.totals th, tfoot.totals td { border-top: 2px solid var(--border, rgba(127,127,127,.35)); font-weight: 600; white-space: nowrap; }

/* Messages: unseen ones stand out; their state as the office sees it. */
.msg.unseen { border-inline-start: 3px solid var(--accent, #3b82f6); padding-inline-start: 8px; cursor: pointer; }
.msg { cursor: pointer; }
.msg-state { font-size: 0.85em; white-space: nowrap; }
.msg-state.seen { color: var(--ok, #16a34a); }
.msg-state.delivered { color: var(--accent, #3b82f6); }

/* Users page: one tick per feature, with what it does and where it shows. */
.perm-item { align-items: flex-start; }
.perm-item .perm-help { display: block; font-weight: 400; }
.perm-preview { margin-top: var(--space-4, 16px); padding: var(--space-3, 12px); border-radius: var(--radius-md, 8px); background: rgba(var(--accent-rgb, 59, 130, 246), 0.08); }

/* A button with a small line icon (the radius filler download). */
.btn-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
  margin-inline-end: var(--space-3);
}
.filler-download {
  margin-inline-start: auto;
  text-decoration: none;
}
.toolbar-end {
  justify-content: flex-end;
}

/* Ticket note: the "Enter sends" tick beside the button. */
.tk-note-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

/* Collect page: customers who moved this month; ticket: the new address of a moving customer. */
.collect-moved {
  margin-bottom: var(--space-3);
}

.collect-moved summary {
  cursor: pointer;
  font-weight: 700;
  padding: var(--space-2) 0;
}

.tk-move {
  margin-top: var(--space-3);
}

.tk-move-empty {
  border: 1px dashed var(--warning);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

/* Get the app: Android or iPhone; the iPhone web app's notification offer. */
/* Android or iPhone: one control of two halves. */
.apps-choices {
  display: flex;
  gap: 0;
  margin: var(--space-3) 0;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}

.apps-choices button {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.apps-choices button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.apps-steps li,
.apps-printing li {
  margin-bottom: var(--space-2);
}

.apps-notify {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.apps-printing {
  margin-top: var(--space-4);
}

.apps-printing a {
  color: var(--primary);
}

.webapp-notify {
  position: fixed;
  inset-inline: var(--space-3);
  bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--border);
}

.webapp-notify span {
  flex: 1 1 100%;
}

/* Collector page: what they hold, customer by customer; a handover's details. */
.collector-pending {
  margin-block: var(--space-3);
}

.collector-pending summary {
  cursor: pointer;
  padding-block: var(--space-2);
}

.handover-detail td {
  background: rgba(var(--muted-rgb), 0.06);
}

/* A receipt printed again (receipt.html): the slip image, alone on the paper when printing. */
.receipt-page {
  display: grid;
  justify-items: center;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-4);
}

.receipt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.receipt-image {
  width: 80mm;
  max-width: 100%;
}

.receipt-page[data-paper="384"] .receipt-image {
  width: 58mm;
}

.receipt-page[data-paper="a4"] .receipt-image {
  width: 120mm;
}

/* The office's A4 receipt (receipt-a4.js): printed paper, so its own ink colours, not the theme's. */
.a4-receipt {
  --a4-paper: #fff;
  --a4-ink: #15181f;
  --a4-muted: #5d6474;
  --a4-line: #cfd4dc;
  --a4-soft: #f1f3f6;
  width: 210mm;
  max-width: 100%;
  min-height: 297mm;
  box-sizing: border-box;
  padding: 16mm 15mm;
  display: flex;
  flex-direction: column;
  gap: 7mm;
  background: var(--a4-paper);
  color: var(--a4-ink);
  font-family: "Inter", "Noto Kufi Arabic", "Segoe UI", Arial, sans-serif;
  font-size: 10.5pt;
  line-height: 1.45;
  box-shadow: 0 10px 40px rgba(var(--shadow-rgb), 0.35);
}

.a4-receipt h1,
.a4-receipt h2,
.a4-receipt h3,
.a4-receipt p {
  margin: 0;
}

.a4-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8mm;
  padding-bottom: 6mm;
  border-bottom: 2.5pt solid var(--a4-ink);
}

.a4-company {
  display: flex;
  align-items: center;
  gap: 5mm;
}

.a4-logo {
  max-height: 22mm;
  max-width: 45mm;
  object-fit: contain;
}

.a4-company h1 {
  font-size: 20pt;
  letter-spacing: 0.02em;
}

.a4-company p {
  color: var(--a4-muted);
}

.a4-title {
  min-width: 62mm;
  display: grid;
  gap: 1.5mm;
}

.a4-title h2 {
  font-size: 17pt;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2mm;
}

.a4-field {
  display: flex;
  justify-content: space-between;
  gap: 4mm;
}

.a4-field span {
  color: var(--a4-muted);
}

.a4-box {
  border: 1pt solid var(--a4-line);
  border-radius: 2mm;
  padding: 4mm 5mm;
  display: grid;
  gap: 2mm;
}

.a4-box h3,
.a4-table th {
  font-size: 8.5pt;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--a4-muted);
}

.a4-name {
  font-size: 14pt;
  font-weight: 700;
}

.a4-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5mm 10mm;
}

.a4-table {
  width: 100%;
  border-collapse: collapse;
}

.a4-table th,
.a4-table td {
  padding: 2.5mm 3mm;
  text-align: start;
  border-bottom: 1pt solid var(--a4-line);
}

.a4-table thead th {
  background: var(--a4-soft);
  border-bottom: 1.5pt solid var(--a4-ink);
}

.a4-table .num {
  text-align: end;
  white-space: nowrap;
}

.a4-totals {
  align-self: flex-end;
  width: 92mm;
  display: grid;
  gap: 1.8mm;
}

.a4-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 4mm;
}

.a4-totals > div span {
  color: var(--a4-muted);
}

.a4-totals .a4-balance {
  margin-top: 1.5mm;
  padding: 3mm 4mm;
  background: var(--a4-ink);
  color: var(--a4-paper);
  font-size: 13pt;
  font-weight: 700;
  justify-content: center;
}

.a4-totals .a4-balance span {
  color: var(--a4-paper);
}

.a4-totals .a4-balance:has(strong) {
  justify-content: space-between;
}

.a4-note {
  color: var(--a4-muted);
  font-size: 9pt;
}

.a4-center,
.a4-thanks {
  text-align: center;
}

.a4-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10mm;
  padding-top: 6mm;
  border-top: 1pt dashed var(--a4-line);
}

.a4-sign {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10mm;
}

.a4-sign div {
  display: grid;
  gap: 1mm;
}

.a4-sign span {
  color: var(--a4-muted);
  font-size: 9pt;
}

.a4-sign i {
  display: block;
  height: 14mm;
  border-bottom: 1pt solid var(--a4-ink);
}

.a4-whish {
  width: 58mm;
  display: grid;
  justify-items: center;
  gap: 1.5mm;
  text-align: center;
  font-size: 9pt;
  font-weight: 700;
}

.a4-qr {
  width: 34mm;
  height: 34mm;
}

.a4-thanks {
  font-weight: 600;
}

@media print {
  .receipt-toolbar,
  #receipt-message {
    display: none;
  }

  .receipt-page {
    padding: 0;
  }

  .receipt-page[data-paper="a4"] {
    background: var(--a4-paper, #fff);
  }

  .a4-receipt {
    box-shadow: none;
    width: auto;
    min-height: 0;
    height: 265mm;
    padding: 0;
  }

  @page {
    size: A4;
    margin: 14mm;
  }
}

/* Excel-style filters on every table's column headers (ui.js setUpTableFilters). */
tr.filtered-out {
  display: none;
}

.col-filter {
  display: none;
  margin-inline-start: var(--space-1);
  padding: 0 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.2;
  vertical-align: middle;
  cursor: pointer;
}

table.col-filters-on .col-filter {
  display: inline-block;
}

/* Click a header to sort it (A→Z, Z→A, then back), as in Excel's sort buttons. */
table.col-filters-on th.col-sortable {
  cursor: pointer;
  user-select: none;
}

table.col-filters-on th.col-sortable:hover {
  color: var(--text);
}

.col-filter.on {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.12);
}

.col-menu {
  position: fixed;
  z-index: 1000;
  width: min(300px, calc(100vw - 16px));
  max-height: min(560px, calc(100vh - 16px));
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(var(--shadow-rgb), 0.45);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

.col-menu-item {
  text-align: start;
  padding: 6px var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.col-menu-item:hover {
  background: var(--panel-soft);
}

.col-menu-values {
  overflow: auto;
  max-height: 220px;
  min-height: 90px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-1);
}

.col-menu-value {
  display: flex;
  gap: var(--space-1);
  align-items: center;
  padding: 2px 0;
  font-size: var(--text-sm);
}

.col-menu-value[hidden] {
  display: none;
}

.col-menu-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-1);
  padding-top: var(--space-1);
  border-top: 1px solid var(--border);
}

/* Excel's filter menu (public/ui.js showMenu). */
.col-menu-item[disabled] { opacity: 0.45; cursor: default; }
.col-menu-item svg, .col-filter svg { vertical-align: -1px; width: 9px; height: 9px; }
.col-menu-line { width: 100%; margin: 2px 0; border: 0; border-top: 1px solid var(--border); }
.col-menu-cond summary { cursor: pointer; padding: 4px var(--space-2); border-radius: var(--radius-sm); }
.col-menu-cond summary:hover { background: var(--panel-soft); }
.col-menu-cond-row { display: flex; flex-wrap: wrap; gap: var(--space-1); padding: var(--space-1) 0; }
.col-menu-cond-row select, .col-menu-cond-row input { flex: 1 1 110px; min-width: 0; }
.col-menu-value small { margin-inline-start: auto; font-size: var(--text-xs); }


/* A handover closed with a difference (received less). */
.warning-text {
  color: var(--warning);
}

.handover-difference {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* The customer page inside the phone app (client.html?embed=1): the app has its own menu. */
body.embedded #cp-sidebar {
  display: none;
}

/* The Stock home page's reports, folded until opened. */
.str-details {
  margin-top: var(--space-5);
}

/* A stock count with differences to decide (Stock page). */
.stc-count + .stc-count {
  margin-top: var(--space-5);
}

/* Money handed in (cash book): the row opens its handover. */
.cb-handed {
  cursor: pointer;
}

/* A technician's handover in detail (Maintenance money): ticket by ticket. */
.tm-detail-row > td {
  background: rgba(var(--shadow-rgb), 0.12);
}

.tm-detail-group + .tm-detail-group {
  margin-top: var(--space-3);
}

.tm-detail-group h5 {
  margin: 0 0 var(--space-1);
}

.tm-detail-table {
  width: 100%;
}

/* Technician stats: one card per technician (public/stats.js). */
.tech-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-6);
}
.tech-stat-card {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}
.tech-stat-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-lg);
}
.tech-stat-badges {
  display: flex;
  gap: var(--space-2);
}
.tech-stat-big {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}
.tech-stat-big > div {
  display: grid;
  justify-items: center;
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.tech-stat-big span {
  font-size: var(--text-2xl);
  font-weight: 800;
}
.tech-stat-big small {
  color: var(--muted);
}
.tech-stat-groups {
  display: grid;
  gap: var(--space-4);
}
.tech-stat-groups h5 {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tech-stat-groups dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2) var(--space-5);
  margin: 0;
}
.tech-stat-groups dl > div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  border-bottom: 1px dashed var(--border);
  padding-bottom: var(--space-1);
}
.tech-stat-groups dt {
  color: var(--muted);
}
.tech-stat-groups dd {
  margin: 0;
  font-weight: 600;
  text-align: end;
}
.tech-stat-groups .is-money dl {
  grid-template-columns: 1fr;
}
.tech-stat-groups .is-bad dd {
  color: var(--danger);
}
.tech-stat-card > footer {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.summary-card.compact .summary-value {
  font-size: var(--text-xl);
}

/* The working day above the user's name (public/my-day.js). */
.my-day {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.my-day.on-shift {
  border-color: rgba(var(--success-rgb), 0.5);
}
.my-day-buttons {
  display: flex;
  gap: var(--space-2);
}
.tm-receive-detail {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.tm-receive-detail > summary {
  cursor: pointer;
  font-weight: 600;
}
.tm-receive-detail #tm-receive-items {
  max-height: 360px;
  margin-top: var(--space-3);
  overflow: auto;
}

/* Supplier invoices (public/purchases.js). */
.pu-form {
  display: grid;
  gap: var(--space-5);
}
.pu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4) var(--space-5);
}
/* Each field stays inside its own column (the amount with its currency spilled over Paid). */
.pu-grid label {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}
.pu-grid label > input,
.pu-grid label > select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
#view-purchases > .panel + .panel {
  margin-top: 16px;
}
.pu-lines > .btn {
  justify-self: start;
}
.pu-grid .pu-wide {
  grid-column: 1 / -1;
}
.pu-money {
  display: flex;
  gap: var(--space-2);
  min-width: 0;
}
.pu-money input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
}
.pu-lines {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.pu-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.pu-line select {
  flex: 1 1 220px;
}

/* The permissions on the Users page: one folding group per menu section. */
details.perm-group {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
details.perm-group > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  cursor: pointer;
}
.perm-group-tools {
  margin-inline-start: auto;
}
#perm-search {
  flex: 1 1 220px;
}
.pu-money select {
  flex: 0 0 auto;
  min-width: 84px;
}
/* Setup: where it stands, under the list. */
.setup-summary {
  margin: var(--space-6) 0 var(--space-3);
  font-weight: 600;
}
.setup-summary.todo {
  color: var(--warning);
}
.setup-summary.ok {
  color: var(--success);
}
.setup-left {
  margin: var(--space-4) 0;
}
.setup-left summary {
  color: var(--warning);
  font-weight: 600;
  cursor: pointer;
}
.setup-ok {
  max-height: 420px;
  overflow-y: auto;
  margin-bottom: var(--space-5);
}
#setup-steps .obs-act {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: flex-end;
}
/* Bandwidth: what is left stands out; a bill's parts sit under it. */
td.bw-left {
  color: var(--danger);
}
.bw-detail > td {
  background: var(--panel-soft);
}
/* Staff: no salary column for whoever may not see salaries. */
.st-no-salary th:nth-child(2),
.st-no-salary td:nth-child(2) {
  display: none;
}
/* The Users page's ticks: how they differ from the role, what a tick needs, pairs to think twice about. */
.perm-summary {
  grid-column: 1 / -1;
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  font-size: var(--text-md);
}
.perm-conflict {
  color: var(--text);
  font-size: var(--text-sm);
}
.perm-needs {
  display: block;
  font-style: italic;
}
.perm-mark {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
}
.perm-extra .perm-mark {
  color: var(--primary);
}
.perm-missing .perm-mark {
  color: var(--warning);
}
.perm-extra {
  box-shadow: inset 3px 0 0 var(--primary);
}
.perm-missing {
  box-shadow: inset 3px 0 0 var(--warning);
}
[dir="rtl"] .perm-extra {
  box-shadow: inset -3px 0 0 var(--primary);
}
[dir="rtl"] .perm-missing {
  box-shadow: inset -3px 0 0 var(--warning);
}
.perm-item.perm-diff-off {
  display: none;
}
/* The Roles tab: every role beside the others. */
.roles-matrix th.num,
.roles-matrix td.num {
  text-align: center;
}
.roles-group {
  cursor: pointer;
  background: var(--panel-soft);
}
.roles-group:hover {
  background: rgba(var(--primary-rgb), 0.06);
}
.roles-perm td:first-child {
  padding-inline-start: var(--space-9);
}
.roles-all {
  color: var(--success);
  font-weight: 600;
}
.roles-yes {
  color: var(--success);
  font-weight: 700;
}
.roles-conflict-list {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
.roles-conflict-list li {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--warning);
  border-radius: var(--radius-sm);
}
.perm-list > .perm-tools,
.perm-list > .perm-preview {
  grid-column: 1 / -1;
}

/* Find a feature (public/feature-search.js), above the menu. */
.feature-search {
  position: relative;
  margin: 0;
  width: min(300px, 32vw);
}
.feature-search input {
  width: 100%;
}
.feature-results {
  position: absolute;
  inset-inline-end: 0;
  min-width: min(360px, 90vw);
  top: calc(100% + var(--space-2));
  z-index: 50;
  max-height: 60vh;
  margin: 0;
  padding: var(--space-2);
  overflow: auto;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(var(--shadow-rgb), 0.35);
}
.feature-results button {
  display: grid;
  width: 100%;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--text);
  text-align: start;
  cursor: pointer;
}
.feature-results button.active,
.feature-results button:hover {
  background: rgba(var(--primary-rgb), 0.14);
}
.feature-none {
  padding: var(--space-3) var(--space-4);
}
.feature-found {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: var(--radius-xs);
  transition: outline-color 0.4s;
}

/* A customer's secret note at the top of their page (office, call center, accountant, admin). */
.secret-note {
  margin: var(--space-4) 0 0;
}
.secret-note.has-note {
  padding: var(--space-4) var(--space-5);
  border: 1px solid rgba(var(--danger-rgb), 0.55);
  border-inline-start: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  background: rgba(var(--danger-rgb), 0.08);
}
.secret-note-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}
.secret-note p {
  margin: var(--space-3) 0 0;
}
.cb-held { border-color: rgba(var(--primary-rgb), 0.5); }

/* Stock categories (public/stock.js). */
.stk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.stk-chip {
  padding: var(--space-1) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
}

/* A supplier's invoice seen again (public/invoice-view.js). */
.invoice-view {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: rgba(var(--shadow-rgb), 0.6);
}
.invoice-view-card {
  display: grid;
  gap: var(--space-5);
  width: min(720px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: var(--space-7);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
}
.invoice-view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
}
.invoice-view-head h3 {
  margin: 0;
}
.invoice-view-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-4) var(--space-6);
  margin: 0;
}
.invoice-view-facts dt {
  color: var(--muted);
  font-size: var(--text-xs);
}
.invoice-view-facts dd {
  margin: 0;
}
.invoice-view-photo img {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
}
.rep-late td { background: rgba(var(--danger-rgb), 0.06); }

/* The cash book ledger (public/cashbook.js). */
.cb-ledger-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.cb-ledger th.small {
  font-weight: 500;
  color: var(--muted);
}
.cb-ledger .cb-closing {
  font-weight: 700;
}
.cb-ledger-total td {
  border-top: 2px solid var(--border);
}
.cb-locked {
  border-color: rgba(var(--warning-rgb), 0.6);
}

/* System health (public/health.js). */
.hl-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.hl-check {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.hl-check.down { border-color: rgba(var(--danger-rgb), 0.6); background: rgba(var(--danger-rgb), 0.08); }
.hl-check.warn { border-color: rgba(var(--warning-rgb), 0.6); }
.hl-check.ok { border-color: rgba(var(--success-rgb), 0.4); }
.hl-state { font-size: var(--text-lg); }
.hl-stack { max-height: 200px; overflow: auto; white-space: pre-wrap; font-size: var(--text-xs); }

/* Backups to Google Drive (public/connections.js). */
.conn-drive-setup {
  margin-top: var(--space-4);
}
.conn-drive-steps {
  line-height: 1.7;
  padding-inline-start: var(--space-6);
}
.conn-drive-steps a {
  color: var(--primary);
}

/* The user-experience record (public/ux.js, public/ux-report.js). */
.ux-pulse {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding: var(--space-5);
  border: 1px solid rgba(var(--primary-rgb), 0.5);
  border-radius: var(--radius-sm);
  background: rgba(var(--primary-rgb), 0.08);
}
.ux-scores,
.ux-pulse-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.ux-score {
  display: grid;
  min-width: 72px;
  text-align: center;
}
.ux-big {
  font-size: var(--text-lg);
}
.ux-week {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}
.ux-week-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.ux-week-all {
  margin-inline-start: auto;
  font-size: var(--text-lg);
}
.ux-bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 80px;
  align-items: center;
  gap: var(--space-3);
}
.ux-bar {
  height: 10px;
  border-radius: 5px;
  background: var(--border);
  overflow: hidden;
}
.ux-bar span {
  display: block;
  height: 100%;
  background: var(--primary);
}
.ux-week-change {
  margin-top: var(--space-2);
  color: var(--muted);
}
.ux-mood {
  font-size: var(--text-lg);
}
.ux-reply {
  margin-top: var(--space-2);
}
.ux-select {
  padding: var(--space-2);
}
.ux-changes {
  display: grid;
  gap: var(--space-2);
  padding-inline-start: var(--space-5);
}

/* Pages in a pop-up over the page (common.js openPage). */
.np-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(var(--shadow-rgb), 0.5);
}
.np-overlay-box {
  width: min(1280px, 100%);
  height: min(92vh, 100%);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  box-shadow: 0 24px 64px rgba(var(--shadow-rgb), 0.5);
  overflow: hidden;
}
.np-overlay.narrow .np-overlay-box { width: min(520px, 100%); }
.np-overlay-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.np-overlay iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: var(--bg);
}
body.overlay-open { overflow: hidden; }

/* A long page's sections as tabs (public/ui.js setUpPageTabs). */
.page-tabs {
  margin: var(--space-4) 0 var(--space-3);
}
[data-page-tab].page-tab-off { display: none; }

/* The connection history's cards, above the customer page's tabs. */
#history-panel { margin-bottom: var(--space-4); }

/* The neighbour picture (public/neighbour-map.js) and the Neighbours box (public/neighbours.js). */
.nmap {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(var(--shadow-rgb), 0.5);
}
.nmap[hidden] { display: none; }
.nmap-box {
  width: min(1320px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  overflow: hidden;
}
.nmap-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.nmap-head h3 { margin: 0; }
.nmap-tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.nmap-body {
  overflow-y: auto;
  padding: var(--space-4);
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--space-4);
  align-items: start;
}
.nmap-svg {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  margin: 0 auto;
  /* Pinch and drag move the picture, not the page (public/neighbour-map.js zoomable). */
  touch-action: none;
  cursor: grab;
}
.nmap-zoom {
  position: absolute;
  top: var(--space-2);
  inset-inline-end: var(--space-2);
  display: flex;
  gap: var(--space-2);
}
.nmap-zoom .btn {
  min-width: 44px;
  min-height: 44px;
  font-size: var(--text-lg);
}
.nmap-left { min-width: 0; display: grid; gap: var(--space-3); align-content: start; }
.nmap-graph { min-width: 0; position: relative; }
.nmap-ring {
  fill: none;
  stroke: var(--border);
  stroke-dasharray: 3 6;
}
.nmap-ring.ring1 { stroke: rgba(var(--success-rgb), 0.35); stroke-dasharray: none; }
.nmap-link {
  stroke: var(--border);
  stroke-width: 1;
  transition: stroke 0.15s, stroke-width 0.15s;
}
.nmap-node { cursor: pointer; outline: none; }
.nmap-node circle {
  fill: var(--panel);
  stroke-width: 3;
  transition: stroke-width 0.15s;
}
.nmap-node.suggested circle { stroke-dasharray: 6 3; }
.nmap-node.on circle { stroke: rgb(var(--success-rgb)); fill: rgba(var(--success-rgb), 0.2); }
.nmap-node.warn circle { stroke: rgb(var(--warning-rgb)); fill: rgba(var(--warning-rgb), 0.22); }
.nmap-node.off circle { stroke: rgb(var(--danger-rgb)); fill: rgba(var(--danger-rgb), 0.16); }
.nmap-node.stop circle { stroke: var(--muted); fill: rgba(var(--shadow-rgb), 0.3); }
.nmap-node.center circle { stroke-width: 4; }
/* Pointed at: the person and the line to the middle stand out. */
.nmap-item:hover .nmap-link, .nmap-item:focus-within .nmap-link { stroke: var(--primary); stroke-width: 2; }
.nmap-node:hover circle, .nmap-node:focus-visible circle { stroke-width: 5; }
.nmap-node:focus-visible circle { stroke: var(--primary); }
/* Text on the picture: a dark edge keeps it readable over the rings and lines. */
.nmap-node text {
  fill: var(--text);
  text-anchor: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--panel);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.nmap-node .nmap-initial { font-size: var(--text-lg); font-weight: 800; stroke: none; }
.nmap-node.center .nmap-initial { font-size: var(--text-2xl); }
.nmap-node .nmap-name { font-size: var(--text-md); font-weight: 700; }
.nmap-node.center .nmap-name { font-size: var(--text-lg); }
.nmap-node .nmap-brief { font-size: var(--text-xs); fill: var(--muted); }
.nmap-node .nmap-ping { font-size: var(--text-xs); fill: var(--muted); font-weight: 600; }
.nmap-yes, .nmap-no { cursor: pointer; }
.nmap-yes circle, .nmap-no circle { stroke: var(--panel); stroke-width: 2; transition: transform 0.15s; transform-box: fill-box; transform-origin: center; }
.nmap-yes:hover circle, .nmap-no:hover circle { transform: scale(1.2); }
.nmap-yes circle { fill: rgb(var(--success-rgb)); }
.nmap-no circle { fill: rgb(var(--danger-rgb)); }
.nmap-yes text, .nmap-no text {
  fill: #fff;
  font-size: var(--text-sm);
  font-weight: 800;
  text-anchor: middle;
  pointer-events: none;
}
.nmap-legend { margin: 0; }
.nmap-cards {
  display: grid;
  gap: var(--space-3);
}
.nmap-card {
  display: grid;
  gap: 2px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-inline-start-width: 4px;
  border-radius: var(--radius-sm);
}
.nmap-card.center { border-color: rgba(var(--primary-rgb), 0.7); }
.nmap-card.on { border-inline-start-color: rgb(var(--success-rgb)); }
.nmap-card.warn { border-inline-start-color: rgb(var(--warning-rgb)); }
.nmap-card.off { border-inline-start-color: rgb(var(--danger-rgb)); }
.nmap-card.stop { border-inline-start-color: var(--muted); }
.nmap-card-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.nmap-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
body.nmap-open { overflow: hidden; }
@media (max-width: 760px) {
  .nmap { padding: 0; }
  .nmap-box { height: 100%; border-radius: 0; }
  .nmap-body { grid-template-columns: minmax(0, 1fr); }
  /* The whole picture fits the phone; two fingers zoom in on it. */
  .nmap-graph { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
  .nmap-svg { width: 100%; max-width: none !important; }
}
.nb-panel .panel-header { display: flex; justify-content: space-between; align-items: center; }
.nb-verdict { margin: var(--space-2) 0; padding: var(--space-3); border-radius: var(--radius-sm); background: rgba(var(--primary-rgb), 0.08); }
.nb-verdict.online { background: rgba(var(--success-rgb), 0.12); }
.nb-verdict.level-middle { background: rgba(var(--warning-rgb), 0.14); }
.nb-verdict.level-full, .nb-verdict.offline { background: rgba(var(--danger-rgb), 0.14); }
.nb-levels { display: grid; gap: var(--space-2); }
.nb-level { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.nb-level.flagged { border-color: rgba(var(--danger-rgb), 0.6); }
.nb-level.narrowest { border-inline-start: 4px solid rgba(var(--primary-rgb), 0.7); }
.nb-level-head {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.nb-level-head:disabled { cursor: default; }
.nb-counts { display: flex; gap: var(--space-3); }
.nb-list { padding: 0 var(--space-3) var(--space-3); display: grid; gap: 2px; }
.nb-member { display: flex; justify-content: space-between; gap: var(--space-3); }
.loc-line { margin: var(--space-2) 0; }
.loc-line a { color: var(--primary); }
.nb-doubt { margin: var(--space-2) 0; padding: var(--space-3); border-radius: var(--radius-sm); background: rgba(var(--warning-rgb), 0.16); }
.nmap-notes { min-width: 0; }
.ag-list { display: grid; gap: var(--space-3); }
.ag-item { padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ag-members { margin: var(--space-2) 0; padding-inline-start: var(--space-5); }

/* The task panel (public/tasks.js): a card's list beside the page. */
.task-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 790;
  background: rgba(var(--shadow-rgb), 0.35);
}
body.task-open .task-backdrop { display: block; }
.task-panel {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: 800;
  width: min(520px, 100vw);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--panel);
  border-inline-start: 1px solid var(--border);
  box-shadow: -12px 0 32px rgba(var(--shadow-rgb), 0.35);
  overflow: hidden;
}
.task-panel[hidden] { display: none; }
.task-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.task-head h3 {
  flex: 1;
  margin: 0;
}
.task-count {
  min-width: 28px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(var(--warning-rgb), 0.2);
  font-weight: 700;
  text-align: center;
}
.task-count:empty { display: none; }
.task-panel > .muted { margin: 0; }
.task-body {
  flex: 1;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: var(--space-3);
}
.task-item {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: opacity 0.25s, transform 0.25s;
}
.task-item.task-leaving {
  opacity: 0;
  transform: translateX(24px);
}
.task-main {
  display: grid;
  gap: var(--space-1);
}
.task-main a {
  color: var(--primary);
  text-decoration: none;
}
.task-main a:hover { text-decoration: underline; }
.task-amount {
  font-weight: 700;
}
.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.task-step {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.task-step.done:not(.info) { opacity: 0.6; }
.task-step-text {
  display: grid;
}
.task-mark {
  font-weight: 800;
  text-align: center;
  color: rgb(var(--warning-rgb));
}
.task-step.done .task-mark { color: rgb(var(--success-rgb)); }
.task-step.info .task-mark { color: rgb(var(--primary-rgb)); }
.task-done {
  padding: var(--space-6);
  text-align: center;
  font-size: var(--text-lg);
  color: rgb(var(--success-rgb));
}
.task-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.task-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
@media (max-width: 600px) {
  .task-panel { padding: var(--space-4); }
  .task-step { grid-template-columns: 24px 1fr; }
  .task-step .task-actions { grid-column: 2; }
}

/* My work (public/home.js). */
/* My work (public/home.js): the app's My work on a wide screen — a "today" line, then the cards
   in three sections (now, to do, good to know), each card's number in its section's colour:
   urgent red, to do the primary, good to know muted (mobile/lib/screens/office/my_work.dart). */
.home-today {
  margin-bottom: var(--space-4);
}
.home-hello {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 700;
}
.home-summary {
  margin: var(--space-2) 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  color: var(--muted);
}
.home-summary:empty {
  display: none;
}
.home-section-title {
  margin: var(--space-9) 0 var(--space-4);
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
[dir="rtl"] .home-section-title {
  letter-spacing: 0;
}
.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}
.home-card {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-7);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.04);
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.home-card:hover {
  border-color: rgba(var(--primary-rgb), 0.5);
  box-shadow: 0 6px 18px rgba(var(--shadow-rgb), 0.08);
}
.home-count {
  display: grid;
  place-items: center;
  min-width: 56px;
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--muted);
}
.home-card.urgent .home-count { color: var(--danger); }
.home-card.todo .home-count { color: var(--primary); }
.home-text {
  display: grid;
  gap: var(--space-1);
}
.home-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.home-pages-box h3 {
  margin: var(--space-9) 0 var(--space-4);
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.home-pages {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

/* Wide tables (public/ui.js): the Columns button, and the first column kept in view when the
   table scrolls sideways. */
.col-chooser {
  margin: 0 0 var(--space-2);
}
.table-scroll table tr > :first-child {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: var(--panel);
}
.table-scroll table thead tr > :first-child {
  z-index: 2;
}

/* "≈ $" beside LBP totals (public/common.js usdEquivalent). */
.usd-eq {
  display: block;
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 500;
}

/* One look for every form that records something (index.html: class np-form): the same frame,
   the same labels, a red * on what must be filled, and the frame lit while it is being filled. */
.np-form {
  padding: var(--space-7);
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(var(--light-rgb), 0.02);
}
.np-form[hidden] {
  display: none;
}
.np-form:focus-within {
  border-color: rgba(var(--primary-rgb), 0.55);
}
.np-form label > span:first-child {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
}
.np-form label:has(> input[required], > select[required], > textarea[required], > span > input[required]) > span:first-child::after {
  content: " *";
  color: rgb(var(--danger-rgb));
}

/* The customer's history (public/customer-timeline.js). */
.tl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.tl-chip {
  padding: var(--space-2) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.tl-chip.active {
  border-color: rgba(var(--primary-rgb), 0.7);
  background: rgba(var(--primary-rgb), 0.15);
}
/* The customer's History as a log: one line per event, and what the checks found first. */
.tl-tools {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
}
.tl-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-7);
  margin-bottom: var(--space-5);
}
.tl-bar .tl-chips {
  margin-bottom: 0;
}
.tl-bar input[type="search"] {
  flex: 1 1 260px;
  max-width: 380px;
  min-width: 0;
}
.tl-problems {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
}
.tl-problems:empty {
  display: none;
}
.tl-problems.clean {
  border-inline-start-color: var(--success);
}
.tl-problems.check {
  border-inline-start-color: var(--warning);
}
.tl-problems.high {
  border-inline-start-color: var(--danger);
}
.tl-problem-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.tl-problem {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.tl-problem:hover,
.tl-problem.active {
  border-color: var(--border);
  background: var(--panel);
}
.tl-checked summary {
  color: var(--muted);
  font-size: var(--text-sm);
  cursor: pointer;
}
.tl-checked ul {
  margin: var(--space-3) 0 0;
  padding-inline-start: var(--space-8);
  color: var(--muted);
  font-size: var(--text-sm);
  columns: 2 280px;
}
.tl-log td {
  vertical-align: top;
}
.tl-log .tl-first td {
  border-top: 2px solid var(--border);
}
.tl-when strong {
  display: block;
}
.tl-what {
  min-width: 240px;
}
.tl-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(var(--muted-rgb), 0.12);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}
.tl-type-payment,
.tl-type-activate {
  background: rgba(var(--success-rgb), 0.14);
  color: var(--success);
}
.tl-type-stop {
  background: rgba(var(--danger-rgb), 0.12);
  color: var(--danger);
}
.tl-type-correction,
.tl-type-plan,
.tl-type-period {
  background: rgba(var(--warning-rgb), 0.14);
  color: var(--warning);
}
.tl-type-ticket,
.tl-type-ticketClosed,
.tl-type-call {
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--primary);
}
.tl-flagged > td:first-child {
  box-shadow: inset 3px 0 0 var(--warning);
}
[dir="rtl"] .tl-flagged > td:first-child {
  box-shadow: inset -3px 0 0 var(--warning);
}
.tl-flag {
  margin-top: var(--space-2);
  color: var(--warning);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* After an action (public/common.js toast): the Undo button; and the bar while a request is slow. */
.toast-action {
  margin-inline-start: var(--space-4);
}
.np-busy {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: np-busy 1.1s linear infinite;
}
.np-busy[hidden] {
  display: none;
}
@keyframes np-busy {
  from { background-position: -50% 0; }
  to { background-position: 150% 0; }
}

/* An empty list that says what to do (public/ui.js setUpEmptyHints). */
.empty-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-3);
  color: var(--text);
  font-size: var(--text-sm);
}

/* Reports (public/reports.js): cards and charts as on the Billing overview. */
.rep-cards {
  margin-bottom: var(--space-6);
}
.rep-chart {
  margin-bottom: var(--space-6);
}

/* ---------- On a phone (#7): tables as cards, room for fingers ---------- */
@media (max-width: 700px) {
  /* A row is a card: the first cell its title, the others "column: value" (public/ui.js labelCells). */
  .table-scroll table.phone-cards,
  .table-scroll table.phone-cards tbody,
  .table-scroll table.phone-cards tfoot {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .table-scroll table.phone-cards thead {
    display: none;
  }
  .table-scroll table.phone-cards tr {
    display: block;
    margin-bottom: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--panel);
  }
  .table-scroll table.phone-cards tr.filtered-out {
    display: none;
  }
  .table-scroll table.phone-cards td,
  .table-scroll table.phone-cards th {
    display: block;
    overflow: hidden;
    padding: var(--space-2) 0;
    border: 0;
    text-align: end;
    position: static;
    background: none;
  }
  .table-scroll table.phone-cards td::before {
    content: attr(data-label);
    float: inline-start;
    max-width: 45%;
    margin-inline-end: var(--space-5);
    color: var(--muted);
    font-size: var(--text-xs);
    text-align: start;
  }
  .table-scroll table.phone-cards td:first-child {
    display: block;
    padding-bottom: var(--space-3);
    font-size: var(--text-md);
    text-align: start;
  }
  .table-scroll table.phone-cards td:first-child::before,
  .table-scroll table.phone-cards td[data-label=""]::before,
  .table-scroll table.phone-cards td[colspan]::before {
    content: none;
  }
  .table-scroll table.phone-cards td:empty {
    display: none;
  }

  /* Room for a finger: buttons, fields and menu items at least 44px tall. */
  .btn,
  .nav-item,
  select,
  input:not([type="checkbox"]):not([type="radio"]),
  textarea {
    min-height: 44px;
  }
  .col-filter {
    display: none;
  }
}

/* "?" beside a field with rules, and its explanation (public/common.js). */
.help-q {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
}
.help-pop {
  position: fixed;
  z-index: 1001;
  max-width: 320px;
  padding: var(--space-5) var(--space-6);
  border: 1px solid rgba(var(--primary-rgb), 0.5);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--text);
  font-size: var(--text-sm);
  line-height: 1.5;
  box-shadow: 0 12px 32px rgba(var(--shadow-rgb), 0.3);
}

/* The bell (public/home.js): what waits for you, from any page. */
.bell-wrap {
  position: relative;
}
.bell-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--warning);
  color: var(--on-primary);
  font-size: var(--text-xs);
  font-weight: 800;
  text-align: center;
}
.bell.urgent .bell-count {
  background: var(--danger);
}
.bell-pop {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  z-index: 50;
  display: grid;
  gap: var(--space-2);
  width: min(340px, 90vw);
  max-height: 70vh;
  overflow: auto;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(var(--shadow-rgb), 0.35);
}
.bell-pop[hidden] {
  display: none;
}
/* On a phone the bell can sit anywhere in the top bar: the list spans the screen under it, never
   past an edge. */
@media (max-width: 900px) {
  .bell-pop {
    position: fixed;
    inset-inline: 12px;
    top: calc(56px + env(safe-area-inset-top));
    width: auto;
  }
}
.bell-item {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border: 0;
  border-inline-start: 3px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.bell-item:hover {
  background: var(--panel-soft);
}
.bell-item.urgent { border-inline-start-color: var(--danger); }
.bell-item.todo { border-inline-start-color: var(--primary); }
.bell-item.info { border-inline-start-color: var(--muted); }
.bell-item strong {
  min-width: 32px;
  text-align: center;
}
.bell-all {
  justify-self: center;
  margin-top: var(--space-2);
}
.col-clear {
  margin: 0 var(--space-3) var(--space-2);
}

/* Text for screen readers only. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Profiles & prices (public/profiles.js). */
.pf-edit {
  display: inline-flex;
  gap: var(--space-3);
}
.pf-edit input {
  width: 120px;
}

/* Network map (netmap.js): the Dude's maps drawn as SVG. */
.nm-toolbar { flex-wrap: wrap; gap: 8px; align-items: center; }
.nm-toolbar select { max-width: 260px; }
.nm-find { position: relative; }
.nm-find input { width: 240px; }
.nm-found { position: absolute; z-index: 20; top: calc(100% + 4px); inset-inline-start: 0; width: 360px; max-height: 320px; overflow: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(var(--shadow-rgb), 0.3); padding: 4px; }
.nm-found button { display: block; width: 100%; text-align: start; background: none; border: 0; color: var(--text); padding: 6px 8px; border-radius: var(--radius-xs); cursor: pointer; }
.nm-found button:hover { background: var(--panel-soft); }
.nm-crumbs { min-height: 18px; margin: 4px 0 8px; }
.nm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; }
.nm-stage { position: relative; padding: 0; overflow: hidden; }
.nm-svg { display: block; width: 100%; height: calc(100vh - 260px); min-height: 420px; cursor: grab; touch-action: none; background: radial-gradient(circle, rgba(var(--muted-rgb), 0.12) 1px, transparent 1px) 0 0 / 22px 22px; }
.nm-svg:active { cursor: grabbing; }
.nm-link { stroke: rgba(var(--muted-rgb), 0.55); stroke-width: 1.6; }
.nm-link.nm-wireless { stroke: var(--primary); stroke-dasharray: 6 4; }
.nm-link.nm-fast { stroke: var(--violet); stroke-width: 3; }
.nm-link.nm-cut { stroke: var(--danger); stroke-width: 3; }
.nm-node { cursor: pointer; }
.nm-dot-shape { stroke: var(--panel); stroke-width: 2; }
.nm-dot-shape.st-ok, .nm-dot.st-ok { fill: var(--success); background: var(--success); }
.nm-dot-shape.st-bad, .nm-dot.st-bad { fill: var(--danger); background: var(--danger); }
.nm-dot-shape.st-warn, .nm-dot.st-warn { fill: var(--warning); background: var(--warning); }
.nm-dot-shape.st-none, .nm-dot.st-none { fill: rgba(var(--muted-rgb), 0.55); background: rgba(var(--muted-rgb), 0.55); }
.nm-glyph { fill: var(--on-primary); font-size: var(--text-xs); font-weight: 700; pointer-events: none; }
.nm-name { fill: var(--text); font-size: var(--text-xs); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.nm-label { fill: var(--muted); font-size: var(--text-sm); font-style: italic; }
.nm-count { fill: var(--violet); }
.nm-count-text { fill: #fff; font-size: 9px; font-weight: 700; pointer-events: none; }
.nm-area { fill: var(--panel-soft); stroke: var(--primary); stroke-width: 1.5; }
.nm-area.st-bad { stroke: var(--danger); stroke-width: 2.5; }
.nm-area.nm-up { fill: transparent; stroke: rgba(var(--muted-rgb), 0.7); stroke-dasharray: 4 3; }
.nm-area-name { fill: var(--text); font-size: var(--text-sm); font-weight: 600; }
.nm-area-facts { fill: var(--muted); font-size: 10px; }
.nm-node.nm-selected .nm-dot-shape, .nm-node.nm-selected .nm-area { stroke: var(--text); stroke-width: 3; }
.nm-node.nm-cut .nm-dot-shape, .nm-node.nm-cut .nm-area { stroke: var(--danger); stroke-width: 4; }
.nm-node.nm-cut .nm-name { fill: var(--danger); }
.nm-legend { position: absolute; inset-inline-start: 10px; bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); background: rgba(var(--panel-rgb), 0.85); padding: 6px 10px; border-radius: var(--radius-sm); }
.nm-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.nm-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.nm-line { width: 18px; height: 0; display: inline-block; border-top: 2px dashed var(--primary); }
.nm-line.nm-fast { border-top: 3px solid var(--violet); }
.nm-read { position: absolute; inset-inline-end: 10px; top: 8px; }
.nm-side { max-height: calc(100vh - 260px); min-height: 420px; overflow: auto; }
.nm-side h3 { margin: 0 0 8px; word-break: break-word; }
.nm-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0; font-size: var(--text-md); }
.nm-facts dt { color: var(--muted); }
.nm-facts dd { margin: 0; word-break: break-word; }
.nm-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.nm-affected { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; }
.nm-affected h4 { margin: 0 0 6px; color: var(--danger); }
.nm-list { margin: 6px 0; padding-inline-start: 18px; }
.nm-customers { max-height: 220px; overflow: auto; }
@media (max-width: 900px) {
  .nm-layout { grid-template-columns: 1fr; }
  .nm-svg { height: 60vh; min-height: 320px; }
  .nm-side { max-height: none; min-height: 0; }
  .nm-find input { width: 100%; }
  .nm-found { width: min(360px, calc(100vw - 32px)); }
}

/* Set location here (tech.js hereForm): the phone's position and how good it is. */
.tech-here-fix { padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(var(--muted-rgb), 0.12); font-weight: 600; }
.tech-here-fix.good { background: rgba(var(--success-rgb), 0.15); color: var(--success); }
.tech-here-fix.weak { background: rgba(var(--warning-rgb), 0.15); color: var(--warning); }
.nm-modes { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 2px; background: var(--panel); }
.nm-modes button { border: 0; background: none; color: var(--muted); padding: 5px 12px; border-radius: var(--radius-pill); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.nm-modes button.active { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.nm-geo { width: 100%; height: calc(100vh - 260px); min-height: 420px; }
.nm-geo-note { position: absolute; z-index: 500; inset-inline-start: 50px; top: 10px; margin: 0; padding: 4px 10px; border-radius: var(--radius-sm); background: rgba(var(--panel-rgb), 0.9); color: var(--text); }
.nm-site li { margin-bottom: 10px; }
@media (max-width: 900px) { .nm-geo { height: 60vh; min-height: 320px; } }

/* An installation whose customer may be in the radius already under another username. */
.in-existing { border: 1px solid rgba(var(--warning-rgb), 0.5); background: rgba(var(--warning-rgb), 0.08); border-radius: var(--radius-sm); padding: 10px 12px; margin: 10px 0; }
.in-existing li { margin: 6px 0; }

/* The admin's message to the staff (notify-settings.js). */
.nf-send { display: grid; gap: 10px; max-width: 640px; }
.nf-send label > span { display: block; color: var(--muted); font-size: var(--text-sm); margin-bottom: 4px; }
.nf-send input:not([type="checkbox"]), .nf-send textarea, .nf-send select { width: 100%; box-sizing: border-box; }
.nf-choices { display: flex; flex-wrap: wrap; gap: 6px 14px; max-height: 200px; overflow: auto; }
.nf-role-table td:first-child { min-width: 220px; }
.nf-role-group th { text-align: start; color: var(--muted); font-size: var(--text-sm); padding-top: 12px; }

/* Address check (address-check.js): what the customers there say about the place. */
.ac-verdict { font-weight: 600; padding: 10px 12px; border-radius: var(--radius-sm); margin: 10px 0; }
.ac-verdict.bad { background: rgba(var(--danger-rgb), 0.12); color: var(--danger); }
.ac-verdict.warn { background: rgba(var(--warning-rgb), 0.12); color: var(--warning); }
.ac-verdict.good { background: rgba(var(--success-rgb), 0.12); color: var(--success); }

/* Why the customer cannot connect (client.js loadWhyStopped). */
.cp-why-stopped { margin: 8px 0; padding: 8px 12px; border-radius: var(--radius-sm); background: rgba(var(--warning-rgb), 0.12); color: var(--warning); font-weight: 600; }
.cp-why-stopped.unpaid { background: rgba(var(--danger-rgb), 0.12); color: var(--danger); }

/* ---------- The admin working as a reseller (common.js showActingBar) ---------- */
.acting-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  padding: 8px 16px;
  background: #c62828;
  color: #fff;
  font-weight: 600;
  text-align: center;
}
.acting-bar .btn { background: #fff; color: #c62828; border-color: #fff; }

/* The licence: a quiet bar through the trial, a clear one when the program is read only. */
.licence-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  padding: 7px 16px;
  background: rgba(var(--warning-rgb), 0.16);
  color: var(--text);
  font-size: var(--text-md);
  text-align: center;
}
.licence-bar.read-only {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--danger);
  color: var(--on-primary);
  font-weight: 600;
}
.licence-bar a {
  color: inherit;
  font-weight: 700;
}
a.brand-product {
  display: block;
  color: var(--muted);
  text-decoration: none;
}
a.brand-product:hover {
  text-decoration: underline;
}
.licence-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  letter-spacing: 0.04em;
}


/* ---------- Kept with no signal (public/tech-outbox.js) ---------- */
.tech-outbox {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  background: #b26a00;
  color: #fff;
  font-weight: 600;
}
.tech-outbox[hidden] { display: none; }

/* Money a technician holds for the customer, not handed in yet (common.js heldBadge). */
.held-badge { margin-top: 3px; font-size: var(--text-sm); font-weight: 600; color: #2e7d32; white-space: normal; }


/* ---------- Laptops (most office PCs: 15-inch, 1366-1600 px wide, often under 900 px tall) ----------
   The menu narrower and the empty space around panels smaller, so tables and forms get the room;
   cards and their figures less tall; windows always fit the screen. Bigger screens keep the roomy
   layout, phones their own (max-width rules above). */
@media (min-width: 981px) and (max-width: 1600px) {
  .shell {
    grid-template-columns: 228px minmax(0, 1fr);
  }
  .cp-shell {
    grid-template-columns: 216px minmax(0, 1fr);
  }
  .sidebar {
    padding: 20px 14px;
  }
  .brand {
    margin-bottom: var(--space-4);
  }
  .brand-mark {
    width: 36px;
    height: 36px;
  }
  .content {
    padding: 20px 24px;
  }
  .topbar {
    margin-bottom: 16px;
  }
  .summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-6);
    margin-bottom: 16px;
  }
  .summary-card {
    padding: var(--space-7) var(--space-8);
  }
  .summary-label {
    margin-bottom: var(--space-4);
  }
  .summary-value {
    font-size: 1.6rem;
  }
  .panel {
    padding: var(--space-8);
  }
  .panel-header {
    margin-bottom: 12px;
  }
}

/* Short screens (a laptop at 125-150 % zoom): the menu rows closer, windows scroll inside. */
@media (min-width: 981px) and (max-height: 900px) {
  .nav-item {
    padding: var(--space-4) var(--space-6);
  }
  .nav-section .nav-group {
    padding: var(--space-4) var(--space-5);
  }
  .sidebar {
    gap: var(--space-4);
  }
  .np-dialog {
    max-height: calc(100vh - 48px);
    overflow-y: auto;
  }
}


/* ---------- The rail: the menu folded to its icons (public/nav.js setRail) ----------
   On a laptop it gives tables about 170 px back. Each group is its icon with its count; its pages
   open in a panel beside the rail on hover or click. Phones keep their own menu (below 981 px). */
.rail-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.rail-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rail-toggle:hover {
  background: rgba(var(--light-rgb), 0.06);
  color: var(--text);
}
[dir="rtl"] .rail-toggle svg {
  transform: scaleX(-1);
}
.user-menu-item.rail-only {
  display: none;
}
@media (min-width: 981px) {
  .rail-toggle {
    display: inline-flex;
    flex: none;
  }
  html[data-rail="1"] .shell {
    grid-template-columns: 60px minmax(0, 1fr);
  }
  html[data-rail="1"] .cp-shell {
    grid-template-columns: 60px minmax(0, 1fr);
  }
  html[data-rail="1"] .sidebar {
    padding: 14px 8px;
    gap: var(--space-4);
    align-items: center;
    overflow: visible;
    /* The panels open over the page. */
    z-index: 70;
  }
  html[data-rail="1"] .sidebar-head {
    flex-direction: column;
    gap: var(--space-4);
  }
  html[data-rail="1"] .brand > div,
  html[data-rail="1"] .my-day,
  html[data-rail="1"] .user-text,
  html[data-rail="1"] #language-button,
  html[data-rail="1"] .nav-group > span:first-of-type,
  html[data-rail="1"] .nav-chevron,
  html[data-rail="1"] .nav-item.nav-home > span {
    display: none;
  }
  html[data-rail="1"] .rail-toggle svg {
    transform: scaleX(-1);
  }
  html[data-rail="1"][dir="rtl"] .rail-toggle svg,
  [dir="rtl"] html[data-rail="1"] .rail-toggle svg {
    transform: none;
  }
  html[data-rail="1"] .brand {
    margin: 0;
    gap: 0;
  }
  html[data-rail="1"] .brand-mark {
    width: 36px;
    height: 36px;
  }
  /* The groups: icon only, the count on its corner; panels must not be clipped by the menu's scroll. */
  html[data-rail="1"] .nav {
    width: 100%;
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
    gap: var(--space-2);
  }
  html[data-rail="1"] .nav-section {
    position: relative;
  }
  html[data-rail="1"] .nav-section .nav-group,
  html[data-rail="1"] .nav-item.nav-home {
    position: relative;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0 auto;
    gap: 0;
  }
  html[data-rail="1"] .nav-icon {
    width: 21px;
    height: 21px;
  }
  html[data-rail="1"] .nav-section:has(.nav-item.active) .nav-group {
    background: rgba(var(--primary-rgb), 0.12);
  }
  html[data-rail="1"] .nav-section:has(.nav-item.active) .nav-icon,
  html[data-rail="1"] .nav-section.flyout .nav-icon,
  html[data-rail="1"] .nav-section:hover .nav-icon {
    color: var(--primary);
    opacity: 1;
  }
  html[data-rail="1"] .nav-section-count {
    position: absolute;
    top: -2px;
    inset-inline-end: -4px;
    min-width: 18px;
    padding: 1px 5px;
    font-size: var(--text-xs);
    line-height: 1.3;
  }
  /* A group's pages: a panel beside the rail, with the group's name over them (an open group's
     list stays folded too: the rule outranks .nav-section.open .nav-items). */
  html[data-rail="1"] .nav-section .nav-items {
    display: none;
    position: absolute;
    top: 0;
    inset-inline-start: calc(100% + 6px);
    z-index: 60;
    min-width: 230px;
    margin: 0;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--panel);
    box-shadow: 0 16px 40px rgba(var(--shadow-rgb), 0.45);
    max-height: calc(100vh - 16px);
    overflow-y: auto;
  }
  html[data-rail="1"] .nav-items::before {
    content: attr(data-label);
    display: block;
    padding: var(--space-3) var(--space-7) var(--space-4);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  [dir="rtl"] html[data-rail="1"] .nav-items::before,
  html[data-rail="1"][dir="rtl"] .nav-items::before {
    letter-spacing: 0;
  }
  /* A gap to cross between the icon and its panel without closing it. */
  html[data-rail="1"] .nav-items::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-end: 100%;
    width: 8px;
  }
  /* Opened by public/nav.js (hover, with a moment to reach the panel; closed once a page is
     chosen), or by the keyboard. */
  html[data-rail="1"] .nav-section.flyout .nav-items,
  html[data-rail="1"] .nav-section:has(:focus-visible) .nav-items {
    display: grid;
  }
  html[data-rail="1"] .nav-top {
    margin-bottom: 0;
  }
  /* The user box: the avatar opens the account menu, which carries the language switch too. */
  html[data-rail="1"] .user-box {
    width: 100%;
    padding-top: var(--space-5);
    justify-items: center;
  }
  html[data-rail="1"] .user-who {
    justify-content: center;
  }
  html[data-rail="1"] .user-actions {
    justify-content: center;
  }
  html[data-rail="1"] .user-menu > summary {
    width: 36px;
    height: 32px;
    padding: 0;
    font-size: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  html[data-rail="1"] .user-menu > summary::before {
    content: '•••';
    font-size: var(--text-sm);
    letter-spacing: 0.1em;
  }
  html[data-rail="1"] .user-menu-item.rail-only {
    display: block;
  }
}

/* The feature search sits in the top bar; on a phone the bell keeps the room. */
@media (max-width: 620px) {
  .topbar-actions .feature-search {
    display: none;
  }
}

/* A page inside the pop-up (common.js openPage): without its own menu and top bar, the page
   behind has them. Last in the file and as specific as the folded menu's rules
   (html[data-rail="1"] .cp-shell), so neither the folded menu nor a laptop width brings the
   menu's column back: the page would be squeezed into it. */
html.in-popup #cp-sidebar,
html.in-popup .shell > .sidebar,
html.in-popup .topbar { display: none; }
html.in-popup .shell,
html.in-popup .cp-shell { grid-template-columns: minmax(0, 1fr); }

/* The admin's own money (public/my-money.html). */
.mm-holds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2);
}

.mm-actions,
.mm-month {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin: 12px 0;
}

.mm-actions .btn {
  flex: 1;
}

.mm-month {
  justify-content: space-between;
}

.mm-in {
  color: var(--success, #22c55e);
}

.mm-out {
  color: var(--danger, #ef4444);
}

.mm-result {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-bottom: 12px;
}

.mm-result div {
  display: grid;
  gap: 4px;
}

/* While something loads (public/ui.js skeletonHtml, loadingRows): grey bars, gently pulsing. */
.skeleton {
  display: grid;
  gap: 12px;
  padding: 4px 0;
}

.skeleton-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--panel);
}

.skeleton-bar {
  display: block;
  height: 12px;
  border-radius: var(--radius-xs);
  background: rgba(var(--muted-rgb), 0.18);
  animation: skeleton-pulse 1.2s ease-in-out infinite alternate;
}

.skeleton-bar.thin {
  height: 8px;
}

.skeleton-row td {
  padding-block: 12px;
}

@keyframes skeleton-pulse {
  0% { opacity: 0.45; }
  100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-bar { animation: none; }
}

/* Reports → Analytics (public/analytics.js) */
.an-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-4, 16px);
  margin-block: var(--space-3, 12px);
}

.an-card .summary-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.an-how {
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.7;
}

.an-how:hover,
.an-how:focus-visible {
  opacity: 1;
}

.an-up {
  color: var(--success);
}

.an-down {
  color: var(--danger);
}

tr.an-war td {
  background: rgba(var(--warning-rgb), 0.08);
}

@media print {
  #view-analytics .an-charts {
    grid-template-columns: 1fr 1fr;
  }

  #view-analytics .panel {
    break-inside: avoid;
    margin-bottom: 12px;
  }
}

/* How the customer paid at the end of a ticket (public/tech.js paidLine). */
.tech-paid-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid rgba(var(--light-rgb), 0.12);
  border-radius: var(--radius-sm);
}

/* Finishing a new customer: the steps after Confirm, one after the other (public/onboarding.js). */
.obs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.obs-step {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.obs-step.next {
  border-color: var(--primary);
}
.obs-step.done .obs-icon {
  color: var(--success);
}
.obs-step.skip,
.obs-step.wait {
  opacity: 0.75;
}
.obs-icon {
  font-weight: 700;
  text-align: center;
}
.obs-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
.obs-act {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.obs-finished {
  color: var(--success);
  font-weight: 600;
}
@media (max-width: 640px) {
  .obs-step {
    grid-template-columns: 28px 1fr;
  }
  .obs-act {
    grid-column: 2;
  }
}
/* A step whose buttons include a small form (an amount, a choice): the form gets its own line. */
.obs-step:has(.obs-act input, .obs-act select) {
  grid-template-columns: 28px 1fr;
}
.obs-step:has(.obs-act input, .obs-act select) .obs-act {
  grid-column: 2;
}
.pc-charge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
}
.pc-charge > .muted {
  flex-basis: 100%;
}
.pc-charge input {
  max-width: 160px;
}
.pc-charge select {
  max-width: 360px;
}

/* Where the money is: one line per holder or pot, its amounts and its button. */
.ms-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
}
.ms-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}
.ms-who {
  flex: 1 1 220px;
  min-width: 0;
}
.ms-row input {
  max-width: 130px;
}

/* Collect a bill: the whole bill in one currency, two buttons side by side. */
.tech-full {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.tech-free-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}
.tech-free-check input {
  width: auto;
  min-height: 0;
}

/* The company's equipment at this customer: above the secret note, amber. */
.company-items-note {
  margin: var(--space-4) 0 0;
  padding: var(--space-3) var(--space-5);
  border: 1px solid rgba(var(--warning-rgb), 0.55);
  border-inline-start: 4px solid var(--warning);
  border-radius: var(--radius-sm);
  background: rgba(var(--warning-rgb), 0.1);
}

/* The sign-in page's public links (privacy policy, terms of service). */
.auth-legal {
  margin: var(--space-6) 0 0;
  text-align: center;
}

/* My money: the total under each group of money in. */
.mm-subtotal {
  border-top: 1px solid var(--border);
  font-weight: 600;
}

/* My money: where the money is (four cards), and where a handover came from. */
.mm-where-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}
.mm-where-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.mm-cw {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.mm-pots {
  list-style: none;
  margin: var(--space-2) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.mm-pots li {
  border-top: 1px solid var(--border);
  padding-top: var(--space-2);
}
.mm-sources {
  width: 100%;
  margin-top: var(--space-3);
}
.mm-sources ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mm-sources li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-1) 0;
}

/* The decision boxes (public/decision-chain.js): one question at a time, left to right. */
.dc-chain {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5) var(--space-6);
  align-items: flex-start;
  margin: var(--space-4) 0;
}
.dc-box {
  display: grid;
  gap: var(--space-2);
  min-width: 200px;
  flex: 1 1 200px;
  max-width: 320px;
}
.dc-box.dc-dim { opacity: .4; }
.dc-label {
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.dc-n {
  display: inline-flex;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 25%, transparent);
  color: var(--primary);
  align-items: center;
  justify-content: center;
  font-size: 0.85em;
}
.dc-select, .dc-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-weight: 600;
}
.dc-select.dc-ask { border-color: var(--warning, #f59e0b); color: var(--warning, #f59e0b); }
.dc-box.dc-dim .dc-select { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.dc-hint { font-size: 0.82em; color: var(--muted); line-height: 1.4; }
.dc-facts { margin: var(--space-2) 0 0; line-height: 1.5; }
.dc-summary {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-3) 0 var(--space-4);
}
.dc-summary h5 {
  margin: 0 0 var(--space-2);
  font-size: 0.72em;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.dc-summary ul { margin: 0; padding-inline-start: 18px; }
.dc-summary li { margin: 3px 0; line-height: 1.45; }
.task-dc .dc-chain { gap: var(--space-3) var(--space-4); }
.task-dc .dc-box { min-width: 150px; flex-basis: 150px; }
.obs-act:has(.dc) { flex: 1 1 100%; }
@media (max-width: 640px) {
  .dc-box { max-width: none; }
}

/* Administration → Rules & names (public/rules.js). */
.rules-value strong { white-space: pre-wrap; }
/* Rules & names → The company: the logo beside its words, the details under (public/rules.js). */
.rules-company {
  display: grid;
  gap: var(--space-6);
  padding-top: var(--space-6);
}
.rules-logo {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.rules-logo-img {
  width: 72px;
  height: 72px;
  flex: none;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--panel-soft);
  border: 1px solid var(--border);
}
.rules-changed .rules-value strong { color: var(--primary); }

/* A paged table's filters (2026-11-10): what the list is filtered by, each removable. */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin: var(--space-1) 0 var(--space-2);
  font-size: var(--text-sm);
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 2px 10px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-pill);
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--text);
}
.filter-chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
  font-size: var(--text-sm);
}
.filter-chip button:hover { color: var(--text); }
.col-menu-item.chosen { font-weight: 600; color: var(--primary); }
.col-menu-title { padding: 2px 4px 6px; }
.col-menu-note { margin: 6px 4px 0; }

/* ==================== The kit (2026-11-10) ====================
   The same six pieces as the app (mobile/lib/core/kit.dart), on the same tokens, so a page on the
   computer and a screen on the phone read as one product. The pages are restyled with these
   piece by piece (the website track of the app redesign). */

/* The state dot: online, offline, stopped, expired/blocked, unknown hollow. */
.kit-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--muted); vertical-align: middle; }
.kit-dot[data-state="online"] { background: var(--success); border-color: var(--success); }
.kit-dot[data-state="offline"] { background: var(--danger); border-color: var(--danger); }
.kit-dot[data-state="stopped"] { background: var(--muted); }
.kit-dot[data-state="expired"], .kit-dot[data-state="blocked"] { background: var(--warning); border-color: var(--warning); }

/* A small word in colour. */
.kit-chip { display: inline-block; padding: 3px 8px; border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: 600; color: var(--muted); background: rgba(var(--muted-rgb), 0.12); }
.kit-chip.ok { color: var(--success); background: rgba(var(--success-rgb), 0.12); }
.kit-chip.warn { color: var(--warning); background: rgba(var(--warning-rgb), 0.12); }
.kit-chip.bad { color: var(--danger); background: rgba(var(--danger-rgb), 0.12); }

/* 1. The list row: name · dot · meta · amount · chevron. */
.kit-row { display: flex; align-items: center; gap: var(--space-6); padding: var(--space-6) var(--space-8); border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; cursor: pointer; }
.kit-row:hover { background: var(--panel-soft); }
.kit-row.dim { opacity: 0.55; }
.kit-row .kit-main { flex: 1; min-width: 0; }
.kit-row .kit-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: var(--space-4); }
.kit-row .kit-meta { font-size: var(--text-md); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: var(--space-1); }
.kit-row .kit-amount { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; text-align: end; }
.kit-row .kit-amount.bad { color: var(--danger); }
.kit-row .kit-side { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }
.kit-row .kit-chevron { color: var(--muted); }
.kit-section { padding: var(--space-9) var(--space-8) var(--space-3); font-size: var(--text-md); font-weight: 700; color: var(--muted); letter-spacing: 0.3px; display: flex; justify-content: space-between; }

/* 2. A thing's page: header, body, the one primary action at the bottom. */
.kit-detail { display: flex; flex-direction: column; min-height: 100%; }
.kit-header { padding: var(--space-4) var(--space-8) var(--space-8); background: var(--panel); border-bottom: 1px solid var(--border); }
.kit-header .kit-sub { font-size: var(--text-md); color: var(--muted); }
.kit-header .kit-key { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; direction: ltr; display: inline-block; }
.kit-header .kit-chips { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; margin-top: var(--space-4); }
.kit-body { flex: 1; }
.kit-actions { position: sticky; bottom: 0; padding: var(--space-5) var(--space-8); background: var(--panel); border-top: 1px solid var(--border); }
.kit-actions .kit-secondary { display: flex; gap: var(--space-3); margin-bottom: var(--space-5); }
.kit-actions .kit-secondary .btn { flex: 1; }
.kit-actions .kit-primary { width: 100%; min-height: 48px; }
.kit-fact { display: flex; gap: var(--space-6); padding: var(--space-3) var(--space-8); font-size: 15px; }
.kit-fact > span:first-child { width: 120px; flex: none; font-size: var(--text-md); color: var(--muted); }

/* 3 and 4. Sheets: the money sheet and the one-question sheet come up from the bottom. */
.kit-sheet { position: fixed; inset: auto 0 0 0; background: var(--panel); border-radius: 20px 20px 0 0; padding: var(--space-5) var(--space-10) var(--space-10); box-shadow: 0 -8px 30px rgba(var(--shadow-rgb), 0.18); max-width: 560px; margin: 0 auto; }
.kit-sheet .kit-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 14px; }
.kit-sheet .kit-question { font-size: 17px; font-weight: 600; }
.kit-sheet .kit-detail-text { font-size: var(--text-md); color: var(--muted); margin-top: var(--space-4); }
.kit-sheet .kit-choices { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-9); }
.kit-sheet .kit-choices .btn { min-height: 48px; }
.kit-sheet .kit-big-amount { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; direction: ltr; }
.kit-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); margin-top: var(--space-5); }
.kit-keypad button { min-height: 52px; border-radius: var(--radius-sm); background: var(--panel-soft); border: none; color: var(--text); font-size: 22px; font-weight: 600; }

/* 5. The receipt as it prints. */
.kit-receipt { margin: 0 var(--space-8); padding: var(--space-7); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.35; white-space: pre; direction: ltr; }
.kit-receipt-actions { display: flex; gap: var(--space-4); padding: var(--space-6) var(--space-8) var(--space-4); }
.kit-receipt-actions .btn { flex: 1; }
.btn.whatsapp { background: var(--whatsapp); color: #fff; }

/* 6. The empty state that teaches. */
.kit-empty { text-align: center; padding: 32px; }
.kit-empty .kit-empty-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto var(--space-8); display: grid; place-items: center; background: rgba(var(--primary-rgb), 0.12); color: var(--primary); }
.kit-empty h3 { margin: 0 0 var(--space-3); font-size: 17px; }
.kit-empty p { margin: 0 0 var(--space-9); color: var(--muted); font-size: 15px; }

/* The first line of a "today": one sentence, the number that matters, chips. */
.kit-today { padding: var(--space-7) var(--space-8); background: var(--panel); border-bottom: 1px solid var(--border); }
.kit-today .kit-today-text { font-size: var(--text-md); color: var(--muted); }
.kit-today .kit-today-amount { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; direction: ltr; display: inline-block; margin-top: var(--space-2); }

/* ==================== The shell (2026-11-10, step 2 of the website track) ==================== */

/* A form's own button inside a page that already has its main action (a note, a line added):
   tinted, so the page keeps one filled button. */
.btn.tonal {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: rgba(var(--primary-rgb), 0.4);
  color: var(--primary);
}

/* An open ticket (public/tickets.js): its boxes apart from each other. */
#tk-detail > * + * {
  margin-top: var(--space-8);
}
/* A tick in the fees form sits beside its words, at its own size. */
.tk-charge-form label input[type="checkbox"] {
  width: auto;
}
.tk-charge-form label:has(> input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* In a list every row has its action: there it is tinted, not filled, so the page keeps one
   filled action (the kit's rule) and a table of forty rows is not forty loud buttons. */
tbody .btn.primary {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: rgba(var(--primary-rgb), 0.4);
  color: var(--primary);
}

/* A link in running text takes the theme's primary, not the browser's blue. */
a:not([class]) {
  color: var(--primary);
}

/* On a phone a dialog comes up from the bottom, as the app's sheets do (kit pieces 3 and 4), and
   its buttons are as tall as a finger. */
@media (max-width: 700px) {
  .np-dialog {
    width: 100vw;
    max-width: none;
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
  }
  .np-dialog-actions .btn {
    flex: 1;
    min-height: 48px;
  }
}

/* ==================== A page of its own inside the site (2026-11-11) ====================
   My money and Take a payment were drawn for a phone. On a computer they now sit in the site:
   its menu beside them (public/nav.js cloneMenu), the page's width used, the site's text size.
   On a phone they stay as they were, with no menu (the app, or the page's own bar). */
.page-shell-main {
  min-width: 0;
}
.mm-cols {
  display: grid;
  gap: var(--space-6);
}
/* The page's own name: on a computer only (a phone shows the company and who is signed in). */
.page-shell-title {
  display: none;
}
.page-shell > .sidebar[hidden] + .page-shell-main {
  grid-column: 1 / -1;
}
@media (max-width: 980px) {
  .page-shell > .sidebar {
    display: none;
  }
  .page-shell {
    display: block;
  }
}
@media (min-width: 981px) {
  .page-shell {
    font-size: var(--text-base);
  }
  .page-shell .collect-header {
    position: static;
    padding: 28px 32px 0;
    background: none;
    border-bottom: 0;
  }
  .page-shell .collect-who strong {
    font-size: var(--text-2xl);
    font-weight: 700;
  }
  .page-shell #mm-home {
    display: none;
  }
  .page-shell .collect-main {
    max-width: 1280px;
    margin: 0;
    padding: var(--space-10) 32px 32px;
  }
  .page-shell .collect-main > .panel,
  .page-shell .mm-cols {
    margin-bottom: var(--space-8);
  }
  .page-shell .mm-where-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .page-shell .mm-holds {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
  }
  .page-shell .mm-actions,
  .page-shell .mm-month {
    max-width: 460px;
  }
  .page-shell .mm-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

/* Take a payment on a computer (2026-11-11): a counter. The list on one side as rows, the
   payment always on the other (a hint there while nobody is chosen); My payments and the printer
   are two quiet buttons at the top, not tabs; the form in a computer's sizes, the two currencies
   side by side. On a phone, and in the pop-up over a page, nothing of this applies. */
.collect-side {
  display: none;
}
@media (min-width: 981px) {
  body.collect-page:has(> .page-shell) {
    padding-bottom: 0;
  }
  .page-shell .page-shell-main {
    position: relative;
  }
  .page-shell .page-shell-title {
    display: block;
  }
  .page-shell #collect-company,
  .page-shell .tech-modes,
  .page-shell .collect-header-actions {
    display: none;
  }
  /* Everything of the page keeps clear of the payment's side. */
  .page-shell .collect-header,
  .page-shell .collect-main,
  .page-shell .collect-banner {
    margin-inline-end: 480px;
  }
  /* My payments · Printer: quiet buttons at the top; "Customers" only as the way back. */
  .page-shell .collect-nav {
    position: absolute;
    top: 30px;
    bottom: auto;
    inset-inline: auto 512px;
    display: flex;
    gap: var(--space-3);
    padding: 0;
    background: none;
    border-top: 0;
  }
  .page-shell .collect-nav button {
    padding: var(--space-3) var(--space-7);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--panel-soft);
    color: var(--text);
    font-size: var(--text-md);
    font-weight: 600;
  }
  .page-shell .collect-nav button.active {
    display: none;
  }
  .page-shell .collect-nav button[data-tab="customers"]::before {
    content: "←";
    margin-inline-end: var(--space-3);
  }
  [dir="rtl"] .page-shell .collect-nav button[data-tab="customers"]::before {
    content: "→";
  }
  .page-shell .collect-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-5);
  }
  .page-shell .collect-search input[type="search"] {
    flex: 1 1 320px;
    width: auto;
    font-size: var(--text-lg);
    padding: var(--space-5) var(--space-6);
  }
  .page-shell .collect-search select {
    width: auto;
    min-width: 170px;
  }
  /* Whose payment (customers or resellers): a small switch, not a bar as wide as the page. */
  .page-shell .collect-mode {
    display: inline-grid;
    min-width: 300px;
    margin: 0 0 var(--space-6);
  }
  .page-shell .collect-mode button {
    padding: var(--space-3) var(--space-8);
  }
  .collect-resellers .page-shell #collect-by-collector,
  .collect-resellers .page-shell #collect-area,
  .collect-resellers .page-shell .collect-regions,
  .collect-resellers .page-shell #collect-moved {
    display: none;
  }
  /* The list: rows in one card, the chosen one marked. */
  .page-shell .collect-list {
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--panel);
  }
  .page-shell .collect-list:empty {
    display: none;
  }
  .page-shell .collect-list .collect-item {
    padding: var(--space-5) var(--space-8);
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: none;
  }
  .page-shell .collect-list li:last-child .collect-item {
    border-bottom: 0;
  }
  .page-shell .collect-list button.collect-item:hover {
    background: rgba(var(--light-rgb), 0.04);
  }
  .page-shell .collect-list .collect-item.selected {
    background: rgba(var(--primary-rgb), 0.1);
    box-shadow: inset 3px 0 0 var(--primary);
  }
  [dir="rtl"] .page-shell .collect-list .collect-item.selected {
    box-shadow: inset -3px 0 0 var(--primary);
  }
  .page-shell .collect-more {
    margin-top: var(--space-6);
  }
  /* The payment's side: the hint, and over it the payment once someone is chosen. */
  .collect-page:has(> .page-shell) .collect-side,
  .collect-page:has(> .page-shell) .collect-sheet {
    position: fixed;
    inset: 0;
    inset-inline-start: auto;
    width: 480px;
    border-inline-start: 1px solid var(--border);
    background: rgba(var(--chrome-rgb), 0.96);
  }
  .collect-page:has(> .page-shell) .collect-side {
    display: grid;
    place-items: center;
    z-index: 4;
  }
  .collect-page:has(> .page-shell) .collect-sheet-head {
    flex-direction: row-reverse;
    justify-content: space-between;
    padding: var(--space-10) var(--space-10) var(--space-6);
    background: none;
    border-bottom: 0;
  }
  .collect-page:has(> .page-shell) .collect-sheet-head strong {
    font-size: var(--text-xl);
  }
  .collect-page:has(> .page-shell) .collect-sheet-body {
    max-width: none;
    padding: 0 var(--space-10) var(--space-10);
  }
  .collect-page:has(> .page-shell) .collect-sheet .panel {
    padding: var(--space-8);
  }
  /* The form: two columns, the currencies side by side, "Full" right under them. */
  .collect-page:has(> .page-shell) .collect-sheet .collect-form {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6) var(--space-6);
  }
  .collect-page:has(> .page-shell) .collect-sheet .collect-form > * {
    grid-column: 1 / -1;
  }
  .collect-page:has(> .page-shell) .collect-sheet .collect-form > label:has(#pay-lbp),
  .collect-page:has(> .page-shell) .collect-sheet .collect-form > label:has(#pay-usd),
  .collect-page:has(> .page-shell) .collect-sheet .collect-form > label:has(#reseller-method),
  .collect-page:has(> .page-shell) .collect-sheet .collect-form > label:has(#reseller-note),
  .collect-page:has(> .page-shell) .collect-sheet #pay-office > label:not(.collect-toggle) {
    grid-column: auto;
  }
  .collect-page:has(> .page-shell) .collect-sheet #pay-office:not([hidden]) {
    display: contents;
  }
  .collect-page:has(> .page-shell) .collect-sheet #pay-office > .collect-toggle {
    grid-column: 1 / -1;
  }
  .collect-page:has(> .page-shell) .collect-sheet .collect-breakdown { order: 1; }
  .collect-page:has(> .page-shell) .collect-sheet .collect-due { order: 2; }
  .collect-page:has(> .page-shell) .collect-sheet .collect-form > label { order: 3; }
  .collect-page:has(> .page-shell) .collect-sheet .collect-quick { order: 4; }
  .collect-page:has(> .page-shell) .collect-sheet .collect-form > label:has(#pay-method),
  .collect-page:has(> .page-shell) .collect-sheet .collect-form > label:has(#reseller-method),
  .collect-page:has(> .page-shell) .collect-sheet .collect-form > label:has(#reseller-note) { order: 5; }
  .collect-page:has(> .page-shell) .collect-sheet #pay-whish,
  .collect-page:has(> .page-shell) .collect-sheet #reseller-whish { order: 6; }
  .collect-page:has(> .page-shell) .collect-sheet #pay-office > * { order: 7; }
  .collect-page:has(> .page-shell) .collect-sheet #pay-rate { order: 8; }
  /* Closing a small rest as rounding (the tick main added): with what is left, above the button. */
  .collect-page:has(> .page-shell) .collect-sheet #pay-round-wrap { order: 9; }
  .collect-page:has(> .page-shell) .collect-sheet .collect-remaining { order: 9; }
  .collect-page:has(> .page-shell) .collect-sheet .collect-submit { order: 10; min-height: 46px; }
  .collect-page:has(> .page-shell) .collect-sheet .collect-form label {
    font-size: var(--text-md);
    color: var(--muted);
  }
  .collect-page:has(> .page-shell) .collect-sheet .collect-form input:not([type="checkbox"]),
  .collect-page:has(> .page-shell) .collect-sheet .collect-form select {
    font-size: var(--text-lg);
    padding: var(--space-4) var(--space-6);
    color: var(--text);
  }
  .collect-page:has(> .page-shell) .collect-sheet .collect-quick .btn {
    flex: 1;
  }
  .collect-page:has(> .page-shell) .toast {
    inset-inline: auto 500px;
    bottom: 20px;
    max-width: 420px;
  }
}

/* The customer page's Change plan (public/plan-change.js): the plan he has and the new one side
   by side, and the line for a trial running or a change booked. */
.pc-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
.pc-card {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding: var(--space-7) var(--space-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}
.pc-card.pc-new {
  border-color: rgba(var(--primary-rgb), 0.45);
  background: rgba(var(--primary-rgb), 0.06);
}
.pc-card strong {
  font-size: var(--text-xl);
}
.pc-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.pc-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  font-variant-numeric: tabular-nums;
}
.pc-arrow {
  display: grid;
  place-items: center;
  font-size: var(--text-2xl);
  color: var(--muted);
}
[dir="rtl"] .pc-arrow {
  transform: scaleX(-1);
}
.pc-mode p {
  margin: 0 0 var(--space-5);
}
/* The length takes the room its longest choice needs, the note takes the rest; neither may
   spill over the other, and on a narrow page the note goes under the length. */
.pc-fields {
  display: grid;
  grid-template-columns: minmax(180px, max-content) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: end;
  margin-bottom: var(--space-6);
}
.pc-fields label {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
  font-size: var(--text-md);
  color: var(--muted);
}
.pc-fields select,
.pc-fields input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
@media (max-width: 620px) {
  .pc-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}
.pc-fields .pc-wide:only-child {
  grid-column: 1 / -1;
}
.plan-banner {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.plan-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-7);
  border: 1px solid rgba(var(--warning-rgb), 0.45);
  border-radius: var(--radius-md);
  background: rgba(var(--warning-rgb), 0.08);
}
@media (max-width: 700px) {
  .pc-compare,
  .pc-fields {
    grid-template-columns: 1fr;
  }
  .pc-arrow {
    transform: rotate(90deg);
  }
}

/* Money transfer services (lib/transfer-services.js): their logos with the company's number,
   beside "paid by transfer" and on printed bills; in the list on Rules & names. */
.transfer-strip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-7);
}
.transfer-service,
.pay-service {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-md);
}
.transfer-service img,
.pay-service img {
  height: 20px;
  width: auto;
}
.pay-services {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.pay-service {
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.pay-service-line {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.pay-service-line img {
  height: 14px;
  width: auto;
}
/* A logo is a picture to recognise, not something to press. */
.pay-service img,
.pay-service-line img,
.transfer-service img {
  pointer-events: none;
}
.pay-service:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.rules-ts-logo {
  width: 72px;
}
.rules-ts-logo img {
  height: 28px;
  width: auto;
}
