/* archive-it.pl - KANCELARIA / REJESTR ARCHIWALNY (Swiss-Polish Archival Industrial Design)
 * Paleta: papier archiwalny #ECEAE3, kartka robocza #FFFFFF, tusz weglowy #111315,
 * karmin pieczatki #C8281D, kobalt rejestru #184394.
 * Zero AI slopu, zero gradientow, zero pill-buttonow 999px, ostre 0-2px narozniki.
 */
:root {
  --bg: #eceae3;
  --bg-deep: #e2dfd5;
  --surface: #ffffff;
  --surface-paper: #f7f6f1;
  --ink: #111315;
  --ink-2: #1f2329;
  --ink-soft: #2e333b;
  --text: #111315;
  --text-muted: #4b5058;
  --text-dim: #6c717a;
  --border: #cfc9bc;
  --border-strong: #9e988a;
  --border-ink: #111315;
  --stamp: #c8281d;
  --stamp-hover: #a61e15;
  --stamp-tint: #fdf2f0;
  --cobalt: #184394;
  --cobalt-tint: #edf3fc;
  --ok: #137a43;
  --ok-bright: #5ee393;
  --ok-bg: #ebf7f0;
  --err: #b42318;
  --err-bg: #fef2f2;
  --radius: 2px;
  --shadow-hard: 4px 4px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
  --font-display: 'Archivo', system-ui, -apple-system, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --maxw: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}
a { color: var(--cobalt); text-decoration: none; }
a:hover { color: var(--stamp); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--text);
}
code, pre, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
main { flex: 1 0 auto; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ==================== TOPBAR (48px desktop, 3px karminowa krawedz) ==================== */
.topbar {
  background: var(--ink);
  color: #f6f5f0;
  border-top: 3px solid var(--stamp);
  border-bottom: 1.5px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 50;
  overflow-x: clip;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { color: #ffffff; text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--stamp);
  color: #ffffff;
  border-radius: 1px;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: #ffffff;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: #a6abb4;
  text-transform: uppercase;
  margin-top: 1px;
}

.nav {
  display: flex;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
}
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #c7cbd2;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 11px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.nav a .nav-idx {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #7c828d;
}
.nav a:hover {
  color: #ffffff;
  background: var(--ink-2);
  text-decoration: none;
}
.nav a.active {
  color: #ffffff;
  background: var(--ink-2);
  border-bottom-color: var(--stamp);
}
.nav a.active .nav-idx { color: var(--stamp); }

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ok-bright);
  background: #171c19;
  border: 1px solid #2b4735;
  padding: 4px 8px;
  border-radius: 1px;
  white-space: nowrap;
  flex-shrink: 0;
}
.local-dot {
  width: 6px;
  height: 6px;
  background: var(--ok-bright);
  display: inline-block;
  flex-shrink: 0;
}

/* ==================== KOMPAKTOWY NAGLOWEK ROBOCZY (narzedzie w gornych 20%) ==================== */
.page-head {
  padding: 12px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head-main { min-width: 0; flex: 1 1 480px; }
.page-head h1 {
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.page-head p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.38;
  max-width: 780px;
}
.head-stats {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--border-ink);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  flex-shrink: 0;
}
.head-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  white-space: nowrap;
}
.head-stats span:last-child { border-right: 0; }
.head-stats strong { color: var(--ink); font-weight: 700; }

/* ==================== STOL ROBOCZY / KARTA ARCHIWALNA (WORKBENCH) ==================== */
.workbench {
  background: var(--surface);
  border: 1.5px solid var(--border-ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
  margin-bottom: 8px;
}
.workbench-pad {
  padding: 16px;
}

/* ZAKLADKI SEGREGATORA (TOOL TABS) */
.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  background: var(--bg-deep);
  border-bottom: 1.5px solid var(--border-ink);
}
.tool-tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border-strong);
  border-top: 3px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  gap: 7px;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
}
.tool-tab:last-child { border-right: 0; }
.tool-tab:hover {
  color: var(--ink);
  background: #eae7df;
}
.tool-tab.active {
  color: var(--ink);
  background: var(--surface);
  border-top-color: var(--stamp);
  position: relative;
}
.tool-tab .tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(17, 19, 21, 0.06);
  padding: 1px 5px;
  border-radius: 1px;
}
.tool-tab.active .tag {
  background: var(--stamp);
  color: #ffffff;
}

.tool-body { padding: 16px; }
.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(290px, 0.92fr);
  gap: 16px;
  align-items: start;
}

/* PLYTA SKANERA / DROPZONE ZE ZNACZNIKAMI CIECIA */
.dropzone {
  position: relative;
  border: 1.5px dashed var(--border-ink);
  background: var(--surface-paper);
  border-radius: var(--radius);
  padding: 24px 20px;
  min-height: 224px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.dropzone::before,
.dropzone::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
}
.dropzone::before {
  top: 6px;
  left: 6px;
  border-top: 2px solid var(--stamp);
  border-left: 2px solid var(--stamp);
}
.dropzone::after {
  bottom: 6px;
  right: 6px;
  border-bottom: 2px solid var(--stamp);
  border-right: 2px solid var(--stamp);
}
.dropzone:hover,
.dropzone.dragover {
  border-style: solid;
  border-color: var(--stamp);
  background: var(--stamp-tint);
}
.dropzone:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}
.dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 auto 8px;
  border: 1.5px solid var(--ink);
  background: var(--surface);
  color: var(--stamp);
}
.dropzone-title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.25;
}
.dropzone-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 13px;
}
.dropzone input[type="file"] { display: none; }

/* PRZYCISKI - OSTRE, KANCELARYJNE, ZERO PILL 999px */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border-ink);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: transform 0.08s, box-shadow 0.08s, background 0.1s, color 0.1s;
}
.btn:hover {
  background: var(--ink);
  color: #ffffff;
  text-decoration: none;
}
.btn:disabled {
  opacity: 1;
  background: var(--bg-deep);
  border-color: var(--border-strong);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.btn:disabled:hover {
  background: var(--bg-deep);
  border-color: var(--border-strong);
  color: var(--text-dim);
}
.btn-primary {
  background: var(--stamp);
  border-color: var(--border-ink);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) {
  background: var(--stamp-hover);
  color: #ffffff;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-primary:active:not(:disabled) {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-danger {
  border-color: var(--err);
  color: var(--err);
  background: var(--surface);
}
.btn-danger:hover {
  background: var(--err);
  color: #ffffff;
  border-color: var(--err);
}

/* LISTA PLIKOW */
.file-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-paper);
  border: 1px solid var(--border-ink);
  border-left: 3px solid var(--cobalt);
  border-radius: var(--radius);
}
.file-meta { min-width: 0; flex: 1; }
.file-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-info {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 0;
}
.file-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* PANEL PARAMETROW (PRAWY SLUP ROBOCZY) */
.opts-box {
  background: var(--surface-paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 14px;
}
.opts-box h3 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 7px;
  border-bottom: 1.5px solid var(--border-ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.opts-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.opts-actions #pdf-action-btn { flex: 1 1 auto; }

.field { margin-bottom: 11px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 13.5px;
  transition: border-color 0.1s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.field input[type="range"] {
  accent-color: var(--stamp) !important;
  cursor: pointer;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 11px;
}
.preset-btn {
  background: var(--surface);
  border: 1px solid var(--border-ink);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 1px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.preset-btn:hover { background: var(--bg-deep); }
.preset-btn.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

/* KOMUNIKATY STATUSU */
.status-bar {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--border-ink);
  background: var(--surface-paper);
  color: var(--ink);
  display: none;
}
.status-bar.show { display: block; }
.status-bar.ok { border-color: var(--ok); background: var(--ok-bg); color: #0d542e; }
.status-bar.err { border-color: var(--err); background: var(--err-bg); color: #8c1a12; }
.status-bar.info { border-color: var(--cobalt); background: var(--cobalt-tint); color: #123373; }

/* PODGLAD JPG */
.jpg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.jpg-card {
  background: var(--surface-paper);
  border: 1px solid var(--border-ink);
  border-radius: var(--radius);
  padding: 8px;
  text-align: center;
}
.jpg-card img {
  width: 100%;
  height: 146px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--border);
  display: block;
  margin-bottom: 6px;
}
.jpg-card .mono {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

/* ==================== KALKULATOR TERMINU PRZECHOWYWANIA & KSeF ==================== */
.calc-result {
  background: var(--surface-paper);
  border: 1.5px solid var(--border-ink);
  border-left: 5px solid var(--stamp);
  border-radius: var(--radius);
  padding: 16px;
}
.calc-date {
  font-family: var(--font-mono);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  color: var(--stamp);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 4px 0 10px;
}
.calc-badge-wrap { margin-bottom: 12px; }
/* Ciemna pieczec statusu zapewnia maksymalny kontrast dla dynamicznych kolorow JS (#6ee798 / #ffd9a0) */
#calc-status-badge {
  display: inline-flex;
  align-items: center;
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 1px;
  white-space: normal;
}
.calc-meta {
  font-size: 13px;
  color: var(--text-muted);
  padding: 5px 0;
  border-top: 1px solid var(--border);
}
.calc-meta strong { color: var(--ink); }
.calc-note {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 10px 0 14px;
  line-height: 1.45;
}
.calc-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* CHECKLISTA KSeF */
.ksef-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 14px;
}
.ksef-progress-head strong { color: var(--ink); font-size: 13px; }
.progress-track {
  height: 10px;
  background: var(--bg-deep);
  border: 1.5px solid var(--border-ink);
  border-radius: 1px;
  overflow: hidden;
  margin: 6px 0 4px;
}
.progress-fill {
  height: 100%;
  background: var(--stamp);
  width: 0%;
  transition: width 0.2s ease;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--border-ink);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.check-item:hover { background: var(--surface-paper); }
.check-item.done {
  border-color: var(--ok);
  border-left-color: var(--ok);
  background: var(--ok-bg);
}
.check-item input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--ok);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  cursor: pointer;
}
.check-item strong {
  display: block;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 2px;
}
.check-item span {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==================== CZYSTY KONTENER ADSENSE (ZERO CLS, ZERO RAMKI ROBOCZEJ) ==================== */
.ad-slot {
  min-height: 90px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  display: block;
  width: 100%;
}
.ad-slot + .section { margin-top: 6px; }

/* ==================== SEKCJE I KARTY KATALOGOWE (FISZKI) ==================== */
.section { margin: 22px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--border-ink);
}
.section-head h2 {
  font-size: 17.5px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.section-head span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.cards-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.card {
  background: var(--surface);
  border: 1.5px solid var(--border-ink);
  border-radius: var(--radius);
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.1s, box-shadow 0.1s;
}
.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--ink);
}
.card-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--stamp);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.card h3 {
  font-size: 16px;
  margin-top: 5px;
  line-height: 1.25;
}
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--stamp); }
.card p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.48;
}
.card-static {
  background: var(--surface);
  border: 1.5px solid var(--border-ink);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 22px;
}
.card-static h2 { font-size: 19px; margin-bottom: 8px; }
.card-static h3 { font-size: 15px; margin: 14px 0 5px; }
.card-static p { margin: 0 0 8px; font-size: 14px; color: var(--text-muted); }

/* ==================== TABELA REJESTROWA ==================== */
.table-wrap {
  overflow-x: auto;
  border: 1.5px solid var(--border-ink);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
th, td {
  padding: 10px 13px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  background: var(--ink);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--stamp);
}
tbody tr:nth-child(even) { background: var(--surface-paper); }
tbody tr:last-child td { border-bottom: 0; }
td strong { font-family: var(--font-mono); color: var(--stamp); }

/* ==================== REKOMENDACJE NARZEDZI B2B (AFILIACJA) ==================== */
.aff-box {
  background: var(--surface);
  border: 1.5px solid var(--border-ink);
  border-left: 5px solid var(--cobalt);
  border-radius: var(--radius);
  padding: 16px;
  margin: 22px 0;
}
.aff-disclosure {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--cobalt);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.aff-box h3 { font-size: 16px; margin-bottom: 4px; }
.aff-lead { margin: 0; font-size: 13px; color: var(--text-muted); }
.aff-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.aff-item {
  background: var(--surface-paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px;
}
.aff-item h4 { font-size: 14px; margin-bottom: 4px; }
.aff-item p { font-size: 12.5px; color: var(--text-muted); margin: 0 0 8px; line-height: 1.45; }
.aff-status {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  padding-top: 6px;
  border-top: 1px dashed var(--border-strong);
}

/* ==================== FAQ (AKORDEON KANCELARYJNY) ==================== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
details.faq {
  background: var(--surface);
  border: 1.5px solid var(--border-ink);
  border-radius: var(--radius);
  padding: 12px 14px;
}
details.faq summary {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-ink);
  background: var(--surface-paper);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--stamp);
  flex-shrink: 0;
}
details.faq[open] summary::after {
  content: "-";
  background: var(--ink);
  color: #ffffff;
}
details.faq p {
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ==================== STOPKA ==================== */
.footer {
  margin-top: 32px;
  border-top: 2px solid var(--stamp);
  background: var(--ink);
  color: #b7bcc5;
  padding: 20px 0;
  font-size: 12.5px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer strong { color: #ffffff; font-family: var(--font-display); }
.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.footer-links a { color: #c7cbd2; }
.footer-links a:hover { color: #ffffff; }

/* ==================== RESPONSYWNOSC (900px & 375px MOBILE - ZERO OVERFLOW) ==================== */
@media (max-width: 960px) {
  .brand-sub { display: none; }
  .tool-grid { grid-template-columns: 1fr; }
  .cards-3, .aff-grid, .cards-2 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 12px; }

  /* Kompaktowy dwupasmowy naglowek mobile: 40px brand + 34px szyna nawigacji = 74px */
  .topbar-inner {
    flex-wrap: wrap;
    min-height: 0;
    gap: 0;
    padding: 0;
  }
  .brand {
    padding: 7px 0;
    gap: 8px;
  }
  .brand-mark { width: 24px; height: 24px; }
  .brand-name { font-size: 14px; }
  .local-badge {
    font-size: 9.5px;
    padding: 3px 6px;
    gap: 5px;
  }
  .local-badge .badge-long { display: none; }

  .nav {
    order: 3;
    width: calc(100% + 24px);
    margin: 0 -12px;
    padding: 0 12px;
    background: var(--ink-2);
    border-top: 1px solid #2a2f38;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a {
    padding: 8px 9px;
    font-size: 12px;
    gap: 4px;
  }
  .nav a .nav-idx { display: none; }

  /* Ultra-kompaktowy tytul na mobile, aby narzedzie startowalo w gornych 20% ekranu (~120px) */
  .page-head {
    padding: 9px 0 8px;
    gap: 6px;
  }
  .page-head h1 { font-size: 17px; line-height: 1.18; }
  .page-head p {
    display: none;
  }
  .head-stats { display: none; }

  /* Zakladki narzedzi PDF jako pojedynczy przewijalny pasek (36px zamiast 120px!) */
  .workbench {
    box-shadow: 2px 2px 0 var(--ink);
  }
  .workbench-pad { padding: 12px; }
  .tool-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tool-tabs::-webkit-scrollbar { display: none; }
  .tool-tab {
    padding: 9px 11px;
    font-size: 12px;
    flex: 0 0 auto;
  }
  .tool-tab .tag { display: none; }

  .tool-body { padding: 12px; }
  .dropzone { padding: 16px 12px; min-height: 0; }
  .dropzone-icon { width: 28px; height: 28px; margin-bottom: 6px; }
  .dropzone-title { font-size: 14px; }
  .dropzone-sub { font-size: 11.5px; margin-bottom: 10px; }

  .opts-box { padding: 12px; }
  .ad-slot { min-height: 50px; margin: 8px 0; }
  .section { margin: 18px 0; }
  .section-head { flex-direction: column; gap: 2px; }
  .section-head h2 { font-size: 15.5px; }
  .calc-date { font-size: 26px; }
  .footer { padding: 16px 0; }
  .footer-links { gap: 10px; }
}
