/*
 * Incident #404 – GC-IRT visual foundation (WP002)
 *
 * One self-contained stylesheet: no external fonts, no imports, no remote or
 * data: URLs (the CSP only allows same-origin resources), no JavaScript needed.
 *
 *   1. Design tokens
 *   2. Base and reset
 *   3. Typography
 *   4. Layout: shell, header, progress navigation, footer
 *   5. Components
 *   6. Forensic / raw-data presentation
 *   7. Page compositions
 *   8. Responsive rules
 *   9. Accessibility: motion and forced colours
 *
 * Conventions
 *   - Prefix gc-, block__element, --modifier.
 *   - State is carried by data-state="…" AND by visible text in the markup;
 *     colour, shape and border style only reinforce it.
 *   - Colours come from the tokens below; do not hard-code new ones in rules.
 */

/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Surfaces, darkest to lightest */
  --gc-bg: #0a0d11;
  --gc-surface: #10141a;
  --gc-surface-2: #151a21;
  --gc-surface-elevated: #1c222a;

  /* Lines */
  --gc-border: #2c343e;
  --gc-border-strong: #7b8693;
  --gc-separator: #212830;

  /* Text */
  --gc-text: #e8ecf0;
  --gc-text-secondary: #b3bcc6;
  --gc-text-muted: #8f99a5;

  /* Neutral extremes */
  --gc-black: #05070a;
  --gc-white: #f7f9fb;

  /* Critical / restricted (used deliberately, never as a general accent) */
  --gc-critical: #d8393e;
  --gc-critical-text: #ff7a78;
  --gc-critical-surface: #2a1416;

  /* State */
  --gc-locked: #98a2ad;
  --gc-locked-border: #5d6874;
  --gc-locked-hatch: repeating-linear-gradient(135deg, var(--gc-surface-elevated) 0 1px, transparent 1px 7px);
  --gc-confirmed: var(--gc-white);
  --gc-focus: #ffffff;

  /* Decorative three-part mark. Carries no information. */
  --gc-mark-black: var(--gc-black);
  --gc-mark-black-edge: #6e7885;
  --gc-mark-red: var(--gc-critical);
  --gc-mark-white: var(--gc-white);
  --gc-mark-width: 2.25rem;
  --gc-mark-height: 0.375rem;
  --gc-mark: linear-gradient(var(--gc-mark-white), var(--gc-mark-white)) 100% 0 / 33.34% 100% no-repeat,
    linear-gradient(var(--gc-mark-red), var(--gc-mark-red)) 50% 0 / 33.33% 100% no-repeat,
    linear-gradient(var(--gc-mark-black), var(--gc-mark-black)) 1px 1px / calc(33.33% - 2px) calc(100% - 2px) no-repeat,
    linear-gradient(var(--gc-mark-black-edge), var(--gc-mark-black-edge)) 0 0 / 33.33% 100% no-repeat;

  /* Spacing scale */
  --gc-space-1: 0.25rem;
  --gc-space-2: 0.5rem;
  --gc-space-3: 0.75rem;
  --gc-space-4: 1rem;
  --gc-space-5: 1.5rem;
  --gc-space-6: 2rem;
  --gc-space-7: 3rem;

  /* Radii */
  --gc-radius-sm: 2px;
  --gc-radius: 4px;

  /* Type */
  --gc-font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gc-font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
  --gc-text-xs: 0.8125rem;
  --gc-text-sm: 0.875rem;
  --gc-text-base: 1rem;
  --gc-text-lg: 1.125rem;

  /* Layout and motion */
  --gc-content-max: 74rem;
  --gc-gutter: var(--gc-space-4);
  --gc-transition: 120ms ease;
}

/* ==========================================================================
   2. Base and reset
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--gc-bg);
  color: var(--gc-text);
  font: var(--gc-text-base) / 1.55 var(--gc-font-ui);
}

:focus-visible {
  outline: 2px solid var(--gc-focus);
  outline-offset: 2px;
}

::selection {
  background: var(--gc-white);
  color: var(--gc-black);
}

.gc-skip-link {
  position: absolute;
  inset-block-start: -4rem;
  inset-inline-start: var(--gc-space-3);
  z-index: 10;
  padding: var(--gc-space-2) var(--gc-space-4);
  background: var(--gc-white);
  color: var(--gc-black);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--gc-radius);
}

.gc-skip-link:focus {
  inset-block-start: var(--gc-space-3);
}

/* ==========================================================================
   3. Typography
   ========================================================================== */

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  font-weight: 600;
}

h1 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2.125rem);
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: var(--gc-text-base);
}

p,
ul,
ol,
dl,
figure,
pre {
  margin: 0;
}

a {
  color: var(--gc-text);
  text-decoration: underline;
  text-decoration-color: var(--gc-border-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--gc-transition), text-decoration-color var(--gc-transition);
}

a:hover {
  color: var(--gc-white);
  text-decoration-color: var(--gc-white);
}

code,
kbd,
samp {
  font-family: var(--gc-font-mono);
  font-size: 0.9em;
}

:not(pre) > code {
  padding: 0.1em 0.35em;
  background: var(--gc-surface-elevated);
  border-radius: var(--gc-radius-sm);
}

/* Small uppercase technical label (mono, tracked). */
.gc-eyebrow,
.gc-label {
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gc-text-muted);
}

.gc-lead {
  max-inline-size: 42rem;
  font-size: var(--gc-text-lg);
  color: var(--gc-text-secondary);
}

/* Vertical rhythm: direct children are separated by --flow. */
.gc-flow > * + * {
  margin-block-start: var(--flow, var(--gc-space-4));
}

/* ==========================================================================
   4. Layout: shell, header, progress navigation, footer
   ========================================================================== */

.gc-shell {
  display: flex;
  flex-direction: column;
  min-block-size: 100vh;
}

.gc-wrap {
  inline-size: 100%;
  max-inline-size: var(--gc-content-max);
  margin-inline: auto;
  padding-inline: var(--gc-gutter);
}

.gc-main {
  flex: 1 0 auto;
  padding-block: var(--gc-space-5) var(--gc-space-7);
  --flow: var(--gc-space-5);
}

.gc-main:focus {
  outline: none; /* programmatic skip-link target only */
}

/* Decorative three-part mark, always in the same fixed order. */
.gc-motif,
.gc-rule::before,
.gc-panel--evidence::before,
.gc-state::before {
  content: "";
  display: block;
  flex: none;
  inline-size: var(--gc-mark-width);
  block-size: var(--gc-mark-height);
  background: var(--gc-mark);
}

/* Incident header */
.gc-header {
  background: var(--gc-surface);
  border-block-end: 1px solid var(--gc-border);
}

.gc-header__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gc-space-3) var(--gc-space-5);
  padding-block: var(--gc-space-3);
}

.gc-brand {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gc-space-1) var(--gc-space-3);
  color: var(--gc-text);
  text-decoration: none;
}

.gc-brand__id,
.gc-brand__title {
  font-family: var(--gc-font-mono);
  text-transform: uppercase;
}

.gc-brand__id {
  font-size: var(--gc-text-lg);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.gc-brand__title {
  padding-inline-start: var(--gc-space-3);
  border-inline-start: 1px solid var(--gc-border-strong);
  font-size: var(--gc-text-sm);
  letter-spacing: 0.18em;
  color: var(--gc-text-secondary);
}

.gc-header__context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gc-space-1) var(--gc-space-5);
}

.gc-ident {
  font-family: var(--gc-font-mono);
  font-weight: 700;
  letter-spacing: 0.14em;
}

.gc-inline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gc-space-1) var(--gc-space-5);
}

.gc-inline-meta__item {
  display: flex;
  gap: var(--gc-space-2);
  font-size: var(--gc-text-sm);
}

.gc-inline-meta dt {
  color: var(--gc-text-muted);
}

.gc-inline-meta dt::after {
  content: ":";
}

.gc-inline-meta dd {
  margin: 0;
  font-family: var(--gc-font-mono);
  color: var(--gc-text);
}

/* Evidence / progress navigation. The list background shows through the 1px gaps as dividers. */
.gc-progress {
  background: var(--gc-surface);
  border-block-start: 1px solid var(--gc-separator);
}

.gc-progress__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: var(--gc-space-3) 0;
  padding: 0;
  list-style: none;
  background: var(--gc-border);
  border: 1px solid var(--gc-border);
  border-radius: var(--gc-radius);
  overflow: hidden;
}

.gc-progress__item {
  min-inline-size: 0;
  background: var(--gc-surface-2);
}

.gc-progress__item--final {
  grid-column: 1 / -1;
}

.gc-progress__link {
  display: flex;
  flex-direction: column;
  gap: var(--gc-space-1);
  block-size: 100%;
  padding: var(--gc-space-2) var(--gc-space-3);
  color: var(--gc-state-fg, var(--gc-text));
  text-decoration: none;
  transition: background-color var(--gc-transition);
}

a.gc-progress__link:hover {
  background: var(--gc-surface-elevated);
  color: var(--gc-state-fg, var(--gc-text));
}

.gc-progress__link:focus-visible {
  outline-offset: -3px;
}

.gc-progress__label {
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-sm);
  letter-spacing: 0.04em;
}

/* Final stage: a heavier left edge, independent of colour and of the state styling. */
.gc-progress__item--final .gc-progress__link {
  border-inline-start: 3px solid var(--gc-border-strong);
}

.gc-progress__state {
  display: inline-flex;
  align-items: center;
  gap: var(--gc-space-2);
  font-size: var(--gc-text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gc-progress__item[data-state="current"] {
  background: var(--gc-surface-elevated);
  box-shadow: inset 0 2px 0 var(--gc-white);
}

.gc-progress__item[data-state="current"] .gc-progress__label {
  font-weight: 700;
}

.gc-progress__item[data-state="locked"] {
  background: var(--gc-surface-2) var(--gc-locked-hatch);
}

/* Narrow-display recommendation; hidden on wide displays, never blocks use. */
.gc-viewport-notice {
  margin-block-start: var(--gc-space-4);
}

/* Footer / status line */
.gc-footer {
  background: var(--gc-surface);
  border-block-start: 1px solid var(--gc-border);
}

.gc-footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gc-space-2) var(--gc-space-5);
  padding-block: var(--gc-space-3);
}

.gc-statusline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gc-space-1) var(--gc-space-4);
  padding: 0;
  list-style: none;
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gc-text-muted);
}

.gc-statusline a {
  color: inherit;
}

.gc-activity {
  display: inline-block;
  inline-size: 0.5rem;
  block-size: 0.5rem;
  margin-inline-end: var(--gc-space-2);
  background: var(--gc-white);
  border-radius: 50%;
}

/* ==========================================================================
   5. Components
   ========================================================================== */

/* State map. Shared by badges, progress items and any future stateful element.
   Each state sets text colour, edge colour and glyph; the visible word stays authoritative. */
[data-state="current"] {
  --gc-state-fg: var(--gc-white);
  --gc-state-edge: var(--gc-white);
  --gc-glyph-fill: currentColor;
}

[data-state="available"] {
  --gc-state-fg: var(--gc-text);
  --gc-state-edge: var(--gc-text-secondary);
  --gc-glyph-radius: 50%;
}

[data-state="resolved"] {
  --gc-state-fg: var(--gc-text-secondary);
  --gc-state-edge: var(--gc-border-strong);
  --gc-glyph-fill: currentColor;
  --gc-glyph-radius: 50%;
}

[data-state="confirmed"] {
  --gc-state-fg: var(--gc-confirmed);
  --gc-state-edge: var(--gc-confirmed);
  --gc-glyph-fill: currentColor;
  --gc-glyph-radius: 50%;
}

[data-state="locked"] {
  --gc-state-fg: var(--gc-locked);
  --gc-state-edge: var(--gc-locked-border);
  --gc-state-line: dashed;
  --gc-glyph-fill: repeating-linear-gradient(135deg, currentColor 0 1px, transparent 1px 3px);
}

[data-state="warning"],
[data-state="critical"] {
  --gc-state-fg: var(--gc-critical-text);
  --gc-state-edge: var(--gc-critical);
  --gc-glyph-fill: currentColor;
  --gc-glyph-turn: 45deg;
}

[data-state="critical"] {
  --gc-state-bg: var(--gc-critical-surface);
}

/* Glyph: a small shape (square, ring, disc, hatched square, diamond) that backs up the status word. */
.gc-progress__state::before,
.gc-badge[data-state]::before {
  content: "";
  flex: none;
  inline-size: 0.6875rem;
  block-size: 0.6875rem;
  border: 2px solid currentColor;
  border-radius: var(--gc-glyph-radius, 0);
  background: var(--gc-glyph-fill, transparent);
  transform: rotate(var(--gc-glyph-turn, 0deg));
}

/* Status badge */
.gc-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--gc-space-2);
  padding: 0.125rem var(--gc-space-2);
  border: 1px var(--gc-state-line, solid) var(--gc-state-edge, var(--gc-border-strong));
  border-radius: var(--gc-radius-sm);
  background: var(--gc-state-bg, transparent);
  color: var(--gc-state-fg, var(--gc-text-secondary));
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Panels */
.gc-panel {
  position: relative;
  background: var(--gc-surface);
  border: 1px solid var(--gc-border);
  border-radius: var(--gc-radius);
}

.gc-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gc-space-2) var(--gc-space-3);
  padding: var(--gc-space-3) var(--gc-space-4);
  background: var(--gc-surface-2);
  border-block-end: 1px solid var(--gc-separator);
  border-radius: var(--gc-radius) var(--gc-radius) 0 0;
}

.gc-panel__title {
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gc-text-secondary);
}

.gc-panel__body {
  padding: var(--gc-space-4);
  --flow: var(--gc-space-3);
}

/* Evidence panel: standard panel plus a panel-edge accent. */
.gc-panel--evidence {
  border-color: var(--gc-border-strong);
}

.gc-panel--evidence::before,
.gc-state::before {
  position: absolute;
  inset-block-start: -1px;
  inset-inline-start: var(--gc-space-4);
}

/* Separator with the mark at its start. Decorative: mark up as <div class="gc-rule" aria-hidden="true"></div>. */
.gc-rule {
  display: flex;
  align-items: center;
  gap: var(--gc-space-3);
}

.gc-rule::after {
  content: "";
  flex: 1;
  block-size: 1px;
  background: var(--gc-separator);
}

/* Key/value metadata */
.gc-meta {
}

.gc-meta__row {
  display: grid;
  grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr);
  gap: var(--gc-space-1) var(--gc-space-4);
  padding-block: var(--gc-space-2);
  border-block-end: 1px solid var(--gc-separator);
}

.gc-meta__row:last-child {
  border-block-end: 0;
}

.gc-meta dt {
  font-size: var(--gc-text-sm);
  color: var(--gc-text-muted);
}

.gc-meta dd {
  margin: 0;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.gc-meta__mono {
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-sm);
}

/* Technical metadata group: a titled, bordered set of rows. */
.gc-meta-group {
  background: var(--gc-surface-2);
  border: 1px solid var(--gc-border);
  border-radius: var(--gc-radius);
}

.gc-meta-group__title {
  padding: var(--gc-space-2) var(--gc-space-4);
  border-block-end: 1px solid var(--gc-separator);
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gc-text-muted);
}

.gc-meta-group .gc-meta {
  padding-inline: var(--gc-space-4);
}

/* Notices. The label word is always present; border weight and colour only reinforce it. */
.gc-notice {
  padding: var(--gc-space-3) var(--gc-space-4);
  background: var(--gc-surface-2);
  border: 1px solid var(--gc-border-strong);
  border-inline-start-width: 4px;
  border-radius: var(--gc-radius);
  color: var(--gc-text-secondary);
}

.gc-notice__label {
  display: inline-block;
  margin-inline-end: var(--gc-space-2);
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gc-text);
}

.gc-notice--warning,
.gc-notice--error {
  background: var(--gc-critical-surface);
  border-color: var(--gc-critical);
  color: var(--gc-text);
}

.gc-notice--warning .gc-notice__label,
.gc-notice--error .gc-notice__label {
  color: var(--gc-critical-text);
}

.gc-notice--error {
  border-width: 2px;
  border-inline-start-width: 6px;
}

/* Buttons (<button> or <a>) */
.gc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gc-space-3);
}

.gc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gc-space-2);
  min-block-size: 2.75rem;
  padding: var(--gc-space-2) var(--gc-space-5);
  background: var(--gc-surface-elevated);
  border: 1px solid var(--gc-border-strong);
  border-radius: var(--gc-radius);
  color: var(--gc-text);
  font: 600 var(--gc-text-base) / 1.2 var(--gc-font-ui);
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--gc-transition), border-color var(--gc-transition), color var(--gc-transition);
}

.gc-btn:hover {
  background: var(--gc-border);
  border-color: var(--gc-white);
  color: var(--gc-white);
}

.gc-btn--primary {
  background: var(--gc-white);
  border-color: var(--gc-white);
  color: var(--gc-black);
}

.gc-btn--primary:hover {
  background: var(--gc-text-secondary);
  border-color: var(--gc-text-secondary);
  color: var(--gc-black);
}

/* Reserved for restricted or sensitive actions. */
.gc-btn--restricted {
  background: transparent;
  border-color: var(--gc-critical);
  color: var(--gc-critical-text);
}

.gc-btn--restricted:hover {
  background: var(--gc-critical-surface);
  border-color: var(--gc-critical-text);
  color: var(--gc-critical-text);
}

.gc-btn[disabled],
.gc-btn[aria-disabled="true"] {
  background: transparent;
  border-style: dashed;
  border-color: var(--gc-locked-border);
  color: var(--gc-locked);
  cursor: not-allowed;
}

/* Form fields */
.gc-form {
  display: grid;
  gap: var(--gc-space-4);
  max-inline-size: 36rem;
}

.gc-field {
  display: grid;
  gap: var(--gc-space-1);
}

.gc-field__label {
  font-size: var(--gc-text-sm);
  font-weight: 600;
}

.gc-field__hint {
  font-size: var(--gc-text-sm);
  color: var(--gc-text-muted);
}

.gc-field__error {
  font-size: var(--gc-text-sm);
  color: var(--gc-critical-text);
}

.gc-input {
  inline-size: 100%;
  min-block-size: 2.75rem;
  padding: var(--gc-space-2) var(--gc-space-3);
  background: var(--gc-bg);
  border: 1px solid var(--gc-border-strong);
  border-radius: var(--gc-radius);
  color: var(--gc-text);
  caret-color: var(--gc-white);
  font: var(--gc-text-base) / 1.4 var(--gc-font-mono);
  transition: border-color var(--gc-transition);
}

.gc-input::placeholder {
  color: var(--gc-text-muted);
  opacity: 1;
}

.gc-input:hover {
  border-color: var(--gc-text-secondary);
}

.gc-input[aria-invalid="true"] {
  border: 2px solid var(--gc-critical);
}

.gc-input[disabled] {
  border-style: dashed;
  border-color: var(--gc-locked-border);
  color: var(--gc-locked);
  cursor: not-allowed;
}

/* Locked / error state presentation */
.gc-state {
  position: relative;
  display: grid;
  justify-items: start;
  gap: var(--gc-space-4);
  max-inline-size: 40rem;
  padding: var(--gc-space-6) var(--gc-space-5) var(--gc-space-5);
  background: var(--gc-surface);
  border: 1px solid var(--gc-border);
  border-radius: var(--gc-radius);
}

.gc-state--locked {
  border: 1px dashed var(--gc-locked-border);
  background: var(--gc-surface) var(--gc-locked-hatch);
}

.gc-state--error {
  border-color: var(--gc-critical);
}

.gc-state__text {
  max-inline-size: 34rem;
  color: var(--gc-text-secondary);
}

/* Hint container placeholder (behaviour follows in a later work package). */
.gc-hints {
  padding: var(--gc-space-4);
  border: 1px dashed var(--gc-locked-border);
  border-radius: var(--gc-radius);
  background: var(--gc-surface);
}

.gc-hints__title {
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gc-text-secondary);
}

.gc-hints__empty {
  margin-block-start: var(--gc-space-2);
  font-size: var(--gc-text-sm);
  color: var(--gc-text-muted);
}

/* Progressive hints (WP007): a secondary panel below the evidence interaction. The server only ever sends the hints
   that are revealed, so nothing here hides or shows content. The level is stated in words (badge, status line, labels),
   never by colour alone. The panel is a fragment target (#hints) and takes focus when it is reached. */
.gc-panel--hints {
  scroll-margin-block-start: var(--gc-space-4);
}

/* Where the redirect after a reveal lands. Browsers do not always treat that programmatic focus as :focus-visible, so the
   target itself is drawn: border and ring, in addition to the words in the panel. */
.gc-panel--hints:target {
  border-color: var(--gc-white);
  outline: 2px solid var(--gc-focus);
  outline-offset: 2px;
}

.gc-hintpanel__status {
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-sm);
  color: var(--gc-text);
}

.gc-hintpanel__note {
  font-size: var(--gc-text-sm);
  color: var(--gc-text-secondary);
}

.gc-hintlist {
  display: grid;
  gap: var(--gc-space-4);
  padding: 0;
  list-style: none;
}

.gc-hintlist__item {
  min-inline-size: 0;
  padding-inline-start: var(--gc-space-4);
  border-inline-start: 2px solid var(--gc-border-strong);
}

.gc-hintlist__label {
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gc-text-secondary);
}

/* Hint copy is prose with inline code (paths, commands, addresses): it wraps, it never scrolls the page sideways. */
.gc-hintlist__text {
  margin-block-start: var(--gc-space-1);
  max-inline-size: 46rem;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   6. Forensic / raw-data presentation
   Raw artifacts are shown exactly as given: monospace, whitespace preserved,
   never re-wrapped. Long lines scroll horizontally inside the block.
   ========================================================================== */

.gc-raw,
.gc-terminal {
  max-inline-size: 100%;
  min-inline-size: 0;
  border: 1px solid var(--gc-border);
  border-radius: var(--gc-radius);
  overflow: hidden;
}

.gc-raw__head,
.gc-terminal__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--gc-space-1) var(--gc-space-4);
  padding: var(--gc-space-2) var(--gc-space-4);
  background: var(--gc-surface-2);
  border-block-end: 1px solid var(--gc-separator);
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-xs);
  color: var(--gc-text-muted);
}

.gc-raw__name {
  font-weight: 600;
  color: var(--gc-text);
}

/* Shared scroll-body rules for every raw-text block. Mark up as
   <pre class="…" tabindex="0" role="region" aria-labelledby="…"> so keyboard users can scroll it. */
.gc-raw__body,
.gc-terminal__screen,
.gc-code,
.gc-log {
  display: block;
  padding: var(--gc-space-4);
  overflow-x: auto;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  tab-size: 8;
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-sm);
  line-height: 1.55;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  color: var(--gc-text);
  scrollbar-color: var(--gc-border-strong) var(--gc-surface-2);
}

.gc-raw__body:focus-visible,
.gc-terminal__screen:focus-visible,
.gc-code:focus-visible,
.gc-log:focus-visible {
  outline-offset: -3px;
}

.gc-raw__body {
  background: var(--gc-bg);
}

.gc-code {
  background: var(--gc-surface);
  border: 1px solid var(--gc-border);
  border-radius: var(--gc-radius);
}

.gc-log {
  background: var(--gc-surface);
  border: 1px solid var(--gc-border);
  border-inline-start: 3px solid var(--gc-border-strong);
  border-radius: var(--gc-radius);
  line-height: 1.45;
  color: var(--gc-text-secondary);
}

/* Command / output presentation */
.gc-terminal {
  border-color: var(--gc-border-strong);
}

.gc-terminal__screen {
  background: var(--gc-black);
}

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

.gc-terminal__cmd {
  font-weight: 700;
  color: var(--gc-white);
}

.gc-terminal__out {
  color: var(--gc-text);
}

/* Interactive command line below the transcript: prompt and input on one row, wrapping on narrow screens. */
.gc-terminal__form {
  display: grid;
  gap: var(--gc-space-2);
  padding: var(--gc-space-4);
  background: var(--gc-black);
  border-block-start: 1px solid var(--gc-separator);
}

.gc-terminal__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gc-space-2) var(--gc-space-3);
}

.gc-terminal__line .gc-terminal__prompt {
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-sm);
  overflow-wrap: anywhere;
}

.gc-terminal__input {
  flex: 1 1 14rem;
  inline-size: auto;
  min-inline-size: 0;
}

/* ==========================================================================
   7. Page compositions
   ========================================================================== */

.gc-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gc-space-1) var(--gc-space-4);
}

.gc-page-head .gc-eyebrow {
  flex-basis: 100%;
}

.gc-hero {
  display: grid;
  justify-items: start;
  gap: var(--gc-space-4);
  padding-block: var(--gc-space-4) var(--gc-space-2);
}

.gc-hero__sub {
  display: block;
  font-family: var(--gc-font-mono);
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gc-text-secondary);
}

.gc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gc-space-5);
}

.gc-grid > * {
  min-inline-size: 0;
}

.gc-index {
  padding: 0;
  list-style: none;
}

.gc-index__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gc-space-2) var(--gc-space-4);
  padding: var(--gc-space-3) var(--gc-space-4);
  border-block-end: 1px solid var(--gc-separator);
}

.gc-index__row:last-child {
  border-block-end: 0;
}

.gc-index__name {
  font-family: var(--gc-font-mono);
  color: var(--gc-state-fg, var(--gc-text));
}

.gc-index__note {
  padding: var(--gc-space-3) var(--gc-space-4);
  border-block-start: 1px solid var(--gc-separator);
  font-size: var(--gc-text-sm);
  color: var(--gc-text-muted);
}

/* Completed incident report (WP008). Closed-state presentation: restrained, mono identifiers, text carries the state. */
.gc-status-tag {
  flex-basis: 100%;
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-sm);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--gc-text-secondary);
}

.gc-summary {
  display: grid;
  gap: var(--gc-space-3) var(--gc-space-6);
  padding: var(--gc-space-4);
  background: var(--gc-surface-2);
  border: 1px solid var(--gc-border);
  border-inline-start: 4px solid var(--gc-border-strong);
  border-radius: var(--gc-radius);
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-sm);
  letter-spacing: 0.08em;
}

.gc-summary__status {
  font-weight: 600;
}

.gc-summary__time {
  color: var(--gc-text-secondary);
}

.gc-summary time {
  color: var(--gc-text);
  font-weight: 600;
}

/* Verification matrix: one row per evidence stage. The row header names the stage; the last cell states the result in words. */
.gc-matrix {
  inline-size: 100%;
  border-collapse: collapse;
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-sm);
  letter-spacing: 0.06em;
}

.gc-matrix th,
.gc-matrix td {
  padding: var(--gc-space-2) var(--gc-space-3);
  border-block-end: 1px solid var(--gc-separator);
  text-align: start;
  vertical-align: baseline;
}

.gc-matrix th {
  font-weight: 600;
  color: var(--gc-text-muted);
  white-space: nowrap;
}

.gc-matrix td:last-child {
  text-align: end;
}

.gc-readout {
  font-family: var(--gc-font-mono);
  font-weight: 600;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}

dd.gc-readout {
  margin: 0;
  min-inline-size: 0;
  font-size: var(--gc-text-lg);
}

/* Images that are served as stored: scaled by the browser only, never cropped, filtered or restyled. */
.gc-figure {
  display: grid;
  gap: var(--gc-space-3);
  padding-block-start: var(--gc-space-4);
  border-block-start: 1px solid var(--gc-separator);
}

.gc-figure__title {
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-sm);
  letter-spacing: 0.1em;
}

.gc-figure__note {
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-xs);
  letter-spacing: 0.06em;
  color: var(--gc-text-muted);
}

.gc-figure__image {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--gc-border);
}

.gc-closure {
  display: grid;
  gap: var(--gc-space-2);
  padding: var(--gc-space-4) var(--gc-space-5);
  border-block: 1px solid var(--gc-border-strong);
}

.gc-closure h2 {
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-base);
  letter-spacing: 0.1em;
}

.gc-closure p {
  color: var(--gc-text-secondary);
}

/* A deliberately quiet action: a text link, not a button. */
.gc-action-secondary {
  font-size: var(--gc-text-sm);
  color: var(--gc-text-muted);
}

.gc-action-secondary a {
  color: inherit;
}

/* Development component reference (/_dev/components): palette swatches. */
.gc-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: var(--gc-space-3);
  padding: 0;
  list-style: none;
}

.gc-swatch {
  display: grid;
  gap: var(--gc-space-1);
  font-family: var(--gc-font-mono);
  font-size: var(--gc-text-xs);
  color: var(--gc-text-secondary);
}

.gc-swatch::before {
  content: "";
  block-size: 2.5rem;
  background: var(--gc-swatch);
  border: 1px solid var(--gc-border-strong);
  border-radius: var(--gc-radius-sm);
}

.gc-swatch[data-swatch="bg"] { --gc-swatch: var(--gc-bg); }
.gc-swatch[data-swatch="surface"] { --gc-swatch: var(--gc-surface); }
.gc-swatch[data-swatch="surface-2"] { --gc-swatch: var(--gc-surface-2); }
.gc-swatch[data-swatch="elevated"] { --gc-swatch: var(--gc-surface-elevated); }
.gc-swatch[data-swatch="text"] { --gc-swatch: var(--gc-text); }
.gc-swatch[data-swatch="text-secondary"] { --gc-swatch: var(--gc-text-secondary); }
.gc-swatch[data-swatch="text-muted"] { --gc-swatch: var(--gc-text-muted); }
.gc-swatch[data-swatch="critical"] { --gc-swatch: var(--gc-critical); }
.gc-swatch[data-swatch="locked"] { --gc-swatch: var(--gc-locked-hatch); }
.gc-swatch[data-swatch="black"] { --gc-swatch: var(--gc-mark-black); }
.gc-swatch[data-swatch="white"] { --gc-swatch: var(--gc-mark-white); }

/* ==========================================================================
   8. Responsive rules
   Base styles above are the narrow layout (stacked, wrapped). Wide-layout
   rules sit in the min-width block. Nothing is hidden on narrow screens; the
   large-display notice is the only element hidden on wide ones.
   ========================================================================== */

@media (max-width: 379px) {
  .gc-brand__title {
    padding-inline-start: 0;
    border-inline-start: 0;
  }
}

@media (max-width: 559px) {
  .gc-meta__row {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The verification matrix keeps its three columns on a phone: tighter cells and type, the stage title may wrap. */
  .gc-matrix {
    font-size: var(--gc-text-xs);
    letter-spacing: 0.02em;
  }

  .gc-matrix th,
  .gc-matrix td {
    padding-inline: var(--gc-space-2);
  }

  .gc-matrix th {
    white-space: normal;
  }

  .gc-btn {
    inline-size: 100%;
  }
}

@media (max-width: 379px) {
  .gc-matrix {
    font-size: 0.6875rem;
    letter-spacing: 0;
  }

  .gc-matrix th,
  .gc-matrix td {
    padding-inline: var(--gc-space-1);
  }

  .gc-matrix .gc-badge {
    padding-inline: var(--gc-space-1);
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
  }
}

@media (min-width: 900px) {
  :root {
    --gc-gutter: var(--gc-space-6);
  }

  .gc-viewport-notice {
    display: none;
  }

  .gc-statusline li + li {
    padding-inline-start: var(--gc-space-4);
    border-inline-start: 1px solid var(--gc-border);
  }

  .gc-progress__list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .gc-progress__item--final {
    grid-column: auto;
  }

  .gc-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gc-panel__body {
    padding: var(--gc-space-5);
  }
}

/* ==========================================================================
   9. Accessibility: motion and forced colours
   ========================================================================== */

/* The only animation is a slow opacity pulse on the status-line indicator. */
@media (prefers-reduced-motion: no-preference) {
  .gc-activity {
    animation: gc-pulse 4s ease-in-out infinite;
  }
}

@keyframes gc-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .gc-motif,
  .gc-rule::before,
  .gc-panel--evidence::before,
  .gc-state::before {
    forced-color-adjust: none;
  }

  .gc-panel,
  .gc-badge,
  .gc-notice,
  .gc-state,
  .gc-progress__list {
    border-color: CanvasText;
  }
}
