/* Site chrome on phones and tablets: the header pill, the menu sheet, the
   language switcher and the footer. ONE sheet for every marketing family.

   Why it exists (2026-09-24, Kaspar: "phone doesn't look good, the header and
   footer are kinda broken, the language thing looks stupid"). Eight families
   drew the same chrome from their own sheets and inline blocks, and on a phone
   they disagreed: /pricing, /contact and /api clustered the CTA and burger
   next to the logo (a11y.css `.nav-lang+.nav-actions{margin-left:0}` still
   matched with the switcher hidden), the language chips mixed "EN" with
   "Deutsch" in mono type and three sizes (a11y.css `#mobile-menu a{padding:
   14px 2px !important}` hit them too), case studies and /pricing never turned
   the burger into a close button, the wordmark vanished at 360px, footers ran
   1,400-3,600px with flex-wrapped columns that broke German words mid-word,
   "• System status" sat alone on the last line, and the sticky CTA bar
   covered the end of the footer.

   How it wins: it is the LAST stylesheet in <head> on every page that has the
   pill (sync-nav.js inserts it, --check enforces it; the homepage, the three
   rendered templates, blog-chrome.js and the hosting generator carry it by
   hand). Several families keep <style> blocks inside <body>, after this sheet,
   so selectors start with `html body` to outrank their one-class rules
   without relying on order. `!important` appears only where a11y.css (or an
   inline style="") already uses it on the same property.

   Desktop (>=1024px) is untouched except for the footer's language row.
   Behaviour lives in site-chrome.js: the scrim, Escape, focus leaving the
   sheet, the scroll lock, aria-expanded and the close icon kept true to what
   is on screen, the footer sections folding on phones, and the sticky CTA
   bar stepping aside at the footer. Without JavaScript every footer link
   stays visible.

   Never lock scrolling with overflow on <html> or <body>: most families set
   body{overflow-x:hidden} and the blog html{overflow-x:clip}, and either
   change turns <body> into its own scroll container, so the sticky pill
   scrolls away with the page the moment the sheet opens (found in review).
   site-chrome.js blocks the scroll gestures instead. */

:root {
    --sc-ink: #15161a;
    --sc-text: #3d3d3a;
    --sc-dim: #64625c;
    --sc-well: #f1efe8;
    --sc-rule: rgba(20, 20, 19, .09);
    --sc-line: rgba(20, 20, 19, .1);
    --sc-accent: #2733d9;
    --sc-accent-deep: #1f2abf;
    --sc-sans: 'Schibsted Grotesk', -apple-system, 'Segoe UI', sans-serif;
}

/* ── 1. Header pill (burger layout, <=1023px) ─────────────────────────── */
@media (max-width: 1023px) {
    html body nav.hm-nav,
    html body nav:has(> .nav-inner) {
        position: sticky !important; top: 10px !important; z-index: 100;
        width: auto !important; max-width: none !important; align-self: stretch !important;
        margin: 10px 16px 0 !important; padding: 0 !important;
        background: none !important; border: 0 !important; box-shadow: none !important;
        -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    }
    html body .nav-inner,
    html body .hm-nav-inner {
        display: flex; align-items: center; gap: 12px !important;
        width: auto; max-width: none; height: 60px; min-height: 0; margin: 0;
        padding: 0 8px 0 16px !important;
        background: rgba(255, 255, 255, .88);
        border: 1px solid var(--sc-rule); border-radius: 999px;
        box-shadow: 0 1px 2px rgba(20, 20, 19, .04), 0 10px 30px -14px rgba(20, 20, 19, .16);
        -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
    }
    html body .nav-logo,
    html body .hm-logo {
        display: flex; align-items: center; gap: 10px !important;
        flex: 0 1 auto !important; min-width: 0 !important; margin: 0;
        overflow: hidden !important; white-space: nowrap !important;
        font-family: var(--sc-sans); font-size: 1.125rem !important; font-weight: 700;
        letter-spacing: -0.02em; line-height: 1; color: var(--sc-ink); text-decoration: none;
    }
    html body .nav-logo .logo-mark,
    html body .hm-logo .logo-mark {
        display: flex; align-items: center; justify-content: center; flex-shrink: 0;
        width: 28px; height: 28px; margin: 0; border-radius: 9px;
        background: var(--sc-ink); color: #fff;
    }
    html body .nav-logo .logo-mark svg,
    html body .hm-logo .logo-mark svg { width: 14px; height: 14px; }

    html body .nav-links,
    html body .hm-nav-links,
    html body .nav-inner > .nav-lang,
    html body .hm-nav-inner > .nav-lang,
    html body .nav-actions .nav-login,
    html body .hm-nav-login { display: none !important; }

    /* The CTA and the burger own the right edge, always. */
    html body .nav-inner > .nav-actions,
    html body .hm-nav-inner > .hm-nav-actions {
        display: flex !important; align-items: center; gap: 8px;
        margin: 0 0 0 auto !important; flex-shrink: 0 !important;
    }
    html body .nav-inner > .nav-actions > a:not(.nav-login),
    html body .hm-nav-inner > .hm-nav-actions > a:not(.hm-nav-login) {
        display: inline-flex !important; align-items: center; justify-content: center;
        height: 36px !important; min-height: 0 !important; padding: 0 14px !important;
        border: 0 !important; border-radius: 999px !important; box-shadow: none !important;
        background: var(--sc-accent) !important; color: #fff !important;
        font-family: var(--sc-sans) !important; font-size: .8125rem !important; font-weight: 700 !important;
        letter-spacing: 0 !important; text-transform: none !important; line-height: 1 !important;
        white-space: nowrap; text-decoration: none;
    }
    html body #mobile-menu-btn {
        display: inline-flex !important; align-items: center; justify-content: center;
        flex-shrink: 0 !important; width: 40px !important; height: 40px !important;
        margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 999px;
        background: transparent; color: var(--sc-ink); cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    html body #mobile-menu-btn svg { width: 22px; height: 22px; }
    html body #mobile-menu-btn[aria-expanded="true"] { background: rgba(20, 20, 19, .07); }
    /* A tap leaves :hover stuck on touch screens; only real pointers get it. */
    @media (hover: none) {
        html body #mobile-menu-btn:hover:not([aria-expanded="true"]) { background: transparent; }
    }
}
@media (max-width: 640px) {
    html body nav.hm-nav,
    html body nav:has(> .nav-inner) { margin: 10px 12px 0 !important; }
}
/* 320px holds the mark, the CTA and the burger, not the wordmark as well;
   360px (the common Android width) holds all four. */
@media (max-width: 359px) {
    html body .nav-logo,
    html body .hm-logo { font-size: 0 !important; gap: 0 !important; }
}

/* ── 2. Menu sheet ───────────────────────────────────────────────────── */
/* Fixed under the pill (site-chrome.js measures the pill into --sc-menu-top),
   so opening it never pushes the page down and scrolling never drags it
   along. Behind it, a real scrim element (.sc-scrim, added by the script):
   iOS sends no click for a tap on plain page content, and a tap must not
   focus the form field underneath, so the tap has to land on an element. */
@media (max-width: 1023px) {
    html body #mobile-menu {
        position: fixed !important; top: var(--sc-menu-top, 80px) !important;
        left: 16px !important; right: 16px !important; bottom: auto !important;
        z-index: 1001 !important; width: auto !important; max-width: none !important;
        margin: 0 !important; padding: 6px 20px 20px !important;
        max-height: calc(100vh - var(--sc-menu-top, 80px) - 16px);
        max-height: calc(100dvh - var(--sc-menu-top, 80px) - 16px);
        overflow-y: auto; overscroll-behavior: contain;
        background: #fff !important; border: 1px solid var(--sc-rule) !important; border-radius: 20px !important;
        box-shadow: 0 24px 48px -18px rgba(20, 20, 19, .3) !important;
        font-family: var(--sc-sans);
    }
    html body #mobile-menu::before { content: none !important; }
    html.sc-menu-open .sc-scrim {
        display: block; position: fixed; inset: 0; z-index: 1000;
        background: rgba(20, 20, 19, .22); touch-action: none; -webkit-tap-highlight-color: transparent;
    }
    html.sc-menu-open .sm-progress { visibility: hidden; }
    html.sc-menu-open body nav.hm-nav,
    html.sc-menu-open body nav:has(> .nav-inner) { z-index: 1002 !important; }
    /* Opaque while the sheet is open, or the scrim greys the pill. */
    html.sc-menu-open body .nav-inner,
    html.sc-menu-open body .hm-nav-inner { background: #fff; }

    html body #mobile-menu > a:not(.hm-btn):not(.btn-bracket):not(.btn-primary) {
        display: flex !important; align-items: center; justify-content: space-between; gap: 12px;
        min-height: 52px; margin: 0 !important; padding: 0 4px 0 2px !important;
        border: 0 !important; border-bottom: 1px solid rgba(20, 20, 19, .08) !important; border-radius: 0 !important;
        background: none !important; box-shadow: none !important;
        font-family: var(--sc-sans) !important; font-size: 1.0625rem !important; font-weight: 500 !important;
        letter-spacing: -0.005em !important; text-transform: none !important; line-height: 1.25 !important;
        color: var(--sc-ink) !important; text-decoration: none !important;
    }
    html body #mobile-menu > a:not(.hm-btn):not(.btn-bracket):not(.btn-primary)::after {
        content: ""; flex-shrink: 0; width: 7px; height: 7px;
        border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor;
        transform: rotate(45deg); opacity: .32;
    }
    html body #mobile-menu > a[aria-current]:not(.hm-btn):not(.btn-bracket):not(.btn-primary),
    html body #mobile-menu > a.active:not(.hm-btn):not(.btn-bracket):not(.btn-primary) {
        color: var(--sc-accent) !important; font-weight: 600 !important;
    }

    /* Language: one segmented control, each language in its own name. */
    html body #mobile-menu .mob-lang {
        display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
        margin: 18px 0 0 !important; padding: 4px !important;
        border: 0 !important; border-radius: 14px; background: var(--sc-well) !important;
    }
    html body #mobile-menu .mob-lang > * {
        display: flex !important; align-items: center; justify-content: center;
        min-width: 0; min-height: 40px !important; margin: 0 !important; padding: 0 6px !important;
        border: 0 !important; border-radius: 10px !important; box-shadow: none !important;
        background: transparent !important; color: var(--sc-dim) !important;
        font-family: var(--sc-sans) !important; font-size: .875rem !important; font-weight: 500 !important;
        letter-spacing: 0 !important; text-transform: none !important; line-height: 1.2 !important;
        white-space: nowrap; text-decoration: none !important;
    }
    html body #mobile-menu .mob-lang > .lang-current,
    html body #mobile-menu .mob-lang > [aria-current] {
        background: #fff !important; color: var(--sc-ink) !important; font-weight: 600 !important;
        box-shadow: 0 1px 2px rgba(20, 20, 19, .1), 0 0 0 1px rgba(20, 20, 19, .06) !important;
    }

    html body #mobile-menu .mob-actions {
        display: grid !important; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px !important;
        margin: 16px 0 0 !important; padding: 0 !important; border: 0 !important;
    }
    html body #mobile-menu .mob-actions > a {
        display: flex !important; align-items: center !important; justify-content: center !important;
        min-width: 0; min-height: 48px !important; height: auto !important; margin: 0 !important; padding: 0 12px !important;
        border-radius: 999px !important; box-shadow: none !important;
        font-family: var(--sc-sans) !important; font-size: .9375rem !important; font-weight: 600 !important;
        letter-spacing: 0 !important; text-transform: none !important; line-height: 1.2 !important;
        white-space: nowrap !important; text-decoration: none !important;
    }
    html body #mobile-menu .mob-actions > a:first-child:not(:last-child) {
        background: #fff !important; color: var(--sc-ink) !important; border: 1px solid rgba(20, 20, 19, .16) !important;
    }
    html body #mobile-menu .mob-actions > a:last-child {
        background: var(--sc-accent) !important; color: #fff !important; border: 1px solid var(--sc-accent) !important; font-weight: 700 !important;
    }
    /* Signed in, wow.js hides Log in inline and leaves Dashboard alone. */
    html body #mobile-menu .mob-actions > a[style*="display: none"],
    html body #mobile-menu .mob-actions > a[style*="display:none"],
    html body #mobile-menu .mob-actions > [hidden] { display: none !important; }
    @media (hover: hover) {
        html body #mobile-menu > a:not(.hm-btn):not(.btn-bracket):not(.btn-primary):hover { color: var(--sc-accent-deep) !important; }
        html body #mobile-menu .mob-lang > a:hover { color: var(--sc-ink) !important; }
        html body #mobile-menu .mob-actions > a:first-child:not(:last-child):hover { background: rgba(20, 20, 19, .04) !important; }
        html body #mobile-menu .mob-actions > a:last-child:hover { background: var(--sc-accent-deep) !important; border-color: var(--sc-accent-deep) !important; }
    }
}
@media (min-width: 641px) and (max-width: 1023px) {
    html body #mobile-menu { left: auto !important; width: 400px !important; }
}
@media (max-width: 640px) {
    html body #mobile-menu { left: 12px !important; right: 12px !important; }
}
@media (max-width: 1023px) and (prefers-reduced-motion: no-preference) {
    html body #mobile-menu { animation: sc-sheet-in .22s cubic-bezier(.22, 1, .36, 1) !important; }
    html.sc-menu-open .sc-scrim { animation: sc-fade .2s ease; }
    @keyframes sc-sheet-in { from { opacity: 0; transform: translateY(-6px); } }
    @keyframes sc-fade { from { opacity: 0; } }
}

/* ── 3. Footer: phones (<=640px) ─────────────────────────────────────── */
/* Brand, then the four link groups as rows that fold open (site-chrome.js
   adds .sc-folds; without it every link shows), then one bottom block in
   DOM order: Privacy / Terms / System status on one line, the language
   control (trilingual pages), and the company line last. */
@media (max-width: 640px) {
    html body footer:has(.footer-links) {
        padding-top: 48px !important; padding-left: 20px !important; padding-right: 20px !important;
        text-align: left !important;
    }
    /* The blog keeps room for its article CTA bar at the bottom. */
    html body:not(.mob-cta-on) footer:has(.footer-links) { padding-bottom: 32px !important; }
    html body footer .footer-inner {
        display: block !important; max-width: none !important; margin: 0 !important; padding: 0 !important;
        border: 0 !important; gap: 0 !important;
    }
    html body footer .footer-inner > :first-child { margin: 0 0 28px !important; }
    html body footer .footer-logo {
        display: inline-flex !important; align-items: center; gap: 10px !important; margin: 0 !important;
        font-family: var(--sc-sans) !important; font-size: 1.125rem !important; font-weight: 700 !important;
        letter-spacing: -0.02em; color: var(--sc-ink) !important; text-decoration: none;
    }
    html body footer .footer-logo .logo-mark {
        display: inline-flex; align-items: center; justify-content: center;
        width: 26px; height: 26px; border-radius: 8px; background: var(--sc-ink); color: #fff; flex-shrink: 0;
    }
    html body footer .footer-tagline {
        margin: 12px 0 0 !important; max-width: 34ch !important;
        font-size: .9375rem !important; line-height: 1.55 !important; color: var(--sc-dim) !important;
    }
    html body footer .footer-links {
        display: block !important; margin: 0 !important; padding: 0 !important; gap: 0 !important;
        border-top: 1px solid var(--sc-line);
    }
    html body footer .footer-col {
        display: block !important; min-width: 0; margin: 0 !important; padding: 0 0 12px !important;
        border-bottom: 1px solid var(--sc-line); gap: 0 !important;
        overflow-wrap: break-word !important; word-break: normal !important; -webkit-hyphens: auto; hyphens: auto;
    }
    html body footer .footer-col-head {
        display: block; margin: 0 !important; padding: 16px 2px 6px !important;
        font-family: var(--sc-sans) !important; font-size: 1rem !important; font-weight: 600 !important;
        letter-spacing: -0.005em !important; text-transform: none !important; line-height: 1.3 !important;
        color: var(--sc-ink) !important;
    }
    html body footer .footer-col > a {
        display: block !important; margin: 0 !important; padding: 9px 2px !important;
        font-size: .9375rem !important; font-weight: 400 !important; line-height: 1.35 !important;
        color: var(--sc-text) !important; text-decoration: none;
    }

    /* Folded (JavaScript ran): each group is a 56px row with a chevron. */
    html body footer.sc-folds .footer-col { padding: 0 !important; }
    html body footer.sc-folds .footer-col.sc-open { padding-bottom: 12px !important; }
    html body footer.sc-folds .footer-col-head { padding: 0 !important; }
    html body footer.sc-folds .footer-col:not(.sc-open) > :not(.footer-col-head) { display: none !important; }
    html body footer .sc-fold {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        width: 100%; min-height: 56px; margin: 0; padding: 0 6px 0 2px;
        border: 0; background: none; color: inherit; cursor: pointer; text-align: left;
        font: inherit; letter-spacing: inherit; -webkit-tap-highlight-color: transparent;
    }
    html body footer .sc-fold::after {
        content: ""; flex-shrink: 0; width: 7px; height: 7px; margin-top: -4px;
        border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
        transform: rotate(45deg); opacity: .45; transition: transform .2s, margin .2s;
    }
    html body footer .sc-fold[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: 4px; }

    html body footer .footer-bottom {
        display: flex !important; flex-flow: row wrap !important; align-items: center !important;
        justify-content: flex-start !important; gap: 4px 20px !important;
        max-width: none !important; margin: 24px 0 0 !important; padding: 0 !important; border: 0 !important;
        text-align: left !important; font-size: .875rem !important; color: var(--sc-dim) !important;
    }
    html body footer .footer-bottom > * { margin: 0 !important; }
    /* The company line is text only, so moving it last changes no focus order. */
    html body footer .footer-bottom > span:first-child {
        order: 9; flex: 1 1 100%; margin-top: 10px !important;
        font-size: .8125rem !important; line-height: 1.6 !important; color: var(--sc-dim) !important;
        text-wrap: pretty;
    }
    html body footer .footer-bottom > div:not(.footer-lang),
    html body footer .footer-bottom > .footer-bottom-links { display: inline-flex !important; align-items: center; gap: 20px !important; }
    html body footer .footer-bottom a {
        display: inline-flex; align-items: center; min-height: 40px;
        font-size: .875rem !important; color: var(--sc-text) !important; text-decoration: none; white-space: nowrap;
    }
    html body footer .footer-bottom .footer-lang { flex: 1 1 100%; margin: 12px 0 4px !important; }
}
/* Estonian "Privaatsus · Tingimused · Süsteemi olek" fits 280px only this tight. */
@media (max-width: 359px) {
    html body footer .footer-bottom { column-gap: 14px !important; }
    html body footer .footer-bottom > div:not(.footer-lang),
    html body footer .footer-bottom > .footer-bottom-links { gap: 14px !important; }
}

/* ── 4. Footer: tablets (641-1023px) ─────────────────────────────────── */
@media (min-width: 641px) and (max-width: 1023px) {
    /* One side inset for every family (/api padded the footer AND its inner box). */
    html body footer:has(.footer-links) { padding-left: 32px !important; padding-right: 32px !important; }
    html body footer .footer-inner {
        display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 36px !important;
        max-width: none !important; padding-left: 0 !important; padding-right: 0 !important;
    }
    html body footer .footer-links {
        display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 32px 28px !important;
    }
    html body footer .footer-col {
        display: flex !important; flex-direction: column; gap: 0 !important; min-width: 0;
        overflow-wrap: break-word !important; word-break: normal !important; -webkit-hyphens: auto; hyphens: auto;
    }
    html body footer .footer-col > a { padding: 6px 0 !important; font-size: .8125rem !important; line-height: 1.35; }
    html body footer .footer-bottom {
        display: flex !important; flex-flow: row wrap !important; align-items: center !important;
        justify-content: flex-start !important; gap: 10px 24px !important; text-align: left !important;
    }
    html body footer .footer-bottom > span:first-child { order: 9; flex: 1 1 100%; text-wrap: pretty; }
    html body footer .footer-bottom > div:not(.footer-lang),
    html body footer .footer-bottom > .footer-bottom-links { display: inline-flex !important; align-items: center; gap: 22px !important; }
    html body footer .footer-bottom a { white-space: nowrap; }
}
/* An iPad in portrait fits all four groups side by side, German included. */
@media (min-width: 740px) and (max-width: 1023px) {
    html body footer .footer-links { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 32px 20px !important; }
}

/* ── 5. Footer language control ──────────────────────────────────────── */
/* Phones and tablets: the menu's segmented control, smaller. Desktop: a
   quiet text row the size of its neighbours (the bottom row was laid out
   for that), with the same labels (English / Deutsch / Eesti). */
@media (max-width: 1023px) {
    html body footer .footer-lang {
        display: inline-grid !important; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px !important;
        padding: 3px !important; border-radius: 12px; background: var(--sc-well);
    }
    html body footer .footer-lang > svg { display: none !important; }
    html body footer .footer-lang > * {
        display: flex !important; align-items: center; justify-content: center;
        min-height: 36px; padding: 0 12px !important; border-radius: 9px;
        font-family: var(--sc-sans); font-size: .8125rem !important; font-weight: 500 !important;
        letter-spacing: 0 !important; text-transform: none !important; white-space: nowrap;
        color: var(--sc-dim) !important; text-decoration: none !important;
    }
    html body footer .footer-lang > .lang-current,
    html body footer .footer-lang > [aria-current] {
        background: #fff; color: var(--sc-ink) !important; font-weight: 600 !important;
        box-shadow: 0 1px 2px rgba(20, 20, 19, .1), 0 0 0 1px rgba(20, 20, 19, .06);
    }
    @media (hover: hover) { html body footer .footer-lang > a:hover { color: var(--sc-ink) !important; } }
}
@media (max-width: 640px) {
    html body footer .footer-lang { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    html body footer .footer-lang > * { min-height: 40px; }
}
@media (min-width: 1024px) {
    html body footer .footer-lang { display: inline-flex !important; align-items: center; gap: 8px !important; }
    html body footer .footer-lang > svg { opacity: .5; }
    html body footer .footer-lang > * { white-space: nowrap; text-decoration: none; }
    html body footer .footer-lang > .lang-current,
    html body footer .footer-lang > [aria-current] { color: var(--sc-ink) !important; font-weight: 700; }
    /* pricing/contact/api: the row gained the control, so it may wrap. */
    html body footer:not(.hm-footer) .footer-bottom:has(> .footer-lang) { flex-wrap: wrap !important; gap: 12px 24px !important; }
    html body footer:not(.hm-footer) .footer-bottom:has(> .footer-lang) > * { white-space: nowrap; }
    html body footer:not(.hm-footer) .footer-bottom:has(> .footer-lang) > span:first-child { white-space: normal; }
}

/* ── 6. The sticky CTA bar steps aside at the footer ─────────────────── */
/* Hidden, not just moved: its links must not take focus off-screen. */
html.sc-at-footer #scta-bar.scta-visible {
    transform: translateY(110%) !important; visibility: hidden; pointer-events: none;
    transition: transform .35s cubic-bezier(.16, 1, .3, 1), visibility 0s .35s;
}
