/* ClipForge – Oberfläche
   Richtung: Regieplatz beim Livestream – graphitgrau, ruhig, Timecode-Ziffern.
   Gelb (#FFE600, das Untertitel-Gelb) nur dort, wo ein Clip entsteht. */
:root {
  --bg-0: #0f0f10;
  --bg: #141415;
  --card: #19191b;
  --raised: #232325;
  --raised-2: #2b2b2e;
  --line: rgba(237, 237, 237, .08);
  --line-2: rgba(237, 237, 237, .16);
  --text: #ededed;
  --text-2: #a1a1a6;
  --muted: #85858b;
  --accent: #ffe600;
  --accent-ink: #141414;
  --accent-soft: rgba(255, 230, 0, .12);
  --good: #4cc38a;
  --bad: #e5484d;
  --rec: #e5484d;
  --r-ctl: 8px;
  --r-card: 12px;
  --r-panel: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ctl-h: 40px;
  --side-w: 232px;
  color-scheme: dark;
  font-synthesis: none;
}
@media (max-width: 899px) { :root { --ctl-h: 44px; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/22px -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid rgba(237, 237, 237, .6); outline-offset: 2px; }

/* ---------- Symbole (lucide, 1,5 px Strich) */
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ic.s { width: 16px; height: 16px; }

/* ---------- Gerüst: Seitenleiste (Laptop) / Tab-Leiste unten (Handy) */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 30;
  display: flex; flex-direction: column; gap: 24px;
  padding: 20px 12px; background: var(--bg-0); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; height: 32px; text-decoration: none; font-weight: 600; font-size: 16px; }
.mark { width: 24px; height: 24px; flex: none; display: block; }
.mainnav { display: flex; flex-direction: column; gap: 2px; }
.mainnav a {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-ctl);
  text-decoration: none; color: var(--text-2); font-weight: 500; font-size: 14px;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.mainnav a:hover { background: var(--raised); color: var(--text); }
.mainnav a.active { background: var(--raised); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.mainnav a .ic { color: var(--muted); }
.mainnav a.active .ic { color: var(--text); }
.nav-rec { width: 6px; height: 6px; border-radius: 50%; background: var(--rec); margin-left: auto; }
.side-foot { margin-top: auto; padding: 0 10px; font-size: 12px; line-height: 16px; color: var(--muted); }

main { padding: 32px 32px 64px; margin-left: var(--side-w); }
main > * { max-width: 1200px; margin-left: auto; margin-right: auto; }

@media (max-width: 899px) {
  .side {
    inset: auto 0 0 0; width: auto; flex-direction: row; gap: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line); background: rgba(15, 15, 16, .96);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .brand, .side-foot { display: none; }
  .mainnav { flex-direction: row; flex: 1; gap: 0; }
  .mainnav a { flex: 1; flex-direction: column; justify-content: center; gap: 4px; height: 52px; padding: 0; font-size: 11px; line-height: 12px; position: relative; }
  .mainnav a:hover { background: transparent; }
  .mainnav a.active { background: transparent; box-shadow: none; }
  .mainnav a .ic { width: 22px; height: 22px; }
  .nav-rec { position: absolute; top: 8px; left: calc(50% + 10px); margin: 0; }
  main { margin-left: 0; padding: calc(16px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)); }
}

/* ---------- Text */
h1 { font-size: 28px; line-height: 34px; font-weight: 500; margin: 0; }
h2 { font-size: 17px; line-height: 24px; font-weight: 500; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 500; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.sub { color: var(--text-2); }
.small { font-size: 13px; line-height: 20px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.pad { padding: 48px 0; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 899px) { h1 { font-size: 24px; line-height: 30px; } }

/* ---------- Grundbausteine */
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: 16px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head > div:first-child { min-width: 0; }
.page-sub { color: var(--text-2); font-size: 14px; line-height: 20px; margin: 4px 0 0; max-width: 40rem; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); text-decoration: none; font-size: 14px; margin-bottom: 8px; }
.back:hover { color: var(--text); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 32px 0 12px; }
.section-title h2 { margin: 0; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px; min-width: 0; }
.panel + .panel { margin-top: 16px; }
.panel > h2:first-child { margin-top: 0; }
.list { padding: 0; overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }
.empty { padding: 20px; color: var(--muted); margin: 0; }

label.field { display: block; min-width: 0; }
label.field > span { display: block; font-size: 13px; line-height: 20px; color: var(--text-2); margin-bottom: 4px; }
input[type=text], input[type=url], input[type=password], input[type=number], select, textarea {
  width: 100%; min-height: var(--ctl-h); padding: 8px 12px; outline: none;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-ctl);
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--line-2); background: var(--raised-2); }
textarea { resize: vertical; min-height: 64px; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1a6' stroke-width='1.5' 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 10px center; background-size: 16px; }
select.auto { width: auto; }
input[type=color] { width: 44px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); padding: 2px; cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--text-2); }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: var(--ctl-h); cursor: pointer; color: var(--text); }
.check input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--text); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ---------- Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--ctl-h); padding: 0 16px; border-radius: var(--r-ctl);
  border: 1px solid var(--line); background: var(--raised); color: var(--text);
  font-weight: 500; font-size: 14px; line-height: 20px; cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease), opacity .15s var(--ease);
}
.btn:hover { background: var(--raised-2); border-color: var(--line-2); }
.btn:active { transform: scale(.98); }
.btn .ic { color: var(--text-2); }
.btn.primary { background: var(--text); color: #141415; border-color: var(--text); box-shadow: none; }
.btn.primary:hover { background: #ffffff; }
.btn.primary .ic, .btn.accent .ic { color: inherit; }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: none; font-weight: 600; }
.btn.accent:hover { background: #fff04d; border-color: #fff04d; }
.btn.danger { color: var(--bad); }
.btn.danger .ic { color: var(--bad); }
.btn.danger:hover { border-color: rgba(229, 72, 77, .4); background: rgba(229, 72, 77, .08); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--raised); color: var(--text); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn.big { min-height: 48px; padding: 0 20px; font-size: 15px; }
.btn.block, .btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.ready { background: var(--text); color: #141415; border-color: var(--text); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--text); font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.linkbtn:hover { text-decoration-color: var(--text); }

/* Umschalter (Link / Datei, Layout-Modus) */
.tabs { display: flex; gap: 4px; background: var(--bg-0); padding: 4px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { flex: 1; min-height: 36px; border: 0; background: transparent; padding: 0 12px; border-radius: var(--r-ctl);
  font-weight: 500; font-size: 14px; color: var(--text-2); cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease); }
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--raised); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }

.drop { display: block; border: 1px dashed var(--line-2); border-radius: var(--r-card); padding: 32px 16px; text-align: center; color: var(--text-2); cursor: pointer;
  transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.drop .ic { width: 24px; height: 24px; margin-bottom: 8px; color: var(--muted); }
.drop.over { border-color: var(--text-2); background: var(--raised); color: var(--text); }
.drop input { display: none; }

details.more { margin-top: 16px; }
details.more > summary { cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 14px; list-style: none; padding: 4px 0; display: flex; align-items: center; gap: 8px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .18s var(--ease); margin: 0 2px; }
details.more[open] > summary::before { transform: rotate(45deg); }
details.more > summary:hover { color: var(--text); }
details.panel.more { margin-top: 16px; }

/* Fortschritt: das Gelb = hier entsteht ein Clip */
.bar { height: 4px; background: var(--raised-2); border-radius: 2px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .4s var(--ease); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--raised-2); border-top-color: var(--accent); border-radius: 50%;
  animation: spin .9s linear infinite; display: inline-block; vertical-align: -3px; flex: none; }
.spinner.big { width: 32px; height: 32px; }
@keyframes spin { to { transform: rotate(360deg); } }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; font-weight: 500; padding: 2px 8px;
  border-radius: 6px; background: var(--raised); color: var(--text-2); white-space: nowrap; }
.chip.run::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.chip.ok { color: var(--good); background: rgba(76, 195, 138, .1); }
.chip.err { color: var(--bad); background: rgba(229, 72, 77, .1); }
.chip.live { background: var(--rec); color: #fff; }

.alert { border-radius: var(--r-card); padding: 12px 16px; font-size: 14px; line-height: 20px; white-space: pre-wrap; }
.alert.err { background: rgba(229, 72, 77, .08); border: 1px solid rgba(229, 72, 77, .3); }
.alert.warn { background: var(--raised); border: 1px solid var(--line-2); }
.alert a { text-underline-offset: 3px; }

.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--raised); flex: none; object-fit: cover; }

/* ---------- Neu: Formular + Aufträge */
.home { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.home .section-title { margin-top: 0; min-height: 34px; align-items: center; }
@media (max-width: 1099px) { .home { grid-template-columns: minmax(0, 1fr); gap: 0; } .home .section-title { margin-top: 32px; } }
.src-input { min-height: 48px !important; font-size: 15px; }
.form-foot { margin-top: 20px; }

.jobs { display: block; }
.job-card { display: flex; gap: 12px; align-items: center; padding: 12px 16px; text-decoration: none; min-width: 0; transition: background-color .15s var(--ease); }
.job-card:hover { background: var(--raised); }
.job-card .thumb { width: 36px; height: 64px; border-radius: 6px; background: var(--raised) center/cover; flex: none; }
.job-card .title { font-weight: 500; }
.job-card .meta { font-size: 13px; line-height: 20px; color: var(--muted); }
.job-card .bar { margin-top: 8px; }

/* ---------- Auftrag: Rangliste */
.job-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.job-meta a { color: var(--text-2); text-underline-offset: 3px; }
.progress-panel .bar { margin: 16px 0 8px; }
.clips { display: grid; gap: 16px; }
.clip { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 24px; }
@media (max-width: 760px) { .clip { grid-template-columns: 1fr; } }
.clip .player { position: relative; width: 100%; max-width: 252px; aspect-ratio: 9 / 16; background: #000; border-radius: var(--r-card); overflow: hidden; margin: 0 auto; }
.clip video, .clip .player img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clip .player .overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .6); text-align: center; padding: 16px; font-size: 14px; }
.rankline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 8px; }
.rank { font-family: var(--mono); color: var(--muted); font-size: 13px; }
.score { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 500; font-size: 30px; line-height: 1; }
.score small { font-size: 13px; color: var(--muted); font-weight: 400; }
.s-good { color: var(--good); } .s-mid { color: var(--text); } .s-low { color: var(--text-2); }
.values { display: grid; gap: 8px; margin: 16px 0; }
.value { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr) 24px; gap: 12px; align-items: center; font-size: 13px; line-height: 20px; }
.value .bar { height: 4px; }
.value .bar > i { background: var(--text-2); }
.value b { text-align: right; font-weight: 500; font-family: var(--mono); font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .value { grid-template-columns: minmax(0, 1fr) 72px 20px; } }
.tags { color: var(--text-2); font-size: 14px; line-height: 20px; word-break: break-word; }
.reason { color: var(--text-2); font-size: 14px; line-height: 20px; margin: 0 0 8px; }
.edit-title { font-weight: 500; font-size: 17px; line-height: 24px; background: transparent; border: 1px solid transparent; padding: 4px 8px; margin-left: -9px; border-radius: var(--r-ctl); width: 100%; min-height: 0 !important; }
.edit-title:hover, .edit-title:focus { border-color: var(--line); background: var(--raised); }
.times { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px 12px; align-items: end; }
@media (max-width: 480px) { .times { grid-template-columns: 1fr 1fr; } .times .btn { grid-column: span 2; } }
.times .field input { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.nudge { display: flex; gap: 4px; margin-top: 4px; }
.nudge button { flex: 1; min-height: 32px; border-radius: 6px; border: 1px solid var(--line); background: var(--raised); font-size: 12px; font-family: var(--mono); color: var(--text-2); cursor: pointer; }
.nudge button:hover { color: var(--text); border-color: var(--line-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
@media (max-width: 760px) { .actions .btn { flex: 1 1 calc(50% - 8px); } .actions .btn.accent { flex-basis: 100%; min-height: 48px; } }
.toolbar { display: grid; grid-template-columns: minmax(0, 1.4fr) auto auto auto auto; gap: 12px 16px; align-items: end; }
@media (max-width: 760px) { .toolbar { grid-template-columns: 1fr 1fr; } }
.layout-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.cand-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.cand-row b { font-family: var(--mono); font-weight: 500; width: 32px; flex: none; }

/* ---------- Meldungen, Fenster */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: calc(100% - 32px);
  background: var(--raised); border: 1px solid var(--line-2); padding: 12px 16px; border-radius: var(--r-card); font-size: 14px; line-height: 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .4); animation: rise .3s var(--ease); }
.toast.err { border-color: rgba(229, 72, 77, .5); }
@media (min-width: 900px) { .toast { left: calc(50% + var(--side-w) / 2); } }
@media (max-width: 899px) { .toast { bottom: calc(76px + env(safe-area-inset-bottom)); } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 16px; overflow: auto; }
.modal .box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px; width: min(1000px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 216px; gap: 24px; align-items: start; }
@media (max-width: 760px) { .editor { grid-template-columns: 1fr; } }
.stage { position: relative; user-select: none; touch-action: none; border-radius: var(--r-ctl); overflow: hidden; background: #000; }
.stage img { width: 100%; display: block; pointer-events: none; }
.rect { position: absolute; border: 2px solid var(--accent); background: var(--accent-soft); cursor: move; }
.rect .h { position: absolute; width: 20px; height: 20px; background: var(--accent); border-radius: 50%; right: -10px; bottom: -10px; cursor: nwse-resize; }
.rect .h.tl { left: -10px; top: -10px; right: auto; bottom: auto; }
.edit-more { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.preview916 { width: 216px; aspect-ratio: 9 / 16; background: #000; border-radius: var(--r-ctl); display: block; margin: 0 auto; }

/* Auswahlfenster unten (Clip-Länge) */
.sheet-wrap { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s var(--ease); }
.sheet { background: var(--card); border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; width: min(520px, 100%);
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); animation: sheetUp .32s var(--ease); }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 20px; border-bottom: 1px solid var(--line); padding: 24px; } }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sheet-head .avatar { width: 40px; height: 40px; }
.sheet-head b { display: block; font-size: 17px; line-height: 24px; font-weight: 500; }
.lens-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.lens-grid .btn { min-height: 64px; padding: 0 4px; flex-direction: column; gap: 0; font-family: var(--mono); font-size: 20px; font-weight: 500; }
.lens-grid .btn small { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 11px; line-height: 14px; color: var(--muted); font-weight: 400; }
.lens-grid .btn.min { border-color: rgba(255, 230, 0, .4); }
.lens-grid .btn.min small { color: var(--accent); }
.sheet-note { font-size: 13px; line-height: 20px; color: var(--muted); margin: 12px 0 0; }
.sheet .btn.wide { margin-top: 16px; }
@keyframes sheetUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Live */
.live-master { display: flex; align-items: center; gap: 16px; }
.live-state { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 17px; line-height: 24px; }
.live-state i { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.live-state.on i { background: var(--rec); box-shadow: 0 0 0 4px rgba(229, 72, 77, .18); animation: rec 2s ease-in-out infinite; }
@keyframes rec { 50% { opacity: .45; } }
.live-warn { margin-top: 12px; }

.lv-row { display: grid; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) auto auto; grid-template-areas: "name stats clip sw";
  align-items: center; column-gap: 16px; row-gap: 8px; padding: 12px 16px; min-height: 68px; }
.lv-name { grid-area: name; display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 15px; }
.lv-name b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-stats { grid-area: stats; font-size: 13px; line-height: 20px; color: var(--muted); min-width: 0; }
.lv-stats > span { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-stats .ic { width: 14px; height: 14px; }
.lv-stats .num { color: var(--text-2); }
.lv-stats .hot { color: var(--accent); font-weight: 500; }
.lv-stats .warm { color: var(--text); }
.lv-row > .lv-clip { grid-area: clip; }
.lv-row > .switch { grid-area: sw; }
.lv-row.off .lv-name { color: var(--muted); }
.lv-row.off .avatar { opacity: .5; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--rec); flex: none; margin-left: -4px; }
.lv-clip { min-height: 44px; padding: 0 18px; font-size: 15px; }
@media (max-width: 640px) {
  .lv-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name clip sw" "stats stats stats"; column-gap: 12px; padding: 12px; }
  .lv-name .avatar { width: 32px; height: 32px; }
  .lv-clip { padding: 0 14px; }
  .lv-stats .lbl { display: none; }
  .page-head { align-items: flex-start; }
}

.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--raised-2); border: 1px solid var(--line); border-radius: 13px; transition: background-color .18s var(--ease); }
.switch span::before { content: ""; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: transform .18s var(--ease); }
.switch input:checked + span { background: var(--good); border-color: var(--good); }
.switch input:checked + span::before { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid rgba(237, 237, 237, .6); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; }
.switch.big { width: 52px; height: 30px; }
.switch.big span { border-radius: 15px; }
.switch.big span::before { width: 24px; height: 24px; }
.switch.big input:checked + span::before { transform: translateX(22px); }

/* ---------- Ergebnisse: eine Kachel pro Clip */
.res-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -8px 0 20px; font-size: 13px; color: var(--muted); }
.res-tools .ic { width: 16px; height: 16px; }
.res-tools b { color: var(--text-2); font-weight: 500; }
#res-store { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; align-items: stretch; }
.res-grid > .empty { grid-column: 1 / -1; padding: 0; }
.res { padding: 8px 8px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; border-radius: var(--r-panel); }
.panel.res + .panel.res { margin-top: 0; }
.res .player { position: relative; width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: 8px; overflow: hidden; }
.res .player video { width: 100%; height: 100%; object-fit: cover; display: block; }
.res .player.pending { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: var(--bg-0); color: var(--text-2); text-decoration: none; text-align: center; padding: 0 16px; font-size: 13px; }
.res .player.pending .bar { width: 64%; }
.score-badge { position: absolute; top: 8px; left: 8px; font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 500; font-size: 15px; line-height: 20px;
  padding: 2px 8px; border-radius: 6px; background: rgba(15, 15, 16, .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); pointer-events: none; }
.res-meta { display: flex; align-items: center; gap: 8px; min-height: 20px; padding: 0 4px; font-size: 13px; color: var(--muted); }
.res-meta .ellipsis { flex: 1; min-width: 0; }
.res-title { font-weight: 500; line-height: 20px; color: var(--text); text-decoration: none; padding: 0 4px; font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.res-title:hover { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.res-tags { padding: 0 4px; font-size: 13px; line-height: 20px; color: var(--text-2); word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.res-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; padding: 4px 4px 0; }
.res-actions .btn { padding: 0 8px; }
.res-actions .btn.tool { flex-direction: column; gap: 4px; min-height: 56px; padding: 6px 2px; font-size: 12px; line-height: 16px; }
.res-actions .btn.tool span { white-space: nowrap; }
.res-actions .btn.accent, .res-actions .btn.ready { grid-column: 1 / -1; min-height: 44px; }
@media (max-width: 520px) { .res-grid { grid-template-columns: 1fr; } .res-actions .btn.accent, .res-actions .btn.ready { min-height: 48px; font-size: 15px; } }

/* ---------- Mehr / Streamer */
.cols { columns: 2 400px; column-gap: 16px; }
.cols > .panel { break-inside: avoid; margin: 0 0 16px; display: block; }
.cols > .panel + .panel { margin-top: 0; }
.steps { padding-left: 20px; line-height: 24px; margin: 8px 0; }
.steps li + li { margin-top: 4px; }
code { font-family: var(--mono); font-size: 13px; }
code.copy { background: var(--raised); border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; cursor: pointer; user-select: all; word-break: break-all; }
code.copy:hover { border-color: var(--line-2); }
.kv { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 4px 24px; font-size: 14px; line-height: 20px; margin: 0 0 16px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.foot { font-size: 12px; line-height: 16px; color: var(--muted); text-align: center; margin-top: 24px; }
.streamer .head { display: flex; align-items: center; gap: 12px; }

/* ---------- Anmeldung */
.login { max-width: 360px; margin: 12vh auto 0; text-align: center; }
.login .mark { width: 56px; height: 56px; margin: 0 auto 16px; display: block; }
.login h1 { margin-bottom: 8px; }
.login input { text-align: center; font-size: 17px; }
.locked .side { display: none !important; }
.locked main { margin-left: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 640px) {
  .modal { padding: 8px; }
  .modal .box { padding: 16px; max-height: calc(100vh - 16px); }
  .modal .tabs { display: grid; grid-template-columns: 1fr 1fr; }
}
