/* Admin app: layouts that only the admin console uses. Shared components live in app.css. */

.global-search {
  position: relative;
  flex: 1 1 320px;
  max-width: 520px;
  min-width: 0;
}
.global-search .search {
  max-width: none;
}
.global-search .search kbd {
  flex: none;
}
.global-results {
  inset-inline: 0;
  top: calc(100% + 4px);
  max-width: none;
  max-height: 440px;
  overflow-y: auto;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--s6);
  align-items: start;
}
.two-col.even {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* dashboard */
.check-list > li {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 48px;
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--text-sm);
}
.check-list > li:last-child {
  border-bottom: 0;
}
.check-list .dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  color: transparent;
}
.check-list li.done .dot {
  background: var(--ok-soft);
  border-color: transparent;
  color: var(--ok);
}
.check-list li.done .label {
  color: var(--text-3);
  text-decoration: line-through;
}
.alert-row .icon {
  color: var(--text-3);
}
.alert-row.bad .icon {
  color: var(--bad);
}
.alert-row.warn .icon {
  color: #b87400;
}

/* One colour for each kind of number, the same on the control panel's tiles, on the subscriber list's status
   buttons and on the dot beside a status, so a person learns each colour once and finds it before reading.
   Each is dark enough for its number to read on white and for a white symbol to read on it. */
:root {
  --k-total: #4338ca;
  --k-online: #15803d;
  --k-offline: #64748b;
  --k-active: #0f766e;
  --k-expiring: #a16207;
  --k-expired: #b91c1c;
  --k-new: #1d4ed8;
  --k-suspended: #7e22ce;
  --k-disabled: #78716c;
  --k-owes: #be185d;
  --k-new-month: #0369a1;
  --k-receipts: #4d7c0f;
  --k-cards: #c2410c;
  --k-vpn: #a21caf;
}
.st-total {
  --dot: var(--k-total);
}
.st-online {
  --dot: var(--k-online);
}
.st-offline {
  --dot: var(--k-offline);
}
.st-active {
  --dot: var(--k-active);
}
.st-expiring {
  --dot: var(--k-expiring);
}
.st-expired {
  --dot: var(--k-expired);
}
.st-new {
  --dot: var(--k-new);
}
.st-suspended {
  --dot: var(--k-suspended);
}
.st-disabled {
  --dot: var(--k-disabled);
}
.st-owes {
  --dot: var(--k-owes);
}
.st-new-month {
  --dot: var(--k-new-month);
}
.st-receipts {
  --dot: var(--k-receipts);
}
.st-cards {
  --dot: var(--k-cards);
}
.st-vpn {
  --dot: var(--k-vpn);
}
/* a service's status (the list's status column, a subscriber's page): its dot in that status's colour */
.status.has-dot::before {
  border: 0;
  background: var(--dot);
}

/* control panel: status tiles, each kind in its own colour (a bar along the top, a round symbol and the number,
   on a light wash of the same colour). A number that needs action stands out more: a stronger wash and a border. */
.tiles {
  --dot: var(--text-3); /* (each tile's own st-* class gives it its colour) */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: var(--s3);
}
.tile {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 104px;
  padding: calc(var(--s3) + 4px) var(--s4) var(--s3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: inset 0 4px 0 var(--dot);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--motion-100) var(--ease-out);
}
/* (the wash: the tile's colour, faint, under its text) */
.tile::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--dot);
  opacity: 0.05;
  pointer-events: none;
}
.tile:hover {
  border-color: var(--dot);
  text-decoration: none;
}
.tile.hot {
  border-color: var(--dot);
}
.tile.hot::before {
  opacity: 0.11;
}
.tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
}
.tile-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--dot);
  color: #fff;
}
.tile-value {
  font-size: var(--text-h2);
  font-weight: var(--w-semibold);
  line-height: 1.3;
  color: var(--dot);
  font-variant-numeric: tabular-nums;
}
.tile-label {
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  color: var(--text);
}
.tile-hint {
  font-size: var(--text-meta);
  color: var(--text-2);
}
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}
.quick-actions + .summary-rows {
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid var(--hairline);
}
.summary-rows > div {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s1) 0;
  font-size: var(--text-sm);
}
.summary-rows dt {
  color: var(--text-2);
}
.summary-rows dd {
  margin: 0;
  font-weight: var(--w-medium);
}

/* subscriber page */
.service-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.service-card .head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
  padding: var(--s4);
}
.service-card .head h3 {
  font-size: var(--text-base);
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
}
.service-card .body {
  padding: 0 var(--s4) var(--s4);
}
.service-card .foot {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--hairline);
}
.feed > li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) max-content;
  gap: var(--s3);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--text-sm);
}
.feed > li:last-child {
  border-bottom: 0;
}
.feed .icon {
  color: var(--text-3);
  margin-top: 2px;
}
.feed .when {
  color: var(--text-3);
  font-size: var(--text-meta);
  white-space: nowrap;
}
.feed .note {
  margin-top: var(--s1);
  padding: var(--s2) var(--s3);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* fault finder */
.verdict {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  padding: var(--s4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.verdict.ok {
  background: var(--ok-soft);
  border-color: #c3e0cf;
}
.verdict.warn {
  background: var(--warn-soft);
  border-color: #efd8a8;
}
.verdict.bad {
  background: var(--bad-soft);
  border-color: #f1c6c2;
}
.verdict h3 {
  font-size: var(--text-base);
}
.verdict p {
  font-size: var(--text-sm);
  color: var(--text-2);
  margin-top: var(--s1);
}
.checks > li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: var(--s3);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--text-sm);
}
.checks > li:last-child {
  border-bottom: 0;
}
.checks .ok .icon {
  color: var(--ok);
}
.checks .warn .icon {
  color: #b87400;
}
.checks .bad .icon {
  color: var(--bad);
}
.checks .what {
  font-weight: var(--w-medium);
}
.checks .why {
  color: var(--text-2);
}

/* settings: section menu beside the content */
.settings-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: var(--s8);
  align-items: start;
}
.settings-nav {
  position: sticky;
  top: calc(var(--topbar-h) + var(--s4));
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-nav .group {
  margin-top: var(--s4);
  padding: 0 var(--s3) var(--s1);
  font-size: var(--text-meta);
  color: var(--text-3);
}
.settings-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: var(--s1) var(--s3);
  border-radius: var(--radius);
  color: var(--text);
  font-size: var(--text-sm);
}
.settings-nav a:hover {
  background: var(--surface-sunken);
  text-decoration: none;
}
.settings-nav a[aria-current='page'] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: var(--w-medium);
}
.settings-body {
  max-width: 720px;
  min-width: 0;
}
.settings-body.wide {
  max-width: none;
}
.setting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--hairline);
}
.setting-row:last-child {
  border-bottom: 0;
}
.danger-zone {
  margin-top: var(--s8);
  padding: var(--s4);
  border: 1px solid #f1c6c2;
  border-radius: var(--radius-lg);
  background: #fffafa;
}
.danger-zone h2 {
  font-size: var(--text-base);
  color: var(--bad);
  margin-bottom: var(--s1);
}

/* glossary */
.glossary dt {
  font-weight: var(--w-semibold);
  margin-top: var(--s4);
}
.glossary dd {
  color: var(--text-2);
  max-width: 72ch;
}
.glossary dd .example {
  display: inline-block;
  margin-top: var(--s1);
  padding: 2px var(--s2);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text);
  font-size: var(--text-sm);
}

@media (max-width: 1023.98px) {
  .two-col,
  .two-col.even {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 767.98px) {
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s2);
  }
  .tile {
    padding: calc(var(--s3) + 4px) var(--s3) var(--s3);
  }
  .tile-badge {
    width: 32px;
    height: 32px;
  }
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s4);
  }
  .settings-nav {
    position: static;
  }
  .settings-nav.as-select {
    display: none;
  }
  .global-search .search label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .feed > li {
    grid-template-columns: 24px minmax(0, 1fr);
  }
  .feed .when {
    grid-column: 2;
  }
}

/* ---- Settings → Subscription (first-contact screen: website feel) ------- */
.sub-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: var(--s6);
  padding: var(--s6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(to left, rgba(251, 250, 247, 0) 0%, var(--surface) 62%),
    url('/img/pattern.svg') repeat,
    var(--surface);
}
[dir='ltr'] .sub-hero {
  background:
    linear-gradient(to right, rgba(251, 250, 247, 0) 0%, var(--surface) 62%),
    url('/img/pattern.svg') repeat,
    var(--surface);
}
.sub-hero-main {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  min-width: 0;
}
.sub-hero h2 {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--text-h1);
  line-height: 1.3;
}
.sub-hero p {
  max-width: 62ch;
}
.sub-hero-meter {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  max-width: 420px;
}
.sub-hero-code {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s2);
  padding: var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  align-self: start;
}
.sub-hero-code .label {
  display: flex;
  align-items: center;
  gap: var(--s1);
  color: var(--text-2);
  font-size: var(--text-sm);
}
.sub-hero-code .code-value {
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
.usage-row {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}
.sub-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s3);
}
.sub-head h2 {
  font-size: var(--text-h2);
}
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s4);
}
.price-card {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.price-card.popular {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.price-card.current {
  border-color: var(--ok);
  background: var(--ok-soft);
}
.price-card h3 {
  font-size: var(--text-h3);
}
.price-card .price {
  min-height: 44px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s1);
}
.price-card .amount {
  font-size: var(--text-h1);
  font-weight: var(--w-semibold);
  color: var(--text);
}
.price-card .per,
.price-card .ask {
  color: var(--text-2);
  font-size: var(--text-sm);
}
.price-card .btn {
  margin-top: auto;
}
.price-list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
}
.price-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
}
.price-list li .icon {
  flex: none;
  margin-top: 3px;
  color: var(--ok);
}
.price-list li.no {
  color: var(--text-2);
}
.price-list li.no .icon {
  color: var(--bad);
}
.price-list li.note .icon {
  color: var(--warn);
}
.tag.accent {
  background: var(--accent-soft);
  color: var(--accent);
}
.compare-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
}
.compare-2 > div {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.compare-2 h3 {
  font-size: var(--text-base);
}
.request-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.request-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s3);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--hairline);
}
.request-list li:first-child {
  padding-top: 0;
}
.request-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
/* where to send the subscription money: one row per account, with a copy button */
.pay-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pay-list li,
.pay-to {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
}
.pay-list li + li {
  border-top: 1px solid var(--hairline);
}
.pay-to {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pay-details {
  display: block;
  white-space: pre-line;
  overflow-wrap: anywhere;
  font-size: var(--text-base);
}
@media (max-width: 767.98px) {
  .sub-hero {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--s4);
    gap: var(--s4);
  }
  .sub-hero h2 {
    font-size: var(--text-h2);
  }
  .sub-hero-code {
    align-self: stretch;
  }
  .compare-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .contact-row .btn {
    flex: 1 1 140px;
  }
}

/* ---------------------------------------------------------------- connect a router with one line */
.code-line {
  display: grid;
  gap: var(--s3);
}
.code-line pre {
  margin: 0;
  padding: var(--s4);
  direction: ltr;
  text-align: left;
  background: var(--navy-900);
  color: #e6e1d6;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 220px;
  overflow: auto;
}
.pic-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.pic-steps li {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}
.pic-steps svg {
  display: block;
  width: 100%;
  height: auto;
  direction: ltr;
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 9px;
}
.pic-steps .cap {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  font-size: var(--text-sm);
}
.pic-steps .cap .n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--text-meta);
  font-weight: var(--w-semibold);
}
.pic-steps .pw {
  fill: var(--surface);
  stroke: var(--border-strong);
}
.pic-steps .pb {
  fill: var(--navy-700);
}
.pic-steps .pdot {
  fill: var(--on-dark-2);
}
.pic-steps .pf {
  fill: var(--surface);
  stroke: var(--border-strong);
}
.pic-steps .pm {
  fill: var(--surface-sunken);
}
.pic-steps .pd {
  fill: var(--navy-900);
}
.pic-steps .pa {
  fill: var(--accent);
}
.pic-steps .pl {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 3;
  stroke-linecap: round;
}
.pic-steps .pcur {
  fill: #e6e1d6;
}
.pic-steps .pkey {
  fill: var(--surface);
  stroke: var(--border-strong);
}
.pic-steps .pt {
  fill: var(--text-2);
}
.pic-steps .pt-dim {
  fill: var(--text-3);
}
.pic-steps .pt-light {
  fill: var(--on-dark);
}
.pic-steps .pt-on {
  fill: var(--on-accent);
  font-weight: var(--w-semibold);
}
.pic-steps .pt-term {
  fill: #9fd6a8;
}
.pic-steps .pt-code {
  fill: #e6e1d6;
}
.pic-steps .pt-key {
  fill: var(--text);
  font-weight: var(--w-semibold);
}
.marks {
  display: grid;
  gap: var(--s4);
  margin: 0;
  padding: 0;
  list-style: none;
}
.marks li {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  color: var(--text-3);
}
.marks .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
}
.marks .mark .spinner {
  width: 14px;
  height: 14px;
}
.marks .t {
  display: flex;
  align-items: center;
  gap: var(--s1);
  min-height: 28px;
}
.marks .d {
  font-size: var(--text-sm);
  color: var(--text-2);
}
.marks li.done,
.marks li.now,
.marks li.bad {
  color: var(--text);
}
.marks li.done .mark {
  background: var(--ok-soft);
  border-color: transparent;
  color: var(--ok);
}
.marks li.now .mark {
  border-color: var(--accent);
  color: var(--accent);
}
.marks li.now .t,
.marks li.bad .t {
  font-weight: var(--w-medium);
}
.marks li.bad .mark {
  background: var(--bad-soft);
  border-color: transparent;
  color: var(--bad);
}
@media (max-width: 767.98px) {
  .pic-steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .pic-steps li {
    flex-direction: row;
    align-items: center;
    gap: var(--s3);
  }
  .pic-steps svg {
    flex: none;
    width: 132px;
  }
}

/* ---------------------------------------------------------------- VPN page */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--s3);
}
.app-tile {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 64px;
  padding: var(--s2) var(--s4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.app-tile.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.app-tile .ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text-2);
}
.app-tile.on .ico {
  background: var(--surface);
  color: var(--accent);
}
.app-tile .name {
  flex: 1;
  min-width: 0;
  font-weight: var(--w-medium);
}
.app-tile .switch {
  min-height: 0;
}
.app-grid.muted-grid .app-tile {
  cursor: default;
  opacity: 0.6;
}
.pick-list {
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 52vh;
  overflow: auto;
}
.pick-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s4);
  min-height: 56px;
  border-bottom: 1px solid var(--hairline);
}
.pick-row:last-child {
  border-bottom: 0;
}
.row-check {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}
/* shown above a list while rows are ticked: how many, widen the choice, and what to do with them */
.select-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s2) var(--s3);
  padding: var(--s2) var(--s3);
  margin-bottom: var(--s3);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.skip-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
}
.skip-list li {
  padding: var(--s1) 0;
  border-bottom: 1px solid var(--hairline);
}
.skip-list li:last-child {
  border-bottom: 0;
}

/* ---------------------------------------------------------------- router monitor */
.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--s4);
  align-items: start;
}
.monitor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  min-width: 0;
}
.monitor-card .head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s4);
  border-bottom: 1px solid var(--hairline);
}
.monitor-card .head h2 {
  font-size: var(--text-h3);
  margin-bottom: var(--s1);
}
.monitor-card .body {
  padding: var(--s4);
}
.monitor-card .live {
  padding: var(--s3);
  border-radius: var(--radius);
  background: var(--surface-muted);
}
.dl.compact {
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  gap: var(--s1) var(--s3);
}
.traffic-list,
.event-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--s1);
  font-size: var(--text-sm);
}
.traffic-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--s3);
  align-items: baseline;
}
.event-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
}
@media (max-width: 767.98px) {
  .monitor-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------------------------------------------------------------- remote access */
.door {
  display: grid;
  gap: var(--s3);
  padding: var(--s4);
  border: 1px solid var(--ok);
  border-radius: var(--radius);
  background: var(--ok-soft);
}
.door-address {
  padding: var(--s3) var(--s4);
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: var(--text-h3);
  overflow-wrap: anywhere;
  direction: ltr;
  text-align: left;
}

/* ---- emails: a message shown inside a screen, and the screens that edit it (also in the vendor portal) ---- */
.mail-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s6);
  align-items: start;
}
.mail-cols.wide {
  grid-template-columns: minmax(0, 9fr) minmax(0, 11fr);
}
.mail-side {
  position: sticky;
  top: calc(var(--topbar-h) + var(--s4));
}
@media (max-width: 1439.98px) {
  .mail-cols:not(.wide) {
    grid-template-columns: minmax(0, 1fr);
  }
  .mail-cols:not(.wide) > .mail-side {
    position: static;
  }
}
@media (max-width: 1099.98px) {
  .mail-cols.wide {
    grid-template-columns: minmax(0, 1fr);
  }
  .mail-cols.wide > .mail-side {
    position: static;
  }
}
.mail-list {
  margin-top: var(--s3);
  border-top: 1px solid var(--hairline);
}
/* a text is typed in its own direction, whatever the portal's language */
.mail-words[data-lang='ar'] .input,
.mail-words[data-lang='ar'] .textarea {
  direction: rtl;
  text-align: right;
}
.mail-words[data-lang='en'] .input,
.mail-words[data-lang='en'] .textarea {
  direction: ltr;
  text-align: left;
}
.mail-word {
  min-height: 32px;
  padding: 0 var(--s3);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-sm);
}
.mail-word:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.mail-view {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.mail-view-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding-block: var(--s2);
  padding-inline: var(--s4) var(--s2);
  border-bottom: 1px solid var(--border);
}
.mail-view-head .subject {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  overflow-wrap: anywhere;
}
.mail-view-head .icon-btn[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.mail-view-note {
  padding: var(--s2) var(--s4);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--text-sm);
}
.mail-view-scroll {
  position: relative;
  height: min(720px, calc(100vh - 280px));
  min-height: 380px;
  overflow-x: hidden;
  overflow-y: scroll;
  background: var(--surface-sunken);
}
.mail-view.tall .mail-view-scroll {
  height: calc(100vh - 200px);
}
.mail-view-scroll .sheet {
  position: relative;
  margin-inline: auto;
  overflow: hidden;
}
.mail-view-scroll iframe {
  display: block;
  border: 0;
  transform-origin: 0 0;
}
.mail-view-scroll iframe.next {
  position: absolute;
  top: 0;
  left: 0;
  visibility: hidden;
}
.mail-view-wait {
  display: flex;
  justify-content: center;
  padding: var(--s12);
}
.mail-test {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s3);
  align-items: start;
}
.mail-test .btn {
  margin-top: 28px;
}
.mail-logo {
  max-width: 140px;
  max-height: 56px;
  object-fit: contain;
}
.mail-color {
  display: grid;
  gap: var(--s3);
}
.mail-color .input {
  max-width: 200px;
}
.mail-color-pick {
  width: 44px;
  height: 44px;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.mail-swatch {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--border-strong);
}
.mail-swatch[aria-pressed='true'] {
  box-shadow: 0 0 0 2px var(--text);
}
.mail-said {
  margin-top: var(--s2);
  overflow-wrap: anywhere;
}
.mail-form {
  max-width: 760px;
}
@media (max-width: 479.98px) {
  .mail-test {
    grid-template-columns: minmax(0, 1fr);
  }
  .mail-test .btn {
    margin-top: 0;
  }
}

/* the subscriber list: a row's actions as icons in fixed places, and the dot that says who is online */
.row-icons {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.row-icons .icon-btn {
  width: 36px;
  height: 36px;
}
.row-icons .icon-btn.danger:hover {
  color: var(--bad);
}
.row-icons .icon-gap {
  display: inline-block;
  width: 36px;
  height: 36px;
  flex: none;
}
.online-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-inline-end: 6px;
  border-radius: 50%;
  background: var(--k-online);
  vertical-align: middle;
}
.online-dot.off {
  background: var(--k-offline);
}
.boost-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
}
.table .sub.boost-line {
  display: flex;
}
/* the actions stay in view at the row's end when a screen is not wide enough for every column (the row's menu opens
   in a layer of its own, so a pinned cell cannot cover it) */
@media (min-width: 768px) {
  .table th.col-actions,
  .table td.col-actions {
    position: sticky;
    inset-inline-end: 0;
  }
  .table td.col-actions {
    background: var(--surface);
  }
}
/* below 1536 px (laptops of 1280 to 1440 px): the column that only fits on a wide screen goes, and the list packs tighter */
@media (max-width: 1535.98px) {
  .hide-mid {
    display: none !important;
  }
  .row-icons .icon-btn,
  .row-icons .icon-gap {
    width: 32px;
  }
}
/* (on a phone the rows are cards with their own spacing) */
@media (min-width: 768px) and (max-width: 1535.98px) {
  .table:has(td.col-actions) th,
  .table:has(td.col-actions) td {
    padding-inline: var(--s3);
  }
}

/* the subscriber's name in the list: a step bigger and bolder than the rest of the row, so the eye finds it first */
.table .sub-name {
  font-size: var(--text-base);
  font-weight: var(--w-semibold);
  color: var(--text);
  line-height: 1.35;
}
/* (a wide screen: room for a two-word name on one line before the other columns share what is left) */
@media (min-width: 1360px) {
  .table td.name-cell {
    min-width: 168px;
  }
}
/* (a laptop or tablet: every column is already at its narrowest, so the name grows a little less, and the list
   never has to slide sideways) */
@media (min-width: 768px) and (max-width: 1359.98px) {
  .table .sub-name {
    font-size: 0.9375rem;
  }
}
@media (max-width: 767.98px) {
  .table .sub-name {
    font-size: 1.0625rem;
  }
}
/* under the list: show the subscriber codes or not (kept for this person, on every device) */
.codes-pick {
  min-height: 36px;
  color: var(--text-2);
}

/* a subscriber's connection, under the login name: online (green), offline for how long, never connected */
.conn.on {
  color: var(--ok);
}
.conn.off {
  color: var(--text-2);
}
.conn.never {
  color: var(--text-3);
}
.reduced,
.table .sub.reduced {
  color: var(--warn);
}

/* the status buttons above the subscriber list: one tap for each status, with how many there are */
.state-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s3);
}
.state-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 var(--s3);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
  white-space: nowrap;
  cursor: pointer;
}
.state-chip:hover {
  background: var(--surface-sunken);
}
.state-chip:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.state-chip .n {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
/* (each status's dot in its own colour, the same as its tile on the control panel: see --k-* at the top) */
.state-chip.has-dot::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot, var(--border-strong));
}
.state-chip[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.state-chip[aria-pressed='true']:hover {
  background: var(--accent-hover);
}
.state-chip[aria-pressed='true'] .n {
  color: inherit;
}
.state-chip[aria-pressed='true']::before {
  background: currentColor;
}
.toolbar .router-pick {
  width: auto;
  flex: 0 1 220px;
}
/* a phone: the row's lines under the name, and its main actions as buttons in a bar at the bottom */
.card-lines .line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  min-height: 24px;
  font-size: var(--text-sm);
}
.phone-bar {
  display: flex;
  align-items: center;
  gap: var(--s2);
}
@media (max-width: 767.98px) {
  .table.stacked td.card-lines {
    display: block;
    padding-top: var(--s1);
  }
  .table.stacked td.bar-narrow {
    position: static;
    display: block;
    margin-top: var(--s2);
  }
  /* (the bar runs the card's whole width, under the tick box too) */
  .table.stacked.has-pick td.bar-narrow {
    margin-inline-start: -32px;
  }
  /* (no menu in the row's corner any more: the name has the whole width) */
  .table.stacked td.name-cell,
  .table.stacked.has-pick td.name-cell {
    padding-inline-end: 0;
  }
  /* the status buttons stay on one line, and slide sideways */
  .state-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: calc(-1 * var(--s4));
    padding-inline: var(--s4);
    scrollbar-width: none;
  }
  .state-chips::-webkit-scrollbar {
    display: none;
  }
  .toolbar .router-pick {
    flex: 1 1 160px;
  }
}

/* small choices side by side (a speed, a number of hours) */
.pick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}
.pick-chips .radio-card {
  flex: 1 1 96px;
  align-items: center;
  padding: var(--s2) var(--s3);
}
.pick-chips .radio-card input {
  margin-top: 0;
}
