/* Gridlock page (/gridlock) — banded system map + guided journey.
   Reuses the architecture-page shell (.architecture-page, .arch-section,
   .quality-badge) from architecture.css; everything gl-* lives here. */

.gridlock-page { max-width: 1280px; }

/* ── Legend ─────────────────────────────────────────────────────────── */
.gl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.gl-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}
.gl-swatch-physical    { background: #3d4d63; }
.gl-swatch-institution { background: #1f6feb; }
.gl-swatch-stakeholder { background: #9e6a03; }
.gl-edge-key {
  display: inline-block;
  width: 22px;
  height: 0;
  border-top: 2px solid #9fb4c7;
  margin-right: 4px;
  vertical-align: middle;
}
.gl-edge-key-approval { border-color: #79b8ff; border-top-style: dashed; }
.gl-edge-key-money    { border-color: #7fdca0; border-top-style: dotted; border-top-width: 3px; }
.gl-edge-key-tension  { border-color: #f47067; border-top-style: dashed; }

/* ── SVG map ────────────────────────────────────────────────────────── */
.gl-svg-wrap {
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #0e1116;
  padding: 8px;
}
.gl-svg { width: 100%; height: auto; display: block; }

.gl-band-label {
  fill: #4d5866;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gl-node rect {
  fill: #3d4d63;
  stroke: #30363d;
  stroke-width: 1;
  transition: filter 0.12s ease, opacity 0.35s ease;
}
.gl-node { cursor: pointer; transition: opacity 0.35s ease; }
.gl-node:hover rect { filter: brightness(1.35); }
.gl-node-physical rect    { fill: #3d4d63; }
.gl-node-institution rect { fill: #1f6feb; }
.gl-node-stakeholder rect { fill: #9e6a03; }

.gl-node-label {
  color: var(--fg);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  overflow: hidden;
}

.gl-edge {
  fill: none;
  stroke-width: 2;
  cursor: pointer;
  opacity: 0.85;
  transition: stroke-width 0.12s ease, opacity 0.35s ease;
}
.gl-edge:hover { stroke-width: 3.4; opacity: 1; }
.gl-edge-physical { stroke: #9fb4c7; }
.gl-edge-approval { stroke: #79b8ff; stroke-dasharray: 6 4; }
.gl-edge-money    { stroke: #7fdca0; stroke-dasharray: 2 4; stroke-linecap: round; }
.gl-edge-tension  { stroke: #f47067; stroke-dasharray: 8 3; }

/* Journey / explore focus states. Dim is heavy so the focused path pops. */
.gl-dimmable.gl-dim { opacity: 0.13; }
.gl-node.gl-focus rect { filter: brightness(1.25); stroke: #e6edf3; stroke-width: 1.5; }
.gl-edge.gl-focus { stroke-width: 3.2; opacity: 1; }

/* ── Cursor tooltip ─────────────────────────────────────────────────── */
.gl-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 320px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--fg);
  pointer-events: none;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.gl-tip-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.gl-tip-physical    { color: #9fb4c7; }
.gl-tip-institution { color: #79b8ff; }
.gl-tip-stakeholder { color: #e3b341; }
.gl-tip-kind {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}
.gl-tip-hint { margin-top: 6px; font-size: 10.5px; color: var(--muted); }

/* ── Detail panel (click-to-pin) ────────────────────────────────────── */
.gl-panel {
  margin-top: 12px;
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #161b22;
  padding: 14px 16px;
}
.gl-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.gl-panel-title { font-size: 15px; font-weight: 600; }
.gl-panel-close {
  background: none;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  padding: 2px 8px;
  cursor: pointer;
}
.gl-panel-close:hover { border-color: var(--accent); color: var(--accent); }
.gl-panel-kind {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 8px;
}
.gl-panel-simple { font-size: 13.5px; margin-bottom: 8px; }
.gl-panel-detail { font-size: 12.5px; color: #b6c2cf; margin-bottom: 8px; }

.gl-stat {
  display: block;
  margin: 6px 0;
  padding: 7px 10px;
  background: #0e1116;
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-size: 12.5px;
}
.gl-stat-source {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.gl-stat-source a { color: var(--accent); }

.gl-incentive {
  margin: 6px 0;
  padding: 7px 10px;
  background: #0e1116;
  border-left: 2px solid #9e6a03;
  border-radius: 0 4px 4px 0;
  font-size: 12.5px;
}
.gl-editorial-chip {
  display: inline-block;
  padding: 0 6px;
  margin-right: 4px;
  border-radius: 8px;
  background: #6e40c9;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.gl-panel-refs { margin-top: 8px; font-size: 11.5px; color: var(--muted); }

/* ── Speed-it-up mode ───────────────────────────────────────────────── */
.gl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 4px;
  align-items: center;
}
.gl-zap-badge {
  font-size: 13px;
  text-anchor: end;
  pointer-events: none;
}
.gl-speed-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #161b22;
  color: #e3b341;
  border: 1px solid #9e6a03;
  border-radius: 6px;
  padding: 9px 16px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.gl-speed-toggle:hover { border-color: #e3b341; }
.gl-speed-toggle.gl-speed-on { background: #9e6a03; color: #fff; }
.gl-speed-toggle[hidden] { display: none; }
.gl-speed-hint {
  margin: 8px 0 0;
  padding: 8px 12px;
  border: 1px dashed #9e6a03;
  border-radius: 6px;
  font-size: 12.5px;
  color: #e3b341;
  background: rgba(158, 106, 3, 0.08);
}

.gl-intervention {
  margin: 8px 0;
  padding: 9px 12px;
  background: #0e1116;
  border: 1px solid #30363d;
  border-left: 2px solid #e3b341;
  border-radius: 0 4px 4px 0;
  font-size: 12.5px;
}
.gl-iv-label { font-weight: 650; color: #e3b341; margin-bottom: 6px; }
.gl-iv-row { margin: 5px 0; }
.gl-iv-tag {
  display: inline-block;
  padding: 0 6px;
  margin-right: 5px;
  border-radius: 8px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.gl-iv-tag-speedup { background: #1f6feb; color: #fff; }
.gl-iv-tag-bill    { background: #b62324; color: #fff; }
.gl-iv-model {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed #30363d;
}
.gl-iv-model-note { color: #b6c2cf; margin-bottom: 5px; }
.gl-iv-model-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.gl-iv-model-link:hover { text-decoration: underline; }
.gl-iv-model-link code {
  font-size: 11px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}
.gl-iv-model-hint {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--muted);
}

/* ── Journey card ───────────────────────────────────────────────────── */
.gl-journey-launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 4px;
  background: #1f6feb;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.gl-journey-launch:hover { background: #388bfd; }
/* Explicit display would otherwise defeat the [hidden] attribute the journey
   engine toggles. */
.gl-journey-launch[hidden] { display: none; }

.gl-journey {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  margin-top: 12px;
  border: 1px solid #388bfd;
  border-radius: 8px;
  background: #10161f;
  padding: 14px 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}
.gl-journey-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.gl-journey-dots { display: flex; gap: 5px; align-items: center; }
.gl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #30363d;
  border: none;
  padding: 0;
  cursor: pointer;
}
.gl-dot.gl-dot-active { background: var(--accent); }
.gl-dot.gl-dot-done { background: #388bfd; }
.gl-journey-count {
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}
.gl-journey-title { font-size: 15px; font-weight: 650; margin-bottom: 4px; }
.gl-journey-simple { font-size: 13.5px; margin-bottom: 8px; }
.gl-journey-detailwrap { border-top: 1px dashed #30363d; padding-top: 8px; margin-top: 4px; }
.gl-journey-detail { font-size: 12.5px; color: #b6c2cf; margin-bottom: 6px; }
.gl-journey-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.gl-btn {
  background: #161b22;
  color: var(--fg);
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 5px 12px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.gl-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.gl-btn:disabled { opacity: 0.4; cursor: default; }
.gl-btn-primary { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.gl-btn-primary:hover:not(:disabled) { background: #388bfd; color: #fff; }
.gl-wonk-toggle[aria-pressed="true"] { border-color: #6e40c9; color: #c9a7ff; }
.gl-journey-hint { font-size: 10.5px; color: var(--muted); margin-left: auto; }

/* ── Idea chat ──────────────────────────────────────────────────────── */
.gl-chat {
  margin-top: 20px;
  border: 1px solid #30363d;
  border-radius: 8px;
  background: #10161f;
  padding: 14px 16px;
}
.gl-chat-head { font-size: 15px; font-weight: 650; margin-bottom: 4px; }
.gl-chat-intro { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.gl-chat-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  margin-bottom: 10px;
}
.gl-chat-msg {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  white-space: pre-wrap;
  max-width: 85%;
}
.gl-chat-user {
  align-self: flex-end;
  background: #1f6feb;
  color: #fff;
}
.gl-chat-assistant {
  align-self: flex-start;
  background: #161b22;
  border: 1px solid #30363d;
}
.gl-chat-form { display: flex; gap: 8px; align-items: flex-end; }
.gl-chat-input {
  flex: 1;
  resize: vertical;
  background: #0e1116;
  color: var(--fg);
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  min-height: 40px;
}
.gl-chat-input:focus { outline: none; border-color: var(--accent); }
.gl-chat-send { white-space: nowrap; }

@media (max-width: 700px) {
  .gl-journey { position: static; }
  .gl-journey-hint { display: none; }
}
