/* Phase 6: venture pages (/projects/map/<branch id>) and the KPI pieces on the Map, in the
   project popup and on the venture page. Loaded after final.css; light theme via the tokens. */

/* ---- Map: a branch name opens its page; the arrow is the keyboard way there ---- */
.pmv-map-link { cursor: pointer; text-decoration: underline transparent; text-underline-offset: 3px; transition: text-decoration-color .15s; }
@media (hover: hover) { .pmv-map-link:hover { text-decoration-color: var(--accent); } }
.pmv-map-open { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); transition: opacity .15s, border-color .15s, color .15s; }
.pmv-map-open svg { width: 14px; height: 14px; }
@media (hover: hover) {
  .pmv-map-open { opacity: 0; }
  .pmv-map-row:hover .pmv-map-open { opacity: 1; }
  .pmv-map-open:hover { border-color: var(--accent); color: var(--accent); }
}
.pmv-map-open:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: none) { .pmv-map-open { width: 32px; height: 32px; opacity: .9; } }

/* ---- the sparkline: one accent line, a dot on the latest point, no axes ---- */
.pm-kpi-spark { display: block; width: 100%; height: 56px; overflow: visible; }
.pm-kpi-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pm-kpi-dot { fill: var(--accent); }
.pm-kpi-base { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }

/* a value box: looks like text until hovered; a line under it when typing */
.pm-kpi-in { width: 100%; height: 40px; padding: 0 2px; border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: none; color: var(--text); font: inherit; font-size: var(--fs-body, 14px); transition: border-color .15s; }
.pm-kpi-in::placeholder { color: var(--muted); }
.pm-kpi-in:hover:not(:disabled), .pm-kpi-in:focus { border-bottom-color: var(--accent); outline: none; }

/* ---- the project popup's KPI block ---- */
.pm-kpi-box { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.pm-kpi-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.pm-kpi-hint { color: var(--muted); font-size: var(--fs-meta, 12px); }
.pm-kpi-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.pm-kpi-read { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; align-items: center; }
.pm-kpi-big { display: flex; flex-direction: column; gap: 2px; }
.pm-kpi-big b { font-family: var(--display, inherit); font-size: 32px; font-weight: 600; line-height: 1; letter-spacing: -.03em; }
.pm-kpi-big span { color: var(--muted); font-size: var(--fs-meta, 13px); }
.pm-kpi-read .pm-kpi-spark { height: 48px; }
.pm-kpi-read .pm-kpi-in, .pm-kpi-n { grid-column: 1 / -1; }
.pm-kpi-n { color: var(--muted); font-size: var(--fs-meta, 12px); }
@media (max-width: 700px) {
  .pm-kpi-fields, .pm-kpi-read { grid-template-columns: minmax(0, 1fr); }
}

/* ---- venture page ---- */
.pmv-vt-back { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin: -8px 0 16px; color: var(--muted); font-size: var(--fs-meta, 13px); font-weight: 600; text-decoration: none; }
.pmv-vt-back svg { width: 16px; height: 16px; transform: scaleX(-1); }
.pmv-vt-back:hover, .pmv-vt-back:focus-visible { color: var(--text); outline: none; }
.pmv-vt-note { margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: var(--fs-body, 14px); }

/* health: a dot in its colour, the level, the reasons */
.pmv-vt-health { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 20px; color: var(--muted); font-size: var(--fs-body, 14px); line-height: 22px; }
.pmv-vt-health b { color: var(--text); }
.pmv-vt-dot { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--sc, var(--muted)); }
.pmv-vt-health.green { --sc: var(--accent); }
.pmv-vt-health.amber { --sc: var(--amber); }
.pmv-vt-health.red { --sc: var(--danger); }

/* two columns on wide screens: the numbers and the work, then the rest beside them */
.pmv-vt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1100px) { .pmv-vt-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.pmv-vt-main, .pmv-vt-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.pmv-vt-box { padding: 20px 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--glass); box-shadow: var(--elevation); }
.pmv-vt-box-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.pmv-vt-box-head h2 { margin: 0; font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.01em; }
.pmv-vt-box-head .pm-label { font-weight: 400; }
.pmv-vt-box .pm-empty { margin: 0; padding: 20px 16px; border-radius: 14px; font-size: var(--fs-body, 14px); }

/* the KPI cards: one per project, the line full width under the number */
.pmv-vt-kpi-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.pmv-vt-kpi { display: flex; max-width: 440px; flex-direction: column; gap: 6px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: inset 3px 0 0 var(--c); }
.pmv-vt-kpi-name { display: inline-flex; align-items: center; gap: 8px; min-height: 24px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: var(--fs-body, 14px); font-weight: 600; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.pmv-vt-kpi-name:hover, .pmv-vt-kpi-name:focus-visible { color: var(--accent); outline: none; }
.pmv-vt-sw { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.pmv-vt-kpi-label { color: var(--muted); font-size: var(--fs-cap, 11px); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.pmv-vt-kpi-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.pmv-vt-kpi-big b { font-family: var(--display, inherit); font-size: 40px; font-weight: 600; line-height: 1; letter-spacing: -.04em; }
.pmv-vt-kpi-big span { color: var(--muted); font-size: var(--fs-meta, 13px); }
.pmv-vt-kpi .pm-kpi-spark { margin-top: 4px; }

/* open work by stage: the cards as on the board, read-only, tap to open */
.pmv-vt-lane + .pmv-vt-lane { margin-top: 18px; }
.pmv-vt-lane h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--muted); font-size: var(--fs-cap, 11px); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.pmv-vt-lane h3 b { color: var(--text); font-size: 12px; }
.pmv-vt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pmv-vt-cards .pm-card { margin: 0; }

/* milestone, people, waiting, activity */
.pmv-vt-ms { display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: var(--fs-body, 14px); line-height: 22px; }
.pmv-vt-ms small { color: var(--muted); font-size: var(--fs-meta, 13px); }
.pmv-vt-people { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.pmv-vt-names { color: var(--muted); font-size: var(--fs-meta, 13px); line-height: 20px; }
.pmv-vt-list, .pmv-vt-activity { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.pmv-vt-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.pmv-vt-list li:first-child { border-top: 0; padding-top: 0; }
.pmv-vt-list small { color: var(--muted); font-size: var(--fs-meta, 13px); }
.pmv-vt-row, .pmv-vt-task { padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.pmv-vt-row { min-height: 24px; font-weight: 600; }
.pmv-vt-row:hover, .pmv-vt-row:focus-visible, .pmv-vt-task:hover, .pmv-vt-task:focus-visible { color: var(--accent); outline: none; }
.pmv-vt-activity li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--fs-meta, 13px); line-height: 20px; }
.pmv-vt-activity li:first-child { border-top: 0; padding-top: 0; }
.pmv-vt-activity li.muted, .pmv-vt-activity li.error { display: block; }
.pmv-vt-activity p { margin: 0; overflow-wrap: anywhere; }
.pmv-vt-activity time { color: var(--muted); white-space: nowrap; }
.pmv-vt-task { color: var(--muted); }
.pmv-vt-box .muted { margin: 0; }

/* ---- phone (≤760px): one column, the line full width, 40px tap targets ---- */
@media (max-width: 760px) {
  .pmv-vt-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .pmv-vt-main, .pmv-vt-side { gap: 14px; }
  .pmv-vt-box { padding: 16px; border-radius: 16px; }
  .pmv-vt-kpi-list, .pmv-vt-cards { grid-template-columns: minmax(0, 1fr); }
  .pmv-vt-kpi { max-width: none; padding: 14px; }
  .pmv-vt-kpi .pm-kpi-spark { height: 64px; }
  .pmv-vt-kpi-name, .pmv-vt-row { min-height: 40px; }
  .pmv-vt-kpi-big b { font-size: 36px; }
  .pmv-vt-cards .pm-card { padding: 14px 14px 14px 18px; border-radius: 16px; }
  .pmv-vt-back { margin-top: 0; }
  .pmv-vt-activity time { grid-column: 2; grid-row: 2; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .pmv-vt-grid { grid-template-columns: minmax(0, 1fr); }
}
