:root {
  color-scheme: dark;
  --bg: #101612;
  --surface: #19211c;
  --raised: #202b23;
  --line: #344039;
  --text: #f1f2e9;
  --muted: #a4b3a6;
  --lime: #d1f98a;
  --danger: #ffb4a5;
  --amber: #f0cf88;
  font:
    15px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 8px;
}
button {
  background: var(--raised);
  color: var(--text);
  padding: 9px 14px;
  cursor: pointer;
  min-height: 42px;
}
button:hover:not(:disabled) {
  background: #334331;
  border-color: #69835d;
}
button.primary {
  background: var(--lime);
  color: #17220f;
  border-color: var(--lime);
  font-weight: 650;
}
button.primary:hover:not(:disabled) {
  background: #e1ffb2;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button.quiet {
  background: transparent;
}
button.danger {
  color: var(--danger);
}
:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}
input,
textarea,
select {
  background: var(--bg);
  color: var(--text);
  padding: 11px 12px;
  width: 100%;
}
textarea {
  min-height: 140px;
  resize: vertical;
  font:
    13px/1.6 ui-monospace,
    SFMono-Regular,
    monospace;
}
label {
  display: block;
  margin: 15px 0 7px;
  color: var(--muted);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 31px;
  letter-spacing: -0.8px;
  font-weight: 650;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 16px;
}
small,
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--lime);
}
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}
aside {
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.brand img {
  width: 43px;
  height: 43px;
}
.brand strong {
  display: block;
  font-size: 15px;
}
.brand span {
  color: var(--muted);
  font-size: 12px;
}
nav {
  display: grid;
  gap: 6px;
}
nav button {
  text-align: left;
  border: 0;
}
nav button.active {
  background: var(--raised);
  color: var(--lime);
}
.sidebar-note {
  margin-top: auto;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
main {
  padding: 32px 40px 60px;
  min-width: 0;
  max-width: 1600px;
  width: 100%;
  margin: auto;
  align-self: start;
}
.topline,
.heading,
.section-title,
.actions,
.router-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topline {
  margin-bottom: 32px;
}
.actions {
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}
.heading {
  align-items: end;
  margin-bottom: 28px;
}
.heading p {
  margin-top: 8px;
  color: var(--muted);
  max-width: 600px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.badge.good {
  color: var(--lime);
  background: #d1f98a0c;
}
.badge.warn {
  color: var(--amber);
}
.badge.bad {
  color: var(--danger);
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.banner {
  padding: 13px 17px;
  background: #d1f98a0a;
  border: 1px solid #d1f98a28;
  border-radius: 9px;
  color: #c1d2b1;
  margin-bottom: 26px;
  font-size: 13px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 24px 0 30px;
}
.stat {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.stat strong {
  display: block;
  font-size: 30px;
  font-weight: 500;
}
.stat span {
  color: var(--muted);
  font-size: 13px;
}
.toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
}
.toolbar input {
  max-width: 400px;
}
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
}
.router-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 1fr 1fr auto;
  gap: 20px;
  padding: 22px;
  align-items: center;
}
.router-row + .router-row {
  border-top: 1px solid var(--line);
}
.router-row small {
  display: block;
  margin-top: 5px;
}
.section-title {
  margin: 30px 0 15px;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.profile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 21px;
  min-width: 0;
}
.profile .number {
  font:
    11px ui-monospace,
    monospace;
  color: var(--muted);
  margin-bottom: 22px;
}
.profile .protocol {
  color: var(--lime);
  font-size: 11px;
  letter-spacing: 1px;
}
.profile h3 {
  font-size: 20px;
  margin: 5px 0 3px;
}
.profile dl {
  margin: 23px 0;
  font-size: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.endpoint-port {
  display: inline-block;
  white-space: nowrap;
  overflow-wrap: normal;
}
.profile .actions {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.profile .actions button {
  flex: 1;
  font-size: 13px;
}
.profile .router-name button {
  flex: 0;
  min-width: 34px;
  min-height: 34px;
  padding: 6px;
  border-color: transparent;
}
.profile .actions .danger {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 4px 0;
  border: 0;
}
.history-row {
  padding: 18px 22px;
  border-top: 1px solid var(--line);
}
.history-row:first-child {
  border-top: 0;
}
.history-row .actions {
  justify-content: space-between;
}
.events {
  padding: 14px 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}
.events li {
  padding: 4px 0;
}
.empty {
  padding: 36px 24px;
  text-align: center;
  color: var(--muted);
}
.error {
  color: var(--danger);
  padding: 12px 0;
  white-space: pre-line;
}
.login {
  width: min(460px, calc(100% - 32px));
  margin: 10vh auto;
  padding: 32px;
}
.login h1 {
  margin: 28px 0 8px;
}
.login button[type="submit"] {
  width: 100%;
  margin: 22px 0;
}
.login .actions {
  margin-top: 20px;
}
dialog {
  width: min(720px, calc(100% - 28px));
  max-height: 90vh;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 15px;
  padding: 26px;
}
dialog::backdrop {
  background: #050a08c9;
  backdrop-filter: blur(4px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}
.dialog-head h2 {
  margin-top: 7px;
}
.dialog-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: -26px;
  background: var(--surface);
  padding-bottom: 16px;
  z-index: 1;
}
.selection {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
  cursor: pointer;
}
.selection input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.selection small {
  display: block;
}
.change {
  margin: 16px 0;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.change strong {
  display: block;
  margin-bottom: 6px;
}
.change p {
  overflow-wrap: anywhere;
  font-size: 13px;
  color: var(--muted);
}
.preserved {
  font-size: 13px;
  color: var(--muted);
  margin: 16px 0;
}
.job-progress {
  border-left: 2px solid var(--lime);
  padding: 8px 14px;
  margin: 18px 0;
}
#notice {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: min(440px, calc(100vw - 40px));
  padding: 0;
  background: var(--raised);
  border-radius: 10px;
  z-index: 5;
}
#notice:not(:empty) {
  padding: 16px 20px;
  border: 1px solid var(--line);
}
.skip {
  position: fixed;
  left: 15px;
  top: -80px;
  padding: 10px;
  background: var(--lime);
  color: var(--bg);
  z-index: 10;
}
.skip:focus {
  top: 10px;
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  main {
    padding: 26px;
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .profile dl {
    grid-template-columns: 120px 1fr;
  }
  .router-row {
    grid-template-columns: 1fr auto;
  }
  .router-row .router-meta {
    display: none;
  }
}

@media (max-width: 640px) {
  .shell {
    display: block;
  }
  aside {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px 20px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  aside nav,
  .sidebar-note {
    display: none;
  }
  main {
    padding: 22px 18px;
  }
  .topline {
    margin-bottom: 24px;
    flex-wrap: wrap;
  }
  .heading {
    display: block;
  }
  .heading .actions {
    margin-top: 18px;
  }
  h1 {
    font-size: 26px;
  }
  .stats {
    gap: 12px;
  }
  .stat strong {
    font-size: 25px;
  }
  .router-row {
    padding: 18px;
    gap: 12px;
  }
  .router-row button {
    padding: 8px 12px;
  }
  dialog {
    padding: 20px;
  }
  .dialog-footer {
    bottom: -20px;
  }
  .section-title {
    align-items: start;
  }
}
