:root {
  --bg: #f6f8fb;
  --bg-accent: #edf3f8;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-soft: #f8fbfd;
  --panel-strong: #ffffff;
  --border: rgba(125, 147, 166, 0.22);
  --border-strong: rgba(125, 147, 166, 0.34);
  --text: #13232d;
  --muted: #637582;
  --accent: #186d67;
  --accent-strong: #0f5752;
  --accent-soft: rgba(24, 109, 103, 0.10);
  --danger: #a03c48;
  --danger-soft: rgba(160, 60, 72, 0.10);
  --warn: #986126;
  --warn-soft: rgba(152, 97, 38, 0.12);
  --ok: #2f7a4a;
  --ok-soft: rgba(47, 122, 74, 0.10);
  --shadow: 0 18px 44px rgba(19, 35, 45, 0.05);
  --shadow-soft: 0 8px 24px rgba(19, 35, 45, 0.04);
  --radius: 22px;
  --radius-sm: 16px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  line-height: 1.55;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.98), transparent 34%),
    radial-gradient(circle at top right, rgba(216, 235, 244, 0.65), transparent 26%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 100%);
}

a {
  color: var(--accent);
}

code,
.mono,
textarea {
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
}

.page-shell {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}

.brand-block h1 {
  margin: 0;
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 7px 12px;
  border: 1px solid rgba(125, 147, 166, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.brand-subtitle {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.nav a,
.nav button,
.ghost-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
  overflow-wrap: anywhere;
}

.nav a,
.ghost-button {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

.nav a.active {
  border-color: rgba(24, 109, 103, 0.16);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.nav button,
.primary-button {
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 26px rgba(24, 109, 103, 0.18);
}

.nav a:hover,
.ghost-button:hover {
  border-color: var(--border-strong);
  background: #fff;
}

.nav button:hover,
.primary-button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.layout-stack {
  display: grid;
  gap: 18px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 18px;
}

.sites-layout {
  grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
}

.panel,
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.section-gap {
  margin-top: 18px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 253, 0.98)),
    var(--panel);
}

.hero h2,
.panel h2 {
  margin: 0;
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: clamp(26px, 3vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero p,
.panel p,
.small {
  color: var(--muted);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: stretch;
  gap: 10px;
}

.hero-actions form {
  display: flex;
}

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

.stat-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.stat-label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat-value {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: 30px;
  line-height: 1.02;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.stat-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.notice-stack,
.form-stack,
.meta-stack {
  display: grid;
  gap: 12px;
}

.notice {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
  line-height: 1.5;
}

.notice.ok {
  border-color: rgba(47, 122, 74, 0.18);
  background: var(--ok-soft);
  color: var(--ok);
}

.notice.info {
  border-color: rgba(24, 109, 103, 0.16);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.notice.warn {
  border-color: rgba(152, 97, 38, 0.18);
  background: var(--warn-soft);
  color: var(--warn);
}

label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  box-shadow: inset 0 1px 2px rgba(19, 35, 45, 0.02);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(24, 109, 103, 0.42);
  box-shadow:
    0 0 0 4px rgba(24, 109, 103, 0.08),
    inset 0 1px 2px rgba(19, 35, 45, 0.02);
}

textarea {
  min-height: 112px;
  resize: vertical;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(125, 147, 166, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: auto;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(125, 147, 166, 0.14);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(248, 251, 253, 0.96);
}

th.section {
  background: rgba(24, 109, 103, 0.06);
  color: var(--accent-strong);
}

.service {
  font-weight: 700;
  white-space: normal;
}

.badge-list,
.preview-grid {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.preview-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.badge.up {
  border-color: rgba(47, 122, 74, 0.14);
  background: var(--ok-soft);
  color: var(--ok);
}

.badge.warn {
  border-color: rgba(152, 97, 38, 0.16);
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.down {
  border-color: rgba(160, 60, 72, 0.14);
  background: var(--danger-soft);
  color: var(--danger);
}

.preview-trigger {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.preview-tile {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(19, 35, 45, 0.05);
}

.preview-thumb-wrap {
  display: block;
  border: 1px solid rgba(125, 147, 166, 0.18);
  border-radius: 12px;
  overflow: hidden;
  background: #f2f6fa;
}

.preview-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #f2f6fa;
}

.preview-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 12px;
}

.preview-caption {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.preview-card {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 40;
  width: min(680px, calc(100vw - 40px));
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 60px rgba(19, 35, 45, 0.18);
}

.preview-trigger:hover .preview-card {
  display: block;
}

.preview-card img {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border: 1px solid rgba(125, 147, 166, 0.18);
  border-radius: 12px;
  background: #f2f6fa;
}

.preview-missing {
  display: none;
  padding: 12px;
  border-radius: 12px;
  background: #f4f7fa;
  color: var(--muted);
  font-size: 12px;
}

.preview-missing-inline {
  display: block;
}

.preview-meta {
  display: block;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.45;
}

.preview-meta.fresh {
  background: var(--ok-soft);
  color: var(--ok);
}

.preview-meta.stale {
  background: var(--warn-soft);
  color: var(--warn);
}

.preview-url {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.service-table .service-cell {
  min-width: 136px;
}

.service-table .host-cell {
  min-width: 168px;
}

.service-table .host-cell code {
  display: inline-block;
  white-space: normal;
}

.service-table .status-cell {
  min-width: 340px;
}

.service-table .summary-cell {
  min-width: 200px;
}

.summary {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
}

.kv {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.k {
  min-width: 58px;
  color: var(--muted);
}

.inspect {
  margin-top: 9px;
}

.inspect summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}

.probe-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.probe-item {
  padding: 11px 12px;
  border: 1px solid rgba(125, 147, 166, 0.14);
  border-radius: 14px;
  background: rgba(248, 251, 253, 0.95);
}

.probe-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.probe-head strong,
.probe-note,
.probe-meta,
.meta,
.muted-code,
code {
  overflow-wrap: anywhere;
}

.probe-meta,
.probe-note,
.meta,
.small {
  color: var(--muted);
}

.client {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(125, 147, 166, 0.14);
}

.client h3,
.meta {
  overflow-wrap: anywhere;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

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

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 0;
}

.checkbox-pill input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  box-shadow: none;
}

.compact-badges {
  gap: 6px;
}

.danger-button {
  border-color: rgba(160, 60, 72, 0.18);
  color: var(--danger);
}

.danger-button:hover {
  border-color: rgba(160, 60, 72, 0.3);
  background: rgba(160, 60, 72, 0.06);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.auth-card {
  width: min(460px, 100%);
  padding: 30px;
}

.auth-title {
  margin: 0 0 8px;
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: clamp(30px, 4vw, 38px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.auth-form {
  margin-top: 18px;
}

.form-actions {
  margin-top: 4px;
}

.form-actions .primary-button {
  width: 100%;
}

.docs-surface {
  padding: 20px 22px 26px;
}

.docs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.docs-meta .muted-code {
  border-radius: 14px;
}

.docs-content {
  color: var(--text);
}

.docs-content > :first-child {
  margin-top: 0;
}

.docs-content h1,
.docs-content h2,
.docs-content h3 {
  margin: 0 0 14px;
  font-family: "IBM Plex Serif", Georgia, serif;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.docs-content h1 {
  font-size: clamp(36px, 4vw, 44px);
}

.docs-content h2 {
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px solid rgba(125, 147, 166, 0.14);
  font-size: 25px;
}

.docs-content h3 {
  margin-top: 20px;
  font-size: 18px;
}

.docs-content p,
.docs-content li {
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.docs-content ul,
.docs-content ol {
  padding-left: 22px;
}

.docs-content .lede {
  max-width: 920px;
  color: var(--muted);
  font-size: 17px;
}

.docs-content .pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0 8px 10px 0;
  padding: 0 12px;
  border: 1px solid rgba(24, 109, 103, 0.10);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-content .note,
.docs-content .warn,
.docs-content .panel {
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: none;
}

.docs-content .note {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

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

.docs-content .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.docs-content .kv {
  display: block;
  margin: 0;
}

.docs-content .kv dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 700;
}

.docs-content .kv dd {
  margin: 0 0 12px;
}

.docs-content code {
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(19, 35, 45, 0.05);
  font-size: 0.95em;
}

.docs-content pre {
  overflow-x: auto;
  padding: 15px 16px;
  border: 1px solid rgba(19, 35, 45, 0.06);
  border-radius: 16px;
  background: #f4f7fa;
  color: #17232d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.docs-content table {
  min-width: 100%;
  margin-top: 16px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.84);
  table-layout: auto;
}

.docs-content th {
  background: rgba(248, 251, 253, 0.96);
  color: var(--accent-strong);
}

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

.muted-code {
  display: inline-block;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid rgba(125, 147, 166, 0.14);
  border-radius: 999px;
  background: rgba(248, 251, 253, 0.94);
  color: var(--text);
  white-space: normal;
}

.docs-raw-shell {
  max-width: 1180px;
}

.docs-content-raw {
  padding: 8px 0 24px;
}

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

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

  .sites-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding: 18px 0 28px;
  }

  .page-header,
  .hero {
    flex-direction: column;
  }

  .hero {
    padding: 22px 18px;
  }

  .hero-actions {
    width: 100%;
    justify-content: stretch;
  }

  .hero-actions form {
    width: 100%;
  }

  .hero-actions .ghost-button,
  .hero-actions .primary-button {
    flex: 1 1 auto;
  }

  .topbar,
  .nav {
    align-items: stretch;
  }

  .nav a,
  .nav button {
    flex: 1 1 100%;
  }

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

  .docs-surface,
  .panel,
  .auth-card {
    padding: 18px;
  }

  table {
    min-width: 760px;
  }

  .service-table .status-cell,
  .service-table .summary-cell {
    min-width: 180px;
  }

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

  .preview-card {
    left: auto;
    right: 0;
    width: min(88vw, 560px);
  }

  .split-fields {
    grid-template-columns: 1fr;
  }
}
