/* =========================================================
   DobryKalkulator.pl — HOME (FINAL, CLEAN)
   Scope: .dk-home (minimal collisions with Astra/WP)
   Dark mode: html[data-theme="dark"] + html.is-dark + body.is-dark
   HTML: HERO (copy + preview) + SEARCHBAR section under hero
   ========================================================= */

/* ---------- TOKENS ---------- */
:root{
  --dk-blue:#1187d9;
  --dk-orange:#ff9a1a;

  --dk-bg:#ffffff;
  --dk-text:#0f172a;
  --dk-muted:#475569;

  --dk-surface:rgba(255,255,255,.92);
  --dk-surface-2:rgba(255,255,255,.78);
  --dk-line:rgba(15,23,42,.10);

  --dk-radius-lg:18px;
  --dk-radius-xl:24px;

  --dk-ring:rgba(17,135,217,.28);

  --dk-shadow-1:0 10px 24px rgba(15,23,42,.06);
  --dk-shadow-2:0 18px 46px rgba(15,23,42,.10);
  --dk-shadow-3:0 26px 70px rgba(15,23,42,.12);

  --dk-container:1350px;
  --dk-gutter:40px;
  --dk-sticky-top:12px; /* dostosuj, jeśli masz sticky header */
}


/* WP admin bar (jeśli dotyczy) */
body.admin-bar .dk-home{ --dk-sticky-top:44px; }
@media (max-width:782px){
  body.admin-bar .dk-home{ --dk-sticky-top:56px; }
}

html[data-theme="dark"], html.is-dark, body.is-dark{
  --dk-bg:#0b1220;
  --dk-text:#e5e7eb;
  --dk-muted:rgba(168,179,199,.92);

  --dk-surface:rgba(17,24,39,.92);
  --dk-surface-2:rgba(17,24,39,.74);
  --dk-line:rgba(148,163,184,.16);

  --dk-ring:rgba(59,130,246,.34);

  --dk-shadow-1:0 14px 34px rgba(0,0,0,.30);
  --dk-shadow-2:0 22px 60px rgba(0,0,0,.36);
  --dk-shadow-3:0 30px 80px rgba(0,0,0,.44);
}

/* ---------- BASE / RESET (scoped) ---------- */
.dk-home{
  color:var(--dk-text);
  background:var(--dk-bg);
  font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,"Noto Sans","Liberation Sans",sans-serif;
  overflow-x:hidden;
}

.dk-home *, .dk-home *::before, .dk-home *::after{ box-sizing:border-box; }

.dk-home img, .dk-home svg{ max-width:100%; height:auto; display:block; }

.dk-home :where(a, a:visited, a:hover, a:focus, a:active){
  color:inherit;
  text-decoration:none !important; /* Astra często wymusza underline */
}

.dk-home :where(button, input, select){
  font:inherit;
  color:inherit;
}

.dk-home :where(button){
  appearance:none;
  -webkit-appearance:none;
  border:1px solid transparent;
  background:transparent;
  text-transform:none;
}

.dk-home :where(a, button, input, select):focus-visible{
  outline:3px solid var(--dk-ring);
  outline-offset:2px;
  border-radius:14px;
}

.dk-home .dk-wrap{
  width:min(var(--dk-container), calc(100% - var(--dk-gutter)));
  margin-inline:auto;
}

@media (max-width:560px){
  .dk-home .dk-wrap{ width:calc(100% - 24px); }
}

.dk-home .dk-section{
  padding:clamp(18px, 3vw, 40px) 0;
}

/* a11y helper */
.dk-home .dk-sr-only{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}

/* ---------- TYPOGRAPHY ---------- */
.dk-home .dk-h2{
  margin:0 0 8px 0;
  font-size:clamp(24px, 2.4vw, 32px);
  font-weight:950;
  letter-spacing:-.02em;
  line-height:1.15;
}

.dk-home .dk-sub{
  margin:0;
  color:var(--dk-muted);
  max-width:92ch;
  line-height:1.65;
}

.dk-home .dk-section__head{ margin-bottom:14px; }

/* ---------- BUTTONS ---------- */
.dk-home .dk-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px 14px;
  border-radius:14px;
  font-weight:900;
  border:1px solid var(--dk-line);
  background:var(--dk-surface);
  box-shadow:var(--dk-shadow-1);
  transition:transform 120ms ease, box-shadow 160ms ease, border-color 160ms ease, filter 160ms ease;
  white-space:nowrap;
}

.dk-home .dk-btn:active{ transform:translateY(1px); }

.dk-home .dk-btn--primary{
  background:var(--dk-blue);
  color:#fff;
  border-color:rgba(17,135,217,.30);
  box-shadow:0 16px 34px rgba(17,135,217,.18);
}

.dk-home .dk-btn--secondary{
  background:var(--dk-surface);
  border-color:rgba(17,135,217,.18);
}

.dk-home .dk-btn--ghost{
  background:transparent;
  border-color:var(--dk-line);
}

@media (hover:hover) and (pointer:fine){
  .dk-home .dk-btn:hover{
    border-color:rgba(17,135,217,.26);
    box-shadow:var(--dk-shadow-2);
  }
  .dk-home .dk-btn--primary:hover{
    filter:brightness(.98);
    box-shadow:0 18px 40px rgba(17,135,217,.22);
  }
}

/* ---------- HERO (copy + preview) ---------- */
.dk-home .dk-hero{
  padding:clamp(18px, 3.2vw, 44px) 0;
  background:
    radial-gradient(800px 260px at 15% 0%, rgba(17,135,217,.15), transparent 60%),
    radial-gradient(800px 260px at 85% 10%, rgba(255,154,26,.18), transparent 55%),
    linear-gradient(180deg, #f7fbff, #ffffff 80%);
  border-bottom:1px solid rgba(15,23,42,.06);
}

html[data-theme="dark"] .dk-home .dk-hero,
html.is-dark .dk-home .dk-hero,
body.is-dark .dk-home .dk-hero{
  background:
    radial-gradient(800px 260px at 15% 0%, rgba(59,130,246,.18), transparent 60%),
    radial-gradient(800px 260px at 85% 10%, rgba(255,154,26,.12), transparent 55%),
    linear-gradient(180deg, #0b1220, #0b1220 80%);
  border-bottom-color:rgba(148,163,184,.12);
}

/* Desktop layout */
.dk-home .dk-hero__inner{
  display:grid;
  grid-template-columns:minmax(0, 1.15fr) minmax(320px, 560px);
  gap:clamp(18px, 3vw, 44px);
  align-items:start;
}

.dk-home .dk-hero__copy{ min-width:0; }

.dk-home .dk-eyebrow{
  display:inline-block;
  margin:0 0 10px 0;
  font-size:13px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--dk-blue);
}

html[data-theme="dark"] .dk-home .dk-eyebrow,
html.is-dark .dk-home .dk-eyebrow,
body.is-dark .dk-home .dk-eyebrow{ color:#60a5fa; }

.dk-home .dk-hero__title{
  margin:0 0 12px 0;
  font-size:clamp(30px, 4vw, 46px);
  letter-spacing:-.025em;
  line-height:1.06;
  font-weight:1000;
}

.dk-home .dk-hero__lead{
  margin:0 0 16px 0;
  color:var(--dk-muted);
  font-size:16px;
  line-height:1.75;
  max-width:88ch;
}

.dk-home .dk-hero__cta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:14px 0 0 0;
}

.dk-home .dk-bullets{
  margin:14px 0 0 0;
  padding:0 0 0 18px;
  color:var(--dk-muted);
  line-height:1.75;
}

.dk-home .dk-bullets li{ margin:6px 0; }

/* Preview wrapper — IMPORTANT: żadnych transform/absolute, żeby nie nachodziło */
.dk-home .dk-hero__preview{
  justify-self:end;
  align-self:start;
  width:100%;
  max-width:560px;
  position:relative;
  z-index:1;
}

/* Mobile fix: hero stack + preview NIE NACHODZI */
@media (max-width:980px){
  .dk-home .dk-hero__inner{
    display:flex;
    flex-direction:column;
    gap:16px;
  }
  .dk-home .dk-hero__preview{
    max-width:560px;
    width:100%;
    align-self:center;
    margin-top:6px;
  }
}

/* ---------- PREVIEW CARD ---------- */
.dk-home .dk-preview{
  border-radius:var(--dk-radius-xl);
  border:1px solid rgba(15,23,42,.10);
  background:var(--dk-surface);
  box-shadow:var(--dk-shadow-2);
  padding:14px;
}

html[data-theme="dark"] .dk-home .dk-preview,
html.is-dark .dk-home .dk-preview,
body.is-dark .dk-home .dk-preview{
  background:rgba(2,6,23,.48);              /* bardziej “glass”, ale czytelnie */
  border-color:rgba(148,163,184,.18);
  box-shadow:var(--dk-shadow-3);
}

.dk-home .dk-preview__top{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 6px 12px 6px;
  color:var(--dk-muted);
}

html[data-theme="dark"] .dk-home .dk-preview__top,
html.is-dark .dk-home .dk-preview__top,
body.is-dark .dk-home .dk-preview__top{
  color:rgba(229,231,235,.82);
}

.dk-home .dk-dot{
  width:10px;
  height:10px;
  border-radius:999px;
  background:rgba(148,163,184,.55);
}

html[data-theme="dark"] .dk-home .dk-dot,
html.is-dark .dk-home .dk-dot,
body.is-dark .dk-home .dk-dot{
  background:rgba(148,163,184,.42);
}

.dk-home .dk-preview__label{
  margin-left:6px;
  font-size:13px;
  font-weight:850;
}

/* 2 kolumny na desktop/tablet */
.dk-home .dk-preview__grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px;
}

/* 1 kolumna na wąskich ekranach (naprawia “Wyni/ki” i ścisk) */
@media (max-width:420px){
  .dk-home .dk-preview__grid{ grid-template-columns:1fr; }
}

.dk-home .dk-preview__card{
  border-radius:16px;
  border:1px solid rgba(15,23,42,.10);
  background:rgba(255,255,255,.78);
  padding:12px;
  min-width:0;
}

html[data-theme="dark"] .dk-home .dk-preview__card,
html.is-dark .dk-home .dk-preview__card,
body.is-dark .dk-home .dk-preview__card{
  background:rgba(17,24,39,.78);
  border-color:rgba(148,163,184,.16);
}

.dk-home .dk-preview__card--accent{
  background:rgba(17,135,217,.08);
  border-color:rgba(17,135,217,.18);
}

html[data-theme="dark"] .dk-home .dk-preview__card--accent,
html.is-dark .dk-home .dk-preview__card--accent,
body.is-dark .dk-home .dk-preview__card--accent{
  background:rgba(59,130,246,.14);
  border-color:rgba(59,130,246,.22);
}

.dk-home .dk-preview__h{
  font-weight:950;
  margin-bottom:10px;
}

html[data-theme="dark"] .dk-home .dk-preview__h,
html.is-dark .dk-home .dk-preview__h,
body.is-dark .dk-home .dk-preview__h{
  color:rgba(229,231,235,.92);
}

.dk-home .dk-skel{
  border-radius:999px;
  background:rgba(148,163,184,.35);
  height:10px;
  margin:8px 0;
}

.dk-home .dk-skel--kpi{ height:20px; border-radius:12px; }
.dk-home .dk-skel--btn{ height:34px; border-radius:14px; margin-top:14px; }

html[data-theme="dark"] .dk-home .dk-skel,
html.is-dark .dk-home .dk-skel,
body.is-dark .dk-home .dk-skel{
  background:rgba(148,163,184,.22);
}

.dk-home .dk-preview__note{
  margin:12px 4px 0 4px;
  color:var(--dk-muted);
  font-size:13px;
  line-height:1.6;
}

html[data-theme="dark"] .dk-home .dk-preview__note,
html.is-dark .dk-home .dk-preview__note,
body.is-dark .dk-home .dk-preview__note{
  color:rgba(168,179,199,.92);
}

/* ---------- SEARCHBAR (pod hero) ---------- */
.dk-home .dk-searchbar{
  padding:18px 0 28px;
  background:linear-gradient(180deg, rgba(247,251,255,.85), rgba(255,255,255,1));
  border-bottom:1px solid rgba(17,135,217,.10);
}

html[data-theme="dark"] .dk-home .dk-searchbar,
html.is-dark .dk-home .dk-searchbar,
body.is-dark .dk-home .dk-searchbar{
  background:linear-gradient(180deg, rgba(11,18,32,1), rgba(11,18,32,1));
  border-bottom-color:rgba(148,163,184,.14);
}

/* ---------- SEARCH MODULE ---------- */
.dk-home .dk-search{
  padding:12px;
  border-radius:20px;
  background:rgba(255,255,255,.78);
  border:1px solid rgba(15,23,42,.10);
  box-shadow:var(--dk-shadow-2);
  width:100%;
  margin:0;
  position:relative;
}

html[data-theme="dark"] .dk-home .dk-search,
html.is-dark .dk-home .dk-search,
body.is-dark .dk-home .dk-search{
  background:rgba(2,6,23,.40);
  border-color:rgba(148,163,184,.16);
}

.dk-home .dk-search__title{
  margin:0 0 10px 0;
  font-size:13px;
  font-weight:900;
  letter-spacing:.04em;
  color:var(--dk-muted);
}

.dk-home .dk-search__row{
  display:flex;
  gap:10px;
  align-items:stretch;
}

.dk-home .dk-search__field{
  position:relative;
  flex:1 1 auto;
  min-width:0;
}

.dk-home .dk-search__icon{
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  color:rgba(71,85,105,.70);
  pointer-events:none;
}

html[data-theme="dark"] .dk-home .dk-search__icon,
html.is-dark .dk-home .dk-search__icon,
body.is-dark .dk-home .dk-search__icon{
  color:rgba(168,179,199,.82);
}

.dk-home .dk-search__input{
  width:100%;
  height:52px;
  border-radius:16px;
  border:1px solid rgba(15,23,42,.12);
  background:rgba(255,255,255,.96);
  padding:0 14px 0 42px;
  font-size:16px;
  font-weight:800;
  color:var(--dk-text);
  outline:none;
}

html[data-theme="dark"] .dk-home .dk-search__input,
html.is-dark .dk-home .dk-search__input,
body.is-dark .dk-home .dk-search__input{
  background:rgba(2,6,23,.52);
  border-color:rgba(148,163,184,.18);
  color:rgba(229,231,235,.94);
}

.dk-home .dk-search__input::placeholder{
  color:rgba(71,85,105,.78);
  font-weight:700;
}

html[data-theme="dark"] .dk-home .dk-search__input::placeholder,
html.is-dark .dk-home .dk-search__input::placeholder,
body.is-dark .dk-home .dk-search__input::placeholder{
  color:rgba(168,179,199,.72);
}

.dk-home .dk-search__input:focus{
  border-color:rgba(17,135,217,.34);
  box-shadow:0 0 0 4px var(--dk-ring);
}

.dk-home .dk-search__btn{
  height:52px;
  padding:0 18px;
  border-radius:16px;
  font-weight:1000;
  background:var(--dk-blue);
  color:#fff;
  border:1px solid rgba(17,135,217,.25);
  box-shadow:0 16px 34px rgba(17,135,217,.18);
  cursor:pointer;
  white-space:nowrap;
}

.dk-home .dk-search__btn:active{ transform:translateY(1px); }

.dk-home .dk-search__chips{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:12px;
}

.dk-home .dk-chip{
  border:1px solid rgba(15,23,42,.10);
  background:rgba(255,255,255,.92);
  border-radius:999px;
  padding:8px 10px;
  font-weight:900;
  cursor:pointer;
  box-shadow:none;
}

html[data-theme="dark"] .dk-home .dk-chip,
html.is-dark .dk-home .dk-chip,
body.is-dark .dk-home .dk-chip{
  background:rgba(2,6,23,.28);
  border-color:rgba(148,163,184,.16);
  color:rgba(229,231,235,.90);
}

.dk-home .dk-search__results{
  margin-top:10px;
  border-radius:18px;
  border:1px solid rgba(15,23,42,.10);
  background:rgba(255,255,255,.98);
  box-shadow:var(--dk-shadow-3);
  overflow:hidden;
  z-index:30;
  max-height:340px;
  overflow-y:auto;
}

html[data-theme="dark"] .dk-home .dk-search__results,
html.is-dark .dk-home .dk-search__results,
body.is-dark .dk-home .dk-search__results{
  background:rgba(2,6,23,.92);
  border-color:rgba(148,163,184,.16);
}

.dk-home .dk-search__item{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  cursor:pointer;
  border-top:1px solid rgba(15,23,42,.08);
}

.dk-home .dk-search__item:first-child{ border-top:0; }
.dk-home .dk-search__item[aria-selected="true"]{ background:rgba(17,135,217,.10); }

.dk-home .dk-search__name{
  font-weight:950;
  letter-spacing:-.01em;
  line-height:1.25;
}

.dk-home .dk-search__meta{
  color:var(--dk-muted);
  font-size:13px;
  display:flex;
  gap:8px;
  align-items:center;
  flex:0 0 auto;
}

.dk-home .dk-search__cat{
  padding:4px 8px;
  border-radius:999px;
  background:rgba(17,135,217,.08);
  border:1px solid rgba(17,135,217,.18);
  white-space:nowrap;
}

html[data-theme="dark"] .dk-home .dk-search__cat,
html.is-dark .dk-home .dk-search__cat,
body.is-dark .dk-home .dk-search__cat{
  background:rgba(59,130,246,.14);
  border-color:rgba(59,130,246,.22);
}

.dk-home .dk-search mark{
  background:rgba(255,154,26,.25);
  padding:0 2px;
  border-radius:6px;
}

@media (max-width:620px){
  .dk-home .dk-search__row{ flex-direction:column; }
  .dk-home .dk-search__btn{ width:100%; }
}

/* ---------- GRIDS ---------- */
.dk-home .dk-grid{ display:grid; gap:12px; }

/* Categories */
.dk-home .dk-grid--cats{ grid-template-columns:repeat(5, minmax(0,1fr)); gap:14px; }
@media (max-width:1180px){ .dk-home .dk-grid--cats{ grid-template-columns:repeat(3, minmax(0,1fr)); } }
@media (max-width:820px){ .dk-home .dk-grid--cats{ grid-template-columns:repeat(2, minmax(0,1fr)); } }
@media (max-width:520px){ .dk-home .dk-grid--cats{ grid-template-columns:1fr; } }

/* Tools */
.dk-home .dk-grid--tools{ grid-template-columns:repeat(4, minmax(0,1fr)); gap:14px; }
@media (max-width:1240px){ .dk-home .dk-grid--tools{ grid-template-columns:repeat(3, minmax(0,1fr)); } }
@media (max-width:980px){ .dk-home .dk-grid--tools{ grid-template-columns:repeat(2, minmax(0,1fr)); } }
@media (max-width:620px){ .dk-home .dk-grid--tools{ grid-template-columns:1fr; } }

/* ---------- CATEGORY CARDS ---------- */
.dk-home .dk-card{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:14px;
  border-radius:var(--dk-radius-xl);
  border:1px solid var(--dk-line);
  background:var(--dk-surface);
  box-shadow:var(--dk-shadow-1);
  cursor:pointer;
  text-align:left;
  transition:transform 140ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

@media (hover:hover) and (pointer:fine){
  .dk-home .dk-card:hover{
    transform:translateY(-2px);
    border-color:rgba(17,135,217,.22);
    box-shadow:var(--dk-shadow-2);
  }
}

html[data-theme="dark"] .dk-home .dk-card,
html.is-dark .dk-home .dk-card,
body.is-dark .dk-home .dk-card{
  background:rgba(17,24,39,.92);
  border-color:rgba(148,163,184,.18);
}

.dk-home .dk-card__body{ width:100%; }
.dk-home .dk-card__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.dk-home .dk-card__title{
  margin:0 0 6px 0;
  font-size:16px;
  font-weight:950;
  letter-spacing:-.01em;
  min-width:0;
}
.dk-home .dk-card__text{
  margin:0;
  color:var(--dk-muted);
  line-height:1.6;
}

.dk-home .dk-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  font-weight:950;
  font-size:13px;
  color:var(--dk-muted);
  background:rgba(15,23,42,.04);
  border:1px solid var(--dk-line);
  white-space:nowrap;
}

html[data-theme="dark"] .dk-home .dk-count,
html.is-dark .dk-home .dk-count,
body.is-dark .dk-home .dk-count{
  background:rgba(148,163,184,.10);
  border-color:rgba(148,163,184,.18);
  color:rgba(229,231,235,.86);
}

/* pseudo-icon */
.dk-home .dk-card--cat{ position:relative; padding-left:62px; }
.dk-home .dk-card--cat::before{
  content:"";
  position:absolute;
  left:14px; top:14px;
  width:40px; height:40px;
  border-radius:16px;
  background:rgba(17,135,217,.08);
  border:1px solid rgba(17,135,217,.16);
}

/* category colors */
.dk-home .dk-card--cat[data-cat="Zdrowie"]::before{ background:rgba(34,197,94,.10); border-color:rgba(34,197,94,.18); }
.dk-home .dk-card--cat[data-cat="Finanse, ubezpieczenia i kredyty"]::before{ background:rgba(245,158,11,.12); border-color:rgba(245,158,11,.18); }
.dk-home .dk-card--cat[data-cat="Dom, ogrzewanie i energia"]::before{ background:rgba(59,130,246,.12); border-color:rgba(59,130,246,.18); }
.dk-home .dk-card--cat[data-cat="Motoryzacja"]::before{ background:rgba(168,85,247,.12); border-color:rgba(168,85,247,.18); }
.dk-home .dk-card--cat[data-cat="Pozostałe"]::before{ background:rgba(100,116,139,.12); border-color:rgba(100,116,139,.18); }

.dk-home .dk-card__go{
  display:inline-block;
  margin-top:10px;
  font-weight:950;
  color:var(--dk-blue);
}

/* ---------- CATALOG ---------- */
.dk-home .dk-catalog{
  background:
    radial-gradient(900px 320px at 20% 0%, rgba(17,135,217,.10), transparent 62%),
    linear-gradient(180deg, rgba(247,251,255,.90), rgba(255,255,255,1));
  border-top:1px solid rgba(17,135,217,.10);
  border-bottom:1px solid rgba(17,135,217,.10);
}

html[data-theme="dark"] .dk-home .dk-catalog,
html.is-dark .dk-home .dk-catalog,
body.is-dark .dk-home .dk-catalog{
  background:
    radial-gradient(900px 320px at 20% 0%, rgba(59,130,246,.14), transparent 62%),
    linear-gradient(180deg, #0b1220, #0b1220);
  border-top-color:rgba(148,163,184,.12);
  border-bottom-color:rgba(148,163,184,.12);
}

.dk-home .dk-catalog__controls{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  margin:8px 0 14px 0;
}

.dk-home .dk-filter{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.dk-home .dk-filter__btn{
  border:1px solid var(--dk-line);
  background:var(--dk-surface);
  border-radius:999px;
  padding:9px 12px;
  font-weight:950;
  cursor:pointer;
  box-shadow:none;
}

.dk-home .dk-filter__btn.is-active{
  background:rgba(17,135,217,.14);
  border-color:rgba(17,135,217,.28);
}

html[data-theme="dark"] .dk-home .dk-filter__btn,
html.is-dark .dk-home .dk-filter__btn,
body.is-dark .dk-home .dk-filter__btn{
  background:rgba(17,24,39,.92);
  border-color:rgba(148,163,184,.18);
  color:rgba(229,231,235,.92);
}

html[data-theme="dark"] .dk-home .dk-filter__btn.is-active,
html.is-dark .dk-home .dk-filter__btn.is-active,
body.is-dark .dk-home .dk-filter__btn.is-active{
  background:rgba(59,130,246,.20);
  border-color:rgba(59,130,246,.30);
}

.dk-home .dk-catalog__side{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1 1 320px;
  justify-content:flex-end;
}

.dk-home .dk-catalog__search{ flex:1 1 280px; max-width:520px; }

.dk-home .dk-catalog__input{
  width:100%;
  height:46px;
  border-radius:16px;
  border:1px solid var(--dk-line);
  background:var(--dk-surface);
  padding:0 14px;
  font-weight:850;
  outline:none;
  box-shadow:none;
}

.dk-home .dk-catalog__input:focus{
  border-color:rgba(17,135,217,.35);
  box-shadow:0 0 0 4px var(--dk-ring);
}

html[data-theme="dark"] .dk-home .dk-catalog__input,
html.is-dark .dk-home .dk-catalog__input,
body.is-dark .dk-home .dk-catalog__input{
  background:rgba(17,24,39,.92);
  border-color:rgba(148,163,184,.18);
  color:rgba(229,231,235,.92);
}

.dk-home .dk-sort{
  height:46px;
  border-radius:16px;
  border:1px solid var(--dk-line);
  background:var(--dk-surface);
  padding:0 12px;
  font-weight:900;
  cursor:pointer;
  box-shadow:none;
}

html[data-theme="dark"] .dk-home .dk-sort,
html.is-dark .dk-home .dk-sort,
body.is-dark .dk-home .dk-sort{
  background:rgba(17,24,39,.92);
  border-color:rgba(148,163,184,.18);
  color:rgba(229,231,235,.92);
}

/* ---------- TOOL CARDS ---------- */
.dk-home .dk-tool{
  display:flex;
  flex-direction:column;
  height:100%;
  padding:14px;
  border-radius:var(--dk-radius-xl);
  border:1px solid var(--dk-line);
  background:var(--dk-surface);
  box-shadow:var(--dk-shadow-1);
  transition:transform 140ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

@media (hover:hover) and (pointer:fine){
  .dk-home .dk-tool:hover{
    transform:translateY(-2px);
    border-color:rgba(17,135,217,.22);
    box-shadow:var(--dk-shadow-2);
  }
}

html[data-theme="dark"] .dk-home .dk-tool,
html.is-dark .dk-home .dk-tool,
body.is-dark .dk-home .dk-tool{
  background:rgba(17,24,39,.92);
  border-color:rgba(148,163,184,.18);
}

.dk-home .dk-tool__head{
  display:flex;
  gap:10px;
  align-items:flex-start;
  justify-content:space-between;
}

.dk-home .dk-tool__title{
  margin:0;
  font-size:16px;
  font-weight:950;
  letter-spacing:-.01em;
  line-height:1.25;
}

.dk-home .dk-tool__text{
  margin:8px 0 0 0;
  color:var(--dk-muted);
  line-height:1.6;
  font-size:13px;
}

.dk-home .dk-tool__meta{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:auto;
  padding-top:12px;
}

.dk-home .dk-tool__tag{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--dk-line);
  background:rgba(15,23,42,.03);
  color:var(--dk-muted);
  font-weight:900;
  font-size:12px;
  white-space:nowrap;
}

html[data-theme="dark"] .dk-home .dk-tool__tag,
html.is-dark .dk-home .dk-tool__tag,
body.is-dark .dk-home .dk-tool__tag{
  background:rgba(148,163,184,.10);
  border-color:rgba(148,163,184,.18);
  color:rgba(229,231,235,.86);
}

/* Optional actions */
.dk-home .dk-tool__actions{
  display:inline-flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}

.dk-home .dk-tool__badge{
  font-size:12px;
  font-weight:950;
  padding:6px 10px;
  border-radius:999px;
  line-height:1;
  background:rgba(255,154,26,.16);
  border:1px solid rgba(255,154,26,.26);
  color:rgba(15,23,42,.92);
  white-space:nowrap;
}

html[data-theme="dark"] .dk-home .dk-tool__badge,
html.is-dark .dk-home .dk-tool__badge,
body.is-dark .dk-home .dk-tool__badge{
  background:rgba(255,154,26,.18);
  border-color:rgba(255,154,26,.30);
  color:rgba(255,243,224,.96);
}

.dk-home .dk-tool__cta{
  font-size:13px;
  font-weight:950;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(17,135,217,.08);
  border:1px solid rgba(17,135,217,.18);
  line-height:1;
  white-space:nowrap;
}

html[data-theme="dark"] .dk-home .dk-tool__cta,
html.is-dark .dk-home .dk-tool__cta,
body.is-dark .dk-home .dk-tool__cta{
  background:rgba(59,130,246,.16);
  border-color:rgba(59,130,246,.24);
  color:rgba(229,231,235,.94);
}

/* Empty state */
.dk-home .dk-catalog__empty{
  margin:12px 0 0 0;
  padding:12px 14px;
  border-radius:16px;
  border:1px dashed rgba(148,163,184,.35);
  color:var(--dk-muted);
}


/* ---------- RECENT (ostatnio używane) ---------- */
.dk-home .dk-recent{
  margin:10px 0 14px 0;
  padding:12px;
  border-radius:20px;
  border:1px solid rgba(15,23,42,.10);
  background:var(--dk-surface-2);
  box-shadow:var(--dk-shadow-1);
}

html[data-theme="dark"] .dk-home .dk-recent,
html.is-dark .dk-home .dk-recent,
body.is-dark .dk-home .dk-recent{
  border-color:rgba(148,163,184,.16);
  background:rgba(17,24,39,.74);
}

.dk-home .dk-recent__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.dk-home .dk-recent__title{
  margin:0;
  font-size:14px;
  font-weight:950;
  letter-spacing:-.01em;
}

.dk-home .dk-recent__clear{
  border:1px solid var(--dk-line);
  background:transparent;
  border-radius:999px;
  padding:7px 10px;
  font-weight:900;
  cursor:pointer;
  color:var(--dk-muted);
}

.dk-home .dk-recent__clear:hover{
  border-color:rgba(17,135,217,.26);
  color:var(--dk-text);
}

/* ---------- STICKY CONTROLS (filtry + szukaj + sort) ---------- */
.dk-home .dk-sticky-sentinel{ height:1px; }

.dk-home .dk-catalog__controls{
  position:sticky;
  top:var(--dk-sticky-top);
  z-index:40;
  padding:10px;
  border-radius:20px;
  border:1px solid rgba(15,23,42,.08);
  background:rgba(255,255,255,.88);
}

@supports ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))){
  .dk-home .dk-catalog__controls{
    background:rgba(255,255,255,.72);
    -webkit-backdrop-filter:blur(10px);
    backdrop-filter:blur(10px);
  }
}

.dk-home .dk-catalog__controls.is-stuck{
  box-shadow:var(--dk-shadow-2);
}

html[data-theme="dark"] .dk-home .dk-catalog__controls,
html.is-dark .dk-home .dk-catalog__controls,
body.is-dark .dk-home .dk-catalog__controls{
  border-color:rgba(148,163,184,.14);
  background:rgba(17,24,39,.82);
}

@supports ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))){
  html[data-theme="dark"] .dk-home .dk-catalog__controls,
  html.is-dark .dk-home .dk-catalog__controls,
  body.is-dark .dk-home .dk-catalog__controls{
    background:rgba(17,24,39,.64);
  }
}

/* ---------- TOOL DESCRIPTION (opcjonalny opis) ---------- */
.dk-home .dk-tool__desc{
  margin:8px 0 0 0;
  color:var(--dk-muted);
  line-height:1.6;
  font-size:13px;
}

.dk-home .dk-tool__text{ display:none; } /* kategoria jest już w tagu; usuń, jeśli chcesz podwójny opis */


/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce){
  .dk-home *{ transition:none !important; scroll-behavior:auto !important; }
}



/* =========================================================
   v2.3 — drobne dopracowania UX
   - lepszy układ sekcji „Ostatnio używane” (bez pustych kolumn)
   - przycisk czyszczenia w polu „Szukaj w katalogu…”
   - przycisk „Wyczyść filtry” w stanie braku wyników
   ========================================================= */

.dk-home .dk-recent__grid{
  /* w katalogu mamy stałe kolumny; dla „ostatnio używane” lepiej auto-fit */
  grid-template-columns:repeat(auto-fit, minmax(260px, 1fr));
  justify-content:start;
}

.dk-home .dk-recent__grid .dk-tool{
  max-width:420px; /* ogranicz rozciąganie pojedynczej karty */
  justify-self:start;
}

.dk-home .dk-catalog__search{ position:relative; }
.dk-home .dk-catalog__input{ padding-right:46px; }

.dk-home .dk-catalog__clear{
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  width:34px;
  height:34px;
  display:none;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  border:1px solid var(--dk-line);
  background:var(--dk-surface);
  box-shadow:var(--dk-shadow-1);
  cursor:pointer;
  font-weight:950;
  line-height:1;
  color:var(--dk-muted);
}

.dk-home .dk-catalog__clear.is-visible{ display:flex; }

@media (hover:hover) and (pointer:fine){
  .dk-home .dk-catalog__clear:hover{
    border-color:rgba(17,135,217,.26);
    color:var(--dk-text);
    box-shadow:var(--dk-shadow-2);
  }
}

html[data-theme="dark"] .dk-home .dk-catalog__clear,
html.is-dark .dk-home .dk-catalog__clear,
body.is-dark .dk-home .dk-catalog__clear{
  background:rgba(17,24,39,.92);
  border-color:rgba(148,163,184,.18);
  color:rgba(229,231,235,.86);
}

.dk-home .dk-empty__clear{
  margin-left:10px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--dk-line);
  background:var(--dk-surface);
  font-weight:900;
  cursor:pointer;
  color:var(--dk-text);
}

@media (hover:hover) and (pointer:fine){
  .dk-home .dk-empty__clear:hover{
    border-color:rgba(17,135,217,.26);
    box-shadow:var(--dk-shadow-1);
  }
}



/* ---------- RECENT LIST LAYOUT (dopasowanie do liczby elementów) ---------- */
.dk-recent[data-count="1"] .dk-recent__grid{
  grid-template-columns:minmax(0, 1fr);
}
.dk-recent[data-count="1"] .dk-recent__grid .dk-tool{
  max-width:720px;
  width:100%;
  justify-self:center;
}

.dk-recent[data-count="2"] .dk-recent__grid{
  grid-template-columns:repeat(2, minmax(260px, 1fr));
}
.dk-recent[data-count="2"] .dk-recent__grid .dk-tool{
  max-width:none;
  width:100%;
  justify-self:stretch;
}
/* =========================================================
   v2.5 — polish „Ostatnio używane”
   - mniejsza „wysokość” modułu (padding + odstępy)
   - bez badge „Polecane” w sekcji recent
   ========================================================= */

.dk-home .dk-recent{
  padding:10px 12px;
  margin:8px 0 12px 0;
}

.dk-home .dk-recent__head{
  margin-bottom:8px;
}

.dk-home .dk-recent__title{
  font-size:13px;
}

.dk-home .dk-recent__clear{
  padding:6px 10px;
}

.dk-home .dk-recent__grid{
  gap:10px;
}

/* safety: nawet jeśli badge zostanie wyrenderowany, ukryj go w „Ostatnio używane” */
.dk-home .dk-recent .dk-tool__badge{
  display:none !important;
}

/* =========================================================
   v2.6 — offset przewijania do kotwic (fixed/sticky header)
   - chroni przed "ucinaniem" nagłówków sekcji po kliknięciu
     (CTA w hero, kafle kategorii, chipy, submit wyszukiwarki)
   - korzysta z --dk-sticky-top, więc ustawiasz to w jednym miejscu
   ========================================================= */

.dk-home #dk-search,
.dk-home #dk-catalog{
  scroll-margin-top:calc(var(--dk-sticky-top) + 16px);
}


/* =========================
   v2.7 — Hero CTA + chips aktywnych filtrów + skróty
   ========================= */

/* Hero: jedno dominujące CTA (wizualnie) */
.dk-home .dk-hero__cta{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
}
.dk-home .dk-hero__cta .dk-btn:not(.dk-btn--primary):not(.dk-btn--ghost){
  background:#fff;
  border:1px solid var(--dk-border, rgba(15,23,42,.12));
  box-shadow:none;
}
.dk-home .dk-hero__cta .dk-btn--ghost{
  background:transparent;
  border:0;
  box-shadow:none;
  padding:6px 6px;
  text-decoration:underline;
  text-underline-offset:4px;
}
.dk-home .dk-hero__cta .dk-btn--ghost:hover{
  text-decoration-thickness:2px;
}

/* Chips aktywnych filtrów (pod panelem filtrów) */
.dk-home .dk-active-filters{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin:10px 0 14px;
}
.dk-home .dk-active-filters[hidden]{ display:none !important; }

.dk-home .dk-active-filters__list{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}

.dk-home .dk-chip{
  appearance:none;
  border:1px solid var(--dk-border, rgba(15,23,42,.12));
  background:#fff;
  color:inherit;
  border-radius:999px;
  padding:7px 10px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  line-height:1;
  cursor:pointer;
  transition:transform .08s ease, background .12s ease;
}
.dk-home .dk-chip:hover{ transform:translateY(-1px); background:rgba(15,23,42,.02); }
.dk-home .dk-chip:active{ transform:none; }
.dk-home .dk-chip:focus-visible{
  outline:3px solid rgba(59,130,246,.35);
  outline-offset:2px;
}

.dk-home .dk-chip__x{
  width:18px;
  height:18px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--dk-border, rgba(15,23,42,.12));
  font-weight:700;
  line-height:1;
}

.dk-home .dk-active-filters__clear{
  appearance:none;
  border:1px solid var(--dk-border, rgba(15,23,42,.12));
  background:#fff;
  border-radius:999px;
  padding:7px 12px;
  font-size:13px;
  line-height:1;
  cursor:pointer;
  white-space:nowrap;
}
.dk-home .dk-active-filters__clear:hover{ background:rgba(15,23,42,.02); }
.dk-home .dk-active-filters__clear:focus-visible{
  outline:3px solid rgba(59,130,246,.35);
  outline-offset:2px;
}

/* Bezpieczny fallback: ukryj badge "Polecane" wewnątrz sekcji Ostatnio używane */
.dk-home #dk-recent .dk-tool__badge{ display:none !important; }

/* v2.7.4: wyniki wyszukiwarki jako linki <a> */
.dk-search__item{
  color:inherit;
  text-decoration:none;
}
.dk-search__item:visited{
  color:inherit;
}
.dk-search__item:hover,
.dk-search__item:focus{
  text-decoration:none;
}

/* =========================================================
   v2.9 — Skip link (dostępność klawiatury)
   - pierwszy Tab pokazuje link „Przejdź do wyszukiwania”
   - po aktywacji przenosi do pola wyszukiwania
   ========================================================= */

.dk-home{ position:relative; }

.dk-home .dk-skip-link{
  position:absolute;
  left:12px;
  top:12px;
  z-index:9999;
  padding:10px 14px;
  background:var(--dk-text);
  color:var(--dk-bg);
  border-radius:14px;
  box-shadow:var(--dk-shadow-1);
  transform:translateY(-220%);
  transition:transform .18s ease, opacity .18s ease;
  opacity:0;
}

.dk-home .dk-skip-link:focus,
.dk-home .dk-skip-link:focus-visible{
  transform:translateY(0);
  opacity:1;
}

@media (max-width:560px){
  .dk-home .dk-skip-link{ left:10px; top:10px; }
}
/* =========================================================
   v3.0 – A11Y polish: kontrast + focus + prefers-* support
   ========================================================= */

/* Mocniejszy focus (bardziej widoczny i zwykle spełnia 3:1 w praktyce) */
.dk-home :where(a, button, input, select, textarea, [role="button"], [tabindex]):focus-visible{
  outline:3px solid var(--dk-blue);
  outline-offset:2px;
  box-shadow:0 0 0 4px var(--dk-ring);
}

/* Dropdown z wynikami ma overflow, więc outline może się ucinać – używamy ringa „wewnątrz” */
.dk-home .dk-search__item:focus-visible{
  outline:0;
  box-shadow:inset 0 0 0 2px var(--dk-blue);
}

/* Wyższy kontrast placeholderów (jasny motyw) */
.dk-home input::placeholder{
  color:#64748b; /* ~4.75:1 na białym */
}

/* W ciemnym motywie zachowujemy dotychczasowe placeholdery */
html[data-theme="dark"] .dk-home input::placeholder,
html.is-dark .dk-home input::placeholder,
body.is-dark .dk-home input::placeholder{
  color:rgba(168,179,199,.72);
}

/* Użytkownik prosi o większy kontrast */
@media (prefers-contrast: more){
  .dk-home{
    --dk-line:rgba(15,23,42,.18);
    --dk-ring:rgba(17,135,217,.42);
  }

  html[data-theme="dark"] .dk-home,
  html.is-dark .dk-home,
  body.is-dark .dk-home{
    --dk-line:rgba(148,163,184,.30);
    --dk-ring:rgba(59,130,246,.55);
  }

  .dk-home .dk-tool__tag{
    background:rgba(15,23,42,.06);
    border-color:rgba(15,23,42,.18);
  }

  html[data-theme="dark"] .dk-home .dk-tool__tag,
  html.is-dark .dk-home .dk-tool__tag,
  body.is-dark .dk-home .dk-tool__tag{
    background:rgba(148,163,184,.16);
    border-color:rgba(148,163,184,.32);
    color:rgba(229,231,235,.92);
  }
}

/* Preferencje ograniczenia ruchu */
@media (prefers-reduced-motion: reduce){
  .dk-home *, .dk-home *::before, .dk-home *::after{
    animation:none !important;
    transition:none !important;
    scroll-behavior:auto !important;
  }
}

/* Windows High Contrast / Forced Colors */
@media (forced-colors: active){
  .dk-home :where(a, button, input, select, textarea, [role="button"], [tabindex]):focus{
    outline:2px solid Highlight;
    outline-offset:2px;
  }

  .dk-home .dk-skip-link{
    forced-color-adjust:none;
    background:Canvas;
    color:CanvasText;
    border:1px solid CanvasText;
  }

  .dk-home .dk-search__results{
    border:1px solid CanvasText;
  }

  .dk-home .dk-search__item[aria-selected="true"],
  .dk-home .dk-search__item:focus{
    background:Highlight;
    color:HighlightText;
  }
}


/* =========================================================
   v3.1 — UX polish: podpowiedzi wyszukiwania z opisem
   ========================================================= */

.dk-home .dk-search__item{
  align-items:flex-start;
}

.dk-home .dk-search__main{
  min-width:0;
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.dk-home .dk-search__name{
  min-width:0;
}

.dk-home .dk-search__desc{
  color:var(--dk-muted);
  font-size:13px;
  line-height:1.25;
  font-weight:500;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.dk-home .dk-search__meta{
  margin-top:1px;
}
/* =========================================================
   DARK MODE — MAX READABILITY (v3.2.1)
   ========================================================= */

html[data-theme="dark"], html.is-dark, body.is-dark{
  /* 3 warstwy: bg < surface-2 < surface */
  --dk-bg:#070b14;
  --dk-surface-2:#0b1424;  /* sekcje / panele */
  --dk-surface:#0f1b33;    /* karty / elementy klikalne */

  /* tekst */
  --dk-text:#f1f5f9;
  --dk-muted:#cbd5e1;

  /* linie i focus */
  --dk-line:rgba(255,255,255,.22);
  --dk-ring:rgba(59,130,246,.60);

  /* cienie – mniej „mętne” w dark */
  --dk-shadow-1:0 10px 24px rgba(0,0,0,.28);
  --dk-shadow-2:0 18px 44px rgba(0,0,0,.36);
  --dk-shadow-3:0 26px 70px rgba(0,0,0,.44);
}

/* Tło hero: minimalna ornamentyka, stabilny kontrast */
html[data-theme="dark"] .dk-home .dk-hero,
html.is-dark .dk-home .dk-hero,
body.is-dark .dk-home .dk-hero{
  background:
    radial-gradient(700px 240px at 15% 0%, rgba(59,130,246,.08), transparent 62%),
    radial-gradient(700px 240px at 85% 10%, rgba(255,154,26,.05), transparent 60%),
    linear-gradient(180deg, var(--dk-bg), var(--dk-bg) 80%);
  border-bottom-color:rgba(255,255,255,.14);
}

/* Searchbar pod hero: traktuj jak Surface-2 */
html[data-theme="dark"] .dk-home .dk-searchbar,
html.is-dark .dk-home .dk-searchbar,
body.is-dark .dk-home .dk-searchbar{
  background:linear-gradient(180deg, var(--dk-surface-2), var(--dk-bg));
  border-bottom-color:rgba(255,255,255,.14);
}

/* Katalog tło: mniej „plam” */
html[data-theme="dark"] .dk-home .dk-catalog,
html.is-dark .dk-home .dk-catalog,
body.is-dark .dk-home .dk-catalog{
  background:
    radial-gradient(900px 320px at 20% 0%, rgba(59,130,246,.06), transparent 66%),
    linear-gradient(180deg, var(--dk-bg), var(--dk-bg));
  border-top-color:rgba(255,255,255,.14);
  border-bottom-color:rgba(255,255,255,.14);
}

/* Secondary CTA w hero: nie może wyglądać jak disabled */
html[data-theme="dark"] .dk-home .dk-hero__cta .dk-btn:not(.dk-btn--primary):not(.dk-btn--ghost),
html.is-dark .dk-home .dk-hero__cta .dk-btn:not(.dk-btn--primary):not(.dk-btn--ghost),
body.is-dark .dk-home .dk-hero__cta .dk-btn:not(.dk-btn--primary):not(.dk-btn--ghost){
  background:var(--dk-surface);
  border-color:rgba(255,255,255,.26);
  color:var(--dk-text);
  box-shadow:var(--dk-shadow-1);
}

/* Ghost CTA w hero: wyraźne jak link, bez „szarości” */
html[data-theme="dark"] .dk-home .dk-hero__cta .dk-btn--ghost,
html.is-dark .dk-home .dk-hero__cta .dk-btn--ghost,
body.is-dark .dk-home .dk-hero__cta .dk-btn--ghost{
  color:rgba(219,234,254,.96); /* jasny niebieski */
  text-decoration-color:rgba(219,234,254,.75);
}

/* Inputy: czytelniejsze wnętrze + placeholder */
html[data-theme="dark"] .dk-home .dk-search__input,
html.is-dark .dk-home .dk-search__input,
body.is-dark .dk-home .dk-search__input{
  background:var(--dk-surface);
  border-color:rgba(255,255,255,.22);
}

html[data-theme="dark"] .dk-home .dk-search__input::placeholder,
html.is-dark .dk-home .dk-search__input::placeholder,
body.is-dark .dk-home .dk-search__input::placeholder{
  color:rgba(226,232,240,.78);
}

/* Input katalogu */
html[data-theme="dark"] .dk-home .dk-catalog__input,
html.is-dark .dk-home .dk-catalog__input,
body.is-dark .dk-home .dk-catalog__input{
  background:var(--dk-surface);
  border-color:rgba(255,255,255,.22);
  color:rgba(241,245,249,.92);
}
html[data-theme="dark"] .dk-home .dk-catalog__input::placeholder,
html.is-dark .dk-home .dk-catalog__input::placeholder,
body.is-dark .dk-home .dk-catalog__input::placeholder{
  color:rgba(226,232,240,.75);
}

/* Licznik wyników: wyraźniejsze tło i obrys */
html[data-theme="dark"] .dk-home .dk-count,
html.is-dark .dk-home .dk-count,
body.is-dark .dk-home .dk-count{
  background:rgba(255,255,255,.08);
  border-color:rgba(255,255,255,.22);
  color:rgba(241,245,249,.92);
}

/* Filtry (przyciski kategorii): mocniejszy obrys + aktywny stan */
html[data-theme="dark"] .dk-home .dk-filter__btn,
html.is-dark .dk-home .dk-filter__btn,
body.is-dark .dk-home .dk-filter__btn{
  background:var(--dk-surface);
  border-color:rgba(255,255,255,.22);
  color:rgba(241,245,249,.94);
}
html[data-theme="dark"] .dk-home .dk-filter__btn:hover,
html.is-dark .dk-home .dk-filter__btn:hover,
body.is-dark .dk-home .dk-filter__btn:hover{
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.30);
}
html[data-theme="dark"] .dk-home .dk-filter__btn.is-active,
html.is-dark .dk-home .dk-filter__btn.is-active,
body.is-dark .dk-home .dk-filter__btn.is-active{
  background:rgba(59,130,246,.22);
  border-color:rgba(59,130,246,.60);
}

/* Chipy aktywnych filtrów: nie białe w dark */
html[data-theme="dark"] .dk-home .dk-chip,
html.is-dark .dk-home .dk-chip,
body.is-dark .dk-home .dk-chip{
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.22);
  color:var(--dk-text);
}
html[data-theme="dark"] .dk-home .dk-chip:hover,
html.is-dark .dk-home .dk-chip:hover,
body.is-dark .dk-home .dk-chip:hover{
  background:rgba(255,255,255,.09);
  border-color:rgba(255,255,255,.30);
}

/* Przycisk „Wyczyść wszystko” w chipach */
html[data-theme="dark"] .dk-home .dk-active-filters__clear,
html.is-dark .dk-home .dk-active-filters__clear,
body.is-dark .dk-home .dk-active-filters__clear{
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.26);
  color:var(--dk-text);
}
html[data-theme="dark"] .dk-home .dk-active-filters__clear:hover,
html.is-dark .dk-home .dk-active-filters__clear:hover,
body.is-dark .dk-home .dk-active-filters__clear:hover{
  background:rgba(255,255,255,.10);
}

/* Czytelniejsze obrysy na kartach i panelach */
html[data-theme="dark"] .dk-home :where(.dk-card, .dk-tool, .dk-recent, .dk-catalog__controls),
html.is-dark .dk-home :where(.dk-card, .dk-tool, .dk-recent, .dk-catalog__controls),
body.is-dark .dk-home :where(.dk-card, .dk-tool, .dk-recent, .dk-catalog__controls){
  border-color:rgba(255,255,255,.22);
}

/* Wysokokontrastowy tryb preferencji: jeszcze mocniej */
@media (prefers-contrast: more){
  html[data-theme="dark"], html.is-dark, body.is-dark{
    --dk-line:rgba(255,255,255,.36);
    --dk-muted:#dbe6f7;
    --dk-ring:rgba(59,130,246,.72);
  }
  html[data-theme="dark"] .dk-home .dk-chip,
  html.is-dark .dk-home .dk-chip,
  body.is-dark .dk-home .dk-chip{
    background:rgba(255,255,255,.10);
  }
}


/* =========================================================
   DobryKalkulator.pl — Dark mode readability patch (v1)
   Scope: category tiles icon + headings (dark)
   Targets: html[data-theme="dark"], html.is-dark, body.is-dark
   ========================================================= */

/* Headings (na wypadek „gradient text” / transparent fill w motywie) */
html[data-theme="dark"] .dk-home h1,
html[data-theme="dark"] .dk-home h2,
html[data-theme="dark"] .dk-home h3,
html[data-theme="dark"] .dk-home h4,
html[data-theme="dark"] .dk-home h5,
html[data-theme="dark"] .dk-home h6,
html.is-dark .dk-home h1,
html.is-dark .dk-home h2,
html.is-dark .dk-home h3,
html.is-dark .dk-home h4,
html.is-dark .dk-home h5,
html.is-dark .dk-home h6,
body.is-dark .dk-home h1,
body.is-dark .dk-home h2,
body.is-dark .dk-home h3,
body.is-dark .dk-home h4,
body.is-dark .dk-home h5,
body.is-dark .dk-home h6{
  color:#EAF2FF !important;
  opacity:1 !important;
  background:none !important;
  background-image:none !important;
  -webkit-text-fill-color:#EAF2FF !important;
  -webkit-background-clip:border-box !important;
  background-clip:border-box !important;
}

/* Category tiles icon: zwiększona widoczność */
html[data-theme="dark"] .dk-home .dk-card--cat::before,
html.is-dark .dk-home .dk-card--cat::before,
body.is-dark .dk-home .dk-card--cat::before{
  background:rgba(17,135,217,.22) !important;
  border-color:rgba(17,135,217,.60) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.08) inset,
    0 0 0 1px rgba(0,0,0,.35),
    0 10px 22px rgba(0,0,0,.45),
    0 0 18px rgba(17,135,217,.18) !important;
}

/* Per-category colors */
html[data-theme="dark"] .dk-home .dk-card--cat[data-cat="Zdrowie"]::before,
html.is-dark .dk-home .dk-card--cat[data-cat="Zdrowie"]::before,
body.is-dark .dk-home .dk-card--cat[data-cat="Zdrowie"]::before{
  background:rgba(34,197,94,.24) !important;
  border-color:rgba(34,197,94,.62) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.08) inset,
    0 0 0 1px rgba(0,0,0,.35),
    0 10px 22px rgba(0,0,0,.45),
    0 0 18px rgba(34,197,94,.20) !important;
}

html[data-theme="dark"] .dk-home .dk-card--cat[data-cat="Finanse, ubezpieczenia i kredyty"]::before,
html.is-dark .dk-home .dk-card--cat[data-cat="Finanse, ubezpieczenia i kredyty"]::before,
body.is-dark .dk-home .dk-card--cat[data-cat="Finanse, ubezpieczenia i kredyty"]::before{
  background:rgba(245,158,11,.26) !important;
  border-color:rgba(245,158,11,.70) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.08) inset,
    0 0 0 1px rgba(0,0,0,.35),
    0 10px 22px rgba(0,0,0,.45),
    0 0 18px rgba(245,158,11,.22) !important;
}

html[data-theme="dark"] .dk-home .dk-card--cat[data-cat="Dom, ogrzewanie i energia"]::before,
html.is-dark .dk-home .dk-card--cat[data-cat="Dom, ogrzewanie i energia"]::before,
body.is-dark .dk-home .dk-card--cat[data-cat="Dom, ogrzewanie i energia"]::before{
  background:rgba(59,130,246,.26) !important;
  border-color:rgba(59,130,246,.70) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.08) inset,
    0 0 0 1px rgba(0,0,0,.35),
    0 10px 22px rgba(0,0,0,.45),
    0 0 18px rgba(59,130,246,.20) !important;
}

html[data-theme="dark"] .dk-home .dk-card--cat[data-cat="Motoryzacja"]::before,
html.is-dark .dk-home .dk-card--cat[data-cat="Motoryzacja"]::before,
body.is-dark .dk-home .dk-card--cat[data-cat="Motoryzacja"]::before{
  background:rgba(168,85,247,.26) !important;
  border-color:rgba(168,85,247,.70) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.08) inset,
    0 0 0 1px rgba(0,0,0,.35),
    0 10px 22px rgba(0,0,0,.45),
    0 0 18px rgba(168,85,247,.20) !important;
}

html[data-theme="dark"] .dk-home .dk-card--cat[data-cat="Pozostałe"]::before,
html.is-dark .dk-home .dk-card--cat[data-cat="Pozostałe"]::before,
body.is-dark .dk-home .dk-card--cat[data-cat="Pozostałe"]::before{
  background:rgba(148,163,184,.22) !important;
  border-color:rgba(148,163,184,.55) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.08) inset,
    0 0 0 1px rgba(0,0,0,.35),
    0 10px 22px rgba(0,0,0,.45),
    0 0 18px rgba(148,163,184,.18) !important;
}

/* Licznik (12/8/3/…) na kafelkach kategorii */
html[data-theme="dark"] .dk-home .dk-card--cat .dk-count,
html.is-dark .dk-home .dk-card--cat .dk-count,
body.is-dark .dk-home .dk-card--cat .dk-count{
  color:#EAF2FF !important;
  background:rgba(255,255,255,.08) !important;
  border-color:rgba(255,255,255,.18) !important;
}



/* H1 — mniejsze, żeby mieściło się w jednej linii (desktop) */
.dk-home h1,
.dk-home .dk-hero h1,
.dk-home .hero h1 {
  font-size: clamp(32px, 3.2vw, 48px) !important;
  line-height: 1.05 !important;
  letter-spacing: -0.02em !important;
}

/* Opcjonalnie: tylko od desktopu w górę (jeśli na mobile ma zostać jak jest) */
@media (min-width: 1024px){
  .dk-home h1,
  .dk-home .dk-hero h1,
  .dk-home .hero h1{
    font-size: 43px !important;
  }
}

