/* Sendeplan – Modern UI (PHP 7.4–8.3) */

:root {
    --bg: #0f1419;
    --bg-card: #1a2332;
    --bg-hover: #243044;
    --text: #e7ecf3;
    --text-muted: #8b9cb3;
    --border: #2d3a4f;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --sidebar: #121a26;
    --radius: var(--sp-radius-lg, 12px);
    --shadow: var(--sp-shadow-card);
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.theme-light {
    --bg: #f0f4f8;
    --bg-card: #ffffff;
    --bg-hover: #e8eef5;
    --text: #1a2332;
    --text-muted: #5a6b7d;
    --border: #d8e0ea;
    --sidebar: #ffffff;
    --shadow: 0 4px 20px rgba(0,0,0,.08);
}

/* Einheitliches Design (Panels, Admin, öffentlich) */
:root,
.theme-dark {
    --sp-radius-lg: 14px;
    --sp-radius-md: 10px;
    --sp-radius-sm: 8px;
    --sp-radius-pill: 999px;
    --sp-shadow-card: 0 4px 18px rgba(0, 0, 0, 0.22);
    --sp-shadow-hover: 0 8px 26px rgba(0, 0, 0, 0.3);
    --sp-shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.14);
    --sp-page-gradient: linear-gradient(160deg, var(--bg) 0%, #1a2744 100%);
    --sp-widget-bg: var(--bg-card);
    --sp-widget-border: var(--border);
    --sp-widget-text: var(--text);
    --sp-widget-muted: var(--text-muted);
    --sp-surface-muted: var(--bg-hover);
    --sp-accent-soft: rgba(59, 130, 246, 0.14);
    --sp-accent-text: #60a5fa;
    --sp-meta-gradient: linear-gradient(180deg, var(--bg-hover) 0%, var(--bg-card) 100%);
}

.theme-light {
    --sp-shadow-card: 0 4px 18px rgba(26, 35, 50, 0.08);
    --sp-shadow-hover: 0 8px 24px rgba(26, 35, 50, 0.12);
    --sp-shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.06);
    --sp-page-gradient: linear-gradient(145deg, #f4f6f9 0%, #e8ecf2 100%);
    --sp-widget-bg: #ffffff;
    --sp-widget-border: #dde3ec;
    --sp-widget-text: #1a2332;
    --sp-widget-muted: #8b9cb3;
    --sp-surface-muted: #f8fafc;
    --sp-accent-soft: #eff6ff;
    --sp-accent-text: #2563eb;
    --sp-meta-gradient: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.theme-light {
    --sp-widget-bg: #ffffff;
    --sp-widget-text: #1a2332;
}

.admin-body {
    background: var(--sp-page-gradient);
    background-attachment: fixed;
}

.admin-body .admin-main {
    background: transparent;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

body.sp-public,
body.embed-mode {
    background: var(--sp-page-gradient);
    background-attachment: fixed;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem 1.2rem;
    border: none;
    border-radius: var(--sp-radius-sm);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, transform .1s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary { background: var(--bg-hover); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-danger { background: var(--error); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-sm { padding: .35rem .75rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }

/* Cards */
.card {
    background: var(--sp-widget-bg, var(--bg-card));
    border: 1px solid var(--sp-widget-border, var(--border));
    border-radius: var(--sp-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--sp-shadow-card);
    transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover {
    box-shadow: var(--sp-shadow-hover);
}
.card h2, .card h3 { margin-top: 0; }

/* Forms */
label { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; font-weight: 500; }
input, select, textarea {
    padding: .65rem .85rem;
    border: 1px solid var(--border);
    border-radius: var(--sp-radius-sm);
    background: var(--sp-widget-bg, var(--bg-card));
    color: var(--text);
    font: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.form-grid .full { grid-column: 1 / -1; }
.checkbox { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
.checkbox-group { display: flex; flex-direction: column; gap: .5rem; margin: 1rem 0; }

/* Alerts */
.alert { padding: 1rem 1.25rem; border-radius: var(--sp-radius-md); margin-bottom: 1rem; }
.alert-success { background: rgba(34,197,94,.15); border: 1px solid var(--success); color: var(--success); }
.alert-error { background: rgba(239,68,68,.15); border: 1px solid var(--error); color: var(--error); }
.alert-warning { background: rgba(245,158,11,.15); border: 1px solid var(--warning); }

.text-muted { color: var(--text-muted); }
.small { font-size: .85rem; }

/* Public header */
.public-header {
    background: var(--sp-widget-bg, var(--bg-card));
    border-bottom: 1px solid var(--sp-widget-border, var(--border));
    padding: 1.5rem 2rem;
    box-shadow: var(--sp-shadow-soft);
}
.public-header.compact { padding: 1rem 1.25rem; }
.public-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.public-header h1 { margin: 0; font-size: 1.75rem; font-weight: 700; }
.public-actions { display: flex; gap: .5rem; }
.public-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* Schedule table */
.schedule-public { padding: 1rem; max-width: 100%; }
.schedule-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.schedule-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    background: var(--bg-card);
}
.schedule-table th,
.schedule-table td {
    border: 1px solid var(--border);
    padding: .5rem;
    vertical-align: top;
    text-align: center;
}
.schedule-table th {
    background: var(--bg-hover);
    font-weight: 600;
    font-size: .85rem;
    padding: .75rem .5rem;
    position: sticky;
    top: 0;
    z-index: 2;
}
.schedule-table th.today,
.schedule-table td.today {
    background: rgba(59,130,246,.08);
}
.schedule-table td.now {
    box-shadow: inset 0 0 0 2px var(--primary);
}
.time-col {
    width: 70px;
    font-size: .8rem;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg) !important;
    position: sticky;
    left: 0;
    z-index: 1;
}
.schedule-cell { min-height: 52px; min-width: 110px; }

/* Show boxes */
.show-box {
    background: linear-gradient(135deg, var(--show-color, #3b82f6) 0%, color-mix(in srgb, var(--show-color, #3b82f6) 70%, #000) 100%);
    color: #fff;
    border-radius: 8px;
    padding: .5rem .6rem;
    margin: 2px 0;
    text-align: left;
    font-size: .78rem;
    line-height: 1.35;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.show-box strong { display: block; font-size: .85rem; }
.show-sub, .show-dj, .show-genre, .show-time {
    display: block;
    opacity: .9;
    font-size: .72rem;
}
.show-genre {
    display: inline-block;
    background: rgba(255,255,255,.2);
    padding: .1rem .4rem;
    border-radius: 4px;
    margin-top: .2rem;
}

/* Admin layout */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    box-shadow: var(--sp-shadow-soft);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.sidebar-brand {
    padding: 1.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    border-bottom: 1px solid var(--border);
}
.brand-icon { font-size: 1.4rem; }
.sidebar-nav { flex: 1; padding: 1rem 0; }
.sidebar-nav a {
    display: block;
    padding: .75rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all .15s;
}
.sidebar-nav a:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.sidebar-nav a.active {
    color: var(--primary);
    background: rgba(59,130,246,.1);
    border-left-color: var(--primary);
    font-weight: 600;
}
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: .5rem;
    font-size: .85rem;
}
.admin-main { flex: 1; padding: 1.5rem 2rem; overflow-x: auto; }
.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.admin-topbar h1 { margin: 0; font-size: 1.5rem; }
.user-badge {
    background: var(--sp-accent-soft);
    color: var(--sp-accent-text, var(--primary));
    padding: .4rem .85rem;
    border-radius: var(--sp-radius-pill);
    font-size: .85rem;
    font-weight: 600;
    border: 1px solid var(--sp-widget-border, var(--border));
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--sp-widget-bg, var(--bg-card));
    border: 1px solid var(--sp-widget-border, var(--border));
    border-radius: var(--sp-radius-lg);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--sp-shadow-card);
    transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sp-shadow-hover);
}
.stat-num { display: block; font-size: 2rem; font-weight: 700; color: var(--sp-accent-text, var(--primary)); }
.stat-label { color: var(--text-muted); font-size: .9rem; }
.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; }
.quick-link {
    display: block;
    padding: 1rem;
    background: var(--sp-widget-bg, var(--bg-hover));
    border-radius: var(--sp-radius-md);
    color: var(--sp-widget-text, var(--text));
    text-decoration: none;
    border: 1px solid var(--sp-widget-border, var(--border));
    box-shadow: var(--sp-shadow-soft);
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.quick-link:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--sp-shadow-card);
    text-decoration: none;
    color: var(--sp-widget-text, var(--text));
}

/* Show list admin */
.page-grid { display: grid; gap: 1.5rem; }
@media (min-width: 1100px) {
    .page-grid { grid-template-columns: 1fr 1fr; }
    .schedule-admin-grid { grid-template-columns: 380px 1fr; }
    .users-grid { grid-template-columns: 420px 1fr; }
}
.show-list { display: flex; flex-direction: column; gap: .75rem; }
.show-list-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem;
    background: var(--sp-widget-bg, var(--bg-card));
    border-radius: var(--sp-radius-md);
    border: 1px solid var(--sp-widget-border, var(--border));
    box-shadow: var(--sp-shadow-soft);
    transition: box-shadow .15s ease, transform .12s ease;
}
.show-list-item:hover {
    box-shadow: var(--sp-shadow-card);
    transform: translateY(-1px);
}
.show-list-color {
    width: 6px;
    height: 40px;
    border-radius: 3px;
    background: var(--show-color);
    flex-shrink: 0;
}
.show-list-info { flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.show-list-info span { font-size: .85rem; color: var(--text-muted); }
.show-list-actions { display: flex; gap: .5rem; align-items: center; }

/* Admin schedule boxes */
.admin-box { position: relative; padding-right: 2rem; }
.admin-box .box-actions {
    position: absolute;
    top: .25rem;
    right: .25rem;
    display: flex;
    gap: .15rem;
}
.admin-box .box-actions button,
.admin-box .box-actions a {
    background: rgba(0,0,0,.3);
    border: none;
    color: #fff;
    cursor: pointer;
    padding: .15rem .3rem;
    border-radius: 4px;
    font-size: .7rem;
    text-decoration: none;
}
.inline-form { display: inline; }

/* Permissions UI */
.permissions-panel {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .75rem;
    margin-top: 1rem;
}
.perm-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    gap: .5rem;
}
.perm-card:has(input:checked) {
    border-color: var(--primary);
    background: rgba(59,130,246,.08);
}
.perm-card input { width: auto; }
.perm-icon { font-size: 1.5rem; }
.perm-label { font-size: .85rem; font-weight: 500; }

/* User cards */
.user-list { display: flex; flex-direction: column; gap: 1rem; }
.user-card {
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.user-card-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .35rem; }
.role-badge {
    font-size: .7rem;
    padding: .2rem .6rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}
.role-admin { background: rgba(239,68,68,.2); color: var(--error); }
.role-editor { background: rgba(59,130,246,.2); color: var(--primary); }
.role-viewer { background: rgba(139,156,179,.2); color: var(--text-muted); }
.user-card-meta { font-size: .85rem; color: var(--text-muted); margin-bottom: .5rem; }
.user-perm-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.perm-tag {
    font-size: .72rem;
    padding: .2rem .5rem;
    background: var(--bg-hover);
    border-radius: 4px;
    border: 1px solid var(--border);
}
.user-card-actions { display: flex; gap: .5rem; }

/* Integration / code */
.code-block, .code-area {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: Consolas, monospace;
    font-size: .85rem;
    color: var(--text);
    overflow-x: auto;
}
.code-area { min-height: 80px; resize: vertical; margin: .5rem 0 1.5rem; }
.integration-box {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    border: 1px dashed var(--border);
}

/* Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--sp-page-gradient);
    background-attachment: fixed;
}
.login-wrap { width: 100%; max-width: 420px; padding: 1rem; }
.login-card {
    box-shadow: var(--sp-shadow-card);
    border-radius: var(--sp-radius-lg);
}
.login-card label { margin-bottom: 1rem; }
.login-brand {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Installer */
.install-page {
    background: var(--sp-page-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 2rem 1rem;
}
.install-wrap { max-width: 640px; margin: 0 auto; }
.install-header { text-align: center; margin-bottom: 2rem; }
.install-header .logo { font-size: 2rem; font-weight: 800; }
.install-steps {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.install-step {
    padding: .4rem .85rem;
    border-radius: var(--sp-radius-pill);
    font-size: .8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.install-step.active { border-color: var(--primary); color: var(--primary); }
.install-step.done { background: rgba(34,197,94,.15); border-color: var(--success); color: var(--success); }
.check-list { list-style: none; padding: 0; }
.check-list li { padding: .5rem 0; padding-left: 1.5rem; position: relative; }
.check-list li.ok::before { content: '✓'; position: absolute; left: 0; color: var(--success); }
.check-list li.fail::before { content: '✗'; position: absolute; left: 0; color: var(--error); }
.summary-list { list-style: none; padding: 0; }
.summary-list li { padding: .35rem 0; }
.success-card { text-align: center; }

/* Embed mode */
.embed-mode { background: var(--sp-page-gradient); }

.sp-public .public-shell {
    background: transparent;
    padding-bottom: 2rem;
}

.sp-schedule-shell {
    max-width: 1400px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
}

.sp-schedule-shell .schedule-scroll {
    border-radius: var(--sp-radius-lg);
    box-shadow: var(--sp-shadow-card);
    border: 1px solid var(--sp-widget-border, var(--border));
    overflow: hidden;
    background: var(--sp-widget-border, var(--border));
}

/* === Klassische Sendeplan-Ansicht (Art vom Original) === */
.sp-public { text-align: center; }

.sp-day-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem;
    margin: 1rem auto;
    max-width: 900px;
}
.sp-day-btn {
    padding: .45rem .95rem;
    border: 1px solid var(--sp-widget-border, var(--border));
    border-radius: var(--sp-radius-pill);
    background: var(--sp-widget-bg, var(--bg-card));
    color: var(--sp-widget-text, var(--text));
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    box-shadow: var(--sp-shadow-soft);
    transition: background .15s, transform .12s, box-shadow .15s;
}
.sp-day-btn:hover {
    background: var(--sp-surface-muted, var(--bg-hover));
    text-decoration: none;
    color: var(--sp-widget-text, var(--text));
    transform: translateY(-1px);
}
.sp-day-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
.sp-day-btn.is-today:not(.active) {
    border-color: var(--primary);
    color: var(--sp-accent-text, var(--primary));
}

.sp-view-toggle {
    margin: .75rem 0;
    font-size: .9rem;
    padding: .5rem 1rem;
    display: inline-block;
    background: var(--sp-surface-muted, var(--bg-card));
    border-radius: var(--sp-radius-pill);
    border: 1px solid var(--sp-widget-border, var(--border));
}
.sp-live-clock {
    font-size: .85rem;
    color: var(--sp-widget-muted, var(--text-muted));
    margin: .5rem 0;
    font-variant-numeric: tabular-nums;
}
.sp-broadcast-hint { font-size: .85rem; font-style: italic; color: var(--text-muted); margin: 0 1rem 1.25rem; max-width: 720px; margin-left: auto; margin-right: auto; }

/* Wochen-Gitter (tbl-Stil) */
.sp-weekly-view { padding: 0 0 1.5rem; }
.schedule-scroll { overflow-x: auto; margin: 0 auto; max-width: 100%; }
.sp-grid.tbl-style {
    width: 100%;
    min-width: 880px;
    border-collapse: separate;
    border-spacing: 1px;
    background: var(--border);
    margin: 0 auto;
}
.sp-grid.tbl-style th,
.sp-grid.tbl-style td {
    background: var(--bg-card);
    padding: .4rem .35rem;
    vertical-align: middle;
    text-align: center;
    font-size: .78rem;
}
.sp-grid.tbl-style thead th {
    background: var(--bg-hover);
    font-weight: 700;
    padding: .6rem .35rem;
}
.sp-grid.tbl-style th.today,
.sp-grid.tbl-style td.today { background: rgba(59,130,246,.12); }
.sp-grid.tbl-style td.now { outline: 2px solid var(--primary); outline-offset: -2px; }
.sp-corner { width: 72px; font-size: .72rem; }
.sp-hour { font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.sp-cell { min-width: 88px; min-height: 58px; }
.sp-cell-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    color: var(--text);
    text-decoration: none;
}
.sp-cell-link:hover { text-decoration: none; color: var(--primary); }
.sp-cell-autodj { cursor: default; }
.sp-cell-avatar {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--sp-radius-md);
    border: 2px solid var(--sp-widget-bg, var(--bg-card));
    box-shadow: var(--sp-shadow-soft);
}
.sp-autodj { color: var(--text-muted); font-size: .72rem; }
.sp-empty-cell { color: var(--text-muted); }

/* Show-Box mit Hintergrundbild */
.sp-showbox {
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    border-radius: var(--sp-radius-lg);
    overflow: hidden;
    box-shadow: var(--sp-shadow-card);
    text-align: left;
    color: #fff;
    transition: transform .15s ease, box-shadow .15s ease;
}
.sp-showbox:hover {
    transform: translateY(-2px);
    box-shadow: var(--sp-shadow-hover);
}
.sp-showbox-inner {
    background: linear-gradient(to bottom, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 100%);
    padding: .65rem .75rem;
    min-height: inherit;
}
.sp-showbox-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .35rem;
}
.sp-showbox-time { font-size: .78rem; font-weight: 700; }
.sp-onair {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: .62rem;
    font-weight: 800;
    padding: .2rem .5rem;
    border-radius: 999px;
    letter-spacing: .06em;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, .25);
    animation: sp-pulse 1.4s ease-in-out infinite;
}
@keyframes sp-pulse { 0%,100% { opacity: 1; } 50% { opacity: .65; } }
.sp-showbox-title { margin: 0 0 .25rem; font-size: 1rem; font-weight: 700; }
.sp-showbox-sub { margin: 0 0 .35rem; font-size: .85rem; opacity: .95; }
.sp-showbox-desc { font-size: .78rem; line-height: 1.4; opacity: .92; }

/* Tages-Ansicht */
.sp-daily-view { max-width: min(900px, 100%); margin: 0 auto 2rem; padding: 0 clamp(.65rem, 3vw, 1rem); box-sizing: border-box; }
.sp-daily-title { font-size: 1.1rem; margin-bottom: 1rem; }
.sp-daily-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: .75rem;
    margin-bottom: 1rem;
    text-align: left;
}
.sp-daily-row-has-dj {
    flex-wrap: nowrap;
    gap: 0;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--sp-radius-lg);
    overflow: hidden;
    box-shadow: none;
    background: transparent;
}
.sp-daily-row-has-dj .sp-show-template,
.sp-daily-row-has-dj .sp-showbox {
    border-radius: 0;
    box-shadow: none;
    flex: 0 0 auto;
}
.sp-daily-row-has-dj .sp-dj-panel {
    align-self: stretch;
}
.sp-daily-row-template {
    width: auto;
    max-width: 100%;
}
.sp-daily-row-template .sp-show-template {
    flex: 0 1 auto;
    width: min(var(--template-width, 300px), 100%);
    max-width: min(var(--template-width, 300px), 100%);
    margin: 0;
}
.sp-show-template {
    position: relative;
    width: 100%;
    height: min(var(--template-height, 130px), 32vw);
    min-height: min(var(--template-height, 130px), 32vw);
    max-height: none;
    border-radius: var(--sp-radius-lg);
    overflow: hidden;
    box-shadow: var(--sp-shadow-card);
    background: transparent;
}
.sp-show-template-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.sp-show-template-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: .55rem .65rem .6rem;
    background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,.08) 100%);
    color: #fff;
}
.sp-template-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .65rem;
    flex-shrink: 0;
    min-height: 1.6rem;
}
.sp-template-top .sp-showbox-time {
    flex: 0 1 auto;
    font-size: .8rem;
    line-height: 1.35;
    padding-top: .12rem;
}
.sp-template-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem .45rem;
    flex: 0 1 auto;
    max-width: 58%;
}
.sp-onair-template {
    font-size: .68rem;
    font-weight: 800;
    padding: .32rem .62rem;
    letter-spacing: .07em;
    white-space: nowrap;
    line-height: 1.2;
    flex-shrink: 0;
}
.sp-template-body {
    flex: 0 1 auto;
    margin-top: auto;
    padding-top: .25rem;
}
.sp-show-template-title { margin: 0 0 .15rem; font-size: clamp(.88rem, 2.5vw, 1rem); font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,.5); line-height: 1.2; }
.sp-show-template-sub { margin: 0 0 .2rem; font-size: clamp(.72rem, 2.1vw, .82rem); opacity: .95; }
.sp-show-template-desc { font-size: clamp(.65rem, 1.9vw, .75rem); line-height: 1.35; opacity: .92; max-height: 2.6em; overflow: hidden; }
.sp-daily-event .sp-show-template { outline: 2px solid #f59e0b; }
.sp-autodj-tag {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    background: rgba(0, 0, 0, .45);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Admin: Vorlagen-Galerie & Picker */
.sp-template-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.sp-template-card {
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--sp-radius-lg);
    overflow: hidden;
    background: var(--bg-card);
}
.sp-template-card.is-inactive { opacity: .55; }
.sp-template-card img { width: 100%; height: 110px; object-fit: cover; display: block; }
.sp-template-card figcaption { padding: .65rem .75rem; font-size: .85rem; }
.sp-template-card-actions { display: flex; gap: .35rem; margin-top: .5rem; flex-wrap: wrap; }
.sp-template-preview-img { max-width: 100%; max-height: 120px; border-radius: 8px; border: 1px solid var(--border); }
.sp-template-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: .65rem;
    margin: .75rem 0 1rem;
}
.sp-template-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: .5rem;
    border: 2px solid var(--border);
    border-radius: var(--sp-radius-md);
    cursor: pointer;
    text-align: center;
    font-size: .75rem;
    transition: border-color .15s, box-shadow .15s;
}
.sp-template-option input { position: absolute; opacity: 0; pointer-events: none; }
.sp-template-option img { width: 100%; height: 72px; object-fit: cover; border-radius: 6px; }
.sp-template-option.is-selected,
.sp-template-option:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(59,130,246,.25); }
.sp-template-none { display: flex; align-items: center; justify-content: center; min-height: 72px; width: 100%; background: var(--bg); border-radius: 6px; color: var(--text-muted); font-size: .72rem; line-height: 1.3; }
.sp-sample-preview .sp-template-card img { height: 90px; }
.sp-sample-preview figcaption { font-size: .7rem; word-break: break-all; }
.sp-dj-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    flex: 0 0 auto;
    width: 92px;
    min-width: 88px;
    padding: .5rem .4rem;
    background: transparent;
    border-left: 1px solid rgba(255, 255, 255, .1);
    border-radius: 0;
    box-shadow: none;
}
.sp-daily-row:not(.sp-daily-row-has-dj) .sp-dj-panel {
    border: 1px solid var(--sp-widget-border, var(--border));
    border-radius: var(--sp-radius-lg);
    box-shadow: var(--sp-shadow-card);
    min-width: 110px;
    padding: .85rem;
    gap: .5rem;
}
.sp-dj-avatar {
    display: block;
    width: 72px;
    max-width: 100%;
    height: auto;
    max-height: 86px;
    border-radius: 4px;
    object-fit: contain;
    object-position: center;
    background: transparent;
    border: none;
    box-shadow: none;
}
.sp-dj-name {
    display: block;
    text-align: center;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
    color: inherit;
}
.sp-dj-setcard {
    display: block;
    text-align: center;
    font-size: .72rem;
    font-weight: 600;
    color: #e53e3e;
    text-decoration: none;
}
.sp-dj-setcard:hover {
    text-decoration: underline;
    color: #f56565;
}
.sp-empty { color: var(--text-muted); font-style: italic; padding: 2rem; }

/* Tooltip (Wochen-Hover) */
.sp-tooltip-floating {
    position: absolute;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 8px 28px rgba(0,0,0,.45);
    border-radius: 8px;
}
.sp-tooltip-box .sp-showbox-inner { min-height: 100px; }

/* Responsive */
@media (max-width: 768px) {
    .admin-shell { flex-direction: column; }
    .sidebar { width: 100%; }
    .sidebar-nav { display: flex; overflow-x: auto; padding: 0; }
    .sidebar-nav a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
    .sidebar-nav a.active { border-left: none; border-bottom-color: var(--primary); }
    .admin-main { padding: 1rem; }
}

/* Lizenz-Verwaltung */
.lic-wrap { max-width: 52rem; }
.lic-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1rem 1.15rem; border-radius: 8px; color: #fff; margin-bottom: 1rem;
}
.lic-banner--ok { background: #1b6b3c; }
.lic-banner--warn { background: #7a6130; }
.lic-banner--bad { background: #a63a21; }
.lic-banner-sub { font-size: .9rem; opacity: .95; }
.lic-grid {
    background: var(--sp-widget-bg, var(--bg-card));
    border: 1px solid var(--sp-widget-border, var(--border));
    border-radius: var(--sp-radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--sp-shadow-soft);
}
.lic-row {
    display: flex; justify-content: space-between; gap: 1rem;
    padding: .65rem 1rem; border-bottom: 1px solid var(--border); font-size: .9rem;
}
.lic-row:last-child { border-bottom: 0; }
.lic-row span:first-child { font-weight: 600; color: var(--text-muted); }
.lic-ok { color: var(--success); }
.lic-bad { color: var(--error); }
.lic-form-card label { margin-bottom: 1rem; display: block; }
.lic-flash { border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; font-weight: 600; }
.lic-flash--ok { background: rgba(34,197,94,.15); border: 1px solid var(--success); color: var(--success); }
.lic-flash--err { background: rgba(239,68,68,.15); border: 1px solid var(--error); color: var(--error); }
.lic-flash--note { background: rgba(59,130,246,.12); border: 1px solid var(--primary); color: var(--primary); }
.lic-note {
    margin-top: 1rem; padding: .85rem 1rem; background: var(--bg);
    border: 1px dashed var(--border); border-radius: 8px; font-size: .88rem; line-height: 1.5;
}
.lic-skip { text-align: center; margin-top: 1rem; }
.lic-warn-card { border-color: var(--warning); background: rgba(245,158,11,.08); }

.lic-block-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--sp-page-gradient);
    background-attachment: fixed;
    padding: 1rem;
}
.lic-block-wrap {
    max-width: 46rem;
    text-align: center;
    padding: 1.75rem;
    border: 1px solid var(--warning);
    background: var(--sp-widget-bg, var(--bg-card));
    color: var(--text);
    border-radius: var(--sp-radius-lg);
    box-shadow: var(--sp-shadow-card);
}
.lic-block-wrap h1 { margin-top: 0; color: var(--warning); }
.lic-block-detail { margin-top: 1rem; font-size: .92rem; color: var(--text-muted); }
.lic-block-foot {
    margin-top: 1rem;
    padding-top: .85rem;
    border-top: 1px solid var(--border);
    font-size: .9rem;
    color: var(--text-muted);
}

/* Admin subnav */
.admin-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-bottom: 1.25rem;
    padding: .5rem;
    background: var(--sp-widget-bg, var(--bg-card));
    border: 1px solid var(--sp-widget-border, var(--border));
    border-radius: var(--sp-radius-lg);
    box-shadow: var(--sp-shadow-soft);
}
.admin-subnav a {
    padding: .45rem .85rem;
    border-radius: var(--sp-radius-pill);
    text-decoration: none;
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 600;
    transition: background .15s, color .15s;
}
.admin-subnav a:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.admin-subnav a.active { background: var(--primary); color: #fff; }
.tag-repeat { font-size: .65rem; background: rgba(59,130,246,.25); padding: .1rem .35rem; border-radius: 4px; }
.repeat-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.repeat-list li { padding: .4rem 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.day-editor-table select { width: 100%; max-width: 320px; }
.admin-overview-table tfoot td { padding: .5rem; }

/* PHPFusion install panel (also used in embed-info) */
.fusion-install-panel { max-width: 900px; }
.fusion-step {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: .75rem;
    background: var(--sp-widget-bg, var(--bg-card));
    border: 1px solid var(--sp-widget-border, var(--border));
    border-radius: var(--sp-radius-lg);
    align-items: flex-start;
    box-shadow: var(--sp-shadow-soft);
}
.fusion-step-num { flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.fusion-step.ok { border-color: var(--success); }
.fusion-step.fail { border-color: var(--error); }
.fusion-status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; margin: 1rem 0; }
.fusion-status-item { padding: .75rem; border-radius: 8px; border: 1px solid var(--border); text-align: center; font-size: .85rem; }
.fusion-status-item.ok { background: rgba(34,197,94,.1); border-color: var(--success); }
.fusion-status-item.fail { background: rgba(239,68,68,.1); border-color: var(--error); }

/* Support & Downloads */
.support-packages { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.support-pkg {
    border: 1px solid var(--sp-widget-border, var(--border));
    border-radius: var(--sp-radius-lg);
    padding: 1rem;
    background: var(--sp-widget-bg, var(--bg-card));
    display: flex;
    flex-direction: column;
    gap: .5rem;
    box-shadow: var(--sp-shadow-soft);
    transition: box-shadow .15s ease, transform .12s ease;
}
.support-pkg:hover {
    box-shadow: var(--sp-shadow-card);
    transform: translateY(-1px);
}
.support-pkg header { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.support-pkg header h4 { margin: 0; font-size: 1rem; }
.support-pkg-ver { font-size: .75rem; background: var(--bg); padding: .15rem .45rem; border-radius: 4px; color: var(--text-muted); }
.support-pkg footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .5rem; border-top: 1px solid var(--border); }
.support-pkg-size { font-size: .8rem; color: var(--text-muted); }
.support-pkg.is-pending { opacity: .85; }
.support-hints { margin: 0; padding-left: 1.2rem; line-height: 1.6; }
.lic-support-block p { margin: .5rem 0 0; }

.setcards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.setcard-item {
    border: 1px solid var(--sp-widget-border, var(--border));
    border-radius: var(--sp-radius-lg);
    padding: 1.25rem;
    text-align: center;
    background: var(--sp-widget-bg, var(--bg-card));
    box-shadow: var(--sp-shadow-card);
    transition: transform .15s ease, box-shadow .15s ease;
}
.setcard-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--sp-shadow-hover);
}
.setcard-avatar {
    width: 96px;
    height: 96px;
    border-radius: var(--sp-radius-md);
    object-fit: cover;
    margin-bottom: .5rem;
    border: 2px solid var(--sp-widget-bg, var(--bg-card));
    box-shadow: var(--sp-shadow-soft);
}

.sp-nsv-badge { margin-left: .35rem; font-size: 1rem; vertical-align: middle; opacity: .9; }
.sp-studiobox-link { display: inline-block; margin-top: .5rem; font-size: .85rem; font-weight: 600; color: var(--primary); }
.sp-event-tag { font-size: .65rem; background: #f59e0b; color: #111; padding: .1rem .35rem; border-radius: 4px; margin-left: .35rem; }
.sp-daily-event .sp-showbox { outline: 2px solid #f59e0b; }

.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th, .admin-table td {
    border: 1px solid var(--sp-widget-border, var(--border));
    padding: .5rem .65rem;
    text-align: left;
    vertical-align: top;
}
.admin-table th {
    background: var(--sp-surface-muted, var(--bg-hover));
    font-weight: 600;
}

.card .admin-table,
.card .schedule-scroll {
    border-radius: var(--sp-radius-md);
    overflow: hidden;
}

.sp-studiobox-card {
    max-width: 380px;
    margin: 1rem auto;
}

/* Roadmap & Updater */
.page-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.page-head-row h2 { margin-top: 0; }

.sp-roadmap {
    position: relative;
    margin: 1rem 0 0;
    padding-left: 1.5rem;
    border-left: 2px solid var(--border);
}
.sp-roadmap-item {
    position: relative;
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.sp-roadmap-marker {
    position: absolute;
    left: calc(-1.5rem - 6px);
    top: .45rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--border);
}
.sp-roadmap-done .sp-roadmap-marker { background: var(--success); box-shadow: 0 0 0 2px rgba(34, 197, 94, .35); }
.sp-roadmap-progress .sp-roadmap-marker { background: var(--primary); box-shadow: 0 0 0 2px rgba(59, 130, 246, .35); animation: sp-roadmap-pulse 2s ease-in-out infinite; }
.sp-roadmap-planned .sp-roadmap-marker { background: var(--text-muted); }

@keyframes sp-roadmap-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: .75; }
}

.sp-roadmap-body {
    flex: 1;
    background: var(--sp-widget-bg, var(--bg-card));
    border: 1px solid var(--sp-widget-border, var(--border));
    border-radius: var(--sp-radius-md);
    padding: .85rem 1rem;
    box-shadow: var(--sp-shadow-soft);
}
.sp-roadmap-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .65rem;
    margin-bottom: .35rem;
}
.sp-roadmap-head h3 { margin: 0; font-size: 1rem; }
.sp-roadmap-body p { margin: 0; font-size: .9rem; color: var(--text-muted); }

.sp-roadmap-badge {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .15rem .5rem;
    border-radius: 999px;
}
.sp-roadmap-badge-done { background: rgba(34, 197, 94, .15); color: var(--success); }
.sp-roadmap-badge-progress { background: rgba(59, 130, 246, .15); color: var(--primary); }
.sp-roadmap-badge-planned { background: rgba(139, 156, 179, .15); color: var(--text-muted); }
.sp-roadmap-version {
    font-size: .75rem;
    color: var(--text-muted);
    font-family: ui-monospace, monospace;
}

.update-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .35rem 1.25rem;
    margin: 1rem 0;
}
.update-dl dt { color: var(--text-muted); font-size: .88rem; }
.update-dl dd { margin: 0; }

.update-changelog {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--sp-surface-muted, var(--bg));
    border: 1px solid var(--sp-widget-border, var(--border));
    border-radius: var(--sp-radius-md);
}
.update-changelog pre {
    margin: .5rem 0 0;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: .88rem;
    color: var(--text-muted);
}
.update-roadmap-preview {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--sp-accent-soft);
    border: 1px solid var(--sp-widget-border, var(--border));
    border-radius: var(--sp-radius-md);
}
.update-roadmap-list {
    margin: .5rem 0 0;
    padding-left: 1.2rem;
    line-height: 1.55;
}
.update-roadmap-list li + li { margin-top: .65rem; }
.update-required-banner {
    border-left: 4px solid var(--warning);
    font-size: .95rem;
}
.update-install-box {
    margin-top: 1.25rem;
    padding: 1rem;
    border: 1px solid var(--warning);
    border-radius: var(--sp-radius-lg);
    background: rgba(245, 158, 11, .06);
    box-shadow: var(--sp-shadow-soft);
}
.update-install-box h3 { margin-top: 0; }

/* Drag & Drop Wochenplan */
.sp-dnd-palette {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    margin: 0 0 1rem;
    padding: .65rem;
    background: var(--sp-surface-muted, var(--bg-hover));
    border: 1px dashed var(--sp-widget-border, var(--border));
    border-radius: var(--sp-radius-md);
}
.sp-dnd-palette-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: .35rem;
}
.sp-dnd-show {
    display: inline-block;
    padding: .35rem .65rem;
    border-radius: var(--sp-radius-pill);
    font-size: .78rem;
    font-weight: 600;
    cursor: grab;
    background: var(--show-color, var(--primary));
    color: #fff;
    box-shadow: var(--sp-shadow-soft);
    user-select: none;
}
.sp-dnd-show.is-dragging,
.sp-dnd-cell.is-dragging {
    opacity: .55;
    cursor: grabbing;
}
.sp-dnd-cell.is-drop-target {
    outline: 2px dashed var(--primary);
    outline-offset: -2px;
    background: rgba(59, 130, 246, .12) !important;
}
.sp-dnd-status {
    min-height: 1.25rem;
    font-size: .85rem;
    margin: 0 0 .75rem;
}
.sp-dnd-status.is-ok { color: var(--success); }
.sp-dnd-status.is-error { color: var(--error); }
.sp-dnd-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.sp-dnd-duration-label { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.sp-conflict-fixes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sp-dnd-continuation { opacity: .55; cursor: default; }
.sp-continuation { color: var(--text-muted); font-size: 12px; }
.tag-duration { font-size: 10px; background: rgba(59,130,246,.2); color: #93c5fd; padding: 1px 5px; border-radius: 4px; }
.sp-multi-hour { border-left: 2px solid rgba(59,130,246,.5); }
.stream-history-bars { display: flex; align-items: flex-end; gap: 4px; min-height: 44px; margin-top: 8px; }
.stream-history-bar { width: 12px; border-radius: 3px 3px 0 0; background: #64748b; }
.stream-history-bar.is-online { background: #22c55e; }
.stream-history-bar.is-offline { background: #ef4444; }
.health-history-title { font-size: 14px; margin: 16px 0 4px; font-weight: 600; }

.sp-slot-conflict {
    outline: 2px solid var(--error) !important;
    outline-offset: -2px;
    background: rgba(239, 68, 68, 0.12) !important;
}
.tag-conflict {
    display: inline-block;
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: var(--error);
    color: #fff;
}
.conflict-list {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
    font-size: 0.9rem;
}
.sp-copy-day-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.health-item {
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
}
.health-item.is-ok { border-color: var(--success); }
.health-item.is-warn { border-color: var(--warning, #f59e0b); }
.health-item.is-bad { border-color: var(--error); }
.health-label { display: block; font-size: 0.75rem; color: var(--muted); }
.health-value { font-weight: 600; font-size: 0.95rem; }

.sp-home-stream-wrap {
    max-width: 520px;
    margin: 0 auto 1.25rem;
    padding: 0 1rem;
}
.sp-home-stream-wrap .sp-widget-stream {
    margin: 0;
}

/* v4.10 — Hero On Air */
.sp-hero-wrap { margin-bottom: .75rem; }
.sp-hero-onair {
    max-width: min(720px, 100%);
    margin: 0 auto;
    padding: 0 clamp(.65rem, 3vw, 1rem);
}
.sp-hero-onair-inner {
    position: relative;
    border-radius: var(--sp-radius-lg);
    overflow: hidden;
    background: linear-gradient(135deg, var(--hero-color, #2563eb), color-mix(in srgb, var(--hero-color, #2563eb) 55%, #0f172a));
    box-shadow: var(--sp-shadow-card);
    padding: 1rem 1.1rem;
    color: #fff;
}
.sp-hero-onair-badge {
    position: absolute;
    top: .65rem;
    right: .75rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .08em;
    padding: .28rem .55rem;
    border-radius: 999px;
}
.sp-hero-onair-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.sp-hero-avatar {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.25);
}
.sp-hero-time { margin: 0 0 .2rem; font-size: .78rem; opacity: .9; }
.sp-hero-title { margin: 0 0 .15rem; font-size: 1.25rem; font-weight: 800; line-height: 1.15; }
.sp-hero-sub { margin: 0 0 .2rem; font-size: .85rem; opacity: .92; }
.sp-hero-dj { margin: 0; font-size: .8rem; font-weight: 700; opacity: .95; }

.sp-settings-preview {
    display: block;
    width: 100%;
    max-width: 720px;
    height: 340px;
    border: 1px solid var(--border);
    border-radius: var(--sp-radius-lg);
    background: var(--bg);
    margin: .5rem 0 1rem;
}
.sp-template-live-preview {
    margin: .75rem 0;
    max-width: 320px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.sp-template-live-preview img { display: block; width: 100%; height: auto; }
