/* Paths screen + breadcrumb — owned by the paths module (step 8).
   Uses only app.css tokens; dark candlelit-study language throughout. */

/* ===== breadcrumb bar (content chrome; `hidden` is panels' to toggle) =====
   Lives INSIDE #top-bar's right side (panels.js moves it into #tb-route-slot),
   so it must flow inline — no fixed positioning. */
#breadcrumb-bar {
  position: static;
  transform: none;
  max-width: min(640px, 46vw);
  min-width: 0;
  margin-right: 6px;
}
.bc-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-left: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 0 0 0 12px;
  box-shadow: none;
  backdrop-filter: none;
}
.bc-label {
  font-family: var(--smallcaps);
  font-size: 14px;
  letter-spacing: .18em;
  color: var(--accent);
  text-transform: lowercase;
  flex: none;
}
.bc-empty {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-faint);
  white-space: nowrap;
}
.bc-seq {
  min-width: 0;
  max-width: 400px;
  overflow-x: auto;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  padding-bottom: 2px;
  scrollbar-width: thin;
}
/* whisper-quiet retro scrollbar: a thin candle-gold rule, only on hover */
.bc-seq::-webkit-scrollbar { height: 3px; }
.bc-seq::-webkit-scrollbar-track { background: transparent; }
.bc-seq::-webkit-scrollbar-thumb { border: none; border-radius: 2px; background: rgba(242, 201, 76, .18); }
.bc-seq:hover::-webkit-scrollbar-thumb { background: rgba(242, 201, 76, .42); }
.bc-num { padding: 0 1px; }
.bc-arrow { color: var(--ink-faint); padding: 0; }
.bc-arrow.bad { color: var(--bad); cursor: help; }
.bc-caret { color: var(--accent-bright); padding: 0 2px; font-weight: bold; }
.bc-count {
  flex: none;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-dim);
  border-left: 1px solid var(--line-soft);
  padding-left: 10px;
  white-space: nowrap;
}
.bc-btn {
  flex: none;
  font-family: var(--smallcaps);
  font-size: 14px;
  letter-spacing: .09em;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 9px 3px;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.bc-btn:hover { color: var(--accent-bright); border-color: var(--accent-line); }

/* ===== screen shell ===== */
#screen-paths {
  overflow-y: auto;
  background:
    radial-gradient(1100px 620px at 50% -8%, rgba(242, 201, 76, .045), transparent 60%),
    radial-gradient(1400px 900px at 50% 110%, rgba(0, 0, 0, .5), transparent 65%),
    var(--bg-0);
  /* the icon rail overlays the left edge; keep interactives clear of it */
  padding: 0 26px 0 56px;
}
.paths-wrap {
  max-width: 940px;
  margin: 0 auto;
  padding: 52px 0 120px;
}

/* ===== header ===== */
.paths-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 26px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.paths-head::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 7px;
  height: 7px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--bg-0);
  border: 1px solid var(--accent-line);
}
.paths-kicker {
  font-family: var(--smallcaps);
  font-size: 14px;
  letter-spacing: .32em;
  color: var(--ink-dim);
  text-transform: lowercase;
}
.paths-title {
  margin: 6px 0 10px;
  font-family: var(--smallcaps);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 40px);
  letter-spacing: .14em;
  color: var(--accent);
  text-shadow: 0 0 34px rgba(242, 201, 76, .18);
}
.paths-sub {
  margin: 0;
  max-width: 620px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-dim);
}
.paths-sub b { color: var(--ink); font-weight: 600; }
.paths-head > .btn { flex: none; margin-top: 4px; }

/* ===== blocks ===== */
.paths-block { margin-bottom: 36px; }
.paths-block-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.paths-label {
  font-family: var(--smallcaps);
  font-size: 15px;
  letter-spacing: .16em;
  color: var(--accent);
  text-transform: lowercase;
}
.paths-editing {
  font-size: 14px;
  color: var(--ink-dim);
  font-family: var(--sans);
}
.paths-editing b { color: var(--ink); font-weight: 600; }
.paths-editing i { color: var(--ink-faint); font-style: italic; }
.paths-spacer { flex: 1; }
.paths-counter {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-dim);
  white-space: nowrap;
  transition: color .3s var(--ease);
}
.paths-counter.glow, .bc-count.glow {
  color: var(--accent-bright);
  animation: paths-glow 2.2s ease-in-out infinite alternate;
}
@keyframes paths-glow {
  from { text-shadow: 0 0 6px rgba(242, 201, 76, .35); }
  to { text-shadow: 0 0 16px rgba(242, 201, 76, .85); }
}

/* ===== working route chips ===== */
.paths-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-height: 106px;
  padding: 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), inset 0 14px 30px rgba(0, 0, 0, .25);
}
/* the insertion cursor: where new steps land in the working route */
.path-cursor {
  flex: none;
  width: 12px;
  height: 76px;
  border-radius: 3px;
  border: 1px dashed transparent;
  color: var(--accent-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s var(--ease), background .15s var(--ease), width .15s var(--ease);
}
.path-cursor:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.path-cursor.active {
  width: 30px;
  border: 1px solid var(--accent-line);
  background: linear-gradient(180deg, rgba(242, 201, 76, .16), rgba(242, 201, 76, .04));
  box-shadow: 0 0 12px rgba(242, 201, 76, .25);
  cursor: default;
}
.path-cursor .icon { width: 16px; height: 16px; }

.path-chip {
  position: relative;
  flex: none;
  width: 92px;
  height: 76px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-3);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color .15s var(--ease), transform .15s var(--ease), opacity .15s var(--ease);
}
.path-chip:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.path-chip:focus-visible { outline: 1px solid var(--accent-line); outline-offset: 2px; }
.path-chip.dragging { opacity: .35; cursor: grabbing; }
.chip-thumb {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  filter: saturate(.85) brightness(.92);
  pointer-events: none;
}
.chip-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(8, 7, 5, .12) 30%, rgba(8, 7, 5, .74));
}
.chip-num {
  position: absolute;
  left: 9px;
  bottom: 4px;
  z-index: 2;
  font-family: var(--display);
  font-size: 30px;
  line-height: 1;
  color: var(--ink);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .95), 0 0 14px rgba(0, 0, 0, .8);
  pointer-events: none;
}
.chip-num.chip-num-title {
  font-family: var(--smallcaps);
  font-size: 11.5px;
  line-height: 1.2;
  letter-spacing: .03em;
  width: 58px;
  white-space: normal;
}
.chip-grip {
  position: absolute;
  top: 3px;
  left: 5px;
  z-index: 2;
  font-size: 14px;
  letter-spacing: -1px;
  color: var(--ink-dim);
  opacity: .65;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}
.path-chip:hover .chip-grip { color: var(--accent); opacity: 1; }
.chip-x, .chip-dup {
  position: absolute;
  z-index: 3;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: rgba(10, 9, 6, .82);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  transition: opacity .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.chip-x { top: 4px; right: 4px; }
.chip-dup { bottom: 4px; right: 4px; font-size: 14px; }
.path-chip:hover .chip-x, .path-chip:focus .chip-x, .path-chip:focus-within .chip-x,
.path-chip:hover .chip-dup, .path-chip:focus .chip-dup, .path-chip:focus-within .chip-dup { opacity: 1; }
.chip-x:hover { color: var(--bad); border-color: var(--bad); }
.chip-dup:hover { color: var(--accent-bright); border-color: var(--accent-line); }

/* insertion indicator (drag reorder) */
.path-chip.drop-before::before, .path-chip.drop-after::after {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(242, 201, 76, .8);
  z-index: 4;
  pointer-events: none;
}
.path-chip.drop-before::before { left: -14px; }
.path-chip.drop-after::after { right: -14px; }

/* connector marks between chips */
.path-conn {
  flex: none;
  width: 26px;
  text-align: center;
  font-size: 15px;
}
.path-conn.ok { color: var(--accent); text-shadow: 0 0 8px rgba(242, 201, 76, .35); }
.path-conn.bad { color: var(--bad); opacity: .75; cursor: help; }

/* ===== controls row ===== */
.paths-controls {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.paths-num-input {
  width: 86px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 7px 10px 8px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .4);
}
.paths-num-input:focus { outline: none; border-color: var(--accent-line); }
.paths-num-input::placeholder { color: var(--ink-faint); }

/* ===== solution verification ===== */
.paths-verify-sub {
  margin: 0 0 12px;
  max-width: 620px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-dim);
}
.paths-verify-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.paths-verify-input {
  width: 200px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 7px 10px 8px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .4);
}
.paths-verify-input:focus { outline: none; border-color: var(--accent-line); }
.paths-verify-input::placeholder { color: var(--ink-faint); }
.paths-verify-result {
  margin: 12px 0 0;
  max-width: 620px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
}
.paths-verify-result.ok { color: var(--ok); }
.paths-verify-result.bad { color: var(--bad); }

/* ===== saved paths ===== */
.saved-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 11px 14px;
  margin-bottom: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), inset 0 0 0 2px rgba(232, 225, 209, .03);
  transition: border-color .15s var(--ease);
}
.saved-row:hover { border-color: var(--accent-line); }
.saved-row.active { border-left: 2px solid var(--accent); }
.saved-main { flex: 1; min-width: 0; }
.saved-name {
  display: block;
  font-family: var(--smallcaps);
  font-size: 16.5px;
  letter-spacing: .08em;
  color: var(--ink);
}
.saved-row.active .saved-name { color: var(--accent-bright); }
.saved-meta {
  display: block;
  font-size: 14px;
  color: var(--ink-faint);
  margin: 1px 0 3px;
}
.saved-preview {
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-actions { flex: none; display: flex; gap: 7px; }
.saved-actions .btn { font-size: 14px; padding: 4px 10px 5px; }

/* ===== empty states ===== */
.paths-empty {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-faint);
  padding: 16px 6px;
}

/* ===== modal bits (save-as / rename / confirms) ===== */
.paths-field span {
  display: block;
  font-family: var(--smallcaps);
  font-size: 14px;
  letter-spacing: .12em;
  color: var(--ink-dim);
  margin-bottom: 7px;
  text-transform: lowercase;
}
.paths-text-input {
  width: 100%;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px 11px 9px;
  font-family: var(--serif);
  font-size: 15.5px;
  color: var(--ink);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .4);
}
.paths-text-input:focus { outline: none; border-color: var(--accent-line); }
.paths-modal-note { color: var(--bad); font-size: 14px; margin-top: 9px; }
.paths-confirm-text {
  margin: 0;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
}

/* ===== undo toast ===== */
.toast-undo {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.toast-undo-btn {
  font-family: var(--smallcaps);
  font-size: 14px;
  letter-spacing: .09em;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(242, 201, 76, .45);
  text-underline-offset: 3px;
}
.toast-undo-btn:hover { color: var(--accent-bright); }
