@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/IBMPlexSans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/IBMPlexSans-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/IBMPlexSans-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/IBMPlexSans-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/IBMPlexMono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/IBMPlexMono-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/IBMPlexMono-600.woff2") format("woff2"); }

:root {
  --cds-background: #ffffff;
  --cds-background-hover: #e8e8e8;
  --cds-background-active: #c6c6c6;
  --cds-background-selected: #e0e0e0;
  --cds-layer-01: #f4f4f4;
  --cds-layer-02: #ffffff;
  --cds-layer-accent-01: #e0e0e0;
  --cds-layer-hover-01: #e8e8e8;
  --cds-field-01: #f4f4f4;
  --cds-border-subtle-01: #e0e0e0;
  --cds-border-subtle-02: #c6c6c6;
  --cds-border-strong-01: #8d8d8d;
  --cds-text-primary: #161616;
  --cds-text-secondary: #525252;
  --cds-text-placeholder: #a8a8a8;
  --cds-text-helper: #6f6f6f;
  --cds-text-on-color: #ffffff;
  --cds-icon-primary: #161616;
  --cds-icon-secondary: #525252;
  --cds-button-primary: #0f62fe;
  --cds-button-primary-hover: #0050e6;
  --cds-button-primary-active: #002d9c;
  --cds-focus: #0f62fe;
  --cds-interactive: #0f62fe;
  --cds-link-primary: #0f62fe;
  --play-0: #0f62fe;
  --play-1: #007d79;
  --play-2: #6929c4;
  --play-3: #198038;
  --play-4: #ff832b;
  --play-5: #9f1853;
  --play-6: #0043ce;
  --play-7: #8a3800;
  --play-8: #005d5d;
  --play-9: #6f6f6f;
  --conn-neutral: #6f6f6f;
  --kind-native: #0f62fe;
  --font-sans: "IBM Plex Sans", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;
}

[data-theme="dark"] {
  --cds-background: #161616;
  --cds-background-hover: #353535;
  --cds-background-active: #525252;
  --cds-background-selected: #353535;
  --cds-layer-01: #262626;
  --cds-layer-02: #393939;
  --cds-layer-accent-01: #525252;
  --cds-layer-hover-01: #333333;
  --cds-field-01: #262626;
  --cds-border-subtle-01: #393939;
  --cds-border-subtle-02: #525252;
  --cds-border-strong-01: #6f6f6f;
  --cds-text-primary: #f4f4f4;
  --cds-text-secondary: #c6c6c6;
  --cds-text-placeholder: #6f6f6f;
  --cds-text-helper: #8d8d8d;
  --cds-icon-primary: #f4f4f4;
  --cds-icon-secondary: #c6c6c6;
  --cds-button-primary: #0f62fe;
  --cds-button-primary-hover: #0353e9;
  --cds-button-primary-active: #002d9c;
  --cds-focus: #ffffff;
  --cds-interactive: #4589ff;
  --cds-link-primary: #78a9ff;
  --play-0: #4589ff;
  --play-1: #3ddbd9;
  --play-2: #be95ff;
  --play-3: #6fdc8c;
  --play-4: #ff832b;
  --play-5: #ff7eb6;
  --play-6: #78a9ff;
  --play-7: #ba4e00;
  --play-8: #08bdba;
  --play-9: #8d8d8d;
  --conn-neutral: #8d8d8d;
  --kind-native: #4589ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; width: 100%; overflow: hidden; }
body {
  font-family: var(--font-sans);
  background: var(--cds-background);
  color: var(--cds-text-primary);
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

.cds-shell {
  flex-shrink: 0;
  background: var(--cds-layer-01);
  border-bottom: 1px solid var(--cds-border-subtle-01);
}

.cds-shell__bar1 {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 16px;
  gap: 16px;
}

.cds-shell__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.cds-shell__wordmark { font-weight: 600; }
.cds-shell__divider { width: 1px; height: 16px; background: var(--cds-border-subtle-02); }
.cds-shell__product { font-weight: 400; color: var(--cds-text-secondary); }

.cds-shell__links {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.cds-shell__external-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cds-link-primary);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--cds-border-subtle-02);
  background: var(--cds-layer-02);
  transition: all 0.15s ease;
}

.cds-shell__external-link:hover {
  background: var(--cds-layer-hover-01);
  text-decoration: underline;
}

.cds-shell__external-link .icon-launch {
  flex-shrink: 0;
}

.cds-shell__meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cds-shell__meta-text {
  font-size: 12px;
  color: var(--cds-text-helper);
  font-family: var(--font-mono);
}

.cds-shell__theme-btn {
  background: transparent;
  border: 1px solid var(--cds-border-subtle-02);
  color: var(--cds-text-primary);
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.cds-shell__theme-btn:hover {
  background: var(--cds-layer-hover-01);
}

.cds-shell__bar2 {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 16px;
  border-top: 1px solid var(--cds-border-subtle-01);
  background: var(--cds-layer-01);
  overflow-x: auto;
}

.search-container {
  position: relative;
  width: 320px;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  height: 32px;
  padding: 0 32px 0 12px;
  background: var(--cds-field-01);
  border: 1px solid var(--cds-border-subtle-02);
  border-bottom: 1px solid var(--cds-border-strong-01);
  color: var(--cds-text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  border-radius: 0;
}

.search-input:focus {
  outline: 2px solid var(--cds-focus);
  outline-offset: -2px;
}

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--cds-text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: none;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
}

.search-clear.is-visible { display: block; }

.search-results-count {
  font-size: 12px;
  color: var(--cds-text-secondary);
  font-family: var(--font-mono);
  white-space: nowrap;
}

#play-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 12px;
  border: 1px solid var(--cds-border-subtle-02);
  background: var(--cds-layer-02);
  color: var(--cds-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.legend-chip:hover {
  color: var(--cds-text-primary);
  border-color: var(--cds-border-strong-01);
}

.legend-chip[aria-pressed="true"] {
  background: var(--cds-layer-accent-01);
  color: var(--cds-text-primary);
  border-color: var(--cds-interactive);
  font-weight: 600;
}

.legend-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--play-color, var(--cds-interactive));
}

.legend-chip .chip-count {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--cds-background-hover);
  padding: 1px 5px;
  border-radius: 8px;
}

.os-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding-left: 12px;
  border-left: 1px solid var(--cds-border-subtle-01);
}

.os-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 10px;
  border: 1px solid var(--cds-border-subtle-02);
  background: transparent;
  color: var(--cds-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.os-chip:hover {
  color: var(--cds-text-primary);
  border-color: var(--cds-border-strong-01);
  background: var(--cds-background-hover);
}

.os-chip.is-active {
  background: var(--cds-interactive);
  border-color: var(--cds-interactive);
  color: var(--cds-text-on-color);
  font-weight: 600;
}

#main {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}


.partner-badge {
  display: inline-block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 4px;
  border-radius: 2px;
  background: var(--play-4);
  color: #ffffff;
  margin-left: 6px;
  font-weight: 600;
  vertical-align: middle;
}

.restricted-badge {
  display: inline-block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1px 5px;
  border-radius: 2px;
  background: #f1c21b;
  color: #000000;
  margin-left: 6px;
  font-weight: 700;
  vertical-align: middle;
}

.restricted-pill {
  color: #f1c21b;
  border-color: #f1c21b;
  font-size: 11px;
}

#sidebar {
  width: 360px;
  flex-shrink: 0;
  background: var(--cds-layer-01);
  border-left: 1px solid var(--cds-border-subtle-01);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#sidebar-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--cds-border-subtle-01);
}

.sidebar-title {
  font-size: 14px;
  font-weight: 600;
}

#reset-btn {
  background: transparent;
  border: none;
  font-size: 12px;
  color: var(--cds-link-primary);
  cursor: pointer;
  padding: 4px 8px;
}

#reset-btn:hover {
  text-decoration: underline;
}

#sidebar-inner {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.sb-empty {
  color: var(--cds-text-helper);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 24px;
}

.sb-category {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--cds-text-helper);
  font-weight: 600;
  margin-bottom: 4px;
}

.sb-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--cds-text-primary);
  margin-bottom: 8px;
}

.sb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.play-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--cds-layer-02);
  border: 1px solid var(--cds-border-subtle-02);
  color: var(--cds-text-secondary);
}

.play-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--play-color, var(--cds-interactive));
}

.os-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.os-pill--aix   { border-color: #3ddbd9; color: #3ddbd9; }
.os-pill--ibmi  { border-color: #4589ff; color: #4589ff; }
.os-pill--linux { border-color: #42be65; color: #42be65; }
.os-pill--ocp   { border-color: #ff832b; color: #ff832b; }

[data-theme="dark"] .os-pill--aix   { border-color: #3ddbd9; color: #3ddbd9; }
[data-theme="dark"] .os-pill--ibmi  { border-color: #4589ff; color: #4589ff; }
[data-theme="dark"] .os-pill--linux { border-color: #42be65; color: #42be65; }
[data-theme="dark"] .os-pill--ocp   { border-color: #ff832b; color: #ff832b; }

.sb-section {
  margin-bottom: 20px;
}

.sb-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--cds-text-helper);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sb-section-docs-link {
  color: var(--cds-text-helper);
  opacity: 0.6;
  transition: opacity 0.15s;
  flex-shrink: 0;
  line-height: 0;
}

.sb-section-docs-link:hover {
  opacity: 1;
  color: var(--cds-link-primary);
}

/* Software tier table */
.sb-tier-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 2px;
}

.sb-tier-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--cds-text-helper);
  padding: 5px 8px 5px 0;
  border-bottom: 1px solid var(--cds-border-subtle-01);
}

.sb-tier-table td {
  padding: 6px 8px 6px 0;
  color: var(--cds-text-secondary);
  vertical-align: top;
  border-bottom: 1px solid var(--cds-border-subtle-01);
}

.sb-tier-table tr:last-child td {
  border-bottom: none;
}

.sb-tier-table .sb-tier-notes-row td {
  padding-top: 0;
  padding-bottom: 8px;
  font-size: 11px;
  color: var(--cds-text-helper);
  font-style: italic;
  border-bottom: 1px solid var(--cds-border-subtle-01);
}

.sb-tier-table .sb-tier-notes-row:last-child td {
  border-bottom: none;
}

.sb-tier-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--play-1) 15%, transparent);
  color: var(--play-1);
  border: 1px solid color-mix(in srgb, var(--play-1) 35%, transparent);
  white-space: nowrap;
}

/* Version badge — uses the OS category colour (play-1 teal) */
.sb-version-badge {
  background: color-mix(in srgb, var(--play-0) 12%, transparent);
  color: var(--cds-text-primary);
  border-color: color-mix(in srgb, var(--play-0) 30%, transparent);
  font-size: 10px;
}

.sb-version-yes {
  font-size: 11px;
  font-weight: 600;
  color: var(--play-3);
}

.sb-version-no {
  font-size: 11px;
  font-weight: 600;
  color: var(--cds-text-helper);
  font-style: italic;
}

.sb-description {
  font-size: 13px;
  line-height: 1.5;
  color: var(--cds-text-secondary);
  margin-bottom: 8px;
}

.sb-value {
  font-size: 13px;
  line-height: 1.5;
  color: var(--cds-text-primary);
  background: var(--cds-layer-02);
  padding: 10px;
  border-left: 3px solid var(--cds-interactive);
  border-radius: 2px;
}

.sb-list {
  list-style: disc;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--cds-text-secondary);
}

.sb-list li { margin-bottom: 4px; }

.sb-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--cds-link-primary);
  text-decoration: none;
  font-weight: 500;
  margin-top: 8px;
}

.sb-link:hover { text-decoration: underline; }

.sb-connections {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sb-conn-card {
  background: var(--cds-layer-02);
  border: 1px solid var(--cds-border-subtle-02);
  border-radius: 4px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sb-conn-card:hover {
  border-color: var(--cds-border-strong-01);
  background: var(--cds-layer-hover-01);
}

.sb-conn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.sb-conn-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--cds-text-primary);
}

.sb-conn-badge {
  font-size: 10px;
  text-transform: uppercase;
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--cds-field-01);
  color: var(--cds-text-secondary);
}

.sb-conn-summary {
  font-size: 12px;
  line-height: 1.4;
  color: var(--cds-text-secondary);
  margin-bottom: 4px;
}

.sb-conn-note {
  font-size: 11px;
  line-height: 1.4;
  color: var(--cds-text-helper);
  font-style: italic;
  border-top: 1px dashed var(--cds-border-subtle-01);
  padding-top: 4px;
  margin-top: 4px;
}

#footer {
  height: 36px;
  flex-shrink: 0;
  background: var(--cds-layer-01);
  border-top: 1px solid var(--cds-border-subtle-01);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 11px;
  color: var(--cds-text-helper);
}

.footer-stats {
  font-family: var(--font-mono);
}

.footer-hint {
  font-style: italic;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---------------------------------------------------------------------------
   View switch toggle (Map / Grid)
--------------------------------------------------------------------------- */
.view-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--cds-layer-accent-01);
  border-radius: 4px;
  padding: 2px;
  flex-shrink: 0;
}

.view-btn {
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--cds-text-secondary);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.view-btn:hover {
  color: var(--cds-text-primary);
  background: var(--cds-background-hover);
}

.view-btn.is-active {
  background: var(--cds-layer-02);
  color: var(--cds-text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* ---------------------------------------------------------------------------
   View layout shells (Map / Architecture / Network / Availability)
--------------------------------------------------------------------------- */

#main.is-grid-mode #grid-area    { display: flex; }
#main.is-grid-mode #network-area,
#main.is-grid-mode #arch-area,
#main.is-grid-mode #avail-area   { display: none; }

#main.is-network-mode #network-area { display: flex; }
#main.is-network-mode #grid-area,
#main.is-network-mode #arch-area,
#main.is-network-mode #avail-area   { display: none; }

#main.is-arch-mode #arch-area    { display: block; }
#main.is-arch-mode #grid-area,
#main.is-arch-mode #network-area,
#main.is-arch-mode #avail-area   { display: none; }

#main.is-avail-mode #avail-area  { display: flex; }
#main.is-avail-mode #grid-area,
#main.is-avail-mode #network-area,
#main.is-avail-mode #arch-area   { display: none; }
#main.is-avail-mode #sidebar     { display: none !important; }

/* Sidebar collapses in map / architecture / network modes */
#main.is-grid-mode #sidebar,
#main.is-arch-mode #sidebar,
#main.is-network-mode #sidebar {
  width: 0;
  min-width: 0;
  overflow: hidden;
  border-left: none;
  transition: width 0.22s ease, min-width 0.22s ease;
}

#main.is-grid-mode #sidebar.is-open,
#main.is-arch-mode #sidebar.is-open,
#main.is-network-mode #sidebar.is-open {
  width: 360px;
  min-width: 360px;
  border-left: 1px solid var(--cds-border-subtle-01);
}

#grid-area {
  display: none;
  flex: 1;
  overflow: hidden;
  background: var(--cds-background);
}

#arch-area {
  display: none;
  flex: 1;
  overflow-y: auto;
  background: var(--cds-background);
}

/* ── Map view (radial) ───────────────────────────────────────────────────── */
.map-stage {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--cds-background);
  overflow: hidden;
}

.synergy-map {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  font-family: inherit;
}

.spoke {
  stroke-width: 1;
  opacity: 0.22;
  stroke-linecap: round;
  pointer-events: none;
  transition: opacity 0.15s;
}
.spoke.is-dimmed { opacity: 0.06; }
.spoke.is-lit    { opacity: 0.55; stroke-width: 1.5; }

.inode {
  cursor: pointer;
  outline: none;
}
.inode text.fg {
  fill: var(--cds-text-secondary);
  pointer-events: none;
  text-anchor: middle;
  font-weight: 600;
  font-size: 12px;
  transition: fill 0.15s;
}
.inode:hover text.fg,
.inode:focus-visible text.fg {
  fill: var(--ic) !important;
}
.inode.is-active text.fg,
.inode.is-highlighted text.fg,
.inode.is-query-hit text.fg {
  fill: var(--ic) !important;
  font-weight: 700;
}
.inode.is-dimmed { opacity: 0.22; }
.inode.is-query-hit text.fg {
  paint-order: stroke;
  stroke: var(--cds-interactive);
  stroke-width: 0.6px;
  stroke-opacity: 0.45;
}

.arc-lbl { pointer-events: none; }
.arc-lbl-text {
  font-size: 13px;
  font-weight: 700;
  fill: #fff;
  letter-spacing: 0.04em;
  dominant-baseline: middle;
}

.hub {
  cursor: pointer;
  outline: none;
}
.hub .hc {
  fill: var(--hc, var(--play-0));
  transition: filter 0.2s;
}
.hub:hover .hc,
.hub:focus-visible .hc { filter: brightness(1.12); }
.hub.is-active .hc,
.hub.is-highlighted .hc { filter: brightness(1.1); }
.hub.is-dimmed { opacity: 0.35; }
.hub text {
  fill: #fff;
  text-anchor: middle;
  pointer-events: none;
}
.hub .hub-ibm {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.8;
}
.hub .hub-nm {
  font-size: 28px;
  font-weight: 700;
}
.hub .hub-st {
  font-size: 11px;
  fill: rgba(22, 22, 22, 0.85);
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Network view
--------------------------------------------------------------------------- */

#network-area {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
  background: var(--cds-background);
  padding: 32px 40px 48px;
  gap: 0;
}

.net-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  position: relative;
  padding: 12px 0;
}

/* Subtle connector line between rows */
.net-row + .net-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 100px;
  right: 0;
  height: 1px;
  background: var(--cds-border-subtle-01);
}

.net-row-label {
  width: 140px;
  flex-shrink: 0;
  padding-top: 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--cds-text-helper);
  user-select: none;
}

.net-row-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1;
}

/* Row 0 — single anchor card gets centred treatment */
.net-row[data-row="0"] .net-row-cards {
  justify-content: flex-start;
}

.net-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1.5px solid var(--cds-border-subtle-02);
  border-left: 4px solid var(--net-color, var(--cds-interactive));
  border-radius: 4px;
  background: var(--cds-layer-01);
  cursor: pointer;
  transition: opacity 0.15s, background 0.12s, box-shadow 0.12s, border-color 0.12s;
  min-width: 200px;
  max-width: 300px;
  user-select: none;
}

.net-card:hover {
  background: var(--cds-layer-hover-01);
  border-top-color: var(--net-color, var(--cds-interactive));
  border-right-color: var(--net-color, var(--cds-interactive));
  border-bottom-color: var(--net-color, var(--cds-interactive));
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.net-card-icon {
  font-size: 18px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
  color: var(--net-color, var(--cds-interactive));
  font-family: var(--font-sans);
  line-height: 1;
}

.net-card-body {
  min-width: 0;
}

.net-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--cds-text-primary);
  line-height: 1.3;
}

.net-card-sub {
  font-size: 11px;
  color: var(--cds-text-helper);
  margin-top: 2px;
  line-height: 1.3;
}

/* Selected card */
.net-card.is-selected {
  background: color-mix(in srgb, var(--net-color, var(--cds-interactive)) 15%, var(--cds-layer-01));
  border-top-color: var(--net-color, var(--cds-interactive));
  border-right-color: var(--net-color, var(--cds-interactive));
  border-bottom-color: var(--net-color, var(--cds-interactive));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--net-color, var(--cds-interactive)) 50%, transparent),
              0 2px 12px rgba(0,0,0,0.15);
}

.net-card.is-selected .net-card-label {
  color: var(--cds-text-primary);
}

/* Reachable (in path) card */
.net-card.is-reachable {
  background: color-mix(in srgb, var(--net-color, var(--cds-interactive)) 8%, var(--cds-layer-01));
  border-top-color: color-mix(in srgb, var(--net-color, var(--cds-interactive)) 60%, transparent);
  border-right-color: color-mix(in srgb, var(--net-color, var(--cds-interactive)) 60%, transparent);
  border-bottom-color: color-mix(in srgb, var(--net-color, var(--cds-interactive)) 60%, transparent);
  opacity: 1;
}

/* Dimmed — not in current path */
.net-card.is-dimmed {
  opacity: 0.22;
  filter: grayscale(0.5);
}

/* Dark-theme net card tweaks */
[data-theme="dark"] .net-card {
  background: var(--cds-layer-01);
  border-top-color: var(--cds-border-subtle-02);
  border-right-color: var(--cds-border-subtle-02);
  border-bottom-color: var(--cds-border-subtle-02);
}

[data-theme="dark"] .net-card.is-selected {
  background: color-mix(in srgb, var(--net-color, var(--cds-interactive)) 20%, var(--cds-layer-01));
}

[data-theme="dark"] .net-card.is-reachable {
  background: color-mix(in srgb, var(--net-color, var(--cds-interactive)) 12%, var(--cds-layer-01));
}

/* Plane divider — separates VPC-plane from PowerVS-plane cards in Row 4 */
.net-plane-divider {
  display: flex;
  align-items: center;
  align-self: stretch;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--cds-text-helper);
  border-left: 2px solid var(--cds-border-subtle-01);
  margin: 0 4px;
  white-space: nowrap;
}

/* VPC-plane cards get a faint top pip to group them visually */
.net-card[data-plane="vpc"] {
  border-top: 2.5px solid #9f1853;
}

/* PowerVS-plane NSG card gets a purple top pip to match TGW/Route Tables colour */
.net-card[data-plane="pvs"] {
  border-top: 2.5px solid #6929c4;
}

/* ---------------------------------------------------------------------------
   Grid view — OS column (left)
--------------------------------------------------------------------------- */

.grid-os-col {
  display: flex;
  flex-direction: column;
  width: 160px;
  flex-shrink: 0;
  border-right: 1px solid var(--cds-border-subtle-01);
  background: var(--cds-layer-01);
  overflow-y: auto;
}

.grid-col-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--cds-text-helper);
  border-bottom: 1px solid var(--cds-border-subtle-01);
  background: var(--cds-layer-01);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}

.grid-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--col-color, var(--cds-interactive));
  flex-shrink: 0;
}

.grid-os-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 10px;
}

.grid-os-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  border: 1.5px solid var(--cds-border-subtle-02);
  border-radius: 4px;
  background: var(--cds-layer-02);
  color: var(--cds-text-primary);
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
  position: relative;
}

.grid-os-btn::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--os-color, var(--cds-interactive));
  margin-right: 9px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.14s;
}

.grid-os-btn:hover {
  border-color: var(--os-color, var(--cds-interactive));
  background: var(--cds-background-hover);
}

.grid-os-btn.is-active {
  border-color: var(--os-color, var(--cds-interactive));
  border-width: 2px;
  background: color-mix(in srgb, var(--os-color, var(--cds-interactive)) 18%, var(--cds-layer-01));
  color: var(--cds-text-primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--os-color, var(--cds-interactive));
}

.grid-os-btn.is-active::before {
  opacity: 1;
}

.grid-os-btn.is-query-hit {
  border-color: var(--cds-interactive);
  border-width: 2px;
  background: color-mix(in srgb, var(--cds-interactive) 12%, var(--cds-layer-01));
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--cds-interactive);
}

.grid-os-btn.is-query-hit::before {
  opacity: 1;
}

.grid-os-btn.is-dimmed {
  opacity: 0.28;
}

/* ---------------------------------------------------------------------------
   Grid view — integration columns (right)
--------------------------------------------------------------------------- */

.grid-integ-cols {
  display: flex;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 0;
}

.grid-cat-col {
  display: flex;
  flex-direction: column;
  min-width: 180px;
  flex: 1;
  border-right: 1px solid var(--cds-border-subtle-01);
  overflow-y: auto;
  background: var(--cds-background);
}

.grid-cat-col:last-child {
  border-right: none;
}

.grid-col-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px;
  overflow-y: auto;
  flex: 1;
}

/* ---------------------------------------------------------------------------
   Grid view — integration cards
--------------------------------------------------------------------------- */

.grid-card {
  padding: 9px 11px;
  border-radius: 4px;
  border-top: 1.5px solid var(--cds-border-subtle-01);
  border-right: 1.5px solid var(--cds-border-subtle-01);
  border-bottom: 1.5px solid var(--cds-border-subtle-01);
  border-left: 3px solid var(--card-color, var(--cds-interactive));
  background: var(--cds-layer-01);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, opacity 0.15s, box-shadow 0.15s;
}

.grid-card:hover {
  border-top-color: var(--card-color, var(--cds-interactive));
  border-right-color: var(--card-color, var(--cds-interactive));
  border-bottom-color: var(--card-color, var(--cds-interactive));
  background: var(--cds-background-hover);
}

.grid-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--cds-text-primary);
  line-height: 1.3;
  margin-bottom: 4px;
}

.grid-card-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--play-4) 15%, transparent);
  color: var(--play-4);
  border: 1px solid color-mix(in srgb, var(--play-4) 35%, transparent);
  margin-bottom: 4px;
  margin-right: 4px;
}

.grid-card-badge.is-restricted {
  background: color-mix(in srgb, #f1c21b 12%, transparent);
  color: #b28600;
  border-color: color-mix(in srgb, #f1c21b 40%, transparent);
}

[data-theme="dark"] .grid-card-badge.is-restricted {
  color: #f1c21b;
}

.grid-card-os {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.grid-card-os-pip {
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 2px;
  border: 1px solid currentColor;
  opacity: 0.65;
  white-space: nowrap;
}

/* Highlight states */
.grid-card.is-highlighted {
  border-top-color: var(--card-color, var(--cds-interactive));
  border-right-color: var(--card-color, var(--cds-interactive));
  border-bottom-color: var(--card-color, var(--cds-interactive));
  background: color-mix(in srgb, var(--card-color, var(--cds-interactive)) 10%, var(--cds-layer-01));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--card-color, var(--cds-interactive)) 40%, transparent),
              0 2px 8px rgba(0,0,0,0.10);
}

.grid-card.is-highlighted .grid-card-os-pip {
  opacity: 1;
}

.grid-card.is-dimmed {
  opacity: 0.22;
  filter: grayscale(0.4);
}

/* Dark theme card tweaks */
[data-theme="dark"] .grid-card {
  background: var(--cds-layer-01);
  border-top-color: var(--cds-border-subtle-02);
  border-right-color: var(--cds-border-subtle-02);
  border-bottom-color: var(--cds-border-subtle-02);
}

[data-theme="dark"] .grid-card.is-highlighted {
  background: color-mix(in srgb, var(--card-color, var(--cds-interactive)) 14%, var(--cds-layer-01));
  border-top-color: var(--card-color, var(--cds-interactive));
  border-right-color: var(--card-color, var(--cds-interactive));
  border-bottom-color: var(--card-color, var(--cds-interactive));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--card-color, var(--cds-interactive)) 50%, transparent),
              0 2px 12px rgba(0,0,0,0.35);
}

/* ---------------------------------------------------------------------------
   Matrix view — OS × Integration columns
--------------------------------------------------------------------------- */

#matrix-area {
  display: none;
  flex: 1;
  overflow: hidden;
  background: var(--cds-background);
}

/* OS selector column — left, fixed width */
.matrix-os-col {
  display: flex;
  flex-direction: column;
  width: 180px;
  flex-shrink: 0;
  border-right: 1px solid var(--cds-border-subtle-01);
  background: var(--cds-layer-01);
  overflow-y: auto;
}

.matrix-col-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--cds-text-helper);
  border-bottom: 1px solid var(--cds-border-subtle-01);
  background: var(--cds-layer-01);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}

.matrix-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--col-color, var(--cds-interactive));
  flex-shrink: 0;
}

.matrix-os-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 12px;
}

/* OS selector buttons — prominent, tall */
.matrix-os-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  border: 2px solid var(--cds-border-subtle-02);
  border-radius: 6px;
  background: var(--cds-layer-02);
  color: var(--cds-text-primary);
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
  position: relative;
}

.matrix-os-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--os-color, var(--cds-interactive));
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.14s, transform 0.14s;
}

.matrix-os-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--cds-text-helper);
  background: var(--cds-layer-03, var(--cds-layer-01));
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
  line-height: 1.6;
}

.matrix-os-btn:hover {
  border-color: var(--os-color, var(--cds-interactive));
  background: var(--cds-background-hover);
}

.matrix-os-btn.is-active {
  border-color: var(--os-color, var(--cds-interactive));
  background: color-mix(in srgb, var(--os-color, var(--cds-interactive)) 16%, var(--cds-layer-01));
  font-weight: 600;
  box-shadow: inset 4px 0 0 var(--os-color, var(--cds-interactive));
}

.matrix-os-btn.is-active .matrix-os-swatch {
  opacity: 1;
  transform: scale(1.2);
}

.matrix-os-btn.is-active .matrix-os-count {
  background: color-mix(in srgb, var(--os-color, var(--cds-interactive)) 28%, transparent);
  color: var(--os-color, var(--cds-interactive));
}

/* Integration columns — fill remaining width */
.matrix-integ-cols {
  display: flex;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
}

.matrix-cat-col {
  display: flex;
  flex-direction: column;
  min-width: 175px;
  flex: 1;
  border-right: 1px solid var(--cds-border-subtle-01);
  overflow-y: auto;
  background: var(--cds-background);
}

.matrix-cat-col:last-child {
  border-right: none;
}

.matrix-col-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px;
  overflow-y: auto;
  flex: 1;
}

/* Integration cards */
.matrix-card {
  padding: 9px 11px;
  border-radius: 4px;
  border-top: 1.5px solid var(--cds-border-subtle-01);
  border-right: 1.5px solid var(--cds-border-subtle-01);
  border-bottom: 1.5px solid var(--cds-border-subtle-01);
  border-left: 3px solid var(--card-color, var(--cds-interactive));
  background: var(--cds-layer-01);
  transition: border-color 0.15s, background 0.15s, opacity 0.15s, box-shadow 0.15s;
  cursor: default;
}

.matrix-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--cds-text-primary);
  line-height: 1.3;
  margin-bottom: 4px;
}

.matrix-card-os {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.matrix-card-os-pip {
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 2px;
  border: 1px solid currentColor;
  opacity: 0.4;
  white-space: nowrap;
  transition: opacity 0.14s, transform 0.14s;
}

.matrix-card-os-pip.is-active-os {
  opacity: 1;
  transform: scale(1.08);
}

/* Highlight states */
.matrix-card.is-highlighted {
  border-top-color: var(--card-color, var(--cds-interactive));
  border-right-color: var(--card-color, var(--cds-interactive));
  border-bottom-color: var(--card-color, var(--cds-interactive));
  background: color-mix(in srgb, var(--card-color, var(--cds-interactive)) 10%, var(--cds-layer-01));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--card-color, var(--cds-interactive)) 40%, transparent),
              0 2px 8px rgba(0,0,0,0.10);
}

.matrix-card.is-dimmed {
  opacity: 0.15;
  filter: grayscale(0.5);
}

/* Dark theme card tweaks */
[data-theme="dark"] .matrix-card {
  background: var(--cds-layer-01);
  border-top-color: var(--cds-border-subtle-02);
  border-right-color: var(--cds-border-subtle-02);
  border-bottom-color: var(--cds-border-subtle-02);
}

[data-theme="dark"] .matrix-card.is-highlighted {
  background: color-mix(in srgb, var(--card-color, var(--cds-interactive)) 14%, var(--cds-layer-01));
  border-top-color: var(--card-color, var(--cds-interactive));
  border-right-color: var(--card-color, var(--cds-interactive));
  border-bottom-color: var(--card-color, var(--cds-interactive));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--card-color, var(--cds-interactive)) 50%, transparent),
              0 2px 12px rgba(0,0,0,0.35);
}

/* ---------------------------------------------------------------------------
   Availability view
--------------------------------------------------------------------------- */

#avail-area {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background: var(--cds-background);
}

/* Header bar — title + filter chips */
.avail-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px 11px;
  background: var(--cds-layer-01);
  border-bottom: 1px solid var(--cds-border-subtle-01);
  flex-wrap: wrap;
}

.avail-title {
  font-size: 13px;
  color: var(--cds-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.avail-gen-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cds-text-helper);
}

.avail-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Filter chip buttons */
.avail-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  border: 1px solid var(--cds-border-subtle-02);
  border-radius: 12px;
  background: var(--cds-layer-02);
  color: var(--cds-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.avail-chip:hover {
  border-color: var(--cds-border-strong-01);
  color: var(--cds-text-primary);
  background: var(--cds-layer-hover-01);
}

.avail-chip.is-active {
  background: var(--cds-interactive);
  border-color: var(--cds-interactive);
  color: #ffffff;
  font-weight: 600;
}

.avail-chip-name {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.avail-chip-fam {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.avail-chip-fam--power10 {
  background: color-mix(in srgb, #0f62fe 15%, transparent);
  color: var(--cds-interactive);
}

.avail-chip-fam--power11 {
  background: color-mix(in srgb, #6929c4 15%, transparent);
  color: #be95ff;
}

.avail-chip.is-active .avail-chip-fam {
  background: rgba(255,255,255,0.2);
  color: #ffffff;
}

/* Scrollable grid area */
.avail-grid {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Geographic group */
.avail-geo-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.avail-geo-group.is-empty {
  display: none;
}

.avail-geo-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--cds-text-helper);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--cds-border-subtle-01);
}

.avail-cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Datacenter card */
.avail-card {
  background: var(--cds-layer-01);
  border: 1px solid var(--cds-border-subtle-02);
  border-radius: 6px;
  padding: 14px 16px 12px;
  min-width: 180px;
  max-width: 240px;
  flex: 1 0 180px;
  transition: opacity 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.avail-card.is-hidden {
  display: none;
}

.avail-card.is-highlighted {
  border-color: var(--cds-interactive);
  background: color-mix(in srgb, var(--cds-interactive) 6%, var(--cds-layer-01));
}

[data-theme="dark"] .avail-card.is-highlighted {
  background: color-mix(in srgb, var(--cds-interactive) 10%, var(--cds-layer-01));
}

/* Region identifier */
.avail-card-region {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--cds-text-primary);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

/* Machine type rows */
.avail-card-mts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.avail-mt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  border-radius: 3px;
  transition: opacity 0.15s ease;
}

.avail-mt-row.is-focused {
  background: color-mix(in srgb, var(--cds-interactive) 10%, transparent);
  padding: 3px 5px;
  margin: 0 -5px;
}

.avail-mt-row.is-dimmed {
  opacity: 0.3;
}

.avail-mt-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.avail-mt-name--power10 {
  color: var(--cds-interactive);
}

.avail-mt-name--power11 {
  color: #be95ff;
}

[data-theme="light"] .avail-mt-name--power11 {
  color: #6929c4;
}

.avail-mt-badges {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* Shared / Dedicated availability badges */
.avail-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 2px;
  white-space: nowrap;
}

.avail-badge--general {
  background: color-mix(in srgb, var(--cds-interactive) 14%, transparent);
  color: var(--cds-interactive);
  border: 1px solid color-mix(in srgb, var(--cds-interactive) 35%, transparent);
}

.avail-badge--dedicated {
  background: color-mix(in srgb, #6929c4 14%, transparent);
  color: #be95ff;
  border: 1px solid color-mix(in srgb, #6929c4 35%, transparent);
}

[data-theme="light"] .avail-badge--dedicated {
  color: #6929c4;
}

/* Capability pills row */
.avail-card-caps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--cds-border-subtle-01);
}

.avail-cap-pill {
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 2px;
  cursor: default;
}

.avail-cap-pill.is-enabled {
  background: color-mix(in srgb, #198038 14%, transparent);
  color: #6fdc8c;
  border: 1px solid color-mix(in srgb, #198038 40%, transparent);
}

[data-theme="light"] .avail-cap-pill.is-enabled {
  color: #198038;
}

.avail-cap-pill.is-disabled {
  background: transparent;
  color: var(--cds-text-placeholder);
  border: 1px solid var(--cds-border-subtle-01);
  opacity: 0.5;
}

/* Loading state */
.avail-loading {
  padding: 48px 32px;
  font-size: 13px;
  color: var(--cds-text-helper);
}

/* ==========================================================================
   Architecture Reference View
   ========================================================================== */

.arch-view-wrapper {
  padding: 24px;
  max-width: 1680px;
  margin: 0 auto;
  color: var(--cds-text-primary);
}

.arch-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--cds-layer-01);
  border: 1px solid var(--cds-border-subtle-01);
  border-left: 4px solid var(--cds-interactive);
  padding: 14px 20px;
  border-radius: 4px;
  margin-bottom: 24px;
}

.arch-top-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.16px;
}

.arch-title-icon { color: var(--cds-interactive); }

.arch-traffic-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.arch-legend-note {
  color: var(--cds-text-helper);
  font-weight: 500;
}

.arch-traffic-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}

.arch-traffic-pill .pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.pill-public {
  background: rgba(15, 98, 254, 0.12);
  color: #0f62fe;
  border-color: rgba(15, 98, 254, 0.3);
}
.pill-public .pill-dot { background: #0f62fe; }

.pill-private {
  background: rgba(36, 161, 72, 0.12);
  color: #24a148;
  border-color: rgba(36, 161, 72, 0.3);
}
.pill-private .pill-dot { background: #24a148; }

.pill-secure {
  background: rgba(218, 30, 40, 0.12);
  color: #da1e28;
  border-color: rgba(218, 30, 40, 0.3);
}
.pill-secure .pill-dot { background: #da1e28; }

.arch-diagram-grid {
  display: grid;
  grid-template-columns: 180px 1fr 200px;
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 1200px) {
  .arch-diagram-grid { grid-template-columns: 1fr; }
}

.arch-col {
  display: flex;
  flex-direction: column;
  background: var(--cds-layer-01);
  border: 1px solid var(--cds-border-subtle-01);
  border-radius: 4px;
}

.arch-col-consumer,
.arch-col-provider {
  border-color: rgba(15, 98, 254, 0.4);
}

.arch-col-header {
  padding: 12px 14px;
  background: rgba(15, 98, 254, 0.08);
  border-bottom: 1px solid var(--cds-border-subtle-01);
}

.arch-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cds-text-primary);
}

.arch-col-body {
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1;
}

.arch-consumer-flow,
.arch-provider-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.arch-v-line {
  width: 2px;
  height: 28px;
  background: #0f62fe;
}

.arch-col-cloud {
  background: transparent;
  border: none;
}

.arch-region-box {
  background: var(--cds-layer-01);
  border: 1px solid var(--cds-border-subtle-01);
  border-radius: 4px;
  padding: 18px;
}

.arch-region-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--cds-border-subtle-01);
}

.arch-cloud-brand {
  font-size: 14px;
  font-weight: 600;
  color: #0f62fe;
}

.arch-region-label {
  font-size: 12px;
  color: var(--cds-text-helper);
}

.arch-vpcs-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.arch-vpc-card {
  background: var(--cds-background);
  border: 1.5px solid #0072c3;
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.arch-vpc-header { margin-bottom: 12px; }

.arch-vpc-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.arch-vpc-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16px;
}

.arch-vpc-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  margin-left: 6px;
}

.mgmt-badge {
  background: rgba(218, 30, 40, 0.15);
  color: #da1e28;
  border: 1px solid rgba(218, 30, 40, 0.3);
}

.workload-badge {
  background: rgba(255, 131, 43, 0.15);
  color: #ff832b;
  border: 1px solid rgba(255, 131, 43, 0.3);
}

.arch-vpc-desc {
  font-size: 12px;
  color: var(--cds-text-helper);
  line-height: 1.4;
}

.arch-conn-options-bar {
  background: var(--cds-layer-01);
  border: 1px solid var(--cds-border-subtle-01);
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.secure-options-bar { border-left: 3px solid #da1e28; }
.public-options-bar { border-left: 3px solid #ff832b; }

.arch-conn-options-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--cds-text-primary);
  margin-bottom: 8px;
}

.arch-conn-options-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.arch-zone-box {
  background: var(--cds-layer-01);
  border: 1px dashed var(--cds-border-subtle-01);
  border-radius: 4px;
  padding: 14px;
}

.arch-zone-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--cds-text-helper);
  margin-bottom: 12px;
}

.arch-acls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.arch-acl-block {
  background: var(--cds-background);
  border: 1px solid #0072c3;
  border-radius: 4px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.arch-acl-header {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #0072c3;
  margin-bottom: 8px;
  padding-bottom: 4px;
  width: 100%;
  border-bottom: 1px solid var(--cds-border-subtle-01);
}

.arch-acl-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.arch-tgw-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(0, 114, 195, 0.08);
  border: 1px solid rgba(0, 114, 195, 0.35);
  border-radius: 4px;
  padding: 12px 18px;
}

.arch-tgw-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.arch-tgw-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--cds-text-primary);
}

.arch-tgw-desc {
  font-size: 12px;
  color: var(--cds-text-helper);
}

.arch-cloud-services-box {
  background: var(--cds-background);
  border: 1.5px solid #0072c3;
  border-radius: 6px;
  padding: 16px;
}

.arch-cloud-services-header {
  font-size: 13px;
  font-weight: 700;
  color: #0072c3;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--cds-border-subtle-01);
}

.arch-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.arch-service-group {
  background: var(--cds-layer-01);
  border: 1px solid var(--cds-border-subtle-01);
  border-radius: 4px;
  padding: 10px;
}

.arch-service-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--cds-text-helper);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--cds-border-subtle-01);
  padding-bottom: 4px;
}

.arch-service-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.arch-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--cds-background);
  border: 1px solid var(--cds-border-subtle-01);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-align: center;
  min-width: 64px;
  max-width: 140px;
  outline: none;
  user-select: none;
}

.arch-node:hover {
  background: var(--cds-background-hover);
  border-color: var(--arch-color, var(--cds-interactive));
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.arch-node:focus-visible {
  outline: 2px solid var(--cds-focus);
  outline-offset: 2px;
}

.arch-node.is-selected {
  background: color-mix(in srgb, var(--arch-color, var(--cds-interactive)) 20%, var(--cds-background));
  border-color: var(--arch-color, var(--cds-interactive));
  box-shadow: 0 0 0 2px var(--arch-color, var(--cds-interactive));
}

.arch-node.is-dimmed { opacity: 0.3; }

.arch-node.is-query-hit {
  box-shadow: 0 0 0 2px #f1c21b;
  border-color: #f1c21b;
}

.arch-node-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  margin-bottom: 4px;
}

.arch-icon-svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.arch-node-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--cds-text-primary);
  line-height: 1.2;
  word-break: break-word;
}

.arch-node-type {
  font-size: 9.5px;
  color: var(--cds-text-helper);
  line-height: 1.2;
  margin-top: 2px;
}

.arch-conn-node {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  min-width: 130px;
  max-width: 220px;
  text-align: left;
}

.arch-conn-node .arch-node-icon-box {
  margin-bottom: 0;
  flex-shrink: 0;
}

.arch-conn-node .arch-node-label { font-size: 11.5px; }

.arch-consumer-node,
.arch-provider-node {
  width: 100%;
  max-width: 150px;
  padding: 10px 8px;
}
