:root {
  --bg: #050814;
  --bg-elev: #0b1124;
  --bg-card: rgba(12, 19, 40, 0.92);
  --border: rgba(110, 155, 255, 0.22);
  --border-hi: rgba(56, 242, 255, 0.55);
  --text: #eaf2ff;
  --muted: #8ea4cc;
  --cyan: #38f2ff;
  --violet: #b07cff;
  --gold: #ffd166;
  --magenta: #ff6bcb;
  --emerald: #3df5a7;
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* HEADER */
.topbar {
  height: 52px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #070c1d 0%, #0b132b 55%, #080d1e 100%);
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

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

.brand-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 242, 255, 0.16), rgba(5, 8, 20, 0.2));
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  white-space: nowrap;
}

.brand-text h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #38f2ff 0%, #e5ecff 50%, #ffd166 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nav-pill {
  background: rgba(19, 29, 58, 0.8);
  color: #cfe0ff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.nav-pill:hover {
  border-color: var(--cyan);
  color: #ffffff;
}

.nav-pill.active {
  background: rgba(56, 242, 255, 0.16);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(56, 242, 255, 0.2);
}

.nav-pill.nav-accent {
  background: rgba(61, 245, 167, 0.12);
  border-color: rgba(61, 245, 167, 0.45);
  color: var(--emerald);
}

.nav-pill.nav-accent:hover {
  background: rgba(61, 245, 167, 0.22);
  border-color: var(--emerald);
}

/* WORKSPACE */
.workspace {
  height: calc(100vh - 52px);
  display: flex;
  overflow: hidden;
}

.stage-pane {
  position: relative;
  flex: 1;
  min-width: 0;
  background: radial-gradient(circle at 50% 50%, #0a132c 0%, #050814 72%);
  overflow: hidden;
}

#constellationCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

/* STAGE HUD TOP */
.stage-hud-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  z-index: 4;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(7, 12, 28, 0.82);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #b5c7e8;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.filter-chip.active {
  background: rgba(56, 242, 255, 0.16);
  border-color: rgba(56, 242, 255, 0.5);
  color: #ffffff;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.dot-geometry { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.dot-analysis { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.dot-algebra { background: var(--violet); box-shadow: 0 0 6px var(--violet); }
.dot-optimization { background: var(--magenta); box-shadow: 0 0 6px var(--magenta); }
.dot-discrete { background: var(--emerald); box-shadow: 0 0 6px var(--emerald); }

.search-wrap {
  pointer-events: auto;
}

.search-wrap input {
  width: 152px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(7, 12, 28, 0.85);
  color: var(--text);
  font-size: 11.5px;
  outline: none;
  transition: border-color 0.15s ease;
}

.search-wrap input:focus {
  border-color: var(--cyan);
}

.search-wrap input::placeholder {
  color: #6d84ad;
}

/* STAGE HUD BOTTOM */
.stage-hud-bottom {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  z-index: 4;
}

.tour-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: rgba(7, 12, 28, 0.84);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.tour-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 2px;
  white-space: nowrap;
}

.tour-chip {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 102, 0.25);
  background: rgba(255, 209, 102, 0.06);
  color: #f6e2b3;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tour-chip:hover {
  border-color: var(--gold);
  background: rgba(255, 209, 102, 0.16);
  color: #ffffff;
}

.tour-chip.active {
  border-color: var(--gold);
  background: rgba(255, 209, 102, 0.24);
  color: #fff5d6;
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.28);
}

.tour-chip.tour-clear {
  border-color: rgba(255, 107, 203, 0.45);
  background: rgba(255, 107, 203, 0.12);
  color: #ffb8e4;
}

.stage-hint {
  font-size: 10.5px;
  color: #7d93ba;
  background: rgba(7, 12, 28, 0.72);
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(110, 155, 255, 0.14);
  white-space: nowrap;
}

/* TOOLTIP */
.hover-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(7, 12, 28, 0.94);
  border: 1px solid rgba(56, 242, 255, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  font-size: 11px;
  line-height: 1.35;
}

.hover-tooltip .tt-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.hover-tooltip .tt-title {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 3px;
}

.hover-tooltip .tt-cert {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--emerald);
}

/* RIGHT INSPECTOR */
.inspector-pane {
  width: 348px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #080e20 0%, #060a17 100%);
  border-left: 1px solid var(--border);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  flex-shrink: 0;
}

.kpi-card {
  background: rgba(14, 22, 46, 0.85);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 6px 4px;
  text-align: center;
}

.kpi-val {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1.15;
}

.kpi-lbl {
  font-size: 9.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.kpi-cyan { color: var(--cyan); }
.kpi-gold { color: var(--gold); }
.kpi-violet { color: var(--violet); }
.kpi-emerald { color: var(--emerald); }

/* TOUR BANNER */
.tour-banner {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.12), rgba(56, 242, 255, 0.06));
  border: 1px solid rgba(255, 209, 102, 0.45);
  border-radius: 10px;
  padding: 8px 10px;
  flex-shrink: 0;
}

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

.tour-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.03em;
}

.tour-step-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #fff4d2;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 8px;
}

.tour-note {
  font-size: 11px;
  line-height: 1.38;
  color: #e4eeff;
  margin-bottom: 7px;
}

.tour-controls {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

/* INSPECTOR CARD */
.inspector-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  overflow-y: auto;
}

.inspector-card::-webkit-scrollbar {
  width: 5px;
}
.inspector-card::-webkit-scrollbar-thumb {
  background: rgba(110, 155, 255, 0.25);
  border-radius: 999px;
}

.insp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.vol-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(56, 242, 255, 0.4);
  background: rgba(56, 242, 255, 0.12);
  color: var(--cyan);
}

.cid-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.insp-title {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.22;
  color: #ffffff;
}

.insp-desc {
  font-size: 11.5px;
  line-height: 1.44;
  color: #c2d4f4;
}

.formula-box, .cert-box {
  border-radius: 8px;
  padding: 7px 9px;
}

.formula-box {
  background: rgba(56, 242, 255, 0.06);
  border: 1px solid rgba(56, 242, 255, 0.22);
}

.cert-box {
  background: rgba(61, 245, 167, 0.06);
  border: 1px solid rgba(61, 245, 167, 0.26);
}

.box-kicker {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

.cert-box .box-kicker {
  color: var(--emerald);
}

.formula-text {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.35;
  color: #dff7ff;
}

.cert-text {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.38;
  color: #c6ffe5;
}

.bridges-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bridges-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bridge-pill {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(130, 165, 255, 0.22);
  background: rgba(16, 26, 54, 0.72);
  color: var(--text);
  cursor: pointer;
  transition: all 0.14s ease;
}

.bridge-pill:hover {
  border-color: var(--cyan);
  background: rgba(56, 242, 255, 0.1);
  transform: translateX(2px);
}

.bridge-pill-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
}

.bridge-pill-sub {
  font-size: 10px;
  color: var(--muted);
}

.insp-actions {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.cta-btn, .sec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cta-btn {
  background: linear-gradient(90deg, #16b9d8, #38f2ff);
  color: #04101f;
  box-shadow: 0 0 14px rgba(56, 242, 255, 0.28);
}

.cta-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 20px rgba(56, 242, 255, 0.45);
}

.sec-btn {
  background: rgba(20, 32, 64, 0.85);
  color: #cde0ff;
  border: 1px solid var(--border);
}

.sec-btn:hover {
  border-color: var(--emerald);
  color: var(--emerald);
}

/* VOLUME RIBBON */
.vol-ribbon {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  background: rgba(11, 18, 38, 0.9);
  border: 1px solid var(--border);
  border-radius: 9px;
  flex-shrink: 0;
}

.ribbon-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.ribbon-pills {
  display: flex;
  flex: 1;
  justify-content: space-between;
  gap: 3px;
}

.vol-pill {
  flex: 1;
  padding: 4px 0;
  border-radius: 6px;
  border: 1px solid rgba(110, 155, 255, 0.22);
  background: rgba(16, 26, 52, 0.7);
  color: #bdd1f5;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.vol-pill:hover, .vol-pill.active {
  color: #ffffff;
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.1);
}

.mini-btn {
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(16, 26, 54, 0.85);
  color: #d6e6ff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.mini-btn:hover {
  border-color: var(--cyan);
}

.mini-btn-primary {
  background: rgba(255, 209, 102, 0.2);
  border-color: rgba(255, 209, 102, 0.55);
  color: #fff3cf;
}

/* CATALOG VIEW */
.catalog-view {
  height: calc(100vh - 52px);
  overflow-y: auto;
  padding: 16px 20px 28px;
  background: radial-gradient(circle at 20% 0%, #0d1736 0%, #050814 60%);
}

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

.catalog-title-group h2 {
  font-size: 18px;
  color: #ffffff;
}

.catalog-title-group p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.catalog-controls input {
  width: 280px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(10, 17, 36, 0.9);
  color: var(--text);
  font-size: 12px;
  outline: none;
}

.catalog-controls input:focus {
  border-color: var(--cyan);
}

.catalog-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cat-volume-block {
  background: rgba(10, 17, 36, 0.82);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.cat-vol-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(110, 155, 255, 0.16);
  flex-wrap: wrap;
}

.cat-vol-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-vol-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  color: #050814;
}

.cat-vol-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
}

.cat-vol-links {
  display: flex;
  gap: 8px;
  font-size: 11.5px;
}

.cat-vol-links a {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 600;
}

.cat-vol-links a:hover {
  text-decoration: underline;
}

.cat-chambers-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(14, 24, 52, 0.72);
  border: 1px solid rgba(110, 155, 255, 0.18);
  border-radius: 9px;
  padding: 9px 10px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.cat-card:hover {
  border-color: var(--cyan);
  transform: translateY(-1px);
}

.cat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--muted);
}

.cat-card h3 {
  font-size: 12.5px;
  color: #ffffff;
  line-height: 1.25;
}

.cat-card-cert {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--emerald);
  line-height: 1.3;
}

.cat-card-foot {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cat-card-foot a {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  text-decoration: none;
}

.cat-card-foot button {
  font-size: 10.5px;
  background: transparent;
  border: 1px solid rgba(110, 155, 255, 0.25);
  color: #b7ccf0;
  border-radius: 6px;
  padding: 2px 7px;
  cursor: pointer;
}

.cat-card-foot button:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 16, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 16px;
}

.modal-panel {
  width: min(860px, 96vw);
  max-height: 88vh;
  background: #0a1126;
  border: 1px solid rgba(56, 242, 255, 0.4);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.72);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(14, 24, 52, 0.75);
}

.modal-header h2 {
  font-size: 16px;
  color: #ffffff;
}

.modal-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: #ffffff;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 13px;
}

.modal-close:hover {
  border-color: var(--magenta);
  color: var(--magenta);
}

.modal-body {
  padding: 10px 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cli-card {
  background: rgba(6, 11, 24, 0.9);
  border: 1px solid rgba(61, 245, 167, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
}

.cli-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--emerald);
  font-weight: 700;
  margin-bottom: 6px;
}

.cli-code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: #040711;
  border: 1px solid rgba(110, 155, 255, 0.2);
  border-radius: 7px;
  padding: 8px 10px;
  color: #dff8ff;
  overflow-x: auto;
}

.cli-foot {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}

.cli-foot a {
  color: var(--cyan);
  font-weight: 700;
  text-decoration: none;
}

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

.proof-table th {
  text-align: left;
  padding: 4px 7px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.proof-table td {
  padding: 4px 7px;
  border-bottom: 1px solid rgba(110, 155, 255, 0.12);
  vertical-align: middle;
}

.proof-table td a {
  color: var(--cyan);
  text-decoration: none;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.proof-table td:nth-child(2) a { white-space: normal; font-family: var(--font-sans); }

.proof-table td a:hover {
  text-decoration: underline;
}

.status-pass {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--emerald);
  background: rgba(61, 245, 167, 0.12);
  border: 1px solid rgba(61, 245, 167, 0.35);
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
}

.nav-gold {
  border-color: rgba(255, 209, 102, 0.52);
  color: var(--gold);
  background: rgba(255, 209, 102, 0.09);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.nav-gold:hover {
  border-color: rgba(255, 209, 102, 0.85);
  background: rgba(255, 209, 102, 0.18);
  color: #fff6d6;
}
.modal-body > * {
  flex-shrink: 0;
}
.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Compact inspector card so CTA buttons sit cleanly visible at 1024x768 */
.inspector-card {
  padding: 10px 12px;
  gap: 6px;
}
.insp-title {
  font-size: 14.5px;
  line-height: 1.22;
}
.insp-desc {
  font-size: 11px;
  line-height: 1.36;
}
.formula-box, .cert-box {
  padding: 6px 9px;
}
.bridge-pill {
  padding: 5px 8px;
}
.bridge-pill-sub {
  font-size: 9.6px;
  line-height: 1.25;
}
.insp-actions {
  margin-top: auto;
  padding-top: 4px;
}

/* Exact 1024x768 Swiss-watch vertical fit */
.inspector-pane {
  padding: 8px 10px;
  gap: 6px;
}
.kpi-card {
  padding: 5px 4px;
}
.kpi-val {
  font-size: 14px;
}
.formula-text {
  font-size: 10.3px;
  line-height: 1.3;
}
.cert-text {
  font-size: 10px;
  line-height: 1.3;
}
.cta-btn, .sec-btn {
  padding: 6px 8px;
  font-size: 11px;
}
.vol-ribbon {
  padding: 5px 8px;
}

@media (min-width: 960px) {
  .cat-chambers-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.nav-cyan {
  text-decoration: none;
  color: #38f2ff;
  border-color: rgba(56, 242, 255, 0.42);
  background: rgba(56, 242, 255, 0.08);
}
.nav-cyan:hover {
  background: rgba(56, 242, 255, 0.18);
  border-color: rgba(56, 242, 255, 0.75);
  box-shadow: 0 0 12px rgba(56, 242, 255, 0.25);
}

/* === GRAND PORTAL IV: CAPSTONES & ALL-35 MASTER CONSTELLATION === */
.nav-pill.nav-violet {
  border-color: rgba(176, 124, 255, 0.45);
  color: #e4d4ff;
  background: rgba(176, 124, 255, 0.12);
}
.nav-pill.nav-violet:hover {
  border-color: rgba(176, 124, 255, 0.85);
  background: rgba(176, 124, 255, 0.24);
  box-shadow: 0 0 12px rgba(176, 124, 255, 0.28);
}

.dot-harmony { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.dot-color { background: var(--magenta); box-shadow: 0 0 6px var(--magenta); }
.dot-cartography { background: var(--emerald); box-shadow: 0 0 6px var(--emerald); }
.dot-quantum { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.dot-computability { background: var(--violet); box-shadow: 0 0 6px var(--violet); }

.kpi-magenta { color: var(--magenta); }

/* Master 35-Observatory View */
.master-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.master-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.10), rgba(56, 242, 255, 0.08), rgba(176, 124, 255, 0.10));
  border: 1px solid rgba(255, 209, 102, 0.30);
}

.master-hero h2 {
  margin: 0 0 4px;
  font-size: 1.08rem;
  color: #fff6df;
  letter-spacing: 0.01em;
}

.master-hero p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.master-kpis {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.master-kpi {
  background: rgba(8, 12, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px 11px;
  text-align: center;
  min-width: 78px;
}

.master-kpi strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
}

.master-kpi span {
  font-size: 0.64rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.suite-section {
  background: rgba(12, 18, 34, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  padding: 12px 14px 14px;
}

.suite-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.suite-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.suite-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.suite-meta {
  font-size: 0.73rem;
  color: var(--muted);
}

.suite-portal-link {
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f4f7ff;
  background: rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.suite-portal-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

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

.obs-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  background: rgba(7, 11, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.obs-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 209, 102, 0.55);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.obs-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 700;
}

.obs-name {
  font-size: 0.76rem;
  font-weight: 600;
  color: #f4f7ff;
  line-height: 1.25;
}

.obs-sub {
  font-size: 0.66rem;
  color: var(--muted);
  line-height: 1.25;
}

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

.cli-row-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 3px;
}

/* Polish for Grand Portal IV 1024x768 header & quad-atlas links */
.brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
}
.brand-text h1 {
  font-size: 14.5px !important;
  line-height: 1.1;
  white-space: nowrap;
}
.brand-sub {
  font-size: 9.8px !important;
  line-height: 1.1;
  white-space: nowrap;
  overflow: visible !important;
  text-overflow: clip !important;
}
.top-nav {
  gap: 5px !important;
}
.nav-pill {
  padding: 5px 8px !important;
  font-size: 11.2px !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.nav-pill.nav-violet {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.ribbon-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
}
.vol-pill {
  flex: 1 1 auto;
  text-align: center;
  padding: 3px 5px !important;
  font-size: 10.5px !important;
}

/* Keep Open Live Chamber & Verifier buttons 100% unclipped at 1024x768 */
.inspector-pane { gap: 6px !important; }
.kpi-card { padding: 5px 6px !important; }
.inspector-card { padding: 10px 12px !important; gap: 7px !important; }
.insp-title { font-size: 14.5px !important; line-height: 1.2 !important; }
.insp-desc { font-size: 11px !important; line-height: 1.32 !important; }
.formula-box, .cert-box { padding: 6px 8px !important; }
.formula-text, .cert-text { font-size: 10.6px !important; line-height: 1.3 !important; }
.bridge-pill { padding: 5px 7px !important; }
.bridge-pill-sub { font-size: 10px !important; line-height: 1.25 !important; }
.bridges-list { gap: 5px !important; }
.insp-actions { padding-top: 2px !important; }
.cta-btn, .sec-btn { padding: 6px 9px !important; font-size: 11.2px !important; }
.inspector-card { overflow: hidden !important; }
.bridges-section { display: flex !important; flex-direction: column !important; flex: 1 1 0 !important; min-height: 76px !important; overflow: hidden !important; }
.bridges-list { flex: 1 1 0 !important; min-height: 0 !important; overflow-y: auto !important; padding-right: 2px; }
.insp-actions { flex-shrink: 0 !important; margin-top: 2px !important; }
