/* SyncMAX - P6 Project Performance Dashboard. Site tokens only, so light and dark follow html[data-mode]. */
.pd-section { padding-block: clamp(32px, 5vw, 64px); }
.pd { display: grid; gap: 18px; min-width: 0; --s0: var(--brand); --s1: var(--amber); --s2: var(--crit); }
.pd * { min-width: 0; }
.pd .vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pd .pd-small { font-size: .86rem; color: var(--ink-soft); margin: 0; }
.pd button, .pd select, .pd input { font-family: inherit; }
.pd :is(button, select, input, a, summary, [tabindex]):focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.pd-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px 32px; align-items: start; }
.pd-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pd-about { margin: 0; padding: 14px 16px; border-left: 4px solid var(--amber); background: var(--surface); border-radius: 0 10px 10px 0; font-size: .9rem; color: var(--ink-soft); }
.pd-about b { color: var(--ink); }
.pd a { color: var(--brand); }

.pd-intake { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px 28px; align-items: stretch; }
.pd-drop { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 20px 18px; border: 2px dashed color-mix(in srgb, var(--brand) 45%, var(--line)); border-radius: 12px; background: var(--surface); }
.pd-drop.is-drag { border-color: var(--amber); background: var(--amber-soft); }
.pd-drop svg { width: 30px; height: 30px; color: var(--brand); }
.pd-drop .pd-pick-lbl { margin-top: 6px; position: relative; }
.pd-drop:focus-within .pd-pick-lbl { outline: 3px solid var(--amber); outline-offset: 2px; }
.pd-file { position: absolute; inset: 0; opacity: 0; width: 1px; height: 1px; }
.pd-intake-side { display: grid; gap: 10px; align-content: start; justify-items: start; }
.pd-intake-side .note { margin: 0; }

.pd-status { margin: 0; font-size: .92rem; }
.pd-status:empty { display: none; }
.pd-status.is-error { color: var(--crit); font-weight: 600; }
.pd-status.is-warn { color: color-mix(in srgb, var(--amber) 70%, var(--ink)); }
.pd-status.is-ok { color: var(--good); }

.pd-review { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--paper); display: grid; gap: 10px; }
.pd-review-head { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: end; }
.pd-review-head h3 { font-size: 1.05rem; margin: 0 auto 0 0; }
.pd-review tr.is-replaced td, .pd-review tr.is-skipped td, .pd-review tr.is-error td { color: var(--ink-soft); }
.pd-review tr.is-error b, .pd-review tr.is-skipped b { color: var(--crit); }
.pd-alert { margin: 0; color: var(--crit); font-weight: 600; font-size: .92rem; }
.pd-yes { color: var(--good); font-weight: 700; } .pd-no { color: var(--ink-soft); }

.pd-head { display: grid; gap: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.pd-badge { justify-self: start; margin: 12px 0 0; padding: 3px 10px; border-radius: 99px; background: var(--amber-soft); color: var(--ink); font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.pd.is-sample .pd-badge { background: var(--amber); color: #1A1406; }
.pd-title { margin: 0; font-size: clamp(1.2rem, 2.4vw, 1.6rem); }
.pd-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; font-size: .88rem; color: var(--ink-soft); }
.pd-meta b { color: var(--ink); font-weight: 600; }

.pd-controls { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.pd-controls label, .pd-side label { display: grid; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.pd-custom { display: flex; gap: 12px; }
.pd select, .pd input[type="date"], .pd input[type="search"] { font-size: .95rem; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.pd-modes { border: 0; margin: 0; padding: 0; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.pd-modes legend { font-size: .82rem; font-weight: 600; color: var(--ink-soft); padding: 0; margin-bottom: 4px; }
.pd-modes label { display: inline-flex; gap: 6px; align-items: center; font-size: .92rem; color: var(--ink); font-weight: 500; }
.pd-showing { margin: -6px 0 0; font-size: .9rem; color: var(--ink); font-weight: 600; }

.pd-body { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.pd-side { display: grid; gap: 12px; position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.pd-reset { justify-self: start; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; color: var(--brand); font-weight: 600; cursor: pointer; }
.pd-tree ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pd-tree ul ul { padding-left: 18px; }
.pd-tree li { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; }
.pd-tree li > ul { grid-column: 1 / -1; padding-left: 20px; }
.pd-tw { border: 0; background: none; color: var(--ink-soft); cursor: pointer; padding: 6px 0; font-size: .8rem; }
.pd-node { text-align: left; border: 1px solid transparent; background: none; color: var(--ink); border-radius: 6px; padding: 5px 8px; cursor: pointer; font-size: .88rem; line-height: 1.3; display: flex; justify-content: space-between; gap: 8px; }
.pd-node span { color: var(--ink-soft); font-family: var(--f-mono); font-size: .78rem; }
.pd-node:hover { background: var(--surface); }
.pd-node.is-on { background: var(--amber-soft); border-color: var(--amber); font-weight: 650; }

.pd-main { display: grid; gap: 18px; }
.pd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.pd-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); display: grid; gap: 2px; align-content: start; }
.pd-card.is-wide { grid-column: span 2; }
.pd-card-l { margin: 0; font-size: .76rem; font-weight: 650; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .03em; }
.pd-card-v { margin: 0; font-family: var(--f-display); font-size: 1.35rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.pd-card-s { margin: 0; font-size: .78rem; color: var(--ink-soft); }
.pd-card.is-late { border-left: 4px solid var(--crit); } .pd-card.is-early { border-left: 4px solid var(--good); }
.pd-card.is-na .pd-card-v { font-size: 1rem; color: var(--ink-soft); }

.pd-panel { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--paper); display: grid; gap: 10px; align-content: start; }
.pd-panel h4 { margin: 0; font-size: 1.02rem; }
.pd-panel details summary { cursor: pointer; font-size: .88rem; color: var(--brand); font-weight: 600; }
.pd-panel details[open] summary { margin-bottom: 8px; }
.pd-chart { overflow-x: auto; }
.pd-svg { width: 100%; height: auto; min-width: 520px; display: block; font-family: var(--f-body); }
.pd-grid { stroke: var(--line); stroke-width: 1; }
.pd-ax { fill: var(--ink-soft); font-size: 12px; }
.pd-lbl { fill: var(--ink); font-size: 12.5px; }
.pd-mv { fill: var(--ink); font-size: 12.5px; font-family: var(--f-mono); }
.pd-gap { fill: var(--ink-soft); font-size: 14px; }
.pd-marker { stroke: var(--ink-soft); stroke-dasharray: 3 3; }
.pd-line { fill: none; stroke-width: 2.6; stroke-linejoin: round; }
.pd-line.is-dash { stroke-dasharray: 7 5; stroke-width: 2; }
.pd-line.s0, .pd-bar.s0 { stroke: var(--s0); } .pd-line.s1 { stroke: var(--s1); } .pd-line.s2 { stroke: var(--s2); }
.pd-bar.s0 { fill: var(--s0); stroke: none; } .pd-bar.s1 { fill: var(--s1); } .pd-bar.s2 { fill: var(--s2); }
.pd-pt { stroke: var(--paper); stroke-width: 1.5; cursor: pointer; }
.pd-pt.s0 { fill: var(--s0); } .pd-pt.s1 { fill: var(--s1); } .pd-pt.s2 { fill: var(--s2); }
.pd-pt:hover, .pd-pt:focus, .pd-bar:hover, .pd-bar:focus { stroke: var(--ink); stroke-width: 2; }
.pd-db-line { stroke: var(--ink-soft); stroke-width: 2; }
.pd-db.is-late .pd-db-line { stroke: var(--crit); } .pd-db.is-early .pd-db-line { stroke: var(--good); }
.pd-db-bl { fill: var(--paper); stroke: var(--brand); stroke-width: 2.4; cursor: pointer; }
.pd-db-fc { fill: var(--amber); stroke: color-mix(in srgb, var(--amber) 60%, var(--ink)); stroke-width: 1; cursor: pointer; }
.pd-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .84rem; color: var(--ink-soft); }
.pd-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pd-legend i { width: 18px; height: 3px; border-radius: 2px; background: var(--s0); display: inline-block; }
.pd-legend .s1 i { background: var(--s1); } .pd-legend .s2 i { background: var(--s2); }
.pd-legend .is-dash i { background: repeating-linear-gradient(90deg, currentColor 0 6px, transparent 6px 10px); color: var(--s0); }
.pd-legend .s1.is-dash i { color: var(--s1); }
.pd-legend .bl i { width: 12px; height: 12px; border-radius: 50%; border: 2.4px solid var(--brand); background: var(--paper); }
.pd-legend .fc i { width: 12px; height: 12px; background: var(--amber); transform: rotate(45deg); border-radius: 1px; }
.pd-tip { position: absolute; z-index: 60; max-width: 260px; padding: 7px 10px; border-radius: 8px; background: var(--ink); color: var(--paper); font-size: .8rem; line-height: 1.35; pointer-events: none; box-shadow: var(--shadow); }

.pd-tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; max-height: 460px; }
.pd-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.pd-table th, .pd-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.pd-table th { position: sticky; top: 0; background: var(--surface); font-weight: 650; white-space: nowrap; }
.pd-table td:first-child { font-family: var(--f-mono); font-size: .8rem; }
.pd-table td span { color: var(--ink-soft); font-size: .78rem; }

.pd-notes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.pd-calc-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .88rem; }
.pd-source dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: .86rem; }
.pd-source dt { font-weight: 650; color: var(--ink-soft); }
.pd-source dd { margin: 0; overflow-wrap: anywhere; }
.pd-source .btn-row { margin: 4px 0 0; }

/* highlight used by the walkthrough */
.pd-hl { outline: 3px solid var(--amber) !important; outline-offset: 3px; border-radius: 10px; box-shadow: 0 0 0 9px color-mix(in srgb, var(--amber) 22%, transparent); transition: outline-color .3s, box-shadow .3s; }
.pd-tourbar { position: fixed; z-index: 80; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(760px, calc(100% - 24px)); background: var(--night); color: var(--on-night); border-radius: 14px; padding: 12px 14px 0; box-shadow: 0 20px 40px -18px rgba(0,0,0,.55); display: grid; gap: 8px; overflow: hidden; }
.pd-tourbar[hidden] { display: none; }
.pd-tour-cap { margin: 0; font-size: 1rem; line-height: 1.4; min-height: 2.8em; }
.pd-tourbar.no-cc .pd-tour-cap { visibility: hidden; min-height: 0; height: 0; }
.pd-tour-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: .84rem; padding-bottom: 10px; }
.pd-tour-step { margin-right: auto; color: var(--on-night-soft); }
.pd-tour-ctl button { background: transparent; color: var(--on-night); border: 1px solid rgba(255,255,255,.35); border-radius: 7px; padding: 5px 10px; cursor: pointer; font: inherit; }
.pd-tour-ctl button:hover { background: rgba(255,255,255,.08); }
.pd-tour-ctl button[data-a="play"] { background: var(--amber); border-color: var(--amber); color: #1A1406; font-weight: 700; }
.pd-tour-ctl label { display: inline-flex; gap: 5px; align-items: center; }
.pd-tour-ctl :focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.pd-tour-prog { height: 4px; margin: 0 -14px; background: rgba(255,255,255,.12); }
.pd-tour-prog i { display: block; height: 100%; width: 0; background: var(--amber); transition: width .4s; }

@media (max-width: 980px) {
  .pd-top, .pd-intake, .pd-notes { grid-template-columns: 1fr; }
  .pd-body { grid-template-columns: 1fr; }
  .pd-side { position: static; max-height: none; }
}
@media (max-width: 560px) {
  .pd-card.is-wide { grid-column: auto; }
  .pd-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-card-v { font-size: 1.1rem; }
  .pd-source dl { grid-template-columns: 1fr; }
  .pd-actions .btn { width: 100%; }
  .pd-svg { min-width: 560px; }
}
@media (prefers-reduced-motion: reduce) { .pd-hl, .pd-tour-prog i { transition: none; } }

/* print / save as PDF: dashboard only */
@media print {
  html.pd-printing .site-header, html.pd-printing .site-footer, html.pd-printing .page-hero, html.pd-printing .band, html.pd-printing .to-top,
  html.pd-printing .pd-actions, html.pd-printing .pd-intake, html.pd-printing .pd-review, html.pd-printing .pd-side, html.pd-printing .pd-exports, html.pd-printing .pd-tourbar, html.pd-printing .pd-tip { display: none !important; }
  html.pd-printing .pd-body { grid-template-columns: 1fr; }
  html.pd-printing .pd-panel, html.pd-printing .pd-card { break-inside: avoid; }
  html.pd-printing details > *:not(summary) { display: block; }
  html.pd-printing .pd-tablewrap { max-height: none; overflow: visible; }
  html.pd-printing .pd-svg { min-width: 0; }
}

.pd-videowrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); gap: 32px; align-items: center; }
.pd-videowrap video { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--night); }
@media (max-width: 760px) { .pd-videowrap { grid-template-columns: 1fr; } .pd-videowrap video { max-width: 380px; } }
