/* Project Scheduler: page-specific layer.
   Tokens and shared components come from ../dark.css, ../light.css, ../shared.css.
   The table is styled after the Rent vs Own Sensitivity table and the Cost of
   Living detailed view: bordered cells on the input tint, headings centred,
   units in .th-unit. Here every editable cell is a borderless input that fills
   its cell, as in a spreadsheet. */

.container{max-width:1600px;}
.btn-back{text-decoration:none;display:inline-flex;align-items:center;}
h1{font-size:1.85rem;margin:0 0 4px;}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
.tip-wrap{display:inline-flex;align-items:center;gap:4px;}

/* ── The project: Quick Start, name, start, the note on privacy ── */
.project-card{margin-bottom:18px;}
.quick-start-row{display:flex;align-items:center;gap:10px;padding:10px 16px;border-bottom:1px solid var(--border);flex-wrap:wrap;}
.quick-start-label{display:inline-flex;align-items:center;gap:5px;font-weight:700;font-size:.82rem;color:var(--muted);white-space:nowrap;flex-shrink:0;}
.quick-start-label .tico{width:1.05em;height:1.05em;}
.quick-start-btns{display:flex;gap:6px;flex-wrap:wrap;}
.quick-start-btn{background:var(--input-bg);border:1.5px solid var(--border);border-radius:var(--radius-md);color:var(--muted);padding:5px 11px;font-size:.78rem;font-weight:600;cursor:pointer;font-family:inherit;transition:color var(--motion-fast),background-color var(--motion-fast),border-color var(--motion-fast);}
.quick-start-btn:hover{border-color:var(--accent);color:var(--text);}
.quick-start-btn.active{border-color:var(--accent2);color:var(--text);background:color-mix(in srgb,var(--accent2) 15%,transparent);}
.btn-clear{margin-left:auto;width:auto;padding:0 8px;font-size:.8rem;font-weight:600;}
.project-fields{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,2.2fr);gap:12px 16px;padding:12px 16px 14px;align-items:end;}
.pf-field{display:flex;flex-direction:column;gap:5px;min-width:0;}
.pf-label{font-size:.78rem;font-weight:700;color:var(--muted);display:inline-flex;align-items:center;gap:4px;}
.pf-field .txt-input{width:100%;}
.privacy-note{margin:0;display:flex;align-items:flex-start;gap:7px;color:var(--muted);font-size:.8rem;line-height:1.45;padding:8px 10px;border-radius:var(--radius-md);background:var(--bg-subtle);border:1px solid var(--border);}
.privacy-note .tico{width:15px;height:15px;flex-shrink:0;margin-top:1px;color:var(--accent);}
.privacy-note strong{color:var(--text);}

/* ── The summary ── */
.metrics{grid-template-columns:repeat(6,minmax(0,1fr));}
.metric .value{font-size:1.25rem;}
.metric .sub{margin-top:4px;color:var(--muted);font-size:.74rem;line-height:1.35;}
.metric.is-bad .value{color:var(--negative-em);}
.metric.is-crit .value{color:var(--gold);}
.metric .label .tip-wrap{gap:4px;}

/* ── The workspace ── */
.workspace{margin-bottom:18px;}
/* Sticky over the table while it scrolls, so it is solid: rows never show through. */
.toolbar{position:sticky;top:0;z-index:50;display:flex;align-items:center;flex-wrap:wrap;gap:10px 18px;padding:10px 14px;margin-bottom:12px;background:var(--panel);}
/* Every group keeps its own width (the site's *{min-width:0} would let a
   label shrink under the buttons beside it); the row wraps instead. */
.tb-group{display:flex;align-items:center;gap:8px;flex:0 0 auto;}
.tb-label{flex:0 0 auto;font-size:.78rem;font-weight:700;color:var(--muted);white-space:nowrap;cursor:default;}
.toolbar .seg-group{flex:0 0 auto;}
.toolbar .seg-group .seg-btn{padding:6px 13px;font-size:.8rem;}
.seg-group.ps-seg{display:inline-flex;width:auto;}
.seg-group.ps-seg .seg-btn{flex:0 0 auto;font-family:inherit;}
.tb-files{margin-left:auto;flex-wrap:nowrap;gap:8px;}
/* The schedule's start: a date picker that moves the whole schedule. */
.tb-start .tb-label{cursor:pointer;}
.txt-input.tb-date{width:auto;min-width:142px;padding:6px 10px;font-size:.82rem;font-variant-numeric:tabular-nums;}
.txt-input.tb-date:disabled{opacity:.55;cursor:not-allowed;}
.tb-dpick{display:inline-block;}
.tb-dpick .dshow{left:11px;font-size:.82rem;}
.tb-dpick input:disabled ~ .dshow{opacity:.55;}
.tb-files .btn-theme{padding:7px 12px;font-size:.8rem;display:inline-flex;align-items:center;gap:6px;}
.tb-files .btn-theme .ico{width:15px;height:15px;}
.tb-summary{display:none;font-size:.8rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;}
.tb-summary strong{color:var(--text);font-family:'DM Mono',monospace;font-weight:500;}
.tb-summary .bad{color:var(--negative-em);}
.tb-full{width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;padding:0;border-radius:var(--radius-sm);border:1px solid var(--accent-strong);background:var(--accent-strong);color:var(--text-inv);font-family:inherit;font-size:1.1rem;cursor:pointer;flex-shrink:0;}
.tb-full:hover{background:var(--accent);border-color:var(--accent);}
.tb-full:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
.tb-full .zf-close,.workspace.is-full .tb-full .zf-open{display:none;}
.workspace.is-full .tb-full .zf-close{display:block;}

.view-card{padding:16px 18px 18px;}
.view-card[hidden]{display:none;}
.detail-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 12px;margin-bottom:10px;}
.detail-head h2,.detail-head h3{margin:0;}
.detail-head h3{font-size:1rem;}
.row-tools{display:flex;align-items:center;gap:2px;flex-wrap:wrap;}
.row-tools .btn-sm{margin-right:6px;}
.row-tools .btn-bare{min-width:32px;height:32px;font-size:1.05rem;}
.row-tools .btn-bare .tico,.row-tools .btn-bare .ico{width:17px;height:17px;}
.rt-sep{width:1px;height:20px;background:var(--border);margin:0 6px;}
.h-sub{font-weight:500;color:var(--muted);font-size:.85em;}

/* Full screen: the toolbar and the open view fill the window. */
html.ws-full-open{overflow:hidden;scrollbar-gutter:auto;}
.workspace.is-full{position:fixed;inset:0;z-index:1000;margin:0;display:flex;flex-direction:column;background:var(--bg);
  padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));}
.workspace.is-full .toolbar{position:static;flex:0 0 auto;margin-bottom:10px;}
.workspace.is-full .tb-summary{display:block;flex:1 1 200px;}
.workspace.is-full .view-card{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;}
.workspace.is-full .view-card[hidden]{display:none;}
.workspace.is-full .table-card .sheet-wrap:not(.res-wrap){flex:1 1 auto;max-height:none;min-height:120px;}
.workspace.is-full .table-card{overflow:auto;}
.workspace.is-full .stage-wrap{flex:1 1 auto;min-height:0;}
.workspace.is-full .stage{max-height:none;height:100%;}
.workspace.is-full .hover-box{flex:0 0 auto;}

/* ── The sheet ── */
.sheet-wrap{overflow:auto;max-height:min(72vh,760px);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--panel);}
@supports not selector(::-webkit-scrollbar){.sheet-wrap,.stage{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb) transparent;}}
table.dt{border-collapse:separate;border-spacing:0;font-size:.84rem;font-family:'DM Sans',sans-serif;font-variant-numeric:tabular-nums;}
.sheet .cell[data-f="pred"],.sheet .cell[data-f="succ"]{font-family:'DM Mono',monospace;font-size:.8rem;}
table.sheet{width:max-content;min-width:100%;}
.dt th{padding:9px 10px;background:var(--input-bg);border-right:1px solid var(--border);border-bottom:1px solid var(--border);white-space:normal;text-align:center;vertical-align:middle;font-size:.78rem;font-weight:700;color:var(--text);line-height:1.25;}
.dt td{padding:0;border-right:1px solid var(--border);border-bottom:1px solid var(--border);vertical-align:middle;height:32px;background:var(--panel);}
.dt th:last-child,.dt td:last-child{border-right:none;}
.dt tbody tr:last-child td{border-bottom:none;}
/* The heading row stays in view; it is painted over the panel so rows do not show through. */
.sheet thead th{position:sticky;top:0;z-index:3;background:color-mix(in srgb,var(--text) 4.5%,var(--panel));}
.th-unit{display:block;font-weight:500;color:var(--muted);font-size:.72rem;margin-top:2px;}
/* #, WBS and the name stay put as the sheet scrolls sideways. */
.sheet .c-num{position:sticky;left:0;z-index:2;width:38px;min-width:38px;text-align:center;color:var(--muted);font-family:'DM Mono',monospace;font-size:.74rem;}
.sheet .c-wbs{position:sticky;left:38px;z-index:2;width:58px;min-width:58px;font-family:'DM Mono',monospace;font-size:.78rem;color:var(--muted);padding:0 8px;}
.sheet .c-name{position:sticky;left:96px;z-index:2;min-width:250px;width:270px;box-shadow:inset -1px 0 0 var(--border);}
.sheet thead .c-num,.sheet thead .c-wbs,.sheet thead .c-name{z-index:4;}
.sheet td.c-num,.sheet td.c-wbs,.sheet td.c-name{background:var(--panel);}
.sheet .c-date{min-width:132px;width:136px;}
.sheet .c-dur{min-width:82px;width:86px;}
.sheet .c-ms{min-width:78px;width:80px;text-align:center;}
.sheet .c-link{min-width:128px;width:140px;}
.sheet .c-res{min-width:160px;width:180px;}
.sheet .c-out{min-width:112px;padding:0 10px;font-family:'DM Mono',monospace;font-size:.78rem;white-space:nowrap;color:var(--text);text-align:right;}
.sheet td.c-out{background:var(--bg-subtle);}
.sheet .c-sep{border-left:2px solid var(--border);}
.sheet .c-float{min-width:86px;}
.sheet .c-status{min-width:150px;padding:0 8px;text-align:left;}
.sheet thead .c-status{text-align:center;}

/* A cell's input fills it, as a spreadsheet cell does. */
.cell{display:block;width:100%;height:32px;margin:0;padding:0 9px;border:0;border-radius:0;background:transparent;color:var(--text);font:inherit;font-size:.84rem;outline:none;}
.cell.num{text-align:right;font-family:'DM Mono',monospace;font-size:.8rem;}
.cell.date{font-variant-numeric:tabular-nums;}
/* A date field is the browser's date picker. Without focus its own text is
   hidden and .dshow, laid over it, writes the date as the page does (3 Mar
   2027) or, blank, the schedule's date in italics; with focus the picker's
   own day, month and year show for typing, and a click opens its calendar. */
.dpick{position:relative;display:block;}
.dpick input[type=date]{color:transparent;cursor:pointer;}
.dpick input[type=date]:focus{color:var(--text);cursor:text;}
.dpick input[type=date]::-webkit-calendar-picker-indicator{opacity:0;cursor:pointer;margin-left:2px;}
.dpick:hover input[type=date]::-webkit-calendar-picker-indicator,.dpick input[type=date]:focus::-webkit-calendar-picker-indicator{opacity:.6;}
.dshow{position:absolute;left:9px;right:26px;top:0;bottom:0;display:flex;align-items:center;pointer-events:none;white-space:nowrap;overflow:hidden;font-size:.84rem;color:var(--text);font-variant-numeric:tabular-nums;}
.dshow.ph{color:var(--muted);opacity:.85;font-style:italic;}
.dpick input[type=date]:focus ~ .dshow,.dpick input[type=date]:focus ~ .dl-flag{visibility:hidden;}
body:not(.light) input[type=date]{color-scheme:dark;}
.pf-date .dshow{left:14.5px;font-size:.92rem;font-weight:500;}
.pf-date .dshow.ph{font-weight:400;}
.cell::placeholder{color:var(--muted);opacity:.85;font-style:italic;}
.cell:focus{box-shadow:inset 0 0 0 2px var(--accent);background:var(--panel);}
td.is-err .cell,td.is-err .ro{box-shadow:inset 0 0 0 1.5px var(--negative);background:var(--negative-bg);}
td.is-warn .cell{box-shadow:inset 0 0 0 1.5px color-mix(in srgb,var(--warning-text) 70%,transparent);}
td.is-err .cell:focus,td.is-warn .cell:focus{box-shadow:inset 0 0 0 2px var(--accent);}
.ro{display:block;padding:0 9px;line-height:32px;color:var(--muted);font-size:.82rem;white-space:nowrap;}
.ro.num{text-align:right;font-family:'DM Mono',monospace;font-size:.8rem;}
.c-ms input[type=checkbox]{width:16px;height:16px;accent-color:var(--accent);cursor:pointer;margin:0;vertical-align:middle;}
.c-ms .ro{text-align:center;}
/* A Finish that is a deadline wears a flag; a missed one goes red. */
.date-wrap{position:relative;}
.dl-flag{position:absolute;right:26px;top:50%;transform:translateY(-50%);font-size:.72rem;color:var(--muted);pointer-events:none;}
.date-wrap.has-dl .dshow{right:40px;}
.date-wrap.is-late .dl-flag{color:var(--negative-em);}
.date-wrap.is-late .dshow{color:var(--negative-em);font-weight:600;}

/* The name: indented by its level, a phase folds. */
.name-cell{display:flex;align-items:center;padding-left:calc(var(--lvl,0) * 16px + 4px);}
.name-cell .cell{padding-left:4px;}
.fold{flex:0 0 20px;width:20px;height:22px;padding:0;border:0;background:transparent;color:var(--muted);cursor:pointer;font-size:.8rem;line-height:1;border-radius:4px;transition:transform var(--motion-fast),color var(--motion-fast);}
.fold:hover{color:var(--accent-strong);background:var(--input-bg);}
.fold.is-closed{transform:rotate(-90deg);}
.fold-gap{flex:0 0 20px;}
.sheet tr.is-parent .cell[data-f="name"]{font-weight:700;}
.sheet tr.is-parent td{background:color-mix(in srgb,var(--text) 3%,var(--panel));}
.sheet tr.is-parent td.c-out{background:color-mix(in srgb,var(--text) 5%,var(--bg-subtle));}
.sheet tr.is-sel td.c-num{background:var(--accent-strong);color:var(--text-inv);}
.sheet tr.is-sel td{background:color-mix(in srgb,var(--accent) 7%,var(--panel));}
.sheet tr.is-sel td.c-out{background:color-mix(in srgb,var(--accent) 9%,var(--bg-subtle));}
.sheet tr.is-crit td.c-wbs{box-shadow:inset 3px 0 0 var(--gold);}
.sheet tr.is-crit td.c-float{color:var(--gold);font-weight:600;}
.sheet tr.is-late td.c-float{color:var(--negative-em);}

/* Status chips. */
.chips{display:flex;flex-wrap:wrap;gap:4px;padding:4px 0;}
.chip{display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:999px;font-size:.7rem;font-weight:700;white-space:nowrap;border:1px solid transparent;line-height:1.35;}
.chip.crit{color:var(--gold);border-color:color-mix(in srgb,var(--gold) 45%,transparent);background:color-mix(in srgb,var(--gold) 10%,transparent);}
.chip.late,.chip.over,.chip.err{color:var(--negative-em);border-color:var(--negative-border);background:var(--negative-bg);}
.chip.warn{color:var(--warning-text);background:var(--warning-bg);}
.chip.ok{color:var(--muted);border-color:var(--border);}

.btn-add{display:inline-block;margin-top:10px;background:transparent;border:1px dashed var(--border);border-radius:var(--radius-sm);padding:6px 13px;font-size:.8rem;font-weight:600;color:var(--muted);cursor:pointer;font-family:inherit;white-space:nowrap;transition:color var(--motion-fast),border-color var(--motion-fast);}
.btn-add:hover{border-color:var(--accent-strong);color:var(--accent-strong);}

/* Resources. */
.res-section{margin-top:22px;padding-top:16px;border-top:1px solid var(--border);}
.res-wrap{max-height:none;}
.res-sheet .r-name{min-width:200px;width:220px;}
.res-sheet .r-type{min-width:120px;width:124px;}
.res-sheet .r-cap{min-width:104px;width:110px;}
.res-sheet .r-date{min-width:132px;width:136px;}
.res-sheet .r-out{min-width:110px;padding:0 10px;font-family:'DM Mono',monospace;font-size:.78rem;text-align:right;white-space:nowrap;}
.res-sheet td.r-out{background:var(--bg-subtle);}
.res-sheet .r-status{min-width:220px;padding:0 8px;}
.res-sheet .r-del{width:40px;min-width:40px;text-align:center;}
.res-sheet .r-type select{width:calc(100% - 8px);margin:0 4px;font-size:.8rem;padding-top:4px;padding-bottom:4px;padding-left:8px;--sel-pad:24px;--sel-chev:7px;}

/* A short message about the last edit: a loop that was refused, a name added. */
.sheet-note{margin:0 0 10px;padding:8px 12px;border-radius:var(--radius-sm);font-size:.82rem;line-height:1.45;border:1px solid var(--border);background:var(--bg-subtle);color:var(--text);}
.sheet-note[hidden]{display:none;}
.sheet-note.bad{border-color:var(--negative-border);background:var(--negative-bg);color:var(--negative-em);}

/* A file dragged over the workspace. */
.workspace.is-drop{outline:2px dashed var(--accent);outline-offset:4px;}
.is-busy{opacity:.6;cursor:progress;}

/* Checks: every problem, each one a jump to its cell. */
.checks{margin-top:18px;padding:12px 14px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--bg-subtle);}
.checks h3{margin:0 0 8px;font-size:.95rem;}
.check-list{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:4px;}
.check-list li{font-size:.82rem;line-height:1.45;color:var(--text);display:flex;gap:8px;align-items:baseline;}
.check-list .ck-kind{flex:0 0 auto;font-size:.68rem;font-weight:700;padding:1px 6px;border-radius:999px;}
.check-list .ck-err{color:var(--negative-em);background:var(--negative-bg);}
.check-list .ck-warn{color:var(--warning-text);background:var(--warning-bg);}
.check-list button{border:0;background:none;padding:0;color:var(--accent-strong);font:inherit;font-weight:600;cursor:pointer;text-decoration:underline;text-underline-offset:2px;}

/* What a file brought in, or why it could not. */
.file-report{margin:0 0 12px;padding:12px 14px;border-radius:var(--radius-md);border:1px solid var(--border);background:var(--bg-subtle);font-size:.84rem;line-height:1.5;position:relative;}
.file-report[hidden]{display:none;}
.file-report.bad{border-color:var(--negative-border);background:var(--negative-bg);}
.file-report.warn{border-color:color-mix(in srgb,var(--warning-text) 40%,transparent);background:var(--warning-bg);}
.file-report h3{margin:0 26px 4px 0;font-size:.92rem;}
.file-report ul{margin:6px 0 0;padding-left:18px;max-height:180px;overflow:auto;}
.file-report li{margin:2px 0;}
.file-report .fr-close{position:absolute;right:8px;top:8px;}
.file-report .fr-undo{margin-top:6px;}

/* ── The charts ── */
.chart-opts{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;margin:12px 0 10px;}
.chart-opts .opt{display:inline-flex;align-items:center;gap:7px;}
.chk-opt{cursor:pointer;font-size:.82rem;font-weight:600;color:var(--text);}
.chk-opt input{accent-color:var(--accent);width:15px;height:15px;cursor:pointer;margin:0;}
.legend{display:flex;flex-wrap:wrap;gap:6px 14px;margin-left:auto;font-size:.76rem;color:var(--muted);}
.legend span{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;}
.legend svg{flex-shrink:0;}
.stage-wrap{position:relative;}
.stage{position:relative;overflow:auto;max-height:min(74vh,820px);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--panel);overscroll-behavior:contain;}
.stage svg{display:block;}
.arrow-stage svg,.node-stage svg{margin:0 auto;}
.stage text{user-select:none;-webkit-user-select:none;}
.gantt-stage .g-hit:hover{fill:color-mix(in srgb,var(--accent) 7%,transparent);}
/* A canvas: the background pans; over a task the cursor says what a press
   does there: draw a link, move the bar, stretch its end, or open it. */
.gantt-stage,.arrow-stage,.node-stage{cursor:grab;}
.stage svg,.stage svg *{cursor:inherit;}
.stage.z-link,.stage.is-linking{cursor:crosshair;}
.stage.z-move,.stage.is-moving{cursor:move;}
.stage.z-resize,.stage.is-resizing{cursor:ew-resize;}
.stage.z-pick{cursor:pointer;}
.stage.is-panning{cursor:grabbing;}
.stage.is-panning,.stage.is-linking,.stage.is-moving,.stage.is-resizing{user-select:none;-webkit-user-select:none;}
/* The layer over a chart: what a drag draws and what is picked (never exported). */
.stage svg.ps-ov{position:absolute;left:0;top:0;pointer-events:none;overflow:visible;}
.ps-ov .ov-band{fill:none;stroke:var(--accent);stroke-dasharray:6 4;stroke-linecap:round;}
.ps-ov .ov-dot{fill:var(--accent);}
.ps-ov .ov-handle{fill:var(--panel);stroke:var(--accent);stroke-width:1.6;}
.ps-ov rect.ov-src,.ps-ov rect.ov-tgt,.ps-ov rect.ov-sel,.ps-ov rect.ov-bad{fill:none;stroke-width:2;}
.ps-ov path.ov-src,.ps-ov path.ov-tgt,.ps-ov path.ov-sel,.ps-ov path.ov-bad,.ps-ov path.ov-hov{fill:none;stroke-width:9;stroke-linecap:round;stroke-linejoin:round;opacity:.38;}
.ps-ov .ov-src{stroke:var(--accent);stroke-dasharray:3 2;}
.ps-ov path.ov-src{stroke-dasharray:none;opacity:.25;}
.ps-ov .ov-tgt{stroke:var(--accent);}
.ps-ov .ov-bad{stroke:var(--negative);}
.ps-ov .ov-sel{stroke:var(--accent-strong);}
.ps-ov path.ov-hov{stroke:var(--accent);opacity:.18;}
.ps-ov path.ov-line{stroke-width:5;opacity:.5;}
.ps-ov .ov-lab{font-family:'DM Sans',sans-serif;font-weight:600;fill:var(--text);stroke:var(--panel);paint-order:stroke;stroke-linejoin:round;}
.ps-ov .ov-lab.bad{fill:var(--negative-em);}
.ps-ov .ov-handle.is-on{fill:var(--accent);}
.ps-ov .ov-grip{fill:var(--panel);stroke:var(--accent);stroke-width:1.2;}
.ps-ov .ov-grip.is-on{fill:var(--accent);}
.ps-ov .ov-ghost{fill:color-mix(in srgb,var(--accent) 22%,transparent);stroke:var(--accent);stroke-width:1.5;stroke-dasharray:4 3;}
.ps-ov .ov-guide{stroke:var(--accent);stroke-width:1;stroke-dasharray:3 3;opacity:.7;}
.ps-ov circle.ov-ev{fill:none;stroke-width:3.5;opacity:.55;}
.ps-ov circle.ov-ev.ov-hov{stroke:var(--accent);opacity:.4;}
.ps-ov rect.ov-hov{fill:none;stroke:var(--accent);stroke-width:2;opacity:.35;}
.stage-zoom{position:absolute;right:12px;bottom:12px;display:flex;flex-direction:column;gap:4px;z-index:5;}
.stage-zoom .btn-icon{min-width:32px;padding:4px 0;background:var(--panel);font-size:.95rem;}
.stage-empty{padding:40px 20px;text-align:center;color:var(--muted);font-size:.88rem;}
.hover-box{margin-top:10px;color:var(--muted);font-size:.84rem;min-height:22px;line-height:1.5;}
.hover-box strong{color:var(--text);}
.hover-box .mono{font-family:'DM Mono',monospace;color:var(--text);font-size:.8rem;}
.hover-box .bad{color:var(--negative-em);font-weight:600;}
.hover-box .crit{color:var(--gold);font-weight:600;}
/* A task or link clicked on the chart stays in the box, its links each with × to remove. */
.hover-box.is-pinned{position:relative;padding:8px 36px 8px 12px;border:1px solid color-mix(in srgb,var(--accent) 40%,var(--border));border-radius:var(--radius-md);background:var(--bg-subtle);color:var(--text);}
.hover-box .hv-close{position:absolute;right:6px;top:6px;}
.hv-links{display:flex;flex-wrap:wrap;align-items:center;gap:5px 6px;margin-top:6px;}
.hv-k{font-size:.74rem;font-weight:700;color:var(--muted);margin-left:4px;}
.hv-k:first-child{margin-left:0;}
.hv-none{font-size:.78rem;color:var(--muted);font-style:italic;}
.lk-chip{display:inline-flex;align-items:center;gap:2px;padding:1px 2px 1px 8px;border:1px solid var(--border);border-radius:999px;background:var(--panel);}
.lk-chip .mono{font-size:.76rem;}
.lk-x{border:0;background:none;color:var(--muted);font:inherit;font-size:.95rem;line-height:1;width:20px;height:20px;border-radius:50%;cursor:pointer;padding:0;}
.lk-x:hover,.lk-x:focus-visible{color:var(--negative-em);background:var(--negative-bg);}
.hover-box .hv-ev{font-size:.76rem;color:var(--muted);}
.hv-btn{margin-left:6px;border:1px solid var(--negative-border);background:var(--negative-bg);color:var(--negative-em);font:inherit;font-size:.76rem;font-weight:600;padding:2px 9px;border-radius:999px;cursor:pointer;}

/* A number with its unit written after it, inside the cell (Capacity: /day, total). */
.unit-wrap{position:relative;}
.unit-wrap .cell{padding-right:46px;}
.cell-unit{position:absolute;right:9px;top:0;bottom:0;display:flex;align-items:center;font-size:.74rem;color:var(--muted);pointer-events:none;white-space:nowrap;}

/* The editor over a chart: a task's fields, the same as its table row. */
.ps-pop{position:fixed;z-index:1100;left:8px;top:8px;width:min(430px,calc(100vw - 16px));max-height:calc(100vh - 16px);overflow:auto;padding:10px 14px 12px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--panel);box-shadow:var(--shadow-lg,0 12px 32px rgba(0,0,0,.22));}
.ps-pop[hidden]{display:none;}
.pop-head{display:flex;align-items:center;gap:8px;margin-bottom:6px;min-height:30px;}
.pop-code{font-family:'DM Mono',monospace;font-size:.8rem;color:var(--muted);}
.pop-kind{font-size:.74rem;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;}
.pop-head .pop-x{margin-left:auto;}
.pop-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px 10px;margin-top:8px;}
.pop-f{display:flex;flex-direction:column;gap:3px;min-width:0;}
.pop-wide{margin-top:8px;}
.pop-l{font-size:.74rem;font-weight:700;color:var(--muted);}
.ps-pop .pop-ctl{border:1px solid var(--border);border-radius:var(--radius-sm,6px);background:var(--input-bg);overflow:hidden;}
.ps-pop .pop-ctl:focus-within,.ps-pop input.pop-ctl:focus{border-color:var(--accent);box-shadow:none;}
.ps-pop .pop-ctl .cell:focus,.ps-pop input.pop-ctl:focus{box-shadow:none;background:var(--panel);}
.ps-pop .cell.mono{font-family:'DM Mono',monospace;font-size:.8rem;}
.pop-ms{flex-direction:row;align-items:center;gap:7px;align-self:end;height:34px;font-size:.84rem;font-weight:600;color:var(--text);cursor:pointer;}
.pop-ms input{accent-color:var(--accent);width:15px;height:15px;margin:0;cursor:pointer;}
.pop-sched{margin-top:10px;padding:8px 10px;border-radius:var(--radius-sm,6px);background:var(--bg-subtle);font-size:.8rem;line-height:1.5;color:var(--muted);}
.pop-sched:empty{display:none;}
.pop-sched .mono{font-family:'DM Mono',monospace;color:var(--text);font-size:.76rem;}
.pop-sched .crit{color:var(--gold);font-weight:600;}
.pop-sched .bad,.pop-warn{color:var(--negative-em);}
.pop-warn{margin-top:4px;font-weight:600;}
.pop-foot{display:flex;align-items:center;gap:10px;margin-top:10px;}
.pop-note{font-size:.74rem;color:var(--muted);}
.pop-foot .pop-del{margin-left:auto;padding:0 8px;font-size:.8rem;}
.ps-pop.is-sheet{left:8px;right:8px;top:auto;bottom:8px;width:auto;max-height:72vh;}

/* ── Phones and narrow windows ── */
@media (max-width:1180px){
  .metrics{grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media (max-width:760px){
  h1{font-size:1.45rem;}
  .project-fields{grid-template-columns:1fr 1fr;}
  .privacy-note{grid-column:1/-1;}
  .metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  .metric .value{font-size:1.08rem;}
  /* A grid: the view with full screen beside it, the scale, then the files. */
  .toolbar{position:static;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:8px 10px;}
  .tb-label{display:none;}
  .tb-view{grid-column:1;grid-row:1;}
  .tb-full{grid-column:2;grid-row:1;}
  .tb-scale{grid-column:1/-1;grid-row:2;}
  .tb-start{grid-column:1/-1;grid-row:3;}
  .tb-start .tb-label{display:inline;}
  .tb-start .tb-dpick{flex:1 1 auto;}
  .tb-start .tb-date{width:100%;}
  .tb-files{grid-column:1/-1;grid-row:4;margin-left:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));}
  .tb-files .btn-theme{justify-content:center;padding:7px 6px;}
  .tb-view .seg-group.ps-seg,.tb-scale .seg-group.ps-seg{display:flex;width:100%;}
  .tb-view .seg-group.ps-seg .seg-btn,.tb-scale .seg-group.ps-seg .seg-btn{flex:1 1 0;}
  .workspace.is-full .tb-summary{grid-column:1/-1;grid-row:5;}
  .view-card{padding:12px;}
  .sheet .c-name{min-width:180px;width:190px;}
  .sheet .c-wbs{width:50px;min-width:50px;}
  .sheet .c-name{left:88px;}
  .legend{margin-left:0;}
  .btn-clear{margin-left:0;}
}
@media (max-width:480px){
  .project-fields{grid-template-columns:1fr;}
  .sheet .c-wbs{position:static;}
  .sheet .c-name{left:38px;}
}
