/* Intucora Handy-Fassung "Wie eine App" (aus Werkstatt v18). Wird mit media="(max-width: 699px)" geladen.
   Alle Regeln hängen an html.app-h (setzt kopf.js im <head>) und greifen schon vor handy.js.
   Plätze für Reiterleiste, "Mehr lesen" und Leiste unten sind vorab reserviert, damit nichts springt.
   Reiter der Startseite (nur wenn main > .vollbild da ist), Zuordnung rein per Selektor:
     dich      .wechsel, .zahlenband, .kosten-satz
     berufe    section:has(> .berufe)
     ratgeber  .sec-tint:has(.facts), .zweitweg, form.liste
     ankommen  .sec-tint:has(.ankommen)
     firmen    .ag-zeile, .firmenband
   Untere Leiste: Seiten mit Menüpunkt "Profil anlegen", ohne Eingabefeld in den ersten zwei Abschnitten
   (Profil, Rechner), nicht mein/ und antwort/ (kopf.js setzt dort app-ol). Dieselbe Bedingung steht in handy.js. */
@media (max-width: 699px) {

  /* ================= Startseite: Reiter ================= */
  /* Ohne gewählten Reiter (erster Aufruf): Reiter mit dem Sprungziel (#anker, per :target schon vor jedem Skript),
     sonst der erste. In den :target-Bedingungen stehen gleichwertige Selektoren ohne :has (darf nicht verschachtelt
     werden): Berufe = section ohne Klasse, Ratgeber = erstes .sec-tint vor .zweitweg, Ankommen = .sec-tint nach .zweitweg. */
  html.app-h:has(main > .vollbild):not([data-reiter]):not(:has(main > section:not([class]):target, main > section:not([class]) :target, main > .sec-tint:not(.zweitweg ~ .sec-tint):target, main > .sec-tint:not(.zweitweg ~ .sec-tint) :target, main > .zweitweg:target, main > .zweitweg :target, main > form.liste:target, main > form.liste :target, main > .zweitweg ~ .sec-tint:target, main > .zweitweg ~ .sec-tint :target, main > .ag-zeile:target, main > .ag-zeile :target, main > .firmenband:target, main > .firmenband :target)) main > :is(section:has(> .berufe), .sec-tint:has(.facts), .zweitweg, form.liste, .sec-tint:has(.ankommen), .ag-zeile, .firmenband),
  html.app-h:has(main > .vollbild):not([data-reiter]):has(main > section:not([class]):target, main > section:not([class]) :target) main > :is(.wechsel, .zahlenband, .kosten-satz, .sec-tint:has(.facts), .zweitweg, form.liste, .sec-tint:has(.ankommen), .ag-zeile, .firmenband),
  html.app-h:has(main > .vollbild):not([data-reiter]):has(main > .sec-tint:not(.zweitweg ~ .sec-tint):target, main > .sec-tint:not(.zweitweg ~ .sec-tint) :target, main > .zweitweg:target, main > .zweitweg :target, main > form.liste:target, main > form.liste :target) main > :is(.wechsel, .zahlenband, .kosten-satz, section:has(> .berufe), .sec-tint:has(.ankommen), .ag-zeile, .firmenband),
  html.app-h:has(main > .vollbild):not([data-reiter]):has(main > .zweitweg ~ .sec-tint:target, main > .zweitweg ~ .sec-tint :target) main > :is(.wechsel, .zahlenband, .kosten-satz, section:has(> .berufe), .sec-tint:has(.facts), .zweitweg, form.liste, .ag-zeile, .firmenband),
  html.app-h:has(main > .vollbild):not([data-reiter]):has(main > .ag-zeile:target, main > .ag-zeile :target, main > .firmenband:target, main > .firmenband :target) main > :is(.wechsel, .zahlenband, .kosten-satz, section:has(> .berufe), .sec-tint:has(.facts), .zweitweg, form.liste, .sec-tint:has(.ankommen)),
  html.app-h:has(main > .vollbild)[data-reiter="dich"] main > :is(section:has(> .berufe), .sec-tint:has(.facts), .zweitweg, form.liste, .sec-tint:has(.ankommen), .ag-zeile, .firmenband),
  html.app-h:has(main > .vollbild)[data-reiter="berufe"] main > :is(.wechsel, .zahlenband, .kosten-satz, .sec-tint:has(.facts), .zweitweg, form.liste, .sec-tint:has(.ankommen), .ag-zeile, .firmenband),
  html.app-h:has(main > .vollbild)[data-reiter="ratgeber"] main > :is(.wechsel, .zahlenband, .kosten-satz, section:has(> .berufe), .sec-tint:has(.ankommen), .ag-zeile, .firmenband),
  html.app-h:has(main > .vollbild)[data-reiter="ankommen"] main > :is(.wechsel, .zahlenband, .kosten-satz, section:has(> .berufe), .sec-tint:has(.facts), .zweitweg, form.liste, .ag-zeile, .firmenband),
  html.app-h:has(main > .vollbild)[data-reiter="firmen"] main > :is(.wechsel, .zahlenband, .kosten-satz, section:has(> .berufe), .sec-tint:has(.facts), .zweitweg, form.liste, .sec-tint:has(.ankommen)) {
    display: none;
  }
  html.app-h:has(main > .vollbild) main [id] { scroll-margin-top: calc(var(--app-kopf, 61px) + 51px + .5rem); }

  /* Platz für die Reiterleiste (51 px), bis handy.js sie einsetzt */
  html.app-h:not(.app-fertig) main > .vollbild { margin-bottom: 51px; }
  html.app-h .app-reiter {
    position: sticky; top: var(--app-kopf, 0px); z-index: 25; box-sizing: border-box; height: 51px;
    display: flex; gap: .15rem; margin: 0 calc(50% - 50vw); padding: 0 calc(50vw - 50% - .35rem);
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none;
    background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: 0 6px 14px -12px rgba(10, 26, 19, .45);
  }
  html.app-h .app-reiter::-webkit-scrollbar { display: none; }
  html.app-h .app-tab {
    flex: 0 0 auto; height: 100%; padding: .2rem .7rem 0; margin: 0;
    background: none; border: 0; border-block-end: 3px solid transparent; border-radius: 0;
    font: inherit; font-size: .93rem; font-weight: 600; color: var(--muted); white-space: nowrap; cursor: pointer;
  }
  html.app-h .app-tab[aria-selected="true"] { color: var(--accent); border-block-end-color: var(--accent); }
  html.app-h .app-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -5px; }

  /* Kompakter Kopf */
  html.app-h .vollbild { padding-top: 0; padding-bottom: 0; }
  html.app-h .vollbild .inn { padding: 1.35rem 0 1.15rem; }
  html.app-h .vollbild h1 { margin-top: 0; font-size: 1.62rem; line-height: 1.12; margin: 0 0 .55rem; max-width: none; text-wrap: balance; }
  html.app-h .vollbild .lead { font-size: .95rem; line-height: 1.45; margin: 0 0 .9rem; }
  html.app-h .vollbild p:has(> .btn.primary) { margin: 0; }
  html.app-h .vollbild .btn.primary {
    display: flex; align-items: center; justify-content: center; min-height: 54px;
    font-size: 1.08rem; font-weight: 700; border-radius: 12px;
  }
  html.app-h .vollbild .merk { font-size: .78rem; line-height: 1.4; margin: .65rem 0 0; }

  /* Reiterinhalte: oben ohne Außenabstand (sonst stimmt der reservierte Platz nicht) */
  html.app-h:has(main > .vollbild) main > :is(.wechsel, .zahlenband, .kosten-satz, section:has(> .berufe), .sec-tint:has(.facts), .zweitweg, form.liste, .sec-tint:has(.ankommen), .ag-zeile, .firmenband) { margin-top: 0; }
  html.app-h:has(main > .vollbild) main > section:has(> .berufe) { padding-top: 1.1rem; }
  html.app-h:has(main > .vollbild) main > section:has(> .berufe) h2,
  html.app-h:has(main > .vollbild) main > .sec-tint h2,
  html.app-h:has(main > .vollbild) .firmenband h2 { font-size: 1.4rem; margin-top: 0; }
  html.app-h:has(main > .vollbild) main > :is(section:has(> .berufe), .sec-tint:has(.ankommen)) .lead { font-size: 1rem; margin-bottom: .2rem; }
  html.app-h:has(main > .vollbild) main > .sec-tint:is(:has(.facts), :has(.ankommen)) { padding-top: 1.1rem; padding-bottom: 1.2rem; }

  /* Für Bewerber */
  html.app-h:has(main > .vollbild) body section.wechsel .wrap { padding-top: 1.1rem; padding-bottom: 1rem; }
  html.app-h:has(main > .vollbild) section.wechsel h2 { font-size: 1.35rem; }
  html.app-h:has(main > .vollbild) section.wechsel .los { margin-bottom: .2rem; }
  html.app-h:has(main > .vollbild) .zahlenband div { padding: .85rem 1rem .9rem; }
  html.app-h:has(main > .vollbild) .zahlenband b { font-size: 1.6rem; }
  html.app-h:has(main > .vollbild) .zahlenband span { font-size: .82rem; line-height: 1.35; margin-top: .3rem; }
  html.app-h:has(main > .vollbild) .kosten-satz p { margin: .6rem 0 .2rem; font-size: .84rem; line-height: 1.45; }

  /* Berufe und Ankommen: Karten als kompakte Zeilen untereinander (Bild links 104 x 78 px, Text rechts,
     ganze Zeile antippbar; RTL spiegelt das Raster von selbst) */
  html.app-h:has(main > .vollbild) main > section:has(> .berufe) .berufe,
  html.app-h:has(main > .vollbild) main > .sec-tint .ankommen { display: block; margin: .9rem 0 0; }
  html.app-h:has(main > .vollbild) main > section:has(> .berufe) .beruf,
  html.app-h:has(main > .vollbild) main > .sec-tint .ankommen .ak {
    display: grid; grid-template-columns: 104px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: .9rem; row-gap: .15rem;
    align-items: start; aspect-ratio: auto; min-height: 78px; padding: .7rem 0; overflow: visible;
    border-top: 1px solid var(--line); border-radius: 0; color: var(--ink); text-decoration: none;
  }
  html.app-h:has(main > .vollbild) main > section:has(> .berufe) .beruf:last-child,
  html.app-h:has(main > .vollbild) main > .sec-tint .ankommen .ak:last-child { border-bottom: 1px solid var(--line); }
  html.app-h:has(main > .vollbild) main > section:has(> .berufe) .beruf img {
    position: static; grid-row: 1 / 3; width: 104px; height: 78px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px;
  }
  html.app-h:has(main > .vollbild) main > section:has(> .berufe) .beruf:hover img { transform: none; }
  html.app-h:has(main > .vollbild) main > section:has(> .berufe) .beruf .deck { display: none; }
  html.app-h:has(main > .vollbild) main > section:has(> .berufe) .beruf .txt { position: static; grid-column: 2; grid-row: 1 / 3; padding: 0; color: inherit; }
  html.app-h:has(main > .vollbild) main > section:has(> .berufe) .beruf h3 { color: var(--ink); font-size: 1.08rem; line-height: 1.2; margin: .1rem 0 .2rem; }
  html.app-h:has(main > .vollbild) main > section:has(> .berufe) .beruf p { color: var(--muted); opacity: 1; font-size: .87rem; line-height: 1.35; }
  html.app-h:has(main > .vollbild) main > .sec-tint .ankommen .ak .bild { grid-column: 1; grid-row: 1 / 3; width: 104px; height: 78px; aspect-ratio: 4 / 3; margin: 0; border-radius: 8px; }
  html.app-h:has(main > .vollbild) main > .sec-tint .ankommen .ak h3 { grid-column: 2; font-size: 1.08rem; line-height: 1.2; margin: .1rem 0 0; }
  html.app-h:has(main > .vollbild) main > .sec-tint .ankommen .ak p { grid-column: 2; font-size: .87rem; line-height: 1.35; }
  html.app-h:has(main > .vollbild) .bf-startzeile a { font-size: 1.02rem; min-height: 52px; }

  /* Ratgeber */
  html.app-h:has(main > .vollbild) main > .sec-tint .sec-head p { font-size: .92rem; }
  html.app-h:has(main > .vollbild) main > .sec-tint ul.facts { gap: .55rem; margin-bottom: .8rem; font-size: .95rem; }
  html.app-h:has(main > .vollbild) main > .sec-tint:has(.facts) .note { margin: .8rem 0 0; }
  html.app-h:has(main > .vollbild) .zweitweg .wrap { gap: .6rem; padding-top: .8rem; padding-bottom: .8rem; }
  html.app-h:has(main > .vollbild) main > form.liste { margin: 1rem 0 0; padding: 1rem; }
  html.app-h:has(main > .vollbild) main > form.liste p { margin: .15rem 0 .6rem; font-size: .93rem; line-height: 1.45; }
  html.app-h:has(main > .vollbild) main > form.liste .zu { margin: .6rem 0 .3rem; font-size: .86rem; }
  html.app-h:has(main > .vollbild) main > form.liste small { font-size: .8rem; line-height: 1.4; }

  /* Für Arbeitgeber */
  html.app-h:has(main > .vollbild) .ag-zeile p { font-size: .9rem; }
  html.app-h:has(main > .vollbild) .firmenband .inn { padding: 1.5rem 0 1.4rem; }
  /* Firmenzahlen als drei Zeilen (Zahl links, Erklärung rechts): alle drei Preise auf einen Blick vergleichbar */
  html.app-h:has(main > .vollbild) .firmenband .zahlen { display: block; gap: 0; margin: 1rem 0 1.2rem; padding: 0; border-top: 0; }
  html.app-h:has(main > .vollbild) .firmenband .zahlen > div {
    display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); column-gap: .8rem; align-items: baseline;
    padding: .6rem 0; border-top: 1px solid rgba(255, 255, 255, .18);
  }
  html.app-h:has(main > .vollbild) .firmenband .zahlen > div:last-child { border-bottom: 1px solid rgba(255, 255, 255, .18); }
  html.app-h:has(main > .vollbild) .firmenband .zahlen b { font-size: 1.45rem; margin: 0; white-space: nowrap; }
  html.app-h:has(main > .vollbild) .firmenband .zahlen span { font-size: .86rem; line-height: 1.35; }

  /* "Anonymes Profil anlegen" im Wechsel-Kasten als schlichter Textlink (nicht ausgeblendet) */
  html.app-h:has(main > .vollbild) section.wechsel .los .btn.primary {
    display: inline-flex; align-items: center; width: auto; min-height: 44px; padding: 0; margin: 0;
    background: none; border: 0; box-shadow: none; color: var(--accent); font-weight: 700;
    text-decoration: underline; text-underline-offset: 3px;
  }
  html.app-h:has(main > .vollbild) section.wechsel .los .mehr-link { display: inline-flex; align-items: center; min-height: 44px; margin: 0; }

  /* ================= Kopf ================= */
  /* Der Menü-Knopf der Seite wird erst bei DOMContentLoaded sichtbar; das kommt wegen defer erst nach handy.js.
     Platz deshalb vorab freihalten (unsichtbar), sonst rutscht bei langsamem Netz der Kopf um. */
  html.app-h.js header.site button.menu[hidden] { display: inline-flex !important; visibility: hidden; }
  /* Schmale Handys: Menü-Knopf nur mit Symbol (das Wort bleibt für Screenreader), damit der Kopf einzeilig bleibt */
  @media (max-width: 420px) {
    html.app-h header.site button.menu { font-size: 0; gap: 0; min-width: 44px; min-height: 40px; justify-content: center; padding: .42rem .6rem; }
    html.app-h header.site .wordmark { font-size: 1.3rem; }
  }

  /* ================= Untere Leiste: ein großer Knopf =================
     Konto und Menü bleiben oben im Kopf. Die Leiste zeigt nur den Hauptweg (Profil, im Reiter "Für Arbeitgeber"
     den Firmenweg) und blendet sich auf der Startseite erst ein, wenn der Profil-Knopf im Startbild aus dem Bild ist.
     Gleiche Bedingung wie MIT_LEISTE in handy.js. */
  /* Platz am Seitenende bleibt immer reserviert (Leiste 64 px plus Luft) */
  html.app-h:not(.app-ol):has(nav.main .nav-profil):not(:has(main > section:nth-of-type(-n+2) :is(input:not([type="hidden"]), select, textarea))) footer.site {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
  /* Profil-Knopf im Fuß-Markenblock ausblenden, die Leiste übernimmt ihn (Satz im Fuß bleibt) */
  html.app-h:not(.app-ol):has(nav.main .nav-profil):not(:has(main > section:nth-of-type(-n+2) :is(input:not([type="hidden"]), select, textarea))) footer.site .fuss-knopf { display: none; }

  html.app-h .app-leiste {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 60; box-sizing: border-box; display: flex;
    padding: .5rem .75rem calc(.5rem + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    -webkit-backdrop-filter: saturate(1.3) blur(10px); backdrop-filter: saturate(1.3) blur(10px);
    border-top: 1px solid var(--line); box-shadow: 0 -8px 20px -14px rgba(10, 26, 19, .45);
    transition: transform .22s ease, opacity .22s ease, visibility 0s linear 0s;
  }
  html.app-h .app-l {
    flex: 1 1 auto; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
    min-height: 48px; padding: .3rem 1rem; border-radius: 12px; background: var(--accent); color: var(--accent-ink);
    font: inherit; font-size: 1.02rem; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none;
  }
  html.app-h .app-l:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  /* Aus (Startbild-Knopf noch sichtbar, oder Tastatur offen): nur transform/opacity, danach unsichtbar für Tab-Taste */
  html.app-h .app-leiste.app-weg,
  html.app-tippen .app-leiste,
  html.app-tastatur .app-leiste {
    transform: translateY(110%); opacity: 0; pointer-events: none; visibility: hidden;
    transition: transform .22s ease, opacity .22s ease, visibility 0s linear .22s;
  }

  /* ================= "Mehr lesen" (Platz ist vorab reserviert) ================= */
  html.app-h .app-mehr {
    display: flex; align-items: center; gap: .5rem; box-sizing: border-box; height: 44px; margin: 0; padding: 0 .2rem;
    background: none; border: 0; font: inherit; font-size: .92rem; font-weight: 600; line-height: 1; color: inherit;
    cursor: pointer; text-decoration: underline; text-underline-offset: 3px; justify-self: start;
  }
  html.app-h .app-mehr::after {
    content: ""; width: .5rem; height: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg); /* zeigt nach unten, auch in RTL */
  }
  html.app-h .app-mehr[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
  html.app-h .app-mehr:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: var(--radius); }

  /* Profilseite: Einleitung kompakt, die zwei Merkabsätze hinter "Mehr lesen" */
  html.app-h .hero.profil-kopf { padding-top: 1.05rem; padding-bottom: .7rem; }
  html.app-h:not(.app-fertig) .hero.profil-kopf:has(> .kopf-merk) { padding-bottom: calc(.7rem + 44px); }
  html.app-h .hero.profil-kopf:not(.app-auf) > .kopf-merk { display: none; }
  html.app-h .hero.profil-kopf .eyebrow { margin: 0 0 .25rem; }
  html.app-h .hero.profil-kopf h1 { font-size: 1.6rem; line-height: 1.15; margin: 0 0 .45rem; }
  html.app-h .hero.profil-kopf .lead { font-size: .95rem; line-height: 1.45; margin-bottom: 0; }
  html.app-h .hero.profil-kopf > .app-mehr { position: relative; z-index: 2; color: var(--deep-ink); }

  /* Artikel und Berufe: Werbekasten kompakt (Satz und Knopf bleiben sichtbar) */
  html.app-h .einschub:is(.banner-ag, .banner-gruen):has(:is(.ba-p, .bn-p)) { position: relative; row-gap: .45rem; }
  html.app-h:not(.app-fertig) .einschub:is(.banner-ag, .banner-gruen):has(:is(.ba-p, .bn-p)) { padding-bottom: calc(.85rem + 44px + .45rem); }
  html.app-h .einschub:not(.app-auf) :is(.ba-p, .ba-preis, .bn-p, .bn-merk) { display: none; }
  html.app-h .einschub.banner-ag.app-auf .ba-preis { display: block; }
  html.app-h .einschub.banner-ag { margin: .9rem 0 1.3rem; padding: .85rem .95rem; }
  html.app-h .banner-ag .ba-h { font-size: 1.2rem; margin: 0; }
  html.app-h .einschub.banner-ag a.ba-knopf { min-height: 46px; padding: .55rem .8rem; }
  html.app-h .einschub > .app-mehr { grid-column: 1 / -1; font-size: .86rem; }

  /* Übrige Kästen kompakt */
  html.app-h .prose .box,
  html.app-h .prose .note.angebot { padding: .85rem .95rem; }
  html.app-h .prose .note.angebot p { margin: .35rem 0; }
  html.app-h .prose .ki-hinweis-lang { font-size: .82rem; line-height: 1.45; }
  html.app-h .prose .related { margin-top: 1.4rem; }

  /* ================= Fußzeile: Spalten als Klappliste ================= */
  html.app-h footer.site { margin-top: 1.6rem; }
  html.app-h footer.site .fuss { gap: 1.1rem; padding-top: 1.5rem; padding-bottom: 1rem; }
  html.app-h footer.site .fuss-satz { font-size: 1.05rem; margin: .55rem 0 .8rem; }
  html.app-h footer.site .fuss-spalten { grid-template-columns: 1fr; gap: 0; }
  html.app-h footer.site .fuss-spalten > div { position: relative; border-top: 1px solid color-mix(in srgb, var(--deep-ink) 16%, var(--deep)); }
  html.app-h footer.site .fuss-spalten .fuss-h { margin: 0; min-height: 48px; display: flex; align-items: center; padding-inline-end: 2.6rem; }
  html.app-h footer.site .fuss-spalten > div:not(.app-auf):not(:has(a[href*="impressum"])) > ul { display: none; }   /* Rechtliches bleibt offen (Impressum, 24.10.2026) */
  html.app-h footer.site .fuss-spalten ul { padding: 0 0 1rem; }
  html.app-h footer.site .app-fuss-kn {
    position: absolute; top: 0; inset-inline: 0; height: 48px; margin: 0; padding: 0 .4rem; display: flex;
    justify-content: flex-end; align-items: center; background: none; border: 0; color: var(--deep-ink); cursor: pointer;
  }
  html.app-h footer.site .app-fuss-kn::after {
    content: ""; width: .55rem; height: .55rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
  }
  html.app-h footer.site .app-fuss-kn[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
  html.app-h footer.site .app-fuss-kn:focus-visible { outline: 2px solid var(--sand); outline-offset: -2px; }
  html.app-h footer.site .fuss-unten { padding-top: 1rem; }

  @media (prefers-reduced-motion: reduce) {
    html.app-h .app-leiste { transition: none; }
  }
}
