:root {
  --bg: #10151c;
  --panel: #18202b;
  --panel-2: #1f2937;
  --line: #2c3a4c;
  --text: #eef2f7;
  --muted: #9aa9bd;
  --red: #d92a2a;
  --red-dark: #a71d1d;
  --amber: #f0a92b;
  --green: #2fa25b;
  --blue: #4c8dff;
}

* {
  box-sizing: border-box;
}

/* Several blocks below set `display`, which would otherwise beat the UA
   stylesheet's [hidden] rule and leave hidden sections on screen. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 0.35rem;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

p {
  margin: 0 0 0.75rem;
}

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

.small {
  font-size: 0.85rem;
}

.lead {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* ---------------------------------------------------------------- topbar --- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: #0b0f14;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.topbar__title {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
}

/* ----------------------------------------------------------------- panel --- */

main {
  display: flex;
  justify-content: center;
  padding: 2rem 1.25rem 4rem;
}

.panel {
  width: 100%;
  max-width: 680px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.75rem;
}

#view-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem;
}

.block {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}

.block--warn {
  border-color: rgba(240, 169, 43, 0.5);
  background: rgba(240, 169, 43, 0.07);
}

.block--ok {
  border-color: rgba(47, 162, 91, 0.5);
  background: rgba(47, 162, 91, 0.08);
}

.block--error {
  border-color: rgba(217, 42, 42, 0.55);
  background: rgba(217, 42, 42, 0.08);
}

/* ---------------------------------------------------------------- checks --- */

.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.checks li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--panel-2);
}

.checks li + li {
  border-top: 1px solid var(--line);
}

.check__icon {
  flex: 0 0 1.4rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #06121a;
}

.check__icon--ok {
  background: var(--green);
}

.check__icon--warn {
  background: var(--amber);
}

.check__icon--bad {
  background: var(--red);
  color: #fff;
}

.check__icon--pending {
  background: var(--line);
  color: var(--muted);
}

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

.check__label {
  font-weight: 600;
}

.check__value {
  color: var(--muted);
  font-size: 0.9rem;
  word-break: break-word;
}

/* ----------------------------------------------------------------- rules --- */

.rules {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.rule {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.rule:hover {
  border-color: var(--blue);
}

.rule--selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue) inset;
}

.rule--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.rule input {
  margin-top: 0.3rem;
  accent-color: var(--blue);
}

.rule__target {
  font-weight: 600;
}

/* Addresses read better as monospace; prose options shouldn't. */
.rule__target--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.rule__meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.tag--warn {
  background: rgba(240, 169, 43, 0.2);
  color: var(--amber);
}

.tag--info {
  background: rgba(76, 141, 255, 0.18);
  color: var(--blue);
}

/* --------------------------------------------------------------- buttons --- */

.btn {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  color: #fff;
  background: var(--panel);
}

.btn--primary {
  background: var(--blue);
  color: #04121f;
}

.btn--danger {
  background: var(--red);
}

.btn--ok {
  background: var(--green);
  color: #04140a;
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.buttonrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--blue);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.linkbtn--centred {
  display: block;
  margin: 1.25rem auto 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ------------------------------------------------------------ big button --- */

.bigbutton-wrap {
  display: grid;
  place-items: center;
  padding: 1rem 0 0.5rem;
}

.bigbutton {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 6px solid #7b1414;
  background: radial-gradient(circle at 35% 28%, #ff5b5b, var(--red) 55%, var(--red-dark));
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 12px 0 #6d1111,
    0 18px 32px rgba(0, 0, 0, 0.45);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}

.bigbutton:hover:not(:disabled) {
  transform: translateY(-2px);
}

.bigbutton:active:not(:disabled) {
  transform: translateY(10px);
  box-shadow:
    0 2px 0 #6d1111,
    0 6px 14px rgba(0, 0, 0, 0.5);
}

.bigbutton:disabled {
  cursor: not-allowed;
  filter: grayscale(0.85);
  opacity: 0.5;
  box-shadow: 0 12px 0 #333, 0 18px 32px rgba(0, 0, 0, 0.3);
}

.bigbutton:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 6px;
}

/* --------------------------------------------------------------- notices --- */

.notice {
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  margin: 0.75rem 0;
  font-size: 0.95rem;
}

.notice--error {
  background: rgba(217, 42, 42, 0.14);
  border: 1px solid rgba(217, 42, 42, 0.5);
}

/* ---------------------------------------------------------------- misc ----- */

.plainlist,
.steps {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.plainlist li,
.steps li {
  margin-bottom: 0.35rem;
}

.running__head {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.running__head h2 {
  margin: 0;
}

details {
  margin-top: 1rem;
  font-size: 0.9rem;
}

summary {
  cursor: pointer;
  color: var(--muted);
}

pre {
  margin: 0.6rem 0 0;
  padding: 0.75rem;
  background: #0b0f14;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
  color: #cbd6e4;
  max-height: 320px;
}

.spinner {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 3px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 3s;
  }
  .bigbutton {
    transition: none;
  }
}

@media (max-width: 520px) {
  .panel {
    padding: 1.25rem;
  }
  .bigbutton {
    width: 180px;
    height: 180px;
    font-size: 1.25rem;
  }
}
