html, body {
  overflow-x: hidden !important;
  max-width: 100% !important;
}
img, video, svg, table {
  max-width: 100%;
}
header {
  max-width: 100%;
}
header a.logo {
  font-size: clamp(0.95rem, 3vw, 1.35rem);
}
.search {
  min-width: 0 !important;
  max-width: 100% !important;
}
.search input {
  text-align: center !important;
}
.search input::placeholder {
  text-align: center !important;
}
nav.az {
  max-width: 100%;
  overflow: hidden;
}
main {
  max-width: 56rem !important;
  width: 100% !important;
  min-width: 0;
  overflow-x: hidden;
}
main.wide {
  max-width: min(72rem, 100%) !important;
}

/* kafelki na głównej — stałe wysokości, nic nie rozpycha */
.tfeat {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  width: 100% !important;
  margin: 0 0 1.5rem !important;
}
.tfeat a {
  position: relative !important;
  display: block !important;
  overflow: hidden !important;
  height: 8.5rem !important;
  min-height: 0 !important;
  border: 1px solid #27272a;
  border-radius: 16px;
  background: #09090b;
  text-decoration: none;
  color: #fff;
}
.tfeat a.big {
  grid-column: 1 / -1 !important;
  height: 16rem !important;
}
.tfeat img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
.tfeat .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 0.85rem 1rem;
  background: linear-gradient(transparent, #000d);
}
.tfeat .cap b {
  display: block;
  font-size: 0.95rem;
  line-height: 1.3;
}
.tfeat a.big .cap b {
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
}
@media (min-width: 900px) {
  .tfeat {
    grid-template-columns: 2fr 1fr 1fr !important;
    grid-template-rows: 11rem 11rem !important;
  }
  .tfeat a {
    height: 11rem !important;
  }
  .tfeat a.big {
    grid-column: 1 !important;
    grid-row: 1 / 3 !important;
    height: 100% !important;
  }
}

.tcat {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.tcat a {
  position: relative;
  display: block;
  height: 9.5rem;
  overflow: hidden;
  border: 1px solid #27272a;
  border-radius: 16px;
  text-decoration: none;
  color: #fff;
}
.tcat img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tcat .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.75rem;
  background: linear-gradient(transparent, #000);
}
.tlist a {
  display: flex;
  gap: 12px;
  min-height: 5.5rem;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #27272a;
  border-radius: 16px;
  text-decoration: none;
  color: #fff;
  background: #09090b;
  margin: 0 0 0.75rem;
}
.tlist img {
  width: 7.5rem;
  min-width: 7.5rem;
  object-fit: cover;
  background: #18181b;
}
.tlist .pad {
  min-width: 0;
  padding: 0.9rem 1rem;
}
.tlist .pad span {
  display: block;
  color: #a1a1aa;
  font-size: 0.9rem;
  margin-top: 0.35rem;
}
.tfeat a:hover, .tcat a:hover, .tlist a:hover { border-color: #10b981; }

.hasla-count {
  text-align: center;
  color: #71717a;
  font-family: ui-monospace, monospace;
  font-weight: 700;
  font-size: 1rem;
  margin: 0.35rem 0 0.75rem;
}

/* TYLKO Tematy AI — nie rusza reszty strony */
.tematy-body {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.tematy-body p,
.tematy-body .tematy-p {
  color: #fff;
  font-size: 1.125rem;
  line-height: 1.85;
  margin: 0 0 1.35rem;
}
.tematy-muted { color: #a1a1aa; }
.tematy-num-mark {
  display: block;
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 1.75rem 0 0.6rem;
  color: #34d399;
}
.tematy-agent {
  text-align: center;
  font-size: clamp(1.2rem, 3.5vw, 1.7rem);
  font-weight: 700;
  margin: 2.75rem 0 1.25rem;
  line-height: 1.35;
  white-space: normal !important;
}
.tematy-agent-line { white-space: normal !important; }
.tematy-agent-gemini { color: #34d399 !important; }
.tematy-agent-grok { color: #38bdf8 !important; }
.tematy-agent-chatgpt { color: #c084fc !important; }
.tematy-agent-claude,
.tematy-agent-anthropic { color: #fb923c !important; }
.tematy-h3,
.tematy-teaser {
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  margin: 0 0 1.5rem !important;
  line-height: 1.35 !important;
  text-align: center !important;
}
.tematy-num-mark {
  display: block;
  text-align: center;
  font-size: 2.35rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 2.75rem 0 1rem;
  color: #34d399;
}

/* Encyklopedia / vs4 / newsroom: cyfra na środku, pod nią tytuł na środku */
article.ency-art {
  counter-reset: sekcja;
}
article.ency-art h2:not(.h-gem):not(.h-grok):not(.h-cla):not(.h-gpt):not(.tematy-agent):not(.ency-teaser) {
  counter-increment: sekcja;
  text-align: center !important;
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin-top: 3rem !important;
  margin-bottom: 1.5rem !important;
  line-height: 1.35 !important;
}
article.ency-art h2:not(.h-gem):not(.h-grok):not(.h-cla):not(.h-gpt):not(.tematy-agent):not(.ency-teaser)::before {
  content: counter(sekcja);
  display: block;
  text-align: center;
  font-size: 2.35rem;
  font-weight: 700;
  color: #34d399;
  line-height: 1.2;
  margin: 0 0 1rem;
}
article.ency-art h2.ency-teaser {
  counter-increment: none !important;
  text-align: center !important;
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin-top: 0 !important;
  margin-bottom: 1.5rem !important;
  line-height: 1.35 !important;
}
article.ency-art h2.ency-teaser::before {
  content: none !important;
  display: none !important;
}
article.ency-art h3 {
  text-align: center !important;
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin: 3rem 0 1.5rem !important;
  line-height: 1.35 !important;
}
.tematy-ul {
  color: #fff;
  font-size: 1.125rem;
  line-height: 1.85;
  margin: 0 0 1.35rem;
  padding-left: 1.4rem;
}
.tematy-ul li { margin: 0 0 0.5rem; }
.tematy-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin: 0 0 1.5rem;
}
.tematy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.tematy-table th,
.tematy-table td {
  border: 1px solid #27272a;
  padding: 0.6rem 0.75rem;
  vertical-align: top;
  color: #fff;
}
.tematy-table th {
  color: #34d399;
  background: #09090b;
}
.tematy-pre {
  overflow-x: auto;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  line-height: 1.45;
  background: #09090b;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin: 0 0 1.35rem;
  color: #d4d4d8;
}
