/* MaddLabs: legal pages. Tokens copied from web/static/app.css (monochrome). */

:root {
  --bg: #fafafa;
  --bg-2: #f3f3f4;
  --surface: #ffffff;
  --surface-2: #f6f6f7;
  --line: rgba(10, 10, 12, 0.08);
  --line-2: rgba(10, 10, 12, 0.15);
  --text: #0c0c0e;
  --muted: #55555c;
  --faint: #6f6f78;
  --inv: #111113;
  --inv-text: #f7f7f8;
  --r-card: 14px;
  --r-input: 10px;
  --r-pill: 999px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --nav-h: 64px;
  --max: 1200px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) and (max-width: 0px) {
  :root:not([data-theme="light"]) {
    --bg: #09090b;
    --bg-2: #0e0e11;
    --surface: #111114;
    --surface-2: #17171b;
    --line: rgba(255, 255, 255, 0.08);
    --line-2: rgba(255, 255, 255, 0.16);
    --text: #f4f4f5;
    --muted: #a6a6ae;
    --faint: #8a8a93;
    --inv: #f4f4f5;
    --inv-text: #0c0c0e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090b;
  --bg-2: #0e0e11;
  --surface: #111114;
  --surface-2: #17171b;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f4f4f5;
  --muted: #a6a6ae;
  --faint: #8a8a93;
  --inv: #f4f4f5;
  --inv-text: #0c0c0e;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 24px); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.65; font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; }
code, kbd, .mono { font-family: var(--mono); font-size: .92em; }
::selection { background: var(--text); color: var(--bg); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

.skip { position: absolute; left: -9999px; top: 8px; }
.skip:focus { left: 16px; z-index: 100; background: var(--inv); color: var(--inv-text); padding: 8px 14px; border-radius: var(--r-pill); }

/* top bar */
.top {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; }
.brand-wm { display: inline-flex; align-items: center; font-family: var(--mono); font-weight: 600; font-size: 17px; letter-spacing: -0.02em; line-height: 1; }
.brand-m { display: inline-grid; place-items: center; height: 1.45em; padding: 0 .28em; margin: 0 .12em; border-radius: 6px; background: var(--inv); color: var(--inv-text); font-weight: 700; }
.top-links { display: flex; gap: 4px; }
.top-links a { padding: 6px 12px; border-radius: var(--r-pill); color: var(--muted); font-size: 14px; text-decoration: none; transition: color .2s, background .2s; }
.top-links a:hover { color: var(--text); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lang { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-pill); }
.lang a { padding: 3px 10px; border-radius: var(--r-pill); font-family: var(--mono); font-size: 12px; color: var(--muted); text-decoration: none; }
.lang a[aria-current="true"] { background: var(--inv); color: var(--inv-text); }
@media (max-width: 720px) { .top-links { display: none; } }

/* layout */
.layout { padding: 48px 0 80px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 960px) {
  .layout { grid-template-columns: 232px minmax(0, 1fr); gap: 72px; padding-top: 64px; }
  .layout.no-toc { grid-template-columns: minmax(0, 1fr); }
}

/* table of contents */
.toc-side { display: none; }
@media (min-width: 960px) {
  .toc-side { display: block; position: sticky; top: calc(var(--nav-h) + 32px); align-self: start; max-height: calc(100vh - var(--nav-h) - 64px); overflow-y: auto; }
  .toc-m { display: none; }
}
.toc-title { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px; }
.toc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc-list a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 8px; font-size: 13.5px; line-height: 1.4; color: var(--muted); text-decoration: none; }
.toc-list a:hover { color: var(--text); background: var(--surface-2); }
.toc-m { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.toc-m summary { cursor: pointer; padding: 12px 16px; font-size: 14px; font-weight: 500; list-style: none; display: flex; justify-content: space-between; }
.toc-m summary::-webkit-details-marker { display: none; }
.toc-m summary::after { content: "+"; font-family: var(--mono); color: var(--faint); }
.toc-m[open] summary::after { content: "\2212"; }
.toc-m .toc-list { padding: 0 16px 14px 26px; }

/* document */
.doc { max-width: 72ch; min-width: 0; counter-reset: sec; }
.doc-head { margin-bottom: 40px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 0 0 14px; }
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { color: var(--text); }
.doc h1 { font-size: clamp(30px, 4.4vw, 44px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 600; margin: 0 0 16px; text-wrap: balance; }
.doc .doc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.doc-meta li { font-family: var(--mono); font-size: 12px; padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--muted); }
.note { margin: 20px 0 0; padding: 14px 16px; border-radius: var(--r-input); background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.note a { color: var(--text); }
.lead { font-size: 16.5px; color: var(--muted); margin: 0 0 8px; }

.doc h2 { font-size: 20px; line-height: 1.3; letter-spacing: -0.015em; font-weight: 600; margin: 48px 0 14px; padding-top: 8px; }
.doc h2:not(.u) { counter-increment: sec; }
.doc h2:not(.u)::before { content: counter(sec) ". "; font-family: var(--mono); font-weight: 500; color: var(--faint); font-size: .85em; margin-right: 4px; }
.doc h3 { font-size: 15.5px; font-weight: 600; margin: 28px 0 8px; }
.doc p, .doc li { color: var(--text); }
.doc p { margin: 0 0 14px; }
.doc ul, .doc ol { padding-left: 22px; margin: 0 0 14px; }
.doc li { margin: 0 0 6px; }
.doc li > ul, .doc li > ol { margin-top: 6px; }
.doc ol.cl { list-style: none; padding: 0; counter-reset: cl; }
.doc ol.cl > li { counter-increment: cl; position: relative; padding-left: 46px; margin-bottom: 12px; }
.doc ol.cl > li::before { content: counter(sec) "." counter(cl) "."; position: absolute; left: 0; top: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.65rem; color: var(--faint); }
.doc ol.al { list-style: lower-alpha; }
.doc a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.doc a:hover { text-decoration-color: currentColor; }
.doc strong { font-weight: 600; }
.doc dl { margin: 0 0 14px; }
.doc dt { font-weight: 600; margin-top: 10px; }
.doc dd { margin: 2px 0 0; color: var(--text); }

.tw { width: 100%; overflow-x: auto; margin: 6px 0 20px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); -webkit-overflow-scrolling: touch; }
.doc table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 13.5px; line-height: 1.5; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 500; font-size: 12px; font-family: var(--mono); letter-spacing: .02em; color: var(--faint); background: var(--surface-2); }
.doc tr:last-child td { border-bottom: 0; }

.box { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); margin: 6px 0 20px; }
.box p:last-child { margin-bottom: 0; }

.changelog { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); }
.changelog h2 { margin-top: 0; font-size: 15px; }
.changelog p, .changelog li { color: var(--muted); font-size: 14px; }

/* index list */
.doc .docs-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.docs-list li { margin: 0; }
.docs-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); text-decoration: none; transition: border-color .2s; }
.docs-list a:hover { border-color: var(--line-2); }
.docs-list .t { font-weight: 600; font-size: 15.5px; }
.docs-list .v { font-family: var(--mono); font-size: 12px; color: var(--faint); align-self: center; }
.docs-list .d { grid-column: 1 / -1; color: var(--muted); font-size: 14px; }
@media (max-width: 520px) { .docs-list a { grid-template-columns: minmax(0, 1fr); } .docs-list .v { align-self: start; } }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--muted); font-size: 13.5px; }
.foot .wrap { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .foot .wrap { grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr); } }
.foot h4 { margin: 0 0 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 500; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 20px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); }
.foot .co { line-height: 1.7; margin: 12px 0 0; }

@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --muted: #222; --faint: #444; --line: #bbb; --line-2: #888; color-scheme: light; }
  body { font-size: 10.5pt; line-height: 1.5; background: #fff; }
  .top, .toc-side, .toc-m, .foot-docs, .skip, .lang { display: none !important; }
  .layout { display: block; padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .doc { max-width: none; }
  .doc h2 { break-after: avoid; page-break-after: avoid; margin-top: 22px; }
  .doc li, .doc p, .doc tr { break-inside: avoid; }
  .tw { overflow: visible; border: 0; }
  .doc table { min-width: 0; }
  .doc a { text-decoration: none; }
  .foot { border: 0; padding: 16px 0 0; }
}

/* ── marka MaddLabs: M jak góry odbite w jeziorze, odbicie rozpływa się (zero retencji) ── */
.brand-wm { display: inline-flex; align-items: center; gap: 9px; line-height: 1; font-family: inherit; }
.brand-mark { width: 24px; height: 24px; flex: none; display: block; }
.brand-name { font-family: "Bricolage Grotesque", var(--font); font-variation-settings: "opsz" 28; font-weight: 700; font-size: 20px; letter-spacing: -0.03em; color: var(--text); transform: translateY(var(--bn-y, 2.75px)); }
.brand-ai { font: 500 10px var(--mono); letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 3px 5px 2px; margin-left: -2px; }

/* bez wersalikowych „nadpisów” (07.11): etykiety zwykłym tekstem */
.eyebrow, .toc-title, .foot h4 { text-transform: none !important; letter-spacing: 0 !important; font-family: inherit !important; font-size: 13px !important; }
