/* Roadmap view (pm-view-roadmap.js). A left column per stream and a week track on the right;
   the whole timeline scrolls sideways inside its own box. --c = the stream's colour,
   --pmv-rm-wk = weeks on the axis, --pmv-rm-vw = the scroller's visible width (set in JS). */

.pmv-rm-wrap { --pmv-rm-bg: #131418; }
.pmv-rm-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md, 14px); background: var(--pmv-rm-bg); }
.pmv-rm-inner { width: max(100%, calc(260px + var(--pmv-rm-wk) * 48px)); }
.pmv-rm-line { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.pmv-rm-row { border-top: 1px solid var(--line); }

/* Left column: sticky so it stays put while the track scrolls. */
.pmv-rm-left { position: sticky; left: 0; z-index: 3; box-sizing: border-box; background: var(--pmv-rm-bg); border-right: 1px solid var(--line); }
.pmv-rm-headlabel { display: flex; align-items: flex-end; padding: 12px 18px; color: var(--muted); font-size: var(--fs-cap, 11px); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.pmv-rm-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; width: 100%; padding: 16px 18px; border-top: 0; border-bottom: 0; border-left: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
@media (hover: hover) { .pmv-rm-meta:hover { background: #1a1c21; } }
.pmv-rm-meta[aria-expanded="true"] { background: #17191d; }
.pmv-rm-meta:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pmv-rm-name { color: var(--c); font-size: var(--fs-item, 16px); line-height: 22px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pmv-rm-goal { color: var(--muted); font-size: 13px; line-height: 18px; overflow-wrap: anywhere; }
.pmv-rm-pips { display: flex; align-items: center; gap: 4px; }
.pmv-rm-pips b { width: 20px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .12); }
.pmv-rm-pips b.on { background: var(--c); }
.pmv-rm-pips span { margin-left: 6px; color: var(--muted); font-size: var(--fs-cap, 11px); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.pmv-rm-flag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.pmv-rm-flag.cool { border-color: var(--line); color: var(--muted); }
.pmv-rm-flag.ok { border-color: rgba(52, 211, 153, .6); color: var(--accent); }

/* Axis and tracks share week lines drawn as a repeating background. */
.pmv-rm-axis, .pmv-rm-track { position: relative; background: linear-gradient(to right, rgba(255, 255, 255, .05) 1px, transparent 1px) 0 0 / calc(100% / var(--pmv-rm-wk)) 100%; }
.pmv-rm-axis { height: 60px; overflow: hidden; }
.pmv-rm-month { position: absolute; top: 6px; height: 54px; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, .18); color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pmv-rm-wk { position: absolute; bottom: 4px; padding-left: 6px; color: var(--muted); font-size: var(--fs-cap, 11px); font-variant-numeric: tabular-nums; }
.pmv-rm-track { min-height: 108px; overflow: hidden; }
.pmv-rm-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 2; pointer-events: none; }
.pmv-rm-today span { position: absolute; top: 24px; left: 4px; padding: 0 4px; background: var(--pmv-rm-bg); color: var(--accent); font-size: var(--fs-cap, 11px); line-height: 12px; font-weight: 700; letter-spacing: .1em; }

.pmv-rm-bar { position: absolute; z-index: 3; top: 50%; height: 22px; min-width: 6px; transform: translateY(-50%); border-radius: var(--r-chip, 8px); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 78%, transparent)); }
.pmv-rm-bar.draft { background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px dashed rgba(255, 255, 255, .38); box-sizing: border-box; }
.pmv-rm-bar span { position: absolute; top: 50%; left: 8px; transform: translateY(-50%); color: #fff; font-size: var(--fs-cap, 11px); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.pmv-rm-prep { position: absolute; z-index: 3; top: 12px; height: 20px; padding-left: 5px; padding-right: 6px; background: var(--pmv-rm-bg); border-left: 2px solid var(--sky); color: var(--sky); font-size: 11px; font-weight: 600; white-space: nowrap; }
.pmv-rm-diamond { position: absolute; top: 50%; z-index: 1; width: 14px; height: 14px; box-sizing: border-box; transform: translate(-50%, -50%) rotate(45deg); border: 2px solid #fff; background: var(--c); }
.pmv-rm-diamond.draft { border: 2px dashed var(--c); background: var(--pmv-rm-bg); }
.pmv-rm-tlabel { position: absolute; top: 50%; transform: translate(14px, -50%); color: var(--text); font-size: var(--fs-cap, 11px); font-weight: 600; white-space: nowrap; }
.pmv-rm-lps { position: absolute; z-index: 3; bottom: 10px; display: flex; gap: 4px; }
.pmv-rm-lp { padding: 2px 6px; border: 1px solid var(--line); border-radius: var(--r-chip, 8px); background: var(--pmv-rm-bg); color: var(--muted); font-size: var(--fs-cap, 11px); white-space: nowrap; }
.pmv-rm-lp.s1 { border-color: var(--sky); color: var(--sky); }
.pmv-rm-lp.s2 { border-color: var(--danger); color: var(--danger); }
.pmv-rm-lp.s3 { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }

/* Inline editor: sticky at the left edge, as wide as the visible box. */
.pmv-rm-edit { position: sticky; left: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; width: var(--pmv-rm-vw, 100%); box-sizing: border-box; padding: 20px 22px; border-top: 1px solid var(--line); background: #17191d; box-shadow: inset 3px 0 0 var(--c); }
.pmv-rm-f { gap: 6px; min-width: 0; }
.pmv-rm-f label, .pmv-rm-flabel { color: var(--muted); font-size: var(--label-fs, 13px); font-weight: 500; line-height: 18px; }
.pmv-rm-edit input { height: var(--field-h, 44px); }
.pmv-rm-edit select { width: 100%; height: var(--field-h, 44px); }
.pmv-rm-edit textarea { min-height: 84px; resize: none; }
.pmv-rm-wide { grid-column: span 2; }
.pmv-rm-full { grid-column: 1 / -1; }

.pmv-rm-swatches { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.pmv-rm-swatch { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 999px; background: var(--sw); cursor: pointer; }
.pmv-rm-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px #17191d, 0 0 0 4px var(--text); }
.pmv-rm-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.pmv-rm-swatch:disabled { cursor: default; opacity: .6; }

.pmv-rm-lpbox { display: flex; flex-direction: column; gap: 8px; }
.pmv-rm-lphead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pmv-rm-lplist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 180px)); gap: 8px; }
.pmv-rm-lp-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm, 10px); }
.pmv-rm-lp-top { display: flex; align-items: center; justify-content: space-between; }
.pmv-rm-lp-top b { color: var(--muted); font-size: var(--fs-cap, 11px); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.pmv-rm-x { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); font: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.pmv-rm-x:focus-visible { color: var(--danger); background: rgba(240, 138, 138, .1); }
@media (hover: hover) { .pmv-rm-x:hover { color: var(--danger); background: rgba(240, 138, 138, .1); } }
.pmv-rm-none { color: var(--muted); font-size: 13px; }

.pmv-rm-draft { grid-column: 1 / -1; color: var(--amber); font-size: 13px; }
.pmv-rm-acts { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.pmv-rm-acts .btn { height: var(--btn-h-sm, 36px); }
.pmv-rm-finish { border-color: var(--accent); background: transparent; color: var(--accent); }
@media (hover: hover) { .pmv-rm-finish:hover { background: var(--accent); color: var(--on-accent); } }

/* Phone: the left block stacks above its track; the track still scrolls inside the box. */
@media (max-width: 700px) {
  .pmv-rm-wrap { padding: 16px; }
  .main.pm-view .pmv-rm-wrap > .pm-lanes-head > .pm-label { display: none; }
  /* a little room so the first week number is not clipped; sticky blocks shrink to match */
  .pmv-rm-scroll { padding-left: 8px; }
  .pmv-rm-edit { width: calc(var(--pmv-rm-vw, 100%) - 8px); }
  .pmv-rm-inner { width: max(100%, calc(var(--pmv-rm-wk) * 40px)); }
  .pmv-rm-line { grid-template-columns: minmax(0, 1fr); }
  .pmv-rm-headlabel { display: none; }
  .pmv-rm-left { width: calc(var(--pmv-rm-vw, calc(100vw - 58px)) - 8px); border-right: 0; }
  .pmv-rm-meta { padding: 14px 16px 10px; }
  .pmv-rm-edit { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px 16px 16px 19px; }
  .pmv-rm-wide { grid-column: 1 / -1; }
  .pmv-rm-lplist { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
