/* Encyklopedia Manipulacji online — ciemny, prosty motyw w barwach freeyourselfpoland.pl
   Kontrast (WCAG AA): tekst 15:1, tekst drugorzędny 6.6:1, linki 6.5:1, przyciski 4.8:1 */
:root {
  color-scheme: dark;
  --bg: #161616;
  --surface: #1e1e21;
  --surface-2: #26262a;
  --surface-3: #2f2f34;
  --text: #ececec;
  --muted: #a3a3ab;
  --accent: #e8542f;          /* pomarańcz marki — paski, obramowania, aktywne stany */
  --accent-text: #ff7a52;     /* pomarańcz do tekstu i linków na ciemnym tle */
  --accent-btn: #c9461f;      /* tło przycisków (biały tekst 4.8:1) */
  --accent-btn-h: #b23c18;
  --accent-soft: rgba(232, 84, 47, .14);
  --accent-line: rgba(232, 84, 47, .45);
  --hl: rgba(233, 196, 106, .22);
  --hl-active: #e9c46a;
  --border: #2e2e33;
  --border-strong: #3d3d44;
  --radius: 12px;
  --read: 42rem;
  --side: 15.5rem;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.wrap { max-width: 52rem; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 32px; padding-bottom: 48px; min-height: 70vh; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.05rem; margin-bottom: 20px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent-btn); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Szkielet: stały sidebar (desktop) / pasek u góry (telefon) ---------- */
.sidebar { background: #101011; border-right: 1px solid var(--border); }
.logo { display: block; font-weight: 800; letter-spacing: .06em; font-size: .95rem; color: var(--text); line-height: 1.2; }
.logo:hover { text-decoration: none; }
.logo span { color: var(--accent); }
.logo small { display: block; font-weight: 500; letter-spacing: .02em; color: var(--muted); font-size: .75rem; margin-top: 2px; }
.side-nav a { display: block; color: var(--muted); font-weight: 600; font-size: .93rem; border-radius: 8px; }
.side-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.side-nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }


@media (min-width: 900px) {
  .has-nav .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side); padding: 24px 14px; overflow-y: auto; }
  .has-nav .page { margin-left: var(--side); }
  .sidebar .logo { padding: 0 10px 22px; }
  .side-nav { display: grid; gap: 2px; }
  .side-nav a { padding: 9px 12px; }
}
@media (max-width: 899.98px) {
  .sidebar { position: sticky; top: 0; z-index: 20; padding: 10px 0 0; padding-top: max(10px, env(safe-area-inset-top)); }
  .sidebar .logo { padding: 0 16px 8px; }
  /* Menu przewijane w poziomie — zawsze widoczne, jedno dotknięcie do każdej funkcji */
  .side-nav { display: flex; gap: 6px; overflow-x: auto; padding: 4px 16px 10px; scrollbar-width: none; scroll-padding: 0 16px; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav a { flex: 0 0 auto; padding: 7px 13px; border: 1px solid var(--border); border-radius: 999px; font-size: .88rem; white-space: nowrap; }
  .side-nav a[aria-current="page"] { box-shadow: none; border-color: var(--accent); }
}
.no-nav .sidebar { border-right: 0; border-bottom: 1px solid var(--border); padding: 14px 0; }
.no-nav .sidebar .logo { max-width: 52rem; margin: 0 auto; padding: 0 16px; }
.site-footer { color: var(--muted); font-size: .85rem; padding-top: 24px; padding-bottom: 32px; border-top: 1px solid var(--border); }
.site-footer a { color: var(--muted); text-decoration: underline; }

/* ---------- Elementy ---------- */
h1 { font-size: clamp(1.6rem, 4.5vw, 2.1rem); line-height: 1.2; font-weight: 800; letter-spacing: -.01em; margin-bottom: 12px; }
.page-title { margin-bottom: 8px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.card p + p, .card p + form, .card form + p { margin-top: 14px; }
.narrow { max-width: 30rem; margin: 24px auto; }
.stack { display: grid; gap: 14px; margin-top: 16px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
input, textarea, select {
  font: inherit; font-weight: 400; color: var(--text); background: var(--bg);
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 12px; width: 100%;
}
input::placeholder, textarea::placeholder { color: #7d7d85; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.8); }
.btn {
  display: inline-block; background: var(--accent-btn); color: #fff; font: inherit; font-weight: 700;
  padding: 11px 22px; border-radius: 999px; border: 0; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--accent-btn-h); text-decoration: none; color: #fff; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-lg { padding: 14px 30px; font-size: 1.05rem; width: 100%; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.link { background: none; border: 0; font: inherit; color: var(--accent-text); cursor: pointer; padding: 0; }
.link:hover { text-decoration: underline; }
form.inline { display: inline; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.row form { display: contents; }
.alert { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 6px; overflow-wrap: anywhere; }
.count { display: inline-block; font-size: .75rem; font-weight: 700; color: var(--muted); background: var(--surface-3); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }

/* Paywall / konto */
.eyebrow { color: var(--accent-text); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; margin-bottom: 6px; }
.checks { list-style: none; margin: 18px 0 22px; display: grid; gap: 8px; }
.checks li { padding-left: 26px; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-text); font-weight: 800; }
.paywall form { margin-bottom: 14px; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin-top: 12px; }
.details dt { color: var(--muted); }
.details dd { overflow-wrap: anywhere; }

/* ---------- Spis treści ---------- */
.cat-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 28px; }
.cat-jump a { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 14px; font-weight: 600; color: var(--text); font-size: .9rem; }
.cat-jump a:hover { border-color: var(--accent); text-decoration: none; }
.toc-cat { margin-bottom: 36px; scroll-margin-top: 120px; }
.toc-cat h2 { font-size: 1.3rem; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid var(--border-strong); }
.cat-intro { margin: 0 0 12px; }
.cat-intro summary { cursor: pointer; color: var(--muted); font-size: .92rem; }
.cat-intro .prose { margin-top: 8px; font-size: 1rem; }
.toc-list { list-style: none; }
.toc-list a { display: flex; gap: 12px; align-items: baseline; padding: 10px 6px; border-bottom: 1px solid var(--border); color: var(--text); }
.toc-list a:hover { background: var(--surface); text-decoration: none; }
.toc-list a:hover .t { color: var(--accent-text); }
.toc-list .num { flex: 0 0 2.2rem; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.toc-list .t { flex: 1; }
.badge { background: var(--accent-btn); color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 1px 8px; }

/* ---------- Rozdział ---------- */
.chapter { max-width: var(--read); margin: 0 auto; }
.crumbs { color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.prose { font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-size: 1.12rem; line-height: 1.75; color: #e2e2e2; }
.prose p { margin: 0 0 1em; }
.prose h2 { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 1.35rem; margin: 1.8em 0 .6em; line-height: 1.3; color: var(--text); }
.prose h3 { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 1.08rem; margin: 1.8em 0 .5em; line-height: 1.35; color: var(--text); }
.prose strong { font-weight: 700; color: var(--text); }
#chapter-content { margin-top: 24px; }
#chapter-content ::selection { background: rgba(232, 84, 47, .4); color: #fff; }
mark.hl { background: var(--hl); color: inherit; border-radius: 2px; cursor: pointer; box-shadow: 0 2px 0 var(--hl-active); scroll-margin: 120px; }
mark.hl mark.hl { background: rgba(233, 196, 106, .4); }
.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0%, 30% { background: var(--accent); color: #fff; } 100% { } }

.pager { max-width: var(--read); margin: 40px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pager a { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; color: var(--text); font-weight: 600; line-height: 1.35; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager small { display: block; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }

/* ---------- Tagi ---------- */
.chapter-tags { max-width: var(--read); margin: 40px auto 0; padding-top: 24px; border-top: 1px solid var(--border-strong); }
.chapter-tags h2, .tag-group h2 { font-size: 1.2rem; margin-bottom: 12px; }
.tag-list { list-style: none; display: grid; gap: 10px; }
.tag-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; scroll-margin-top: 120px; }
.tag-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .88rem; }
.tag-head time { color: var(--muted); }
.tag-head .del { margin-left: auto; font-size: .85rem; color: var(--muted); }
.tag-head .del:hover, .tag-head .del.confirm { color: var(--accent-text); }
.tag-head .src { font-weight: 600; color: var(--text); flex: 1 1 16rem; }
.chip { display: inline-block; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; border-radius: 999px; padding: 3px 11px; font-size: .88rem; border: 1px solid transparent; }
.chip:hover { text-decoration: none; border-color: var(--accent-line); }
.chip.on { background: var(--accent-btn); color: #fff; }
.chip .count { background: rgba(0, 0, 0, .25); color: inherit; }
.tag-item blockquote { margin-top: 8px; padding-left: 12px; border-left: 3px solid var(--hl-active); font-family: Georgia, serif; overflow-wrap: anywhere; }
.tag-item blockquote a { color: var(--text); }
.tag-item blockquote a:hover { color: var(--accent-text); }
.tag-item .note { margin-top: 8px; white-space: pre-wrap; font-size: .95rem; overflow-wrap: anywhere; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tag-group { margin-bottom: 32px; }

/* Przycisk „Dodaj tag” przy zaznaczeniu */
.tag-btn {
  position: absolute; z-index: 30; background: var(--accent-btn); color: #fff; border: 0; border-radius: 999px;
  padding: 8px 16px; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; box-shadow: 0 4px 16px rgba(0, 0, 0, .5);
}
.tag-btn:hover { background: var(--accent-btn-h); }
.tag-btn[hidden] { display: none; }
@media (pointer: coarse) {
  /* Na telefonie: przycisk przyklejony do dołu, żeby nie kolidował z systemowym menu zaznaczenia */
  .tag-btn { position: fixed; left: 16px !important; right: 16px; top: auto !important; bottom: calc(16px + env(safe-area-inset-bottom)); padding: 14px; font-size: 1rem; }
}

.tag-dialog { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 24px; width: min(32rem, calc(100vw - 32px)); margin: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); color: var(--text); background: var(--surface); }
.tag-dialog::backdrop { background: rgba(0, 0, 0, .65); }
.tag-dialog h3 { font-size: 1.15rem; }
.tag-dialog .stack { margin-top: 0; }
.tag-dialog blockquote { max-height: 8rem; overflow: auto; padding-left: 12px; border-left: 3px solid var(--hl-active); font-family: Georgia, serif; color: var(--muted); }
.tag-dialog .row { margin-top: 4px; }
.tag-dialog label .small { font-weight: 400; }


/* ---------- Narzędzia z arkusza pracy ---------- */
:root { --yes: var(--accent); --partly: var(--hl-active); --no: #6e6e76; --dim: var(--surface-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.btn-sm { padding: 7px 14px; font-size: .88rem; }
select { padding: 9px 10px; }
fieldset { border: 0; min-width: 0; }
legend { font-weight: 600; font-size: .95rem; margin-bottom: 6px; padding: 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 14px; }

/* Karty pulpitu */
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; }
.dash-card > header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.dash-card h2 { font-size: 1.15rem; }
.dash-card > header a { font-size: .9rem; font-weight: 600; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0 18px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-bottom: 10px; }
.stat strong { display: block; font-size: 1.9rem; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat.yes strong { color: var(--accent-text); }
.stat.partly strong { color: var(--hl-active); }
.stat.dim strong { color: var(--muted); }
svg.bar { display: block; width: 100%; height: 10px; border-radius: 999px; background: var(--dim); margin-bottom: 8px; overflow: hidden; }
svg.bar .yes { fill: var(--yes); }
svg.bar .partly { fill: var(--partly); }
svg.bar .no { fill: var(--no); }

.dash-tests { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 16px 24px; }
.dash-tests li { border-top: 1px solid var(--border); padding-top: 12px; }
.dash-test-name { font-weight: 700; color: var(--text); line-height: 1.35; display: block; }
.score { display: flex; align-items: baseline; gap: 4px; margin-top: 6px; }
.score strong { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.score time { margin-left: auto; }
.score.big strong { font-size: 2.6rem; }
.band-text { margin-top: 4px; }
.history-line { margin-top: 4px; }

/* Dzisiejsza aktywność */
.today { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--no); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 16px; }
.today.on { border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), var(--surface) 60%); }
.today h2 { font-size: 1.12rem; margin-bottom: 2px; }
.today .row { margin-top: 12px; }
.today-icon { flex: 0 0 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--dim); color: var(--muted); }
.today.on .today-icon { background: var(--accent-btn); color: #fff; }

/* Testy */
.test-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 0 18px; }
.test-list h2 a { color: var(--text); }
.test-list .row { margin-top: 12px; }
.questions { list-style: none; display: grid; gap: 12px; margin: 12px 0 0; }
.questions li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.questions legend { font-weight: 500; font-size: 1rem; line-height: 1.5; margin-bottom: 10px; }
.qnum { font-weight: 800; color: var(--muted); }
.points, .seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg legend { width: 100%; }
.points label, .seg label { position: relative; display: block; font-weight: 600; font-size: .9rem; cursor: pointer; }
.points input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.points span, .seg span { display: inline-block; border: 1px solid var(--border-strong); border-radius: 999px; padding: 7px 15px; background: var(--bg); color: var(--text); user-select: none; }
.points b { font-variant-numeric: tabular-nums; }
.points label:hover span, .seg label:hover span { border-color: var(--accent); }
.points input:checked + span, .seg input:checked + span { background: var(--text); border-color: var(--text); color: #161616; }
.seg .yes input:checked + span { background: var(--accent-btn); border-color: var(--accent-btn); color: #fff; }
.seg .partly input:checked + span { background: var(--partly); border-color: var(--partly); color: #161616; }
.seg .no input:checked + span { background: #4a4a52; border-color: #4a4a52; color: var(--text); }
.seg .dim input:checked + span { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }
.points input:focus-visible + span, .seg input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.test-total { position: sticky; bottom: 0; z-index: 10; background: var(--surface-2); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius) var(--radius) 0 0; padding: 14px 18px; padding-bottom: max(14px, env(safe-area-inset-bottom)); margin-top: 16px; box-shadow: 0 -8px 24px rgba(0, 0, 0, .4); }
.test-total #test-sum { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.test-total .btn { margin-top: 10px; }
.test-total #test-band:empty { display: none; }
.bands, .history, .journal { margin-top: 32px; }
.bands h2, .history h2, .journal h2, .plan-step h2, .checklist-panel h2 { font-size: 1.2rem; margin-bottom: 10px; }
.bands ul { list-style: none; display: grid; gap: 8px; }
.bands li { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-size: .95rem; }
.bands li.on { border-color: var(--accent); background: var(--accent-soft); }
.result-card { background: var(--surface); border: 1px solid var(--accent-line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 20px; scroll-margin-top: 120px; }

/* Tabele (na telefonie zamieniają się w karty) */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.table tr:last-child td { border-bottom: 0; }
.table .num { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.table .hl-row td { background: var(--accent-soft); }
.journal-table .what { min-width: 16rem; white-space: pre-wrap; }
.table .actions { white-space: nowrap; }
.table .actions form { margin-left: 10px; }
.del { color: var(--muted); }
.del.confirm, .del:hover { color: var(--accent-text); }
.pill { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.pill.yes { background: var(--accent-btn); color: #fff; }
.pill.partly { background: var(--partly); color: #161616; }
.pill.no { background: #3a3a41; color: var(--text); }
.pill.dim { background: transparent; border: 1px solid var(--border-strong); color: var(--muted); font-weight: 600; }
@media (max-width: 640px) {
  .table-wrap { background: none; border: 0; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px; margin-bottom: 10px; }
  .table td { border: 0; padding: 4px 0; display: grid; grid-template-columns: 7.5rem 1fr; gap: 8px; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; }
  .table td:not([data-label]) { display: block; }
  .table td:not([data-label])::before { content: none; }
  .journal-table .what { min-width: 0; }
  .table td > .pill { justify-self: start; }
  .table .actions form { margin-left: 16px; }
}

/* Checklista: zwijane sekcje (Związki / Praca / Rodzina / Znajomi) */
.cl-sections { display: grid; gap: 12px; }
.cl-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.cl-section > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 16px 18px; border-radius: var(--radius); }
.cl-section > summary::-webkit-details-marker { display: none; }
.cl-section > summary::before { content: ""; width: .55rem; height: .55rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
.cl-section[open] > summary::before { transform: rotate(45deg); }
.cl-section > summary:hover { background: var(--surface-2); }
.cl-section h2 { font-size: 1.12rem; }
.cl-meta { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.cl-list { list-style: none; border-top: 1px solid var(--border); }
.cl-list li { border-bottom: 1px solid var(--border); }
.cl-list li:last-child { border-bottom: 0; }
.cl-list a { display: grid; grid-template-columns: 2.2rem 1fr auto; gap: 4px 12px; align-items: baseline; padding: 11px 18px; color: var(--text); }
.cl-list a:hover { background: var(--surface-2); text-decoration: none; }
.cl-list a:hover .t { color: var(--accent-text); }
.cl-list .num { color: var(--muted); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.cl-list .extra { grid-column: 2 / -1; color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
@media (max-width: 560px) { .cl-list a { padding: 11px 14px; grid-template-columns: 1.8rem 1fr auto; } }

/* Panel checklisty pod rozdziałem */
.checklist-panel { max-width: var(--read); margin: 40px auto 0; padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); scroll-margin-top: 120px; }
.checklist-panel .stack { margin-top: 12px; }
.save-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.save-status { font-size: .88rem; font-weight: 600; color: var(--muted); transition: opacity .6s; }
.save-status.error { color: var(--accent-text); }
.save-status.fade { opacity: 0; }

/* Plan wyjścia */
.plan-step { margin-bottom: 32px; scroll-margin-top: 120px; }
.plan-step h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border-strong); }
.plan-step h2 .eyebrow { width: 100%; margin: 0; }
.plan-step h2 .count { margin-left: auto; }
.plan-actions { list-style: none; display: grid; gap: 10px; margin-top: 12px; }
.plan-action { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--dim); border-radius: var(--radius); padding: 12px 16px; }
.plan-action[data-status="W trakcie"] { border-left-color: var(--partly); }
.plan-action[data-status="Zrobione"] { border-left-color: var(--accent); }
.plan-action[data-status="Zrobione"] .plan-text { color: var(--muted); }
.plan-action[data-status="Nie dotyczy"] { border-left-color: var(--no); opacity: .7; }
.plan-text { font-size: .97rem; }
.plan-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; }
.plan-form label { display: block; }
.plan-form .grow { flex: 1 1 12rem; }
.plan-form input, .plan-form select { padding: 7px 10px; font-size: .92rem; }
.plan-form input[type=date] { width: auto; }
.plan-action[data-status="Zrobione"] select { border-color: var(--accent); color: var(--accent-text); font-weight: 700; }
.plan-action[data-status="W trakcie"] select { border-color: var(--partly); font-weight: 600; }

/* Twoja diagnoza */
.disclaimer { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--hl-active); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; font-size: .93rem; color: #d4d4d8; }
.diag-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; }
.diag-card h2 { font-size: 1.2rem; margin-bottom: 10px; }
.diag-summary p { margin-bottom: .9em; font-size: 1.04rem; line-height: 1.75; }
.diag-summary p:last-child { margin-bottom: 0; }
.diag-steps { list-style: none; counter-reset: step; display: grid; gap: 12px; }
.diag-steps li { counter-increment: step; position: relative; padding: 14px 16px 14px 58px; background: var(--surface-2); border-radius: 10px; }
.diag-steps li::before { content: counter(step); position: absolute; left: 16px; top: 14px; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; }
.diag-steps h3 { font-size: 1.02rem; line-height: 1.4; margin-bottom: 4px; }
.diag-steps p { color: #d4d4d8; font-size: .96rem; }
.diag-steps .plan-link { display: inline-block; margin-top: 6px; font-size: .88rem; font-weight: 600; }
.diag-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.diag-sources { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.busy-note { display: none; }
form.busy .busy-note { display: inline; }

/* Konfetti i komunikat po zapisie — stonowane, w barwach motywu */
.confetti-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 61; transform: translate(-50%, 16px);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  max-width: calc(100vw - 32px); font-size: .93rem; line-height: 1.4;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast strong { display: block; color: var(--text); font-size: 1rem; }
.toast span { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .toast, .cl-section > summary::before { transition: none; } }
.cl-empty { padding: 12px 18px; border-top: 1px solid var(--border); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; margin-top: .25rem; accent-color: var(--accent-btn); }

/* Konto: dane i strefa nieodwracalnych działań */
.card.narrow + .card.narrow { margin-top: 18px; }
.card h2 { font-size: 1.2rem; margin-bottom: 6px; }
.small-form { margin-top: 12px; font-size: .9rem; }
.alert.ok { background: rgba(233, 196, 106, .12); border-left-color: var(--hl-active); }
.danger-zone { margin-top: 16px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px 16px; }
.danger-zone summary { cursor: pointer; font-weight: 600; color: var(--accent-text); }
.danger-zone .stack { margin-top: 12px; }
.btn-danger { background: #8f2a14; }
.btn-danger:hover { background: #75220f; }

/* Dokumenty prawne */
.legal { max-width: var(--read); margin: 0 auto; }
.legal h2 { font-size: 1.2rem; margin: 28px 0 8px; }
.legal p, .legal li { margin-bottom: 8px; }
.legal ol, .legal ul { padding-left: 1.4rem; }
.legal .table { margin: 8px 0 16px; background: var(--surface); }
mark.todo { background: rgba(233, 196, 106, .18); color: var(--hl-active); border-radius: 4px; padding: 0 4px; font-weight: 600; }
.consent .checks { margin: 14px 0 18px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 6px; }

/* Szybkie wyjście i pilna pomoc — zawsze widoczne, dyskretne */
.brand-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.quick-exit { flex: 0 0 auto; font-size: .78rem; font-weight: 700; color: var(--text); border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 11px; white-space: nowrap; }
.quick-exit:hover { background: var(--surface-2); text-decoration: none; }
.help-link { display: block; font-size: .85rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.help-link:hover, .help-link[aria-current="page"] { color: var(--hl-active); }
@media (min-width: 900px) {
  .has-nav .brand-row { flex-direction: column; padding: 0 10px 18px; }
  .has-nav .brand-row .logo { padding: 0; }
  .has-nav .help-link { margin: 18px 12px 0; }
}
@media (max-width: 899.98px) {
  .brand-row { padding: 0 16px 8px; align-items: center; }
  .brand-row .logo { padding: 0; }
  .help-link { padding: 0 16px 10px; font-size: .8rem; }
}
.no-nav .brand-row { max-width: 52rem; margin: 0 auto; padding: 0 16px; align-items: center; }
.no-nav .brand-row .logo { padding: 0; margin: 0; }
.no-nav .help-link { max-width: 52rem; margin: 6px auto 0; padding: 0 16px; }

.helplines { list-style: none; display: grid; gap: 10px; margin: 16px 0 24px; }
.helplines li { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.helplines .tel { flex: 0 0 8.5rem; font-size: 1.25rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.helplines .tel:hover { color: var(--accent-text); }
.helplines.compact li { padding: 10px 14px; background: var(--surface-2); }
.helplines.compact .tel { font-size: 1.1rem; flex-basis: 7.5rem; }
@media (max-width: 560px) { .helplines li { flex-direction: column; gap: 4px; } .helplines .tel { flex-basis: auto; } }
.safety-tips ul { padding-left: 1.2rem; display: grid; gap: 6px; margin-top: 8px; }
.crisis { background: rgba(233, 196, 106, .1); border: 1px solid rgba(233, 196, 106, .5); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; }
.crisis h2 { font-size: 1.15rem; margin-bottom: 6px; color: var(--hl-active); }
.crisis .helplines { margin: 12px 0 8px; }
.safety-note { border-left: 4px solid var(--hl-active); background: var(--surface); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; font-size: .95rem; }

/* Wprowadzenie */
.onboarding { list-style: none; counter-reset: ob; display: grid; gap: 12px; margin: 8px 0 20px; }
.onboarding li { counter-increment: ob; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px 18px 66px; }
.onboarding li::before { content: counter(ob); position: absolute; left: 20px; top: 18px; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; }
.onboarding h2 { font-size: 1.08rem; margin-bottom: 4px; }

/* Telefon: cień na krawędzi paska menu sygnalizuje, że da się przewinąć */
@media (max-width: 899.98px) {
  .side-nav { mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .side-nav.at-end { mask-image: none; -webkit-mask-image: none; }
}
