:root {
  --bg: #071018;
  --bg-2: #0d1f29;
  --panel: rgba(12, 27, 35, 0.82);
  --panel-border: rgba(165, 210, 205, 0.12);
  --text: #edf6f4;
  --muted: #93b2b0;
  --accent: #52ddb4;
  --accent-2: #f0b15e;
  --danger: #f86f67;
  --radius: 22px;
  --font: "Avenir Next", "Segoe UI", "IBM Plex Sans", sans-serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(circle at 20% 0%, rgba(82, 221, 180, 0.2), transparent 28%),
    radial-gradient(circle at 100% 20%, rgba(240, 177, 94, 0.16), transparent 20%),
    linear-gradient(150deg, #061019 0%, #0b1822 50%, #132733 100%);
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 290px 1fr;
  overflow: hidden;
}

.sidebar {
  height: 100vh;
  padding: 26px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(5, 14, 20, 0.55);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: auto;
}

.brand { margin: 8px 0 0; font-size: 2rem; line-height: 0.95; }
.sidebar-copy { color: var(--muted); line-height: 1.5; margin-top: 14px; }
.eyebrow { margin: 0; color: var(--accent); text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; }

.nav { display: grid; gap: 8px; margin-top: 30px; }

.nav-item,
button,
.logout-link {
  border: 0;
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
}

.nav-item {
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(82, 221, 180, 0.24), rgba(82, 221, 180, 0.08));
  border: 1px solid rgba(82, 221, 180, 0.22);
}

.sidebar-footer { display: grid; gap: 12px; }
.user-badge { padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,0.04); color: var(--muted); }
.logout-link { text-decoration: none; color: var(--text); background: rgba(255,255,255,0.06); text-align: center; }

.main {
  padding: 24px;
  overflow-y: auto;
  min-height: 0;
}
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
h1,h2,h3,p,pre { margin: 0; }

.notice-bar {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.05);
}

.notice-bar.info {
  border-color: rgba(82, 221, 180, 0.18);
  background: rgba(82, 221, 180, 0.08);
}

.notice-bar.success {
  border-color: rgba(82, 221, 180, 0.24);
  background: rgba(82, 221, 180, 0.12);
}

.notice-bar.error {
  border-color: rgba(248, 111, 103, 0.3);
  background: rgba(248, 111, 103, 0.12);
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.04);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 6px rgba(240, 177, 94, 0.14);
}

.hero-status.ok .dot { background: var(--accent); box-shadow: 0 0 0 6px rgba(82, 221, 180, 0.14); }
.hero-status.bad .dot { background: var(--danger); box-shadow: 0 0 0 6px rgba(248, 111, 103, 0.16); }

button {
  color: #06222b;
  background: linear-gradient(135deg, var(--accent), #9cf0db);
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

button.ghost { color: var(--text); background: rgba(255,255,255,0.06); }
button.danger { color: #fff5f4; background: rgba(248, 111, 103, 0.28); }

.view { display: none; margin-top: 18px; }
.view.active { display: block; }

.overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.panel,
.metric-card,
.listener-card,
.generic-card {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.metric-card { padding: 18px 20px; }
.metric-card .label { color: var(--muted); }
.metric-card .value { margin-top: 8px; font-size: 1.9rem; font-weight: 700; }

.panel-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.capacity-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.capacity-health-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.capacity-health-top strong {
  display: block;
  margin-top: 8px;
  font-size: 1.15rem;
}

.capacity-health-detail,
.capacity-cell-meta,
.capacity-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.config-import-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.config-import-summary > div {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.import-conflict-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.import-conflict-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(240, 177, 94, 0.22);
  background: rgba(240, 177, 94, 0.07);
}

.import-conflict-row > span {
  display: grid;
  gap: 4px;
}

.import-conflict-row small {
  color: var(--muted);
}

.update-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.update-panel-head h3 {
  margin-top: 6px;
}

.update-phase {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  font-weight: 700;
}

.update-phase.success {
  color: #b9f7df;
  border-color: rgba(82, 221, 180, 0.24);
  background: rgba(82, 221, 180, 0.1);
}

.update-phase.error {
  color: #ffd2ce;
  border-color: rgba(248, 111, 103, 0.26);
  background: rgba(248, 111, 103, 0.1);
}

.update-status-card {
  display: grid;
  gap: 8px;
  margin-top: 15px;
  padding: 14px;
  border-radius: 15px;
  background: rgba(255,255,255,0.035);
  border-left: 3px solid rgba(147, 178, 176, 0.5);
}

.update-status-card.success {
  border-left-color: var(--accent);
}

.update-status-card.error {
  border-left-color: var(--danger);
}

.update-status-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 12px;
}

.update-test-output {
  margin-top: 14px;
  color: var(--muted);
}

.update-test-output summary {
  cursor: pointer;
}

.update-test-output pre {
  max-height: 320px;
  margin-top: 10px;
  padding: 12px;
  overflow: auto;
  border-radius: 14px;
  background: rgba(3, 13, 19, 0.35);
  font-size: 11px;
  white-space: pre-wrap;
}

.capacity-meter {
  margin-top: 12px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
}

.capacity-meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(82, 221, 180, 0.95), rgba(156, 240, 219, 0.95));
}

.capacity-meter.warn .capacity-meter-fill {
  background: linear-gradient(90deg, rgba(240, 177, 94, 0.95), rgba(255, 228, 161, 0.95));
}

.capacity-meter.bad .capacity-meter-fill {
  background: linear-gradient(90deg, rgba(248, 111, 103, 0.95), rgba(255, 177, 170, 0.95));
}

.capacity-table-wrap {
  overflow: auto;
  border-radius: 18px;
}

.capacity-table td {
  min-width: 100px;
}

.capacity-pressure {
  display: inline-flex;
  min-width: 82px;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.capacity-pressure.ok {
  border-color: rgba(82, 221, 180, 0.18);
  background: rgba(82, 221, 180, 0.08);
}

.capacity-pressure.warn {
  border-color: rgba(240, 177, 94, 0.18);
  background: rgba(240, 177, 94, 0.08);
}

.capacity-pressure.bad {
  border-color: rgba(248, 111, 103, 0.2);
  background: rgba(248, 111, 103, 0.1);
}

.diagnostics-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
}

.diagnostics-port-panel,
.diagnostics-detail-panel {
  min-height: calc(100vh - 140px);
}

.diagnostics-detail-panel {
  overflow: hidden;
}

.diagnostic-port-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 240px);
  overflow: auto;
}

.visor-port-search {
  margin-bottom: 10px;
}

.diagnostic-port-item {
  width: 100%;
  text-align: left;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.diagnostic-port-item.active {
  border-color: rgba(82, 221, 180, 0.24);
  background: rgba(82, 221, 180, 0.1);
}

.panel { padding: 22px; }
.panel-wide { grid-column: 1 / -1; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }

.feed {
  max-height: 520px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.feed-item,
.file-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
}

.feed-item .top,
.file-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.feed-item .body { margin-top: 6px; line-height: 1.45; }

.alert-item.critical {
  border-left: 4px solid #f86f67;
  background: rgba(248, 111, 103, 0.08);
}

.alert-item.warning {
  border-left: 4px solid #f7c66b;
  background: rgba(247, 198, 107, 0.08);
}

.alert-item.info {
  border-left: 4px solid #58a6ff;
  background: rgba(88, 166, 255, 0.08);
}

.compact-select {
  min-width: 180px;
}

.listeners-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

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

.listener-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.listener-table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.06);
}

.listener-table {
  min-width: 980px;
}

.listener-table tbody tr {
  transition: background 160ms ease;
}

.listener-table tbody tr:hover,
.listener-table tbody tr.active {
  background: rgba(82, 221, 180, 0.06);
}

.listener-table .listener-status {
  min-width: 92px;
  padding: 6px 10px;
  font-size: 12px;
}

.icon-button {
  min-width: 76px;
  padding: 9px 11px;
}

.refresh-paused-badge {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #ffefcf;
  border: 1px solid rgba(240, 177, 94, 0.22);
  background: rgba(240, 177, 94, 0.1);
  font-size: 12px;
  font-weight: 700;
}

.listener-edit-panel {
  margin-top: 16px;
}

.sampled-status {
  color: var(--muted);
  font-size: 12px;
}

.exporter-choice-field {
  display: grid;
  gap: 8px;
}

.exporter-choice-field > span {
  color: var(--muted);
  font-size: 12px;
}

.exporter-choice-field > small {
  color: var(--muted);
  line-height: 1.45;
}

.exporter-choice-grid {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(3, 13, 19, 0.22);
}

.exporter-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 13px;
  background: rgba(255,255,255,0.035);
  border: 1px solid transparent;
}

.exporter-choice:has(input:checked) {
  border-color: rgba(82, 221, 180, 0.28);
  background: rgba(82, 221, 180, 0.08);
}

.exporter-choice.disabled {
  opacity: 0.62;
}

.exporter-choice input {
  width: 18px;
  height: 18px;
}

.exporter-choice span,
.exporter-choice strong,
.exporter-choice small {
  min-width: 0;
}

.exporter-choice span {
  display: grid;
  gap: 3px;
}

.exporter-choice small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exporter-choice em {
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.exporter-choice-empty {
  padding: 14px;
  color: var(--muted);
  text-align: center;
}

.exporters-shell {
  display: grid;
  grid-template-columns: minmax(360px, 500px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.exporters-list-panel,
.exporters-editor-panel {
  min-height: 520px;
}

.exporters-list-panel {
  position: sticky;
  top: 0;
}

.exporter-list {
  display: grid;
  gap: 9px;
  max-height: calc(100vh - 250px);
  margin-top: 14px;
  overflow: auto;
  padding-right: 4px;
}

.exporter-row {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 14px;
  color: var(--text);
  text-align: left;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.035);
}

.exporter-row:hover,
.exporter-row.active {
  border-color: rgba(82, 221, 180, 0.28);
  background: rgba(82, 221, 180, 0.08);
}

.exporter-row-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.exporter-row-main small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exporter-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.exporter-row-meta em,
.exporter-row-meta b,
.exporter-row-meta i {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  font-size: 11px;
  font-style: normal;
}

.exporter-row-meta i.ok {
  color: #a8f5d9;
  background: rgba(82, 221, 180, 0.1);
}

.exporter-row-meta i.bad {
  color: #ffd2ce;
  background: rgba(248, 111, 103, 0.12);
}

.exporter-empty-state {
  min-height: 460px;
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
}

.exporter-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.exporter-stat-strip > div {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
}

.exporter-stat-strip span,
.exporter-runtime-note span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.exporter-stat-strip strong {
  display: block;
  margin-top: 5px;
}

.exporter-runtime-note {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(3, 13, 19, 0.22);
}

.exporter-circuit-warning {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(202, 98, 70, 0.28);
  border-radius: 14px;
  background: rgba(202, 98, 70, 0.09);
  color: var(--text);
}

.exporter-circuit-warning span {
  color: var(--muted);
  font-size: 12px;
}

.exporter-uses {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.exporter-uses > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.exporter-use-chip {
  padding: 8px 10px;
  font-size: 12px;
}

.exporter-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.exporter-preview-grid > label,
.exporter-preview-grid > div {
  min-width: 0;
}

.exporter-preview-grid > div > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.exporter-preview-grid textarea,
.exporter-preview-grid pre {
  min-height: 260px;
  max-height: 460px;
  overflow: auto;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.exporter-preview-grid pre {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(3, 13, 19, 0.32);
  white-space: pre-wrap;
  word-break: break-word;
}

.protocols-shell {
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.protocols-list-panel,
.protocols-detail-panel {
  min-height: 420px;
}

.protocols-detail-panel .listener-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.protocols-detail-panel .listener-meta-grid > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e8e4ee;
  border-radius: 11px;
  background: #fbfafc;
}

.protocols-detail-panel .listener-meta-grid span,
.protocols-detail-panel .listener-meta-grid strong {
  display: block;
}

.protocols-detail-panel .listener-meta-grid span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.protocols-detail-panel .listener-meta-grid strong {
  overflow-wrap: anywhere;
  font-size: 9px;
  line-height: 1.45;
}

.protocol-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.protocol-card:hover,
.protocol-card.active {
  transform: translateY(-2px);
  border-color: rgba(82, 221, 180, 0.28);
  box-shadow: 0 18px 50px rgba(16, 33, 44, 0.18);
}

.protocol-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.protocol-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(24, 123, 255, 0.12);
  color: #0f4fa8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.protocol-chip.muted {
  background: rgba(120, 120, 120, 0.12);
  color: #666;
}

.protocol-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.protocol-detail-card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.025);
}

.protocol-metric-strip {
  margin-top: 16px;
}

.panel-head.compact {
  margin-bottom: 14px;
  align-items: flex-start;
}

.protocol-listeners,
.protocol-doc-list {
  display: grid;
  gap: 12px;
}

.protocol-doc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.protocol-listener-item,
.protocol-doc-item {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.protocol-listener-item {
  text-align: left;
  cursor: pointer;
}

.protocol-listener-item:hover {
  border-color: rgba(82, 221, 180, 0.24);
}

.protocol-listener-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.protocol-doc-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.protocol-doc-item span {
  color: var(--muted);
  font-size: 12px;
}

.protocol-doc-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
}

.protocol-doc-item:hover,
.protocol-doc-item.active {
  border-color: rgba(82, 221, 180, 0.24);
}

.protocol-readme {
  margin: 0;
  max-height: 560px;
  overflow: auto;
  padding: 16px;
  border-radius: 16px;
  background: rgba(17, 24, 29, 0.96);
  color: #dff7f1;
  line-height: 1.5;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.listener-card,
.generic-card { padding: 18px; }

.listener-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.listener-protocol { color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; }

.listener-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  text-transform: capitalize;
}

.listener-status.running {
  color: #d6fff1;
  border-color: rgba(82, 221, 180, 0.22);
  background: rgba(82, 221, 180, 0.12);
}

.listener-status.starting,
.listener-status.restarting {
  color: #ffefcf;
  border-color: rgba(240, 177, 94, 0.24);
  background: rgba(240, 177, 94, 0.12);
}

.listener-status.idle {
  color: #d8edff;
  border-color: rgba(106, 179, 255, 0.24);
  background: rgba(106, 179, 255, 0.12);
}

.listener-status.error,
.listener-status.stopped,
.listener-status.disabled {
  color: #ffd7d3;
  border-color: rgba(248, 111, 103, 0.24);
  background: rgba(248, 111, 103, 0.1);
}

.listener-meta,
.stats {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.listener-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.summary-chip {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}

.summary-chip .label {
  font-size: 12px;
  color: var(--muted);
}

.summary-chip .value {
  margin-top: 4px;
  font-weight: 700;
}

.stacked-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.stacked-label > span {
  font-size: 12px;
  color: var(--muted);
}

.compact-textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

.secondary-ip-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.secondary-ip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.025);
}

.secondary-ip-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.secondary-ip-value {
  font-weight: 700;
  letter-spacing: 0.01em;
  word-break: break-word;
}

.secondary-ip-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}

.secondary-ip-status.ok {
  color: #9cf1b8;
  background: rgba(50, 135, 80, 0.2);
}

.secondary-ip-status.warn {
  color: #ffd987;
  background: rgba(163, 116, 17, 0.2);
}

.secondary-ip-status.muted {
  color: var(--muted);
  background: rgba(255,255,255,0.04);
}

.secondary-ip-addbar {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
}

.secondary-ip-addbar .search-input {
  flex: 1;
}

.secondary-ip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.network-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.network-feedback.info {
  background: rgba(83, 154, 255, 0.12);
  color: #cde1ff;
}

.network-feedback.success {
  background: rgba(60, 173, 103, 0.14);
  color: #c9f4d7;
}

.network-feedback.error {
  background: rgba(201, 82, 82, 0.14);
  color: #ffd4d4;
}

.gprs-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.gprs-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.gprs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.gprs-preview {
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}

.gprs-preview .label {
  font-size: 12px;
  color: var(--muted);
}

.gprs-preview .value {
  margin-top: 6px;
  word-break: break-word;
  font-size: 13px;
}

.listener-activity-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.mini-connection-count {
  min-width: 42px;
  text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--muted);
}

.mini-connection-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.mini-connection,
.connection-card {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.mini-connection.live,
.connection-card.live {
  border-color: rgba(82, 221, 180, 0.22);
  background: rgba(82, 221, 180, 0.06);
}

.mini-connection-top,
.connection-card-top,
.connection-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.mini-connection-meta,
.connection-peer,
.connection-section-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.mini-connection-preview,
.connection-preview-block .value {
  margin-top: 8px;
  word-break: break-word;
  font-size: 13px;
}

.mini-connection-empty {
  margin-top: 12px;
  color: var(--muted);
}

.connection-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.connection-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.connection-query-summary,
.connection-pager {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.connection-query-summary {
  margin: 4px 0 18px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}

.connection-query-summary div {
  display: grid;
  gap: 3px;
}

.connection-query-summary strong {
  color: var(--text);
}

.connection-pager {
  justify-content: center;
  margin-top: 20px;
}

.connection-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.connection-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.connection-preview-block {
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}

.connection-preview-block .label {
  font-size: 12px;
  color: var(--muted);
}

.diagnostic-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.diagnostic-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
}

.diagnostic-list-meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.diagnostic-list-items,
.timeline-list {
  display: grid;
  gap: 10px;
  max-height: 880px;
  overflow: auto;
}

.diagnostic-item {
  width: 100%;
  text-align: left;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 14px;
}

.diagnostic-item.active {
  border-color: rgba(82, 221, 180, 0.24);
  background: rgba(82, 221, 180, 0.1);
}

.diagnostic-item-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.diagnostic-item-meta,
.diagnostic-item-preview,
.timeline-top,
.timeline-preview {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.diagnostic-item-preview,
.timeline-summary,
.timeline-preview {
  word-break: break-word;
}

.diagnostic-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 12px;
}

.diagnostic-dot.live {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(82, 221, 180, 0.12);
}

.diagnostic-dot.recent {
  background: #58a6ff;
  box-shadow: 0 0 0 5px rgba(88, 166, 255, 0.12);
}

.diagnostic-dot.idle {
  background: rgba(255,255,255,0.35);
}

.timeline-panel {
  margin-top: 14px;
  padding: 18px;
}

.visor-history-panel {
  overflow: hidden;
}

.visor-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  max-height: 980px;
  overflow: auto;
}

.visor-entry-card {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}

.visor-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(24, 39, 47, 0.98), rgba(15, 28, 35, 0.98));
  border-bottom: 1px solid rgba(82, 221, 180, 0.18);
}

.visor-entry-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.visor-entry-message {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.visor-entry-times {
  display: grid;
  gap: 8px;
  padding: 14px 16px 10px;
  background: rgba(82, 221, 180, 0.08);
}

.visor-time-block .label {
  font-size: 12px;
  color: rgba(237, 246, 244, 0.72);
}

.visor-time-block strong {
  display: block;
  margin-top: 4px;
  color: #a5ff7f;
  font-size: 1rem;
}

.visor-entry-summary {
  padding: 12px 16px 0;
  color: var(--muted);
  word-break: break-word;
  font-size: 13px;
}

.visor-entry-summary.raw {
  padding-top: 10px;
}

.visor-entry-summary.raw strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.visor-entry-summary.raw div {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.visor-entry-table-wrap {
  padding: 12px 16px 16px;
}

.visor-entry-table {
  background: rgba(255,255,255,0.02);
  border-radius: 14px;
  overflow: hidden;
}

.visor-entry-table th,
.visor-entry-table td {
  padding: 9px 10px;
}

.visor-entry-table tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.025);
}

.visor-compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.timeline-item {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 0;
}

.timeline-summary {
  margin-top: 8px;
}

.gprs-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.gprs-badge.enviado {
  color: #ffefcf;
  border-color: rgba(240, 177, 94, 0.24);
  background: rgba(240, 177, 94, 0.12);
}

.gprs-badge.ack_posterior {
  color: #d6fff1;
  border-color: rgba(82, 221, 180, 0.22);
  background: rgba(82, 221, 180, 0.12);
}

.gprs-badge.sin_confirmacion {
  color: #ffd7d3;
  border-color: rgba(248, 111, 103, 0.24);
  background: rgba(248, 111, 103, 0.1);
}

.gprs-badge.idle {
  color: var(--muted);
}

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

.stat {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}

.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { margin-top: 4px; font-size: 1rem; font-weight: 700; }

.form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.form.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: 1 / -1; }
label span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }

input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  font: inherit;
}

.search-input {
  max-width: 420px;
}

textarea { min-height: 110px; resize: vertical; }
#configEditor { min-height: 420px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; }

.toggle-row { display: flex; justify-content: space-between; align-items: center; }
.toggle-row input { width: 18px; height: 18px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.card-feedback {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}

.card-feedback.busy {
  color: #ffefcf;
  border: 1px solid rgba(240, 177, 94, 0.18);
}

.card-feedback.success {
  color: #d6fff1;
  border: 1px solid rgba(82, 221, 180, 0.18);
}

.create-panel {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.protocol-create-helper {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(82, 221, 180, 0.12);
  background: rgba(82, 221, 180, 0.05);
}

.protocol-create-helper h4 {
  margin: 0 0 6px;
}

.hidden { display: none; }

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

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
  vertical-align: top;
}

.table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.log-content {
  min-height: 520px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  overflow: auto;
  white-space: pre-wrap;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.login-shell { width: min(520px, calc(100vw - 32px)); }
.login-card {
  padding: 32px;
  border: 1px solid var(--panel-border);
  border-radius: calc(var(--radius) + 8px);
  background: linear-gradient(145deg, rgba(16, 34, 44, 0.84), rgba(8, 20, 28, 0.82));
  box-shadow: var(--shadow);
}

.login-form { display: grid; gap: 14px; margin-top: 18px; }
.login-error { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: rgba(248,111,103,0.14); border: 1px solid rgba(248,111,103,0.25); color: #ffd5d1; }

@media (max-width: 1100px) {
  .app-shell { height: auto; grid-template-columns: 1fr; overflow: visible; }
  .sidebar { height: auto; border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
  .main { overflow: visible; }
  .panel-grid { grid-template-columns: 1fr; }
  .protocols-shell,
  .exporters-shell,
  .protocol-detail-grid { grid-template-columns: 1fr; }
  .exporters-list-panel { position: static; }
  .exporter-list { max-height: 420px; }
  .diagnostics-shell { grid-template-columns: 1fr; }
  .diagnostics-port-panel,
  .diagnostics-detail-panel,
  .diagnostic-port-list { min-height: 0; max-height: none; }
}

@media (max-width: 760px) {
  .main { padding: 16px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .form.compact { grid-template-columns: 1fr; }
  .gprs-grid { grid-template-columns: 1fr; }
  .connection-chip-grid { grid-template-columns: 1fr; }
  .connection-section-head { flex-direction: column; }
  .connection-query-summary { align-items: flex-start; flex-direction: column; }
  .diagnostic-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .diagnostic-layout { grid-template-columns: 1fr; }
  .visor-compact-grid { grid-template-columns: 1fr; }
  .visor-history-grid { grid-template-columns: 1fr; }
  .exporter-stat-strip,
  .exporter-preview-grid { grid-template-columns: 1fr; }
  .update-panel-head { flex-direction: column; }
  .import-conflict-row { grid-template-columns: 1fr; }
}

/* Control Center 2.2: warm, high-clarity operations interface. */
:root {
  color-scheme: light;
  --bg: #f6f4fa;
  --bg-2: #efedf7;
  --panel: #ffffff;
  --panel-soft: #faf9fd;
  --panel-border: #e7e3ef;
  --text: #24243a;
  --muted: #77758a;
  --accent: #7257d5;
  --accent-strong: #5e43c4;
  --accent-soft: #eee9ff;
  --accent-2: #e89f43;
  --success: #24a66f;
  --success-soft: #e9f8f1;
  --danger: #d95763;
  --danger-soft: #fff0f1;
  --info: #4a82db;
  --info-soft: #edf4ff;
  --radius: 20px;
  --font: "Avenir Next", "Nunito Sans", "Trebuchet MS", sans-serif;
  --shadow: 0 14px 40px rgba(55, 42, 96, 0.07);
  --shadow-hover: 0 18px 48px rgba(55, 42, 96, 0.12);
}

html {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 88% 2%, rgba(114, 87, 213, 0.08), transparent 26rem),
    linear-gradient(135deg, #f8f7fb 0%, #f3f1f8 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.42;
  background-image: radial-gradient(rgba(114, 87, 213, 0.13) 0.7px, transparent 0.7px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, black, transparent 48%);
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  grid-template-columns: 276px minmax(0, 1fr);
  background: transparent;
}

.sidebar {
  position: relative;
  z-index: 50;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 18px 16px;
  overflow: hidden;
  border-right: 1px solid var(--panel-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 247, 253, 0.98)),
    #fff;
  box-shadow: 10px 0 35px rgba(52, 42, 87, 0.035);
  backdrop-filter: none;
}

.sidebar-brand {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 7px 8px 16px;
  border-bottom: 1px solid var(--panel-border);
}

.brand-mark {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  border-radius: 15px 15px 15px 5px;
  background: linear-gradient(145deg, #8064e4, #5f43c2);
  box-shadow: 0 10px 24px rgba(95, 67, 194, 0.24);
}

.brand-mark::after {
  position: absolute;
  width: 18px;
  height: 18px;
  right: -5px;
  bottom: -5px;
  content: "";
  border-radius: 50%;
  background: #efab4d;
}

.brand-mark span {
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 11px;
}

.brand-mark strong {
  position: relative;
  z-index: 1;
  font-size: 14px;
  letter-spacing: -0.03em;
}

.brand-copy {
  min-width: 0;
}

.brand-copy .eyebrow {
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.brand {
  margin-top: 3px;
  font-size: 1.05rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.brand-copy .brand-solution {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy .brand-version {
  width: max-content;
  margin-top: 5px;
  padding: 2px 6px;
  color: #5f4bab;
  border: 1px solid #dfd7f4;
  border-radius: 999px;
  background: #f4f0ff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sidebar-close,
.mobile-menu-btn {
  width: 42px;
  height: 42px;
  padding: 10px;
  align-items: center;
  justify-content: center;
}

.sidebar-close {
  display: none;
}

.sidebar-close svg,
.mobile-menu-btn svg,
.refresh-action svg,
.logout-link svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 17px;
  margin: 14px -4px 14px 0;
  padding-right: 4px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d9d4e7 transparent;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-label {
  margin: 0 10px 4px;
  color: #9a97a9;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  min-height: 43px;
  display: grid;
  grid-template-columns: 21px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 10px 12px;
  color: #5f5c70;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-item:hover {
  color: var(--accent-strong);
  background: #f4f1fc;
  transform: translateX(2px);
}

.nav-item.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #7d61df, #674bc9);
  box-shadow: 0 9px 22px rgba(104, 76, 202, 0.2);
}

.nav-item svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-count {
  min-width: 22px;
  padding: 2px 6px;
  color: #fff;
  border-radius: 999px;
  background: var(--danger);
  font-size: 10px;
  text-align: center;
}

.nav-item.active .nav-count {
  color: #684bca;
  background: #fff;
}

.sidebar-footer {
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-border);
}

.sidebar-system {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 4px 8px;
}

.sidebar-system > div,
.user-badge > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sidebar-system strong,
.user-badge strong {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-system small,
.user-badge small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-pulse {
  position: relative;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(36, 166, 111, 0.12);
}

.user-badge {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(58, 47, 93, 0.04);
}

.user-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #5c43b9;
  border-radius: 12px;
  background: linear-gradient(145deg, #ebe6ff, #f7f4ff);
  font-size: 13px;
  font-weight: 800;
}

.logout-link {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 7px;
  color: var(--muted);
  border: 0;
  border-radius: 10px;
  background: #f5f3f8;
}

.logout-link:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.sidebar-backdrop {
  display: none;
}

.main {
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
  padding: 0 30px 38px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 88px;
  padding: 18px 0 16px;
  border-bottom: 1px solid rgba(225, 221, 235, 0.82);
  background: rgba(247, 245, 250, 0.9);
  backdrop-filter: blur(18px);
}

.topbar-leading {
  min-width: 0;
  display: flex;
  gap: 12px;
  align-items: center;
}

.topbar h2 {
  margin-top: 3px;
  color: #29273d;
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.eyebrow,
.panel-kicker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mobile-menu-btn {
  display: none;
}

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

.hero-status {
  min-height: 43px;
  max-width: min(470px, 42vw);
  padding: 10px 14px;
  color: #4c495e;
  border-color: var(--panel-border);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 7px 24px rgba(51, 42, 82, 0.04);
  font-size: 12px;
}

.hero-status .dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--accent-2);
  box-shadow: 0 0 0 5px rgba(232, 159, 67, 0.12);
}

.hero-status.ok .dot {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(36, 166, 111, 0.12);
}

.hero-status.bad .dot {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(217, 87, 99, 0.12);
}

.refresh-action {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

button,
.logout-link {
  min-height: 42px;
  padding: 10px 15px;
  color: #fff;
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(135deg, #7659d8, #6045c3);
  box-shadow: 0 8px 18px rgba(96, 69, 195, 0.15);
  font-size: 12px;
  font-weight: 750;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 11px 24px rgba(96, 69, 195, 0.2);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(114, 87, 213, 0.2);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.52;
}

button.ghost {
  color: #5d5870;
  border-color: var(--panel-border);
  background: #fff;
  box-shadow: none;
}

button.ghost:hover:not(:disabled) {
  color: var(--accent-strong);
  border-color: #d6cef0;
  background: #f7f4ff;
  box-shadow: 0 8px 18px rgba(82, 60, 157, 0.07);
}

button.danger {
  color: #b63e4a;
  border-color: #f1ccd0;
  background: #fff3f4;
  box-shadow: none;
}

button.danger:hover:not(:disabled) {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
  box-shadow: 0 9px 18px rgba(217, 87, 99, 0.18);
}

.nav-item {
  min-height: 43px;
  padding: 10px 12px;
  color: #5f5c70;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.nav-item:hover:not(:disabled) {
  color: var(--accent-strong);
  border-color: transparent;
  background: #f4f1fc;
  box-shadow: none;
  transform: translateX(2px);
}

.nav-item.active,
.nav-item.active:hover:not(:disabled) {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #7d61df, #674bc9);
  box-shadow: 0 9px 22px rgba(104, 76, 202, 0.2);
}

.hidden {
  display: none !important;
}

.view {
  margin-top: 22px;
}

.view.active {
  animation: view-enter 280ms ease both;
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.notice-bar {
  position: fixed;
  z-index: 100;
  top: 96px;
  right: 28px;
  width: min(440px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 14px 14px 14px 16px;
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(49, 38, 85, 0.16);
  animation: notice-enter 220ms ease both;
}

@keyframes notice-enter {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.notice-bar.info,
.notice-bar.success,
.notice-bar.error {
  background: #fff;
}

.notice-bar.info { border-color: #cfdcf4; }
.notice-bar.success { border-color: #bce4d3; }
.notice-bar.error { border-color: #efc4c8; }

.notice-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--info);
  box-shadow: 0 0 0 5px rgba(74, 130, 219, 0.12);
}

.notice-bar.success .notice-icon {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(36, 166, 111, 0.12);
}

.notice-bar.error .notice-icon {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(217, 87, 99, 0.12);
}

.notice-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.notice-copy strong {
  font-size: 12px;
}

.notice-copy > span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.notice-close {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 10px;
}

.operation-hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  overflow: hidden;
  padding: 23px 25px;
  border: 1px solid #e4dff0;
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 20%, rgba(114, 87, 213, 0.11), transparent 18rem),
    linear-gradient(135deg, #ffffff 0%, #f7f3ff 100%);
  box-shadow: var(--shadow);
}

.operation-hero::after {
  position: absolute;
  width: 180px;
  height: 180px;
  right: -92px;
  bottom: -112px;
  content: "";
  border: 20px solid rgba(114, 87, 213, 0.055);
  border-radius: 50%;
}

.operation-hero.attention {
  border-color: #f0d6c4;
  background:
    radial-gradient(circle at 88% 20%, rgba(232, 159, 67, 0.12), transparent 18rem),
    linear-gradient(135deg, #fff 0%, #fff8f0 100%);
}

.operation-hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  gap: 17px;
  align-items: center;
}

.operation-hero-icon {
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  border: 11px solid #dff3ea;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 1px #cce8dc;
}

.operation-hero.attention .operation-hero-icon {
  border-color: #faead6;
  background: var(--accent-2);
  box-shadow: 0 0 0 1px #eed5b6;
}

.operation-hero h3 {
  margin-top: 5px;
  font-size: clamp(1.2rem, 2.1vw, 1.65rem);
  letter-spacing: -0.035em;
}

.operation-hero-copy p:last-child {
  max-width: 760px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.operation-hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
}

.overview {
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.panel,
.metric-card,
.listener-card,
.generic-card {
  border-color: var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.panel {
  padding: 20px;
}

.panel:hover {
  border-color: #dfd9eb;
}

.panel-head {
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel-head h3 {
  margin-top: 4px;
  font-size: 1.03rem;
  letter-spacing: -0.02em;
}

.sidebar-copy {
  max-width: 850px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.metric-card {
  position: relative;
  min-height: 116px;
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 17px;
  overflow: hidden;
}

.metric-card::after {
  position: absolute;
  width: 56px;
  height: 56px;
  right: -28px;
  bottom: -28px;
  content: "";
  border: 9px solid rgba(114, 87, 213, 0.045);
  border-radius: 50%;
}

.metric-accent {
  width: 9px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #c2b8e9;
}

.metric-success .metric-accent { background: var(--success); }
.metric-warning .metric-accent { background: var(--accent-2); }
.metric-live .metric-accent { background: #7257d5; }
.metric-info .metric-accent { background: var(--info); }

.metric-copy {
  min-width: 0;
}

.metric-card .label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.metric-card .value {
  margin-top: 5px;
  color: #29273d;
  font-size: 1.55rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.metric-meta {
  margin-top: 7px;
  color: #9692a4;
  font-size: 9px;
  line-height: 1.35;
}

.panel-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 14px;
  margin-top: 14px;
}

.dashboard-primary-grid {
  grid-template-columns: 1fr;
}

.attention-feed {
  max-height: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.attention-feed > .feed-item {
  min-width: 0;
}

.feed {
  gap: 9px;
  scrollbar-width: thin;
  scrollbar-color: #d9d4e7 transparent;
}

.feed-item,
.file-item,
.capacity-health-card,
.summary-chip,
.connection-preview-block,
.config-import-summary > div {
  color: var(--text);
  border-color: #ebe7f1;
  background: #faf9fc;
}

.feed-item {
  border-radius: 14px;
}

.feed-item .top,
.file-top {
  color: var(--muted);
}

.alert-item.critical {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.alert-item.warning {
  border-left-color: var(--accent-2);
  background: #fff8ed;
}

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

.empty-state {
  min-height: 140px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 22px;
  color: var(--muted);
  border: 1px dashed #dcd6e9;
  border-radius: 16px;
  background: #fbfafc;
  text-align: center;
}

.empty-state strong {
  color: var(--text);
}

.empty-state p {
  max-width: 460px;
  font-size: 11px;
  line-height: 1.5;
}

.empty-state-icon {
  width: 30px;
  height: 30px;
  border: 8px solid #dff3ea;
  border-radius: 50%;
  background: var(--success);
}

.capacity-table-wrap,
.listener-table-wrap {
  border: 1px solid var(--panel-border);
  border-radius: 15px;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: #d5cfe4 transparent;
}

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

.table th,
.table td {
  padding: 12px 11px;
  border-bottom-color: #eeebf3;
}

.table th {
  color: #898598;
  background: #faf9fc;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.table tbody tr {
  background: #fff;
}

.table tbody tr:hover,
.listener-table tbody tr:hover,
.listener-table tbody tr.active {
  background: #faf8ff;
}

.dashboard-health-table {
  min-width: 1100px;
}

.port-identity {
  min-width: 220px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.port-number {
  display: inline-grid;
  min-height: 35px;
  place-items: center;
  padding: 5px 7px;
  color: var(--accent-strong);
  border: 1px solid #ded6f5;
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 800;
}

.port-identity > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.port-identity small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-stack,
.delivery-stack {
  min-width: 112px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
}

.activity-stack strong,
.delivery-stack strong {
  color: var(--text);
}

.table-footer-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 11px 3px 0;
  color: var(--muted);
  font-size: 10px;
}

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

.compact-action {
  min-height: 33px;
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 9px;
}

.listener-row-actions {
  min-width: 235px;
  flex-wrap: nowrap;
}

.listener-table {
  min-width: 1190px;
}

.listener-table th:last-child,
.listener-table td:last-child,
.dashboard-health-table th:last-child,
.dashboard-health-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -10px 0 18px rgba(52, 42, 84, 0.055);
}

.listener-table th:last-child,
.dashboard-health-table th:last-child {
  z-index: 3;
  background: #faf9fc;
}

.listener-list-toolbar {
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: #faf9fc;
}

.sampled-status {
  color: var(--muted);
}

.refresh-paused-badge {
  color: #9b6420;
  border-color: #ecd6b8;
  background: #fff7eb;
}

.listener-card,
.generic-card {
  background: #fff;
}

.listener-card:hover {
  box-shadow: var(--shadow-hover);
}

.listener-protocol {
  color: var(--accent);
}

.listener-status {
  min-width: 90px;
  color: var(--muted);
  border-color: #e2deea;
  background: #f8f7fa;
  font-size: 10px;
  font-weight: 750;
}

.listener-status.running {
  color: #16875a;
  border-color: #bfe5d5;
  background: var(--success-soft);
}

.listener-status.starting,
.listener-status.restarting {
  color: #a56a1d;
  border-color: #efd5b2;
  background: #fff6e9;
}

.listener-status.idle {
  color: #3b70bf;
  border-color: #cadaf4;
  background: var(--info-soft);
}

.listener-status.error,
.listener-status.stopped,
.listener-status.disabled {
  color: #b33f4a;
  border-color: #efc9cd;
  background: var(--danger-soft);
}

.summary-chip {
  border: 1px solid #ece8f2;
}

.summary-chip .label,
.stacked-label > span,
.exporter-choice-field > span,
.exporter-choice-field > small {
  color: var(--muted);
}

.stats .stat,
.gprs-panel {
  border-color: #e9e5f0;
  background: #faf9fc;
}

.gprs-preview,
.connection-preview-block {
  background: #f7f5fa;
}

input,
select,
textarea,
.search-input,
.compact-textarea {
  color: var(--text);
  border-color: #dcd7e7;
  background: #fff;
  box-shadow: none;
}

input::placeholder,
textarea::placeholder {
  color: #aaa6b5;
}

select option {
  color: var(--text);
  background: #fff;
}

.form label > span {
  color: var(--muted);
}

.create-panel,
.listener-edit-panel {
  border-color: #ded7f1;
  background: #faf8ff;
}

.exporter-choice-grid {
  border-color: #e4dfec;
  background: #f8f6fb;
}

.exporter-choice {
  border-color: transparent;
  background: #fff;
}

.exporter-choice:has(input:checked) {
  border-color: #cfc3f3;
  background: #f3efff;
}

.exporter-choice em {
  color: var(--accent);
}

.exporter-row,
.protocol-doc-item,
.diagnostic-port-item {
  color: var(--text);
  border-color: #e8e4ee;
  background: #fbfafc;
  box-shadow: none;
}

.exporter-row:hover,
.exporter-row.active,
.diagnostic-port-item.active,
.protocol-card.active {
  color: var(--text);
  border-color: #cfc4ef;
  background: #f3efff;
}

.exporter-row-meta em,
.exporter-row-meta b,
.exporter-row-meta i,
.protocol-chip,
.update-phase {
  color: var(--muted);
  border-color: #e5e1eb;
  background: #f4f2f7;
}

.exporter-row-meta i.ok,
.update-phase.success {
  color: #16875a;
  border-color: #bfe5d5;
  background: var(--success-soft);
}

.update-phase.error {
  color: #b33f4a;
  border-color: #efc9cd;
  background: var(--danger-soft);
}

.protocol-readme,
.log-content,
#configEditor,
.update-test-output pre {
  color: #eae7f5;
  border: 1px solid #353148;
  background: #262334;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#configEditor {
  min-height: 580px;
}

.capacity-meter {
  background: #ece9f1;
}

.capacity-meter-fill {
  background: linear-gradient(90deg, #7257d5, #9f8bea);
}

.capacity-meter.warn .capacity-meter-fill {
  background: linear-gradient(90deg, #e39b42, #f2c279);
}

.capacity-meter.bad .capacity-meter-fill {
  background: linear-gradient(90deg, #d95763, #ed8a93);
}

.capacity-pressure,
.capacity-pressure.ok,
.capacity-pressure.warn,
.capacity-pressure.bad {
  border-color: #e8e4ee;
  background: #faf9fc;
}

.capacity-pressure.ok {
  border-color: #c4e4d7;
  background: var(--success-soft);
}

.capacity-pressure.warn {
  border-color: #ebd5b7;
  background: #fff7ec;
}

.capacity-pressure.bad {
  border-color: #efc9cd;
  background: var(--danger-soft);
}

.settings-shell {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.settings-nav-panel {
  min-width: 0;
  max-width: 100%;
  position: sticky;
  top: 106px;
  padding: 18px 12px 12px;
}

.settings-nav-panel > div {
  padding: 0 8px 13px;
}

.settings-nav {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 6px;
}

.settings-nav-item {
  min-height: 59px;
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  color: var(--text);
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.settings-nav-item span {
  font-size: 12px;
}

.settings-nav-item small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.settings-nav-item:hover:not(:disabled) {
  color: var(--accent-strong);
  border-color: #e3def0;
  background: #f8f5ff;
  box-shadow: none;
}

.settings-nav-item.active {
  color: var(--accent-strong);
  border-color: #d9cff6;
  background: #f1edff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.settings-content {
  min-width: 0;
}

.config-section {
  display: none;
}

.config-section.active {
  display: block;
  animation: view-enter 220ms ease both;
}

.config-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.config-summary-card {
  min-width: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--panel-border);
  border-radius: 15px;
  background: #faf9fc;
}

.config-summary-icon {
  width: 11px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent);
}

.config-summary-icon.blue { background: var(--info); }
.config-summary-icon.green { background: var(--success); }
.config-summary-icon.amber { background: var(--accent-2); }

.config-summary-card > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.config-summary-card small,
.config-summary-card span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-summary-card strong {
  font-size: 1.25rem;
  letter-spacing: -0.04em;
}

.config-task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 14px;
}

.config-task-card {
  min-height: 142px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  align-content: start;
  padding: 17px;
  color: var(--text);
  border: 1px solid var(--panel-border);
  background: #fff;
  box-shadow: none;
  text-align: left;
}

.config-task-card:hover:not(:disabled) {
  border-color: #cfc4ef;
  background: #faf8ff;
  box-shadow: var(--shadow);
}

.config-task-card.attention {
  border-color: #ead0ae;
  background: #fffaf3;
}

.task-index {
  grid-row: 1 / span 3;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  border-radius: 9px;
  background: var(--accent-soft);
  font-size: 9px;
  font-weight: 800;
}

.config-task-card strong {
  font-size: 12px;
}

.config-task-card small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.45;
}

.task-link {
  align-self: end;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.configuration-principle {
  margin-top: 14px;
  padding: 16px 17px;
  color: #4e4863;
  border: 1px solid #ded7f1;
  border-radius: 15px;
  background: linear-gradient(135deg, #f5f1ff, #fbf9ff);
}

.configuration-principle p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.config-transfer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--panel-border);
  border-radius: 15px;
  background: #faf9fc;
}

.config-transfer-flow {
  display: grid;
  gap: 10px;
}

.config-transfer-step {
  display: grid;
  grid-template-columns: 34px minmax(210px, 1fr) minmax(170px, auto);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: #faf9fc;
}

.config-transfer-step.primary {
  border-color: #d5c9f2;
  background: linear-gradient(135deg, #f6f2ff, #fbfaff);
}

.config-transfer-step > span:first-child {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff;
  border-radius: 10px;
  background: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.config-transfer-step > div {
  display: grid;
  gap: 3px;
}

.config-transfer-step > .config-transfer-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.config-transfer-step small,
.config-backup-head span,
.config-backup-row span,
.config-backup-row small,
.config-editor-status span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.config-backups-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--panel-border);
}

.config-backup-head,
.config-backup-row,
.config-backup-actions,
.config-editor-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.config-backup-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.config-backup-head > div,
.config-backup-row > div:first-child {
  display: grid;
  gap: 3px;
}

.config-backup-list {
  display: grid;
  gap: 8px;
}

.config-backup-row {
  justify-content: space-between;
  padding: 12px 13px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: #faf9fc;
}

.config-backup-actions a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  text-decoration: none;
}

.danger-outline {
  color: #a13b47;
  border-color: #e8c5ca;
  background: #fff7f8;
}

.config-safety-note,
.config-editor-status {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: #faf9fc;
}

.config-editor-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.config-editor-status {
  margin-bottom: 10px;
}

.config-editor-status.protected {
  color: #4f4864;
  border-color: #dcd4ef;
  background: #f6f2ff;
}

.config-editor-status.warning {
  color: #805718;
  border-color: #efd8ae;
  background: #fff8eb;
}

.config-editor-status.success {
  color: #126e4b;
  border-color: #bfe2d3;
  background: var(--success-soft);
}

.config-safety-note.success {
  color: #126e4b;
  border-color: #bfe2d3;
  background: var(--success-soft);
}

.config-editor-status.error {
  color: #a13b47;
  border-color: #e8c5ca;
  background: var(--danger-soft);
}

#configEditor[readonly] {
  opacity: 0.78;
  cursor: not-allowed;
}

#configEditor.editor-unlocked {
  opacity: 1;
  border-color: #8f73e0;
  box-shadow: 0 0 0 3px rgba(114, 87, 213, 0.12);
}

#configImportPanel {
  margin-top: 14px;
}

.secondary-ip-row {
  border-color: var(--panel-border);
  background: #faf9fc;
}

.secondary-ip-status {
  border-color: #e1dce9;
}

.secondary-ip-status.ok {
  color: #16875a;
  background: var(--success-soft);
}

.secondary-ip-status.warn {
  color: #9c661e;
  background: #fff7eb;
}

.secondary-ip-status.muted {
  color: var(--muted);
  background: #f2f0f5;
}

.network-feedback {
  border-color: var(--panel-border);
}

.network-feedback.info {
  color: #376aa9;
  background: var(--info-soft);
}

.network-feedback.success {
  color: #167b54;
  background: var(--success-soft);
}

.network-feedback.error {
  color: #a63a45;
  background: var(--danger-soft);
}

.platform-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.platform-setting-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--panel-border);
  border-radius: 17px;
  background: linear-gradient(145deg, #fff, #faf9fc);
}

.platform-storage-card {
  grid-column: 1 / -1;
}

.platform-setting-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 9px;
}

.platform-setting-head > span {
  display: grid;
  gap: 2px;
}

.platform-setting-head small {
  color: var(--accent);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
}

.platform-setting-head strong {
  font-size: 14px;
}

.platform-setting-head a,
.platform-setting-head b {
  color: var(--accent-strong);
  font-size: 9px;
}

.platform-setting-card > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.platform-state {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--info-soft);
  text-transform: uppercase;
}

.platform-state.success {
  color: #167b54;
  background: var(--success-soft);
}

.platform-state.error {
  color: #a63a45;
  background: var(--danger-soft);
}

.platform-token-secret {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 13px;
  border: 1px solid #c9baf0;
  border-radius: 13px;
  background: #f6f1ff;
}

.platform-token-secret textarea {
  min-height: 66px;
  resize: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.platform-scope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: #fff;
}

.platform-token-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.platform-token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: #fff;
}

.platform-token-row > div {
  min-width: 0;
  display: grid;
}

.platform-token-row small,
.platform-token-row > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.media-storage-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.media-storage-stats span {
  padding: 6px 9px;
  color: var(--muted);
  border-radius: 999px;
  background: #f0eef4;
  font-size: 8px;
  font-weight: 700;
}

.camera-active-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.camera-active-channels button {
  min-height: 34px;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 7px 10px;
}

.camera-active-channels button span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}

.camera-active-channels button.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.camera-no-channel {
  color: var(--muted);
  font-size: 9px;
}

.update-status-card {
  border-color: #ddd8e7;
  background: #faf9fc;
}

.update-status-card.success {
  border-left-color: var(--success);
}

.update-status-card.error {
  border-left-color: var(--danger);
}

.diagnostics-shell {
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 14px;
}

.diagnostics-port-panel,
.diagnostics-detail-panel {
  min-height: calc(100vh - 138px);
}

.connection-card,
.diagnostic-device-item,
.visor-device-item {
  border-color: var(--panel-border);
  background: #faf9fc;
}

.login-body {
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(114, 87, 213, 0.15), transparent 26rem),
    radial-gradient(circle at 88% 88%, rgba(232, 159, 67, 0.12), transparent 22rem),
    #f7f5fb;
}

.login-card {
  position: relative;
  overflow: hidden;
  border-color: var(--panel-border);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 28px 80px rgba(51, 39, 91, 0.15);
}

.login-card::before {
  position: absolute;
  width: 190px;
  height: 190px;
  top: -115px;
  right: -95px;
  content: "";
  border: 24px solid rgba(114, 87, 213, 0.08);
  border-radius: 50%;
}

.login-error {
  color: #a83d47;
  border-color: #efc5c9;
  background: var(--danger-soft);
}

.login-shell {
  width: min(980px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(380px, 1.08fr);
  align-items: stretch;
  gap: 18px;
}

.login-card {
  padding: clamp(28px, 4vw, 46px);
}

.login-brand-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand-row .eyebrow {
  margin: 0 0 2px;
  color: var(--primary);
}

.login-brand-row strong {
  color: var(--text);
  font-size: 0.98rem;
}

.login-brand-mark {
  flex: 0 0 auto;
  box-shadow: 0 10px 22px rgba(114, 87, 213, 0.22);
}

.login-heading {
  position: relative;
  z-index: 1;
  margin-top: clamp(42px, 7vh, 76px);
}

.login-heading h1 {
  margin: 5px 0 10px;
  color: var(--text);
  font-size: clamp(2.2rem, 5vw, 3.35rem);
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.login-heading .subtitle {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.login-form {
  position: relative;
  z-index: 1;
  margin-top: 30px;
}

.login-form label span {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.login-form input {
  min-height: 50px;
  background: #fbfafc;
}

.login-form button {
  min-height: 52px;
  margin-top: 4px;
  font-size: 0.92rem;
}

.login-assurance {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.login-assurance span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.login-context {
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: 650px;
  padding: clamp(34px, 5vw, 64px);
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(86, 65, 164, 0.12);
  border-radius: 30px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.2), transparent 18rem),
    linear-gradient(145deg, #7660d9 0%, #5f49ba 56%, #3f2e86 100%);
  box-shadow: 0 28px 80px rgba(51, 39, 91, 0.18);
}

.login-context::before,
.login-context::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
}

.login-context::before {
  width: 420px;
  height: 420px;
  right: -230px;
  top: -180px;
}

.login-context::after {
  width: 260px;
  height: 260px;
  left: -150px;
  bottom: -140px;
}

.login-context .panel-kicker {
  position: relative;
  z-index: 1;
  color: #dcd5ff;
}

.login-context h2 {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 9px 0 34px;
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  letter-spacing: -0.06em;
  line-height: 0.93;
}

.login-flow {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 10px;
  color: #f5f2ff;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-flow i {
  height: 1px;
  background: rgba(255, 255, 255, 0.42);
}

.login-context-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 38px;
  padding: 17px 19px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.login-context-card div {
  display: grid;
  gap: 3px;
}

.login-context-card small {
  color: #ddd6ff;
  line-height: 1.45;
}

@media (max-width: 1440px) {
  .overview {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

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

@media (max-width: 1180px) {
  .app-shell {
    height: 100vh;
    grid-template-columns: 1fr;
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(330px, 88vw);
    height: 100vh;
    border-right: 1px solid var(--panel-border);
    border-bottom: 0;
    transform: translateX(-105%);
    transition: transform 220ms ease;
    box-shadow: 24px 0 60px rgba(43, 32, 79, 0.16);
  }

  .sidebar-close,
  .mobile-menu-btn {
    display: inline-flex;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: block;
    opacity: 0;
    visibility: hidden;
    background: rgba(34, 28, 53, 0.32);
    backdrop-filter: blur(3px);
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
  }

  .main {
    height: 100vh;
    padding: 0 24px 32px;
    overflow-y: auto;
  }

  .panel-grid,
  .protocols-shell,
  .exporters-shell,
  .protocol-detail-grid,
  .diagnostics-shell {
    grid-template-columns: 1fr;
  }

  .settings-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .diagnostics-port-panel,
  .diagnostics-detail-panel,
  .diagnostic-port-list {
    min-height: 0;
    max-height: none;
  }

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

  #visorView .diagnostics-port-panel {
    min-height: 0;
  }

  #visorView .diagnostic-port-list {
    display: flex;
    grid-template-columns: none;
    max-height: none;
    padding: 2px 2px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
  }

  #visorView .diagnostic-port-item {
    flex: 0 0 min(280px, calc(100vw - 76px));
    scroll-snap-align: start;
  }
}

@media (max-width: 820px) {
  .login-body {
    align-items: flex-start;
    padding: 18px 0;
  }

  .login-shell {
    width: min(560px, calc(100vw - 28px));
    grid-template-columns: 1fr;
  }

  .login-context {
    display: none;
  }

  .login-card {
    min-height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 24px;
  }
}

@media (max-width: 860px) {
  .topbar {
    min-height: 76px;
  }

  .hero-status {
    display: none;
  }

  .operation-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .operation-hero-actions {
    width: 100%;
  }

  .operation-hero-actions button {
    flex: 1;
  }

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

  .attention-feed {
    grid-template-columns: 1fr;
  }

  .settings-shell {
    grid-template-columns: 1fr;
  }

  .settings-nav-panel {
    position: static;
    padding: 14px;
  }

  .settings-nav-panel > div {
    padding: 0 0 11px;
  }

  .settings-nav {
    display: flex;
    padding-bottom: 3px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .settings-nav-item {
    flex: 0 0 156px;
    min-height: 54px;
    scroll-snap-align: start;
  }

  .config-task-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 0 14px 24px;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    padding: 14px 0 12px;
  }

  .topbar-actions {
    width: auto;
    flex-direction: row;
  }

  .refresh-action {
    width: 42px;
    padding: 10px;
  }

  .refresh-action span {
    display: none;
  }

  .view {
    margin-top: 14px;
  }

  .notice-bar {
    top: 78px;
    right: 14px;
  }

  .operation-hero {
    padding: 18px;
    border-radius: 18px;
  }

  .operation-hero-copy {
    align-items: flex-start;
  }

  .operation-hero-icon {
    width: 35px;
    height: 35px;
    border-width: 9px;
  }

  .operation-hero h3 {
    font-size: 1.1rem;
  }

  .operation-hero-actions {
    flex-direction: column;
  }

  .overview {
    gap: 9px;
  }

  .metric-card {
    min-height: 105px;
    padding: 13px;
  }

  .metric-card .value {
    font-size: 1.25rem;
  }

  .panel {
    padding: 15px;
    border-radius: 17px;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-head > button {
    width: 100%;
  }

  .table-footer-note,
  .secondary-ip-row,
  .secondary-ip-addbar,
  .update-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .secondary-ip-actions,
  .secondary-ip-actions button,
  .secondary-ip-addbar button {
    width: 100%;
  }

  .config-overview-grid {
    grid-template-columns: 1fr;
  }

  .config-transfer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .config-transfer-actions > * {
    width: 100%;
  }

  .config-transfer-step {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .config-transfer-step > select,
  .config-transfer-step > button,
  .config-transfer-step > .config-transfer-controls {
    grid-column: 1 / -1;
    width: 100%;
  }

  .config-transfer-step > .config-transfer-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .config-transfer-controls > * {
    width: 100%;
  }

  .config-backup-head,
  .config-backup-row,
  .config-backup-actions,
  .config-editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .config-backup-head button,
  .config-backup-actions > *,
  .config-editor-actions button {
    width: 100%;
  }

  .diagnostic-port-list {
    grid-template-columns: 1fr;
  }

  #visorView .diagnostic-port-list {
    display: flex;
  }

  .listener-table {
    min-width: 0;
  }

  .listener-table thead {
    display: none;
  }

  .listener-table,
  .listener-table tbody,
  .listener-table tr,
  .listener-table td {
    display: block;
    width: 100%;
  }

  .listener-table tbody {
    display: grid;
    gap: 11px;
    padding: 10px;
    background: #f8f6fb;
  }

  .listener-table tbody tr {
    padding: 8px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: #fff;
  }

  .listener-table td {
    position: relative;
    min-height: 38px;
    padding: 10px 4px 10px 104px;
    border-bottom: 1px solid #efecf3;
  }

  .listener-table td:last-child {
    position: static;
    padding-left: 4px;
    border-bottom: 0;
    box-shadow: none;
  }

  .listener-table td::before {
    position: absolute;
    left: 4px;
    top: 12px;
    color: #9692a3;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .listener-table td:nth-child(1)::before { content: "Cliente"; }
  .listener-table td:nth-child(2)::before { content: "Puerto"; }
  .listener-table td:nth-child(3)::before { content: "Transporte"; }
  .listener-table td:nth-child(4)::before { content: "Parser"; }
  .listener-table td:nth-child(5)::before { content: "Destino"; }
  .listener-table td:nth-child(6)::before { content: "Actividad"; }
  .listener-table td:nth-child(7)::before { content: "Estado"; }

  .listener-row-actions {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .listener-row-actions button {
    min-height: 40px;
  }

  .dashboard-health-table {
    min-width: 980px;
  }

  .form.compact,
  .gprs-grid,
  .connection-chip-grid,
  .visor-compact-grid,
  .visor-history-grid,
  .exporter-stat-strip,
  .exporter-preview-grid,
  .config-import-summary {
    grid-template-columns: 1fr;
  }

  .diagnostic-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Processing Studio */
.pipeline-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(620px, 1.8fr);
  gap: 16px;
  align-items: start;
}

.pipeline-list-panel {
  position: sticky;
  top: 0;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 132px);
  overflow: hidden;
}

.pipeline-list {
  min-height: 160px;
  display: grid;
  gap: 9px;
  overflow-y: auto;
  padding-right: 4px;
}

.pipeline-row {
  width: 100%;
  display: grid;
  gap: 11px;
  padding: 14px;
  color: var(--text);
  text-align: left;
  border: 1px solid #e8e4ee;
  border-radius: 14px;
  background: #fbfafc;
  box-shadow: none;
}

.pipeline-row:hover,
.pipeline-row.active {
  color: var(--text);
  border-color: #cfc4ef;
  background: #f3efff;
  transform: translateY(-1px);
}

.pipeline-row-main,
.pipeline-row-meta {
  min-width: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.pipeline-row-main {
  align-items: flex-start;
  flex-direction: column;
}

.pipeline-row-main small {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-row-meta {
  flex-wrap: wrap;
}

.pipeline-row-meta em,
.pipeline-row-meta b,
.pipeline-row-meta i {
  padding: 4px 7px;
  color: var(--muted);
  border: 1px solid #e5e1eb;
  border-radius: 999px;
  background: #f4f2f7;
  font-size: 8px;
  font-style: normal;
  font-weight: 750;
}

.pipeline-row-meta i.ok {
  color: #16875a;
  border-color: #bfe5d5;
  background: var(--success-soft);
}

.pipeline-row-meta i.bad {
  color: #b33f4a;
  border-color: #efc9cd;
  background: var(--danger-soft);
}

.pipeline-editor-panel {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.pipeline-welcome {
  position: relative;
  overflow: hidden;
  padding: 28px;
  color: #fff;
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 0, rgba(255, 255, 255, 0.2), transparent 16rem),
    linear-gradient(130deg, #4e3aa7, #7961d7 56%, #a57ce8);
}

.pipeline-welcome::after {
  position: absolute;
  width: 180px;
  height: 180px;
  right: -90px;
  bottom: -120px;
  content: "";
  border: 24px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
}

.pipeline-welcome .panel-kicker,
.pipeline-welcome p {
  color: rgba(255, 255, 255, 0.82);
}

.pipeline-welcome h3 {
  margin: 5px 0 9px;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
}

.pipeline-steps {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.pipeline-steps span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 10px;
  font-weight: 700;
}

.pipeline-steps b {
  width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  color: #5943ad;
  border-radius: 50%;
  background: #fff;
  font-size: 9px;
}

.pipeline-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pipeline-template-card {
  min-height: 140px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 9px;
  padding: 16px;
  color: var(--text);
  text-align: left;
  border: 1px solid #e5e0ec;
  background: #fff;
  box-shadow: none;
}

.pipeline-template-card:hover {
  border-color: #cfc4ef;
  background: #faf8ff;
  transform: translateY(-2px);
}

.pipeline-template-card span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.pipeline-template-card em {
  margin-top: auto;
  color: var(--accent-strong);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.pipeline-editor-head {
  padding-bottom: 14px;
  border-bottom: 1px solid #ece8f2;
}

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

.pipeline-metric-strip .metric-card {
  min-height: 92px;
  padding: 14px;
  box-shadow: none;
}

.pipeline-metric-strip .metric-card .value {
  font-size: 1.35rem;
}

.pipeline-main-form {
  padding: 15px;
  border: 1px solid #e9e5f0;
  border-radius: 15px;
  background: #faf9fc;
}

.pipeline-rules-section,
.pipeline-trace-section {
  display: grid;
  gap: 12px;
}

.pipeline-rule-list,
.pipeline-trace-list {
  display: grid;
  gap: 10px;
}

.pipeline-rule-card {
  position: relative;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 13px;
  padding: 13px;
  border: 1px solid #e5e0ec;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 9px 24px rgba(52, 42, 84, 0.045);
}

.pipeline-rule-order {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
}

.pipeline-rule-order > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  border: 1px solid #dcd3f4;
  border-radius: 11px;
  background: var(--accent-soft);
  font-weight: 850;
}

.pipeline-rule-order > div {
  display: grid;
  gap: 5px;
}

.pipeline-rule-body {
  min-width: 0;
}

.pipeline-rule-heading {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: flex-start;
}

.pipeline-rule-heading > div {
  display: grid;
  gap: 3px;
}

.pipeline-rule-heading p:not(.panel-kicker) {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.compact-toggle {
  min-width: 105px;
}

.pipeline-rule-form {
  margin-top: 12px;
}

.pipeline-rule-form textarea {
  min-height: 116px;
  color: #eae7f5;
  border-color: #353148;
  background: #262334;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  line-height: 1.55;
}

.pipeline-rule-form small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.pipeline-rule-delete {
  align-self: start;
}

.pipeline-save-actions {
  position: sticky;
  z-index: 4;
  bottom: 0;
  padding: 12px;
  border: 1px solid #e0daeb;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -12px 30px rgba(52, 42, 84, 0.08);
  backdrop-filter: blur(12px);
}

.pipeline-trace-section {
  padding-top: 16px;
  border-top: 1px solid #ece8f2;
}

.pipeline-trace-item {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #e5e9e6;
  border-left: 4px solid #35a774;
  border-radius: 12px;
  background: #fbfdfc;
}

.pipeline-trace-item.dropped {
  border-color: #f0d7c3;
  border-left-color: #e49b46;
  background: #fffaf4;
}

.pipeline-trace-head {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.pipeline-trace-head span {
  color: var(--muted);
  font-size: 9px;
}

.pipeline-trace-head em {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 750;
}

.pipeline-trace-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pipeline-trace-rules span {
  padding: 4px 7px;
  color: var(--muted);
  border: 1px solid #e6e2eb;
  border-radius: 999px;
  background: #f4f2f7;
  font-size: 8px;
}

.pipeline-trace-rules span.ok {
  color: #16875a;
  border-color: #bfe5d5;
  background: var(--success-soft);
}

.pipeline-trace-rules span.warn {
  color: #9b6420;
  border-color: #ecd6b8;
  background: #fff7eb;
}

.pipeline-trace-rules span.bad {
  color: #b33f4a;
  border-color: #efc9cd;
  background: var(--danger-soft);
}

@media (max-width: 1180px) {
  .pipeline-workspace {
    grid-template-columns: 1fr;
  }

  .pipeline-list-panel {
    position: static;
    max-height: none;
  }

  .pipeline-list {
    max-height: 360px;
  }
}

@media (max-width: 760px) {
  .pipeline-template-grid,
  .pipeline-metric-strip {
    grid-template-columns: 1fr 1fr;
  }

  .pipeline-rule-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .pipeline-rule-delete {
    grid-column: 1 / -1;
    width: 100%;
  }

  .pipeline-rule-heading {
    flex-direction: column;
  }

  .compact-toggle {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .pipeline-template-grid,
  .pipeline-metric-strip {
    grid-template-columns: 1fr;
  }

  .pipeline-welcome {
    padding: 20px;
  }

  .pipeline-rule-card {
    grid-template-columns: 1fr;
  }

  .pipeline-rule-order {
    align-items: center;
    flex-direction: row;
  }

  .pipeline-rule-order > div {
    display: flex;
  }

  .pipeline-save-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Interpreter catalog */
.protocols-list-panel {
  position: sticky;
  top: 98px;
  height: calc(100vh - 116px);
  height: calc(100dvh - 116px);
  min-height: 0;
  max-height: calc(100vh - 116px);
  max-height: calc(100dvh - 116px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.protocols-list-panel #protocolsGrid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #d5cfe4 transparent;
}

.protocol-simple-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.protocol-simple-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  color: var(--text);
  border: 1px solid #e7e3ec;
  border-radius: 13px;
  background: #fff;
  box-shadow: none;
  text-align: left;
}

.protocol-simple-row:hover,
.protocol-simple-row.active {
  color: var(--text);
  border-color: #cfc4ef;
  background: #f5f1ff;
  box-shadow: 0 8px 20px rgba(52, 42, 84, 0.06);
}

.protocol-simple-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  border: 1px solid #ddd5f4;
  border-radius: 11px;
  overflow: hidden;
  padding: 3px;
  background: #fff;
  font-size: 9px;
  font-weight: 850;
}

.protocol-brand-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 8px;
}

.protocol-simple-copy,
.protocol-simple-meta {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.protocol-simple-copy strong {
  font-size: 10px;
}

.protocol-simple-copy small,
.protocol-simple-meta small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.protocol-simple-meta {
  max-width: 150px;
  text-align: right;
}

.protocol-simple-meta b {
  color: var(--accent-strong);
  font-size: 9px;
}

.protocol-source-card {
  margin-top: 14px;
}

.protocol-source-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
}

.protocol-source-list {
  max-height: 430px;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow: auto;
}

.protocol-source-list .protocol-doc-item {
  width: 100%;
}

.protocol-source-preview {
  min-width: 0;
}

.protocol-source-preview .protocol-readme {
  min-height: 260px;
  max-height: 540px;
}

.exporter-format-explainer {
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  color: #4d4770;
  border: 1px solid #ddd5f4;
  border-radius: 12px;
  background: #f8f5ff;
}

.exporter-format-explainer strong {
  font-size: 10px;
}

.exporter-format-explainer span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

/* Port Center */
.ports-workspace {
  display: grid;
  grid-template-columns: minmax(370px, 0.78fr) minmax(560px, 1.22fr);
  gap: 16px;
  align-items: start;
}

.ports-list-panel {
  position: sticky;
  top: 98px;
  height: calc(100vh - 116px);
  height: calc(100dvh - 116px);
  min-width: 0;
  min-height: 0;
  max-height: calc(100vh - 116px);
  max-height: calc(100dvh - 116px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ports-list-panel #listenersGrid {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
}

.ports-list-panel .panel-head {
  flex: 0 0 auto;
}

.ports-list-panel .diagnostic-actions {
  flex-wrap: nowrap;
}

.ports-list-panel .diagnostic-actions button {
  min-height: 38px;
  padding: 9px 11px;
  white-space: nowrap;
}

.ports-detail-column,
.port-detail-panel {
  min-width: 0;
}

.port-detail-panel {
  scroll-margin-top: 96px;
}

.port-create-panel {
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.listener-list-toolbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  align-items: stretch;
  justify-content: stretch;
  margin-bottom: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.listener-list-toolbar .search-input {
  width: 100%;
  max-width: none;
}

.port-list-sampling {
  min-height: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 9px;
}

.port-list-sampling .refresh-paused-badge {
  min-height: 24px;
  padding: 4px 8px;
  font-size: 8px;
}

.port-list {
  min-height: 0;
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1px 4px 1px 1px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #d5cfe4 transparent;
}

.port-list-item {
  min-width: 0;
  display: block;
  border: 1px solid #e8e4ef;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.port-list-item:hover {
  border-color: #d6cff0;
  box-shadow: 0 8px 20px rgba(52, 42, 84, 0.07);
}

.port-list-item.active {
  border-color: #bcaeea;
  background: #f8f5ff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.port-list-open {
  width: 100%;
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 9px 34px 54px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 11px 8px 11px 12px;
  color: var(--text);
  border: 0;
  border-radius: 13px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  text-align: left;
}

.protocol-brand-logo-port {
  width: 34px;
  height: 34px;
  padding: 2px;
  border: 1px solid #e3deea;
  border-radius: 10px;
  background: #fff;
}

.port-list-open:hover {
  background: transparent;
}

.port-pulse {
  width: 9px;
  height: 9px;
  display: inline-block;
  flex: 0 0 auto;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #b4b0be;
  box-shadow: 0 0 0 2px #e5e2e9;
}

.port-pulse.live {
  background: #24b475;
  box-shadow: 0 0 0 2px #ccebdd, 0 0 0 6px rgba(36, 180, 117, 0.08);
  animation: port-live-pulse 2s ease-in-out infinite;
}

.port-pulse.recent {
  background: #4f8fdc;
  box-shadow: 0 0 0 2px #d5e3f6;
}

@keyframes port-live-pulse {
  50% { box-shadow: 0 0 0 2px #ccebdd, 0 0 0 9px rgba(36, 180, 117, 0); }
}

.port-list-number {
  min-height: 35px;
  display: grid;
  place-items: center;
  padding: 5px 7px;
  color: var(--accent-strong);
  border: 1px solid #ddd5f4;
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 850;
}

.port-list-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.port-list-copy strong,
.port-list-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.port-list-copy strong {
  font-size: 11px;
}

.port-list-copy small {
  color: var(--muted);
  font-size: 9px;
}

.port-list-meta {
  grid-column: 4;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 3px 8px;
  margin-top: 2px;
}

.port-list-meta b {
  color: var(--text);
  font-size: 9px;
}

.port-list-meta small,
.port-list-meta em {
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
}

.port-list-meta em {
  color: #4f76a5;
  font-weight: 750;
}

.port-detail-empty {
  min-height: 420px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 40px;
  color: var(--muted);
  border: 1px dashed #d9d3e6;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 28%, rgba(114, 87, 213, 0.08), transparent 32%),
    #fff;
  text-align: center;
}

.port-detail-empty h3 {
  color: var(--text);
  font-size: 1.35rem;
}

.port-detail-empty > p:not(.panel-kicker) {
  max-width: 500px;
  font-size: 11px;
  line-height: 1.55;
}

.port-detail-empty-icon {
  width: 42px;
  height: 42px;
  border: 11px solid #e4def7;
  border-radius: 50%;
  background: var(--accent);
}

.port-detail-empty-flow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.port-detail-empty-flow span {
  padding: 7px 10px;
  color: var(--accent-strong);
  border: 1px solid #dfd7f5;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 9px;
  font-weight: 800;
}

.port-detail-empty-flow i {
  width: 20px;
  height: 1px;
  background: #cfc7e2;
}

.port-control-card {
  padding: 0;
  overflow: hidden;
}

.port-control-card:hover {
  box-shadow: var(--shadow);
}

.port-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #ece8f2;
}

.port-detail-identity {
  min-width: 0;
  display: flex;
  gap: 13px;
  align-items: center;
}

.protocol-brand-logo-detail {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  padding: 3px;
  border: 1px solid #e2ddeb;
  border-radius: 13px;
  background: #fff;
}

.port-detail-identity > span:last-child {
  min-width: 0;
}

.port-detail-identity h3 {
  overflow: hidden;
  margin-top: 3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.port-detail-identity small {
  color: var(--muted);
  font-size: 10px;
}

.port-detail-number {
  min-width: 70px;
  min-height: 52px;
  display: grid;
  place-items: center;
  padding: 8px;
  color: #fff;
  border-radius: 15px;
  background: linear-gradient(145deg, #7257d5, #4e3ca3);
  box-shadow: 0 9px 22px rgba(87, 64, 170, 0.2);
  font-size: 14px;
  font-weight: 850;
}

.port-health-ribbon {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) repeat(3, minmax(92px, 0.65fr)) minmax(155px, 1fr);
  border-bottom: 1px solid #ece8f2;
  background: #faf9fc;
}

.port-health-item {
  min-width: 0;
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 13px 14px;
  border-right: 1px solid #ece8f2;
}

.port-health-item:last-child {
  border-right: 0;
}

.port-health-item.primary {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.port-health-item.primary > span:last-child {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.port-health-item small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.port-health-item strong {
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  text-overflow: ellipsis;
}

.port-health-item .health-healthy { color: #16875a; }
.port-health-item .health-degraded { color: #a56a1d; }
.port-health-item .health-down { color: #b33f4a; }
.port-health-item .health-idle { color: #3b70bf; }

.port-attention-strip {
  display: grid;
  gap: 3px;
  margin: 14px 20px 0;
  padding: 11px 13px;
  color: #8a5b22;
  border: 1px solid #ead7bc;
  border-radius: 12px;
  background: #fff9ef;
  font-size: 9px;
}

.port-config-block {
  padding: 20px;
  border-bottom: 1px solid #ece8f2;
}

.port-media-primary {
  background:
    radial-gradient(circle at 94% 8%, rgba(40, 164, 132, 0.1), transparent 30%),
    linear-gradient(180deg, #fff, #fbfdfc);
}

.port-media-primary.hidden {
  display: none;
}

.port-media-route {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.port-media-route > div {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 12px;
  border: 1px solid #dfe9e5;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.9);
}

.port-media-route > i {
  display: none;
}

.port-media-route small {
  color: #58726a;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.port-media-route strong {
  overflow-wrap: anywhere;
  color: #183e35;
  font-size: 10px;
}

.port-media-route span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.port-media-reservation {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  color: #536b64;
  border: 1px solid #d9e8e2;
  border-radius: 11px;
  background: #f1faf6;
  font-size: 9px;
  line-height: 1.45;
}

.port-media-reservation strong {
  flex: 0 0 auto;
  color: #20725e;
}

.port-media-primary [data-media-primary-content] {
  margin-top: 17px;
}

.port-media-primary [data-media-primary-content] > .protocol-settings-section {
  padding-top: 0;
  border-top: 0;
}

@media (max-width: 920px) {
  .port-media-route {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .port-media-reservation {
    display: grid;
  }
}

@media (max-width: 560px) {
  .port-media-route {
    grid-template-columns: 1fr;
  }
}

.port-config-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  margin-bottom: 15px;
}

.port-config-heading-actions {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.port-config-heading h4 {
  font-size: 1rem;
}

.port-config-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.port-step {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  border: 1px solid #dcd3f4;
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 850;
}

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

.port-enabled-toggle {
  align-self: end;
}

.port-change-note {
  margin-top: 10px;
  padding: 9px 11px;
  color: #716b7d;
  border-radius: 10px;
  background: #f6f4f8;
  font-size: 9px;
  line-height: 1.45;
}

.port-parser-control {
  display: grid;
  grid-template-columns: minmax(190px, 0.75fr) minmax(0, 1.25fr);
  gap: 12px;
  align-items: stretch;
}

.port-parser-summary {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid #e5e0ee;
  border-radius: 12px;
  background: #faf9fc;
}

.port-parser-summary > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.port-parser-summary small,
.port-parser-summary em {
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
  line-height: 1.4;
}

.port-parser-summary strong {
  font-size: 10px;
}

.port-normalization-note {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 11px 13px;
  color: #4d4770;
  border: 1px solid #ddd5f4;
  border-radius: 12px;
  background: linear-gradient(135deg, #f7f3ff, #fbfaff);
}

.port-normalization-note strong {
  font-size: 10px;
}

.port-normalization-note span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.port-exporter-grid {
  max-height: 260px;
  overflow: auto;
}

.port-exporter-grid .exporter-choice small {
  max-width: 520px;
  overflow: hidden;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.port-output-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-top: 11px;
}

.port-output-toolbar small {
  color: var(--muted);
  font-size: 9px;
}

.port-quick-exporter {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #d9d0f1;
  border-radius: 14px;
  background: #faf8ff;
}

.port-quick-exporter.hidden {
  display: none;
}

.port-quick-exporter-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.port-quick-exporter-head > span {
  display: grid;
  gap: 4px;
}

.port-quick-exporter-head strong {
  font-size: 11px;
}

.port-quick-exporter-head small {
  color: var(--muted);
  font-size: 9px;
}

.port-delivery-mode {
  max-width: 360px;
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.port-advanced {
  border-bottom: 1px solid #ece8f2;
  background: #fbfafc;
}

.port-advanced > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  list-style: none;
}

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

.port-advanced > summary::after {
  content: "+";
  color: var(--accent);
  font-size: 17px;
}

.port-advanced[open] > summary::after {
  content: "−";
}

.port-advanced > summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.port-advanced-content {
  display: grid;
  gap: 16px;
  padding: 0 20px 20px;
}

.protocol-settings-section {
  display: grid;
  gap: 11px;
  padding-top: 15px;
  border-top: 1px solid #e9e5ef;
}

.protocol-settings-section.hidden {
  display: none;
}

.protocol-settings-section h5 {
  color: var(--text);
  font-size: 11px;
}

.port-gprs-status,
.port-diagnostic-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.port-gprs-status > div,
.port-diagnostic-notes > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #e9e5ef;
  border-radius: 11px;
  background: #fff;
}

.port-gprs-status small,
.port-diagnostic-notes small {
  color: var(--muted);
  font-size: 8px;
}

.port-gprs-status strong,
.port-diagnostic-notes strong {
  overflow-wrap: anywhere;
  font-size: 9px;
  line-height: 1.45;
}

.port-danger-zone {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 13px;
  border: 1px solid #efd2d5;
  border-radius: 12px;
  background: #fff8f8;
}

.port-danger-zone > span {
  display: grid;
  gap: 4px;
}

.port-danger-zone small {
  color: var(--muted);
  font-size: 9px;
}

.port-detail-actions {
  position: sticky;
  z-index: 4;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #e6e1ed;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 -12px 30px rgba(52, 42, 84, 0.07);
  backdrop-filter: blur(12px);
}

.port-detail-actions button {
  min-height: 38px;
}

.port-control-card > .card-feedback {
  margin: 0 20px 20px;
}

.port-create-intro {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #ece8f2;
}

.port-create-intro h3 {
  margin-top: 3px;
}

.port-create-intro > div:first-child > p:last-child {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.port-create-flow {
  display: flex;
  gap: 7px;
  align-items: center;
}

.port-create-flow span {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.port-create-flow b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  border: 1px solid #dcd3f4;
  border-radius: 8px;
  background: var(--accent-soft);
  font-size: 9px;
}

.port-create-flow i {
  width: 16px;
  height: 1px;
  background: #d5cfdf;
}

.port-create-step {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #e7e2ed;
  border-radius: 15px;
  background: #fff;
}

.port-create-step .port-config-heading {
  margin-bottom: 12px;
}

.port-create-step .protocol-create-helper {
  margin-top: 11px;
}

.new-listener-port-plan {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 14px;
  margin-top: 11px;
  padding: 9px 11px;
  color: #48685f;
  border: 1px solid #d8e9e3;
  border-radius: 10px;
  background: #f2faf7;
  font-size: 9px;
}

.new-listener-port-plan strong {
  color: #20725e;
}

.new-listener-inline-exporter {
  display: grid;
  gap: 11px;
  margin-top: 12px;
  padding: 13px;
  border: 1px dashed #cfc3ee;
  border-radius: 13px;
  background: #faf8ff;
}

.new-listener-inline-exporter > div:first-child {
  display: grid;
  gap: 4px;
}

.new-listener-inline-exporter strong {
  font-size: 10px;
}

.new-listener-inline-exporter small {
  color: var(--muted);
  font-size: 9px;
}

.port-create-advanced {
  margin-top: 12px;
  padding: 0 15px;
  border: 1px solid #e7e2ed;
  border-radius: 14px;
  background: #fbfafc;
}

.port-create-advanced summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 0;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.port-create-advanced summary small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.port-create-advanced > .form {
  padding-bottom: 15px;
}

@media (max-width: 1320px) {
  .ports-workspace {
    grid-template-columns: minmax(350px, 0.72fr) minmax(520px, 1.28fr);
  }

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

  .port-health-item.primary {
    grid-column: span 2;
  }

  .port-health-item:last-child {
    grid-column: auto;
    border-top: 1px solid #ece8f2;
  }
}

@media (max-width: 1080px) {
  .ports-workspace {
    grid-template-columns: 1fr;
  }

  .ports-list-panel,
  .protocols-list-panel {
    position: static;
    height: auto;
    max-height: none;
  }

  .port-list {
    max-height: 430px;
  }

  .protocols-list-panel #protocolsGrid {
    max-height: 430px;
  }

  .protocol-source-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .protocols-detail-panel .listener-meta-grid {
    grid-template-columns: 1fr;
  }

  .ports-list-panel .panel-head,
  .port-detail-header,
  .port-danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .ports-list-panel .diagnostic-actions {
    width: 100%;
  }

  .ports-list-panel .diagnostic-actions button {
    flex: 1;
  }

  .port-list-open {
    grid-template-columns: 9px 32px 52px minmax(0, 1fr);
  }

  .port-list-meta {
    grid-column: 4;
    min-width: 0;
    justify-items: start;
  }

  .port-detail-header .listener-status {
    align-self: flex-start;
  }

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

  .port-health-item.primary,
  .port-health-item:last-child {
    grid-column: 1 / -1;
  }

  .port-primary-form,
  .port-parser-control,
  .port-gprs-status,
  .port-diagnostic-notes {
    grid-template-columns: 1fr;
  }

  .port-create-intro,
  .port-quick-exporter-head {
    align-items: stretch;
    flex-direction: column;
  }

  .port-create-flow {
    flex-wrap: wrap;
  }

  .protocol-simple-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .protocol-simple-meta {
    grid-column: 2;
    max-width: none;
    text-align: left;
  }

  .port-config-heading-actions {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .port-config-heading-actions button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .port-advanced > summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .port-advanced > summary small {
    margin-left: 0;
  }

  .port-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .port-detail-identity {
    align-items: flex-start;
  }

  .port-detail-number {
    min-width: 60px;
  }

  .port-detail-actions {
    grid-template-columns: 1fr;
  }

  .port-detail-empty {
    min-height: 330px;
    padding: 24px 16px;
  }

  .port-detail-empty-flow i {
    display: none;
  }
}

/* Data inspector: manual, bounded inspection of RAW -> interpreted -> exported. */
#visorView,
#visorView .diagnostics-shell,
#visorView .diagnostics-port-panel,
#visorView .diagnostics-detail-panel,
.inspector-header,
.inspector-stage-tabs,
.inspector-stage-explanation,
.inspector-toolbar,
.inspector-layout,
.inspector-detail {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

#visorView {
  overflow-x: hidden;
}

.inspector-header,
.inspector-detail-head,
.field-dictionary-intro,
.field-dictionary-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.inspector-header h3,
.inspector-detail-head h4,
.field-dictionary-intro h4 {
  margin: 2px 0 0;
}

.inspector-stage-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.inspector-stage-tabs::before {
  position: absolute;
  z-index: 0;
  top: 18px;
  right: 8%;
  left: 8%;
  height: 2px;
  content: "";
  background: #ded9e8;
}

.inspector-stage-tabs button {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  min-height: 64px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  color: #6f687c;
  border-color: #e6e1ed;
  background: #faf9fc;
}

.inspector-stage-tabs button span {
  width: 24px;
  height: 24px;
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  color: #766e82;
  border: 1px solid #d8d2e2;
  border-radius: 50%;
  background: #fff;
  font-size: 9px;
}

.inspector-stage-tabs button.active {
  color: #fff;
  border-color: #7056c9;
  background: linear-gradient(135deg, #7056c9, #5d45b2);
  box-shadow: 0 10px 24px rgba(91, 66, 177, 0.2);
}

.inspector-stage-tabs button.active span {
  color: #5d45b2;
  border-color: #fff;
}

.inspector-stage-tabs button strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inspector-stage-explanation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding: 11px 13px;
  color: #514b60;
  border: 1px solid #e6e1ed;
  border-radius: 12px;
  background: #faf9fc;
  font-size: 9px;
}

.inspector-stage-explanation strong {
  color: #5d45b2;
}

.inspector-stage-explanation small {
  color: var(--muted);
  white-space: nowrap;
}

.inspector-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 12px 0;
}

.inspector-layout {
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
}

.inspector-identity-list .diagnostic-list-items {
  max-height: calc(100vh - 390px);
}

.inspector-identity-list .diagnostic-item {
  padding: 12px;
}

.inspector-identity-list .diagnostic-item.active {
  border-color: #cfc5ee;
  background: #f3effd;
}

.inspector-count-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.inspector-count-row span {
  padding: 3px 6px;
  color: #665f72;
  border-radius: 999px;
  background: #f0edf5;
  font-size: 7px;
  font-weight: 700;
}

.inspector-count-row span.bad {
  color: #a63a45;
  background: #fff0f1;
}

.inspector-detail {
  min-width: 0;
}

.inspector-detail-head {
  padding-bottom: 12px;
  border-bottom: 1px solid #ece8f2;
}

.inspector-empty {
  min-height: 260px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 32px;
  text-align: center;
  border: 1px dashed #dcd6e5;
  border-radius: 16px;
  background: #faf9fc;
}

.inspector-empty strong {
  color: #4e465b;
  font-size: 12px;
}

.inspector-empty p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.inspector-record-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.inspector-record {
  overflow: hidden;
  border: 1px solid #e4dfea;
  border-radius: 14px;
  background: #fff;
}

.inspector-record[open] {
  border-color: #d2c8ec;
  box-shadow: 0 10px 30px rgba(50, 39, 83, 0.08);
}

.inspector-record > summary {
  min-height: 64px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 13px;
  cursor: pointer;
  list-style: none;
  background: #faf9fc;
}

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

.inspector-record > summary span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.inspector-record > summary strong {
  overflow: hidden;
  color: #433b50;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-record > summary small,
.inspector-record > summary time {
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
}

.inspector-sequence {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #624bb5;
  border-radius: 9px;
  background: #eee9fb;
  font-size: 9px;
  font-weight: 800;
}

.inspector-record.export-record.delivered .inspector-sequence {
  color: #187851;
  background: #e6f7ef;
}

.inspector-record.export-record.failed .inspector-sequence {
  color: #aa3946;
  background: #fff0f1;
}

.inspector-record-body {
  padding: 13px;
  border-top: 1px solid #ece8f2;
}

.inspector-time-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.inspector-time-pair span {
  padding: 9px 11px;
  border-radius: 10px;
  background: #f4f1f9;
}

.inspector-time-pair small,
.inspector-time-pair strong {
  display: block;
}

.inspector-time-pair small {
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inspector-time-pair strong {
  margin-top: 3px;
  color: #4e4269;
  font-size: 9px;
}

.inspector-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.inspector-meta-strip span {
  padding: 6px 8px;
  color: #736d7e;
  border: 1px solid #ebe7f0;
  border-radius: 8px;
  background: #fbfafc;
  font-size: 8px;
}

.inspector-meta-strip strong {
  margin-left: 3px;
  color: #4d4658;
}

.inspector-meta-strip strong.ok {
  color: #187851;
}

.inspector-meta-strip strong.bad {
  color: #aa3946;
}

.inspector-warning {
  margin-top: 9px;
  padding: 8px 10px;
  color: #7c5b1f;
  border: 1px solid #f0d79e;
  border-radius: 9px;
  background: #fff8e8;
  font-size: 8px;
}

.inspector-payload {
  max-height: 340px;
  margin: 10px 0 0;
  overflow: auto;
  padding: 12px;
  color: #d9f6e7;
  border: 1px solid #1f3b35;
  border-radius: 10px;
  background: #10241f;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}

.inspector-payload.hex {
  color: #b9d4ff;
  background: #101d2f;
}

.inspector-payload.response {
  color: #3e3850;
  border-color: #e3deeb;
  background: #f8f6fb;
}

.inspector-payload-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.inspector-payload-group > div > span {
  color: #5c5468;
  font-size: 8px;
  font-weight: 800;
}

.inspector-json-block {
  margin-top: 10px;
}

.inspector-json-block > summary {
  color: #654db7;
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
}

.inspector-field-table {
  margin-top: 10px;
}

.inspector-field-table td:first-child strong,
.inspector-field-table td:first-child small,
.field-dictionary-table td:nth-child(2) strong,
.field-dictionary-table td:nth-child(2) code,
.field-dictionary-table td:nth-child(2) small {
  display: block;
}

.inspector-field-table td:first-child small,
.field-dictionary-table td:nth-child(2) small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 7px;
}

.inspector-field-table code,
.field-dictionary-table code {
  color: #6954ad;
  font-size: 7px;
  overflow-wrap: anywhere;
}

.field-dictionary-intro {
  margin-top: 12px;
  padding: 13px;
  border: 1px solid #ded6f1;
  border-radius: 13px;
  background: #f7f3ff;
}

.field-dictionary-intro p,
.field-dictionary-footer p {
  max-width: 680px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
}

.field-dictionary-table-wrap {
  max-height: 680px;
  margin-top: 10px;
  overflow: auto;
  border: 1px solid #e4dfea;
  border-radius: 12px;
}

.field-dictionary-table {
  margin: 0;
}

.field-dictionary-table thead {
  position: sticky;
  z-index: 2;
  top: 0;
}

.field-dictionary-table td:nth-child(1) {
  width: 62px;
  text-align: center;
}

.field-dictionary-table td:nth-child(2) {
  min-width: 180px;
}

.field-dictionary-table td:nth-child(3) {
  max-width: 280px;
  overflow-wrap: anywhere;
}

.field-dictionary-table input[type="text"],
.field-dictionary-table input:not([type]) {
  min-width: 150px;
}

.field-dictionary-footer {
  margin-top: 10px;
  padding: 12px;
  align-items: center;
  border-top: 1px solid #ece8f2;
}

@media (max-width: 1080px) {
  .inspector-layout {
    grid-template-columns: 1fr;
  }

  .inspector-identity-list .diagnostic-list-items {
    max-height: 360px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .inspector-header,
  .inspector-detail-head,
  .field-dictionary-intro,
  .field-dictionary-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .inspector-header button,
  .field-dictionary-footer button {
    width: 100%;
    max-width: 100%;
  }

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

  .inspector-stage-tabs::before {
    display: none;
  }

  .inspector-stage-explanation {
    grid-template-columns: 1fr;
  }

  .inspector-stage-explanation small {
    white-space: normal;
  }

  .inspector-toolbar,
  .inspector-time-pair,
  .inspector-payload-group {
    grid-template-columns: 1fr;
  }

  .inspector-identity-list .diagnostic-list-items {
    grid-template-columns: 1fr;
  }

  .inspector-record > summary {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .inspector-record > summary time {
    grid-column: 2;
  }

  .field-dictionary-table {
    min-width: 760px;
  }
}

.camera-console {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}

.camera-directory-panel,
.camera-workspace-panel {
  min-width: 0;
  min-height: calc(100vh - 150px);
}

.camera-directory-panel {
  position: sticky;
  top: 112px;
  display: flex;
  max-height: calc(100vh - 132px);
  flex-direction: column;
}

.camera-port-filter {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
}

.camera-port-filter > span,
.camera-command-form label > span,
.camera-record-toolbar label > span,
.camera-channel-control label > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.camera-directory-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.camera-directory-search button {
  min-width: 72px;
}

.camera-directory-panel .diagnostic-list-meta {
  margin: 12px 0 8px;
}

.camera-device-list {
  min-height: 180px;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 4px 12px 0;
}

.camera-device-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  padding: 13px;
  color: var(--text);
  border: 1px solid #e4dfea;
  border-radius: 15px;
  background: #fff;
  box-shadow: none;
  text-align: left;
}

.camera-device-item:hover,
.camera-device-item.active {
  color: var(--text);
  border-color: #b9addc;
  background: #f7f4ff;
  transform: none;
}

.camera-device-item.active {
  box-shadow: inset 3px 0 #6752b3;
}

.camera-device-identity {
  min-width: 0;
  display: flex;
  gap: 9px;
  align-items: center;
}

.camera-device-identity > span:last-child,
.camera-device-identity strong,
.camera-device-identity small {
  min-width: 0;
  display: block;
}

.camera-device-identity strong {
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-device-identity small,
.camera-device-time,
.camera-device-item p {
  color: var(--muted);
  font-size: 8px;
}

.camera-device-identity small {
  margin-top: 3px;
}

.camera-device-time {
  white-space: nowrap;
}

.camera-device-item p {
  grid-column: 1 / -1;
  margin: 0;
  overflow: hidden;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-directory-empty {
  padding: 22px 12px;
}

.camera-workspace-panel {
  overflow: hidden;
}

.camera-workspace-empty {
  min-height: 520px;
  display: grid;
  place-content: center;
  gap: 9px;
  padding: 40px;
  text-align: center;
}

.camera-workspace-empty span {
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.camera-workspace-empty strong {
  color: var(--text);
  font-family: var(--display);
  font-size: 30px;
}

.camera-workspace-empty p {
  max-width: 470px;
  color: var(--muted);
  line-height: 1.6;
}

.camera-workspace-head,
.camera-workspace-title,
.camera-workspace-title > span,
.camera-section-head,
.camera-section-head > span,
.camera-section-title,
.camera-section-title > span {
  display: flex;
}

.camera-workspace-head,
.camera-section-head,
.camera-section-title {
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.camera-workspace-title {
  min-width: 0;
  gap: 12px;
  align-items: center;
}

.camera-workspace-title > span,
.camera-section-head > span,
.camera-section-title > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.camera-workspace-title small,
.camera-workspace-title strong,
.camera-workspace-title p {
  display: block;
}

.camera-workspace-title small,
.camera-section-head small,
.camera-section-title small {
  color: var(--accent);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.camera-workspace-title strong {
  overflow: hidden;
  color: var(--text);
  font-family: var(--display);
  font-size: 23px;
  text-overflow: ellipsis;
}

.camera-workspace-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.camera-brand-logo {
  width: 44px;
  height: 44px;
  padding: 7px;
  border: 1px solid #e2ddea;
  border-radius: 13px;
  background: #fff;
}

.camera-tabs {
  display: flex;
  gap: 7px;
  margin: 18px -4px 0;
  padding: 4px;
  overflow-x: auto;
  border-bottom: 1px solid #e5e0e9;
}

.camera-tabs button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 9px 13px;
  color: var(--muted);
  border: 0;
  border-radius: 10px 10px 0 0;
  background: transparent;
  box-shadow: none;
}

.camera-tabs button:hover,
.camera-tabs button.active {
  color: #5f48aa;
  background: #f3effc;
  transform: none;
}

.camera-tab-content {
  min-height: 520px;
  padding-top: 18px;
}

.camera-workspace-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 12px;
  color: var(--muted);
  border-top: 1px solid #e8e3ec;
  font-size: 8px;
}

.camera-action-feedback {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 14px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #d7cdec;
  border-radius: 13px;
  background: #f6f2ff;
}

.camera-action-feedback strong,
.camera-action-feedback span {
  grid-column: 1;
}

.camera-action-feedback strong {
  color: var(--text);
  font-size: 9px;
}

.camera-action-feedback span,
.camera-action-feedback small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.camera-action-feedback small {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}

.camera-action-feedback.success {
  border-color: #b9dfd1;
  background: #effaf6;
}

.camera-action-feedback.warning {
  border-color: #ead49a;
  background: #fff9e9;
}

.camera-action-feedback.error {
  border-color: #efc5c5;
  background: #fff4f4;
}

.camera-operational-warnings {
  display: grid;
  gap: 9px;
  margin-bottom: 14px;
}

.camera-operational-warning {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 13px;
  border: 1px solid #eadca8;
  border-radius: 14px;
  background: #fffaf0;
}

.camera-operational-warning > span {
  min-width: 36px;
  padding: 6px 7px;
  color: #735c15;
  border-radius: 9px;
  background: #f4e7b7;
  font-size: 8px;
  font-weight: 900;
  text-align: center;
}

.camera-operational-warning div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.camera-operational-warning strong {
  color: var(--text);
  font-size: 10px;
}

.camera-operational-warning p {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.camera-operational-warning button {
  width: max-content;
  margin-top: 4px;
}

.camera-operational-warning.important {
  border-color: #efc3b2;
  background: #fff5f0;
}

.camera-operational-warning.resolved {
  border-color: #b9dfd1;
  background: #effaf6;
}

.camera-setup-assistant {
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid #ddd4eb;
  border-radius: 17px;
  background: #f8f6fc;
}

.camera-setup-assistant > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  cursor: pointer;
  list-style: none;
}

.camera-setup-assistant > summary::-webkit-details-marker {
  display: none;
}

.camera-setup-assistant > summary span {
  display: grid;
  gap: 3px;
}

.camera-setup-assistant > summary small,
.camera-setup-assistant > p {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.camera-setup-assistant > summary strong {
  color: var(--text);
  font-size: 11px;
}

.camera-setup-assistant > summary b {
  padding: 6px 9px;
  color: #6c4db1;
  border-radius: 999px;
  background: #eee7fb;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.camera-readiness-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px 13px;
}

.camera-readiness-list > div {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 7px;
  padding: 10px;
  border: 1px solid #e2dde9;
  border-radius: 11px;
  background: #fff;
}

.camera-readiness-list > div > span {
  width: 8px;
  height: 8px;
  grid-row: 1 / span 2;
  margin-top: 2px;
  border-radius: 50%;
  background: #d89b49;
}

.camera-readiness-list > div.ready > span {
  background: #27a474;
  box-shadow: 0 0 0 3px #def3eb;
}

.camera-readiness-list strong {
  color: var(--text);
  font-size: 8px;
}

.camera-readiness-list small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 7px;
  line-height: 1.35;
}

.camera-setup-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 14px 16px;
  border-top: 1px solid #e4deea;
  background: #fff;
}

.camera-setup-form label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.camera-setup-form .span-2 {
  grid-column: span 2;
}

.camera-setup-assistant > p {
  margin: 0;
  padding: 12px 16px 14px;
}

.camera-overview-grid,
.camera-control-grid,
.camera-activity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
}

.camera-map-card,
.camera-telemetry-card,
.camera-command-panel,
.camera-audio-panel,
.camera-resource-results {
  min-width: 0;
  padding: 16px;
  border: 1px solid #e2dce8;
  border-radius: 17px;
  background: #fbfafd;
}

.camera-section-head strong,
.camera-section-title strong {
  color: var(--text);
  font-size: 11px;
}

.camera-section-head a {
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
}

.camera-map {
  height: 360px;
  margin-top: 13px;
  overflow: hidden;
  border: 1px solid #ded9e4;
  border-radius: 14px;
  background: #ece9f0;
  z-index: 0;
}

.camera-map-empty {
  min-height: 360px;
  display: grid;
  place-items: center;
  margin-top: 13px;
  padding: 26px;
  color: var(--muted);
  border: 1px dashed #d8d1e0;
  border-radius: 14px;
  background: #f7f5f9;
  line-height: 1.55;
  text-align: center;
}

.camera-position-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 8px;
}

.camera-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 13px;
}

.camera-telemetry-grid > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid #e6e1e9;
  border-radius: 12px;
  background: #fff;
}

.camera-telemetry-grid small {
  color: var(--muted);
  font-size: 8px;
}

.camera-telemetry-grid strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 10px;
}

.camera-telemetry-grid .camera-telemetry-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.5;
}

.camera-capability-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.camera-capability-row > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 13px;
  border: 1px solid #e3deea;
  border-radius: 14px;
  background: #fff;
}

.camera-capability-row small,
.camera-capability-row span {
  color: var(--muted);
  font-size: 8px;
}

.camera-capability-row strong {
  color: var(--text);
  font-size: 12px;
}

.camera-capability-row span {
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.camera-route-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
  padding: 14px;
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: #f4f0fb;
}

.camera-route-summary > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.camera-route-summary small,
.camera-route-summary span {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.camera-route-summary strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 9px;
}

.camera-live-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 16px;
}

.camera-simple-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}

.camera-simple-status > div {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid #e3dee8;
  border-radius: 13px;
  background: #fff;
}

.camera-simple-status > div > span {
  width: 10px;
  height: 10px;
  grid-row: 1 / span 2;
  border-radius: 50%;
  background: #c8c2cd;
}

.camera-simple-status > div.ready > span {
  background: #24a274;
  box-shadow: 0 0 0 4px #e2f5ee;
}

.camera-simple-status > div.live > span {
  background: #ef5b51;
  box-shadow: 0 0 0 4px #fde7e5;
  animation: camera-live-pulse 1.8s ease-in-out infinite;
}

.camera-simple-status > div.blocked > span {
  background: #d28c32;
  box-shadow: 0 0 0 4px #faecd9;
}

.camera-simple-status small {
  color: var(--muted);
  font-size: 7px;
  text-transform: uppercase;
}

.camera-simple-status strong {
  overflow: hidden;
  color: var(--text);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes camera-live-pulse {
  50% {
    box-shadow: 0 0 0 7px rgba(239, 91, 81, 0.08);
  }
}

.camera-live-stage {
  min-height: 500px;
  display: grid;
  overflow: hidden;
  border-radius: 18px;
  background: #17141d;
}

.camera-live-stage iframe {
  width: 100%;
  height: 100%;
  min-height: 500px;
  border: 0;
}

.camera-live-player-shell {
  min-width: 0;
  min-height: 500px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.camera-player-caption {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 10px 13px;
  color: #d9d4df;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: #221e28;
}

.camera-player-caption > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4fd3a2;
  box-shadow: 0 0 0 4px rgba(79, 211, 162, 0.12);
}

.camera-player-caption strong {
  color: #fff;
  font-size: 8px;
}

.camera-player-caption small {
  color: #aaa3b3;
  font-size: 7px;
  line-height: 1.4;
}

.camera-live-placeholder {
  display: grid;
  place-content: center;
  gap: 9px;
  padding: 42px;
  color: #fff;
  text-align: center;
}

.camera-live-placeholder span {
  color: #bbaaf1;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.camera-live-placeholder strong {
  font-family: var(--display);
  font-size: 25px;
}

.camera-live-placeholder p {
  max-width: 470px;
  color: #aaa3b3;
  line-height: 1.55;
}

.camera-live-controls {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 16px;
  border: 1px solid #e1dce7;
  border-radius: 18px;
  background: #faf9fc;
}

.camera-primary-action-copy {
  display: grid;
  gap: 5px;
  margin-bottom: 5px;
  padding-bottom: 13px;
  border-bottom: 1px solid #e5e0e9;
}

.camera-primary-action-copy small {
  color: var(--accent);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.camera-primary-action-copy strong {
  color: var(--text);
  font-family: var(--display);
  font-size: 20px;
}

.camera-primary-action-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.camera-primary-button {
  min-height: 44px;
  font-size: 10px;
}

.camera-live-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 4px;
}

.camera-live-metrics > span {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid #e4dfe8;
  border-radius: 10px;
  background: #fff;
}

.camera-live-metrics small {
  color: var(--muted);
  font-size: 6px;
  text-transform: uppercase;
}

.camera-live-metrics strong {
  overflow: hidden;
  color: var(--text);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-channel-control label {
  display: grid;
  gap: 6px;
}

.camera-live-route {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  padding-top: 13px;
  border-top: 1px solid #e5e0e9;
}

.camera-live-route small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
}

.camera-live-route strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 8px;
  line-height: 1.45;
}

.camera-record-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 10px;
  padding: 15px;
  border: 1px solid #e1dbe7;
  border-radius: 17px;
  background: #faf9fc;
}

.camera-record-toolbar.simple {
  margin: 12px 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.camera-media-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
  gap: 13px;
}

.camera-media-actions > article {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 13px;
  padding: 17px;
  border: 1px solid #e1dbe7;
  border-radius: 17px;
  background: #fbfafd;
}

.camera-media-actions article > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.camera-action-number {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 10px;
  background: #7155be;
  font-size: 10px;
  font-weight: 900;
}

.camera-media-actions small {
  color: var(--accent);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.camera-media-actions strong {
  color: var(--text);
  font-size: 12px;
}

.camera-media-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.camera-record-toolbar label,
.camera-command-form label {
  display: grid;
  gap: 7px;
}

.camera-record-toolbar input {
  width: 100%;
  min-width: 0;
}

.camera-record-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.camera-resource-results,
.camera-resource-empty {
  margin-top: 15px;
}

.camera-resource-results table {
  width: 100%;
  min-width: 680px;
  margin-top: 12px;
  border-collapse: collapse;
}

.camera-resource-results th,
.camera-resource-results td {
  padding: 9px 10px;
  color: var(--muted);
  border-top: 1px solid #e8e3eb;
  font-size: 8px;
  text-align: left;
}

.camera-resource-results th {
  color: var(--text);
}

.camera-resource-empty {
  padding: 14px;
  color: var(--muted);
  border: 1px dashed #dcd5e2;
  border-radius: 13px;
  background: #faf9fb;
  font-size: 9px;
  line-height: 1.5;
}

.camera-section-title {
  margin: 18px 0 12px;
}

.camera-ready-library {
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid #d8d0e4;
  border-radius: 16px;
  background: linear-gradient(145deg, #ffffff 0%, #faf8fd 100%);
  box-shadow: 0 12px 34px rgba(42, 31, 68, 0.06);
}

.camera-ready-library .camera-section-title {
  margin: 0 0 8px;
}

.camera-library-help {
  max-width: 880px;
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.camera-media-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.camera-media-summary > span {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 11px;
  border: 1px solid #e4dfe8;
  border-radius: 11px;
  background: #fff;
}

.camera-media-summary strong {
  color: var(--accent);
  font-size: 15px;
}

.camera-media-summary small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.camera-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 13px;
}

.camera-media-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 9px;
}

.camera-playable-card {
  border-color: #dcd4e8;
  box-shadow: 0 10px 28px rgba(42, 31, 68, 0.06);
}

.camera-command-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
}

.camera-command-form .span-2 {
  grid-column: 1 / -1;
}

.camera-control-route {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}

.camera-control-route > div {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid #e4dfe8;
  border-radius: 11px;
  background: #fff;
}

.camera-control-route small,
.camera-control-route strong {
  font-size: 8px;
  line-height: 1.45;
}

.camera-control-route small {
  color: var(--accent);
  font-weight: 850;
  text-transform: uppercase;
}

.camera-control-route strong {
  overflow-wrap: anywhere;
  color: var(--muted);
}

.camera-control-warning {
  margin: 11px 0 0;
  color: #9a651e;
  font-size: 8px;
  line-height: 1.5;
}

.camera-audio-panel {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 15px;
}

.camera-audio-panel > div:first-child {
  display: grid;
  gap: 4px;
}

.camera-audio-panel small,
.camera-audio-panel p,
.camera-audio-actions span {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.camera-audio-panel strong {
  color: var(--text);
  font-size: 11px;
}

.camera-audio-actions,
.camera-audio-file {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.camera-audio-actions span {
  flex-basis: 100%;
}

.camera-audio-file input {
  min-width: 0;
  max-width: 230px;
}

.camera-communication-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.camera-communication-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 20px;
  border: 1px solid #ded8e5;
  border-radius: 19px;
  background: #fff;
}

.camera-communication-card.listen {
  background: linear-gradient(145deg, #f8f6fd, #fff 72%);
}

.camera-communication-card.talk {
  background: linear-gradient(145deg, #effaf6, #fff 72%);
}

.camera-communication-card.test {
  background: linear-gradient(145deg, #fff8ea, #fff 72%);
}

.camera-communication-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  color: #fff;
  border-radius: 14px;
  background: #6f52bb;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.camera-communication-card.talk .camera-communication-icon {
  background: #238a68;
}

.camera-communication-card.test .camera-communication-icon {
  background: #c47b22;
}

.camera-communication-card > small {
  color: var(--accent);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.camera-communication-card > strong {
  color: var(--text);
  font-family: var(--display);
  font-size: 20px;
}

.camera-communication-card > p {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.camera-communication-state {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 11px;
  color: var(--muted);
  border-radius: 10px;
  background: #f3f1f5;
  font-size: 8px;
}

.camera-communication-state span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #aaa4ae;
}

.camera-communication-state.active span {
  background: #ef5b51;
  box-shadow: 0 0 0 3px #fde7e5;
}

.camera-https-required {
  display: grid;
  gap: 4px;
  padding: 11px;
  color: #765015;
  border: 1px solid #ead1a2;
  border-radius: 11px;
  background: #fff8e9;
}

.camera-https-required strong {
  font-size: 9px;
}

.camera-https-required span {
  font-size: 8px;
  line-height: 1.45;
}

.camera-https-required button {
  justify-self: start;
  margin-top: 5px;
}

.camera-technical-command {
  margin: 15px 0;
  padding: 13px;
  border: 1px solid #e3dce8;
  border-radius: 13px;
  background: #faf9fc;
}

.camera-technical-command summary {
  color: var(--text);
  cursor: pointer;
  font-size: 9px;
  font-weight: 850;
}

.camera-technical-command p {
  margin: 10px 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.camera-technical-command > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.camera-technical-command > .camera-control-route,
.camera-technical-command > .camera-command-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.camera-technical-command > .camera-audio-file,
.camera-technical-command > .camera-record-actions {
  display: flex;
}

.camera-technical-files {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid #e0dae5;
  border-radius: 14px;
  background: #f8f7fa;
}

.camera-technical-files > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  color: var(--text);
  cursor: pointer;
  font-size: 9px;
  font-weight: 850;
}

.camera-technical-files > summary small,
.camera-technical-files > p {
  color: var(--muted);
  font-size: 8px;
}

.camera-technical-files > p {
  margin: 0;
  padding: 0 15px 12px;
  line-height: 1.5;
}

.camera-technical-files .table-scroll {
  padding: 0 15px 15px;
}

.camera-technical-files table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: #fff;
}

.camera-technical-files th,
.camera-technical-files td {
  padding: 8px 9px;
  color: var(--muted);
  border-top: 1px solid #ebe7ee;
  font-size: 8px;
  text-align: left;
}

.camera-global-library {
  overflow: hidden;
}

.camera-global-library-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 19px;
  cursor: pointer;
  list-style: none;
}

.camera-global-library-summary::-webkit-details-marker {
  display: none;
}

.camera-global-library-summary > span {
  display: grid;
  gap: 4px;
}

.camera-global-library-summary > span small {
  color: var(--accent);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.camera-global-library-summary strong {
  color: var(--text);
  font-family: var(--display);
  font-size: 17px;
}

.camera-global-library-summary > small {
  max-width: 480px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
  text-align: right;
}

.camera-global-library-content {
  padding: 0 18px 18px;
  border-top: 1px solid #e6e1e9;
}

.camera-activity-grid {
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
}

.camera-activity-grid .camera-section-title {
  margin-top: 0;
}

.camera-interaction-list {
  max-height: 690px;
  display: grid;
  gap: 8px;
  overflow-y: auto;
}

.camera-interaction-list article {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  padding: 11px;
  border: 1px solid #e4dfe8;
  border-radius: 12px;
  background: #fff;
}

.camera-interaction-kind {
  align-self: start;
  padding: 5px 7px;
  color: #5e49aa;
  border-radius: 7px;
  background: #f0ebfb;
  font-size: 7px;
  font-weight: 850;
  text-transform: uppercase;
}

.camera-interaction-list article > div {
  min-width: 0;
}

.camera-interaction-list strong,
.camera-interaction-list time {
  color: var(--text);
  font-size: 8px;
}

.camera-interaction-list pre {
  max-height: 78px;
  margin: 6px 0 0;
  overflow: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.camera-interaction-list time {
  grid-column: 2;
  color: var(--muted);
}

.camera-interpreted-list {
  max-height: 690px;
  overflow-y: auto;
}

.camera-global-library {
  margin-top: 20px;
}

.camera-global-library:not([open]) {
  min-height: 0;
}

@media (max-width: 1180px) {
  .camera-overview-grid,
  .camera-control-grid,
  .camera-activity-grid {
    grid-template-columns: 1fr;
  }

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

  .camera-audio-panel {
    grid-template-columns: 1fr 1fr;
  }

  .camera-audio-panel > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .camera-console {
    grid-template-columns: 1fr;
  }

  .camera-directory-panel {
    position: static;
    min-height: 0;
    max-height: none;
  }

  .camera-device-list {
    max-height: 330px;
  }

  .camera-workspace-panel {
    min-height: 620px;
  }

  .camera-live-layout {
    grid-template-columns: 1fr;
  }

  .camera-media-actions,
  .camera-communication-grid {
    grid-template-columns: 1fr;
  }

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

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

  .camera-live-route,
  .camera-channel-control {
    grid-column: 1 / -1;
  }

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

@media (max-width: 700px) {
  .camera-directory-search,
  .camera-record-toolbar,
  .camera-command-form,
  .camera-setup-form,
  .camera-technical-command > div {
    grid-template-columns: 1fr;
  }

  .camera-directory-search button,
  .camera-workspace-head > button,
  .camera-record-actions button {
    width: 100%;
  }

  .camera-workspace-head,
  .camera-section-title,
  .camera-route-summary,
  .camera-media-more,
  .camera-workspace-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .camera-workspace-title strong {
    font-size: 19px;
  }

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

  .camera-tab-content {
    min-height: 440px;
  }

  .camera-map,
  .camera-map-empty {
    height: 300px;
    min-height: 300px;
  }

  .camera-telemetry-grid,
  .camera-capability-row,
  .camera-live-controls,
  .camera-audio-panel,
  .camera-simple-status,
  .camera-technical-command > .camera-control-route,
  .camera-technical-command > .camera-command-form {
    grid-template-columns: 1fr;
  }

  .camera-audio-panel > div:first-child,
  .camera-command-form .span-2,
  .camera-setup-form .span-2,
  .camera-record-actions,
  .camera-live-route,
  .camera-channel-control {
    grid-column: auto;
  }

  .camera-live-stage,
  .camera-live-stage iframe,
  .camera-live-player-shell {
    min-height: 360px;
  }

  .camera-player-caption {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .camera-player-caption small {
    grid-column: 1 / -1;
  }

  .camera-live-placeholder {
    padding: 26px;
  }

  .camera-action-feedback {
    grid-template-columns: 1fr;
  }

  .camera-action-feedback small {
    grid-column: 1;
    grid-row: auto;
  }

  .camera-readiness-list {
    grid-template-columns: 1fr;
  }

  .camera-operational-warning {
    grid-template-columns: 1fr;
  }

  .camera-global-library-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .camera-global-library-summary > small {
    text-align: left;
  }

  .camera-communication-card > p {
    min-height: 0;
  }
}

.media-library {
  min-height: calc(100vh - 150px);
}

.media-flow-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.media-flow-guide > div {
  position: relative;
  min-height: 112px;
  padding: 16px 16px 16px 52px;
  border: 1px solid #e3dfea;
  border-radius: 18px;
  background: #faf9fc;
}

.media-flow-guide > div > span {
  position: absolute;
  top: 15px;
  left: 15px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: #6752b3;
  font-size: 10px;
  font-weight: 800;
}

.media-flow-guide strong,
.media-flow-guide small {
  display: block;
}

.media-flow-guide strong {
  color: #2e2938;
}

.media-flow-guide small {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.45;
}

.media-flow-guide .media-flow-published {
  border-color: #a9dfcf;
  background: #f1fbf7;
}

.media-flow-guide .media-flow-published > span {
  background: var(--success);
}

.media-toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.media-toolbar .search-input {
  min-width: 210px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.media-live-section {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid #ded8e8;
  border-radius: 20px;
  background: linear-gradient(145deg, #fbfafe, #f3f8f7);
}

.media-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.media-section-heading small,
.media-section-heading h3 {
  display: block;
}

.media-section-heading small {
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.media-section-heading h3 {
  margin-top: 3px;
}

.media-live-summary {
  padding: 8px 11px;
  color: #28785f;
  border: 1px solid #bfe4d7;
  border-radius: 999px;
  background: #effaf6;
  font-size: 9px;
  font-weight: 800;
}

.media-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.media-live-empty {
  grid-column: 1 / -1;
}

.media-live-card {
  overflow: hidden;
  border: 1px solid #ddd7e6;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(55, 45, 76, 0.06);
}

.media-live-player {
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #17141d;
}

.media-live-player iframe {
  width: 100%;
  height: 260px;
  border: 0;
  background: #17141d;
}

.media-destination-settings {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e4deeb;
}

.media-destination-settings > h5 {
  margin-bottom: 10px;
}

.media-command-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 11px;
  border: 1px solid #dcd4ef;
  border-radius: 13px;
  background: linear-gradient(135deg, #faf8ff, #f5f1ff);
}

.media-command-guide > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.media-command-guide > div > span:last-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.media-command-guide strong {
  color: var(--text);
  font-size: 9px;
  line-height: 1.35;
}

.media-command-guide small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.media-command-step {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 8px;
  background: var(--accent);
  font-size: 9px;
  font-weight: 850;
}

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

.media-control-panel {
  margin-top: 16px;
}

.media-operation-guide {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #ddd7e8;
  border-radius: 18px;
  background: linear-gradient(145deg, #fbfafe, #f4f8f7);
}

.media-operation-head,
.media-operation-head > span:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.media-operation-head {
  justify-content: space-between;
}

.media-operation-head > span:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.media-operation-head small {
  color: var(--accent);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.media-operation-head strong {
  color: var(--text);
  font-size: 11px;
}

.media-readiness {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 850;
}

.media-readiness.ready {
  color: #1d755a;
  border: 1px solid #bce4d6;
  background: #ebf9f4;
}

.media-readiness.pending {
  color: #996018;
  border: 1px solid #edd5ad;
  background: #fff8e9;
}

.media-operation-route {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.media-operation-route > div {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 12px;
  border: 1px solid #e4dfeb;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.88);
}

.media-operation-route small {
  color: var(--accent);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}

.media-operation-route strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 9px;
}

.media-operation-route span,
.media-delivery-note span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.media-delivery-note {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: #f4f0fb;
}

.media-delivery-note strong {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 9px;
}

.media-command-catalog {
  border: 1px solid #e2dce9;
  border-radius: 13px;
  background: #fff;
}

.media-command-catalog > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.media-command-catalog > summary::-webkit-details-marker {
  display: none;
}

.media-command-catalog > summary span {
  color: var(--text);
  font-size: 9px;
  font-weight: 850;
}

.media-command-catalog > summary small {
  color: var(--muted);
  font-size: 8px;
}

.media-command-catalog table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

.media-command-catalog th,
.media-command-catalog td {
  padding: 10px 12px;
  border-top: 1px solid #ece8f0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
  text-align: left;
  vertical-align: top;
}

.media-command-catalog th,
.media-command-catalog td strong {
  color: var(--text);
}

@media (max-width: 1050px) {
  .media-operation-route {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .media-operation-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .media-operation-route {
    grid-template-columns: 1fr;
  }

  .media-delivery-note {
    align-items: flex-start;
    flex-direction: column;
  }
}

.media-audio-upload {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e7e2ed;
}

.media-audio-upload strong,
.media-audio-upload small {
  display: block;
}

.media-mic-actions,
.media-file-talk {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.media-mic-actions small {
  flex-basis: 100%;
}

.media-file-talk {
  justify-content: flex-end;
}

.media-file-talk input {
  max-width: 240px;
}

.media-audio-upload small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.media-grid > .feed-item,
.media-grid > .media-empty,
.media-grid > .media-load-more {
  grid-column: 1 / -1;
}

.media-load-more {
  display: flex;
  justify-content: center;
  padding: 8px 0 2px;
}

.media-card {
  overflow: hidden;
  border: 1px solid #e3dfea;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(55, 45, 76, 0.06);
}

.media-card-preview {
  display: grid;
  min-height: 180px;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(113, 91, 194, 0.12), rgba(62, 168, 143, 0.1)),
    #f4f1f8;
}

.media-preview-image,
.media-preview-video {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #17141d;
}

.media-preview-audio {
  width: calc(100% - 30px);
}

.media-preview-placeholder {
  display: grid;
  gap: 5px;
  max-width: 230px;
  padding: 24px;
  text-align: center;
}

.media-preview-placeholder span,
.media-preview-placeholder small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.media-preview-placeholder strong {
  color: #5d46ad;
  font-size: 24px;
  letter-spacing: 0.06em;
}

.media-card-body {
  padding: 15px;
}

.media-card-title,
.media-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.media-card-title span,
.media-card-title small,
.media-card-title strong {
  display: block;
}

.media-card-title small,
.media-card-meta,
.media-card-body > p {
  color: var(--muted);
  font-size: 8px;
}

.media-card-title strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 12px;
}

.media-card-title b {
  padding: 6px 8px;
  color: #5d46ad;
  border: 1px solid #dcd3f5;
  border-radius: 8px;
  background: #f6f2ff;
  font-size: 8px;
}

.media-card-body > p {
  margin: 12px 0;
  overflow-wrap: anywhere;
}

.media-card-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.media-card-meta span + span::before {
  margin-right: 7px;
  content: "·";
}

.media-delivery-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  color: #746b7d;
  font-size: 8px;
  font-weight: 800;
}

.media-delivery-state span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #d7a239;
}

.media-delivery-state.delivered {
  color: #247154;
}

.media-delivery-state.delivered span {
  background: #37a676;
}

.media-delivery-state.failed {
  color: #a04848;
}

.media-delivery-state.failed span {
  background: #d76666;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  color: #fff;
  border: 1px solid #6752b3;
  border-radius: 10px;
  background: #6752b3;
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
}

.button-link.ghost {
  color: #5f5670;
  border-color: #ddd7e6;
  background: #fff;
}

@media (max-width: 700px) {
  .platform-settings-grid,
  .platform-retention-form,
  .platform-scope-grid {
    grid-template-columns: 1fr;
  }

  .platform-storage-card {
    grid-column: auto;
  }

  .platform-token-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .platform-token-row button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .media-toolbar,
  .media-toolbar .search-input,
  .media-toolbar button {
    width: 100%;
  }

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

  .media-live-grid {
    grid-template-columns: 1fr;
  }

  .media-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .media-audio-upload {
    grid-template-columns: 1fr;
  }

  .media-file-talk {
    justify-content: flex-start;
  }

  .media-flow-guide {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 701px) and (max-width: 1100px) {
  .media-flow-guide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
