/* Aptivyr brand palette — the exact sRGB values used across the Aptivyr decks
   and videos, so this tool looks like part of the same product family rather
   than a separate utility. Do not reinvent these per project. */
:root {
  --bg:        #0A0E15;
  --panel:     #1A212C;
  --panel-deep:#11161F;
  --border:    #2A3140;
  --cyan:      #47DBE3;
  --purple:    #A97BF5;
  --muted:     #8B96A8;
  --text:      #EEF2F6;
  --amber:     #E3B247;
  --red:       #F0616D;

  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------- header ---------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1.1rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--border);
  background: var(--panel-deep);
}

.brand { display: flex; align-items: center; gap: .85rem; }

/* Stand-in for the Aptivyr circuit-X mark: a cyan/purple gradient lozenge.
   Kept as CSS so the page stays a single self-contained deliverable. */
.mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
}

h1 { margin: 0; font-size: 1.05rem; font-weight: 650; letter-spacing: .01em; }
.tagline { margin: 0; font-size: .78rem; color: var(--muted); }

.posture { font-size: .74rem; font-family: var(--mono); color: var(--muted); }
.posture .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: .45rem; vertical-align: baseline;
}
.dot.ok   { background: var(--cyan); }
.dot.warn { background: var(--amber); }

/* ---------- tabs ---------- */

.tabs {
  display: flex; gap: .25rem;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--border);
  background: var(--panel-deep);
}

.tab {
  appearance: none; background: none; border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted); font: inherit; font-size: .88rem;
  padding: .7rem .9rem; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }

main { padding: clamp(1.1rem, 4vw, 2rem) clamp(1rem, 4vw, 2.5rem) 4rem; }
.view { display: none; }
.view.active { display: block; }

/* ---------- search ---------- */

.search { display: flex; gap: .6rem; max-width: 860px; }

.search input {
  flex: 1; min-width: 0;
  padding: .7rem .9rem;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  font: inherit;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--cyan); }

.search button {
  padding: .7rem 1.3rem;
  background: var(--cyan); color: #06222a;
  border: 0; border-radius: var(--radius);
  font: inherit; font-weight: 650; cursor: pointer;
}
.search button:hover { filter: brightness(1.08); }

.hint { max-width: 860px; margin: .7rem 0 1.6rem; font-size: .8rem; color: var(--muted); }

/* ---------- result cards ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  padding: .95rem 1.1rem;
  margin-bottom: .8rem;
  max-width: 900px;
}
.card.authority { border-left-color: var(--purple); }
.card.stale     { border-left-color: var(--red); }

.card-head {
  display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
  margin-bottom: .4rem;
}
.office { font-family: var(--mono); font-weight: 650; color: var(--cyan); }
.card.authority .office { color: var(--purple); }
.pubtitle { font-size: .8rem; color: var(--muted); }

.quote { margin: 0 0 .55rem; }
.quote mark { background: rgba(71, 219, 227, .18); color: inherit; border-radius: 3px; padding: 0 2px; }

/* The citation is the point of the whole tool, so it is set apart in mono and
   never truncated. */
.cite { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.cite .auth { color: var(--purple); }

.warn {
  margin-top: .55rem; padding: .4rem .6rem;
  background: rgba(240, 97, 109, .1);
  border: 1px solid rgba(240, 97, 109, .35);
  border-radius: 6px;
  font-size: .78rem; color: var(--red);
}

.badge {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .04em;
  text-transform: uppercase;
  padding: .12rem .45rem; border-radius: 4px;
  border: 1px solid var(--border); color: var(--muted);
}
.badge.auth { border-color: var(--purple); color: var(--purple); }

/* ---------- tables ---------- */

table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 550; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
tbody tr:hover { background: var(--panel); }
td.num { font-family: var(--mono); text-align: right; }
td.id  { font-family: var(--mono); color: var(--cyan); }

.wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-deep); }

.status-current    { color: var(--cyan); }
.status-superseded { color: var(--red); }

.empty { color: var(--muted); max-width: 620px; }
.empty code {
  font-family: var(--mono); font-size: .84rem;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 5px; padding: .12rem .4rem;
}

.lede { max-width: 860px; margin: 0 0 1.2rem; color: var(--muted); font-size: .86rem; }
.count { color: var(--text); font-weight: 650; }

/* ---------- synthesized answer ---------- */

.answer {
  background: linear-gradient(180deg, rgba(71,219,227,.06), rgba(71,219,227,0));
  border: 1px solid var(--border);
  border-left: 3px solid var(--purple);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1.4rem;
  max-width: 900px;
}
.answer-label {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .5rem;
}
.answer-body { font-size: 1rem; line-height: 1.6; white-space: pre-wrap; }

/* Citation markers are the load-bearing part of an answer, so they are made
   visually findable rather than left as plain bracketed digits. */
.marker {
  font-family: var(--mono); font-size: .72rem; font-weight: 650;
  color: var(--purple); background: rgba(169,123,245,.14);
  border-radius: 4px; padding: .05rem .3rem;
}

.notice {
  border: 1px solid var(--border); border-left: 3px solid var(--amber);
  background: rgba(227,178,71,.07);
  border-radius: var(--radius);
  padding: .7rem .95rem; margin-bottom: 1.2rem;
  font-size: .84rem; color: var(--muted); max-width: 900px;
}

/* Version sits with the tagline rather than the posture line: it identifies the
   build, which is a different question from what the build is currently allowed
   to reach. */
#version { font-family: var(--mono); font-size: .72rem; color: var(--muted); opacity: .75; margin-left: .35rem; }

/* ── Access sign-in ─────────────────────────────────────────────────────────
   Prose answers come from the on-prem model, reached with the operator's own
   Cloudflare Access session. Signed out is a normal state, not an error: the
   cited passages are a complete answer on their own, so this control stays
   quiet rather than nagging. */
.topbar-right { display: flex; align-items: center; gap: .75rem; }

.signin {
  font: inherit;
  font-size: .82rem;
  padding: .35rem .7rem;
  border: 1px solid var(--line, #d0d4da);
  border-radius: 5px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.signin:hover { border-color: currentColor; }
.signin[disabled] { opacity: .55; cursor: default; }

.authstate {
  font-size: .78rem;
  opacity: .75;
  white-space: nowrap;
}
