/*
 * Einwilligungshinweis.
 *
 * Bewusst kein bildschirmfüllendes Sperrfenster: die Seite bleibt lesbar und
 * bedienbar. Ein Hinweis, der den Inhalt geiselt, bis man zustimmt, ist keine
 * freiwillige Entscheidung.
 */

.nippon-ew {
    position: fixed;
    left: max(16px, env(safe-area-inset-left));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 9500;

    width: min(30rem, calc(100vw - 32px));

    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.nippon-ew.ist-sichtbar {
    opacity: 1;
    transform: translateY(0);
}

.nippon-ew__karte {
    display: flex;
    gap: 14px;
    padding: 20px 22px 22px;
    border: 1px solid #e4e7e1;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 14px 44px rgba(22, 25, 26, 0.22);
}

.nippon-ew__sushi {
    flex: 0 0 auto;
    width: 68px;
    height: 55px;
    margin-top: 2px;
}

.nippon-ew__wort {
    min-width: 0;
}

.nippon-ew__titel {
    margin: 0 0 6px;
    font-size: 1.08rem;
    line-height: 1.3;
    color: #16191a;
}

.nippon-ew__text {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.6;
    color: #4a534c;
}

/* ---------- Kategorien ---------- */

.nippon-ew__liste {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid #e4e7e1;
}

.nippon-ew__kategorie {
    padding: 13px 0;
    border-bottom: 1px solid #e4e7e1;
}

.nippon-ew__schalter {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 700;
    color: #16191a;
}

.nippon-ew__schalter input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* Eigener Schalter, damit er in jedem Browser gleich aussieht. */
.nippon-ew__marke {
    flex: 0 0 auto;
    width: 40px;
    height: 23px;
    border-radius: 999px;
    background: #cdd4ce;
    transition: background 0.2s ease;
    position: relative;
}

.nippon-ew__marke::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.2s ease;
}

.nippon-ew__schalter input:checked + .nippon-ew__marke {
    background: #2e7d32;
}

.nippon-ew__schalter input:checked + .nippon-ew__marke::after {
    transform: translateX(17px);
}

/* Gesperrte Pflichtkategorie erkennbar machen, ohne sie zu verstecken. */
.nippon-ew__schalter input:disabled + .nippon-ew__marke {
    background: #9aa79c;
    cursor: not-allowed;
}

.nippon-ew__schalter input:focus-visible + .nippon-ew__marke {
    outline: 3px solid #2e7d32;
    outline-offset: 3px;
}

.nippon-ew__immer {
    margin-left: 8px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #6b746c;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nippon-ew__ktext {
    margin: 7px 0 0 50px;
    font-size: 0.84rem;
    line-height: 1.55;
    color: #6b746c;
}

/* ---------- Schaltflächen ---------- */

.nippon-ew__knoepfe {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 16px;
}

/* Zustimmen und Ablehnen sind gleich groß und gleich auffällig — sonst wäre
   die Wahl nicht frei. */
.nippon-ew__knopf {
    flex: 1 1 auto;
    min-width: 8.5rem;
    padding: 11px 18px;
    border-radius: 999px;
    border: 2px solid transparent;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.nippon-ew__knopf--voll {
    background: #2e7d32;
    color: #ffffff;
}

.nippon-ew__knopf--voll:hover {
    background: #1b5e20;
}

.nippon-ew__knopf--rand {
    background: #ffffff;
    border-color: #e4e7e1;
    color: #333a35;
}

.nippon-ew__knopf--rand:hover {
    border-color: #4caf50;
}

.nippon-ew__knopf:focus-visible {
    outline: 3px solid #2e7d32;
    outline-offset: 3px;
}

.nippon-ew__fein {
    margin: 12px 0 0;
    font-size: 0.8rem;
    color: #6b746c;
}

.nippon-ew__fein a {
    color: #2e7d32;
}

/* Verweis in der Fußzeile */
.nippon-ew__erneut {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 560px) {
    .nippon-ew {
        left: 10px;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        width: auto;
    }

    .nippon-ew__karte {
        padding: 16px 17px 18px;
        gap: 11px;
    }

    .nippon-ew__sushi {
        width: 50px;
        height: 40px;
    }

    /* Der Anrufknopf sitzt unten rechts; solange der Hinweis steht, weicht
       er nach oben aus, damit sich beide nicht überdecken. */
    .nippon-ew.ist-sichtbar ~ .nippon-ruf,
    body:has(.nippon-ew.ist-sichtbar) .nippon-ruf {
        bottom: auto;
        top: max(74px, env(safe-area-inset-top));
    }
}

/* Dunkelmodus — folgt der Systemeinstellung wie der Rest der Seite. */
@media (prefers-color-scheme: dark) {
    .nippon-ew__karte {
        border-color: #333a40;
        background: #1e2225;
        box-shadow: 0 14px 44px rgba(0, 0, 0, 0.6);
    }

    .nippon-ew__titel {
        color: #f2f5f3;
    }

    .nippon-ew__text {
        color: #cdd4cf;
    }

    .nippon-ew__liste,
    .nippon-ew__kategorie {
        border-color: #333a40;
    }

    .nippon-ew__schalter {
        color: #f2f5f3;
    }

    .nippon-ew__ktext,
    .nippon-ew__immer,
    .nippon-ew__fein {
        color: #a3aca6;
    }

    .nippon-ew__marke {
        background: #454d54;
    }

    .nippon-ew__marke::after {
        background: #e8ece9;
    }

    .nippon-ew__schalter input:checked + .nippon-ew__marke {
        background: #3f9a45;
    }

    .nippon-ew__schalter input:disabled + .nippon-ew__marke {
        background: #363d43;
    }

    .nippon-ew__knopf--voll {
        background: #3f9a45;
        color: #0e1a10;
    }

    .nippon-ew__knopf--voll:hover {
        background: #6fbf73;
    }

    .nippon-ew__knopf--rand {
        background: #1e2225;
        border-color: #333a40;
        color: #dfe3e0;
    }

    .nippon-ew__knopf--rand:hover {
        border-color: #6fbf73;
    }

    .nippon-ew__knopf:focus-visible,
    .nippon-ew__schalter input:focus-visible + .nippon-ew__marke {
        outline-color: #6fbf73;
    }

    .nippon-ew__fein a {
        color: #6fbf73;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nippon-ew,
    .nippon-ew__marke,
    .nippon-ew__marke::after {
        transition: none;
    }
}

@media (prefers-contrast: more) {
    .nippon-ew__karte {
        border-color: #16191a;
    }
}

@media print {
    .nippon-ew {
        display: none !important;
    }
}
