/* Planning layer: scoring, journeys, priorities, sprint plan, voting, decisions, present mode, report. Uses tokens from app.css. */

.migrate-note { background: var(--mid-soft); border-radius: 8px; padding: 10px 14px; font-size: 13.5px; }
.migrate-note code { background: var(--surface); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

.btn.danger { color: var(--bad); border-color: var(--bad-soft); }
.btn.danger:hover { border-color: var(--bad); }
.btn:disabled { opacity: 0.5; cursor: default; }
#voteBtn.live { background: var(--red); border-color: var(--red); color: #FFFFFF; }
.linkish { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--taupe); text-underline-offset: 3px; font: inherit; text-align: left; }
.linkish:hover { text-decoration-color: var(--red); }
.linkish.strong { font-weight: 600; }
.pr-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }

/* Badges on map leaves and board cards */
.nebadge { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; background: var(--mid-soft); color: var(--mid); font-size: 11px; font-weight: 700; flex: none; }
.vbadge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #FFFFFF; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.vbadge.mine { background: var(--ink); color: var(--bg); }

/* Show filters and journey */
.jsel { border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 4px 10px; font-size: 13px; max-width: 100%; }
.journey-bar { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
.jb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.jb-head b { font-size: 15px; }
.jb-verdict { color: var(--muted); font-size: 13px; flex: 1 1 240px; }
.jb-layers { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.jb-layer { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; }
.jb-dias { display: inline-flex; gap: 6px; align-items: center; }

/* Route panel: scores, confidence, journey */
.d-slot { display: grid; gap: 18px; }
.d-slot:empty { display: none; }
details.plan-sec > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
details.plan-sec > summary::-webkit-details-marker { display: none; }
details.plan-sec > summary .flabel::before { content: "▸"; display: inline-block; margin-right: 6px; transition: transform .15s; }
details.plan-sec[open] > summary .flabel::before { transform: rotate(90deg); }
details.plan-sec[open] > summary { margin-bottom: 8px; }
.score-result { font-size: 12.5px; color: var(--muted); }
.score-result b { color: var(--ink); font-variant-numeric: tabular-nums; }
.scores { display: grid; gap: 8px; }
.score-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.score-lbl { display: grid; min-width: 0; }
.score-lbl span { font-weight: 600; font-size: 13.5px; }
.score-lbl small { color: var(--muted); font-size: 11.5px; font-weight: 400; line-height: 1.35; }
.score-btns { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.score-btns button { width: 36px; height: 34px; border: 0; border-right: 1px solid var(--line); background: transparent; font-weight: 600; font-variant-numeric: tabular-nums; }
.score-btns button:last-child { border-right: 0; }
.score-btns button:hover:not(:disabled) { background: var(--sunk); }
.score-btns button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.score-sep { border-top: 1px dashed var(--line); margin: 2px 0; }
details.plan-sec .hint { margin-top: 8px; }
.qchip { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.q-quick { background: var(--good-soft); color: var(--good); }
.q-bet { background: #FCE9EB; color: #B42A3B; }
.q-fill { background: var(--sunk); color: var(--muted); }
.q-drop { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.seg-conf { margin-bottom: 6px; }
.toggle-ne[aria-pressed="true"] { border-color: var(--mid); background: var(--mid-soft); }
.jr-layer { display: grid; gap: 4px; }
.jr-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.jr-list { list-style: none; margin: 0 0 6px; padding: 0 0 0 17px; display: grid; gap: 3px; }
.jr-list li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.jr-list .ev-del { margin-left: auto; }
.jr-add { display: flex; flex-wrap: wrap; gap: 6px; }
.jr-add select, #playAdd, #pAddRoute { border: 1px solid var(--line); border-radius: 6px; background: var(--bg); padding: 8px 10px; font-size: 13.5px; min-width: 0; flex: 1 1 200px; max-width: 100%; }
#pAddRoute { width: 100%; margin-top: 6px; }

/* Play panel */
.title-input { width: 100%; font-family: var(--font-display); font-size: 28px; line-height: 1.15; border: 1px solid transparent; border-radius: 6px; background: transparent; padding: 2px 6px; margin-left: -6px; }
.title-input:hover, .title-input:focus { border-color: var(--line); background: var(--bg); }
.field.two { grid-template-columns: 1fr 1fr; gap: 10px; }
.field.two > div { display: grid; gap: 6px; min-width: 0; }
.field.two label { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.field.two input, .field.two select, .lk-add select { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); padding: 8px 10px; font-size: 13.5px; font-weight: 400; }

/* Tab layout */
.tab-intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; margin-bottom: 16px; }
.tab-intro > div { min-width: 0; }
.tab-h { font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.1; margin: 0 0 4px; }
.card-plain { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; display: grid; gap: 10px; min-width: 0; align-content: start; }
.h3 { margin: 0; font-size: 16px; font-weight: 600; }
#panel-priorities, #panel-log { display: grid; gap: 16px; }
#panel-priorities[hidden], #panel-log[hidden], #panel-sprint[hidden] { display: none; }
.prio-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }

/* Matrix */
.mx-wrap { overflow-x: auto; }
.matrix { width: 100%; min-width: 520px; height: auto; display: block; }
.mx-grid { stroke: var(--line); stroke-width: 1; }
.mx-mid { stroke: var(--taupe); stroke-width: 1.5; stroke-dasharray: 5 5; }
.mx-q { fill: var(--good-soft); opacity: 0.55; }
.mx-tick { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.mx-axis { fill: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; }
.mx-qlbl { fill: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.mx-qlbl-strong { fill: var(--good); }
.mx-lbl { fill: var(--ink); font-size: 11.5px; font-weight: 500; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.mx-star { fill: var(--red); font-size: 11px; }
.mx-pt { cursor: pointer; }
.mx-pt:hover circle, .mx-pt:focus circle { stroke-width: 5 !important; }
.mx-pt:focus { outline: none; }
.mx-pt:focus-visible circle { stroke: var(--ink) !important; }
.mx-key { font-size: 12px; }
.ring { width: 11px; height: 11px; border-radius: 50%; border: 3px solid; display: inline-block; }

/* Weights */
.weights { display: grid; gap: 10px; }
.wrow { display: grid; grid-template-columns: 120px minmax(0, 1fr) 36px; gap: 10px; align-items: center; font-size: 13.5px; font-weight: 600; }
.wrow input { width: 100%; accent-color: var(--red); }
.wrow output { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; text-align: right; }

/* Ranked table */
.table-wrap { overflow-x: auto; }
.rank { width: 100%; border-collapse: collapse; font-size: 13px; }
.rank th { text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rank td { padding: 8px 10px; border-bottom: 1px solid var(--sunk); vertical-align: middle; }
.rank .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank tbody tr:hover { background: var(--bg); }
.obar { display: inline-block; width: 44px; height: 5px; background: var(--sunk); border-radius: 3px; margin-right: 8px; vertical-align: middle; overflow: hidden; }
.obar i { display: block; height: 100%; background: var(--bronze); }
.rank small { color: var(--muted); margin-left: 2px; }
.unscored summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips-wrap .chip { display: inline-flex; align-items: center; gap: 4px; }

/* Sprint board */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kcol { background: var(--sunk); border-radius: 10px; padding: 10px; display: grid; gap: 8px; align-content: start; min-height: 220px; border: 2px solid transparent; transition: border-color .15s; }
.kcol.over { border-color: var(--red); }
.kcol-h { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; padding: 2px 4px; }
.kcol-body { display: grid; gap: 8px; }
.kcol-empty { padding: 10px 4px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 6px; cursor: grab; }
.pcard.dragging { opacity: 0.4; }
.pcard:hover { border-color: var(--ink); }
.pcard .lane { justify-self: start; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bronze); background: var(--mid-soft); border-radius: 999px; padding: 1px 8px; }
.pcard-name { border: 0; background: none; padding: 0; text-align: left; font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.pcard-name:hover { text-decoration: underline; text-decoration-color: var(--red); }
.pcard-meta { font-size: 12px; color: var(--ink); display: grid; overflow-wrap: anywhere; font-weight: 400; }
.pcard-meta span { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pcard-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pcard-routes { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--muted); }
.pcard-routes span { margin-left: 4px; }
.pcard-routes .ldot { width: 7px; height: 7px; }
.outcome { font-size: 10.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.o-scale { background: var(--good-soft); color: var(--good); }
.o-iterate { background: var(--mid-soft); color: var(--mid); }
.o-kill { background: var(--bad-soft); color: var(--bad); }
.pcard-move { display: flex; gap: 4px; justify-content: flex-end; }
.pcard-move button { border: 1px solid var(--line); background: transparent; border-radius: 6px; width: 30px; height: 26px; font-size: 13px; }
.pcard-move button:hover:not(:disabled) { border-color: var(--ink); }
.pcard-move button:disabled { opacity: 0.3; }

/* Voting bar */
.vote-bar { background: var(--surface); border: 1.5px solid var(--red); border-radius: 10px; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; }
.vb-main { display: grid; gap: 8px; flex: 1 1 360px; min-width: 0; }
.vb-status { font-size: 13.5px; }
.vb-status span { color: var(--muted); }
.vb-name { display: flex; gap: 6px; flex-wrap: wrap; }
.vb-name input { border: 1px solid var(--line); border-radius: 6px; background: var(--bg); padding: 7px 10px; font-size: 13.5px; flex: 1 1 220px; min-width: 0; }
.vb-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vb-per { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.vb-per select { border: 1px solid var(--line); border-radius: 6px; background: var(--bg); padding: 5px 8px; }

/* Decisions and changes */
.log-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dec-add { display: grid; gap: 8px; }
.dec-add textarea { min-height: 70px; }
.dec-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dec-row select { flex: 1 1 200px; min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); padding: 8px 10px; font-size: 13.5px; }
.decisions { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.decisions li::marker { color: var(--taupe); font-variant-numeric: tabular-nums; }
.dec-text { font-size: 14px; white-space: pre-line; }
.dec-del { margin-left: auto; }
.ch-ctrl { display: flex; gap: 6px; }
.ch-ctrl select { border: 1px solid var(--line); border-radius: 999px; background: var(--bg); padding: 5px 10px; font-size: 13px; }
.changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.changes > li { border-bottom: 1px solid var(--sunk); padding-bottom: 10px; display: grid; gap: 4px; }
.ch-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: baseline; }
.ch-lines { margin: 0; padding-left: 34px; font-size: 13px; color: var(--ink); font-weight: 400; display: grid; gap: 1px; }

/* Present mode */
.present-bar { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; background: var(--ink); color: var(--bg); border-radius: 999px; padding: 4px; box-shadow: 0 4px 18px rgba(41,41,41,.25); z-index: 3; max-width: calc(100% - 24px); }
.present-bar button { border: 0; background: transparent; color: inherit; min-width: 40px; height: 40px; border-radius: 999px; font-weight: 600; padding: 0 12px; }
.present-bar button:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.present-bar button:disabled { opacity: 0.35; }
.present-bar span { padding: 0 12px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.presenting .zoombar, body.presenting .maphint { display: none; }
body.presenting .stage { transition: transform .55s cubic-bezier(.3,.7,.2,1); }

/* Report */
.report { position: fixed; inset: 0; z-index: 40; background: var(--sunk); overflow-y: auto; padding-top: env(safe-area-inset-top, 0px); }
.rp-bar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px; background: var(--ink); color: var(--bg); z-index: 1; flex-wrap: wrap; }
.rp-bar .btn { background: var(--surface); color: var(--ink); }
.rp-bar .btn.primary { background: var(--red); border-color: var(--red); color: #FFFFFF; }
.rp { max-width: 900px; margin: 24px auto 60px; background: #FFFFFF; padding: 48px 56px; border-radius: 4px; box-shadow: 0 2px 20px rgba(41,41,41,.08); display: grid; gap: 28px; }
.rp-head { border-bottom: 3px solid var(--red); padding-bottom: 18px; }
.rp-head h1 { font-family: var(--font-display); font-weight: 400; font-size: 44px; line-height: 1.05; margin: 6px 0; }
.rp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rp-stats div { background: var(--bg); border-radius: 6px; padding: 12px 14px; display: grid; }
.rp-stats b { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rp-stats span { font-size: 12px; color: var(--muted); }
.rp-sec { display: grid; gap: 10px; }
.rp-sec h2 { font-family: var(--font-display); font-weight: 400; font-size: 24px; margin: 0; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.rp-sec h3 { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bronze); margin: 8px 0 0; }
.rp-sec p, .rp-sec li { font-size: 13.5px; margin: 0; }
.rp-sec .matrix { min-width: 0; }
.rp-play { border-left: 3px solid var(--taupe); padding: 4px 0 4px 12px; display: grid; gap: 4px; }
.rp-play-h { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.rp-play-h span { font-size: 11px; font-weight: 600; color: var(--bronze); text-transform: uppercase; letter-spacing: 0.06em; }
.rp-meta { color: var(--muted); font-size: 12.5px; }
.rp-dec { padding-left: 20px; display: grid; gap: 6px; }
.rp-note { color: var(--muted); }

@media (max-width: 960px) {
  .prio-grid, .log-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .score-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .field.two { grid-template-columns: minmax(0, 1fr); }
  .rp { padding: 24px 20px; margin: 12px; }
  .rp-stats { grid-template-columns: repeat(2, 1fr); }
  .wrow { grid-template-columns: 96px minmax(0, 1fr) 36px; }
}

@media print {
  @page { size: A4; margin: 14mm; }
  body.reporting > *:not(#report) { display: none !important; }
  body.reporting { background: #FFFFFF; }
  .report { position: static; overflow: visible; background: #FFFFFF; padding: 0; }
  .rp-bar { display: none; }
  .rp { box-shadow: none; margin: 0; padding: 0; max-width: none; gap: 20px; }
  .rp-sec { break-inside: auto; }
  .rp-break-avoid, .rp-play, .rp-stats, tr { break-inside: avoid; }
  .rp-sec h2 { break-after: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
