/*
 * Rewind – Oberfläche.
 * Gestaltungsregeln: neutrale Graustufen für alles Beiläufige, genau eine Signalfarbe
 * (Messing) für Bedienbares, Rot nur für Aufnahme und Warnung. Abstände in Vielfachen
 * von 4px. Keine Schlagschatten an Bedienelementen, nur Kanten.
 */

:root {
  --bg: #0b0c0e;
  --bg-raised: #101216;
  --panel: #14161a;
  --panel-strong: #171a1f;
  --line: #24272e;
  --line-strong: #32363f;

  --text: #e8eaed;
  --text-dim: #9aa0aa;
  --text-faint: #6b717b;

  --accent: #c9a227;
  --accent-soft: rgba(201, 162, 39, 0.14);
  --accent-line: rgba(201, 162, 39, 0.45);
  --danger: #d0553f;
  --ok: #5c9e6b;

  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.55);

  --step-1: 11px;
  --step-0: 13px;
  --step-1-up: 15px;
  --step-2: 19px;
  --step-3: 26px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: var(--step-0)/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.mono {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: -0.01em;
}
.muted { color: var(--text-dim); }
.error { color: var(--danger); }

svg.icon {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}

#viewport { position: fixed; inset: 0; background: #0b0c0e; }
#viewport canvas { display: block; width: 100%; height: 100%; }

/* ========================================================== Anmeldung */
.login-page {
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 500px at 50% -10%, #1a1d23 0%, transparent 70%),
    var(--bg);
}
.login-card {
  width: min(380px, calc(100vw - 32px));
  padding: 36px 32px 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: linear-gradient(145deg, var(--accent), #8c6f15);
  display: grid; place-items: center; color: #15120a;
}
.brand-mark svg { width: 17px; height: 17px; stroke-width: 2; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: var(--step-1-up); font-weight: 600; letter-spacing: 0.01em; }
.brand-sub {
  font-size: var(--step-1); color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.09em;
}

.field { margin-bottom: 14px; }
.field label {
  display: block; margin-bottom: 6px;
  font-size: var(--step-1); color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.field input {
  width: 100%; padding: 10px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--step-1-up);
}
.field input:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.login-card button[type="submit"] {
  width: 100%; margin-top: 8px; padding: 11px;
  background: var(--accent); border: 0; border-radius: var(--radius);
  color: #15120a; font-size: var(--step-1-up); font-weight: 600;
}
.login-card button[type="submit"]:hover { background: #d8af2c; }
.login-note {
  margin: 18px 0 0; padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: var(--step-1); color: var(--text-faint);
}
#hint { margin: 14px 0 0; font-size: var(--step-0); }

/* ========================================================== Flächen */
.panel {
  position: fixed;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

#browser {
  top: 12px; left: 12px; bottom: 12px;
  width: 296px; z-index: 50;
  display: flex; flex-direction: column;
  transition: transform 0.16s ease;
}
#browser.collapsed { transform: translateX(calc(-100% + 44px)); }
#browser header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 12px; border-bottom: 1px solid var(--line);
}
#browser .scroll { flex: 1; overflow-y: auto; padding: 6px 8px 10px; }
#browser footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 14px; border-top: 1px solid var(--line);
  font-size: var(--step-1);
}
#browser footer a { color: var(--text-faint); text-decoration: none; }
#browser footer a:hover { color: var(--text); }

.search { padding: 10px 10px 4px; }
.search input {
  width: 100%; padding: 7px 10px 7px 30px;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); font-size: var(--step-0);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b717b' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>");
  background-repeat: no-repeat; background-position: 8px center; background-size: 14px;
}
.search input:focus { outline: none; border-color: var(--accent-line); }

.list { margin-bottom: 6px; }
.list h2 {
  margin: 12px 8px 7px;
  font-size: var(--step-1); font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-faint);
}
.entry {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 7px 9px; margin-bottom: 2px;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: var(--step-0); text-align: left;
}
.entry:hover { background: var(--panel-strong); border-color: var(--line); }
.entry.active { background: var(--accent-soft); border-color: var(--accent-line); }
.entry .sub { margin-left: auto; font-size: var(--step-1); color: var(--text-faint); }
.entry img {
  width: 20px; height: 20px; border-radius: 3px;
  image-rendering: pixelated; background: var(--bg-raised);
}
.entry.back { color: var(--text-dim); font-size: var(--step-1); padding: 6px 9px; }
.entry.back:hover { color: var(--text); }

/* Aktivität einer Stunde: 60 Minuten als Streifen */
.minutes { display: flex; gap: 1px; height: 14px; margin: 3px 9px 12px; }
.minute { flex: 1; background: #1a1d22; border-radius: 1px; }
.minute.has-data { background: #3c4654; }
.minute.has-voice { background: var(--ok); }
.minute:hover { outline: 1px solid var(--accent); outline-offset: 0; }

/* ========================================================== Editor */
#player-bar {
  left: 50%; bottom: 12px; transform: translateX(-50%);
  width: min(1060px, calc(100vw - 332px));
  padding: 10px 14px 12px; z-index: 50;
}
#player-bar .row { display: flex; align-items: center; gap: 6px; }
#player-bar .row.actions { margin-top: 10px; gap: 6px; }
#player-bar .spacer { flex: 1; }
#player-bar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }

#player-bar button, #player-bar select {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 9px; font-size: var(--step-0);
  color: var(--text-dim);
}
#player-bar button:hover, #player-bar select:hover {
  color: var(--text); border-color: var(--line-strong); background: #1c2027;
}
#player-bar select { padding-right: 6px; }
#player-bar button.icon-only { padding: 6px; }
#player-bar button.primary {
  background: var(--accent); border-color: var(--accent);
  color: #15120a; font-weight: 600;
}
#player-bar button.primary:hover { background: #d8af2c; border-color: #d8af2c; }
#player-bar button.record { color: var(--danger); border-color: rgba(208, 85, 63, 0.4); }
#player-bar button.record:hover { background: rgba(208, 85, 63, 0.12); color: #e8705a; }
#player-bar button:disabled { opacity: 0.4; cursor: default; }
#play { min-width: 34px; justify-content: center; color: var(--text); }
#clock { font-size: var(--step-0); color: var(--text-dim); white-space: nowrap; padding: 0 4px; }
#volume { width: 74px; accent-color: var(--accent); }

.track { margin-top: 11px; user-select: none; }
#ruler { position: relative; height: 13px; font-size: 10px; color: var(--text-faint); }
#ruler span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
#ruler span::after {
  content: ''; position: absolute; left: 50%; top: 12px;
  width: 1px; height: 3px; background: var(--line-strong);
}
#clip-bar {
  position: relative; height: 44px; margin-top: 3px;
  background:
    repeating-linear-gradient(90deg, #171a1f 0 1px, transparent 1px 40px),
    linear-gradient(180deg, #16191e, #121418);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
#selection-range {
  position: absolute; top: 0; bottom: 0;
  background: var(--accent-soft);
  border-left: 1px solid var(--accent); border-right: 1px solid var(--accent);
}
#clip-bar .handle {
  position: absolute; top: 0; bottom: 0; width: 10px;
  background: var(--accent); cursor: ew-resize;
  display: flex; align-items: center; justify-content: center;
  transform: translateX(-5px);
}
#clip-bar .handle::after {
  content: ''; width: 2px; height: 14px;
  background: rgba(21, 18, 10, 0.75); border-radius: 1px;
}
#playhead {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: #fff; pointer-events: none;
}
#playhead::before {
  content: ''; position: absolute; top: 0; left: -4px;
  width: 9px; height: 5px; background: #fff;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
#timeline-marks { position: absolute; left: 0; right: 0; bottom: 3px; height: 9px; }
.mark { position: absolute; bottom: 0; width: 2px; height: 7px; border-radius: 1px; }
.mark.chat { background: #4c6ea8; }
.mark.death { background: var(--danger); height: 9px; }
.mark.voice { background: var(--ok); }
#range-info { font-size: var(--step-1); color: var(--text-dim); }

/* ========================================================== Überlagerungen */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
#crosshair {
  position: absolute; left: 50%; top: 50%; width: 13px; height: 13px;
  margin: -6.5px 0 0 -6.5px; opacity: 0.5; display: none;
  background:
    linear-gradient(#fff, #fff) center/1px 13px no-repeat,
    linear-gradient(#fff, #fff) center/13px 1px no-repeat;
  mix-blend-mode: difference;
}
body.pointer-locked #crosshair { display: block; }

#overlay-info {
  position: absolute; top: 14px; right: 16px; text-align: right;
  font-size: var(--step-1); color: rgba(232, 234, 237, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}
#view-mode { text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); }
#coords { font-variant-numeric: tabular-nums; font-family: ui-monospace, monospace; }

#chat-log {
  position: absolute; left: 324px; bottom: 148px;
  max-width: 440px; font-size: var(--step-0);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}
#chat-log div { margin-top: 2px; }
#chat-log .who { color: var(--accent); }
#event-log {
  position: absolute; right: 16px; bottom: 148px;
  max-width: 320px; text-align: right; font-size: var(--step-1);
  color: rgba(226, 200, 196, 0.9); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

#toast {
  position: fixed; left: 50%; top: 16px; transform: translateX(-50%);
  padding: 8px 15px; background: var(--panel-strong);
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: var(--step-0); z-index: 65; box-shadow: var(--shadow);
}

#splash {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: rgba(8, 9, 11, 0.86); z-index: 30; pointer-events: none;
}
#splash.hidden { display: none; }
.splash-inner {
  width: min(430px, calc(100vw - 32px)); padding: 26px;
  text-align: center; pointer-events: auto;
}
.splash-inner .brand { justify-content: center; margin-bottom: 18px; }
#splash-text { margin: 0; font-size: var(--step-0); color: var(--text-dim); }
#splash-text strong { color: var(--text); font-weight: 600; }
#splash-list {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 20px; max-height: 40vh; overflow-y: auto; text-align: left;
}
#splash-list:empty { display: none; }
#splash-list .entry { background: var(--bg-raised); border-color: var(--line); }
#splash-list .entry:hover { background: var(--accent-soft); border-color: var(--accent-line); }
#progress {
  width: 240px; height: 3px; margin: 18px auto 0;
  background: var(--line); border-radius: 2px; overflow: hidden;
}
#progress-bar { height: 100%; width: 0; background: var(--accent); transition: width 0.2s ease; }

button.icon {
  background: transparent; border: 0; color: var(--text-faint);
  padding: 4px; display: inline-flex; align-items: center;
}
button.icon:hover { color: var(--text); }

/* ========================================================== Inventar */
#inventory {
  z-index: 55; right: 12px; top: 12px; width: 322px;
}
#inventory header, #share header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
#inventory header h2, #share header h2 {
  margin: 0; font-size: var(--step-1); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim);
}
.inv-body { padding: 12px 14px 14px; }
.inv-grid, .inv-row { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; }
.inv-grid { margin: 8px 0; }
.inv-row.hotbar { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.slot {
  position: relative; aspect-ratio: 1;
  background: var(--bg-raised); border: 1px solid #1f2329; border-radius: 3px;
  background-repeat: no-repeat; image-rendering: pixelated;
}
.slot.filled { border-color: #2b3038; }
.slot.held { border-color: var(--accent); }
.slot .count {
  position: absolute; right: 1px; bottom: 0;
  font-size: 10px; font-weight: 700; color: #fff;
  text-shadow: 1px 1px 0 #000; pointer-events: none;
}
#inv-note { margin: 10px 0 0; font-size: var(--step-1); }

/* ========================================================== Teilen */
#share {
  z-index: 60; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 32px));
}
.share-body { padding: 14px; }
.share-body > p { margin: 0 0 12px; font-size: var(--step-1); }
.copy-row { display: flex; align-items: stretch; gap: 6px; }
.copy-row input, .copy-row textarea {
  flex: 1; min-width: 0; padding: 9px 10px;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); font-size: var(--step-1); line-height: 1.55;
  font-family: ui-monospace, monospace; color: var(--text);
  resize: none;
}
.copy-row input:focus, .copy-row textarea:focus {
  outline: none; border-color: var(--accent-line);
}
.copy-row button.copy {
  flex: none; width: 36px; display: grid; place-items: center;
  background: var(--panel-strong); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text-dim);
}
.copy-row button.copy:hover { color: var(--text); border-color: var(--line-strong); }
.share-state { min-height: 16px; margin: 10px 0 12px; font-size: var(--step-1); }
.share-state.good { color: var(--ok); }
.share-state.bad { color: var(--danger); }
.share-body button.wide {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 9px; background: var(--accent);
  border: 0; border-radius: var(--radius);
  color: #15120a; font-weight: 600;
}
.share-body button.wide:disabled { opacity: 0.45; cursor: default; }

#record-badge {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 70; display: flex; align-items: center; gap: 9px;
  padding: 8px 16px; background: var(--panel-strong);
  border: 1px solid rgba(208, 85, 63, 0.5); border-radius: 999px;
  font-size: var(--step-0); box-shadow: var(--shadow);
}
#record-badge .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }

body.clip-mode #browser { display: none; }
body.clip-mode #player-bar { width: min(1060px, calc(100vw - 24px)); }
body.clip-mode #chat-log { left: 16px; }

/* ================================================= Eingebettet (/e/<token>) */
body.embed-mode #player-bar {
  left: 8px; right: 8px; bottom: 8px; width: auto; transform: none;
  padding: 7px 10px 9px; border-radius: 8px;
  background: rgba(16, 18, 22, 0.92);
  backdrop-filter: blur(6px);
}
body.embed-mode #player-bar .track { margin-top: 8px; }
body.embed-mode #clip-bar { height: 26px; }
body.embed-mode #ruler { height: 11px; }
body.embed-mode #chat-log { left: 12px; bottom: 112px; }
body.embed-mode #splash .brand-sub { display: none; }

/* Herkunftsnachweis: aus dem Rahmen heraus zum vollen Ausschnitt. */
#embed-mark {
  position: fixed; top: 10px; left: 12px; z-index: 58;
  display: flex; align-items: center; gap: 7px;
  padding: 5px 11px 5px 8px; border-radius: 999px;
  background: rgba(16, 18, 22, 0.82); border: 1px solid var(--line);
  color: var(--text-dim); font-size: var(--step-1); text-decoration: none;
  letter-spacing: 0.04em;
}
#embed-mark:hover { color: var(--text); border-color: var(--line-strong); }
#embed-mark .brand-mark { display: flex; color: var(--accent); }
#embed-mark svg.icon { width: 13px; height: 13px; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #262a31; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #333842; }

@media (max-width: 1000px) {
  #browser { width: 250px; }
  #player-bar { width: calc(100vw - 24px); }
  #chat-log { left: 16px; bottom: 156px; }
  #inventory { width: 280px; }
}

/* ========================================================== Diagnose */
#diagnostics {
  z-index: 62; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(600px, calc(100vw - 32px));
}
.diag-body { padding: 12px 14px 14px; }
#diag-text {
  margin: 0 0 10px; padding: 12px;
  max-height: 52vh; overflow: auto;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--step-1); line-height: 1.55;
  white-space: pre-wrap; word-break: break-word; color: var(--text-dim);
}
#diag-text b { color: var(--text); font-weight: 600; }
#diag-text .bad { color: var(--danger); }
#diag-copy {
  width: 100%; padding: 9px; background: var(--panel-strong);
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--text-dim);
}
#diag-copy:hover { color: var(--text); border-color: var(--line-strong); }

/* ========================================================== Trefferanalyse */
#hits {
  z-index: 56; right: 12px; top: 12px; width: 372px;
}
#hits header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
#hits header h2 {
  margin: 0; font-size: var(--step-1); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim);
}
.hits-body { padding: 12px 14px 14px; }
#hits-summary { margin: 0 0 10px; font-size: var(--step-0); }
#hits-summary .flag { color: var(--danger); font-weight: 600; }
#hits-list { max-height: 46vh; overflow-y: auto; }
.hit-row {
  display: grid; grid-template-columns: 46px 1fr 56px 48px;
  gap: 8px; align-items: center;
  width: 100%; padding: 6px 8px; margin-bottom: 2px;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius); text-align: left;
  font-size: var(--step-1); color: var(--text-dim);
}
.hit-row:hover { background: var(--panel-strong); border-color: var(--line); color: var(--text); }
.hit-row .time { font-variant-numeric: tabular-nums; font-family: ui-monospace, monospace; }
.hit-row .who { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit-row .dist {
  text-align: right; font-variant-numeric: tabular-nums;
  font-family: ui-monospace, monospace; color: var(--text);
}
.hit-row.over .dist { color: var(--danger); font-weight: 600; }
.hit-row .tag { text-align: right; font-size: 10px; color: var(--accent); }
.hits-note {
  margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: var(--step-1); color: var(--text-faint); line-height: 1.5;
}

/* ========================================================== Clip-Editor */
#backdrop {
  position: fixed; inset: 0; z-index: 58;
  background: rgba(6, 7, 9, 0.62);
}

#clip-editor {
  z-index: 59; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 28px));
  max-height: min(86vh, 760px);
  display: flex; flex-direction: column;
}
/* display: flex sticht das hidden-Attribut aus - deshalb hier ausdruecklich. */
#clip-editor[hidden] { display: none; }
#clip-editor header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
#clip-editor header h2 {
  margin: 0; font-size: var(--step-1); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim);
}
.clip-body { padding: 14px; overflow-y: auto; min-height: 0; }

.field { display: block; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field-label {
  display: block; margin-bottom: 6px;
  font-size: var(--step-1); letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-faint);
}
.field-label .muted { text-transform: none; letter-spacing: 0; }
.field > input[type="text"], .field > select {
  width: 100%; padding: 9px 10px;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text); font-size: var(--step-0);
}
.field > input[type="text"]:focus, .field > select:focus {
  outline: none; border-color: var(--accent-line);
}
.field > input::placeholder { color: var(--text-faint); }
.hint { margin: 7px 0 0; font-size: var(--step-1); color: var(--text-faint); line-height: 1.5; }

.clip-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.clip-columns .field { margin-bottom: 0; }

/* -------- Zeitraum */
.clip-times { display: flex; align-items: center; gap: 8px; }
.clip-times .spacer { flex: 1; }
.clip-arrow { color: var(--text-faint); }
.stamp {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 5px 11px; min-width: 88px;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text);
}
.stamp:hover { border-color: var(--accent-line); }
.stamp-label {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint);
}
.stamp .mono { font-size: var(--step-1-up); }
.clip-length { color: var(--accent); font-size: var(--step-1-up); }

.clip-strip {
  position: relative; height: 30px; margin-top: 9px;
  background: var(--bg-raised);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: ew-resize; touch-action: none;
}
#clip-strip-range {
  position: absolute; top: 0; bottom: 0;
  background: var(--accent-soft);
  border-left: 2px solid var(--accent); border-right: 2px solid var(--accent);
}
#clip-strip-head {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: var(--text); opacity: 0.75;
}

/* -------- Personen */
.clip-people {
  max-height: 188px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-raised);
}
.person {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; cursor: pointer;
  border-bottom: 1px solid var(--line);
  font-size: var(--step-0); color: var(--text-dim);
}
.person:last-child { border-bottom: 0; }
.person:hover { background: var(--panel-strong); color: var(--text); }
.person input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; flex: none; }
.person input[type="checkbox"]:disabled { opacity: 0.5; }
.person .head {
  width: 22px; height: 22px; flex: none; border-radius: 3px;
  background-color: #23262c;
  /* Aus der 64×64-Haut nur das Gesicht (8,8)–(16,16) ausschneiden. */
  background-size: 800% 800%; background-position: 14.2857% 14.2857%;
  image-rendering: pixelated;
  border: 1px solid var(--line-strong);
}
.person .who { flex: 1; min-width: 0; color: var(--text); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.person .tag {
  flex: none; padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 10px; letter-spacing: 0.05em; color: var(--text-faint);
}
.person .tag.voice { color: var(--accent); border-color: var(--accent-line); }
.person .tag.main { color: var(--text-dim); }
.person.off { opacity: 0.5; }
.clip-empty { padding: 12px; font-size: var(--step-1); color: var(--text-faint); }

/* -------- Fußzeile */
.clip-actions {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; border-top: 1px solid var(--line);
}
.clip-actions .spacer { flex: 1; }
#clip-note { font-size: var(--step-1); }
#clip-note.bad { color: var(--danger); }
#clip-note.good { color: var(--ok); }
.clip-actions button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; font-size: var(--step-0);
  background: var(--panel-strong); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text-dim);
}
.clip-actions button:hover { color: var(--text); border-color: var(--line-strong); }
.clip-actions button.primary {
  background: var(--accent); border-color: var(--accent);
  color: #15120a; font-weight: 600;
}
.clip-actions button.primary:hover { background: #d8af2c; border-color: #d8af2c; }
.clip-actions button:disabled { opacity: 0.45; cursor: default; }

@media (max-width: 560px) {
  .clip-columns { grid-template-columns: 1fr; }
  .clip-actions { flex-wrap: wrap; }
  #clip-note { width: 100%; }
}
