:root {
  font-family: Inter, "PingFang SC", "Microsoft Yahei", sans-serif;
  color: #192b39;
  background: #f4f6f8;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: flex;
  min-height: 100vh;
}
aside {
  width: 228px;
  background: #132c39;
  color: #d2dfe5;
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
}
.brand {
  color: white;
  text-decoration: none;
  font-size: 26px;
  font-weight: 650;
}
.brand span {
  font-size: 14px;
  letter-spacing: 3px;
  margin-left: 10px;
  color: #79bbba;
}
.caption {
  font-size: 14px;
  letter-spacing: 1px;
  color: #91a8b5;
  margin: 14px 0 42px;
}
nav {
  display: grid;
  gap: 8px;
}
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid #ccd7df;
  background: white;
  border-radius: 7px;
  min-height: 44px;
  padding: 10px 16px;
  color: #233e4d;
}
button:hover {
  background: #eaf2f4;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
nav button {
  text-align: left;
  background: transparent;
  color: #c7d5dc;
  border: 0;
}
nav button[aria-current="page"] {
  background: #294652;
  color: #fff;
}
.aside-foot {
  margin-top: auto;
  line-height: 1.9;
  color: #94adb9;
  font-size: 14px;
}
main {
  margin-left: 228px;
  width: calc(100% - 228px);
  padding: 36px 44px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #dbe2e7;
  padding-bottom: 22px;
}
.eyebrow {
  color: #5d7c8b;
  letter-spacing: 2px;
  font-size: 14px;
  margin: 0 0 8px;
}
h1 {
  font-size: 28px;
  margin: 0;
  font-weight: 600;
}
h2 {
  font-size: 20px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
#actor {
  font-size: 14px;
  color: #647985;
}
.primary {
  background: #176766;
  color: white;
  border-color: #176766;
}
.primary:hover {
  background: #105350;
}
#notice {
  min-height: 22px;
  color: #b04432;
  line-height: 1.7;
}
#login {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 900px;
  margin: 60px auto;
  background: white;
  border: 1px solid #dce4e8;
  border-radius: 12px;
  overflow: hidden;
}
.login-copy {
  background: #e8f0f0;
  padding: 48px 32px;
  line-height: 1.9;
}
.login-copy h2 {
  font-size: 28px;
  line-height: 1.6;
}
.login-copy p {
  color: #58707b;
}
.badge {
  font-size: 14px;
  letter-spacing: 2px;
  color: #267271;
}
form {
  padding: 32px;
}
label {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: #49616e;
  font-size: 14px;
}
input,
textarea {
  font: inherit;
  border: 1px solid #bfcdd4;
  border-radius: 6px;
  padding: 12px;
  background: white;
  color: #1c3443;
  width: 100%;
}
input:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid #96c3c4;
  outline-offset: 2px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 20px 0;
}
.card {
  background: white;
  border: 1px solid #dce4e8;
  border-radius: 10px;
  padding: 24px;
}
.card p {
  color: #5f7884;
  line-height: 1.7;
}
.metric {
  font-size: 36px;
  font-weight: 600;
  color: #176766;
}
.table-wrap {
  overflow: auto;
  background: white;
  border: 1px solid #dce4e8;
  border-radius: 8px;
}
table {
  border-collapse: collapse;
  min-width: 700px;
  width: 100%;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 16px;
  border-bottom: 1px solid #e6ebef;
  max-width: 360px;
  overflow-wrap: anywhere;
}
th {
  background: #eef3f5;
  font-weight: 500;
  color: #58727e;
}
td button {
  font-size: 14px;
  padding: 6px 10px;
  margin: 3px;
}
.hint {
  line-height: 1.8;
  color: #617986;
}
.filter {
  max-width: 360px;
  margin-bottom: 18px;
}
footer {
  color: #899ba5;
  font-size: 14px;
  margin-top: 40px;
}
dialog {
  border: 1px solid #dce4e8;
  border-radius: 12px;
  max-width: 480px;
  width: 90%;
}
dialog::backdrop {
  background: #132c3970;
}
[hidden] {
  display: none !important;
}
@media (max-width: 900px) {
  aside {
    width: 180px;
    padding: 24px 14px;
  }
  main {
    margin-left: 180px;
    width: calc(100% - 180px);
    padding: 24px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  header {
    align-items: flex-start;
    gap: 15px;
    flex-direction: column;
  }
  #login {
    grid-template-columns: 1fr;
    margin: 20px auto;
  }
  .login-copy {
    padding: 24px;
  }
}
@media (max-width: 600px) {
  body {
    display: block;
  }
  aside {
    position: static;
    width: 100%;
    padding: 18px;
  }
  .caption,
  .aside-foot {
    display: none;
  }
  nav {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 15px;
  }
  nav button {
    text-align: center;
    padding: 8px;
    font-size: 14px;
  }
  main {
    margin: 0;
    width: 100%;
    padding: 20px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
}

.access-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
  margin: 12px 0;
}
.access-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.access-row input[type="checkbox"] {
  width: auto;
}
dialog {
  max-width: 560px;
  width: calc(100% - 48px);
}
#setup-secret {
  display: block;
  word-break: break-all;
  padding: 12px;
  background: #eef2ff;
}
#recovery-codes {
  user-select: all;
}
.access-row select {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid #c2d0d5;
  border-radius: 7px;
  background: #fff;
  color: #243c46;
}
dialog {
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.access-row label {
  margin: 0;
}
#access-fields {
  margin: 20px 0;
}
#create-user-form input {
  box-sizing: border-box;
}
#begin-setup {
  margin-top: 12px;
}

/* Base / 星枢 control plane. Keep all assets local under the admin CSP. */
:root {
  color-scheme: dark;
  --bg: #080e16;
  --panel: #0d1722;
  --line: #213341;
  --muted: #8a9eae;
  --cyan: #76dedf;
  --blue: #88aff2;
  --green: #8ad5ad;
  --violet: #b3a1e5;
  background: var(--bg);
  color: #dce8ee;
  font-family: Inter, "PingFang SC", "Microsoft Yahei", sans-serif;
}
body {
  background:
    radial-gradient(ellipse at 68% 0%, #10283866, transparent 50%), var(--bg);
}
body > aside {
  width: 232px;
  background: #0a121c;
  border-right: 1px solid var(--line);
  padding: 32px 20px;
  z-index: 2;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 25px;
  letter-spacing: 3px;
}
.brand span {
  margin: 0;
  color: var(--cyan);
  font-size: 14px;
  letter-spacing: 2px;
}
.brand .brand-mark {
  font-size: 33px;
  margin-right: 4px;
}
.caption {
  font:
    14px ui-monospace,
    monospace;
  letter-spacing: 1.5px;
  margin: 12px 0 40px;
}
.nav-label {
  font:
    14px ui-monospace,
    monospace;
  letter-spacing: 1.7px;
  color: #6f8799;
  margin: 24px 10px 10px;
}
nav {
  gap: 5px;
}
nav .nav-label {
  margin-top: 28px;
}
nav button {
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 14px;
  min-height: 45px;
}
nav button span {
  display: inline-block;
  font:
    14px ui-monospace,
    monospace;
  color: #637b8d;
  margin-right: 18px;
}
nav button[aria-current="page"] {
  background: #15303c;
  border-color: #295463;
  color: #a4f4ef;
  box-shadow: inset 2px 0 #76dedf;
}
nav button:hover {
  background: #132632;
}
.aside-foot {
  font:
    14px/2 ui-monospace,
    monospace;
  padding-top: 28px;
}
.aside-foot span {
  font:
    14px/2 "PingFang SC",
    sans-serif;
  color: #718796;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 9px #8ad5ad66;
  margin-right: 7px;
}
main {
  margin-left: 232px;
  width: calc(100% - 232px);
  padding: 30px 38px;
  max-width: 1900px;
}
header {
  border-color: var(--line);
  padding-bottom: 24px;
}
h1 {
  font-size: 24px;
  letter-spacing: 1px;
}
h2 {
  font-size: 21px;
  font-weight: 550;
}
h3 {
  font-size: 15px;
  font-weight: 550;
}
.eyebrow {
  font:
    14px/1.6 ui-monospace,
    SFMono-Regular,
    monospace;
  letter-spacing: 1.6px;
  color: var(--muted);
}
#actor {
  font:
    14px ui-monospace,
    monospace;
  color: #9aafbd;
}
.toolbar {
  flex-wrap: wrap;
}
button {
  border: 1px solid #2d4353;
  background: #11202c;
  color: #cbdce6;
  border-radius: 4px;
  transition:
    background 0.18s,
    border-color 0.18s;
}
button:hover {
  background: #18303e;
  border-color: #4b8494;
}
button:focus-visible,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
.primary {
  background: #80ddd7;
  color: #0a2026;
  border-color: #80ddd7;
  font-weight: 600;
}
.primary:hover {
  background: #a1efea;
  color: #0a2026;
}
#notice {
  color: #e6bc7a;
  min-height: 8px;
  margin: 14px 0;
}
#notice:empty {
  margin: 8px 0;
}
.hint {
  color: var(--muted);
  line-height: 1.8;
}
.section-head {
  margin: 24px 0;
}
.section-head h2 {
  font-size: 27px;
  letter-spacing: 0.5px;
  margin: 10px 0;
}
.section-head .hint {
  font-size: 14px;
  margin-bottom: 0;
}
.cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0;
}
.card {
  background: linear-gradient(130deg, #101e2b, #0d1620);
  border-color: var(--line);
  border-radius: 5px;
  padding: 23px;
}
.card p {
  color: var(--muted);
}
.metric-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  text-align: left;
}
.metric-card .metric {
  font:
    38px/1.1 ui-monospace,
    monospace;
  font-weight: 500;
  color: #daf1f5;
  letter-spacing: -2px;
}
.metric-card > span:last-child {
  font-size: 14px;
  color: #9cb1bf;
}
.metric-card:hover {
  border-color: #4b8494;
  background: #122632;
}
.flow-panel {
  border: 1px solid #2a3e4b;
  background: #0b141e;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 24px;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.panel-heading h2 {
  font-size: 17px;
  margin: 5px 0 0;
}
.panel-heading p {
  margin: 0;
}
.panel-heading button {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 14px;
}
.mode-label {
  font:
    14px ui-monospace,
    monospace;
  color: #83b9bd;
}
.flow-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 225px;
}
.flow-canvas {
  min-width: 0;
  background-image: radial-gradient(#2c485366 0.7px, transparent 0.7px);
  background-size: 18px 18px;
  padding: 12px 8px 18px;
}
.flow-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 320px;
}
.flow-line {
  fill: none;
  stroke: #39515f;
  stroke-width: 1.3;
}
.flow-line.violet {
  stroke: #746991;
  stroke-dasharray: 5 4;
}
.cyan {
  --signal: var(--cyan);
}
.blue {
  --signal: var(--blue);
}
.green {
  --signal: var(--green);
}
.violet {
  --signal: var(--violet);
}
.flow-dot {
  fill: var(--signal);
  filter: drop-shadow(0 0 4px var(--signal));
}
.topology-node {
  cursor: pointer;
  outline: none;
}
.topology-node rect {
  fill: #0e1c28;
  stroke: var(--signal);
  stroke-opacity: 0.55;
}
.topology-node:hover rect,
.topology-node:focus rect {
  fill: #19303e;
  stroke-opacity: 1;
  stroke-width: 2;
}
.node-corner {
  stroke: var(--signal);
  stroke-width: 2;
  fill: none;
}
.node-code {
  font:
    14px ui-monospace,
    monospace;
  fill: var(--signal);
  letter-spacing: 1px;
}
.node-name {
  font:
    15px "PingFang SC",
    sans-serif;
  fill: #deecf1;
}
.node-detail {
  font:
    14px ui-monospace,
    "PingFang SC",
    monospace;
  fill: #8ca6b6;
}
.guard-label {
  font:
    14px "PingFang SC",
    sans-serif;
  fill: #b3a1e5;
  pointer-events: none;
}
.branch-label {
  font:
    14px ui-monospace,
    monospace;
  fill: #7894a5;
  letter-spacing: 1.5px;
}
.flow-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 14px;
  color: #92aab7;
}
.flow-legend span:before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--signal);
  margin-right: 7px;
  border-radius: 50%;
}
.event-rail {
  position: static;
  inset: auto;
  width: auto;
  background: #0d1721;
  border-left: 1px solid var(--line);
  display: block;
  padding: 24px 18px;
  min-width: 0;
}
.event-rail h3 {
  margin: 7px 0;
}
.event-rail .hint {
  font-size: 14px;
}
.event-item {
  border-left: 1px solid #314855;
  padding: 3px 0 3px 13px;
  margin: 22px 0;
  display: grid;
  gap: 8px;
  position: relative;
  overflow-wrap: anywhere;
}
.event-item:before {
  content: "";
  position: absolute;
  left: -3px;
  top: 5px;
  background: var(--cyan);
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.event-item time {
  font:
    14px ui-monospace,
    monospace;
  color: #7891a1;
}
.event-item strong {
  font:
    14px ui-monospace,
    monospace;
  color: #bfd8e3;
}
.event-item span {
  font-size: 14px;
  color: #829baa;
}
.text-button {
  background: transparent;
  border-color: transparent;
  padding: 8px 0;
  min-height: 36px;
  color: var(--cyan);
  font-size: 14px;
  text-align: left;
}
.text-button:hover {
  background: transparent;
  border-color: transparent;
  color: #b4ffff;
}
.flow-caption {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 13px 24px;
  color: #859caa;
  font-size: 14px;
  line-height: 1.8;
}
.module-shortcuts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.shortcut {
  text-align: left;
  display: grid;
  gap: 10px;
  padding: 18px 14px;
  background: #0d1822;
  border-color: var(--line);
  font-size: 14px;
}
.shortcut small {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.module-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 5px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.module-card h3 {
  font-size: 18px;
  margin: 8px 0;
}
.module-card .hint {
  font-size: 14px;
  flex: 1;
  overflow-wrap: anywhere;
}
.module-card .eyebrow {
  color: #72b6c2;
}
.module-filters {
  display: flex;
  gap: 12px;
  margin: 22px 0;
}
.module-filters input {
  max-width: 460px;
}
.module-filters select {
  width: 160px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.detail-value {
  white-space: pre-line;
  overflow-wrap: anywhere;
  font:
    14px/1.9 ui-monospace,
    "PingFang SC",
    monospace;
}
.empty-state {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
  padding: 24px 0;
}
.table-wrap {
  background: #0d1722;
  border-color: var(--line);
  border-radius: 5px;
  margin-top: 16px;
}
th {
  background: #132330;
  color: #9bb6c7;
}
th,
td {
  border-color: #20323f;
  padding: 15px;
}
td {
  color: #c0d2dd;
}
tbody tr:hover {
  background: #12232f;
}
input,
textarea,
select,
.access-row select {
  background: #0b1620;
  border: 1px solid #304857;
  color: #d8e8ef;
  border-radius: 4px;
  padding: 12px;
  font: inherit;
}
label {
  color: #9fb6c4;
}
.filter {
  margin-top: 18px;
}
dialog {
  background: #101e2b;
  color: #deebf2;
  border-color: #385769;
  box-shadow: 0 20px 100px #0009;
}
dialog::backdrop {
  background: #030a11b8;
  backdrop-filter: blur(5px);
}
#setup-secret {
  background: #152838;
  color: var(--cyan);
}
footer {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  font:
    14px ui-monospace,
    monospace;
  letter-spacing: 0.5px;
  color: #687e8e;
}
#login {
  background: #0e1a26;
  border-color: #294252;
  margin: 50px auto;
  max-width: 980px;
  border-radius: 6px;
}
.login-copy {
  background:
    radial-gradient(ellipse at bottom, #15414b66, transparent 65%), #0b1822;
  padding: 42px 32px;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--line);
}
.login-copy h2 {
  font-size: 28px;
  color: #d9eef2;
}
.login-copy p {
  font-size: 14px;
  color: #91aeba;
}
.badge {
  color: var(--cyan);
  font:
    14px ui-monospace,
    monospace;
  letter-spacing: 2px;
}
.login-orbit {
  width: 180px;
  height: 180px;
  border: 1px solid #3d6976;
  border-radius: 50%;
  margin: 32px auto;
  display: grid;
  place-items: center;
  position: relative;
  background: radial-gradient(circle, #17435188, transparent 65%);
  box-shadow:
    0 0 0 18px #284b5820,
    0 0 0 38px #284b5810;
}
.login-orbit:before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px dashed #365966;
  border-radius: 50%;
}
.login-orbit:after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 3px solid transparent;
  border-top-color: #7be5e0;
  border-radius: 50%;
  animation: orbit 10s linear infinite;
}
.login-orbit span {
  font:
    22px ui-monospace,
    monospace;
  letter-spacing: 5px;
  color: #9ae6e4;
}
@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}
#login form {
  padding: 42px 36px;
}
#login form h2 {
  margin-bottom: 28px;
}
#login form button {
  width: 100%;
}
#login form .eyebrow {
  color: #75b5c0;
}
@media (min-width: 1600px) {
  .flow-svg {
    max-height: 600px;
  }
}
@media (max-width: 1200px) {
  main {
    padding: 26px;
  }
  .flow-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .event-rail {
    border-left: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  .event-rail > .eyebrow,
  .event-rail > h3,
  .event-rail > .hint {
    grid-column: 1/-1;
    margin: 0;
  }
  .event-item {
    margin: 8px 0;
  }
  .module-shortcuts {
    grid-template-columns: repeat(3, 1fr);
  }
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  body > aside {
    width: 180px;
    padding: 26px 14px;
  }
  .brand {
    font-size: 20px;
    gap: 6px;
  }
  .brand .brand-mark {
    font-size: 26px;
  }
  .brand span {
    font-size: 14px;
  }
  .caption {
    font-size: 8px;
    letter-spacing: 0.5px;
  }
  main {
    margin-left: 180px;
    width: calc(100% - 180px);
    padding: 22px;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .flow-canvas {
    overflow-x: auto;
  }
  .flow-svg {
    min-width: 620px;
  }
  .flow-legend {
    min-width: 570px;
  }
  .module-shortcuts {
    grid-template-columns: repeat(2, 1fr);
  }
  #login {
    grid-template-columns: 1fr;
    margin: 24px auto;
  }
  .login-copy {
    padding: 26px;
  }
  .login-orbit {
    width: 100px;
    height: 100px;
    margin: 24px auto;
  }
  .login-copy h2 {
    font-size: 23px;
  }
  .login-copy p {
    margin-bottom: 0;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  body > aside {
    position: static;
    width: 100%;
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  body > aside > .nav-label,
  nav > .nav-label {
    display: none;
  }
  nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }
  nav button {
    font-size: 14px;
    padding: 9px 3px;
    min-height: 40px;
    text-align: center;
  }
  nav button span {
    display: none;
  }
  main {
    margin: 0;
    width: 100%;
    padding: 20px 16px;
  }
  .section-head h2 {
    font-size: 23px;
  }
  .cards {
    gap: 10px;
  }
  .metric-card {
    padding: 18px;
  }
  .metric-card .metric {
    font-size: 32px;
  }
  .module-grid {
    grid-template-columns: 1fr;
  }
  .module-filters {
    flex-direction: column;
  }
  .module-filters select {
    width: 100%;
  }
  .event-rail {
    grid-template-columns: 1fr;
  }
  .module-shortcuts {
    grid-template-columns: 1fr 1fr;
  }
  .flow-caption {
    padding: 12px 16px;
  }
  .panel-heading {
    padding: 18px 16px;
  }
  .panel-heading .toolbar {
    gap: 8px;
  }
  .detail-grid .card {
    padding: 18px;
  }
  #login form {
    padding: 26px;
  }
  .toolbar {
    gap: 8px;
  }
  .access-row {
    grid-template-columns: 1fr;
  }
  form {
    padding: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
  .flow-dot {
    display: none;
  }
}
.contract-panel {
  margin-top: 28px;
}
.validate-form {
  padding: 24px 0;
  max-width: 900px;
}
.validate-form textarea {
  font:
    14px/1.8 ui-monospace,
    monospace;
  resize: vertical;
}
.validation-result {
  overflow-wrap: anywhere;
}
.validation-result > p:first-child {
  color: var(--cyan);
}
.feature-summary {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 24px 0;
}
.feature-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin: 26px 0;
}
.feature-tabs button[aria-selected="true"] {
  background: #183642;
  border-color: #4d8993;
  color: var(--cyan);
}
.feature-form {
  padding: 8px 0;
  max-width: 780px;
}
.feature-form textarea {
  font:
    14px/1.7 ui-monospace,
    "PingFang SC",
    monospace;
  resize: vertical;
}
.json-view {
  padding: 20px;
  background: #08121c;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #a9c7d4;
  font:
    14px/1.8 ui-monospace,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 600px;
  overflow: auto;
}
.button-link {
  display: inline-block;
  padding: 12px 16px;
  color: var(--cyan);
  text-decoration: none;
  border: 1px solid #3b6977;
  border-radius: 4px;
}
.operation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}
.operation-list span,
.process-metrics span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  color: #a9c4d2;
  font-size: 14px;
}
.system-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.system-card {
  border: 1px solid var(--line);
  background: #0c1823;
  padding: 20px;
  border-radius: 4px;
}
.system-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.system-card h3 {
  margin: 0;
  font-size: 15px;
}
.system-status {
  font-size: 14px;
  line-height: 1.5;
  color: #8ca2b1;
}
.system-status:before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
  margin-right: 6px;
}
.healthy .system-status {
  color: var(--green);
}
.degraded .system-status,
.timeout .system-status,
.unavailable .system-status,
.unauthorized .system-status,
.invalid .system-status {
  color: #e9b57a;
}
.system-card .text-button {
  font-size: 14px;
}
.system-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: 14px;
  gap: 13px;
  margin: 22px 0;
  color: #b5cbd8;
}
.system-details dt {
  color: var(--muted);
}
.system-details dd {
  margin: 0;
  text-align: right;
}
.system-card .hint {
  font-size: 14px;
}
.process-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}
.process-graph {
  overflow-x: auto;
  border: 1px solid var(--line);
  background:
    radial-gradient(#35505c55 0.7px, transparent 0.7px) 0 0/18px 18px,
    #0c1721;
}
.process-graph svg {
  width: 100%;
  min-width: 750px;
  display: block;
}
.task-node {
  cursor: pointer;
}
.task-node rect {
  fill: #102330;
  stroke: #668894;
}
.task-node.done rect {
  stroke: var(--green);
}
.task-node.claimed rect {
  stroke: var(--cyan);
}
.task-node.expired rect {
  stroke: #e9b57a;
}
.task-node:focus rect,
.task-node:hover rect {
  fill: #1a3542;
  stroke-width: 2;
}
.task-node .node-code {
  fill: var(--cyan);
}
.empty-panel {
  padding: 40px;
  border: 1px dashed #34515f;
  background: #0b1721;
  margin: 20px 0;
}
.module-card .hint {
  max-height: 110px;
  overflow: auto;
}
body > aside {
  overflow-y: auto;
}
nav .nav-label {
  margin-top: 16px;
}
.caption {
  margin-bottom: 25px;
}
nav button {
  min-height: 41px;
}
.aside-foot {
  min-height: 80px;
}
@media (max-width: 1100px) {
  .system-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .system-grid {
    grid-template-columns: 1fr;
  }
  .feature-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .feature-tabs {
    gap: 5px;
  }
  .feature-tabs button {
    padding: 8px 10px;
    font-size: 14px;
  }
  .empty-panel {
    padding: 24px;
  }
  .feature-form {
    max-width: 100%;
  }
  .feature-form input,
  .feature-form textarea {
    min-width: 0;
  }
  nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
.feature-tabs button[aria-pressed="true"] {
  background: #183642;
  border-color: #4d8993;
  color: var(--cyan);
}
#system-topology .section-head {
  margin: 0;
}
#system-topology .section-head h2 {
  font-size: 20px;
}
#system-topology .section-head .hint {
  font-size: 14px;
}
.process-graph .flow-line {
  stroke: #536e7d;
  stroke-width: 1.4;
}
.process-layout{display:grid;grid-template-columns:minmax(0,1fr)230px;border:1px solid var(--line)}.process-layout .process-graph{border:0;min-width:0}.process-layout .process-graph svg{min-width:640px}.process-layout .event-rail{display:block}.process-layout .event-item strong{font-family:inherit;line-height:1.8}.process-layout .event-item span{color:var(--cyan)}@media(max-width:1200px){.process-layout{grid-template-columns:minmax(0,1fr)}.process-layout .event-rail{border-left:0;border-top:1px solid var(--line)}}

.node-value { font: 14px ui-monospace, "PingFang SC", monospace; fill: #d4e7ef; }
.topology-node .summary-track { fill: #273844; stroke: none; }
.topology-node .summary-fill { fill: var(--signal); stroke: none; }
.gray { --signal: #83929b; }
.topology-node.gray rect { fill: #192126; stroke: #59666e; }
.topology-node.gray .node-name, .topology-node.gray .node-code,
.topology-node.gray .node-detail, .topology-node.gray .node-value { fill: #9aa6ad; }
.flow-line.gray { stroke: #59666e; opacity: .65; }
.system-card.offline { border-color: #59666e; background: #192126; }
.system-card.offline .system-status { color: #a5afb6; background: #263038; }
.system-card.offline h3 { color: #a5afb6; }
.base-service-band { fill: #0c1822; stroke: #31576a; stroke-dasharray: 6 4; }
.monitor-link { stroke-dasharray: 4 5; }
.identity-link { stroke-dasharray: 9 5; }
.live-architecture { min-width: 850px; }

/* Keep graph headings inside the panel border and routes in separate gutters. */
.live-flow-panel > .panel-heading { padding: 22px 24px; }
.live-flow-panel .section-head { margin: 0; min-width: 0; }
.live-flow-panel .section-head .hint { margin-top: 10px; overflow-wrap: anywhere; line-height: 1.7; }
.live-flow-panel .section-head h2 { margin: 8px 0 0; }
.live-flow-panel .flow-line.pending-link { stroke-dasharray: 6 5; }
@media (max-width: 600px) {
  .live-flow-panel > .panel-heading { padding: 18px 16px; }
}

/* Explicit SVG fills preserve contrast independently of inherited signal colors. */
.base-capabilities .node-name { fill: #e6f0f5; }
.base-capabilities .node-detail { fill: #afc3cf; }
.base-module-link { cursor: pointer; }
.base-module-link rect { fill: #152c3b; stroke: #547b91; stroke-width: 1; }
.base-module-link text { fill: #dcf3ff; font-size: 14px; }
.base-module-link:hover rect, .base-module-link:focus rect { fill: #24465a; stroke: #98def5; stroke-width: 2; }
.base-module-link:focus { outline: none; }

.live-architecture .central-bus { fill: #102330; stroke: #527d92; stroke-dasharray: none; }
.live-architecture .product-link.pending-link { stroke-dasharray: 3 5; stroke-width: 1.2; opacity: .65; }
.live-architecture .bus-port { fill: #102330; stroke: #7896a6; stroke-width: 1.2; }

.overview-core { margin-bottom: 48px; }
.overview-details { border-top: 1px solid #496171; padding-top: 32px; }
.system-card:focus { outline: 2px solid #98def5; outline-offset: 4px; }

.architecture-layout { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; isolation: isolate; }
.architecture-layout.has-details > .flow-canvas { pointer-events: none; }
.node-details { position: absolute; inset: 0; box-sizing: border-box; width: 100%; height: 100%; overflow: auto; background: #10212d; border: 2px solid #789fb3; border-radius: 8px; padding: 28px; color: #e6f0f5; z-index: 2; }
.node-details .system-grid { grid-template-columns: 1fr; }
.node-details .system-card { padding: 24px; }
.node-details .system-details { max-width: 900px; }
.node-details .section-head h2 { font-size: 22px; }
.detail-close { margin-bottom: 24px; }
.live-architecture .topology-node.selected > rect:first-child { stroke: #98def5; stroke-width: 2; }
@media(max-width: 600px) { .node-details { padding: 16px; } }

.node-details { border: 1px solid #52758a; padding: 28px 36px; background: #0e1b25; }
.node-details .detail-close { border: 0; background: transparent; color: #adc5d3; padding: 6px 0; margin: 0 0 24px; box-shadow: none; }
.runtime-detail { max-width: 1100px; margin: 0 auto; }
.runtime-heading { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; }
.runtime-heading h2 { margin: 0; font-size: 26px; }
.runtime-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; padding: 24px 0; border-top: 1px solid #304553; border-bottom: 1px solid #304553; }
.runtime-metric { display: grid; gap: 12px; }
.runtime-metric span { color: #a4b8c5; font-size: 14px; }
.runtime-metric strong { color: #e3edf4; font-size: 23px; font-weight: 500; }
.runtime-groups { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 32px; padding: 30px 0; }
.runtime-groups h3 { font-size: 15px; margin: 0 0 20px; }
.runtime-groups dl { display: grid; grid-template-columns: 54px minmax(0,1fr); gap: 14px 12px; margin: 0; font-size: 14px; }
.runtime-groups dt { color: #a4b8c5; }
.runtime-groups dd { margin: 0; overflow-wrap: anywhere; color: #dce8f0; }
.runtime-source { border-top: 1px solid #304553; padding-top: 20px; margin-top: 20px; color: #a4b8c5; font-size: 14px; overflow-wrap: anywhere; }
.runtime-source summary { cursor: pointer; }
@media(max-width: 700px) { .node-details { padding: 20px; } .runtime-groups { grid-template-columns: 1fr; gap: 28px; } .runtime-metrics { gap: 12px; } .runtime-metric strong { font-size: 17px; } }

/* Expanded content determines the frame height; the graph keeps its return geometry. */
.architecture-layout.has-details > .flow-canvas { position: absolute; inset: 0; visibility: hidden; }
.architecture-layout.has-details .node-details { position: relative; inset: auto; height: auto; min-height: 520px; overflow: hidden; }
.runtime-groups dl { grid-template-columns: max-content minmax(0,1fr); }
.runtime-groups dt { white-space: nowrap; }
.node-details .detail-close:focus:not(:focus-visible) { outline: none; }

/* The expanded card replaces the whole panel, including its heading. */
.live-flow-panel.is-expanded { overflow: hidden; }
.live-flow-panel.is-expanded > .panel-heading,
.live-flow-panel.is-expanded > .flow-caption { display: none; }
.live-flow-panel.is-expanded .architecture-layout { border-radius: inherit; }
.live-flow-panel.is-expanded .node-details { border: 0; border-radius: inherit; margin: 0; }

.architecture-layout.has-details .node-details { min-height: 0; height: auto; }
.node-details .json-view { max-height: 420px; overflow: auto; }

/* Animate composited properties; content layout stays at its final width. */
.node-details { transform-origin: top left; }

/* Reference palette: charcoal surfaces with muted terminal accents. */
:root {
  --bg: #1e2229;
  --panel: #22262e;
  --line: #494e59;
  --muted: #a4a7b0;
  --cyan: #99d7e4;
  --blue: #92b6e8;
  --green: #9bd4ac;
  --violet: #baa9e7;
  color: #e0e1e6;
}
body { background: var(--bg); }
body > aside { background: #20242c; }
.flow-panel, .flow-canvas, .node-details, .system-card,
.module-card, .card, .json-view { background: var(--bg); background-image: none; border-color: var(--line); }
.live-architecture .topology-node > rect:first-child { fill: #20242b; stroke-opacity: .85; stroke-width: 1; }
.live-architecture .topology-node:hover > rect:first-child,
.live-architecture .topology-node:focus > rect:first-child { fill: #292e37; stroke-opacity: 1; stroke-width: 1.5; }
.live-architecture .topology-node.gray > rect:first-child { fill: #20242b; stroke: #626772; }
.live-architecture .central-bus { fill: #20242b; stroke: var(--cyan); }
.live-architecture .bus-port { fill: var(--bg); stroke: #8e95a2; }
.live-architecture .flow-line { stroke: #626772; }
.live-architecture .node-name, .base-capabilities .node-name { fill: #e0e1e6; }
.live-architecture .node-detail, .base-capabilities .node-detail { fill: #a4a7b0; }
.live-architecture [data-controller] > rect:first-child { stroke: var(--violet); }
.live-architecture [data-controller] .node-name { fill: var(--violet); }
.live-architecture .base-capabilities .node-name { fill: var(--cyan); }
.live-architecture .base-module-link rect { fill: #242831; stroke: #626c80; }
.live-architecture .base-module-link text { fill: var(--blue); }
.live-architecture .base-module-link:hover rect,
.live-architecture .base-module-link:focus rect { fill: #303642; stroke: var(--blue); }
.topology-node .summary-track { fill: #363b44; stroke: none; }
.topology-node .summary-fill { fill: var(--green); stroke: none; }
.flow-dot { filter: none; }
.runtime-metrics, .runtime-source { border-color: var(--line); }
.runtime-metric span, .runtime-groups dt, .runtime-source,
.node-details .detail-close { color: var(--muted); }
.runtime-metric strong, .runtime-groups dd { color: #e0e1e6; }

#process-body { padding: 8px 0 28px; }
#process-body > .hint { margin: 14px 0; line-height: 1.6; }
.process-missing { margin: 16px 0; color: var(--muted); font-size: 14px; }
.process-missing summary { cursor: pointer; padding: 8px 0; }
.task-state-bar { display: flex; height: 8px; gap: 3px; margin: 20px 0 10px; background: #353a43; }
.state-segment { flex-basis: 0; background: #666c78; }
.state-segment.open { background: var(--blue); }
.state-segment.claimed { background: var(--cyan); }
.state-segment.done { background: var(--green); }
.state-segment.expired { background: #c9a37b; }
.process-graph { padding: 20px; background: var(--bg); }
.task-node rect { fill: #242831; stroke: var(--blue); }
.task-node:hover rect, .task-node:focus rect { fill: #303642; }
.process-events, .event-log, .process-log { background: var(--panel); padding: 24px; }
.module-filters input, .module-filters select { background: #242831; border-color: var(--line); }
#process-body .table-wrap { margin-top: 20px; padding: 8px 16px; background: var(--panel); }
nav button[aria-current="page"] { background: #2c323d; border-color: #68778c; }

/* Shared controls and data views use the same neutral surfaces as the topology. */
:root { --surface: #242831; --surface-hover: #2d323c; --text: #e0e1e6; }
main table, main .table-wrap { background: var(--bg); border-color: var(--line); }
main table thead, main table th { background: var(--surface); color: #bfc3cd; border-color: var(--line); }
main table td { background: transparent; color: var(--text); border-color: #3b404a; }
main table tbody tr { background: var(--bg); }
main table tbody tr:hover { background: var(--surface-hover); }
main input, main select, main textarea,
main .module-filters input, main .module-filters select { background: var(--surface); color: var(--text); border-color: #535965; }
main input::placeholder, main textarea::placeholder { color: #a4a7b0; }
main button, main .button-link { background: var(--surface); color: #c6d8ea; border-color: #596373; }
main button:hover, main .button-link:hover { background: var(--surface-hover); border-color: var(--blue); }
main .text-button, main .detail-close { background: transparent; color: var(--cyan); }
main .primary { background: #303e45; color: #c6e8e5; border-color: #709794; }
main dialog, main .module-card, main .empty-panel { background: var(--surface); border-color: var(--line); }
main pre, main code { background-color: #242831; color: #c8ccd6; }
main .badge, main .mode-label { background: #2c323b; color: #bdd0e5; border-color: #596373; }

/* Soft daylight palette. Neutral surfaces avoid bright white panels. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e4e9e9; --panel: #dce3e4; --surface: #edf0ee;
  --surface-hover: #d4dfe1; --line: #acbabe; --muted: #596c74;
  --text: #293f49; --cyan: #286876; --blue: #416894;
  --green: #39765c; --violet: #74618d;
  color: var(--text); background: var(--bg);
}
[data-theme="light"] body, [data-theme="light"] main { background: var(--bg); color: var(--text); }
[data-theme="light"] body > aside { background: #d8e0e2; color: var(--text); }
[data-theme="light"] h1, [data-theme="light"] h2, [data-theme="light"] h3,
[data-theme="light"] .brand, [data-theme="light"] nav button { color: var(--text); }
[data-theme="light"] nav button[aria-current="page"] { background: #cadadd; border-color: #7999a3; color: #285d6b; }
[data-theme="light"] .hint, [data-theme="light"] .eyebrow, [data-theme="light"] .caption,
[data-theme="light"] .nav-label, [data-theme="light"] footer { color: var(--muted); }
[data-theme="light"] .node-details, [data-theme="light"] .flow-panel,
[data-theme="light"] .flow-canvas, [data-theme="light"] .process-graph { background: var(--surface); color: var(--text); }
[data-theme="light"] .live-architecture .topology-node > rect:first-child,
[data-theme="light"] .live-architecture .central-bus,
[data-theme="light"] .task-node rect { fill: #e6eceb; }
[data-theme="light"] .live-architecture .topology-node:hover > rect:first-child,
[data-theme="light"] .live-architecture .topology-node:focus > rect:first-child { fill: #d5e2e3; }
[data-theme="light"] .live-architecture .base-module-link rect { fill: #dae4e6; stroke: #90a5af; }
[data-theme="light"] .live-architecture .base-module-link:hover rect { fill: #cbdce1; }
[data-theme="light"] .live-architecture .node-name, [data-theme="light"] .node-value,
[data-theme="light"] .task-node .node-name { fill: #304953; }
[data-theme="light"] .live-architecture .node-detail, [data-theme="light"] .branch-label,
[data-theme="light"] .topology-node.gray .node-code { fill: #63737a; }
[data-theme="light"] .live-architecture .bus-port { fill: var(--surface); }
[data-theme="light"] .runtime-metric strong, [data-theme="light"] .runtime-groups dd,
[data-theme="light"] main table td { color: var(--text); }
[data-theme="light"] main table th { color: #47616d; }
[data-theme="light"] main table td { border-color: #b8c4c8; }
[data-theme="light"] main button, [data-theme="light"] main .button-link { color: #365c70; }
[data-theme="light"] main .primary { background: #ccdfdb; color: #285d55; }
[data-theme="light"] main pre, [data-theme="light"] main code { background: #dce4e5; color: #3e5663; }
[data-theme="light"] .system-card.offline { background: #dee3e3; }
[data-theme="light"] .system-status { color: #45636b; }
[data-theme="light"] input::placeholder { color: #64767d; }

body > aside .account-panel { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 10px; margin-top: auto; padding: 18px 0 0; min-height: 0; border-top: 1px solid var(--line); line-height: 1.5; }
.account-avatar { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 6px; color: var(--cyan); }
.account-identity { display: grid; gap: 4px; min-width: 0; }
.account-identity #actor { color: var(--text); font-size: 14px; overflow-wrap: anywhere; }
.account-identity #account-mode { color: var(--muted); font-size: 14px; }
.account-panel #logout { grid-column: 2; justify-self: start; padding: 5px 0; border: 0; background: transparent; color: var(--cyan); font-size: 14px; }

/* Reading scale shared by both themes. */
body { font-size: 16px; line-height: 1.65; }
nav button { font-size: 15px; min-height: 46px; }
main input, main select, main textarea, main button { font-size: 15px; }
main th, main td { font-size: 15px; line-height: 1.65; }
main .hint, .flow-caption, .module-card .hint { font-size: 14px; line-height: 1.7; }
.runtime-groups dl, .runtime-source, .runtime-metric span { font-size: 15px; }
.live-architecture .node-name { font-size: 16px; }
.live-architecture .node-code { font-size: 14px; letter-spacing: 0; }
.live-architecture .node-detail, .live-architecture .node-value { font-size: 14px; }
.live-architecture .base-module-link text { font-size: 14px; }
.node-details .module-card { text-align: left; padding: 20px; }
.node-details .module-card h3 { margin: 0 0 10px; }

/* Muted light theme: grey surfaces with restrained luminance. */
:root[data-theme="light"] {
  --bg: #c9cece;
  --panel: #c3caca;
  --surface: #d0d5d3;
  --surface-hover: #bcc8ca;
  --line: #98a5a9;
  --muted: #4f626a;
}
[data-theme="light"] body > aside { background: #bdc6c8; }
[data-theme="light"] .live-architecture .topology-node > rect:first-child,
[data-theme="light"] .live-architecture .central-bus,
[data-theme="light"] .task-node rect { fill: #cbd2d0; }
[data-theme="light"] .live-architecture .topology-node:hover > rect:first-child,
[data-theme="light"] .live-architecture .topology-node:focus > rect:first-child { fill: #bacacc; }
[data-theme="light"] .live-architecture .base-module-link rect { fill: #c1cdcf; }
[data-theme="light"] .live-architecture .base-module-link:hover rect { fill: #b3c5ca; }
[data-theme="light"] main pre, [data-theme="light"] main code { background: #c2cccd; }
[data-theme="light"] .system-card.offline { background: #c6cdcc; }

.brand .brand-logo { width: 36px; height: 36px; flex: 0 0 36px; color: var(--cyan); }
main .icon-button { width: 40px; height: 40px; min-width: 40px; padding: 9px; display: inline-grid; place-items: center; }
.icon-button svg { width: 21px; height: 21px; }

/* Consistent readable hierarchy across management views. */
main { font-size: 16px; }
main label, main th, main td, main input, main select, main textarea { font-size: 16px; }
main .hint, main .eyebrow, main small, .caption, .nav-label, .account-identity #account-mode { font-size: 14px; }
main .module-card p, main .detail-value, .runtime-groups dl { font-size: 16px; }
.live-architecture { min-width: 980px; }
.live-architecture .node-name { font-size: 17px; }
.live-architecture .node-code, .live-architecture .node-detail, .live-architecture .node-value { font-size: 13px; letter-spacing: 0; }
.live-architecture .base-module-link text { font-size: 14px; }

.account-panel #admin-signin { grid-column: 2; justify-self: start; padding: 5px 0; border: 0; background: transparent; color: var(--cyan); font-size: 14px; }
