:root {
  color-scheme: dark;
  --bg: #09111c;
  --bg-deep: #070d15;
  --surface: #0c1521;
  --surface-raised: #101c2c;
  --surface-soft: #111d2b;
  --line: #26364a;
  --line-soft: #1d2a3a;
  --text: #f3f7fb;
  --muted: #94a6ba;
  --muted-2: #70839a;
  --green: #198754;
  --green-bright: #3ee58f;
  --green-soft: rgba(30, 192, 113, 0.12);
  --blue: #6ba9ff;
  --blue-soft: rgba(74, 144, 226, 0.12);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.13);
  --button: #142131;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.console-body {
  background:
    radial-gradient(circle at 86% 3%, rgba(52, 128, 229, 0.15), transparent 29rem),
    radial-gradient(circle at 12% -8%, rgba(30, 192, 113, 0.12), transparent 30rem),
    linear-gradient(180deg, #08111c, #09121e 34%, #070e17);
  background-attachment: fixed;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: progress;
  opacity: 0.75;
}

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

.icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-glyph {
  width: 21px;
  height: 21px;
  stroke-width: 1.7;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(7, 13, 21, 0.76);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(22px);
}

.topbar-inner {
  width: min(1360px, calc(100% - 44px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.16s ease;
}

.brand-row:hover {
  opacity: 0.84;
}

.brand-icon,
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(62, 229, 143, 0.36);
  color: var(--green-bright);
  font-weight: 900;
  background: linear-gradient(145deg, rgba(30, 192, 113, 0.18), rgba(30, 192, 113, 0.07));
  box-shadow: 0 0 22px rgba(30, 192, 113, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.topbar h1 {
  font-size: 16px;
  line-height: 1.2;
}

.topbar p,
.panel-title p,
.notice,
.metric span,
.port-card p,
.row-note {
  color: var(--muted);
}

.topbar p {
  font-size: 12px;
  margin-top: 2px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-link {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: transparent;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
  gap: 8px;
}

.nav-link:hover {
  border-color: var(--line);
  background: var(--button);
}

.nav-link.active {
  color: var(--green-bright);
  border-color: rgba(62, 229, 143, 0.2);
  background: var(--green-soft);
}

.ws-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line-soft);
  user-select: none;
}
.ws-indicator svg {
  display: block;
  width: 10px;
  height: 10px;
}
.ws-indicator circle {
  fill: #f87171;
  transition: fill 0.2s ease;
}
.ws-indicator.connected circle {
  fill: #4ade80;
}
.ws-indicator.connected {
  color: var(--green-bright);
  border-color: rgba(74, 222, 128, 0.3);
}

.page {
  width: min(1360px, calc(100% - 44px));
  margin: 30px auto 44px;
  display: grid;
  gap: 20px;
}

.console-hero {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(270px, 0.82fr) minmax(520px, 1.18fr);
  align-items: center;
  gap: 28px;
  padding: 30px 32px;
  border: 1px solid rgba(38, 54, 74, 0.8);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(107, 169, 255, 0.12), transparent 40%),
    linear-gradient(120deg, rgba(15, 28, 43, 0.96), rgba(10, 18, 30, 0.94));
  box-shadow: var(--shadow);
}

.console-hero-copy h2 {
  margin: 8px 0 9px;
  font-size: clamp(27px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.console-hero-copy > p:last-child {
  max-width: 400px;
  color: var(--muted);
  line-height: 1.6;
}

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

.overview-card {
  position: relative;
  min-width: 0;
  min-height: 100px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: rgba(8, 14, 23, 0.52);
}

.overview-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 20px;
  height: 20px;
  color: var(--muted-2);
}

.overview-card.live .overview-icon {
  color: var(--green-bright);
}

.overview-card.accent .overview-icon {
  color: var(--blue);
}

.overview-card strong {
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.overview-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overview-card.live strong {
  color: var(--green-bright);
}

.overview-card.accent strong {
  color: var(--blue);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  align-items: start;
  gap: 18px;
  min-width: 0;
}

.panel {
  min-width: 0;
  background: linear-gradient(155deg, rgba(16, 28, 44, 0.92), rgba(9, 16, 27, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.16), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  min-width: 0;
}

.panel-title > * {
  min-width: 0;
}

.panel-title h2 {
  font-size: 18px;
  line-height: 1.25;
}

.panel-title p {
  margin-top: 5px;
  line-height: 1.45;
}

.panel-title .panel-kicker {
  margin: 0 0 8px;
  color: var(--green-bright);
  line-height: 1;
}

.create-panel {
  display: flex;
  flex-direction: column;
}

.create-panel .panel-title {
  margin-bottom: 20px;
}

.create-options {
  display: grid;
  gap: 10px;
}

.create-option {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(8, 14, 23, 0.32);
}

.create-option + .create-option {
  padding-top: 13px;
}

.create-option-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.toggle-option {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  justify-content: start;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background:
    radial-gradient(circle at 0 0, rgba(107, 169, 255, 0.08), transparent 36%),
    rgba(8, 15, 24, 0.48);
  cursor: pointer;
  transition:
    border-color 0.22s ease,
    background 0.22s ease,
    transform 0.22s ease;
}

.toggle-option:hover {
  border-color: rgba(107, 169, 255, 0.42);
  background:
    radial-gradient(circle at 0 0, rgba(107, 169, 255, 0.12), transparent 38%),
    rgba(11, 22, 35, 0.62);
  transform: translateY(-1px);
}

.toggle-option input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.toggle-control {
  position: relative;
  width: 58px;
  height: 32px;
  border: 1px solid rgba(107, 169, 255, 0.24);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(15, 25, 39, 0.96), rgba(20, 36, 54, 0.9)),
    rgba(8, 15, 24, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition:
    border-color 0.24s ease,
    background 0.24s ease,
    box-shadow 0.24s ease;
}

.toggle-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #d9e6f4, #7f93aa);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.26);
  transition:
    transform 0.28s cubic-bezier(0.2, 0.9, 0.2, 1.16),
    background 0.24s ease,
    box-shadow 0.24s ease;
}

.toggle-check {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #052313;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 18;
  stroke-dashoffset: 18;
  transform: scale(0.72);
  transition:
    stroke-dashoffset 0.24s ease 0.08s,
    transform 0.24s ease 0.08s;
}

.toggle-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  overflow-wrap: anywhere;
}

.toggle-copy strong {
  color: #dfeaf6;
  font-size: 13px;
  line-height: 1.2;
}

.toggle-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  max-width: 440px;
}

.toggle-option:has(input[type="checkbox"]:focus-visible) {
  border-color: rgba(87, 214, 111, 0.76);
  box-shadow: 0 0 0 3px rgba(87, 214, 111, 0.14);
}

.toggle-option:has(input[type="checkbox"]:checked) {
  border-color: rgba(62, 229, 143, 0.34);
  background:
    radial-gradient(circle at 0 0, rgba(62, 229, 143, 0.14), transparent 38%),
    rgba(9, 28, 20, 0.66);
}

.toggle-option:has(input[type="checkbox"]:checked) .toggle-control {
  border-color: rgba(62, 229, 143, 0.5);
  background:
    linear-gradient(135deg, rgba(25, 135, 84, 0.98), rgba(18, 112, 68, 0.96)),
    rgba(25, 135, 84, 0.9);
  box-shadow:
    0 0 0 4px rgba(62, 229, 143, 0.08),
    inset 0 0 18px rgba(62, 229, 143, 0.16);
}

.toggle-option:has(input[type="checkbox"]:checked) .toggle-knob {
  transform: translateX(26px);
  background: linear-gradient(135deg, #f2fff5, #78f0aa);
  box-shadow: 0 7px 18px rgba(35, 209, 121, 0.22);
}

.toggle-option:has(input[type="checkbox"]:checked) .toggle-check {
  stroke-dashoffset: 0;
  transform: scale(1);
}

.create-option .inline-form {
  align-items: stretch;
}

.service-create-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 0.34fr);
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}

.service-create-grid input[name="warp_license_key"],
.service-create-grid .toggle-option,
.service-create-grid button {
  grid-column: 1 / -1;
}

.service-create-grid .toggle-option {
  justify-content: start;
}

.create-empty {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
}

.create-panel .notice {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  line-height: 1.45;
  font-size: 12px;
}

.table-wrap + .notice {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  line-height: 1.45;
  font-size: 12px;
}

.panel-kicker,
.eyebrow {
  color: var(--green-bright);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.pill {
  min-width: 74px;
  height: 28px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: #1b2129;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  gap: 7px;
}

.pill .icon {
  width: 14px;
  height: 14px;
}

.pill.live {
  color: var(--green-bright);
  border-color: rgba(87, 214, 111, 0.45);
  background: var(--green-soft);
}

.pill.warn {
  color: #ffb4b4;
  border-color: rgba(239, 68, 68, 0.45);
  background: var(--red-soft);
}

.status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.health-badge {
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  background: rgba(27, 33, 41, 0.82);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.health-badge .icon {
  width: 14px;
  height: 14px;
}

.health-badge.online {
  color: var(--green-bright);
  border-color: rgba(87, 214, 111, 0.45);
  background: var(--green-soft);
}

.health-badge.error {
  color: #ffb4b4;
  border-color: rgba(239, 68, 68, 0.45);
  background: var(--red-soft);
}

.health-badge.booting,
.health-badge.checking {
  color: var(--blue);
  border-color: rgba(107, 169, 255, 0.42);
  background: var(--blue-soft);
}

.health-note {
  display: block;
  max-width: 340px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.warp-egress-note {
  display: grid;
  gap: 2px;
  max-width: 340px;
  margin-top: 3px;
  color: #78dca0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.warp-egress-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 5px;
  min-width: 0;
}

.warp-egress-label {
  color: #5fae81;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.4;
  text-transform: uppercase;
}

.warp-egress-value {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.warp-egress-state {
  color: var(--warning);
  font-family: var(--font-sans);
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.metric {
  min-width: 0;
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(8, 14, 23, 0.4);
}

.metric strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  color: #e7eff7;
}

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

.metric span .icon {
  width: 14px;
  height: 14px;
}

.inline-form,
.port-form,
.mini-form {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) 150px;
}

.port-form {
  grid-template-columns: 120px minmax(160px, 1fr) minmax(160px, 1.3fr) 130px;
  margin-bottom: 22px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(8, 14, 23, 0.36);
}

.mini-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 88px;
  margin-top: 12px;
}

.settings-hero {
  grid-template-columns: minmax(270px, 1fr) minmax(280px, 0.72fr);
}

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

.settings-panel {
  max-width: 920px;
}

.settings-form {
  display: grid;
  gap: 10px;
}

.settings-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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

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

.settings-preview div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(8, 14, 23, 0.36);
}

.settings-preview span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.settings-preview strong {
  overflow-wrap: anywhere;
}

.api-key-panel .api-key-form {
  margin-bottom: 14px;
}

.api-key-result {
  margin: 14px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(62, 229, 143, 0.36);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, rgba(62, 229, 143, 0.12), transparent 32%),
    rgba(9, 24, 18, 0.62);
}

.api-key-result[hidden] {
  display: none;
}

.api-key-result span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.api-key-result code {
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(8, 14, 23, 0.58);
}

input,
select {
  min-width: 0;
  width: 100%;
  height: 44px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(8, 15, 24, 0.72);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input::placeholder {
  color: var(--muted-2);
}

input:focus,
select:focus {
  border-color: rgba(87, 214, 111, 0.75);
  box-shadow: 0 0 0 2px rgba(87, 214, 111, 0.16);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  min-width: 0;
  min-height: 44px;
  border-radius: 11px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 800;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-btn {
  background: linear-gradient(135deg, #198754, #127044);
  border-color: rgba(62, 229, 143, 0.28);
  color: #f7fff8;
  box-shadow: 0 8px 20px rgba(25, 135, 84, 0.16);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #1e9860, #147c4a);
}

.secondary-btn,
.ghost-btn,
.icon-btn {
  background: var(--button);
  border-color: var(--line);
}

.secondary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover {
  border-color: #3c5169;
  background: #1b2a3c;
}

.danger-btn,
.icon-btn.danger {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.65);
  color: #ff9b9b;
}

.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.compact {
  min-height: 44px;
}

.port-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.port-card {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(107, 169, 255, 0.08), transparent 38%),
    rgba(11, 19, 31, 0.72);
  padding: 18px;
}

.port-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.port-head h3 {
  font-size: 34px;
  line-height: 1.05;
  margin-top: 3px;
}

.port-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.port-meta span {
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: rgba(8, 14, 23, 0.6);
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
}

.port-meta .icon {
  width: 13px;
  height: 13px;
}

.port-note {
  margin-top: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

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

.provision-row form {
  flex: 1 1 100%;
  min-width: min(100%, 280px);
  display: grid;
  gap: 10px;
}

.port-state {
  color: var(--muted);
  font-size: 12px;
  flex: 1 1 180px;
}

.service-list {
  margin-top: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(13, 17, 23, 0.38);
}

.service-row {
  min-height: 48px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.service-row:last-child {
  border-bottom: 0;
}

.service-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.text-danger,
.link-btn {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.text-danger {
  color: #ff9b9b;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(8, 14, 23, 0.3);
}

.inventory-panel {
  padding: 14px 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(62, 229, 143, 0.07), transparent 28rem),
    linear-gradient(155deg, rgba(16, 28, 44, 0.95), rgba(8, 15, 25, 0.94));
}

.inventory-panel .panel-title h2 {
  font-size: 1.05rem;
}

.inventory-panel .panel-title {
  margin-bottom: 10px;
}

.inventory-toolbar,
.api-docs-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.inventory-search {
  display: grid;
  flex: 1 1 360px;
  min-width: 0;
  max-width: 620px;
  gap: 7px;
}

.inventory-search > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.inventory-search input {
  width: 100%;
  min-width: 0;
}

.inventory-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.pagination-status {
  min-width: 104px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.pagination-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pagination-page {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(9, 18, 29, 0.72);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.pagination-page:hover {
  border-color: rgba(107, 169, 255, 0.56);
  color: var(--text);
  transform: translateY(-1px);
}

.pagination-page.active {
  border-color: rgba(62, 229, 143, 0.64);
  background: rgba(30, 192, 113, 0.2);
  color: var(--green-bright);
  box-shadow: inset 0 0 0 1px rgba(62, 229, 143, 0.12);
}

.pagination-page:focus-visible {
  outline: 2px solid rgba(107, 169, 255, 0.76);
  outline-offset: 2px;
}

.pagination-ellipsis {
  min-width: 14px;
  color: var(--muted-2);
  font-size: 12px;
  text-align: center;
}

.inventory-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.inventory-wrap {
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(12, 23, 36, 0.9), rgba(7, 13, 22, 0.76));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.inventory-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 0;
  table-layout: fixed;
  font-size: 12px;
}

.inventory-table .col-name {
  width: 16%;
}

.inventory-table .col-type {
  width: 9%;
}

.inventory-table .col-exposed {
  width: 7%;
}

.inventory-table .col-local {
  width: 6%;
}

.inventory-table .col-status {
  width: 18%;
}

.inventory-table .col-actions {
  width: 44%;
}

/* Compact density: more rows visible for large pools */
.inventory-table th,
.inventory-table td {
  padding: 6px 8px;
}

.inventory-table th {
  height: 32px;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.inventory-table td {
  height: auto;
  min-height: 42px;
  vertical-align: middle;
}

.inventory-table .container-name-cell {
  gap: 8px;
}

.inventory-table .container-avatar {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  flex-shrink: 0;
}

.inventory-table .container-avatar .icon {
  width: 13px;
  height: 13px;
}

.inventory-table .container-avatar-badge {
  min-width: 22px;
  height: 11px;
  font-size: 7px;
  padding: 0 3px;
}

.inventory-table .container-name-cell strong,
.inventory-table .container-name-cell .table-link {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.inventory-table .row-note {
  margin-top: 1px;
  max-width: 220px;
  font-size: 10px;
  line-height: 1.25;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-table .type-stack {
  gap: 3px;
}

.inventory-table .type-pill,
.inventory-table .mode-chip,
.inventory-table .egress-chip,
.inventory-table .local-port-chip,
.inventory-table .port-chip,
.inventory-table .copy-port-btn {
  min-height: 20px;
  padding: 0 7px;
  font-size: 10px;
  border-radius: 6px;
}

.inventory-table .container-avatar-badge {
  min-width: 24px;
  height: 12px;
  font-size: 8px;
  padding: 0 4px;
}

.inventory-table .status-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.inventory-table .status-stack .pill,
.inventory-table .health-badge {
  min-height: 20px;
  padding: 0 7px;
  font-size: 10px;
  gap: 4px;
}

.inventory-table .status-stack .pill .icon,
.inventory-table .health-badge .icon {
  width: 11px;
  height: 11px;
}

.inventory-table .health-note {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.2;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.8;
}

.inventory-table .warp-egress-note {
  width: 100%;
  max-width: none;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.inventory-table .actions {
  gap: 4px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.inventory-table .action-group {
  gap: 3px;
  padding: 2px;
  border-radius: 8px;
}

/* Icon + short labels, tighter buttons */
.inventory-table .action-group .small {
  min-height: 24px;
  min-width: 0;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  gap: 3px;
  line-height: 1;
}

.inventory-table .action-group .small .icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.inventory-table th:last-child,
.inventory-table td:last-child {
  min-width: 0;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  padding: 15px 14px;
  vertical-align: middle;
}

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

tbody tr {
  transition: opacity 0.32s ease, transform 0.32s ease, filter 0.32s ease;
}

tbody tr.row-removing {
  opacity: 0;
  transform: translateX(18px) scale(0.985);
  filter: blur(3px);
  pointer-events: none;
}

th {
  color: var(--muted);
  background: rgba(16, 28, 44, 0.76);
  font-size: 12px;
  font-weight: 800;
}

.inventory-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 32px;
  color: #9fb2c7;
  background: rgba(13, 24, 38, 0.96);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.inventory-table th:last-child,
.inventory-table td:last-child {
  min-width: 0;
}

.inventory-table td {
  height: auto;
  min-height: 40px;
  background: rgba(8, 14, 23, 0.14);
}

.inventory-table tbody tr:hover td {
  background: rgba(107, 169, 255, 0.035);
}

.container-name-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.container-name-cell > div {
  min-width: 0;
}

.container-avatar {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(62, 229, 143, 0.26);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--green-bright);
  background:
    linear-gradient(145deg, rgba(62, 229, 143, 0.13), rgba(107, 169, 255, 0.07)),
    rgba(8, 15, 24, 0.78);
}

.container-avatar .icon {
  width: 17px;
  height: 17px;
}

.container-avatar-badge {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 2px);
  transform: translateX(-50%);
  min-width: 28px;
  height: 14px;
  padding: 0 5px;
  border: 1px solid rgba(107, 169, 255, 0.4);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ddecff;
  background:
    linear-gradient(135deg, rgba(107, 169, 255, 0.28), rgba(62, 229, 143, 0.18)),
    rgba(8, 15, 24, 0.96);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
}

/* POOL sits on the avatar like MITM (green tint) */
.container-avatar-badge.pool {
  color: #b8f5d0;
  border-color: rgba(126, 227, 168, 0.5);
  background:
    linear-gradient(135deg, rgba(62, 229, 143, 0.32), rgba(107, 169, 255, 0.12)),
    rgba(8, 15, 24, 0.96);
}

/* When both MITM + POOL are present, stack them above the icon */
.container-avatar:has(.container-avatar-badge.pool):has(.container-avatar-badge:not(.pool)) .container-avatar-badge:not(.pool) {
  bottom: calc(100% + 10px);
}

.row-note {
  display: block;
  max-width: 360px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.type-stack {
  display: grid;
  gap: 7px;
  justify-items: start;
}

.type-pill,
.mode-chip,
.egress-chip,
.local-port-chip {
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: #d9e6f4;
  background: rgba(18, 31, 47, 0.78);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.type-pill.service {
  color: var(--blue);
  border-color: rgba(107, 169, 255, 0.34);
  background: var(--blue-soft);
}

.type-pill.custom {
  color: #f8d891;
  border-color: rgba(248, 216, 145, 0.32);
  background: rgba(248, 216, 145, 0.08);
}

.mode-chip {
  color: var(--muted);
  background: rgba(8, 15, 24, 0.58);
}

.egress-chip {
  color: #9be7ff;
  background: rgba(14, 116, 144, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.pool-badge {
  color: #7ee3a8;
  border: 1px solid rgba(126, 227, 168, 0.35);
  background: rgba(126, 227, 168, 0.12);
  font-size: 10px;
  font-weight: 800;
  padding: 0 6px;
  border-radius: 999px;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
}

.local-port-chip {
  min-width: 58px;
  justify-content: center;
  color: #dce8f6;
  border-radius: 9px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.profile-actions .small {
  min-height: 34px;
}

.action-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px;
  border: 1px solid rgba(38, 54, 74, 0.62);
  border-radius: 12px;
  background: rgba(6, 12, 20, 0.36);
}

.action-group .small {
  min-height: 32px;
  border-radius: 8px;
}

th:last-child,
td:last-child {
  min-width: 440px;
}

.empty,
.activity-empty {
  color: var(--muted);
  padding: 14px;
}

.table-empty {
  text-align: center;
  padding: 28px 14px;
}

.activity-list {
  min-height: 44px;
  display: grid;
  gap: 0;
}

.activity-row {
  min-height: 38px;
  display: grid;
  grid-template-columns: 96px 90px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
}

.activity-panel .activity-empty {
  border: 1px dashed var(--line);
  border-radius: 13px;
  background: rgba(8, 14, 23, 0.24);
}

.activity-row span {
  color: var(--muted);
}

.activity-row strong {
  color: var(--green-bright);
}

.activity-row p {
  overflow-wrap: anywhere;
}

.activity-row .activity-container-name {
  color: var(--text);
  font-weight: 900;
}

.blink-highlight {
  animation: blink-highlight 1.05s ease-in-out 2;
}

.notification-stack {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 40;
  width: min(420px, calc(100vw - 40px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.notification {
  max-width: min(420px, calc(100vw - 40px));
  min-height: 76px;
  padding: 14px;
  border: 1px solid rgba(87, 214, 111, 0.45);
  background: rgba(16, 32, 24, 0.96);
  color: var(--text);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 28px;
  gap: 12px;
  align-items: start;
  pointer-events: auto;
  animation: notification-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.notification.error {
  border-color: rgba(239, 68, 68, 0.65);
  background: rgba(36, 17, 19, 0.96);
}

.notification.is-leaving {
  animation: notification-out 0.2s ease forwards;
}

.notification-mark {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--green-bright);
  box-shadow: 0 0 0 5px rgba(87, 214, 111, 0.15);
}

.notification.error .notification-mark {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.16);
}

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

.notification-copy strong {
  display: block;
  margin-bottom: 3px;
}

.notification-copy p,
.notification-copy span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.notification-copy span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.notification-close {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(13, 17, 23, 0.62);
  color: var(--muted);
  display: grid;
  place-items: center;
}

@keyframes notification-in {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes notification-out {
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

@keyframes blink-highlight {
  0%,
  100% {
    color: inherit;
    text-shadow: none;
  }
  45% {
    color: var(--green-bright);
    text-shadow: 0 0 14px rgba(62, 229, 143, 0.7);
  }
}

.modal-open {
  overflow: hidden;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.18s ease;
}

.modal-layer[aria-hidden="true"] {
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 10, 0.72);
  backdrop-filter: blur(10px);
}

.confirm-modal {
  position: relative;
  width: min(430px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(17, 24, 33, 0.98), rgba(13, 17, 23, 0.98));
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  transform: translateY(0) scale(1);
  transition: transform 0.18s ease;
}

.modal-layer[aria-hidden="true"] .confirm-modal {
  transform: translateY(14px) scale(0.98);
}

.modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border-color: rgba(239, 68, 68, 0.65);
  background: var(--red-soft);
  color: #ffb4b4;
  border: 1px solid rgba(239, 68, 68, 0.5);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.modal-icon .icon {
  width: 22px;
  height: 22px;
}

.confirm-modal h2 {
  margin-top: 5px;
  font-size: 20px;
}

.confirm-modal p {
  color: var(--muted);
  line-height: 1.55;
}

.modal-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

.loader {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: none;
  animation: spin 0.8s linear infinite;
}

.is-loading .loader {
  display: inline-block;
}

.is-loading .btn-text {
  opacity: 0.76;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.login-body {
  background: var(--bg-deep);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr);
  background:
    linear-gradient(90deg, rgba(13, 17, 23, 0.2), rgba(13, 17, 23, 0.92)),
    var(--bg);
}

.login-visual {
  position: relative;
  min-height: 100vh;
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  background:
    linear-gradient(rgba(87, 214, 111, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87, 214, 111, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 18% 20%, rgba(88, 166, 255, 0.12), transparent 28%),
    #10171f;
  background-size: 42px 42px, 42px 42px, auto, auto;
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(13, 17, 23, 0.84));
  pointer-events: none;
}

.login-status-grid {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.login-status-grid div {
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.7);
}

.login-status-grid span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  margin-bottom: 8px;
}

.login-status-grid .icon {
  width: 14px;
  height: 14px;
}

.login-status-grid strong {
  color: var(--green-bright);
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.login-copy h1 {
  font-size: 40px;
  line-height: 1.08;
  margin-bottom: 18px;
}

.login-copy p {
  max-width: 460px;
  color: #d8dee8;
  line-height: 1.7;
}

.login-panel-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--bg-deep);
}

.login-panel {
  width: min(448px, 100%);
  padding: 32px;
  box-shadow: var(--shadow);
}

.login-panel .panel-kicker {
  margin-bottom: 14px;
}

.login-panel h2 {
  font-size: 22px;
}

.login-panel p {
  color: var(--muted);
  margin-top: 8px;
}

.field {
  margin: 24px 0 14px;
}

.login-panel .primary-btn {
  width: 100%;
  margin-top: 16px;
}

.auth-alert {
  min-height: 58px;
  padding: 12px;
  border: 1px solid rgba(239, 68, 68, 0.62);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  background: var(--red-soft);
  color: #ffd4d4;
}

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

.auth-alert p {
  margin-top: 2px;
  color: #f5b6b6;
}

.alert-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
}

.has-error {
  animation: shake 0.24s linear;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

@media (max-width: 1100px) {
  .topbar-inner {
    flex-wrap: wrap;
    padding-block: 12px;
  }

  .topbar .top-actions {
    flex-wrap: wrap;
    width: 100%;
  }
}

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

  /* Keep the inventory readable on narrow desktop/tablet widths. */
  .inventory-table .col-name { width: 17%; }
  .inventory-table .col-type { width: 9%; }
  .inventory-table .col-exposed { width: 7%; }
  .inventory-table .col-local { width: 6%; }
  .inventory-table .col-status { width: 31%; }
  .inventory-table .col-actions { width: 30%; }

  .inventory-table .actions {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
  }

  .inventory-table .action-group {
    width: 100%;
    justify-content: center;
  }

  .inventory-table .action-group .small {
    flex: 1 1 auto;
    padding-inline: 5px;
  }

  .console-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .hero-grid,
  .port-grid,
  .login-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-visual {
    min-height: 42vh;
  }

  .login-panel-wrap {
    min-height: 58vh;
  }

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

@media (max-width: 640px) {
  .topbar-inner,
  .page {
    width: min(100% - 20px, 1240px);
  }

  .topbar-inner,
  .panel-title,
  .port-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-inner {
    padding: 12px 0 14px;
    gap: 12px;
  }

  .brand-row {
    width: 100%;
    gap: 10px;
  }

  .brand-icon,
  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    flex-shrink: 0;
  }

  .topbar h1 {
    font-size: 15px;
  }

  .topbar p {
    font-size: 11px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .page {
    margin-top: 14px;
    gap: 14px;
  }

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

  .console-hero-copy h2 {
    font-size: 1.55rem;
    line-height: 1.15;
  }

  .console-hero-copy p {
    font-size: 13px;
    line-height: 1.45;
  }

  /* Nav: WS chip full-row (not stretched bar), 2×2 links, sign-out full width */
  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  .top-actions .ws-indicator {
    grid-column: 1 / -1;
    justify-self: start;
    width: auto;
    max-width: 100%;
    min-height: 30px;
    padding: 5px 12px;
    gap: 6px;
    font-size: 11px;
  }

  .top-actions .ws-indicator::after {
    content: attr(data-status);
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-actions .nav-link {
    width: 100%;
    min-height: 44px;
    padding: 0 10px;
    font-size: 12px;
    gap: 6px;
    border-color: var(--line-soft);
    background: rgba(8, 14, 23, 0.45);
  }

  .top-actions .nav-link .icon {
    width: 15px;
    height: 15px;
  }

  .top-actions .nav-link.active {
    border-color: rgba(62, 229, 143, 0.35);
  }

  .logout-form {
    grid-column: 1 / -1;
  }

  .logout-form .ghost-btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .metric-grid,
  .inline-form,
  .service-create-grid,
  .port-form,
  .mini-form,
  .settings-inline,
  .settings-preview,
  .login-status-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .overview-card {
    min-height: 78px;
    padding: 12px;
    border-radius: 14px;
  }

  .overview-card strong {
    font-size: 1.55rem;
  }

  .overview-card span {
    font-size: 11px;
  }

  .create-panel .notice {
    margin-top: 12px;
    padding-top: 12px;
  }

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

  .inventory-panel {
    padding: 12px 12px 14px;
  }

  .inventory-toolbar,
  .api-docs-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-search {
    flex-basis: auto;
    max-width: none;
  }

  .inventory-pagination {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .pagination-status {
    grid-column: 1 / -1;
    min-width: 0;
    text-align: left;
  }

  .pagination-pages {
    min-width: 0;
  }

  .pagination-page {
    width: 28px;
  }

  .inventory-pagination > .secondary-btn {
    padding-inline: 10px;
  }

  .panel-title h2 {
    font-size: 1.15rem;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .inventory-wrap {
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  table {
    min-width: 0;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tr {
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    background:
      radial-gradient(circle at 100% 0, rgba(107, 169, 255, 0.08), transparent 42%),
      rgba(8, 14, 23, 0.62);
    overflow: hidden;
  }

  tr[data-container-id],
  tr[data-pool-id] {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  }

  /* Card rows: label | value. data-label preferred; multi-child values stay in col 2 */
  td {
    min-height: 0;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line-soft);
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 6px;
    align-items: center;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    padding-top: 3px;
    line-height: 1.25;
  }

  /* All real content in value column (fixes IP under STATUS label) */
  td > * {
    grid-column: 2;
    min-width: 0;
  }

  /* Bare-text cells: keep text in value column via anonymous box */
  td:not(:has(> *)) {
    /* fallback for empty / text-only — content after label */
    white-space: normal;
  }

  /* Fallback labels when data-label missing (legacy rows) */
  .containers-table td:nth-child(1):not([data-label])::before { content: "Name"; }
  .containers-table td:nth-child(2):not([data-label])::before { content: "Type"; }
  .containers-table td:nth-child(3):not([data-label])::before { content: "Exposed"; }
  .containers-table td:nth-child(4):not([data-label])::before { content: "Local"; }
  .containers-table td:nth-child(5):not([data-label])::before { content: "Status"; }
  .containers-table td:nth-child(6):not([data-label])::before { content: "Actions"; }

  .pools-table td:nth-child(1):not([data-label])::before { content: "Name"; }
  .pools-table td:nth-child(2):not([data-label])::before { content: "Size"; }
  .pools-table td:nth-child(3):not([data-label])::before { content: "Online"; }
  .pools-table td:nth-child(4):not([data-label])::before { content: "Mode"; }
  .pools-table td:nth-child(5):not([data-label])::before { content: "Actions"; }

  .api-keys-table td:nth-child(1):not([data-label])::before { content: "Tag"; }
  .api-keys-table td:nth-child(2):not([data-label])::before { content: "Prefix"; }
  .api-keys-table td:nth-child(3):not([data-label])::before { content: "Created"; }
  .api-keys-table td:nth-child(4):not([data-label])::before { content: "Last used"; }
  .api-keys-table td:nth-child(5):not([data-label])::before { content: "Actions"; }

  td:last-child {
    border-bottom: 0;
  }

  td.empty,
  td.table-empty,
  tr:has(td.empty) td,
  tr:has(.table-empty) td {
    display: block;
    grid-template-columns: none;
    text-align: center;
    padding: 18px 14px;
  }

  td.empty::before,
  td.table-empty::before,
  tr:has(td.empty) td::before,
  tr:has(.table-empty) td::before {
    content: none;
  }

  .status-stack,
  .actions,
  .type-stack {
    min-width: 0;
  }

  /* Status / health pills: never overlap; clear gap above IP */
  .inventory-table .status-stack {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    row-gap: 8px;
  }

  .inventory-table .status-stack .pill,
  .inventory-table .health-badge {
    flex: 0 0 auto;
    max-width: 100%;
    white-space: nowrap;
  }

  .inventory-table .health-note {
    display: block;
    max-width: none;
    margin-top: 8px;
    white-space: normal;
    word-break: break-all;
    font-size: 11px;
    opacity: 0.9;
    line-height: 1.35;
  }

  .inventory-table .warp-egress-note {
    max-width: none;
    white-space: normal;
  }

  .inventory-table .type-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  .inventory-table .row-note {
    max-width: none;
    white-space: normal;
  }

  .inventory-table .actions {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    justify-content: stretch;
  }

  /* Action buttons: equal columns, orphan last button fills full width (no empty hole) */
  .inventory-table .action-group,
  .action-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    padding: 6px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
  }

  .inventory-table .action-group .small,
  .actions .small,
  .pool-actions .small {
    width: 100%;
    min-height: 40px;
    padding: 0 8px;
    font-size: 11px;
    white-space: nowrap;
    justify-content: center;
    gap: 5px;
  }

  /* 2 buttons in a group (e.g. Get Fresh + Delete) */
  .pool-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    align-items: stretch !important;
  }

  .pool-actions::before {
    grid-column: 1 / -1;
  }

  .pool-actions > .small {
    grid-column: auto;
  }

  .pool-actions .pool-progress {
    grid-column: 1 / -1;
    width: 100% !important;
    margin-left: 0 !important;
  }

  .inventory-table .copy-port-btn,
  .inventory-table .local-port-chip {
    width: 100%;
    min-height: 36px;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
  }

  .inventory-table .container-name-cell {
    align-items: center;
    gap: 12px;
    padding-top: 4px; /* room for POOL/MITM badge above avatar */
  }

  .inventory-table .container-name-cell strong,
  .inventory-table .container-name-cell .table-link {
    font-size: 13px;
    word-break: break-word;
  }

  .inventory-table .container-avatar {
    width: 30px;
    height: 30px;
    margin-top: 12px; /* keep POOL/MITM badge clear of avatar + card edge */
    flex-shrink: 0;
  }

  .inventory-table .container-avatar-badge {
    bottom: calc(100% + 4px);
    min-width: 30px;
    height: 13px;
    font-size: 8px;
    letter-spacing: 0.06em;
    z-index: 2;
  }

  /* Two badges (MITM+POOL): stack with clear gap, no overlap */
  .inventory-table .container-avatar:has(.container-avatar-badge.pool):has(.container-avatar-badge:not(.pool)) .container-avatar-badge:not(.pool) {
    bottom: calc(100% + 20px);
  }

  .inventory-table td {
    height: auto;
  }

  /* Name row: allow badge to sit without clipping into previous card */
  tr[data-container-id] {
    overflow: visible;
  }

  tr[data-container-id] td[data-label="Name"] {
    overflow: visible;
    padding-top: 14px;
  }

  /* Actions row: give value full width under a short label */
  .inventory-table td[data-label="Actions"],
  .pools-table td[data-label="Actions"],
  .api-keys-table td[data-label="Actions"] {
    align-items: start;
  }

  .inventory-table td[data-label="Status"] {
    align-items: start;
    row-gap: 0;
  }

  .create-options {
    gap: 12px;
  }

  .create-option {
    padding: 12px;
  }

  .login-visual {
    min-height: auto;
    padding: 24px;
  }

  .login-copy h1 {
    font-size: 30px;
  }

  .login-panel-wrap {
    min-height: auto;
    padding: 20px;
  }

  .login-panel {
    padding: 22px;
  }

  .activity-row {
    grid-template-columns: 1fr;
    padding: 10px 0;
  }

  .notification-stack {
    left: 10px;
    right: 10px;
    top: 10px;
    width: auto;
  }

  .notification {
    max-width: none;
  }

  .confirm-modal {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .top-actions .nav-link {
    font-size: 11px;
    padding: 0 8px;
    gap: 4px;
  }

  .top-actions .nav-link .icon {
    width: 14px;
    height: 14px;
  }

  td {
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 10px 12px;
    column-gap: 8px;
  }

  /* 2-col actions: last orphan button spans full width (no empty half-cell gap) */
  .inventory-table .action-group,
  .action-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .inventory-table .action-group .small:last-child:nth-child(odd),
  .action-group .small:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .inventory-table .action-group .small,
  .actions .small {
    min-height: 42px;
    font-size: 11px;
  }

  /* Status badges stay side-by-side with breathing room; wrap cleanly if needed */
  .inventory-table .status-stack {
    gap: 8px;
  }

  .inventory-table .status-stack .pill,
  .inventory-table .health-badge {
    min-height: 26px;
    padding: 0 9px;
    font-size: 11px;
  }
}

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

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

  .top-actions .ws-indicator {
    justify-self: stretch;
  }
}

.table-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed rgba(148, 166, 186, 0.5);
}

.table-link:hover {
  color: var(--green-bright);
  border-bottom-color: rgba(62, 229, 143, 0.75);
}

.table-link.is-disabled {
  color: var(--muted);
  pointer-events: none;
  text-decoration: none;
  border-bottom-color: transparent;
}

.copy-port-btn {
  border: 1px solid rgba(80, 222, 125, 0.32);
  border-radius: 8px;
  background: rgba(80, 222, 125, 0.08);
  color: var(--green-bright);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-width: 64px;
  padding: 6px 10px;
}

.copy-port-btn.port-chip {
  min-height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background:
    linear-gradient(135deg, rgba(62, 229, 143, 0.15), rgba(62, 229, 143, 0.07)),
    rgba(8, 15, 24, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.copy-port-btn.port-chip .icon {
  width: 14px;
  height: 14px;
}

.copy-port-btn:hover {
  background: rgba(80, 222, 125, 0.14);
  border-color: rgba(80, 222, 125, 0.58);
}

.copy-port-btn:focus-visible {
  outline: 2px solid rgba(80, 222, 125, 0.7);
  outline-offset: 2px;
}

.notice.error {
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.22);
}

.mitm-mock-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.mitm-mock-form label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.mitm-mock-form textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.72);
  color: #dbeafe;
  font: 0.88rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  padding: 14px;
  outline: none;
}

.mitm-mock-form textarea:focus {
  border-color: rgba(56, 189, 248, 0.72);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 0.86rem;
}

.log-stream {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #050b12;
  color: #d7e4f2;
  min-height: 380px;
  max-height: 65vh;
  overflow: auto;
  padding: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.usage-meter {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(8, 14, 23, 0.42);
  padding: 12px;
}

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

.usage-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.usage-head strong {
  font-size: 20px;
  line-height: 1;
}

.usage-track {
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 166, 186, 0.2);
  overflow: hidden;
}

.usage-track span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0ea5e9 0%, #3ee58f 100%);
  transition: width 0.28s ease;
}

.usage-detail {
  margin-top: 8px;
  color: var(--muted);
}

.compact-meter .usage-head strong {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 14px;
}

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

.runtime-meta-item {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(8, 14, 23, 0.38);
  padding: 10px 12px;
}

.runtime-meta-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.runtime-meta-item strong {
  display: block;
  margin-top: 5px;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 14px;
  color: var(--text);
}

.api-docs-panel,
.api-endpoint-card {
  min-width: 0;
}

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

.api-intro-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(8, 14, 23, 0.36);
}

.api-intro-card span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.api-intro-card strong,
.api-intro-card code {
  overflow-wrap: anywhere;
}

.api-docs-grid {
  display: grid;
  gap: 18px;
}

.api-docs-toolbar {
  padding: 14px 16px;
}

.api-docs-toolbar .inventory-search {
  max-width: 720px;
}

.api-endpoint-card {
  padding: 0;
  overflow: clip;
}

.api-endpoint-summary {
  display: grid;
  gap: 12px;
  padding: 18px;
  cursor: pointer;
  list-style: none;
}

.api-endpoint-summary::-webkit-details-marker {
  display: none;
}

.api-endpoint-summary .panel-title {
  margin-bottom: 0;
}

.api-endpoint-summary h2,
.api-endpoint-summary h2 code {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.api-endpoint-summary:focus-visible {
  outline: 2px solid rgba(107, 169, 255, 0.72);
  outline-offset: -3px;
}

.api-endpoint-disclosure {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.api-endpoint-disclosure .icon {
  transition: transform 0.2s ease;
}

.api-endpoint-disclosure-close {
  display: none;
}

.api-endpoint-card[open] .api-endpoint-disclosure-open {
  display: none;
}

.api-endpoint-card[open] .api-endpoint-disclosure-close {
  display: inline;
}

.api-endpoint-card[open] .api-endpoint-disclosure .icon {
  transform: rotate(180deg);
}

.api-endpoint-body {
  padding: 0 18px 18px;
}

.api-playground-global {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.api-playground-global label,
.api-playground-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.api-endpoint-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.api-example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.api-example-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(8, 14, 23, 0.32);
}

.api-example-card pre {
  box-sizing: border-box;
  width: 100%;
  margin: 10px 0 0;
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(38, 54, 74, 0.9);
  border-radius: 12px;
  background: #050b12;
}

.api-example-card code {
  display: block;
  min-width: 100%;
  width: max-content;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

.api-playground-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.api-playground-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(107, 169, 255, 0.1), transparent 45%),
    rgba(8, 14, 23, 0.42);
}

.api-playground-switcher strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.api-playground-switcher p {
  margin-top: 6px;
  max-width: 520px;
  color: var(--muted);
  line-height: 1.5;
}

.playground-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(38, 54, 74, 0.92);
  border-radius: 999px;
  background: rgba(6, 11, 19, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  cursor: pointer;
  user-select: none;
}

.playground-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.playground-toggle-track {
  position: relative;
  width: 58px;
  height: 32px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid rgba(239, 68, 68, 0.24);
  transition: background 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.playground-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #d3deec);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.playground-toggle-copy {
  display: grid;
  min-width: 74px;
  gap: 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.playground-toggle-label-on {
  color: var(--green-bright);
}

.playground-toggle-label-off {
  color: var(--muted-2);
}

.playground-toggle input:checked + .playground-toggle-track {
  background: rgba(30, 192, 113, 0.28);
  border-color: rgba(62, 229, 143, 0.34);
  box-shadow: 0 0 0 6px rgba(30, 192, 113, 0.09);
}

.playground-toggle input:checked + .playground-toggle-track .playground-toggle-thumb {
  transform: translateX(26px);
}

.playground-toggle input:not(:checked) ~ .playground-toggle-copy .playground-toggle-label-on {
  color: var(--muted-2);
}

.playground-toggle input:not(:checked) ~ .playground-toggle-copy .playground-toggle-label-off {
  color: #ff9d9d;
}

.playground-toggle input:focus-visible + .playground-toggle-track {
  outline: 2px solid rgba(107, 169, 255, 0.7);
  outline-offset: 3px;
}

.api-playground-head {
  margin-bottom: 0;
}

.api-playground-fields {
  display: grid;
  gap: 12px;
  overflow: clip;
  transition:
    max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.24s ease,
    transform 0.28s ease,
    filter 0.24s ease,
    margin-top 0.3s ease;
  transform-origin: top center;
}

.api-playground-form.is-disabled {
  opacity: 0.92;
}

.api-playground-form.is-disabled .api-playground-fields {
  max-height: 0 !important;
  opacity: 0;
  transform: translateY(-8px) scaleY(0.98);
  filter: saturate(0.72);
}

.api-playground-form.is-disabled .api-playground-head p:last-child {
  color: var(--muted-2);
}

.api-playground-form.is-disabled .primary-btn[type="submit"] {
  opacity: 0.55;
}

.api-playground-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 10px;
}

.api-playground-grid > div {
  display: grid;
  gap: 8px;
}

.api-playground-form textarea {
  width: 100%;
  min-height: 98px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(8, 15, 24, 0.72);
  color: var(--text);
  padding: 12px;
  outline: none;
  font: 0.88rem/1.55 "JetBrains Mono", "Fira Code", monospace;
}

.api-playground-form textarea:focus {
  border-color: rgba(87, 214, 111, 0.75);
  box-shadow: 0 0 0 2px rgba(87, 214, 111, 0.16);
}

.api-playground-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.api-playground-response pre {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 10px 0 0;
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(38, 54, 74, 0.9);
  border-radius: 12px;
  background: #050b12;
}

.api-playground-output {
  display: block;
  min-width: 100%;
  width: max-content;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

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

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

  .form-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .form-footer .small {
    width: 100%;
  }

  .api-docs-intro,
  .api-playground-grid,
  .api-example-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .api-playground-switcher {
    flex-direction: column;
    align-items: stretch;
  }

  .playground-toggle {
    justify-content: space-between;
  }

  .api-docs-toolbar {
    padding: 12px;
  }

  .api-endpoint-summary {
    padding: 14px;
  }

  .api-endpoint-body {
    padding: 0 14px 14px;
  }

  .api-endpoint-disclosure {
    justify-self: start;
  }
}

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

  .api-endpoint-meta {
    justify-content: flex-start;
  }

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

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

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