:root {
    --red: #c8102e;
    --red-dark: #9f0b23;
    --black: #111111;
    --anthracite: #292929;
    --white: #ffffff;
    --surface: #ffffff;
    --background: #f3f4f6;
    --border: #dfe3e8;
    --muted: #68707c;
    --success: #147d45;
    --warning: #a35b00;
    --danger: #b42318;
    --shadow: 0 8px 24px rgba(17,17,17,.08);
    --radius: 14px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--black);
    font-family: Montserrat, Arial, Helvetica, sans-serif;
    line-height: 1.5;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 10px 24px;
    background: var(--black);
    color: var(--white);
    box-shadow: 0 3px 16px rgba(0,0,0,.22);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--white); }
.brand:hover { text-decoration: none; }
.brand img { width: 48px; height: 48px; object-fit: contain; background: white; border-radius: 50%; padding: 2px; }
.brand span { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-size: 1.05rem; letter-spacing: .04em; }
.brand small { margin-top: 4px; color: #d6d6d6; }
.main-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.main-nav a { color: #f7f7f7; padding: 9px 10px; border-radius: 8px; font-size: .91rem; font-weight: 600; }
.main-nav a:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.user-menu { display: flex; align-items: center; gap: 12px; }
.user-menu > span { display: flex; flex-direction: column; text-align: right; font-size: .9rem; }
.user-menu small { color: #bdbdbd; }
.menu-button { display: none; background: transparent; border: 0; color: white; font-size: 1.55rem; cursor: pointer; }

.page-container { width: min(1400px, calc(100% - 32px)); margin: 28px auto 50px; }
.guest-body { background: radial-gradient(circle at top left, #3a0e17, var(--black) 42%, #090909); }
.guest-container { width: min(520px, calc(100% - 32px)); margin: 7vh auto 3vh; }
.site-footer { padding: 18px; color: var(--muted); text-align: center; font-size: .82rem; }
.guest-body .site-footer { color: #aaa; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -.03em; }
.page-heading p { margin: 6px 0 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 20px;
}
.card h2, .card h3 { margin-top: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.card-header h2 { margin: 0; }
.card-subtle { background: #fafafa; box-shadow: none; }
.login-card { padding: 32px; }
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand img { width: 132px; height: 132px; object-fit: contain; background: white; border-radius: 50%; }
.login-brand h1 { color: white; margin-bottom: 4px; }
.login-brand p { color: #bdbdbd; margin: 0; }
.login-card h2 { margin-top: 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { position: relative; overflow: hidden; }
.metric::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--red); }
.metric .value { display: block; font-size: 2rem; font-weight: 800; line-height: 1; margin: 4px 0 10px; }
.metric .label { color: var(--muted); font-weight: 600; font-size: .9rem; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--red);
    color: white;
    padding: 10px 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: .15s ease;
}
.button:hover { background: var(--red-dark); color: white; text-decoration: none; transform: translateY(-1px); }
.button-secondary { background: var(--black); }
.button-secondary:hover { background: var(--anthracite); }
.button-ghost { background: transparent; border-color: rgba(255,255,255,.38); }
.button-ghost:hover { background: rgba(255,255,255,.12); }
.button-light { background: white; border-color: var(--border); color: var(--black); }
.button-light:hover { background: #f5f5f5; color: var(--black); }
.button-danger { background: var(--danger); }
.button-small { padding: 7px 10px; font-size: .82rem; }
.button[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label { font-weight: 700; font-size: .88rem; }
.help { color: var(--muted); font-size: .8rem; }
input, select, textarea {
    width: 100%;
    border: 1px solid #cbd1d8;
    border-radius: 9px;
    background: white;
    color: var(--black);
    padding: 10px 12px;
    min-height: 44px;
}
textarea { min-height: 118px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(200,16,46,.13); border-color: var(--red); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.checkbox-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.checkbox-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #f7f7f8; border-radius: 8px; }
.checkbox-item input { width: auto; min-height: 0; }
.checkbox-row { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.checkbox-row input { width: auto; min-height: 0; flex: 0 0 auto; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; margin-top: 8px; }
@media (max-width: 820px) { .checkbox-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .checkbox-grid { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 11px; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: 12px 13px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: #f5f5f6; font-size: .79rem; text-transform: uppercase; letter-spacing: .04em; color: #4d5661; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcfc; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #e9edf2; color: #364152; font-size: .74rem; font-weight: 800; white-space: nowrap; }
.badge-played, .badge-approved, .badge-active, .badge-done { background: #dcfce7; color: #166534; }
.badge-cancelled, .badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-scheduled, .badge-draft, .badge-open { background: #fef3c7; color: #92400e; }
.badge-published { background: #dbeafe; color: #1e40af; }

.alert { border-radius: 10px; padding: 13px 15px; margin-bottom: 18px; border: 1px solid transparent; }
.alert-success { background: #e8f7ee; border-color: #bde5cb; color: #14532d; }
.alert-warning { background: #fff7e5; border-color: #f4d89a; color: #7a4800; }
.alert-danger { background: #fff0f0; border-color: #efb9b9; color: #8e1515; }
.alert-info { background: #eef5ff; border-color: #c8dcfb; color: #1d4e89; }

.match-card { border-left: 5px solid var(--red); }
.match-line { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.match-line strong { font-size: 1.15rem; }
.result { font-size: 1.75rem; font-weight: 900; white-space: nowrap; }
.meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: .88rem; }

.post-text { white-space: pre-wrap; background: #f7f7f8; border: 1px solid var(--border); padding: 15px; border-radius: 10px; font-size: .92rem; }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.media-card { background: white; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,.05); }
.media-preview { aspect-ratio: 4/3; background: #e9eaed; display: grid; place-items: center; overflow: hidden; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; }
.media-preview .file-icon { font-size: 3rem; }
.media-info { padding: 12px; }
.media-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-info small { color: var(--muted); }

.pill-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pill-nav a { padding: 8px 11px; border-radius: 999px; background: white; border: 1px solid var(--border); color: var(--black); font-weight: 700; font-size: .85rem; }
.pill-nav a.active, .pill-nav a:hover { background: var(--red); color: white; text-decoration: none; border-color: var(--red); }

@media (max-width: 1050px) {
    .topbar { grid-template-columns: auto auto 1fr; }
    .menu-button { display: block; }
    .main-nav { display: none; position: absolute; top: 68px; left: 12px; right: 12px; background: var(--black); padding: 12px; border-radius: 12px; box-shadow: var(--shadow); }
    .main-nav.open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .user-menu { justify-self: end; }
    .grid-4, .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .page-container { width: min(100% - 20px, 1400px); margin-top: 18px; }
    .topbar { padding: 9px 12px; gap: 10px; }
    .brand span { display: none; }
    .user-menu > span { display: none; }
    .grid-2, .grid-3, .grid-4, .form-grid, .form-grid-3, .media-grid, .checkbox-list { grid-template-columns: 1fr; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .page-actions { width: 100%; }
    .page-actions .button { flex: 1; }
    .card { padding: 16px; border-radius: 11px; }
    th, td { padding: 10px; }
    .main-nav.open { grid-template-columns: 1fr; }
    .match-line { align-items: flex-start; flex-direction: column; }
}

.settings-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 7px;
    margin-bottom: 20px;
    background: #eceef1;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.settings-nav a {
    padding: 9px 13px;
    border-radius: 8px;
    color: var(--black);
    font-weight: 750;
    text-decoration: none;
}
.settings-nav a:hover,
.settings-nav a.active {
    background: var(--black);
    color: white;
}
.master-custom-group {
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fafafa;
}
.sub-label {
    margin-top: 5px;
    color: #555e68;
    font-size: .8rem;
}
.form-button-end {
    flex-direction: row;
    align-items: flex-end;
    flex-wrap: wrap;
}
.filter-card { padding-top: 16px; padding-bottom: 16px; }
.media-description {
    margin: 9px 0 0;
    color: #424b55;
    font-size: .84rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.compact-actions { margin-top: 11px; }
.compact-actions form { margin: 0; }
.media-preview .file-icon {
    max-width: 85%;
    padding: 12px 14px;
    border-radius: 10px;
    background: white;
    color: var(--red);
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: .05em;
    box-shadow: 0 5px 18px rgba(0,0,0,.08);
}
.check-list { padding-left: 22px; line-height: 1.7; }
code {
    background: #f0f1f3;
    border-radius: 5px;
    padding: 2px 5px;
}

@media (max-width: 760px) {
    .settings-nav { display: grid; grid-template-columns: 1fr; }
    .settings-nav a { text-align: center; }
    .form-button-end { align-items: stretch; }
    .form-button-end .button { flex: 1; }
}

/* Einstellungen 4.2: klares Seitenmenü mit Unterkategorien */
.settings-layout {
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}
.settings-sidebar {
    position: sticky;
    top: 88px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.settings-sidebar-title {
    padding: 17px 18px;
    background: var(--black);
    color: white;
    font-size: 1.02rem;
    font-weight: 850;
    letter-spacing: -.01em;
}
.settings-menu-group {
    padding: 12px 10px 10px;
    border-bottom: 1px solid var(--border);
}
.settings-menu-group:last-child { border-bottom: 0; }
.settings-menu-heading {
    padding: 0 8px 7px;
    color: var(--muted);
    font-size: .71rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.settings-submenu {
    display: grid;
    gap: 3px;
}
.settings-submenu a {
    position: relative;
    display: block;
    padding: 9px 10px 9px 14px;
    border-radius: 8px;
    color: var(--black);
    font-size: .88rem;
    font-weight: 720;
    text-decoration: none;
}
.settings-submenu a::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    width: 3px;
    height: 0;
    border-radius: 4px;
    background: var(--red);
    transform: translateY(-50%);
    transition: height .15s ease;
}
.settings-submenu a:hover { background: #f4f4f5; text-decoration: none; }
.settings-submenu a.active {
    background: #fff0f3;
    color: var(--red-dark);
}
.settings-submenu a.active::before { height: 22px; }
.settings-content { min-width: 0; }
.settings-content > .card:first-child { margin-top: 0; }

.badge-archived { background: #e5e7eb; color: #374151; }
.row-archived { background: #f7f7f8; color: #626a75; }
.row-archived:hover { background: #f1f2f4; }

@media (max-width: 920px) {
    .settings-layout { grid-template-columns: 1fr; }
    .settings-sidebar { position: static; }
    .settings-sidebar-title { display: none; }
    .settings-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0;
    }
    .settings-menu-group { border-right: 1px solid var(--border); }
    .settings-menu-group:nth-child(2n) { border-right: 0; }
}

@media (max-width: 620px) {
    .settings-sidebar { grid-template-columns: 1fr; }
    .settings-menu-group { border-right: 0; }
}

/* Version 4.3 */
.button-warning { background: #b45309; }
.button-warning:hover { background: #92400e; }
.badge-review, .badge-in_progress { background: #ede9fe; color: #5b21b6; }
.badge-postponed { background: #ffedd5; color: #9a3412; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-granted, .badge-approved { background: #dcfce7; color: #166534; }
.badge-denied, .badge-rejected { background: #fee2e2; color: #991b1b; }

/* Aufgeräumtes Einstellungsmenü: Hauptbereiche mit einklappbarem Submenü */
.settings-sidebar { overflow: visible; }
.settings-sidebar-title { display: flex; flex-direction: column; gap: 2px; }
.settings-sidebar-title span { color: #c8cbd0; font-size: .74rem; font-weight: 600; }
.settings-menu-section { border-bottom: 1px solid var(--border); background: white; }
.settings-menu-section:last-child { border-bottom: 0; }
.settings-menu-section > summary {
    position: relative;
    list-style: none;
    padding: 14px 42px 14px 17px;
    cursor: pointer;
    color: var(--black);
    font-size: .9rem;
    font-weight: 850;
    user-select: none;
}
.settings-menu-section > summary::-webkit-details-marker { display: none; }
.settings-menu-section > summary::after {
    content: '';
    position: absolute;
    right: 18px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #69717c;
    border-bottom: 2px solid #69717c;
    transform: translateY(-65%) rotate(45deg);
    transition: transform .16s ease;
}
.settings-menu-section[open] > summary { background: #f7f7f8; }
.settings-menu-section[open] > summary::after { transform: translateY(-35%) rotate(225deg); }
.settings-menu-section .settings-submenu { padding: 5px 10px 12px; gap: 4px; }
.settings-menu-section .settings-submenu a { padding: 10px 12px 10px 16px; }
.settings-menu-section .settings-submenu a.active { background: var(--black); color: white; }
.settings-menu-section .settings-submenu a.active::before { height: 0; }
.settings-menu-group, .settings-menu-heading { display: none; }

.workflow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 20px; }
.workflow-step { padding: 10px 12px; border-radius: 9px; background: #f0f1f3; color: #5b6470; font-size: .8rem; font-weight: 800; text-align: center; }
.workflow-step.active { background: var(--red); color: white; }
.workflow-step.done { background: #dcfce7; color: #166534; }

.dashboard-list { display: grid; gap: 10px; }
.dashboard-item { padding: 12px 13px; border: 1px solid var(--border); border-radius: 10px; background: #fafafa; }
.dashboard-item strong { display: block; margin-bottom: 4px; }
.dashboard-item .meta { margin-top: 4px; }

.repeat-table { display: grid; gap: 8px; }
.repeat-row { display: grid; grid-template-columns: 80px minmax(150px, 1fr) minmax(150px, 1fr) 115px minmax(140px, 1fr) auto; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: #fafafa; }
.repeat-row .form-group { min-width: 0; }
.quick-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.quick-stat { padding: 12px; border-radius: 10px; background: #f5f5f6; text-align: center; }
.quick-stat strong { display: block; font-size: 1.35rem; }

.import-preview-valid { border-left: 4px solid #16a34a; }
.import-preview-error { border-left: 4px solid #dc2626; background: #fff7f7; }
.import-errors { margin: 6px 0 0; padding-left: 18px; color: #991b1b; font-size: .82rem; }

.privacy-box { padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: #fafafa; }
.user-access-list { max-height: 260px; overflow: auto; padding: 8px; border: 1px solid var(--border); border-radius: 9px; background: white; }

.task-priority-high { color: #991b1b; font-weight: 800; }
.task-priority-normal { color: #374151; }
.task-priority-low { color: #64748b; }

@media (max-width: 920px) {
    .settings-sidebar { display: block; }
    .settings-menu-section { border-right: 0; }
    .workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .repeat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .repeat-row > .button { align-self: stretch; }
}

@media (max-width: 620px) {
    .workflow, .quick-stats { grid-template-columns: 1fr 1fr; }
    .repeat-row { grid-template-columns: 1fr; }
}

.preview-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; margin: 18px 0; }
.inset-card { padding: 0; border: 1px solid var(--border); }
.social-previews { display: grid; gap: 14px; padding: 0 18px 18px; }
.social-preview { border: 1px solid var(--border); border-radius: 12px; background: #fafafa; padding: 14px; }
.social-preview pre { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: .95rem; line-height: 1.5; }
.graphic-preview { padding: 18px; }
.graphic-preview svg { width: 100%; height: auto; border-radius: 18px; box-shadow: 0 12px 30px rgba(0,0,0,.12); display: block; }
.button-group { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 980px) {
    .preview-grid { grid-template-columns: 1fr; }
}

/* Version 4.5 */
.color-dot { display: inline-block; width: 22px; height: 22px; margin-right: 6px; border: 1px solid rgba(0,0,0,.18); border-radius: 50%; vertical-align: middle; }
.notification-card { border-top: 4px solid var(--red); }
.notification-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.notification-item { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid var(--border); border-left: 5px solid #64748b; border-radius: 10px; background: #fafafa; color: var(--black); text-decoration: none; }
.notification-item:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.notification-item span { color: #626b76; font-size: .86rem; }
.notification-warning { border-left-color: #d97706; }
.notification-danger { border-left-color: #dc2626; }
.notification-info { border-left-color: #2563eb; }

.calendar-card { overflow: hidden; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.calendar-toolbar h2 { margin: 0; text-align: center; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 12px; color: #5f6873; font-size: .82rem; }
.calendar-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { background: #111; color: #fff; border-radius: 10px 10px 0 0; }
.calendar-weekdays > div { padding: 10px; text-align: center; font-size: .82rem; font-weight: 800; }
.calendar-days { border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
.calendar-day { min-height: 132px; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #fff; }
.calendar-day.outside { background: #f5f5f6; color: #9aa0a8; }
.calendar-day.today { box-shadow: inset 0 0 0 3px var(--red); }
.calendar-day-number { font-weight: 900; margin-bottom: 7px; }
.calendar-event-list { display: grid; gap: 5px; }
.calendar-event { display: block; padding: 5px 6px; overflow: hidden; border-radius: 6px; color: #fff; font-size: .72rem; font-weight: 700; line-height: 1.25; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event span { margin-right: 4px; opacity: .82; }
.event-match { background: #c8102e; }
.event-post { background: #2563eb; }
.event-task { background: #d97706; }
.event-calendar { background: #5b21b6; }

@media (max-width: 920px) {
    .notification-list { grid-template-columns: 1fr; }
    .calendar-card { overflow-x: auto; }
    .calendar-grid { min-width: 820px; }
    .calendar-toolbar { min-width: 820px; }
}

/* Version 5.0 – Progressive Web App */
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body { padding-bottom: env(safe-area-inset-bottom); }

.connection-banner {
    position: sticky;
    top: 0;
    z-index: 200;
    padding: 8px 16px;
    background: #b42318;
    color: #fff;
    text-align: center;
    font-size: .82rem;
    font-weight: 800;
}
.connection-banner[hidden] { display: none; }

.icon-button {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 10px;
    background: transparent;
    color: #fff;
    font-size: 1.15rem;
    cursor: pointer;
}
.icon-button:hover { background: rgba(255,255,255,.12); }
.install-button[hidden] { display: none; }

.mobile-bottom-nav { display: none; }
.pwa-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 180;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: min(430px, calc(100% - 32px));
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 18px 45px rgba(0,0,0,.22);
}
.pwa-toast[hidden] { display: none; }

.install-help-modal {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0,0,0,.68);
}
.install-help-modal[hidden] { display: none; }
.install-help-card {
    position: relative;
    width: min(520px, 100%);
    padding: 28px;
    border-radius: 18px;
    background: var(--surface);
    color: var(--black);
    box-shadow: 0 24px 70px rgba(0,0,0,.35);
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #eceef1;
    color: #111;
    font-size: 1.45rem;
    cursor: pointer;
}

.app-install-hero {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    align-items: center;
    gap: 26px;
    background: linear-gradient(135deg, rgba(200,16,46,.09), var(--surface));
}
.app-install-icon img {
    width: 140px;
    height: 140px;
    border-radius: 30px;
    box-shadow: 0 16px 38px rgba(0,0,0,.18);
}
.device-status-card { min-height: 190px; }
.device-status-icon { display: block; margin-bottom: 10px; color: var(--red); font-size: 2rem; font-weight: 900; }

.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.quick-action-card {
    display: flex;
    min-height: 145px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    color: var(--black);
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}
.quick-action-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.quick-action-card span { color: var(--red); font-size: 2rem; line-height: 1; }
.quick-action-card small { color: var(--muted); }

.upload-drop-zone {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-height: 145px;
    padding: 20px;
    border: 2px dashed #aeb6c0;
    border-radius: 15px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.upload-drop-zone:hover, .upload-drop-zone.is-dragging {
    border-color: var(--red);
    background: rgba(200,16,46,.045);
    transform: translateY(-1px);
}
.upload-drop-zone input[type="file"] { max-width: 100%; }
.upload-drop-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.file-preview {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    margin-top: 9px;
    color: var(--muted);
    font-size: .82rem;
}
.file-preview img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; }
.file-preview strong { overflow: hidden; color: var(--black); text-overflow: ellipsis; white-space: nowrap; }

/* Dunkler Modus */
html[data-theme="dark"] {
    --black: #f5f6f8;
    --anthracite: #d9dde3;
    --white: #111317;
    --surface: #191c21;
    --background: #0f1115;
    --border: #343943;
    --muted: #aeb6c2;
    --shadow: 0 8px 24px rgba(0,0,0,.30);
}
html[data-theme="dark"] body,
html[data-theme="dark"] .page-container { background: var(--background); color: var(--black); }
html[data-theme="dark"] .topbar { background: #090b0e; }
html[data-theme="dark"] .card,
html[data-theme="dark"] .media-card,
html[data-theme="dark"] table,
html[data-theme="dark"] .settings-menu-section,
html[data-theme="dark"] .settings-content,
html[data-theme="dark"] .quick-action-card,
html[data-theme="dark"] .install-help-card { background: var(--surface); color: var(--black); }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { background: #111419; color: #f5f6f8; border-color: #454b56; }
html[data-theme="dark"] th { background: #22262d; color: #d6dbe2; }
html[data-theme="dark"] tbody tr:hover,
html[data-theme="dark"] .dashboard-item,
html[data-theme="dark"] .social-preview,
html[data-theme="dark"] .privacy-box,
html[data-theme="dark"] .repeat-row,
html[data-theme="dark"] .quick-stat,
html[data-theme="dark"] .card-subtle { background: #20242b; }
html[data-theme="dark"] .button-light { background: #252a31; border-color: #414751; color: #f5f6f8; }
html[data-theme="dark"] .button-light:hover { background: #303641; color: #fff; }
html[data-theme="dark"] .checkbox-item,
html[data-theme="dark"] .settings-menu-section[open] > summary,
html[data-theme="dark"] .upload-drop-zone { background: #20242b; }
html[data-theme="dark"] .settings-menu-section > summary,
html[data-theme="dark"] .settings-submenu a,
html[data-theme="dark"] .pill-nav a { color: #f5f6f8; }
html[data-theme="dark"] .pill-nav a { background: #1c2026; }
html[data-theme="dark"] .media-preview { background: #242931; }
html[data-theme="dark"] .row-archived { background: #1d2025; color: #aeb6c2; }
html[data-theme="dark"] .calendar-day { background: #191c21; }
html[data-theme="dark"] .calendar-day.outside { background: #12151a; color: #6f7782; }
html[data-theme="dark"] .notification-item { background: #20242b; color: #f5f6f8; }
html[data-theme="dark"] .notification-item span { color: #aeb6c2; }
html[data-theme="dark"] .modal-close { background: #303641; color: #fff; }

@media (max-width: 1100px) {
    .quick-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
    .site-footer { padding-bottom: 10px; }
    .mobile-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 160;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: end;
        padding: 7px 7px calc(7px + env(safe-area-inset-bottom));
        border-top: 1px solid rgba(255,255,255,.11);
        background: rgba(12,14,18,.96);
        box-shadow: 0 -8px 28px rgba(0,0,0,.22);
        backdrop-filter: blur(14px);
    }
    .mobile-bottom-nav a {
        display: flex;
        min-width: 0;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 2px;
        color: #fff;
        text-decoration: none;
    }
    .mobile-bottom-nav span { font-size: 1.22rem; line-height: 1; }
    .mobile-bottom-nav small { max-width: 100%; overflow: hidden; font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
    .mobile-bottom-nav .mobile-primary-action span {
        display: grid;
        width: 46px;
        height: 46px;
        margin-top: -25px;
        place-items: center;
        border: 4px solid #111;
        border-radius: 50%;
        background: var(--red);
        font-size: 1.7rem;
    }
    .user-menu .install-button { display: none !important; }
    .app-install-hero { grid-template-columns: 1fr; text-align: center; }
    .app-install-icon { display: flex; justify-content: center; }
    .app-install-hero .form-actions { justify-content: center; }
    .device-status-grid, .quick-action-grid { grid-template-columns: 1fr; }
    .quick-action-card { min-height: 112px; }
    .upload-drop-zone { grid-template-columns: 1fr; }
    .upload-drop-actions { width: 100%; }
    .upload-drop-actions .button { flex: 1; }
    .pwa-toast { right: 10px; bottom: calc(82px + env(safe-area-inset-bottom)); left: 10px; }
}
html[data-theme="dark"] .brand,
html[data-theme="dark"] .main-nav a,
html[data-theme="dark"] .user-menu,
html[data-theme="dark"] .button-ghost { color: #fff; }
html[data-theme="dark"] .button-secondary { background: #303641; color: #fff; }
html[data-theme="dark"] .button-secondary:hover { background: #3b424d; }
html[data-theme="dark"] .settings-menu-section .settings-submenu a.active { background: var(--red); color: #fff; }
html[data-theme="dark"] .calendar-weekdays { background: #090b0e; }
html[data-theme="dark"] .guest-body { background: radial-gradient(circle at top left, #3a0e17, #111 42%, #090909); }
html[data-theme="dark"] .site-footer { color: #aeb6c2; }

/* Version 5.1 – iPhone-Safe-Area, mobile Formulare, Dark-Mode-Kontrast und Kalender */
:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}

html, body { max-width: 100%; overflow-x: hidden; overflow-x: clip; }
body { min-height: 100dvh; }
.topbar {
    padding-top: calc(10px + var(--safe-top));
    padding-right: calc(24px + var(--safe-right));
    padding-left: calc(24px + var(--safe-left));
}
.connection-banner {
    padding-top: calc(8px + var(--safe-top));
    padding-right: calc(16px + var(--safe-right));
    padding-left: calc(16px + var(--safe-left));
}
.guest-container { margin-top: calc(7vh + var(--safe-top)); }

.form-grid > *, .form-group, .page-actions, .card-header > *, .settings-content { min-width: 0; }
input, select, textarea {
    min-width: 0;
    max-width: 100%;
    inline-size: 100%;
}
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"] {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-inline-size: 0;
    -webkit-appearance: none;
    appearance: none;
}
input[type="date"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value,
input[type="month"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value {
    min-width: 0;
    text-align: left;
}

.media-preview {
    aspect-ratio: 4 / 3;
    padding: 8px;
    background: #eef0f3;
}
.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    image-orientation: from-image;
    border-radius: 8px;
    background: var(--surface);
}

.calendar-mobile-agenda { display: none; }
.calendar-desktop-view { display: block; }

html[data-theme="dark"] .settings-sidebar-title,
html[data-theme="dark"] .main-nav,
html[data-theme="dark"] .settings-nav a.active,
html[data-theme="dark"] .settings-nav a:hover {
    background: #090b0e;
    color: #fff;
}
html[data-theme="dark"] body,
html[data-theme="dark"] .card,
html[data-theme="dark"] .card p,
html[data-theme="dark"] .card strong,
html[data-theme="dark"] .card label,
html[data-theme="dark"] .table-wrap td,
html[data-theme="dark"] .media-info strong,
html[data-theme="dark"] .file-preview strong,
html[data-theme="dark"] .page-heading h1,
html[data-theme="dark"] .calendar-toolbar h2 {
    color: #f5f6f8;
}
html[data-theme="dark"] .help,
html[data-theme="dark"] .meta,
html[data-theme="dark"] .media-info small,
html[data-theme="dark"] .media-description,
html[data-theme="dark"] .sub-label,
html[data-theme="dark"] .calendar-legend,
html[data-theme="dark"] .page-heading p,
html[data-theme="dark"] .quick-action-card small {
    color: #b9c1cc;
}
html[data-theme="dark"] .post-text,
html[data-theme="dark"] .master-custom-group,
html[data-theme="dark"] .user-access-list,
html[data-theme="dark"] code,
html[data-theme="dark"] .media-preview .file-icon {
    background: #20242b;
    color: #f5f6f8;
    border-color: #3f4651;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #8f98a5; opacity: 1; }
html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .85; }
html[data-theme="dark"] .media-preview { background: #111419; }
html[data-theme="dark"] .media-preview img { background: #191c21; }
html[data-theme="dark"] a:not(.button):not(.calendar-event):not(.calendar-agenda-event):not(.notification-item):not(.quick-action-card):not(.brand) { color: #ff6079; }
html[data-theme="dark"] .alert-info { background: #14263f; border-color: #315b8c; color: #d8e8ff; }
html[data-theme="dark"] .alert-warning { background: #382a10; border-color: #70521a; color: #ffe3a0; }
html[data-theme="dark"] .alert-danger { background: #3b1718; border-color: #7f3033; color: #ffd7d9; }
html[data-theme="dark"] .alert-success { background: #123222; border-color: #286342; color: #d6ffe5; }

@media (max-width: 1050px) {
    .main-nav { top: calc(68px + var(--safe-top)); }
}

@media (max-width: 760px) {
    .topbar {
        padding-top: calc(9px + var(--safe-top));
        padding-right: calc(12px + var(--safe-right));
        padding-left: calc(12px + var(--safe-left));
    }
    .page-container {
        width: auto;
        margin-right: calc(10px + var(--safe-right));
        margin-left: calc(10px + var(--safe-left));
    }
    .card { max-width: 100%; overflow: hidden; }
    .table-wrap { max-width: 100%; }
    .calendar-card { overflow: hidden; }
    .calendar-desktop-view { display: none; }
    .calendar-mobile-agenda { display: grid; gap: 12px; }
    .calendar-month-table { display: none; }
    .calendar-toolbar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        min-width: 0;
    }
    .calendar-toolbar h2 {
        grid-column: 1 / -1;
        grid-row: 1;
        font-size: 1.25rem;
    }
    .calendar-toolbar .button {
        min-width: 0;
        padding: 9px 8px;
        font-size: .78rem;
        white-space: normal;
    }
    .calendar-toolbar .button:first-child { grid-column: 1; grid-row: 2; }
    .calendar-toolbar .button:last-child { grid-column: 2; grid-row: 2; }
    .calendar-legend { gap: 6px 10px; }
    .calendar-agenda-day {
        overflow: hidden;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--surface);
    }
    .calendar-agenda-day.today { box-shadow: inset 4px 0 0 var(--red); }
    .calendar-agenda-date {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
        border-bottom: 1px solid var(--border);
        background: #f5f5f6;
    }
    .calendar-agenda-date span { color: var(--muted); font-size: .82rem; }
    .calendar-agenda-events { display: grid; gap: 8px; padding: 10px; }
    .calendar-agenda-event {
        display: grid;
        grid-template-columns: 52px minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        padding: 11px;
        border-radius: 10px;
        color: #fff;
        text-decoration: none;
    }
    .calendar-agenda-event time { font-weight: 900; }
    .calendar-agenda-event > span { display: flex; min-width: 0; flex-direction: column; }
    .calendar-agenda-event strong { overflow-wrap: anywhere; }
    .calendar-agenda-event small { color: rgba(255,255,255,.82); }
    .calendar-agenda-empty {
        padding: 22px;
        border: 1px dashed var(--border);
        border-radius: 12px;
        color: var(--muted);
        text-align: center;
    }
    html[data-theme="dark"] .calendar-agenda-date { background: #22262d; }
    html[data-theme="dark"] .calendar-agenda-date strong { color: #f5f6f8; }
    html[data-theme="dark"] .calendar-agenda-date span { color: #b9c1cc; }
    .form-grid, .form-grid-3 { width: 100%; }
    .form-group.full { min-width: 0; }
}

@media (max-width: 900px) {
    .calendar-card { overflow: hidden; }
    .calendar-desktop-view { display: none; }
    .calendar-mobile-agenda { display: grid; gap: 12px; }
    .calendar-month-table { display: none; }
    .calendar-toolbar { min-width: 0; }
}

/* Agenda-Stile auch für große Smartphones im Querformat */
.calendar-agenda-day {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}
.calendar-agenda-day.today { box-shadow: inset 4px 0 0 var(--red); }
.calendar-agenda-date {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: #f5f5f6;
}
.calendar-agenda-date span { color: var(--muted); font-size: .82rem; }
.calendar-agenda-events { display: grid; gap: 8px; padding: 10px; }
.calendar-agenda-event {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 11px;
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
}
.calendar-agenda-event:hover { color: #fff; text-decoration: none; filter: brightness(1.05); }
.calendar-agenda-event time { font-weight: 900; }
.calendar-agenda-event > span { display: flex; min-width: 0; flex-direction: column; }
.calendar-agenda-event strong { overflow-wrap: anywhere; }
.calendar-agenda-event small { color: rgba(255,255,255,.82); }
.calendar-agenda-empty {
    padding: 22px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
}
html[data-theme="dark"] .calendar-agenda-date { background: #22262d; }
html[data-theme="dark"] .calendar-agenda-date strong { color: #f5f6f8; }
html[data-theme="dark"] .calendar-agenda-date span { color: #b9c1cc; }

/* Version 5.2 – Live-Spielmodus */
.live-match-card {
    overflow: hidden;
    border-top: 5px solid var(--red);
}
.live-stopwatch-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.live-kicker {
    display: block;
    margin-bottom: 3px;
    color: var(--red);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.live-period {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #f1f2f4;
    color: #24282e;
    font-size: .82rem;
    font-weight: 800;
    text-align: center;
}
.live-clock {
    margin: 16px 0;
    font-variant-numeric: tabular-nums;
    font-size: clamp(3.2rem, 12vw, 7.5rem);
    font-weight: 950;
    letter-spacing: -.06em;
    line-height: .95;
    text-align: center;
}
.live-timer-controls,
.live-event-buttons {
    display: grid;
    gap: 10px;
}
.live-timer-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 12px;
}
.live-event-buttons {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    margin-top: 18px;
}
.live-event-button {
    display: flex;
    min-width: 0;
    min-height: 74px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 9px 7px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .78rem;
    font-weight: 850;
    cursor: pointer;
    text-align: center;
}
.live-event-button span {
    font-size: 1.45rem;
    line-height: 1;
}
.live-event-button:hover,
.live-event-button:focus-visible {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(200,16,46,.12);
}
.live-event-goal { background: #edf9f0; color: #145b2a; }
.live-event-yellow { background: #fff8ce; color: #5e4b00; }
.live-event-yellow-red { background: linear-gradient(135deg, #fff8ce 0 50%, #ffe6e8 50% 100%); color: #5e2430; }
.live-event-red { background: #ffe6e8; color: #8c1826; }
.live-event-finish { background: #20242a; color: #fff; }
.live-quick-form {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f7f8fa;
}
.live-quick-form[hidden] { display: none; }
.live-quick-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.live-feedback.live-error { color: #a41827; font-weight: 700; }
html[data-theme="dark"] .live-period,
html[data-theme="dark"] .live-quick-form {
    background: #20242b;
    color: #f5f6f8;
    border-color: #3f4651;
}
html[data-theme="dark"] .live-event-button {
    background: #20242b;
    color: #f5f6f8;
    border-color: #3f4651;
}
html[data-theme="dark"] .live-event-goal { background: #14321f; color: #d5ffe1; }
html[data-theme="dark"] .live-event-yellow { background: #3a3212; color: #fff1a8; }
html[data-theme="dark"] .live-event-yellow-red { background: linear-gradient(135deg, #3a3212 0 50%, #40191d 50% 100%); color: #fff4d2; }
html[data-theme="dark"] .live-event-red { background: #40191d; color: #ffd8dd; }
html[data-theme="dark"] .live-event-finish { background: #07090b; color: #fff; }
html[data-theme="dark"] .live-feedback.live-error { color: #ff9ca7; }

@media (max-width: 1100px) {
    .live-event-buttons { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .live-stopwatch-head { flex-direction: column; }
    .live-period { align-self: flex-start; }
    .live-timer-controls { grid-template-columns: 1fr 1fr; }
    .live-timer-controls .button:last-child { grid-column: 1 / -1; }
    .live-event-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .live-event-button { min-height: 70px; }
    .live-quick-form { padding: 14px; }
}

/* Version 5.3 – Live-Ergebnis, Ereignis-Zeitstrahl und WhatsApp-Teilen */
.live-scoreboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    margin: 18px 0 8px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f7f8fa;
}
.live-score-team {
    min-width: 0;
    text-align: right;
}
.live-score-team-away { text-align: left; }
.live-score-team span {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.live-score-team strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: clamp(.9rem, 3vw, 1.2rem);
    line-height: 1.2;
}
.live-score-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 128px;
    font-variant-numeric: tabular-nums;
    font-size: clamp(2.2rem, 9vw, 4.5rem);
    font-weight: 950;
    letter-spacing: -.06em;
    line-height: 1;
}
.live-score-value b { color: var(--muted); font-size: .7em; }
.live-score-actions { display: flex; justify-content: center; margin-bottom: 4px; }
.button-whatsapp {
    border-color: #167d3f;
    background: #167d3f;
    color: #fff;
}
.button-whatsapp:hover,
.button-whatsapp:focus-visible { border-color: #106431; background: #106431; color: #fff; }
.live-timeline-section {
    margin: 10px 0 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}
.live-timeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.live-timeline-head h3 { margin: 0; }
.live-timeline-head span { color: var(--muted); font-size: .82rem; font-weight: 800; }
.live-timeline {
    position: relative;
    display: grid;
    gap: 12px;
}
.live-timeline::before {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 20px;
    width: 2px;
    background: var(--border);
}
.live-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px 10px 10px 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafafa;
}
.live-timeline-marker {
    position: relative;
    z-index: 1;
    display: flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--surface);
    border-radius: 50%;
    background: #edf9f0;
    color: #145b2a;
    font-size: 1.15rem;
    font-weight: 900;
}
.live-timeline-content { min-width: 0; }
.live-timeline-content > div { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.live-timeline-content time { min-width: 42px; color: var(--red); font-size: .82rem; font-weight: 900; }
.live-timeline-content strong { overflow-wrap: anywhere; }
.live-timeline-content p { margin: 3px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.live-timeline-yellow .live-timeline-marker { background: #ffe36b; color: #3f3400; }
.live-timeline-yellow_red .live-timeline-marker { background: linear-gradient(90deg, #ffe36b 0 50%, #d9293e 50% 100%); color: #111; }
.live-timeline-red .live-timeline-marker { background: #d9293e; color: #fff; }
.live-timeline-kickoff .live-timeline-marker,
.live-timeline-second_half .live-timeline-marker { background: #198754; color: #fff; }
.live-timeline-substitution .live-timeline-marker { background: #e8edf7; color: #27446f; }
.live-timeline-penalty .live-timeline-marker { background: #eee7ff; color: #50318c; }
.live-timeline-empty {
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
}
html[data-theme="dark"] .live-scoreboard,
html[data-theme="dark"] .live-timeline-item {
    border-color: #3f4651;
    background: #20242b;
    color: #f5f6f8;
}
html[data-theme="dark"] .live-timeline-section { border-color: #3f4651; background: #171a1f; }
html[data-theme="dark"] .live-timeline-marker { border-color: #171a1f; }
html[data-theme="dark"] .button-whatsapp { background: #1f8f4d; border-color: #1f8f4d; color: #fff; }

@media (max-width: 760px) {
    .live-scoreboard { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; padding: 12px 9px; }
    .live-score-value { min-width: 92px; gap: 5px; }
    .live-timeline-section { padding: 12px; }
    .live-timeline-item { grid-template-columns: 42px minmax(0, 1fr); padding-right: 8px; }
    .live-timeline-item .button-whatsapp { grid-column: 2; justify-self: start; }
}

@media (max-width: 420px) {
    .live-scoreboard { grid-template-columns: 1fr; text-align: center; }
    .live-score-team,
    .live-score-team-away { text-align: center; }
    .live-score-value { order: -1; }
    .live-timeline-head { align-items: flex-start; flex-direction: column; gap: 3px; }
}

/* Version 5.4 – Heim/Gast-Anordnung, Icon-Aktionen und Push */
.live-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.live-score-team { text-align: left; }
.live-score-team-away { text-align: right; }
.live-score-home { justify-self: stretch; }
.live-score-team-away { justify-self: stretch; }
.live-score-actions { min-height: 42px; align-items: center; }
.whatsapp-icon-button,
.instagram-icon-button,
.push-icon-button {
    display: inline-flex;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #167d3f;
    border-radius: 50%;
    background: #167d3f;
    color: #fff;
    cursor: pointer;
}
.whatsapp-icon-button:hover,
.whatsapp-icon-button:focus-visible { background: #106431; border-color: #106431; }
.whatsapp-icon-button svg,
.instagram-icon-button svg,
.push-icon-button svg { width: 22px; height: 22px; }
.whatsapp-icon-button-small,
.instagram-icon-button-small {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
}
.whatsapp-icon-button-small svg,
.instagram-icon-button-small svg { width: 18px; height: 18px; }
.instagram-icon-button {
    border-color: #c13584;
    background: linear-gradient(135deg, #833ab4, #c13584 48%, #f77737);
}
.instagram-icon-button:hover,
.instagram-icon-button:focus-visible {
    border-color: #a52a75;
    background: linear-gradient(135deg, #6f3198, #a52a75 48%, #db652d);
}
.push-icon-button {
    border-color: var(--border);
    background: var(--surface);
    color: var(--muted);
}
.push-icon-button.is-active {
    border-color: var(--red);
    background: var(--red);
    color: #fff;
}
.push-compact-status { margin: -4px 0 8px; text-align: right; }
.live-side-badge {
    display: inline-flex;
    max-width: 100%;
    padding: 2px 7px;
    border-radius: 999px;
    background: #eef0f3;
    color: #4b5563;
    font-size: .72rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}
.live-side-home { border-left: 3px solid var(--red); }
.live-side-away { border-right: 3px solid #596579; }
.live-timeline-content small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: .76rem;
}
html[data-theme="dark"] .push-icon-button {
    border-color: #4a515d;
    background: #20242b;
    color: #d6dae1;
}
html[data-theme="dark"] .push-icon-button.is-active { border-color: var(--red); background: var(--red); color: #fff; }
html[data-theme="dark"] .live-side-badge { background: #303640; color: #eef1f5; }

@media (max-width: 760px) {
    .live-stopwatch-head { flex-direction: row; align-items: flex-start; }
    .live-head-actions { align-items: flex-start; }
    .push-compact-status { text-align: left; }
    .live-scoreboard {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        gap: 7px;
        padding: 12px 8px;
    }
    .live-score-team strong { font-size: clamp(.76rem, 3.5vw, 1rem); }
    .live-score-team span { font-size: .62rem; }
    .live-score-value { min-width: 78px; gap: 4px; font-size: clamp(2rem, 12vw, 3.2rem); }
    .live-timeline-item { grid-template-columns: 36px minmax(0, 1fr) 34px; gap: 8px; padding: 9px 8px 9px 0; }
    .live-timeline-marker { width: 36px; height: 36px; font-size: 1rem; }
    .live-timeline::before { left: 18px; }
}

@media (max-width: 420px) {
    .live-scoreboard { grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr); text-align: initial; }
    .live-score-team { text-align: left; }
    .live-score-team-away { text-align: right; }
    .live-score-value { order: 0; min-width: 72px; font-size: 2.25rem; }
    .live-timeline-head { align-items: flex-start; flex-direction: column; gap: 3px; }
    .live-head-actions { flex-direction: column-reverse; align-items: flex-end; gap: 6px; }
}

/* Version 5.5 – Rollen, Mannschaftslogos, Sortierung und mobiles Spielcenter */
.team-name-with-logo,
.match-pairing-inline { display: flex; align-items: center; gap: 10px; }
.team-list-logo,
.match-pairing-inline img { width: 42px; height: 42px; object-fit: contain; flex: 0 0 auto; }
.match-pairing-inline img:last-child { margin-left: auto; }
.table-sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.table-sort-link:hover { color: var(--red); text-decoration: none; }
.match-sort-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0 20px; }
.match-sort-bar span { color: var(--muted); font-size: .84rem; font-weight: 700; }
.match-sort-bar a { padding: 7px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--black); font-size: .82rem; font-weight: 700; }
.match-sort-bar a.active { background: var(--red); border-color: var(--red); color: white; }
.match-mobile-list { display: none; }
.match-mobile-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 14px; }
.match-mobile-card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.match-mobile-card > header time { font-weight: 800; }
.match-mobile-new-date { margin: -3px 0 12px; color: var(--red); font-size: .84rem; font-weight: 700; }
.match-mobile-scoreboard { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.match-mobile-scoreboard > div { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.match-mobile-scoreboard img { width: 54px; height: 54px; object-fit: contain; }
.match-mobile-scoreboard strong { width: 100%; overflow-wrap: anywhere; font-size: .9rem; }
.match-mobile-scoreboard span { color: var(--muted); font-size: .72rem; text-transform: uppercase; }
.match-mobile-scoreboard b { font-size: 1.55rem; white-space: nowrap; }
.match-mobile-meta { display: grid; gap: 7px; margin: 12px 0; }
.match-mobile-meta > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; }
.match-mobile-meta dt { color: var(--muted); font-size: .76rem; font-weight: 700; }
.match-mobile-meta dd { margin: 0; overflow-wrap: anywhere; font-size: .84rem; }
.match-mobile-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.role-permission-list { display: grid; gap: 8px; }
.role-permission-row { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(0, 2fr); gap: 18px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 11px; }
.role-permission-info { display: flex; flex-direction: column; gap: 3px; }
.role-permission-info small { color: var(--muted); }
.role-permission-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.live-team-logo { width: 62px; height: 62px; object-fit: contain; margin-bottom: 4px; }
.match-overview-logos { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: center; margin: 12px 0 18px; }
.match-overview-logos > div { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.match-overview-logos img { width: 64px; height: 64px; object-fit: contain; }
.match-overview-logos > strong { font-size: 1.65rem; }

html[data-theme="dark"] .match-sort-bar a,
html[data-theme="dark"] .match-mobile-card,
html[data-theme="dark"] .role-permission-row { background: var(--surface); color: var(--black); }

@media (max-width: 760px) {
    .match-table-desktop { display: none; }
    .match-mobile-list { display: grid; gap: 12px; }
    .match-list-section { padding: 14px; }
    .match-list-section .card-header { margin-bottom: 10px; }
    .match-sort-bar { align-items: stretch; }
    .match-sort-bar span { width: 100%; }
    .match-sort-bar a { flex: 1 1 130px; text-align: center; }
    .role-permission-row { grid-template-columns: 1fr; gap: 10px; }
    .role-permission-options { grid-template-columns: 1fr; }
    .live-team-logo { width: 48px; height: 48px; }
}
.match-line-with-logos { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.match-mini-logos { display: flex; align-items: center; }
.match-mini-logos img { width: 30px; height: 30px; object-fit: contain; margin-right: -4px; border-radius: 50%; background: white; border: 1px solid var(--border); }
.calendar-team-logo { width: 34px; height: 34px; object-fit: contain; flex: 0 0 auto; }
.calendar-team-logo-small { width: 18px; height: 18px; object-fit: contain; flex: 0 0 auto; }
.calendar-team-cell { display: flex; align-items: center; gap: 8px; }
.calendar-agenda-event { grid-template-columns: auto auto minmax(0, 1fr); }
.calendar-event { display: flex; align-items: center; gap: 4px; }
@media (max-width: 480px) {
    .calendar-team-logo { width: 30px; height: 30px; }
}

/* Version 5.6 – Reiter in Spielereignissen und mobile Tabellenkarten */
.live-stopwatch-head-compact {
    align-items: center;
    margin-bottom: 4px;
}
.live-stopwatch-head-compact .live-kicker { margin-bottom: 0; }
.live-section-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 18px 0 0;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #eef0f3;
}
.live-section-tab {
    min-height: 46px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 850;
    cursor: pointer;
}
.live-section-tab:hover,
.live-section-tab:focus-visible { background: rgba(200,16,46,.08); }
.live-section-tab.active {
    background: var(--red);
    color: #fff;
    box-shadow: 0 4px 12px rgba(200,16,46,.18);
}
.live-section-panel { padding-top: 18px; }
.live-section-panel[hidden] { display: none !important; }
.match-overview-logos-responsive {
    margin-top: 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fafafa;
}
.match-overview-logos-responsive > div { min-width: 0; }
.match-overview-logos-responsive > div > span {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.match-overview-logos-responsive > div > strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: .9rem;
}
.match-overview-result { min-width: 92px; }
.match-overview-result strong {
    font-size: clamp(1.7rem, 6vw, 2.5rem) !important;
    white-space: nowrap;
}
.live-overview-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 0;
}
.live-overview-details > div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
}
.live-overview-details dt {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
}
.live-overview-details dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 650;
}
.live-overview-stats { margin-top: 14px; }
.live-manual-entry {
    margin-top: 18px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    overflow: hidden;
}
.live-manual-entry > summary {
    padding: 14px 16px;
    font-weight: 850;
    cursor: pointer;
    user-select: none;
}
.live-manual-entry[open] > summary { border-bottom: 1px solid var(--border); }
.live-manual-entry > form { padding: 16px; }
.event-history-section { margin-top: 20px; }
.event-history-list { display: grid; gap: 10px; }
.event-history-card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
}
.event-history-minute {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    border-radius: 10px;
    background: #f1f3f6;
}
.event-history-minute span { font-size: 1.15rem; }
.event-history-minute strong { color: var(--red); font-size: .9rem; }
.event-history-content { min-width: 0; }
.event-history-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}
.event-history-content p {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 8px;
    margin: 4px 0;
    overflow-wrap: anywhere;
}
.event-history-content p span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 750;
}
.event-history-content small { color: var(--muted); }
.event-history-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.event-history-actions form { display: inline-flex; }
.empty-state-compact {
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
}
html[data-theme="dark"] .live-section-tabs { background: #171a1f; border-color: #3f4651; }
html[data-theme="dark"] .match-overview-logos-responsive,
html[data-theme="dark"] .event-history-minute { background: #20242b; border-color: #3f4651; }
html[data-theme="dark"] .live-manual-entry,
html[data-theme="dark"] .event-history-card,
html[data-theme="dark"] .live-overview-details > div { border-color: #3f4651; }

@media (max-width: 760px) {
    .live-stopwatch-head-compact { flex-direction: row; }
    .live-section-tabs { position: relative; z-index: 2; }
    .live-section-panel { padding-top: 14px; }
    .match-overview-logos-responsive {
        grid-template-columns: minmax(0, 1fr) 78px minmax(0, 1fr);
        gap: 8px;
        padding: 12px 8px;
    }
    .match-overview-logos-responsive img { width: 48px; height: 48px; }
    .match-overview-result { min-width: 72px; }
    .match-overview-result strong { font-size: 1.8rem !important; }
    .live-overview-details { grid-template-columns: 1fr; }
    .live-overview-details > div { grid-template-columns: 90px minmax(0, 1fr); }
    .event-history-card { grid-template-columns: 54px minmax(0, 1fr); padding: 11px; }
    .event-history-minute { min-height: 52px; }
    .event-history-actions { grid-column: 1 / -1; justify-content: stretch; }
    .event-history-actions .button,
    .event-history-actions form { flex: 1 1 120px; }
    .event-history-actions form .button { width: 100%; }
    .event-history-content p { grid-template-columns: 96px minmax(0, 1fr); }

    /* Alle normalen Tabellen werden als Karten angezeigt, statt horizontal zu scrollen. */
    .table-wrap.responsive-table-wrap {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
    }
    table.responsive-card-table,
    table.responsive-card-table tbody,
    table.responsive-card-table tr,
    table.responsive-card-table td { display: block; width: 100%; }
    table.responsive-card-table { background: transparent; }
    table.responsive-card-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }
    table.responsive-card-table tbody { display: grid; gap: 12px; }
    table.responsive-card-table tbody tr {
        overflow: hidden;
        border: 1px solid var(--border);
        border-radius: 13px;
        background: var(--surface);
        box-shadow: 0 3px 12px rgba(0,0,0,.04);
    }
    table.responsive-card-table tbody tr:hover { background: var(--surface); }
    table.responsive-card-table td {
        display: grid;
        grid-template-columns: minmax(96px, 38%) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        padding: 10px 12px;
        border-bottom: 1px solid var(--border);
        text-align: left;
        overflow-wrap: anywhere;
    }
    table.responsive-card-table td:last-child { border-bottom: 0; }
    table.responsive-card-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: .74rem;
        font-weight: 850;
        letter-spacing: .02em;
        text-transform: uppercase;
    }
    table.responsive-card-table td.actions {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
        align-items: center;
    }
    table.responsive-card-table td.actions::before { flex: 0 0 100%; }
    table.responsive-card-table td.actions .button,
    table.responsive-card-table td.actions form { flex: 1 1 115px; }
    table.responsive-card-table td.actions form .button { width: 100%; }
    table.responsive-card-table td[colspan],
    table.responsive-card-table td.empty {
        display: block;
        text-align: center;
    }
    table.responsive-card-table td[colspan]::before,
    table.responsive-card-table td.empty::before { display: none; }
}

@media (max-width: 420px) {
    .match-overview-logos-responsive { grid-template-columns: minmax(0, 1fr) 68px minmax(0, 1fr); }
    .match-overview-logos-responsive img { width: 42px; height: 42px; }
    .match-overview-logos-responsive > div > strong { font-size: .78rem; }
    .event-history-content p { grid-template-columns: 1fr; gap: 1px; }
    table.responsive-card-table td { grid-template-columns: minmax(82px, 35%) minmax(0, 1fr); }
}

/* Version 5.7: einheitliche mobile Navigation */
.mobile-nav-icon {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    display: block;
}
@media (max-width: 760px) {
    .mobile-bottom-nav .mobile-nav-icon {
        width: 25px;
        height: 25px;
        flex-basis: 25px;
    }
    .mobile-bottom-nav .mobile-primary-action .mobile-nav-icon {
        box-sizing: border-box;
        width: 46px;
        height: 46px;
        margin-top: -25px;
        padding: 10px;
        border: 4px solid #111;
        border-radius: 50%;
        background: var(--red);
        stroke-width: 1.7;
    }
}
/* Version 5.11 – mobile Foto-Icon stabil darstellen */
@media (max-width: 760px) {
    .mobile-bottom-nav .mobile-primary-action .mobile-primary-icon {
        display: grid;
        width: 46px;
        height: 46px;
        margin-top: -25px;
        place-items: center;
        border: 4px solid #111;
        border-radius: 50%;
        background: var(--red);
        color: #fff;
    }
    .mobile-bottom-nav .mobile-primary-action .mobile-primary-icon .mobile-nav-icon {
        box-sizing: content-box;
        width: 24px;
        height: 24px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: #fff;
        stroke: #fff;
        stroke-width: 1.9;
    }
}

/* Version 5.11 – Aufstellung pro Spiel */
.lineup-match-card { overflow: hidden; }
.lineup-match-scoreboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    text-align: center;
}
.lineup-match-scoreboard > div { display: grid; gap: 6px; justify-items: center; min-width: 0; }
.lineup-match-scoreboard img { width: 72px; height: 72px; object-fit: contain; }
.lineup-match-scoreboard strong { max-width: 100%; overflow-wrap: anywhere; }
.lineup-match-scoreboard small { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.lineup-match-scoreboard b { font-size: clamp(2rem, 6vw, 3.2rem); }
.lineup-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.lineup-toolbar > div { min-width: 92px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft, #f7f7f8); }
.lineup-toolbar strong { display: block; font-size: 1.35rem; }
.lineup-toolbar span { color: var(--muted); font-size: .8rem; }
.lineup-player-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lineup-player-card { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface, #fff); }
.lineup-player-card.is-selected { border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.lineup-player-card.is-starting { box-shadow: inset 4px 0 0 var(--red); }
.lineup-player-main { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; align-items: center; }
.lineup-player-main div { min-width: 0; }
.lineup-player-main strong, .lineup-player-main small { display: block; }
.lineup-player-main small { margin-top: 2px; color: var(--muted); }
.lineup-shirt { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--surface-soft, #f0f1f3); font-weight: 800; }
.lineup-player-controls { display: grid; grid-template-columns: minmax(0, 1fr) 92px auto auto; gap: 8px; align-items: end; }
.lineup-player-controls label > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: .78rem; }
.lineup-player-controls select, .lineup-player-controls input[type="number"] { width: 100%; min-width: 0; }
.lineup-radio { display: grid; justify-items: center; align-content: center; min-height: 42px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; }
.lineup-radio span { margin: 3px 0 0 !important; color: inherit !important; font-size: .72rem !important; }
.lineup-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lineup-summary-grid ol { margin: 0; padding-left: 24px; }
.lineup-summary-grid li { margin: 7px 0; }
html[data-theme="dark"] .lineup-toolbar > div,
html[data-theme="dark"] .lineup-shirt { background: #20242b; }
html[data-theme="dark"] .lineup-player-card { background: #171a1f; }

@media (max-width: 760px) {
    .lineup-player-list, .lineup-summary-grid { grid-template-columns: 1fr; }
    .lineup-player-controls { grid-template-columns: minmax(0, 1fr) 86px; }
    .lineup-radio { grid-row: auto; }
    .lineup-match-scoreboard { gap: 8px; }
    .lineup-match-scoreboard img { width: 56px; height: 56px; }
    .lineup-match-scoreboard strong { font-size: .86rem; }
}

/* 5.11: Kamerazeichen im roten Schnellbutton immer sichtbar halten. */
@media (max-width: 760px) {
    .mobile-bottom-nav .mobile-primary-action .mobile-primary-icon .mobile-nav-icon path,
    .mobile-bottom-nav .mobile-primary-action .mobile-primary-icon .mobile-nav-icon circle {
        stroke: #fff !important;
        vector-effect: non-scaling-stroke;
    }
}

/* Version 5.12 – kompaktere Aufstellung */
.lineup-player-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lineup-player-card { gap: 8px; padding: 10px 12px; border-width: 2px; }
.lineup-player-card.is-starting { border-color: #22c55e; box-shadow: inset 4px 0 0 #22c55e; }
.lineup-player-card.is-substitute { border-color: #ef4444; box-shadow: inset 4px 0 0 #ef4444; }
.lineup-player-main { grid-template-columns: 36px minmax(0, 1fr); gap: 8px; }
.lineup-shirt { width: 34px; height: 34px; min-width: 34px; display: grid; place-items: center; border-radius: 10px; font-weight: 800; }
.lineup-player-controls { grid-template-columns: minmax(0, 1fr) 90px auto auto; gap: 6px; }
.lineup-player-controls label > span { margin-bottom: 2px; }
.lineup-number-control input { text-align: center; }
@media (max-width: 720px) {
    .lineup-player-list { grid-template-columns: 1fr; gap: 7px; }
    .lineup-player-card { padding: 9px 10px; }
    .lineup-player-controls { grid-template-columns: minmax(0, 1fr) 82px; }
    .lineup-radio { margin-top: 2px; }
}
.report-editor-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.report-editor-section > h3 { margin: 0 0 12px; }

/* Version 5.13 – Spiel-Arbeitsbereich, Filterdialoge und kompakte Aufstellung */
.match-workspace-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 18px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card, var(--surface));
}
.match-workspace-tabs a {
    display: grid;
    min-height: 42px;
    place-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text);
    font-size: .9rem;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
}
.match-workspace-tabs a:hover { background: var(--surface); }
.match-workspace-tabs a.active { background: var(--red); color: #fff; }

.match-center-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.foreground-modal[hidden] { display: none !important; }
.foreground-modal { position: fixed; inset: 0; z-index: 950; display: grid; place-items: center; padding: 18px; }
.foreground-modal-backdrop { position: absolute; inset: 0; background: rgba(7,9,12,.66); backdrop-filter: blur(5px); }
.foreground-modal-card {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: min(82vh, 680px);
    overflow: auto;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card, var(--surface));
    box-shadow: 0 26px 70px rgba(0,0,0,.32);
}
body.foreground-modal-open { overflow: hidden; }

.clickable-match-row { cursor: pointer; transition: background .16s ease; }
.clickable-match-row:hover, .clickable-match-row:focus { background: var(--surface); outline: none; }
.match-overview-table td { vertical-align: middle; }
.match-overview-result { font-size: 1.12rem; }
.match-pairing-inline > div, .match-pairing-inline > a { display: grid; min-width: 0; gap: 1px; }
.match-pairing-inline > div span, .match-pairing-inline > a span { color: var(--muted); font-size: .72rem; font-weight: 600; }
.match-pairing-link { color: inherit; text-decoration: none; }
.match-mobile-card-link { color: inherit; text-decoration: none; }
.match-mobile-card-link:hover { color: inherit; }
.match-open-hint { display: block; margin-top: 10px; color: var(--red); font-size: .78rem; font-weight: 800; text-align: right; }
.match-readonly-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 0; }
.match-readonly-grid > div { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.match-readonly-grid dt { margin-bottom: 4px; color: var(--muted); font-size: .74rem; font-weight: 700; }
.match-readonly-grid dd { margin: 0; font-weight: 700; }
.compact-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.compact-danger-zone p { margin: 4px 0 0; }

.lineup-compact-card { padding-bottom: 14px; }
.lineup-toolbar-compact { margin-bottom: 10px; }
.lineup-player-grid-compact { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.lineup-player-card-compact {
    display: grid;
    grid-template-rows: auto auto;
    min-height: 128px;
    gap: 8px;
    padding: 9px 10px;
    border-width: 2px;
}
.lineup-player-main-compact { min-height: 38px; }
.lineup-player-controls-equal {
    display: grid;
    grid-template-columns: minmax(0,1.65fr) 96px 82px 82px;
    align-items: end;
    gap: 6px;
}
.lineup-player-controls-equal label { min-width: 0; }
.lineup-player-controls-equal select,
.lineup-player-controls-equal input[type="text"] {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 40px;
    margin: 0;
}
.lineup-player-controls-equal .lineup-radio {
    box-sizing: border-box;
    width: 100%;
    min-height: 40px;
    height: 40px;
    padding: 4px 6px;
}
.lineup-player-controls-equal .lineup-radio span { font-size: .68rem !important; }
.lineup-player-card-compact.is-starting { border-color: #22c55e; box-shadow: inset 4px 0 0 #22c55e; }
.lineup-player-card-compact.is-substitute { border-color: #ef4444; box-shadow: inset 4px 0 0 #ef4444; }
.lineup-summary-card { padding-top: 14px; padding-bottom: 14px; }
.lineup-summary-card h3 { margin-top: 0; }
.lineup-save-actions { margin-top: 12px; }

/* Untere PWA-Navigation bleibt an der Geräteunterkante. Bei geöffneter Tastatur wird sie ausgeblendet,
   statt oberhalb der Tastatur in den Inhaltsbereich zu springen. */
@media (max-width: 760px) {
    .mobile-bottom-nav {
        position: fixed !important;
        inset: auto 0 0 0 !important;
        transform: translate3d(0,0,0);
        will-change: transform;
        contain: layout paint;
    }
    html.mobile-keyboard-open .mobile-bottom-nav { display: none !important; }
    .match-center-heading-actions { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .match-center-heading-actions .button { min-width: 0; padding-inline: 9px; text-align: center; }
    .foreground-modal { align-items: end; padding: 10px; }
    .foreground-modal-card { width: 100%; max-height: 78dvh; border-radius: 18px 18px 12px 12px; }
    .match-workspace-tabs { gap: 3px; margin-bottom: 12px; padding: 4px; }
    .match-workspace-tabs a { min-height: 39px; padding: 6px 3px; font-size: .76rem; }
    .match-readonly-grid { grid-template-columns: 1fr 1fr; }
    .compact-danger-zone { align-items: stretch; flex-direction: column; }
    .lineup-player-grid-compact { grid-template-columns: 1fr; gap: 6px; }
    .lineup-player-card-compact { min-height: 118px; padding: 8px; }
    .lineup-player-controls-equal { grid-template-columns: minmax(0,1fr) 88px 72px 72px; gap: 5px; }
    .lineup-player-controls-equal select,
    .lineup-player-controls-equal input[type="text"],
    .lineup-player-controls-equal .lineup-radio { height: 38px; min-height: 38px; }
}

@media (max-width: 430px) {
    .lineup-player-controls-equal { grid-template-columns: minmax(0,1fr) 82px; }
    .lineup-player-controls-equal .lineup-radio { width: 100%; }
    .match-readonly-grid { grid-template-columns: 1fr; }
}

/* ===== Version 5.14 ===== */
.badge {
    max-width: 100%;
    min-width: max-content;
    line-height: 1.15;
    vertical-align: middle;
    overflow: visible;
    text-overflow: clip;
    flex-shrink: 0;
}
.card-header > .badge, .match-workspace-center .badge { white-space: nowrap; }

.match-workspace-header {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
    gap: 18px;
    align-items: center;
    margin: 0 0 12px;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card, var(--surface));
}
.match-workspace-team { display: grid; justify-items: center; gap: 5px; min-width: 0; text-align: center; }
.match-workspace-team img,
.match-workspace-logo-placeholder {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 5px;
    border: 1px solid var(--border);
}
.match-workspace-logo-placeholder { display: block; background: var(--surface-soft, #f2f3f5); }
.match-workspace-team small { color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.match-workspace-team strong { max-width: 100%; font-size: .94rem; line-height: 1.18; overflow-wrap: anywhere; }
.match-workspace-center { display: grid; justify-items: center; gap: 5px; min-width: 88px; text-align: center; }
.match-workspace-center b { font-size: clamp(1.8rem, 5vw, 2.7rem); line-height: 1; }
.match-workspace-center small { color: var(--muted); font-size: .72rem; white-space: nowrap; }

/* Aufstellung: kompakt, gleich große Felder, kleine native Auswahlkreise */
.lineup-player-card-compact { min-height: 0; }
.lineup-player-controls-equal { align-items: stretch; }
.lineup-player-controls-equal > label { display: grid; grid-template-rows: auto 40px; align-items: stretch; }
.lineup-player-controls-equal select,
.lineup-player-controls-equal input[type="text"],
.lineup-player-controls-equal .lineup-radio { height: 40px; min-height: 40px; }
.lineup-player-controls-equal .lineup-radio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 3px 5px;
}
.lineup-radio input[type="radio"] {
    appearance: auto;
    -webkit-appearance: radio;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
}
.lineup-player-controls-equal .lineup-radio span { display: block; margin: 0 !important; line-height: 1; text-align: center; }

.import-hub-grid { align-items: stretch; }
.import-hub-card { display: flex; flex-direction: column; gap: 12px; }
.import-hub-card .button { margin-top: auto; align-self: flex-start; }
.import-hub-icon { font-size: 2rem; }
.update-manager-card input[type="file"] { min-height: 46px; }
.update-steps { display: grid; gap: 8px; padding-left: 24px; }

.dashboard-match-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.dashboard-match-card {
    display: block;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    background: var(--surface, #fff);
    transition: border-color .15s ease, transform .15s ease;
}
.dashboard-match-card:hover { color: inherit; border-color: color-mix(in srgb, var(--red) 45%, var(--border)); transform: translateY(-1px); }
.dashboard-match-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.dashboard-match-card time { font-size: .78rem; font-weight: 800; }
.dashboard-match-scoreboard { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 10px; align-items: center; }
.dashboard-match-scoreboard > div { display: grid; justify-items: center; gap: 4px; min-width: 0; text-align: center; }
.dashboard-match-scoreboard img { width: 54px; height: 54px; object-fit: contain; }
.dashboard-match-scoreboard strong { font-size: .82rem; line-height: 1.16; overflow-wrap: anywhere; }
.dashboard-match-scoreboard small { color: var(--muted); font-size: .62rem; text-transform: uppercase; }
.dashboard-match-scoreboard b { font-size: 1.2rem; color: var(--muted); }
.dashboard-match-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 10px; margin-top: 10px; color: var(--muted); font-size: .72rem; text-align: center; }

@media (max-width: 760px) {
    .match-workspace-header { gap: 8px; padding: 12px 10px; }
    .match-workspace-team img, .match-workspace-logo-placeholder { width: 58px; height: 58px; padding: 4px; }
    .match-workspace-team strong { font-size: .78rem; }
    .match-workspace-center { min-width: 64px; }
    .match-workspace-center small { display: none; }
    .match-workspace-center b { font-size: 1.75rem; }
    .dashboard-match-grid { grid-template-columns: 1fr; }
    .dashboard-match-card { padding: 11px; }
    .lineup-player-controls-equal { grid-template-columns: minmax(0,1fr) 82px 62px 62px !important; gap: 5px; }
    .lineup-player-controls-equal > label { grid-template-rows: auto 36px; }
    .lineup-player-controls-equal select,
    .lineup-player-controls-equal input[type="text"],
    .lineup-player-controls-equal .lineup-radio { height: 36px !important; min-height: 36px !important; }
}

@media (max-width: 430px) {
    .lineup-player-controls-equal {
        grid-template-columns: minmax(0,1fr) 78px !important;
        grid-auto-rows: auto;
    }
    .lineup-player-controls-equal .lineup-radio { width: 100%; }
}
.dashboard-upcoming-section .dashboard-match-grid { grid-template-columns: 1fr; }

/* ===== Version 5.15 =====
   Gleich hohe Spielwappen, kompakte Sticky-Spielkopfzeile, 2x2-Aufstellung
   und sauber angeordnete Live-Steuerung. */
:root { --match-workspace-sticky-top: 72px; }

.match-workspace-header {
    position: sticky;
    top: var(--match-workspace-sticky-top);
    z-index: 44;
    align-items: start;
    transition: padding .18s ease, gap .18s ease, border-radius .18s ease, box-shadow .18s ease;
    isolation: isolate;
}
.match-workspace-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: var(--card, var(--surface));
}
.match-workspace-team {
    align-self: stretch;
    grid-template-rows: 76px 14px minmax(40px, auto);
    align-content: start;
}
.match-workspace-logo-slot {
    display: grid;
    width: 100%;
    height: 76px;
    place-items: center;
}
.match-workspace-logo-slot img,
.match-workspace-logo-slot .match-workspace-logo-placeholder {
    width: 76px;
    height: 76px;
    box-sizing: border-box;
    object-fit: contain;
}
.match-workspace-team > strong {
    display: flex;
    min-height: 40px;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
}
.match-workspace-center { padding-top: 2px; }
.match-workspace-center b {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: .08em;
}
.match-workspace-center b i { font-style: normal; color: var(--muted); }

.match-workspace-header.is-condensed {
    grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
    gap: 8px;
    padding: 6px 10px;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.16);
}
.match-workspace-header.is-condensed .match-workspace-team {
    grid-template-rows: 36px minmax(26px, auto);
    gap: 2px;
}
.match-workspace-header.is-condensed .match-workspace-logo-slot { height: 36px; }
.match-workspace-header.is-condensed .match-workspace-logo-slot img,
.match-workspace-header.is-condensed .match-workspace-logo-slot .match-workspace-logo-placeholder {
    width: 36px;
    height: 36px;
    padding: 2px;
}
.match-workspace-header.is-condensed .match-workspace-team > small,
.match-workspace-header.is-condensed .match-workspace-center > span,
.match-workspace-header.is-condensed .match-workspace-center > small { display: none; }
.match-workspace-header.is-condensed .match-workspace-team > strong {
    min-height: 0;
    align-items: center;
    font-size: .68rem;
    line-height: 1.08;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
}
.match-workspace-header.is-condensed .match-workspace-center {
    align-self: center;
    padding-top: 0;
}
.match-workspace-header.is-condensed .match-workspace-center b { font-size: 1.35rem; }

/* Aufstellung: links Status + Rückennummer, rechts TW + Kapitän. */
.lineup-player-card-compact { padding: 9px 10px; }
.lineup-player-controls-equal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px;
    grid-template-areas:
        "status tw"
        "number captain";
    align-items: stretch;
    gap: 6px 8px;
}
.lineup-control-status { grid-area: status; }
.lineup-number-control { grid-area: number; }
.lineup-control-tw { grid-area: tw; }
.lineup-control-captain { grid-area: captain; }
.lineup-player-controls-equal > label {
    display: grid;
    min-width: 0;
    grid-template-rows: auto 38px;
    align-items: stretch;
}
.lineup-player-controls-equal select,
.lineup-player-controls-equal input[type="text"],
.lineup-player-controls-equal .lineup-radio {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0;
}
.lineup-number-control input { padding-inline: 8px; text-align: center; }
.lineup-player-controls-equal .lineup-radio {
    grid-template-rows: 16px auto;
    place-content: center;
    gap: 2px;
    padding: 3px 5px;
}
.lineup-player-controls-equal .lineup-radio span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lineup-player-card-compact.is-starting { border-color: #22c55e; box-shadow: inset 4px 0 0 #22c55e; }
.lineup-player-card-compact.is-substitute { border-color: #ef4444; box-shadow: inset 4px 0 0 #ef4444; }

/* Live: keine zweite Mannschaftsgrafik mehr; vier Timer-Aktionen sauber 4er/2x2. */
.live-score-actions-standalone { justify-content: flex-end; min-height: 0; margin: -4px 0 2px; }
.live-timer-controls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.live-timer-controls .button { min-width: 0; white-space: normal; line-height: 1.18; }

@media (max-width: 760px) {
    :root { --match-workspace-sticky-top: calc(66px + var(--safe-top, 0px)); }
    .match-workspace-header {
        grid-template-columns: minmax(0,1fr) 64px minmax(0,1fr);
        gap: 8px;
        padding: 10px 8px;
    }
    .match-workspace-team { grid-template-rows: 58px 12px minmax(36px, auto); gap: 3px; }
    .match-workspace-logo-slot { height: 58px; }
    .match-workspace-logo-slot img,
    .match-workspace-logo-slot .match-workspace-logo-placeholder {
        width: 58px;
        height: 58px;
        padding: 4px;
    }
    .match-workspace-team > strong { min-height: 36px; align-items: flex-start; }
    .match-workspace-header.is-condensed { top: var(--match-workspace-sticky-top); }
    .match-workspace-header.is-condensed .match-workspace-team { grid-template-rows: 32px minmax(24px, auto); }
    .match-workspace-header.is-condensed .match-workspace-logo-slot { height: 32px; }
    .match-workspace-header.is-condensed .match-workspace-logo-slot img,
    .match-workspace-header.is-condensed .match-workspace-logo-slot .match-workspace-logo-placeholder { width: 32px; height: 32px; }
    .match-workspace-header.is-condensed .match-workspace-team > strong { font-size: .62rem; }
    .match-workspace-header.is-condensed .match-workspace-center b { font-size: 1.2rem; }

    .lineup-player-grid-compact { gap: 7px; }
    .lineup-player-card-compact { padding: 8px 9px; }
    .lineup-player-controls-equal {
        grid-template-columns: minmax(0,1fr) 80px !important;
        grid-template-areas: "status tw" "number captain" !important;
        gap: 5px 7px;
    }
    .lineup-player-controls-equal > label { grid-template-rows: auto 36px; }
    .lineup-player-controls-equal select,
    .lineup-player-controls-equal input[type="text"],
    .lineup-player-controls-equal .lineup-radio { height: 36px !important; min-height: 36px !important; }

    .live-timer-controls { grid-template-columns: 1fr 1fr !important; gap: 8px; }
    .live-timer-controls .button:last-child { grid-column: auto !important; }
}

@media (max-width: 390px) {
    .match-workspace-header { grid-template-columns: minmax(0,1fr) 58px minmax(0,1fr); gap: 5px; }
    .match-workspace-team strong { font-size: .72rem; }
    .lineup-player-controls-equal { grid-template-columns: minmax(0,1fr) 72px !important; }
    .lineup-player-main-compact { grid-template-columns: 32px minmax(0,1fr); }
    .lineup-shirt { width: 32px; height: 32px; min-width: 32px; }
}

/* Version 5.16 – Spielcenter, Header-Aktionen und stabile Karten */
.header-icon-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--black);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.header-icon-button:hover,
.header-icon-button:focus-visible {
    border-color: var(--red);
    color: var(--red);
    transform: translateY(-1px);
}
.action-icon-svg { width: 21px; height: 21px; }
html[data-theme="dark"] .header-icon-button { background: var(--surface); color: var(--black); }

.match-mobile-card-link,
.match-mobile-card-link:visited,
.match-mobile-card-link:hover,
.match-mobile-card-link:focus,
.match-mobile-card-link *,
.match-pairing-link,
.match-pairing-link:visited,
.match-pairing-link:hover,
.match-pairing-link:focus,
.match-pairing-link * {
    text-decoration: none !important;
}

/* Logo row is fixed so long team names can never push one crest higher/lower. */
.match-mobile-scoreboard { align-items: stretch; }
.match-mobile-scoreboard > div {
    display: grid;
    grid-template-rows: 56px minmax(2.35em, auto) 1em;
    align-content: start;
    justify-items: center;
    align-items: start;
    gap: 5px;
    min-width: 0;
    text-align: center;
}
.match-mobile-scoreboard img {
    width: 54px;
    height: 54px;
    align-self: start;
    justify-self: center;
    object-fit: contain;
}
.match-mobile-scoreboard strong {
    align-self: start;
    line-height: 1.16;
}
.match-mobile-scoreboard span { align-self: end; }

/* Desktop pairing: both crests sit in the same fixed-height logo row as well. */
.match-pairing-inline {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: start;
    gap: 10px;
}
.match-pairing-inline > img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    margin: 0 !important;
    align-self: start;
}
.match-pairing-inline > div,
.match-pairing-inline > a { align-self: start; }

@media (max-width: 760px) {
    .header-icon-button { width: 40px; height: 40px; border-radius: 11px; }
    .match-center-heading-actions { gap: 6px; }
}
.match-pairing-logo-slot,
.match-mobile-logo-slot {
    display: grid;
    place-items: start center;
    width: 100%;
    min-height: 56px;
}
.match-pairing-logo-slot { min-height: 44px; }
.match-pairing-logo-slot img { width: 42px; height: 42px; object-fit: contain; }
.match-mobile-logo-slot img { width: 54px; height: 54px; object-fit: contain; }
.match-mobile-scoreboard > div { grid-template-rows: 56px minmax(2.35em, auto) 1em; }


/* Version 5.17 – Header-Aktionen, kompakter Vorlagenbutton und gleiche Aufstellungsfelder */
.graphic-template-save {
    width: auto !important;
    min-width: 0 !important;
    padding: 8px 13px !important;
    font-size: .86rem;
}
.match-center-create-row {
    display: flex;
    justify-content: flex-end;
    margin: -10px 0 14px;
}
.lineup-player-controls-equal > label {
    display: grid !important;
    grid-template-rows: 18px 38px !important;
    align-items: stretch !important;
    gap: 3px;
    min-width: 0;
    margin: 0;
}
.lineup-player-controls-equal > label > span:first-child {
    display: flex;
    align-items: flex-end;
    min-height: 18px;
    margin: 0 !important;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}
.lineup-player-controls-equal select,
.lineup-player-controls-equal input[type="text"],
.lineup-choice-box {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
}
.lineup-choice-box {
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}
.lineup-choice-box input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    margin: 0 !important;
    accent-color: var(--red);
}
.lineup-option-control { min-width: 0; }
@media (max-width: 760px) {
    .page-heading.page-heading-icon-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 8px 10px;
    }
    .page-heading.page-heading-icon-actions > div:first-child { min-width: 0; }
    .page-heading.page-heading-icon-actions .page-actions {
        width: auto !important;
        align-self: start;
        justify-self: end;
        flex-wrap: nowrap;
    }
    .page-heading.page-heading-icon-actions .page-actions .button,
    .page-heading.page-heading-icon-actions .header-icon-button { flex: 0 0 auto; }
    .page-heading.page-heading-icon-actions p { margin-top: 4px; }
    .match-center-create-row { margin-top: -8px; }
    .lineup-player-controls-equal > label { grid-template-rows: 17px 36px !important; }
    .lineup-player-controls-equal select,
    .lineup-player-controls-equal input[type="text"],
    .lineup-choice-box { height: 36px !important; min-height: 36px !important; }
    .lineup-choice-box input[type="radio"] {
        width: 19px !important;
        height: 19px !important;
        min-width: 19px !important;
        min-height: 19px !important;
    }
}

/* Version 5.20 – Leserechte, Aufstellungsansicht, Bericht-Teilen und stabiles Kalender-Icon */
.post-field-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.lineup-readonly-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.lineup-readonly-group {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}
.lineup-readonly-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft, #f6f7f8);
}
.lineup-readonly-head h3 { margin: 0; font-size: 1rem; }
.lineup-readonly-head > span {
    display: grid;
    min-width: 28px;
    height: 28px;
    place-items: center;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--black);
    color: #fff;
    font-size: .76rem;
    font-weight: 900;
}
.lineup-readonly-list { display: grid; gap: 0; }
.lineup-readonly-player {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 54px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    border-left: 4px solid transparent;
}
.lineup-readonly-player:last-child { border-bottom: 0; }
.lineup-readonly-player.is-starting { border-left-color: #22c55e; }
.lineup-readonly-player.is-substitute { border-left-color: #ef4444; }
.lineup-readonly-number {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: var(--surface-soft, #f0f1f3);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}
.lineup-readonly-player > div:nth-child(2) { min-width: 0; }
.lineup-readonly-player strong,
.lineup-readonly-player small { display: block; }
.lineup-readonly-player small { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.lineup-readonly-marks { display: inline-flex; gap: 4px; align-items: center; }
.lineup-readonly-marks .badge { min-width: 28px; justify-content: center; }

/* Der zentrale Kalender-Button nutzt denselben stabilen Icon-Container wie Foto. */
@media (max-width: 760px) {
    .mobile-bottom-nav .mobile-primary-action .mobile-primary-icon .mobile-nav-icon path,
    .mobile-bottom-nav .mobile-primary-action .mobile-primary-icon .mobile-nav-icon circle,
    .mobile-bottom-nav .mobile-primary-action .mobile-primary-icon .mobile-nav-icon rect,
    .mobile-bottom-nav .mobile-primary-action .mobile-primary-icon .mobile-nav-icon line,
    .mobile-bottom-nav .mobile-primary-action .mobile-primary-icon .mobile-nav-icon polyline {
        stroke: #fff !important;
        fill: none;
        vector-effect: non-scaling-stroke;
    }
    .lineup-readonly-grid { grid-template-columns: 1fr; }
    .post-field-actions { gap: 6px; }
}
