:root {
  --bg-0: #05070a;
  --bg-1: #0e1218;
  --bg-2: #171c24;
  --glass: rgba(19, 25, 34, 0.58);
  --glass-border: rgba(219, 235, 255, 0.18);
  --text: #e9f1ff;
  --muted: #9aa8bf;
  --lime: #bcff3a;
  --pink: #ff5ebe;
  --cyan: #7ae6ff;
  --danger: #ff7676;
  --ok: #76ffbf;
  --warn: #ffd86a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  background: radial-gradient(circle at 48% 12%, #1e2531 0%, var(--bg-1) 42%, var(--bg-0) 100%);
}

body {
  position: relative;
  padding: 18px;
  overflow-x: hidden;
}

p,
th,
td,
li,
h4,
h5,
span,
a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cityline-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.city-photo {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to top, rgba(8, 12, 17, 0.58) 4%, rgba(10, 16, 24, 0.2) 40%, rgba(12, 19, 27, 0.18) 100%),
    url("/images/citadel-bg.jpg");
  background-size: cover;
  background-position: center 52%;
  filter: saturate(1.02) contrast(1.02);
}

.city-photo-tint {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(8, 14, 22, 0.42), rgba(10, 16, 24, 0.08)),
    radial-gradient(circle at 50% 54%, rgba(201, 216, 233, 0.09), transparent 58%);
}

.citadel-anomaly {
  position: absolute;
  left: 50%;
  bottom: 16vh;
  width: min(8vw, 110px);
  height: 56vh;
  transform: translateX(-50%);
  background:
    linear-gradient(to top, rgba(16, 22, 34, 0.78), rgba(36, 52, 78, 0.26) 58%, rgba(205, 222, 248, 0.34));
  border: 1px solid rgba(214, 229, 247, 0.26);
  box-shadow: 0 0 18px rgba(189, 213, 238, 0.18);
  opacity: 0.82;
}

.city-glow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 34vw;
  filter: blur(7px);
}

.city-glow-left {
  left: -12vw;
  background: radial-gradient(ellipse at 18% 46%, rgba(188, 255, 58, 0.08), rgba(188, 255, 58, 0.02) 44%, transparent 76%);
}

.city-glow-right {
  right: -12vw;
  background: radial-gradient(ellipse at 84% 46%, rgba(255, 94, 190, 0.08), rgba(255, 94, 190, 0.02) 44%, transparent 76%);
}

.cable {
  position: absolute;
  left: 4vw;
  width: 56vw;
  height: 1px;
  background:
    linear-gradient(90deg, rgba(169, 205, 243, 0) 0%, rgba(169, 205, 243, 0.58) 18%, rgba(124, 176, 235, 0.62) 52%, rgba(169, 205, 243, 0) 100%),
    repeating-linear-gradient(90deg, rgba(240, 248, 255, 0.66) 0 4px, rgba(178, 206, 235, 0.12) 4px 16px);
  background-size: 220% 100%, 100% 100%;
  opacity: 0.55;
  animation: pulseFlow 4.2s linear infinite;
}

.cable::after {
  content: "";
  position: absolute;
  right: -5px;
  top: -1px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(229, 245, 255, 0.95), rgba(122, 173, 232, 0.75));
  box-shadow: 0 0 9px rgba(180, 216, 245, 0.45), 0 0 9px rgba(132, 182, 238, 0.42);
}

.cable-1 {
  top: 82vh;
  left: -10vw;
  width: 64vw;
  transform: rotate(-58deg);
}

.cable-2 {
  top: 84vh;
  left: 48vw;
  width: 62vw;
  transform: rotate(58deg);
}

.cable-3 {
  top: 70vh;
  left: -2vw;
  width: 54vw;
  transform: rotate(-40deg);
}

.cable-4 {
  top: 70vh;
  left: 50vw;
  width: 52vw;
  transform: rotate(40deg);
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 60%, rgba(196, 220, 247, 0.16), transparent 52%),
    linear-gradient(to top, rgba(6, 10, 14, 0.56), rgba(8, 12, 18, 0.12));
}

.noise-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: radial-gradient(#fff 0.55px, transparent 0.55px);
  background-size: 3px 3px;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  box-shadow: 0 18px 70px rgba(2, 8, 16, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 2;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}

.site-header {
  margin-bottom: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

.site-header h1 {
  font-size: clamp(18px, 2.1vw, 28px);
  line-height: 1.2;
}

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

.hero {
  padding: 22px;
  overflow: hidden;
}

.hero-kicker {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--lime);
}

.hero h2 {
  font-size: clamp(27px, 3.5vw, 44px);
  line-height: 1.08;
  max-width: 960px;
  margin-bottom: 8px;
}

.hero-sub {
  margin: 0;
  color: var(--muted);
  max-width: 880px;
}

.hero-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid rgba(234, 240, 255, 0.24);
  background: rgba(10, 14, 18, 0.36);
  border-radius: 999px;
  font-size: 12px;
  padding: 4px 10px;
}

.tag.tiny {
  font-size: 10px;
  padding: 3px 8px;
}

.auth-panel {
  padding: 18px;
}

.muted {
  margin: 0;
  color: var(--muted);
}

.login-row,
.raw-auth-row,
.action-row {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

input,
select {
  width: 100%;
  border-radius: 11px;
  border: 1px solid rgba(234, 240, 255, 0.2);
  background: rgba(8, 12, 18, 0.62);
  color: var(--text);
  padding: 9px 11px;
  font-size: 14px;
}

.btn {
  border: 1px solid rgba(234, 240, 255, 0.24);
  border-radius: 11px;
  background: rgba(13, 19, 28, 0.94);
  color: var(--text);
  font-family: "Sora", sans-serif;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(234, 240, 255, 0.42);
}

.btn-xs {
  font-size: 12px;
  padding: 5px 9px;
}

.btn.disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.glow {
  background: linear-gradient(120deg, rgba(188, 255, 58, 0.2), rgba(255, 94, 190, 0.24));
  box-shadow: 0 0 16px rgba(188, 255, 58, 0.2), 0 0 20px rgba(255, 94, 190, 0.16);
}

.btn-muted {
  background: rgba(12, 17, 26, 0.75);
}

.link-btn {
  border: 0;
  background: none;
  color: var(--pink);
  text-decoration: underline;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.dashboard {
  display: grid;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.left-nav {
  padding: 10px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 44px);
  overflow: auto;
  display: grid;
  gap: 7px;
}

.tab-btn {
  color: #e9f1ff !important;
  font-family: "Sora", sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.rail-btn {
  width: 100%;
  display: block;
  text-align: left;
  border-radius: 10px;
  background: rgba(8, 12, 19, 0.74);
  border: 1px solid rgba(234, 240, 255, 0.15);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  font-size: 13px;
  padding: 10px 11px;
  line-height: 1.2;
  white-space: normal;
}

.rail-btn:nth-child(1):hover,
.rail-btn:nth-child(1).active {
  border-color: rgba(188, 255, 58, 0.65);
  box-shadow: 0 0 18px rgba(188, 255, 58, 0.22);
}

.rail-btn:nth-child(2):hover,
.rail-btn:nth-child(2).active {
  border-color: rgba(255, 94, 190, 0.65);
  box-shadow: 0 0 18px rgba(255, 94, 190, 0.24);
}

.rail-btn:nth-child(3):hover,
.rail-btn:nth-child(3).active {
  border-color: rgba(122, 230, 255, 0.65);
  box-shadow: 0 0 16px rgba(122, 230, 255, 0.2);
}

.rail-btn:nth-child(4):hover,
.rail-btn:nth-child(4).active,
.rail-btn:nth-child(5):hover,
.rail-btn:nth-child(5).active,
.rail-btn:nth-child(6):hover,
.rail-btn:nth-child(6).active,
.rail-btn:nth-child(7):hover,
.rail-btn:nth-child(7).active,
.rail-btn:nth-child(8):hover,
.rail-btn:nth-child(8).active,
.rail-btn:nth-child(9):hover,
.rail-btn:nth-child(9).active,
.rail-btn:nth-child(10):hover,
.rail-btn:nth-child(10).active,
.rail-btn:nth-child(11):hover,
.rail-btn:nth-child(11).active,
.rail-btn:nth-child(12):hover,
.rail-btn:nth-child(12).active {
  border-color: rgba(234, 240, 255, 0.4);
  box-shadow: 0 0 14px rgba(234, 240, 255, 0.12);
}

.dashboard-content {
  display: grid;
  gap: 10px;
}

.tab-panel {
  padding: 12px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.subhead {
  margin: 12px 0 8px;
}

.network-office {
  margin-top: 6px;
}

.network-map {
  padding: 10px;
  display: grid;
  gap: 8px;
}

.network-row {
  display: grid;
  gap: 8px;
}

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

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

.network-spine {
  width: 3px;
  height: 28px;
  justify-self: center;
  border-radius: 999px;
  background: linear-gradient(to bottom, rgba(138, 188, 238, 0.18), rgba(138, 188, 238, 0.72), rgba(138, 188, 238, 0.18));
}

.network-core {
  display: grid;
  justify-items: center;
}

.network-cluster {
  padding: 9px;
}

.network-cluster h4 {
  font-size: 12px;
  margin-bottom: 8px;
}

.network-stack {
  display: grid;
  gap: 7px;
}

.network-node {
  border: 1px solid rgba(234, 240, 255, 0.18);
  background: rgba(8, 13, 19, 0.68);
  border-radius: 11px;
  padding: 8px;
}

.network-node h5 {
  font-size: 12px;
  margin: 0 0 4px;
}

.network-node p {
  margin: 0 0 7px;
  font-size: 11px;
  color: var(--muted);
}

.network-node.active {
  border-color: rgba(126, 208, 255, 0.6);
  box-shadow: 0 0 12px rgba(126, 208, 255, 0.18);
}

.network-node.inactive {
  opacity: 0.8;
}

.network-node.core {
  width: min(420px, 100%);
  text-align: center;
}

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

.status-grid.compact .metric {
  min-height: 52px;
  padding: 7px;
}

.metric h4 {
  font-size: 11px;
  font-weight: 600;
  color: #cfe0ff;
}

.metric .muted {
  font-size: 11px;
  line-height: 1.2;
}

.metric-value {
  font-size: 12px;
  line-height: 1.2;
  margin: 4px 0 1px;
  font-family: "Sora", sans-serif;
}

.nav-card {
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.nav-card:hover {
  transform: translateY(-1px);
  border-color: rgba(188, 255, 58, 0.5);
}

.resource-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.resource-card {
  padding: 10px;
}

.meter {
  height: 9px;
  width: 100%;
  margin: 8px 0;
  border-radius: 999px;
  border: 1px solid rgba(234, 240, 255, 0.2);
  background: rgba(10, 15, 24, 0.7);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(188, 255, 58, 0.96), rgba(255, 94, 190, 0.96));
  box-shadow: 0 0 14px rgba(188, 255, 58, 0.34);
  transition: width 0.35s ease;
}

.meter-fill[data-level="high"] {
  box-shadow: 0 0 14px rgba(255, 111, 111, 0.38);
}

.kanban-toolbar {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.kanban-mode-btn {
  background: rgba(9, 14, 22, 0.72);
}

.kanban-mode-btn.active {
  border-color: rgba(188, 255, 58, 0.82);
  box-shadow: 0 0 13px rgba(188, 255, 58, 0.2);
}

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

.kanban-lane {
  padding: 8px;
}

.kanban-stack {
  display: grid;
  gap: 7px;
  max-height: min(65vh, 560px);
  overflow: auto;
  padding-right: 2px;
}

.kanban-card {
  border: 1px solid rgba(234, 240, 255, 0.13);
  background: rgba(8, 12, 19, 0.64);
  border-radius: 11px;
  padding: 9px;
  overflow: hidden;
}

.kanban-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 6px;
}

.kanban-card h5 {
  font-size: 12px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card p {
  margin: 0 0 5px;
  line-height: 1.26;
  font-size: 12px;
}

.split-actions {
  justify-content: space-between;
  gap: 6px;
}

.tiny-note {
  font-size: 11px;
}

.panel-note {
  margin-top: 8px;
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.meta-chip {
  border: 1px solid rgba(234, 240, 255, 0.24);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  background: rgba(10, 14, 18, 0.4);
}

.analyze-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.analyze-detail {
  border: 1px solid rgba(234, 240, 255, 0.18);
  border-radius: 12px;
  padding: 10px;
  background: rgba(8, 12, 18, 0.5);
}

.row-active {
  background: rgba(188, 255, 58, 0.08);
}

.detail-card p {
  margin: 0 0 8px;
  font-size: 13px;
}

.error-block {
  margin: 0;
  border-radius: 10px;
  border: 1px solid rgba(234, 240, 255, 0.15);
  background: rgba(8, 12, 18, 0.8);
  padding: 9px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
}

.action-grid {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.field-label {
  font-size: 11px;
  color: var(--muted);
}

.visual-row {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.visual-row.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.visual-card {
  padding: 9px;
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 9px;
  align-items: center;
}

.visual-card img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(234, 240, 255, 0.2);
}

.visual-card p {
  margin-top: 5px;
}

.proof-list {
  margin: 8px 0 0;
  padding-left: 16px;
}

.tools-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0;
}

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

.memory-cats {
  margin-bottom: 8px;
}

.memory-category {
  padding: 9px;
}

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

.proof-card {
  padding: 9px;
  overflow: hidden;
}

.proof-card img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid rgba(234, 240, 255, 0.2);
}

.proof-card p {
  margin: 0 0 6px;
  font-size: 12px;
}

.runtime-summary {
  margin-bottom: 10px;
}

.runtime-summary p {
  margin: 0 0 6px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 13px;
  table-layout: fixed;
}

thead th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid rgba(234, 240, 255, 0.15);
  padding: 7px;
}

tbody td {
  border-bottom: 1px solid rgba(234, 240, 255, 0.08);
  padding: 7px;
  vertical-align: top;
}

.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid rgba(234, 240, 255, 0.25);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge.fresh,
.badge.ok {
  color: var(--ok);
  border-color: rgba(110, 255, 183, 0.45);
}

.badge.stale,
.badge.warn {
  color: var(--warn);
  border-color: rgba(255, 215, 109, 0.55);
}

.badge.offline,
.badge.err {
  color: var(--danger);
  border-color: rgba(255, 111, 111, 0.55);
}

.raw-output {
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(234, 240, 255, 0.15);
  background: rgba(8, 12, 18, 0.75);
  padding: 12px;
  max-height: 440px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.4;
}

.proof-modal {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(0, 0, 0, 0.58);
  display: grid;
  place-items: center;
  padding: 18px;
}

.proof-modal-card {
  width: min(980px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 12px;
}

.proof-preview {
  margin-top: 8px;
  border: 1px solid rgba(234, 240, 255, 0.16);
  border-radius: 10px;
  background: rgba(8, 12, 18, 0.72);
  padding: 10px;
  min-height: 80px;
}

.proof-preview img,
.proof-preview video {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 8px;
}

.proof-preview audio {
  width: 100%;
}

.site-footer {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.hidden {
  display: none !important;
}

@keyframes pulseFlow {
  0% {
    background-position: 0% 0, 0% 0;
  }
  100% {
    background-position: 220% 0, 0% 0;
  }
}

@media (max-width: 1320px) {
  .status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

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

  .left-nav {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analyze-layout,
  .visual-row.two-up,
  .cards-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .network-row.clusters {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  body {
    padding: 10px;
  }

  .site-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions,
  .login-row,
  .raw-auth-row,
  .action-row {
    flex-direction: column;
    align-items: stretch;
  }

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

  .status-grid,
  .resource-grid,
  .kanban-grid,
  .proof-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .network-row.sources {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

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