/* Traseul unei probleme (problem-flow): one component for the About page (generic, static markup), the case page and the
   theme page (topic, drawn by problem-flow.js). Site tokens only (brand.css, GOV.UK theme of 2026-10); its colours are
   component tokens, so a later dark theme redefines them in one place. The layout follows the component's own width
   (container queries), not the page's. Nothing is carried by colour alone: every state is also a word and a shape. */
.problem-flow{--pf-ink:var(--gv-ink,#0b0c0c);--pf-text:var(--gv-ink,#0b0c0c);--pf-muted:var(--gv-muted,#505a5f);--pf-line:var(--gv-line,#b1b4b6);
 --pf-rule:#505a5f;--pf-alt:var(--gv-alt,#f3f2f1);--pf-brand:var(--gv-brand,#0b3d91);--pf-bg:#fff;--pf-ok:var(--gv-ok,#00703c);
 --pf-node:34px;--pf-indent:calc(var(--pf-node) + 18px);container:pf/inline-size;min-width:0;color:var(--pf-text)}
/* On About the component takes the page's own ink and body colours (about.css). */
.about-page .problem-flow{--pf-ink:#172b3a;--pf-text:#52616b}
.problem-flow .pf-vh{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
/* A word with a hyphen („s-a”, „printr-o”) is never split at its hyphen; a short link with one („spune-ne”) stays whole. */
.problem-flow :is(.pf-nw,a[data-pf-nw]){white-space:nowrap}
/* A section that an in-page link moved the focus to (problem-flow.js holdFocus) is not a control: no focus box. The site's
   yellow focus stays on links and buttons. */
body.brand-page [data-pf-target]:focus-visible{outline:none!important;background:transparent!important;box-shadow:none!important}
/* Margins come from the component's own rules (:where() keeps this reset at the lowest specificity). */
.problem-flow :where(.pf-key,.pf-value,.pf-why,.pf-loop) :where(h3,h4,h5,p,ul,ol,dl,dd){margin:0}
.problem-flow .pf-lead{margin:0 0 14px;max-width:72ch;color:var(--pf-text);font-size:16px;line-height:1.65}
.problem-flow .pf-summary{margin:0 0 26px;padding:12px 16px;border-left:5px solid var(--pf-brand);background:var(--pf-alt);color:var(--pf-ink);font-size:16px;line-height:1.55}

/* The stages: numbered nodes on one connector. A dashed node and a dashed segment mean „still empty”. */
.problem-flow .pf-stages{list-style:none;margin:0;padding:0}
.problem-flow .pf-stage{position:relative;padding:0 0 26px var(--pf-indent);break-inside:avoid;scroll-margin-top:100px}
.problem-flow .pf-stage:not(:last-child)::before{content:"";position:absolute;left:calc(var(--pf-node) / 2 - 1px);top:calc(var(--pf-node) + 4px);bottom:4px;border-left:2px solid var(--pf-rule)}
.problem-flow .pf-stage[data-next=empty]::before{border-left-style:dashed}
.problem-flow .pf-node{position:absolute;left:0;top:0;box-sizing:border-box;width:var(--pf-node);height:var(--pf-node);display:flex;align-items:center;justify-content:center;
 border:2px solid var(--pf-ink);border-radius:50%;background:var(--pf-ink);color:#fff;font:700 16px/1 var(--ig-sans,sans-serif)}
.problem-flow .pf-stage:is([data-state=empty],[data-state=busy]) .pf-node{border-style:dashed;background:var(--pf-bg);color:var(--pf-ink)}
.problem-flow .pf-stage[data-state=generic] .pf-node{background:var(--pf-bg);color:var(--pf-ink)}
.problem-flow .pf-name{margin:4px 0 4px;color:var(--pf-ink);font-size:19px;font-weight:700;line-height:1.3;letter-spacing:-.01em}
.problem-flow .pf-caption{margin:0 0 12px;color:var(--pf-muted);font-size:15px;line-height:1.5}
.problem-flow .pf-value{min-width:0;overflow-wrap:anywhere}
.problem-flow .pf-value>*+*{margin-top:8px}

/* Text inside a stage */
.problem-flow .pf-p{font-size:16px;line-height:1.55;color:var(--pf-text)}
.problem-flow .pf-p strong{color:var(--pf-ink)}
.problem-flow .pf-muted{font-size:15px;color:var(--pf-muted)}
.problem-flow .pf-caution{font-size:15px;font-weight:600;color:var(--pf-ink)}
.problem-flow .pf-tag{display:inline-block;padding:2px 8px;border:1px solid var(--pf-alt);background:var(--pf-alt);color:var(--pf-ink);font-size:15px;font-weight:600;line-height:1.5}
.problem-flow .pf-tag[data-kind=empty]{border:1px dashed var(--pf-rule);background:var(--pf-bg)}
.problem-flow .pf-list{padding-left:20px;font-size:16px;line-height:1.55;color:var(--pf-text)}
.problem-flow .pf-list>li+li{margin-top:6px}
.problem-flow .pf-state{display:inline-block;margin:2px 0;padding:0 6px;background:#e5e6e7;color:var(--pf-ink);font-size:14px;font-weight:600;line-height:1.5;white-space:nowrap}
.problem-flow .pf-state[data-tone=bad]{background:#f4cdc6;color:#2a0b06}
.problem-flow .pf-state[data-tone=warn]{background:#fcd6c3;color:#6e3619}
.problem-flow .pf-state[data-tone=ok]{background:#cce2d8;color:#005a30}
.problem-flow .pf-more{display:flex;flex-wrap:wrap;gap:0 18px;margin:6px 0 0;font-size:15px;line-height:1.5}
.problem-flow .pf-more a{display:inline-flex;align-items:center;min-height:44px}

/* Stage 1: the two kinds of evidence, side by side when there is room. */
.problem-flow .pf-lanes{display:grid;gap:14px}
.problem-flow .pf-lane{min-width:0;padding-top:8px;border-top:2px solid var(--pf-ink)}
.problem-flow .pf-lane[data-state=empty]{border-top-style:dashed;border-top-color:var(--pf-rule)}
.problem-flow .pf-lane>*+*{margin-top:6px}
.problem-flow .pf-lane-title{color:var(--pf-ink);font-size:16px;font-weight:700;line-height:1.4}
.problem-flow .pf-mini{display:inline-block;margin-left:4px;padding:0 6px;border:1px dashed var(--pf-rule);color:var(--pf-muted);font-size:13px;font-weight:600;vertical-align:1px}
.problem-flow .pf-lane ul{padding-left:20px}
.problem-flow .pf-lane li{font-size:15px;line-height:1.55}

/* Stage 2: the facts of the problem (narrow: „Nivel Național” on one line; wide: two columns). */
.problem-flow .pf-dl{display:grid;gap:4px;font-size:16px;line-height:1.5;color:var(--pf-text)}
.problem-flow .pf-dl dt{display:inline;color:var(--pf-ink);font-weight:700}
.problem-flow .pf-dl dt::after{content:" "}
.problem-flow .pf-dl dd{display:inline}
/* Gravity: three bars as in the Companiile statului report, always with the words. */
.problem-flow .pf-bars{display:inline-flex;gap:3px;margin-right:8px;vertical-align:1px}
.problem-flow .pf-bars i{box-sizing:border-box;width:14px;height:8px;border:1px solid var(--pf-rule);background:var(--pf-bg)}
.problem-flow .pf-bars i.on{border-color:var(--pf-ink);background:var(--pf-ink)}
/* Generic mode: what gravity and priority mean (an inset with the brand rule). */
.problem-flow .pf-weigh{display:grid;gap:10px;padding:12px 14px;border-left:4px solid var(--pf-brand);background:var(--pf-alt)}
.problem-flow .pf-weigh dt{color:var(--pf-ink);font-size:15px;font-weight:700;line-height:1.4}
.problem-flow .pf-weigh dd{margin:0;font-size:15px;line-height:1.55;color:var(--pf-text)}

/* Stage 3: the one action, with two plain alternatives. A GOV.UK start button (as .gvh-btn on the homepage). */
.problem-flow .pf-action{margin-top:12px}
.problem-flow .pf-start{display:inline-flex;gap:8px;align-items:center;max-width:100%;padding:10px 16px;background:var(--pf-ok);box-shadow:0 2px #002d18;color:#fff;font-size:17px;font-weight:700;line-height:1.35;text-decoration:none}
.problem-flow .pf-start:hover{background:#005a30}
.problem-flow .pf-alt{margin:12px 0 0;padding:0;list-style:none;font-size:15px;line-height:1.5;color:var(--pf-text)}
.problem-flow .pf-alt li+li{margin-top:6px}

/* Stage 4: the five steps until activation. Inline in topic mode; a rail with who acts in generic mode. */
.problem-flow .pf-gates{display:flex;flex-wrap:wrap;gap:2px 0;margin:4px 0 0;padding:0;list-style:none;color:var(--pf-ink);font-size:15px;font-weight:600}
.problem-flow .pf-gates li{display:flex;align-items:center}
.problem-flow .pf-gates li:not(:last-child)::after{content:"→";content:"→" / "";margin:0 8px;color:var(--pf-muted);font-weight:400}
.problem-flow .pf-gates-who{display:grid;gap:0}
.problem-flow .pf-gates-who li{position:relative;display:grid;gap:0 12px;padding:0 0 10px 22px;font-size:15px;line-height:1.45}
.problem-flow .pf-gates.pf-gates-who li:not(:last-child)::after{content:none}
.problem-flow .pf-gates-who li::before{content:"";position:absolute;top:5px;left:2px;width:8px;height:8px;border:2px solid var(--pf-rule);border-radius:50%;background:var(--pf-bg)}
.problem-flow .pf-gates-who li:not(:last-child) b::after{content:"";position:absolute;top:19px;bottom:1px;left:7px;border-left:2px solid var(--pf-rule)}
.problem-flow .pf-gates-who li:last-child{padding-bottom:0}
.problem-flow .pf-gates-who li:last-child::before{width:12px;height:12px;top:3px;left:0;background:var(--pf-rule)}
.problem-flow .pf-gates-who span{color:var(--pf-text);font-weight:400}
/* Stage 5 */
.problem-flow .pf-resolution{padding:8px 12px;background:var(--pf-alt)}

/* After stage 5: the loop back to stage 1, and the reasons (generic) or the link to them (topic). */
.problem-flow .pf-loop{position:relative;margin:0 0 22px;padding-left:var(--pf-indent);color:var(--pf-muted);font-size:15px;line-height:1.5}
.problem-flow .pf-loop-mark{position:absolute;left:calc(var(--pf-node) / 2 - 11px);top:0;width:22px;height:22px;fill:none;stroke:var(--pf-ink);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.problem-flow .pf-why-link{margin:0;font-size:16px}
.problem-flow .pf-why{margin-top:34px}
.problem-flow .pf-why>h3{margin:0 0 4px;color:var(--pf-ink);font-size:22px;line-height:1.3;letter-spacing:-.02em}
.problem-flow .pf-why>p{margin:0;color:var(--pf-text);font-size:16px;line-height:1.7}
.problem-flow .pf-reasons{display:grid;gap:0 32px;margin:12px 0 0;padding:0;list-style:none}
.problem-flow .pf-reasons>li{min-width:0;padding:14px 0 16px;border-top:1px solid var(--pf-line);break-inside:avoid}
.problem-flow .pf-reasons h4{margin:0 0 4px;color:var(--pf-ink);font-size:16px;font-weight:700;line-height:1.4}
.problem-flow .pf-reasons h4 span{margin-right:8px;color:var(--pf-muted);font:600 14px/1.4 var(--ig-mono,monospace)}
.problem-flow .pf-reasons p{margin:0;color:var(--pf-text);font-size:15px;line-height:1.6}
.problem-flow .pf-onpage{margin:20px 0 0;color:var(--pf-text);font-size:16px;line-height:1.7}

/* Compact density (theme page): small nodes, one line per stage, no captions. */
.problem-flow.pf-compact{--pf-node:26px;--pf-indent:40px;margin:0 0 28px}
.problem-flow.pf-compact .pf-title{margin:0 0 4px;font-size:19px;line-height:1.3}
.problem-flow.pf-compact .pf-lead{margin:0 0 12px;font-size:15px}
.problem-flow.pf-compact .pf-stage{padding-bottom:12px}
.problem-flow.pf-compact .pf-node{font-size:14px}
.problem-flow.pf-compact .pf-name{margin:2px 0 2px;font-size:16px}
.problem-flow.pf-compact .pf-p{font-size:15px}

/* Generic mode: the whole path at a glance, five stages and the way back. A picture only (aria-hidden): the list of stages
   below says the same in words. Shown when the component is wide enough for one row. */
.problem-flow .pf-map{display:none}
@container pf (min-width:720px){
 .problem-flow .pf-map{display:block;position:relative;margin:4px 0 34px;padding-bottom:44px}
 .problem-flow .pf-map ol{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));margin:0;padding:0;list-style:none}
 .problem-flow .pf-map li{position:relative;display:flex;flex-direction:column;align-items:center;gap:8px;padding:0 6px;color:var(--pf-ink);font-size:15px;font-weight:700;line-height:1.35;text-align:center}
 .problem-flow .pf-map li>span{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:var(--pf-node);height:var(--pf-node);border:2px solid var(--pf-ink);border-radius:50%;background:var(--pf-bg);font:700 16px/1 var(--ig-sans,sans-serif)}
 /* Arrows between the stages: a line and a head. */
 .problem-flow .pf-map li:not(:last-child)::after{content:"";position:absolute;top:calc(var(--pf-node) / 2 - 1px);left:calc(50% + var(--pf-node) / 2 + 6px);right:calc(var(--pf-node) / 2 + 12px - 50%);border-top:2px solid var(--pf-rule)}
 .problem-flow .pf-map li:not(:last-child)::before{content:"";position:absolute;top:calc(var(--pf-node) / 2 - 5px);right:calc(var(--pf-node) / 2 + 5px - 50%);width:8px;height:10px;background:var(--pf-rule);clip-path:polygon(0 0,100% 50%,0 100%)}
 /* The way back: from under stage 5 to under stage 1, with its words on the line. */
 .problem-flow .pf-map::before{content:"";position:absolute;left:10%;right:10%;bottom:10px;height:24px;border:2px solid var(--pf-rule);border-top:0}
 .problem-flow .pf-map::after{content:"";position:absolute;left:calc(10% - 4px);bottom:34px;width:10px;height:8px;background:var(--pf-rule);clip-path:polygon(50% 0,100% 100%,0 100%)}
 .problem-flow .pf-map>p{position:absolute;left:50%;bottom:0;transform:translateX(-50%);margin:0;padding:0 12px;background:var(--pf-bg);color:var(--pf-muted);font-size:14px;line-height:22px;white-space:nowrap}
}

/* Wider components: name and caption on the left, the content on the right. */
@container pf (min-width:720px){
 .problem-flow .pf-stage{display:grid;grid-template-columns:minmax(170px,210px) minmax(0,1fr);grid-template-rows:auto 1fr;column-gap:32px}
 .problem-flow .pf-key{grid-column:1;grid-row:1}
 .problem-flow .pf-value{grid-column:2;grid-row:1}
 /* The section links stay after the content, in the same column, so the reading and Tab order match the DOM. */
 .problem-flow .pf-more{grid-column:2;grid-row:2;margin-top:2px}
 .problem-flow .pf-dl>div{display:grid;grid-template-columns:120px minmax(0,1fr);column-gap:14px}
 .problem-flow .pf-dl :is(dt,dd){display:block}.problem-flow .pf-dl dt::after{content:none}
 .problem-flow .pf-gates-who li{grid-template-columns:104px minmax(0,1fr)}
 .problem-flow.pf-compact .pf-stage{grid-template-columns:minmax(150px,180px) minmax(0,1fr);column-gap:24px}
 .problem-flow.pf-compact .pf-value{padding-top:3px}
}
@container pf (min-width:860px){.problem-flow .pf-lanes{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}}
@container pf (min-width:560px){.problem-flow .pf-reasons{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container pf (max-width:420px){
 .problem-flow:not(.pf-compact){--pf-node:30px;--pf-indent:44px}
 .problem-flow .pf-name{font-size:18px}
 .problem-flow .pf-start{display:flex;justify-content:center;text-align:center}
}

/* Windows high contrast: keep the nodes, bars, connectors and boxes visible. */
@media (forced-colors:active){
 .problem-flow :is(.pf-node,.pf-bars i){forced-color-adjust:none;border-color:CanvasText;background:CanvasText;color:Canvas}
 .problem-flow .pf-map li::before,.problem-flow .pf-map li::after,.problem-flow .pf-map::after{forced-color-adjust:none;border-color:CanvasText;background:CanvasText}
 .problem-flow .pf-stage:is([data-state=empty],[data-state=busy],[data-state=generic]) .pf-node,.problem-flow .pf-bars i:not(.on){background:Canvas;color:CanvasText}
 .problem-flow .pf-stage::before{border-color:CanvasText}
 .problem-flow .pf-loop-mark{stroke:CanvasText}
 .problem-flow :is(.pf-summary,.pf-tag,.pf-state,.pf-weigh,.pf-resolution,.pf-start){border:1px solid CanvasText}
}
/* Print: every stage whole, section links dropped, the action as black text in a black box. The page-level part hides the
   fixed header, the skip link, the feedback bar and the side navigation of the pages that carry the component. */
@media print{
 .problem-flow :is(.pf-stage,.pf-lane,.pf-action,.pf-reasons>li){break-inside:avoid}
 .problem-flow .pf-more{display:none}
 .problem-flow :is(.pf-node,.pf-bars i,.pf-summary,.pf-tag,.pf-state,.pf-weigh){-webkit-print-color-adjust:exact;print-color-adjust:exact}
 .problem-flow .pf-start{border:2px solid #000;background:#fff;box-shadow:none;color:#000}
 body:has(.problem-flow) :is(.skip-link,.site-menu-toggle,.gv-feedback,.gv-entry,.about-sidebar,.catalog-sidebar){display:none!important}
 body:has(.problem-flow) .sitebar{position:static!important;height:auto!important}
 body:has(.problem-flow) .brand-hero{padding-top:24px!important}
 body:has(.problem-flow).about-page .about-main>.brand-shell{display:block!important}
}
