/* Steady — design tokens & base styles.
 * Lifted from design/steady/styles.css (the design exploration). Kept in sync by
 * hand for now; the server-rendered templates use these tokens directly so the
 * shipped UI matches the design source of truth. */

:root {
  /* Light mode (default) */
  --bg: oklch(98% 0.008 80);
  --bg-sunken: oklch(96% 0.008 80);
  --surface: #ffffff;
  --surface-2: oklch(99% 0.005 80);
  --ink: oklch(20% 0.01 60);
  --ink-2: oklch(35% 0.01 60);
  --ink-muted: oklch(52% 0.01 60);
  --ink-faint: oklch(68% 0.008 60);
  --border: oklch(91% 0.006 80);
  --border-strong: oklch(85% 0.006 80);
  --hairline: oklch(94% 0.005 80);

  --accent: oklch(68% 0.16 145);          /* up / green */
  --accent-ink: oklch(35% 0.13 145);
  --accent-soft: oklch(94% 0.05 145);
  --down: oklch(62% 0.22 25);             /* down / red */
  --down-soft: oklch(94% 0.05 25);
  --warn: oklch(78% 0.16 75);             /* degraded / amber */
  --warn-soft: oklch(95% 0.06 75);

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
}

[data-theme="dark"] {
  --bg: oklch(16% 0.008 60);
  --bg-sunken: oklch(13% 0.008 60);
  --surface: oklch(20% 0.008 60);
  --surface-2: oklch(23% 0.008 60);
  --ink: oklch(95% 0.005 80);
  --ink-2: oklch(82% 0.006 80);
  --ink-muted: oklch(65% 0.006 80);
  --ink-faint: oklch(48% 0.006 80);
  --border: oklch(28% 0.008 60);
  --border-strong: oklch(35% 0.008 60);
  --hairline: oklch(24% 0.008 60);

  --accent: oklch(75% 0.18 145);
  --accent-ink: oklch(85% 0.16 145);
  --accent-soft: oklch(30% 0.08 145);
  --down: oklch(70% 0.22 25);
  --down-soft: oklch(32% 0.1 25);
  --warn: oklch(82% 0.16 75);
  --warn-soft: oklch(32% 0.08 75);
}

html, body { margin: 0; padding: 0; min-height: 100%; }

.steady {
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: -0.005em;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}
.steady * { box-sizing: border-box; }
.steady .mono { font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace; }
.steady .serif { font-family: "Instrument Serif", "Iowan Old Style", Georgia, serif; font-style: normal; letter-spacing: -0.015em; }
.steady .display { font-family: "Instrument Serif", serif; font-weight: 400; letter-spacing: -0.02em; line-height: 1.02; }

/* Pulse animation for live status dot */
@keyframes steady-pulse {
  0%   { transform: scale(1);   opacity: 0.5; }
  70%  { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}
.steady .pulse-dot {
  position: relative;
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}
.steady .pulse-dot::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: steady-pulse 2.2s ease-out infinite;
}
.steady .pulse-dot.down { background: var(--down); }
.steady .pulse-dot.down::after { background: var(--down); }
.steady .pulse-dot.warn { background: var(--warn); }
.steady .pulse-dot.warn::after { background: var(--warn); }

/* Sticker / chip */
.steady .chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
  background: var(--bg-sunken); color: var(--ink-2);
  border: 1px solid var(--border);
}
.steady .chip.up    { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.steady .chip.down  { background: var(--down-soft);   color: var(--down);       border-color: transparent; }
.steady .chip.warn  { background: var(--warn-soft);   color: oklch(45% 0.14 65); border-color: transparent; }

.steady .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: var(--radius);
  font-size: 13.5px; font-weight: 500;
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink);
  cursor: pointer; transition: background .12s;
  text-decoration: none;
}
.steady .btn:hover { background: var(--bg-sunken); }
.steady .btn.primary {
  background: var(--ink); color: var(--bg);
  border-color: var(--ink);
}
.steady .btn.primary:hover { background: var(--ink-2); }
.steady .btn.ghost { background: transparent; border-color: transparent; }
.steady .btn.ghost:hover { background: var(--bg-sunken); }
.steady .btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }

.steady .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* Form controls — text/url/number inputs and selects share .input. Tagged
 * onto Django widgets in MonitorForm. */
.steady .input {
  width: 100%;
  height: 36px; padding: 0 11px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.steady select.input { padding: 0 8px; }
.steady .input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.steady .input::placeholder { color: var(--ink-faint); }

.steady a { color: inherit; text-decoration: none; }
.steady a.link { border-bottom: 1px solid var(--border-strong); }
.steady a.link:hover { border-bottom-color: var(--ink); }

.steady ::selection { background: oklch(68% 0.16 145 / 0.3); }

/* Tiny icon style consistent across screens */
.steady .ico {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.steady .ico.lg { width: 20px; height: 20px; stroke-width: 1.5; }
.steady .ico.sm { width: 13px; height: 13px; }

/* Django messages framework — rendered as a stack of chips under the nav. */
.steady .messages { list-style: none; margin: 0; padding: 12px 64px 0; display: flex; flex-direction: column; gap: 8px; }
.steady .messages li { align-self: flex-start; }

/* ── Dashboard: monitor list ──────────────────────────────────────────────
 * Desktop is a 4-column grid (name / status / response / last-checked); on
 * narrow screens each row reflows into a stacked card with labelled values
 * (the fixed grid is ~780px wide and overflowed phones otherwise). */
.steady .mon-section { padding: 40px 64px 64px; max-width: 1000px; }

.steady .mon-head,
.steady .mon-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.6fr) 90px 110px 130px;
  gap: 16px;
  align-items: center;
}
.steady .mon-head { padding: 11px 20px; border-bottom: 1px solid var(--hairline); background: var(--bg-sunken); }
.steady .mon-row  { padding: 14px 20px; border-bottom: 1px solid var(--hairline); }
.steady .mon-row:last-child { border-bottom: none; }

.steady .mon-col { font-size: 10.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.steady .mon-col.right { text-align: right; }

.steady .mon-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.steady .mon-name-line { font-size: 13.5px; font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 8px; min-width: 0; }
.steady .mon-name-line .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steady .mon-method { font-size: 10px; color: var(--ink-faint); background: var(--bg-sunken); padding: 1px 6px; border-radius: 4px; font-weight: 400; flex-shrink: 0; }
.steady .mon-url { font-size: 11px; color: var(--ink-faint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steady .mon-status .chip { font-size: 11px; }
.steady .mon-resp    { font-size: 13px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.steady .mon-checked { font-size: 11.5px; color: var(--ink-muted); text-align: right; }

/* Per-cell labels are desktop-hidden (the column header covers them); they
 * reappear when rows stack on mobile. */
.steady .cell-label { display: none; }

/* Responsive: the landing uses generous desktop padding; tighten on narrow. */
@media (max-width: 720px) {
  .steady .messages { padding-left: 24px; padding-right: 24px; }

  .steady .mon-section { padding: 28px 18px 40px; }
  .steady .mon-head { display: none; }
  .steady .mon-row {
    display: flex; flex-direction: column;
    align-items: stretch; gap: 9px; padding: 16px;
  }
  .steady .mon-cell { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .steady .mon-resp, .steady .mon-checked { text-align: right; }
  .steady .cell-label {
    display: inline; font-size: 10.5px; color: var(--ink-faint);
    text-transform: uppercase; letter-spacing: 0.06em;
  }
}
