/* Header, chapters, map, notices, overlay. Square corners and 1px borders
   throughout — that silhouette is the series signature. */

/* ── header ─────────────────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { display: block; }

.header-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.header-path {
  display: none;
  align-items: center;
  gap: var(--u);
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-family: var(--mono);
  font-size: var(--fs-small);
}
.header-path-label { color: var(--text-muted); letter-spacing: 1.5px; }
.header-path-value { color: var(--accent-1); }

.header-actions { display: flex; gap: var(--u); margin-left: auto; }

.btn {
  padding: 8px 14px;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.btn:hover { color: var(--text); border-color: var(--text-secondary); }
.btn-accent { border-color: var(--accent-1); color: var(--accent-1); }
.btn-accent:hover { background: var(--accent-1); color: var(--bg); }
.btn-small { padding: 6px 10px; font-size: 10px; }
.btn-github { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text); }
.btn-github svg { display: block; width: 16px; height: 16px; }
.github-stars { font-size: 11px; letter-spacing: 1px; }
.github-stars::before { content: '★ '; color: var(--accent-1); }
.btn[aria-expanded='true'] { color: var(--accent-1); border-color: var(--accent-1); }

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
}
.link-btn:hover { color: var(--accent-1); }

/* ── chapters ───────────────────────────────────────────────────────────── */
.pane-chapters { overflow-y: auto; }

.chapter-list { padding: var(--u) 0; }

.chapter {
  border-bottom: 1px solid rgba(53, 65, 88, .5);
}

.chapter-btn {
  display: grid;
  grid-template-columns: 22px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--u);
  width: 100%;
  padding: 12px calc(var(--u) * 2);
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.chapter-btn:hover { background: var(--bg-surface); }
.chapter.is-current .chapter-btn { border-left-color: var(--accent-1); background: var(--bg-surface); }

.chapter-index {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}
.chapter.is-current .chapter-index { color: var(--accent-1); }

.chapter-title {
  font-family: var(--mono);
  font-size: var(--fs-small);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* What the arc name actually teaches — SCAN/HONESTY/DECIDE alone tell a
   beginner nothing about the content. */
.chapter-subtitle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--text-muted);
}
.chapter.is-current .chapter-title { color: var(--text); }
.chapter.is-done .chapter-title { color: var(--accent-4); }

.chapter-progress {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.chapter.is-done .chapter-progress { color: var(--accent-4); }

.chapter-blurb {
  padding: 0 calc(var(--u) * 2) 12px calc(var(--u) * 2 + 3px);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.chapter-links {
  display: flex;
  gap: calc(var(--u) * 2);
  padding: 0 calc(var(--u) * 2) 14px calc(var(--u) * 2 + 3px);
}

.step-card {
  margin: 0 calc(var(--u) * 2) calc(var(--u) * 2);
  padding: calc(var(--u) * 1.5);
  border: 1px solid var(--border-bright);
  background: var(--bg-card);
}
.step-kicker { color: var(--accent-1); }
.step-instruct { margin-top: var(--u); font-size: 14px; }
.step-actions { display: flex; gap: var(--u); margin-top: calc(var(--u) * 1.5); }

/* A gentle "not it yet" that appears after a few missed attempts. */
.step-nudge {
  margin-top: var(--u);
  font-size: 12px;
  color: var(--text-muted);
}

.teach { margin-top: calc(var(--u) * 1.5); padding: var(--u); border-left: 2px solid var(--accent-2); background: var(--wash-info); }
/* Labels the box as an explanation of the step just finished, so it never
   reads as part of the instruction above it. */
.teach-kicker { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
.teach.tone-warn { border-left-color: var(--accent-warn); background: var(--wash-warn); }
.teach.tone-pass { border-left-color: var(--accent-4); background: var(--wash-pass); }
.teach-title { font-family: var(--mono); font-size: var(--fs-small); letter-spacing: 1px; color: var(--text); }
.teach-body { margin-top: 6px; font-size: 13px; color: var(--text-secondary); }
.teach code {
  padding: 1px 4px;
  background: rgba(11, 15, 24, .6);
  font-family: var(--mono);
  font-size: .92em;
  color: var(--accent-1);
}

/* ── map ────────────────────────────────────────────────────────────────── */
.map-tree {
  flex: 1;
  overflow: auto;
  padding: var(--u) 0;
  font-family: var(--mono);
  font-size: var(--fs-small);
  line-height: 1.75;
}

.map-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 1px calc(var(--u) * 2) 1px 0;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.map-row:hover { background: var(--bg-surface); }
.map-row.is-cwd { border-left-color: var(--accent-1); background: var(--bg-surface); }
.map-row.is-cwd .map-name { color: var(--accent-1); }
.map-row.is-denied { background: var(--wash-warn); }
.map-row.is-changed { box-shadow: inset 0 0 0 1px rgba(239, 106, 103, .45); }

.map-twist { width: 12px; color: var(--text-muted); }
.map-name { color: var(--text-secondary); }
.map-tag {
  margin-left: 4px;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.map-tag.tag-denied { color: var(--accent-warn); }
.map-target { color: var(--accent-3); }

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--u) calc(var(--u) * 1.5);
  padding: var(--u) calc(var(--u) * 2);
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .5px;
  color: var(--text-muted);
}
.map-legend span { display: flex; align-items: center; gap: 5px; }
.dot { width: 8px; height: 8px; display: block; }
.dot-cwd { background: var(--accent-1); }
.dot-denied { background: var(--accent-warn); }
.dot-link { background: var(--accent-3); }
.dot-virtual { background: var(--text-muted); }

/* ── notices ────────────────────────────────────────────────────────────── */
.notice-stack {
  position: fixed;
  right: calc(var(--u) * 2);
  bottom: calc(var(--u) * 2);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: var(--u);
  width: min(420px, calc(100vw - var(--u) * 4));
}

.notice {
  padding: calc(var(--u) * 1.5);
  border: 1px solid var(--border-bright);
  border-left: 3px solid var(--accent-2);
  background: var(--bg-card);
}
.notice.tone-warn { border-left-color: var(--accent-warn); background: var(--bg-card); }
.notice.tone-pass { border-left-color: var(--accent-4); }
.notice-title { font-family: var(--mono); font-size: var(--fs-small); letter-spacing: 1px; }
.notice.tone-warn .notice-title { color: var(--accent-warn); }
.notice.tone-pass .notice-title { color: var(--accent-4); }
.notice-body { margin-top: 6px; font-size: 13px; color: var(--text-secondary); }
.notice-close { position: absolute; }

/* ── overlay ────────────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: calc(var(--u) * 2);
  background: rgba(11, 15, 24, .86);
  overflow-y: auto;
}

.overlay-panel {
  position: relative;
  width: min(760px, 100%);
  padding: calc(var(--u) * 4);
  border: 1px solid var(--border-bright);
  background: var(--bg-card);
}

/* The in-app confirm dialog — window.confirm in the design system's clothes. */
.confirm-panel {
  width: min(440px, 100%);
  padding: calc(var(--u) * 3);
  border: 1px solid var(--border-bright);
  border-top: 2px solid var(--accent-warn);
  background: var(--bg-card);
}
.confirm-panel.tone-info { border-top-color: var(--accent-2); }
.confirm-kicker { color: var(--text-muted); }
.confirm-title {
  margin-top: var(--u);
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
}
.confirm-body {
  margin-top: var(--u);
  font-size: 13px;
  color: var(--text-secondary);
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--u);
  margin-top: calc(var(--u) * 2);
}

.overlay-close {
  position: absolute;
  top: var(--u);
  right: var(--u);
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.overlay-close:hover { color: var(--accent-1); border-color: var(--accent-1); }

.overlay-title {
  margin-top: var(--u);
  font-size: var(--fs-headline);
  font-weight: 900;
  line-height: .96;
  letter-spacing: -1px;
}

.overlay-body { margin-top: calc(var(--u) * 2); color: var(--text-secondary); }
.overlay-body p { margin-top: var(--u); font-size: 14px; }
.overlay-body code {
  padding: 1px 5px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  font-family: var(--mono);
  font-size: .9em;
  color: var(--accent-1);
}
.overlay-body ul { margin-top: var(--u); display: grid; gap: 6px; }
.overlay-body li { padding-left: 16px; position: relative; font-size: 14px; }
.overlay-body li::before {
  content: '';
  position: absolute;
  left: 0; top: .55em;
  width: 7px; height: 1px;
  background: var(--accent-2);
}

.overlay-video { margin-top: calc(var(--u) * 3); }
.overlay-video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
}
.video-placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border: 1px dashed var(--border-bright);
  background: var(--bg-panel);
  font-family: var(--mono);
  font-size: var(--fs-small);
  letter-spacing: 1.5px;
  text-align: center;
  color: var(--text-muted);
}
