/* Dobrze Śpię: jasny „poranny” motyw (krem + błękit nocy + złoto), tryb nocny pod przełącznikiem.
   Layout: wąska kolumna do czytania + przyklejony spis treści; strona główna z siatką kart. */
:root {
  --bg: #f7f3ec;
  --surface: #fffdf9;
  --surface-2: #f0eadf;
  --ink: #1b2440;
  --muted: #5a6380;
  --night: #1f2a4d;
  --night-ink: #f4efe4;
  --gold: #c9973a;
  --gold-ink: #8a6114;
  --line: #e4dccd;
  --ok: #2f7a55;
  --shadow: 0 1px 2px rgba(27, 36, 64, .06), 0 8px 24px rgba(27, 36, 64, .06);
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --wrap: 1160px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1427;
  --surface: #151d38;
  --surface-2: #1b2547;
  --ink: #ebe6dc;
  --muted: #a3abc6;
  --night: #0a0f1f;
  --night-ink: #ebe6dc;
  --gold: #e2b35d;
  --gold-ink: #e2b35d;
  --line: #27315a;
  --ok: #6cc497;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.7 var(--body); }
img, svg { max-width: 100%; }
a { color: var(--gold-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.2; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(32px, 5vw, 50px); margin: 0 0 12px; }
h2 { font-size: clamp(24px, 3vw, 30px); margin: 44px 0 12px; }
h3 { font-size: 21px; margin: 28px 0 8px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }

/* Pasek postępu czytania */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--gold); z-index: 60; transition: width .1s linear; }

/* Nagłówek */
.site-head { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--display); font-size: 21px; font-weight: 700; }
.logo svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; padding: 8px 12px; border-radius: 999px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.nav a.nav-cta { color: var(--night-ink); background: var(--night); }
.nav a.nav-cta:hover { background: var(--ink); color: var(--bg); }
.theme-btn { flex: none; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .nav { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); display: none; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .menu-btn { display: grid; place-items: center; margin-left: auto; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
  .menu-btn svg { width: 20px; height: 20px; }
}

/* Przyciski */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 600 16px var(--body); padding: 13px 20px; border-radius: 999px; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--gold); color: #1b1407; }
.btn-primary:hover { background: var(--gold-ink); color: #fff; }
:root[data-theme="dark"] .btn-primary:hover { background: #f0c97b; color: #1b1407; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--gold); color: var(--ink); }

/* Hero */
.hero { background: var(--night); color: var(--night-ink); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; padding-block: 56px 64px; }
.hero h1 { color: var(--night-ink); }
.hero h1 em { font-style: italic; color: var(--gold); }
.hero p.lead { font-size: 19px; color: color-mix(in srgb, var(--night-ink) 80%, transparent); max-width: 34em; margin: 0 0 24px; }
.hero .eyebrow { color: var(--gold); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .btn-ghost { background: transparent; color: var(--night-ink); border-color: color-mix(in srgb, var(--night-ink) 30%, transparent); }
.hero .btn-ghost:hover { border-color: var(--gold); color: var(--night-ink); }
.hero-art { width: 100%; max-width: 440px; justify-self: end; }
.hero-art .star { animation: twinkle 3.6s ease-in-out infinite; }
.hero-art .star:nth-child(2n) { animation-delay: 1.2s; }
.hero-art .star:nth-child(3n) { animation-delay: 2.1s; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 28px; font-size: 14px; color: color-mix(in srgb, var(--night-ink) 75%, transparent); }
.hero-facts span::before { content: "✓ "; color: var(--gold); }
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; padding-block: 40px 48px; }
  .hero-art { max-width: 300px; justify-self: center; order: -1; }
}

/* Sekcje strony głównej */
.section { padding-block: 56px; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { margin: 4px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 500 14px var(--body); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--night); color: var(--night-ink); border-color: var(--night); }
:root[data-theme="dark"] .chip[aria-pressed="true"] { background: var(--gold); color: #1b1407; border-color: var(--gold); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; min-width: 0; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--gold); color: var(--ink); }
.card .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--gold-ink); }
.card .icon svg { width: 24px; height: 24px; }
.card h3 { margin: 0; font-size: 20px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.card .meta { margin-top: auto; font-size: 13px; color: var(--muted); display: flex; gap: 12px; }
.card[hidden] { display: none; }

.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.trust > div { padding: 24px; border-radius: var(--radius); background: var(--surface-2); }
.trust h3 { margin: 10px 0 6px; font-size: 19px; }
.trust p { margin: 0; color: var(--muted); font-size: 15px; }
.trust svg { width: 28px; height: 28px; color: var(--gold-ink); }
@media (max-width: 820px) { .trust { grid-template-columns: 1fr; } }

.cta-band { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.cta-band h2 { margin: 0 0 6px; }
.cta-band p { margin: 0; color: var(--muted); }
@media (max-width: 700px) { .cta-band { grid-template-columns: 1fr; padding: 24px; } }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--gold-ink); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* Artykuł */
.crumbs { font-size: 14px; color: var(--muted); padding-top: 28px; }
.crumbs a { color: var(--muted); }
.art-head { padding-block: 8px 24px; max-width: 820px; }
.art-head .lede { font-size: 19px; color: var(--muted); margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--gold-ink); text-decoration: none; }
.pill svg { width: 15px; height: 15px; }
.art-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); margin-top: 14px; }
.art-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; align-items: start; padding-bottom: 32px; }
.art-body { min-width: 0; max-width: 760px; }
.art-body > p, .art-body li { max-width: 68ch; }
.art-body table { border-collapse: collapse; width: 100%; font-size: 15px; }
.art-body th, .art-body td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.art-body th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
.table-card { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 20px 0; }
.table-card table { min-width: 560px; }
.art-body blockquote { margin: 20px 0; padding: 14px 20px; border-left: 3px solid var(--gold); background: var(--surface); border-radius: 0 10px 10px 0; }
.tldr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 0 0 28px; }
.tldr .eyebrow { display: block; margin-bottom: 6px; }
.tldr ul { margin: 0; padding-left: 20px; }
.tldr li { margin: 4px 0; }
.disclosure { font-size: 14px; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 24px; }
.toc { position: sticky; top: 88px; font-size: 14px; }
.toc .eyebrow { display: block; margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.4; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); border-left-color: var(--gold); font-weight: 600; }
.toc-mobile { display: none; }
@media (max-width: 1000px) {
  .art-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .toc-mobile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; margin-bottom: 24px; }
  .toc-mobile summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
  .toc-mobile ol { margin: 0 0 12px; padding-left: 20px; }
}
.related { border-top: 1px solid var(--line); padding-block: 40px 16px; }
.related h2 { margin-top: 0; }

/* Przyciski do sklepów */
.shop-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: var(--night); color: var(--night-ink); text-decoration: none; }
.shop-btn:hover { background: var(--gold); color: #1b1407; }
:root[data-theme="dark"] .shop-btn { background: var(--surface-2); }
.shop-btn small { font-weight: 500; font-size: 11px; opacity: .75; }
.shop-list { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* Ranking */
.rank-tools { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 16px 0 0; }
.field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 0; }
.field select, .field input[type="number"] { font: 15px var(--body); padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.field input[type="range"] { accent-color: var(--gold); width: 200px; max-width: 100%; }
.field output { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.rank-count { margin-left: auto; font-size: 14px; color: var(--muted); }
.rank-table th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.rank-table th button:focus-visible { outline: 2px solid var(--gold); }
.rank-table th[aria-sort="ascending"] button::after { content: "▲"; font-size: 10px; }
.rank-table th[aria-sort="descending"] button::after { content: "▼"; font-size: 10px; }
.rank-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.rank-table .model b { font-family: var(--display); font-size: 17px; }
.rank-table .model span { display: block; color: var(--muted); font-size: 13px; }
.rank-table tr[hidden] { display: none; }
.rank-empty { padding: 20px; color: var(--muted); }

/* Quiz */
.quiz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin: 16px 0 8px; }
.quiz form, .quiz .result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.quiz fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.quiz legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: 15px; cursor: pointer; }
.seg input:checked + span { background: var(--night); color: var(--night-ink); border-color: var(--night); }
:root[data-theme="dark"] .seg input:checked + span { background: var(--gold); color: #1b1407; border-color: var(--gold); }
.seg input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input { flex: 1; accent-color: var(--gold); min-width: 0; }
.range-row output { min-width: 80px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.result { position: sticky; top: 88px; align-self: start; }
.result .big { font-family: var(--display); font-size: 44px; line-height: 1; color: var(--gold-ink); margin: 6px 0 4px; }
.scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 14px 0; }
.scale i { height: 10px; border-radius: 4px; background: var(--surface-2); }
.scale i.on { background: var(--gold); }
.scale-labels { display: grid; grid-template-columns: repeat(4, 1fr); font-size: 12px; color: var(--muted); text-align: center; margin-top: -8px; }
.result ul { padding-left: 18px; margin: 8px 0; }
.result .models { display: grid; gap: 8px; margin-top: 10px; }
.result .models a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 15px; }
.result .models a:hover { border-color: var(--gold); }
.result .note { font-size: 13px; color: var(--muted); margin-top: 12px; }
@media (max-width: 820px) { .quiz { grid-template-columns: 1fr; } .result { position: static; } }

/* Stopka */
.site-foot { background: var(--night); color: color-mix(in srgb, var(--night-ink) 75%, transparent); margin-top: 48px; font-size: 14px; }
.site-foot .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; padding-block: 40px; }
.site-foot a { color: var(--night-ink); text-decoration: none; display: block; padding: 3px 0; }
.site-foot a:hover { color: var(--gold); }
.site-foot strong { color: var(--night-ink); font-family: var(--display); font-size: 19px; display: block; margin-bottom: 6px; }
.site-foot .fine { grid-column: 1 / -1; border-top: 1px solid color-mix(in srgb, var(--night-ink) 15%, transparent); padding-top: 16px; }
@media (max-width: 700px) { .site-foot .wrap { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
:root[data-theme="dark"] .nav a.nav-cta { background: var(--gold); color: #1b1407; }
:root[data-theme="dark"] .nav a.nav-cta:hover { background: #f0c97b; color: #1b1407; }

/* ===== Wersja 4: wyszukiwarka, intencje, narzędzia, słowniczek, porównywarka ===== */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { font: 600 11px var(--body); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
.search-btn { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 500 14px var(--body); cursor: pointer; }
.search-btn svg { width: 18px; height: 18px; }
.search-btn:hover { border-color: var(--gold); color: var(--ink); }
@media (max-width: 1060px) { .search-btn span, .search-btn kbd { display: none; } .search-btn { width: 40px; padding: 0; justify-content: center; } }
@media (max-width: 860px) { .search-btn { display: none; } }

/* Dolny pasek na telefonie */
.tabbar { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .tabbar a, .tabbar button { all: unset; display: grid; justify-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11px; font-weight: 600; color: var(--muted); cursor: pointer; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar [aria-current="page"] { color: var(--gold-ink); }
  .tabbar a:focus-visible, .tabbar button:focus-visible { outline: 2px solid var(--gold); outline-offset: -4px; }
  .site-foot { padding-bottom: 8px; }
}

/* Okno wyszukiwania */
dialog.search { width: min(640px, calc(100vw - 24px)); margin: 10vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px rgba(10, 15, 31, .35); }
dialog::backdrop { background: rgba(10, 15, 31, .45); backdrop-filter: blur(3px); }
.search-box { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search-box > svg { width: 22px; height: 22px; color: var(--gold-ink); flex: none; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 500 18px var(--body); }
.search-close { font: 600 12px var(--body); border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: min(60vh, 440px); overflow: auto; }
.search-results a { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.search-results a b { font-weight: 600; line-height: 1.35; }
.search-results a small { color: var(--muted); font-size: 13px; }
.search-results [aria-selected="true"] a, .search-results a:hover { background: var(--surface-2); }
.search-results [aria-selected="true"] a b { color: var(--gold-ink); }
.search-results .none { padding: 16px 12px; color: var(--muted); }
.search-hint { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (pointer: coarse) { .search-hint { display: none; } }
@media (max-width: 600px) { dialog.search { margin-top: 12px; } }

/* Hero v4 */
.hero .wrap { padding-block: 56px 96px; }
.hero-search { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 560px; padding: 15px 16px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--night-ink) 22%, transparent); background: color-mix(in srgb, var(--night-ink) 8%, transparent); color: color-mix(in srgb, var(--night-ink) 78%, transparent); font: 500 16px var(--body); text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.hero-search:hover { border-color: var(--gold); background: color-mix(in srgb, var(--night-ink) 12%, transparent); }
.hero-search svg { width: 22px; height: 22px; color: var(--gold); flex: none; }
.hero-search span { flex: 1; min-width: 0; }
.hero-search kbd { background: transparent; color: inherit; border-color: color-mix(in srgb, var(--night-ink) 30%, transparent); }
@media (max-width: 820px) { .hero .wrap { padding-block: 32px 88px; } .hero-search kbd { display: none; } .hero-art { max-width: 240px; } }

/* Intencje: „Co Cię sprowadza?” */
.intents-wrap { margin-top: -56px; position: relative; z-index: 2; }
.intents { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.intent { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform .15s, border-color .15s; min-width: 0; }
.intent:hover { transform: translateY(-2px); border-color: var(--gold); color: var(--ink); }
.intent .icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--gold-ink); }
.intent .icon svg { width: 24px; height: 24px; }
.intent > span:nth-child(2) { flex: 1; min-width: 0; display: grid; }
.intent b { font-weight: 600; line-height: 1.3; }
.intent small { color: var(--muted); font-size: 14px; line-height: 1.4; }
.intent > svg { width: 18px; height: 18px; color: var(--muted); flex: none; transition: transform .15s; }
.intent:hover > svg { transform: translateX(3px); color: var(--gold-ink); }
@media (max-width: 900px) { .intents { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .intents { grid-template-columns: 1fr; gap: 8px; } .intent { padding: 12px 14px; } .intent small { font-size: 13px; } }

/* Ostatnio czytane */
.recent-wrap { padding-top: 28px; }
.recent-wrap h2 { margin: 0 0 10px; font-family: var(--body); }
.recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.recent a { display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line); text-decoration: none; color: var(--ink); background: var(--surface); }
.recent a:hover { border-color: var(--gold); border-style: solid; }
.recent small { color: var(--muted); font-size: 12px; }
.recent b { font-size: 15px; line-height: 1.35; }
.bar { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 4px; }

/* Narzędzia */
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tool { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: 20px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); transition: transform .15s, box-shadow .15s, border-color .15s; min-width: 0; }
a.tool:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold); color: var(--ink); }
.tool h3 { margin: 0; font-size: 23px; }
.tool p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.tool-sleep { background: var(--night); color: var(--night-ink); border-color: var(--night); }
.tool-sleep .eyebrow { color: var(--gold); }
.tool-sleep .field { color: color-mix(in srgb, var(--night-ink) 75%, transparent); }
.tool-sleep input[type="time"] { font: 600 26px var(--display); padding: 6px 10px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--night-ink) 25%, transparent); background: color-mix(in srgb, var(--night-ink) 8%, transparent); color: var(--night-ink); color-scheme: dark; width: 100%; max-width: 180px; }
.sm-out { margin: 0; font-size: 15px; line-height: 1.6; min-height: 3.2em; }
.sm-out b { font-family: var(--display); font-size: 22px; color: var(--gold); }
.sm-out small { opacity: .75; }
.tool-go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; color: var(--gold-ink); text-decoration: none; }
.tool-sleep .tool-go { color: var(--gold); }
.tool-go svg { width: 18px; height: 18px; transition: transform .15s; }
.tool:hover .tool-go svg, .tool-go:hover svg { transform: translateX(3px); }
.mini-scale, .mini-check { display: flex; gap: 6px; margin: 4px 0 6px; }
.mini-scale i { flex: 1; height: 10px; border-radius: 5px; background: var(--surface-2); }
.mini-scale i.on { background: var(--gold); animation: pulse 2.4s ease-in-out infinite; }
.mini-check i { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); }
.mini-check i.on { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 3px var(--surface); }
@keyframes pulse { 50% { opacity: .55; } }
@media (max-width: 900px) { .tools { grid-template-columns: 1fr; } }

/* Słowniczek */
.term { all: unset; cursor: help; border-bottom: 1.5px dotted var(--gold); color: inherit; }
.term:hover, .term[aria-expanded="true"] { color: var(--gold-ink); }
.term:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 3px; }
.term-pop { position: absolute; z-index: 70; padding: 12px 14px; border-radius: 12px; background: var(--night); color: var(--night-ink); font-size: 14px; line-height: 1.5; box-shadow: 0 12px 32px rgba(10, 15, 31, .3); }
:root[data-theme="dark"] .term-pop { background: var(--surface-2); border: 1px solid var(--line); }

/* Ranking v4: twardość, koszt za noc, porównanie */
.firm { display: block; width: 64px; height: 6px; border-radius: 3px; background: var(--surface-2); margin: 6px 0 4px; overflow: hidden; }
.firm i { display: block; height: 100%; width: calc(var(--lvl) * 25%); background: var(--gold); border-radius: 3px; }
.per-night { display: block; font-weight: 500; font-size: 12px; color: var(--ok); margin-top: 2px; }
.cmp { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.cmp input { accent-color: var(--gold); width: 16px; height: 16px; margin: 0; }
.cmp input:disabled + span { opacity: .45; }
.cmp-bar { position: sticky; bottom: 12px; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px 12px 18px; margin: 12px 0; border-radius: 16px; background: var(--night); color: var(--night-ink); box-shadow: 0 12px 32px rgba(10, 15, 31, .3); }
.cmp-bar[hidden] { display: none; }
.cmp-bar span { flex: 1; font-weight: 600; font-size: 15px; }
.cmp-bar .btn { padding: 9px 16px; font-size: 15px; }
.cmp-bar .btn:disabled { opacity: .5; cursor: not-allowed; }
.cmp-bar .btn-ghost { background: transparent; color: var(--night-ink); border-color: color-mix(in srgb, var(--night-ink) 30%, transparent); }
@media (max-width: 760px) { .cmp-bar { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); } }
.cmp-dialog { width: min(900px, calc(100vw - 24px)); max-height: 88vh; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); }
.cmp-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.cmp-head h2 { margin: 0; font-size: 24px; }
.icon-btn { width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.icon-btn svg { width: 18px; height: 18px; }
.cmp-diff { display: inline-flex; gap: 8px; align-items: center; margin: 12px 20px 0; font-size: 14px; color: var(--muted); cursor: pointer; }
.cmp-diff input { accent-color: var(--gold); }
.cmp-body { padding: 8px 20px 20px; overflow-x: auto; }
.cmp-row { display: grid; grid-template-columns: 130px repeat(var(--cols, 2), minmax(150px, 1fr)); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; min-width: calc(130px + var(--cols, 2) * 162px); }
.cmp-row > span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 3px; }
.cmp-names b { font-family: var(--display); font-size: 19px; }
.cmp-row .best { color: var(--ok); font-weight: 600; }
.cmp-row em { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--ok) 15%, transparent); margin-left: 4px; }
.cmp-row:not(.same):not(.cmp-names) { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 8%, transparent), transparent 60%); }
.only-diff .cmp-row.same { display: none; }

/* Kalkulator snu */
.sleep { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; margin: 16px 0 8px; }
.sleep-inputs { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: end; margin: 18px 0 8px; }
.sleep-time[hidden] { display: none; }
.sleep input[type="time"] { font: 600 34px var(--display); padding: 6px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 250px; max-width: 100%; }
.sleep-lead { margin: 12px 0 10px; font-size: 17px; }
.sleep-results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sleep-results li { display: grid; gap: 2px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
.sleep-results b { font-family: var(--display); font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sleep-results span { font-size: 13px; color: var(--muted); }
.sleep-results em { justify-self: start; margin-top: 6px; font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.sleep-results em.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.sleep-results em.warn { background: color-mix(in srgb, #c0583a 14%, transparent); color: #b2492c; }
:root[data-theme="dark"] .sleep-results em.warn { color: #f09a80; }
.sleep-results li.c5, .sleep-results li.c6 { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.sleep-actions { margin-top: 14px; }
.sleep-actions .btn svg, .share-btn svg { width: 18px; height: 18px; }
.share-btn { margin-top: 12px; padding: 9px 16px; font-size: 15px; }
@media (max-width: 700px) { .sleep-results { grid-template-columns: 1fr 1fr; } .sleep { padding: 16px; } }

/* Lista kontrolna */
.check { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; margin: 16px 0 8px; }
.check-top { display: flex; gap: 18px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.4; }
.ring .track { stroke: var(--surface-2); }
.ring .fill { stroke: var(--ok); stroke-linecap: round; stroke-dasharray: 97.4; stroke-dashoffset: 97.4; transition: stroke-dashoffset .4s ease; }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 20px; }
.check-status { margin: 0 0 8px; font-weight: 600; }
.check.complete .check-status { color: var(--ok); }
.check-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.check-btns .btn { padding: 7px 14px; font-size: 14px; }
.check-list { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: c; }
.check-list li { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.check-list li:last-child { border-bottom: 0; }
.check-list label { flex: 1; display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; cursor: pointer; line-height: 1.5; font-size: 16px; max-width: none; }
.check-list input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-list .box { flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.check-list input:checked + .box { background: var(--ok); border-color: var(--ok); }
.check-list input:checked + .box::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check-list input:focus-visible + .box { outline: 3px solid var(--gold); outline-offset: 2px; }
.check-list li.done label > span:last-child { color: var(--muted); }
.check-list li.done b { text-decoration: line-through; text-decoration-color: var(--ok); }
.check-list .more { flex: none; width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; color: var(--muted); }
.check-list .more:hover { background: var(--surface-2); color: var(--gold-ink); }
.check-list .more svg { width: 18px; height: 18px; }

/* Druk listy kontrolnej */
@media print {
  .site-head, .tabbar, .site-foot, .crumbs, .toc, .toc-mobile, .related, .disclosure, .check-btns, .progress, .check-list .more, dialog, .art-body > p:last-child { display: none !important; }
  body { background: #fff; color: #000; padding: 0; font-size: 13px; }
  .check, .tldr { border: 0; padding: 0; }
  .check-list .box { border-color: #000; }
}
.tool-sleep .sm-out { color: var(--night-ink); }
.tool-sleep input[type="time"] { max-width: 220px; }
