@font-face {
  font-family: BasierCircle;
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/static/brand/BasierCircle-Regular.woff") format("woff");
}
@font-face {
  font-family: BasierCircle;
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("/static/brand/BasierCircle-Medium.woff") format("woff");
}
@font-face {
  font-family: BasierCircle;
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/static/brand/BasierCircle-SemiBold.woff") format("woff");
}
@font-face {
  font-family: BasierCircle;
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/static/brand/BasierCircle-Bold.woff") format("woff");
}

:root {
  --ink: #263a54;
  --paper: #f2f6ff;
  --sheet: #ffffff;
  --rule: #d6dadf;
  --amber: #00a1cb;
  --live: #27a607;
  --down: #df2955;
  --stamp: #1c4d8e;
  --heading: #334d70;
  color: var(--ink);
  background: var(--paper);
  font-family: BasierCircle, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

* { box-sizing: border-box; }

body {
  margin: 0;
}

a { color: var(--stamp); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.mast {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: #fff;
  color: var(--ink);
  border-top: 4px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}

.mast a { color: inherit; text-decoration: none; }
.mast nav { display: flex; gap: 1.15rem; flex-wrap: wrap; }
.mast nav a { font-size: 0.95rem; font-weight: 500; }
.mast nav a[aria-current="page"] { color: var(--stamp); font-weight: 700; }
.mast form { margin-left: auto; }
.mast button, button {
  font: inherit;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}
button:disabled, input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
main button, .gate button {
  background: var(--stamp);
  color: #fff;
  border-color: var(--stamp);
  font-weight: 600;
}

.brand img { display: block; height: 28px; width: auto; }

main { padding: 1.5rem; max-width: 1180px; margin: 0 auto; }

h1, h2, h3 {
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 0.4rem;
}
h1 { font-size: 2rem; line-height: 1.15; }
h2 { font-size: 1.55rem; margin-top: 2.2rem; }
h3 { font-size: 1.05rem; margin: 1.4rem 0 0.6rem; }

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stamp);
  margin: 0;
}

.lede p, .fine { color: #596e8a; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.86rem; }

.source-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 0.5rem;
}
.source-row article, .ages article {
  background: var(--sheet);
  padding: 1rem 1.1rem 0.8rem;
  border: 1px solid var(--rule);
  border-top: 4px solid var(--stamp);
  border-radius: 12px;
}
.count {
  font-weight: 700;
  font-size: 2.6rem;
  line-height: 1;
  margin: 0.25rem 0;
  color: #004c93;
}

.card {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: auto;
  margin-top: 0.8rem;
}
table { width: 100%; border-collapse: collapse; background: var(--sheet); }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: #596e8a;
}

.lane { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.lane .arrow { color: var(--amber); padding: 0 0.35rem; }
.lane .sub, .src { display: block; color: #596e8a; font-size: 0.78rem; font-weight: 500; }
.src { font-family: "IBM Plex Mono", monospace; letter-spacing: 0.06em; font-size: 0.68rem; }

.lane-hero { font-size: 1.05rem; margin-top: 0.4rem; }

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem 1rem;
  margin: 1.2rem 0;
}
.facts div { background: var(--sheet); padding: 0.55rem 0.7rem; }
.facts dt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #526170;
}
.facts dd { margin: 0.15rem 0 0; }

.filters, .ask { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: end; }
label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  padding: 0.45rem 0.55rem;
  min-width: 10rem;
}
textarea { width: min(100%, 40rem); }

.alert { color: var(--down); }
.status-failed, .status-escalated, .status-reverted { color: var(--down); }
.status-ok, .status-applied { color: var(--live); }
.error-line { color: var(--down); font-size: 0.9rem; }

.attempt {
  background: var(--sheet);
  padding: 0.8rem 1rem;
  margin: 0.6rem 0;
}
.attempt header { display: flex; gap: 0.8rem; flex-wrap: wrap; font-size: 0.9rem; }
pre {
  white-space: pre-wrap;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  background: var(--paper);
  padding: 0.7rem;
}

.gate { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.gate-card {
  width: min(100%, 26rem);
  background: var(--sheet);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.gate-card h1 { font-size: 2.4rem; }
.plain { padding-left: 1.1rem; }
.answer { background: var(--sheet); padding: 1rem 1.1rem; margin-top: 1rem; border-left: 4px solid var(--amber); white-space: pre-wrap; }

.wire {
  margin-top: 1rem;
  background: var(--sheet);
  border-left: 4px solid var(--stamp);
  padding: 0.9rem 1rem 1rem;
}
.wire[hidden] { display: none; }
.status-line {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  margin: 0;
}
.status-line::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.45rem;
  background: var(--amber);
  vertical-align: 0.05rem;
  animation: blink 1.1s steps(2, end) infinite;
}
.wire.done .status-line::before {
  animation: none;
  background: var(--live);
}
.think {
  max-height: 11rem;
  overflow: auto;
  margin-top: 0.7rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #526170;
  white-space: pre-wrap;
  background: var(--paper);
  padding: 0.65rem 0.7rem;
}
.think[hidden], #ask-sql[hidden] { display: none; }
.wire .answer { margin-top: 0.8rem; }

.settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}
.settings article {
  background: var(--sheet);
  padding: 1rem 1.1rem 0.9rem;
  border: 1px solid var(--rule);
  border-top: 4px solid var(--stamp);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.settings .count { font-size: 2.6rem; }
.settings label { margin-top: 0.45rem; }
.settings select, .settings input { width: 100%; }
.settings button, .settings .fine { grid-column: 1 / -1; }

@keyframes blink {
  50% { opacity: 0; }
}

.trust { display: grid; gap: 0.45rem; margin-top: 1rem; }
.trust p {
  margin: 0;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
}
.trust .covered { border-left: 4px solid var(--live); }
.trust .gap { border-left: 4px solid var(--down); }
.trust span { display: block; color: #596e8a; font-size: 0.85rem; }

.ages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}
.hours {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 0.25rem;
  align-items: end;
  height: 9rem;
  margin-top: 0.4rem;
}
.hour { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 0.2rem; }
.hour span, .hour em { font-size: 0.62rem; color: #596e8a; }
.hour i {
  display: block;
  width: 100%;
  height: calc(var(--share) * 6.2rem);
  min-height: 2px;
  background: var(--stamp);
  border-radius: 3px 3px 0 0;
}
.hours.seen { margin-top: 0.2rem; }
.hours.seen .hour i { background: #00a1cb; }
.days { display: flex; flex-wrap: wrap; gap: 0.45rem; list-style: none; padding: 0.8rem 0 0; }
.days li {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
}
.split { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; margin: 0.8rem 0; }
.split p { margin: 0; }
.open-job { box-shadow: inset 3px 0 0 var(--stamp); }
.card td a { font-weight: 600; }

@media (max-width: 800px) {
  .source-row, .facts, .settings, .ages { grid-template-columns: 1fr 1fr; }
  .mast { flex-wrap: wrap; }
  h1 { font-size: 1.7rem; }
  .hours { grid-template-columns: repeat(12, minmax(0, 1fr)); height: auto; }
  .hour { height: 7rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .status-line::before { animation: none; }
}
