/* ==========================================================================
   Generatory Online — arkusz stylów
   Mobile-first, viewport-aware, AdSense-ready
   Paleta: atrament (#15233B), kość (#F5F2EA), amarant (#C8102E – polska czerwień),
           bursztyn (#E9A227), szałwia (#5B7B6F)
   Typografia: "Spectral" (display, szeryfowy), "Inter" (tekst), "JetBrains Mono" (dane)
   ========================================================================== */

:root {
  --ink: #15233B;
  --ink-soft: #2C3A52;
  --bone: #F5F2EA;
  --bone-deep: #EBE6D8;
  --amaranth: #C8102E;
  --amaranth-dark: #A50D26;
  --amber: #E9A227;
  --sage: #5B7B6F;
  --line: #D8D1C0;
  --muted: #6B7280;
  --white: #FFFFFF;
  --ok: #2E7D54;
  --warn: #B45309;

  --maxw: 1180px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(21, 35, 59, .06), 0 8px 28px rgba(21, 35, 59, .08);
  --shadow-lg: 0 2px 6px rgba(21, 35, 59, .08), 0 20px 50px rgba(21, 35, 59, .14);

  --font-display: "Spectral", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bone);
  line-height: 1.65;
  font-size: clamp(15px, 1.15vw + 11px, 17px);
  overflow-x: hidden;
}

/* Subtelne tło z siatki – ślad "narzędziowni" */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(21,35,59,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21,35,59,.025) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--amaranth); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }

/* ---------- Typografia ---------- */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 5.2vw, 50px); }
h2 { font-size: clamp(23px, 3.6vw, 34px); margin-bottom: .5em; }
h3 { font-size: clamp(19px, 2.4vw, 24px); }
h4 { font-size: clamp(17px, 1.8vw, 20px); }
h5 { font-size: 16px; }
h6 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--sage); }
p { margin-bottom: 1em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--amaranth);
  font-weight: 600;
  display: inline-block;
  margin-bottom: .9em;
}

/* ---------- Pasek górny (skip + flaga) ---------- */
.topbar {
  background: var(--ink);
  color: var(--bone);
  font-size: 13px;
  font-family: var(--font-mono);
}
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 38px; gap: 12px; }
.topbar .pl-flag { display: inline-flex; align-items: center; gap: 8px; }
.topbar .pl-flag span { width: 22px; height: 14px; border-radius: 2px; overflow: hidden; display: inline-flex; flex-direction: column; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
.topbar .pl-flag span i { display: block; height: 50%; width: 100%; }
.topbar .pl-flag span i:first-child { background: #fff; }
.topbar .pl-flag span i:last-child { background: var(--amaranth); }
.topbar .clock { opacity: .85; }

/* ---------- Header / nawigacja ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245,242,234,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--ink), var(--ink-soft));
  color: var(--amber);
  display: grid; place-items: center;
  font-size: 21px; flex: none;
  box-shadow: inset 0 0 0 1px rgba(233,162,39,.25);
}
.brand b { color: var(--amaranth); }

.nav-toggle { display: none; background: none; border: 1.5px solid var(--line); border-radius: 9px; width: 44px; height: 40px; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { content: ""; display: block; width: 20px; height: 2px; background: var(--ink); position: relative; transition: .2s; }
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

.main-nav ul { list-style: none; display: flex; gap: 4px; align-items: center; }
.main-nav a { color: var(--ink-soft); font-weight: 500; font-size: 15px; padding: 8px 13px; border-radius: 9px; transition: background .15s, color .15s; }
.main-nav a:hover { background: var(--bone-deep); color: var(--ink); text-decoration: none; }
.main-nav a.cta { background: var(--amaranth); color: #fff; }
.main-nav a.cta:hover { background: var(--amaranth-dark); }

/* ---------- Hero ---------- */
.hero { padding: clamp(34px, 6vw, 70px) 0 clamp(26px, 4vw, 44px); position: relative; }
.hero-grid { display: grid; gap: clamp(28px, 4vw, 52px); }
.hero h1 { margin-bottom: .35em; }
.hero h1 em { font-style: normal; color: var(--amaranth); }
.hero .lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-soft); max-width: 60ch; }
.hero .trust { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.hero .trust b { color: var(--ink); }
.hero .trust span { display: inline-flex; align-items: center; gap: 7px; }
.hero .trust span::before { content: "✓"; color: var(--ok); font-weight: 700; }

/* ---------- Tool box (główne narzędzie – pierwszy ekran) ---------- */
.toolcard {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.toolcard__head { padding: clamp(18px, 3vw, 26px) clamp(18px, 3vw, 28px) 0; }
.toolcard__head h2 { font-size: clamp(20px, 2.6vw, 26px); margin-bottom: .2em; }
.toolcard__head p { color: var(--muted); font-size: 14.5px; margin-bottom: 0; }
.toolcard__body { padding: clamp(16px, 3vw, 26px); }
.toolcard__foot {
  background: var(--bone);
  border-top: 1px dashed var(--line);
  padding: 13px clamp(18px, 3vw, 28px);
  font-size: 12.5px; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.toolcard__foot::before { content: "ⓘ"; color: var(--sage); font-size: 15px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }

input[type=text], input[type=number], select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px; /* zapobiega zoomowi na iOS */
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bone);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(21,35,59,.12);
  background: #fff;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.55; }

.row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .08s, background .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--amaranth); color: #fff; box-shadow: 0 6px 16px rgba(200,16,46,.22); }
.btn-primary:hover { background: var(--amaranth-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bone-deep); }
.btn-ink { background: var(--ink); color: var(--bone); }
.btn-ink:hover { background: var(--ink-soft); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--bone); }
.seg button { background: none; border: none; padding: 10px 15px; font-family: var(--font-body); font-size: 14px; font-weight: 500; cursor: pointer; color: var(--ink-soft); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bone); }

/* Wynik */
.result {
  margin-top: 18px;
  border: 1.5px dashed var(--sage);
  border-radius: var(--radius-sm);
  background: #fbfaf6;
  padding: 16px;
  min-height: 58px;
}
.result:empty { display: none; }
.result-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-family: var(--font-mono);
  font-size: clamp(15px, 2.4vw, 19px);
  padding: 9px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  word-break: break-all;
}
.result-item:last-child { margin-bottom: 0; }
.result-item .val { font-weight: 600; color: var(--ink); }
.copy-btn { background: var(--bone-deep); border: 1px solid var(--line); border-radius: 7px; padding: 6px 11px; font-size: 12.5px; font-family: var(--font-body); cursor: pointer; color: var(--ink-soft); flex: none; }
.copy-btn:hover { background: var(--amber); color: var(--ink); border-color: var(--amber); }
.copy-btn.done { background: var(--ok); color: #fff; border-color: var(--ok); }

.badge { display: inline-block; font-family: var(--font-mono); font-size: 11.5px; padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.badge-ok { background: rgba(46,125,84,.12); color: var(--ok); }
.badge-bad { background: rgba(200,16,46,.1); color: var(--amaranth); }

/* ---------- Sekcje ---------- */
.section { padding: clamp(34px, 5vw, 60px) 0; }
.section--alt { background: var(--bone-deep); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__head { max-width: 64ch; margin-bottom: clamp(22px, 3vw, 36px); }
.section__head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- Siatka narzędzi ---------- */
.tool-cats { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
.cat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.cat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--sage); }
.cat__icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-size: 22px; background: var(--bone-deep); margin-bottom: 14px; }
.cat h3 { font-size: 18px; margin-bottom: 6px; }
.cat p { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.cat ul { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; }
.cat ul a { font-size: 13px; padding: 5px 11px; background: var(--bone); border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); }
.cat ul a:hover { background: var(--ink); color: var(--bone); text-decoration: none; }

/* ---------- Kroki "jak używać" ---------- */
.steps { counter-reset: step; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.step { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px 20px; box-shadow: var(--shadow); }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  color: var(--amaranth);
  position: absolute; top: 16px; right: 18px;
}
.step h4 { margin-bottom: 6px; }
.step p { font-size: 14px; color: var(--muted); margin-bottom: 0; }

/* ---------- Tekst objaśniający (prose) ---------- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.4em; }
.prose h3 { margin-top: 1.2em; margin-bottom: .4em; }
.prose ul, .prose ol { margin: 0 0 1.1em 1.3em; }
.prose li { margin-bottom: .45em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 14.5px; }
.prose th, .prose td { text-align: left; padding: 10px 13px; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--font-display); background: var(--bone-deep); }
.prose code { font-family: var(--font-mono); font-size: .9em; background: var(--bone-deep); padding: 2px 6px; border-radius: 5px; }
.callout { border-left: 4px solid var(--amber); background: #fffaf0; padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 1.2em 0; font-size: 14.5px; }
.callout.warn { border-left-color: var(--amaranth); background: #fdf2f3; }

/* ---------- FAQ ---------- */
.faq { max-width: 80ch; }
.faq details { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; }
.faq summary { cursor: pointer; padding: 16px 20px; font-family: var(--font-display); font-weight: 700; font-size: 17px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; color: var(--amaranth); font-family: var(--font-body); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 20px 18px; color: var(--ink-soft); font-size: 14.5px; }

/* ---------- Opinie ---------- */
.reviews { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.review { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.review .stars { color: var(--amber); letter-spacing: 2px; margin-bottom: 10px; }
.review p { font-size: 14.5px; }
.review .who { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }

/* ---------- Breadcrumb ---------- */
.crumbs { font-size: 13px; font-family: var(--font-mono); color: var(--muted); padding: 14px 0; }
.crumbs a { color: var(--sage); }
.crumbs span { margin: 0 7px; opacity: .6; }

/* ---------- Reklama (AdSense placeholder) ---------- */
.ad-slot {
  margin: clamp(20px, 4vw, 34px) auto;
  max-width: 970px;
  min-height: 90px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(45deg, #fbfaf6, #fbfaf6 12px, #f4f1ea 12px, #f4f1ea 24px);
  display: grid; place-items: center;
  color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
}

/* ---------- Powiązane narzędzia ---------- */
.related { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.related a { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 18px; color: var(--ink); box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.related a:hover { transform: translateY(-2px); border-color: var(--amaranth); text-decoration: none; }
.related a b { display: block; font-family: var(--font-display); font-size: 16px; }
.related a small { color: var(--muted); }

/* ---------- Udostępnij ---------- */
.share { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.share span { font-size: 13px; color: var(--muted); font-family: var(--font-mono); }
.share a { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--bone-deep); color: var(--ink); font-weight: 700; font-size: 14px; border: 1px solid var(--line); }
.share a:hover { background: var(--ink); color: var(--bone); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #C7CEDB; padding: clamp(40px, 5vw, 64px) 0 24px; margin-top: clamp(40px, 6vw, 70px); }
.site-footer a { color: #C7CEDB; }
.site-footer a:hover { color: #fff; }
.foot-grid { display: grid; gap: 30px; grid-template-columns: 1.4fr repeat(3, 1fr); }
.foot-brand .brand { color: #fff; }
.foot-brand .brand b { color: var(--amber); }
.foot-brand p { font-size: 14px; margin-top: 14px; max-width: 38ch; color: #9AA4B5; }
.foot-col h4 { color: #fff; font-size: 15px; margin-bottom: 14px; font-family: var(--font-body); font-weight: 600; }
.foot-col ul { list-style: none; }
.foot-col li { margin-bottom: 9px; font-size: 14px; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 34px; padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: #8C97A8; }

/* ---------- Cookies ---------- */
.cookie-bar {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  width: min(680px, calc(100% - 28px));
  background: var(--ink); color: var(--bone);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 16px 18px; z-index: 80;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  font-size: 13.5px;
}
.cookie-bar p { margin: 0; flex: 1 1 280px; color: #C7CEDB; }
.cookie-bar a { color: var(--amber); }
.cookie-bar .btn { padding: 9px 18px; font-size: 14px; }
.cookie-bar.hidden { display: none; }

/* ---------- 404 ---------- */
.error-page { text-align: center; padding: clamp(50px, 9vw, 120px) 0; }
.error-page .code { font-family: var(--font-mono); font-size: clamp(70px, 18vw, 150px); font-weight: 700; color: var(--amaranth); line-height: 1; }
.error-page h1 { margin: 10px 0 14px; }
.error-page p { color: var(--ink-soft); max-width: 48ch; margin: 0 auto 26px; }

/* ---------- Responsywność nawigacji ---------- */
@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bone); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; padding: 12px; gap: 2px; }
  .main-nav a { padding: 12px 14px; border-radius: 9px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .foot-grid { grid-template-columns: 1fr; }
  .topbar .clock { display: none; }
}

/* ---------- Dostępność ---------- */
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 100; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============================================================
   Dodatkowe komponenty narzędzi (grid, checkboxy, suwak, kody)
   ============================================================ */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.grid2 .field { margin: 0; }
@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; gap: 12px; }
}

/* Grupa checkboxów */
.checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}
@media (max-width: 520px) { .checks { grid-template-columns: 1fr; } }
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color .15s ease, background .15s ease;
}
.check:hover { border-color: var(--sage); }
.check input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--amaranth);
  flex: none;
  margin: 0;
}

/* Suwak długości (range) */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amaranth), var(--amber));
  outline: none;
  margin: 12px 0 4px;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(21,35,59,.35);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(21,35,59,.35);
  cursor: pointer;
}

/* Segmentowany przełącznik — wariant zawijany (wiele opcji) */
.seg--wrap { flex-wrap: wrap; }
.seg--wrap button { flex: 1 1 auto; }

/* Pojemniki na kod kreskowy / QR */
.barcode-box, .qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  margin-top: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 120px;
}
.barcode-box:empty, .qr-box:empty { display: none; }
.barcode-box svg, .qr-box svg { max-width: 100%; height: auto; }
.qr-box svg { width: 240px; max-width: 100%; }

/* Oscyloskop / wykres przebiegu */
.scope-box {
  margin-top: 6px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}
.scope-box canvas {
  display: block;
  width: 100%;
  height: 180px;
  border-radius: 8px;
}
.readout {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.readout div { font-size: 0.95rem; color: var(--ink-soft); }
.readout strong { font-family: var(--mono, monospace); color: var(--ink); }
.play-btn.is-on { background: var(--amaranth); border-color: var(--amaranth); color: #fff; }

/* Kalendarz */
.cal-table { width: 100%; border-collapse: collapse; margin-top: 6px; background: #fff; }
.cal-table caption { font-family: var(--display, serif); font-size: 1.25rem; font-weight: 700; color: var(--ink); padding: 8px 0 14px; text-transform: capitalize; }
.cal-table th { padding: 8px 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 2px solid var(--line); }
.cal-table td { height: 52px; width: 14.28%; vertical-align: top; padding: 6px; border: 1px solid var(--line); font-size: .95rem; color: var(--ink-soft); }
.cal-table td.cal-empty { background: var(--bone); border-color: var(--bone); }
.cal-table td .d { font-weight: 600; color: var(--ink); }
.cal-table td.cal-hol { background: #FBEAEC; }
.cal-table td.cal-hol .d, .cal-table td.cal-sun .d { color: var(--amaranth); }
.cal-hol-name { display: block; font-size: .66rem; line-height: 1.15; margin-top: 2px; color: var(--amaranth); }
.cal-legend { margin-top: 12px; font-size: .85rem; color: var(--muted); }

/* Wizytówka */
.bizcard { width: 100%; max-width: 420px; aspect-ratio: 85/55; margin: 6px auto 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.bizcard .bc-accent-bar { height: 6px; border-radius: 4px; background: var(--accent, #C8102E); margin: -22px -24px 16px; }
.bizcard .bc-name { font-family: var(--display, serif); font-size: 1.5rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.bizcard .bc-title { font-size: .95rem; color: var(--accent, #C8102E); margin-top: 2px; }
.bizcard .bc-company { font-size: 1rem; font-weight: 600; color: var(--ink-soft); margin-top: 10px; }
.bizcard .bc-contact { margin-top: auto; padding-top: 12px; font-size: .85rem; color: var(--muted); line-height: 1.5; }
.bizcard.acc-amaranth { --accent: #C8102E; } .bizcard.acc-sage { --accent: #5B7B6F; } .bizcard.acc-ink { --accent: #15233B; }

/* Zaproszenie */
.invite { width: 100%; max-width: 420px; margin: 6px auto 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 34px 28px; text-align: center; }
.invite .inv-kicker { font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.invite .inv-title { font-family: var(--display, serif); font-size: 1.9rem; font-weight: 700; color: var(--ink); margin: 8px 0; }
.invite .inv-name { font-size: 1.1rem; color: var(--ink-soft); }
.invite .inv-sep { width: 48px; height: 2px; background: var(--amaranth); margin: 18px auto; }
.invite .inv-meta { font-size: 1rem; color: var(--ink-soft); line-height: 1.7; }
.invite .inv-note { font-size: .9rem; color: var(--muted); margin-top: 16px; font-style: italic; }

/* Pieczątka */
.stamp-box { display: flex; justify-content: center; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 6px; }
.stamp-box:empty { display: none; }
.stamp-box svg { width: 260px; height: 260px; max-width: 100%; }

/* Flexbox playground */
.flex-demo { display: flex; gap: 8px; min-height: 170px; padding: 12px; background: var(--bone); border: 1px dashed var(--line); border-radius: var(--radius); margin-top: 6px; }
.flex-demo .flex-item { background: var(--ink); color: #fff; border-radius: 8px; padding: 14px 20px; font-family: var(--font-mono, monospace); font-weight: 600; display: flex; align-items: center; justify-content: center; }
.flex-demo .flex-item:nth-child(2) { background: var(--amaranth); }
.flex-demo .flex-item:nth-child(3) { background: var(--sage); }
.flex-demo .flex-item:nth-child(4) { background: var(--amber); color: var(--ink); }
.flex-demo .flex-item:nth-child(5) { background: var(--ink-soft); }
.code-box { margin-top: 14px; background: var(--ink); color: #E6EAF2; border-radius: var(--radius); padding: 16px 18px; font-family: var(--font-mono, monospace); font-size: .9rem; line-height: 1.55; white-space: pre; overflow-x: auto; }
.code-box:empty { display: none; }

/* Podpis odręczny */
.sig-preview { display: flex; align-items: center; justify-content: center; min-height: 150px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 6px; font-size: 54px; line-height: 1.25; padding: 18px; text-align: center; word-break: break-word; }

/* Drabinka turniejowa */
.bracket-box { margin-top: 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; overflow-x: auto; }
.bracket-box svg { height: auto; }
.bracket-box:empty { display: none; }


/* Podgląd druku przelewu */
.przelew-print .pp-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.przelew-print .pp-row:last-child { border-bottom: 0; }
.przelew-print .pp-row span:first-child {
  color: var(--sage);
  font-family: var(--font-body);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.przelew-print .pp-row span:last-child { font-weight: 600; text-align: right; word-break: break-word; }

/* ============================================================
   Strona główna — hero, wyszukiwarka, use-cases; strony statyczne; 404
   ============================================================ */
.hero--home { text-align: center; }
.hero--home .eyebrow { display: inline-block; }
.hero--home h1 { max-width: 16ch; margin: 10px auto 14px; }
.hero--home .lead { max-width: 60ch; margin-left: auto; margin-right: auto; }
.home-search { max-width: 520px; margin: 22px auto 6px; }
.home-search input {
  width: 100%;
  font-size: 17px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--shadow);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.home-search input:focus { border-color: var(--amaranth); box-shadow: var(--shadow-lg); }
.trust--home { justify-content: center; }

.nohit {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  padding: 24px 0 4px;
}

/* Use-cases */
.usecases { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.uc { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--sage); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.uc h3 { font-size: 17px; margin-bottom: 7px; }
.uc p { font-size: 14px; color: var(--muted); margin-bottom: 0; }

/* Strony statyczne / treściowe */
.page-head { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(28px, 5vw, 40px); }
.prose--page { max-width: 760px; }

/* 404 */
.error-404 { text-align: center; }
.err-box { max-width: 620px; margin: 0 auto; }
.err-code {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(56px, 14vw, 104px);
  line-height: 1;
  color: var(--amaranth);
  letter-spacing: -.02em;
}
.error-404 h1 { margin: 6px 0 10px; }
.error-404 .lead { max-width: 52ch; margin-left: auto; margin-right: auto; }
.err-cta { margin-top: 20px; }
.error-404 .section__head { text-align: center; }
.error-404 .related { text-align: left; }

/* ============ Footer: zaprzyjaźnione strony (friend links) ============ */
.foot-friends { border-top: 1px solid rgba(255,255,255,.10); margin-top: 22px; padding-top: 18px; }
.foot-friends h4 { font-size: .82rem; letter-spacing: .05em; text-transform: uppercase; color: #9aa6b8; margin: 0 0 10px; }
.friend-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.friend-links a { color: #c2ccda; font-size: .92rem; text-decoration: none; }
.friend-links a:hover { color: #fff; text-decoration: underline; }

/* ============ Blog / Poradniki ============ */
.page-head, .article-head { max-width: 768px; margin: 0 0 24px; }
.page-head h1, .article-head h1 { margin: .25em 0 .35em; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.post-card { display: block; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.post-date { font: 600 .8rem/1 var(--font-mono); color: var(--amaranth); letter-spacing: .03em; }
.post-card h2 { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.3; margin: .5em 0 .4em; color: var(--ink); }
.post-card p { font-size: .95rem; color: var(--muted); margin: 0 0 .9em; }
.post-more { font-weight: 600; color: var(--ink-soft); font-size: .92rem; }

/* Article layout with sidebar (4th ad position) */
.article-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 38px; align-items: start; }
.article-aside { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 16px; }
.aside-box { background: var(--bone); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.aside-box h4 { margin: 0 0 10px; font-size: 1rem; }
.aside-box ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.aside-box a { color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .95rem; }
.aside-box a:hover { color: var(--amaranth); }
.ad-slot--side { min-height: 600px; max-width: 100%; margin: 0; display: flex; align-items: center; justify-content: center; }
.callout--cta { background: var(--bone); border-color: var(--line); }
@media (max-width: 860px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-aside { position: static; }
  .ad-slot--side { min-height: 120px; }
}

/* ============ Partia 6: plakat, etykieta, faktura, drzewo, trimino, demotywator, logo, gif ============ */
.canvas-box { margin-top: 6px; text-align: center; }
.canvas-box canvas { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.label-sheet { margin-top: 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.label-grid { display: grid; gap: 6px; }
.label-cell { border: 1px dashed var(--line); border-radius: 6px; min-height: 54px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 6px; font-size: .9rem; }
.inv { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 6px; font-size: .92rem; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 12px 0; }
.inv-parties h4 { margin: 0 0 6px; font-size: .95rem; color: var(--amaranth); }
.inv-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: .85rem; }
.inv-table th, .inv-table td { border: 1px solid var(--line); padding: 5px 7px; text-align: left; }
.inv-sum { text-align: right; margin-top: 10px; line-height: 1.7; }
.tree-box, .trimino-box { margin-top: 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; overflow-x: auto; }
.tree-box svg, .trimino-box svg { height: auto; }
.q-box { margin-top: 6px; background: var(--bone); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; font-size: 1.15rem; text-align: center; min-height: 72px; display: flex; align-items: center; justify-content: center; }
.gif-status { margin-top: 8px; font-size: .9rem; color: var(--muted); text-align: center; }
