/* ==========================================================================
   OnPoint 24 – Kiosk-Oberfläche
   Ziel: modern, voll per Touch bedienbar, alles passt ohne Scrollen auf den
   Bildschirm. Alle Größen hängen an der (fluiden) rem-Basis und skalieren so
   mit der Bildschirmgröße mit.
   ========================================================================== */

:root {
    --bg: #eef0f4;
    --text: #14161c;
    --muted: rgba(20, 22, 28, 0.62);
    --faint: rgba(20, 22, 28, 0.42);

    --glass: rgba(255, 255, 255, 0.82);
    --glass-strong: #ffffff;
    --glass-press: #e6e8ee;
    --line: rgba(20, 22, 28, 0.07);
    --line-strong: rgba(20, 22, 28, 0.16);
    --shadow: 0 14px 34px -16px rgba(20, 22, 28, 0.22);

    --brand: #ff2b2b;
    --red: #e0142b;
    --green: #16a34a;

    --grad-brand: linear-gradient(135deg, #ff2b2b 0%, #ff6a3d 100%);
    --grad-videos: linear-gradient(135deg, #ff3b3b, #ff7a45);
    --grad-idea: linear-gradient(135deg, #3b82f6, #6366f1);
    --grad-help: linear-gradient(135deg, #f59e0b, #f97316);
    --grad-ok: linear-gradient(135deg, #22c55e, #0d9488);

    --radius-xl: 2rem;
    --radius-lg: 1.5rem;
    --radius-md: 1.1rem;
    --radius-sm: 0.8rem;

    --pad: 1.75rem;
    --gap: 1.5rem;
    --touch: max(56px, 3.6rem);

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

    color-scheme: light;
}

/* Fluide Basisgröße: richtet sich nach Breite UND Höhe, damit nichts überläuft */
html {
    font-size: clamp(14px, min(1.1vw, 1.95vh), 30px);
    height: 100%;
    background: var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    font-family: var(--font);
    color: var(--text);
    background: transparent;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    overscroll-behavior: none;
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
img, video, svg { display: block; }
img { -webkit-user-drag: none; }
[hidden] { display: none !important; }

.icon { width: 1.25em; height: 1.25em; flex: none; }

/* Sanfte Seitenübergänge (moderne Browser, sonst einfach ohne) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.22s; }

/* ---------- Hintergrund ---------------------------------------------------- */

.backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: var(--bg);
}
.backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(50% 60% at 0% 0%, rgba(255, 59, 59, 0.09), transparent 70%),
        radial-gradient(50% 60% at 100% 100%, rgba(59, 130, 246, 0.09), transparent 70%);
}

/* ---------- Grundbausteine ------------------------------------------------- */

.page {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    padding: calc(var(--pad) + env(safe-area-inset-top)) calc(var(--pad) + env(safe-area-inset-right)) calc(var(--pad) + env(safe-area-inset-bottom)) calc(var(--pad) + env(safe-area-inset-left));
}

.glass {
    background: var(--glass);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    backdrop-filter: blur(18px) saturate(1.3);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: var(--touch);
    padding: 0 1.6rem;
    border-radius: 999px;
    font-size: 1.2rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: transform 0.15s var(--ease-out), background-color 0.15s, box-shadow 0.15s, opacity 0.2s;
}
.btn .icon { width: 1.4em; height: 1.4em; }
.btn:active { transform: scale(0.96); }

.btn--ghost {
    background: var(--glass-strong);
    border: 1px solid var(--line);
    box-shadow: 0 6px 18px -10px rgba(20, 22, 28, 0.25);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}
.btn--ghost:active { background: var(--glass-press); }

.btn--primary {
    color: #fff;
    background: var(--grad-brand);
    box-shadow: 0 10px 26px -10px rgba(255, 43, 43, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn--primary:active { box-shadow: 0 4px 14px -6px rgba(255, 43, 43, 0.6); }
.btn:disabled { opacity: 0.35; pointer-events: none; box-shadow: none; }

.btn--lg { min-height: calc(var(--touch) * 1.3); padding: 0 2.2rem; font-size: 1.5rem; }

/* Kopfzeile der Unterseiten */
.topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--gap);
    flex: none;
}
.btn--back { justify-self: start; padding-block: 0; padding-inline: 1.3rem 1.8rem; font-size: 1.3rem; }
.topbar__title { text-align: center; }
.topbar__title h1 { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.topbar__title p { margin-top: 0.3rem; font-size: 1.1rem; color: var(--muted); }
.topbar__logo { justify-self: end; }
.topbar__logo img { height: 3.4rem; width: auto; }

/* Einblend-Animation */
.rise { animation: rise 0.6s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(1.2rem); } }

/* ==========================================================================
   Startseite
   ========================================================================== */

.home {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
        "head  media"
        "hello media"
        "tiles media";
    column-gap: calc(var(--gap) * 1.4);
    row-gap: var(--gap);
}

.home__head { grid-area: head; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; container: head / inline-size; }
.home__head > a:first-child { flex: 0 1 auto; min-width: 0; }
.home__logo { width: 14rem; max-width: 100%; height: auto; }

/* Sprachwahl: Flagge + Name in der eigenen Sprache */
.langs { flex: none; display: flex; gap: 0.6rem; align-self: center; }
.lang {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-width: 4.6rem;
    padding: 0.5rem 0.5rem 0.4rem;
    border-radius: var(--radius-md);
    background: var(--glass-strong);
    border: 1px solid var(--line);
    box-shadow: 0 6px 18px -12px rgba(20, 22, 28, 0.35);
    transition: transform 0.15s var(--ease-out), border-color 0.15s, box-shadow 0.15s;
}
.lang:active { transform: scale(0.93); }
.lang__flag { display: block; width: 3.3rem; aspect-ratio: 3 / 2; border-radius: 0.4rem; overflow: hidden; box-shadow: 0 0 0 1px rgba(20, 22, 28, 0.14); }
.lang__flag img { width: 100%; height: 100%; object-fit: cover; }
.lang__name { font-size: 0.85rem; font-weight: 650; line-height: 1.15; white-space: nowrap; color: var(--muted); }
.lang.is-on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 43, 43, 0.2), 0 10px 22px -12px rgba(255, 43, 43, 0.6); }
.lang.is-on .lang__name { color: var(--text); }
/* Zu wenig Platz neben Logo und Uhr: Flaggen in eine eigene Zeile */
@container head (max-width: 47rem) {
    .langs { order: 3; width: 100%; }
}

.clock { text-align: end; line-height: 1; }
.clock__time { font-size: 3rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.clock__date { margin-top: 0.4rem; font-size: 1.05rem; color: var(--muted); }

.home__hello { grid-area: hello; }
.home__hello h1 { font-size: 3.3rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.home__hello p { margin-top: 0.5rem; font-size: 1.35rem; color: var(--muted); }

/* Hinweis „Touch-Display“ */
.home__hello .touch-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.9rem;
    padding-block: 0.45rem;
    padding-inline: 0.45rem 1.3rem;
    border-radius: 999px;
    background: var(--glass-strong);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    color: var(--text);
}
.touch-hint strong { font-weight: 750; }
.touch-hint__icon {
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    color: #fff;
    background: var(--grad-brand);
}
.touch-hint__icon .icon { width: 1.5rem; height: 1.5rem; }
.touch-hint__icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--brand);
    animation: hint-ping 2.2s ease-out infinite;
}
@keyframes hint-ping { 0% { transform: scale(1); opacity: 0.7; } 70%, 100% { transform: scale(1.7); opacity: 0; } }
.grad-text {
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tiles {
    grid-area: tiles;
    display: grid;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
    min-height: 0;
}

.tile {
    --accent: var(--grad-videos);
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.6rem;
    padding-block: 1rem;
    padding-inline: 1.4rem 1.6rem;
    border-radius: var(--radius-xl);
    overflow: hidden;
    min-height: 0;
    isolation: isolate;
    transition: transform 0.18s var(--ease-out), background-color 0.18s, border-color 0.18s;
}
.tile:active { transform: scale(0.975); background: var(--glass-strong); border-color: var(--line-strong); }

.tile--idea { --accent: var(--grad-idea); }
.tile--help { --accent: var(--grad-help); }

.tile__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 5.6rem;
    height: 5.6rem;
    border-radius: 1.5rem;
    color: #fff;
    background: var(--accent);
    box-shadow: 0 10px 24px -10px rgba(20, 22, 28, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.tile__icon .icon { width: 2.8rem; height: 2.8rem; }

.tile__text { min-width: 0; }
.tile__text h2 { font-size: 2.2rem; font-weight: 750; letter-spacing: -0.015em; line-height: 1.15; }
.tile__text p { margin-top: 0.35rem; font-size: 1.25rem; color: var(--muted); }

.tile__go {
    flex: none;
    margin-inline-start: auto;
    display: grid;
    place-items: center;
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 50%;
    background: #f1f2f5;
    border: 1px solid var(--line);
}
.tile__go .icon { width: 1.6rem; height: 1.6rem; }

/* Tipp-Vorführung: Hand fährt über die drei Kacheln und drückt jeweils den Pfeil-Knopf.
   Ein Durchlauf dauert 7,5 s, gedrückt wird bei 10 %, 45 % und 80 % (alle 2,625 s). */
.tiles { position: relative; }
.home .tile__go { animation: go-tap 7.5s ease-in-out calc(1.6s + var(--n, 0) * 2.625s) infinite backwards; }
@keyframes go-tap {
    0%, 6%, 17%, 100% { transform: none; background: #f1f2f5; color: var(--text); }
    10%, 12% { transform: scale(0.84); background: var(--brand); color: #fff; }
}
.tap-demo {
    --row: calc((100% - 2.2rem) / 3);            /* Höhe einer Kachel (Abstand 1,1rem) */
    position: absolute;
    z-index: 2;
    right: 3.3rem;                                /* Mitte des Pfeil-Knopfs */
    top: calc(var(--row) / 2);
    width: 0;
    height: 0;
    pointer-events: none;
    opacity: 0;
    animation: tap-move 7.5s ease-in-out 1.6s infinite;
}
@keyframes tap-move {
    0%        { top: calc(var(--row) / 2); opacity: 0; transform: translate(2.5rem, 2rem); }
    6%, 18%   { top: calc(var(--row) / 2); opacity: 1; transform: none; }
    35%, 53%  { top: calc(var(--row) * 1.5 + 1.1rem); opacity: 1; transform: none; }
    70%, 84%  { top: calc(var(--row) * 2.5 + 2.2rem); opacity: 1; transform: none; }
    94%, 100% { top: calc(var(--row) * 2.5 + 2.2rem); opacity: 0; transform: translate(2.5rem, 2rem); }
}
.tap-demo__hand {
    position: absolute;
    left: -2rem;                                  /* Fingerspitze liegt auf dem Punkt */
    top: -0.1rem;
    width: 4.6rem;
    height: auto;
    transform-origin: 43% 4%;
    transform: rotate(-12deg);
    filter: drop-shadow(0 0.6rem 0.8rem rgba(20, 22, 28, 0.28));
    animation: tap-press 7.5s ease-in-out 1.6s infinite;
}
@keyframes tap-press {
    0%, 7%, 14%, 42%, 49%, 77%, 84%, 100% { transform: rotate(-12deg); }
    10%, 11%, 45%, 46%, 80%, 81% { transform: rotate(-12deg) scale(0.86); }
}
.tap-demo__ring {
    position: absolute;
    left: -2.2rem;
    top: -2.2rem;
    width: 4.4rem;
    height: 4.4rem;
    border-radius: 50%;
    border: 0.25rem solid var(--brand);
    background: rgba(255, 43, 43, 0.12);
    opacity: 0;
    animation: tap-ring 7.5s ease-out 1.6s infinite;
}
@keyframes tap-ring {
    0%, 9.9%, 22%, 44.9%, 57%, 79.9%, 92%, 100% { transform: scale(0.3); opacity: 0; }
    10%, 45%, 80% { transform: scale(0.3); opacity: 0.9; }
    20%, 55%, 90% { transform: scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .tap-demo { display: none; } }

/* Video-Karte mit Farbrand */
.home__media {
    grid-area: media;
    position: relative;
    height: calc(100dvh - 2 * var(--pad));
    width: min(calc((100dvh - 2 * var(--pad)) * 0.75), 44vw);
    border-radius: var(--radius-xl);
    padding: 4px;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 24px 60px -24px rgba(20, 22, 28, 0.4);
}
.home__media::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 200%;
    aspect-ratio: 1;
    z-index: -1;
    background: linear-gradient(135deg, #ff2b2b, #ff7a45);
    transform: translate(-50%, -50%);
}

.media-slot {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: calc(var(--radius-xl) - 4px);
    background: #fff;
}
.media-slot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

/* ==========================================================================
   Alle Videos
   ========================================================================== */

.vwrap { flex: 1; min-height: 0; container-type: size; }

.vgrid {
    --g: 1.6rem;
    --card-w: calc(var(--vscale, 1) * min(
        (100cqw - (var(--vc) - 1) * var(--g)) / var(--vc),
        (100cqh - (var(--vr) - 1) * var(--g)) / var(--vr) * 16 / 9
    ));
    height: 100%;
    display: grid;
    gap: var(--g);
    grid-template-columns: repeat(var(--vc), var(--card-w));
    align-content: center;
    justify-content: center;
}
/* Mehr Videos als auf den Schirm passen: seitlich wischen statt scrollen */
@media (orientation: landscape) {
    .vgrid--scroll-l {
        grid-template-columns: none;
        grid-template-rows: repeat(var(--vr), auto);
        grid-auto-flow: column;
        grid-auto-columns: var(--card-w);
        justify-content: start;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        touch-action: pan-x;
    }
    .vgrid--scroll-l .vcard { scroll-snap-align: start; }
}
@media (orientation: portrait) {
    .vgrid--scroll-p {
        grid-template-columns: none;
        grid-template-rows: repeat(var(--vr), auto);
        grid-auto-flow: column;
        grid-auto-columns: var(--card-w);
        justify-content: start;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        touch-action: pan-x;
    }
    .vgrid--scroll-p .vcard { scroll-snap-align: start; }
}
.vgrid::-webkit-scrollbar { display: none; }

.vcard {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 24px 60px -28px rgba(20, 22, 28, 0.35);
    transition: transform 0.2s var(--ease-out);
    text-align: start;
}
.vcard:active { transform: scale(0.975); }
.vcard__media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vcard::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 45%, rgba(255, 255, 255, 0.94) 100%);
}
.vcard__play {
    position: absolute;
    inset-inline-end: 1.4rem;
    bottom: 1.3rem;
    z-index: 2;
    display: grid;
    place-items: center;
    width: clamp(3.6rem, 13%, 5.4rem);
    aspect-ratio: 1;
    border-radius: 50%;
    color: #fff;
    background: var(--grad-brand);
    box-shadow: 0 0 0 0 rgba(255, 43, 43, 0.5);
    animation: pulse 2.4s ease-out infinite;
}
.vcard__play .icon { width: 42%; height: 42%; margin-left: 8%; fill: currentColor; }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 43, 43, 0.5); }
    70%, 100% { box-shadow: 0 0 0 1.6rem rgba(255, 43, 43, 0); }
}
.vcard__info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: flex; flex-direction: column; gap: 0.25rem; padding-block: 1.3rem 1.4rem; padding-inline: 1.6rem 8rem; }
.vcard__title { font-size: 1.8rem; font-weight: 750; letter-spacing: -0.01em; line-height: 1.15; }
.vcard__text { font-size: 1.15rem; color: var(--muted); }
.vcard__dur {
    position: absolute;
    top: 1rem;
    inset-inline-end: 1rem;
    z-index: 1;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    color: #fff;
    background: rgba(20, 22, 28, 0.6);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.vcard__dur:empty { display: none; }

.empty {
    height: 100%;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 1rem;
    text-align: center;
    color: var(--muted);
    font-size: 1.3rem;
}
.empty .icon { width: 4rem; height: 4rem; color: var(--faint); }

/* Vollbild-Player */
.player {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    animation: fade-in 0.25s ease both;
}
@keyframes fade-in { from { opacity: 0; } }
.player__stage { position: relative; flex: 1; min-height: 0; background: #0f1115; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.player__motion { position: absolute; inset: 0; }
.player__motion:empty { display: none; }
/* Vorschau der Erklärvideos in den Kacheln: nur die Grafik */
.vcard .motion__segs, .vcard .motion__logo, .vcard .ms__copy { display: none; }
.vcard .ms { padding: 6cqmin 6cqmin 24cqmin; }

.player__top, .player__bar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem calc(var(--pad) + env(safe-area-inset-right)) 1rem calc(var(--pad) + env(safe-area-inset-left));
    background: #fff;
}
.player__top { padding-top: calc(1rem + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }
.player__top h2 { flex: 1; font-size: 1.6rem; font-weight: 700; }
.player__bar { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

.round-btn {
    flex: none;
    display: grid;
    place-items: center;
    width: calc(var(--touch) * 1.15);
    height: calc(var(--touch) * 1.15);
    border-radius: 50%;
    background: rgba(20, 22, 28, 0.06);
    border: 1px solid rgba(20, 22, 28, 0.12);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: transform 0.15s var(--ease-out), background-color 0.15s;
}
.round-btn .icon { width: 45%; height: 45%; }
.round-btn:active { transform: scale(0.92); background: rgba(20, 22, 28, 0.14); }
.round-btn--main { width: calc(var(--touch) * 1.45); height: calc(var(--touch) * 1.45); color: #fff; background: var(--grad-brand); border: 0; }
.round-btn--main .icon { fill: currentColor; }

.player__time { font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 4.2ch; text-align: center; }

.progress { position: relative; flex: 1; height: var(--touch); display: flex; align-items: center; cursor: pointer; touch-action: none; }
.progress__track { position: relative; width: 100%; height: 0.55rem; border-radius: 999px; background: rgba(20, 22, 28, 0.12); }
.progress__fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--grad-brand); }
.progress__knob {
    position: absolute;
    top: 50%;
    left: 0;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: #fff;
    border: 1px solid rgba(20, 22, 28, 0.12);
    box-shadow: 0 2px 10px rgba(20, 22, 28, 0.35);
    transform: translate(-50%, -50%);
}

.player__flash {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    pointer-events: none;
}
.player__flash .icon { width: 3.4rem; height: 3.4rem; fill: currentColor; }
.player__flash.is-on { animation: flash 0.6s var(--ease-out); }
@keyframes flash {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.8); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); }
}

/* ==========================================================================
   Produkt vorschlagen
   ========================================================================== */

.suggest { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 1.2rem; }
.suggest__hero { display: none; }
.entry { display: flex; gap: 1rem; flex: none; }
.entry__field {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 5.2rem;
    padding-block: 0;
    padding-inline: 1.6rem 0.9rem;
    border-radius: var(--radius-lg);
    background: #fff;
    border: 2px solid var(--line-strong);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.entry__field.has-text { border-color: rgba(255, 43, 43, 0.7); box-shadow: 0 0 0 5px rgba(255, 43, 43, 0.12); }
.entry__text {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: pre;
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.entry__placeholder { color: var(--faint); font-weight: 500; }
.caret {
    flex: none;
    width: 3px;
    height: 1.15em;
    margin-inline-start: 2px;
    border-radius: 2px;
    background: var(--brand);
    animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.entry__count { flex: none; font-size: 1rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.entry__clear {
    flex: none;
    display: grid;
    place-items: center;
    width: var(--touch);
    height: var(--touch);
    border-radius: 50%;
    background: rgba(20, 22, 28, 0.06);
    transition: transform 0.15s, background-color 0.15s;
}
.entry__clear:active { transform: scale(0.9); background: rgba(20, 22, 28, 0.14); }
.entry__clear .icon { width: 1.5rem; height: 1.5rem; }

.alert {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: none;
    padding: 0.9rem 1.3rem;
    border-radius: var(--radius-md);
    background: rgba(255, 59, 59, 0.1);
    border: 1px solid rgba(255, 59, 59, 0.35);
    font-size: 1.15rem;
}
.alert .icon { width: 1.6rem; height: 1.6rem; color: var(--red); }

.kb {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.65rem;
    padding: 1rem;
    border-radius: var(--radius-xl);
    background: #e3e6ec;
}
.kb__row { flex: 1 1 0; max-height: 6.4rem; min-height: 0; display: flex; gap: 0.65rem; }

.key {
    flex: var(--w, 1) 1 0;
    min-width: 0;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    background: #fff;
    border: 1px solid rgba(20, 22, 28, 0.08);
    box-shadow: 0 3px 0 rgba(20, 22, 28, 0.14);
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1;
    transition: transform 0.08s, background-color 0.08s, box-shadow 0.08s;
}
.key .icon { width: 1.7rem; height: 1.7rem; }
.key.is-down {
    transform: translateY(2px) scale(0.96);
    background: rgba(255, 43, 43, 0.16);
    box-shadow: 0 1px 0 rgba(20, 22, 28, 0.14), 0 0 18px rgba(255, 43, 43, 0.3);
}
.key--fn { display: flex; align-items: center; justify-content: center; background: #f1f2f5; font-size: 1.25rem; }
.key--fn span { margin-inline-start: 0.5rem; }
.key--spacer { visibility: hidden; }
.key--shift.is-on { background: #14161c; color: #fff; }
.key--shift.is-lock { background: #14161c; color: #fff; box-shadow: 0 3px 0 rgba(20, 22, 28, 0.25), 0 0 0 3px var(--brand); }
.key--send { display: flex; justify-content: center; gap: 0.6rem; color: #fff; background: var(--grad-brand); border: 0; font-size: 1.4rem; font-weight: 700; }
.key--send:disabled { opacity: 0.35; }
.key--send.is-down { background: var(--grad-brand); filter: brightness(1.15); }

/* Erfolgsmeldung */
.done { flex: 1; min-height: 0; display: grid; place-items: center; }
.done__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 42rem;
    padding: 3rem 3.5rem;
    border-radius: var(--radius-xl);
    text-align: center;
}
.done__check {
    display: grid;
    place-items: center;
    width: 8rem;
    height: 8rem;
    margin-bottom: 0.6rem;
    border-radius: 50%;
    color: #fff;
    background: var(--grad-ok);
    box-shadow: 0 0 0 0.8rem rgba(47, 214, 123, 0.15), 0 20px 60px -10px rgba(47, 214, 123, 0.6);
    animation: pop 0.6s var(--ease-out) both;
}
.done__check .icon { width: 4.2rem; height: 4.2rem; stroke-width: 2.6; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 0.5s 0.3s var(--ease-out) forwards; }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done__card h2 { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.02em; }
.done__card p { font-size: 1.3rem; color: var(--muted); line-height: 1.45; }
.done__product { color: var(--text); font-weight: 700; }
.done__actions { display: flex; gap: 1rem; margin-top: 1rem; }
.done__hint { font-size: 1.05rem !important; color: var(--faint) !important; }

/* ==========================================================================
   Hilfe bei Störung
   ========================================================================== */

.help {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: calc(var(--gap) * 1.3);
    align-items: center;
}
.help__info { display: flex; flex-direction: column; gap: 1rem; min-height: 0; }

.status {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font-size: 1.1rem;
    font-weight: 650;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #15803d;
    line-height: 1.25;
}
.status__dot { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: ping 1.8s ease-out infinite; }
@keyframes ping { 70%, 100% { box-shadow: 0 0 0 0.6rem transparent; } }
.status.is-off { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.45); color: #b45309; }
.status.is-off .status__dot { animation: none; }

.help__info h2 { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }

.help__alert {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(255, 59, 59, 0.12), rgba(255, 122, 28, 0.08));
    border: 1px solid rgba(255, 90, 60, 0.45);
}
.help__alert-icon { flex: none; display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 1rem; color: #fff; background: linear-gradient(135deg, #ff3b3b, #ff7a1c); animation: alarm 2.4s ease-in-out infinite; }
.help__alert-icon .icon { width: 1.8rem; height: 1.8rem; }
@keyframes alarm { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(-12deg); } 88% { transform: rotate(12deg); } 92% { transform: rotate(-8deg); } 96% { transform: rotate(8deg); } }
.help__alert p { font-size: 1.15rem; line-height: 1.35; }
.help__alert strong { font-size: 1.2rem; }

.needs h3 { margin-bottom: 0.6rem; font-size: 1.15rem; font-weight: 700; color: var(--muted); }
.needs__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.need { display: flex; align-items: center; gap: 0.9rem; padding: 0.8rem 1rem; border-radius: var(--radius-md); }
.need__icon { flex: none; display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 0.9rem; color: #fff; background: var(--grad-brand); }
.need__icon .icon { width: 1.5rem; height: 1.5rem; }
.need__text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.need__text strong { font-size: 1.12rem; font-weight: 700; }
.need__text em { font-size: 0.95rem; font-style: normal; color: var(--muted); }
.need__text em b { color: var(--text); }
.need__tag { display: inline-block; margin-inline-start: 0.3rem; padding: 0.1rem 0.5rem; border-radius: 99px; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; vertical-align: 0.12em; color: #fff; background: var(--red); }
.need--key { border-color: rgba(255, 59, 59, 0.5); background: rgba(255, 59, 59, 0.06); }
.need--key .need__icon { background: linear-gradient(135deg, #ff3b3b, #ff7a1c); }

.help__extra { display: flex; align-items: center; gap: 1rem; padding: 0.85rem 1.1rem; border-radius: var(--radius-md); }
.help__extra-icons { flex: none; display: flex; gap: 0.35rem; color: #6366f1; }
.help__extra-icons .icon { width: 1.6rem; height: 1.6rem; }
.help__extra p { font-size: 1.02rem; line-height: 1.35; color: var(--muted); }
.help__extra strong { color: var(--text); }

.help__note { display: flex; align-items: center; gap: 0.7rem; font-size: 0.98rem; line-height: 1.35; color: var(--muted); }
.help__note .icon { width: 1.6rem; height: 1.6rem; color: var(--green); }

.help__qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.6rem;
    border-radius: var(--radius-xl);
    text-align: center;
    max-height: 100%;
}
.qr {
    flex: none;
    width: min(100%, 15rem, 30dvh);
    aspect-ratio: 1;
    padding: 1rem;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: 0 0 0 1px rgba(20, 22, 28, 0.08), 0 24px 60px -20px rgba(20, 22, 28, 0.35);
}
.qr img { width: 100%; height: 100%; object-fit: contain; }
.help__qr-text { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; width: 100%; }
.help__scan { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 1.15rem; font-weight: 650; }
.help__scan .icon { width: 1.5rem; height: 1.5rem; color: var(--brand); }
.help__phone { display: inline-flex; align-items: center; gap: 0.7rem; font-size: 1.6rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.help__phone .icon { width: 1.4rem; height: 1.4rem; color: var(--green); }

.hours-box { width: 100%; padding: 0.9rem 1rem; border-radius: var(--radius-md); background: #f6f7f9; border: 1px solid var(--line); text-align: start; }
.hours-box__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; font-size: 1rem; color: var(--muted); }
.hours-box__row .icon { width: 1.4rem; height: 1.4rem; color: var(--brand); }
.hours-box__row strong { flex-basis: 100%; font-size: 1.25rem; font-weight: 750; color: var(--text); font-variant-numeric: tabular-nums; }
.hours-box p { margin-top: 0.4rem; font-size: 0.95rem; line-height: 1.35; color: var(--muted); }
.hours-box p b { color: var(--text); }

.help__video { width: 100%; }

/* ==========================================================================
   Hinweis bei Inaktivität
   ========================================================================== */

/* Copyright im unteren Rand (liegt im Innenabstand der Seite, verdeckt nichts) */
.copyright {
    position: fixed;
    left: 0;
    right: 0;
    bottom: env(safe-area-inset-bottom);
    z-index: 10;
    height: var(--pad);
    display: grid;
    place-items: center;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    color: var(--faint);
    pointer-events: none;
}

.idle-toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--pad) + env(safe-area-inset-bottom));
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 0.9rem 0.9rem 0.9rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line-strong);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(20, 22, 28, 0.25);
    transform: translateX(-50%);
    animation: toast-in 0.35s var(--ease-out) both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 1.5rem); } }
.idle-toast__ring { position: relative; width: 3.4rem; height: 3.4rem; display: grid; place-items: center; font-size: 1.3rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.idle-toast__ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.idle-toast__ring circle { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 97.4; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
.idle-toast__text { display: flex; flex-direction: column; gap: 0.15rem; }
.idle-toast__text strong { font-size: 1.2rem; }
.idle-toast__text span { font-size: 1rem; color: var(--muted); }

/* ==========================================================================
   Arabisch (von rechts nach links)
   ========================================================================== */

/* Buchstabenabstand zerreißt die verbundene arabische Schrift */
:lang(ar) { letter-spacing: 0 !important; }
html[lang="ar"] body { line-height: 1.3; }
/* Pfeile zeigen in Leserichtung */
[dir="rtl"] .btn--back .icon, [dir="rtl"] .tile__go .icon { transform: scaleX(-1); }
[dir="rtl"] .tap-demo { right: auto; left: 3.3rem; }
/* Tastatur und Abspielleiste wie in allen anderen Sprachen */
[dir="rtl"] .kb, [dir="rtl"] .player__bar { direction: ltr; }
[dir="rtl"] .help__phone { direction: ltr; }

/* ==========================================================================
   Hochformat-Bildschirme
   ========================================================================== */

@media (orientation: portrait) {
    html { font-size: clamp(14px, min(1.9vw, 1.25vh), 30px); }

    .home {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto minmax(0, 1fr) auto;
        grid-template-areas: "head" "hello" "media" "tiles";
    }
    .home__media {
        justify-self: center;
        height: 100%;
        width: auto;
        max-width: 100%;
        aspect-ratio: 3 / 4;
    }
    .tiles { grid-template-rows: repeat(3, 7.5rem); }

    .help { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; align-items: start; gap: 1.4rem; }
    .help__qr { order: -1; flex-direction: row; align-items: center; gap: 1.6rem; padding: 1.4rem; text-align: start; }
    .qr { width: min(17rem, 38vw, 24dvh); }
    .help__qr-text { align-items: flex-start; }

    /* Tastatur unten (gut erreichbar), freie Fläche oben für einen Hinweis */
    .suggest { justify-content: flex-end; }
    .suggest__hero {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        text-align: center;
    }
    .suggest__icon {
        display: grid;
        place-items: center;
        width: 8rem;
        height: 8rem;
        margin-bottom: 0.6rem;
        border-radius: 2.2rem;
        color: #fff;
        background: var(--grad-idea);
        box-shadow: 0 20px 60px -15px rgba(99, 102, 241, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    .suggest__icon .icon { width: 4rem; height: 4rem; }
    .suggest__hero h2 { font-size: 2.8rem; font-weight: 800; letter-spacing: -0.02em; }
    .suggest__hero p { max-width: 28rem; font-size: 1.35rem; color: var(--muted); line-height: 1.4; }
    .kb { flex: none; }
    .kb__row { flex: none; height: 6.6rem; max-height: none; }
    /* Tasten sind hier schmaler: Beschriftung von Löschen & Co. etwas kleiner */
    .key--fn { font-size: 1.1rem; }
    .key--fn span { margin-inline-start: 0.35rem; }

    .topbar__title h1 { font-size: 2rem; }
}

/* Schmale Bildschirme (z. B. Handy) */
@media (max-width: 760px) {
    :root { --pad: 1rem; --gap: 1rem; }
    .btn--back span, .topbar__logo { display: none; }
    .topbar { grid-template-columns: auto 1fr auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
