/* ============================================================================
   Unser Urlaub – Oberflaeche im Stil von iOS
   ----------------------------------------------------------------------------
   Systemfarben, gruppierte Listen mit Haarlinien, durchscheinende Tab-Leiste.
   Auf iPhones greift die Systemschrift (SF Pro), anderswo eine nahe Vertretung.
   ========================================================================== */

:root {
    /* Systemfarben, hell */
    --bg:            #f2f2f7;   /* gruppierter Hintergrund */
    --surface:       #ffffff;   /* Karten und Listen */
    --surface-alt:   #e5e5ea;   /* gefuellte Felder */
    --text:          #000000;
    --muted:         rgba(60, 60, 67, .6);
    --muted-2:       rgba(60, 60, 67, .3);
    --border:        rgba(60, 60, 67, .29);
    --primary:       #007aff;
    --primary-ink:   #ffffff;
    --primary-soft:  rgba(0, 122, 255, .1);
    --danger:        #ff3b30;
    --danger-soft:   rgba(255, 59, 48, .12);
    --success:       #34c759;
    --success-soft:  rgba(52, 199, 89, .14);
    --warn:          #ff9500;

    --radius:        12px;
    --radius-klein:  10px;
    --shadow:        none;
    --leiste:        rgba(249, 249, 249, .82);

    --schrift: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:           #000000;
        --surface:      #1c1c1e;
        --surface-alt:  #2c2c2e;
        --text:         #ffffff;
        --muted:        rgba(235, 235, 245, .6);
        --muted-2:      rgba(235, 235, 245, .3);
        --border:       rgba(84, 84, 88, .65);
        --primary:      #0a84ff;
        --primary-ink:  #ffffff;
        --primary-soft: rgba(10, 132, 255, .18);
        --danger:       #ff453a;
        --danger-soft:  rgba(255, 69, 58, .18);
        --success:      #30d158;
        --success-soft: rgba(48, 209, 88, .18);
        --warn:         #ff9f0a;
        --leiste:       rgba(28, 28, 30, .82);
    }
}

* { box-sizing: border-box; }

/* Muss vor den Komponenten stehen: display-Regeln aus Klassen wuerden das
   hidden-Attribut sonst ueberstimmen. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.45 var(--schrift);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -.01em;
}

a, button, label, select, summary,
.check-zeile, .photo-open, .cover-choice, .share-choice, .tile {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

a { color: var(--primary); }
small { color: var(--muted); }

/* ------------------------------------------------------------------ Layout */

.page {
    /*
     * width und min-width sind hier kein Beiwerk: Der Body ist eine Flex-Spalte,
     * und ein "margin: auto" auf der Querachse verhindert dort das Dehnen – die
     * Seite bekaeme sonst nur ihre Inhaltsbreite und koennte breiter werden als
     * der Bildschirm. Genau das fuehrte zum waagerechten Wischen.
     */
    width: 100%;
    min-width: 0;
    max-width: 620px;
    margin: 0 auto;
    padding: max(1rem, env(safe-area-inset-top)) 1rem 2rem;
}

/*
 * Die Leiste haengt nicht an "position: fixed": Auf iOS sitzt sie damit bei
 * kurzen, nicht scrollenden Seiten nicht zuverlaessig am unteren Rand – auf
 * der Startseite fiel das auf. Stattdessen ist der Body eine Spalte ueber die
 * volle Hoehe, der Inhalt dehnt sich, die Leiste ist schlicht das letzte
 * Element und klebt beim Scrollen unten fest.
 */
body.hat-tableiste {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
@supports (height: 100svh) {
    body.hat-tableiste { min-height: 100svh; }
}

body.hat-tableiste .page {
    flex: 1 0 auto;
    padding-bottom: 1.4rem;
}

/* ------------------------------------------------------------ Statusleiste */

/*
 * Deckt den Bereich der iOS-Statusleiste ab (Uhrzeit, Empfang, Akku).
 * Ohne das scrollt der Inhalt sichtbar dahinter durch – seit die Kopfzeile
 * weg ist, deckt ihn sonst nichts mehr ab. Hoehe 0, wo es keinen solchen
 * Bereich gibt, die Regel stoert dort also nicht.
 */
body::before {
    content: "";
    position: fixed; top: 0; left: 0; right: 0; z-index: 45;
    height: env(safe-area-inset-top, 0px);
    background: var(--leiste);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    pointer-events: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body::before { background: var(--surface); }
}

/* --------------------------------------------------------------- Tab-Leiste */

/*
 * Die Unschaerfe liegt auf einer Ebene darunter, nicht auf der Leiste selbst:
 * backdrop-filter auf einem fest positionierten Element bringt iOS aus dem
 * Tritt – die Leiste rutscht dann ein Stueck vom unteren Rand weg.
 */
.tableiste {
    position: sticky; bottom: 0; z-index: 40;
    flex: none;
    display: flex;
    /*
     * iOS meldet unten 34 Punkte Sicherheitsabstand fuer die Home-Anzeige.
     * Das komplett freizulassen wirkt in einer Web-App wie eine Luecke, weil
     * dahinter nichts durchscrollt. 20 Punkte davon nehmen wir zurueck – die
     * Home-Anzeige selbst braucht nur etwa ein Drittel des Bereichs.
     */
    padding-bottom: max(calc(env(safe-area-inset-bottom, 0px) - 20px), 0px);
    border-top: .5px solid var(--border);
    background: transparent;
    isolation: isolate;
}

.tableiste::before {
    content: "";
    position: absolute; inset: 0; z-index: -1;
    background: var(--leiste);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

/* Ohne Unschaerfe (aeltere Browser) muss die Leiste deckend sein,
   sonst scheint der Inhalt durch. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .tableiste::before { background: var(--surface); }
}

.tableiste a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .12rem;
    padding: .45rem 0 .35rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 10px; font-weight: 500; letter-spacing: 0;
    min-height: 49px;
}

.tableiste .icon { width: 25px; height: 25px; stroke-width: 1.7; }
.tableiste a.is-active { color: var(--primary); }
.tableiste a.is-active .icon { stroke-width: 2.1; }

/* ----------------------------------------------------------- Ueberschriften */

.page-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .8rem;
    margin: .2rem 0 1rem;
}
.page-head h1 { flex: 1; min-width: 0; }
.page-head > .hint { flex: none; }

h1 {
    margin: 0;
    font-size: 34px; font-weight: 700; line-height: 1.1;
    letter-spacing: -.025em;
}

h2 {
    margin: 0 0 .5rem;
    font-size: 17px; font-weight: 600; letter-spacing: -.01em;
}

h3 { margin: 0 0 .4rem; font-size: 15px; font-weight: 600; }

/* Zurueck-Verweis wie die Navigationsleiste in iOS: Winkel plus Ziel */
.breadcrumb { margin: 0 0 .5rem; font-size: 17px; }
.breadcrumb a {
    display: inline-flex; align-items: center; gap: .15rem;
    text-decoration: none;
    margin-left: -.2rem;
}
.breadcrumb .icon { width: 19px; height: 19px; stroke-width: 2.6; }

.hint {
    color: var(--muted);
    font-size: 13px; line-height: 1.38;
    margin: .35rem 0;
}

.notes { white-space: pre-wrap; margin: 0; font-size: 16px; }

/* -------------------------------------------------------- Gruppen (Karten) */

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    margin-bottom: 1.1rem;
    border: 0;
    box-shadow: var(--shadow);
}

.card > h2 {
    margin: -.9rem -1rem .6rem;
    padding: .8rem 1rem .55rem;
    border-bottom: .5px solid var(--border);
}

.card-danger > h2 { color: var(--danger); }

.empty {
    text-align: center;
    padding: 2.6rem 1.2rem;
    background: var(--surface);
    border-radius: var(--radius);
}
.empty-title { font-weight: 600; margin: 0 0 .3rem; font-size: 17px; }
.empty .btn { margin-top: 1rem; }

/* Hinweisstreifen ganz oben */
.banner {
    display: flex; align-items: center; gap: .6rem;
    padding: .8rem 1rem;
    margin-bottom: 1rem;
    background: var(--danger-soft);
    color: var(--danger);
    border-radius: var(--radius-klein);
    text-decoration: none;
    font-size: 15px; font-weight: 500;
}
.banner span { flex: 1; }
.banner .icon:last-child { color: var(--muted); }

/* ------------------------------------------------------------------ Listen */

.mini-list, .status-list, .doc-list, .check-list, .expense-list,
.music-list, .land-liste, .file-list, .balance-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mini-list li, .status-list li, .doc-list li, .check-list li,
.expense-list li, .land-liste li, .balance-list li {
    display: flex; align-items: center; justify-content: space-between;
    gap: .8rem;
    padding: .65rem 0;
    border-bottom: .5px solid var(--border);
    font-size: 16px;
}

.mini-list li:last-child, .status-list li:last-child, .doc-list li:last-child,
.check-list li:last-child, .expense-list li:last-child,
.land-liste li:last-child, .balance-list li:last-child { border-bottom: 0; }

.music-list li { padding: .8rem 0; border-bottom: .5px solid var(--border); }
.music-list li:last-child { border-bottom: 0; }

.status-list li { font-size: 15px; flex-wrap: wrap; }
.status-list code, .file-list code { font-size: 13px; word-break: break-all; }
.file-list li { flex-wrap: wrap; }

.status-ok  { color: var(--success); font-weight: 600; font-size: 13px; }
.status-bad { color: var(--danger);  font-weight: 600; font-size: 13px; }

.tag {
    flex: none;
    background: var(--surface-alt); color: var(--muted);
    font-size: 12px; font-weight: 600;
    padding: .15rem .5rem; border-radius: 99px;
}

.with-icon { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }

/* --------------------------------------------------------------- Formulare */

.stack { display: grid; gap: .85rem; }
.stack > h2 { margin: -.9rem -1rem .1rem; }

.row { display: grid; gap: .85rem; grid-template-columns: 1fr; }
@media (min-width: 520px) { .row { grid-template-columns: 1fr 1fr; } }

label {
    display: grid; gap: .3rem;
    font-size: 13px; font-weight: 500; color: var(--muted);
    letter-spacing: 0;
}

input, textarea, select {
    font: inherit; font-size: 17px;
    color: var(--text);
    background: var(--surface-alt);
    border: 0;
    border-radius: var(--radius-klein);
    padding: .7rem .8rem;
    width: 100%;
    min-height: 44px;
    letter-spacing: -.01em;
    -webkit-appearance: none;
    appearance: none;
}

select {
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                      linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 2.2rem;
}

input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
}

textarea { resize: vertical; min-height: 90px; }
input[type="file"] { padding: .55rem; font-size: 15px; }

/* ---------------------------------------------------------------- Knoepfe */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    font: inherit; font-size: 17px; font-weight: 500;
    letter-spacing: -.01em;
    padding: .7rem 1.1rem;
    min-height: 44px;
    border-radius: var(--radius-klein);
    border: 0;
    background: var(--surface-alt);
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn:active { opacity: .6; }

.btn-primary { background: var(--primary); color: var(--primary-ink); font-weight: 600; }
.btn-danger  { background: var(--danger);  color: #fff; font-weight: 600; }
.btn-block   { width: 100%; }

/* Runder Knopf neben dem grossen Titel – so bricht die Ueberschrift nicht um */
.btn-rund {
    width: 40px; min-width: 40px; height: 40px; min-height: 40px;
    padding: 0; border-radius: 99px;
}
.btn-rund .icon { width: 22px; height: 22px; stroke-width: 2.2; }
.btn-gross   { padding: 1rem; font-size: 17px; font-weight: 600; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn .icon { width: 19px; height: 19px; }

.linkish {
    background: none; border: 0; padding: 0;
    min-height: 44px; display: inline-flex; align-items: center;
    font: inherit; font-size: 17px; color: var(--primary); cursor: pointer;
}

.icon-btn {
    background: none; border: 0; cursor: pointer;
    color: var(--muted-2);
    min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border-radius: 99px;
}
.icon-btn:active { color: var(--danger); }

.inline { display: inline; }

/* ------------------------------------------------------------------ Icons */

.icon {
    width: 1.15em; height: 1.15em;
    flex: none;
    vertical-align: -.18em;
    stroke-width: 1.8;
}
.icon-sprite { display: none; }

/* --------------------------------------------------------------- Meldungen */

.alert {
    border-radius: var(--radius-klein);
    padding: .75rem .9rem;
    margin: 0 0 .9rem;
    font-size: 15px;
    background: var(--surface);
}
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error   { background: var(--danger-soft);  color: var(--danger); }
.alert-info    { background: var(--primary-soft); color: var(--primary); }

/* -------------------------------------------------------------- Anmeldung */

.auth-body { background: var(--bg); }
.auth-body .page { display: grid; place-items: center; min-height: 100vh; }
@supports (height: 100svh) {
    .auth-body .page { min-height: 100svh; }
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.6rem 1.3rem;
    width: 100%; max-width: 380px;
    margin: 2rem auto;
}
.auth-card h1 { font-size: 28px; margin-bottom: .3rem; }
.auth-card .btn { margin-top: .3rem; }

/* ------------------------------------------------------------- Reiseliste */

.trip-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }

.trip-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
}
.trip-card > a { display: block; color: inherit; text-decoration: none; }
.trip-card:active { opacity: .75; }

.trip-cover {
    position: relative;
    aspect-ratio: 16 / 7;
    background: var(--hero, var(--surface-alt));
}
.trip-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.trip-initials {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    font-size: 2.4rem; font-weight: 800; letter-spacing: .06em;
    color: rgba(255, 255, 255, .5);
}

.trip-past .trip-cover img { filter: saturate(.72); }

.badge {
    position: absolute; left: .7rem; bottom: .7rem;
    background: rgba(0, 0, 0, .55); color: #fff;
    font-size: 12px; font-weight: 600;
    padding: .25rem .6rem; border-radius: 99px;
    backdrop-filter: blur(6px);
}
.badge-live { background: var(--success); }

.trip-body { padding: .8rem 1rem 1rem; }
.trip-body h2 { margin: 0 0 .2rem; font-size: 20px; font-weight: 600; }

.trip-meta {
    display: flex; flex-wrap: wrap; gap: .45rem;
    margin: 0; color: var(--muted); font-size: 15px;
}
.trip-meta span + span::before { content: "·"; padding-right: .45rem; }

.trip-counts {
    display: flex; align-items: center; gap: .35rem;
    margin: .45rem 0 0; font-size: 13px; color: var(--muted);
}
.trip-counts .icon + .icon { margin-left: .7rem; }

/* -------------------------------------------------------------- Hero-Kopf */

.hero {
    position: relative;
    margin: calc(-1 * max(1rem, env(safe-area-inset-top))) -1rem 1.1rem;
    min-height: 280px;
    display: flex; align-items: flex-end;
    background: var(--hero, var(--surface-alt));
    background-size: cover; background-position: center;
    color: #fff;
    isolation: isolate;
    overflow: hidden;
}
.hero-photo { background-image: var(--hero); }

.hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(to top, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .12) 55%, rgba(0, 0, 0, .3) 100%);
}

.hero-initials {
    position: absolute; inset: 0; z-index: -2;
    display: grid; place-items: center;
    font-size: 6rem; font-weight: 800; letter-spacing: .05em;
    color: rgba(255, 255, 255, .22);
}

.hero-leiste {
    position: absolute; z-index: 2;
    top: calc(env(safe-area-inset-top, 0px) + .9rem);
    left: 1rem; right: 1rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: .5rem;
}
.hero-gruppe { display: flex; align-items: center; gap: .5rem; }

.hero-knopf {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px;
    padding: 0 .3rem;
    background: rgba(0, 0, 0, .35);
    color: #fff; text-decoration: none;
    border-radius: 99px;
    backdrop-filter: blur(12px);
    font-size: 15px; font-weight: 500;
    white-space: nowrap;
}
.hero-knopf-text { padding: 0 .9rem; }

.hero-body { padding: 1.2rem 1rem; width: 100%; }
.hero-body h1 { color: #fff; margin: .4rem 0 .3rem; font-size: 30px; }

.hero-meta {
    display: flex; flex-wrap: wrap; gap: .25rem 1rem;
    margin: 0; font-size: 15px; color: rgba(255, 255, 255, .92);
}
.hero-meta span { display: inline-flex; align-items: center; gap: .35rem; }

.hero .badge { position: static; display: inline-flex; margin-bottom: .1rem; }

.credit { margin: -.5rem 0 .9rem; font-size: 12px; }
.credit a { color: var(--muted); text-decoration: none; }

.map-link { margin: -.2rem 0 1rem; }
.map-link a { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; }

/* --------------------------------------------------------------- Kacheln */

/* Passt sich der Breite an: drei Spalten auf grossen Geraeten, zwei auf kleinen */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(102px, 1fr));
    gap: .6rem;
    margin-bottom: 1.1rem;
}

.tile {
    display: grid; gap: .05rem; align-content: start;
    background: var(--surface);
    border-radius: var(--radius);
    padding: .7rem .75rem .8rem;
    text-decoration: none; color: inherit;
    min-width: 0;
}
.tile:active { opacity: .7; }
.tile-icon { color: var(--primary); display: block; margin-bottom: .3rem; }
.tile-icon .icon { width: 21px; height: 21px; }
.tile-count {
    font-size: 24px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile-count-small { font-size: 17px; }
.tile-label { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .hint { margin: .1rem 0 0; }

.countdown {
    display: flex; align-items: baseline; gap: .5rem;
    background: var(--primary-soft); color: var(--primary);
    border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: 1.1rem;
}
.countdown strong { font-size: 28px; line-height: 1; }
.countdown span { font-size: 15px; }
.countdown-live { background: var(--success-soft); color: var(--success); }

/* -------------------------------------------------------------- Dokumente */

.doc-main {
    display: flex; align-items: center; gap: .75rem;
    text-decoration: none; color: inherit; min-width: 0; flex: 1;
}
.doc-main strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-main small { display: block; font-size: 13px; }

.doc-icon {
    flex: none; width: 38px; height: 38px; border-radius: 9px;
    display: grid; place-items: center;
    background: var(--primary-soft); color: var(--primary);
}

/* ------------------------------------------------------------------ Fotos */

.photo-day { margin-bottom: 1.4rem; }
.photo-day-head {
    display: flex; align-items: baseline; justify-content: space-between;
    position: sticky; top: 0; z-index: 5;
    margin: 0 0 .5rem;
    padding: .45rem 0;
    background: var(--bg);
    font-size: 15px; font-weight: 600;
}
.photo-day-head small { font-weight: 400; }

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: .25rem;
}

.photo-item { margin: 0; position: relative; }
.photo-item img {
    width: 100%; aspect-ratio: 1; object-fit: cover;
    border-radius: 4px; display: block; background: var(--surface-alt);
}
.photo-open { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; width: 100%; }
.photo-open:active { opacity: .7; }

.photo-item figcaption {
    position: absolute; inset: auto .15rem .3rem .15rem;
    display: flex; justify-content: space-between;
    opacity: 0; transition: opacity .15s;
}
.photo-item:hover figcaption, .photo-item:focus-within figcaption { opacity: 1; }
@media (hover: none) { .photo-item figcaption { opacity: 1; } }

.photo-action {
    background: rgba(0, 0, 0, .5); color: #fff;
    border: 0; border-radius: 99px;
    min-width: 34px; min-height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; cursor: pointer;
    backdrop-filter: blur(6px);
}

.photo-strip { display: flex; gap: .3rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: .8rem; }
.photo-strip img { width: 88px; height: 88px; object-fit: cover; border-radius: 6px; display: block; }

.lightbox {
    position: fixed; inset: 0; z-index: 50;
    background: #000;
    display: grid; place-items: center; gap: .8rem;
    padding: 1rem;
}
.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; }
.lightbox-caption { color: rgba(255, 255, 255, .7); font-size: 13px; margin: 0; }

.lightbox-close {
    position: absolute; top: max(1rem, env(safe-area-inset-top)); right: 1rem;
    background: rgba(255, 255, 255, .16); color: #fff;
    border: 0; border-radius: 99px; width: 40px; height: 40px;
    display: grid; place-items: center; cursor: pointer;
}
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255, 255, 255, .16); color: #fff;
    border: 0; border-radius: 99px; width: 44px; height: 44px;
    display: grid; place-items: center; cursor: pointer;
}
.lightbox-prev { left: .6rem; }
.lightbox-next { right: .6rem; }
.lightbox-nav[disabled] { opacity: .25; }

/* ------------------------------------------------- Fotos mehrfach auswaehlen */

.auswahl-leiste {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    padding: .45rem .5rem .45rem .2rem;
    margin-bottom: .7rem;
    background: var(--leiste);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-radius: var(--radius-klein);
}
.auswahl-leiste #auswahl-zahl { font-size: 15px; font-weight: 500; }
.auswahl-leiste .btn { min-height: 38px; padding: .4rem .9rem; font-size: 15px; }
.auswahl-leiste .linkish { padding: 0 .6rem; }

/* Waehrend der Auswahl rutschen die Datumszeilen unter die Leiste */
#foto-album.auswahl-aktiv .photo-day-head { top: 3.1rem; }

/*
 * Das Kaestchen liegt ueber dem Foto. Ausserhalb des Auswahlmodus ist es
 * unsichtbar und nicht antippbar – dann oeffnet ein Tipp wie gewohnt das Bild.
 */
.photo-haken {
    position: absolute; right: .3rem; top: .3rem;
    display: none;
    margin: 0; padding: 0;
    pointer-events: none;
}
#foto-album.auswahl-aktiv .photo-haken { display: block; }

.photo-haken input { position: absolute; opacity: 0; width: 0; height: 0; }

.photo-haken span {
    display: grid; place-items: center;
    width: 24px; height: 24px;
    border-radius: 99px;
    background: rgba(0, 0, 0, .35);
    border: 1.5px solid rgba(255, 255, 255, .9);
    color: transparent;
    backdrop-filter: blur(6px);
}
.photo-haken .icon { width: 14px; height: 14px; stroke-width: 3.2; }

.photo-haken input:checked + span {
    background: var(--primary);
    border-color: #fff;
    color: #fff;
}

/* Markierte Fotos treten zurueck, damit die Auswahl auffaellt */
#foto-album.auswahl-aktiv .photo-item:has(input:checked) img { opacity: .55; }

/* Im Auswahlmodus stoeren die Einzelknoepfe nur */
#foto-album.auswahl-aktiv figcaption { display: none; }

/* -------------------------------------------------------------- Packliste */

.progress {
    height: 6px; border-radius: 99px;
    background: var(--surface-alt);
    overflow: hidden; margin-bottom: .4rem;
}
.progress-bar { height: 100%; background: var(--primary); border-radius: 99px; transition: width .25s; }
.progress-text { margin: 0 0 1.1rem; }

.add-row {
    display: grid;
    grid-template-columns: 1fr 8.5rem auto;
    gap: .5rem; align-items: center;
}
@media (max-width: 480px) {
    .add-row { grid-template-columns: 1fr auto; }
    .add-row input:nth-of-type(2) { grid-column: 1 / -1; }
}

.check-form { display: flex; align-items: center; flex: 1; min-width: 0; }

.check-zeile {
    display: flex; align-items: center; gap: .75rem;
    flex: 1; min-width: 0;
    padding: .3rem 0;
    background: none; border: 0;
    font: inherit; font-size: 16px; color: inherit; text-align: left;
    cursor: pointer; min-height: 44px;
}

.check-box {
    flex: none;
    width: 24px; height: 24px;
    border-radius: 99px;
    border: 1.5px solid var(--muted-2);
    background: transparent;
    color: transparent;
    display: grid; place-items: center;
    transition: background .15s, border-color .15s, color .15s;
}
.check-box .icon { width: 14px; height: 14px; stroke-width: 3.2; }

.check-list li.is-done .check-box {
    background: var(--primary); border-color: var(--primary); color: #fff;
}
.check-list li.is-done .check-label { color: var(--muted); }

.check-label { padding: 0; }
.preset-row { display: flex; flex-wrap: wrap; gap: .5rem; }

/* --------------------------------------------------------------- Ausgaben */

.summary { background: var(--surface); border-radius: var(--radius); padding: 1.1rem 1rem; margin-bottom: 1.1rem; }
.summary-total { text-align: center; margin-bottom: 1rem; }
.summary-total strong { display: block; font-size: 34px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }

.balance-list li { font-size: 15px; display: grid; grid-template-columns: 1fr auto auto; }
.balance-paid { color: var(--muted); }
.balance-saldo { font-weight: 600; font-variant-numeric: tabular-nums; }
.balance-saldo.is-plus { color: var(--success); }
.balance-saldo.is-minus { color: var(--danger); }

.settle {
    margin: 0; padding: .8rem .9rem;
    background: var(--primary-soft); color: var(--primary);
    border-radius: var(--radius-klein); font-size: 15px;
}

.expense-main { flex: 1; min-width: 0; }
.expense-main strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expense-main small { display: block; font-size: 13px; }
.expense-amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------------ Route */

.route-map {
    height: 340px;
    border-radius: var(--radius);
    margin-bottom: .5rem;
    z-index: 1;
    background: var(--surface-alt);
    overflow: hidden;
}
.map-credit { margin: 0 0 1.1rem; font-size: 12px; }
.map-credit a { color: var(--muted); }

.route-marker span {
    display: grid; place-items: center;
    width: 28px; height: 28px; border-radius: 99px;
    background: var(--primary); color: #fff;
    font: 600 13px/1 var(--schrift);
    border: 2px solid #fff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .35);
}

.route-list { list-style: none; margin: 0; padding: 0; }
.route-day + .route-day { margin-top: 1.1rem; padding-top: .9rem; border-top: .5px solid var(--border); }
.route-day h3 { display: flex; align-items: baseline; gap: .6rem; font-size: 16px; }
.route-day h3 small { font-weight: 400; font-size: 13px; }

.route-stops { list-style: none; margin: 0; padding: 0 0 0 .85rem; border-left: 2px solid var(--border); }
.route-stop { display: flex; align-items: center; gap: .7rem; padding: .4rem 0; position: relative; }
.route-stop::before {
    content: ""; position: absolute; left: calc(-.85rem - 5px);
    width: 8px; height: 8px; border-radius: 99px; background: var(--primary);
}
.route-foto::before { background: var(--warn); }

.route-pin {
    flex: none; width: 32px; height: 32px; border-radius: 9px;
    display: grid; place-items: center;
    background: var(--primary-soft); color: var(--primary);
}
.route-stop img { flex: none; width: 42px; height: 42px; object-fit: cover; border-radius: 7px; }
.route-label { flex: 1; min-width: 0; font-size: 16px; }
.route-label small { display: block; color: var(--muted); font-size: 13px; }
.route-foto .route-label { color: var(--muted); font-size: 15px; }

/* ----------------------------------------------------------- Aufzeichnung */

.track-anzeige {
    display: flex; align-items: center; gap: .6rem;
    margin: .9rem 0 .4rem;
    font-weight: 600; font-size: 15px;
}
.track-punkt {
    width: 12px; height: 12px; border-radius: 99px;
    background: var(--danger);
    animation: pulsieren 1.6s ease-in-out infinite;
}
@keyframes pulsieren {
    0%, 100% { opacity: 1;  transform: scale(1); }
    50%      { opacity: .35; transform: scale(.8); }
}
#tracker.is-recording { outline: 2px solid var(--danger); outline-offset: -2px; }
#track-hinweis.is-error { color: var(--danger); }

/* ------------------------------------------------------------------- Reel */

.reel {
    position: relative;
    margin: 0 auto 1.1rem;
    max-width: 320px;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
}
.reel canvas { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; }
.reel progress {
    position: absolute; left: 0; right: 0; bottom: 0;
    width: 100%; height: 3px; border: 0;
    background: rgba(255, 255, 255, .25);
    -webkit-appearance: none; appearance: none;
}
.reel progress::-webkit-progress-bar   { background: rgba(255, 255, 255, .25); }
.reel progress::-webkit-progress-value { background: #fff; }
.reel progress::-moz-progress-bar      { background: #fff; }
.reel.is-playing { outline: 2px solid var(--primary); outline-offset: -2px; }

/* ------------------------------------------------------------------ Musik */

.music-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; margin-bottom: .5rem; }
.music-titel { min-width: 0; }
.music-titel strong { display: block; font-weight: 500; overflow-wrap: anywhere; }
.music-titel small { display: block; color: var(--muted); font-size: 13px; }
.music-list audio { width: 100%; height: 36px; }
.music-list .credit { margin: .4rem 0 0; }

/* -------------------------------------------------------------- Titelbild */

.cover-preview {
    position: relative; aspect-ratio: 16 / 7;
    border-radius: var(--radius-klein);
    background-size: cover; background-position: center;
    margin-bottom: .9rem; overflow: hidden;
}
.cover-preview .hero-initials { font-size: 3rem; }

.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .4rem; }

.cover-choice {
    display: block; width: 100%;
    padding: 0; border: 2px solid transparent;
    background: var(--surface-alt);
    border-radius: var(--radius-klein);
    cursor: pointer; overflow: hidden; text-align: left;
}
.cover-choice.is-current { border-color: var(--primary); }
.cover-choice:active { opacity: .7; }
.cover-choice img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.cover-choice small {
    display: block; padding: .3rem .4rem;
    font-size: 11px; line-height: 1.3; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ----------------------------------------------------------------- Teilen */

.share-choice {
    display: flex; align-items: center; gap: .9rem;
    width: 100%; padding: .9rem 1rem;
    background: none; border: 0; cursor: pointer;
    font: inherit; color: inherit; text-align: left;
}
.share-mark {
    flex: none; width: 46px; height: 46px; border-radius: 11px;
    display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: 15px;
}
.share-choice small { display: block; color: var(--muted); font-size: 13px; }

/* -------------------------------------------------------------- Statistik */

.stat-gross { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: .8rem; }
.stat-gross > div {
    background: var(--surface); border-radius: var(--radius);
    padding: 1.1rem 1rem; text-align: center;
}
.stat-gross strong {
    display: block; font-size: 34px; font-weight: 700; line-height: 1.1;
    letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.stat-gross span { display: block; font-weight: 500; font-size: 15px; margin-top: .15rem; }
.stat-gross small { display: block; color: var(--muted); font-size: 12px; margin-top: .35rem; }

.stat-zeile { margin: 0; }
.stat-zeile strong { font-size: 24px; font-weight: 700; }
.stat-zeile .hint { display: block; margin-top: .2rem; }

.land-liste li { gap: .7rem; }
.land-flagge {
    flex: none;
    width: 2.2rem; height: 1.7rem;
    display: grid; place-items: center;
    line-height: 1;
    background: var(--surface-alt);
    border-radius: 6px;
    font-weight: 700; font-size: 15px;
}
.land-name { flex: 1; min-width: 0; font-weight: 500; font-size: 16px; }

/* -------------------------------------------------------------- Ortssuche */

.autocomplete { position: relative; }

.autocomplete-list {
    position: absolute; z-index: 30; left: 0; right: 0; top: 100%;
    margin: .25rem 0 0; padding: .25rem;
    list-style: none;
    background: var(--surface);
    border-radius: var(--radius-klein);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
    max-height: 300px; overflow-y: auto;
}
.autocomplete-list li {
    display: flex; align-items: baseline; justify-content: space-between; gap: .6rem;
    padding: .6rem .65rem;
    border-radius: 8px; cursor: pointer; font-size: 16px;
}
.autocomplete-list li small { flex: none; color: var(--muted); font-size: 12px; }
.autocomplete-list li.is-active, .autocomplete-list li:hover {
    background: var(--primary); color: #fff;
}
.autocomplete-list li.is-active small { color: rgba(255, 255, 255, .8); }

/* --------------------------------------------------- Upload und Protokoll */

.upload-fortschritt { display: flex; align-items: center; gap: .7rem; margin-top: .2rem; }
.upload-fortschritt progress {
    flex: 1; height: 6px; border: 0; border-radius: 99px;
    background: var(--surface-alt);
    -webkit-appearance: none; appearance: none;
}
.upload-fortschritt progress::-webkit-progress-bar   { background: var(--surface-alt); border-radius: 99px; }
.upload-fortschritt progress::-webkit-progress-value { background: var(--primary); border-radius: 99px; }
.upload-fortschritt progress::-moz-progress-bar      { background: var(--primary); border-radius: 99px; }
.upload-fortschritt progress[data-unbestimmt] {
    background: linear-gradient(90deg, var(--surface-alt) 40%, var(--primary) 50%, var(--surface-alt) 60%);
    background-size: 250% 100%;
    animation: wandern 1.2s linear infinite;
}
@keyframes wandern {
    from { background-position: 100% 0; }
    to   { background-position: 0 0; }
}
.upload-text {
    flex: none; font-size: 15px; font-weight: 600; color: var(--primary);
    font-variant-numeric: tabular-nums; min-width: 5.5rem; text-align: right;
}

.logview {
    margin: 0; padding: .8rem;
    background: var(--surface-alt);
    border-radius: var(--radius-klein);
    font-size: 12px; line-height: 1.45;
    white-space: pre-wrap; word-break: break-word;
    overflow-x: auto; max-height: 60vh;
}

/* -------------------------------------------------------------- Sonstiges */

.page-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 0 1rem 2rem; }
.nav-text { display: inline; }

@media (prefers-reduced-motion: reduce) {
    .track-punkt, .upload-fortschritt progress[data-unbestimmt] { animation: none; }
}

/* Querformat: der Kopf darf nicht den ganzen Bildschirm fuellen */
@media (max-height: 500px) and (orientation: landscape) {
    .hero { min-height: 190px; }
    .hero-body h1 { font-size: 24px; }
    .hero-initials { font-size: 4rem; }
    .reel { max-width: 210px; }
}

/* Sehr schmale Geraete */
@media (max-width: 359px) {
    h1 { font-size: 30px; }
    /* Nur breite Textknoepfe umbrechen – runde Symbolknoepfe bleiben rund
       und duerfen neben der Ueberschrift stehen. */
    .page-head:not(:has(.btn-rund)) { flex-direction: column; align-items: stretch; gap: .6rem; }
    .page-head:not(:has(.btn-rund)) .btn { width: 100%; }
    .hero-knopf-text { padding: 0 .65rem; font-size: 14px; }
    .tableiste a { font-size: 9px; }
}
