/* ==========================================================================
   KushHub – Oberflaeche (Sanierung 10.11.2026)
   Dunkel, an Twitch angelehnt. Keine externen Schriften oder Bibliotheken.
   ========================================================================== */

:root {
    --bg: #0e0e10;
    --surface: #18181b;
    --surface-2: #1f1f23;
    --surface-3: #26262c;
    --line: #2f2f36;
    --line-strong: #3d3d46;
    --text: #efeff1;
    --muted: #adadb8;
    --faint: #7d7d8a;
    --accent: #9147ff;
    --accent-strong: #a970ff;
    --accent-soft: rgba(145, 71, 255, 0.16);
    --ok: #00d68f;
    --ok-soft: rgba(0, 214, 143, 0.14);
    --warn: #ffb224;
    --warn-soft: rgba(255, 178, 36, 0.14);
    --danger: #ff5c5c;
    --danger-soft: rgba(255, 92, 92, 0.14);
    --live: #eb0400;
    --radius: 12px;
    --radius-small: 8px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --topbar-height: 60px;
    --page-width: 1320px;
    color-scheme: dark;
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

h1 { font-size: 1.75rem; font-weight: 750; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }

p { margin: 0 0 0.75rem; }
p:last-child { margin-bottom: 0; }

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

a:hover { text-decoration: underline; }

small { font-size: 0.82rem; color: var(--muted); }

img { max-width: 100%; display: block; }

:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 2px;
    border-radius: 6px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.icon {
    flex: none;
    vertical-align: -0.2em;
}

/* --------------------------------------------------------------------------
   Kopfleiste
   -------------------------------------------------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(24, 24, 27, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.topbar-inner {
    max-width: var(--page-width);
    height: var(--topbar-height);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.brand:hover { text-decoration: none; }

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), #6b2be0);
    color: #fff;
    font-weight: 900;
    font-size: 1.05rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 13px;
    border-radius: 9px;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--surface-3);
    color: var(--text);
    text-decoration: none;
}

.nav-link.is-active {
    color: var(--text);
    background: var(--accent-soft);
}

.nav-link.is-active .icon { color: var(--accent-strong); }

.nav-count,
.tab-count {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text);
    font-size: 0.74rem;
    font-weight: 700;
}

.nav-count {
    background: var(--accent);
    color: #fff;
}

.topbar-side {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 650;
    white-space: nowrap;
}

.pill .dot,
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--faint);
}

.pill-ok .dot { background: var(--ok); }
.pill-warn { color: var(--warn); border-color: rgba(255, 178, 36, 0.35); }
.pill-warn .dot { background: var(--warn); }

.pill-live {
    background: var(--live);
    border-color: var(--live);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pill-live:hover { text-decoration: none; filter: brightness(1.1); }
.pill-live .dot { background: #fff; animation: pulse 1.6s ease-in-out infinite; }

@keyframes pulse {
    50% { opacity: 0.35; }
}

.avatar {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--surface-3);
    border: 1px solid var(--line-strong);
    color: var(--text);
    font-weight: 750;
    font-size: 0.85rem;
}

.avatar-large {
    width: 52px;
    height: 52px;
    font-size: 1.35rem;
}

.menu { position: relative; }

.menu-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 8px 0 5px;
    border-radius: 999px;
    cursor: pointer;
    list-style: none;
    color: var(--muted);
    font-weight: 600;
    user-select: none;
}

.menu-button::-webkit-details-marker { display: none; }
.menu-button:hover,
.menu[open] .menu-button { background: var(--surface-3); color: var(--text); }

.menu-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 210px;
    padding: 6px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.menu-head {
    display: flex;
    flex-direction: column;
    padding: 8px 10px 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line);
}

.menu-panel a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-small);
    color: var(--text);
    font-weight: 550;
}

.menu-panel a:hover { background: var(--surface-3); text-decoration: none; }

.testbar {
    background: var(--warn-soft);
    border-bottom: 1px solid rgba(255, 178, 36, 0.35);
    color: var(--warn);
}

.testbar-inner {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Seitenrahmen
   -------------------------------------------------------------------------- */

.page {
    flex: 1;
    width: 100%;
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 26px 20px 60px;
    position: relative;
    z-index: 2;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.lead {
    margin: 6px 0 0;
    color: var(--muted);
    max-width: 68ch;
}

.head-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.crumbs {
    margin-bottom: 14px;
    font-weight: 600;
}

.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); text-decoration: none; }

.section { margin-top: 34px; }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.link-more { font-weight: 600; font-size: 0.9rem; white-space: nowrap; }

.hint {
    color: var(--muted);
    font-size: 0.88rem;
}

.narrow { max-width: 620px; }

.footer {
    max-width: var(--page-width);
    width: 100%;
    margin: 0 auto;
    padding: 18px 20px 26px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--faint);
    font-size: 0.82rem;
    border-top: 1px solid var(--line);
    position: relative;
    z-index: 2;
}

.footer a { color: var(--faint); }

/* --------------------------------------------------------------------------
   Knoepfe
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--surface-3);
    color: var(--text);
    font: inherit;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, transform 0.06s;
}

.btn:hover {
    background: #32323a;
    border-color: #4a4a55;
    text-decoration: none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: #7d34ea;
    border-color: #7d34ea;
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
}

.btn-ghost:hover {
    background: var(--surface-3);
    border-color: transparent;
    color: var(--text);
}

.btn-danger {
    background: var(--danger-soft);
    border-color: rgba(255, 92, 92, 0.4);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(255, 92, 92, 0.24);
    border-color: var(--danger);
}

.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { color: var(--danger); background: var(--danger-soft); }

.btn-small {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.85rem;
    border-radius: 8px;
    gap: 6px;
}

.btn-large {
    min-height: 48px;
    font-size: 1.02rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn:disabled,
.btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

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

.alert,
.notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px;
    margin-bottom: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
    background: var(--surface-2);
}

.alert { display: block; }
.alert a { font-weight: 650; margin-left: 6px; }

.alert-success {
    border-color: rgba(0, 214, 143, 0.4);
    background: var(--ok-soft);
}

.alert-error {
    border-color: rgba(255, 92, 92, 0.45);
    background: var(--danger-soft);
}

.alert-info {
    border-color: rgba(145, 71, 255, 0.45);
    background: var(--accent-soft);
}

.alert-password {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notice { color: var(--muted); }
.notice .icon { margin-top: 2px; color: var(--accent-strong); }
.notice-inline { margin: 14px 0 0; }

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 44px 20px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
}

.empty p { max-width: 52ch; }
.empty .icon { color: var(--faint); }

.empty-page {
    margin: 8vh auto 0;
    max-width: 560px;
    border-style: solid;
    background: var(--surface);
}

.empty-page h1 { color: var(--text); }

.error-code {
    font-size: 3.2rem;
    font-weight: 850;
    line-height: 1;
    color: var(--accent-strong);
}

/* --------------------------------------------------------------------------
   Kacheln
   -------------------------------------------------------------------------- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
}

.card:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.card.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s;
}

.card:hover .thumb img { transform: scale(1.03); }

.thumb-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--faint);
    background: linear-gradient(135deg, #1b1b20, #101014);
}

.thumb.is-broken,
.short-frame.is-broken {
    background: linear-gradient(135deg, #1b1b20, #101014);
}

.thumb-time {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.thumb .badge {
    position: absolute;
    left: 8px;
    top: 8px;
}

.card-check {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.card-check input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    padding: 12px 13px 13px;
}

.card-title {
    font-size: 0.98rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent-strong); text-decoration: none; }

.card-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
    overflow-wrap: anywhere;
}

.card-note {
    display: flex;
    gap: 6px;
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.card-note-error { color: var(--danger); }

.card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: auto;
    padding-top: 6px;
}

.card-actions form { display: contents; }

.card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 0;
}

.badge,
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    background: var(--surface-3);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.chip { border-radius: 999px; font-weight: 600; }
a.chip:hover { color: var(--text); text-decoration: none; background: #32323a; }
.chip-accent { background: var(--accent-soft); color: var(--accent-strong); }

.badge-open { background: var(--accent-soft); color: var(--accent-strong); }
.badge-posted { background: rgba(0, 214, 143, 0.9); color: #04271b; }
.badge-done { background: rgba(60, 60, 70, 0.92); color: var(--text); }
.badge-waiting { background: rgba(255, 178, 36, 0.92); color: #2d1e00; }
.badge-error { background: var(--danger); color: #2b0000; }
.badge-platform { background: rgba(0, 0, 0, 0.78); color: #fff; }
.badge-twitch { background: var(--accent); }
.badge-youtube { background: #ff0033; }

.card-body .badge-posted,
.detail .badge-posted,
.segments .badge-posted { background: var(--ok-soft); color: var(--ok); }

.card-body .badge-waiting,
.detail .badge-waiting,
.segments .badge-waiting { background: var(--warn-soft); color: var(--warn); }

.card-body .badge-error,
.detail .badge-error,
.segments .badge-error { background: var(--danger-soft); color: var(--danger); }

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

.live-banner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px;
    margin-bottom: 24px;
    border-radius: var(--radius);
    border: 1px solid rgba(235, 4, 0, 0.5);
    background: linear-gradient(90deg, rgba(235, 4, 0, 0.16), var(--surface) 60%);
    color: var(--text);
}

.live-banner:hover { text-decoration: none; border-color: var(--live); }

.live-banner img {
    width: 176px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-small);
}

.live-banner-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    flex: 1;
    min-width: 0;
}

.live-banner-text strong { font-size: 1.05rem; overflow-wrap: anywhere; }

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
}

.stat:hover { text-decoration: none; border-color: var(--accent); }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-label { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.stat-error { border-color: rgba(255, 92, 92, 0.5); }
.stat-error .stat-label { color: var(--danger); }

/* --------------------------------------------------------------------------
   Reiter, Filter, Sammelaktionen
   -------------------------------------------------------------------------- */

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-weight: 650;
    white-space: nowrap;
}

.tab:hover { color: var(--text); text-decoration: none; }

.tab.is-active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.tab.is-active .tab-count { background: var(--accent); color: #fff; }
.tab-error .tab-count { background: var(--danger); color: #2b0000; }

.filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.filters-total {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.88rem;
}

.search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 260px;
    max-width: 440px;
}

.search .icon {
    position: absolute;
    left: 12px;
    color: var(--faint);
    pointer-events: none;
}

.search input[type="search"] { padding-left: 38px; }

.bulkbar {
    position: sticky;
    top: calc(var(--topbar-height) + 8px);
    z-index: 20;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 9px 13px;
    margin-bottom: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(31, 31, 35, 0.95);
    backdrop-filter: blur(10px);
}

.bulkbar.has-selection { border-color: var(--accent); }

.bulk-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
}

.bulk-all input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
.bulk-count { color: var(--muted); font-size: 0.88rem; }

.bulk-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 28px;
}

.pager-info { color: var(--muted); font-size: 0.9rem; }

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

input[type="text"],
input[type="search"],
input[type="url"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

textarea { resize: vertical; min-height: 84px; }

input::placeholder,
textarea::placeholder { color: var(--faint); }

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

select {
    appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23adadb8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    cursor: pointer;
}

select:disabled { opacity: 0.55; cursor: not-allowed; }

.select { display: inline-flex; }
.select select { width: auto; min-width: 150px; }

.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label { font-weight: 650; }

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.form-actions-stack { flex-direction: column; }

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.check input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--accent);
}

.check span { display: flex; flex-direction: column; }
.check input:disabled + span { color: var(--faint); }

.more summary {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.more summary:hover { color: var(--text); }
.more[open] summary { margin-bottom: 10px; }

.copy-row {
    display: flex;
    gap: 8px;
}

.copy-row input {
    font-size: 0.85rem;
    min-height: 32px;
    padding: 4px 10px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.result-list {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-list li {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    overflow-wrap: anywhere;
}

.result-list .is-ok .icon { color: var(--ok); margin-top: 3px; }
.result-list .is-skip { color: var(--muted); }
.result-list .is-skip .icon { color: var(--warn); margin-top: 3px; }

/* --------------------------------------------------------------------------
   Flaechen
   -------------------------------------------------------------------------- */

.panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.panel-quiet {
    background: transparent;
    border-style: dashed;
    gap: 4px;
    padding: 10px;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.panel-title .icon { color: var(--accent-strong); }

.facts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    margin: 0;
}

.facts dt {
    margin-top: 8px;
    color: var(--faint);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.facts .notes {
    color: var(--muted);
    font-size: 0.88rem;
}

.status-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    font-weight: 650;
}

.status-ok { color: var(--ok); }
.status-error { color: var(--danger); }

.log {
    margin: 0;
    padding: 12px;
    max-height: 320px;
    overflow: auto;
    border-radius: var(--radius-small);
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--muted);
    font: 0.78rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.table-wrap { padding: 0; overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th,
.table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.table th {
    color: var(--faint);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------------------
   Clip-Detail und Video-Studio
   -------------------------------------------------------------------------- */

.detail,
.studio {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
    align-items: start;
}

.studio { grid-template-columns: minmax(0, 1fr) 380px; }

.detail-main,
.studio-main { min-width: 0; }

.detail-side,
.studio-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.studio-side {
    position: sticky;
    top: calc(var(--topbar-height) + 14px);
    max-height: calc(100vh - var(--topbar-height) - 28px);
    overflow-y: auto;
    padding-right: 2px;
}

.player {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
}

.player iframe,
.player img,
.player #player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
}

.player-problem {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    margin: 0;
    text-align: center;
    color: var(--muted);
}

.detail-title {
    margin: 16px 0 6px;
    font-size: 1.4rem;
    overflow-wrap: anywhere;
}

.detail .card-meta .badge,
.studio .card-meta .badge { margin-right: 6px; }

.timeline {
    position: relative;
    height: 14px;
    margin-top: 10px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.timeline-mark {
    position: absolute;
    top: -3px;
    width: 6px;
    height: 18px;
    margin-left: -3px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: var(--accent-strong);
    cursor: pointer;
}

.timeline-mark:hover { background: #fff; }

.cut-row {
    display: grid;
    grid-template-columns: 130px 1fr auto;
    align-items: center;
    gap: 10px;
}

.btn-cut { min-height: 44px; }

.cut-time {
    font-size: 1.2rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.nudge {
    display: inline-flex;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    overflow: hidden;
}

.nudge button {
    min-width: 36px;
    height: 32px;
    padding: 0 6px;
    border: 0;
    background: var(--surface-3);
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.nudge button + button { border-left: 1px solid var(--line-strong); }
.nudge button:hover { background: #32323a; }
.nudge button:disabled { opacity: 0.35; cursor: not-allowed; }

.cut-info {
    margin: 0;
    padding: 9px 12px;
    border-radius: var(--radius-small);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.88rem;
}

.cut-info.is-ok { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.cut-info.is-warn { background: var(--warn-soft); color: var(--warn); }

#marker-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#marker-fields[hidden] { display: none; }

.segments {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.segment {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.segment:first-child { border-top: 0; padding-top: 0; }
.segment:last-child { padding-bottom: 0; }
.segment.is-done .segment-title { color: var(--muted); }

.segment-play {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    align-self: start;
    height: 30px;
    padding: 0 9px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--bg);
    color: var(--accent-strong);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.segment-play:hover { border-color: var(--accent); color: #fff; background: var(--accent); }

.segment-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.segment-title { overflow-wrap: anywhere; }
.segment-notes { color: var(--muted); overflow-wrap: anywhere; }

/* --------------------------------------------------------------------------
   Shorts
   -------------------------------------------------------------------------- */

.grid-shorts { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.short-frame {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    padding: 0;
    border: 0;
    background: #000;
    cursor: pointer;
    overflow: hidden;
}

.short-frame img,
.short-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
}

.short-frame.is-playing { cursor: default; }

.play-button {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: -29px 0 0 -29px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    transition: background 0.12s, transform 0.12s;
}

.play-button .icon { fill: currentColor; margin-left: 3px; }
.short-frame:hover .play-button { background: var(--accent); transform: scale(1.08); }

/* --------------------------------------------------------------------------
   Verwaltung
   -------------------------------------------------------------------------- */

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.admin-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.user-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.user-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px 12px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.user-list .user-row:first-child { border-top: 0; }

.user-name {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name strong { overflow-wrap: anywhere; }
.user-name .chip { margin-left: 6px; vertical-align: 2px; }
.user-role .select select { min-width: 120px; }

.user-more > summary { list-style: none; }
.user-more > summary::-webkit-details-marker { display: none; }
.user-more[open] { grid-column: 1 / -1; }
.user-more[open] > summary { margin-bottom: 10px; }

.user-more-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    border-radius: var(--radius-small);
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.add-user {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.add-user input { flex: 1 1 200px; width: auto; }

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

.is-guest .page {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.is-guest .page > .alert { max-width: 400px; width: 100%; margin-left: auto; margin-right: auto; }

.login {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding-bottom: 6vh;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
    text-align: center;
}

.login-brand .brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.login-brand p { color: var(--muted); }

.login-note {
    margin-top: 16px;
    text-align: center;
    color: var(--faint);
    font-size: 0.84rem;
}

/* --------------------------------------------------------------------------
   Schwebende Kanal-Emotes am Rand (nur sehr breite Bildschirme)
   -------------------------------------------------------------------------- */

.emote-lanes {
    display: none;
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.emote-lane {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
}

.emote-lane-left { left: 0; }
.emote-lane-right { right: 0; }

.floating-emote {
    position: absolute;
    bottom: -48px;
    width: 34px;
    height: 34px;
    object-fit: contain;
    opacity: 0.32;
    animation: emote-rise 12s linear forwards;
}

@keyframes emote-rise {
    0% { transform: translateY(0) rotate(-6deg); }
    50% { transform: translateY(-55vh) rotate(6deg); }
    100% { transform: translateY(-112vh) rotate(-6deg); opacity: 0; }
}

@media (min-width: 1500px) {
    .emote-lanes { display: block; }
}

/* --------------------------------------------------------------------------
   Kleinere Bildschirme
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .detail,
    .studio,
    .admin-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .studio-side {
        position: static;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 860px) {
    .menu-name,
    .topbar-side .pill-ok { display: none; }

    /* Ohne Weichzeichner: der wuerde die feste Leiste unten an die Kopfleiste binden. */
    .topbar { backdrop-filter: none; background: var(--surface); }

    /* Navigation wandert als feste Leiste an den unteren Rand - wie in einer App. */
    .nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        justify-content: space-around;
        gap: 0;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        background: rgba(24, 24, 27, 0.97);
        border-top: 1px solid var(--line);
        backdrop-filter: blur(12px);
    }

    .nav-link {
        flex: 1;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
        height: 50px;
        padding: 0 4px;
        font-size: 0.7rem;
    }

    .nav-count {
        position: absolute;
        top: 2px;
        left: 50%;
        margin-left: 6px;
        min-width: 18px;
        height: 17px;
        font-size: 0.66rem;
    }

    .topbar-inner { justify-content: space-between; }
    .page { padding: 18px 14px 96px; }
    .footer { padding-bottom: 86px; }

    h1 { font-size: 1.45rem; }
    .stats { gap: 8px; }
    .stat { padding: 12px; }
    .stat-value { font-size: 1.5rem; }
    .stat-label { font-size: 0.78rem; }

    .live-banner { flex-wrap: wrap; }
    .live-banner img { width: 120px; }

    .bulkbar { top: calc(var(--topbar-height) + 6px); }
    .bulk-actions { margin-left: 0; }
    .filters-total { margin-left: 0; width: 100%; }

    .user-row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .user-more { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
    .grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .grid-shorts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .head-actions { width: 100%; }
    .head-actions .btn,
    .head-actions form { flex: 1; }
    .head-actions form .btn { width: 100%; }
    .cut-row { grid-template-columns: 116px 1fr auto; gap: 8px; }
    .search { max-width: none; flex-basis: 100%; }
    .select,
    .select select { flex: 1; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
