:root {
  --bg: #06101f;
  --bg-soft: #09182d;
  --panel: rgba(12, 30, 55, 0.78);
  --panel-solid: #0b1c34;
  --line: rgba(143, 187, 255, 0.16);
  --line-strong: rgba(143, 187, 255, 0.28);
  --text: #ecf5ff;
  --muted: #91a7bf;
  --brand: #35a7ff;
  --brand-2: #62d6ff;
  --danger: #ff647c;
  --warn: #ffc65a;
  --ok: #52e6a6;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  --radius: 24px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(53, 167, 255, 0.2), transparent 36rem),
    radial-gradient(circle at top right, rgba(98, 214, 255, 0.12), transparent 32rem),
    var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background: transparent;
}

button,
input,
textarea {
  font: inherit;
}

code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  color: #b9e7ff;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero__content,
.panel,
.health-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(12, 30, 55, 0.86), rgba(7, 18, 35, 0.72));
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.hero__content {
  padding: clamp(24px, 4vw, 44px);
}

.eyebrow {
  display: inline-flex;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: #b9e7ff;
  background: rgba(53, 167, 255, 0.1);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 800px;
  margin-bottom: 14px;
  margin-top: 18px;
  font-size: clamp(32px, 6vw, 64px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

h2 {
  margin-bottom: 6px;
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: -0.03em;
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.health-card {
  padding: 24px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.health-card__label,
.metric-card__label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.health-card__status {
  margin-top: 12px;
  font-size: 30px;
  font-weight: 800;
}

.health-card__meta {
  margin-top: 10px;
  color: var(--muted);
  word-break: break-word;
}

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

.is-offline {
  color: var(--danger);
}

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

.panel {
  padding: clamp(18px, 3vw, 28px);
  margin-bottom: 22px;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.check-form,
.bulk-actions {
  display: flex;
  gap: 12px;
}

.bulk-form {
  display: grid;
  gap: 12px;
}

input,
textarea {
  width: 100%;
  color: var(--text);
  background: rgba(2, 10, 24, 0.62);
  border: 1px solid var(--line-strong);
  outline: none;
  border-radius: 16px;
  padding: 14px 16px;
  min-height: 52px;
}

textarea {
  resize: vertical;
  min-height: 170px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  line-height: 1.6;
}

input:focus,
textarea:focus {
  border-color: rgba(98, 214, 255, 0.68);
  box-shadow: 0 0 0 4px rgba(53, 167, 255, 0.13);
}

button {
  border: 0;
  color: #04101f;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  min-height: 52px;
  padding: 0 20px;
  border-radius: 16px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  filter: brightness(1.06);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line-strong);
}

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

.metric-card,
.loading-card,
.error-card,
.empty-card,
.timeline-item {
  border: 1px solid var(--line);
  background: rgba(2, 10, 24, 0.35);
  border-radius: 18px;
  padding: 16px;
}

.metric-card {
  display: grid;
  gap: 10px;
  min-height: 128px;
}

.metric-card strong {
  font-size: 18px;
  word-break: break-word;
}

.metric-card small,
.muted {
  color: var(--muted);
}

.error-card {
  color: #ffd1d8;
  border-color: rgba(255, 100, 124, 0.35);
}

.table-wrap {
  overflow: auto;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
}

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

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: #b9e7ff;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.035);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #dcefff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge--online,
.badge--clear,
.badge--healthy,
.badge--low {
  color: #d8fff0;
  background: rgba(82, 230, 166, 0.11);
  border-color: rgba(82, 230, 166, 0.28);
}

.badge--offline,
.badge--blocked,
.badge--blocked_or_flagged,
.badge--high {
  color: #ffd1d8;
  background: rgba(255, 100, 124, 0.12);
  border-color: rgba(255, 100, 124, 0.28);
}

.badge--indicated,
.badge--attention,
.badge--medium,
.badge--timeout {
  color: #fff1c8;
  background: rgba(255, 198, 90, 0.12);
  border-color: rgba(255, 198, 90, 0.28);
}

.timeline {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.timeline-item > div {
  display: grid;
  gap: 8px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  padding: 14px 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 20;
  width: min(460px, calc(100% - 32px));
  padding: 14px 16px;
  color: var(--text);
  background: #0e213c;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.toast[data-type="warn"] {
  border-color: rgba(255, 198, 90, 0.36);
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 16px;
  }

  .hero,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .check-form,
  .bulk-actions,
  .footer {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .timeline-item {
    align-items: flex-start;
    flex-direction: column;
  }
}
