/* Mobile-first. The base styles are the phone layout; wider screens add to them. */
:root {
  --ink: #1b2430;
  --muted: #5d6b7a;
  --line: #d9dfe6;
  --surface: #ffffff;
  --page: #f4f6f8;
  --accent: #0b5cad;
  --ok: #1e7a46;
  --fail: #b3261e;
  --space: 1rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.container { max-width: 56rem; margin: 0 auto; padding: var(--space); }
h1 { margin: 0; font-size: 1.5rem; }
h2 { font-size: 1.125rem; margin: 1.5rem 0 .5rem; }
.muted { color: var(--muted); font-size: .9rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
a { color: var(--accent); }
code { background: #e8edf2; padding: 0 .25rem; border-radius: .25rem; }

.page-header { margin-bottom: var(--space); }

/* Connection checks: one card per line on a phone, three across from a tablet up. */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.check { display: grid; gap: .125rem; background: var(--surface); border: 1px solid var(--line); border-left-width: .375rem; border-radius: .5rem; padding: .75rem; }
.check--ok { border-left-color: var(--ok); }
.check--fail { border-left-color: var(--fail); }
.check__state { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.check--ok .check__state { color: var(--ok); }
.check--fail .check__state { color: var(--fail); }
.check__label { font-weight: 600; }
.check__detail { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }

/* Search form: stacked on a phone, in a row from a tablet up. Inputs are tall enough to tap. */
.filters { display: grid; gap: .5rem; margin-bottom: var(--space); }
.filters input, .filters select { width: 100%; min-height: 2.75rem; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); font: inherit; }
.filters input[type="submit"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* Reports: cards, not a wide table, so there is no sideways scrolling on a phone. */
.reports { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.report { display: grid; gap: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: .5rem; padding: .75rem; }
.report__main { display: grid; gap: .125rem; overflow-wrap: anywhere; }
.report__meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.badge { display: inline-block; padding: .125rem .5rem; border-radius: 999px; background: #e8edf2; font-size: .8rem; font-weight: 600; }
.badge--complete { background: #dff3e7; color: var(--ok); }
.badge--update { background: #e3edf9; color: var(--accent); }

.pager { display: flex; flex-wrap: wrap; gap: var(--space); align-items: center; justify-content: space-between; margin-top: var(--space); }
.pager a { min-height: 2.75rem; display: inline-flex; align-items: center; }

.notice { margin: 0 0 var(--space); padding: .75rem; border-radius: .5rem; background: var(--surface); border: 1px solid var(--line); }
.notice--fail { border-color: var(--fail); }

/* Report page */
.steps { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .25rem; }
.step { padding: .5rem .75rem; border-radius: .5rem; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.step--done { color: var(--ok); }
.step--done::before { content: "\2713  "; }
.step--current { color: #fff; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.links { margin: 0; padding-left: 1.25rem; }

@media (min-width: 40rem) {
  .steps { grid-auto-flow: column; grid-auto-columns: 1fr; text-align: center; }
  .checks { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
  .report { grid-template-columns: 1fr auto; align-items: center; }
  .report__meta { justify-content: flex-end; }
}

/* Signed-in bar, sign-in form, buttons */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: var(--space); padding: .5rem var(--space); background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar__name { font-weight: 600; overflow-wrap: anywhere; }
.topbar form { margin: 0; }
.linkbutton { background: none; border: 0; padding: 0; min-height: 2.75rem; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }

.signin { max-width: 24rem; margin: 2rem auto; }
.stack { display: grid; gap: var(--space); }
.field { display: grid; gap: .25rem; }
.field label { font-weight: 600; }
.field input { width: 100%; min-height: 2.75rem; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); font: inherit; }
.button { min-height: 2.75rem; padding: .5rem 1rem; border: 1px solid var(--accent); border-radius: .5rem; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }

.company { font-size: .85rem; font-weight: 600; color: var(--accent); overflow-wrap: anywhere; }

/* Tranches: one card each. Comparables scroll sideways inside their own box, never the page. */
.tranche { margin: 0 0 var(--space); padding: .75rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); }
.tranche header { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.tranche h3 { margin: 0; font-size: 1.05rem; }
.tranche h4 { margin: var(--space) 0 .5rem; font-size: .95rem; }
.table-wrap { overflow-x: auto; }
.comparables { width: 100%; border-collapse: collapse; font-size: .9rem; }
.comparables th, .comparables td { padding: .375rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.comparables th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.comparable-photo { float: left; width: 80px; height: auto; margin: 0 .5rem .25rem 0; border-radius: .25rem; }

/* A link that looks like a button; tall enough to tap. */
.button { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .5rem 1rem; border-radius: .5rem; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; }
