/* The scrolling user guide uses the app's chrome and Nogat tokens; the standalone
 * slide presentation keeps its separate stylesheet (prezentacja.css). */
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-height) + var(--space-4)); }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--text-site)/1.55 var(--font-sans); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.skip {
    position: absolute; left: var(--space-2); top: -60px; z-index: 20;
    padding: var(--space-1) var(--space-3); background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius-md);
}
.skip:focus { top: var(--space-2); }
.topbar { position: sticky; top: 0; height: var(--header-height); }
.topbar .btn {
    display: inline-flex; align-items: center; gap: var(--space-1);
    height: var(--control); padding: 0 var(--space-3);
    border: 1px solid transparent; border-radius: var(--radius-md);
    color: var(--text); text-decoration: none; font: var(--weight-medium) var(--text-sm)/1 var(--font-sans);
}
.topbar .btn:hover { background: var(--highlight); }
.topbar .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.guide {
    display: grid; grid-template-columns: 250px minmax(0, 1fr);
    grid-template-areas: 'toc head' 'toc text'; column-gap: var(--space-8);
    max-width: var(--container-max); margin: 0 auto; padding: var(--space-8) var(--space-6) var(--space-16);
}
.guide-head { grid-area: head; max-width: 860px; padding: 0 0 var(--space-6); }
.guide-toc { grid-area: toc; }
.guide-text { grid-area: text; min-width: 0; max-width: 860px; }
.guide-toc {
    position: sticky; top: calc(var(--header-height) + var(--space-6)); align-self: start;
    max-height: calc(100vh - var(--header-height) - var(--space-12)); overflow-y: auto;
    font-size: var(--text-base); line-height: var(--line-height);
}
.guide-toc h2 { margin: 0 0 var(--space-2); color: var(--text-3); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; }
.toc-hint { margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); border-left: 3px solid var(--tool-hydrograf); border-radius: var(--radius-sm); background: var(--accent-soft); font-size: var(--text-sm); }
.toc, .toc ol { margin: 0; padding: 0; list-style: none; }
.toc a { display: flex; gap: var(--space-2); padding: 3px var(--space-2); border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; }
.toc a:hover { background: var(--surface-2); color: var(--text); }
.toc-num { flex: none; min-width: 22px; color: var(--text-3); font: var(--weight-bold) var(--text-xs)/1.9 var(--font-mono); }
.toc-start { margin: 0 0 var(--space-2); padding: 0 0 var(--space-2); border-bottom: 1px solid var(--line); }
.toc-start > a, .toc-start > a .toc-num { color: var(--tool-hydrograf); font-weight: var(--weight-bold); }
.toc-start ol a { padding-left: calc(var(--space-2) + 30px); font-size: var(--text-sm); }
.kicker { margin: 0 0 var(--space-1); color: var(--tool-hydrograf); font-size: var(--text-xs); font-weight: var(--weight-bold); text-transform: uppercase; letter-spacing: 0.06em; }
.guide-head h1 { margin: 0 0 var(--space-3); font-size: var(--text-2xl); line-height: 1.2; color: var(--tool-hydrograf); }
.guide-head p { margin: 0 0 var(--space-3); }
.lead { color: var(--text-2); font-size: var(--text-lg); }
.note-box, .hint { margin: var(--space-4) 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); }
.note-box, .hint.warn { background: var(--warn-bg); border-left: 3px solid var(--warn); }
.hint { background: var(--info-bg); border-left: 3px solid var(--info); }
.guide-text h2 { margin: 0 0 var(--space-4); font-size: var(--text-xl); line-height: 1.25; }
.guide-text h3 { margin: var(--space-6) 0 var(--space-3); font-size: var(--text-lg); line-height: 1.3; }
.guide-text h4 { margin: var(--space-4) 0 var(--space-2); font-size: var(--text-md); }
.guide-text p { margin: 0 0 var(--space-3); }
.guide-text ul, .guide-text ol { margin: 0 0 var(--space-3); padding-left: var(--space-6); }
.guide-text li { margin-bottom: var(--space-2); }
.guide-text a { color: var(--tool-hydrograf); }
.guide-text code, .guide-text kbd { padding: 0 3px; border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--surface-2); font: 0.9em var(--font-mono); }
.guide-text kbd { border-bottom-width: 2px; white-space: nowrap; }
/* Provider lines (ECO-060) beside the screenshots of PMAXTP results, quoted from
 * backend/core/attribution.py: the attribution, then the notice of the terms */
.provider-lines {
    margin: var(--space-4) 0; padding: var(--space-3) var(--space-4);
    background: var(--surface-2); border-left: 3px solid var(--tool-hydrograf);
    border-radius: var(--radius-md); color: var(--text-2); font-size: var(--text-md); line-height: 1.5;
    overflow-wrap: break-word;
}
.guide-text .provider-lines p { margin: 0 0 var(--space-1); }
.guide-text .provider-lines .provider-title { color: var(--tool-hydrograf); font-size: var(--text-sm); font-weight: var(--weight-bold); text-transform: uppercase; letter-spacing: 0.06em; }
.provider-terms { margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--line); }
.guide-text .provider-lines .provider-terms p:last-child { margin-bottom: 0; }
.part { padding: var(--space-8) 0 var(--space-6); border-top: 1px solid var(--line); }
.guide-subsection { margin: var(--space-6) 0 var(--space-8); }
.back { margin: var(--space-6) 0 0; font-size: var(--text-sm); }
.cols, .grid { display: grid; gap: var(--space-3); }
.cols, .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#czym-jest .cols { grid-template-columns: minmax(0, 1fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.col, .stack, .steps-list { min-width: 0; }
.split { display: flex; align-items: flex-start; gap: var(--space-5); }
.split > :not(figure) { flex: 1; min-width: 0; }
.card, .step {
    margin-bottom: var(--space-3); padding: var(--space-3) var(--space-4);
    background: var(--surface-2); border-left: 3px solid var(--tool-hydrograf);
    border-radius: var(--radius-md);
}
.card p, .step p { margin: var(--space-1) 0 0; color: var(--text-2); }
.card .label { color: var(--tool-hydrograf); font-size: var(--text-sm); font-weight: var(--weight-bold); }
.step { border-left: none; border-top: 3px solid var(--accent-green); }
.step strong { display: block; }
.number { display: block; margin: 0 0 var(--space-1); color: var(--tool-hydrograf); font: var(--weight-bold) var(--text-lg)/1 var(--font-mono); }
.defs { display: grid; gap: var(--space-3); margin: 0 0 var(--space-3); }
.defs dt { color: var(--text); font-weight: var(--weight-bold); }
.defs dd { margin: 2px 0 0; color: var(--text-2); }
.glossary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.symbols { list-style: none; padding: 0 !important; }
.symbols li { display: flex; align-items: center; gap: var(--space-3); }
.sym { display: inline-block; flex: 0 0 30px; }
.sym-area { height: 20px; border: 2px solid var(--tool-hydrograf); background: var(--accent-soft); }
.sym-ring { width: 17px; height: 17px; flex-basis: 17px; border: 3px solid var(--tool-hydrograf); border-radius: 50%; }
.sym-pair { display: flex; flex-direction: column; gap: 4px; }
.sym-line { border-top: 3px solid var(--info); }
.sym-line.faint { opacity: 0.5; }
.sym-dash { border-top: 3px dashed var(--warn); }
.sym-dot { border-top: 3px dotted var(--warn); }
.guide-text figure { margin: var(--space-3) 0 var(--space-5); max-width: 100%; }
.guide-text figure a { display: block; }
.guide-text figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); background: var(--surface); }
.guide-text figcaption { margin: var(--space-2) 0 0; color: var(--text-3); font-size: var(--text-sm); }
.guide-text .split figure { flex: 0 1 52%; min-width: 0; }
.guide-text .split figure.portrait { flex: 0 1 270px; }
.guide-text .split:has(figure:not(.portrait)) { display: block; }
.guide-text .split figure:not(.portrait) { width: 100%; max-width: 860px; }
.guide-text .tree-figure { max-width: 700px; }
.guide-text .strip-figure { max-width: 650px; }
.compare { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.compare th, .compare td { padding: var(--space-2); text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.compare thead th { color: var(--tool-hydrograf); }
.compare tbody tr:nth-child(odd) { background: var(--surface-2); }
/* „Objaśnienia wielkości i metod”: the longer explanations linked by the (i) texts (DEV-15.14) */
.guide-text math { font-family: math, "STIX Two Math", "Cambria Math", "Latin Modern Math", serif; }
.guide-text .nowrap { white-space: nowrap; }
.explain { margin: 0 0 var(--space-6); }
.explain:target h4 { color: var(--tool-hydrograf); }
.explain-formula { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--surface-2); overflow-x: auto; }
.explain-vars { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px var(--space-3); margin: 0 0 var(--space-3); }
.explain-vars div { display: contents; }
.explain-vars dd { margin: 0; color: var(--text-2); }
.guide-text .explain-src { color: var(--text-3); font-size: var(--text-sm); }
/* The regulamin of a public deployment (DEV-15.7), under the table of contents; js/terms.js */
.toc-terms {
    display: block; margin: var(--space-3) 0 0; padding: var(--space-2) var(--space-2) 0;
    border-top: 1px solid var(--line);
    color: var(--text-3); font-size: var(--text-xs); text-decoration: none;
}
.toc-terms[hidden] { display: none; }
.toc-terms:hover { color: var(--text); text-decoration: underline; }
@media (max-width: 1050px) {
    .guide { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'head' 'toc' 'text'; padding: var(--space-6) var(--space-4) var(--space-12); }
    .guide-toc { position: static; max-height: none; overflow: visible; margin-bottom: var(--space-6); }
}
@media (max-width: 860px) {
    html { scroll-padding-top: 56px; }
    .topbar { height: 48px; }
    .topbar .btn { padding: 0 var(--space-2); }
    .cols, .grid.two, .grid.three, .grid.four, .glossary { grid-template-columns: minmax(0, 1fr); }
    .split { display: block; }
    .guide-text .split figure { max-width: 100%; }
    .guide-text .split figure.portrait { max-width: 290px; }
    .guide-head h1 { font-size: var(--text-xl); }
    .compare { display: block; overflow-x: auto; }
}
