/* dd.css — shared stylesheet of the dd project site (stragowski.suby.pl/dd/).
   Source: site-src/static/dd.css (copied to site/assets/dd.css by site-src/build.py — edit the source).
   Phone first, high contrast, light and dark (prefers-color-scheme), no external fonts.
   Other workstreams (e.g. W0 market pages) may link it: <link rel="stylesheet" href="/dd/assets/dd.css">
   Useful classes: .table-wrap (horizontal scroll for wide tables), .lead, .note, .soon, .where,
   .chip, .badge, .lbl-src/.lbl-calc/.lbl-sim/.lbl-meas/.lbl-assume, .st-pass/.st-partial/.st-fail/
   .st-blocked/.st-notrun, .cards/.card, .btn, .pill, .gallery, svg.chart, .facts (dl). */

:root {
  --bg: #fbfbf9;
  --bg-soft: #f1f2f0;
  --bg-card: #ffffff;
  --fg: #15171c;
  --muted: #535a66;
  --border: #d5d9df;
  --link: #0a58c2;
  --link-visited: #5b3cc4;
  --accent: #0a58c2;
  --accent-2: #c2410c;
  --ok: #0f7a3d;
  --warn: #a15c00;
  --bad: #b42318;
  --info: #0a58c2;
  --c1: #0a58c2;
  --c2: #6b7280;
  --c3: #0f7a3d;
  --c4: #c2410c;
  --band: rgba(10, 88, 194, .16);
  --code-bg: #f1f2f0;
  --add-bg: #e3f6e8;
  --add-fg: #0b5a2c;
  --del-bg: #fde8e7;
  --del-fg: #8e1b12;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .04);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014;
    --bg-soft: #171a20;
    --bg-card: #151820;
    --fg: #eceef2;
    --muted: #a7afbb;
    --border: #2c323c;
    --link: #79b2ff;
    --link-visited: #b9a3ff;
    --accent: #79b2ff;
    --accent-2: #ff9a5c;
    --ok: #4cc77f;
    --warn: #f0b252;
    --bad: #ff7b6e;
    --info: #79b2ff;
    --c1: #79b2ff;
    --c2: #9aa3b0;
    --c3: #4cc77f;
    --c4: #ff9a5c;
    --band: rgba(121, 178, 255, .2);
    --code-bg: #171a20;
    --add-bg: #10301c;
    --add-fg: #9ff0bd;
    --del-bg: #3a1513;
    --del-fg: #ffb4ab;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}

main {
  display: block;
  max-width: 48rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
  overflow-wrap: anywhere;
}
main.wide { max-width: 72rem; }

a { color: var(--link); text-underline-offset: .18em; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--bg-card); padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; top: .5rem; }

h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 .55em; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; margin-top: .6em; }
h2 { font-size: 1.32rem; padding-top: .3em; border-top: 1px solid var(--border); }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; }
article > header h1, .hero h1 { border: 0; }
p, ul, ol, dl, figure, details, .table-wrap, pre { margin: 0 0 1rem; }
ul, ol { padding-left: 1.3rem; }
li { margin: .25rem 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
img { max-width: 100%; height: auto; }
small, .muted { color: var(--muted); }
.lead { font-size: 1.12rem; color: var(--fg); }
.meta { color: var(--muted); font-size: .95rem; margin-top: -.3rem; }
.meta span + span::before { content: " · "; }
.note { color: var(--muted); font-size: .95rem; }
blockquote { margin: 0 0 1rem; padding: .2rem 1rem; border-left: 4px solid var(--border); color: var(--muted); }

@media (min-width: 40rem) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.45rem; }
  main { padding: 1.5rem 1.5rem 4rem; }
}

/* ---------- header and navigation ---------- */
.top { background: var(--bg-card); border-bottom: 1px solid var(--border); }
.top-inner { max-width: 72rem; margin: 0 auto; padding: .6rem 1rem .5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--fg); min-height: 44px; }
.brand:visited { color: var(--fg); }
.brand-mark {
  display: inline-grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 10px;
  background: var(--fg); color: var(--bg); font-weight: 800; font-size: 1.05rem; letter-spacing: -.04em;
}
.brand-text { display: flex; flex-direction: column; font-weight: 700; line-height: 1.15; }
.brand-text small { font-weight: 400; font-size: .8rem; }
.mainnav { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 .2rem; }
.mainnav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: .35rem .85rem;
  border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--fg);
  background: var(--bg); font-weight: 600; font-size: .98rem;
}
.mainnav a:visited { color: var(--fg); }
.mainnav a[aria-current="page"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.crumbs { font-size: .92rem; color: var(--muted); margin: .2rem 0 .4rem; }
.crumbs a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
.crumbs .sep { margin: 0 .4rem; }

.demo-banner {
  background: repeating-linear-gradient(-45deg, #ffe08a, #ffe08a 14px, #ffd25c 14px, #ffd25c 28px);
  color: #2b1d00; padding: .7rem 1rem; text-align: center; font-size: .95rem;
}
.demo-banner a { color: #2b1d00; font-weight: 700; display: inline-flex; align-items: center; min-height: 44px; }

.foot { border-top: 1px solid var(--border); color: var(--muted); font-size: .88rem; padding: 1.2rem 1rem 2.5rem; }
.foot p { max-width: 48rem; margin: 0 auto .6rem; }

/* ---------- blocks ---------- */
.hero { padding: .4rem 0 .2rem; }
.hero h1 { font-size: 1.75rem; margin-top: .2rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--accent-2); margin: .8rem 0 0; }
@media (min-width: 40rem) { .hero h1 { font-size: 2.3rem; } }

.where {
  background: var(--bg-soft); border: 1px solid var(--border); border-left: 5px solid var(--accent-2);
  border-radius: var(--radius); padding: .9rem 1rem .3rem; margin: 1.4rem 0;
}
.where h2, .where h3 { border: 0; margin-top: 0; padding-top: 0; font-size: 1.1rem; }

.soon {
  background: var(--bg-soft); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: .9rem 1rem; margin: 0 0 1rem;
}

.gate { border-radius: var(--radius); padding: .9rem 1rem; margin: 0 0 1rem; border: 1px solid var(--border); }
.gate-held { border-left: 5px solid var(--warn); background: var(--bg-soft); }
.gate-pending { border-left: 5px solid var(--info); background: var(--bg-soft); }
.gate-disqualified { border-left: 5px solid var(--bad); background: var(--bg-soft); }
.gate-released { border-left: 5px solid var(--ok); background: var(--bg-soft); }

.versions { background: var(--bg-soft); border-radius: var(--radius); padding: .6rem 1rem .2rem; margin: 2rem 0 1rem; }
.versions h2 { border: 0; margin-top: .3rem; font-size: 1.05rem; }

.note-block { border-left: 3px solid var(--border); padding: .1rem 0 .1rem .8rem; margin: 0 0 1rem; }

.btn, .pill {
  display: inline-flex; align-items: center; min-height: 44px; padding: .4rem 1rem; margin: 0 .4rem .5rem 0;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card); color: var(--fg);
  text-decoration: none; font-weight: 600;
}
.btn:visited, .pill:visited { color: var(--fg); }
.btn:hover, .pill:hover { border-color: var(--accent); }
.pill { min-width: 44px; justify-content: center; }
.btn-row { margin: .4rem 0 1rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .8rem; margin: 0 0 1rem; }
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .8rem 1rem .4rem; box-shadow: var(--shadow);
}
.card h3 { margin: .1rem 0 .3rem; font-size: 1.08rem; }
.card h3 a { display: inline-flex; align-items: center; min-height: 44px; }
.card p { margin: 0 0 .6rem; }
.card-meta { color: var(--muted); font-size: .9rem; }

dl.facts { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0 0 1.2rem; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
dl.facts > div { display: grid; grid-template-columns: minmax(7.5rem, 38%) 1fr; gap: .6rem; padding: .5rem .8rem; border-top: 1px solid var(--border); }
dl.facts > div:first-child { border-top: 0; }
dl.facts dt { color: var(--muted); font-size: .93rem; }
dl.facts dd { margin: 0; }
dl.facts.stats { grid-template-columns: repeat(2, 1fr); }
dl.facts.stats > div { grid-template-columns: 1fr; gap: 0; border-left: 1px solid var(--border); }
dl.facts.stats dd { font-size: 1.4rem; font-weight: 700; }
@media (min-width: 40rem) { dl.facts.stats { grid-template-columns: repeat(4, 1fr); } }

/* ---------- chips, badges, labels ---------- */
.chip, .badge, .lbl, .st {
  display: inline-block; border-radius: 999px; padding: .08rem .55rem; font-size: .8rem; font-weight: 700;
  line-height: 1.5; border: 1px solid currentColor; white-space: nowrap; vertical-align: .08em;
}
.chip-todo { color: var(--muted); }
.chip-active { color: var(--info); }
.chip-waiting { color: var(--warn); }
.chip-blocked { color: var(--bad); }
.chip-done { color: var(--ok); }
.lbl { font-size: .7rem; letter-spacing: .03em; padding: 0 .45rem; }
.lbl-src { color: var(--c1); }
.lbl-calc { color: var(--c3); }
.lbl-sim { color: var(--link-visited); }
.lbl-meas { color: var(--accent-2); }
.lbl-assume { color: var(--warn); }
.st-pass { color: var(--ok); }
.st-partial { color: var(--warn); }
.st-fail { color: var(--bad); }
.st-blocked { color: var(--bad); border-style: dashed; }
.st-notrun { color: var(--muted); border-style: dashed; }
.req { font-weight: 700; }
.req-met, .req-spelnione, .req-pass { color: var(--ok); }
.req-partly, .req-partial, .req-czesciowo { color: var(--warn); }
.req-not-met, .req-niespelnione, .req-fail { color: var(--bad); }
.req-not-addressed, .req-pominiete { color: var(--muted); }

/* ---------- stages timeline ---------- */
.stages, .timeline { list-style: none; padding: 0; margin: 0 0 1rem; position: relative; }
.stages::before, .timeline::before {
  content: ""; position: absolute; left: 1.05rem; top: .6rem; bottom: .6rem; width: 2px; background: var(--border);
}
.stage, .timeline > li { position: relative; display: grid; grid-template-columns: 2.2rem 1fr; gap: .8rem; margin: 0 0 .9rem; }
.stage-n, .tl-dot {
  position: relative; z-index: 1; display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--bg-card); border: 2px solid var(--border); font-weight: 800; color: var(--muted);
}
.tl-dot { width: 1.1rem; height: 1.1rem; margin: .45rem 0 0 .55rem; }
.stage-active .stage-n { border-color: var(--info); color: var(--info); }
.stage-done .stage-n { background: var(--ok); border-color: var(--ok); color: var(--bg); }
.stage-waiting .stage-n { border-color: var(--warn); color: var(--warn); }
.stage-blocked .stage-n { border-color: var(--bad); color: var(--bad); }
.stage-body h3, .tl-body h3 { margin: .25rem 0 .2rem; font-size: 1.05rem; }
.stage-body p, .tl-body p { margin: 0 0 .35rem; }
.stage-note { color: var(--muted); font-size: .95rem; }

/* ---------- reports ---------- */
.report-list { list-style: none; padding: 0; }
.report-list > li { border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem 1rem .2rem; margin: 0 0 .7rem; background: var(--bg-card); }
.report-link { display: flex; flex-direction: column; padding: .2rem 0 .3rem; text-decoration: none; }
.report-date { color: var(--muted); font-size: .88rem; }
.report-title { font-weight: 700; font-size: 1.08rem; text-decoration: underline; text-underline-offset: .18em; }
.report-list p { margin: 0 0 .5rem; color: var(--muted); }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; margin: 2rem 0 0; }
.pager a { display: inline-flex; align-items: center; min-height: 44px; }
.dead-link { text-decoration: underline dotted; }

/* ---------- details ---------- */
details { border: 1px solid var(--border); border-radius: var(--radius); padding: 0 .9rem; background: var(--bg-card); }
details > summary { cursor: pointer; padding: .7rem 0; min-height: 44px; font-weight: 600; }
details[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: .7rem; }
details > :last-child { margin-bottom: .8rem; }
.stage-body details { padding: 0 .7rem; }
.stage-body details > summary { font-weight: 500; color: var(--muted); padding: .5rem 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; overflow-wrap: normal; }
th, td { text-align: left; vertical-align: top; padding: .5rem .65rem; border-bottom: 1px solid var(--border); }
thead th { background: var(--bg-soft); font-weight: 700; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
td a { display: inline-block; padding: .3rem 0; }
a.run-id code { white-space: normal; background: none; padding: 0; font-size: .86em; display: inline-block; min-width: 11.5rem; }
a.more { display: inline-flex; align-items: center; min-height: 44px; }
table.num-right td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
table.runs td, table.ranking td { white-space: nowrap; }
table.ranking td:nth-child(2), table.ranking td:last-child { white-space: normal; min-width: 12rem; }
table.reqs td:nth-child(3) { min-width: 14rem; }
caption { text-align: left; padding: .5rem .65rem; color: var(--muted); }

/* ---------- requirement cards ---------- */
.req-cat { margin-top: 1.4rem; }
.req-list { display: grid; gap: .6rem; margin: 0 0 1rem; }
.req-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .9rem .3rem; }
.req-card h4 { margin: .1rem 0 .3rem; font-size: 1rem; }
.req-card p { margin: 0 0 .5rem; }
.req-head { display: flex; justify-content: space-between; gap: .5rem; color: var(--muted); font-size: .88rem; }
.req-weight { white-space: nowrap; }
dl.req-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .3rem .8rem; margin: 0 0 .6rem; }
dl.req-facts dt { color: var(--muted); font-size: .8rem; }
dl.req-facts dd { margin: 0; font-weight: 600; }
dl.req-facts div.wide { grid-column: 1 / -1; order: 9; }
dl.req-facts div.wide dd { font-weight: 400; }
.req-card details { margin: 0 0 .5rem; padding: 0 .7rem; }
.req-card details > summary { font-weight: 500; color: var(--muted); padding: .45rem 0; }

/* ---------- code, prompts, diffs ---------- */
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: .9em; background: var(--code-bg); padding: .05em .3em; border-radius: 4px; }
pre { background: var(--code-bg); border-radius: 8px; padding: .8rem; overflow-x: auto; font-size: .86rem; line-height: 1.45; }
pre code { background: none; padding: 0; }
pre.prompt-text, pre.diff { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
pre.diff span { display: block; padding: 0 .3rem; border-radius: 3px; }
.d-add { background: var(--add-bg); color: var(--add-fg); }
.d-del { background: var(--del-bg); color: var(--del-fg); }
.d-hunk { color: var(--muted); text-align: center; }
.d-add-n { color: var(--ok); font-weight: 700; }
.d-del-n { color: var(--bad); font-weight: 700; }
.mono-title code { font-size: .8em; background: none; padding: 0; white-space: normal; word-break: break-all; }

/* ---------- charts ---------- */
.chart-fig { margin: 0 0 1.2rem; }
.chart-fig figcaption { color: var(--muted); font-size: .92rem; margin: 0 0 .3rem; }
svg.chart { display: block; width: 100%; max-width: 40rem; height: auto; font-family: inherit; overflow: visible; }
svg.chart .grid { stroke: var(--border); stroke-width: 1; }
svg.chart .axis { stroke: var(--muted); stroke-width: 1.2; }
svg.chart .tick { fill: var(--muted); font-size: 10.5px; }
svg.chart .axis-label { fill: var(--muted); font-size: 10px; }
svg.chart .val { fill: var(--fg); font-size: 9.5px; font-weight: 600; }
svg.chart .line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .line.s1, svg.chart .pt.s1 { stroke: var(--c1); }
svg.chart .line.s2, svg.chart .pt.s2 { stroke: var(--c2); }
svg.chart .pt { stroke-width: 2; fill: var(--bg); }
svg.chart .bar.s1 { fill: var(--c1); }
svg.chart .bar.s3 { fill: var(--c3); }
svg.chart .bar.s4 { fill: var(--c4); }
svg.chart .band { fill: var(--band); stroke: none; }
svg.chart .edge { stroke: var(--c2); stroke-width: 1.4; opacity: .8; }
svg.chart .node { fill: var(--c1); stroke: var(--bg); stroke-width: 1.5; }
svg.chart .node.seed { fill: var(--c4); }
svg.chart .node.scratch { fill: var(--c3); }
svg.chart .node-label { fill: var(--fg); font-size: 9.5px; font-weight: 600; }
svg.chart a:focus .node { stroke: var(--fg); stroke-width: 3; }
.legend { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .9rem; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.legend .key { display: inline-block; width: 1.4rem; height: .55rem; border-radius: 3px; background: var(--c1); }
.legend .key.s2 { background: var(--c2); }
.legend .key.band { background: var(--band); outline: 1px solid var(--border); }
.legend .key.node { width: .8rem; height: .8rem; border-radius: 50%; background: var(--c1); }
.legend .key.node.seed { background: var(--c4); }
.legend .key.node.scratch { background: var(--c3); }
.legend .key.edge { height: 2px; background: var(--c2); }

/* ---------- family tree list ---------- */
.tree ul { list-style: none; margin: 0; padding-left: .9rem; border-left: 2px solid var(--border); }
.tree > ul { border-left: 0; padding-left: 0; }
.tree li { margin: .35rem 0; padding-left: .4rem; }
.tree li li { padding-left: .5rem; }
.tree ul ul ul ul ul ul { padding-left: .3rem; }

/* ---------- 3D and media ---------- */
.model-box { margin: 0 0 1rem; }
model-viewer {
  display: block; width: 100%; height: min(70vh, 26rem); border-radius: var(--radius);
  background: radial-gradient(circle at 50% 40%, var(--bg-card), var(--bg-soft)); border: 1px solid var(--border);
  --poster-color: transparent;
}
.model-hint { color: var(--muted); font-size: .88rem; margin: .3rem 0 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .6rem; margin: 0 0 1rem; }
.gallery figure { margin: 0; }
.gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-soft); }
.gallery figcaption { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.files li { margin: .3rem 0; }
.files a { display: inline-block; padding: .35rem 0; }
.link-list { list-style: none; padding: 0; }
.link-list > li { border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem 1rem; margin: 0 0 .6rem; background: var(--bg-card); }
.link-list > li > a { display: inline-block; padding: .3rem 0; font-weight: 700; }
.link-list p { margin: 0 0 .4rem; color: var(--muted); }

.run-report h3, .run-report h4 { margin-top: 1.2em; }
.charts h2 { margin-bottom: .8rem; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
