/* Meter.net — Ping test fragment
   Design tokens: one value per token per theme. Everything below resolves
   through these — nothing else carries a literal colour. */

/* Source Sans Pro — self-hosted (same font as the legacy web, no CDN) */
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 400;
  font-display: fallback;
  src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url(assets/fonts/sourcesanspro.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 400;
  font-display: fallback;
  src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url(assets/fonts/sourcesanspro_ext.woff2) format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 700;
  font-display: fallback;
  src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(assets/fonts/sourcesanspro_bold.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
@font-face {
  font-family: 'Source Sans Pro';
  font-style: normal;
  font-weight: 700;
  font-display: fallback;
  src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(assets/fonts/sourcesanspro_ext_bold.woff2) format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #ffffff; --bg-2: #f7fafb; --bg-3: #eef4f5;
  --bd: #dde7e9; --bd-2: #edf3f4;
  --tx: #1e292c; --tx-2: #414d51; --tx-3: #3d4c52;
  --brand: #12c2d6; --brand-2: #0fb0c2; --brand-ink: #0899ab;
  --brand-soft: #e2f4f7; --on-brand: #ffffff;
  --ok: #1d9e50; --ok-2: #4d9e1d; --warn: #c98a12; --err: #b02a2a; --err-graph: #d84b4b;
  --ink: #33393b; --ink-tx: #c8cfd1; --ink-tx-2: #8d9799; --ink-lnk: #9fd8e0;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #161b1d; --bg-2: #1c2325; --bg-3: #232b2d;
  --bd: #2d3739; --bd-2: #262e30;
  --tx: #e9eff0; --tx-2: #c0cacc; --tx-3: #8b989b;
  --brand: #12c2d6; --brand-2: #3ad3e4; --brand-ink: #3ad3e4;
  --brand-soft: #10343b; --on-brand: #062b32;
  --ok: #4bc97f; --ok-2: #4bc97f; --warn: #d8a13c; --err: #e07070; --err-graph: #e07070;
  --ink: #0f1315; --ink-tx: #98a2a4; --ink-tx-2: #6c7678; --ink-lnk: #7fc9d4;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #161b1d; --bg-2: #1c2325; --bg-3: #232b2d;
    --bd: #2d3739; --bd-2: #262e30;
    --tx: #e9eff0; --tx-2: #c0cacc; --tx-3: #8b989b;
    --brand: #12c2d6; --brand-2: #3ad3e4; --brand-ink: #3ad3e4;
    --brand-soft: #10343b; --on-brand: #062b32;
    --ok: #4bc97f; --ok-2: #4bc97f; --warn: #d8a13c; --err: #e07070; --err-graph: #e07070;
    --ink: #0f1315; --ink-tx: #98a2a4; --ink-tx-2: #6c7678; --ink-lnk: #7fc9d4;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg-2);
  font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
  color: var(--tx-2);
}
a { color: var(--brand-ink); }
a:hover { color: var(--brand-2); }
img { max-width: 100%; }
button { font-family: inherit; }
.hidden { display: none !important; }

.page {
  max-width: 1140px; margin: 0 auto; background: var(--bg);
  box-shadow: 0 8px 40px rgba(20,40,45,0.14);
  display: flex; flex-direction: column; position: relative; min-height: 100vh;
}

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; height: 64px; border-bottom: 1px solid var(--bd);
  position: relative; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-link { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { height: 28px; width: auto; }
.brand-word { display: flex; align-items: baseline; gap: 2px; font-weight: 800; font-size: 22px; }
.brand-meter { color: var(--tx); }
.brand-net { color: var(--err); font-size: 0.85em; }
.page-title {
  margin: 0; font-size: 20px; font-weight: 700; color: var(--tx);
  border-left: 1px solid var(--bd); padding-left: 12px; line-height: 1.2;
}

.nav-desktop {
  display: flex; align-items: center; gap: 26px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}
.nav-desktop > a { color: var(--tx-2); text-decoration: none; }
.nav-desktop > a:hover { color: var(--brand-ink); }
.nav-drop { position: relative; }
.nav-drop-btn {
  display: flex; align-items: center; gap: 6px; background: none; border: none; padding: 0;
  font: inherit; color: var(--tx-2); letter-spacing: inherit; text-transform: inherit; cursor: pointer;
}
.nav-drop.open .nav-drop-btn, .nav-drop-btn:hover { color: var(--brand-ink); }
.caret { font-size: 9px; }
.signin-btn {
  color: var(--brand-ink); border: 1.5px solid var(--brand); border-radius: 6px; padding: 7px 16px;
}
.signin-btn:hover { background: var(--brand-soft); }
.nav-drop-menu {
  display: none; position: absolute; top: 32px; left: -16px; min-width: 214px;
  background: var(--bg); border: 1px solid var(--bd); border-radius: 10px;
  box-shadow: 0 14px 36px rgba(10,25,30,0.18); padding: 6px;
  flex-direction: column; text-transform: none; letter-spacing: 0;
  font-size: 14px; font-weight: 500; z-index: 45;
}
.nav-drop.open .nav-drop-menu { display: flex; }
.nav-drop-menu-wide { min-width: 250px; }
.nav-drop-menu a {
  padding: 10px 14px; border-radius: 7px; color: var(--tx-2); text-decoration: none;
}
.nav-drop-menu a:hover { background: var(--brand-soft); }
.nav-drop-menu a.active { color: var(--brand-ink); font-weight: 700; background: var(--brand-soft); }
.nav-drop[data-drop="user"] .nav-drop-menu,
.nav-drop[data-drop="lang"] .nav-drop-menu { left: auto; right: -16px; }
.nav-drop[data-drop="user"] .nav-drop-menu { top: 42px; min-width: 196px; }
.nav-drop-lang { width: 322px; padding: 8px; }
.nav-drop-heading {
  padding: 6px 10px 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--tx-3);
}
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; }
.lang-grid a {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px;
  color: var(--tx-2); text-decoration: none; font-size: 13px; font-weight: 500;
}
.lang-grid a:hover { background: var(--brand-soft); }
.flag { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.flag-lg { width: 22px; height: 15px; }

.nav-mobile { display: none; align-items: center; margin-left: auto; }
.lang-trigger {
  display: flex; align-items: center; gap: 5px; padding: 11px 6px;
  background: none; border: none; color: var(--tx-2); cursor: pointer;
}
.lang-trigger .caret { font-size: 11px; }
.burger {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 6px 12px 10px;
  background: none; border: none; cursor: pointer;
}
.burger span { width: 20px; height: 2px; background: var(--tx-2); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--brand-soft) 0%, var(--bg-2) 100%);
  padding: 24px 48px 26px; display: flex; align-items: center; gap: 40px;
}
/* equal flex split with the hero text - the block width is driven by the
   layout, not by the (possibly long) server name, which ellipsizes instead.
   V HTML je text PRED ovladanim (SEO, jako v predloze) - vizualni poradi
   obraci flex order. */
.hero-controls { display: flex; flex-direction: column; gap: 10px; flex: 1 1 0; min-width: 0; order: 1; }
.cta {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
  gap: 14px; background: var(--brand); color: var(--on-brand); border: none; border-radius: 8px;
  height: 58px; padding: 0 32px; font-size: 19px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 18px rgba(18,194,214,0.35); white-space: nowrap; align-self: stretch;
}
.cta:hover { background: var(--brand-2); }
a.cta-link { text-decoration: none; color: var(--on-brand); }
a.cta-link:hover { color: var(--on-brand); }
.cta.running { background: var(--tx-3); box-shadow: none; }
.cta.running:hover { background: var(--tx-2); }
.cta-icon { font-size: 15px; width: 15px; display: flex; justify-content: center; }
.cta-progress {
  position: absolute; left: 0; bottom: 0; height: 4px; width: 0%;
  background: rgba(255,255,255,0.6); transition: width 0.15s linear;
}
.mode-row { display: flex; gap: 10px; }
.mode-card {
  /* min-width: 0 - dlouhy nazev serveru nesmi kartu rozsirit na ukor druhe,
     obe drzi presne 50/50 a text se zkracuje trojteckou */
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  background: transparent; border: 1.5px solid var(--bd); border-radius: 8px;
  padding: 9px 14px; cursor: pointer;
}
.mode-card.selected { background: var(--bg); border: 2px solid var(--brand); padding: 8.5px 13.5px; }
.mode-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--tx-3); background: var(--bg); flex-shrink: 0;
}
.mode-card.selected .mode-dot {
  border-color: var(--brand);
  background: radial-gradient(circle, var(--brand) 0 5px, var(--bg) 5px);
}
.mode-texts { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mode-texts strong { font-size: 14px; color: var(--tx); }
.mode-sub {
  font-size: 12px; color: var(--tx-3); white-space: nowrap;
  display: flex; align-items: baseline; gap: 4px; min-width: 0;
}
.mode-sub a { flex-shrink: 0; }
#serverLabel { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mode-sub a { font-weight: 600; }
.hero-text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--tx-2); flex: 1 1 0; max-width: 560px; text-wrap: pretty; order: 2; }

/* ---------- Spots (reklamni pruhy - neutralni nazvy kvuli adblock
   cosmetic filtrum, zadne "ad"/"banner" substringy) ---------- */
/* reklamni bloky bez bocniho odsazeni (od hrany ke hrane), obsah se
   pri mensi sirce centruje */
.spot-wrap { padding: 24px 0 0; display: flex; justify-content: center; }
.spot-live > div { width: 100%; text-align: center; }
.spot-live ins.adsbygoogle { margin: 0 auto; }
.spot-wrap-tight { padding-top: 28px; }
.spot-box {
  border: 1px dashed var(--tx-3); border-radius: 6px;
  background: repeating-linear-gradient(45deg, var(--bg-3), var(--bg-3) 10px, var(--bd-2) 10px, var(--bd-2) 20px);
  display: flex; align-items: center; justify-content: center;
  font: 500 12px ui-monospace, monospace; color: var(--tx-3);
}
.spot-wide { width: 970px; max-width: 100%; height: 90px; }
.spot-narrow { display: none; width: 100%; height: 100px; }
/* live spoty: rezervovana vyska GPT slotu, nez se banner nacte (bez shiftu);
   AdSense ins si drzi rozmery sam pres .a_responsive_im3 */
.spot-top #spot-slot-1 { min-height: 90px; }

/* ---------- Result cards ---------- */
.result-wrap { padding: 28px 48px 8px; }
.result-card { border: 1px solid var(--bd); border-radius: 12px; overflow: hidden; }
.result-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 28px; background: var(--bg-2); border-bottom: 1px solid var(--bd);
  gap: 16px; flex-wrap: wrap;
}
/* value block and labels vertically centered against each other — with
   baseline alignment the two-line meta hung visibly lower than the number */
.result-main { display: flex; align-items: center; gap: 16px; }
.result-meta { justify-content: center; gap: 2px; }
/* min-width reserves space for up to 3 digits + unit — the value appearing
   or growing must not push the labels on the right */
.result-value { font-size: 52px; font-weight: 800; color: var(--brand-ink); line-height: 1; min-width: 150px; }
.result-value .unit { font-size: 22px; font-weight: 600; color: var(--tx-3); }
.result-meta { display: flex; flex-direction: column; }
.result-label {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--tx-3); font-weight: 600;
}
.result-verdict { font-size: 14px; font-weight: 700; color: var(--tx-3); }
.result-verdict.ok { color: var(--ok); }
.result-verdict.warn { color: var(--warn); }
.result-verdict.err { color: var(--err); }
/* hidden until the result is stored; visibility keeps the reserved space —
   showing the button must not cause a layout shift */
.result-actions { display: flex; gap: 12px; visibility: hidden; }
.result-actions.ready { visibility: visible; }
.btn {
  border-radius: 7px; padding: 11px 20px; font-size: 15px; font-weight: 600; cursor: pointer;
  display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 7px;
}
.btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.btn-primary { background: var(--brand); color: var(--on-brand); border: none; }
.btn-primary:hover { background: var(--brand-2); }
.btn-outline { background: var(--bg); color: var(--brand-ink); border: 1.5px solid var(--brand); }
.btn-outline:hover { background: var(--brand-soft); }
/* "New test setup" vedle Share - jen na mobilu (desktop ma start button na ocich) */
.btn-newtest { display: none; }
/* mobilni Stop v prostoru pro Share behem bezciciho testu */
.btn-stoptest { display: none; }
/* maly ctvercovy rerun (stejny test hned znovu) - jen na mobilu */
.btn-rerun { display: none; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--bd); }
.stat {
  padding: 14px 28px; border-right: 1px solid var(--bd-2);
  display: flex; flex-direction: column; gap: 2px;
}
.stat:last-child { border-right: none; }
.stat-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--tx-3); font-weight: 600;
}
.stat-value { font-size: 20px; font-weight: 700; color: var(--tx); }

.graph-box { padding: 22px 28px 26px; }
.graph-note {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12px; color: var(--tx-3); margin-bottom: 8px;
}
.graph { display: flex; align-items: flex-end; gap: 2px; height: 77px; }
.graph-bar { flex: 1; border-radius: 2px 2px 0 0; background: var(--bd); min-height: 2px; position: relative; }
.graph-bar.done { background: var(--brand); }
.graph-bar.spike { background: var(--err-graph); }
/* hover tooltip s hodnotou konkretniho pingu (jen namerene bary) */
.graph-bar[data-ms]:hover { filter: brightness(1.25); }
.graph-bar[data-ms]:hover::after {
  content: attr(data-ms) ' ms';
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 5px; padding: 3px 8px; border-radius: 4px;
  background: var(--ink); color: var(--ink-tx);
  font-size: 11px; font-weight: 600; white-space: nowrap;
  pointer-events: none; z-index: 5;
}
.graph-scale {
  display: flex; justify-content: space-between; font-size: 11px;
  color: var(--tx-3); margin-top: 6px;
}

/* ---------- World ping ---------- */
.world-box { display: flex; flex-direction: column; padding: 16px 28px 22px; }
.world-legend { padding-bottom: 8px; margin-bottom: 0; }
.world-thead {
  display: grid; grid-template-columns: 44px 1.4fr 110px 1.1fr 1fr 80px; gap: 0 16px;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--tx-3); font-weight: 600; padding: 0 6px 6px; border-bottom: 1px solid var(--bd);
}
.world-col-ms { text-align: right; }
.world-scroll { }
.world-rows { display: flex; flex-direction: column; }
.world-row {
  height: 34px; display: grid; grid-template-columns: 44px 1.4fr 110px 1.1fr 1fr 80px; gap: 0 16px;
  align-items: center; padding: 0 6px; border-bottom: 1px solid var(--bg-3); font-size: 13px;
}
.world-row .w-provider {
  color: var(--tx-3); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.world-row .w-rank { color: var(--tx-3); font-weight: 600; }
.world-row .w-rank.err { color: var(--err); }
.world-row .w-loc { display: flex; flex-direction: column; min-width: 0; }
.world-row .w-loc strong { color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.world-row .w-loc .w-loc-region { display: none; color: var(--tx-3); font-size: 10px; }
.world-row .w-region { color: var(--tx-3); font-size: 12px; }
.world-row .w-bar { height: 10px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.world-row .w-bar i { display: block; height: 10px; border-radius: 3px; }
.world-row .w-ms { text-align: right; font-weight: 700; }
.world-row.running { background: var(--brand-soft); }
.world-row.running .w-rank { color: var(--brand-ink); }
.world-row.slot-empty { opacity: 0.45; }
/* pool rows: ping bar + a thin per-server progress bar stacked below it */
.world-row .w-bar-stack {
  height: auto; background: transparent; border-radius: 0; overflow: visible;
  display: flex; flex-direction: column; gap: 3px; justify-content: center;
}
.w-bar-stack .w-bar-ping { height: 10px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.w-bar-stack .w-bar-ping i { display: block; height: 10px; border-radius: 3px; }
.w-bar-stack .w-bar-prog { height: 3px; background: var(--bg-3); border-radius: 2px; overflow: hidden; }
.w-bar-stack .w-bar-prog i {
  display: block; height: 3px; border-radius: 2px;
  background: var(--brand); transition: width 0.15s linear;
}
.tone-ok { color: var(--ok); } .bg-ok { background: var(--ok); }
.tone-warn { color: var(--warn); } .bg-warn { background: var(--warn); }
.tone-err { color: var(--err); } .bg-err { background: var(--err); }
.tone-idle { color: var(--tx-3); }

/* ---------- SEO content ---------- */
.seo-grid { padding: 40px 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.seo-col { display: flex; flex-direction: column; gap: 12px; }
.seo-grid h2, .history h2, .faq h2 { margin: 0; font-size: 24px; font-weight: 700; color: var(--tx); }
.seo-grid p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--tx-2); text-wrap: pretty; }
.ping-table {
  display: flex; flex-direction: column; border: 1px solid var(--bd);
  border-radius: 10px; overflow: hidden;
}
.ping-row {
  display: grid; grid-template-columns: 110px 1fr 130px; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--bd-2); font-size: 14px;
}
.ping-row:last-child { border-bottom: none; }
.ping-row strong { color: var(--tx); font-size: 15px; }
.ping-desc { color: var(--tx-2); }
.ping-verdict {
  justify-self: end; font-weight: 700; font-size: 12px;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.tone-excellent { color: var(--ok); }
.tone-good { color: var(--ok-2); }
.tone-fair { color: var(--warn); }
.tone-poor { color: var(--err-graph); }

/* ---------- History ---------- */
.history { padding: 0 48px 44px; display: flex; flex-direction: column; gap: 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.link-more { font-size: 14px; font-weight: 600; }
.history-empty {
  border: 1.5px dashed var(--bd); border-radius: 10px; padding: 32px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
}
.history-empty strong { font-size: 16px; color: var(--tx-2); }
.history-empty span { font-size: 14px; color: var(--tx-3); }
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-more { align-self: center; }
.history-more:disabled { opacity: 0.5; cursor: default; }
.history-row {
  border: 1px solid var(--bd); border-radius: 10px; padding: 14px 20px;
  display: flex; align-items: center; gap: 24px;
}
.history-median { display: flex; align-items: baseline; gap: 4px; min-width: 120px; }
.history-median span { font-size: 26px; font-weight: 800; color: var(--brand-ink); }
.history-median small { font-size: 13px; color: var(--tx-3); }
.history-type {
  min-width: 110px; text-align: center; font-size: 12px; font-weight: 700;
  border-radius: 20px; padding: 5px 12px;
}
.type-single { color: var(--brand-ink); background: var(--brand-soft); }
.type-world { color: var(--ok); background: var(--bg-3); }
.history-info { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.history-date { font-size: 13px; color: var(--tx-3); }
.history-place { font-size: 14px; font-weight: 600; color: var(--tx); }
.history-extra { margin-left: auto; display: flex; gap: 14px; font-size: 13px; color: var(--tx-3); }
.history-extra a { font-weight: 600; }

/* ---------- FAQ ---------- */
.faq { padding: 0 48px 44px; display: flex; flex-direction: column; gap: 16px; }
.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 44px; }
.faq-item { display: flex; flex-direction: column; gap: 6px; }
.faq-item h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--tx); }
.faq-item p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--tx-2); text-wrap: pretty; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto; background: var(--ink); color: var(--ink-tx); padding: 22px 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  font-size: 13px; flex-wrap: wrap;
}
.site-footer a { color: var(--ink-lnk); }
.theme-switch { display: flex; align-items: center; gap: 8px; color: var(--ink-tx-2); }
.theme-tabs { display: flex; border: 1px solid var(--ink-tx-2); border-radius: 20px; overflow: hidden; }
.theme-tabs button {
  background: transparent; border: none; padding: 3px 11px; cursor: pointer;
  font-size: 13px; color: var(--ink-tx-2);
}
.theme-tabs button.active { background: rgba(255,255,255,0.12); color: var(--ink-tx); font-weight: 700; }

/* ---------- Overlays, modals, sheets ---------- */
.overlay {
  display: none; position: fixed; inset: 0; background: rgba(18,32,36,0.45); z-index: 50;
  justify-content: center; align-items: flex-start; padding-top: 160px;
}
.overlay.open { display: flex; }
.overlay-right { padding: 0; justify-content: flex-end; }
.overlay-top { padding: 0; flex-direction: column; justify-content: flex-start; }
.modal {
  width: 480px; max-width: calc(100% - 32px); background: var(--bg); border-radius: 12px;
  box-shadow: 0 20px 60px rgba(10,25,30,0.3); overflow: hidden;
  display: flex; flex-direction: column;
}
.modal-server { width: 560px; padding-bottom: 10px; }
.sheet-grip { display: none; width: 40px; height: 4px; background: var(--bd); border-radius: 2px; align-self: center; margin: 8px 0 0; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--bd);
}
.modal-head strong { font-size: 18px; color: var(--tx); }
.modal-close {
  background: none; border: none; font-size: 20px; color: var(--tx-3);
  cursor: pointer; padding: 4px 8px;
}
.modal-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.share-row { display: flex; flex-direction: column; gap: 8px; }
.share-row input {
  width: 100%; min-width: 0; border: 1px solid var(--bd); border-radius: 7px; padding: 11px 12px;
  font: 400 11.5px ui-monospace, monospace; color: var(--tx-2); background: var(--bg-2);
}
.share-row .btn { height: 44px; padding: 0 18px; font-size: 14px; }
.modal-note { font-size: 13px; color: var(--tx-3); }
.share-items { display: flex; flex-direction: column; }
.share-item {
  display: flex; align-items: center; gap: 14px; padding: 13px 10px;
  border-top: 1px solid var(--bd-2); text-decoration: none;
  font-size: 16px; font-weight: 600; color: var(--tx-2);
}
.share-item:hover { background: var(--brand-soft); color: var(--brand-ink); }
.share-item svg { width: 20px; height: 20px; color: var(--brand-ink); flex-shrink: 0; }
.modal-search { padding: 14px 24px 0; }
.modal-search input {
  width: 100%; border: 1px solid var(--bd); border-radius: 7px; padding: 11px 14px;
  font: 400 14px 'Source Sans Pro', sans-serif; color: var(--tx-2); background: var(--bg);
}
.server-list {
  display: flex; flex-direction: column; padding: 12px 8px 14px;
  max-height: 340px; overflow-y: auto;
}
.server-item {
  display: flex; align-items: center; gap: 14px; padding: 11px 16px;
  border-radius: 8px; cursor: pointer;
}
.server-item:hover { background: var(--brand-soft); }
.server-texts { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.server-texts strong { font-size: 15px; color: var(--tx); }
.server-texts span { font-size: 13px; color: var(--tx-3); }
.server-ping { font-size: 13px; color: var(--tx-3); }
.server-current {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--brand-ink); border: 1.5px solid var(--brand); border-radius: 20px; padding: 3px 10px;
}

/* Drawer (mobile menu) */
.drawer {
  width: 288px; max-width: 85%; background: var(--bg);
  box-shadow: -8px 0 30px rgba(10,25,30,0.25);
  display: flex; flex-direction: column; align-self: stretch; overflow-y: auto;
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--bd);
}
.drawer-head .brand-word { font-size: 17px; }
.drawer-nav { display: flex; flex-direction: column; padding: 6px 0; flex-shrink: 0; }
.drawer-top {
  display: block; padding: 13px 20px; font-size: 15px; font-weight: 600;
  text-decoration: none; color: var(--tx-2); border-left: 3px solid transparent;
}
.drawer-top:hover { background: var(--brand-soft); }
.drawer-sep { border-top: 1px solid var(--bd-2); }
.drawer-sub { display: flex; flex-direction: column; padding: 2px 0 6px; }
.drawer-sub a {
  padding: 10px 20px 10px 34px; font-size: 14px; text-decoration: none; color: var(--tx-3);
}
.drawer-sub a:hover { background: var(--brand-soft); }
.drawer-sub a.active { font-weight: 700; color: var(--brand-ink); border-left: 3px solid var(--brand); padding-left: 31px; }

/* Language sheet (mobile) */
.lang-sheet {
  margin-top: 54px; background: var(--bg); border-radius: 0 0 14px 14px;
  box-shadow: 0 16px 36px rgba(10,25,30,0.28); padding: 14px 14px 16px;
  display: flex; flex-direction: column; gap: 11px;
}
.lang-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.lang-sheet-head strong {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--tx-3);
}
.lang-sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lang-sheet-grid a {
  display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 10px;
  border: 1px solid var(--bd); border-radius: 9px; text-decoration: none;
}
.lang-sheet-grid a:hover { background: var(--brand-soft); }
.lang-sheet-grid span { font-size: 12px; font-weight: 600; color: var(--tx); }
.lang-sheet-grid em {
  margin-left: auto; font-style: normal; font-size: 10px; font-weight: 700;
  letter-spacing: 0.05em; color: var(--tx-3);
}

/* ---------- Narrow desktop - hero stacks, text under the controls ---------- */
@media (max-width: 1080px) {
  .hero { flex-direction: column; align-items: stretch; gap: 18px; }
  .hero-text { max-width: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .site-header { padding: 0 12px 0 18px; height: 54px; }
  .brand { gap: 12px; }
  .brand-logo { height: 26px; }
  .brand-word { display: none; }
  .page-title { font-size: 20px; font-weight: 800; line-height: 1; }
  .nav-desktop { display: none; }
  .nav-mobile { display: flex; }

  .hero {
    background: linear-gradient(160deg, var(--brand-soft) 0%, var(--bg-2) 100%);
    padding: 16px 18px 18px; flex-direction: column; align-items: stretch; gap: 10px;
  }
  /* uvodni SEO text musi byt viditelny i na mobilu (mobile-first indexace) */
  .hero-text { font-size: 13px; line-height: 1.5; }
  .cta { height: 56px; gap: 12px; padding: 0; }
  .mode-row { gap: 8px; }
  .mode-card { flex-direction: column; align-items: stretch; gap: 2px; padding: 9px 12px; min-height: 44px; }
  .mode-card.selected { padding: 8.5px 11.5px; }
  .mode-card .mode-texts { display: contents; }
  .mode-card strong { font-size: 13px; display: flex; align-items: center; gap: 7px; }
  .mode-dot { width: 14px; height: 14px; }
  .mode-card { display: grid; grid-template-columns: 21px 1fr; grid-template-rows: auto auto; }
  .mode-card .mode-dot { grid-row: 1; align-self: center; }
  .mode-card strong { grid-column: 2; grid-row: 1; }
  .mode-sub { grid-column: 2; grid-row: 2; font-size: 11px; min-width: 0; overflow: hidden; }

  .spot-wrap { padding: 16px 0 0; }
  .spot-wide { display: none; }
  .spot-narrow { display: flex; }
  .spot-top #spot-slot-1 { min-height: 100px; }
  .result-actions .btn-newtest { display: inline-flex; }
  .result-actions .btn.btn-rerun {
    display: inline-flex; flex: 0 0 44px;
    width: 44px; min-width: 44px; max-width: 44px; height: 44px; padding: 0;
  }
  /* behem testu je akcni radek viditelny a obsahuje jen Stop */
  .result-actions.running { visibility: visible; }
  .result-actions.running .btn { display: none; }
  .result-actions.running .btn-stoptest { display: inline-flex; }
  /* po selhani testu jen navrat k nastaveni (share neni co sdilet) */
  .result-actions.failed { visibility: visible; }
  .result-actions.failed .btn { display: none; }
  .result-actions.failed .btn-newtest { display: inline-flex; }

  .result-wrap { padding: 16px 18px; }
  .result-head { padding: 16px 18px 12px; }
  .result-value { font-size: 40px; min-width: 115px; }
  .result-value .unit { font-size: 17px; }
  .result-label { font-size: 11px; }
  .result-verdict { font-size: 13px; }
  /* uvodni "Results will appear..." jen na desktopu; na mobilu se dlouhy
     text zalamoval - radek zustava rezervovany, text neviditelny */
  .result-verdict.idle { visibility: hidden; white-space: nowrap; }
  .result-actions { width: 100%; }
  .result-actions .btn { flex: 1; height: 44px; padding: 0; font-size: 15px; }
  /* vsechny 4 statistiky vedle sebe (popisek nad hodnotou) - nizsi vyska */
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .stat { padding: 8px 10px; align-items: center; text-align: center; }
  .stat-label { font-size: 10px; }
  .stat-value { font-size: 16px; }
  .graph-box { padding: 14px 16px; }
  /* poznamka nad grafem pres cely radek, vzdy jeden radek (ellipsis);
     "spikes shown in red" na mobilu pryc */
  .graph-box .graph-note { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .graph-box .graph-note span + span { display: none; }
  .graph { height: 49px; gap: 1px; }
  .graph-bar { border-radius: 1px 1px 0 0; }
  .graph-bar:nth-child(even) { display: none; }

  .world-box { padding: 10px 14px 12px; }
  .world-legend { display: none; }
  .world-thead { display: none; }
  .world-row { height: 34px; grid-template-columns: 26px 1fr 64px; gap: 0 8px; padding: 0 4px; }
  .world-row .w-rank { font-size: 11px; }
  .world-row .w-loc strong { font-size: 12px; }
  .world-row .w-loc .w-loc-region { display: block; }
  .world-row .w-region { display: none; }
  .world-row .w-provider { display: none; }
  .world-row .w-bar { display: none; }
  .world-row .w-ms { font-size: 12px; }

  .seo-grid { padding: 24px 18px 8px; grid-template-columns: 1fr; gap: 24px; }
  .seo-grid h2, .history h2, .faq h2 { font-size: 20px; }
  .seo-grid p { font-size: 14px; line-height: 1.6; }
  .ping-row { grid-template-columns: 84px 1fr auto; padding: 10px 14px; font-size: 13px; }
  .ping-row strong { font-size: 14px; }
  .ping-desc { display: none; }
  .ping-verdict { font-size: 11px; }

  .history { padding: 18px 18px 24px; gap: 10px; }
  .history-row { padding: 12px 14px; gap: 10px; flex-wrap: wrap; }
  .history-median { min-width: 52px; }
  .history-median span { font-size: 22px; }
  .history-type { min-width: 0; font-size: 10px; padding: 2px 8px; }
  .history-info { min-width: 0; flex: 1; }
  .history-date { font-size: 11px; }
  .history-place { font-size: 12px; }
  .history-extra span { display: none; }

  .faq { padding: 8px 18px 24px; gap: 14px; }
  .faq-grid { grid-template-columns: 1fr; gap: 16px; }
  .faq-item h3 { font-size: 15px; }
  .faq-item p { font-size: 13px; }

  .site-footer { padding: 20px 18px; flex-direction: column; align-items: flex-start; gap: 12px; font-size: 12px; }
  .footer-copy { line-height: 1.7; }
  .theme-tabs button { padding: 4px 12px; }

  /* Modals become bottom sheets */
  .overlay { padding: 0; align-items: flex-end; }
  .modal {
    width: 100%; max-width: 100%; border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 40px rgba(10,25,30,0.3);
  }
  .sheet-grip { display: block; }
  .modal-head { border-bottom: none; padding: 10px 18px 0; }
  .modal-head strong { font-size: 17px; }
  .modal-body { padding: 0 18px 22px; }
  .share-row { flex-direction: column; }
  .share-row .btn { height: 48px; font-size: 16px; }
  .modal-note { text-align: center; font-size: 12px; }
  .modal-search { padding: 10px 18px 0; }
  .server-list { max-height: 300px; padding: 8px 8px 10px; }
}
