:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0d1422;
  color: #e8edf6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(160deg, #111b2e 0%, #0d1422 52%, #111827 100%);
}

.diagnostics {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.diagnostics-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 22px;
  border-bottom: 1px solid #334155;
  font-size: 12px;
}
.diagnostics-breadcrumbs a { color: #8fb5ff; white-space: nowrap; text-decoration: none; }
.diagnostics-breadcrumbs a:first-child { flex-shrink: 0; font-weight: 650; }
.diagnostics-breadcrumbs a:hover { text-decoration: underline; }
.diagnostics-breadcrumbs [aria-current] { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 768px) { .diagnostics-breadcrumbs { padding-inline: 12px; } }

.page-header,
.panel,
.notice {
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #8fb5ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 7vw, 3.25rem);
  line-height: 1.08;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.intro,
.notice p,
.panel-heading p,
.privacy {
  color: #b5c0d4;
  line-height: 1.6;
}

.intro {
  max-width: 720px;
  font-size: 1.04rem;
}

.notice,
.panel {
  border: 1px solid #2c3950;
  border-radius: 14px;
  background: rgba(20, 30, 49, 0.94);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.22);
}

.notice {
  padding: 18px 20px;
  border-left: 4px solid #e5a83a;
}

.notice p,
.privacy,
.panel-heading p {
  margin-bottom: 0;
}

.panel {
  padding: 24px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.actions,
.report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

button,
.report-actions a {
  min-height: 44px;
  border: 1px solid #536078;
  border-radius: 8px;
  padding: 10px 14px;
  background: #202c40;
  color: #f4f7fb;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button.primary {
  border-color: #447cec;
  background: #3267cf;
}

button:hover:not(:disabled),
button:focus-visible,
.report-actions a:hover,
.report-actions a:focus-visible {
  border-color: #8fb5ff;
  outline: 3px solid rgba(108, 156, 255, 0.25);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.run-status {
  min-height: 24px;
  margin: 22px 0 12px;
  color: #d7dfed;
}

.script-failure {
  border-left: 3px solid #df6d77;
  padding-left: 12px;
  color: #ffb6bd;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #344158;
  border-radius: 10px;
}

table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #2c3950;
  text-align: left;
  vertical-align: middle;
}

thead th {
  color: #aebbd0;
  background: #18243a;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 750;
}

.badge.idle,
.badge.running {
  background: #303d54;
  color: #d7dfed;
}

.badge.ok {
  background: #153f35;
  color: #8be4c1;
}

.badge.failed {
  background: #51282d;
  color: #ffb6bd;
}

.badge.cancelled {
  background: #4b3a1d;
  color: #f8d28d;
}

.summary {
  display: grid;
  grid-template-columns: 1.25fr 1.5fr 1fr;
  gap: 12px;
  margin: 18px 0;
}

.summary div {
  min-width: 0;
  border: 1px solid #344158;
  border-radius: 9px;
  padding: 12px;
  background: #111b2d;
}

dt {
  margin-bottom: 7px;
  color: #9eabc0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
}

.probe-detail {
  min-width: 190px;
  color: #b8c5d9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.report-actions a {
  margin-left: auto;
  color: #a9c7ff;
  text-decoration: none;
}

.report-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: #aebbd0;
  font-size: 0.9rem;
}

.privacy {
  padding: 0 4px;
  font-size: 0.86rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 680px) {
  .diagnostics {
    width: min(100% - 20px, 920px);
    padding: 24px 0;
  }

  .panel {
    padding: 18px 14px;
  }

  .panel-heading {
    display: block;
  }

  .actions {
    margin-top: 16px;
  }

  .actions button,
  .report-actions button {
    flex: 1 1 140px;
  }

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

  .report-actions a {
    width: 100%;
    margin: 6px 0 0;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}