/* =====================================================
   Finanse Bez Owijania — Stitch Dark Base (universal overlay)
   Ładowane na WSZYSTKICH podstronach (po ich własnych CSS)
   żeby żadna sekcja nie zostawała biała. Nadpisuje tło
   elementów, które w szablonach mają twarde #fff / jasne
   kolory. Nie ruszamy treści/układu.
   ===================================================== */

/* Bazowe tło na wypadek, gdyby inline <style> nie zadziałał */
html,
body {
  background: #10150f !important;
  color: #e0e4da !important;
}

/* Uniwersalne ciemne tło dla kart, kontenerów i paneli */
.card,
.panel,
.section,
.box,
.content-box,
.form,
.form-section,
.feature-box,
.support-main,
.support-container,
.pin-item,
.pin-info,
.pencraft,
.article-card,
.product-ad-card,
.calc-result,
.budget-chart-container,
.result-card,
.calc-form,
.wrap,
.inner,
.slot {
  background: #111418 !important;
  border-color: #40493d !important;
  color: #e0e4da !important;
  box-shadow: none !important;
}

/* Inputy / selecty / textarea na podstronach */
input,
select,
textarea {
  background: #0A0C10 !important;
  color: #e0e4da !important;
  border: 1px solid #40493d !important;
  border-radius: 6px !important;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #88d982 !important;
  outline: none !important;
  box-shadow: 0 0 0 1px #2e7d32 !important;
}
select {
  background-color: #0A0C10 !important;
}
select option {
  background: #111418 !important;
  color: #e0e4da !important;
}
input::placeholder,
textarea::placeholder {
  color: #64748b !important;
}

/* Przyciski — ciemny motyw Stitch */
button,
.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.calc-cta-button,
.taryfa-btn,
.filter-btn {
  background: #2e7d32 !important;
  color: #cbffc2 !important;
  border: 1px solid #40493d !important;
  border-radius: 6px !important;
}
button:hover,
.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-ghost:hover,
.calc-cta-button:hover,
.taryfa-btn:hover,
.filter-btn:hover {
  background: #1b6d24 !important;
  color: #a3f69c !important;
}

/* Linki */
a { color: #88d982 !important; }
a:hover { color: #a3f69c !important; }

/* Nagłówki na ciemnym tle */
h1, h2, h3, h4, h5, h6 {
  color: #e0e4da !important;
}

/* Stopki i nagłówki sekcji z jasnym tłem */
footer,
.site-footer,
.blog-footer,
.header,
.site-header,
.ch-topbar,
.privacy-nav,
.nav {
  background: #111418 !important;
  border-color: #40493d !important;
  color: #e0e4da !important;
}
header a,
.site-header a,
.ch-topbar a,
.nav a {
  color: #e0e4da !important;
}

/* Kontenery z białym tłem (usuwanie ostrych #ffffff) */
.container,
.main-container,
.content {
  background: transparent !important;
}
.container .card {
  background: #111418 !important;
}

/* Tabele — ciemne wiersze */
table {
  background: #111418 !important;
  color: #e0e4da !important;
  border-color: #40493d !important;
}
table th {
  background: #262b25 !important;
  color: #88d982 !important;
}
table td {
  background: #1c211b !important;
  color: #e0e4da !important;
  border-color: #40493d !important;
}

/* Favfelment: przywracamy przypisane kolory akcentów (nie dotyczy) */

/* =========================================================================
   WYDAJNOŚĆ KONTRASTU TEKSTU
   Szablony mają twarde ciemne kolory tekstu (#212121, #333, #555, #757575)
   nałożone na ciemne tło Stitch → prawie niewidoczne. Podnosimy je na jasne.
   ========================================================================= */
h1, h2, h3, h4, h5, h6,
p, li, ul, ol,
strong, b, em, span,
a, small, blockquote, figure, figcaption,
td, th, label, .lead, .subtitle, .section-subtitle,
.verdict, .result, .description, .product-ad-desc,
.chf-card p, .entry-point-card p, .how-card p,
.pseo-variant-card p, .benefit-card p, .feature-card p,
.faq-answer p, .faq-toggle span,
.tool-card p, .tool-card-title, .calc-form label, .calc-result-item span {
  color: #e0e4da !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
/* Zachowaj akcent kolorem głównym (zielony) tam, gdzie był zamierzony */
a, .stitch-primary, .accent { color: #88d982 !important; }
a:hover { color: #a3f69c !important; }
/* Muted wciąż jaśniej niż domyślny szary, ale czytelny */
.muted, .muted-text, .para-muted, .desc, .meta, .date,
.blog-meta, .article-date, .chapter-meta, .muted-small {
  color: #bfcaba !important;
}
/* Zielone akcenty statusów — wyższy kontrast na ciemnym */
.success, .ok { color: #10B981 !important; }
.warning { color: #F59E0B !important; }
.danger, .error, .over { color: #ffb4ab !important; }
.data-blue { color: #a9c7ff !important; }

/* =========================================================================
   ACCESSIBILITY — focus-ring + reduced-motion
   ========================================================================= */
:focus-visible {
  outline: 2px solid #88d982;
  outline-offset: 2px;
  border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* === Tools hub final override: ładowane po uniwersalnej nakładce === */
body .tools-hub-header {
  background: transparent !important;
  text-align: left !important;
}
body .tools-search-wrap {
  width: min(100%, 672px) !important;
  max-width: 672px !important;
  min-height: 44px !important;
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  background: #111418 !important;
  border: 1px solid #1B2026 !important;
  border-radius: 2px !important;
  padding: 0 16px !important;
}
body .tools-search-wrap .tools-search-icon {
  color: #bfcaba !important;
  text-shadow: none !important;
}
body .tools-filters .filter-btn,
body .tools-filters button {
  background: #111418 !important;
  border: 1px solid #1B2026 !important;
  border-radius: 9999px !important;
  color: #bfcaba !important;
}
body .tools-filters .filter-btn:hover,
body .tools-filters button:hover {
  background: #111418 !important;
  border-color: #40493d !important;
  color: #e0e4da !important;
}
body .tools-filters .filter-btn.active,
body .tools-filters button.active {
  background: #2e7d32 !important;
  border-color: #88d982 !important;
  color: #cbffc2 !important;
}
body .tools-grid {
  width: 100% !important;
  max-width: var(--stitch-container-max, 1280px) !important;
  margin: 0 auto var(--stitch-spacing-6, 48px) !important;
  padding: 0 var(--stitch-margin-mobile, 16px) !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 20px !important;
  box-sizing: border-box !important;
}
body .tools-nav {
  padding: 0 !important;
}
body .tools-nav,
body .fbo-public-nav,
body .blog-site-header.fbo-public-nav {
  min-height: var(--stitch-nav-height, 64px) !important;
  background: rgba(16, 21, 15, 0.96) !important;
  border-bottom: 1px solid var(--stitch-outline-variant, #40493d) !important;
  box-shadow: none !important;
  backdrop-filter: blur(12px) !important;
}
body .tools-nav-inner {
  width: 100% !important;
  max-width: var(--stitch-container-max, 1280px) !important;
  min-height: var(--stitch-nav-height, 64px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--stitch-margin-mobile, 16px) !important;
  padding-right: var(--stitch-margin-mobile, 16px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: var(--stitch-spacing-4, 24px) !important;
  box-sizing: border-box !important;
}
body .fbo-public-nav-inner {
  width: 100% !important;
  max-width: var(--stitch-container-max, 1280px) !important;
  min-height: var(--stitch-nav-height, 64px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--stitch-margin-mobile, 16px) !important;
  padding-right: var(--stitch-margin-mobile, 16px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: var(--stitch-spacing-4, 24px) !important;
  box-sizing: border-box !important;
}
body .tools-nav-brand,
body .fbo-public-brand {
  color: var(--stitch-on-surface, #e0e4da) !important;
  font-family: var(--stitch-font-display, "Space Grotesk", ui-sans-serif, system-ui, sans-serif) !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  text-shadow: 0 1px 0 rgba(255,255,255,0.08) !important;
  white-space: nowrap !important;
}
body .tools-nav-links,
body .fbo-public-links {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: var(--stitch-spacing-2, 8px) !important;
}
body .tools-nav-links a,
body .fbo-public-links a {
  min-height: 40px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: var(--stitch-spacing-1, 4px) !important;
  padding: 0 var(--stitch-spacing-2, 8px) !important;
  color: var(--stitch-on-surface-variant, #bfcaba) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: var(--stitch-radius-btn, 4px) !important;
  font-family: var(--stitch-font-body, "JetBrains Mono", ui-monospace, monospace) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
  text-decoration: none !important;
}
body .tools-nav-links a:hover,
body .tools-nav-links a:focus-visible,
body .fbo-public-links a:hover,
body .fbo-public-links a:focus-visible {
  color: var(--stitch-primary, #88d982) !important;
  background: var(--stitch-surface-container, #1c211b) !important;
  border-color: var(--stitch-outline-variant, #40493d) !important;
  outline: none !important;
  text-decoration: none !important;
}
body .tools-nav-links a[aria-current="page"],
body .fbo-public-links a[aria-current="page"] {
  color: var(--stitch-primary, #88d982) !important;
  font-weight: 700 !important;
}
body .tools-nav-links .nav-icon,
body .fbo-public-links .material-symbols-outlined {
  color: currentColor !important;
  font-size: 20px !important;
  line-height: 1 !important;
}
body .tools-hub-header,
body .tools-filters,
body .tools-grid,
body .tools-footer > * {
  margin-left: auto !important;
  margin-right: auto !important;
}
body .tools-hub-header,
body .tools-filters,
body .tools-grid {
  max-width: var(--stitch-container-max, 1280px) !important;
}
body .tools-filters {
  margin-bottom: 40px !important;
  padding-left: var(--stitch-margin-mobile, 16px) !important;
  padding-right: var(--stitch-margin-mobile, 16px) !important;
  justify-content: flex-start !important;
  row-gap: 8px !important;
}
body .tools-footer {
  padding-left: var(--stitch-margin-mobile, 16px) !important;
  padding-right: var(--stitch-margin-mobile, 16px) !important;
}
body .tools-footer > * {
  max-width: var(--stitch-container-max, 1280px) !important;
}
@media (min-width: 768px) {
  body .tools-grid,
  body .tools-filters,
  body .tools-footer,
  body .tools-nav-inner,
  body .fbo-public-nav-inner {
    padding-left: var(--stitch-margin-desktop, 64px) !important;
    padding-right: var(--stitch-margin-desktop, 64px) !important;
  }
  body .tools-hub-header {
    padding-left: var(--stitch-margin-desktop, 64px) !important;
    padding-right: var(--stitch-margin-desktop, 64px) !important;
  }
}
@media (max-width: 768px) {
  body .tools-nav-inner {
    min-height: 64px !important;
    gap: 12px !important;
  }
  body .fbo-public-nav-inner {
    min-height: 64px !important;
    gap: 12px !important;
  }
  body .tools-nav-brand,
  body .fbo-public-brand {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 1rem !important;
  }
  body .tools-nav-links,
  body .fbo-public-links {
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
  }
  body .tools-nav-links a,
  body .fbo-public-links a {
    width: 40px !important;
    min-width: 40px !important;
    padding: 0 !important;
    justify-content: center !important;
  }
  body .tools-nav-links .nav-text,
  body .fbo-public-links a > span:not(.material-symbols-outlined) {
    display: none !important;
  }
  body .tools-nav-links .nav-icon,
  body .fbo-public-links .material-symbols-outlined {
    font-size: 21px !important;
  }
}
body .tools-grid .tool-card {
  min-height: 258px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 16px !important;
  background: #111418 !important;
  border: 1px solid #1B2026 !important;
  border-radius: 8px !important;
  color: #e0e4da !important;
  padding: 24px !important;
  text-align: left !important;
  text-decoration: none !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025) !important;
}
body .tools-grid .tool-card:hover {
  background: #181d17 !important;
  border-color: #88d982 !important;
}
body .tools-grid .tool-card-icon,
body .related-card-icon {
  width: 54px !important;
  height: 54px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #16201a !important;
  border: 1px solid #2e7d32 !important;
  border-bottom-color: #88d982 !important;
  border-radius: 8px !important;
  color: #88d982 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05) !important;
  font-family: "Material Symbols Outlined" !important;
  font-size: 30px !important;
  font-feature-settings: "liga" !important;
  font-variation-settings: "FILL" 1, "wght" 560, "GRAD" 0, "opsz" 30 !important;
  line-height: 1 !important;
  text-shadow: none !important;
}
body .tools-grid .tool-card:nth-child(3n + 2) .tool-card-icon,
body .related-card:nth-child(3n + 2) .related-card-icon {
  background: #101d2e !important;
  border-color: #005db7 !important;
  border-bottom-color: #a9c7ff !important;
  color: #a9c7ff !important;
}
body .tools-grid .tool-card:nth-child(3n) .tool-card-icon,
body .related-card:nth-child(3n) .related-card-icon {
  background: #251722 !important;
  border-color: #8e3a58 !important;
  border-bottom-color: #ffb1c7 !important;
  color: #ffb1c7 !important;
}
body .tools-grid .tool-card h2,
body .tools-grid .tool-card h3 {
  margin: 8px 0 0 !important;
  color: #e0e4da !important;
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif !important;
  font-size: clamp(24px, 2vw, 32px) !important;
  line-height: 1.18 !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
}
body .tools-grid .tool-card p {
  margin: 0 !important;
  color: #d1dacb !important;
  font-size: 16px !important;
  line-height: 1.55 !important;
  text-shadow: none !important;
}
body .tools-grid .tool-card-cta {
  margin-top: auto !important;
  padding-top: 16px !important;
  width: 100% !important;
  border-top: 1px solid #40493d !important;
  color: #88d982 !important;
  font-family: "JetBrains Mono", ui-monospace, monospace !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  text-shadow: none !important;
}
body .tools-grid .tool-card-header {
  width: 100% !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 16px !important;
}
body .tool-badge-popular {
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-left: auto !important;
  background: #1c211b !important;
  border: 1px solid #40493d !important;
  border-radius: 4px !important;
  color: #bfcaba !important;
  text-shadow: none !important;
}
body .tool-badge-popular .material-symbols-outlined {
  color: #ffb1c7 !important;
  font-size: 15px !important;
}
@media (max-width: 1120px) {
  body .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 720px) {
  body .tools-grid { grid-template-columns: 1fr !important; }
  body .tools-grid .tool-card { min-height: 220px !important; }
}

/* Pagination */
body .tools-pagination {
  display: flex !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding: 0 16px 48px !important;
  max-width: var(--stitch-container-max, 1200px) !important;
  margin: 0 auto !important;
}
body .tools-pagination .page-btn {
  min-width: 40px;
  height: 40px;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 14px !important;
  background: #1c211b !important;
  border: 1px solid #40493d !important;
  border-radius: 4px !important;
  color: #bfcaba !important;
  font-family: "JetBrains Mono", ui-monospace, monospace !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  cursor: pointer !important;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease !important;
}
body .tools-pagination .page-btn:hover {
  border-color: #88d982 !important;
  color: #e0e4da !important;
}
body .tools-pagination .page-btn.active {
  background: #2e7d32 !important;
  border-color: #88d982 !important;
  color: #e0ffd8 !important;
}

/* =====================================================
   TOOLS — share + budget bridge (ciemny Stitch)
   Oba bloki są wstrzykiwane runtime'owo przez wspólny JS
   (/tools/_common.js → #calculator-budget-bridge,
    /js/sharing.js → .social-share) i mają twarde jasne
   tła (#f5f9ff / #f5f5f5), które odcinały się od
   ciemnego layoutu narzędzi. Podbijamy specyficzność
   (body + klasa), bo <style> z sharing.js jest wstrzykiwany
   do DOM już po arkuszach.
   ===================================================== */

/* — Kalkulator → budżet (bridge pod wynikami) — */
body .calculator-budget-bridge {
  background: #1c211b !important;
  border: 1px solid #40493d !important;
  color: #e0e4da !important;
}
body .calculator-budget-bridge strong {
  color: #e0e4da !important;
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
}
body .calculator-budget-bridge p {
  color: #bfcaba !important;
}
body .calculator-budget-bridge .calculator-budget-button {
  background: #2e7d32 !important;
  border: 1px solid #88d982 !important;
  border-radius: 4px !important;
  color: #cbffc2 !important;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
body .calculator-budget-bridge .calculator-budget-button:hover {
  background: #388e3c !important;
  color: #e0ffd8 !important;
}

/* — Udostępnij (legacy social-share z /js/sharing.js) — */
body .social-share {
  background: #1c211b !important;
  border: 1px solid #40493d !important;
  border-radius: 4px !important;
  color: #e0e4da !important;
}
body .social-share h3 {
  color: #e0e4da !important;
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.01em;
}
body .social-share .share-btn {
  background: #111418 !important;
  border: 1px solid #40493d !important;
  border-radius: 9999px !important;
  color: #bfcaba !important;
  font-weight: 600;
}
body .social-share .share-btn:hover {
  background: #111418 !important;
  border-color: #88d982 !important;
  color: #88d982 !important;
}
