/* Notenarchiv Musikverein Henglarn – Farben aus dem Vereinslogo */

:root {
    --blau: #1f3a66;
    --blau-dunkel: #152a4c;
    --silber: #c9ced6;
    --grund: #f2f4f8;
    --flaeche: #ffffff;
    --text: #1b2333;
    --text-leise: #5d6779;
    --rand: #dde2ea;
    --akzent: #1f3a66;
    --akzent-text: #ffffff;
    --chip: #e8ecf3;
    --warnung: #9a4a05;
    --warnung-grund: #fdf0d5;
    --offen: #5b4a00;
    --offen-grund: #f3eec8;
    --ok: #17602f;
    --ok-grund: #ddf3e3;
    --fehler: #a61b1b;
    --fehler-grund: #fde3e3;
    --youtube: #c4302b;
    --radius: 12px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --grund: #0f1726;
        --flaeche: #18233a;
        --text: #e7ebf2;
        --text-leise: #9aa6ba;
        --rand: #2a3854;
        --akzent: #8fb0e6;
        --akzent-text: #0f1726;
        --chip: #24324d;
        --warnung: #f7c37a;
        --warnung-grund: #3d2a0f;
        --offen: #e9dc8f;
        --offen-grund: #37331a;
        --ok: #8fdca6;
        --ok-grund: #173623;
        --fehler: #ff9b9b;
        --fehler-grund: #3d1717;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--grund);
    color: var(--text);
    font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--akzent); }
h1 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
code { font-size: .85em; word-break: break-all; }

.symbol { width: 1.2em; height: 1.2em; vertical-align: -.2em; flex: none; }

/* Kopfzeile */
.kopf {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .5rem 16px;
    padding-top: max(.5rem, env(safe-area-inset-top));
    background: var(--blau);
    color: #fff;
    box-shadow: 0 2px 6px rgb(0 0 0 / .2);
}
.marke { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; }
.marke img { display: block; }
.marke span { display: flex; flex-direction: column; line-height: 1.15; }
.marke small { color: var(--silber); font-size: .78rem; }

.kopf-rechts { display: flex; align-items: center; gap: .3rem; }
.kopf-knopf { display: flex; padding: .45rem; border-radius: 8px; color: #fff; }
.kopf-knopf .symbol { width: 1.6rem; height: 1.6rem; }
.kopf-knopf:hover { background: var(--blau-dunkel); }

.anmelden {
    color: #fff;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    padding: .45rem .8rem;
    border: 1px solid rgb(255 255 255 / .35);
    border-radius: 8px;
}
.anmelden:hover { background: var(--blau-dunkel); }

.menue { position: relative; }
.menue summary {
    list-style: none;
    cursor: pointer;
    padding: .45rem;
    border-radius: 8px;
    display: flex;
}
.menue summary::-webkit-details-marker { display: none; }
.menue summary .symbol { width: 1.6rem; height: 1.6rem; }
.menue summary:hover, .menue[open] summary { background: var(--blau-dunkel); }
.menue nav {
    position: absolute;
    right: 0;
    top: calc(100% + .4rem);
    min-width: 220px;
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgb(0 0 0 / .18);
    padding: .4rem;
    display: flex;
    flex-direction: column;
}
.menue nav a, .menue nav button {
    display: block;
    width: 100%;
    padding: .7rem .8rem;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--text);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.menue nav a:hover, .menue nav button:hover { background: var(--chip); }
.menue nav form { margin: 0; border-top: 1px solid var(--rand); margin-top: .3rem; padding-top: .3rem; }
.menue-name { margin: .3rem .8rem .4rem; font-size: .85rem; color: var(--text-leise); }

/* Inhalt */
.inhalt {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
}

.karte {
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 1.1rem;
    margin-bottom: 1rem;
}
.schmal { max-width: 420px; margin: 1.5rem auto; }
.leise { color: var(--text-leise); font-size: .9rem; }
.hinweis { text-align: center; color: var(--text-leise); padding: 2rem 0; }

.meldung { border-radius: var(--radius); padding: .75rem 1rem; margin: 0 0 1rem; background: var(--ok-grund); color: var(--ok); }
.meldung-fehler { background: var(--fehler-grund); color: var(--fehler); }
.meldung-hinweis { background: var(--chip); color: var(--text); }
ul.meldung { padding-left: 2rem; }

/* Knöpfe */
.knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 44px;
    padding: .55rem 1.1rem;
    border: 1px solid var(--rand);
    border-radius: 10px;
    background: var(--flaeche);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.knopf:hover { border-color: var(--akzent); }
.knopf-haupt { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.knopf-gefahr { background: var(--youtube); border-color: var(--youtube); color: #fff; }
.knopf-gefahr:hover { border-color: var(--youtube); filter: brightness(1.08); }
.knopf-youtube { width: 100%; background: var(--youtube); border-color: var(--youtube); color: #fff; font-size: 1.05rem; margin: .5rem 0 1rem; }
.knopf-youtube:hover { border-color: var(--youtube); filter: brightness(1.08); }

.aktionen { display: flex; flex-wrap: wrap; gap: .6rem; }
.aktionen form { margin: 0; }

.zurueck { display: inline-flex; align-items: center; gap: .2rem; margin-bottom: .8rem; text-decoration: none; font-weight: 600; }

/* Formulare */
.formular { display: flex; flex-direction: column; gap: .9rem; }
.formular p, .formular h1, .formular h2 { margin: 0; }
.formular label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .92rem; }
.formular label small { font-weight: 400; color: var(--text-leise); }
input, select, textarea {
    width: 100%;
    min-height: 44px;
    padding: .55rem .7rem;
    border: 1px solid var(--rand);
    border-radius: 10px;
    background: var(--flaeche);
    color: var(--text);
    font: inherit;
    font-weight: 400;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: 1px; }
input[type="radio"] { width: auto; min-height: 0; }
input[type="file"] { padding: .45rem; }
textarea { resize: vertical; }

.feld { display: flex; flex-direction: column; gap: .4rem; }
.zweispaltig { display: grid; gap: .9rem; }
@media (min-width: 560px) { .zweispaltig { grid-template-columns: 1fr 1fr; } }

.optionen { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.optionen legend { font-weight: 600; font-size: .92rem; margin-bottom: .4rem; padding: 0; }
.optionen label { flex-direction: row; align-items: center; gap: .4rem; font-weight: 400; font-size: 1rem; }
.feld-hilfe { margin: -.5rem 0 0; font-size: .9rem; }
.feld-hilfe summary { cursor: pointer; color: var(--akzent); }
.feld-hilfe ol { padding-left: 1.3rem; }
.feld-hilfe textarea { width: 100%; margin-bottom: .5rem; font: .8rem/1.4 ui-monospace, Consolas, monospace; }

/* Suche und Filter */
.suche { margin-bottom: .5rem; }
.suche input[type="search"] { font-size: 1.05rem; min-height: 48px; }
.filter { margin: .5rem 0 0; }
.filter summary { cursor: pointer; color: var(--akzent); font-weight: 600; padding: .3rem 0; }
.filter-felder { display: grid; gap: .5rem; margin-top: .4rem; }
@media (min-width: 560px) { .filter-felder { grid-template-columns: 1fr 1fr; } }
.filter-zuruecksetzen { align-self: center; font-size: .9rem; }

.anzahl { color: var(--text-leise); font-size: .9rem; margin: .8rem 0 .5rem; }

/* Liste der Stücke */
.liste { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .5rem; }
.eintrag {
    display: flex;
    align-items: stretch;
    background: var(--flaeche);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    overflow: hidden;
}
.eintrag-link {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .8rem 1rem;
    color: inherit;
    text-decoration: none;
}
a.eintrag-link:hover { background: var(--grund); }
.eintrag-titel { font-weight: 700; font-size: 1.05rem; }
.eintrag-unter { color: var(--text-leise); font-size: .9rem; }
.eintrag-fehler { color: var(--fehler); font-size: .9rem; }
.eintrag-fehler::before { content: "⚠ "; }
.eintrag-fehler, .eintrag-doppelt { opacity: .85; }

.abspielen {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    flex: none;
    color: var(--youtube);
    border-left: 1px solid var(--rand);
}
.abspielen .symbol { box-sizing: border-box; width: 2.5rem; height: 1.75rem; padding: .3rem; border-radius: .5rem; background: var(--youtube); color: #fff; }
.abspielen:hover { background: var(--grund); }
.abspielen:hover .symbol { filter: brightness(1.08); }

.chips { display: flex; flex-wrap: wrap; gap: .3rem; margin: .25rem 0 0; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .1rem .55rem;
    border-radius: 999px;
    background: var(--chip);
    font-size: .8rem;
    white-space: nowrap;
}
.chip .symbol { width: .95em; height: .95em; }
.chip-warnung, .chip-fehler { background: var(--warnung-grund); color: var(--warnung); }
.chip-offen, .chip-vorhanden, .chip-doppelt { background: var(--offen-grund); color: var(--offen); }
.chip-ok, .chip-neu { background: var(--ok-grund); color: var(--ok); }

/* Detailansicht */
.detail h1 { margin-bottom: .3rem; }
.eigenschaften { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; }
.eigenschaften dt { color: var(--text-leise); }
.eigenschaften dd { margin: 0; font-weight: 600; }
.notizen { white-space: normal; margin: 0; }
.pruefung { margin: 1rem 0 0; padding-top: .8rem; border-top: 1px solid var(--rand); color: var(--text-leise); }
.pruefung strong { color: var(--text); }

/* Änderungsverlauf */
.verlauf-karte { margin-top: 1rem; }
.verlauf-karte h2 { margin-top: 0; }
.verlauf { list-style: none; margin: 0; padding: 0; }
.verlauf > li { padding: .7rem 0; border-top: 1px solid var(--rand); }
.verlauf > li:first-child { border-top: 0; padding-top: 0; }
.verlauf p { margin: 0; }
.verlauf-zeit { color: var(--text-leise); font-size: .85rem; }
.verlauf-felder { margin: .35rem 0 0; padding-left: 1.1rem; font-size: .92rem; }
.verlauf del { color: var(--text-leise); }
.verlauf ins { text-decoration: none; font-weight: 600; }

/* Benutzerverwaltung */
.benutzer summary { cursor: pointer; display: flex; flex-direction: column; gap: .2rem; list-style: none; }
.benutzer summary::-webkit-details-marker { display: none; }
.benutzer[open] summary { margin-bottom: .8rem; }
.benutzer form { margin-bottom: 1rem; padding-top: .8rem; border-top: 1px solid var(--rand); }

/* Schwebender Knopf zum Anlegen */
.neu-knopf {
    position: fixed;
    right: max(16px, calc(50vw - 380px + 16px));
    bottom: calc(20px + env(safe-area-inset-bottom));
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blau);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 6px 16px rgb(0 0 0 / .28);
}
.neu-knopf .symbol { width: 28px; height: 28px; stroke-width: 2.5; }
.foto-fab { bottom: calc(90px + env(safe-area-inset-bottom)); width: 48px; height: 48px; right: max(21px, calc(50vw - 380px + 21px)); }
.foto-fab .symbol { width: 24px; height: 24px; stroke-width: 2; }
.foto-fab { cursor: pointer; }
.foto-fab input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Cover scannen */
.scan { display: flex; flex-direction: column; gap: .7rem; padding: .9rem; border: 1px dashed var(--rand); border-radius: var(--radius); }
.scan p { margin: 0; }
.formular .foto-knopf { position: relative; flex-direction: row; min-height: 52px; font-size: 1.05rem; color: var(--akzent-text); }
.foto-knopf input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.foto-vorschau { width: 100%; max-height: 40vh; object-fit: contain; border-radius: var(--radius); background: var(--grund); }
.scan-status { font-size: .92rem; color: var(--text-leise); }
.scan-status.fehler { color: var(--fehler); }
.treffer button {
    font: inherit; font-size: .9rem; text-align: left; cursor: pointer;
    border: 1px solid var(--rand); border-radius: 8px; background: var(--grund); color: var(--text); padding: .35rem .6rem;
}
.treffer button:hover, .treffer button.gewaehlt { border-color: var(--akzent); }
.anleitung { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .3rem; }
.feld-markiert { outline: 2px solid var(--ok); outline-offset: 1px; }

/* YouTube-Treffer */
.treffer { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.treffer li { display: flex; gap: .4rem; align-items: stretch; }
.treffer button { flex: 1; display: flex; flex-direction: column; gap: .1rem; }
.treffer small { color: var(--text-leise); }
.treffer a { display: flex; align-items: center; padding: 0 .6rem; color: var(--youtube); border: 1px solid var(--rand); border-radius: 8px; }

/* Import-Vorschau: Gruppen */
.import-gruppe { font-size: 1rem; margin: 1.2rem 0 .5rem; }
