.disc-subbar{position:sticky;top:52px;z-index:40;display:flex;gap:1.2rem;align-items:center;
  max-width:1180px;margin:0 auto;padding:.7rem 1.6rem;
  background:rgba(11,13,20,.82);background:color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter:blur(10px);border-bottom:1px solid var(--border);flex-wrap:wrap;}
.disc-views{display:flex;gap:3px;background:var(--bg-elevated);border:1px solid var(--border);
  border-radius:10px;padding:3px;overflow-x:auto;}
.dv{font-family:var(--font-heading);font-size:.74rem;font-weight:500;color:var(--text-muted);
  background:none;border:0;border-radius:8px;padding:.42rem .85rem;cursor:pointer;white-space:nowrap;
  display:flex;align-items:center;gap:.4rem;}
.dv.on{background:var(--bg-card);color:var(--text);box-shadow:0 1px 4px rgba(0,0,0,.25);}
.dv .k{font-family:var(--font-mono);font-size:.62rem;color:var(--glow,var(--purple));}
.disc-search{position:relative;flex:1;min-width:220px;display:flex;align-items:center;gap:.55rem;
  background:var(--bg-card);border:1px solid var(--border);border-radius:11px;padding:.6rem .85rem;color:var(--text-muted);}
.disc-search input{flex:1;background:none;border:0;color:var(--text);font-family:var(--font);font-size:1rem;outline:none;}
.disc-search:focus-within{border-color:var(--purple);box-shadow:0 0 0 3px rgba(176,122,255,.1);}
.disc-k{font-family:var(--font-mono);font-size:.6rem;border:1px solid var(--border);border-radius:5px;padding:.1rem .3rem;color:var(--text-muted);}
.disc-clear{display:flex;align-items:center;justify-content:center;flex:none;width:18px;height:18px;
  background:none;border:0;border-radius:50%;cursor:pointer;font-size:.72rem;line-height:1;
  color:var(--text-muted);transition:color .15s,background .15s;padding:0;}
.disc-clear:hover{color:var(--text);background:rgba(176,122,255,.18);}
[data-theme="light"] .disc-clear:hover{background:rgba(176,122,255,.14);}
.disc-view-root{max-width:1180px;margin:0 auto;padding:1.4rem 1.6rem 4rem;}
.disc-view{animation:discIn .22s ease both;}
@keyframes discIn{from{transform:translateY(6px)}to{transform:translateY(0)}}
.disc-dropdown{position:absolute;top:calc(100% + 6px);left:0;right:0;background:var(--bg-elevated);
  border:1px solid var(--border2);border-radius:14px;
  box-shadow:0 16px 48px rgba(0,0,0,.5),0 2px 8px rgba(0,0,0,.25);
  padding:.5rem;z-index:60;max-height:60vh;overflow:auto;animation:ddIn .18s var(--ease-spring) both;}
@keyframes ddIn{from{transform:translateY(-6px)}to{transform:translateY(0)}}
.disc-stub{color:var(--text-muted);font-family:var(--font);padding:3rem 1rem;text-align:center;}
@media(max-width:820px){
  .disc-subbar{flex-direction:column;align-items:stretch;top:48px;}
  .disc-search{order:2;} .disc-views{order:1;}
}
.fmt-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem;}
.fmt-grid .fmt-card{position:relative;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);
  padding:1.6rem 1.5rem 1.4rem;min-height:230px;display:flex;flex-direction:column;text-decoration:none;color:inherit;
  transition:transform .18s ease,box-shadow .18s ease;overflow:hidden;}
.fmt-grid .fmt-card::before{content:"";position:absolute;top:0;left:0;right:0;height:3px;background:var(--g);}
.fmt-grid .fmt-card:hover{transform:translateY(-3px);box-shadow:0 14px 40px rgba(0,0,0,.35);}
.fmt-grid .fmt-card.dim{opacity:.3;}
.fmt-grid .fmt-eyebrow{font-family:var(--font-mono);font-size:.62rem;letter-spacing:.18em;color:var(--text-muted);display:flex;align-items:center;gap:.45rem;}
.fmt-grid .fmt-dot{width:8px;height:8px;border-radius:50%;background:var(--d);}
.fmt-grid .fmt-title{font-family:var(--font-display);font-style:italic;font-size:1.55rem;font-weight:600;margin:.4rem 0;}
.fmt-grid .fmt-desc{font-family:var(--font);font-size:.98rem;color:var(--text-dim);flex:1;}
.fmt-grid .fmt-cta{font-family:var(--font-heading);font-size:.82rem;font-weight:500;color:var(--text);margin-top:1rem;}
.fmt-grid .fmt-cta .arw{transition:transform .18s ease;display:inline-block;}
.fmt-grid .fmt-card:hover .fmt-cta .arw{transform:translateX(4px);}
@media(max-width:900px){.fmt-grid{grid-template-columns:1fr 1fr;}}
@media(max-width:560px){.fmt-grid{grid-template-columns:1fr;}}

.start-hero{text-align:center;padding:2rem 0 1.5rem;}
.start-hero h1{font-family:var(--font-display);font-style:italic;font-size:2.5rem;font-weight:400;margin:0;}
.start-hero h1 b{font-style:normal;color:var(--glow,var(--purple));font-weight:600;}
.start-stat{font-family:var(--font-mono);font-size:.8rem;color:var(--text-muted);margin-top:1rem;}
.start-stat b{color:var(--text-dim);font-weight:400;}
.start-sec{margin:1.6rem 0;}

/* Search-first Start: the shared .disc-search is relocated here, centered & large */
.start-searchwrap{display:flex;justify-content:center;margin-top:1.6rem;}
.disc-search.in-hero{flex:0 1 620px;max-width:620px;width:100%;min-width:0;padding:.95rem 1.2rem;border-radius:14px;}
.disc-search.in-hero input{font-size:1.1rem;}
.disc-search.in-hero svg{width:20px;height:20px;flex-shrink:0;}
/* When the search lives in the hero, center the leftover tabs in the subbar */
.disc-subbar.search-moved{justify-content:center;}
@media(max-width:640px){.disc-search.in-hero{padding:.8rem 1rem;}.disc-search.in-hero input{font-size:1rem;}}
.start-label{font-family:var(--font-mono);font-size:.6rem;letter-spacing:.18em;text-transform:uppercase;color:var(--text-muted);
  display:flex;align-items:center;gap:.8rem;margin-bottom:.7rem;}
.start-label::after{content:"";flex:1;height:1px;background:var(--border);}
.chip{font-family:var(--font-mono);font-size:.68rem;background:var(--bg-card);border:1px solid var(--border);
  border-radius:999px;padding:.32rem .7rem;cursor:pointer;color:var(--text-dim);text-decoration:none;display:inline-block;}
.chip.resume{background:rgba(232,168,124,.1);border-color:rgba(232,168,124,.35);color:var(--warm);}
.goal-grid{display:grid;grid-template-columns:1fr 1fr;gap:.8rem;}
.goal-card{display:flex;gap:.7rem;align-items:center;background:var(--bg-card);border:1px solid var(--border);
  border-radius:var(--radius);padding:.8rem;cursor:pointer;}
.goal-ic{width:34px;height:34px;border-radius:9px;display:grid;place-items:center;background:var(--bg3);}
.dd-group-label{
  font-family:var(--font-mono);font-size:.58rem;letter-spacing:.16em;text-transform:uppercase;
  color:var(--text-muted);padding:.55rem .7rem .25rem;
  margin-top:.2rem;
}
.dd-group-label:first-child{margin-top:0;}
/* Row: dot | body (title + meta) | action-btn */
.dd-item{
  display:flex;align-items:center;gap:.65rem;
  padding:.55rem .7rem;min-height:2.4rem;
  border-radius:9px;cursor:pointer;
  transition:background .1s;
}
.dd-item:hover,.dd-item[aria-selected="true"]{background:rgba(176,122,255,.14);}
.dd-item[aria-selected="true"]{outline:none;}
.dd-dot{width:8px;height:8px;border-radius:50%;flex:none;margin-top:1px;}
/* Text column: title + meta stacked, truncates instead of wrapping */
.dd-item-body{
  flex:1;min-width:0;
  display:flex;flex-direction:column;gap:.12rem;
  overflow:hidden;
}
.dd-item-title{
  font-family:var(--font-heading);font-size:.84rem;font-weight:500;color:var(--text);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  line-height:1.3;
}
.dd-item-meta{
  font-family:var(--font-mono);font-size:.6rem;color:var(--text-muted);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  line-height:1.2;
}
/* Action slot: pinned to the right, never overlaps text */
.dd-item-action{
  flex:none;margin-left:auto;padding-left:.4rem;
  display:flex;align-items:center;
}
/* In the dropdown the add-button is icon-only — hide the text label */
.dd-item-action .add-path-label{display:none;}
.dd-item-action .add-path-btn{width:24px;height:24px;font-size:.8rem;padding:0;}
.dd-foot{
  display:flex;justify-content:space-between;
  font-family:var(--font-mono);font-size:.58rem;color:var(--text-muted);
  padding:.45rem .7rem;border-top:1px solid var(--border);margin-top:.3rem;
}
mark{background:rgba(232,168,124,.3);color:inherit;border-radius:3px;}
/* Light-mode: ensure dropdown reads as a floating panel */
[data-theme="light"] .disc-dropdown{
  border-color:rgba(0,0,0,.12);
  box-shadow:0 16px 48px rgba(0,0,0,.16),0 2px 8px rgba(0,0,0,.1);
}
@media(max-width:640px){.start-hero h1{font-size:1.9rem;}.goal-grid{grid-template-columns:1fr;}}

/* ── Map view ──────────────────────────────────────────────────────────────── */

/* ── Theme-aware map stage ──────────────────────────────────────────────────── */
/* No token overrides — the Map now inherits site theme tokens so it renders
   cream in light mode and dark in dark mode, matching the rest of the page.
   The constellation has been removed; DOM-only cards/list/columns look clean
   with standard tokens on both themes. */
.map-stage{
  background:var(--bg-elevated);
  background-image:radial-gradient(ellipse 80% 60% at 50% 35%,rgba(92,201,181,.04),transparent 70%);
  border-radius:var(--radius-lg);
  padding:.85rem 0 0; /* breathing room above the toggle */
}

/* Layout toggle — pill segmented control (mirrors .disc-views style) */
.map-layout-toggle{
  display:flex;gap:3px;
  background:var(--bg-elevated);
  border:1px solid var(--border);
  border-radius:10px;
  padding:3px;
  width:fit-content;
  margin-bottom:.85rem;
  overflow-x:auto;
}
.map-layout-btn{
  font-family:var(--font-heading);font-size:.74rem;font-weight:500;
  color:var(--text-muted);
  background:none;border:0;border-radius:8px;
  padding:.4rem .9rem;cursor:pointer;white-space:nowrap;
  display:flex;align-items:center;gap:.35rem;
  transition:background .14s,color .14s,box-shadow .14s;
}
.map-layout-btn .mlt-icon{font-size:.8rem;line-height:1;}
.map-layout-btn.on{
  background:var(--bg-card);color:var(--text);
  box-shadow:0 1px 4px rgba(0,0,0,.25);
}
.map-layout-btn:hover:not(.on){color:var(--text-dim);}

/* Shared content container */
.map-content{position:relative;}
.map-content--constellation{}
.map-content--cards{}
.map-content--list{}

/* Drawer — #map-drawer is always hoisted to document.body (see map.js hoistDrawer).
   Hoisting ensures position:fixed resolves to the viewport, not the .disc-view
   ancestor whose CSS animation (discIn fill-mode:both) leaves a transform that
   would otherwise create a new containing block and shift the closed drawer into
   the visible viewport area.
   top:52px keeps the drawer below the em-header (z-index:9000, height:52px) so
   the header buttons remain accessible and the ✕ close button is not covered. */
.map-drawer{
  position:fixed;
  top:52px;right:0;
  height:calc(100% - 52px);width:360px;max-width:64%;
  background:var(--bg-elevated);backdrop-filter:blur(8px);
  border-left:3px solid var(--warm);
  transform:translateX(100%);
  transition:transform .32s var(--ease-spring);
  overflow:auto;padding:1.2rem;
  z-index:80;
}
.map-drawer.open{transform:translateX(0);}

@media(max-width:720px){
  .map-drawer{
    top:auto;bottom:0;left:0;right:0;
    height:auto;max-height:75vh;
    width:100%;max-width:100%;
    border-left:0;border-top:3px solid var(--warm);
    transform:translateY(100%);
    border-radius:14px 14px 0 0;
    position:fixed;
  }
  .map-drawer.open{transform:translateY(0);}
  .map-layout-toggle{margin-bottom:.6rem;}
}

.map-drawer .md-header{display:flex;align-items:flex-start;justify-content:space-between;gap:.5rem;margin-bottom:.7rem;}
.map-drawer .md-header-text{min-width:0;flex:1 1 auto;}
.map-drawer .md-close{
  flex:none;margin-top:.1rem;
  background:none;border:1px solid var(--border2);border-radius:6px;
  color:var(--text-muted);cursor:pointer;
  font-size:.75rem;line-height:1;padding:.28rem .42rem;
  transition:color .14s,border-color .14s,background .14s;
}
.map-drawer .md-close:hover{color:var(--text);border-color:var(--border-hover);background:var(--bg3);}
.map-drawer .md-eyebrow{font-family:var(--font-mono);font-size:.6rem;letter-spacing:.15em;text-transform:uppercase;}
.map-drawer .md-title{font-family:var(--font-display);font-style:italic;font-size:1.4rem;margin:.2rem 0;color:var(--text);}
.map-drawer .md-sub{font-family:var(--font-mono);font-size:.62rem;color:var(--text-muted);}
.map-drawer a.md-lesson{display:flex;gap:.5rem;align-items:center;padding:.32rem .4rem;border-radius:6px;color:var(--text);text-decoration:none;}
.map-drawer a.md-lesson:hover{background:var(--bg3);}
.map-drawer .md-dot{width:7px;height:7px;border-radius:50%;flex:none;}
.map-drawer .md-lesson-title{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.82rem;}
.map-drawer .md-tier{color:var(--text-muted);font-family:var(--font-mono);font-size:.6rem;}
/* Add-to-journey button inside drawer rows — sits right of title */
.map-drawer .add-path-btn{
  flex:none;margin-left:auto;
  font-size:.62rem;padding:.2rem .5rem;
  /* ensure it's always visible even without hover on mobile */
  opacity:.7;
}
.map-drawer a.md-lesson:hover .add-path-btn{opacity:1;}
.map-drawer .add-path-label{display:none;}/* hide label text in narrow rows */

/* ── Cards layout ───────────────────────────────────────────────────────────── */
.map-cards{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:.85rem;
  animation:discIn .22s ease both;
}
.map-card{
  display:flex;flex-direction:column;align-items:center;gap:.55rem;
  padding:1.1rem .8rem 1rem;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  cursor:pointer;
  text-align:center;
  transition:transform .18s var(--ease-spring),
             box-shadow .18s ease,
             border-color .15s,
             opacity .18s ease;
  /* reset button defaults */
  font:inherit;color:inherit;
  animation:discIn .22s ease both;
}
.map-card:hover{
  transform:translateY(-4px);
  box-shadow:0 12px 36px rgba(0,0,0,.32);
  border-color:var(--border2);
}
.map-card:focus-visible{
  outline:none;
  border-color:var(--purple);
  box-shadow:0 0 0 3px rgba(176,122,255,.18);
}
.map-card.dim{opacity:.22;pointer-events:none;}

.map-orb{
  border-radius:50%;
  flex:none;
  /* Background + box-shadow set inline per cluster color */
  transition:transform .18s var(--ease-spring);
}
.map-card:hover .map-orb{transform:scale(1.1);}
.map-orb--sm{/* smaller variant used in list rows */}

.map-card-label{
  font-family:var(--font-heading);
  font-weight:600;font-size:.82rem;
  color:var(--text);line-height:1.3;
}
.map-card-count{
  font-family:var(--font-mono);font-size:.6rem;
  color:var(--text-muted);
}

/* Responsive grid: 4 → 3 → 2 → 2 */
@media(max-width:960px){.map-cards{grid-template-columns:repeat(3,1fr);}}
@media(max-width:640px){.map-cards{grid-template-columns:repeat(2,1fr);gap:.6rem;}}
/* 375px intentionally stays 2-col (looks good); enforced by max-width:640 above */

/* ── List layout ────────────────────────────────────────────────────────────── */
.map-list{
  display:flex;flex-direction:column;gap:.4rem;
  animation:discIn .22s ease both;
}
.map-row{
  display:flex;align-items:center;gap:.9rem;
  padding:.75rem 1rem;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  cursor:pointer;
  text-align:left;
  width:100%;
  /* reset button defaults */
  font:inherit;color:inherit;
  transition:transform .15s var(--ease-spring),
             box-shadow .15s ease,
             border-color .13s,
             opacity .18s ease;
  animation:discIn .2s ease both;
}
.map-row:hover{
  transform:translateX(3px);
  box-shadow:0 4px 18px rgba(0,0,0,.22);
  border-color:var(--border2);
}
.map-row:focus-visible{
  outline:none;
  border-color:var(--purple);
  box-shadow:0 0 0 3px rgba(176,122,255,.14);
}
.map-row.dim{opacity:.22;pointer-events:none;}

.map-row-body{flex:1;min-width:0;}
.map-row-label{
  font-family:var(--font-heading);font-weight:600;font-size:.88rem;
  color:var(--text);line-height:1.3;
}
.map-row-peek{
  font-family:var(--font-mono);font-size:.6rem;
  color:var(--text-muted);margin-top:.2rem;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.map-row-count{
  font-family:var(--font-mono);font-size:.65rem;
  color:var(--text-muted);flex:none;white-space:nowrap;
}

@media(max-width:640px){
  .map-row{padding:.65rem .75rem;gap:.7rem;}
  .map-row-label{font-size:.82rem;}
}

/* ── Light-mode orb treatment ────────────────────────────────────────────── */
/* In dark mode the full radial glow looks great; in light mode on cream the big
   colored halo looks muddy. Replace with a crisp solid dot + small drop-shadow. */
[data-theme="light"] .map-card .map-orb,
[data-theme="light"] .map-row .map-orb{
  box-shadow:0 2px 8px rgba(0,0,0,.18) !important;
}
/* Give cards a subtle border upgrade in light so they read as crisp on cream */
[data-theme="light"] .map-card:hover{
  box-shadow:0 8px 24px rgba(0,0,0,.12);
}
[data-theme="light"] .map-row:hover{
  box-shadow:0 2px 10px rgba(0,0,0,.1);
}

.feed-row{display:flex;flex-wrap:wrap;gap:.5rem;}
.feed-row .chip{max-width:340px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;}

/* ── Paths view ────────────────────────────────────────────────────────────── */
.paths-heading{font-family:var(--font-display);font-style:italic;font-weight:600;
  font-size:2rem;margin:0 0 1.4rem;color:var(--text);}

/* Goal card grid */
.path-goals{display:grid;grid-template-columns:repeat(2,1fr);gap:.85rem;margin-bottom:1.8rem;}
.path-goal-card{position:relative;background:var(--bg-card);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:1.1rem 1.2rem 1rem;cursor:pointer;overflow:hidden;
  transition:transform .18s ease,box-shadow .18s ease;}
.path-goal-card::before{content:"";position:absolute;top:0;left:0;right:0;height:3px;
  background:var(--gc);}
.path-goal-card:hover{transform:translateY(-3px);box-shadow:0 10px 32px rgba(0,0,0,.3);}
.path-goal-card.active{border-color:var(--gc);box-shadow:0 0 0 1px var(--gc);}
.path-goal-card.dim{opacity:.3;pointer-events:none;}
.path-goal-body{padding-top:.25rem;}
.path-goal-title{font-family:var(--font-heading);font-weight:600;font-size:.95rem;color:var(--text);}
.path-goal-meta{font-family:var(--font-mono);font-size:.62rem;color:var(--text-muted);margin-top:.3rem;}
.path-hint{font-family:var(--font-mono);font-size:.75rem;color:var(--text-muted);
  text-align:center;padding:2.5rem 1rem;}

/* Path back-link row (‹ all goals) */
.path-back-row{margin-bottom:.75rem;}
.path-back-link{
  background:none;border:none;padding:0;cursor:pointer;
  font-family:var(--font-mono);font-size:.72rem;color:var(--text2);
  letter-spacing:.02em;
  transition:color .15s;
}
.path-back-link:hover{color:var(--warm);}

/* Path panel */
.path-panel{background:var(--bg-elevated);border:1px solid var(--border);border-radius:var(--radius-lg);
  padding:1.4rem 1.5rem 1.2rem;animation:discIn .2s ease both;}
.path-panel-header{margin-bottom:1.1rem;}
.path-panel-title{font-family:var(--font-display);font-style:italic;font-weight:600;
  font-size:1.5rem;color:var(--text);margin-bottom:.6rem;}
.path-panel-prog-row{display:flex;align-items:center;gap:.8rem;}
.path-prog{flex:1;height:6px;background:var(--bg3);border-radius:999px;overflow:hidden;}
.path-prog-fill{height:100%;background:var(--pc,var(--warm));border-radius:999px;
  transition:width .4s var(--ease-spring);}
.path-prog-label{font-family:var(--font-mono);font-size:.65rem;color:var(--text-muted);white-space:nowrap;}

/* Step track */
.path-track{display:flex;flex-direction:row;align-items:flex-start;gap:.5rem;
  overflow-x:auto;padding-bottom:.6rem;scroll-snap-type:x mandatory;
  scrollbar-width:thin;scrollbar-color:var(--border) transparent;}
.path-track::-webkit-scrollbar{height:4px;}
.path-track::-webkit-scrollbar-track{background:transparent;}
.path-track::-webkit-scrollbar-thumb{background:var(--border);border-radius:999px;}
.path-arrow{font-family:var(--font-mono);font-size:1.1rem;color:var(--text-muted);
  align-self:center;flex:none;padding:0 .1rem;user-select:none;}
.path-step{min-width:130px;max-width:180px;flex:none;background:var(--bg-card);
  border:1px solid var(--border);border-radius:10px;padding:.7rem .8rem;
  text-decoration:none;color:inherit;display:block;scroll-snap-align:start;position:relative;
  transition:border-color .15s,box-shadow .15s;}
.path-step-remove{position:absolute;top:6px;right:6px;width:20px;height:20px;padding:0;
  border-radius:50%;border:1px solid var(--border2);background:var(--bg-elevated);color:var(--text3);
  font-size:.66rem;line-height:1;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;
  z-index:4;transition:color .15s,border-color .15s,background .15s,opacity .15s;}
.path-step-remove:hover{color:#fff;background:var(--red);border-color:var(--red);}
/* On hover-capable devices, reveal on step hover only (keeps the track clean).
   On touch devices (no hover) it stays visible so it's reachable. */
@media (hover: hover){
  .path-step-remove{display:none;}
  .path-step:hover .path-step-remove,.path-step:focus-within .path-step-remove{display:inline-flex;}
}
.path-step:hover{border-color:var(--border2);}
.path-step.done{opacity:.55;}
.path-step.done .path-step-kicker{color:var(--green);}
.path-step.now{border-color:var(--pc,var(--warm));
  box-shadow:0 0 0 1px var(--pc,var(--warm)),0 4px 16px rgba(232,168,124,.18);}
.path-step.missing{opacity:.4;cursor:default;}
.path-step-kicker{font-family:var(--font-mono);font-size:.58rem;
  letter-spacing:.1em;color:var(--text-muted);margin-bottom:.35rem;}
.path-step.now .path-step-kicker{color:var(--pc,var(--warm));}
.path-step-title{font-family:var(--font-heading);font-weight:500;font-size:.82rem;
  color:var(--text);line-height:1.3;}
.path-step-title.muted{color:var(--text-muted);}
.path-step-tier{font-family:var(--font-mono);font-size:.58rem;color:var(--text-muted);margin-top:.3rem;}

/* Branch chips section */
.path-branch{margin-top:1.2rem;padding-top:1rem;border-top:1px solid var(--border);}
.path-branch-label{font-family:var(--font-mono);font-size:.6rem;letter-spacing:.16em;
  text-transform:uppercase;color:var(--text-muted);margin-bottom:.6rem;}
.path-branch-chips{display:flex;flex-direction:column;gap:.55rem;}
.path-branch-group{display:flex;align-items:center;flex-wrap:wrap;gap:.4rem;}
.path-branch-kind{font-family:var(--font-mono);font-size:.58rem;color:var(--text-muted);
  min-width:70px;flex:none;}
.path-missing-note{font-family:var(--font-mono);font-size:.6rem;color:var(--text-muted);
  margin-top:.8rem;opacity:.7;}

/* Mobile: vertical timeline */
@media(max-width:640px){
  .path-goals{grid-template-columns:1fr;}
  .path-track{flex-direction:column;overflow-x:visible;gap:.35rem;scroll-snap-type:none;}
  .path-step{min-width:unset;max-width:unset;width:100%;}
  .path-arrow{transform:rotate(90deg);align-self:center;}
}

/* ── Light-mode overrides for hardcoded-dark surfaces ─────────────────────── */
[data-theme="light"] .disc-subbar{background:rgba(245,240,232,.85);background:color-mix(in srgb, var(--bg) 86%, transparent);}

/* ── Columns view ──────────────────────────────────────────────────────────── */
.col-crumb{
  font-family:var(--font-mono);font-size:.65rem;color:var(--text-muted);
  display:flex;align-items:center;gap:.35rem;flex-wrap:wrap;
  margin-bottom:.85rem;min-height:1.2rem;
}
.col-crumb span{display:inline-flex;align-items:center;gap:.25rem;}
.col-crumb-back{
  cursor:pointer;color:var(--text-dim);
  font-family:var(--font-mono);font-size:.65rem;
  transition:color .15s;
}
.col-crumb-back:hover{color:var(--purple);}

.col-grid{
  display:grid;
  grid-template-columns:1fr 1fr 1.1fr 1.3fr;
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  min-height:380px;
  overflow:hidden;
}
.col-grid .col + .col{border-left:1px solid var(--border);}

.col{
  display:flex;
  flex-direction:column;
  min-height:0;
}
.col-h{
  font-family:var(--font-mono);font-size:.58rem;letter-spacing:.18em;
  text-transform:uppercase;color:var(--text-muted);
  padding:.55rem .75rem .45rem;border-bottom:1px solid var(--border);
  background:var(--bg-elevated);flex:none;
}
.col-body{
  overflow-y:auto;
  flex:1;
  padding:.3rem .3rem;
  scrollbar-width:thin;
  scrollbar-color:var(--border) transparent;
}
.col-body::-webkit-scrollbar{width:3px;}
.col-body::-webkit-scrollbar-track{background:transparent;}
.col-body::-webkit-scrollbar-thumb{background:var(--border);border-radius:999px;}

.col-empty{
  font-family:var(--font-mono);font-size:.65rem;color:var(--text-muted);
  padding:.6rem .5rem;
}

.col-cell{
  display:flex;align-items:center;gap:.45rem;
  padding:.42rem .5rem;border-radius:8px;cursor:pointer;
  font-family:var(--font-heading);font-size:.78rem;color:var(--text);
  transition:background .12s;
  user-select:none;
}
.col-cell:hover{background:var(--bg3);}
.col-cell.on{background:rgba(176,122,255,.12);color:var(--text);}
.col-cell.dim{opacity:.28;pointer-events:none;}

.col-dot{
  width:8px;height:8px;border-radius:50%;flex:none;
}
.col-cell-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.3;}
.col-cell-title{font-size:.76rem;line-height:1.35;white-space:normal;}
.col-cell-count{
  font-family:var(--font-mono);font-size:.6rem;color:var(--text-muted);
  flex:none;
}
.col-cell-chev{font-family:var(--font-mono);font-size:.75rem;color:var(--text-muted);flex:none;}
.col-cell-tier{
  font-family:var(--font-mono);font-size:.58rem;color:var(--text-muted);
  flex:none;white-space:nowrap;
}

/* ── Preview column ── */
.col-preview{background:var(--bg-elevated);}
.col-preview-body{
  flex:1;padding:.8rem .85rem;overflow-y:auto;display:flex;flex-direction:column;gap:.65rem;
}
.col-prev-hint{
  font-family:var(--font-mono);font-size:.65rem;color:var(--text-muted);
  padding:1.2rem 0;text-align:center;
}
.col-thumb{
  width:100%;height:90px;border-radius:10px;flex:none;
  background:linear-gradient(135deg,var(--warm),transparent);
}
.col-ptitle{
  font-family:var(--font-display);font-style:italic;font-weight:600;
  font-size:1.15rem;color:var(--text);line-height:1.3;
}
.col-pdesc{
  font-family:var(--font);font-size:.875rem;color:var(--text-dim);
  line-height:1.55;
}
.col-meta{display:flex;flex-wrap:wrap;gap:.4rem;}
.col-meta-chip{
  font-family:var(--font-mono);font-size:.6rem;
  background:var(--bg3);border:1px solid var(--border);
  border-radius:999px;padding:.2rem .6rem;color:var(--text-muted);
}
.col-start{
  display:block;text-align:center;padding:.55rem .8rem;border-radius:10px;
  font-family:var(--font-heading);font-size:.82rem;font-weight:600;
  color:#fff;text-decoration:none;cursor:pointer;
  margin-top:auto;transition:opacity .15s,transform .15s;
  background:var(--warm);
}
.col-start:hover{opacity:.88;transform:translateY(-1px);}
.col-start-disabled{
  opacity:.4;cursor:default;pointer-events:none;
  background:var(--bg3) !important;color:var(--text-muted);
}

/* mark is already styled warm in the base sheet; reinforce scoped */
.col-cell mark{background:rgba(232,168,124,.3);color:inherit;border-radius:3px;padding:0 1px;}

/* ── Mobile accordion (≤760px) ── */
@media(max-width:760px){
  .col-grid{
    grid-template-columns:1fr;
    border-radius:var(--radius-lg);
  }
  .col-grid .col + .col{border-left:none;border-top:1px solid var(--border);}

  /* Mobile mode: only the active level column is shown */
  .col-grid.col-mobile .col{display:none;}
  .col-grid.col-mobile[data-level="0"] [data-col="domain"]{display:flex;}
  .col-grid.col-mobile[data-level="1"] [data-col="topic"]{display:flex;}
  .col-grid.col-mobile[data-level="2"] [data-col="lesson"]{display:flex;}
  .col-grid.col-mobile[data-level="3"] [data-col="preview"]{display:flex;}

  .col-preview-body{padding:.7rem .75rem;}
  .col-cell{font-size:.85rem;padding:.55rem .6rem;}
}

/* ── Light-mode adjustments ── */
[data-theme="light"] .col-grid{border-color:var(--border);}
[data-theme="light"] .col-h{background:rgba(245,240,232,.6);}
[data-theme="light"] .col-preview{background:rgba(245,240,232,.4);}

/* ── Safety: never dim the selected cell regardless of filter state ── */
.col-cell.on{opacity:1 !important;pointer-events:auto !important;}

/* ── Wiki view ─────────────────────────────────────────────────────────────── */
.wiki-wrap{position:relative;height:520px;background:var(--bg-elevated);border-radius:var(--radius-lg);overflow:hidden;}
.wiki-wrap canvas{max-width:100%;display:block;cursor:pointer;}
.wiki-hint{position:absolute;top:10px;left:12px;font-family:var(--font-mono);font-size:.6rem;color:var(--text-muted);background:rgba(11,13,20,.6);padding:.2rem .6rem;border-radius:999px;pointer-events:none;}

/* Drawer — right panel on desktop, bottom-sheet ≤720px */
.wiki-drawer{
  position:absolute;top:0;right:0;height:100%;width:380px;max-width:68%;
  background:var(--bg-elevated);backdrop-filter:blur(8px);
  border-left:3px solid var(--warm);
  transform:translateX(100%);
  transition:transform .32s var(--ease-spring);
  overflow-y:auto;padding:1.2rem 1.25rem;
  display:flex;flex-direction:column;gap:.1rem;
}
.wiki-drawer.open{transform:translateX(0);}

@media(max-width:720px){
  .wiki-wrap{height:60vh;}
  .wiki-drawer{
    top:auto;bottom:0;height:auto;max-height:75vh;
    width:100%;max-width:100%;
    border-left:0;border-top:3px solid var(--warm);
    transform:translateY(100%);
  }
  .wiki-drawer.open{transform:translateY(0);}
}

/* Drawer content typography */
.wiki-drawer .wiki-eyebrow{
  font-family:var(--font-mono);font-size:.58rem;letter-spacing:.16em;
  text-transform:uppercase;margin-bottom:.1rem;flex:none;
}
.wiki-drawer .wiki-title{
  font-family:var(--font-display);font-style:italic;
  font-size:1.45rem;font-weight:600;
  color:var(--text);line-height:1.2;margin:.1rem 0 .1rem;flex:none;
}
.wiki-drawer .wiki-sub{
  font-family:var(--font-mono);font-size:.62rem;
  color:var(--text-muted);margin-bottom:.55rem;flex:none;
}
.wiki-drawer .wiki-overview{
  font-family:var(--font);font-size:.9rem;
  color:var(--text-dim);line-height:1.55;
  margin:.3rem 0 .6rem;flex:none;
}
.wiki-drawer .wiki-fallback{
  font-style:italic;color:var(--text-muted);
}
.wiki-drawer .wiki-section-label{
  font-family:var(--font-mono);font-size:.58rem;
  letter-spacing:.16em;text-transform:uppercase;
  color:var(--text-muted);margin:.75rem 0 .35rem;flex:none;
}
.wiki-drawer .wiki-section-label:first-child{margin-top:.1rem;}

/* Chip row */
.wiki-drawer .wiki-chips{
  display:flex;flex-wrap:wrap;gap:.35rem .4rem;
  margin-bottom:.3rem;flex:none;
}
.wiki-drawer .wiki-chip{
  font-family:var(--font-mono);font-size:.66rem;
  background:var(--bg-card);border:1px solid var(--border);
  border-radius:999px;padding:.28rem .68rem;
  cursor:pointer;color:var(--text-dim);
  transition:background .14s,border-color .14s,color .14s;
  white-space:nowrap;
}
.wiki-drawer .wiki-chip:hover{
  background:var(--bg3);border-color:var(--border2);color:var(--text);
}
.wiki-drawer .wiki-chip-cluster{
  border-color:color-mix(in srgb, var(--chip-color,var(--warm)) 40%, var(--border));
  color:var(--chip-color,var(--warm));
}
.wiki-drawer .wiki-chip-cluster:hover{
  background:color-mix(in srgb, var(--chip-color,var(--warm)) 12%, var(--bg-card));
}

/* Lesson link rows */
.wiki-drawer .wiki-lesson{
  display:flex;gap:.5rem;align-items:center;
  padding:.3rem .4rem;border-radius:6px;
  color:var(--text);text-decoration:none;
  font-family:var(--font-heading);font-size:.78rem;
  transition:background .12s;flex:none;
}
.wiki-drawer .wiki-lesson:hover{background:var(--bg3);}
.wiki-drawer .wiki-dot{width:7px;height:7px;border-radius:50%;flex:none;}
.wiki-drawer .wiki-tier{color:var(--text-muted);font-family:var(--font-mono);font-size:.6rem;}
.wiki-drawer .wiki-empty{
  font-family:var(--font-mono);font-size:.65rem;color:var(--text-muted);
  padding:.3rem 0;margin:0;
}

/* ‹ Back affordance */
.wiki-drawer .wiki-back{
  font-family:var(--font-mono);font-size:.62rem;
  background:none;border:0;border-bottom:1px solid var(--border);
  color:var(--text-muted);padding:0 0 .6rem;
  cursor:pointer;text-align:left;margin-bottom:.6rem;
  display:block;width:100%;flex:none;
  transition:color .14s;
}
.wiki-drawer .wiki-back:hover{color:var(--purple);}

/* ── Light-mode overrides ────────────────────────────────────────────────── */
[data-theme="light"] .wiki-hint{background:rgba(245,240,232,.7);}
/* Drawer must use the light elevated bg — var(--bg-elevated) resolves correctly
   in light mode because the token is overridden in [data-theme="light"] block
   of style.css / micro.css. No override needed here — token-based. */

/* ── Wiki lesson row wrapper ─────────────────────────────────────────────── */
/* Wraps .wiki-lesson + .add-path-btn so they sit side-by-side */
.wiki-lesson-row{
  display:flex;align-items:center;gap:.3rem;
  padding:0;flex:none;
}
.wiki-lesson-row .wiki-lesson{flex:1;}

/* ── Add-to-path button (.add-path-btn) ──────────────────────────────────── */
.add-path-btn{
  display:inline-flex;align-items:center;justify-content:center;
  width:22px;height:22px;padding:0;
  font-size:.78rem;line-height:1;
  background:none;
  border:1px solid var(--border);
  border-radius:6px;
  color:var(--text-muted);
  cursor:pointer;
  flex:none;
  transition:background .13s,border-color .13s,color .13s,transform .13s;
  /* prevent layout jitter in flex rows */
  align-self:center;
}
.add-path-btn:hover{
  background:rgba(232,168,124,.12);
  border-color:var(--warm);
  color:var(--warm);
  transform:scale(1.1);
}
.add-path-btn:active{transform:scale(.94);}
.add-path-btn-added{
  background:rgba(92,201,181,.18) !important;
  border-color:var(--teal) !important;
  color:var(--teal) !important;
}

/* Slightly smaller in col-cell rows so they don't crowd the label */
.col-cell .add-path-btn{width:19px;height:19px;font-size:.7rem;}

/* In path-step cards — bottom-right corner feel */
.path-step .add-path-btn{
  display:block;margin-top:.5rem;width:100%;height:auto;padding:.2rem;
  font-size:.62rem;border-radius:5px;
  text-align:center;
}

/* In col-preview-body — "add to path" below the start button */
.col-preview-body .add-path-btn{
  width:100%;height:auto;padding:.45rem;
  font-size:.78rem;border-radius:9px;
  border-color:var(--border2);
}

/* ── Draft FAB (.draft-fab) ──────────────────────────────────────────────── */
.draft-fab{
  position:fixed;
  bottom:1.4rem;right:7.5rem;
  z-index:800;
  background:var(--warm);
  color:#fff;
  font-family:var(--font-heading);font-weight:600;font-size:.82rem;
  border:none;
  border-radius:999px;
  padding:.6rem 1.2rem;
  cursor:pointer;
  box-shadow:0 4px 20px rgba(232,168,124,.45);
  transform:translateY(0) scale(1);
  transition:transform .22s var(--ease-spring),
             box-shadow .18s ease,
             opacity .18s ease;
}
.draft-fab:hover{
  transform:translateY(-2px) scale(1.04);
  box-shadow:0 8px 28px rgba(232,168,124,.55);
}
.draft-fab:active{transform:scale(.96);}
.draft-fab.pb-fab-hidden{
  transform:translateY(80px) scale(.8);
  opacity:0;
  pointer-events:none;
}

@media(max-width:640px){
  .draft-fab{bottom:1rem;right:6.5rem;font-size:.76rem;padding:.55rem 1rem;}
}

/* ── Builder overlay backdrop ─────────────────────────────────────────────── */
.path-builder-overlay{
  position:fixed;inset:0;
  z-index:900;
  background:rgba(11,13,20,.72);
  backdrop-filter:blur(4px);
  display:flex;align-items:flex-end;justify-content:center;
  padding:1rem;
}
.path-builder-overlay[hidden]{display:none;}

@media(min-width:641px){
  .path-builder-overlay{align-items:center;}
}

/* ── Builder panel (.path-builder) ───────────────────────────────────────── */
.path-builder{
  width:100%;max-width:540px;max-height:92vh;
  background:var(--bg-elevated);
  border:1px solid var(--border2);
  border-radius:18px 18px 16px 16px;
  display:flex;flex-direction:column;
  overflow:hidden;
  box-shadow:0 24px 60px rgba(0,0,0,.55);
  animation:pbIn .24s var(--ease-spring) both;
}
@keyframes pbIn{from{transform:translateY(24px);opacity:0}to{transform:translateY(0);opacity:1}}

.pb-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:.85rem 1.1rem .7rem;
  border-bottom:1px solid var(--border);
  flex:none;
}
.pb-title-label{
  font-family:var(--font-display);font-style:italic;font-weight:600;
  font-size:1.1rem;color:var(--text);
}
.pb-close{
  background:none;border:0;color:var(--text-muted);font-size:1rem;
  cursor:pointer;padding:.25rem .35rem;border-radius:6px;
  transition:background .12s,color .12s;
}
.pb-close:hover{background:var(--bg3);color:var(--text);}

.pb-body{
  flex:1;overflow-y:auto;padding:.9rem 1.1rem;display:flex;flex-direction:column;gap:.7rem;
  scrollbar-width:thin;scrollbar-color:var(--border) transparent;
}

.pb-field{display:flex;flex-direction:column;gap:.3rem;}
.pb-label{
  font-family:var(--font-mono);font-size:.6rem;letter-spacing:.14em;
  text-transform:uppercase;color:var(--text-muted);
}
.pb-input{
  background:var(--bg-card);border:1px solid var(--border);
  border-radius:9px;padding:.55rem .75rem;
  font-family:var(--font-heading);font-size:.92rem;color:var(--text);
  outline:none;transition:border-color .15s;
}
.pb-input:focus{border-color:var(--purple);box-shadow:0 0 0 3px rgba(176,122,255,.1);}

.pb-steps-header{
  display:flex;align-items:center;justify-content:space-between;
}
.pb-steps-count{
  font-family:var(--font-mono);font-size:.6rem;color:var(--text-muted);
}

.pb-steps-list{
  display:flex;flex-direction:column;gap:.35rem;
  background:var(--bg-card);border:1px solid var(--border);
  border-radius:10px;padding:.5rem .55rem;
  min-height:60px;
}
.pb-empty{
  font-family:var(--font-mono);font-size:.65rem;color:var(--text-muted);
  text-align:center;padding:.7rem 0;
}
.pb-step-row{
  display:flex;align-items:center;gap:.45rem;
  padding:.3rem .4rem;border-radius:7px;
  background:var(--bg-elevated);
  font-family:var(--font-heading);font-size:.78rem;color:var(--text);
}
.pb-step-num{
  font-family:var(--font-mono);font-size:.58rem;color:var(--text-muted);
  min-width:1.6rem;flex:none;
}
.pb-step-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.pb-step-actions{display:flex;gap:.2rem;flex:none;}
.pb-step-btn{
  background:none;border:1px solid var(--border);border-radius:5px;
  color:var(--text-muted);font-size:.7rem;padding:.15rem .3rem;
  cursor:pointer;transition:background .12s,color .12s,border-color .12s;
  line-height:1;
}
.pb-step-btn:hover:not(:disabled){background:var(--bg3);border-color:var(--border2);color:var(--text);}
.pb-step-btn:disabled{opacity:.3;cursor:default;}
.pb-remove:hover:not(:disabled){border-color:var(--red) !important;color:var(--red) !important;}

.pb-public-row label{
  display:flex;align-items:center;gap:.5rem;
  font-family:var(--font-mono);font-size:.7rem;color:var(--text-dim);cursor:pointer;
}
.pb-public-row input[type="checkbox"]{accent-color:var(--teal);width:14px;height:14px;}

/* Status / share result */
.pb-status{
  background:var(--bg-card);border:1px solid var(--border);
  border-radius:10px;padding:.7rem .8rem;
  font-family:var(--font-mono);font-size:.7rem;color:var(--text-dim);
  display:flex;flex-direction:column;gap:.45rem;
}
.pb-status.pb-status-error{border-color:rgba(232,106,106,.5);color:var(--red);}
.pb-status.pb-status-success{border-color:rgba(92,201,181,.4);}
.pb-saved-label{color:var(--teal);font-weight:600;}
.pb-share-row{display:flex;gap:.4rem;align-items:center;}
.pb-share-input{
  flex:1;background:var(--bg3);border:1px solid var(--border);
  border-radius:7px;padding:.3rem .55rem;
  font-family:var(--font-mono);font-size:.66rem;color:var(--text-dim);
  outline:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.pb-copy-btn{
  background:var(--teal);color:#fff;
  font-family:var(--font-mono);font-size:.66rem;font-weight:600;
  border:none;border-radius:7px;padding:.3rem .7rem;cursor:pointer;
  white-space:nowrap;transition:opacity .14s;flex:none;
}
.pb-copy-btn:hover{opacity:.85;}

/* Actions row */
.pb-actions{
  display:flex;gap:.55rem;padding:.75rem 1.1rem .85rem;
  border-top:1px solid var(--border);flex:none;
}
.pb-btn{
  flex:1;padding:.6rem .8rem;border:none;border-radius:10px;
  font-family:var(--font-heading);font-weight:600;font-size:.85rem;
  cursor:pointer;transition:opacity .14s,transform .13s;
}
.pb-btn:hover{opacity:.88;transform:translateY(-1px);}
.pb-btn:active{transform:scale(.97);}
.pb-btn:disabled{opacity:.45;cursor:default;transform:none;}
.pb-btn-save{background:var(--warm);color:#fff;}
.pb-btn-clear{background:var(--bg-card);color:var(--text-dim);border:1px solid var(--border);}

/* ── Toast (.pb-toast) ──────────────────────────────────────────────────────── */
.pb-toast{
  position:fixed;bottom:5rem;left:50%;transform:translateX(-50%) translateY(12px);
  z-index:1000;
  background:var(--bg-elevated);border:1px solid var(--border2);
  border-radius:999px;padding:.42rem 1.1rem;
  font-family:var(--font-mono);font-size:.72rem;color:var(--text);
  box-shadow:0 8px 28px rgba(0,0,0,.4);
  pointer-events:none;
  opacity:0;
  transition:opacity .2s ease,transform .2s var(--ease-spring);
}
.pb-toast.pb-toast-show{opacity:1;transform:translateX(-50%) translateY(0);}
.pb-toast.pb-toast-error{border-color:rgba(232,106,106,.45);color:var(--red);}
.pb-toast.pb-toast-success{border-color:rgba(92,201,181,.4);color:var(--teal);}

/* ── add-path-btn: show text label on wider contexts, icon-only on tight ──── */
/* In narrow col-cell rows: hide the label, keep icon + full a11y attrs */
.add-path-btn .add-path-label{font-size:.72rem;white-space:nowrap;}
.col-cell .add-path-btn .add-path-label{display:none;}
.col-cell .add-path-btn{width:22px;height:22px;padding:0;}
/* In path-step cards: show full label */
.path-step .add-path-btn .add-path-label{font-size:.62rem;}
/* In preview bodies: show full label */
.col-preview-body .add-path-btn .add-path-label{font-size:.78rem;}

/* ── "Create a journey" neutral-state button ─────────────────────────────── */
.path-neutral{display:flex;flex-direction:column;align-items:flex-start;gap:.85rem;padding:.25rem 0;}
.create-journey-btn{
  display:inline-flex;align-items:center;gap:.4rem;
  background:var(--warm);color:#fff;
  font-family:var(--font-heading);font-weight:600;font-size:.88rem;
  border:none;border-radius:10px;
  padding:.6rem 1.2rem;
  cursor:pointer;
  box-shadow:0 3px 14px rgba(232,168,124,.35);
  transition:opacity .14s,transform .16s var(--ease-spring);
}
.create-journey-btn:hover{opacity:.9;transform:translateY(-1px);}
.create-journey-btn:active{transform:scale(.97);}

/* ── In-builder lesson search ─────────────────────────────────────────────── */
.pb-lesson-search-field{position:relative;}
.pb-lesson-search-input{padding-right:2rem;}
.pb-lesson-results{
  position:absolute;left:0;right:0;top:calc(100% + 4px);
  background:var(--bg-elevated);border:1px solid var(--border2);
  border-radius:10px;
  z-index:10;
  max-height:220px;overflow-y:auto;
  box-shadow:0 8px 28px rgba(0,0,0,.4);
  scrollbar-width:thin;scrollbar-color:var(--border) transparent;
}
.pb-result-item{
  display:flex;align-items:center;gap:.5rem;
  padding:.5rem .75rem;cursor:pointer;
  transition:background .1s;
}
.pb-result-item:hover,.pb-result-item:focus{background:var(--bg3);outline:none;}
.pb-result-item.pb-result-in-draft{opacity:.6;cursor:default;}
.pb-result-item.pb-result-added{background:rgba(92,201,181,.14);}
.pb-result-title{
  flex:1;font-family:var(--font-heading);font-size:.8rem;color:var(--text);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.pb-result-meta{
  font-family:var(--font-mono);font-size:.58rem;color:var(--text-muted);
  white-space:nowrap;flex:none;
}
.pb-result-check{color:var(--teal);font-size:.75rem;flex:none;}
.pb-result-empty{
  padding:.65rem .75rem;
  font-family:var(--font-mono);font-size:.65rem;color:var(--text-muted);
  text-align:center;
}

/* ── Light-mode adjustments for path-builder additions ───────────────────── */
[data-theme="light"] .draft-fab{box-shadow:0 4px 20px rgba(212,120,90,.35);}
[data-theme="light"] .path-builder{border-color:var(--border);}
[data-theme="light"] .pb-steps-list{background:rgba(245,240,232,.6);}
[data-theme="light"] .pb-step-row{background:rgba(245,240,232,.4);}
[data-theme="light"] .pb-status{background:rgba(245,240,232,.4);}
[data-theme="light"] .pb-share-input{background:rgba(245,240,232,.7);}
[data-theme="light"] .pb-lesson-results{background:var(--bg-elevated);border-color:var(--border);}
[data-theme="light"] .pb-result-item:hover{background:var(--bg3);}

@media(max-width:640px){
  .path-builder{max-width:100%;border-radius:18px 18px 0 0;}
  .path-builder-overlay{padding:0;align-items:flex-end;}
  .pb-body{max-height:60vh;}
}

/* ── Community gallery (.path-gallery / .gallery-card) ────────────────────── */
.path-gallery{
  margin-top:2.4rem;
  padding-top:1.6rem;
  border-top:1px solid var(--border);
}

/* Section label — matches existing .start-label / .path-branch-label mono style */
.gallery-label{
  font-family:var(--font-mono);
  font-size:.6rem;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--text-muted);
  display:flex;
  align-items:center;
  gap:.8rem;
  margin-bottom:1rem;
}
.gallery-label::after{
  content:"";
  flex:1;
  height:1px;
  background:var(--border);
}

/* Loading / empty state */
.gallery-loading,
.gallery-empty{
  font-family:var(--font-mono);
  font-size:.72rem;
  color:var(--text-muted);
  text-align:center;
  padding:1.6rem 1rem;
  margin:0;
}

/* Card grid — 3 cols → 2 → 1 */
.gallery-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:.75rem;
}

/* Individual card */
.gallery-card{
  position:relative;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:.85rem 1rem .8rem;
  cursor:pointer;
  overflow:hidden;
  /* reveal: enter from below */
  animation:discIn .22s ease both;
  transition:transform .18s ease,
             box-shadow .18s ease,
             border-color .15s ease;
  outline:none;
}
.gallery-card:hover{
  transform:translateY(-3px);
  box-shadow:0 10px 32px rgba(0,0,0,.3);
  border-color:var(--border2);
}
.gallery-card:focus-visible{
  border-color:var(--purple);
  box-shadow:0 0 0 3px rgba(176,122,255,.18);
}

/* Top accent line (warm, consistent with goal-cards) */
.gallery-card::before{
  content:"";
  position:absolute;
  top:0;left:0;right:0;
  height:2px;
  background:var(--warm);
  opacity:.6;
}

.gallery-card-title{
  font-family:var(--font-heading);
  font-weight:600;
  font-size:.88rem;
  color:var(--text);
  line-height:1.3;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}
.gallery-card-meta{
  font-family:var(--font-mono);
  font-size:.6rem;
  color:var(--text-muted);
  margin-top:.3rem;
}
.gallery-card-author{
  font-family:var(--font-mono);
  font-size:.58rem;
  color:var(--text-muted);
  margin-top:.15rem;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Responsive: 3 → 2 → 1 */
@media(max-width:820px){
  .gallery-grid{grid-template-columns:repeat(2,1fr);}
}
@media(max-width:540px){
  .gallery-grid{grid-template-columns:1fr;}
}

/* Light-mode tweaks */
[data-theme="light"] .gallery-card{background:rgba(245,240,232,.6);}
[data-theme="light"] .gallery-card:hover{box-shadow:0 8px 24px rgba(0,0,0,.12);}

/* ── My Journeys: journey cards (match goal-card visual style) ─────────────── */
.my-journeys-label{
  font-family:var(--font-mono);
  font-size:.6rem;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--text-muted);
  display:flex;
  align-items:center;
  gap:.8rem;
  margin-bottom:.85rem;
  margin-top:2rem;
}
.my-journeys-label::after{
  content:"";
  flex:1;
  height:1px;
  background:var(--border);
}

.my-journeys-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:.85rem;
}

/* Journey card — identical chrome to .path-goal-card */
.my-journey-card{
  position:relative;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:1.1rem 1.2rem 1rem;
  cursor:pointer;
  overflow:hidden;
  /* top accent uses --gc set inline (warm fallback) */
  transition:transform .18s ease,
             box-shadow .18s ease,
             border-color .15s;
  outline:none;
  animation:discIn .22s ease both;
}
/* Top accent bar */
.my-journey-card::before{
  content:"";
  position:absolute;
  top:0;left:0;right:0;
  height:3px;
  background:var(--gc,var(--warm));
}
.my-journey-card:hover{
  transform:translateY(-3px);
  box-shadow:0 10px 32px rgba(0,0,0,.3);
}
.my-journey-card:focus-visible{
  border-color:var(--purple);
  box-shadow:0 0 0 3px rgba(176,122,255,.18);
}

/* Body content (mirrors .path-goal-body / .path-goal-title / .path-goal-meta) */
.my-journey-card-body{padding-top:.25rem;}
.my-journey-card-title{
  font-family:var(--font-heading);
  font-weight:600;
  font-size:.95rem;
  color:var(--text);
  line-height:1.3;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  /* leave room for action buttons in top-right */
  padding-right:3.2rem;
}
.my-journey-card-meta{
  font-family:var(--font-mono);
  font-size:.62rem;
  color:var(--text-muted);
  margin-top:.3rem;
}
.my-journey-card-device{
  font-family:var(--font-mono);
  font-size:.6rem;
  color:var(--text3);
  margin-top:.18rem;
}

/* Action buttons cluster — top-right corner, revealed on hover */
.my-journey-actions{
  position:absolute;
  top:.55rem;right:.55rem;
  display:flex;
  gap:.25rem;
  align-items:center;
  /* always present in DOM; fade-in on hover for polish */
  opacity:0;
  transition:opacity .15s;
  pointer-events:none;
}
.my-journey-card:hover .my-journey-actions,
.my-journey-card:focus-within .my-journey-actions{
  opacity:1;
  pointer-events:auto;
}

/* Individual action button: share ⤴ and delete ✕ */
.my-journey-action-btn{
  background:var(--bg-elevated);
  border:1px solid var(--border2);
  border-radius:5px;
  color:var(--text-muted);
  cursor:pointer;
  font-size:.72rem;
  line-height:1;
  padding:.22rem .4rem;
  transition:background .12s,color .12s,border-color .12s;
  white-space:nowrap;
}
.my-journey-action-btn:hover{
  background:var(--bg3);
  color:var(--text);
  border-color:var(--border-hover);
}
.my-journey-share-btn:hover{
  border-color:var(--teal);
  color:var(--teal);
}
.my-journey-delete-btn:hover{
  border-color:var(--red);
  color:var(--red);
}

/* Mobile: always show actions (no hover) */
@media(max-width:640px){
  .my-journeys-grid{grid-template-columns:1fr;}
  .my-journey-actions{
    opacity:1;
    pointer-events:auto;
  }
}

/* ── "Add to my account" button in shared journey header ─────────────────── */
.path-add-to-account-btn{
  display:inline-flex;
  align-items:center;
  gap:.38rem;
  background:var(--warm);
  color:#fff;
  font-family:var(--font-heading);
  font-weight:600;
  font-size:.82rem;
  border:none;
  border-radius:8px;
  padding:.42rem 1rem;
  cursor:pointer;
  box-shadow:0 3px 12px rgba(232,168,124,.35);
  transition:opacity .14s,transform .16s var(--ease-spring);
  white-space:nowrap;
}
.path-add-to-account-btn:hover{opacity:.88;transform:translateY(-1px);}
.path-add-to-account-btn:active{transform:scale(.97);}

/* Light-mode tweaks */
[data-theme="light"] .my-journey-card{background:rgba(245,240,232,.6);}
[data-theme="light"] .my-journey-card:hover{box-shadow:0 8px 24px rgba(0,0,0,.12);}
[data-theme="light"] .my-journey-action-btn{background:rgba(245,240,232,.8);}

/* ── Journey picker popover (.journey-picker) ──────────────────────────────── */
/* Anchored near the clicked ＋ button; reveal via transform only (no display swap) */
.journey-picker{
  position:absolute;
  z-index:1200;
  min-width:220px;max-width:320px;
  background:var(--bg-elevated);
  border:1px solid var(--border2);
  border-radius:12px;
  box-shadow:0 16px 48px rgba(0,0,0,.5),0 2px 8px rgba(0,0,0,.25);
  padding:.4rem;
  /* entrance animation — transform only, no opacity flash */
  animation:jpIn .17s var(--ease-spring) both;
  overflow:hidden;
}
@keyframes jpIn{from{transform:translateY(-6px) scale(.97)}to{transform:translateY(0) scale(1)}}

.journey-picker-loading{
  font-family:var(--font-mono);font-size:.65rem;color:var(--text-muted);
  padding:.55rem .7rem;text-align:center;
}

/* Individual row — full-width button */
.journey-picker-row{
  display:flex;align-items:center;gap:.55rem;
  width:100%;padding:.5rem .7rem;
  background:none;border:0;border-radius:8px;
  font-family:var(--font-heading);font-size:.82rem;color:var(--text);
  cursor:pointer;text-align:left;
  transition:background .1s,color .1s;
  white-space:nowrap;overflow:hidden;
}
.journey-picker-row:hover:not([aria-disabled="true"]){
  background:rgba(176,122,255,.14);
}
.journey-picker-row:active:not([aria-disabled="true"]){
  background:rgba(176,122,255,.22);
}

/* "New journey" row — warm accent */
.journey-picker-new{color:var(--warm);}
.journey-picker-new:hover{background:rgba(232,168,124,.12) !important;color:var(--warm);}

/* Dimmed row (lesson already in that journey) */
.journey-picker-row-dim{opacity:.45;cursor:default;}

/* Icon glyph */
.journey-picker-icon{
  flex:none;font-size:.8rem;line-height:1;color:inherit;
  opacity:.7;
}

/* Title — truncates */
.journey-picker-label{
  flex:1;overflow:hidden;text-overflow:ellipsis;
  font-size:.82rem;line-height:1.3;
}

/* Step count */
.journey-picker-count{
  flex:none;font-family:var(--font-mono);font-size:.58rem;
  color:var(--text-muted);margin-left:auto;padding-left:.3rem;
}

/* "already in" / "already in draft" badge */
.journey-picker-badge{
  flex:none;font-family:var(--font-mono);font-size:.55rem;
  color:var(--teal);background:rgba(92,201,181,.12);
  border:1px solid rgba(92,201,181,.25);
  border-radius:999px;padding:.1rem .4rem;
  white-space:nowrap;
}

/* Separator between "New journey" and existing journeys */
.journey-picker-sep{
  height:1px;background:var(--border);
  margin:.3rem .3rem;
}

/* Light-mode */
[data-theme="light"] .journey-picker{
  border-color:rgba(0,0,0,.12);
  box-shadow:0 16px 48px rgba(0,0,0,.16),0 2px 8px rgba(0,0,0,.1);
}
[data-theme="light"] .journey-picker-row:hover:not([aria-disabled="true"]){
  background:rgba(176,122,255,.1);
}
[data-theme="light"] .journey-picker-new:hover{
  background:rgba(232,168,124,.1) !important;
}
