/* One small stylesheet for the whole site. Propshaft serves it as it is: no build step. */
:root {
  color-scheme: light dark;
  --ink: #1b1b1f;
  --paper: #fbfaf7;
  --muted: #5d5d66;
  --rule: #d6d3ca;
  --card: #f2f0ea;
  --ok: #17673b;
  --bad: #a4161a;
  --warn: #8a4b00;
  --focus: #0b57d0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1f0ec;
    --paper: #17171a;
    --muted: #a6a6b0;
    --rule: #3a3a42;
    --card: #202024;
    --ok: #6fcf97;
    --bad: #ff8a8a;
    --warn: #ffc266;
    --focus: #8ab4f8;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.125rem/1.6 system-ui, sans-serif;
}

/* The page is a column: header (banner), main, footer (contentinfo). The footer sits at the bottom of a short page.
   Plain flow, no JavaScript. Nothing here uses CSS nesting or :has, so an older phone still draws it. Text is 16 px or
   more everywhere. */
.board-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.board-header,
.board,
.board-footer {
  box-sizing: border-box;
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
  padding-right: 1rem;
  padding-left: 1rem;
  overflow-wrap: break-word;
}

.board-header {
  padding-top: 1.25rem;
}

.board {
  flex: 1 0 auto;
}

.board-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  line-height: 1.1;
}

.board-footer {
  padding-top: 2rem;
  padding-bottom: 1.5rem;
  color: var(--muted);
  font-size: 1rem;
}

.board-footer p {
  margin: 0;
}

.board h2 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.lede {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.4;
}

.board a {
  color: inherit;
}

.board a:focus-visible,
.board summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.signs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.sign {
  min-width: 0;
  padding: 0.5rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  background: var(--card);
}

.board .sign h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.sign p {
  margin: 0;
  line-height: 1.3;
}

.sign-count {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.sign-days {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
}

.sign-unit {
  font-size: 1.125rem;
}

.sign-state {
  font-weight: 700;
  color: var(--ok);
}

.sign[data-state="investigating"] .sign-state {
  color: var(--warn);
}

.sign-since {
  color: var(--muted);
  font-size: 1rem;
}

.connection {
  margin: 0.75rem 0 0;
  padding: 0.25rem 0.75rem;
  border-left: 4px solid var(--warn);
  font-size: 1rem;
  line-height: 1.4;
}

.checks {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* One check row. Narrow screens: the id and the status on the first line, then the priority, the time and the
   duration on a second line that uses the full width. */
.check {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "id id status"
    "priority time duration";
  column-gap: 0.75rem;
  align-items: baseline;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 1rem;
  line-height: 1.4;
}

.check > * {
  min-width: 0;
}

.check-id {
  grid-area: id;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.check-priority {
  grid-area: priority;
}

.check-time {
  grid-area: time;
}

.check-duration {
  grid-area: duration;
}

.check-priority,
.check-time,
.check-duration {
  color: var(--muted);
}

.check-status {
  grid-area: status;
  font-weight: 700;
  text-align: right;
}

.check-status[data-status="pass"] {
  color: var(--ok);
}

.check-status[data-status="fail"] {
  color: var(--bad);
}

.check-status[data-status="error"],
.check-status[data-status="lost"] {
  color: var(--warn);
}

.check-status[data-status="never_run"] {
  color: var(--muted);
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.125rem 0.75rem;
  margin: 0;
}

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

.facts dd {
  margin: 0;
  min-width: 0;
}

.month-label {
  margin: 0 0 0.25rem;
  font-weight: 600;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.incident {
  min-width: 0;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}

.board .incident h3 {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.incident p {
  margin: 0.25rem 0;
}

.incident-meta {
  color: var(--muted);
  font-size: 1rem;
}

.incident-note {
  overflow-wrap: anywhere;
}

.incident-evidence pre {
  margin: 0.5rem 0 0;
  padding: 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 0.25rem;
  background: var(--card);
  font-size: 1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.how li,
.how p {
  overflow-wrap: anywhere;
}

@media (min-width: 700px) {
  .signs {
    grid-template-columns: 1fr 1fr;
  }

  .check {
    grid-template-columns: minmax(12rem, 1.4fr) 4rem 9rem 1.2fr 5rem;
    grid-template-areas: "id priority status time duration";
  }

  .check-status {
    text-align: left;
  }
}
