/* OpenPageScore: lekki wygląd bez JavaScriptu. Jasny, a przy ciemnym motywie systemu ciemny.
   Zasada: dużo światła, cienkie linie zamiast ramek i teł, jeden kolor akcentu. */
:root {
  --bg: #ffffff; --soft: #f6f7f8; --text: #111418; --muted: #6a7280;
  --line: #e8eaed; --accent: #2b59d9; --btn: #111418; --btn-text: #ffffff;
  --op: #2b59d9; --pr: #7c5cd6; --hc: #0e9384;
  --up: #12805c; --down: #c0392b;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1114; --soft: #171a1f; --text: #eceef1; --muted: #98a1ae;
    --line: #252a31; --accent: #8fb0ff; --btn: #eceef1; --btn-text: #0f1114;
    --op: #8fb0ff; --pr: #b9a3ff; --hc: #4fd1c1;
    --up: #4fd19a; --down: #ff8a7a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* nagłówek */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: -.01em; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.top nav { display: flex; flex-wrap: wrap; gap: 2px 18px; font-size: 14px; }
.top nav a { color: var(--muted); white-space: nowrap; padding: 4px 0; }
.top nav a:hover, .top nav a[aria-current] { color: var(--text); text-decoration: none; }
.top nav a[aria-current] { font-weight: 600; }
.hsearch { flex: 0 1 190px; min-width: 120px; margin-left: auto; }
.hsearch + .lang { margin-left: 0; }
.hsearch input { width: 100%; padding: 6px 10px; font: inherit; font-size: 14px; color: var(--text); background: var(--soft); border: 1px solid transparent; border-radius: 7px; }
.hsearch input:hover { border-color: var(--line); }
.hsearch input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--bg); }
.top .lang { margin-left: auto; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; }
.top .lang:hover { color: var(--text); border-color: var(--muted); text-decoration: none; }
@media (max-width: 640px) {
  .top { position: static; }
  .top .wrap { gap: 8px 14px; }
  .top nav { order: 3; flex-basis: 100%; gap: 2px 16px; }
  .hsearch { flex-basis: 130px; }
}
main { padding-top: 36px; padding-bottom: 72px; min-height: 60vh; }

/* stopka */
.foot { background: var(--soft); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot .wrap { padding-top: 40px; padding-bottom: 28px; }
.foot-cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px 32px; }
.foot-brand p { margin: 10px 0 0; max-width: 30ch; }
.foot h2 { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text); margin: 4px 0 10px; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin: 0 0 7px; }
.foot li a { color: var(--muted); }
.foot li a:hover { color: var(--text); text-decoration: none; }
.foot-base { margin: 32px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.foot-base p { margin: 0; }
.foot-base a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 700px) { .foot-cols { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

/* tekst */
h1 { font-size: clamp(28px, 5vw, 40px); font-weight: 650; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 12px; overflow-wrap: anywhere; text-wrap: balance; }
h2 { font-size: 18px; font-weight: 650; letter-spacing: -.01em; margin: 0 0 12px; }
section { margin-top: 56px; }
.hero { margin-top: 56px; text-align: center; }
.hero .lead { margin-left: auto; margin-right: auto; }
.hero .search { margin: 0 auto; justify-content: center; }
.hero .sub { max-width: 62ch; margin-left: auto; margin-right: auto; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 24px; max-width: 58ch; }
.sub, .hint, .crumb { color: var(--muted); font-size: 14px; }
.crumb { margin: 0 0 8px; }
.note { border-left: 2px solid var(--line); padding: 2px 0 2px 14px; color: var(--muted); font-size: 14px; max-width: 70ch; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }
code { background: var(--soft); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--soft); padding: 14px 16px; border-radius: 8px; overflow-x: auto; }
pre code { background: none; padding: 0; }
li { margin-bottom: 6px; }

/* formularze */
.search { display: flex; gap: 8px; flex-wrap: wrap; max-width: 620px; }
.search input, .gapform input, .gapform textarea {
  padding: 11px 14px; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px;
}
.search input { flex: 1 1 200px; min-width: 0; }
.search input:hover, .gapform input:hover, .gapform textarea:hover { border-color: var(--muted); }
.search input:focus, .gapform input:focus, .gapform textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.search button, .gapform button {
  padding: 11px 20px; font: inherit; font-weight: 600; cursor: pointer;
  color: var(--btn-text); background: var(--btn); border: 0; border-radius: 8px;
}
.search button:hover, .gapform button:hover { opacity: .85; }
.gapform { display: grid; gap: 16px; max-width: 560px; margin: 20px 0 28px; }
.gapform label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.gapform textarea { resize: vertical; }
.gapform button { justify-self: start; }

/* wyniki na karcie domeny */
.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 28px 24px; margin: 28px 0 16px; }
.score-head { display: flex; flex-direction: column-reverse; gap: 2px; }
.score-head span { font-size: 14px; color: var(--muted); }
.score-head strong { font-size: 44px; font-weight: 650; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.meter { height: 4px; background: var(--line); border-radius: 2px; margin: 12px 0 10px; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 2px; }
.op .meter span { background: var(--op); }
.pr .meter span { background: var(--pr); }
.hc .meter span { background: var(--hc); }
.score .hint { margin: 0; font-size: 13px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 40px; margin: 0; }
.facts div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts small { font-weight: 400; color: var(--muted); font-size: 13px; }
.tag { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }

/* tabele: same linie poziome */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
thead th { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; border-bottom-color: var(--text); }
tbody tr:hover > * { background: var(--soft); }
.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank thead th { white-space: normal; vertical-align: bottom; }
.rank td:nth-child(2) { overflow-wrap: anywhere; }
.rank:not(.gap) td:first-child { color: var(--muted); }
.rank:not(.gap) td:nth-child(2) { min-width: 17ch; }
.gap td:first-child { overflow-wrap: anywhere; }
.gap td small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 600px) {
  .rank th, .rank td { padding: 8px 4px; font-size: 13px; }
  .rank thead th { font-size: 11px; }
  .rank:not(.gap) td:nth-child(2) { min-width: 14ch; }
}
td .up, td .down, td .flat { font-size: 13px; margin-left: 6px; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }

/* zakładki, stronicowanie */
.tabs { display: flex; gap: 4px 20px; flex-wrap: wrap; margin: 16px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 0; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current] { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; font-size: 14px; color: var(--muted); }

/* metodologia */
.formula { font-size: 17px; background: var(--soft); border-radius: 8px; padding: 14px 16px; overflow-x: auto; }
.gloss dt { font-weight: 600; margin-top: 12px; }
.gloss dd { margin: 2px 0 0; color: var(--muted); }

/* wykresy historii (SVG z charts.py) */
.chart { margin: 20px 0 28px; overflow-x: auto; }
.chart svg { width: 100%; min-width: 560px; height: auto; display: block; font-family: inherit; }
.chart figcaption { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { font-size: 11px; fill: var(--muted); }
.chart .line { stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.chart .line.main { stroke-width: 2.6; opacity: 1; }
.chart .area { opacity: .1; }
.chart .gapline { stroke-width: 1.2; stroke-dasharray: 3 4; opacity: .6; }
.chart .val { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .val.main { font-size: 16px; font-weight: 700; }
.chart .bar { fill: var(--op); opacity: .8; }
.chart .crawl { stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 2 4; stroke-linecap: round; }
.chart .tip { opacity: 0; pointer-events: none; transition: opacity .08s; }
.chart .hit:hover .tip { opacity: 1; }
.chart .hit:hover ~ .hit .tip { opacity: 0; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .dot { stroke: var(--bg); stroke-width: 2; }
.chart .tipbox { fill: var(--bg); stroke: var(--line); filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .12)); }
.chart .th { font-size: 11px; fill: var(--muted); }
.chart .tl { font-size: 12px; fill: var(--text); font-variant-numeric: tabular-nums; }

/* strony narzędzi: opisy, kafelki, FAQ */
.prose { max-width: 68ch; }
.prose p, .prose li { color: var(--text); }
.prose ul { padding-left: 20px; }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.tools a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.tools a:hover { border-color: var(--muted); text-decoration: none; }
.tools strong { display: block; margin-bottom: 4px; }
.tools span { color: var(--muted); font-size: 14px; }
.faq { max-width: 72ch; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary, .gloss summary { cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker, .gloss summary::-webkit-details-marker { display: none; }
.faq summary { padding: 14px 28px 14px 0; font-weight: 600; position: relative; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-weight: 400; font-size: 20px; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* karta domeny: słownik miar i opis danych */
details.gloss { margin: 14px 0 0; font-size: 14px; }
details.gloss summary { color: var(--accent); display: inline-block; }
details.gloss summary:hover { text-decoration: underline; text-underline-offset: 3px; }
details.gloss dl { margin: 8px 0 0; padding: 4px 16px 14px; background: var(--soft); border-radius: 8px; }
.insights { list-style: none; margin: 0; padding: 0; max-width: 74ch; }
.insights li { margin: 0; padding: 12px 0 12px 16px; border-bottom: 1px solid var(--line); border-left: 2px solid var(--accent); padding-left: 14px; margin-bottom: 8px; border-bottom: 0; }
.insights li strong { display: block; }

/* mapa rankingów */
.tldmap { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.tldmap li { margin: 0; }
.tldmap a { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); }
.tldmap a:hover { border-color: var(--muted); text-decoration: none; }
.tldmap strong { color: var(--accent); }
.tldmap em { grid-column: 1; grid-row: 2; font-style: normal; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tldmap span { grid-column: 2; grid-row: 1; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tldsmall { line-height: 2; font-size: 14px; }
.tldsmall a { margin-right: 10px; white-space: nowrap; }

/* dokumentacja API */
table.api th { text-align: left; font-weight: 500; white-space: nowrap; vertical-align: top; width: 1%; padding-right: 20px; }
table.api td { color: var(--muted); }
h3 { font-size: 16px; font-weight: 650; margin: 36px 0 8px; scroll-margin-top: 70px; }
h3 code { font-size: 14px; }
.verb { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--accent); border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; vertical-align: 2px; }
#common-crawl { scroll-margin-top: 70px; }
.mcp-url { margin: 4px 0 10px; }
.mcp-url code { display: inline-block; font-size: 16px; padding: 12px 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); user-select: all; overflow-wrap: anywhere; }

/* telefon */
h3 code, .prose code, p code, td code { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  /* menu w jednym wierszu, przewijane w bok zamiast łamania */
  .top nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .top nav::-webkit-scrollbar { display: none; }
  /* trzy wyniki obok siebie zamiast 2 + 1 */
  .scores { grid-template-columns: repeat(3, 1fr); gap: 16px 14px; }
  .score-head strong { font-size: 32px; }
  .score-head span { font-size: 12px; }
  .score .hint { display: none; }
  /* wykres zaczyna się od prawej strony: najnowsze wydania widać bez przewijania */
  .chart { direction: rtl; }
  .chart svg, .chart figcaption { direction: ltr; }
  .chart figcaption { text-align: left; }
  /* tabele dokumentacji API: nazwa nad opisem */
  table.api, table.api tbody, table.api tr, table.api th, table.api td { display: block; width: auto; }
  table.api th { white-space: normal; padding: 12px 0 2px; border: 0; }
  table.api td { padding: 0 0 12px; }
  h3 { margin-top: 28px; }
  .mcp-url code { font-size: 14px; padding: 10px 12px; }
  /* odstęp treści od nagłówka i zakładki w jednym wierszu */
  main.wrap { padding-top: 20px; }
  .hero { margin-top: 28px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
}

/* przyciski „Ask AI”: wyróżniony blok z tłem i akcentem */
.ai-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin: 28px 0 12px; padding: 16px 20px; background: var(--soft); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; }
.ai-text { display: flex; flex-direction: column; gap: 2px; min-width: 200px; }
.ai-head { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 650; }
.ai-head svg { color: var(--accent); width: 18px; height: 18px; }
.ai-sub { font-size: 13px; color: var(--muted); }
.ai-chips { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.ai-chip, .ai-chip:visited { padding: 8px 16px; font-size: 14px; font-weight: 600; background: var(--btn); color: var(--btn-text); border-radius: 999px; white-space: nowrap; }
.ai-chip:hover { opacity: .85; text-decoration: none; }
.hero .ai-links, .scores + .sub + .ai-links { margin-top: 20px; }
@media (max-width: 640px) {
  .ai-links { padding: 14px 16px; }
  .ai-chip, .ai-chip:visited { padding: 8px 14px; }
}

/* ukryta strona statystyk */
table.stats td, table.stats th { white-space: nowrap; }
.sbar { display: inline-block; width: 90px; height: 6px; margin-left: 8px; background: var(--soft); border-radius: 3px; vertical-align: middle; overflow: hidden; }
.sbar span { display: block; height: 100%; background: var(--op); }
.shours { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.shours span { flex: 1; min-height: 1px; background: var(--op); opacity: .8; border-radius: 2px 2px 0 0; }
.shours span:hover { opacity: 1; }

.partner { margin: 16px 0; padding: 14px 18px; background: var(--soft); border: 1px solid var(--line); border-left: 3px solid var(--up); border-radius: 10px; }
.partner p { margin: 0; }
.ad-tag { display: inline-block; margin-right: 8px; padding: 1px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--muted); border-radius: 4px; vertical-align: 1px; }
.nc-tag { display: inline-block; margin-left: 6px; padding: 0 6px; font-size: 11px; color: var(--muted); border: 1px solid var(--line, var(--muted)); border-radius: 4px; white-space: nowrap; vertical-align: 1px; }
p.note .nc-tag { margin-left: 0; margin-right: 6px; }
.partner a { white-space: nowrap; font-weight: 600; }
.partner small { color: var(--muted); }
@media (max-width: 600px) { .partner a { white-space: normal; } }
