/* R48 „handy“ – Handy-Regeln, Tippflächen, Kontrast, Sprachleiste, Sprungmarken, zwei Raster-Kleinigkeiten.
   Gemessen mit tests/r48-handy.js (390 px, DE/EN, hell/dunkel/„Leichter lesen“). */

/* ---------------------------------------------------------------- 1. Keine Schrift unter 12 px am Handy
   Eyebrows, Kicker, Etiketten und kleine Zeilen standen mit 8–11,5 px. Am Handy (≤ 760 px, wie die zweizeilige Kopfzeile) bekommen sie
   12 px; Großbuchstaben mit etwas weniger Sperrung, damit sie ihre Breite (und ihre Zeile) behalten. Nur Selektoren, die gemessen unter
   12 px lagen; Ausnahmen, die schon größer sind (z. B. die Kicker in /projekt „Zum Ausprobieren“), bleiben, wie sie sind. „Leichter lesen“
   vergrößert manches selbst (auf 17–18 px) – dort gilt eine kürzere Liste, damit nichts kleiner wird. */
@media screen and (max-width:760px){
  html:not([data-read=on]) body :is(.eyebrow,p.index,.page-gist-label,.little-tag,.wd-kicker,.ft-tag,.ft-tag b,.csba-tag,.st-k,.fw4-kick,.pj-kicker:not(.pj-panel>.pj-kicker),
    .tk-label,.wg-kicker,.kt-q,.art-caption,.tangle-slips>i,.picture-label>span:first-child,.ref-stamp,.live-tag,.w46-ref-h,.hero-glance small,
    .experience-note>span,.cv-label>small,.deeper-links>a>span:first-child,.page-gist dt,.case-meta dt,.st-facts dt,.kt-green>.kt-icon,
    .pj-facts small,.pj-brief h2,.pj-ba-label,.pj-scrap>small,.pj-status dt,.pj-state>b,.pj-case-steps small,.pj-share h4,.pj-human-cols h4,
    .pj-chain small,.tk-files a>small,.tk-log h2,.fw4-points>li>span,.wg-sheet h2,.lost .code,.diag-title>span,
    :is(.hr-stop,.hr-alt,.hr-mp-play,.hr-mp-stop)>.hr-ico,.tg-sol-kicker,.wd-callbar,.wd-callbar>span,.wd-msg>small,.wd-context dt,.wd-context dd,
    .kt-chip,.kt-log time,.kt-field>span,.kt-field>span>small,.kt-prio>legend,.fio-group-title,.fio-now-label,.fox-ouch,.sound-controls>label,
    .sound-controls output,.sound-preview,.sound-preview>span,.sound-help,.qa-item>small,.qa-esc,.qa-group,.r41-tray-cards small,
    .journey-nav .station-link,.journey-nav .station-link>span){font-size:12px!important}
  html[data-read=on] body :is(.eyebrow,p.index,.little-tag,.wd-kicker,.ft-tag,.ft-tag b,.csba-tag,.st-k,.fw4-kick,.tk-label:not(.tk-assignee>.tk-label),.kt-q,
    .art-caption,.tangle-slips>i,.picture-label>span:first-child,.ref-stamp,.live-tag,.w46-ref-h,.hero-glance small,.experience-note>span,
    .cv-label>small,.deeper-links>a>span:first-child,.page-gist dt,.case-meta dt,.st-facts dt,.kt-green>.kt-icon,.pj-facts small,.pj-brief h2,
    .pj-ba-label,.pj-scrap>small,.pj-status dt,.pj-state>b,.pj-case-steps small,.pj-share h4,.pj-human-cols h4,.pj-chain small,.tk-files a>small,
    .tk-log h2,.fw4-points>li>span,.wg-sheet h2,:is(.hr-stop,.hr-alt,.hr-mp-play,.hr-mp-stop)>.hr-ico,.wd-msg>small,.wd-context dt,.kt-chip,
    .kt-log time,.kt-field>span,.kt-field>span>small,.kt-prio>legend,.fio-group-title,.fio-now-label,.fox-ouch,.sound-controls>label,
    .sound-controls output,.sound-preview,.sound-preview>span,.sound-help,.qa-item>small,.qa-esc,.qa-group,.r41-tray-cards small,
    .journey-nav .station-link,.journey-nav .station-link>span){font-size:12px!important}
  html body :where(.service-example,.section,.wrap) ol.journey>li::before,
  html body .import-callout::after{font-size:12px!important}
  html body header .nav-pages-panel a::after{font-size:12px!important}
  html body .j-hero .eyebrow{text-wrap:balance}
  /* 1 px bigger letters, a little less tracking: the labels keep their width (and their line) */
  html body :is(.eyebrow,p.index,.little-tag,.wd-kicker,.ft-tag,.csba-tag,.st-k,.fw4-kick,.tk-label,.wg-kicker,.kt-q,.art-caption,
    .picture-label>span:first-child,.ref-stamp,.live-tag,.w46-ref-h,.hero-glance small,.experience-note>span,.deeper-links>a>span:first-child,.page-gist dt,.case-meta dt,
    .st-facts dt,.pj-facts small,.pj-brief h2,.pj-ba-label,.pj-scrap>small,.pj-status dt,.pj-case-steps small,.pj-share h4,.pj-human-cols h4,.pj-chain small,
    .tk-log h2,.wg-sheet h2,.page-gist-label,.pj-kicker:not(.pj-panel>.pj-kicker),.lost .code,.diag-title>span){letter-spacing:.06em!important}
  /* the day bar: 12 px needs a little room – smaller gaps inside the links */
  html body .journey-nav .station-link{gap:3px!important}
}
@media screen and (max-width:420px){html body .journey-nav>.j-shell{column-gap:6px!important}}
@media screen and (min-width:380px) and (max-width:420px){html body .journey-nav>.j-shell{column-gap:10px!important}}
/* up to 400 px the counter shows „0/3“ only; „Aufgaben erledigt“ stays in the text for screen readers (font-size 0, no box) */
@media screen and (max-width:400px){
  html body .journey-nav .journey-count{font-size:0!important;white-space:nowrap}
  html body .journey-nav .journey-count>b{font-size:12px!important}
  html body .journey-nav .journey-count::after{content:"/3" / "";font-size:12px;font-weight:inherit}
}

/* ---------------------------------------------------------------- 2. Tippflächen ≥ 44 px im Kopf (Handy)
   Unsichtbare Trefferflächen (::after) um die Knöpfe; sie stoßen aneinander, überlappen aber nicht. Gemessen bei 390 und 360 px:
   Zeile 1 (Ton · Ton-Einstellungen · DE · EN) liegt bei y 4–48, Zeile 2 (Seiten · Lebensläufe · Kontakt · Dunkel · Lesen) bei 50–94.
   Damit Ton und Ton-Einstellungen je 44 px bekommen, rückt der Ton-Knopf 10 px nach links (Abstand 12 statt 2 px) – sonst bleibt alles stehen. */
@media screen and (max-width:760px){
  html body header div.sound-toolbar{gap:12px!important}
  html body header :is(.scene-sound-toggle,.sound-settings-toggle,.view-btn,.nav-pages>summary,.header-links>a,.main-nav>a,.nav-contact,.header-contact){position:relative}
  html body header :is(.scene-sound-toggle,.sound-settings-toggle,.view-btn,.nav-pages>summary,.header-links>a,.main-nav>a,.nav-contact,.header-contact,.language-switch a)::after{
    content:""!important;position:absolute!important;top:-4px;bottom:-4px;left:min(0px,calc((100% - 44px)/2));right:min(0px,calc((100% - 44px)/2));
    width:auto!important;height:auto!important;margin:0!important;background:none!important;border:0!important;transition:none!important;border-radius:6px}
  /* insets count from the padding box: the bordered ones (Kontakt, Dunkel, Lesen) reach 1 px further */
  html body header a:is(.nav-contact,.header-contact)::after{top:-5px;bottom:-5px}
  html body header .sound-toolbar>.scene-sound-toggle::after{inset:-5px 0 -5px -6px}
  html body header .sound-toolbar>.sound-settings-toggle::after{inset:-2px -2px -2px -12px}
  html body header .language-switch a:first-of-type::after{inset:-5px -3px -5px -7px}
  html body header .language-switch a:last-of-type::after{inset:-5px -9px -5px -1px}
  html body header .view-controls>.view-btn:first-child::after{inset:-5px -3px -5px -7px}
  html body header .view-controls>.view-btn.view-read::after{inset:-5px}
}
/* very narrow (≤ 350 px): Dunkel/Lesen wrap into a third row – 4 px more between the rows, so the areas do not overlap */
@media screen and (max-width:350px){html body :is(header.j-header>.header-row,header.site-header>.header-inner){row-gap:8px!important}}
/* /ticket: „Zurück zur Webseite“ (40 px) */
@media screen and (max-width:760px){
  html body.page-ticket .tk-appbar .tk-back{position:relative}
  html body.page-ticket .tk-appbar .tk-back::after{content:"";position:absolute;inset:-2px 0}
}
/* /projekt: the knots get an invisible 44 px area (x48-handy.js, the knot pictures themselves stay untouched) */
.x48-knot-hit{position:absolute;z-index:0;display:block;margin:0;padding:0;border:0;background:none;cursor:pointer;pointer-events:auto;-webkit-tap-highlight-color:transparent}

/* Kontaktzeilen: Telefon, E-Mail, LinkedIn, „E-Mail kopieren“, vCard und die Fußlinks – je ≥ 48 px hoch (Padding, gleiche Schrift) */
@media screen and (max-width:760px){
  html body .hero-glance strong>:is(a[href^="tel:"],a[href^="mailto:"],a[href*="linkedin"]){display:flex;align-items:center;width:fit-content;min-height:48px}
  html body .hero-glance strong>br{display:none}
  html body .hero-glance strong:has(>a[href^="tel:"]){display:block;margin:-8px 0 -10px}
  html body .j-contact .contact-bottom>:is(a,button){display:inline-flex!important;align-items:center;min-height:48px!important}
  html body .st-links>a,html body .status-actions>a:not(.status-cta){display:inline-flex!important;align-items:center;min-height:48px}
  html body .st-links,html body .status-hero .status-actions{row-gap:0!important}
  html body .page-gist a[href^="mailto:"]{display:inline-flex;align-items:center;min-height:48px}
  html body .contact-section :is(a.email-link,.copy-link,.vcard-link){display:inline-flex!important;align-items:center;min-height:48px!important;box-sizing:border-box;padding-top:0!important;padding-bottom:0!important}
  html body .contact-section a.email-link:is(.phone-link,.linkedin-link){display:flex!important;width:fit-content;margin-top:0!important}
  html body :is(.kt-act,a.wg-forward,.wg-cb-mail){min-height:48px!important}
  html body footer :is(a,button):not(.fs-dock a){display:inline-flex!important;align-items:center;min-height:48px!important;box-sizing:border-box}
}
@media screen and (max-width:760px){
  html body .wg-contact dd>a,html body .wg-qr-link{display:inline-flex;align-items:center;min-height:48px}
  html body .wg-contact dl{align-items:center}
  html body .wg-contact dt{padding-top:0}
}

/* ---------------------------------------------------------------- 3. Kontrast ≥ 4,5 : 1 (hell; dunkel siehe unten bzw. Generator) */
.trail-node{color:#66552f}
html body .ft-tag{color:#56666c}
html body .page-gist .page-gist-label{color:color-mix(in srgb,var(--gist-accent,#304ee7) 78%,#000)}
html body .csba-tag{color:#4f5b59}
html body .csba-node.csba-me .csba-tag{color:#1f6f45}
html body .wd-time{color:#56666e}
html body.page-ticket .tk-log h2{color:#a3b1ae}
html body .st-notes small{color:#56625f}

/* ---------------------------------------------------------------- 4. „Prefer English?“: verdeckt den Fokus nicht
   Solange die Leiste da ist, hält das Scrollen (Tab, Sprünge) unten ihren Platz frei. Am Handy teilt sie sich den Platz mit
   „Anrufen | E-Mail“: der Knopf wartet, bis die Leiste zu ist, statt über ihr zu schweben. */
html.tg-enbar-on{scroll-padding-bottom:calc(var(--tg-enbar,52px) + 24px)}
@media screen and (max-width:760px){
  html.tg-enbar-on .fs-dock,html.tg-enbar-on .fs-dock.is-on{bottom:calc(16px + env(safe-area-inset-bottom,0px))!important;opacity:0!important;visibility:hidden!important;pointer-events:none!important}
}

/* ---------------------------------------------------------------- 6. Sprungmarken: eine Zeile beim ersten Tab */
.x48-skip{position:fixed;top:8px;left:8px;right:8px;z-index:1200;display:flex;flex-wrap:wrap;align-items:center;gap:4px 2px;width:max-content;max-width:calc(100% - 16px);box-sizing:border-box;
  margin:0;padding:6px;border-radius:8px;background:#152d38;box-shadow:0 12px 30px -12px rgba(10,20,30,.6);font:700 14px/1.2 Manrope,Arial,sans-serif}
.x48-skip:not(:focus-within){clip-path:inset(50%);width:1px;height:1px;overflow:hidden;padding:0;white-space:nowrap}
html body .x48-skip a,html body .x48-skip a.skip-link{position:static!important;transform:none!important;top:auto!important;left:auto!important;display:inline-flex;align-items:center;min-height:44px;margin:0;padding:0 12px;
  border-radius:5px;background:transparent!important;color:#fff!important;font:inherit;text-decoration:none;white-space:nowrap}
html body .x48-skip a:focus-visible{outline:2px solid #fff!important;outline-offset:-4px;background:#304ee7!important;box-shadow:none!important}
.x48-skip a+a::before{content:"·";margin:0 12px 0 -14px;color:#9fb3bd;font-weight:400}
@media screen and (max-width:760px){.x48-skip{display:grid;grid-template-columns:1fr 1fr;width:auto;right:8px}.x48-skip a+a::before{content:none}}

/* ---------------------------------------------------------------- 8. Zwei Raster-Kleinigkeiten (Art-Director)
   /kontakt „Termin vorschlagen“: über die ganze Breite des Satzspiegels statt 820 px (rechts blieb eine Lücke) */
html body .wg-cb .wg-cb-card{max-width:none}
/* … und nutzt sie: rechts steht der Knopf, die Zeilen behalten ihre Lesebreite */
@media screen and (min-width:900px){
  html body .wg-cb .wg-cb-body{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:40px;align-items:center;padding-right:32px}
  html body .wg-cb .wg-cb-body>*{grid-column:1}
  html body .wg-cb .wg-cb-body>.wg-cb-acts{grid-column:2;grid-row:1 / span 6;margin-top:0;align-self:center}
}
