/**
 * Telno console — the design system for every product in the family.
 *
 * One stylesheet, served by both consoles, so the T54W desk-phone console and
 * the HT802 adapter console cannot drift into two design languages. Product
 * specifics live in each product's own /styles.css; anything both products use
 * belongs here.
 *
 * No build step, no dependencies, no resets-by-framework: the vocabulary below
 * is the whole UI language.
 */

/* ── tokens ────────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  --accent: #7c6bff;
  --accent-strong: #9488ff;
  --accent-soft: rgba(124, 107, 255, 0.14);

  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, 0.13);
  --warn: #f2b544;
  --warn-soft: rgba(242, 181, 68, 0.13);
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, 0.13);
  --info: #5cc8ff;
  --info-soft: rgba(92, 200, 255, 0.12);

  --bg: #08080d;
  --bg-glow: radial-gradient(1100px 520px at 12% -12%, rgba(124, 107, 255, 0.13), transparent 62%);
  --surface: #101018;
  --surface-2: #15151f;
  --surface-3: #1b1b27;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);

  --text: #ecebf3;
  --text-2: #a9a7bb;
  --text-3: #6f6d82;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --sidebar: 244px;
  --pad: 22px;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ── base ──────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font: 14px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: var(--accent-strong);
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 40;
  background: var(--surface-3);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.skip:focus {
  left: 8px;
}

/* ── shell ─────────────────────────────────────────────────────────────── */

.app {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(21, 21, 31, 0.9), rgba(13, 13, 20, 0.82));
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 14px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 16px;
  color: #fff;
  background: linear-gradient(140deg, var(--accent), #4d3fd1);
  box-shadow: 0 8px 20px -10px var(--accent);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.brand-name {
  font-weight: 650;
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-label {
  margin: 14px 8px 6px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-item[aria-current="page"] {
  color: #fff;
  background: var(--accent-soft);
  border-color: rgba(124, 107, 255, 0.34);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-ico {
  width: 16px;
  font-size: 12px;
  text-align: center;
  opacity: 0.75;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  font-size: 11px;
  text-align: center;
}

.nav-badge:empty {
  display: none;
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 11.5px;
}

.sidebar-foot .mono {
  width: 100%;
  color: var(--text-3);
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px var(--pad);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 13, 0.82);
  backdrop-filter: blur(10px);
}

.topbar-lead {
  min-width: 0;
}

.topbar h1 {
  font-size: 17px;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.topbar-sub {
  margin-top: 1px;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stamp {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}

.view {
  padding: var(--pad);
  max-width: 1360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── layout helpers ────────────────────────────────────────────────────── */

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

@media (max-width: 1180px) {
  .cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

.inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spacer,
.grow {
  flex: 1;
}

.right {
  text-align: right;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--mono);
  font-size: 0.94em;
}

.small {
  font-size: 12.5px;
}

.muted {
  color: var(--text-2);
}

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

.nowrap {
  white-space: nowrap;
}

/* ── section heading ───────────────────────────────────────────────────── */

.section {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 4px;
}

.section h2 {
  font-size: 13.5px;
  font-weight: 620;
  letter-spacing: -0.005em;
}

.section .hint {
  font-size: 12px;
  color: var(--text-3);
}

/* ── cards ─────────────────────────────────────────────────────────────── */

.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.card-head .title {
  font-size: 13px;
  font-weight: 620;
}

.card-head .sub {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-3);
  text-align: right;
}

.card-body {
  padding: 14px 16px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.16);
}

.card.flush .card-head {
  border-bottom: 1px solid var(--line);
}

/*
 * Key/value lists and tables are full-bleed inside a card. A paragraph, notice
 * or code block placed directly under .card is not, so it gets the card's
 * gutter here rather than every view remembering to add one.
 */
.card > .banner,
.card > .pre,
.card > .inline,
.card > .stack,
.card > p,
.card > .small {
  margin: 12px 16px;
}

.card > :last-child:not(.kv):not(.table):not(.card-actions) {
  margin-bottom: 16px;
}

/* ── hero ──────────────────────────────────────────────────────────────── */

.hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(124, 107, 255, 0.12), transparent 58%), var(--surface);
  box-shadow: var(--shadow);
}

.hero-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 14px;
  font-size: 20px;
  background: linear-gradient(140deg, var(--accent), #4a3cc9);
  box-shadow: 0 12px 26px -16px var(--accent);
}

.hero h2 {
  font-size: 17px;
  font-weight: 640;
  letter-spacing: -0.01em;
}

.hero p {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-2);
}

.hero-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── stats ─────────────────────────────────────────────────────────────── */

.stat {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
}

.stat .label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.stat .value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 640;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.stat .foot {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-2);
}

/* ── key/value lists ───────────────────────────────────────────────────── */

.kv {
  display: flex;
  flex-direction: column;
}

.kv-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.kv-row:first-child {
  border-top: 0;
}

.kv-row .k {
  color: var(--text-3);
  white-space: nowrap;
}

.kv-row .v {
  margin-left: auto;
  max-width: 66%;
  text-align: right;
  overflow-wrap: anywhere;
}

.card-body > .kv {
  margin: -8px -16px;
}

/* ── tables ────────────────────────────────────────────────────────────── */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  position: sticky;
  top: 0;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-3);
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.scroll {
  overflow: auto;
}

/* ── pills, chips, dots ────────────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  font-size: 11.5px;
  white-space: nowrap;
}

.pill.ok,
.pill.good {
  border-color: rgba(61, 220, 151, 0.34);
  background: var(--ok-soft);
  color: var(--ok);
}

.pill.warn {
  border-color: rgba(242, 181, 68, 0.34);
  background: var(--warn-soft);
  color: var(--warn);
}

.pill.bad {
  border-color: rgba(255, 107, 107, 0.34);
  background: var(--bad-soft);
  color: var(--bad);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}

.chip.ok {
  color: var(--ok);
  border-color: rgba(61, 220, 151, 0.3);
  background: var(--ok-soft);
}

.chip.warn {
  color: var(--warn);
  border-color: rgba(242, 181, 68, 0.3);
  background: var(--warn-soft);
}

.chip.bad {
  color: var(--bad);
  border-color: rgba(255, 107, 107, 0.3);
  background: var(--bad-soft);
}

.chip.live {
  color: #fff;
  border-color: rgba(92, 200, 255, 0.4);
  background: rgba(92, 200, 255, 0.16);
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.dot.pulse {
  animation: pulse 1.8s var(--ease) infinite;
}

.dot.ok {
  color: var(--ok);
}

.dot.bad {
  color: var(--bad);
}

.dot.warn {
  color: var(--warn);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

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

/* ── banners ───────────────────────────────────────────────────────────── */

.banner {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--text-3);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
}

.banner > [aria-hidden="true"] {
  line-height: 1.35;
  font-weight: 700;
  color: var(--text-2);
}

.banner.warn > [aria-hidden="true"] {
  color: var(--warn);
}

.banner.bad > [aria-hidden="true"] {
  color: var(--bad);
}

.banner.info > [aria-hidden="true"] {
  color: var(--info);
}

.banner strong {
  color: var(--text);
  font-weight: 600;
}

.banner.info {
  border-left-color: var(--info);
  background: var(--info-soft);
}

.banner.warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.banner.bad {
  border-left-color: var(--bad);
  background: var(--bad-soft);
}

/*
 * Block, not a flex column: banner copy is prose with inline code in it, and a
 * flex container turned every <span class="mono"> into its own row.
 */
.banner .banner-body {
  min-width: 0;
}

.banner .banner-body > * + * {
  margin-top: 6px;
}

.banner ul {
  margin: 2px 0 0;
  padding-left: 16px;
}

.banner li {
  margin: 1px 0;
}

.banner .btn {
  margin-left: auto;
  flex: 0 0 auto;
}

/* A banner that lists several findings can be collapsed to one line. */
.banner details > summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  list-style: none;
}

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

.banner details > summary::after {
  content: " ▾";
  color: var(--text-3);
}

.banner details[open] > summary::after {
  content: " ▴";
}

/* ── buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.btn:hover:not(:disabled) {
  background: #232332;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

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

.btn.primary {
  border-color: transparent;
  background: linear-gradient(140deg, var(--accent), #574ad6);
  color: #fff;
  box-shadow: 0 12px 26px -16px var(--accent);
}

.btn.primary:hover:not(:disabled) {
  background: linear-gradient(140deg, var(--accent-strong), #6659e6);
}

.btn.danger {
  border-color: rgba(255, 107, 107, 0.4);
  background: var(--bad-soft);
  color: #ffb4b4;
}

.btn.danger:hover:not(:disabled) {
  background: rgba(255, 107, 107, 0.2);
}

.btn.ghost {
  background: transparent;
}

.btn.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.btn.sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.icon-btn:hover {
  background: #232332;
  color: var(--text);
}

/* ── forms ─────────────────────────────────────────────────────────────── */

.input,
.select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.input::placeholder {
  color: var(--text-3);
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.select {
  appearance: none;
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%),
    linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% + 2px), calc(100% - 11px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.copy {
  display: flex;
  gap: 8px;
  padding: 0 16px;
}

.copy .input {
  font-family: var(--mono);
  font-size: 12px;
}

/* ── empty states ──────────────────────────────────────────────────────── */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 30px 20px;
  color: var(--text-2);
  font-size: 12.5px;
  text-align: center;
}

.empty .icon {
  font-size: 20px;
  opacity: 0.5;
}

.empty strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

/* ── rows (call lists, contacts) ───────────────────────────────────────── */

.list {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
}

.row:first-child {
  border-top: 0;
}

.row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.row .dir {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
}

.row .dir.missed {
  background: var(--bad-soft);
  color: var(--bad);
}

.row .dir.received {
  background: var(--ok-soft);
  color: var(--ok);
}

.row-main {
  min-width: 0;
  flex: 1;
}

.row-title {
  font-size: 13px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-sub {
  font-size: 11.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  font-size: 11.5px;
  color: var(--text-2);
  text-align: right;
  white-space: nowrap;
}

/* ── code ──────────────────────────────────────────────────────────────── */

.pre {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #0a0a11;
  color: #cfcde0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  overflow: auto;
  max-height: 420px;
  white-space: pre;
}

/* ── toasts and modal ──────────────────────────────────────────────────── */

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(420px, calc(100vw - 36px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius);
  background: var(--surface-3);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.95);
  font-size: 12.5px;
  animation: toast-in 0.2s var(--ease);
}

.toast.bad {
  border-left-color: var(--bad);
}

.toast.good {
  border-left-color: var(--ok);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 4, 8, 0.72);
  backdrop-filter: blur(3px);
}

.modal {
  width: min(440px, 100%);
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: 0 30px 70px -30px #000;
}

.modal h3 {
  font-size: 15px;
  font-weight: 620;
}

.modal p {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-2);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ── a labelled input, in a dialog or in a card ─────────────────────────── */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.field > span {
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}

.field .input {
  width: 100%;
}

/* ── skeleton ──────────────────────────────────────────────────────────── */

.skeleton {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05));
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.sk-card {
  height: 120px;
}

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

/* ── dial screen ───────────────────────────────────────────────────────── */

.grid.dial {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

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

.dial-number {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.28);
}

.dial-number .value {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 24px;
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dial-number .value.empty {
  color: var(--text-3);
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: 0;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 16px 0;
}

.key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 12px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  transition: background 0.12s var(--ease), transform 0.1s var(--ease);
}

.key:hover {
  background: #232332;
}

.key:active {
  transform: scale(0.97);
}

.key small {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--text-3);
}

.dial-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 16px 16px;
}

.dial-actions .btn {
  padding: 11px 14px;
  font-size: 14px;
}

/* ── port cards (adapter consoles) ─────────────────────────────────────── */

.port-card .port-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.port-no {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12.5px;
  font-weight: 600;
}

.port-card .port-actions {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.16);
}

/* ── diagnostic output ─────────────────────────────────────────────────── */

.diag {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-2);
}

.diag-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diag-msg {
  margin-top: 6px;
  color: var(--text);
}

.diag-meta {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-3);
}

.bad-text {
  color: var(--bad);
}

/* ── pager ─────────────────────────────────────────────────────────────── */

.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.16);
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-btn {
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
}

.chip-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.chip-btn[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: rgba(124, 107, 255, 0.4);
  color: #fff;
}
