/* Speedmesser.com — Premium Speed Test Design v4 (2026-12)
   Inspired by: FAST.com simplicity · Ookla clarity · Cloudflare depth */

@layer base, layout, components, utilities;

@layer base {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; tab-size: 4; scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

  :root {
    /* Premium color system — OKLCH for perceptually uniform gradients */
    --brand-1: oklch(0.66 0.20 250);
    --brand-2: oklch(0.78 0.18 180);
    --accent:  oklch(0.78 0.20 145);
    --warn:    oklch(0.78 0.20 75);
    --danger:  oklch(0.65 0.22 28);

    --bg:           oklch(0.12 0.020 250);
    --bg-elev:      oklch(0.16 0.025 250);
    --bg-elev-2:    oklch(0.20 0.030 250);
    --surface:      oklch(0.17 0.025 250 / 0.6);
    --border:       oklch(0.30 0.025 250 / 0.4);
    --border-strong: oklch(0.36 0.030 250 / 0.6);

    --text:         oklch(0.97 0.004 250);
    --text-muted:   oklch(0.70 0.015 250);
    --text-dim:     oklch(0.55 0.015 250);

    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-md: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.5rem;
    --fs-2xl: 2rem;
    --fs-3xl: clamp(1.8rem, 4vw, 2.6rem);

    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
    --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;
    --sp-10: 56px; --sp-12: 72px;

    --r-sm: 8px; --r-md: 14px; --r-lg: 18px; --r-xl: 28px;

    --shadow-soft: 0 10px 40px -10px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 60px -10px oklch(0.66 0.20 250 / 0.25);

    --font-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  }

  /* Light theme override */
  [data-theme="light"] {
    --bg: oklch(0.98 0.004 250);
    --bg-elev: oklch(0.96 0.006 250);
    --bg-elev-2: oklch(0.93 0.008 250);
    --surface: oklch(0.96 0.006 250 / 0.7);
    --border: oklch(0.86 0.012 250 / 0.7);
    --border-strong: oklch(0.78 0.015 250 / 0.8);
    --text: oklch(0.20 0.020 250);
    --text-muted: oklch(0.42 0.020 250);
    --text-dim: oklch(0.58 0.018 250);
  }

  html, body { margin: 0; padding: 0; min-height: 100%; }
  body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    font-size: var(--fs-md);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
  }
  /* Subtle ambient background */
  body::before {
    content: ""; position: fixed; inset: 0;
    background:
      radial-gradient(ellipse 60% 40% at 20% 0%, color-mix(in oklab, var(--brand-1) 18%, transparent), transparent 60%),
      radial-gradient(ellipse 40% 30% at 90% 10%, color-mix(in oklab, var(--brand-2) 14%, transparent), transparent 60%);
    pointer-events: none; z-index: -1; opacity: 0.7;
  }
  [data-theme="light"] body::before { opacity: 0.4; }

  a { color: var(--brand-1); text-decoration: none; }
  a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
  img, svg { max-width: 100%; height: auto; display: block; }

  h1, h2, h3, h4, h5 { margin: 0 0 var(--sp-4); line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; }
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
  h3 { font-size: var(--fs-xl); }
  p { margin: 0 0 var(--sp-4); }
  ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.4em; }
  li { margin-bottom: var(--sp-1); }

  .skip-link {
    position: absolute; top: -100px; left: 0;
    padding: var(--sp-3) var(--sp-5); background: var(--brand-1); color: white;
    z-index: 1000; border-radius: 0 0 var(--r-md) 0;
    transition: top 0.2s;
  }
  .skip-link:focus { top: 0; }
}

@layer layout {
  .container { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: var(--sp-5); }
  @media (min-width: 768px) { .container { padding-inline: var(--sp-6); } }
}

@layer components {
  /* ── HEADER ── */
  .header {
    padding: var(--sp-4) 0;
    border-bottom: 1px solid var(--border);
    background: color-mix(in oklab, var(--bg) 70%, transparent);
    backdrop-filter: blur(20px);
    position: sticky; top: 0; z-index: 50;
  }
  .header-inner {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 1080px; margin-inline: auto; padding-inline: var(--sp-5);
    gap: var(--sp-4);
  }
  .logo {
    display: inline-flex; align-items: center; gap: var(--sp-3);
    color: var(--text); text-decoration: none; font-weight: 700;
  }
  .logo-mark {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    display: grid; place-items: center;
    box-shadow: 0 4px 16px -4px color-mix(in oklab, var(--brand-1) 60%, transparent);
  }
  .logo-mark svg { width: 20px; height: 20px; }
  .logo-text { font-size: var(--fs-lg); letter-spacing: -0.02em; }
  .header nav { display: flex; gap: var(--sp-5); align-items: center; }
  .header nav a {
    color: var(--text-muted); text-decoration: none; font-size: var(--fs-sm);
    font-weight: 500; transition: color 0.15s;
  }
  .header nav a:hover, .header nav a[aria-current="true"] { color: var(--text); }
  @media (max-width: 640px) {
    .header nav a:not(.lang-current):not(.theme-toggle) { display: none; }
  }

  /* Language switcher */
  .lang-switcher { position: relative; }
  .lang-current {
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text); padding: 8px 12px;
    border-radius: var(--r-sm); cursor: pointer; font-weight: 600;
    font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: 6px;
  }
  .lang-current::after { content: "▾"; font-size: 0.8em; color: var(--text-muted); }
  .lang-menu {
    position: absolute; right: 0; top: calc(100% + 6px);
    background: var(--bg-elev-2); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: 6px; z-index: 10;
    min-width: 200px; max-height: 70vh; overflow-y: auto;
    box-shadow: var(--shadow-soft); display: none;
    backdrop-filter: blur(20px);
    scrollbar-width: thin;
  }
  .lang-menu.open { display: block; }
  .lang-menu a {
    display: block; padding: 8px 12px;
    color: var(--text); text-decoration: none;
    border-radius: var(--r-sm); font-size: var(--fs-sm);
  }
  .lang-menu a:hover, .lang-menu a[aria-current="true"] {
    background: color-mix(in oklab, var(--brand-1) 18%, transparent);
    color: var(--brand-1);
  }

  .theme-toggle {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text); cursor: pointer;
    display: grid; place-items: center;
  }
  .theme-toggle svg { width: 16px; height: 16px; }

  /* ── HERO — compact, above-the-fold ── */
  .hero {
    padding: var(--sp-4) 0 var(--sp-3);
    text-align: center;
  }
  .hero h1 {
    font-size: clamp(1.3rem, 2.6vw, 1.8rem);
    margin: 0 auto var(--sp-2);
    max-width: 28ch; line-height: 1.15;
    letter-spacing: -0.02em;
  }
  .hero .grad {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  .hero-sub {
    font-size: clamp(0.82rem, 1.2vw, 0.95rem);
    color: var(--text-muted);
    max-width: 55ch; margin: 0 auto;
    line-height: 1.5;
  }
  .hero-meta { display: none; }

  /* ── TRUST BAR — minimal pill row ── */
  .trust-bar {
    padding: var(--sp-3) 0 var(--sp-4); background: transparent; border: none; margin: 0;
  }
  .trust-bar-inner {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: var(--sp-3) var(--sp-5);
  }
  .trust-stat { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); }
  .trust-stat .num { color: var(--text); font-weight: 600; font-size: var(--fs-sm); }
  .trust-stat .lbl { color: var(--text-muted); font-size: 12px; }
  .featured-in { display: none; }

  /* ── PRE-TEST INFO BAR (Server, IP, Provider) ── */
  .pre-test-info {
    display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); justify-content: center;
    margin: 0 auto var(--sp-4); padding: 8px 16px;
    background: color-mix(in oklab, var(--bg-elev) 60%, transparent);
    border: 1px solid var(--border); border-radius: 999px;
    font-size: var(--fs-sm); color: var(--text-muted);
    max-width: max-content;
  }
  .pre-test-info .pti-item { display: inline-flex; align-items: center; gap: 6px; }
  .pre-test-info .pti-item strong { color: var(--text); font-weight: 600; }
  .pre-test-info .pti-icon { font-size: 14px; }

  /* ── TEST CARD ── */
  .test-card {
    background: var(--surface);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xl);
    padding: clamp(1rem, 2.5vw, 1.75rem);
    box-shadow: var(--shadow-soft), var(--shadow-glow);
    position: relative; overflow: hidden;
    container-type: inline-size;
  }
  .gauge-wrap {
    display: grid; place-items: center;
    margin: 0; padding-bottom: 16px;
    position: relative;
  }
  .gauge { width: 100%; max-width: 220px; aspect-ratio: 1; position: relative; }
  .gauge svg { width: 100%; height: 100%; transform: rotate(135deg); }
  .gauge-bg { fill: none; stroke: var(--border); stroke-width: 6; stroke-linecap: round; opacity: 0.5; }
  .gauge-fg {
    fill: none; stroke: url(#gauge-grad); stroke-width: 12; stroke-linecap: round;
    stroke-dasharray: 0 1000;
    transition: stroke-dasharray 0.5s cubic-bezier(0.22, 0.61, 0.36, 1), stroke 0.4s ease;
    filter: drop-shadow(0 0 14px color-mix(in oklab, var(--brand-1) 50%, transparent));
  }
  .gauge::before {
    content: ""; position: absolute; inset: 12%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, color-mix(in oklab, var(--brand-1) 10%, transparent), transparent 60%);
    filter: blur(12px); pointer-events: none;
  }
  .gauge-value {
    position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
    z-index: 1; transition: opacity 0.25s ease;
  }
  .gauge-value .label {
    color: var(--brand-1); font-size: 10px; font-weight: 700;
    letter-spacing: 0.22em; text-transform: uppercase; margin-bottom: 6px; opacity: 0.85;
  }
  .gauge-value .value {
    font-family: var(--font-mono);
    font-size: clamp(2.4rem, 14cqi, 4rem);
    font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    letter-spacing: -0.03em;
  }
  .gauge-value .unit { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 600; margin-top: 4px; }

  /* GO-Button INSIDE the gauge (overlay) */
  .test-btn {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 62%; aspect-ratio: 1; max-width: 170px;
    background: radial-gradient(circle at 35% 30%, oklch(0.80 0.20 250), oklch(0.55 0.22 250) 70%, oklch(0.42 0.20 250));
    color: white; border: none; border-radius: 9999px;
    font-size: clamp(1.6rem, 5cqi, 2.2rem); font-weight: 800; letter-spacing: 0.08em;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    box-shadow:
      0 8px 32px -6px color-mix(in oklab, var(--brand-1) 60%, transparent),
      0 0 0 4px color-mix(in oklab, var(--brand-1) 8%, transparent),
      inset 0 -8px 24px color-mix(in oklab, var(--brand-1) 30%, transparent),
      inset 0 8px 24px color-mix(in oklab, #fff 14%, transparent);
    text-transform: uppercase;
    z-index: 2;
  }
  .test-btn::before {
    content: ""; position: absolute; inset: -3px; border-radius: inherit;
    background: conic-gradient(from 0deg, transparent, color-mix(in oklab, var(--brand-2) 80%, transparent), transparent 65%);
    z-index: -1; animation: spin-soft 7s linear infinite; opacity: 0.6;
  }
  @keyframes spin-soft { to { transform: rotate(360deg); } }
  .test-btn:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.04);
  }
  .test-btn:active:not(:disabled) { transform: translate(-50%, -50%) scale(0.98); }
  .test-btn:disabled { cursor: progress; }

  .gauge.testing .test-btn { opacity: 0 !important; pointer-events: none; visibility: hidden; }
  .gauge.testing .gauge-value { opacity: 1; }
  .gauge:not(.testing):not(.done) .gauge-value { opacity: 0; }
  /* When .test-btn lives inside .gauge (JS-moved), make sure the gauge-value still wins z-order */
  .gauge .gauge-value { z-index: 3; pointer-events: none; }
  /* DONE-state: hide the entire gauge-wrap + button — result-card has its own retest-pill */
  body.show-result .gauge-wrap,
  body.show-result .test-btn,
  body.show-result .progress-bar,
  body.show-result .status-row,
  body.show-result .stats { display: none; }
  body.show-result .test-card { padding: 0; background: transparent; border: none; box-shadow: none; }

  /* Retest pill — top-right corner of result-card (no longer overlaps content) */
  .retest-pill {
    position: absolute; top: 14px; right: 14px;
    padding: 8px 18px; border-radius: 9999px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: white; border: none; font-weight: 700; font-size: 13px;
    letter-spacing: 0.05em; cursor: pointer;
    box-shadow: 0 4px 14px color-mix(in oklab, var(--brand-1) 40%, transparent);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 3; display: inline-flex; align-items: center; gap: 6px;
  }
  .retest-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px color-mix(in oklab, var(--brand-1) 50%, transparent);
  }
  .retest-pill:active { transform: translateY(0) scale(0.97); }
  .result-card { position: relative; }
  @media (max-width: 540px) {
    .retest-pill { top: 10px; right: 10px; padding: 6px 14px; font-size: 12px; }
  }

  /* Phase colors */
  .gauge.phase-ping .gauge-fg { stroke: var(--warn); animation: gauge-pulse 1.4s ease-in-out infinite; }
  .gauge.phase-down .gauge-fg { stroke: url(#gauge-grad); }
  .gauge.phase-up   .gauge-fg { stroke: var(--brand-2); }
  @keyframes gauge-pulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; filter: drop-shadow(0 0 16px currentColor); }
  }

  /* ── STATS (horizontal compact) ── */
  .stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px; margin-top: var(--sp-3);
  }
  @media (max-width: 540px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 3px; } }
  .stat {
    background: color-mix(in oklab, var(--bg-elev) 65%, transparent);
    border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 8px 6px; text-align: center;
    transition: border-color 0.3s, background 0.3s, transform 0.3s;
    position: relative;
  }
  .stat.active {
    border-color: var(--brand-1);
    background: color-mix(in oklab, var(--brand-1) 14%, var(--bg-elev));
    transform: translateY(-1px);
  }
  .stat-label {
    font-size: 10px; color: var(--text-muted);
    letter-spacing: 0.1em; text-transform: uppercase;
    font-weight: 700; margin-bottom: 4px;
  }
  .stat-value {
    font-family: var(--font-mono); font-size: clamp(1.05rem, 2.5vw, 1.35rem);
    font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
    color: var(--text);
  }
  .stat.active .stat-value {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  .stat-unit { font-size: 10px; color: var(--text-dim); margin-left: 2px; font-weight: 500; }

  .status-row {
    display: flex; justify-content: center; align-items: center;
    gap: var(--sp-2); margin-top: var(--sp-3);
    font-size: var(--fs-sm); color: var(--text-muted); min-height: 1.4em;
  }
  .progress-bar { height: 3px; background: var(--border); border-radius: 999px; overflow: hidden; margin-top: var(--sp-3); }
  .progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand-1), var(--brand-2)); transition: width 0.4s cubic-bezier(0.22, 0.61, 0.36, 1); }

  /* ── RESULT CARD with TABLE + SCORE GRID ── */
  .result-card {
    margin-top: var(--sp-6);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xl);
    padding: clamp(1.25rem, 3vw, 2rem);
    backdrop-filter: blur(20px);
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .result-card.show { opacity: 1; transform: translateY(0); }
  @media (prefers-reduced-motion: reduce) { .result-card { transition: opacity 0.15s; transform: none; } }

  .result-card h3 {
    margin-top: 0; font-size: 11px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.15em; font-weight: 700;
  }
  .result-overall {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-4); margin-bottom: var(--sp-5);
  }
  .result-label { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
  .result-badge {
    font-family: var(--font-mono); font-size: var(--fs-xl); font-weight: 800;
    padding: 8px 18px; border-radius: var(--r-md);
    background: var(--bg-elev); border: 1px solid var(--border);
  }
  .result-badge.level-bad   { background: color-mix(in oklab, var(--danger) 20%, var(--bg-elev)); border-color: var(--danger); color: var(--danger); }
  .result-badge.level-ok    { background: color-mix(in oklab, var(--warn) 20%, var(--bg-elev)); border-color: var(--warn); color: var(--warn); }
  .result-badge.level-good, .result-badge.level-great { background: color-mix(in oklab, var(--accent) 20%, var(--bg-elev)); border-color: var(--accent); color: var(--accent); }

  /* Above-the-fold result summary — 3 compact cards (Download / Upload / Ping) */
  .result-grid {
    display: grid; gap: var(--sp-3);
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: var(--sp-4);
  }
  @media (max-width: 640px) { .result-grid { grid-template-columns: 1fr; } }
  .result-item {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--sp-3) var(--sp-4);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--sp-3); align-items: start;
  }
  .result-item.level-bad   { border-left-color: var(--danger); }
  .result-item.level-ok    { border-left-color: var(--warn); }
  .result-item.level-good  { border-left-color: oklch(0.78 0.18 145); }
  .result-item.level-great { border-left-color: var(--accent); }
  .result-icon {
    font-size: 22px; line-height: 1; align-self: center;
  }
  .result-info {
    display: grid; gap: 2px; min-width: 0;
  }
  .result-info strong {
    font-size: 11px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.08em;
    font-weight: 700;
  }
  .result-value {
    font-family: var(--font-mono);
    font-weight: 800; font-size: var(--fs-lg);
    color: var(--text); line-height: 1.1;
    font-variant-numeric: tabular-nums;
  }
  .result-item.level-bad   .result-value { color: var(--danger); }
  .result-item.level-ok    .result-value { color: var(--warn); }
  .result-item.level-good  .result-value { color: oklch(0.78 0.18 145); }
  .result-item.level-great .result-value { color: var(--accent); }
  .result-text {
    font-size: 12px; color: var(--text-muted);
    line-height: 1.4; margin-top: 2px;
  }

  /* Tip box (lightbulb) below the 3 cards */
  .result-tip {
    display: grid; grid-template-columns: auto 1fr; gap: var(--sp-3);
    align-items: start; padding: var(--sp-3) var(--sp-4);
    background: color-mix(in oklab, var(--brand-1) 8%, var(--bg-elev));
    border: 1px solid color-mix(in oklab, var(--brand-1) 22%, var(--border));
    border-radius: var(--r-md); margin: var(--sp-3) 0;
  }
  .result-tip-icon { font-size: 22px; }
  .result-tip p { margin: 0; font-size: var(--fs-sm); line-height: 1.5; }

  /* Share button row */
  .result-actions {
    display: flex; justify-content: center;
    margin: var(--sp-4) 0;
  }
  .share-btn {
    padding: 10px 22px; border-radius: 9999px;
    background: color-mix(in oklab, var(--brand-1) 12%, var(--bg-elev));
    border: 1px solid color-mix(in oklab, var(--brand-1) 35%, var(--border));
    color: var(--brand-1); font-weight: 700; font-size: var(--fs-sm);
    cursor: pointer; transition: transform 0.15s ease, background 0.2s ease;
  }
  .share-btn:hover {
    transform: translateY(-1px);
    background: color-mix(in oklab, var(--brand-1) 18%, var(--bg-elev));
  }

  /* Affiliate slot inside result card */
  .affiliate-slot {
    margin-top: var(--sp-4); padding: var(--sp-4);
    background: color-mix(in oklab, var(--accent) 6%, var(--bg-elev));
    border: 1px solid color-mix(in oklab, var(--accent) 22%, var(--border));
    border-radius: var(--r-md);
    display: grid; gap: 6px; position: relative;
  }
  .affiliate-slot::before {
    content: attr(data-label); position: absolute; top: 8px; right: 12px;
    font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-dim); opacity: 0.7;
  }
  .affiliate-slot strong { font-size: var(--fs-md); }
  .affiliate-slot p { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
  .affiliate-btn {
    margin-top: 6px; padding: 9px 18px; border-radius: var(--r-sm);
    background: var(--accent); color: var(--bg);
    font-weight: 700; font-size: var(--fs-sm); text-decoration: none;
    display: inline-block; justify-self: start;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
  }
  .affiliate-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px color-mix(in oklab, var(--accent) 35%, transparent); }

  /* Conversion hook (Slow Internet CTA) */
  .conversion-hook {
    margin: var(--sp-4) 0; padding: var(--sp-4) var(--sp-5);
    background: color-mix(in oklab, var(--warn) 10%, var(--bg-elev));
    border: 1px solid color-mix(in oklab, var(--warn) 30%, var(--border));
    border-left: 4px solid var(--warn);
    border-radius: var(--r-md);
  }
  .conversion-hook h4 {
    margin: 0 0 6px; font-size: var(--fs-md); color: var(--warn);
  }
  .conversion-hook p {
    margin: 0 0 var(--sp-3); color: var(--text); font-size: var(--fs-sm); line-height: 1.5;
  }
  .conversion-hook .ch-cta {
    display: inline-block; padding: 9px 18px;
    background: var(--warn); color: var(--bg);
    border-radius: var(--r-sm); font-weight: 700; font-size: var(--fs-sm);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
  }
  .conversion-hook .ch-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 14px color-mix(in oklab, var(--warn) 40%, transparent); }

  /* Rate provider widget */
  .rate-provider {
    margin: var(--sp-4) 0; padding: var(--sp-4);
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--r-md); text-align: center;
  }
  .rate-provider h4 {
    margin: 0 0 var(--sp-2); font-size: var(--fs-md); font-weight: 700;
  }
  .rate-stars {
    display: inline-flex; gap: 6px; cursor: pointer; font-size: 24px;
  }
  .rs-star {
    color: color-mix(in oklab, var(--text-dim) 50%, transparent);
    transition: color 0.15s ease, transform 0.1s ease;
  }
  .rs-star:hover, .rs-star.active {
    color: oklch(0.82 0.16 80);
  }
  .rs-star:hover { transform: scale(1.15); }
  .rp-thanks {
    display: none; margin-top: var(--sp-2);
    color: oklch(0.78 0.18 145); font-size: var(--fs-sm); font-weight: 600;
  }
  .rate-provider.done .rate-stars { pointer-events: none; }
  .rate-provider.done .rp-thanks { display: block; }

  /* Result table — 4 columns Wert/Ergebnis/Bewertung/Bedeutung */
  .result-table-wrap { overflow-x: auto; margin: var(--sp-5) 0; }
  table.result-table {
    width: 100%; border-collapse: collapse; font-size: var(--fs-sm);
  }
  table.result-table th, table.result-table td {
    padding: var(--sp-3) var(--sp-4);
    text-align: left; border-bottom: 1px solid var(--border);
  }
  table.result-table th {
    color: var(--text-muted); font-weight: 600; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.1em;
  }
  table.result-table td:nth-child(2) {
    font-family: var(--font-mono); font-weight: 800; color: var(--text);
    font-size: var(--fs-md); white-space: nowrap;
  }
  table.result-table tr:last-child td { border-bottom: none; }
  .rt-badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  }
  .rt-badge.lvl-great { background: color-mix(in oklab, var(--accent) 22%, var(--bg-elev)); color: var(--accent); }
  .rt-badge.lvl-good  { background: color-mix(in oklab, oklch(0.78 0.18 145) 22%, var(--bg-elev)); color: oklch(0.78 0.18 145); }
  .rt-badge.lvl-ok    { background: color-mix(in oklab, var(--warn) 22%, var(--bg-elev)); color: var(--warn); }
  .rt-badge.lvl-bad   { background: color-mix(in oklab, var(--danger) 22%, var(--bg-elev)); color: var(--danger); }
  @media (max-width: 640px) {
    table.result-table thead { display: none; }
    table.result-table tr {
      display: block; padding: var(--sp-3); border-bottom: 1px solid var(--border);
    }
    table.result-table td {
      display: flex; justify-content: space-between; padding: 6px 0; border: none;
      font-size: var(--fs-sm);
    }
    table.result-table td::before {
      content: attr(data-label); color: var(--text-muted); font-weight: 600; font-size: 11px;
      text-transform: uppercase; letter-spacing: 0.08em;
    }
  }

  /* Use-case score cards (0-100) */
  .score-grid {
    display: grid; gap: var(--sp-3);
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin-top: var(--sp-5);
  }
  .score-card {
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: var(--sp-4);
  }
  .score-card .sc-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
  }
  .score-card .sc-icon { font-size: 22px; }
  .score-card .sc-name { font-weight: 700; font-size: var(--fs-sm); }
  .score-card .sc-value {
    font-family: var(--font-mono); font-weight: 800; font-size: var(--fs-xl);
    font-variant-numeric: tabular-nums;
  }
  .score-card .sc-bar {
    height: 6px; background: var(--bg-elev-2); border-radius: 999px; overflow: hidden;
    margin-bottom: 8px;
  }
  .score-card .sc-fill {
    height: 100%; border-radius: inherit;
    transition: width 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .score-card.lvl-bad  .sc-value, .score-card.lvl-bad  .sc-fill { color: var(--danger); background: var(--danger); }
  .score-card.lvl-ok   .sc-value, .score-card.lvl-ok   .sc-fill { color: var(--warn);   background: var(--warn); }
  .score-card.lvl-good .sc-value, .score-card.lvl-good .sc-fill { color: oklch(0.78 0.18 145); background: oklch(0.78 0.18 145); }
  .score-card.lvl-great .sc-value, .score-card.lvl-great .sc-fill { color: var(--accent); background: var(--accent); }
  .score-card .sc-explain { color: var(--text-muted); font-size: 12px; line-height: 1.4; }
  .score-card .sc-row {
    display: grid; grid-template-columns: 1fr auto; gap: var(--sp-3); align-items: center;
    margin-bottom: 6px;
  }
  .score-card .sc-row .sc-bar { margin-bottom: 0; flex: 1; }

  /* Info-row in result table (server / IP) — no badge, spans the rating + meaning columns */
  table.result-table tr.rt-info td {
    color: var(--text-muted); font-weight: 500;
  }
  table.result-table tr.rt-info td:first-child { font-weight: 600; color: var(--text); }

  /* Diagnostic + Action sections inside result */
  .diag-section { margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--border); }
  .diag-section h4 {
    margin: 0 0 var(--sp-3); font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted);
  }
  .diag-section .ds-heading {
    margin: var(--sp-6) 0 var(--sp-3); font-size: var(--fs-lg);
    font-weight: 800; color: var(--text); letter-spacing: -0.01em;
  }
  .diag-section .ds-heading:first-child { margin-top: 0; }
  .diag-section .ds-sub {
    margin: 0 0 var(--sp-4); color: var(--text-muted); font-size: var(--fs-sm);
  }
  .result-id-footer {
    margin-top: var(--sp-5); padding-top: var(--sp-4);
    border-top: 1px dashed var(--border);
    color: var(--text-muted); font-size: 12px; text-align: center;
  }
  .result-id-footer .mono { font-family: var(--font-mono); }
  .diag-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
  .diag-list li {
    display: grid; grid-template-columns: auto 1fr; gap: var(--sp-3); align-items: start;
    padding: var(--sp-3) var(--sp-4);
    background: color-mix(in oklab, var(--warn) 8%, var(--bg-elev));
    border-left: 3px solid var(--warn); border-radius: var(--r-sm);
  }
  .diag-list li.ok {
    background: color-mix(in oklab, var(--accent) 8%, var(--bg-elev));
    border-left-color: var(--accent);
  }
  .diag-icon { font-size: 18px; }
  .action-tips { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
  .action-tips li {
    padding: var(--sp-3) var(--sp-4) var(--sp-3) calc(var(--sp-4) + 22px);
    background: var(--bg-elev); border-radius: var(--r-sm);
    border: 1px solid var(--border); position: relative;
    font-size: var(--fs-sm);
  }
  .action-tips li::before {
    content: "→"; position: absolute; left: var(--sp-4); color: var(--brand-1); font-weight: 800;
  }

  /* Result-card extras: connection meta + share */
  .diag-meta-grid {
    display: grid; gap: var(--sp-3);
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-top: var(--sp-2);
  }
  .diag-meta-grid > div {
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--r-sm); padding: 10px 14px;
  }
  .diag-key { display: block; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
  .diag-val { display: block; font-weight: 700; color: var(--text); }
  .diag-val.mono { font-family: var(--font-mono); font-size: var(--fs-sm); }

  .result-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: center; margin-top: var(--sp-5); }
  .share-btn {
    background: color-mix(in oklab, var(--brand-1) 12%, transparent);
    color: var(--brand-1);
    border: 1px solid color-mix(in oklab, var(--brand-1) 30%, transparent);
    padding: 10px 18px; border-radius: var(--r-md); cursor: pointer;
    font-weight: 700; font-size: var(--fs-sm);
  }
  .share-btn:hover { background: color-mix(in oklab, var(--brand-1) 22%, transparent); }

  /* Rate provider */
  .rate-provider {
    margin-top: var(--sp-5); padding: var(--sp-4) var(--sp-5);
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--r-md); text-align: center;
  }
  .rate-provider h4 { margin: 0 0 10px; font-size: var(--fs-sm); color: var(--text); text-transform: none; letter-spacing: 0; }
  .rate-stars { display: inline-flex; gap: 4px; cursor: pointer; user-select: none; }
  .rate-stars .rs-star { font-size: 28px; color: var(--text-dim); transition: color 0.15s, transform 0.15s; }
  .rate-stars .rs-star.active { color: oklch(0.78 0.18 75); }
  .rate-stars .rs-star:hover { transform: scale(1.15); }
  .rate-provider .rp-thanks { color: var(--accent); margin-top: var(--sp-2); display: none; font-size: var(--fs-sm); }
  .rate-provider.done .rp-thanks { display: block; }

  /* Affiliate (in result card) */
  .affiliate-slot {
    margin-top: var(--sp-5); padding: var(--sp-4) var(--sp-5);
    background: linear-gradient(135deg, color-mix(in oklab, var(--brand-2) 10%, var(--bg-elev)), var(--bg-elev));
    border: 1px solid color-mix(in oklab, var(--brand-2) 25%, transparent);
    border-radius: var(--r-md); display: grid; gap: 6px;
  }
  .affiliate-slot::before {
    content: "Anzeige · Ad"; display: block; font-size: 10px; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--text-dim); margin-bottom: 2px;
  }
  .affiliate-slot strong { font-size: var(--fs-md); color: var(--text); }
  .affiliate-slot p { color: var(--text-muted); font-size: var(--fs-sm); margin: 0; }
  .affiliate-btn {
    justify-self: start; margin-top: 6px;
    background: var(--brand-2); color: #001a0e;
    padding: 8px 14px; border-radius: var(--r-sm);
    text-decoration: none; font-weight: 700; font-size: var(--fs-sm);
  }
  .affiliate-btn:hover { filter: brightness(1.1); }

  /* ── QUICK TIPS STRIP ── */
  .quick-tips-strip {
    display: grid; gap: var(--sp-3);
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin: var(--sp-6) 0;
  }
  .quick-tip {
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: var(--sp-4); text-align: center;
    transition: transform 0.2s, border-color 0.2s;
  }
  .quick-tip:hover { transform: translateY(-2px); border-color: color-mix(in oklab, var(--brand-1) 40%, var(--border)); }
  .quick-tip .qt-icon { font-size: 26px; margin-bottom: 6px; display: block; }
  .quick-tip .qt-title { font-weight: 700; font-size: var(--fs-sm); margin-bottom: 3px; }
  .quick-tip .qt-desc { color: var(--text-muted); font-size: 12px; line-height: 1.4; }

  /* ── Featured Articles ── */
  .featured-strip {
    display: grid; gap: var(--sp-3);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin: var(--sp-6) 0;
  }
  .featured-card {
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: var(--sp-5);
    text-decoration: none; color: inherit; display: block;
    transition: transform 0.2s, border-color 0.2s;
  }
  .featured-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in oklab, var(--brand-1) 40%, var(--border));
  }
  .featured-card .fc-icon { font-size: 26px; margin-bottom: 8px; display: block; }
  .featured-card .fc-title { font-weight: 700; margin-bottom: 6px; color: var(--text); }
  .featured-card .fc-desc { color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.4; }
  .featured-card .fc-link { color: var(--brand-1); font-size: var(--fs-sm); font-weight: 600; margin-top: 8px; display: inline-block; }

  /* Section heads under-the-fold */
  .section-head { max-width: 60ch; margin-bottom: var(--sp-5); }
  .section-head .eyebrow {
    font-size: 11px; color: var(--brand-1); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.12em;
    display: inline-block; margin-bottom: 6px;
  }
  .section-head h2 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); margin-bottom: 8px; }
  .section-head p { color: var(--text-muted); }

  /* Provider table, card grid, etc. — preserved styles */
  .table-wrap { overflow-x: auto; margin: var(--sp-4) 0; }
  table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
  table th, table td { padding: var(--sp-3) var(--sp-4); text-align: left; border-bottom: 1px solid var(--border); }
  table th { color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
  .badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
  .badge.good { background: color-mix(in oklab, var(--accent) 22%, var(--bg-elev)); color: var(--accent); }
  .badge.ok   { background: color-mix(in oklab, var(--warn) 22%, var(--bg-elev)); color: var(--warn); }
  .badge.bad  { background: color-mix(in oklab, var(--danger) 22%, var(--bg-elev)); color: var(--danger); }

  .card-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: var(--sp-4) 0; }
  .info-card {
    background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-md);
    padding: var(--sp-5);
  }
  .info-card h3 { font-size: var(--fs-md); margin-bottom: 8px; }
  .info-card p  { color: var(--text-muted); font-size: var(--fs-sm); margin: 0; }
  .info-card .icon { width: 32px; height: 32px; margin-bottom: 10px; color: var(--brand-1); }

  /* FAQ */
  details.faq-item {
    background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-md);
    padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-3);
  }
  details.faq-item summary {
    cursor: pointer; font-weight: 600; list-style: none;
    display: flex; justify-content: space-between; align-items: center;
  }
  details.faq-item summary::-webkit-details-marker { display: none; }
  details.faq-item summary::after { content: "+"; color: var(--brand-1); font-size: 22px; font-weight: 800; transition: transform 0.2s; }
  details.faq-item[open] summary::after { transform: rotate(45deg); }
  details.faq-item .faq-body { margin-top: var(--sp-3); color: var(--text-muted); font-size: var(--fs-sm); }

  /* Ad slot */
  .ad-slot {
    margin: var(--sp-6) 0; padding: var(--sp-3); text-align: center;
    background: color-mix(in oklab, var(--bg-elev) 50%, transparent);
    border: 1px dashed var(--border); border-radius: var(--r-md);
    min-height: 100px; position: relative;
  }
  .ad-slot::before {
    content: attr(data-label); position: absolute; top: 8px; right: 12px;
    font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim);
  }

  /* Cookie banner */
  .cookie {
    position: fixed; bottom: var(--sp-4); left: 50%; transform: translateX(-50%);
    width: calc(100% - 2 * var(--sp-4)); max-width: 560px;
    background: var(--bg-elev-2); border: 1px solid var(--border-strong);
    border-radius: var(--r-md); padding: var(--sp-5);
    box-shadow: var(--shadow-soft); z-index: 100;
    opacity: 0; transform: translate(-50%, 100px); pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .cookie.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
  .cookie h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-md); }
  .cookie p { color: var(--text-muted); font-size: var(--fs-sm); margin-bottom: var(--sp-3); }
  .cookie-buttons { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
  .cookie-buttons button {
    flex: 1; min-width: 140px;
    padding: 10px 14px; border-radius: var(--r-sm); cursor: pointer;
    font-weight: 700; font-size: var(--fs-sm); border: 1px solid var(--border);
    background: transparent; color: var(--text);
  }
  .cookie-buttons button.primary {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: white; border: none;
  }

  /* Sticky Ad bottom */
  .sticky-ad { position: fixed; bottom: 0; left: 0; right: 0; padding: var(--sp-2); background: var(--bg-elev-2); border-top: 1px solid var(--border); z-index: 80; }
  .sticky-ad-close { position: absolute; top: -32px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-elev-2); border: 1px solid var(--border); color: var(--text); cursor: pointer; }

  /* ── REVENUE: extra ad placements ── */
  /* Sidebar ads — sticky, desktop only (≥1280px) */
  .ad-sidebar {
    position: fixed; top: 90px; width: 160px;
    z-index: 5; padding: 6px;
    background: color-mix(in oklab, var(--bg-elev) 60%, transparent);
    border: 1px solid var(--border); border-radius: var(--r-md);
    display: none;
  }
  .ad-sidebar::before {
    content: "Anzeige"; position: absolute; top: -18px; left: 0;
    font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-dim); opacity: 0.6;
  }
  .ad-sidebar > ins.adsbygoogle {
    display: block !important; width: 148px !important; height: 600px !important;
    background: var(--bg-elev);
  }
  .ad-sidebar-left  { left: 12px; }
  .ad-sidebar-right { right: 12px; }
  /* Wide screens: show sidebars + add horizontal space to main */
  @media (min-width: 1280px) {
    .ad-sidebar { display: block; }
  }
  @media (min-width: 1440px) {
    .ad-sidebar { width: 200px; top: 100px; }
    .ad-sidebar > ins.adsbygoogle { width: 188px !important; }
  }

  /* Mid-banner ad — between sections, always visible */
  .ad-banner-mid {
    margin: var(--sp-4) 0;
    padding: var(--sp-3);
    background: color-mix(in oklab, var(--bg-elev) 50%, transparent);
    border: 1px dashed var(--border); border-radius: var(--r-md);
    min-height: 90px; text-align: center; position: relative;
  }
  .ad-banner-mid::before {
    content: "Anzeige"; position: absolute; top: 6px; right: 10px;
    font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-dim); opacity: 0.6;
  }
  .ad-banner-mid > ins.adsbygoogle {
    display: block !important; width: 100% !important;
    min-height: 90px;
  }

  /* In-result banner ad — appears INSIDE the result card */
  .ad-banner-result {
    margin-top: var(--sp-5);
    padding: var(--sp-3);
    background: color-mix(in oklab, var(--brand-1) 4%, var(--bg-elev));
    border: 1px solid color-mix(in oklab, var(--brand-1) 18%, var(--border));
    border-radius: var(--r-md);
    min-height: 100px; text-align: center; position: relative;
  }
  .ad-banner-result::before {
    content: "Anzeige"; position: absolute; top: 6px; right: 10px;
    font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-dim); opacity: 0.6;
  }
  .ad-banner-result > ins.adsbygoogle {
    display: block !important; width: 100% !important;
    min-height: 100px;
  }

  /* ── EMBED SECTION — "Add Speedmesser to your site" ── */
  .embed-section {
    margin: var(--sp-7) auto; max-width: 920px; padding: var(--sp-6);
    background: linear-gradient(135deg,
      color-mix(in oklab, var(--brand-1) 8%, var(--bg-elev)),
      color-mix(in oklab, var(--brand-2) 6%, var(--bg-elev)));
    border: 1px solid color-mix(in oklab, var(--brand-1) 25%, var(--border));
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-soft);
  }
  .embed-section .es-eyebrow {
    display: inline-block; font-size: 11px; font-weight: 700;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--brand-1); margin-bottom: var(--sp-2);
  }
  .embed-section h2 {
    margin: 0 0 var(--sp-3); font-size: clamp(1.2rem, 2.4vw, 1.6rem);
    letter-spacing: -0.01em;
  }
  .embed-section > p {
    color: var(--text-muted); font-size: var(--fs-sm);
    margin: 0 0 var(--sp-5); max-width: 60ch;
  }
  .embed-steps {
    display: grid; gap: var(--sp-3);
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: var(--sp-5);
  }
  @media (max-width: 640px) { .embed-steps { grid-template-columns: 1fr; } }
  .embed-step {
    background: color-mix(in oklab, var(--bg-elev) 70%, transparent);
    border: 1px solid var(--border); border-radius: var(--r-md);
    padding: var(--sp-4); position: relative;
  }
  .embed-step .es-num {
    display: inline-flex; width: 26px; height: 26px;
    align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: white; font-weight: 800; font-size: 13px;
    border-radius: 50%; margin-bottom: 8px;
  }
  .embed-step h3 {
    margin: 0 0 6px; font-size: var(--fs-sm); font-weight: 700;
  }
  .embed-step p {
    margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.5;
  }
  .embed-code-wrap {
    position: relative; margin-bottom: var(--sp-4);
  }
  .embed-code {
    display: block; width: 100%; min-height: 90px;
    background: var(--bg); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--r-md);
    padding: var(--sp-4); padding-right: 120px;
    font-family: var(--font-mono); font-size: 12px; line-height: 1.6;
    white-space: pre-wrap; word-break: break-all;
    overflow-x: auto; resize: none;
  }
  .embed-code:focus {
    outline: none; border-color: var(--brand-1);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand-1) 18%, transparent);
  }
  .embed-copy-btn {
    position: absolute; top: 10px; right: 10px;
    padding: 8px 16px; border: none; border-radius: var(--r-sm);
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: white; font-size: 12px; font-weight: 700;
    letter-spacing: 0.05em; cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    z-index: 2;
  }
  .embed-copy-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px color-mix(in oklab, var(--brand-1) 35%, transparent); }
  .embed-copy-btn.copied {
    background: oklch(0.72 0.18 145);
  }
  .embed-options {
    display: flex; gap: var(--sp-3); flex-wrap: wrap;
    align-items: center; margin-bottom: var(--sp-4);
    font-size: var(--fs-sm);
  }
  .embed-options label {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-muted); font-weight: 500;
  }
  .embed-options select {
    background: var(--bg-elev); border: 1px solid var(--border);
    color: var(--text); padding: 6px 10px; border-radius: var(--r-sm);
    font-size: var(--fs-sm); cursor: pointer;
  }
  .embed-platforms {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-top: var(--sp-3); font-size: 12px;
    color: var(--text-muted);
  }
  .embed-platforms .es-plat {
    padding: 3px 9px;
    background: color-mix(in oklab, var(--bg-elev) 80%, transparent);
    border: 1px solid var(--border);
    border-radius: 999px; font-weight: 600;
  }

  /* Footer legal row (CCPA Do-Not-Sell + Cookie settings) */
  .legal-row {
    margin-top: var(--sp-5); padding: var(--sp-3) 0;
    border-top: 1px solid var(--border);
    text-align: center; font-size: 12px;
  }
  .legal-row a {
    color: var(--text-muted);
    text-decoration: underline; text-underline-offset: 3px;
    transition: color 0.2s ease;
  }
  .legal-row a:hover { color: var(--brand-1); }
  .legal-row .legal-sep {
    margin: 0 10px; color: var(--text-dim); opacity: 0.5;
  }

  /* ─── Article Cards Grid (Ratgeber-Sektion + verwandte Links) ─── */
  .article-grid {
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    margin-top: var(--sp-5);
  }
  .article-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--sp-5);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s cubic-bezier(0.22, 0.61, 0.36, 1),
                border-color 0.2s ease,
                box-shadow 0.3s ease,
                background 0.2s ease;
    position: relative;
    overflow: hidden;
  }
  .article-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  .article-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in oklab, var(--brand-1) 40%, var(--border));
    background: color-mix(in oklab, var(--bg-elev) 80%, var(--surface));
    box-shadow: 0 8px 28px -8px color-mix(in oklab, var(--brand-1) 25%, transparent);
  }
  .article-card:hover::before { opacity: 1; }
  .article-card .ac-icon {
    font-size: 28px;
    line-height: 1;
    margin-bottom: var(--sp-3);
    display: inline-block;
    width: 48px;
    height: 48px;
    border-radius: var(--r-sm);
    background: color-mix(in oklab, var(--brand-1) 12%, var(--bg-elev-2));
    display: grid;
    place-items: center;
  }
  .article-card h3 {
    margin: 0 0 var(--sp-2);
    font-size: var(--fs-md);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    letter-spacing: -0.005em;
  }
  .article-card p {
    margin: 0 0 var(--sp-3);
    color: var(--text-muted);
    font-size: var(--fs-sm);
    line-height: 1.5;
    flex: 1;
  }
  .article-card .ac-link {
    margin-top: auto;
    color: var(--brand-1);
    font-weight: 600;
    font-size: var(--fs-sm);
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s ease;
  }
  .article-card:hover .ac-link { gap: 8px; }
  @media (max-width: 540px) {
    .article-grid { grid-template-columns: 1fr; gap: var(--sp-3); }
    .article-card { padding: var(--sp-4); }
  }

  /* ─── Article page lead paragraph + breadcrumb ─── */
  .breadcrumb {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-bottom: var(--sp-3);
  }
  .breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
  }
  .breadcrumb a:hover { color: var(--brand-1); }
  article > .lead, article p.lead {
    font-size: var(--fs-lg);
    color: var(--text);
    line-height: 1.6;
    margin: var(--sp-4) 0 var(--sp-6);
    padding-bottom: var(--sp-5);
    border-bottom: 1px solid var(--border);
  }
  article h2 {
    margin-top: var(--sp-7);
    margin-bottom: var(--sp-3);
    font-size: clamp(1.15rem, 2.2vw, 1.4rem);
    letter-spacing: -0.01em;
  }
  article p {
    line-height: 1.7;
    color: var(--text);
    margin-bottom: var(--sp-4);
  }
  article ul, article ol {
    line-height: 1.7;
    color: var(--text);
    margin-bottom: var(--sp-4);
    padding-left: var(--sp-6);
  }
  article ul li, article ol li { margin-bottom: var(--sp-2); }
  article code {
    background: var(--bg-elev-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: var(--font-mono);
    color: var(--brand-1);
  }
  article a {
    color: var(--brand-1);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.2s ease;
  }
  article a:hover {
    color: var(--brand-2);
    text-decoration-thickness: 2px;
  }
  .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: white !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: var(--fs-md);
    letter-spacing: 0.02em;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 14px color-mix(in oklab, var(--brand-1) 35%, transparent);
  }
  .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px color-mix(in oklab, var(--brand-1) 45%, transparent);
  }

  /* Email modal */
  .email-modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); backdrop-filter: blur(6px); z-index: 1000; padding: var(--sp-4); }
  .email-modal.show { display: flex; }
  .email-modal-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-md); max-width: 460px; width: 100%; padding: var(--sp-7); position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
  .email-modal-close { position: absolute; top: 10px; right: 12px; background: transparent; border: 0; color: var(--text-muted); font-size: 22px; cursor: pointer; }
  .email-modal input[type="email"] { background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 12px 14px; border-radius: var(--r-sm); font-size: var(--fs-sm); width: 100%; margin-bottom: var(--sp-2); }
  .email-modal button[type="submit"] { background: var(--brand-1); color: white; border: 0; padding: 12px 14px; border-radius: var(--r-sm); font-weight: 700; cursor: pointer; width: 100%; }

  /* PWA install */
  .pwa-install-banner { display: none; align-items: center; gap: var(--sp-4); background: linear-gradient(135deg, color-mix(in oklab, var(--brand-1) 12%, var(--bg-elev)), var(--bg-elev)); border: 1px solid color-mix(in oklab, var(--brand-1) 25%, var(--border)); border-radius: var(--r-md); padding: var(--sp-4); margin: var(--sp-5) 0; }
  .pwa-install-banner.show { display: flex; }
  .pwa-install-banner .pwa-icon { font-size: 30px; }
  .pwa-install-banner .pwa-text { flex: 1; }
  .pwa-install-banner button { background: var(--brand-1); color: white; border: 0; padding: 9px 16px; border-radius: var(--r-sm); font-weight: 700; cursor: pointer; }
  .pwa-install-banner .pwa-close { background: transparent; color: var(--text-muted); padding: 4px 10px; font-size: 16px; }

  /* Conversion hook (slow speed → switch ISP CTA) */
  .conversion-hook { margin-top: var(--sp-5); background: linear-gradient(135deg, color-mix(in oklab, var(--warn) 12%, var(--bg-elev)), var(--bg-elev)); border: 1px solid color-mix(in oklab, var(--warn) 25%, transparent); border-radius: var(--r-md); padding: var(--sp-4) var(--sp-5); }
  .conversion-hook h4 { margin: 0 0 6px; color: var(--warn); font-size: var(--fs-md); }
  .conversion-hook p { margin: 0 0 var(--sp-3); color: var(--text); font-size: var(--fs-sm); }
  .conversion-hook .ch-cta { background: var(--warn); color: #1a1300; padding: 8px 14px; border-radius: var(--r-sm); text-decoration: none; font-weight: 700; display: inline-block; font-size: var(--fs-sm); }

  /* Breadcrumb */
  .breadcrumb { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: var(--sp-4); }
  .breadcrumb a { color: inherit; }

  /* Footer */
  .footer {
    background: var(--bg-elev); border-top: 1px solid var(--border);
    margin-top: var(--sp-12); padding: var(--sp-8) 0 var(--sp-5);
  }
  .footer-grid {
    display: grid; gap: var(--sp-6);
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    max-width: 1080px; margin: 0 auto var(--sp-6); padding: 0 var(--sp-5);
  }
  .footer h4 { font-size: var(--fs-sm); margin-bottom: var(--sp-3); }
  .footer ul { list-style: none; padding: 0; }
  .footer li { margin-bottom: 6px; }
  .footer a { color: var(--text-muted); font-size: var(--fs-sm); }
  .footer a:hover { color: var(--text); }
  .footer-bottom { border-top: 1px solid var(--border); max-width: 1080px; margin: 0 auto; padding: var(--sp-4) var(--sp-5) 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-3); font-size: 12px; color: var(--text-dim); }
}

@layer utilities {
  .grad { background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .gauge.phase-ping .gauge-fg { animation: none; }
  .test-btn::before { animation: none; }
}
