:root {
  color-scheme: dark;
  --bg: #0a0d13;
  --side: #0d1119;
  --surface: #121722;
  --surface-2: #171d2a;
  --surface-3: #1e2534;
  --line: #222a3a;
  --line-strong: #2f394d;
  --text: #e9edf5;
  --muted: #8f9bb0;
  --faint: #66728a;
  --accent: #3b82f6;
  --accent-hover: #5a97f8;
  --accent-ink: #ffffff;
  --accent-soft: #13233f;
  --accent-text: #8ab6ff;
  --good: #34d399;
  --good-soft: #10291f;
  --warn: #fbbf24;
  --warn-soft: #2c2410;
  --danger: #f87171;
  --danger-soft: #2f1719;
  --radius: 10px;
  --radius-sm: 7px;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

h1 {
  font: 600 24px/1.2 var(--display);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 15px;
  font-weight: 600;
}

a {
  color: inherit;
}

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

svg.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}

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

.hidden {
  display: none !important;
}

.gate {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 16px 12vh;
}

.gate-box {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px 30px 28px;
}

.gate-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 26px;
  font: 600 17px var(--display);
  letter-spacing: -0.01em;
}

.mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font: 700 18px var(--display);
  flex: none;
}

.gate-box h1 {
  font-size: 21px;
  margin-bottom: 6px;
}

.gate-box .lead {
  color: var(--muted);
  margin-bottom: 22px;
}

.gate-foot {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--faint);
  text-align: center;
}

.shell {
  min-height: 100%;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}

.side {
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 22px;
  font: 600 16px var(--display);
  letter-spacing: -0.01em;
}

.brand .mark {
  width: 30px;
  height: 30px;
  font-size: 16px;
  border-radius: 8px;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 10px 8px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav a.current {
  color: var(--accent-ink);
  background: var(--accent);
}

.side-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-weight: 600;
  text-transform: uppercase;
  flex: none;
}

.who {
  min-width: 0;
  flex: 1;
}

.who strong {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.who span {
  display: block;
  font-size: 12px;
  color: var(--faint);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 0;
  background: none;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.icon-btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.main {
  padding: 30px 38px 64px;
  max-width: 1180px;
  width: 100%;
}

.crumbs {
  font-size: 13px;
  color: var(--faint);
  margin-bottom: 12px;
}

.crumbs a {
  text-decoration: none;
  color: var(--muted);
}

.crumbs a:hover {
  color: var(--text);
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-head p {
  color: var(--muted);
  margin-top: 6px;
  max-width: 64ch;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
}

.btn:hover {
  background: var(--surface-3);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

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

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

.btn.danger {
  color: var(--danger);
  border-color: #4a2427;
  background: var(--danger-soft);
}

.btn.danger:hover {
  background: #3b1c1f;
}

.btn.wide {
  width: 100%;
  height: 42px;
}

.btn.small {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
}

.btn.small svg.icon {
  width: 15px;
  height: 15px;
}

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

.field {
  display: block;
  margin-bottom: 16px;
}

.field > span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field small {
  display: block;
  color: var(--faint);
  font-size: 12.5px;
  margin-top: 6px;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}

input[type="text"],
input[type="password"] {
  height: 40px;
}

input:disabled {
  color: var(--faint);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  margin: 0;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
}

.error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #4a2427;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

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

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  flex: none;
}

.stat-icon svg.icon {
  width: 21px;
  height: 21px;
}

.stat-value {
  font: 600 26px/1.1 var(--display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel + .panel {
  margin-top: 16px;
}

.grid-2 > .panel + .panel {
  margin-top: 0;
}

.panel-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.panel-body {
  padding: 18px;
}

.panel-body.narrow {
  max-width: 480px;
}

.stack > * + * {
  margin-top: 14px;
}

.chart {
  position: relative;
  padding: 14px 18px 12px;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart .grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.chart .axis-text {
  fill: var(--faint);
  font: 11px var(--sans);
}

.chart .bar {
  fill: var(--accent);
}

.chart .bar.zero {
  fill: var(--line-strong);
}

.chart .hit {
  fill: transparent;
}

.chart .hit:hover + .bar,
.chart .hit:hover ~ .bar-of {
  fill: var(--accent-hover);
}

.chart-tip {
  position: absolute;
  pointer-events: none;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12.5px;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  z-index: 5;
}

.chart-tip strong {
  display: block;
  font-variant-numeric: tabular-nums;
}

.chart-tip span {
  color: var(--muted);
}

.feed {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.feed li {
  display: flex;
  gap: 12px;
  padding: 10px 18px;
}

.feed .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 7px;
  flex: none;
}

.feed .what {
  font-weight: 500;
}

.feed .when {
  color: var(--faint);
  font-size: 12.5px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  display: block;
  cursor: pointer;
}

.card:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 14px;
}

.tile {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font: 700 17px var(--display);
  letter-spacing: -0.02em;
  flex: none;
}

.tile.big {
  width: 54px;
  height: 54px;
  font-size: 21px;
  border-radius: 13px;
}

.card-name {
  font: 600 16px var(--display);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-slug {
  color: var(--faint);
}

.card-desc {
  color: var(--muted);
  font-size: 13px;
  min-height: 39px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.card-foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.card-foot svg.icon {
  width: 15px;
  height: 15px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  white-space: nowrap;
}

.pill.good {
  background: var(--good-soft);
  color: var(--good);
}

.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--surface-2);
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

td.actions {
  text-align: right;
  white-space: nowrap;
}

td.actions > * {
  vertical-align: middle;
  margin-left: 6px;
}

td.actions .icon-btn {
  display: inline-grid;
}

.version {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.notes {
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 46ch;
}

.empty {
  padding: 54px 18px;
  text-align: center;
  color: var(--muted);
}

.empty .stat-icon {
  margin: 0 auto 14px;
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.empty strong {
  display: block;
  color: var(--text);
  font: 600 16px var(--display);
  margin-bottom: 4px;
}

.empty .btn {
  margin-top: 18px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: fit-content;
}

.tabs button {
  background: none;
  border: 0;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
}

.tabs button:hover {
  color: var(--text);
}

.tabs button.current {
  color: var(--accent-ink);
  background: var(--accent);
}

.steps {
  counter-reset: step;
}

.step {
  position: relative;
  padding: 18px 18px 18px 62px;
  border-bottom: 1px solid var(--line);
}

.step:last-child {
  border-bottom: 0;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.step p {
  color: var(--muted);
  margin: 3px 0 14px;
  max-width: 70ch;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  max-width: 480px;
}

.inline-form .btn {
  height: 40px;
}

.code {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.code pre {
  margin: 0;
  padding: 14px 16px;
  padding-right: 96px;
  overflow: auto;
  max-height: 360px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  tab-size: 4;
  color: #c9d3e6;
}

.code .btn {
  position: absolute;
  top: 9px;
  right: 9px;
}

.danger-zone {
  border-color: #4a2427;
}

dialog {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 0;
  width: min(500px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

dialog::backdrop {
  background: rgba(4, 6, 10, 0.72);
}

.dialog-head {
  padding: 22px 24px 0;
}

.dialog-head h2 {
  font: 600 18px var(--display);
}

.dialog-head p {
  color: var(--muted);
  margin-top: 5px;
}

.dialog-body {
  padding: 20px 24px 6px;
}

.dialog-foot {
  padding: 12px 24px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-body .dialog-foot {
  padding: 6px 0 16px;
}

.dialog-foot:empty {
  display: none;
}

.drop {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 24px 18px;
  text-align: center;
  color: var(--muted);
  margin-bottom: 16px;
  cursor: pointer;
  background: var(--bg);
}

.drop:hover,
.drop.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop svg.icon {
  width: 26px;
  height: 26px;
  color: var(--accent-text);
  display: block;
  margin: 0 auto 8px;
}

.drop strong {
  color: var(--text);
  font-weight: 600;
}

progress {
  width: 100%;
  height: 6px;
  margin-bottom: 16px;
  accent-color: var(--accent);
}

#toasts {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}

.toast {
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--good);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  max-width: 360px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.toast.bad {
  border-left-color: var(--danger);
}

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

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

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }

  .brand {
    padding: 0;
  }

  .brand span,
  .nav-label,
  .who {
    display: none;
  }

  .nav {
    flex-direction: row;
  }

  .nav a span {
    display: none;
  }

  .side-foot {
    margin: 0 0 0 auto;
    padding: 4px;
  }

  .main {
    padding: 20px 14px 48px;
  }

  .hide-narrow {
    display: none;
  }

  .panel {
    overflow-x: auto;
  }

  .page-head {
    flex-direction: column;
  }
}

.chart .bar.hover {
  fill: var(--accent-hover);
}

.pill.off {
  background: var(--surface-3);
  color: var(--muted);
}

h1 .pill {
  vertical-align: 4px;
  margin-left: 6px;
  font-family: var(--sans);
  letter-spacing: 0;
}

.tile.small {
  width: 34px;
  height: 34px;
  font-size: 13px;
  border-radius: 9px;
  text-decoration: none;
}

.feed .meter-row {
  align-items: center;
}

.meter-main {
  flex: 1;
  min-width: 0;
}

.meter-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.meter-top a {
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter-top a:hover {
  color: var(--accent-text);
}

.meter-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.meter-value small {
  color: var(--faint);
  font-weight: 400;
  font-size: 12.5px;
}

.meter {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  min-width: 0;
}
