:root {
  color-scheme: dark;
  --bg: #0d1117;
  --surface: #141a21;
  --surface-2: #1b232c;
  --surface-3: #222c36;
  --line: #303b47;
  --text: #f3f7fb;
  --muted: #9facba;
  --soft: #c9d4de;
  --brand: #39c980;
  --accent: #62a8ea;
  --ok: #39c980;
  --warn: #f1b84b;
  --error: #f25f5c;
  --info: #62a8ea;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", Inter, Arial, sans-serif;
}

a {
  color: inherit;
}

button,
.button,
.service-nav a,
.action-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  padding: 7px 11px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover,
.service-nav a:hover,
.action-link:hover {
  border-color: var(--accent);
  color: #dcefff;
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

button.danger,
.button.danger {
  border-color: color-mix(in srgb, var(--error) 55%, var(--line));
  color: #ffd7d6;
}

button.warn-action,
.button.warn-action {
  border-color: color-mix(in srgb, var(--warn) 55%, var(--line));
  color: #ffe7ad;
}

input[type="text"] {
  width: min(100%, 360px);
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text);
  padding: 7px 10px;
  font: inherit;
}

input[type="checkbox"] {
  transform: translateY(1px);
}

pre {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090d12;
  color: #dcefff;
  padding: 14px;
  margin-top: 10px;
  font: 13px/1.45 Consolas, "Cascadia Mono", monospace;
  white-space: pre-wrap;
}

details {
  margin-top: 10px;
}

summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

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

h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

h3 {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

code {
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid #3b4652;
  border-radius: 6px;
  background: #090d12;
  color: #e7f7ff;
  padding: 10px 12px;
  font: 14px/1.45 Consolas, "Cascadia Mono", monospace;
}

.page-shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.service-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.eyebrow {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.subtitle,
.stamp,
.note,
.muted {
  color: var(--muted);
}

.subtitle {
  margin-top: 7px;
  max-width: 760px;
}

.stamp {
  font-size: 14px;
  text-align: right;
}

.service-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.service-nav a[aria-current="page"] {
  border-color: color-mix(in srgb, var(--brand) 70%, var(--line));
  background: color-mix(in srgb, var(--brand) 16%, var(--surface-2));
  color: #dcffe9;
}

.service-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

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

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

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

.metric span {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  line-height: 1;
}

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

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

.grid.sidebar {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
}

.card,
.panel {
  padding: 16px;
}

.panel {
  overflow: hidden;
  padding: 0;
}

.panel h2 {
  border-bottom: 1px solid var(--line);
  margin: 0;
  padding: 14px 16px;
}

.wide {
  grid-column: 1 / -1;
}

.rows {
  display: grid;
  gap: 10px;
}

.row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
}

.label {
  color: var(--muted);
  font-weight: 700;
}

.value {
  overflow-wrap: anywhere;
}

.chips,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions {
  margin-top: 12px;
}

.command-board {
  display: grid;
  gap: 12px;
}

.command-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
}

.command-group p {
  color: var(--muted);
  margin-top: 6px;
}

.command-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.chip {
  min-height: 30px;
  padding: 4px 9px;
}

.pill {
  min-width: 76px;
  padding: 3px 8px;
  text-transform: uppercase;
}

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

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

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

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

.notice {
  border: 1px solid color-mix(in srgb, var(--warn) 55%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
  color: #fff2c2;
  margin-bottom: 16px;
  padding: 14px 16px;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.panel table th,
.panel table td {
  padding: 10px 12px;
}

.alerts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.alerts li {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.alerts strong {
  display: block;
  margin-bottom: 4px;
}

.alerts p {
  color: var(--muted);
  margin: 0;
}

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

.link-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px 12px;
}

.link-list a {
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.link-list a:hover {
  color: #dcefff;
}

.link-list span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.empty {
  color: var(--muted);
  padding: 16px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  margin-top: 12px;
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 24px, 1280px);
    padding-top: 14px;
  }

  .service-header,
  .grid,
  .grid.sidebar {
    grid-template-columns: 1fr;
  }

  .service-actions {
    justify-content: flex-start;
  }

  .stamp {
    text-align: left;
  }

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

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

  .link-list li {
    grid-template-columns: 1fr;
  }
}

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

  .service-nav a,
  button,
  .button,
  .action-link {
    width: 100%;
  }
}
