:root {
  color-scheme: light;
  --ink: #142438;
  --muted: #506176;
  --nav: #11283a;
  --nav-accent: #234456;
  --nav-text: #e2edf1;
  --accent: #096b56;
  --accent-hover: #075744;
  --accent-soft: #def3ea;
  --border: #d9e3e8;
  --background: #f2f6f7;
  --surface: #fff;
  --error: #8f2427;
  --radius: 15px;
  font-family: "DM Sans", "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--ink); line-height: 1.6; }
button, select, textarea, input { font: inherit; }
button, .button { text-decoration: none; cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid #1e77bd; outline-offset: 3px; }
.skip { position: fixed; inset-block-start: 8px; inset-inline-start: -100vw; z-index: 2; padding: 8px 12px; background: var(--surface); }
.skip:focus { inset-inline-start: 8px; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar { background: var(--nav); color: var(--nav-text); min-height: 100vh; display: flex; flex-direction: column; padding: 27px 17px 20px; gap: 33px; }
.brand { display: flex; align-items: center; gap: 11px; padding-inline: 5px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.05rem; color: #fff; text-align: right; }
.brand small { font-size: .74rem; color: #bfd1d9; }
.brand-mark { width: 34px; height: 34px; flex: 0 0 34px; display: flex; flex-direction: row; justify-content: center; align-items: end; gap: 3px; padding: 8px; background: #b9e9d6; border-radius: 9px; }
.brand-mark i { width: 4px; border-radius: 2px; background: #0b634f; height: 16px; }
.brand-mark i:nth-child(2) { height: 12px; }
.brand-mark i:nth-child(3) { height: 8px; }
.nav { display: flex; flex-direction: column; gap: 5px; }
.nav button { text-align: start; color: var(--nav-text); font-weight: 600; background: transparent; border: 1px solid transparent; padding: 8px 12px; }
.nav button:hover { background: #193647; }
.nav button[aria-current] { background: var(--nav-accent); color: white; border-inline-start: 3px solid #8fe2bf; }
.session { margin-top: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 13px 6px 0; border-top: 1px solid #395366; font-size: .83rem; }
.session-indicator { border-radius: 50%; background: #b6c5cc; width: 8px; height: 8px; }
.session.connected .session-indicator { background: #7ae8b4; }
.session button.quiet { color: white; border-color: #577181; background: transparent; }
.session button.quiet:hover { background: #193647; }
main { width: 100%; max-width: 1460px; min-width: 0; padding: clamp(22px, 4vw, 52px); }
.panel { width: 100%; }
.page-title { margin: 0 0 26px; }
.page-title h1 { margin: 0 0 3px; font-size: clamp(1.85rem, 4vw, 2.6rem); line-height: 1.15; letter-spacing: -.035em; }
.page-title p, .section-heading p { color: var(--muted); margin: 0; }
.card { min-width: 0; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 2px #14243806; }
.section-heading { margin-bottom: 15px; }
.section-heading h2, .section-heading h3 { font-size: 1.23rem; margin: 0 0 3px; }
.section-heading p, .hint { font-size: .88rem; }
.row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.connection { max-width: 700px; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; min-width: 0; }
.channel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.channel { padding: 15px 17px; display: flex; flex-direction: column; gap: 6px; }
.channel > strong { font-size: 1.15rem; text-align: start; }
.channel > span { color: var(--muted); font-size: .86rem; }
.channel > .channel-mark { width: 20px; height: 4px; background: var(--accent); border-radius: 4px; margin-block-end: 4px; }
.table-card { margin-block-start: 16px; }
.admin-health { margin-block-end: 16px; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: 8px; margin: 0; }
.health-grid > div { display: grid; gap: 2px; background: #f1f6f7; border-radius: 8px; padding: 7px 10px; }
.health-grid dt { color: var(--muted); font-size: .82rem; }
.health-grid dd { margin: 0; font-weight: 700; font-size: 1.14rem; }
.table-wrap { overflow-x: auto; min-width: 0; }
.table-wrap:not(:empty) { margin-block-start: 13px; }
table { width: 100%; border-collapse: collapse; text-align: start; font-size: .9rem; }
thead { color: var(--muted); background: #f1f6f7; }
th, td { text-align: start; padding: 10px 9px; border-block-end: 1px solid var(--border); }
th { white-space: nowrap; }
td bdi { overflow-wrap: anywhere; }
td:last-child { min-width: max-content; }
.tag { display: inline-flex; align-items: center; border-radius: 99px; padding: 2px 8px; color: #344e60; background: #edf2f4; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.tag-good { color: #165a48; background: #e3f4eb; }
.tag-danger { color: var(--error); background: #faecec; }
.empty { font-size: .92rem; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-line { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.span { grid-column: 1 / -1; }
label { display: grid; gap: 5px; font-weight: 600; font-size: .93rem; min-width: 0; }
label .hint { font-weight: 400; color: var(--muted); }
input:not([type=checkbox]), select, textarea { width: 100%; border: 1px solid #a9bdc7; border-radius: 8px; padding: 7px 9px; min-height: 39px; background: var(--surface); color: var(--ink); }
input[dir=ltr], textarea[dir=ltr] { font-size: .9rem; }
textarea { resize: vertical; }
select:disabled, input:disabled { background: #edf2f4; }
button, .button { display: inline-block; min-height: 39px; padding: 7px 15px; border-radius: 8px; border: 1px solid var(--accent); color: white; background: var(--accent); font-weight: 650; text-align: center; }
button:hover, .button:hover { background: var(--accent-hover); }
button:disabled { opacity: .55; cursor: default; }
.quiet { background: var(--surface); color: var(--accent); border-color: #aac5bd; }
.quiet:hover { background: #edf7f3; }
.small { min-height: 30px; padding: 3px 8px; font-size: .79rem; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.notice { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: .9rem; background: #edf5f3; color: #165a48; overflow-wrap: anywhere; }
.notice.error { background: #faecec; color: var(--error); }
.detail { display: grid; gap: 7px; }
.detail:not(:empty) { margin-block-start: 14px; }
.detail-row { display: grid; grid-template-columns: minmax(85px, auto) minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: .88rem; }
.detail-row code, pre { background: #f1f6f7; padding: 6px 8px; border-radius: 5px; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.detail-row span { color: var(--muted); }
.resource-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 20px; margin-block: 22px 10px; }
.resource-heading h2 { margin: 0; }
.resource-heading label { min-width: min(100%, 225px); }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
legend { padding-inline: 4px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { accent-color: var(--accent); }
.docs { margin-bottom: 13px; }
.docs ol { padding-inline-start: 24px; }
.docs code { unicode-bidi: isolate; }
.docs pre { user-select: auto; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 205px minmax(0, 1fr); }
  .columns { grid-template-columns: minmax(0, 1fr); }
  .admin-resources { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .shell { display: block; }
  .sidebar { min-height: 0; padding: 12px 14px; gap: 10px; }
  .brand { padding: 0; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 3px; }
  .nav button { padding: 5px 8px; min-height: 33px; font-size: .85rem; }
  .session { margin: 0; padding: 7px 0 0; }
  .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-resources { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; }
}

@media (max-width: 405px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-row { grid-template-columns: minmax(0, 1fr) auto; }
  .detail-row > span { grid-column: 1 / -1; }
}
