/* Musical-Werkstatt Sonnenland – Ensemble-App
   Farben aus dem Logo (Sonne: Gelb → Orange → Rot) und dem Blau der Website. */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(fonts/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(fonts/barlow-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Raleway"; font-weight: 300; font-display: swap; src: url(fonts/raleway-latin-300-normal.woff2) format("woff2"); }
@font-face { font-family: "Raleway"; font-weight: 500; font-display: swap; src: url(fonts/raleway-latin-500-normal.woff2) format("woff2"); }

:root {
    --sun-1: #FFC63A;
    --sun-2: #F5901E;
    --sun-3: #E5422B;
    --sun: linear-gradient(120deg, var(--sun-1) 0%, var(--sun-2) 50%, var(--sun-3) 100%);
    --accent: #E8701A;
    --accent-ink: #B4500A;
    --blue: #1C4587;
    --blue-2: #2965C6;
    --bg: #FFFAF3;
    --card: #FFFFFF;
    --ink: #2F2F2F;
    --muted: #7A7066;
    --line: #F0E4D4;
    --soft: #FFF2E2;
    --own: #FFE7CC;
    --ok: #2E8B57;
    --warn: #C77700;
    --err: #C62828;
    --shadow: 0 1px 2px rgba(120, 70, 20, .06), 0 4px 16px rgba(120, 70, 20, .06);
    --radius: 14px;
    --top-h: 64px;
    --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-head: "Raleway", "Barlow", system-ui, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --accent: #FF9A3C;
        --accent-ink: #FFB066;
        --blue: #9DB9F2;
        --blue-2: #7FA6F0;
        --bg: #16120E;
        --card: #211B16;
        --ink: #F2ECE4;
        --muted: #A99D90;
        --line: #3A2F25;
        --soft: #2C231B;
        --own: #4A2E14;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.45;
    color: var(--ink);
    background: var(--bg);
}
a { color: var(--blue-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 500; line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.7rem; font-weight: 300; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.08rem; }
img { max-width: 100%; }
code, pre { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; }
.muted { color: var(--muted); }
.small, small { font-size: .85rem; }
.pad { padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------- Kopfzeile ---------- */
.topbar {
    position: sticky; top: 0; z-index: 20;
    height: var(--top-h);
    display: flex; align-items: center; gap: 24px;
    padding: 0 20px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
}
.topbar::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
    background: var(--sun);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none !important; }
.brand img { height: 38px; width: auto; border-radius: 8px; background: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; font-family: var(--font-head); font-weight: 300; }
.brand-a { font-size: 1.05rem; color: var(--muted); letter-spacing: .01em; }
.brand-b { font-size: 1.15rem; color: var(--sun-2); letter-spacing: .08em; }

.mainnav { display: flex; gap: 4px; margin-left: auto; }
.mainnav a {
    position: relative;
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 999px;
    color: var(--muted); font-weight: 600; text-decoration: none;
}
.mainnav a:hover { background: var(--soft); color: var(--ink); }
.mainnav a.active { background: var(--soft); color: var(--accent-ink); }
.mainnav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mainnav .badge { position: absolute; top: 2px; left: 26px; }

.badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    background: var(--sun-3); color: #fff; font-size: .72rem; font-weight: 600; font-style: normal;
}

/* ---------- Inhalt ---------- */
.main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 48px; }
.main-chat { max-width: none; padding: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1, .page-head h2 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { margin: 0 0 12px; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.cols > .card { margin-bottom: 0; }
.cols + .card, .cols + .cols { margin-top: 16px; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack > * { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prose { white-space: normal; margin: 12px 0; }
.tag {
    display: inline-block; padding: 1px 9px; border-radius: 999px;
    background: var(--soft); color: var(--accent-ink); font-size: .78rem; font-weight: 600;
}

/* ---------- Formulare ---------- */
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .92rem; }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea {
    font: inherit; font-weight: 400; color: var(--ink);
    background: var(--card);
    border: 1.5px solid var(--line); border-radius: 10px;
    padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sun-2); box-shadow: 0 0 0 3px rgba(245, 144, 30, .18); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--sun-2); flex: none; padding: 0; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
fieldset.box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
legend { font-weight: 600; font-size: .92rem; padding: 0 4px; }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; max-height: 360px; overflow: auto; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: inherit; font-weight: 600; cursor: pointer;
    border: 1.5px solid transparent; border-radius: 999px;
    padding: 10px 22px; text-decoration: none !important;
    transition: transform .08s, filter .15s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-sun { background: var(--sun); color: #fff; text-shadow: 0 1px 2px rgba(150, 50, 0, .35); }
.btn-sun:hover { filter: brightness(1.05) saturate(1.05); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--soft); }
.btn-danger { background: transparent; border-color: var(--err); color: var(--err); }
.btn-small { padding: 6px 14px; font-size: .88rem; }
.danger-text { color: var(--err); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.row-actions form { margin: 0; }

.flashes { max-width: 1100px; margin: 16px auto 0; padding: 0 20px; }
.page-chat .flashes { position: fixed; top: calc(var(--top-h) + 10px); left: 50%; transform: translateX(-50%); width: min(560px, 92vw); z-index: 30; margin: 0; padding: 0; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 10px; border-left: 4px solid; background: var(--card); box-shadow: var(--shadow); }
.flash-ok { border-color: var(--ok); }
.flash-err { border-color: var(--err); }
.flash-info { border-color: var(--blue-2); }

/* ---------- Anmeldung ---------- */
body.plain {
    min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
    background:
        radial-gradient(ellipse at 50% -10%, rgba(255, 198, 58, .35), transparent 60%),
        radial-gradient(ellipse at 100% 100%, rgba(229, 66, 43, .12), transparent 50%),
        var(--bg);
}
.auth-card { width: min(420px, 100%); background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 28px 28px 22px; border: 1px solid var(--line); }
.auth-logo { display: block; margin: -8px auto 8px; width: 210px; height: auto; }
.auth-logo img { width: 100%; height: auto; display: block; border-radius: 12px; }
.auth-title { text-align: center; font-size: 1.5rem; }
.auth-links { text-align: center; font-size: .92rem; margin: 18px 0 0; line-height: 1.9; }
.checks { list-style: none; padding: 0; margin: 0 0 16px; }
.checks .ok { color: var(--ok); }
.checks .bad { color: var(--err); font-weight: 600; }

/* ---------- Chat ---------- */
.chat {
    display: grid; grid-template-columns: 300px 1fr;
    height: calc(100dvh - var(--top-h));
}
.chat-list { border-right: 1px solid var(--line); background: var(--card); overflow-y: auto; padding-bottom: 20px; }
.list-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 16px 6px; }
.list-head h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0; font-family: var(--font); font-weight: 600; }
.chan {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 16px; color: var(--ink); text-decoration: none !important;
    border-left: 3px solid transparent;
}
.chan:hover { background: var(--soft); }
.chan.active { background: var(--soft); border-left-color: var(--sun-2); }
.chan-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan.has-unread .chan-name { font-weight: 600; }
.avatar {
    flex: none; width: 38px; height: 38px; border-radius: 12px;
    display: grid; place-items: center;
    font-weight: 600; color: #fff;
    background: var(--sun);
}
.avatar-person { border-radius: 50%; background: hsl(var(--hue, 30) 55% 52%); }

.newdm { position: relative; }
.newdm summary { list-style: none; }
.newdm summary::-webkit-details-marker { display: none; }
.newdm-pop {
    position: absolute; right: 0; top: 36px; z-index: 10; width: 250px;
    background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
    padding: 8px;
}
.newdm-list { max-height: 300px; overflow: auto; margin-top: 6px; }
.newdm-list a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--ink); }
.newdm-list a:hover { background: var(--soft); text-decoration: none; }

.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.chat-empty { margin: auto; text-align: center; color: var(--muted); padding: 20px; }
.chat-empty img { opacity: .9; border-radius: 16px; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.chat-head h1 { font-size: 1.25rem; margin: 0; font-weight: 500; }
.chat-head p { margin: 0; }
.chat-head .back { display: none; font-size: 2rem; line-height: 1; padding: 0 8px 4px 0; color: var(--accent); text-decoration: none; }

.messages { flex: 1; overflow-y: auto; padding: 16px 20px 8px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.load-older { align-self: center; margin-bottom: 10px; }
.day-sep { align-self: center; margin: 14px 0 8px; font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--soft); padding: 3px 12px; border-radius: 999px; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: min(640px, 82%); margin-top: 8px; }
.msg.cont { margin-top: 0; }
.msg.own { align-self: flex-end; align-items: flex-end; }
.msg .who { font-size: .8rem; font-weight: 600; color: var(--blue); margin: 0 12px 2px; }
.msg.own .who, .msg.cont .who { display: none; }
.bubble {
    position: relative;
    background: var(--card); border: 1px solid var(--line);
    padding: 7px 12px 6px; border-radius: 16px 16px 16px 6px;
    white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.cont .bubble { border-top-left-radius: 6px; }
.msg.own .bubble { background: var(--own); border-color: transparent; border-radius: 16px 16px 6px 16px; }
.msg.own.cont .bubble { border-top-right-radius: 6px; }
.bubble .time { float: right; margin: 6px 0 -4px 10px; font-size: .7rem; color: var(--muted); }
.bubble.deleted { font-style: italic; color: var(--muted); background: transparent; }
.bubble .file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 2px 0 4px; border-radius: 10px; background: var(--soft); color: var(--ink); text-decoration: none; white-space: normal; }
.msg.own .bubble .file { background: rgba(255, 255, 255, .55); }
.bubble .file b { display: block; font-weight: 600; word-break: break-all; }
.bubble .file span.ic { font-size: 1.5rem; }
.bubble img.preview { display: block; max-width: min(320px, 100%); max-height: 320px; border-radius: 10px; margin: 2px 0 4px; cursor: zoom-in; }
.bubble audio { display: block; width: 260px; max-width: 100%; margin: 4px 0; }
.msg .del { opacity: 0; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .75rem; padding: 2px 8px; }
.msg:hover .del, .msg:focus-within .del { opacity: 1; }

.composer {
    display: flex; align-items: flex-end; gap: 8px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: var(--card); border-top: 1px solid var(--line);
}
.composer-main { flex: 1; min-width: 0; }
.composer textarea { resize: none; max-height: 160px; border-radius: 20px; padding: 9px 16px; line-height: 1.35; display: block; }
.attach-name { font-size: .82rem; color: var(--accent-ink); padding: 0 8px 4px; display: flex; gap: 8px; align-items: center; }
.attach-name button { border: 0; background: none; color: var(--err); cursor: pointer; font-size: 1rem; }
.attach, .send {
    flex: none; width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer; border: 0; padding: 0;
}
.attach { color: var(--muted); background: transparent; }
.attach:hover { background: var(--soft); }
.send { background: var(--sun); color: #fff; }
.send:disabled { filter: grayscale(.6); opacity: .6; }
.attach svg, .send svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .88); display: grid; place-items: center; z-index: 100; cursor: zoom-out; }
.lightbox img { max-width: 95vw; max-height: 92vh; border-radius: 6px; }

/* ---------- Termine ---------- */
.month { font-size: 1rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 26px 0 10px; font-family: var(--font); font-weight: 600; }
.month:first-of-type { margin-top: 8px; }
.event { display: flex; gap: 18px; padding: 16px 18px; border-left: 5px solid var(--line); }
.event.answered-yes { border-left-color: var(--ok); }
.event.answered-maybe { border-left-color: var(--warn); }
.event.answered-no { border-left-color: var(--line); opacity: .78; }
.event.unanswered { border-left-color: var(--sun-2); }
.event h3 { margin: 0 0 4px; font-size: 1.2rem; }
.event h3 a { color: var(--ink); }
.event-body { flex: 1; min-width: 0; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 10px; color: var(--muted); font-size: .92rem; align-items: center; }
.counts { margin: 8px 0 0; color: var(--muted); }
.c-yes { color: var(--ok); }
.c-maybe { color: var(--warn); }
.datebadge {
    flex: none; width: 64px; text-align: center; align-self: flex-start;
    border-radius: 12px; overflow: hidden; background: var(--soft); color: var(--ink);
    display: flex; flex-direction: column; text-decoration: none !important;
}
.datebadge .dow { background: var(--sun); color: #fff; font-size: .75rem; font-weight: 600; padding: 2px 0; text-transform: uppercase; letter-spacing: .08em; }
.datebadge .day { font-size: 1.7rem; font-weight: 600; line-height: 1.2; padding-top: 2px; }
.datebadge .mon { font-size: .8rem; color: var(--muted); padding-bottom: 6px; }
.datebadge.big { width: 84px; }
.datebadge.big .day { font-size: 2.2rem; }

.rsvp { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.rsvp button {
    font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
    padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--muted);
}
.rsvp button:hover { border-color: currentColor; }
.rsvp .rsvp-yes.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.rsvp .rsvp-maybe.on { background: var(--warn); border-color: var(--warn); color: #fff; }
.rsvp .rsvp-no.on { background: var(--err); border-color: var(--err); color: #fff; }
.rsvp-note { flex-basis: 100%; }

.event-detail-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 8px; }
.sub { margin-top: 22px; }
.rsvp-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 22px; }
.rsvp-col { background: var(--soft); border-radius: 12px; padding: 12px 14px; }
.rsvp-col h3 { font-size: .95rem; display: flex; justify-content: space-between; }
.rsvp-col ul { list-style: none; padding: 0; margin: 0; font-size: .95rem; line-height: 1.7; }
.rsvp-col-yes h3 { color: var(--ok); }
.rsvp-col-maybe h3 { color: var(--warn); }
.rsvp-col-no h3 { color: var(--err); }
.count { font-weight: 600; }
.form-card { max-width: 680px; }

/* ---------- Dateien ---------- */
.search input { width: 200px; padding: 6px 14px; border-radius: 999px; }
.folders { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { padding: 6px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .9rem; text-decoration: none !important; }
.chip span { color: var(--muted); font-weight: 400; margin-left: 4px; }
.chip.on { background: var(--sun); color: #fff; border-color: transparent; }
.chip.on span { color: rgba(255, 255, 255, .85); }
.filelist { list-style: none; padding: 4px 0; }
.filelist li { display: flex; gap: 14px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.filelist li:first-child { border-top: 0; }
.ficon { font-size: 1.7rem; flex: none; width: 36px; text-align: center; }
.finfo { flex: 1; min-width: 0; }
.finfo p { margin: 2px 0 0; }
.finfo audio { margin-top: 6px; width: 100%; max-width: 380px; height: 36px; }
.fname { font-weight: 600; color: var(--ink); word-break: break-word; }
.factions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.factions form { margin: 0; }

.dialog { border: 0; border-radius: 18px; padding: 24px; width: min(520px, 94vw); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.dialog::backdrop { background: rgba(40, 20, 0, .45); }

/* ---------- Profil & Verwaltung ---------- */
.people { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px 20px; }
.people li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pname { flex: 1; min-width: 0; }
.subnav { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.subnav a { padding: 8px 14px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; text-decoration: none; }
.subnav a.on { color: var(--accent-ink); border-image: var(--sun) 1; border-bottom-width: 3px; border-bottom-style: solid; }
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.inactive { opacity: .5; }
.table tr.selected td { background: var(--soft); }
.table a { color: var(--ink); }
.status { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.status-ok { background: rgba(46, 139, 87, .14); color: var(--ok); }
.status-wait { background: rgba(41, 101, 198, .12); color: var(--blue-2); }
.status-warn { background: rgba(199, 119, 0, .14); color: var(--warn); }
.status-off { background: var(--soft); color: var(--muted); }
.codebox { background: var(--soft); border-radius: 12px; padding: 14px; border: 2px dashed var(--sun-2); }
.codebox p { margin: 0 0 6px; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 600; letter-spacing: .08em; }
.codebox .code { font-size: 1.6rem; color: var(--accent-ink); }
pre.sample { background: var(--soft); padding: 12px; border-radius: 10px; overflow-x: auto; margin: 0; }
.filter-input { padding: 6px 12px; }

/* ---------- Mobil ---------- */
@media (max-width: 760px) {
    :root { --top-h: 56px; --nav-h: 62px; }
    body { font-size: 16px; }
    .topbar { padding: 0 14px; }
    .brand img { height: 32px; }
    .brand-a { font-size: .92rem; }
    .brand-b { font-size: 1rem; }
    .mainnav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
        margin: 0; gap: 0; justify-content: space-around;
        background: var(--card); border-top: 1px solid var(--line);
        padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    }
    .mainnav a { flex-direction: column; gap: 2px; padding: 6px 8px; font-size: .7rem; border-radius: 12px; flex: 1; max-width: 90px; }
    .mainnav a.active { background: transparent; }
    .mainnav a.active svg { stroke: var(--sun-2); }
    .mainnav .badge { top: 0; left: calc(50% + 6px); }
    .main { padding: 16px 14px calc(var(--nav-h) + 30px + env(safe-area-inset-bottom)); }
    .main-chat { padding: 0; }
    h1 { font-size: 1.45rem; }
    .card { padding: 16px; }

    .chat { grid-template-columns: 1fr; height: calc(100dvh - var(--top-h) - var(--nav-h) - env(safe-area-inset-bottom)); }
    .chat-list { border-right: 0; }
    .chat.has-current .chat-list { display: none; }
    .chat:not(.has-current) .chat-pane { display: none; }
    .chat-head { padding: 10px 12px; }
    .chat-head .back { display: block; }
    .messages { padding: 12px 10px 6px; }
    .msg { max-width: 88%; }
    .msg .del { opacity: 1; }

    .event { gap: 12px; padding: 14px; }
    .datebadge { width: 54px; }
    .datebadge .day { font-size: 1.4rem; }
    .grid2 { grid-template-columns: 1fr; }
    .cols { grid-template-columns: 1fr; }
    .filelist li { flex-wrap: wrap; padding: 12px 14px; }
    .factions { width: 100%; justify-content: flex-start; padding-left: 50px; }
    .search input { width: 150px; }
    .table th:nth-child(2), .table td:nth-child(2), .table th:nth-child(6), .table td:nth-child(6) { display: none; }
}

@media print {
    .topbar, .mainnav, .subnav, .actions, form, .flash { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 0; }
}

/* ---------- Kalender-Abos ---------- */
.source { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.source:first-of-type { border-top: 0; }
.source-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.source h3 { margin: 0 0 2px; }
.source p { margin: 0 0 6px; }
.source details summary { cursor: pointer; color: var(--blue-2); margin: 4px 0; }
.source-form { margin: 10px 0; padding: 12px; background: var(--soft); border-radius: 10px; }
.steps { padding-left: 20px; line-height: 1.7; margin: 0; }
.tag-ext { background: rgba(41, 101, 198, .12); color: var(--blue-2); }

/* ---------- Push ---------- */
.push-device { background: var(--soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.push-device p { margin: 0; }
.push-ios { border-left: 3px solid var(--sun-2); padding-left: 10px; }
.push-banner {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 8px 14px 0; padding: 10px 14px; border-radius: 12px;
    background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .92rem;
}
.push-banner span { flex: 1; min-width: 180px; }
.push-banner .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 2px 6px; }
