/* KeyAssist — gateway-page.css
   Loaded only by the static /gateway topic page (scripts/prerender_gateway.py),
   on top of case-page.css, whose tokens (--bg / --panel / --border / --text /
   --muted / --accent) it reuses so the two static surfaces stay one design.

   The verdict colours are the load-bearing part: a locksmith scanning this
   page is looking for one thing — can I write over OBD or not — so `clear` and
   `blocked` must be separable at a glance, and never by hue alone (the label
   text carries the meaning too, and forced-colors mode keeps the border). */

.gw-main { max-width: 1040px; }

/* ── Intro: the two axes ───────────────────────────────────────────── */
.gw-intro { margin: 0 0 2rem; }
.gw-axes {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.gw-axes dt { font-weight: 600; color: var(--accent); margin-top: .7rem; }
.gw-axes dt:first-child { margin-top: 0; }
.gw-axes dd { margin: .25rem 0 0; color: var(--muted); }

.gw-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: .6rem;
  margin: 1.2rem 0;
  padding: 0;
}
.gw-leg { border: 1px solid var(--border); border-radius: 8px; padding: .55rem .7rem; }
.gw-leg dt { font-weight: 600; font-size: .93rem; }
.gw-leg dd { margin: .2rem 0 0; color: var(--muted); font-size: .87rem; }

.gw-scope {
  border-left: 3px solid var(--accent);
  padding: .5rem 0 .5rem .8rem;
  color: var(--muted);
}

/* ── Verdict colours ───────────────────────────────────────────────── */
.gw-v-clear      { color: #4ade80; }
.gw-v-cable      { color: #fbbf24; }
.gw-v-credential { color: #c084fc; }
.gw-v-either     { color: #38bdf8; }
.gw-v-blocked    { color: #f87171; }
.gw-v-unknown    { color: var(--muted); }
td.gw-v { font-weight: 600; white-space: nowrap; }

/* ── Contents ──────────────────────────────────────────────────────── */
.gw-toc {
  margin: 2rem 0;
  padding: 1rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.gw-toc h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .05em;
             color: var(--muted); margin: 1rem 0 .5rem; }
.gw-toc h2:first-child { margin-top: 0; }
.gw-toc ul { list-style: none; margin: 0; padding: 0; display: flex;
             flex-wrap: wrap; gap: .4rem .9rem; }
.gw-toc-make li span { color: var(--muted); font-size: .85rem; }

.gw-h2 {
  margin: 2.5rem 0 1rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}

/* ── A gateway family ──────────────────────────────────────────────── */
.gw-fam {
  margin: 0 0 1.8rem;
  padding: 1.1rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.gw-fam h3 { margin: 0 0 .3rem; }
.gw-fam h4 { margin: 1.1rem 0 .3rem; font-size: .95rem; color: var(--accent); }
.gw-fam p { margin: 0; }
.gw-fam-meta { color: var(--muted); font-size: .9rem; margin-bottom: .8rem !important; }
.gw-src { color: var(--muted); font-weight: 400; font-size: .8rem; }
.gw-hw { margin: .3rem 0 0; padding-left: 1.2rem; color: var(--muted); }
.gw-hw strong { color: var(--text); }

/* ── A vehicle ─────────────────────────────────────────────────────── */
.gw-make { margin: 0 0 2rem; }
.gw-make > h2 { margin: 0 0 .8rem; font-size: 1.25rem; }
.gw-count { color: var(--muted); font-size: .85rem; font-weight: 400; }

.gw-veh {
  margin: 0 0 1.1rem;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
}
/* Landing straight on an anchor should not hide the heading under nothing —
   and should say which card the link meant. */
.gw-veh:target { border-color: var(--accent); background: var(--accent-soft); }
.gw-veh h3 { margin: 0 0 .6rem; font-size: 1.05rem; scroll-margin-top: 1rem; }

/* Wide content scrolls inside its own box; the page body never scrolls sideways. */
.gw-bands { width: 100%; border-collapse: collapse; font-size: .9rem; display: block;
            overflow-x: auto; white-space: normal; }
.gw-bands th {
  text-align: left; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); font-weight: 600;
  padding: 0 .6rem .35rem 0; border-bottom: 1px solid var(--border);
}
.gw-bands td { padding: .5rem .6rem .5rem 0; border-bottom: 1px solid var(--border);
               vertical-align: top; }
.gw-bands tr:last-child td { border-bottom: 0; }
.gw-yr { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.gw-acc { color: var(--muted); font-size: .85em; }
.gw-none { color: var(--muted); font-style: italic; }
.gw-contested { color: #fbbf24; }

.gw-note { margin: .7rem 0 0; color: var(--muted); font-size: .9rem; }
.gw-lv { margin: .4rem 0 0; color: var(--muted); font-size: .8rem; }
.gw-links { margin: .6rem 0 0; font-size: .9rem; }

.gw-cta { margin: 2.5rem 0 1rem; text-align: center; }

@media (max-width: 640px) {
  .gw-bands { font-size: .85rem; }
  .gw-legend { grid-template-columns: 1fr; }
}

/* Windows high-contrast: hue is gone, so the verdict needs a non-colour cue. */
@media (forced-colors: active) {
  .gw-veh, .gw-fam, .gw-toc, .gw-axes, .gw-leg { border: 1px solid CanvasText; }
  .gw-veh:target { outline: 3px solid Highlight; }
  td.gw-v { text-decoration: underline; }
}

/* ── The field card ─────────────────────────────────────────────────
   Same three slots the app shows, in the same order the job happens:
   what to bring, what to do, what ruins it. It sits above the researched
   prose because the prose is the argument, not the answer. */
.gw-fc { margin: .9rem 0 1rem; }
.gw-fc-need, .gw-fc-trap {
  display: flex; gap: .6rem; align-items: baseline;
  padding: .6rem .75rem; border-radius: 8px; margin: 0 0 .55rem;
  font-size: .93rem; line-height: 1.5;
}
.gw-fc-need { background: var(--accent-soft); border: 1px solid var(--border); }
.gw-fc-trap { background: rgba(248,113,113,.09); border: 1px solid rgba(248,113,113,.35); }
.gw-fc-need > span, .gw-fc-trap > span {
  flex: 0 0 auto; font-size: .68rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; padding-top: .18rem;
}
.gw-fc-need > span { color: var(--accent); }
.gw-fc-trap > span { color: #f87171; }
.gw-fc-do { margin: 0 0 .55rem; padding-left: 1.35rem; }
.gw-fc-do li { margin: .22rem 0; font-size: .93rem; line-height: 1.5; }

.gw-fam-more > summary {
  cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--muted);
  padding: .3rem 0; list-style: none;
}
.gw-fam-more > summary::-webkit-details-marker { display: none; }
.gw-fam-more > summary::before { content: '› '; display: inline-block; transition: transform .15s; }
.gw-fam-more[open] > summary::before { transform: rotate(90deg); }
.gw-fam-more > summary:hover { color: var(--text); }
.gw-fam-more p { margin: .2rem 0 .7rem; }

@media (forced-colors: active) {
  .gw-fc-need, .gw-fc-trap { border: 1px solid CanvasText; }
  .gw-fc-trap > span::after { content: ' (!)'; }
}
