/* Process Management — what is its own: the value stream map, the step table, the process library, guided mode,
   and the owner's and manager's views. Loaded after styles.css and before ui.css (the shared compact layer). */
:root { --tri: #A9C7C9; --tri-fg: #13343B; --burst: #1E4B55; --good: #2F6B4F; --good-pale: #D9EBDD; }
.pm-kpis { grid-template-columns: repeat(4, 1fr); }
.pm-kpis div { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; }
.pm-kpis b { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pm-kpis small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pm-kpis small.better { color: var(--good); } .pm-kpis small.worse { color: var(--danger); }
.pill { display: inline-block; font-size: 11.5px; padding: 1px 7px; font-weight: 700; }
.pill.ok { background: var(--good-pale); color: var(--good); } .pill.bad { background: var(--danger-pale); color: var(--danger); } .pill.warn { background: var(--amber-pale); color: #5A3E10; } .pill.plain { background: var(--surface-2); color: var(--ink-2); }
.state-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 0 0 12px; }
.state-tabs .seg { all: unset; cursor: pointer; padding: 6px 12px; font-size: 13px; font-weight: 600; border: 1px solid var(--line-strong); background: var(--surface); }
.state-tabs .seg[aria-pressed="true"] { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.state-tabs .seg[disabled] { opacity: .45; cursor: not-allowed; }
.state-tabs .spacer { flex: 1; }
.map-wrap { overflow-x: auto; border: 1px solid var(--line-strong); background: var(--paper); }
.map-wrap svg { display: block; }
.map-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin: 6px 0 14px; }
.map-legend span { display: inline-flex; gap: 6px; align-items: center; }
.sheet { overflow-x: auto; border: 1px solid var(--line-strong); background: var(--surface); }
.sheet table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.sheet th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 7px 6px; background: var(--surface-2); white-space: nowrap; }
.sheet td { padding: 3px 5px; border-top: 1px solid var(--line); vertical-align: middle; }
.sheet input, .sheet select, .pm input[type=text], .pm input[type=number], .pm input[type=date], .pm select, .pm textarea { border: 1px solid var(--line-strong); background: var(--surface); padding: 4px 6px; font-size: 13px; min-width: 0; border-radius: 3px; }
.sheet td.nc input { width: 70px; text-align: right; }
.sheet td.nm input { min-width: 190px; width: 100%; }
.sheet .libname { font-size: 11.5px; color: var(--muted); }
.sheet .ct { color: var(--muted); text-align: right; }
.signals { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 12px 14px; list-style: none; }
.signals li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: start; font-size: 13.5px; }
.signals .b { width: 18px; height: 18px; margin-top: 2px; }
.pm-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.pm-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 12px; padding: 12px 14px; }
.fields label.f input, .fields label.f select, .fields label.f textarea { width: 100%; }
.fields .wide { grid-column: 1 / -1; }
label.f textarea { min-height: 54px; resize: vertical; }
/* guided mode */
.guide { border: 1px solid var(--petrol); background: var(--mist-pale); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.ghead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gtitle { font-family: var(--serif); font-weight: 400; font-size: 20px; margin: 0; }
.gbody { display: flex; flex-direction: column; gap: 10px; max-width: 72ch; }
.gq { display: flex; flex-direction: column; gap: 3px; }
.gq input { max-width: 22rem; border: 1px solid var(--line-strong); padding: 5px 7px; background: #fff; }
.gl { font-weight: 700; font-size: 14px; }
.gp { margin: 0; font-size: 14px; }
.gwarn { border-left: 3px solid var(--danger); padding: 4px 10px; background: var(--surface); }
.gwarn p { margin: 0; color: var(--danger); font-size: 13.5px; }
.gint { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.gnav { display: flex; gap: 8px; }
/* process library */
.tpl { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; padding: 12px 14px; }
.tpl button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; border: 1px solid var(--line-strong); background: var(--surface); padding: 7px 10px; font-size: 13.5px; }
.tpl button:hover { border-color: var(--petrol); }
.tpl button[aria-pressed="true"] { border-color: var(--petrol); box-shadow: inset 3px 0 0 var(--petrol); }
.tpl small { color: var(--muted); white-space: nowrap; }
.tree { display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; padding: 8px 14px 14px; max-height: 560px; overflow: auto; }
.node { display: grid; grid-template-columns: 18px auto minmax(0, 1fr) auto; gap: 6px; align-items: start; padding: 3px 4px; }
.node:hover { background: var(--surface-2); }
.node .id { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; padding-top: 1px; white-space: nowrap; }
.node.l1 { font-family: var(--serif); font-size: 16px; margin-top: 6px; }
.node.l1 .id { color: var(--petrol); font-size: 14px; }
.node .nm { min-width: 0; overflow-wrap: anywhere; }
.node .addstep { all: unset; cursor: pointer; border: 1px solid var(--line-strong); background: var(--surface); font-size: 12px; padding: 0 6px; line-height: 20px; font-weight: 600; }
.node .addstep:hover { background: var(--petrol); color: #fff; border-color: var(--petrol); }
.node .addstep.in { background: var(--surface-2); color: var(--muted); cursor: default; }
.tog { all: unset; cursor: pointer; color: var(--muted); width: 18px; line-height: 20px; text-align: center; }
.lib-filters { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 8px; padding: 12px 14px 0; }
.lib-filters select, .lib-filters input { border: 1px solid var(--line-strong); background: #fff; padding: 5px 7px; font-size: 13px; }
.check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: start; font-size: 13px; }
.empty-box { font-size: 13.5px; color: var(--muted); border: 1px dashed var(--line-strong); padding: 10px 12px; margin: 12px 14px; }
/* owner and manager */
.role-card { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 0; }
.role-card > div { padding: 12px 14px; border-right: 1px solid var(--line); min-width: 0; }
.role-card > div:last-child { border-right: none; }
.who { font-family: var(--serif); font-size: 20px; line-height: 1.2; }
.who small { display: block; font-family: var(--font); font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.who.none { color: var(--danger); font-size: 16px; }
.role-card textarea { width: 100%; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { padding: 7px 14px; border-top: 1px solid var(--line); font-size: 13.5px; display: flex; gap: 8px; }
.checks li:first-child { border-top: none; }
.checks li::before { content: ''; flex: 0 0 8px; height: 8px; margin-top: 6px; background: var(--amber); }
.checks li.good::before { background: var(--good); }
.grid-table td.n, .grid-table th.n { text-align: right; font-variant-numeric: tabular-nums; }
.grid-table td.big { font-family: var(--serif); font-size: 17px; }
.grid-table td small { display: block; font-size: 11.5px; color: var(--muted); }
.grid-table tr.late td { background: #FDF6F6; }
.grid-table tr.done td { color: var(--muted); }
.grid-table input.w, .grid-table select.w, .grid-table textarea.w { width: 100%; }
.st-sel { font-size: 12px; font-weight: 700; padding: 3px 4px; border: 1px solid var(--line-strong); }
.st-Idea { background: var(--surface-2); } .st-Planned { background: #FFF6E3; } .st-In-progress { background: var(--mist-pale); color: var(--petrol-dark); } .st-Done { background: var(--good-pale); color: var(--good); } .st-Parked { background: var(--stone); color: var(--muted); }
.st-To-raise { background: var(--amber-pale); color: #5A3E10; } .st-Raised { background: var(--mist-pale); color: var(--petrol-dark); } .st-Decided, .st-Closed { background: var(--good-pale); color: var(--good); }
.st-Open { background: var(--amber-pale); color: #5A3E10; } .st-Raised-to-the-owner { background: var(--mist-pale); color: var(--petrol-dark); } .st-Fixed { background: var(--good-pale); color: var(--good); }
.src-ref { display: block; font-size: 11.5px; color: var(--label); margin-top: 2px; }
.loadbar { position: relative; height: 8px; background: var(--surface-2); min-width: 90px; }
.loadbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--label); max-width: 100%; }
.loadbar.hi i { background: var(--amber); } .loadbar.over i { background: var(--danger); }
.compare { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.compare > div { padding: 12px 14px; border-right: 1px solid var(--line); }
.compare > div:last-child { border-right: none; }
.compare .lbl { margin-bottom: 6px; }
.compare b { font-family: var(--serif); font-weight: 400; font-size: 22px; }
.compare .arrow { color: var(--muted); margin: 0 6px; }
.compare small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.week-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; }
.week-head .chipset { display: flex; gap: 6px; flex-wrap: wrap; }
.panel-foot { padding: 8px 14px 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.scope-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.scope-grid > div { padding: 12px 14px; border-right: 1px solid var(--line); }
.scope-grid > div:last-child { border-right: none; }
.scope-grid ul { margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.scope-grid li { border-top: 1px solid var(--line); padding: 5px 0; }
.about p { font-size: 14px; color: var(--ink-2); max-width: 820px; }
.attr { font-size: 12px; color: var(--muted); max-width: 110ch; margin-top: 18px; }
@media (max-width: 1100px) { .pm-grid2, .pm-grid3, .role-card, .compare, .scope-grid { grid-template-columns: 1fr; } .role-card > div, .compare > div, .scope-grid > div { border-right: none; border-bottom: 1px solid var(--line); } .pm-kpis { grid-template-columns: repeat(2, 1fr); } .lib-filters { grid-template-columns: 1fr 1fr; } .lib-filters input { grid-column: span 2; } }
@media print { .guide, .state-tabs button, .panel-foot { display: none !important; } .map-wrap { overflow: visible; } }
.grid-table td select.w { min-width: 150px; }
/* 8ao (27 Oct 2026): the value stream table as a spreadsheet grid. Every value is its own cell and the cell is the
   field (no box inside a box); column groups coloured as on the family's other grids; the step number is the key column. */
.sheet { border: 2px solid var(--petrol, #0B5257); }
.sheet table#sheet th, .sheet table#sheet td { border: 1px solid #9FC3C8; }
.sheet table#sheet thead tr.groups th { color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; padding: 5px 8px; }
.sheet table#sheet .g-step { background: #0B5257; } .sheet table#sheet .g-time { background: #195190; } .sheet table#sheet .g-wait { background: #8A5A12; }
.sheet table#sheet .g-flow { background: #1E7A45; } .sheet table#sheet .g-class { background: #4A3AA7; } .sheet table#sheet .g-act { background: #4A5468; }
.sheet table#sheet thead tr.cols th { color: #1F2A33; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; white-space: normal; vertical-align: bottom; }
.sheet table#sheet thead tr.cols th.n { text-align: right; }
.sheet table#sheet .t-step { background: #DCEEEF; } .sheet table#sheet .t-time { background: #DCE7F5; } .sheet table#sheet .t-wait { background: #F6E7CC; }
.sheet table#sheet .t-flow { background: #DCEFE2; } .sheet table#sheet .t-class { background: #E4E1F4; } .sheet table#sheet .t-act { background: #E6EAEE; }
.sheet table#sheet tbody td { padding: 0; height: 34px; background: var(--surface, #fff); }
.sheet table#sheet tbody td > input, .sheet table#sheet tbody td > select { display: block; width: 100% !important; min-width: 64px; height: 100%; min-height: 34px; box-sizing: border-box; border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 4px 8px; font-size: 13.5px; margin: 0; }
.sheet table#sheet tbody td.nm > input { min-width: 240px; }
.sheet table#sheet tbody td:nth-child(4) > input { min-width: 160px !important; }
.sheet table#sheet tbody td.nc > input { text-align: right; }
.sheet table#sheet tbody td:hover, .sheet table#sheet tbody td:focus-within { outline: 2px solid #0B5257; outline-offset: -2px; background: #F5FBFB; }
.sheet table#sheet tbody td.num-key { background: #EEF6F7; font-weight: 700; text-align: center; padding: 4px 8px; width: 34px; }
.sheet table#sheet tbody td.ct { padding: 4px 8px; background: #F3F6F7; color: var(--ink-2, #3A4652); }
.sheet table#sheet tbody td.acts { padding: 2px 6px; }
.sheet table#sheet tbody td.acts:hover { outline: 0; background: var(--surface, #fff); }
.sheet table#sheet .libname { padding: 0 8px 4px; }
html[data-display="night"] .sheet table#sheet tbody td, html[data-display="night"] .sheet table#sheet tbody td.acts:hover { background: var(--surface); }
html[data-display="night"] .sheet table#sheet tbody td.num-key, html[data-display="night"] .sheet table#sheet tbody td.ct { background: #24302F; }
html[data-display="night"] .sheet table#sheet thead tr.cols th { color: #1F2A33; }
html[data-display="night"] .sheet table#sheet tbody td > input, html[data-display="night"] .sheet table#sheet tbody td > select { color: var(--ink); }
