/* ============ FORGE (dashboard) ============ */
.forge-wrap { max-width: 1180px; margin: 0 auto; }

.hero { padding: 6px 2px 2px; }
.hero-greet {
  margin: 0;
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  font-weight: 800; letter-spacing: -0.02em;
  color: var(--ink);
  text-transform: lowercase;
}
.hero-greet .hg-cursor { color: var(--acc); animation: blink 1.1s steps(1) infinite; font-weight: 400; }
.hero-sub {
  margin: 3px 0 0; color: var(--muted); font-size: 0.72rem;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  text-transform: lowercase;
}
.hero-sub .sep { color: var(--line-2); }
.streak-flame { display: inline-flex; align-items: center; gap: 4px; color: var(--acc); }
.streak-flame .ic { width: 12px; height: 12px; }

.quick-capture {
  display: flex; gap: 9px; align-items: center;
  margin: 14px 0 8px;
  padding: 3px 3px 3px 12px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  transition: border-color var(--fast);
}
.quick-capture:focus-within { border-color: var(--acc); }
.quick-capture .ic { display: none; }
.quick-capture::before { content: ">"; color: var(--acc); font-weight: 700; }
.quick-capture input {
  flex: 1; border: none; outline: none; background: transparent;
  color: var(--ink); font-size: 0.82rem; font-family: var(--mono);
  padding: 7px 0;
}

/* ticker — a quote tape */
.ticker-wrap {
  position: relative;
  margin: 12px 0 16px;
  overflow: hidden;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  background: var(--bg);
}
.ticker { display: flex; width: max-content; animation: ticker-roll var(--ticker-dur, 46s) linear infinite; }
.ticker:hover { animation-play-state: paused; }
@keyframes ticker-roll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 0 6px 18px;
  font-size: 0.7rem;
  color: var(--ink-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ticker-item .t-label { color: var(--muted); }
.ticker-item .t-price { font-weight: 700; color: var(--ink); }
.ticker-item .sep-dot { color: var(--line-2); width: auto; height: auto; background: none; border-radius: 0; padding-left: 18px; }
.ticker-item .sep-dot::before { content: "│"; }

/* tiles grid */
.tiles { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.tiles .tile { grid-column: span 4; min-height: 180px; }
.tile.t-stats { grid-column: span 5; }
.tile.t-spark { grid-column: span 7; }
.tile.t-tech { grid-column: span 5; }
.tile.t-yt { grid-column: span 7; }
.tile.t-anime { grid-column: span 5; }
.tile.t-sports { grid-column: span 7; }
.tile.t-econ { grid-column: span 12; }
.tile.t-github { grid-column: span 12; }
@media (max-width: 1100px) {
  .tile.t-stats, .tile.t-spark, .tile.t-tech, .tile.t-yt, .tile.t-anime, .tile.t-sports { grid-column: span 12; }
}

/* stats tile */
.stat-top { display: flex; align-items: flex-end; gap: 22px; margin-bottom: 10px; flex-wrap: wrap; }
.stat-big .num {
  font-size: 2.1rem; font-weight: 800; line-height: 1;
  color: var(--acc);
  font-variant-numeric: tabular-nums;
}
.stat-big .lbl, .stat-mini .lbl {
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
}
.stat-mini { display: flex; flex-direction: column; gap: 1px; }
.stat-mini .num { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.status-bars { display: flex; height: 7px; overflow: hidden; gap: 1px; margin: 8px 0 5px; border: 1px solid var(--line); padding: 1px; }
.status-bars span { transition: width 500ms ease; min-width: 0; }
.status-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.status-legend .sl {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.64rem; color: var(--muted); text-transform: lowercase;
}
.spark-canvas { width: 100%; height: 46px; display: block; margin-top: 8px; }

/* spark of the day */
.t-spark .sod-name { font-size: 1.15rem; font-weight: 800; margin: 0 0 5px; }
.t-spark .sod-pitch {
  color: var(--ink-2); margin: 0 0 10px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* hn rows */
.hn-item {
  display: flex; align-items: baseline; gap: 9px;
  padding: 4px 2px;
  border-bottom: 1px dashed var(--line);
  transition: background var(--fast);
}
.hn-item:last-child { border-bottom: none; }
.hn-item:hover { background: var(--bg-2); }
.hn-item .rank { font-size: 0.62rem; color: var(--acc); min-width: 17px; font-variant-numeric: tabular-nums; }
.hn-item a { color: var(--ink-2); font-size: 0.76rem; line-height: 1.4; text-decoration: none; }
.hn-item a:hover { color: var(--acc); text-decoration: underline; }
.hn-item .pts { margin-left: auto; font-size: 0.62rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* media thumbs (yt / anime minis) — framed, captioned */
.yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.yt-mini {
  position: relative; overflow: hidden; cursor: pointer;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  display: block;
}
.yt-mini:hover { border-color: var(--acc); }
.yt-mini img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; filter: saturate(0.85); }
.yt-mini:hover img { filter: saturate(1); }
.yt-mini .yt-t {
  display: block;
  padding: 5px 7px;
  border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: 0.64rem; line-height: 1.35;
  background: var(--bg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.yt-mini:hover .yt-t { color: var(--ink); }

.anime-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 9px; }
.anime-mini {
  position: relative; overflow: hidden; cursor: pointer; display: block;
  border: 1px solid var(--line-2); background: var(--bg-3);
}
.anime-mini:hover { border-color: var(--acc); }
.anime-mini img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; filter: saturate(0.85); }
.anime-mini:hover img { filter: saturate(1); }
.anime-mini .a-score {
  position: absolute; top: 0; right: 0;
  font-size: 0.6rem; font-weight: 700;
  background: var(--bg); color: var(--st-spark);
  padding: 1px 5px; border-left: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
}
.anime-mini .a-t {
  display: block;
  padding: 4px 6px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-2); font-size: 0.6rem; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* match rows */
.match-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center; gap: 9px;
  padding: 5px 6px;
  border-bottom: 1px dashed var(--line);
  font-size: 0.74rem;
}
.match-row:last-child { border-bottom: none; }
.match-row:hover { background: var(--bg-2); }
.match-row .m-team { display: flex; align-items: center; gap: 6px; min-width: 0; }
.match-row .m-team.right { justify-content: flex-end; }
.match-row .m-team span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-row .m-team img { width: 15px; height: 15px; object-fit: contain; flex-shrink: 0; filter: saturate(0.8); }
.match-row .m-score {
  font-weight: 700; font-size: 0.76rem;
  padding: 0 7px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.match-row .m-score.live { color: var(--ok); }
.match-row .m-score.live::before { content: "● "; animation: blink 1s steps(1) infinite; }
.match-row .m-when { font-size: 0.62rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* economy quote board */
.econ-tbl-wrap { overflow-x: auto; }
.econ-tbl .sym { font-weight: 700; color: var(--ink); white-space: nowrap; }
.econ-tbl .last { font-weight: 700; }
.econ-tbl td canvas { width: 130px; height: 26px; display: block; }
.econ-note { font-size: 0.64rem; color: var(--muted); margin-top: 10px; }
.econ-note::before { content: "// "; color: var(--line-2); }

/* ============ GITHUB WIDGET (shared: forge tile + home page) ============
   Contribution-level theming: --gh-0..4 (base.css :root) are color-mix()
   steps of --acc against --bg-2, not GitHub's green — same "one accent"
   system as everywhere else, auto-adapting to both themes with no per-theme
   overrides needed. Language identity uses GitHub's own linguist colors
   (github-widget.js's LANG_COLORS/langColor), set per-segment as an inline
   style — see .gh-lang-seg below, which just supplies the shape. */
.gh-cal-empty { color: var(--muted); font-size: 0.78rem; padding: 10px 0; }

.gh-cal-wrap { overflow-x: auto; margin-top: 10px; padding-bottom: 4px; }
.gh-cal { width: max-content; }
.gh-month-row { display: flex; gap: 2px; margin-bottom: 3px; }
.gh-month-cell {
  width: 10px; flex: 0 0 10px;
  font-size: 0.56rem; color: var(--muted);
  overflow: visible; white-space: nowrap;
}
.gh-cal-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 10px);
  grid-auto-columns: 10px;
  gap: 2px;
}
.gh-day { width: 10px; height: 10px; border: 1px solid var(--line); }
.gh-day.lvl-0 { background: var(--gh-0); }
.gh-day.lvl-1 { background: var(--gh-1); }
.gh-day.lvl-2 { background: var(--gh-2); }
.gh-day.lvl-3 { background: var(--gh-3); }
.gh-day.lvl-4 { background: var(--gh-4); }

/* language bar — each segment's background color comes inline from JS
   (langColor()); this rule just supplies the shared shape/transition. */
.gh-lang-bar { display: flex; gap: 2px; height: 8px; margin-top: 14px; border: 1px solid var(--line); padding: 1px; }
.gh-lang-seg { transition: width 500ms ease; min-width: 0; }
.gh-lang-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.gh-lang-item { display: inline-flex; align-items: center; gap: 5px; font-size: 0.64rem; color: var(--ink-2); }
.gh-lang-item .status-dot { border-radius: 50%; }

/* ============ HOME (public landing) ============
   Structure/rhythm only — no color, no ASCII rendering, no motion added here.
   .home-wrap deliberately carries NO max-width (unlike .forge-wrap/.lib-wrap) so
   .masthead's negative margins below can reach the view's true edges. Every other
   section re-applies the app's usual 1180px content measure via margin:auto. */
.home-wrap { display: flex; flex-direction: column; gap: 0; }

/* masthead — full-bleed band, boxless (no .tile, no corner-ticks). The negative
   margin cancels out #view's own padding (base.css: 18px 22px, 14px 12px under
   960px) so this one section runs edge-to-edge; masthead-inner reinstates the
   usual content max-width so the copy itself still reads at a normal measure.
   Hook for component-curator: ASCII nameplate replaces/decorates #home-hg-text
   (sized via --masthead-size/--masthead-weight from base.css), tagline is
   .mh-tagline, availability indicator is .mh-avail[data-status]. */
.masthead {
  margin: -18px -22px 0;
  padding: 40px 22px 34px;
  border-bottom: 1px solid var(--line);
}
.masthead-inner { max-width: 1180px; margin: 0 auto; }
.mh-name {
  margin: 0;
  font-size: var(--masthead-size);
  font-weight: var(--masthead-weight);
  letter-spacing: -0.02em;
  line-height: 1;
  text-transform: uppercase;
}
/* small "::" tag prefix — the same tagged-label convention already used
   throughout the app (.tile-title, .lib-head h2), scaled way down so the
   nameplate itself stays the one loud element, everything around it stays
   quiet. .masthead-name (added alongside .mh-name in home.js) is a second
   hook, left for scroll-choreographer's scramble/blink timing pass — no
   animation is wired here. */
.mh-name::before {
  content: "::";
  color: var(--acc);
  font-size: 0.28em;
  font-weight: 700;
  vertical-align: 0.42em;
  margin-right: 0.12em;
}
.mh-name .hg-cursor { color: var(--acc); animation: blink 1.1s steps(1) infinite; font-weight: 400; }
.mh-tagline {
  margin: 14px 0 0;
  max-width: 60ch;
  font-size: 0.85rem;
  font-family: var(--serif); /* prose gets the serif, same rule as .p-pitch etc. */
  color: var(--muted);
}
.mh-avail {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 16px;
  font-size: 0.72rem;
  color: var(--ink-2);
  text-transform: lowercase;
}
/* availability dot — .status-dot (components.css) gives the sharp-cornered
   shape, color below is the row's --pub-* status token. .mh-avail-text
   already spells the status out in words, so color is never the only cue. */
.mh-avail-dot { background: var(--muted); }
.mh-avail[data-status="spark"] .mh-avail-dot { background: var(--pub-research); }
.mh-avail[data-status="shaping"] .mh-avail-dot { background: var(--pub-explore); }
.mh-avail[data-status="forging"] .mh-avail-dot { background: var(--pub-live); }
.mh-avail[data-status="shipped"] .mh-avail-dot { background: var(--pub-shipped); }
.mh-avail[data-status="cooling"] .mh-avail-dot { background: var(--pub-idle); }
.mh-cta { margin-top: 22px; }

/* now-tape — quiet marquee strip directly under the masthead. Reuses the
   .ticker marquee mechanics verbatim (see forge.js's economy ticker): the
   same @keyframes ticker-roll (FORGE section, above), the same duplicated-
   content seamless-loop trick (home.js sets track.innerHTML = html + html),
   the same pause-on-hover. Deliberately quieter than .ticker-item — smaller
   type, no background fill — so it doesn't compete with the nameplate. */
.now-tape {
  max-width: 1180px;
  margin: 20px auto 0;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 30px;
}
.now-tape-track {
  display: flex; width: max-content;
  animation: ticker-roll var(--ticker-dur, 42s) linear infinite;
}
.now-tape-track:hover { animation-play-state: paused; }
.now-tape-item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 20px 8px 0;
  font-size: 0.66rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.now-tape-item .nt-label {
  color: var(--line-2);
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.58rem;
}
.now-tape-item .nt-value { color: var(--muted); }
.now-tape-item .nt-sep { color: var(--line-2); }
.now-tape-item .nt-sep::before { content: "│"; }

/* spec body — two-column: about (left) / build log (right). Same stack
   breakpoint as .sport-cols below (980px) — an existing two-rich-column
   pattern already in this file. */
.spec-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
  max-width: 1180px;
  margin: 26px auto 0;
}
.spec-label {
  margin: 0 0 12px;
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.spec-about .chip-row { margin-top: 12px; }

.log-rows { display: flex; flex-direction: column; }
/* .log-row's left rule defaults to a neutral hairline, overridden per
   [data-status] with a --pub-* token below — mirrors the .p-card /
   --col-color convention used in pipeline. Mapping (design-system-keeper's
   report): spark->research, shaping->explore, forging->live,
   shipped->shipped, cooling->idle. */
.log-row {
  padding: 9px 0 9px 14px;
  border-left: 3px solid var(--line-2);
  border-bottom: 1px dashed var(--line);
}
.log-row[data-status="spark"]   { border-left-color: var(--pub-research); }
.log-row[data-status="shaping"] { border-left-color: var(--pub-explore); }
.log-row[data-status="forging"] { border-left-color: var(--pub-live); }
.log-row[data-status="shipped"] { border-left-color: var(--pub-shipped); }
.log-row[data-status="cooling"] { border-left-color: var(--pub-idle); }
.log-row:last-child { border-bottom: none; }
.log-row-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 4px; }
.log-year { font-size: 0.66rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.log-title { font-weight: 700; font-size: 0.82rem; flex: 1; }
/* status word — the text cue paired with the left-rule color, so no row
   ever depends on color alone to convey its status. */
.log-status {
  font-size: 0.6rem; text-transform: lowercase; letter-spacing: 0.06em;
  color: var(--muted);
}
.log-row[data-status="spark"] .log-status   { color: var(--pub-research); }
.log-row[data-status="shaping"] .log-status { color: var(--pub-explore); }
.log-row[data-status="forging"] .log-status { color: var(--pub-live); }
.log-row[data-status="shipped"] .log-status { color: var(--pub-shipped); }
.log-row[data-status="cooling"] .log-status { color: var(--pub-idle); }
.log-body { margin: 0; color: var(--ink-2); }

/* design lab — a live, scoped accent-hue playground. --dsx-0..4 derive from
   --acc via color-mix(), same mechanism as --gh-0..4 (base.css), but scoped
   to .dsx-panel instead of :root — home.js overrides --acc inline on this
   one element only, so dragging the slider never touches the real theme. */
.dsx-section { max-width: 1180px; margin: 30px auto 0; }
.dsx-intro { margin: 0 0 14px; }
.dsx-panel {
  border: 1px solid var(--line); padding: 16px;
  --dsx-0: var(--bg-2);
  --dsx-1: color-mix(in srgb, var(--acc) 25%, var(--bg-2));
  --dsx-2: color-mix(in srgb, var(--acc) 50%, var(--bg-2));
  --dsx-3: color-mix(in srgb, var(--acc) 75%, var(--bg-2));
  --dsx-4: var(--acc);
}
.dsx-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.dsx-slider { flex: 1; accent-color: var(--acc); }
.dsx-hex { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 62px; }
.dsx-preview { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dsx-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--acc); display: inline-block; }
.dsx-swatches { display: flex; gap: 2px; }
.dsx-sw { width: 16px; height: 16px; border: 1px solid var(--line); }
.dsx-sw.lvl-0 { background: var(--dsx-0); }
.dsx-sw.lvl-1 { background: var(--dsx-1); }
.dsx-sw.lvl-2 { background: var(--dsx-2); }
.dsx-sw.lvl-3 { background: var(--dsx-3); }
.dsx-sw.lvl-4 { background: var(--dsx-4); }

/* github activity — own bespoke stat classes rather than reaching into the
   forge tile's .stat-mini vocabulary, keeping this view's CSS boundary as
   crisp as its data-layer one (same cost projects.js already pays for
   .pc-status vs. store.js's STATUS). Renders only when there's real fetched
   data — see home.js's renderGithubSection — so no empty/error state lives
   here on purpose. */
.home-github { max-width: 1180px; margin: 30px auto 0; }
.hg-stats { display: flex; gap: 22px; margin-bottom: 2px; flex-wrap: wrap; row-gap: 10px; }
.hg-stat { display: flex; flex-direction: column; gap: 1px; }
.hg-stat-num { font-size: 1.3rem; font-weight: 800; color: var(--acc); font-variant-numeric: tabular-nums; }
.hg-stat-lbl { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }

/* connect / footer */
.home-footer {
  max-width: 1180px;
  margin: 30px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

@media (max-width: 980px) {
  .spec-body { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 960px) {
  .masthead { margin: -14px -12px 0; padding: 28px 12px 24px; }
}
@media (max-width: 640px) {
  .masthead { margin: -12px -10px 0; padding: 22px 10px 20px; }
  .mh-tagline { max-width: none; }
  .dsx-controls { flex-wrap: wrap; }
  .dsx-preview { gap: 10px; }
}

/* ============ PROJECTS (public showcase) ============
   Structure/rhythm only, same rules as HOME above. .proj-masthead is a smaller
   sibling of .masthead — contained (not full-bleed) since it lives inside
   .lib-wrap's own 1180px measure. .proj-count is left empty here for
   component-curator to compute/render ("N total · M shipped") on each render(). */
.proj-masthead {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.proj-mh-title {
  margin: 0;
  font-size: clamp(1.6rem, 4.5vw, 2.75rem);
  font-weight: var(--masthead-weight);
  letter-spacing: -0.02em;
  line-height: 1;
}
.proj-mh-cursor { font-weight: 400; }
.proj-count {
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* project cards — same colored-left-rule idea as .log-row, but driven by an
   inline --pc-color custom property set per card in projects.js (mirrors
   pipeline's .p-card / --col-color pattern: one property, set from a plain
   status->token map, read by border + dot + label below). Mapping is the
   same five --pub-* tokens as .log-row above.

   A second per-card property rides alongside it: --pj, the project's own
   accent, pulled out of its screenshot and stored in the record. --pc-color
   stays the honest status signal (five values, shared vocabulary); --pj is
   purely the card's own light — rule, glow, bullets, sweep — so twelve cards
   in a grid read as twelve things rather than one repeated component. */
.pc-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.62rem; text-transform: lowercase; letter-spacing: 0.06em;
  color: var(--pc-color, var(--muted));
}
.pc-status-dot {
  width: 7px; height: 7px; flex-shrink: 0;
  background: var(--pc-color, var(--line-2));
}

/* ---- stats strip: one readout per honest number, counted up on entry ---- */
.pj-stats {
  display: flex; flex-wrap: wrap;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--acc);
  margin-bottom: 14px;
  background: var(--bg);
}
.pj-stat {
  flex: 1 1 130px;
  padding: 11px 15px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 3px;
}
.pj-stat:last-child { border-right: none; }
.pj-stat-n {
  font-size: 1.45rem; font-weight: 700; line-height: 1;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.pj-stat-lbl { font-size: 0.62rem; color: var(--muted); text-transform: lowercase; letter-spacing: 0.06em; }

/* ---- filter chips: the five statuses collapsed into three buckets ---- */
.pj-filters {
  display: flex; flex-wrap: wrap;
  border: 1px solid var(--line-2);
  width: fit-content;
  margin-bottom: 16px;
  background: var(--bg);
}
.pj-filter {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.72rem; font-weight: 500;
  padding: 6px 14px;
  border: none; border-right: 1px solid var(--line);
  background: transparent; color: var(--muted);
  text-transform: lowercase;
  transition: background var(--fast), color var(--fast);
}
.pj-filter:last-child { border-right: none; }
.pj-filter:hover { color: var(--ink); background: var(--bg-2); }
.pj-filter.on { background: var(--acc); color: var(--acc-ink); font-weight: 700; }
.pj-filter-n { font-size: 0.6rem; opacity: 0.65; font-variant-numeric: tabular-nums; }

/* ---- the two card shapes ---- */
.pj-featured { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.pj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(312px, 1fr)); gap: 14px; }

.pj-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--pc-color, var(--line-2));
  overflow: hidden;
  transition: border-color var(--fast), box-shadow 220ms ease;
}
.pj-card:hover {
  border-color: color-mix(in srgb, var(--pj) 50%, var(--line-2));
  border-left-color: var(--pc-color, var(--line-2));
  box-shadow: 0 12px 38px -22px color-mix(in srgb, var(--pj) 85%, transparent);
}
/* a hairline in the project's own colour that draws itself across the top on
   hover — the one piece of motion that says "this card, not that one". */
.pj-card::after {
  content: ""; position: absolute; left: 0; top: 0; z-index: 3;
  pointer-events: none;
  height: 2px; width: 0;
  background: var(--pj, var(--acc));
  transition: width 480ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.pj-card:hover::after { width: 100%; }

.pj-feat { flex-direction: row; }
.pj-featured .pj-feat:nth-child(even) { flex-direction: row-reverse; }

/* the whole card is the link: the title's anchor stretches its ::after over the
   card, so a click anywhere lands on the project. Everything that has its own
   job — the expand button, the thumbs, the button row — is lifted above that
   sheet in its own rule below. */
.pj-hot { cursor: pointer; }
.pj-title-link { color: inherit; text-decoration: none; }
.pj-title-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.pj-hot:hover .pj-title-link { color: var(--pj, var(--acc)); }
.pj-title .ic { color: var(--muted); margin-left: 5px; vertical-align: -1px; transition: color var(--fast), transform var(--fast); }
.pj-hot:hover .pj-title .ic { color: var(--pj, var(--acc)); transform: translate(1px, -1px); }

/* ---- the shot frame ---- */
.pj-shot {
  position: relative;
  overflow: hidden;
  background: #0c0c0e;
  flex-shrink: 0;
}
.pj-shot-feat { flex: 0 0 54%; min-height: 348px; }
.pj-shot-grid { aspect-ratio: 16 / 10; }
/* a blurred, scaled copy of the same shot, revealed only behind the ones that
   have to be contained (a portrait widget, a bare wordmark) — so those never
   sit on an empty box, and wide screenshots never pay for a second paint. */
.pj-shot-bg {
  position: absolute; inset: -10%;
  width: 120%; height: 120%;
  object-fit: cover;
  filter: blur(30px) saturate(1.4) brightness(0.5);
  opacity: 0;
  transition: opacity 300ms ease;
}
.pj-shot[data-fit="contain"] .pj-shot-bg { opacity: 0.8; }
.pj-shot-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  filter: saturate(0.92);
  transition: transform 750ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 220ms ease, filter 400ms ease;
}
.pj-shot[data-fit="contain"] .pj-shot-img { object-fit: contain; padding: 18px; }
.pj-card:hover .pj-shot-img { transform: scale(1.035); filter: saturate(1.06); }
.pj-shot.swapping .pj-shot-img { opacity: 0; }
.pj-shot-dead { background: var(--bg-2); }

.pj-scan {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%,
    color-mix(in srgb, var(--pj) 24%, transparent) 50%, transparent 62%);
  transform: translateX(-120%);
}
.pj-card:hover .pj-scan { animation: pj-sweep 900ms ease-out; }
@keyframes pj-sweep { from { transform: translateX(-120%); } to { transform: translateX(120%); } }

.pj-expand {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  display: grid; place-items: center;
  width: 27px; height: 27px;
  border: 1px solid var(--line-2);
  background: color-mix(in srgb, #0c0c0e 72%, transparent);
  color: #e8e6dd;
  opacity: 0;
  transition: opacity var(--fast), border-color var(--fast), color var(--fast);
}
.pj-card:hover .pj-expand, .pj-expand:focus-visible { opacity: 1; }
.pj-expand:hover { border-color: var(--pj); color: var(--pj); }

.pj-thumbs { position: absolute; left: 8px; bottom: 8px; z-index: 2; display: flex; gap: 5px; }
.pj-thumb {
  position: relative;
  width: 54px; height: 34px;
  padding: 0; overflow: hidden;
  border: 1px solid color-mix(in srgb, #e8e6dd 30%, transparent);
  background: #0c0c0e;
  opacity: 0.5;
  transition: opacity var(--fast), border-color var(--fast);
}
.pj-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.pj-thumb:hover { opacity: 0.85; }
.pj-thumb.on { opacity: 1; border-color: var(--pj); }

/* ---- the poster: what a project with no screenshot gets instead of a hole ---- */
.pj-poster {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 20px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--pj) 26%, var(--bg-2)), var(--bg-2) 62%);
}
.pj-poster-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--pj) 14%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--pj) 14%, transparent) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 78%);
}
/* four textures, chosen per project in projects.js — graph paper, punched
   dots, hatching, scanlines. More than half the list has no screenshot, and
   one repeated pattern across that many cards reads as a template. */
.pj-poster[data-pat="1"] .pj-poster-grid {
  background-image: radial-gradient(color-mix(in srgb, var(--pj) 30%, transparent) 1.2px, transparent 1.3px);
  background-size: 15px 15px;
}
.pj-poster[data-pat="2"] .pj-poster-grid {
  background-image: repeating-linear-gradient(48deg,
    color-mix(in srgb, var(--pj) 16%, transparent) 0 1px, transparent 1px 11px);
  background-size: auto;
}
.pj-poster[data-pat="3"] .pj-poster-grid {
  background-image: repeating-linear-gradient(to bottom,
    color-mix(in srgb, var(--pj) 15%, transparent) 0 1px, transparent 1px 7px);
  background-size: auto;
}
.pj-poster-mono {
  position: relative;
  font-size: clamp(3.2rem, 8vw, 5.4rem); font-weight: 700; line-height: 1;
  letter-spacing: -0.05em;
  color: color-mix(in srgb, var(--pj) 78%, transparent);
}
.pj-poster-name { position: relative; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em; color: var(--ink); }
.pj-poster-stack { position: relative; font-size: 0.6rem; color: var(--muted); text-align: center; }

/* ---- the body ---- */
.pj-body { flex: 1; display: flex; flex-direction: column; gap: 9px; padding: 14px 16px 15px; min-width: 0; }
.pj-feat .pj-body { padding: 24px 26px; gap: 11px; }
.pj-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pj-year { font-size: 0.62rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pj-title { margin: 0; font-size: 1.02rem; letter-spacing: -0.02em; line-height: 1.15; }
.pj-feat .pj-title { font-size: clamp(1.3rem, 2.6vw, 1.85rem); }
.pj-tag {
  margin: 0;
  font-family: var(--serif); font-size: 0.95rem; line-height: 1.35;
  color: var(--ink-2);
}
.pj-feat .pj-tag { font-size: 1.1rem; }
.pj-pitch { margin: 0; font-size: 0.73rem; line-height: 1.65; color: var(--muted); }
.pj-feat .pj-pitch { font-size: 0.76rem; }
.pj-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.pj-points li { position: relative; padding-left: 16px; font-size: 0.7rem; line-height: 1.5; color: var(--ink-2); }
.pj-points li::before { content: "▸"; position: absolute; left: 0; color: var(--pj, var(--acc)); }
.pj-stack { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: auto; padding-top: 4px; }
/* above the stretched title link, so these keep their own destinations */
.pj-links { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 7px; }
/* accent-tinted rather than inverted: the twelve project colours cover too wide
   a lightness range to guarantee contrast against a filled button. */
.pj-links .btn:hover {
  background: var(--bg-2);
  border-color: var(--pj, var(--acc));
  color: var(--pj, var(--acc));
}
.pj-links .btn .ic { flex-shrink: 0; }

/* ---- the lightbox ---- */
.pj-lb { display: flex; flex-direction: column; gap: 10px; }
.pj-lb-head { display: flex; align-items: center; gap: 10px; }
.pj-lb-name { font-weight: 700; font-size: 0.85rem; }
.pj-lb-cap { flex: 1; font-size: 0.68rem; color: var(--muted); }
.pj-lb-stage {
  display: grid; place-items: center;
  background: #0c0c0e;
  border: 1px solid var(--line);
  border-top: 2px solid var(--pj, var(--acc));
  min-height: 240px;
}
.pj-lb-stage img { max-width: 100%; max-height: 68vh; display: block; }
.pj-lb-nav { display: flex; align-items: center; justify-content: center; gap: 12px; }
.pj-lb-n { font-size: 0.66rem; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .pj-feat, .pj-featured .pj-feat:nth-child(even) { flex-direction: column; }
  .pj-shot-feat { flex: 0 0 auto; min-height: 0; aspect-ratio: 16 / 10; }
  .pj-feat .pj-body { padding: 16px 17px; }
}
@media (max-width: 560px) {
  .pj-grid { grid-template-columns: 1fr; }
  .pj-stat { flex-basis: 50%; }
  .pj-thumbs { display: none; }
}

/* ============ LIBRARY ============ */
.lib-wrap { max-width: 1180px; margin: 0 auto; }
.lib-tabs {
  display: flex; flex-wrap: wrap;
  border: 1px solid var(--line-2);
  background: var(--bg);
  margin-bottom: 14px;
  width: fit-content;
}
.lib-tab {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.74rem; font-weight: 500;
  padding: 7px 15px;
  border: none; border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  transition: background var(--fast), color var(--fast);
}
.lib-tab:last-child { border-right: none; }
.lib-tab .ic { width: 13px; height: 13px; }
.lib-tab:hover { color: var(--ink); background: var(--bg-2); }
.lib-tab.active { color: var(--acc-ink); background: var(--acc); font-weight: 700; }
.lib-head {
  display: flex; align-items: center; gap: 12px;
  margin: 2px 0 12px;
  min-height: 30px;
  flex-wrap: wrap;
}
.lib-head h2 { margin: 0; font-size: 0.92rem; text-transform: lowercase; }
.lib-head h2::before { content: ":: "; color: var(--acc); }
.lib-updated { font-size: 0.62rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lib-head .grow { flex: 1; }

.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }

.feed-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line-2);
  padding: 11px 13px;
  transition: border-color var(--fast);
}
.feed-card:hover { border-color: var(--muted); }
.feed-card .fc-title { font-weight: 700; font-size: 0.8rem; line-height: 1.4; margin: 0 0 4px; }
.feed-card .fc-title a { color: var(--ink); text-decoration: none; }
.feed-card .fc-title a:hover { color: var(--acc); text-decoration: underline; }
.feed-card .fc-desc { color: var(--muted); line-height: 1.45; margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feed-card .fc-meta { display: flex; align-items: center; gap: 9px; font-size: 0.64rem; color: var(--muted); flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.lang-dot { width: 8px; height: 8px; display: inline-block; }

.item-actions {
  position: absolute; top: 6px; right: 6px;
  display: flex; gap: 3px;
  opacity: 0;
  transition: opacity var(--fast);
}
.feed-card:hover .item-actions, .video-card:hover .item-actions, .anime-card:hover .item-actions,
.item-actions:has(.on) { opacity: 1; }
.item-actions .icon-btn { background: var(--bg); border-color: var(--line-2); }

/* video cards */
.video-card {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line-2);
  cursor: pointer;
  transition: border-color var(--fast);
}
.video-card:hover { border-color: var(--acc); }
.video-card .vc-thumb { position: relative; overflow: hidden; aspect-ratio: 16/9; background: var(--bg-3); border-bottom: 1px solid var(--line); }
.video-card .vc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(0.85); }
.video-card:hover .vc-thumb img { filter: saturate(1); }
.video-card .vc-play {
  position: absolute; right: 6px; bottom: 6px;
  display: grid; place-items: center;
  width: 26px; height: 26px;
  background: var(--bg); border: 1px solid var(--line-2);
  opacity: 0; transition: opacity var(--fast);
}
.video-card:hover .vc-play { opacity: 1; }
.video-card .vc-play .ic { width: 12px; height: 12px; color: var(--acc); }
.video-card .vc-body { padding: 8px 11px 9px; }
.video-card .vc-t { font-weight: 500; font-size: 0.74rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; color: var(--ink-2); }
.video-card:hover .vc-t { color: var(--ink); }
.video-card .vc-m { font-size: 0.62rem; color: var(--muted); display: flex; gap: 6px; font-variant-numeric: tabular-nums; }

/* anime cards */
.anime-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.anime-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--line-2);
  background: var(--bg);
  cursor: pointer;
  transition: border-color var(--fast);
}
.anime-card:hover { border-color: var(--acc); }
.anime-card img.cover { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; filter: saturate(0.85); border-bottom: 1px solid var(--line); }
.anime-card:hover img.cover { filter: saturate(1); }
.anime-card .ac-grad { display: none; }
.anime-card.no-cover::before {
  content: ""; display: block; aspect-ratio: 2/3;
  background: var(--bg-2); border-bottom: 1px solid var(--line);
}
.anime-card .ac-body { padding: 7px 9px 8px; }
.anime-card .ac-t { font-weight: 500; font-size: 0.72rem; line-height: 1.35; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.anime-card:hover .ac-t { color: var(--ink); }
.anime-card .ac-g { font-size: 0.6rem; color: var(--muted); margin-top: 2px; text-transform: lowercase; }
.anime-card .a-score {
  position: absolute; top: 0; left: 0;
  font-size: 0.62rem; font-weight: 700;
  background: var(--bg); color: var(--st-spark);
  padding: 1px 6px;
  border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
}
.anime-card .a-next {
  position: absolute; top: 0; right: 0;
  font-size: 0.58rem;
  background: var(--bg); color: var(--ok);
  padding: 1px 6px;
  border-left: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
  font-variant-numeric: tabular-nums;
}
.anime-card .a-fmt {
  display: inline-block; font-size: 0.56rem; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line-2); padding: 0 4px; margin-bottom: 2px;
}
/* Actions live top-right like every other card's. They share that corner with
   the next-episode badge, so the badge yields on hover — you're either
   scanning the grid or acting on one card, never both at once. */
.anime-card .item-actions { top: 6px; right: 6px; bottom: auto; }
.anime-card .a-next { transition: opacity var(--fast); }
.anime-card:hover .a-next { opacity: 0; }
/* Books/art carry a year rather than a next episode; same corner, same
   yield-on-hover deal with the action buttons. */
.anime-card .a-year {
  position: absolute; top: 0; right: 0;
  font-size: 0.58rem; color: var(--muted);
  background: var(--bg); padding: 1px 6px;
  border-left: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
  font-variant-numeric: tabular-nums;
  transition: opacity var(--fast);
}
.anime-card:hover .a-year { opacity: 0; }
.prov-row { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; min-height: 16px; }
.prov-badge { width: 16px; height: 16px; border-radius: 3px; object-fit: cover; display: block; }
/* badges become their own click target (straight to the where-to-watch page)
   once the lazy lookup resolves one — nudged on hover so it reads as a link
   rather than as decoration on the card behind it. */
.prov-link { display: block; line-height: 0; transition: transform var(--fast), opacity var(--fast); }
.prov-link:hover { transform: translateY(-1px); opacity: 0.82; }
/* ---- music: track rows + collapsible albums ---- */
.mus-list { border: 1px solid var(--line-2); }
.mus-row {
  position: relative;
  display: grid;
  grid-template-columns: 30px 22px 1fr minmax(0, 0.8fr) 44px;
  align-items: center; gap: 10px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  transition: background var(--fast);
}
.mus-row:last-child { border-bottom: none; }
.mus-row:hover { background: var(--bg-2); }
.mus-cover { width: 30px; height: 30px; object-fit: cover; border: 1px solid var(--line-2); display: block; }
.mus-cover.lg { width: 42px; height: 42px; }
.mus-n { font-size: 0.62rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.mus-play {
  display: grid; place-items: center;
  width: 22px; height: 22px; padding: 0;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--muted);
  transition: color var(--fast), border-color var(--fast);
}
.mus-play:hover { color: var(--acc); border-color: var(--acc); }
.mus-play.on { color: var(--acc-ink); background: var(--acc); border-color: var(--acc); }
.mus-play.empty { border-color: transparent; background: transparent; pointer-events: none; }
.mus-title { font-size: 0.76rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mus-row:hover .mus-title { color: var(--ink); }
.mus-e { font-size: 0.5rem; color: var(--muted); border: 1px solid var(--line-2); padding: 0 2px; margin-left: 6px; vertical-align: 1px; }
.mus-artist { font-size: 0.68rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mus-dur { font-size: 0.64rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.mus-row .item-actions { position: static; opacity: 0; grid-column: 5; justify-self: end; }
.mus-row:hover .item-actions, .mus-row .item-actions:has(.on) { opacity: 1; }
.mus-row:hover .mus-dur { display: none; }

.alb-group { border: 1px solid var(--line-2); margin-bottom: 6px; background: var(--bg); }
.alb-head {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 7px 9px;
  border: none; background: transparent; color: inherit;
  font-family: var(--mono); text-align: left;
  transition: background var(--fast);
}
.alb-head:hover { background: var(--bg-2); }
.alb-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.alb-meta b { font-size: 0.78rem; font-weight: 500; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alb-group.open .alb-meta b, .alb-head:hover .alb-meta b { color: var(--ink); }
.alb-meta i { font-style: normal; font-size: 0.66rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alb-count { font-size: 0.62rem; color: var(--muted); white-space: nowrap; }
.alb-chev { color: var(--muted); display: grid; place-items: center; transition: transform var(--med); }
.alb-group.open .alb-chev { transform: rotate(180deg); color: var(--acc); }
/* 0fr -> 1fr animates to the content's real height without measuring it, so
   a tracklist fetched after the fact still opens smoothly */
.alb-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--med) cubic-bezier(0.22, 1, 0.36, 1); }
.alb-group.open .alb-body { grid-template-rows: 1fr; }
.alb-inner { overflow: hidden; min-height: 0; border-top: 1px solid transparent; }
.alb-group.open .alb-inner { border-top-color: var(--line); }
.motion-off .alb-body { transition: none; }
@media (max-width: 620px) {
  .mus-row { grid-template-columns: 30px 22px 1fr 44px; }
  .mus-artist { display: none; }
}

/* ---- music: the cover grid ----
   The default music view. A chart is a wall of artwork before it is a list of
   names, and the old 30px row thumbnail couldn't carry that — this is sized so
   the cover is the thing you scan and the title is the confirmation. */
.mus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
.mus-card {
  position: relative;
  border: 1px solid var(--line-2);
  background: var(--bg);
  cursor: pointer;
  transition: border-color var(--fast);
}
.mus-card:hover { border-color: var(--acc); }
.mus-card .mc-art { position: relative; aspect-ratio: 1; background: var(--bg-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.mus-card .mc-art img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(0.85); transition: filter var(--fast); }
.mus-card:hover .mc-art img { filter: saturate(1); }
.mus-card.no-art .mc-art::after {
  content: "♪"; position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 1.6rem; color: var(--line-2);
}
/* the play control sits on the art, always visible once it exists — a preview
   is the point of the card, not a hover easter egg */
.mus-card .mc-play {
  position: absolute; left: 7px; bottom: 7px;
  width: 28px; height: 28px;
  background: var(--bg); color: var(--ink-2);
}
.mus-card .mc-play:hover, .mus-card .mc-play.on { color: var(--acc-ink); }
.mus-card .mc-dur {
  position: absolute; right: 0; bottom: 0;
  font-size: 0.58rem; color: var(--muted);
  background: var(--bg); padding: 1px 5px;
  border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2);
  font-variant-numeric: tabular-nums;
}
.mus-card .mc-body { padding: 8px 10px 9px; }
.mus-card .mc-t {
  font-weight: 500; font-size: 0.74rem; line-height: 1.35; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mus-card:hover .mc-t { color: var(--ink); }
.mus-card .mc-a { font-size: 0.65rem; color: var(--acc); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mus-card .mc-al { font-size: 0.6rem; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mus-card .item-actions { top: 6px; right: 6px; }
.mus-card:hover .item-actions { opacity: 1; }
@media (max-width: 620px) {
  .mus-grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 8px; }
}

/* ---- library toolbar: sort / group / view (lib-controls.js) ---- */
.lib-ctl {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 11px;
}
.lib-ctl .grow { flex: 1; }
.lc-f { display: inline-flex; align-items: center; gap: 6px; }
.lc-f > span { font-size: 0.6rem; text-transform: lowercase; letter-spacing: 0.04em; color: var(--muted); }
.lc-sel {
  appearance: none; -webkit-appearance: none;
  font-family: var(--mono); font-size: 0.68rem;
  color: var(--ink-2); background: var(--bg);
  border: 1px solid var(--line-2);
  padding: 4px 22px 4px 8px;
  cursor: pointer;
  /* the chevron is painted rather than added as a node so the control stays
     one element and lines up with .seg buttons beside it */
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 12px) calc(50% + 1px), calc(100% - 8px) calc(50% + 1px);
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  transition: border-color var(--fast), color var(--fast);
}
.lc-sel:hover { border-color: var(--muted); color: var(--ink); }
.lc-sel:focus-visible { outline: none; border-color: var(--acc); }
.lc-sel option { background: var(--bg); color: var(--ink); }
.lc-dir { width: 26px; height: 26px; }
.lc-dir.on { color: var(--acc-ink); background: var(--acc); border-color: var(--acc); }
/* .seg.sm button already sets padding, so match its specificity to win */
.seg.lc-view button { padding: 4px 9px; display: inline-grid; place-items: center; }
.lc-count { font-size: 0.62rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- grouped sections ---- */
.lib-group { margin-bottom: 18px; }
.lib-ghead {
  display: flex; align-items: baseline; gap: 9px;
  margin: 0 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
}
.lib-ghead .lg-name { font-size: 0.74rem; font-weight: 700; color: var(--ink-2); }
.lib-ghead .lg-name::before { content: "# "; color: var(--acc); }
.lib-ghead .lg-n { font-size: 0.6rem; color: var(--muted); font-variant-numeric: tabular-nums; }
/* the count is what's loaded, not what exists — this is how you ask for the
   rest of the series without hunting for it */
.lib-ghead .lg-drill {
  margin-left: auto;
  font-size: 0.58rem; letter-spacing: 0.04em; text-transform: lowercase;
  color: var(--muted); background: transparent;
  border: 1px solid var(--line-2); padding: 1px 7px;
  opacity: 0; transition: opacity var(--fast), color var(--fast), border-color var(--fast);
}
.lib-group:hover .lg-drill, .lg-drill:focus-visible { opacity: 1; }
.lib-ghead .lg-drill:hover { color: var(--acc); border-color: var(--acc); }

/* the "you are inside one series" banner */
.lib-facet {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 11px; padding: 7px 11px;
  border: 1px solid var(--acc); background: var(--bg);
  font-size: 0.66rem; color: var(--ink-2);
}
.lib-facet > span::before { content: "▸ "; color: var(--acc); }

/* ---- infinite scroll sentinel ---- */
.lib-more {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 22px 0 30px;
  font-size: 0.65rem; color: var(--muted);
}
.lib-more.done { padding: 18px 0 26px; letter-spacing: 0.06em; text-transform: lowercase; }
.lib-more.done::before, .lib-more.done::after { content: "···"; color: var(--line-2); }
.lm-dots { display: inline-flex; gap: 4px; }
.lm-dots i { width: 4px; height: 4px; background: var(--acc); display: block; animation: lmPulse 1s ease-in-out infinite; }
.lm-dots i:nth-child(2) { animation-delay: 0.15s; }
.lm-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes lmPulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.motion-off .lm-dots i { animation: none; opacity: 0.6; }

/* ---- library search (list-filter.js) ---- */
.lib-search { position: relative; display: flex; align-items: center; margin-bottom: 12px; }
.lib-search input {
  padding-left: 26px;
  /* the prompt glyph is drawn by ::before below, so leave room for it */
}
.lib-search::before {
  content: "/";
  position: absolute; left: 10px;
  color: var(--acc); font-weight: 700; font-size: 0.8rem;
  pointer-events: none;
}
.lib-search input::-webkit-search-cancel-button { filter: grayscale(1) opacity(0.5); cursor: pointer; }
.lib-search-count {
  position: absolute; right: 10px;
  font-size: 0.62rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
/* revealed only while a query matches nothing — cheaper than adding and
   removing a node on every keystroke */
.lib-empty-search { display: none; padding: 34px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); }
.lib-empty-search .em-kao { font-size: 1.1rem; color: var(--ink-2); letter-spacing: 0.05em; margin-bottom: 6px; }
.lib-empty-search p { margin: 0; }
.lib-no-matches .lib-empty-search { display: block; }
.lib-no-matches .anime-grid, .lib-no-matches .cardgrid,
.lib-no-matches .mus-grid, .lib-no-matches .mus-list,
/* the group headers and the "keep scrolling" affordance are part of the list —
   leaving them behind under a no-match note reads as a broken filter */
.lib-no-matches .lib-group, .lib-no-matches .lib-more,
.lib-no-matches .alb-group { display: none; }

.prov-attrib { font-size: 0.6rem; color: var(--muted); margin: -4px 0 10px; }
.prov-attrib a { color: var(--muted); }

/* sports */
.sport-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 980px) { .sport-cols { grid-template-columns: 1fr; } }
.sport-block h3 {
  margin: 0 0 8px; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2);
  display: flex; align-items: center; gap: 7px;
}
.sport-block h3::before { content: "::"; color: var(--acc); }
.sport-block h3 .ic { display: none; }
.standings-wrap { overflow-x: auto; }
.standings-wrap .pos { font-size: 0.62rem; color: var(--muted); width: 24px; font-variant-numeric: tabular-nums; }
.standings-wrap td img { width: 14px; height: 14px; object-fit: contain; vertical-align: -2px; margin-right: 6px; filter: saturate(0.8); }
.standings-wrap .pts { font-weight: 700; }
.standings-wrap tr.top4 .pos { color: var(--ok); font-weight: 700; }

.sports-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.sport-league-card { padding: 14px 16px; }
.slc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.slc-head h3 {
  margin: 0; font-size: 0.68rem; font-weight: 700; flex: 1;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2);
}
.slc-toggle { transition: transform var(--fast); }
.slc-toggle.open { transform: rotate(180deg); }
.slc-matches .match-row:last-child { border-bottom: none; }
.slc-standings { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.slc-standings .tbl { font-size: 0.66rem; }

.lg-chips { display: flex; flex-wrap: wrap; border: 1px solid var(--line-2); width: fit-content; }
.lg-chip {
  font-size: 0.64rem;
  padding: 4px 10px;
  border: none; border-right: 1px solid var(--line);
  background: transparent; color: var(--muted);
  transition: background var(--fast), color var(--fast);
  text-transform: lowercase;
}
.lg-chip:last-child { border-right: none; }
.lg-chip:hover { color: var(--ink); background: var(--bg-2); }
.lg-chip.active { color: var(--acc-ink); background: var(--acc); font-weight: 700; }

/* ============ PIPELINE ============ */
.pipe-wrap {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 10px;
  min-height: calc(100% - 20px);
  padding-top: 8px;
  overflow-x: auto;
}
@media (max-width: 1200px) { .pipe-wrap { grid-template-columns: repeat(5, 240px); } }
@media (max-width: 640px) { .pipe-wrap { grid-template-columns: repeat(5, 78vw); gap: 8px; } }
.pipe-col {
  display: flex; flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line-2);
  max-height: 100%;
  min-width: 0;
  transition: border-color var(--fast);
}
.pipe-col.over { border-color: var(--acc); border-style: dashed; }
.col-head {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-2);
}
.col-head .ic { display: none; }
.col-head::before { content: "■"; color: var(--col-color, var(--muted)); font-size: 0.6rem; }
.col-head .col-name {
  font-weight: 700; font-size: 0.66rem;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.col-head .col-count { margin-left: auto; font-size: 0.64rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-body { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 7px; min-height: 60px; }
.p-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--col-color, var(--line-2));
  padding: 9px 11px;
  cursor: pointer;
  transition: border-color var(--fast), background var(--fast), opacity var(--fast);
}
.p-card:hover { border-color: var(--muted); border-left-color: var(--col-color); background: var(--bg-2); }
.p-card.dragging { opacity: 0.4; }
.p-card .pc-name { font-weight: 500; font-size: 0.76rem; line-height: 1.35; margin-bottom: 5px; display: flex; align-items: start; gap: 6px; color: var(--ink-2); }
.p-card:hover .pc-name { color: var(--ink); }
.p-card .pc-name .pin-ic { color: var(--acc); flex-shrink: 0; margin-top: 1px; }
.p-card .pc-name .pin-ic .ic { width: 11px; height: 11px; }
.p-card .prog { margin: 7px 0 0; height: 5px; }
.p-card .pc-foot { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.col-add { display: flex; gap: 6px; padding: 0 8px 8px; }
.col-add input {
  flex: 1; background: transparent; border: 1px dashed var(--line-2);
  color: var(--ink); padding: 5px 9px; font-size: 0.7rem; font-family: var(--mono);
  transition: border-color var(--fast);
}
.col-add input:focus { outline: none; border-color: var(--acc); border-style: solid; }

/* ============ STASH ============ */
.stash-wrap { max-width: 1180px; margin: 0 auto; padding-top: 4px; }

/* generic layout utility (not stash-specific — reusable anywhere) */
.grow { flex: 1; }

/* compact modifier for .seg (components.css) — used by #st-sort here */
.seg.sm button { padding: 3px 9px; font-size: 0.62rem; }

/* quick-capture composer — the main interaction on this page: paste/type
   anything without leaving it. Same flat-panel language as .think-card /
   .set-section (border var(--line-2), bg var(--bg)). */
.st-composer {
  background: var(--bg);
  border: 1px solid var(--line-2);
  padding: 12px 14px 11px;
  transition: border-color var(--fast), background var(--fast);
}
.st-composer.dropping {
  border-color: var(--acc);
  border-style: dashed;
  background: color-mix(in srgb, var(--acc) 10%, var(--bg));
}
#st-input {
  width: 100%;
  min-height: 76px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 11px 13px;
  resize: vertical;
  transition: border-color var(--fast);
}
#st-input:hover { border-color: var(--muted); }
#st-input:focus { outline: none; border-color: var(--acc); border-style: solid; background: var(--bg); }
#st-input::placeholder { color: var(--muted); opacity: 0.65; }
.st-comp-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 9px; }
#st-hint { font-size: 0.66rem; color: var(--muted); white-space: nowrap; }

/* cards grid — a touch wider than before so screenshot/code cards breathe */
.stash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 12px; }
.stash-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--rail, var(--line-2));
  overflow: hidden;
  transition: border-color var(--fast);
}
.stash-card:hover { border-color: var(--muted); border-left-color: var(--rail, var(--muted)); }

.stash-card .st-img { width: 100%; max-height: 130px; object-fit: cover; display: block; border-bottom: 1px solid var(--line); filter: saturate(0.85); }
/* screenshots read as captured, not a feed thumbnail: taller, a thin inset
   mat (padding + bg-2 behind the image) instead of a flush crop, and a
   truer (less desaturated) filter than the yt/anime library thumbnails. */
.stash-card .st-img.shot {
  max-height: 190px;
  padding: 4px;
  box-sizing: border-box;
  background: var(--bg-2);
  filter: saturate(0.95);
}

/* video thumbnail/player — reuses the plain .st-img max-height, but the
   native <video> controls need to render so no crop/filter tricks here */
.stash-card .st-video { width: 100%; max-height: 130px; display: block; border-bottom: 1px solid var(--line); }

.stash-card .st-body { padding: 10px 12px 11px; }
.stash-card .st-title { font-weight: 700; font-size: 0.78rem; line-height: 1.4; margin-bottom: 3px; }
.stash-card .st-title a { color: var(--ink); text-decoration: none; }
.stash-card .st-title a:hover { color: var(--acc); text-decoration: underline; }
.stash-card .st-meta { font-size: 0.62rem; color: var(--muted); margin-bottom: 7px; }

/* component/snippet excerpt — small mono block, scrolls in its own box */
.st-code {
  display: block;
  margin: 0 0 7px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 8px 10px;
  max-height: 160px;
  overflow-y: auto;
  overflow-x: auto;
  white-space: pre;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--ink-2);
}

/* plain-note excerpt — prose gets the serif, per the app-wide convention */
.st-text {
  margin: 0 0 7px;
  font-family: var(--serif);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.stash-card textarea {
  width: 100%; background: transparent; border: 1px dashed var(--line-2);
  color: var(--ink-2); font-size: 0.72rem; font-family: var(--serif);
  padding: 6px 8px; min-height: 32px; resize: vertical;
  transition: border-color var(--fast);
}
.stash-card textarea:focus { outline: none; border-color: var(--acc); border-style: solid; }
.stash-card .item-actions { opacity: 0; }
.stash-card:hover .item-actions { opacity: 1; }

/* the whole card is a button now — say so on hover, and keep the focus ring
   real for the keyboard path (role=button + tabindex on .stash-card) */
.stash-card { cursor: pointer; }
.stash-card:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.stash-card textarea, .stash-card a, .stash-card .item-actions { cursor: auto; }
.stash-card .item-actions button { cursor: pointer; }

/* a forged idea keeps the shape it was written in, even at card size */
.stash-card.forged .st-tagline {
  font-family: var(--serif);
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 5px;
}
.stash-card .st-chips { margin: 0 0 7px; gap: 4px; }
.stash-card .st-chips .chip { font-size: 0.58rem; padding: 1px 6px; }

/* ---- stash detail: the whole saved thing, not the card's worth of it ---- */
.st-detail .sd-top { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.st-detail .sd-top .grow { flex: 1; }
.st-detail .sd-meta { font-size: 0.64rem; color: var(--muted); }
.st-detail .pt-div { width: 1px; height: 18px; background: var(--line-2); margin: 0 3px; }
.st-detail .sd-title { margin: 0 0 3px; font-size: 1.02rem; line-height: 1.3; }
.st-detail .sd-sub { font-size: 0.64rem; color: var(--muted); margin-bottom: 14px; }
.st-detail .sd-sub a { color: var(--muted); }
.st-detail .sd-sub a:hover { color: var(--acc); }

/* the fix this whole view exists for: the image at its real size, not a
   130px crop of it. capped by viewport height so a tall screenshot scrolls
   the modal rather than escaping it. */
.st-detail .sd-shot {
  display: block;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 5px;
  margin-bottom: 14px;
}
.st-detail .sd-shot img { display: block; width: 100%; height: auto; max-height: 62vh; object-fit: contain; }
.st-detail .sd-video { display: block; width: 100%; max-height: 62vh; margin-bottom: 14px; background: #000; }

.st-detail .sd-tagline {
  font-family: var(--serif);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink);
  padding-left: 10px;
  border-left: 2px solid var(--acc);
  margin-bottom: 12px;
}
.st-detail .sd-text {
  font-family: var(--serif);
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 46vh;
  overflow-y: auto;
}
.st-detail .sd-code {
  margin: 0;
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 12px 14px;
  max-height: 52vh;
  overflow: auto;
  white-space: pre;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.st-detail .sd-brief { margin-top: 12px; }
.st-detail .sd-axis {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--acc);
}
.st-detail .sd-chips { margin-top: 12px; }
.st-detail .sd-note { min-height: 54px; margin-top: 4px; }

/* ---- attachments inside an idea (panel.js) ---- */
.file-drop {
  border: 1px dashed var(--line-2);
  background: var(--bg);
  transition: border-color var(--fast), background var(--fast);
}
.file-drop.dropping { border-color: var(--acc); border-style: solid; background: var(--bg-2); }
.file-drop.empty { cursor: pointer; }
.file-empty { margin: 0; padding: 14px 12px 2px; font-size: 0.72rem; color: var(--muted); text-align: center; }
.file-hint {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 12px 10px; font-size: 0.62rem; color: var(--muted); opacity: 0.75;
}
.file-hint .ic { width: 11px; height: 11px; }
.file-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.74rem;
}
.file-row:hover { background: var(--bg-2); }
.file-row > .ic { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
/* the two Claude writes get the accent — they are the reason the section
   exists, and an uploaded png shouldn't look like a spec */
.file-row.spec > .ic, .file-row.plan > .ic { color: var(--acc); }
.file-name { flex: 1; min-width: 0; }
.file-name b { display: block; font-weight: 600; color: var(--ink); word-break: break-word; line-height: 1.35; }
.file-name i { display: block; font-style: normal; font-size: 0.6rem; color: var(--muted); margin-top: 1px; }
.file-row .icon-btn { opacity: 0; flex-shrink: 0; }
.file-row:hover .icon-btn, .file-row:focus-within .icon-btn { opacity: 1; }

.arch-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.arch-tag {
  font-size: 0.56rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); opacity: 0.7; margin-left: auto;
}
.arch-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.68rem; color: var(--acc);
}
.arch-live .ic { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .arch-live .ic { animation: none; } }

/* ---- the markdown viewer (a spec or a plan, read in place) ---- */
.md-modal .md-body {
  max-height: 68vh;
  overflow-y: auto;
  padding-right: 8px;
  font-family: var(--serif);
  font-size: 0.84rem;
  line-height: 1.68;
  color: var(--ink-2);
}
.md-body h1, .md-body h2, .md-body h3, .md-body h4, .md-body h5, .md-body h6 {
  font-family: inherit;
  color: var(--ink);
  line-height: 1.3;
  margin: 22px 0 8px;
}
.md-body > :first-child { margin-top: 0; }
.md-body h1 { font-size: 1.06rem; }
.md-body h2 {
  font-size: 0.9rem; text-transform: lowercase; letter-spacing: 0.02em;
  padding-bottom: 5px; border-bottom: 1px solid var(--line-2);
}
.md-body h2::before { content: ":: "; color: var(--acc); }
.md-body h3 { font-size: 0.82rem; color: var(--acc); }
.md-body h4, .md-body h5, .md-body h6 { font-size: 0.78rem; }
.md-body p { margin: 0 0 10px; }
.md-body ul, .md-body ol { margin: 0 0 12px; padding-left: 20px; }
.md-body li { margin-bottom: 5px; }
.md-body strong { color: var(--ink); font-weight: 700; }
.md-body a { color: var(--acc); word-break: break-word; }
.md-body hr { border: none; border-top: 1px solid var(--line-2); margin: 18px 0; }
.md-body code {
  font-family: var(--mono); font-size: 0.76em;
  background: var(--bg-3); border: 1px solid var(--line);
  padding: 1px 5px; word-break: break-word;
}
.md-body .md-code {
  background: var(--bg-3); border: 1px solid var(--line);
  padding: 11px 13px; margin: 0 0 12px;
  overflow-x: auto; white-space: pre;
  font-size: 0.72rem; line-height: 1.55;
}
.md-body .md-code code { background: none; border: none; padding: 0; font-size: 1em; }
.md-body .md-row { font-family: var(--mono); font-size: 0.68rem; white-space: pre-wrap; color: var(--ink-2); }

/* ============ THINK ============ */
.think-wrap { max-width: 720px; margin: 0 auto; padding-top: 6px; }
.think-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.think-hero .think-copy h2 { margin: 0 0 4px; font-size: 1.05rem; text-transform: lowercase; }
.think-hero .think-copy h2::before { content: ":: "; color: var(--acc); }
.think-hero .think-copy p { margin: 0; color: var(--muted); max-width: 60ch; }
.think-card {
  background: var(--bg);
  border: 1px solid var(--line-2);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color var(--fast);
}
.think-card:focus-within { border-color: var(--acc); }
.q-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
.q-label::before { content: "?"; color: var(--acc); font-weight: 700; }
.q-label .q-done { color: var(--ok); }
.q-label .q-done .ic { width: 11px; height: 11px; }
.q-text { font-size: 1.02rem; font-weight: 400; font-style: italic; margin: 6px 0 10px; color: var(--ink); }
.think-card textarea {
  width: 100%; min-height: 80px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  color: var(--ink); padding: 9px 11px; font-size: 0.8rem; font-family: var(--mono);
  resize: vertical; margin-bottom: 8px;
  transition: border-color var(--fast);
}
.think-card textarea:focus { outline: none; border-color: var(--acc); }
.think-actions { display: flex; align-items: center; gap: 10px; }
.saved-hint {
  font-size: 0.62rem; color: var(--ok);
  opacity: 0;
  transition: opacity var(--fast);
}
.saved-hint::before { content: "[ok] "; }
.saved-hint.show { opacity: 1; }

/* ============ SETTINGS ============ */
.set-wrap { max-width: 820px; margin: 0 auto; padding-top: 4px; }
.set-section {
  background: var(--bg);
  border: 1px solid var(--line-2);
  padding: 14px 18px 16px;
  margin-bottom: 10px;
}
.set-section h3 {
  margin: -14px -18px 4px; padding: 8px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
  color: var(--ink-2);
}
.set-section h3::before { content: "::"; color: var(--acc); }
.set-section h3 .ic { display: none; }
.set-section .sec-sub { color: var(--muted); margin: 10px 0 13px; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .set-grid { grid-template-columns: 1fr; } }
.chan-row {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  margin-bottom: 5px;
  background: var(--bg);
  transition: border-color var(--fast);
}
.chan-row:hover { border-color: var(--muted); }
.chan-row .cr-name { flex: 1; font-size: 0.76rem; font-weight: 500; }
.chan-row .cr-id { font-size: 0.6rem; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line-2); background: var(--bg); }
.seg button {
  border: none; border-right: 1px solid var(--line);
  background: transparent; color: var(--muted);
  font-family: var(--mono); font-weight: 500; font-size: 0.7rem;
  padding: 5px 12px;
  transition: background var(--fast), color var(--fast);
  text-transform: lowercase;
}
.seg button:last-child { border-right: none; }
.seg button:hover { color: var(--ink); background: var(--bg-2); }
.seg button.active { background: var(--acc); color: var(--acc-ink); font-weight: 700; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 0.76rem; cursor: pointer; text-transform: lowercase; }
.check-row input { accent-color: var(--acc); width: 13px; height: 13px; cursor: pointer; }

/* ============ IDEA PANEL ============ */
#panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 440px; max-width: 94vw;
  background: var(--bg);
  border-left: 1px solid var(--ink);
  transform: translateX(103%);
  transition: transform 230ms ease;
  z-index: 50;
  box-shadow: -7px 0 0 rgba(0, 0, 0, 0.25);
}
#panel.open { transform: translateX(0); }
.panel-inner { height: 100%; overflow-y: auto; overflow-x: hidden; padding: 14px 18px 60px; }
.panel-top {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: nowrap;
  margin: -14px -18px 12px; padding: 8px 12px;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-2);
}
.panel-top .spacer { flex: 1; }
.panel-top .icon-btn { flex-shrink: 0; }
.pt-chips {
  display: flex; align-items: center; gap: 7px;
  flex: 1; min-width: 0;
  overflow: hidden;
}
.pt-chips .chip { overflow: hidden; }
.pt-div {
  width: 1px; align-self: stretch;
  background: var(--line-2);
  margin: 1px 3px;
  flex-shrink: 0;
}
.p-name { font-size: 1.15rem; font-weight: 800; margin: 2px 0 7px; line-height: 1.3; }
.p-pitch { color: var(--ink-2); margin: 0 0 12px; }
.p-pitch code { font-family: var(--mono); font-size: 0.78rem; color: var(--acc); background: var(--bg-3); padding: 0 4px; }
.sec-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 7px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}
.sec-label::before { content: "::"; color: var(--acc); }
.sec-label .ic { display: none; }
.sec-label .sl-btn { margin-left: auto; }
.status-select { display: flex; flex-wrap: wrap; border: 1px solid var(--line-2); width: fit-content; }
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.64rem; text-transform: lowercase;
  padding: 4px 10px;
  border: none; border-right: 1px solid var(--line);
  background: transparent; color: var(--muted);
  transition: background var(--fast), color var(--fast);
}
.status-pill:last-child { border-right: none; }
.status-pill .ic { width: 11px; height: 11px; }
.status-pill:hover { color: var(--ink); background: var(--bg-2); }
.status-pill.active { background: var(--pc, var(--acc)); color: var(--bg); font-weight: 700; }
.roadmap-list { display: flex; flex-direction: column; }
.roadmap-step {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 5px 4px;
  border-bottom: 1px dashed var(--line);
  transition: background var(--fast);
  cursor: pointer;
}
.roadmap-step:last-child { border-bottom: none; }
.roadmap-step:hover { background: var(--bg-2); }
.roadmap-step .rs-check {
  flex-shrink: 0; margin-top: 1px;
  width: auto; height: auto;
  border: none;
  color: var(--muted);
  font-size: 0.76rem;
}
.roadmap-step .rs-check .ic { display: none; }
.roadmap-step .rs-check::before { content: "[ ]"; letter-spacing: -1px; }
.roadmap-step.done .rs-check { color: var(--ok); }
.roadmap-step.done .rs-check::before { content: "[x]"; }
.roadmap-step .rs-body { flex: 1; font-size: 0.76rem; color: var(--ink-2); }
.roadmap-step.done .rs-body { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.roadmap-step .rs-mark { display: inline; font-size: 0.62rem; color: var(--acc); margin-right: 6px; }
.roadmap-step .rs-del { opacity: 0; width: 20px; height: 20px; }
.roadmap-step:hover .rs-del { opacity: 1; }
.link-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 4px;
  border-bottom: 1px dashed var(--line);
  font-size: 0.74rem;
}
.link-row:last-child { border-bottom: none; }
.link-row:hover { background: var(--bg-2); }
.link-row .ic { width: 12px; height: 12px; color: var(--muted); flex-shrink: 0; }
.link-row a { flex: 1; color: var(--ink-2); word-break: break-word; line-height: 1.4; text-decoration: none; }
.link-row a:hover { color: var(--acc); text-decoration: underline; }
.link-row .rm { opacity: 0; width: 20px; height: 20px; }
.link-row:hover .rm { opacity: 1; }
.conn-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.7rem;
  background: var(--bg-2); border: 1px solid var(--line-2);
  padding: 2px 8px; margin: 0 5px 5px 0;
  cursor: pointer;
  transition: border-color var(--fast), color var(--fast);
}
.conn-chip:hover { border-color: var(--acc); color: var(--acc); }
.combo { position: relative; }
.combo-list {
  position: absolute; top: calc(100% + 3px); left: 0; right: 0;
  background: var(--bg);
  border: 1px solid var(--ink);
  box-shadow: var(--hard-shadow);
  max-height: 200px; overflow-y: auto;
  z-index: 10;
}
.combo-list button {
  display: block; width: 100%; text-align: left;
  padding: 6px 10px; border: none; border-bottom: 1px dashed var(--line);
  background: transparent;
  color: var(--ink-2); font-size: 0.74rem; font-family: var(--mono);
}
.combo-list button:hover { background: var(--ink); color: var(--bg); }
.panel-meta { font-size: 0.6rem; color: var(--muted); margin-top: 18px; line-height: 1.9; border-top: 1px dashed var(--line); padding-top: 8px; }
.panel-meta::before { content: "// meta"; display: block; color: var(--line-2); }

.think-embed { margin-top: 14px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.think-embed .think-card { padding: 11px 13px; }
.think-embed .q-text { font-size: 0.9rem; }
.think-embed textarea { min-height: 56px; font-size: 0.76rem; }

/* ============ GRAPH overlays ============ */
#view-ideas {
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
}
.graph-search {
  position: absolute; top: 12px; left: 14px;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 11px;
  z-index: 10;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line-2);
  transition: border-color var(--fast);
}
.graph-search:focus-within { border-color: var(--acc); }
.gs-prompt { color: var(--acc); font-weight: 700; }
.graph-search input {
  border: none; outline: none; background: transparent;
  color: var(--ink); font-family: var(--mono); font-size: 0.76rem;
  width: 170px;
}
.graph-toolbar {
  position: absolute; top: 12px; right: 14px;
  display: flex; flex-direction: column;
  z-index: 10;
  background: var(--bg);
  border: 1px solid var(--line-2);
  padding: 0;
}
.g-btn {
  display: grid; place-items: center;
  width: 40px; height: 30px;
  border: none; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--muted);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em;
  transition: background var(--fast), color var(--fast);
}
.g-btn:last-child { border-bottom: none; }
.g-btn:hover { background: var(--bg-2); color: var(--ink); }
.g-btn.on { color: var(--acc-ink); background: var(--acc); }
.graph-legend {
  position: absolute; left: 14px; bottom: 12px;
  padding: 8px 12px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.62rem; color: var(--muted);
  z-index: 10;
  background: var(--bg);
  border: 1px solid var(--line-2);
  text-transform: lowercase;
}
.graph-legend .row { display: flex; align-items: center; gap: 7px; }
.graph-legend .dot { width: 8px; height: 8px; border-radius: 0; }
.graph-tip {
  position: absolute;
  max-width: 260px;
  padding: 9px 11px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--fast);
  z-index: 12;
  background: var(--bg);
  border: 1px solid var(--ink);
  box-shadow: var(--hard-shadow);
}
.graph-tip.show { opacity: 1; }
.graph-tip .gt-name { font-weight: 700; font-size: 0.78rem; margin-bottom: 2px; }
.graph-tip .gt-pitch { color: var(--muted); font-size: 0.7rem; line-height: 1.45; font-family: var(--serif); }
.graph-tip .chip-row { margin-top: 5px; }

/* loaded-vs-total in a group header: "3/12" */
.lib-ghead .lg-n i { font-style: normal; color: var(--acc); }
