/* =====================================================================
   BAJT – arkusz stylów części publicznej
   Tryb jasny i ciemny: zmienne CSS na <html data-theme="light|dark">
   ===================================================================== */
:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --wrap: 1240px;
  --gap: 1.25rem;
  --shadow: 0 1px 2px rgba(15, 23, 32, .06), 0 2px 8px rgba(15, 23, 32, .05);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f7;
  --bg-alt: #e9edf1;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --border: #dce2e8;
  --border-strong: #c3ccd5;
  --text: #17202a;
  --text-2: #4a5866;
  --muted: #6b7987;
  --accent: #0b8a8f;
  --accent-2: #0a6f73;
  --accent-soft: #e0f3f3;
  --link: #0a6c86;
  --navy: #13233a;
  --header-bg: #111a24;
  --header-text: #e8eef3;
  --danger: #b42318;
  --warn: #8a5a00;
  --warn-bg: #fff6e0;
  --ok: #1d7a43;
  --ok-bg: #e5f5ec;
  --err-bg: #fdecea;
  --badge-8: #0b6e8f;
  --badge-16: #6b3fa0;
  --badge-32: #a04a1a;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12171d;
  --bg-alt: #171e26;
  --surface: #1a222b;
  --surface-2: #202a35;
  --border: #2a3542;
  --border-strong: #3a4757;
  --text: #e4eaf0;
  --text-2: #b4c0cc;
  --muted: #8796a5;
  --accent: #2cc5c9;
  --accent-2: #5fd9dc;
  --accent-soft: #123536;
  --link: #6cc8e6;
  --navy: #0f1a29;
  --header-bg: #0c1117;
  --header-text: #e4eaf0;
  --danger: #ff8a80;
  --warn: #ffcc66;
  --warn-bg: #3a2e12;
  --ok: #7fdca1;
  --ok-bg: #143322;
  --err-bg: #3a1a1a;
  --badge-8: #3fb4d6;
  --badge-16: #b293e6;
  --badge-32: #f0a070;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 var(--font); background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); }
h2 { font-size: 1.35rem; margin-top: 1.6em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); padding: .05em .35em; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; }
.hp { position: absolute; left: -5000px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.danger { color: var(--danger); }
.lead { font-size: 1.1rem; color: var(--text-2); max-width: 75ch; }
.lead-prose { color: var(--text-2); max-width: 80ch; }
.h-small { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .7rem; }
.inline, form.inline { display: inline; }
.stack > * + * { margin-top: .85rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

/* --- Nagłówek --- */
.site-header { background: var(--header-bg); color: var(--header-text); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgba(255,255,255,.06); }
.header-inner { display: flex; align-items: center; gap: 1.25rem; height: 62px; }
.logo { display: inline-flex; align-items: baseline; gap: .45rem; text-decoration: none; color: inherit; }
.logo-mark { font-family: var(--mono); font-weight: 800; font-size: 1.55rem; letter-spacing: .12em; color: #fff; padding: .02em .35em; border: 2px solid var(--accent); border-radius: 4px; line-height: 1.15; }
html[data-theme="light"] .logo-footer .logo-mark { color: var(--text); }
.logo-sub { font-family: var(--mono); font-size: .72rem; color: var(--accent); letter-spacing: .08em; }
.header-search { position: relative; flex: 1; max-width: 520px; display: flex; }
.header-search input { width: 100%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff; border-radius: 999px; padding: .5rem 2.6rem .5rem 1rem; font: inherit; font-size: .92rem; }
.header-search input::placeholder { color: rgba(255,255,255,.55); }
.header-search input:focus { background: rgba(255,255,255,.14); outline: none; border-color: var(--accent); }
.header-search button { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); background: none; border: 0; color: rgba(255,255,255,.75); padding: .35rem .5rem; cursor: pointer; }
.header-actions { display: flex; align-items: center; gap: .55rem; margin-left: auto; }
.theme-toggle { background: transparent; border: 1px solid rgba(255,255,255,.18); color: var(--header-text); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
html[data-theme="light"] .i-moon, html[data-theme="dark"] .i-sun { display: none; }
.site-header .btn-ghost { color: var(--header-text); border-color: rgba(255,255,255,.25); }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .25rem .5rem; border-radius: 999px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary img { border-radius: 50%; }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 220px; padding: .4rem; z-index: 60; }
.user-menu-panel a, .user-menu-panel button { display: block; width: 100%; text-align: left; padding: .5rem .75rem; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: .93rem; }
.user-menu-panel a:hover, .user-menu-panel button:hover { background: var(--surface-2); }
.avatar-fallback { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: .85rem; }
.nav-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; padding: 9px 8px; cursor: pointer; }
.nav-toggle span:not(.visually-hidden) { display: block; height: 2px; background: var(--header-text); margin: 4px 0; border-radius: 2px; }
.main-nav { background: var(--navy); border-top: 1px solid rgba(255,255,255,.05); }
.main-nav > .wrap > ul { list-style: none; display: flex; flex-wrap: wrap; margin: 0; padding: 0; gap: .15rem; }
.main-nav a, .main-nav summary { display: block; padding: .6rem .8rem; color: #c9d4de; text-decoration: none; font-size: .93rem; border-bottom: 2px solid transparent; cursor: pointer; }
.main-nav a:hover, .main-nav summary:hover { color: #fff; }
.main-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--accent); }
.nav-more { position: relative; }
.nav-more summary { list-style: none; }
.nav-more summary::after { content: " ▾"; font-size: .75em; }
.nav-more ul { position: absolute; list-style: none; margin: 0; padding: .35rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 260px; z-index: 60; }
.nav-more ul a { color: var(--text); border: 0; border-radius: var(--radius-sm); }
.nav-more ul a:hover { background: var(--surface-2); color: var(--text); }

/* --- Autocomplete --- */
.ac-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 70; max-height: 70vh; overflow: auto; text-align: left; }
.ac-results a { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .85rem; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.ac-results a:hover, .ac-results a.active { background: var(--accent-soft); }
.ac-type { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.ac-meta { display: block; font-size: .8rem; color: var(--muted); }
.ac-all { display: block; padding: .55rem .85rem; font-weight: 600; }

/* --- Główna --- */
.site-main { flex: 1; padding-bottom: 3rem; }
.flashes { margin-top: 1rem; }
.flash { padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: .5rem; border: 1px solid var(--border); background: var(--surface); }
.flash-success { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.flash-error { background: var(--err-bg); border-color: transparent; color: var(--danger); }
.flash-info { background: var(--accent-soft); border-color: transparent; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; padding: 0; margin: 1rem 0 .5rem; font-size: .85rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: .3rem; opacity: .6; }
.breadcrumbs a { color: var(--muted); }
.page-head { padding: 1.25rem 0 1rem; }
.eyebrow { font-size: .85rem; color: var(--muted); margin: 0 0 .3rem; text-transform: uppercase; letter-spacing: .06em; }
.notice, .callout { background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--accent); padding: .75rem 1rem; border-radius: var(--radius-sm); margin: 1rem 0; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.empty { padding: 2rem; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }

/* --- Przyciski i formularze --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1rem; font: inherit; font-size: .93rem; font-weight: 600; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
html[data-theme="dark"] .btn-primary { color: #071a1b; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: .38rem .75rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linklike { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font: inherit; }
.linklike:hover { text-decoration: underline; }
.linklike.danger { color: var(--danger); }
input, select, textarea { font: inherit; font-size: .95rem; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .5rem .7rem; width: 100%; max-width: 100%; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 4rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field label { font-weight: 600; font-size: .9rem; }
.field .help { color: var(--muted); font-size: .8rem; }
.field-error { color: var(--danger); font-size: .82rem; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.field-check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
.field-check input { margin-top: .3rem; }
.req { color: var(--danger); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.form-card { padding: 1.5rem; }
.form-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem 1.25rem; background: var(--surface); margin: 0 0 1rem; }
.form-group legend { font-weight: 700; padding: 0 .4rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-cell.wide { grid-column: 1 / -1; }
.upload-preview { max-height: 220px; margin-top: .5rem; border-radius: var(--radius-sm); }
.ms-filter { margin-bottom: .3rem; }

/* --- Karty --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-grid > .card { display: flex; flex-direction: column; }
.card-grid > .card > .card-body { flex: 1; display: flex; flex-direction: column; }
.card-body > .badge { margin-top: auto; align-self: flex-start; }
.card-body > .card-spec { margin-bottom: .75rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--gap); }
.card-grid-sm { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
.card-grid-wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card-img { display: block; text-decoration: none; aspect-ratio: 16 / 11; background: var(--surface-2); border-bottom: 1px solid var(--border); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder { display: grid; place-items: center; height: 100%; font-family: var(--mono); font-weight: 700; color: var(--muted); font-size: 1.05rem; letter-spacing: .04em; background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, var(--bg-alt) 10px 20px); text-align: center; padding: .5rem; }
.card-body { padding: .9rem 1rem 1rem; }
.card-title { font-size: 1.02rem; margin: 0 0 .25rem; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-meta { color: var(--muted); font-size: .86rem; margin: 0 0 .35rem; }
.card-spec { font-family: var(--mono); font-size: .78rem; color: var(--text-2); margin: 0 0 .5rem; }
.badge { display: inline-block; font-family: var(--mono); font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 4px; border: 1px solid currentColor; color: var(--muted); white-space: nowrap; }
.badge-8-bit { color: var(--badge-8); }
.badge-16-bit { color: var(--badge-16); }
.badge-32-bit { color: var(--badge-32); }
.tag { display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); background: var(--accent-soft); padding: .05rem .45rem; border-radius: 4px; }
.section-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); margin: 1rem 0 1.5rem; }
.section-cards.six { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.section-card { display: flex; flex-direction: column; gap: .35rem; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); border-top: 3px solid var(--accent); transition: transform .12s ease; }
.section-card:hover { transform: translateY(-2px); color: var(--text); border-color: var(--accent); }
.section-card-title { font-weight: 700; font-size: 1.05rem; }
.section-card-count { font-family: var(--mono); color: var(--accent); font-size: .85rem; }
.section-card-desc { color: var(--muted); font-size: .88rem; }
.chips { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; gap: .4rem; align-items: center; padding: .3rem .7rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-size: .86rem; }
.chip span { color: var(--muted); font-family: var(--mono); font-size: .75rem; }
.chip:hover, .chip.active { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent-soft); }

/* --- Katalog --- */
.catalog-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .8rem; position: sticky; top: 120px; }
.filter-actions { display: flex; gap: .5rem; }
.view-switch { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 1rem; background: var(--surface); }
.view-switch a { padding: .4rem .8rem; font-size: .86rem; color: var(--text-2); text-decoration: none; border-right: 1px solid var(--border); }
.view-switch a:last-child { border-right: 0; }
.view-switch a.active { background: var(--accent); color: #fff; }
.view-switch.small a { padding: .25rem .6rem; font-size: .8rem; }
.results { position: relative; min-height: 120px; transition: opacity .15s; }
.results.loading { opacity: .45; pointer-events: none; }
.results-count { color: var(--muted); font-size: .88rem; margin-bottom: .8rem; }
.item-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.item-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .8rem; }
.item-list.compact .item-row { grid-template-columns: 1fr; }
.item-row img { border-radius: var(--radius-sm); object-fit: cover; width: 96px; height: 72px; }
.thumb-placeholder { width: 96px; height: 72px; display: grid; place-items: center; background: var(--surface-2); border-radius: var(--radius-sm); font-family: var(--mono); color: var(--muted); }
.item-title { font-weight: 600; color: var(--text); text-decoration: none; }
.item-title:hover { color: var(--accent); }
.item-meta { color: var(--muted); font-size: .85rem; }
.item-desc { margin: .25rem 0 0; color: var(--text-2); font-size: .9rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th, .data-table td { padding: .55rem .8rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table thead th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); position: sticky; top: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .sub-row td { border-top: 0; padding-top: 0; }
.pagination { display: flex; flex-wrap: wrap; gap: .3rem; margin: 1.5rem 0; justify-content: center; }
.pagination a, .pagination span { padding: .4rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); text-decoration: none; background: var(--surface); color: var(--text); font-size: .9rem; }
.pagination .pg-current { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .pg-gap { border: 0; background: none; }
.chrono { list-style: none; padding: 0; margin: 0; }
.chrono-year h3 { font-family: var(--mono); color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: .3rem; margin-top: 1.5rem; }

/* --- Oś czasu --- */
.year-jump { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: 1.5rem; }
.year-jump a { font-family: var(--mono); font-size: .82rem; padding: .2rem .45rem; border: 1px solid var(--border); border-radius: 4px; text-decoration: none; background: var(--surface); }
.timeline { list-style: none; padding: 0 0 0 1.25rem; margin: 0; border-left: 2px solid var(--border); }
.tl-year { position: relative; padding: 0 0 1.25rem 1rem; scroll-margin-top: 130px; }
.tl-year::before { content: ""; position: absolute; left: -1.62rem; top: .5rem; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.tl-label { font-family: var(--mono); font-size: 1.25rem; margin: 0 0 .5rem; color: var(--text); }
.tl-items { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .3rem 1.5rem; }
.year-bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.year-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-decoration: none; min-width: 14px; }
.yb-fill { width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; opacity: .75; }
.year-bar:hover .yb-fill { opacity: 1; }
.yb-label { font-family: var(--mono); font-size: .65rem; color: var(--muted); margin-top: 2px; }

/* --- Hero / strona główna --- */
.hero { background: linear-gradient(180deg, var(--navy), var(--header-bg)); color: #e8eef3; padding: 3.5rem 0 3rem; border-bottom: 1px solid var(--border); }
.hero-inner { text-align: center; }
.hero-title { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.hero-logo { font-family: var(--mono); font-weight: 800; font-size: clamp(3rem, 9vw, 5.5rem); letter-spacing: .18em; color: #fff; border: 4px solid var(--accent); padding: 0 .3em 0 .48em; border-radius: 8px; line-height: 1.1; }
.hero-sub { font-size: clamp(1rem, 2.4vw, 1.35rem); font-weight: 500; color: #b9c7d3; letter-spacing: .01em; }
.hero-lead { color: #c9d4de; font-size: 1.1rem; margin-bottom: 1.6rem; }
.search-big { display: flex; gap: .5rem; max-width: 640px; margin: 0 auto 1rem; position: relative; }
.search-big input { padding: .75rem 1rem; font-size: 1.02rem; }
.search-big select { width: auto; }
.hero .search-big input { background: #fff; color: #17202a; border-color: transparent; }
.hero-stats { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 1.5rem; padding: 0; margin: 1.25rem 0 0; color: #b9c7d3; }
.hero-stats strong { color: var(--accent); font-family: var(--mono); font-size: 1.2rem; }
.home-section { margin-top: 2.5rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }
.manufacturer-wall { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; }
.manufacturer-wall a { display: flex; flex-direction: column; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.manufacturer-wall a:hover { border-color: var(--accent); }
.mw-name { font-weight: 700; }
.mw-meta { color: var(--muted); font-size: .8rem; font-family: var(--mono); }
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.stat-row { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 1.5rem; color: var(--text-2); }
.stat-row strong { font-family: var(--mono); color: var(--accent); }

/* --- Karta wpisu --- */
.entity-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; padding: 1rem 0 1.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.entity-head h1 { margin: 0; }
.entity-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.entity-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; }
.entity-side { position: sticky; top: 120px; display: flex; flex-direction: column; gap: 1rem; }
.side-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.gallery-main { margin: 0 0 .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gallery-main img { width: 100%; max-height: 520px; object-fit: contain; background: var(--surface-2); }
.gallery-main figcaption { padding: .5rem .85rem; font-size: .88rem; }
.gallery-thumbs { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.gallery-thumbs img { border-radius: var(--radius-sm); border: 1px solid var(--border); aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.gallery-empty { padding: 2rem; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); margin-bottom: 1rem; }
.prose { max-width: 75ch; }
.prose h2 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose blockquote { border-left: 3px solid var(--accent); margin: 1rem 0; padding: .2rem 1rem; color: var(--text-2); }
.spec-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.spec-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: .92rem; }
.spec-table caption { text-align: left; font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .2rem 0 .45rem; }
.spec-table th, .spec-table td { padding: .5rem .8rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.spec-table th { width: 42%; color: var(--text-2); font-weight: 500; background: var(--surface-2); }
.spec-table tbody tr:last-child th, .spec-table tbody tr:last-child td { border-bottom: 0; }
.spec-table tbody:empty::after { content: "Brak danych"; display: block; padding: .5rem .8rem; color: var(--muted); }
.spec-table.compact { border: 0; }
.spec-table.compact th, .spec-table.compact td { padding: .35rem .4rem; background: transparent; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding: .3rem 0; border-bottom: 1px dotted var(--border); }
.link-list.cols { columns: 2; column-gap: 2rem; }
.link-list.cols li { break-inside: avoid; }
.sources ul { font-size: .9rem; color: var(--text-2); word-break: break-word; }
.history-list { list-style: none; padding: 0; font-size: .88rem; }
.history-list li { padding: .35rem 0; border-bottom: 1px dotted var(--border); }
.history summary { cursor: pointer; }
.inline-h { display: inline; margin: 0; font-size: 1.2rem; }
.diff del { color: var(--danger); }
.diff ins { color: var(--ok); text-decoration: none; }
.issue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
.issue { margin: 0; text-align: center; font-size: .85rem; }
.issue img { border-radius: 4px; border: 1px solid var(--border); margin: 0 auto .3rem; }
.issue-cover-ph { display: grid; place-items: center; aspect-ratio: 3/4; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; font-family: var(--mono); color: var(--muted); margin-bottom: .3rem; }
.download-list { padding-left: 1.1rem; }

/* --- Emulator (przygotowanie) --- */
.emulator-box { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.emulator-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.emulator-head h2 { margin: 0; }
.btn-run { font-family: var(--mono); letter-spacing: .06em; background: var(--surface-2); }
.emulator-stage { aspect-ratio: 4 / 3; background: #000; border-radius: var(--radius-sm); margin-top: 1rem; }

/* --- Komentarze --- */
.comments { margin-top: 2.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.count { font-family: var(--mono); font-size: .8em; color: var(--muted); }
.comment-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: .7rem; scroll-margin-top: 130px; }
.comment:target { border-color: var(--accent); }
.comment-head { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; font-size: .88rem; color: var(--muted); }
.comment-head .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.comment-author { font-weight: 700; color: var(--text); }
.comment-body { margin-top: .45rem; word-wrap: break-word; }
.comment-actions { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; margin-top: .5rem; align-items: flex-start; }
.inline-details summary { cursor: pointer; color: var(--link); }
.inline-details form { margin-top: .5rem; min-width: 280px; }
.comment-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }

/* --- Okna modalne --- */
.modal { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 1.5rem; width: min(560px, 92vw); box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal::backdrop { background: rgba(10, 15, 20, .6); }
.modal h2 { margin-top: 0; }
.lightbox { position: fixed; inset: 0; background: rgba(5, 8, 12, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 200; padding: 1rem; }
.lightbox img { max-width: 95vw; max-height: 82vh; object-fit: contain; }
.lightbox p { color: #ddd; margin-top: .6rem; }
.lightbox button { position: absolute; background: rgba(255,255,255,.1); color: #fff; border: 0; font-size: 1.6rem; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; }
.lb-next { right: 1rem; top: 50%; }

/* --- Konta, profile, zakładki --- */
.auth { padding-top: 2rem; max-width: 480px; }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--border); margin-top: 1rem; }
.tabs a { padding: .5rem .9rem; text-decoration: none; color: var(--text-2); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.avatar-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; font-size: 2rem; }
.profile-head { display: flex; gap: 1.25rem; align-items: center; padding: 1.5rem 0; }
.status { font-size: .8rem; font-weight: 600; padding: .1rem .5rem; border-radius: 4px; background: var(--surface-2); white-space: nowrap; }
.status-pending { color: var(--warn); background: var(--warn-bg); }
.status-accepted { color: var(--ok); background: var(--ok-bg); }
.status-rejected { color: var(--danger); background: var(--err-bg); }

/* --- Reklamy --- */
.ad-wrap { margin: 1rem auto; }
.ad-slot { text-align: center; min-height: 0; overflow: hidden; }
.ad-label { display: none; font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .2rem; }
/* Napis „Reklama” tylko gdy Google faktycznie wyświetlił reklamę; puste miejsca znikają */
.ad-slot:has(ins[data-ad-status="filled"]) .ad-label { display: block; }
.ad-slot:not(:has(ins.adsbygoogle)) .ad-label { display: block; }
.ad-wrap:has(ins[data-ad-status="unfilled"]) { display: none; }

/* --- Zgody (cookies) --- */
.consent { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 150; display: flex; justify-content: center; }
.consent[hidden] { display: none; }
.consent-inner { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.25); padding: 1.1rem 1.25rem; max-width: 760px; width: 100%; }
.consent-inner h2 { margin: 0 0 .4rem; font-size: 1.05rem; }
.consent-inner p { font-size: .9rem; color: var(--text-2); }
.consent-options { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: .8rem; font-size: .9rem; }
.consent-options label { display: flex; gap: .4rem; align-items: center; }
.consent-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }

/* --- Strony błędów --- */
.error-page { text-align: center; padding: 4rem 1rem; }
.error-code { font-family: var(--mono); font-size: 4rem; font-weight: 800; color: var(--accent); margin: 0; }

/* --- Stopka --- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 2.5rem 0 1.5rem; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .6rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { padding: .2rem 0; }
.footer-links a, .footer-links button { color: var(--text-2); text-decoration: none; }
.footer-links a:hover, .footer-links button:hover { color: var(--accent); }
.footer-bottom { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: .82rem; }

/* --- Responsywność --- */
@media (max-width: 1024px) {
  .entity-layout { grid-template-columns: 1fr; }
  .entity-side { position: static; }
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
}
@media (max-width: 820px) {
  .header-inner { flex-wrap: wrap; height: auto; padding-top: .6rem; padding-bottom: .6rem; gap: .6rem; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
  .nav-toggle { display: block; }
  .main-nav { display: none; }
  .main-nav.open { display: block; }
  .main-nav > .wrap > ul { flex-direction: column; padding: .4rem 0; }
  .nav-more ul { position: static; box-shadow: none; }
  .two-col, .footer-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .link-list.cols { columns: 1; }
  .um-name { display: none; }
  .filters { order: -1; }
}
@media (max-width: 540px) {
  .hide-xs { display: none; }
  .item-row { grid-template-columns: 72px 1fr; }
  .item-row .badge { grid-column: 2; justify-self: start; }
  .item-row img, .thumb-placeholder { width: 72px; height: 54px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
  .search-big { flex-wrap: wrap; }
  .hero { padding: 2.25rem 0 2rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .ad-wrap, .comments, .entity-actions, .consent, .filters { display: none !important; } body { background: #fff; color: #000; } }
