/* Groove-Docs – Basis-Styles (mobile first, hell/dunkel automatisch) */

:root {
    --bg: #f5f4f1;
    --surface: #ffffff;
    --surface-2: #f0efeb;
    --text: #1d1f24;
    --muted: #6b7079;
    --border: #e2e0da;
    --accent: #e8590c;
    --accent-hover: #d9480f;
    --accent-soft: #fff0e6;
    --on-accent: #ffffff;
    --topbar: #191c24;
    --topbar-text: #e9eaee;

    --c-auftritt: #e8590c;
    --c-probe: #1c7ed6;
    --c-sonstiges: #868e96;
    --c-anfrage: #e67700;
    --c-bestaetigt: #2b8a3e;
    --c-abgesagt: #c92a2a;
    --c-dabei: #2b8a3e;
    --c-vielleicht: #e67700;
    --c-nein: #c92a2a;
    --c-offen: #868e96;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(20, 20, 30, .06), 0 2px 8px rgba(20, 20, 30, .04);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
    --tabbar-h: 62px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121419;
        --surface: #1b1e25;
        --surface-2: #232730;
        --text: #e8e9ec;
        --muted: #9aa0aa;
        --border: #2d313b;
        --accent: #ff7a2e;
        --accent-hover: #ff8f4f;
        --accent-soft: #3a2316;
        --on-accent: #1a0d05;
        --topbar: #0c0e12;
        --c-probe: #4dabf7;
        --c-bestaetigt: #51cf66;
        --c-dabei: #51cf66;
        --c-anfrage: #fcc419;
        --c-vielleicht: #fcc419;
        --c-abgesagt: #ff6b6b;
        --c-nein: #ff6b6b;
        --shadow: none;
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 var(--font);
}

body.has-nav { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
pre { font-family: var(--mono); }
img { max-width: 100%; }

.icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex-shrink: 0; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.strike { text-decoration: line-through; }
.prewrap { white-space: pre-wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.inline { display: inline; margin: 0; }
[hidden] { display: none !important; }

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

.container { max-width: 1120px; margin: 0 auto; padding: 16px; }

.topbar { background: var(--topbar); color: var(--topbar-text); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 16px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.1rem; letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 7px; }
.mainnav { display: none; gap: 4px; flex: 1; }
.mainnav a, .usermenu a, .icon-link {
    color: var(--topbar-text); display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px;
    border-radius: 8px; font-size: .95rem; opacity: .85; background: none; border: 0; cursor: pointer; font: inherit;
}
.mainnav a:hover, .usermenu a:hover, .icon-link:hover { opacity: 1; background: rgba(255, 255, 255, .08); text-decoration: none; }
.mainnav a.active, .usermenu a.active { opacity: 1; background: rgba(255, 255, 255, .12); }
.usermenu { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.usermenu-name span { display: none; }

.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex;
    background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom); height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .7rem; }
.tabbar a .icon { width: 24px; height: 24px; }
.tabbar a.active { color: var(--accent); }
.tabbar a:hover { text-decoration: none; }

@media (min-width: 900px) {
    body.has-nav { padding-bottom: 0; }
    .tabbar { display: none; }
    .mainnav { display: flex; }
    .usermenu-name span { display: inline; }
    .container { padding: 24px; }
    h1 { font-size: 1.9rem; }
}

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.subtitle { margin: 4px 0 0; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; margin-bottom: 4px; color: var(--muted); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; font-weight: 600; color: var(--accent); margin-bottom: 4px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack > * { margin-bottom: 0; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 900px) {
    .grid-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; align-items: start; }
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 560px; }
.card.highlight { border-color: var(--accent); background: var(--accent-soft); margin-bottom: 16px; }
.card > :last-child { margin-bottom: 0; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }

/* ---------------------------------------------------------------- Buttons */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 40px; padding: 8px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    font: inherit; font-weight: 500; font-size: .95rem; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-sm { min-height: 34px; padding: 5px 10px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn-icon { min-height: 38px; width: 38px; padding: 0; }
.btn-danger-ghost { color: var(--c-abgesagt); }
.btn-danger-ghost:hover { background: rgba(201, 42, 42, .08); border-color: var(--c-abgesagt); }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

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

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: .875rem; font-weight: 600; }
.field.grow { flex: 1; }
.hint { color: var(--muted); font-size: .8rem; }

input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=number],
input[type=date], input[type=time], select, textarea {
    width: 100%; padding: 9px 11px; min-height: 42px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font: inherit;
}
textarea { resize: vertical; min-height: 80px; }
textarea.mono { font-family: var(--mono); font-size: .9rem; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type=file] { font: inherit; max-width: 100%; }

.form-grid { display: grid; gap: 12px 16px; }
@media (min-width: 640px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .form-grid .full { grid-column: 1 / -1; }
}
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 4px 0; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }

.segmented { display: flex; border: 0; padding: 0; margin: 0 0 16px; gap: 6px; flex-wrap: wrap; }
.seg { flex: 1; min-width: 90px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
    display: block; text-align: center; padding: 10px; border-radius: var(--radius-sm); border: 2px solid var(--border);
    cursor: pointer; font-weight: 600; background: var(--surface);
}
.seg input:checked + span { border-color: var(--seg-c, var(--accent)); color: var(--seg-c, var(--accent)); background: color-mix(in srgb, var(--seg-c, var(--accent)) 10%, var(--surface)); }
.seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.seg-auftritt { --seg-c: var(--c-auftritt); }
.seg-probe { --seg-c: var(--c-probe); }
.seg-sonstiges { --seg-c: var(--c-sonstiges); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; padding: 12px; }
.filter-bar .field { flex: 1 1 160px; }
.filter-bar .field.grow { flex: 3 1 240px; }

.copy-field { display: flex; gap: 6px; }
.copy-field input { font-family: var(--mono); font-size: .8rem; }

.link-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.link-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.link-row input[name="link_url[]"] { grid-column: 1 / 2; }
.link-row input[name="link_label[]"] { grid-column: 1 / 2; }
.link-row .btn-icon { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
@media (min-width: 640px) {
    .link-row { grid-template-columns: 200px 1fr auto; }
    .link-row input[name="link_label[]"], .link-row input[name="link_url[]"] { grid-column: auto; }
    .link-row .btn-icon { grid-column: auto; grid-row: auto; }
}

.inline-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inline-form select { width: auto; flex: 1; min-width: 160px; }

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

.flash { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; border: 1px solid; word-break: break-word; }
.flash-success { background: color-mix(in srgb, var(--c-bestaetigt) 12%, var(--surface)); border-color: color-mix(in srgb, var(--c-bestaetigt) 40%, transparent); }
.flash-error { background: color-mix(in srgb, var(--c-abgesagt) 12%, var(--surface)); border-color: color-mix(in srgb, var(--c-abgesagt) 40%, transparent); }
.flash-info { background: color-mix(in srgb, var(--c-probe) 12%, var(--surface)); border-color: color-mix(in srgb, var(--c-probe) 40%, transparent); }

/* ---------------------------------------------------------------- Badges */

.badge {
    display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; line-height: 1;
    padding: 4px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); vertical-align: middle; white-space: nowrap;
}
.badge.tiny { font-size: .65rem; padding: 2px 6px; }
.badge .icon { width: 12px; height: 12px; }
.badge-auftritt { background: color-mix(in srgb, var(--c-auftritt) 15%, transparent); color: var(--c-auftritt); }
.badge-probe { background: color-mix(in srgb, var(--c-probe) 15%, transparent); color: var(--c-probe); }
.badge-sonstiges { background: color-mix(in srgb, var(--c-sonstiges) 18%, transparent); color: var(--c-sonstiges); }
.badge-anfrage { background: color-mix(in srgb, var(--c-anfrage) 18%, transparent); color: var(--c-anfrage); }
.badge-bestaetigt { background: color-mix(in srgb, var(--c-bestaetigt) 15%, transparent); color: var(--c-bestaetigt); }
.badge-abgesagt { background: color-mix(in srgb, var(--c-abgesagt) 15%, transparent); color: var(--c-abgesagt); }
.badge-song-in_arbeit { background: color-mix(in srgb, var(--c-probe) 15%, transparent); color: var(--c-probe); }
.badge-song-archiv { background: var(--surface-2); color: var(--muted); }
.badge-song-repertoire { background: color-mix(in srgb, var(--c-bestaetigt) 15%, transparent); color: var(--c-bestaetigt); }
.badge-telegram { background: color-mix(in srgb, #229ed9 15%, transparent); color: #229ed9; }

.key-badge {
    display: inline-block; min-width: 2.2em; text-align: center; font-weight: 700; font-size: .85rem;
    padding: 2px 7px; border-radius: 6px; background: var(--topbar); color: #fff; font-family: var(--mono);
}
.key-badge.big { font-size: 1.1rem; padding: 4px 10px; }

/* ---------------------------------------------------------------- Tabs & Chips */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tabs { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.tabs a { padding: 6px 14px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs a:hover { text-decoration: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); font-size: .875rem; background: var(--surface); }
.chips a.active { background: var(--text); border-color: var(--text); color: var(--surface); }
.chips a:hover { text-decoration: none; border-color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------------------------------------------------------------- Termine */

.event-list { display: flex; flex-direction: column; gap: 10px; }
.month-head { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 0; }
.month-head:first-child { margin-top: 0; }

.event-item {
    display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 12px; align-items: start;
    background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c-sonstiges);
    border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow);
}
.event-item.type-auftritt { border-left-color: var(--c-auftritt); }
.event-item.type-probe { border-left-color: var(--c-probe); }
.event-item.is-cancelled { opacity: .6; }
.event-item.is-cancelled .event-title { text-decoration: line-through; }
.event-side { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 6px; border-top: 1px dashed var(--border); margin-top: 4px; }
.event-side:empty { display: none; }
@media (min-width: 700px) {
    .event-item { grid-template-columns: 56px minmax(0, 1fr) auto; }
    .event-side { grid-column: auto; flex-direction: column; align-items: flex-end; border: 0; padding: 0; margin: 0; }
}

.datebox { display: flex; flex-direction: column; align-items: center; line-height: 1.05; background: var(--surface-2); border-radius: 10px; padding: 6px 0; color: var(--text); }
.datebox:hover { text-decoration: none; }
.datebox-wd { font-size: .7rem; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.datebox-day { font-size: 1.45rem; font-weight: 800; }
.datebox-mon { font-size: .7rem; text-transform: uppercase; color: var(--muted); }

.event-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.event-title { font-size: 1.05rem; margin: 0 0 2px; }
.event-title a { color: var(--text); }
.event-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; color: var(--muted); font-size: .875rem; }
.event-meta span { display: inline-flex; gap: 4px; align-items: center; }

.open-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.open-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.open-list li div { display: flex; flex-direction: column; }

.next-gig h2 a { color: var(--text); }

/* Zu-/Absage */
.att-buttons { display: inline-flex; gap: 4px; margin: 0; flex-wrap: wrap; }
.att-btn {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
    font: inherit; font-size: .9rem; cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
}
.att-btn:active { transform: scale(.96); }
.att-btn .att-icon { filter: grayscale(1); opacity: .6; transition: filter .15s, opacity .15s; }
.att-btn:hover .att-icon, .att-btn.active .att-icon { filter: none; opacity: 1; }
.att-btn.active.att-dabei { border-color: var(--c-dabei); background: color-mix(in srgb, var(--c-dabei) 14%, var(--surface)); font-weight: 600; }
.att-btn.active.att-vielleicht { border-color: var(--c-vielleicht); background: color-mix(in srgb, var(--c-vielleicht) 14%, var(--surface)); font-weight: 600; }
.att-btn.active.att-nein { border-color: var(--c-nein); background: color-mix(in srgb, var(--c-nein) 14%, var(--surface)); font-weight: 600; }
.att-buttons.compact .att-btn { padding: 4px 10px; min-width: 44px; justify-content: center; font-size: 1.05rem; }
.att-buttons.is-busy { opacity: .6; pointer-events: none; }

.att-counts { display: inline-flex; gap: 8px; font-size: .8rem; color: var(--muted); }
.att-count.zero { opacity: .45; }
.att-count b { color: var(--text); font-weight: 600; }

.my-attendance { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); margin: 8px 0 12px; }
.my-attendance p { margin: 0; }

.attendance-list { list-style: none; margin: 0; padding: 0; }
.att-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.att-row:first-child { border-top: 0; }
.att-row > .att-icon { font-size: 1.1rem; line-height: 1.4; }
.att-row.status-offen > .att-icon { opacity: .6; }
.att-person { flex: 1; min-width: 0; }
.att-person .muted { margin-left: 4px; }
.att-comment { font-size: .875rem; color: var(--muted); font-style: italic; }
.att-other summary { cursor: pointer; list-style: none; padding: 4px 6px; border-radius: 6px; }
.att-other summary::-webkit-details-marker { display: none; }
.att-other[open] summary { margin-bottom: 6px; }
.att-other { text-align: right; }

.danger-zone { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--border); }

/* Fakten-Liste */
.facts { display: grid; gap: 10px 16px; margin: 0 0 12px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.facts div { min-width: 0; }
.facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }

/* Anwesenheitsmatrix */
.matrix th, .matrix td { text-align: center; }
.matrix .sticky-col { position: sticky; left: 0; background: var(--surface); text-align: left; z-index: 1; min-width: 180px; max-width: 260px; font-weight: 500; }
.matrix tbody .sticky-col a { color: var(--text); display: block; }
.matrix .member-col { font-size: .8rem; min-width: 56px; }
.matrix .cell { font-size: 1.1rem; }
.matrix .cell.status-offen { opacity: .45; }
.matrix .cell.sum { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.matrix tr.is-cancelled { opacity: .5; }
.matrix tr.type-auftritt .sticky-col { box-shadow: inset 4px 0 0 var(--c-auftritt); }
.matrix tr.type-probe .sticky-col { box-shadow: inset 4px 0 0 var(--c-probe); }
.matrix sup { font-size: .6rem; }

/* ---------------------------------------------------------------- Tabellen */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.table thead th a { color: var(--muted); }
.table thead th a.sorted { color: var(--text); }
.table thead th a.sorted::after { content: " ▾"; }
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.song-title { font-weight: 600; color: var(--text); }
tr.is-archived { opacity: .6; }
.hide-sm, .hide-md { display: none; }
@media (min-width: 640px) { .hide-sm { display: table-cell; } }
@media (min-width: 900px) { .hide-md { display: table-cell; } }

/* ---------------------------------------------------------------- Songs */

.lyrics { white-space: pre-wrap; font-family: var(--mono); font-size: .9rem; line-height: 1.5; margin: 0; background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); max-height: 70vh; overflow: auto; }
.link-list, .file-list, .plain-list { list-style: none; margin: 0; padding: 0; }
.link-list li { padding: 8px 0; border-top: 1px solid var(--border); }
.link-list li:first-child { border-top: 0; }
.link-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.yt-slot { margin-top: 8px; aspect-ratio: 16 / 9; }
.yt-slot iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius-sm); }
.file-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.file-list li:first-child { border-top: 0; }
.file-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.file-info { flex: 1; min-width: 140px; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.file-actions { display: flex; gap: 4px; }
.file-actions form { margin: 0; }
.upload-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.plain-list li { padding: 4px 0; }

/* ---------------------------------------------------------------- Setlist */

.setlist-layout { display: grid; gap: 16px; }
@media (min-width: 900px) { .setlist-layout { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; gap: 24px; } }
.setlist { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sl-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 4px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-sm); user-select: none; touch-action: pan-y;
}
.sl-item.is-dragging { opacity: .9; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); z-index: 5; position: relative; border-color: var(--accent); }
.sl-item.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.sl-handle { cursor: grab; padding: 6px 4px; color: var(--muted); touch-action: none; display: flex; }
.sl-handle:active { cursor: grabbing; }
.sl-num { width: 1.8em; text-align: right; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.sl-main { flex: 1; min-width: 0; }
.sl-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.sl-sub { font-size: .8rem; color: var(--muted); }
.sl-item input { min-height: 34px; padding: 5px 8px; }
.sl-item .sl-dur { width: 80px; flex-shrink: 0; }
.sl-actions { display: flex; gap: 2px; }
.sl-actions .btn-icon { min-height: 32px; width: 32px; border-color: transparent; background: none; }
.sl-actions .btn-icon:hover { background: var(--surface-2); }
.sl-item.type-set { background: var(--topbar); color: #fff; border-color: var(--topbar); }
.sl-item.type-set input { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .2); font-weight: 700; }
.sl-item.type-set .sl-handle, .sl-item.type-set .sl-actions .btn-icon { color: #fff; }
.sl-item.type-pause { background: var(--surface-2); border-style: dashed; }
.sl-item.type-notiz { background: color-mix(in srgb, var(--c-probe) 8%, var(--surface)); border-style: dashed; }
.set-total { font-size: .75rem; opacity: .75; white-space: nowrap; }
.setlist-tools { margin-bottom: 16px; }
.save-bar {
    position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); display: flex; justify-content: flex-end; align-items: center; gap: 12px;
    background: var(--surface); padding: 10px 0 0; border-top: 1px solid var(--border); margin: 0;
}
@media (min-width: 900px) { .save-bar { bottom: 8px; } }
.empty-hint { text-align: center; padding: 20px; border: 2px dashed var(--border); border-radius: var(--radius-sm); }

.song-picker { list-style: none; margin: 8px 0 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.song-picker li { border-top: 1px solid var(--border); }
.song-picker button {
    width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 4px; background: none; border: 0;
    color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.song-picker button:hover { background: var(--surface-2); }
.song-picker .pick-main { flex: 1; min-width: 0; }
.song-picker .pick-title { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-picker .pick-sub { font-size: .8rem; color: var(--muted); }
.song-picker .in-list .pick-title::after { content: " ✓"; color: var(--c-dabei); }
.song-picker .pick-add { color: var(--accent); }

.setlist-preview { margin: 0 0 12px; padding-left: 1.8em; }
.setlist-preview li { padding: 3px 0; }
.setlist-preview li > span:first-child { margin-right: 6px; }
.setlist-preview li.pause, .setlist-preview li.note { list-style: none; margin-left: -1.4em; color: var(--muted); font-style: italic; }
.set-head { margin: 12px 0 4px; font-size: .95rem; }

/* ---------------------------------------------------------------- Mitglieder */

.member-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.member { display: grid; grid-template-columns: 48px 1fr; gap: 12px; }
.member.is-inactive { opacity: .55; }
.member h3 { margin: 0; }
.member p { margin: 2px 0; }
.member-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.member-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.member-actions form { margin: 0; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; }

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

.auth-page main { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.auth-card { width: 100%; max-width: 420px; padding: 24px; }
.auth-card.wide { max-width: 640px; }
.auth-logo { text-align: center; margin-bottom: 16px; }
.auth-logo img { border-radius: 14px; }
.auth-logo h1 { margin: 8px 0 2px; }

.steps { padding-left: 1.3em; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.mail-preview pre { margin: 0; font-family: var(--font); font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.tg-preview { background: var(--surface-2); padding: 10px; border-radius: 10px; font-size: .9rem; overflow-wrap: anywhere; }
.tg-buttons { display: flex; gap: 4px; margin: 6px 0 0; }
.tg-buttons span { flex: 1; text-align: center; padding: 6px; border-radius: 8px; background: var(--surface-2); font-size: .85rem; }
.error-trace { text-align: left; white-space: pre-wrap; font-size: .8rem; background: var(--surface-2); padding: 12px; border-radius: 8px; overflow: auto; max-height: 60vh; }

@media print {
    .topbar, .tabbar, .actions, .btn, form { display: none !important; }
    body { background: #fff; color: #000; }
    .card { border: 0; box-shadow: none; }
}

/* ---------------------------------------------------------------- Anmeldung & Geräte */

.btn-lg { min-height: 52px; font-size: 1.1rem; }
.mono-input { font-family: var(--mono); }
.device-list { list-style: none; margin: 0; padding: 0; }
.device-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.device-list li:first-child { border-top: 0; }
.device-list .muted { flex-basis: 100%; }
.app-tip ul { margin: 0; padding-left: 1.2em; }
.app-tip li { margin-bottom: 4px; }

/* ---------------------------------------------------------------- Kalender-Menü, Reihen, Schalter */

.event-side-row { display: flex; align-items: center; gap: 10px; }
.cal-menu { position: relative; display: inline-block; }
.cal-menu > summary { list-style: none; cursor: pointer; }
.cal-menu > summary::-webkit-details-marker { display: none; }
.cal-menu[open] > summary { border-color: var(--accent); color: var(--accent); }
.btn-cal { min-height: 34px; width: 34px; }
.cal-menu-list {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(300px, calc(100vw - 32px));
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15); padding: 6px; display: flex; flex-direction: column;
}
.cal-menu-list a { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 6px; color: var(--text); font-size: .92rem; }
.cal-menu-list a:hover { background: var(--surface-2); text-decoration: none; }
.cal-menu-head { margin: 6px 10px 2px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cal-menu-head .muted { text-transform: none; font-weight: 500; letter-spacing: 0; }
.cal-menu-list .cal-menu-foot { font-size: .78rem; color: var(--muted); border-top: 1px solid var(--border); margin-top: 4px; border-radius: 0; }
/* Auf dem Handy als Leiste über der Navigation, damit nichts aus dem Bildschirm ragt */
@media (max-width: 699px) {
    .cal-menu-list {
        position: fixed; left: 12px; right: 12px; top: auto; width: auto;
        bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);
        box-shadow: 0 -6px 30px rgba(0, 0, 0, .25);
    }
    .cal-menu-list a { padding: 13px 10px; font-size: 1rem; }
}

.badge-series { background: color-mix(in srgb, var(--c-probe) 10%, transparent); color: var(--c-probe); }
.series-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; padding: 10px 14px; background: color-mix(in srgb, var(--c-probe) 7%, var(--surface)); }

.switch-form { margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; padding: 4px 0; }
.switch-track { width: 40px; height: 22px; border-radius: 999px; background: var(--border); position: relative; transition: background .15s; flex-shrink: 0; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: left .15s; }
.switch.on .switch-track { background: var(--c-probe); }
.switch.on .switch-thumb { left: 21px; }
.hidden-hint { margin: -4px 0 10px; }
