:root {
  color-scheme: light;
  --bg: #f4f6f7;
  --surface: #ffffff;
  --surface-soft: #f7f9fa;
  --text: #182229;
  --muted: #62727d;
  --border: #d8e0e4;
  --accent: #0d766e;
  --accent-dark: #075e58;
  --ink: #25313a;
  --ok: #0f7b3d;
  --pending: #946200;
  --error: #b42318;
  --blocked: #8a2a0f;
  --warn: #7a4b00;
  --blue: #195b91;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: 34px;
  font-weight: 760;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 18px;
}

h4 {
  font-size: 15px;
}

.status-strip {
  display: grid;
  gap: 2px;
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.status-strip span,
.muted,
.resolved,
.node-foot {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.status-strip strong {
  color: var(--ink);
  font-size: 15px;
}

.panel {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.monitor-panel {
  padding: 20px;
}

.section-head,
.target-head,
.node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-head {
  margin-bottom: 14px;
}

.button-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.section-head .muted,
.target-head .muted {
  margin: 4px 0 0;
}

.target-form,
.check-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  margin-bottom: 16px;
}

.check-form {
  margin-top: 8px;
}

input,
button {
  height: 44px;
  border-radius: 8px;
  font: inherit;
}

input {
  width: 100%;
  border: 1px solid var(--border);
  padding: 0 13px;
  color: var(--text);
  background: var(--surface);
}

input:focus {
  outline: 3px solid rgba(13, 118, 110, 0.18);
  border-color: var(--accent);
}

button {
  border: 0;
  background: var(--accent);
  color: #ffffff;
  font-weight: 750;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.secondary-button {
  width: auto;
  min-width: 100px;
  height: 36px;
  padding: 0 14px;
  color: var(--accent);
  border: 1px solid var(--border);
  background: var(--surface);
}

.secondary-button:hover {
  color: #ffffff;
  background: var(--accent);
}

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

.danger-button:hover {
  color: #ffffff;
  background: var(--error);
  border-color: var(--error);
}

.icon-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover {
  color: #ffffff;
  background: var(--error);
  border-color: var(--error);
}

.target-list {
  display: grid;
  gap: 12px;
}

.target-card,
.node-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.target-card {
  padding: 16px;
}

.node-card {
  min-height: 150px;
  padding: 16px;
}

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

.node-matrix,
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.node-matrix {
  margin-top: 14px;
}

.result-grid {
  margin-top: 12px;
}

.ping-node {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.node-head {
  margin-bottom: 12px;
}

.node-head.compact {
  margin-bottom: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill.ok {
  color: var(--ok);
  background: #e8f5ed;
}

.pill.pending,
.pill.idle {
  color: var(--pending);
  background: #fff4db;
}

.pill.warn {
  color: var(--warn);
  background: #fff4db;
}

.pill.blocked {
  color: var(--blocked);
  background: #fdebd3;
}

.pill.error {
  color: var(--error);
  background: #feecea;
}

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

.ping-metrics div,
.metrics div {
  min-height: 46px;
  padding: 8px 9px;
  border-radius: 8px;
  background: #eef3f5;
}

.ping-metrics span,
.ping-metrics strong,
.metrics span,
.metrics strong,
.metrics small {
  display: block;
}

.ping-metrics span,
.metrics span {
  color: var(--muted);
  font-size: 11px;
}

.ping-metrics strong,
.metrics strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.metrics small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.node-foot {
  margin: 8px 0 0;
}

.verdict-text {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.error-text {
  margin: 10px 0 0;
  color: var(--error);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.form-error {
  margin: 0 0 10px;
}

.resolved {
  margin: 12px 0 0;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .node-matrix,
  .result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1240px);
    padding-top: 24px;
  }

  .topbar,
  .section-head,
  .target-head {
    align-items: stretch;
    flex-direction: column;
  }

  .status-strip {
    width: 100%;
  }

  .target-form,
  .check-form {
    grid-template-columns: 1fr;
  }

  .button-row {
    width: 100%;
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .icon-button {
    width: 100%;
  }

  h1 {
    font-size: 28px;
  }
}
