:root {
  --bg: #070a10;
  --bg-raised: #0b1018;
  --panel: #101720;
  --panel-raised: #151e29;
  --panel-hover: #192430;
  --line: #22303d;
  --line-soft: #19242f;
  --text: #f2f5f7;
  --text-muted: #91a0ad;
  --text-dim: #667583;
  --accent: #64e6b5;
  --accent-strong: #31c992;
  --accent-ink: #06241a;
  --blue: #6ca9ff;
  --amber: #ffc46b;
  --red: #ff7a82;
  --purple: #b69cff;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 20px 70px rgb(0 0 0 / 28%);
  --sidebar: 248px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 80% -20%, rgb(61 139 118 / 12%), transparent 38%),
    var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  color: var(--accent-ink);
  background: var(--accent);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--accent-ink);
  background: var(--accent);
  transform: translateY(-160%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--text-muted);
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(100 230 181 / 35%);
  border-radius: 11px;
  color: var(--accent);
  background: linear-gradient(145deg, rgb(100 230 181 / 15%), rgb(100 230 181 / 2%));
  box-shadow: inset 0 0 16px rgb(100 230 181 / 8%);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-mark.small {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 13px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line-soft);
  background: rgb(9 13 20 / 92%);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 8px;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-copy {
  display: grid;
  line-height: 1.2;
}

.brand-copy strong {
  font-size: 14px;
  letter-spacing: -0.015em;
}

.brand-copy span {
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-label {
  margin: 30px 10px 9px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 12px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-muted);
  font-weight: 580;
  transition: color 140ms ease, background 140ms ease;
}

.nav-link:hover {
  color: var(--text);
  background: rgb(255 255 255 / 3.5%);
  text-decoration: none;
}

.nav-link[aria-current="page"] {
  color: var(--text);
  background: rgb(100 230 181 / 9%);
}

.nav-link[aria-current="page"]::before {
  position: absolute;
  inset: 10px auto 10px 0;
  width: 2px;
  border-radius: 3px;
  background: var(--accent);
  content: "";
}

.nav-icon {
  width: 25px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
}

.nav-link[aria-current="page"] .nav-icon {
  color: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
}

.operator {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.operator:hover {
  border-color: var(--line);
  color: var(--text);
  background: var(--panel);
}

.avatar {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(108 169 255 / 30%);
  border-radius: 50%;
  color: var(--blue);
  background: rgb(108 169 255 / 10%);
  font-size: 11px;
  font-weight: 800;
}

.operator-copy {
  min-width: 0;
  display: grid;
  flex: 1;
}

.operator-copy strong,
.operator-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operator-copy strong {
  color: var(--text);
  font-size: 12px;
}

.operator-copy span {
  color: var(--text-dim);
  font-size: 11px;
}

.logout-glyph {
  color: var(--text-dim);
  font-size: 16px;
}

.workspace {
  min-width: 0;
  grid-column: 2;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(20px, 4vw, 48px);
  border-bottom: 1px solid var(--line-soft);
  background: rgb(7 10 16 / 66%);
  backdrop-filter: blur(12px);
}

.topbar-title {
  min-width: 0;
  flex: 1;
}

.topbar-title p,
.topbar-title h1 {
  margin: 0;
}

.topbar-title p {
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.topbar-title h1 {
  margin-top: 1px;
  overflow: hidden;
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-live {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 11px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(100 230 181 / 10%);
}

.content {
  width: min(1480px, 100%);
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: 34px clamp(20px, 4vw, 48px) 64px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.page-title h2,
.page-title p {
  margin: 0;
}

.page-title h2 {
  font-size: clamp(23px, 2.2vw, 29px);
  font-weight: 680;
  letter-spacing: -0.035em;
}

.page-title p {
  max-width: 680px;
  margin-top: 6px;
  color: var(--text-muted);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--panel);
  font-size: 12px;
  font-weight: 680;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 120ms ease;
}

.btn:hover {
  border-color: #334656;
  background: var(--panel-raised);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent);
}

.btn-primary:hover {
  border-color: #8df0cb;
  background: #7aebc2;
}

.btn-danger {
  border-color: rgb(255 122 130 / 30%);
  color: var(--red);
  background: rgb(255 122 130 / 7%);
}

.btn-quiet {
  border-color: transparent;
  color: var(--text-muted);
  background: transparent;
}

.btn-quiet:hover {
  border-color: var(--line);
  color: var(--text);
}

.btn-small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 11px;
}

.btn-icon {
  width: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 17px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-card,
.panel,
.node-card,
.template-card,
.build-card {
  border: 1px solid var(--line-soft);
  background: linear-gradient(150deg, rgb(20 29 40 / 92%), rgb(13 19 27 / 92%));
  box-shadow: 0 1px 0 rgb(255 255 255 / 2%) inset;
}

.summary-card {
  min-height: 104px;
  padding: 17px 18px;
  border-radius: var(--radius);
}

.summary-card span {
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 9px;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.summary-card small {
  display: block;
  margin-top: 1px;
  color: var(--text-dim);
  font-size: 11px;
}

.panel {
  overflow: hidden;
  border-radius: var(--radius);
}

.panel-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}

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

.panel-title h3,
.panel-title p {
  margin: 0;
}

.panel-title h3 {
  font-size: 13px;
  font-weight: 680;
}

.panel-title p {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 11px;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

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

.data-table th {
  color: var(--text-dim);
  background: rgb(7 11 16 / 22%);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table tbody tr {
  transition: background 130ms ease;
}

.data-table tbody tr:hover {
  background: rgb(255 255 255 / 1.7%);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.resource-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.resource-name strong,
.resource-name small {
  display: block;
}

.resource-name strong {
  font-size: 12px;
  font-weight: 650;
}

.resource-name small,
.muted {
  color: var(--text-dim);
  font-size: 11px;
}

.resource-badge {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  background: rgb(100 230 181 / 6%);
  font-size: 10px;
  font-weight: 800;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 630;
  text-transform: capitalize;
}

.status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  content: "";
}

.status-running,
.status-online,
.status-ready,
.status-completed,
.status-success {
  color: var(--accent);
}

.status-running::before,
.status-online::before,
.status-ready::before,
.status-completed::before,
.status-success::before {
  background: var(--accent);
  box-shadow: 0 0 7px rgb(100 230 181 / 40%);
}

.status-stopped,
.status-offline,
.status-error,
.status-failed {
  color: var(--red);
}

.status-stopped::before,
.status-offline::before,
.status-error::before,
.status-failed::before {
  background: var(--red);
}

.status-starting,
.status-stopping,
.status-syncing,
.status-pending {
  color: var(--amber);
}

.status-starting::before,
.status-stopping::before,
.status-syncing::before,
.status-pending::before {
  background: var(--amber);
}

.metric-stack {
  min-width: 74px;
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
  font-size: 10px;
}

.metric-track {
  width: 100%;
  height: 3px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 4px;
  background: #25313c;
}

.metric-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.metric-fill.warn {
  background: var(--amber);
}

.metric-fill.hot {
  background: var(--red);
}

.io-cell {
  color: var(--text-muted);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.io-cell small {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 8px;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.action-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-muted);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.action-button:hover {
  border-color: var(--line);
  color: var(--text);
  background: var(--panel-hover);
}

.action-button:disabled,
.action-button:disabled:hover {
  border-color: transparent;
  opacity: 0.35;
  color: var(--text-dim);
  background: transparent;
  cursor: not-allowed;
}

.action-button.danger:hover {
  border-color: rgb(255 122 130 / 30%);
  color: var(--red);
  background: rgb(255 122 130 / 7%);
}

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

.node-card,
.template-card,
.build-card {
  min-width: 0;
  padding: 17px;
  border-radius: var(--radius);
}

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

.card-top h3,
.card-top p {
  margin: 0;
}

.card-top h3 {
  overflow: hidden;
  font-size: 14px;
  font-weight: 670;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-top p {
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 11px;
}

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

.card-meta div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgb(5 8 12 / 23%);
}

.card-meta span,
.card-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta span {
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 730;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-meta strong {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.capacity {
  margin-top: 17px;
}

.capacity-row + .capacity-row {
  margin-top: 10px;
}

.capacity-row .metric-head span:first-child {
  color: var(--text-dim);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 15px;
}

.tag {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-muted);
  background: rgb(4 7 10 / 22%);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
}

.empty-state,
.error-state {
  min-height: 300px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 42px 20px;
  text-align: center;
}

.empty-symbol {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text-dim);
  background: var(--panel-raised);
  font-size: 18px;
}

.empty-state h3,
.empty-state p,
.error-state h3,
.error-state p {
  margin: 0;
}

.empty-state h3,
.error-state h3 {
  margin-top: 15px;
  font-size: 14px;
}

.empty-state p,
.error-state p {
  max-width: 420px;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
}

.empty-state .btn,
.error-state .btn {
  margin-top: 17px;
}

.error-state .empty-symbol {
  border-color: rgb(255 122 130 / 25%);
  color: var(--red);
  background: rgb(255 122 130 / 6%);
}

.skeleton {
  position: relative;
  min-height: 14px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--panel-raised);
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 4%), transparent);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}

.loading-list {
  display: grid;
  gap: 1px;
}

.loading-row {
  display: grid;
  grid-template-columns: 1.5fr 0.7fr repeat(3, 1fr) 0.5fr;
  gap: 30px;
  padding: 22px 16px;
  border-bottom: 1px solid var(--line-soft);
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(440px, 1.2fr);
  background:
    radial-gradient(circle at 72% 30%, rgb(100 230 181 / 9%), transparent 30%),
    var(--bg);
}

.auth-panel {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 42px;
  border-right: 1px solid var(--line-soft);
  background: rgb(8 12 18 / 92%);
}

.auth-wrap {
  width: min(390px, 100%);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 66px;
}

.auth-brand strong {
  display: block;
  font-size: 14px;
}

.auth-brand span {
  display: block;
  color: var(--text-dim);
  font-size: 10px;
}

.auth-copy h1,
.auth-copy p {
  margin: 0;
}

.auth-copy h1 {
  font-size: 30px;
  font-weight: 680;
  letter-spacing: -0.045em;
}

.auth-copy p {
  margin-top: 9px;
  color: var(--text-muted);
}

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

.auth-form .btn {
  width: 100%;
  min-height: 44px;
  margin-top: 5px;
}

.auth-foot {
  margin-top: 52px;
  color: var(--text-dim);
  font-size: 10px;
}

.auth-visual {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 60px;
}

.auth-visual::before,
.auth-visual::after {
  position: absolute;
  border: 1px solid rgb(100 230 181 / 8%);
  border-radius: 50%;
  content: "";
}

.auth-visual::before {
  width: 640px;
  height: 640px;
}

.auth-visual::after {
  width: 420px;
  height: 420px;
}

.signal-board {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgb(15 22 30 / 80%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
}

.signal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-muted);
  font-size: 11px;
}

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

.signal-stat {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgb(4 7 10 / 22%);
}

.signal-stat span,
.signal-stat strong {
  display: block;
}

.signal-stat span {
  color: var(--text-dim);
  font-size: 9px;
  text-transform: uppercase;
}

.signal-stat strong {
  margin-top: 5px;
  font-size: 19px;
  font-weight: 620;
}

.signal-lines {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.signal-line {
  display: grid;
  grid-template-columns: 68px 1fr 40px;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 9px;
}

.signal-line i {
  height: 4px;
  overflow: hidden;
  border-radius: 5px;
  background: #24313b;
}

.signal-line i::before {
  width: var(--signal-width, 50%);
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--accent);
  content: "";
}

.field {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.field label,
.fieldset-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 640;
}

.field-hint {
  color: var(--text-dim);
  font-size: 10px;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: #0b1119;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}

.input,
.select {
  min-height: 41px;
  padding: 0 12px;
}

.textarea {
  min-height: 92px;
  padding: 11px 12px;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: #4e5d69;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgb(100 230 181 / 55%);
  outline: none;
  box-shadow: 0 0 0 3px rgb(100 230 181 / 7%);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

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

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
}

.checkbox-row input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent-strong);
}

.form-error {
  padding: 9px 11px;
  border: 1px solid rgb(255 122 130 / 22%);
  border-radius: 8px;
  color: var(--red);
  background: rgb(255 122 130 / 6%);
  font-size: 11px;
}

#confirm-error {
  margin-top: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgb(1 4 7 / 72%);
  backdrop-filter: blur(6px);
  animation: fade-in 130ms ease;
}

.modal {
  width: min(590px, 100%);
  max-height: min(820px, calc(100vh - 44px));
  overflow: auto;
  border: 1px solid #2c3b49;
  border-radius: var(--radius-lg);
  background: #101720;
  box-shadow: var(--shadow);
  animation: modal-in 160ms ease;
}

.modal-wide {
  width: min(760px, 100%);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: rgb(16 23 32 / 96%);
  backdrop-filter: blur(10px);
}

.modal-header h2,
.modal-header p {
  margin: 0;
}

.modal-header h2 {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.modal-header p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 22px;
  border-top: 1px solid var(--line-soft);
  background: rgb(8 12 17 / 24%);
}

.token-box {
  padding: 14px;
  border: 1px solid rgb(100 230 181 / 24%);
  border-radius: 10px;
  background: rgb(100 230 181 / 5%);
}

.token-box code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--accent);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
}

.token-warning {
  margin: 0 0 13px;
  color: var(--amber);
  font-size: 11px;
}

.command-box {
  margin-top: 13px;
  padding: 12px;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  color: var(--text-muted);
  background: #080c12;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  white-space: nowrap;
}

.node-picker {
  display: grid;
  gap: 8px;
  max-height: 310px;
  overflow: auto;
  padding-right: 3px;
}

.node-option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgb(5 8 12 / 22%);
  cursor: pointer;
}

.node-option:hover {
  border-color: var(--line);
  background: var(--panel-raised);
}

.node-option input {
  accent-color: var(--accent-strong);
}

.node-option-copy {
  min-width: 0;
  display: grid;
  flex: 1;
}

.node-option-copy strong {
  font-size: 11px;
}

.node-option-copy span {
  color: var(--text-dim);
  font-size: 10px;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 180;
  width: min(360px, calc(100vw - 36px));
  display: grid;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: #151e28;
  box-shadow: 0 12px 35px rgb(0 0 0 / 35%);
  animation: toast-in 180ms ease;
}

.toast::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.toast-error::before {
  background: var(--red);
}

.toast-warning::before {
  background: var(--amber);
}

.toast div {
  min-width: 0;
  flex: 1;
}

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  font-size: 11px;
}

.toast span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(290px, 0.6fr);
  gap: 14px;
}

.upload-zone {
  position: relative;
  min-height: 210px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 24px;
  border: 1px dashed #314353;
  border-radius: 11px;
  background: rgb(5 9 13 / 20%);
  text-align: center;
  transition: border-color 140ms ease, background 140ms ease;
}

.upload-zone.dragover {
  border-color: var(--accent);
  background: rgb(100 230 181 / 5%);
}

.upload-symbol {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--accent);
  background: var(--panel-raised);
  font-size: 18px;
}

.upload-zone strong {
  margin-top: 12px;
  font-size: 12px;
}

.upload-zone p {
  margin: 3px 0 0;
  color: var(--text-dim);
  font-size: 10px;
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-file {
  max-width: 100%;
  margin-top: 11px;
  overflow: hidden;
  color: var(--accent);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
}

.upload-panel .panel-body,
.settings-panel .panel-body {
  padding: 18px;
}

.upload-panel .form-grid {
  margin-top: 17px;
}

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

.build-list {
  display: grid;
}

.build-item {
  border-bottom: 1px solid var(--line-soft);
}

.build-item:last-child {
  border-bottom: 0;
}

.build-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) 0.8fr 0.8fr auto;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
}

.build-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.build-name {
  min-width: 0;
}

.build-name strong,
.build-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.build-name strong {
  font-size: 12px;
}

.build-name span {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 10px;
}

.build-detail span,
.build-detail strong {
  display: block;
}

.build-detail span {
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.build-detail strong {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 600;
}

.build-replicas {
  display: grid;
  gap: 1px;
  margin: 0 16px 14px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--line-soft);
}

.build-replica {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 11px;
  background: rgb(5 9 13 / 34%);
}

.build-replica-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.build-replica-copy > strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.build-replica-copy > span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-dim);
  font-size: 9px;
}

.build-replica-empty {
  margin: 0 16px 14px;
  padding: 10px 11px;
  border: 1px dashed var(--line-soft);
  border-radius: 9px;
  color: var(--text-dim);
  font-size: 10px;
}

.api-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
}

.api-toolbar-copy {
  min-width: 0;
}

.api-toolbar-copy strong,
.api-toolbar-copy code {
  display: block;
}

.api-toolbar-copy strong {
  font-size: 11px;
}

.api-toolbar-copy code {
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-frame-wrap {
  min-height: 670px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fff;
}

.api-frame {
  width: 100%;
  min-height: 670px;
  display: block;
  border: 0;
  background: #fff;
}

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

.settings-side {
  align-self: start;
  padding: 17px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
}

.settings-side h3,
.settings-side p {
  margin: 0;
}

.settings-side h3 {
  font-size: 12px;
}

.settings-side p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
}

.settings-side dl {
  margin: 17px 0 0;
}

.settings-side dl div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 10px;
}

.settings-side dt {
  color: var(--text-dim);
}

.settings-side dd {
  margin: 0;
  color: var(--text-muted);
  text-align: right;
}

.settings-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.readonly-settings {
  min-width: 0;
  margin: 5px 0 0;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgb(5 9 13 / 24%);
}

.readonly-settings legend {
  padding: 0 7px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 640;
}

.readonly-settings > p {
  margin: 0 0 15px;
  color: var(--text-dim);
  font-size: 10px;
}

.readonly-badge {
  margin-left: 5px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text-dim);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.input[readonly] {
  border-style: dashed;
  color: var(--text-muted);
  background: rgb(8 12 17 / 55%);
  cursor: default;
}

.readonly-control {
  cursor: default;
}

.mobile-menu {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

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

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

  .sync-layout,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-side {
    display: none;
  }

  .data-table .optional-lg {
    display: none;
  }
}

@media (max-width: 860px) {
  :root {
    --sidebar: 74px;
  }

  .sidebar {
    width: var(--sidebar);
    align-items: center;
    padding-inline: 10px;
  }

  .brand {
    justify-content: center;
    padding: 0;
  }

  .brand-copy,
  .nav-label,
  .nav-link span:last-child,
  .operator-copy,
  .logout-glyph {
    display: none;
  }

  .nav-list {
    width: 100%;
  }

  .nav-link {
    justify-content: center;
    padding: 0;
  }

  .nav-icon {
    width: auto;
  }

  .operator {
    justify-content: center;
    padding: 8px;
  }

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

  .auth-panel {
    min-height: 100vh;
    border-right: 0;
  }

  .auth-visual {
    display: none;
  }

  .two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  :root {
    --sidebar: 0px;
  }

  body {
    padding-bottom: 65px;
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    height: 65px;
    display: block;
    padding: 7px 6px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .brand,
  .sidebar-footer,
  .nav-label {
    display: none;
  }

  .nav-list {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1px;
  }

  .nav-link {
    min-height: 50px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 2px;
    padding: 3px 1px;
    border-radius: 8px;
    font-size: 8px;
  }

  .nav-link span:last-child {
    display: block;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-link[aria-current="page"]::before {
    inset: 0 12px auto;
    width: auto;
    height: 2px;
  }

  .workspace {
    grid-column: auto;
  }

  .topbar {
    height: 62px;
    padding: 0 16px;
  }

  .topbar-title p,
  .system-live span:last-child {
    display: none;
  }

  .content {
    min-height: calc(100vh - 62px);
    padding: 23px 14px 34px;
  }

  .page-head {
    align-items: flex-start;
    margin-bottom: 20px;
  }

  .page-title h2 {
    font-size: 23px;
  }

  .page-title p {
    font-size: 12px;
  }

  .page-actions .btn span.optional-mobile {
    display: none;
  }

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

  .summary-card {
    min-height: 92px;
    padding: 14px;
  }

  .summary-card strong {
    font-size: 22px;
  }

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

  .data-table th,
  .data-table td {
    padding-inline: 13px;
  }

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

  .form-grid .full {
    grid-column: auto;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: calc(100vh - 22px);
    border-radius: 18px 18px 0 0;
  }

  .modal-wide {
    width: 100%;
  }

  .build-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .build-row .build-detail {
    display: none;
  }

  .build-replica {
    align-items: flex-start;
    flex-direction: column;
  }

  .api-toolbar {
    align-items: flex-start;
  }

  .api-frame-wrap,
  .api-frame {
    min-height: 600px;
  }

  .auth-panel {
    align-items: start;
    padding: 30px 22px;
  }

  .auth-brand {
    margin-bottom: 70px;
  }
}

.docs-body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.docs-shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.docs-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.docs-header h1 {
  margin: 4px 0 8px;
  font-size: clamp(28px, 5vw, 46px);
}

.docs-header p {
  max-width: 720px;
  color: var(--muted);
}

.docs-routes {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.docs-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px 18px;
}

.docs-search {
  width: min(540px, 100%);
}

.docs-route {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  background: var(--panel);
}

.docs-route code,
.openapi-source {
  overflow-wrap: anywhere;
  color: var(--text);
}

.docs-route-detail {
  min-width: 0;
}

.docs-route-detail p {
  margin: 5px 0 3px;
  color: var(--text);
}

.docs-route-detail small {
  color: var(--muted);
}

.docs-empty {
  padding: 22px 18px;
  background: var(--panel);
}

.method {
  display: inline-flex;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 11px;
  letter-spacing: .08em;
}

.method-get { color: #6ee7b7; }
.method-post { color: #93c5fd; }
.method-put, .method-patch { color: #fde68a; }
.method-delete { color: #fca5a5; }

.openapi-source {
  margin: 0;
  padding: 18px;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .docs-header { align-items: flex-start; flex-direction: column; }
  .docs-route { grid-template-columns: 70px minmax(0, 1fr); padding-inline: 12px; }
}

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