/*
 * Namensschild-Gestalter (requirements/namensschild-gestalter.md)
 *
 * Eigenstaendig, ohne Abhaengigkeit vom Bootstrap-Stylesheet: dieselbe Datei
 * gestaltet das Inhaltselement auf der Website und die App-Ansicht
 * (Seitentyp 1761900003). Das Raster entspricht der gedruckten Seite
 * (Positionen in Prozent der Seite); auf dem Smartphone steht ein Schild je
 * Zeile (Festlegung 9).
 */
.sks-ns {
    --sks-ns-grau: #4e5458;
    --sks-ns-rot: #c4122f;
    --sks-ns-ausrichtung: center;
}

.sks-ns__einstellungen {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: .75rem 1rem;
    margin-bottom: 1rem;
}

.sks-ns__gruppe {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.sks-ns__gruppe[hidden] {
    display: none;
}

.sks-ns__gruppe--breit {
    grid-column: 1 / -1;
}

.sks-ns__beschriftung,
.sks-ns__gruppe legend {
    font-weight: 600;
    font-size: .95rem;
    padding: 0;
    margin-bottom: .25rem;
}

.sks-ns__eingabe {
    box-sizing: border-box;
    width: 100%;
    padding: .4rem .6rem;
    font: inherit;
    color: #212529;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: .375rem;
}

.sks-ns__eingabe:disabled {
    background: #e9ecef;
}

.sks-ns__raender {
    display: grid;
    grid-template-columns: repeat(4, minmax(4.5rem, 1fr));
    gap: .5rem;
}

.sks-ns__raender label {
    display: flex;
    flex-direction: column;
    font-size: .85rem;
}

.sks-ns__gruppe.sks-ns__haken {
    flex-direction: row;
    align-items: center;
    align-self: end;
    gap: .5rem;
    min-height: 2.4rem;
    font-weight: 600;
}

.sks-ns__aktionen {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1.25rem;
    margin: 1rem 0;
}

.sks-ns__knopf {
    padding: .6rem 1.4rem;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: var(--sks-ns-grau);
    border: 0;
    border-radius: .375rem;
    cursor: pointer;
}

.sks-ns__knopf:disabled {
    opacity: .5;
    cursor: default;
}

.sks-ns__info {
    color: var(--sks-ns-grau);
}

.sks-ns__meldung {
    margin: 0;
    font-weight: 600;
    color: #8f0d22;
}

.sks-ns__meldung.is-leer {
    display: none;
}

/* Raster: eine Seite je Block, Seitenverhaeltnis wie das Papier */
.sks-ns__seitentitel {
    margin: 1.25rem 0 .4rem;
    font-size: .9rem;
    color: var(--sks-ns-grau);
}

.sks-ns__seite {
    position: relative;
    width: 100%;
    max-width: 52rem;
    background: #fff;
    box-shadow: 0 0 0 1px #ced4da, 0 .25rem .75rem rgba(0, 0, 0, .08);
}

.sks-ns__schild {
    position: absolute;
    box-sizing: border-box;
    outline: 1px solid #b5b8bb;
    background: #fff;
}

.sks-ns__feld {
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #000;
    font-family: inherit;
    line-height: 1;
    text-align: var(--sks-ns-ausrichtung);
    resize: none;
    overflow: hidden;
}

/* Mehrzeilige Schilder: Zeilenabstand und senkrechte Mitte setzt das Skript */
textarea.sks-ns__feld {
    white-space: pre;
    overflow: hidden;
}

.sks-ns__feld:focus {
    outline: 2px solid var(--sks-ns-grau);
    outline-offset: -2px;
    background: #f3f4f5;
}

/* Zu langer Text (Festlegung 11): rot markiert, wird in der PDF abgeschnitten */
.sks-ns__feld.is-zu-lang {
    background: #fbe3e7;
    box-shadow: inset 0 0 0 2px var(--sks-ns-rot);
}

/* Smartphone: ein Schild je Zeile, die PDF bleibt unveraendert */
@media (max-width: 767.98px) {
    .sks-ns__seite {
        aspect-ratio: auto !important;
        display: flex;
        flex-direction: column;
        gap: .5rem;
        padding: .5rem;
        box-shadow: none;
        background: transparent;
    }

    .sks-ns__schild {
        position: static;
        width: 100% !important;
        height: auto !important;
        aspect-ratio: var(--sks-ns-seitenverhaeltnis);
    }

    .sks-ns__raender {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Installationshinweis (nur auf der Website) */
.sks-ns-installation {
    margin-top: 2rem;
    max-width: 40rem;
}

/* App-Ansicht (Seitentyp 1761900003): nur das Werkzeug */
.sks-ns-app {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #212529;
    background: #fff;
}

.sks-ns-app__inhalt {
    box-sizing: border-box;
    max-width: 56rem;
    min-height: 100vh;
    margin: 0 auto;
    padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
}

.sks-ns-app__titel {
    margin: .5rem 0 1rem;
    font-size: 1.35rem;
}

.sks-ns-app__rechtliches {
    margin-top: auto;
    padding-top: 2rem;
    font-size: .85rem;
    text-align: center;
}

.sks-ns-app__rechtliches a {
    color: #4e5458;
    margin: 0 .5rem;
}
