/* Travel Planner – modernes Basis-Stylesheet */

:root {
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-soft: #eef2ff;
    --danger: #e11d48;
    --success: #059669;
    --warning: #d97706;
    --border: #e2e8f0;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgb(15 23 42 / .05), 0 4px 12px rgb(15 23 42 / .06);
    --shadow-lg: 0 8px 24px rgb(15 23 42 / .10);
    --ring: 0 0 0 3px rgb(79 70 229 / .18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }
body { overflow-x: clip; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background:
        radial-gradient(ellipse 80% 60% at 15% 0%, rgb(99 102 241 / .18), transparent 60%),
        radial-gradient(ellipse 70% 55% at 90% 100%, rgb(236 72 153 / .16), transparent 60%),
        linear-gradient(160deg, #eef2ff 0%, #fdf4ff 55%, #fff7ed 100%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1020px; margin: 0 auto; padding: 0 1.25rem; }

.icon {
    display: inline-block; vertical-align: -0.18em;
    flex-shrink: 0;
}

/* ------------------------------------------------ Header */
/* Schwebende Glas-Leiste: transluzent, Blur, abgerundet, weicher Schatten */
.site-header {
    position: sticky; top: .7rem; z-index: 50;
    max-width: 1060px; margin: .7rem auto 0;
    background: rgb(255 255 255 / .68);
    backdrop-filter: blur(16px) saturate(1.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    border: 1px solid rgb(255 255 255 / .65);
    border-radius: 18px;
    box-shadow: 0 10px 34px rgb(15 23 42 / .10);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: .55rem; padding-bottom: .55rem;
}
.brand {
    display: inline-flex; align-items: center; gap: .5rem;
    font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em;
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-decoration: none;
}
.brand-logo { display: block; border-radius: 7px; flex-shrink: 0; }
header nav { display: flex; gap: .25rem; align-items: center; }
.nav-burger {
    display: none; align-items: center; justify-content: center; flex-shrink: 0;
    width: 2.5rem; height: 2.5rem; padding: 0;
    border: 1px solid var(--border); border-radius: 12px;
    background: var(--card); color: var(--text); cursor: pointer;
}
.nav-burger:hover { border-color: var(--primary); color: var(--primary); }
header nav a {
    color: var(--muted); text-decoration: none; font-weight: 500;
    padding: .4rem .75rem; border-radius: var(--radius-sm);
    transition: color .15s, background .15s;
}
header nav a:hover { color: var(--primary); background: var(--primary-soft); }

main.container { padding-top: 2rem; padding-bottom: 4rem; min-height: 60vh; }

/* Footer fixiert unten – gleiche schwebende Glas-Leiste wie der Header */
.site-footer {
    position: fixed; bottom: .7rem; left: 50%; transform: translateX(-50%);
    z-index: 40;
    width: min(1060px, calc(100% - 2.5rem));
    padding: .7rem 1rem;
    text-align: center; color: var(--muted);
    background: rgb(255 255 255 / .55);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    border: 1px solid rgb(255 255 255 / .55);
    border-radius: 18px;
    box-shadow: 0 10px 34px rgb(15 23 42 / .12);
}
.site-footer .container { padding: 0; }
.trip-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; letter-spacing: .04em; user-select: all; cursor: pointer; transition: color .15s; }
.trip-id:hover { color: var(--primary-dark); text-decoration: underline dotted; text-underline-offset: 3px; }
.trip-id:hover::before { content: '⧉ '; }
.trip-id.copied { color: #059669; }
.trip-id.copied::after { content: ' ✓'; font-family: inherit; }
/* Platz für den fixierten Footer, damit er nichts überdeckt */
body { padding-bottom: 4.5rem; }

/* ------------------------------------------------ Typografie */
h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: .5rem 0 1rem; }
h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; margin: 1.75rem 0 .75rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 0 0 .5rem; }
a { color: var(--primary); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.trip-meta, .muted { color: var(--muted); }
.muted.small, small.muted { font-size: .85em; }
.empty {
    color: var(--muted); font-style: italic;
    background: var(--card); border: 1px dashed var(--border);
    border-radius: var(--radius); padding: 1.25rem; text-align: center;
}

/* ------------------------------------------------ Karten */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.4rem;
    margin-bottom: 1.1rem;
    box-shadow: var(--shadow);
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }

/* ------------------------------------------------ Formulare */
.form label { display: block; margin-bottom: .85rem; font-weight: 600; font-size: .85rem; color: #334155; letter-spacing: .01em; }
.form input[type=text], .form input[type=email], .form input[type=password],
.form input[type=url], .form input[type=date], .form input[type=datetime-local],
.form input[type=number], .form input[type=time], .form input[type=tel],
.form textarea, .form select,
.form-inline input, .form-inline select {
    display: block; width: 100%; margin-top: .35rem;
    padding: .6rem .85rem; border: 1px solid #e2e8f0; border-radius: 12px;
    font: inherit; font-size: .95rem; background: #fff; color: var(--text);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.form input:hover, .form select:hover, .form textarea:hover,
.form-inline input:hover, .form-inline select:hover {
    border-color: #cbd5e1;
}
.form input:focus, .form select:focus, .form textarea:focus,
.form-inline input:focus, .form-inline select:focus {
    outline: none; border-color: var(--primary); box-shadow: var(--ring); background: #fff;
}
.form input::placeholder, .form textarea::placeholder { color: #94a3b8; }
.form textarea { min-height: 5.5rem; resize: vertical; line-height: 1.5; }
.form input[type=checkbox], .form input[type=radio],
.form-inline input[type=checkbox], .form-inline input[type=radio] {
    width: auto; accent-color: var(--primary); margin-top: 0;
}
/* Selects: eigener Pfeil statt Browser-Default */
.form select, .form-inline select, .dt-pair select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .8rem center;
    padding-right: 2.2rem; cursor: pointer;
}
.form.auth { max-width: 26rem; }
.form-inline { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; }
.form-inline input[type=email] { flex: 2; min-width: 200px; }
.addr-body { display: flex; flex-direction: column; gap: .2rem; }
.addr-line { margin: 0; display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.addr-line a { color: var(--primary-dark); text-decoration: none; font-weight: 550; }
.addr-line a:hover { text-decoration: underline; }
.addr-line .icon { flex-shrink: 0; }
.form-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.form-row > label { flex: 1; min-width: 140px; }
.grow { flex: 2 !important; }

/* ------------------------------------------------ Buttons */
button, .btn {
    display: inline-block; font: inherit; font-weight: 600; cursor: pointer;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: #fff; border: none;
    padding: .55rem 1.1rem; border-radius: var(--radius-sm);
    text-decoration: none; letter-spacing: -.01em;
    box-shadow: 0 1px 2px rgb(79 70 229 / .3);
    transition: transform .12s, box-shadow .15s, background .15s, filter .15s;
}
button:hover, .btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
button:active, .btn:active { transform: translateY(0); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.secondary, button.secondary {
    background: #fff; color: var(--primary);
    border: 1px solid var(--border); box-shadow: var(--shadow);
}
.btn.secondary:hover, button.secondary:hover { border-color: var(--primary); color: var(--primary-dark); filter: none; }
.btn.danger { background: var(--danger); box-shadow: 0 1px 2px rgb(225 29 72 / .3); }
.btn.small { padding: .3rem .7rem; font-size: .85rem; }
.linklike {
    background: none; border: none; color: var(--muted); padding: .4rem .5rem;
    font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
    border-radius: var(--radius-sm); transition: color .15s, background .15s;
}
.linklike:hover { color: var(--danger); background: #fff1f2; }
.linklike.danger { color: var(--danger); font-weight: 600; }
.linklike.danger:hover { color: #be123c; background: #ffe4e6; }
.inline { display: inline; }

/* ------------------------------------------------ Fieldsets / Checks */
fieldset {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: .75rem .9rem .9rem; margin: .5rem 0 1.1rem; background: #fafbfd;
}
legend { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 .4rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
.cards-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 1rem; align-items: start; }
.check-inline { display: flex; gap: .45rem; align-items: center; font-weight: 400; margin-bottom: .4rem; }
.check-inline input { width: auto; accent-color: var(--primary); }

/* ------------------------------------------------ Flash / Hinweise */
.flash {
    padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem;
    border: 1px solid transparent; font-weight: 500; box-shadow: var(--shadow);
}
.flash-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.notice-dev { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: .75rem 1rem; border-radius: var(--radius-sm); }

/* ------------------------------------------------ Reisen */
.trip-list {
    list-style: none; padding: 0;
    display: grid; gap: .9rem;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
}
@media (max-width: 640px) {
    .trip-list { grid-template-columns: 1fr; }
}
.trip-card {
    display: block; text-decoration: none; color: inherit;
    position: relative; overflow: hidden;
    transition: transform .15s, box-shadow .15s;
}
.trip-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.trip-title { font-size: 1.15rem; font-weight: 700; color: var(--primary); text-decoration: none; letter-spacing: -.01em; }
.trip-title:hover { text-decoration: underline; }
.trip-card.has-img {
    background-size: cover;
    background-position: center;
    color: #1f2937;
}
.trip-card.has-img::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .78);
    border-radius: inherit;
}
.trip-card.has-img > * { position: relative; z-index: 1; }
.trip-card.has-img .trip-title { color: var(--primary); }
/* ------------------------------------------------ Reisedetail: Bild als Seitengrund */
/* Das Zielbild liegt per Inline-Style auf <body>; ::before legt einen
   hellen Schleier darüber, damit der Inhalt lesbar bleibt. */
body.trip-bg {
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
}
body.trip-bg::before {
    content: ""; position: fixed; inset: 0; z-index: -1;
    background: rgb(255 255 255 / .68);
}
body.trip-bg .site-header {
    background: rgb(255 255 255 / .5);
}
body.trip-bg .site-footer {
    background: rgb(255 255 255 / .55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.trip-role {
    display: inline-block; font-size: .78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--muted); margin-top: .4rem;
    background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: .15rem .6rem;
}

.trip-nav { display: flex; gap: .45rem; flex-wrap: wrap; margin: 1.1rem 0 1.4rem; }
.trip-nav a {
    padding: .4rem .9rem; border-radius: 999px; text-decoration: none;
    background: var(--card); border: 1px solid var(--border); color: var(--text);
    font-size: .88rem; font-weight: 550; box-shadow: var(--shadow);
    transition: all .15s;
}
.trip-nav a.active, .trip-nav a:hover { background: linear-gradient(135deg, var(--primary), #6366f1); border-color: transparent; color: #fff; box-shadow: 0 2px 8px rgb(79 70 229 / .35); }
.trip-nav-chat {
    display: inline-flex; align-items: center; gap: .35rem; flex: 0 0 auto;
    padding: .4rem .9rem; border-radius: 999px;
    background: var(--card); border: 1px solid var(--primary); color: var(--primary-dark);
    font: inherit; font-size: .88rem; font-weight: 650; cursor: pointer;
    box-shadow: var(--shadow); transition: all .15s; white-space: nowrap;
}
.trip-nav-chat:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.trip-nav-chat .icon { width: 15px; height: 15px; }

/* ------------------------------------------------ Modul-Menü (Dropdown) */
.page-head-actions { display: flex; gap: .5rem; align-items: flex-start; flex-wrap: wrap; }
.module-menu { position: relative; }
.module-menu > summary {
    list-style: none; cursor: pointer; user-select: none;
    display: inline-flex; align-items: center;
}
.module-menu > summary::-webkit-details-marker { display: none; }
.module-menu[open] > summary { outline: 2px solid var(--primary); outline-offset: 2px; }
.module-menu-panel {
    position: absolute; right: 0; top: calc(100% + .45rem); z-index: 60;
    width: min(340px, 86vw); padding: .5rem .9rem;
    box-shadow: var(--shadow-lg);
}
.module-row {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    padding: .55rem 0; border-bottom: 1px solid var(--border);
}
.module-row:last-child { border-bottom: none; }
.module-row-text strong { display: block; font-size: .92rem; }
.module-row-text small { display: block; line-height: 1.3; }
.switch {
    flex: 0 0 auto; min-width: 3.4rem; padding: .28rem .8rem;
    border-radius: 999px; border: 1px solid transparent;
    font-size: .8rem; font-weight: 700; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.switch.on  { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.switch.on:hover  { background: #a7f3d0; }
.switch.off { background: var(--bg); color: var(--muted); border-color: var(--border); }
.switch.off:hover { color: var(--text); border-color: var(--primary); }
@media (max-width: 640px) {
    .module-menu-panel { position: fixed; left: .8rem; right: .8rem; top: 4.2rem; width: auto; }
}
.badge-off { font-size: .8rem; color: var(--muted); margin-right: .5rem; }
.badge {
    display: inline-block; background: var(--primary-soft); color: var(--primary-dark);
    border-radius: 999px; padding: .15rem .65rem; font-size: .78rem; font-weight: 600;
}
.badge-person { background: #fef3c7; color: #92400e; }
.pack-who { display: inline; }
@media (max-width: 480px) { .pack-who { display: block; margin-top: .15rem; } }
.totals { display: flex; gap: .55rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.totals .badge { font-size: .95rem; padding: .35rem .9rem; background: #ecfdf5; color: #065f46; }

/* ------------------------------------------------ Tabellen */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.table-wrap .table { margin-bottom: 0; }
table.table { width: 100%; border-collapse: collapse; background: var(--card); }
.table th, .table td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table thead th {
    font-size: .75rem; color: var(--muted); font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
    background: #f8fafc; border-bottom: 1px solid var(--border);
}
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }
.row-actions { white-space: nowrap; display: flex; gap: .7rem; align-items: center; }
.row-actions a { color: var(--primary); font-weight: 550; text-decoration: none; }
.row-actions a:hover { text-decoration: underline; }

/* ------------------------------------------------ Checkliste / Notizen */
.checklist { list-style: none; padding: 0; }
.checklist li {
    display: flex; align-items: center; gap: .65rem;
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: .7rem .9rem; margin-bottom: .45rem;
    box-shadow: var(--shadow);
}
.checklist li.done { opacity: .65; }
.checklist li.done .check-label { text-decoration: line-through; color: var(--muted); }
.checklist .check-label { flex: 1; min-width: 0; }
.check { background: none; border: none; font-size: 1.25rem; cursor: pointer; padding: 0; color: var(--primary); line-height: 1; }

/* Toggle-Switch (Packliste) */
.pack-toggle-form { flex-shrink: 0; align-self: center; }
.pack-toggle {
    position: relative; display: inline-block; flex-shrink: 0;
    width: 2.5rem; height: 1.4rem; padding: 0;
    border: none; border-radius: 999px; cursor: pointer;
    background: #cbd5e1; transition: background .18s ease;
    -webkit-appearance: none; appearance: none;
}
.pack-toggle .pt-knob {
    position: absolute; top: .15rem; left: .15rem;
    width: 1.1rem; height: 1.1rem; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgb(15 23 42 / .35);
    transition: transform .18s ease;
}
.pack-toggle.on { background: var(--primary); }
.pack-toggle.on .pt-knob { transform: translateX(1.1rem); }
.pack-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pack-toggle-static {
    position: relative; display: inline-block; flex-shrink: 0;
    width: 2.5rem; height: 1.4rem; border-radius: 999px;
    background: #cbd5e1; align-self: center;
}
.pack-toggle-static.on { background: var(--primary); }
.pack-toggle-static .pt-knob {
    position: absolute; top: .15rem; left: .15rem;
    width: 1.1rem; height: 1.1rem; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgb(15 23 42 / .35);
}
.pack-toggle-static.on .pt-knob { transform: translateX(1.1rem); }

/* Tagesplan / Gruppentitel */
.day-group { margin: 1.4rem 0 .4rem; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.day-time { color: var(--primary-dark); font-variant-numeric: tabular-nums; }

/* Dokument-Warnungen */
.badge-expired { background: #fee2e2; color: #991b1b; }
.badge-soon { background: #fef3c7; color: #92400e; }

/* Reise-Info-Karte + Formular-Untertitel */
.info-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; }
.info-chips li { display: flex; gap: .35rem; align-items: baseline; }
.form-sub { margin: 1.2rem 0 .6rem; font-size: 1rem; }

/* Icon-Buttons (rechtsbuendig in Kacheln) */
.pack-actions { margin-left: auto; display: inline-flex; gap: .15rem; align-items: center; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; padding: 0;
    border: none; border-radius: var(--radius-sm); cursor: pointer;
    background: none; color: var(--muted); text-decoration: none;
    transition: color .15s, background .15s;
}
.icon-btn:hover { color: var(--primary-dark); background: var(--primary-soft); }
.icon-btn.danger:hover { color: var(--danger); background: #fff1f2; }
.icon-btn.danger { color: #b91c1c; }
.check-body { flex: 1; }

.note.pinned { border-color: #c7d2fe; box-shadow: 0 0 0 3px rgb(99 102 241 / .12), var(--shadow); }
.note-body { white-space: pre-wrap; margin: .5rem 0; }

.member-list { list-style: none; padding: 0; margin: 0; }
.member-list li { padding: .2rem 0; }

.attach-list { list-style: none; padding: 0; margin: 0 0 .8rem; }
.attach-list li {
    display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
    padding: .4rem 0; border-bottom: 1px solid var(--border);
}
.attach-list li:last-child { border-bottom: none; }
.attach-list a { font-weight: 550; text-decoration: none; }
.attach-list a:hover { text-decoration: underline; }

/* Datum+Uhrzeit als einheitliches Feld (Unterkuenfte) */
.dt-group { margin-bottom: .85rem; }
.dt-label { display: block; margin-bottom: .4rem; font-weight: 550; font-size: .95rem; }
.dt-pair {
    display: flex; align-items: stretch;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: #fff; overflow: hidden;
    transition: border-color .15s, background .15s;
}
.dt-pair:focus-within { border-color: var(--primary); background: var(--primary-soft); }
.form .dt-pair input, .form .dt-pair select {
    flex: 1; min-width: 0; border: none; outline: none; background-color: transparent;
    margin-top: 0; padding: .6rem .75rem; font: inherit; font-size: .95rem; color: #0f172a;
}
.form .dt-pair select {
    flex: .7; cursor: pointer;
    font-variant-numeric: tabular-nums;
    padding-right: 2rem;
    background-position: right .6rem center;
}
.dt-pair select:invalid { color: var(--muted); }
.dt-pair input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; }

/* ------------------------------------------------ Datei-Upload-Zone */
.file-drop-field { margin-bottom: .85rem; }
.form-inline .file-drop-field { flex: 1 1 220px; margin-bottom: 0; }
.file-drop-caption { display: block; margin-bottom: .4rem; font-weight: 550; font-size: .95rem; }
.file-drop {
    position: relative;
    display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
    border: 2px dashed var(--border); border-radius: var(--radius-sm);
    padding: .8rem 1rem; cursor: pointer;
    background: #f8fafc;
    transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop.drag-over {
    border-color: var(--primary); background: var(--primary-soft);
}
.file-drop .fd-input {
    position: absolute; width: 1px; height: 1px; opacity: 0;
    overflow: hidden; pointer-events: none;
}
.file-drop .fd-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.4rem; height: 2.4rem; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary-dark); flex-shrink: 0;
}
.fd-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.fd-text strong { font-size: .95rem; }
.fd-text small { color: var(--muted); font-size: .8rem; }
.fd-name {
    margin-left: auto; font-weight: 600; font-size: .9rem;
    color: var(--primary-dark); overflow-wrap: anywhere; text-align: right;
}
.fd-name:empty { display: none; }
.file-drop.drag-over .fd-name:empty::after { content: 'Loslassen zum Hochladen'; }
.file-drop input[type=file]:focus-visible + .fd-icon { outline: 2px solid var(--primary); outline-offset: 2px; }

.pagination { display: flex; gap: .5rem; margin-top: 1.1rem; }
.pagination a, .pagination strong {
    padding: .4rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
    text-decoration: none; color: var(--text); background: var(--card); font-weight: 550;
    transition: all .15s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination strong { background: var(--primary); color: #fff; border-color: var(--primary); }

.error-page { text-align: center; padding: 5rem 1rem; }
.error-page h1 { font-size: 3.5rem; font-weight: 800; }

@media (max-width: 640px) {
    .form-row { flex-direction: column; }
    .form-row > label { min-width: 0; }
    .page-head { flex-direction: column; align-items: flex-start; }
    h1 { font-size: 1.45rem; }
}

/* ------------------------------------------------ Landingpage */
.hero {
    position: relative; overflow: hidden;
    text-align: center;
    min-height: calc(100vh - 130px);
    min-height: calc(100svh - 130px);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 3rem 1.5rem;
    margin: 0 -1.25rem calc(2rem + 4vh);
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgb(219 39 119 / .35), transparent 60%),
        radial-gradient(ellipse 70% 55% at 85% 80%, rgb(34 211 238 / .3), transparent 60%),
        linear-gradient(135deg, #4f46e5 0%, #7c3aed 45%, #db2777 100%);
    background-size: 200% 200%, 200% 200%, 200% 200%;
    background-position: 0% 50%, 100% 50%, 50% 50%;
    color: #fff;
    animation: hero-shift 18s ease-in-out infinite alternate;
}
@keyframes hero-shift {
    0%   { background-position: 0% 50%, 100% 50%, 0% 50%; }
    50%  { background-position: 60% 20%, 40% 80%, 50% 50%; }
    100% { background-position: 100% 50%, 0% 50%, 100% 50%; }
}
/* Dezente Einschal-Animation für Hero-Text und Karten */
.hero h1, .hero .lead, .hero > p:not(.lead) {
    position: relative;
    animation: rise-in .7s cubic-bezier(.2,.7,.3,1) both;
}
.hero .lead { animation-delay: .12s; }
.hero > p:not(.lead) { animation-delay: .24s; }
.grid-cards .card {
    transition: transform .2s, box-shadow .2s;
    animation: rise-in .6s cubic-bezier(.2,.7,.3,1) both;
}
.grid-cards .card:nth-child(2) { animation-delay: .1s; }
.grid-cards .card:nth-child(3) { animation-delay: .2s; }
.grid-cards .card:nth-child(4) { animation-delay: .3s; }
@keyframes rise-in {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .hero,
    .hero h1, .hero .lead, .hero > p:not(.lead),
    .hero-scroll, .grid-cards .card { animation: none; }
}
.hero h1 {
    font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em;
    margin-bottom: .6rem; color: #fff; position: relative;
    text-shadow: 0 2px 24px rgb(0 0 0 / .25);
}
.hero .lead {
    font-size: 1.15rem; color: rgb(255 255 255 / .92); max-width: 42rem;
    margin: 0 auto 1.8rem; position: relative;
}
.hero .btn {
    position: relative; font-size: 1.02rem; padding: .8rem 1.6rem;
    transition: transform .15s, box-shadow .15s;
}
.hero .btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgb(0 0 0 / .25); }
.hero .btn.secondary { background: rgb(255 255 255 / .15); color: #fff; border-color: rgb(255 255 255 / .45); backdrop-filter: blur(6px); }
.hero .btn.secondary:hover { background: rgb(255 255 255 / .28); color: #fff; }
/* Scroll-Hinweis am unteren Hero-Rand */
.hero-scroll {
    position: absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
    color: rgb(255 255 255 / .75); font-size: .8rem; letter-spacing: .08em;
    text-transform: uppercase; animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, 7px); }
}
@media (prefers-reduced-motion: reduce) {
    .hero-scroll { animation: none; }
}

.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 1.1rem; margin: 1.5rem 0 2rem; }
.grid-cards .card { transition: transform .15s, box-shadow .15s; }
.grid-cards .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.grid-cards .card h2 { margin-top: 0; font-size: 1.05rem; }
.grid-cards .card p { color: var(--muted); font-size: .95rem; margin-bottom: 0; }

/* ------------------------------------------------ Reise-Karten & Phasen */
.trip-card-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.trip-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .45rem; }
.trip-activity { font-size: .8rem; color: var(--muted); }
.trip-countdown { margin-top: .4rem; font-size: .9rem; color: var(--primary-dark); font-weight: 550; }
.trip-countdown-lg { font-size: 1.05rem; margin-top: .55rem; }
.trip-countdown-lg strong { font-size: 1.25rem; }

.phase-badge {
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    border-radius: 999px; padding: .2rem .6rem; white-space: nowrap;
}
.phase-countdown   { background: #fef3c7; color: #92400e; }
.phase-active      { background: #d1fae5; color: #065f46; }
.phase-done        { background: #e0e7ff; color: #3730a3; }
.phase-planning    { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

/* ------------------------------------------------ Dashboard & Widgets */
.dash-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: .9rem; margin: 1.25rem 0;
}
.dash-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1rem 1.15rem; box-shadow: var(--shadow);
}
.dash-card h3 {
    margin: 0 0 .5rem; font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.dash-card .big { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.dash-card .sub { color: var(--muted); font-size: .85rem; }
.dash-card a { font-weight: 600; }

.progress {
    height: 8px; border-radius: 999px; background: var(--bg);
    border: 1px solid var(--border); overflow: hidden; margin-top: .4rem;
}
.progress > span {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), #6366f1);
    transition: width .3s;
}
.progress-row { display: flex; justify-content: space-between; font-size: .85rem; margin-top: .3rem; }

.quick-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: .75rem 0 1.25rem; }
.quick-actions .btn { padding: .45rem .9rem; font-size: .88rem; }

/* ------------------------------------------------ Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
    display: flex; gap: .8rem; padding: .5rem 0;
    border-bottom: 1px solid var(--border); align-items: baseline;
}
.timeline li:last-child { border-bottom: none; }
.timeline .t-date {
    flex: 0 0 6.5rem; font-size: .82rem; font-weight: 700; color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.timeline .t-type {
    flex: 0 0 5.5rem; font-size: .75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: var(--primary);
}
.timeline .t-label { flex: 1; }
.timeline .t-done { color: var(--muted); text-decoration: line-through; }
.timeline-empty { color: var(--muted); font-style: italic; }

/* ------------------------------------------------ Prioritäten */
.prio { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    border-radius: 999px; padding: .15rem .55rem; }
.prio-high   { background: #fee2e2; color: #b91c1c; }
.prio-normal { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.prio-low    { background: #e0f2fe; color: #0369a1; }

/* ------------------------------------------------ Karte & Wetter */
.dash-map { height: 260px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-top: .5rem; }
.weather-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: .5rem; margin-top: .6rem; }
.weather-day {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: .5rem .4rem; text-align: center; font-size: .8rem;
}
.weather-day .w-icon-wrap { display: flex; justify-content: center; margin: .15rem 0; }
.weather-day .w-icon { width: 26px; height: 26px; color: #d97706; }
.weather-day .w-temp { font-weight: 700; font-size: .95rem; }
.weather-day .w-cond { color: var(--muted); }

@media (max-width: 640px) {
    .timeline .t-type { display: none; }
    .dash-map { height: 200px; }
}

/* ------------------------------------------------ Einklapp-Formulare */
.add-box summary {
    list-style: none; cursor: pointer; user-select: none;
    display: flex; align-items: center; gap: .55rem;
    font-weight: 650; font-size: .95rem; color: var(--primary-dark);
    padding: 1rem 1.25rem;
}
.add-box summary::-webkit-details-marker { display: none; }
.add-box summary:hover { color: var(--primary); }
.add-plus {
    flex: 0 0 auto; width: 1.6rem; height: 1.6rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 2px 6px rgb(79 70 229 / .35);
    transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
}
.add-plus .icon { display: block; }
.add-box-summary:hover .add-plus { box-shadow: 0 3px 10px rgb(79 70 229 / .45); }
.add-box[open] .add-plus { transform: rotate(45deg); }
.add-box .add-box-body { padding: 0 1.25rem 1.15rem; }

/* Sanftes Aufklappen der Add-Boxen */
.add-box { interpolate-size: allow-keywords; }
.add-box::details-content {
    block-size: 0; overflow: clip;
    transition: block-size .3s ease, content-visibility .3s allow-discrete;
}
.add-box[open]::details-content { block-size: auto; }
@keyframes addbox-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}
.add-box[open] .add-box-body { animation: addbox-in .28s ease both; }
@media (prefers-reduced-motion: reduce) {
    .add-box::details-content { transition: none; }
    .add-box[open] .add-box-body { animation: none; }
}

@media (max-width: 720px) {
    .site-header { margin: .6rem .7rem 0; max-width: none; border-radius: 16px; }
    .site-footer { bottom: .6rem; width: calc(100% - 1.4rem); border-radius: 16px; }

    /* Hamburger-Menü: Navigation klappt als Dropdown unter dem Header auf */
    .nav-burger { display: inline-flex; }
    .header-inner { position: relative; }
    header nav {
        position: absolute; top: calc(100% + .45rem); right: 0;
        flex-direction: column; align-items: stretch; gap: .1rem;
        min-width: 12.5rem; padding: .45rem;
        background: var(--card); border: 1px solid var(--border);
        border-radius: 14px; box-shadow: var(--shadow-lg);
        display: none; z-index: 60;
    }
    header nav.open { display: flex; }
    header nav a { padding: .6rem .8rem; border-radius: 10px; }
    header nav .inline { display: block; }
    header nav .inline .linklike {
        display: block; width: 100%; text-align: left;
        padding: .6rem .8rem; border-radius: 10px;
    }
    .nav-email { display: none; }

    /* background-attachment:fixed ruckelt auf Mobilgeräten beim Scrollen */
    body, body.trip-bg, body.landing-bg { background-attachment: scroll; }
}

/* ------------------------------------------------ Landing: ganzseitiger Farbverlauf */
/* Blau → Violett → Rot als animierter Seitenhintergrund, Inhalt liegt als
   Karten/weißer Text darüber. */
body.landing-bg {
    background:
        radial-gradient(ellipse 90% 65% at 12% -5%, rgb(59 130 246 / .6), transparent 60%),
        radial-gradient(ellipse 85% 60% at 95% 105%, rgb(239 68 68 / .55), transparent 60%),
        linear-gradient(120deg, #1d4ed8 0%, #6d28d9 45%, #dc2626 100%);
    background-size: 200% 200%, 200% 200%, 200% 200%;
    background-position: 0% 50%, 100% 50%, 50% 50%;
    background-attachment: fixed;
    animation: hero-shift 24s ease-in-out infinite alternate;
}
/* Hero wird transparent – die Seite selbst ist der Hintergrund */
.landing-bg .hero {
    background: none;
    animation: none;
    min-height: calc(100vh - 140px);
    min-height: calc(100svh - 140px);
}
.landing-bg .site-footer {
    color: rgb(255 255 255 / .9);
    background: rgb(255 255 255 / .14);
    border-color: rgb(255 255 255 / .3);
}
.landing-bg .site-footer a { color: rgb(255 255 255 / .9); }
@media (prefers-reduced-motion: reduce) {
    body.landing-bg { animation: none; }
}

/* Icons in den Landing-Karten akzentuieren */
.grid-cards .card h2 .icon { color: var(--primary); vertical-align: -3px; }

/* ------------------------------------------------ Auth-Seiten */
/* Hintergrund kommt jetzt global vom <body> – auth-bg nur noch als Hook */
.auth-card {
    max-width: 26rem; margin: 2.5rem auto 3rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.2rem 1.9rem 1.8rem;
    text-align: center;
    animation: rise-in .5s cubic-bezier(.2,.7,.3,1) both;
}
.auth-logo {
    display: block; width: 4rem; height: 4rem; margin: 0 auto .9rem;
    border-radius: 1.1rem;
    box-shadow: 0 12px 30px rgb(79 70 229 / .35);
}
.auth-card h1 { margin: .2rem 0 .2rem; }
.auth-sub { margin-top: 0; }
.auth-card .form { text-align: left; margin-top: 1.3rem; }
.auth-card .notice-dev { text-align: left; margin-top: 1rem; }
.btn-block { width: 100%; justify-content: center; margin-top: .4rem; }
.auth-links { margin-top: 1.3rem; font-size: .9rem; line-height: 1.7; }
@media (prefers-reduced-motion: reduce) {
    .auth-card { animation: none; }
}

/* ------------------------------------------------ Reiseinfos (Ziel-Links) */
.info-links {
    list-style: none; padding: 0; margin: .8rem 0 0;
    display: flex; flex-wrap: wrap; gap: .5rem;
}
.info-links a {
    display: inline-block; padding: .35rem .8rem;
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--bg); color: var(--primary);
    text-decoration: none; font-size: .85rem; font-weight: 600;
    transition: border-color .15s, box-shadow .15s;
}
.info-links a:hover { border-color: var(--primary); box-shadow: var(--shadow); }

/* ------------------------------------------------ Rollen-Badges (Mitglieder) */
.role-badge {
    display: inline-block;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: .22rem .7rem;
    font-size: .78rem; font-weight: 700; line-height: 1.4;
    font-family: inherit;
}
select.role-badge {
    appearance: none; -webkit-appearance: none;
    cursor: pointer;
    padding-right: 1.6rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .55rem center;
}
.role-owner  { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.role-editor { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.role-viewer { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

/* ------------------------------------------------ Bestätigungs-Modal */
.modal-overlay {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    background: rgb(15 23 42 / .45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-overlay[hidden] { display: none; }
.modal-card {
    width: min(24rem, 100%);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem 1.6rem 1.3rem;
    text-align: center;
    animation: modal-in .18s cubic-bezier(.2,.7,.3,1) both;
}
.modal-title { margin: 0 0 .4rem; font-size: 1.05rem; }
.modal-text { margin: 0 0 1.2rem; color: var(--muted); font-size: .95rem; }
.modal-actions { display: flex; gap: .6rem; justify-content: center; }
@keyframes modal-in {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .modal-card { animation: none; }
}

/* ------------------------------------------------ Einladungs-Ablehnung */
.decline-box { margin-top: .4rem; }
.decline-box > summary {
    cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--muted);
}
.decline-box > summary:hover { color: var(--danger, #dc2626); }
.declined-list li { opacity: .75; }

/* ------------------------------------------------ Reiseinfos: Karte & Nahaufnahmen */
.sights-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem; margin-top: 1rem; align-items: start;
}
.sights-map {
    height: 280px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); overflow: hidden;
}
.sights-map iframe { width: 100%; height: 100%; border: 0; display: block; }
.sights-title { margin: 0 0 .6rem; font-size: .95rem; }
.sights-list { display: flex; flex-direction: column; gap: .45rem; font-size: .88rem; }
.sights-list p { margin: 0; }
.sight-item {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    padding: .55rem .8rem; border: 1px solid var(--border); border-radius: 10px;
    background: var(--card); text-decoration: none; color: inherit;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.sight-item:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.sight-name { font-weight: 600; }
.sight-meta { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.sight-kind {
    font-size: .7rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary-dark);
}
.sight-dist { color: var(--muted); font-size: .8rem; white-space: nowrap; }
@media (max-width: 640px) {
    .sights-grid { grid-template-columns: 1fr; }
    .sights-map { height: 220px; }
    .sight-item { flex-direction: column; align-items: flex-start; gap: .3rem; }
}

/* ------------------------------------------------ Reise-Chat Widget */
.chat-widget { position: relative; }
.chat-fab {
    position: fixed; right: 1.2rem; bottom: 4.6rem; z-index: 70;
    height: 3.1rem; padding: 0 1.05rem 0 .9rem; border-radius: 999px;
    border: none; cursor: pointer;
    background: linear-gradient(135deg, #4f46e5, #7c3aed 55%, #db2777);
    color: #fff;
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    font: inherit; font-size: .95rem; font-weight: 650; letter-spacing: .01em;
    box-shadow: 0 10px 28px rgb(79 70 229 / .4);
    transition: transform .15s, box-shadow .15s;
}
.chat-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgb(79 70 229 / .5); }
.chat-fab .icon { width: 20px; height: 20px; }
.chat-fab-label { line-height: 1; }
.chat-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem;
    border-radius: 999px; background: #e11d48; color: #fff;
    font-size: .7rem; font-weight: 700; line-height: 1.25rem; text-align: center;
    border: 2px solid #fff;
}
.chat-panel {
    position: fixed; right: 1.2rem; bottom: 8rem; z-index: 71;
    width: min(24rem, calc(100vw - 2rem)); height: min(30rem, calc(100vh - 11rem));
    display: flex; flex-direction: column;
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modal-in .18s cubic-bezier(.2,.7,.3,1) both;
}
.chat-panel[hidden] { display: none; }
.chat-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .7rem 1rem; border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
}
.chat-head .linklike { color: #fff; opacity: .85; }
.chat-head .linklike:hover { opacity: 1; }
.chat-msgs { flex: 1; overflow-y: auto; padding: .8rem; display: flex; flex-direction: column; gap: .55rem; }
.chat-msg {
    max-width: 85%; align-self: flex-start;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 12px; padding: .45rem .7rem;
}
.chat-msg.mine {
    align-self: flex-end;
    background: #eef2ff; border-color: #c7d2fe;
}
.chat-msg-head { display: flex; gap: .5rem; align-items: baseline; margin-bottom: .1rem; }
.chat-msg-head strong { font-size: .78rem; }
.chat-msg-head small { color: var(--muted); font-size: .7rem; }
.chat-msg-body { font-size: .9rem; white-space: pre-wrap; word-break: break-word; }
.chat-form {
    display: flex; gap: .5rem; padding: .7rem;
    border-top: 1px solid var(--border);
}
.chat-form textarea {
    flex: 1; min-width: 0; padding: .5rem .7rem;
    border: 1px solid var(--border); border-radius: 10px;
    font: inherit; font-size: .9rem; line-height: 1.35;
    resize: none; max-height: 110px; overflow-y: auto;
}
.chat-form textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.chat-readonly { margin: 0; padding: .8rem; font-size: .85rem; text-align: center; }
@media (max-width: 640px) {
    .chat-fab { right: .8rem; bottom: 4.2rem; }
    .chat-panel { right: .8rem; bottom: 7.6rem; width: calc(100vw - 1.6rem); height: min(26rem, calc(100vh - 10rem)); }
}
@media (prefers-reduced-motion: reduce) {
    .chat-panel { animation: none; }
}

/* Ausfluege-Modul */
.exc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.exc-head h3 { margin: 0 0 .2rem; }
.exc-head .row-actions { flex-shrink: 0; }
.exc-list { display: flex; flex-direction: column; gap: .8rem; }
.sugg-list { display: flex; flex-direction: column; gap: .5rem; margin-top: .8rem; }
.sugg-item {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    padding: .55rem .8rem; border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg, #f8fafc);
}
.sugg-item .sugg-actions { display: flex; gap: .4rem; flex-shrink: 0; }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--border); box-shadow: none; }
.btn.ghost:hover { border-color: var(--primary); filter: none; }

/* ------------------------------------------------ Mobile (<480px) */
@media (max-width: 480px) {
    .container { padding: 0 .9rem; }
    main.container { padding-top: 1.1rem; }
    .card { padding: 1rem 1.05rem; }
    h1 { font-size: 1.35rem; }
    .page-head { gap: .5rem; }

    /* Header: kompakter, E-Mail in "Abmelden" ausgeblendet */
    .brand { font-size: 1.05rem; }
    header nav { gap: .1rem; }
    header nav a { padding: .35rem .55rem; font-size: .88rem; }
    .nav-email { display: none; }

    /* Grids: auf sehr schmalen Geräten einspaltig (verhindert minmax-Overflow) */
    .trip-list, .cards-2 { grid-template-columns: 1fr; }
    .grid-cards { grid-template-columns: 1fr; }

    /* Tabellen kompakter, Aktionen umbrechbar */
    .table th, .table td { padding: .5rem .55rem; font-size: .85rem; }
    .row-actions { flex-wrap: wrap; gap: .3rem .9rem; white-space: normal; }

    /* Längere Texte umbrechen statt zu überlaufen */
    .member-list li, .attach-list li, .attach-list a, .table td { overflow-wrap: anywhere; }

    /* Größere Tap-Targets für Finger */
    .linklike { padding: .5rem .6rem; }
    .info-links a { padding: .45rem .9rem; }
    .btn.small { padding: .4rem .8rem; }

    /* Auth-Karte näher an den Rand, aber noch luftig */
    .auth-card { margin: 1.2rem auto 2rem; padding: 1.7rem 1.2rem 1.4rem; }
    .auth-logo { width: 3.4rem; height: 3.4rem; }

    /* Modal: Buttons untereinander für einfache Bedienung */
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .btn { width: 100%; justify-content: center; }

    /* Add-Box-Formulare: volle Breite */
    .form-inline { flex-direction: column; align-items: stretch; }
    .form-inline input, .form-inline select, .form-inline button { width: 100%; }
    .form-inline input[type=email] { min-width: 0; flex: none; }

    /* Rollen-Dropdown in der Mitglieder-Tabelle begrenzen */
    select.role-badge { max-width: 9rem; }

    /* Chat: Panel etwas niedriger für kleine Screens */
    .chat-panel { height: min(24rem, calc(100vh - 10rem)); }
}

/* ------------------------------------------------ Mobile (<640px) */
@media (max-width: 640px) {
    .table th, .table td { padding: .55rem .6rem; font-size: .88rem; }
    .sugg-item { flex-direction: column; align-items: flex-start; gap: .4rem; }
    .exc-head { flex-direction: column; gap: .4rem; }
}

/* ------------------------------------------------ Mobile-Feinschliff */
@media (max-width: 720px) {
    /* iOS Safari: Inputs >= 16px verhindern den Auto-Zoom beim Fokussieren */
    .form input[type=text], .form input[type=email], .form input[type=password],
    .form input[type=url], .form input[type=date], .form input[type=datetime-local],
    .form input[type=number], .form input[type=time], .form input[type=tel],
    .form textarea, .form select,
    .form-inline input, .form-inline select {
        font-size: 1rem;
    }

    /* Modul-Navigation: ein horizontal scrollbarer Streifen statt
       mehrerer Zeilen Pillen (15 Module passen so auf eine Zeile) */
    .trip-nav {
        flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        margin: 1.1rem -1.25rem .9rem;
        padding: 0 1.25rem .45rem;
        mask-image: linear-gradient(90deg, #000 90%, transparent 99%);
        -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent 99%);
        scroll-padding-inline: 1.25rem;
    }
    .trip-nav::-webkit-scrollbar { display: none; }
    .trip-nav a { flex: 0 0 auto; white-space: nowrap; }
}
@media (max-width: 480px) {
    .trip-nav { margin-left: -.9rem; margin-right: -.9rem; padding-left: .9rem; padding-right: .9rem; }
}
@media (max-width: 640px) {
    /* Modul-Menü (14 Module) scrollbar machen */
    .module-menu-panel { max-height: calc(100vh - 7.5rem); overflow-y: auto; }

    /* Kopfbereich: Modul-Menü + Bearbeiten als volle Breite für große Tap-Targets */
    .page-head-actions { width: 100%; }
    .page-head-actions .module-menu { flex: 1 1 0; }
    .module-menu > summary.btn { width: 100%; justify-content: center; }
    .page-head-actions .btn { flex: 1 1 auto; text-align: center; }

    /* Checklisten: etwas kompakter, Icon-Buttons kleiner */
    .checklist li { padding: .55rem .7rem; gap: .5rem; }
    .icon-btn { width: 1.8rem; height: 1.8rem; }

    /* Tagesplan-Zeit + Badges umbrechbar */
    .day-group { font-size: .98rem; }
}

/* Brand: auf kleinen Displays nur die Logo-Marke, ohne Wortmarke */
@media (max-width: 640px) {
    .brand-name { display: none; }
    .brand-logo { width: 30px; height: 30px; }
}

/* Abgelehnte Einladungen: eingeklappt, neutraler Hover */
.declined-toggle > summary { list-style: none; }
.declined-toggle > summary::-webkit-details-marker { display: none; }
.declined-toggle > summary::before { content: '▸ '; color: var(--muted); }
.declined-toggle[open] > summary::before { content: '▾ '; }
.declined-toggle > summary:hover { color: var(--text); }
.declined-toggle .declined-list { margin-top: .4rem; }

/* ------------------------------------------------ Reise-Chat: Blasen-Design */
.chat-grip {
    display: none;
}
.chat-msg {
    border-radius: 16px;
    box-shadow: 0 1px 2px rgb(15 23 42 / .06);
}
.chat-msg:not(.mine) { border-bottom-left-radius: 5px; }
.chat-msg.mine {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border-color: transparent; color: #fff;
    border-bottom-right-radius: 5px;
}
.chat-msg.mine .chat-msg-head strong { color: #fff; }
.chat-msg.mine .chat-msg-head small { color: rgb(255 255 255 / .72); }
.chat-msg-head { margin-bottom: .15rem; }
.chat-day {
    align-self: center; font-size: .72rem; font-weight: 600; color: var(--muted);
    background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
    padding: .15rem .7rem; margin: .15rem 0;
}
.chat-day-new { background: var(--primary-soft); color: var(--primary-dark); border-color: #c7d2fe; }
.chat-older { padding: .25rem .8rem 0; text-align: center; }
.chat-older .btn { font-size: .78rem; }
.chat-older[hidden], .chat-older .btn[hidden] { display: none; }

/* ------------------------------------------------ Reise-Chat: Mobile Bottom-Sheet */
/* Unter 640px: Panel wird zum Bottom-Sheet (abgerundete Oberkante,
   ~85% der *sichtbaren* Höhe). Die Höhe + Unterkante werden per JS an
   window.visualViewport gekoppelt – die mobile Tastatur schiebt das
   Sheet nach oben statt Kopfzeile/Eingabe zu verdecken. */
@media (max-width: 640px) {
    .chat-grip {
        display: block; width: 2.4rem; height: .3rem; margin: .45rem auto .1rem;
        border-radius: 999px; background: rgb(100 116 139 / .3);
    }
    .chat-panel {
        top: auto; left: 0; right: 0; bottom: 0; width: auto;
        height: auto; max-height: none;
        border: none; border-bottom: none;
        border-radius: 18px 18px 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        animation: chat-slide-up .25s cubic-bezier(.2,.7,.3,1) both;
    }
    .chat-head { border-radius: 0; }
    .chat-msgs { padding: .7rem .8rem; gap: .45rem; }
    .chat-msg { max-width: 84%; }
    .chat-form { padding: .55rem .7rem; gap: .55rem; }
    .chat-form textarea {
        font-size: 1rem; padding: .6rem 1rem; border-radius: 999px;
    }
    .chat-form .btn { border-radius: 999px; min-width: 2.6rem; }
}
@keyframes chat-slide-up {
    from { transform: translateY(2rem); opacity: .4; }
    to   { transform: none; opacity: 1; }
}
