/*
  styles.css — the Slice A workspace, dark navy, one stylesheet.

  Constraints that shaped this file rather than taste:

  - No `@import`, no web font, no background image file, no data: URI. The API
    sends `default-src 'none'` with same-origin style and `img-src 'self'`, and
    apps/web is pinned to three files, so a fourth asset cannot exist. The hero
    is a CSS gradient plus an inline SVG in the markup; every icon is inline SVG.
  - System font stack, for the same reason. It is also the fastest possible text
    render and needs no layout-shift mitigation.
  - Colour is never the only carrier of meaning: each state ships a text label
    ("Answered", "No content available", "Not signed in") next to its colour.
  - Every focusable control gets the same 2px focus ring at a 2px offset, on top
    of its own hover treatment, so keyboard position is never ambiguous.

  Contrast on the panel background #101a30: body text #e8eefc ~14.9:1, muted text
  #a8b8d8 ~8.2:1, amber #f5b83f ~9.6:1, red #fca5a5 ~8.9:1, green #6ee7b7 ~11.4:1.
  All above the WCAG 2.1 AA 4.5:1 floor for normal text.
*/

:root {
  --navy-1000: #050a16;
  --navy-950: #070d1d;
  --navy-900: #0a1224;
  --navy-850: #0d1527;
  --navy-800: #101a30;
  --navy-700: #16223c;
  --navy-600: #1d2c4c;

  --line: rgba(146, 172, 224, 0.16);
  --line-strong: rgba(146, 172, 224, 0.3);

  --text: #e8eefc;
  --text-muted: #a8b8d8;
  --text-dim: #8595b7;

  --blue: #3b82f6;
  --blue-bright: #60a5fa;
  --cyan: #38bdf8;
  --violet: #a78bfa;
  --amber: #f5b83f;
  --green: #6ee7b7;
  --red: #fca5a5;

  --focus: #7dd3fc;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  --rail-w: 252px;
  --rrail-w: 280px;

  --font:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1200px 620px at 78% -8%, rgba(59, 130, 246, 0.16), transparent 60%),
    radial-gradient(880px 520px at 12% 4%, rgba(167, 139, 250, 0.1), transparent 62%), var(--navy-1000);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

kbd {
  font-family: var(--mono);
  font-size: 0.78em;
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--navy-700);
}

/* ---------------------------- Accessibility ---------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/*
  The `hidden` attribute must win over any `display` this sheet sets.

  Found by visual QA rather than by reasoning: `.gate` and `.work` both declare
  `display: grid`, and a class selector beats the user-agent rule for `[hidden]`,
  so the signed-out gate and the workspace rendered on top of each other and the
  gate never actually gated anything. `hidden` is the mechanism that keeps
  pre-authentication content out of the accessibility tree as well as out of the
  layout, so this rule is load-bearing, not cosmetic.
*/
[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skiplink {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 40;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.12s ease-out;
}

.skiplink:focus {
  top: 12px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------- Banner ------------------------------- */

.banner {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 9px 20px;
  border-bottom: 1px solid rgba(245, 184, 63, 0.34);
  background: linear-gradient(180deg, rgba(245, 184, 63, 0.16), rgba(245, 184, 63, 0.07));
  backdrop-filter: blur(6px);
}

.banner__tag {
  flex: none;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(245, 184, 63, 0.5);
  background: rgba(245, 184, 63, 0.16);
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.banner__text {
  font-size: 0.86rem;
  color: #f4e6c8;
}

/* The pilot's notice: informational blue, not the amber that means "this is a fixture". */
.banner--pilot {
  border-bottom-color: rgba(96, 165, 250, 0.4);
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.16), rgba(96, 165, 250, 0.07));
}

.banner--pilot .banner__tag {
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(96, 165, 250, 0.16);
  color: var(--blue-bright);
}

.banner--pilot .banner__text {
  color: #dbe7fb;
}

/* ------------------------------- Layout ------------------------------- */

.app {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--rrail-w);
  align-items: start;
  gap: 0;
  max-width: 1680px;
  margin: 0 auto;
}

.main {
  min-width: 0;
  padding: 22px 26px 40px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

/* ------------------------------ Left rail ------------------------------ */

.rail {
  position: sticky;
  top: 44px;
  align-self: start;
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  padding: 20px 14px 28px;
}

.rail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 6px;
  border-radius: var(--r-md);
  color: inherit;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(96, 165, 250, 0.22), rgba(167, 139, 250, 0.14));
}

.brand__mark svg {
  width: 22px;
  height: 22px;
}

.brand__text {
  display: block;
  min-width: 0;
}

.brand__name {
  display: block;
  font-size: 1.16rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.brand__sub {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

.rail__toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--navy-800);
  cursor: pointer;
}

.rail__toggle-bars,
.rail__toggle-bars::before,
.rail__toggle-bars::after {
  display: block;
  width: 16px;
  height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--text);
  content: "";
}

.rail__toggle-bars::before {
  transform: translateY(-5px);
}

.rail__toggle-bars::after {
  transform: translateY(3px);
}

.rail__body {
  margin-top: 18px;
}

.nav__list {
  display: grid;
  gap: 2px;
}

.nav__item {
  display: flex;
  gap: 11px;
  align-items: center;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}

.nav__item:hover:not(.is-gated) {
  background: var(--navy-800);
  color: var(--text);
}

.nav__item.is-active {
  border-color: rgba(96, 165, 250, 0.42);
  background: linear-gradient(100deg, rgba(59, 130, 246, 0.26), rgba(59, 130, 246, 0.08));
  color: #fff;
  font-weight: 600;
}

/*
  Future-gated: dimmed, but still in the tab order and still announced. The
  spec forbids hiding these, because a control the employee can see in the
  design and not find in the product is worse than one that explains itself.
*/
.nav__item.is-gated {
  color: var(--text-dim);
  cursor: not-allowed;
}

.nav__icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
}

.nav__icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav__label {
  flex: 1 1 auto;
}

.nav__gate {
  flex: none;
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 1px 7px;
}

.rail__tagline {
  margin: 26px 0 22px;
  padding-left: 13px;
  border-left: 2px solid rgba(96, 165, 250, 0.55);
  font-size: 1.02rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* ------------------------------ Identity ------------------------------ */

.identity {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--navy-850);
}

.identity__heading {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.identity__note {
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.identity__group {
  display: grid;
  gap: 6px;
  margin-top: 11px;
}

/* Who is signed in, and the control to sign in or out. */
.account {
  display: grid;
  gap: 4px;
  margin-top: 11px;
}

.account__name {
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.account__role {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.account .button {
  margin-top: 8px;
  justify-self: start;
}

.persona {
  display: flex;
  gap: 9px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--navy-900);
  cursor: pointer;
}

.persona:hover {
  border-color: var(--line-strong);
}

.persona:has(.persona__input:checked) {
  border-color: rgba(96, 165, 250, 0.6);
  background: rgba(59, 130, 246, 0.12);
}

.persona__input {
  margin: 3px 0 0;
  accent-color: var(--blue-bright);
  flex: none;
}

.persona__body {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.persona__name {
  font-size: 0.82rem;
  font-weight: 600;
}

.persona__token {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--cyan);
}

.persona__note {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ------------------------------- Top bar ------------------------------- */

.topbar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.topbar__date {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.topbar__right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.iconbtn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--navy-850);
  color: var(--text-muted);
  cursor: pointer;
}

.iconbtn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.iconbtn.is-gated {
  color: var(--text-dim);
  cursor: not-allowed;
  opacity: 0.6;
}

.regionbadge {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--navy-850);
  font-size: 0.78rem;
  font-weight: 600;
}

.regionbadge::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.regionbadge--ok {
  color: var(--green);
  border-color: rgba(110, 231, 183, 0.34);
}

.regionbadge--warn {
  color: var(--amber);
  border-color: rgba(245, 184, 63, 0.38);
}

/* -------------------------------- Gate -------------------------------- */

.gate {
  display: grid;
  place-items: center;
  min-height: 62vh;
  padding: 28px 0;
}

.gate__card {
  max-width: 560px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
  text-align: left;
}

.gate__title {
  margin: 12px 0 10px;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.gate__text {
  color: var(--text-muted);
}

.gate__meta {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
  color: var(--text-dim);
}

.button {
  margin-top: 18px;
  padding: 10px 18px;
  border: 1px solid rgba(96, 165, 250, 0.5);
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, var(--blue), #2563eb);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.08);
}

/* A secondary action: outlined, no fill. Sign out is never the loudest thing on the page. */
.button--quiet {
  border-color: var(--line);
  background: transparent;
  color: var(--text-muted);
}

.button--quiet:hover {
  filter: none;
  color: var(--text);
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* -------------------------------- Hero -------------------------------- */

.work {
  display: grid;
  gap: 20px;
  margin-top: 18px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 30px 30px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(760px 300px at 82% 8%, rgba(56, 189, 248, 0.18), transparent 62%),
    radial-gradient(520px 320px at 96% 96%, rgba(167, 139, 250, 0.16), transparent 66%),
    linear-gradient(168deg, #0c1a35 0%, #0a1224 58%, #090f1e 100%);
}

.hero__art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__path {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 78%;
  height: 100%;
}

.hero__content {
  position: relative;
  max-width: 34rem;
}

.hero__greeting {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  font-weight: 350;
  letter-spacing: -0.02em;
}

.hero__sub {
  margin-top: 6px;
  font-size: clamp(1rem, 1.7vw, 1.3rem);
  color: var(--text-muted);
}

.hero__brand {
  margin-top: 22px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  line-height: 1.9;
  text-transform: uppercase;
  color: #b9cdf0;
}

.hero__words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero__words li {
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(10, 18, 36, 0.62);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* -------------------------------- Ask -------------------------------- */

.ask {
  display: grid;
  gap: 9px;
}

.ask__bar {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  padding: 11px 12px 11px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--navy-800);
  transition:
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}

/* Story-strip step 02 — "input expands with soft glow" — as a focus treatment. */
.ask__bar:focus-within {
  border-color: rgba(96, 165, 250, 0.72);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16);
}

.ask__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 30px;
  max-height: 168px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.ask__input::placeholder {
  color: var(--text-dim);
}

.ask__input:focus {
  outline: none;
}

.ask__controls {
  display: flex;
  gap: 9px;
  align-items: center;
  flex: none;
}

.routepill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  max-width: 15rem;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--navy-700);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: not-allowed;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.routepill--warn {
  color: var(--amber);
  border-color: rgba(245, 184, 63, 0.34);
}

.routepill--ok {
  color: var(--green);
  border-color: rgba(110, 231, 183, 0.34);
}

.submit {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--blue-bright), #2563eb);
  color: #fff;
  cursor: pointer;
}

.submit svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.submit:disabled {
  background: var(--navy-600);
  color: var(--text-dim);
  cursor: progress;
}

.ask__hint {
  padding-left: 18px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.ask__hint--quiet {
  color: var(--text-dim);
}

.ask__status {
  min-height: 1.3em;
  padding-left: 18px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cyan);
}

/*
  The character counter. Empty until the question approaches the bound, so it is
  not a permanent distraction. Over the bound it turns amber *and* gains a weight
  change and a marker, because colour alone would not carry the state.
*/
.ask__count {
  padding-left: 18px;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

.ask__count--over {
  color: var(--amber);
  font-weight: 700;
}

.ask__count--over::after {
  content: " — over the limit";
  font-family: var(--font);
}

/* ------------------------------- Panels ------------------------------- */

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--navy-850);
}

.panel--result {
  background: linear-gradient(180deg, var(--navy-800), var(--navy-850));
}

.panel__head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel__heading {
  font-size: 0.96rem;
}

.panel--result .panel__heading {
  margin-bottom: 12px;
}

.panel__badge {
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* -------------------------------- States -------------------------------- */

.state {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.state--answer {
  animation: rise 0.22s ease-out;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.state-label {
  display: inline-block;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--navy-700);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.state-label--ok {
  color: var(--green);
  border-color: rgba(110, 231, 183, 0.4);
  background: rgba(110, 231, 183, 0.1);
}

.state-label--deny {
  color: var(--red);
  border-color: rgba(252, 165, 165, 0.4);
  background: rgba(252, 165, 165, 0.09);
}

.state-label--warn {
  color: var(--amber);
  border-color: rgba(245, 184, 63, 0.4);
  background: rgba(245, 184, 63, 0.09);
}

.state-label--busy {
  color: var(--cyan);
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.09);
}

.state__text {
  color: var(--text);
}

.state__hint,
.state__list {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.state__list {
  display: grid;
  gap: 5px;
  padding-left: 18px;
  list-style: disc;
}

.originchip {
  padding: 6px 11px;
  border: 1px dashed rgba(245, 184, 63, 0.5);
  border-radius: var(--r-sm);
  font-size: 0.76rem;
  color: var(--amber);
}

.progress {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--navy-700);
}

.progress__fill {
  display: block;
  width: 36%;
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  animation: slide 1.15s ease-in-out infinite;
}

@keyframes slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(300%);
  }
}

.trace {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

/* -------------------------------- Answer -------------------------------- */

.answer__head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.answer__text {
  font-size: 1.04rem;
  line-height: 1.66;
}

.answer__subheading {
  margin-top: 4px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.route__detail {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--navy-700);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.chip--synthetic {
  color: var(--amber);
  border-color: rgba(245, 184, 63, 0.4);
}

.chip--route {
  text-transform: none;
  letter-spacing: 0.01em;
  font-family: var(--mono);
}

.chip--warn {
  color: var(--amber);
  border-color: rgba(245, 184, 63, 0.4);
}

.chip--ok {
  color: var(--green);
  border-color: rgba(110, 231, 183, 0.4);
}

.chip--deny {
  color: var(--red);
  border-color: rgba(252, 165, 165, 0.4);
}

.citations {
  display: grid;
  gap: 10px;
  width: 100%;
}

.citation {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 2px solid rgba(96, 165, 250, 0.6);
  border-radius: var(--r-md);
  background: var(--navy-900);
}

.citation__head {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}

.citation__link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.citation__link:hover {
  color: #93c5fd;
}

.citation__meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.citation__text {
  margin: 9px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--line-strong);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.citation__text:target {
  border-left-color: var(--cyan);
  color: var(--text);
}

/*
  The answer's two actions. Deliberately modest: they are the only two things an
  employee can do with an answer in this release, and styling them like primary
  calls to action would imply a workflow that does not exist yet.
*/
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 4px;
}

.actionbtn {
  padding: 7px 14px;
  border: 1px solid rgba(96, 165, 250, 0.42);
  border-radius: var(--r-sm);
  background: rgba(59, 130, 246, 0.14);
  color: #cfe0ff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.actionbtn:hover {
  background: rgba(59, 130, 246, 0.24);
  color: #fff;
}

.actionbtn--quiet {
  border-color: var(--line);
  background: var(--navy-700);
  color: var(--text-muted);
}

.actionbtn--quiet:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

/* ------------------------------- Session ------------------------------- */

.session {
  display: grid;
  gap: 8px;
}

.session__item {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--navy-900);
}

.session__question {
  flex: 1 1 12rem;
  min-width: 0;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session__time {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.source__name {
  font-weight: 600;
}

/* ------------------------------ Right rail ------------------------------ */

.rrail {
  position: sticky;
  top: 44px;
  align-self: start;
  padding: 22px 18px;
}

.rrail__heading {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.rrail__list {
  display: grid;
  gap: 11px;
  margin-top: 13px;
}

.rrail__item {
  padding: 13px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: rgba(13, 21, 39, 0.55);
}

.rrail__name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.rrail__text {
  margin-top: 5px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.rrail__foot {
  margin-top: 13px;
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* -------------------------------- Footer -------------------------------- */

.footer {
  display: grid;
  gap: 7px;
  max-width: 1680px;
  margin: 0 auto;
  padding: 26px;
  border-top: 1px solid var(--line);
}

.footer__quote {
  font-size: 1.04rem;
  color: var(--text-muted);
}

.footer__brand {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.footer__meta {
  font-size: 0.76rem;
  color: var(--text-dim);
}

/* ------------------------------ Responsive ------------------------------ */

/* Tablet: the right rail's honest notes move below the main column. */
@media (max-width: 1279px) {
  .app {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
  }

  .rrail {
    position: static;
    grid-column: 1 / -1;
    max-height: none;
    border-top: 1px solid var(--line);
  }

  .rrail__list {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

/* Mobile: single column, the rail collapses behind a disclosure button. */
@media (max-width: 860px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .main {
    padding: 18px 16px 32px;
    border: 0;
  }

  .rail {
    position: static;
    max-height: none;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
  }

  .rail__toggle {
    display: grid;
    place-items: center;
  }

  .rail__body {
    display: none;
  }

  .rail[data-open="true"] .rail__body {
    display: block;
  }

  .hero {
    padding: 22px 18px;
  }

  .hero__path {
    width: 100%;
    opacity: 0.55;
  }

  .ask__bar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border-radius: var(--r-lg);
  }

  .ask__controls {
    justify-content: space-between;
  }

  .routepill {
    max-width: none;
    flex: 1 1 auto;
  }

  .ask__hint,
  .ask__status {
    padding-left: 0;
  }

  .gate__card {
    padding: 22px;
  }

  .footer {
    padding: 22px 16px;
  }
}

/* Honour a user's contrast preference by strengthening every hairline. */
@media (prefers-contrast: more) {
  :root {
    --line: rgba(190, 210, 245, 0.42);
    --line-strong: rgba(190, 210, 245, 0.6);
    --text-muted: #c6d4ee;
    --text-dim: #adbcd8;
  }
}
