/* ==========================================================================
   Recorder – Design-System (aufbauend auf Bootstrap 5.3)
   Ruhige Flächen, große Radien, Systemschrift, Hell/Dunkel automatisch.
   ========================================================================== */

:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface-2: #fbfbfd;
    --text: #1d1d1f;
    --text-2: #6e6e73;
    --text-3: #a1a1a6;
    --line: rgba(0, 0, 0, .08);
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-soft: rgba(0, 113, 227, .1);
    --header-bg: rgba(245, 245, 247, .72);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 1px rgba(0, 0, 0, .02);
    --shadow: 0 4px 24px rgba(0, 0, 0, .06);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, .12);
    --radius: 18px;
    --radius-sm: 12px;
    --star: #ff9f0a;

    --c-blue: #0a84ff;
    --c-green: #30d158;
    --c-orange: #ff9f0a;
    --c-purple: #bf5af2;
    --c-pink: #ff375f;
    --c-red: #ff453a;

    --bs-body-font-family: var(--font-sans);
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-secondary-color: var(--text-2);
    --bs-border-color: var(--line);
    --bs-link-color-rgb: 0, 113, 227;
    --bs-link-hover-color-rgb: 0, 119, 237;
    --bs-primary: var(--accent);
    --bs-primary-rgb: 0, 113, 227;
    --bs-border-radius: var(--radius-sm);
    --bs-border-radius-lg: var(--radius);
}

[data-bs-theme="dark"] {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --text: #f5f5f7;
    --text-2: #98989d;
    --text-3: #636366;
    --line: rgba(255, 255, 255, .1);
    --accent: #2997ff;
    --accent-hover: #47a6ff;
    --accent-soft: rgba(41, 151, 255, .16);
    --header-bg: rgba(22, 22, 23, .72);
    --shadow-sm: none;
    --shadow: none;
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, .6);
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-secondary-color: var(--text-2);
    --bs-tertiary-bg: var(--surface-2);
    --bs-link-color-rgb: 41, 151, 255;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -.01em;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }
a { text-decoration: none; }
.text-tertiary { color: var(--text-3) !important; }
.text-secondary { color: var(--text-2) !important; }

.container-app {
    width: 100%;
    max-width: 1240px;
    margin-inline: auto;
    padding-inline: max(20px, env(safe-area-inset-left));
}

/* ---- Header ------------------------------------------------------------ */

.app-header {
    border-bottom: 1px solid var(--line);
}

/* Blur auf einem Pseudo-Element: backdrop-filter am Header selbst würde ihn zum
   Bezugsrahmen für das (position: fixed) Offcanvas-Menü machen – es wäre nur so hoch wie der Header. */
.app-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--header-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.app-header .navbar { min-height: 56px; padding-block: 6px; }

.navbar-brand { font-weight: 600; font-size: 1.05rem; color: var(--text); }
.navbar-brand:hover { color: var(--text); }

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(145deg, #ff453a, #ff2d55);
    color: #fff;
    font-size: .95rem;
}
.brand-mark-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 1.7rem; }

.nav-pills-app { gap: 2px; }
.nav-pills-app .nav-link {
    color: var(--text);
    opacity: .8;
    font-size: .9rem;
    padding: 6px 12px !important;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: 0;
}
.nav-pills-app .nav-link:hover { opacity: 1; background: var(--line); }
.nav-pills-app .nav-link.active { opacity: 1; background: var(--text); color: var(--bg); }

.btn-icon {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    padding: 0;
    color: var(--text);
    border: 0;
    font-size: 1.1rem;
}
.btn-icon:hover { background: var(--line); color: var(--text); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover, .btn-accent:focus, .btn-accent.show { background: var(--accent-hover); color: #fff; }

.dropdown-menu {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 6px;
    background: var(--surface);
    --bs-dropdown-link-active-bg: var(--accent);
}
.dropdown-item { border-radius: 8px; padding: 7px 12px; display: flex; gap: 10px; align-items: center; }

@media (max-width: 991.98px) {
    .offcanvas-lg { background: var(--surface); }
    .nav-pills-app .nav-link { font-size: 1.05rem; padding: 12px 14px !important; border-radius: 12px; }
    .nav-pills-app .nav-link.active { background: var(--accent-soft); color: var(--accent); }
}

/* ---- Typografie & Überschriften ---------------------------------------- */

.display-title {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.08;
    margin: 0;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.section-header h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.section-more { font-size: .9rem; white-space: nowrap; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    font-size: .95rem;
}

/* ---- Flächen ------------------------------------------------------------ */

.panel {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}
.panel-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 14px; }

.notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--accent);
}
.notice > .bi { font-size: 1.15rem; color: var(--accent); }
.notice-success { border-left-color: var(--c-green); }
.notice-success > .bi { color: var(--c-green); }
.notice-danger { border-left-color: var(--c-red); }
.notice-danger > .bi { color: var(--c-red); }
.notice-warning { border-left-color: var(--c-orange); }
.notice-warning > .bi { color: var(--c-orange); }

.empty-state { text-align: center; padding: 48px 16px; color: var(--text-2); }
.empty-state > .bi { font-size: 2.6rem; display: block; margin-bottom: 10px; color: var(--text-3); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--line);
    font-size: .8rem;
    font-weight: 500;
    color: var(--text);
}
.chip-success { background: rgba(48, 209, 88, .15); color: #248a3d; }
.chip-warning { background: rgba(255, 159, 10, .16); color: #b25000; }
.chip-danger { background: rgba(255, 55, 95, .12); color: #d70015; }
[data-bs-theme="dark"] .chip-success { color: var(--c-green); }
[data-bs-theme="dark"] .chip-warning { color: var(--c-orange); }
[data-bs-theme="dark"] .chip-danger { color: var(--c-pink); }

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

.btn { font-weight: 500; }
.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-active-bg: var(--accent-hover);
    --bs-btn-disabled-bg: var(--accent);
    --bs-btn-disabled-border-color: var(--accent);
}
.btn-outline-secondary {
    --bs-btn-color: var(--text);
    --bs-btn-border-color: var(--line);
    --bs-btn-hover-bg: var(--line);
    --bs-btn-hover-color: var(--text);
    --bs-btn-hover-border-color: transparent;
    background: var(--surface);
}
.btn-dark { background: var(--text); color: var(--bg); border: 0; }

/* ---- Filter ------------------------------------------------------------- */

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 22px; }

.segmented {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    background: var(--line);
    border-radius: 10px;
    overflow-x: auto;
    max-width: 100%;
}
.segmented a {
    padding: 5px 14px;
    border-radius: 8px;
    color: var(--text);
    font-size: .875rem;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.segmented a.active { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.segmented-lg a { padding: 8px 16px; font-size: .95rem; }
@media (max-width: 575.98px) { .segmented-lg a span { display: none; } }

.chip-toggle {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-size: .875rem;
    font-weight: 500;
}
.chip-toggle.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- Grid & Karten ------------------------------------------------------ */

.media-grid {
    display: grid;
    gap: 28px 18px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    align-items: start;
}
.media-grid.layout-square { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.media-grid.layout-video { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
@media (max-width: 575.98px) {
    .media-grid, .media-grid.layout-square { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
    .media-grid.layout-video { grid-template-columns: 1fr; }
}

.media-card { position: relative; min-width: 0; }
.media-card-link { color: inherit; display: block; }
.media-card-link:hover { color: inherit; }

.media-cover {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-2);
    box-shadow: var(--shadow);
    transition: transform .25s ease, box-shadow .25s ease;
}
.shape-square .media-cover { aspect-ratio: 1; }
.shape-wide .media-cover { aspect-ratio: 16 / 9; }
.media-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-card-link:hover .media-cover { transform: translateY(-3px) scale(1.015); box-shadow: var(--shadow-lg); }

.media-cover-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 2.4rem;
    color: var(--text-3);
    background: linear-gradient(160deg, var(--surface-2), var(--line));
}

.media-badge-favorite, .media-badge-todo {
    position: absolute;
    top: 8px;
    font-size: .75rem;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(8px);
    color: #fff;
}
.media-badge-favorite { right: 8px; color: #ff375f; background: rgba(255, 255, 255, .85); }
.media-badge-todo { left: 8px; }

.media-meta { padding-top: 10px; }
.media-title {
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.media-subtitle { font-size: .82rem; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-card.is-todo .media-cover { opacity: .75; }

.btn-done {
    margin-top: 8px;
    width: 100%;
    border-radius: 999px;
    background: rgba(48, 209, 88, .15);
    color: #248a3d;
    border: 0;
}
.btn-done:hover { background: var(--c-green); color: #fff; }
[data-bs-theme="dark"] .btn-done { color: var(--c-green); }

.stars { color: var(--star); display: inline-flex; gap: 1px; font-size: .95rem; white-space: nowrap; }
.stars.small { font-size: .75rem; margin-top: 4px; }
.stars.lg { font-size: 1.25rem; gap: 3px; }

/* ---- Listen ------------------------------------------------------------- */

.list-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.list-row {
    display: flex;
    gap: 16px;
    padding: 14px 18px;
    align-items: flex-start;
}
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row.is-todo { background: linear-gradient(90deg, rgba(255, 159, 10, .07), transparent 40%); }

.list-row-thumb {
    flex: 0 0 auto;
    width: 112px;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface-2);
    display: grid;
    place-items: center;
    color: var(--text-3);
    font-size: 1.4rem;
}
.list-row-thumb.shape-poster { width: 56px; aspect-ratio: 2 / 3; }
.list-row-thumb.shape-square { width: 64px; aspect-ratio: 1; }
.list-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 575.98px) { .list-row-thumb { width: 72px; } }

.list-row-body { flex: 1; min-width: 0; }
.list-row-title { color: var(--text); font-weight: 600; font-size: 1rem; display: block; }
.list-row-title:hover { color: var(--accent); }
.list-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .85rem; margin-top: 2px; }
.list-row-meta a { max-width: 100%; }
.list-row-text { color: var(--text-2); font-size: .9rem; margin: 6px 0 0; }
.list-row-text mark { background: rgba(255, 214, 10, .45); color: inherit; padding: 0 2px; border-radius: 3px; }
.list-row-aside { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.list-row-aside .btn-done { width: auto; margin: 0; padding-inline: 12px; }

.diary-day { margin-bottom: 28px; }
.diary-date { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin: 0 0 8px 6px; }

.diary-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    color: var(--text);
}
.diary-row + .diary-row { border-top: 1px solid var(--line); }
.diary-row:hover { background: var(--surface-2); color: var(--text); }
.diary-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    flex: 0 0 auto;
}
.diary-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.diary-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.diary-badge { font-size: .8rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.episode-code {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: .8rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--line);
    flex: 0 0 auto;
}

/* ---- Tags --------------------------------------------------------------- */

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag-list-sm .tag { font-size: .75rem; padding: 2px 9px; }
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: .85rem;
    font-weight: 500;
}
.tag:hover { background: var(--accent); color: #fff; }
.tag-count { font-size: .75em; opacity: .7; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-cloud .tag { font-size: calc(.85rem * var(--weight, 1)); }

/* ---- Startseite --------------------------------------------------------- */

.hero-welcome {
    font-size: clamp(1.25rem, 2.6vw, 1.6rem);
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.3;
    color: var(--text-2);
    max-width: 760px;
}

.search-field { position: relative; }
.search-field .bi { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-2); }
.search-field input {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 12px;
    padding: 12px 16px 12px 42px;
    font-size: 1rem;
    outline: none;
}
.search-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---- Detail ------------------------------------------------------------- */

.detail {
    display: grid;
    grid-template-columns: minmax(200px, 320px) 1fr;
    gap: 40px;
    align-items: start;
}
.detail-square { grid-template-columns: minmax(200px, 340px) 1fr; }
.detail-wide { grid-template-columns: 1fr; max-width: 900px; }
.detail-wide .detail-cover { max-width: 900px; }
.detail:not(:has(.detail-cover, .detail-media)) { grid-template-columns: 1fr; max-width: 820px; }
@media (max-width: 767.98px) {
    .detail { grid-template-columns: 1fr; gap: 24px; }
    .detail-cover.shape-poster { max-width: 240px; }
}

.detail-cover { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); background: var(--surface-2); }
.detail-cover img { width: 100%; display: block; }
.detail-media { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); background: #000; }

.detail-eyebrow { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin-bottom: 6px; }
.detail-title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; margin-bottom: 6px; }
.detail-subtitle { font-size: 1.2rem; color: var(--text-2); margin-bottom: 12px; }
.detail-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 18px; }
.detail-links, .detail-admin { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.detail-admin { padding-top: 20px; border-top: 1px solid var(--line); }

.kv-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 0 0 20px; font-size: .95rem; }
.kv-list dt { font-weight: 400; color: var(--text-2); }
.kv-list dd { margin: 0; }

.prose { font-size: 1.05rem; line-height: 1.65; }
.prose > :last-child { margin-bottom: 0; }
.prose img { max-width: 100%; border-radius: var(--radius-sm); }
.prose blockquote { border-left: 3px solid var(--line); padding-left: 16px; color: var(--text-2); }
.prose pre { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px; overflow-x: auto; }
.prose code { color: var(--c-pink); font-size: .9em; }
.prose pre code { color: inherit; }
.prose table { width: 100%; margin-bottom: 1rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 6px 8px; }

.shownotes { margin: 12px 0; font-size: .95rem; color: var(--text-2); }
.shownotes summary { cursor: pointer; color: var(--text); font-weight: 500; }
.shownotes p { margin: 8px 0 0; }

/* ---- Wiki --------------------------------------------------------------- */

.wiki-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.wiki-layout:not(:has(.wiki-toc)) { grid-template-columns: 1fr; }
@media (max-width: 991.98px) { .wiki-layout { grid-template-columns: 1fr; } }
.wiki-toc { position: sticky; top: 80px; font-size: .9rem; }
.wiki-toc-title { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin-bottom: 8px; }
.wiki-toc ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.wiki-toc li a { display: block; padding: 4px 0 4px 14px; color: var(--text-2); }
.wiki-toc li a:hover { color: var(--accent); }
.wiki-toc li.level-2 a { padding-left: 26px; font-size: .85rem; }
.wiki-content { padding: 32px; }
.wiki-content h1, .wiki-content h2 { scroll-margin-top: 80px; letter-spacing: -.02em; }
.wiki-content h1 { font-size: 1.8rem; margin-top: 1.6em; }
.wiki-content h2 { font-size: 1.4rem; margin-top: 1.4em; }
.wiki-content > :first-child { margin-top: 0; }
.wiki-link { border-bottom: 1px dotted currentColor; }
.wiki-link-new { color: var(--c-red); }

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

.form-label { font-weight: 500; font-size: .9rem; margin-bottom: 6px; }
.form-control, .form-select {
    border-radius: 10px;
    border-color: var(--line);
    background-color: var(--surface-2);
    color: var(--text);
}
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background-color: var(--surface); }
.form-control-lg { border-radius: 12px; font-size: 1.05rem; }
.form-control[readonly] { color: var(--text-2); }
.form-check-input:checked { background-color: var(--c-green); border-color: var(--c-green); }
.form-switch .form-check-input { width: 2.6em; height: 1.45em; margin-top: .1em; }
.form-check-label { padding-left: 6px; }

.autocomplete { position: relative; }
.autocomplete-menu {
    position: absolute;
    z-index: 1050;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    max-height: 360px;
    overflow-y: auto;
    display: none;
}
.autocomplete-menu.show { display: block; }
.autocomplete-item { padding: 8px 10px; border-radius: 9px; cursor: pointer; display: flex; gap: 12px; align-items: center; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--accent-soft); }
.autocomplete-item img, .autocomplete-item .ph { width: 34px; height: 51px; object-fit: cover; border-radius: 5px; background: var(--line); flex: 0 0 auto; }
.autocomplete-item small { color: var(--text-2); display: block; }

.tag-input {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 7px 10px;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    cursor: text;
}
.tag-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.tag-input > input { flex: 1; min-width: 140px; border: 0; outline: 0; background: transparent; color: var(--text); }
.tag-input .tag button { border: 0; background: none; color: inherit; padding: 0; line-height: 1; opacity: .7; }

.star-input { display: inline-flex; align-items: center; gap: 4px; font-size: 1.9rem; color: var(--star); cursor: pointer; user-select: none; outline: none; }
.star-input:focus-visible { box-shadow: 0 0 0 4px var(--accent-soft); border-radius: 8px; }
.star-input .btn-link { font-size: .8rem; text-decoration: none; }

.cover-preview {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-2);
    aspect-ratio: 2 / 3;
    max-width: 220px;
    margin-inline: auto;
    display: grid;
    place-items: center;
    border: 1px dashed var(--line);
}
.cover-preview.shape-square { aspect-ratio: 1; }
.cover-preview.shape-wide { aspect-ratio: 16 / 9; max-width: 100%; }
.cover-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-preview > .bi { font-size: 2rem; color: var(--text-3); display: none; }
.cover-preview.is-empty img { display: none; }
.cover-preview.is-empty > .bi { display: block; }

.auth-card { max-width: 400px; padding: 36px; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); margin-top: 4vh; }

/* ---- Statistik ---------------------------------------------------------- */

.stat-tile { background: var(--surface); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); height: 100%; }
.stat-label { font-size: .85rem; color: var(--text-2); display: flex; gap: 6px; align-items: center; }
.stat-label .bi { color: var(--accent, var(--c-blue)); }
.stat-value { font-size: 2.4rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin-top: 4px; }
.stat-sub { font-size: .85rem; color: var(--star); }

.chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; height: 240px; align-items: end; }
.chart-col { display: flex; flex-direction: column; height: 100%; align-items: center; gap: 6px; }
.chart-total { font-size: .75rem; font-weight: 600; min-height: 1em; }
.chart-bar { flex: 1; width: 100%; max-width: 44px; display: flex; flex-direction: column-reverse; border-radius: 8px; overflow: hidden; background: var(--line); }
.chart-bar span { display: block; width: 100%; }
.chart-label { font-size: .75rem; color: var(--text-2); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; font-size: .85rem; color: var(--text-2); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }

.bar-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.bar-list li { display: grid; grid-template-columns: minmax(80px, 140px) 1fr 36px; gap: 12px; align-items: center; font-size: .9rem; }
.bar-list-bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar-list-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar-list-count { text-align: right; color: var(--text-2); }

/* ---- Installation & Update ---------------------------------------------- */

.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list .ok .bi { color: var(--c-green); }
.check-list .failed .bi { color: var(--c-red); }

.migration-result { display: flex; gap: 12px; padding: 10px 0; }
.migration-result + .migration-result { border-top: 1px solid var(--line); }
.migration-result.ok > .bi { color: var(--c-green); }
.migration-result.failed > .bi { color: var(--c-red); }

/* ---- Paginierung & Footer ----------------------------------------------- */

.pagination-app { gap: 4px; }
.pagination-app .page-link {
    border: 0;
    border-radius: 10px !important;
    min-width: 38px;
    text-align: center;
    color: var(--text);
    background: var(--surface);
}
.pagination-app .page-item.active .page-link { background: var(--text); color: var(--bg); }
.pagination-app .page-item.disabled .page-link { background: transparent; color: var(--text-3); }

.app-footer { padding: 40px 0 calc(40px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); margin-top: 40px; font-size: .9rem; }
.footer-link { color: var(--text-2); margin-left: 10px; }
.footer-link:hover { color: var(--accent); }

.modal-content { border-radius: 20px; border: 0; background: var(--surface); }
