/* =============================================================================
   UploadKI – Aussehen wie Ledger Flow („Limette“, Stand 16.11.2026)
   Ruhige Schale, links die dunkle Leiste, Inhalt in einem hellen Fenster mit
   runden Ecken, Limette als einzige Leuchtfarbe. Bewegung: drei feste Dauern,
   alles geht weich auf UND weich zu.
   ============================================================================= */

@font-face { font-family: "Bricolage"; src: url("/fonts/BricolageGrotesque.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/fonts/Figtree.ttf") format("truetype"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Subline"; src: url("/fonts/Montserrat-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --t-kurz: 120ms;
  --t-mittel: 200ms;
  --t-lang: 450ms;
  --aus: cubic-bezier(0.22, 1, 0.36, 1);
  --feder: cubic-bezier(0.34, 1.45, 0.64, 1);
  --gross: cubic-bezier(0.32, 0.72, 0, 1);
  --rand: 12px;
  --leiste-breite: 88px;
  --font: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --display: "Bricolage", "Figtree", ui-sans-serif, sans-serif;

  --schale: #dde2d7;
  --background: #f3f5ef;
  --surface: #ffffff;
  --surface-2: #ebeee6;
  --border: #dfe3d8;
  --border-strong: #c8cebf;
  --text: #14171a;
  --muted: #586059;
  --faint: #7f877e;
  --primary: #15181b;
  --primary-text: #f6f8f0;
  --ring: #6b8f12;
  --akzent: #c8f04f;
  --akzent-text: #171c08;
  --akzent-tief: #587810;
  --akzent-weich: #eef7d3;
  --success: #18794e;
  --success-soft: #dff3e8;
  --danger: #c62b23;
  --danger-soft: #fce6e3;
  --warning: #a35a00;
  --warning-soft: #fdefd6;
  --sim: #7b47b8;
  --sim-soft: #f0e8fa;
  --shadow-rgb: 22 28 16;
  --shadow-card: 0 1px 1px rgb(22 28 16 / 0.04), 0 10px 24px -14px rgb(22 28 16 / 0.12);
  --shadow-lift: 0 2px 4px -1px rgb(22 28 16 / 0.06), 0 24px 48px -22px rgb(22 28 16 / 0.26);
  --leiste: #121517;
  --leiste-text: #99a29a;
  --leiste-hell: #f3f6ec;
  --held: #121517;
  --held-text: #f3f6ec;
  --held-leise: #99a29a;
  --glas: rgb(243 245 239 / 0.8);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --schale: #090b0a;
  --background: #111413;
  --surface: #191d1b;
  --surface-2: #212624;
  --border: #2a302d;
  --border-strong: #3b433f;
  --text: #f1f4ec;
  --muted: #a3ab9f;
  --faint: #727b72;
  --primary: #c8f04f;
  --primary-text: #141a05;
  --ring: #c8f04f;
  --akzent-text: #141a05;
  --akzent-tief: #c8f04f;
  --akzent-weich: #1f270f;
  --success: #46d08b;
  --success-soft: #11291d;
  --danger: #ff6b5e;
  --danger-soft: #371613;
  --warning: #f4a938;
  --warning-soft: #33240a;
  --sim: #c095f0;
  --sim-soft: #271a38;
  --shadow-rgb: 0 0 0;
  --shadow-card: 0 1px 1px rgb(0 0 0 / 0.4), 0 10px 24px -14px rgb(0 0 0 / 0.6);
  --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.5), 0 24px 48px -20px rgb(0 0 0 / 0.8);
  --leiste: #171b19;
  --leiste-text: #8f988f;
  --leiste-hell: #f1f4ec;
  --held: #0c0f0e;
  --glas: rgb(17 20 19 / 0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scrollbar-color: var(--border-strong) transparent; scrollbar-gutter: stable; }
/* Platz für den Rollbalken immer freihalten: Sonst rutscht die ganze Seite zur Seite, sobald sie länger wird
   (z. B. beim Aufklappen eines Schritts), und alles muss neu umbrechen – das ruckelt. */
@supports not (scrollbar-gutter: stable) { html { overflow-y: scroll; } }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--background);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--akzent); color: var(--akzent-text); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--display); font-weight: 620; letter-spacing: -0.025em; margin: 0; }
h1 { font-size: 2.1rem; line-height: 1.12; padding-top: 2px; }
h2 { font-size: 1.05rem; line-height: 1.3; }
h3 { font-size: 0.95rem; line-height: 1.3; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* --- Schale, Fenster, Leiste ----------------------------------------------- */

.shell { min-height: 100dvh; padding: calc(var(--rand) + 22px) calc(var(--rand) + 26px) calc(var(--rand) + 40px) calc(var(--rand) * 2 + var(--leiste-breite) + 30px); }
.frame {
  position: fixed; z-index: 35; pointer-events: none; will-change: transform;
  inset: var(--rand) var(--rand) var(--rand) calc(var(--rand) * 2 + var(--leiste-breite));
  border-radius: 28px;
  box-shadow: 0 0 0 100vmax var(--schale), inset 0 0 0 1px color-mix(in oklab, var(--text) 7%, transparent);
}
.glow { position: fixed; inset: 0; pointer-events: none; z-index: 0; will-change: transform;
  background: radial-gradient(ellipse 64rem 24rem at 82% -7rem, color-mix(in oklab, var(--akzent) 22%, transparent), transparent 72%) no-repeat; }
:root[data-theme="dark"] .glow { background: radial-gradient(ellipse 64rem 24rem at 82% -7rem, color-mix(in oklab, var(--akzent) 8%, transparent), transparent 72%) no-repeat; }
#view { position: relative; z-index: 1; max-width: 1480px; margin: 0 auto; }

.side {
  position: fixed; z-index: 36; top: var(--rand); bottom: var(--rand); left: var(--rand); width: var(--leiste-breite);
  display: flex; flex-direction: column; align-items: center; padding: 14px 0 12px; border-radius: 26px;
  background: var(--leiste); color: var(--leiste-text);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.07), inset 0 0 0 1px rgb(255 255 255 / 0.04), 0 20px 40px -22px rgb(0 0 0 / 0.6);
}
.brand { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--akzent); color: var(--akzent-text); text-decoration: none; margin-bottom: 10px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.45); }
.nav { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; padding-top: 14px; }
.nav a { position: relative; z-index: 1; display: flex; width: 80px; flex-direction: column; align-items: center; gap: 5px; padding: 7px 0 6px;
  border-radius: 16px; font-size: 10.5px; font-weight: 600; line-height: 1.1; letter-spacing: 0.01em; color: var(--leiste-text); text-decoration: none;
  transition: color var(--t-mittel) ease-out; }
.nav .pic { position: relative; display: grid; width: 44px; height: 32px; place-items: center; border-radius: 12px;
  transition: background-color var(--t-mittel) ease-out, color var(--t-mittel) ease-out, scale var(--t-kurz) ease-out; }
.nav .pic svg { transition: scale var(--t-mittel) var(--feder); }
.nav a:hover { color: var(--leiste-hell); }
.nav a:hover .pic { background: rgb(255 255 255 / 0.08); }
.nav a:hover .pic svg { scale: 1.1; }
.nav a:active .pic { scale: 0.9; }
.nav a[aria-current="page"] { color: var(--leiste-hell); }
.nav a[aria-current="page"] .pic, .nav a[aria-current="page"]:hover .pic { background: transparent; color: var(--akzent-text); }
.nav:not([data-ready]) a[aria-current="page"] .pic { background: var(--akzent); }
.pill { position: absolute; top: 0; left: 0; width: 44px; height: 32px; border-radius: 12px; background: var(--akzent);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.45), 0 8px 20px -8px color-mix(in oklab, var(--akzent) 75%, transparent);
  opacity: 0; transition: transform 460ms var(--feder), opacity var(--t-mittel) ease-out; }
.nav[data-ready] .pill { opacity: 1; }
.nav .dot-badge { position: absolute; top: -3px; right: 2px; width: 9px; height: 9px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 2px var(--leiste); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.me-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: rgb(255 255 255 / 0.09); color: var(--leiste-hell); transition: background-color var(--t-mittel) ease-out, scale var(--t-kurz) ease-out; }
.me-btn:hover { background: rgb(255 255 255 / 0.16); }
.me-btn:active { scale: 0.94; }

/* --- Seitenkopf --------------------------------------------------------------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); }

/* --- Knöpfe ------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 17px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-weight: 600; font-size: 14px;
  text-decoration: none; white-space: nowrap; box-shadow: 0 1px 1px rgb(var(--shadow-rgb) / 0.04);
  transition: background-color var(--t-mittel) ease-out, color var(--t-mittel) ease-out, box-shadow var(--t-mittel) ease-out,
    translate var(--t-mittel) var(--aus), scale var(--t-kurz) ease-out, border-color var(--t-mittel) ease-out, opacity var(--t-mittel);
}
.btn:hover { translate: 0 -1px; box-shadow: 0 10px 18px -14px rgb(var(--shadow-rgb) / 0.6); }
.btn:active { scale: 0.96; translate: 0 0; }
.btn.primary { background: var(--primary); color: var(--primary-text); border-color: transparent;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.14), 0 1px 2px rgb(var(--shadow-rgb) / 0.2), 0 10px 18px -12px rgb(var(--shadow-rgb) / 0.7); }
.btn.akzent { background: var(--akzent); color: var(--akzent-text); border-color: transparent;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.45), 0 10px 22px -12px color-mix(in oklab, var(--akzent-tief) 70%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn.danger { color: var(--danger); }
.btn.sm { height: 32px; padding: 0 13px; font-size: 13px; }
.btn.lg { height: 52px; font-size: 15.5px; padding: 0 24px; }
.btn.block { width: 100%; }
.btn.icon { width: 36px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn[aria-busy="true"] { opacity: 0.75; pointer-events: none; }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkish { border: 0; background: none; padding: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; text-decoration: underline;
  text-decoration-color: var(--border-strong); text-underline-offset: 3px; transition: color var(--t-mittel), text-decoration-color var(--t-mittel); }
.linkish:hover { color: var(--text); text-decoration-color: currentColor; }

/* --- Karten -------------------------------------------------------------------- */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 20px; box-shadow: var(--shadow-card); }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.held { background:
    radial-gradient(26rem 16rem at 100% 0%, color-mix(in oklab, var(--akzent) 26%, transparent), transparent 70%),
    radial-gradient(circle at 1px 1px, rgb(255 255 255 / 0.055) 1px, transparent 0) 0 0 / 22px 22px, var(--held);
  color: var(--held-text); border-radius: 22px; padding: 20px 22px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08), 0 24px 48px -28px rgb(var(--shadow-rgb) / 0.7); }
.held .muted, .held .faint { color: var(--held-leise); }
.held .btn { background: rgb(255 255 255 / 0.1); color: var(--held-text); border-color: rgb(255 255 255 / 0.12); }
.held .btn.akzent { background: var(--akzent); color: var(--akzent-text); border-color: transparent; }

/* --- Felder -------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.input, .textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 13px; color: var(--text); outline: none;
  transition: border-color var(--t-mittel) ease-out, box-shadow var(--t-mittel) ease-out;
}
.input { height: 44px; }
.textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
.input:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .textarea:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--akzent) 45%, transparent); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.count { font-weight: 500; color: var(--faint); font-size: 12px; }
.count.over { color: var(--danger); }
.hint { font-size: 12.5px; color: var(--faint); }

.seg { position: relative; display: inline-flex; padding: 4px; gap: 2px; border-radius: 14px; background: color-mix(in oklab, var(--surface-2) 75%, transparent); box-shadow: inset 0 0 0 1px var(--border); }
.seg button { position: relative; z-index: 1; border: 0; background: transparent; padding: 7px 14px; border-radius: 10px; color: var(--muted); cursor: pointer;
  font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: color var(--t-mittel) ease-out, scale var(--t-kurz) ease-out; }
.seg button:hover { color: var(--text); }
.seg button:active { scale: 0.97; }
.seg button.on { color: var(--primary-text); }
.seg:not([data-ready]) button.on { background: var(--primary); }
.seg .seg-pill { position: absolute; z-index: 0; top: 0; left: 0; border-radius: 10px; background: var(--primary); box-shadow: 0 6px 14px -8px rgb(var(--shadow-rgb) / 0.7);
  transition: transform 380ms var(--aus), width 380ms var(--aus), height 380ms var(--aus); }
.seg.block { display: flex; }
.seg.block button { flex: 1; }
.seg .num { transition: background var(--t-mittel), color var(--t-mittel), opacity var(--t-mittel); display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin-left: 6px; border-radius: 99px; font-size: 11px; background: var(--surface-2); color: var(--muted); transition: background var(--t-mittel), color var(--t-mittel); }
.seg button.on .num { background: rgb(255 255 255 / 0.16); color: inherit; }
:root[data-theme="dark"] .seg button.on .num { background: rgb(0 0 0 / 0.14); }

.switch { position: relative; width: 42px; height: 25px; flex: none; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 25px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-strong); transition: background-color var(--t-mittel) ease-out; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--surface);
  box-shadow: 0 1px 3px rgb(var(--shadow-rgb) / 0.3); transition: transform 260ms var(--feder); }
.switch input:checked + i { background: var(--akzent); box-shadow: none; }
.switch input:checked + i::after { transform: translateX(17px); background: #fff; }
.switch input:focus-visible + i { outline: 2px solid var(--ring); outline-offset: 2px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; min-height: 36px; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap;
  background: var(--surface-2); color: var(--muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--warning-soft); color: var(--warning); }
.badge.err { background: var(--danger-soft); color: var(--danger); }
.badge.sim { background: var(--sim-soft); color: var(--sim); }
.badge.run { background: var(--akzent-weich); color: var(--akzent-tief); }
.badge.run::before { animation: pulse 1.4s ease-in-out infinite; }
.badge.plan { background: var(--surface-2); color: var(--text); }
.badge.plain::before { display: none; }
@keyframes pulse { 50% { opacity: 0.3; } }

.progress { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; position: relative; }
.progress > i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; background: var(--akzent-tief); transition: width 0.5s var(--aus); }
:root[data-theme="dark"] .progress > i { background: var(--akzent); }
.progress.sim > i { background: repeating-linear-gradient(135deg, var(--sim) 0 6px, color-mix(in oklab, var(--sim) 60%, transparent) 6px 12px); }
.progress.indet > i { width: 35% !important; animation: indet 1.4s var(--aus) infinite; }
@keyframes indet { from { left: -35%; } to { left: 100%; } }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 14px; font-size: 13.5px; background: var(--surface-2); }
.notice svg { flex: none; margin-top: 2px; }
.notice.warn { background: var(--warning-soft); }
.notice.warn svg { color: var(--warning); }
.notice.err { background: var(--danger-soft); }
.notice.err svg { color: var(--danger); }
.notice.sim { background: var(--sim-soft); }
.notice.sim svg { color: var(--sim); }
.notice.ok { background: var(--success-soft); }
.notice.ok svg { color: var(--success); }

.pf { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; flex: none; color: #fff; }
.pf.instagram { background: linear-gradient(135deg, #ffb13b, #ff2f73 50%, #a63bff); }
.pf.youtube { background: #ff2a1f; }
.pf.tiktok { background: #0b0b0b; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.16); }
.pf.sm { width: 22px; height: 22px; border-radius: 7px; }

.info-btn { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); background: transparent;
  color: var(--muted); cursor: pointer; font: 700 11px/1 var(--font); transition: background var(--t-mittel), color var(--t-mittel); vertical-align: middle; flex: none; }
.info-btn:hover, .info-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }

/* Weiches Auf- und Zuklappen: große Flächen 360 ms auf, 240 ms zu (wie Plausia). */
.collapse { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 240ms var(--gross), opacity 160ms ease-out; }
.collapse.open { grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows 360ms var(--gross), opacity 260ms ease-out 60ms; }
.collapse > div { overflow: hidden; min-height: 0; }

.empty { padding: 34px 12px; text-align: center; color: var(--faint); font-size: 14px; }
.flash { animation: flash 1.8s var(--aus); }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 2px var(--akzent-tief), 0 0 0 7px color-mix(in oklab, var(--akzent) 45%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Seitenwechsel: Teile kommen gestaffelt herein, leicht unscharf → scharf. */
@keyframes rein { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }
#view.enter > * { animation: rein var(--t-lang) var(--aus) backwards; }
#view.enter > *:nth-child(2) { animation-delay: 60ms; }
#view.enter > *:nth-child(3) { animation-delay: 120ms; }
#view.enter > *:nth-child(4) { animation-delay: 180ms; }
@keyframes fade { from { opacity: 0; } }
@keyframes auf { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

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

.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--schale); }
.login { width: 100%; max-width: 410px; animation: rein var(--t-lang) var(--aus) backwards; }
.login .card { padding: 30px; border-radius: 28px; box-shadow: var(--shadow-lift); }
.login .brand { margin: 0 0 22px; }
.login h1 { font-size: 1.9rem; margin-bottom: 6px; }
.login form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.form-error { color: var(--danger); font-size: 13.5px; min-height: 0; }

/* --- Übersicht: Liste und Einzelheiten ------------------------------------------- */

.top { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.held .k { font-size: 13px; color: var(--held-leise); font-weight: 600; }
.held .big { font-family: var(--display); font-size: 1.6rem; font-weight: 620; letter-spacing: -0.025em; line-height: 1.2; margin: 8px 0 4px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 18px 20px; box-shadow: var(--shadow-card); cursor: pointer;
  transition: translate var(--t-mittel) var(--aus), box-shadow var(--t-mittel) ease-out, border-color var(--t-mittel); text-align: left; font: inherit; color: inherit; }
.stat:hover { translate: 0 -3px; box-shadow: var(--shadow-lift); }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .v { font-family: var(--display); font-size: 2.2rem; font-weight: 620; letter-spacing: -0.03em; line-height: 1.1; margin-top: 6px; }
.stat.alert .v { color: var(--danger); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 0rem; gap: 0; align-items: start; transition: grid-template-columns 260ms var(--aus), gap 260ms var(--aus); }
.split.has-detail { grid-template-columns: minmax(0, 1fr) 27rem; gap: 16px; }
.list { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-card); overflow: hidden; }
.item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--border);
  transition: background-color var(--t-mittel) ease-out; position: relative; }
.item:last-child { border-bottom: 0; }
.item:hover { background: color-mix(in oklab, var(--surface-2) 55%, transparent); }
.item.sel { background: var(--akzent-weich); }
.item::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--akzent-tief);
  opacity: 0; transform: scaleY(0.4); transition: opacity var(--t-mittel) ease-out, transform 260ms var(--aus); }
.item.sel::before { opacity: 1; transform: none; }
.thumb { width: 40px; aspect-ratio: 9 / 16; border-radius: 10px; object-fit: cover; background: var(--surface-2); display: block; }
.item .t { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 12.5px; color: var(--faint); }
.item .pfs { display: flex; gap: 8px; align-items: center; }
.pfd { position: relative; display: inline-grid; }
.pfd::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--surface); background: var(--faint); }
.pfd.ok::after { background: var(--success); }
.pfd.err::after { background: var(--danger); }
.pfd.run::after { background: var(--akzent-tief); animation: pulse 1.4s ease-in-out infinite; }
.pfd.sim::after { background: var(--sim); }
.pfd.plan::after { background: var(--border-strong); }

.detail { position: sticky; top: calc(var(--rand) + 16px); min-width: 0; }
.detail-in { width: 27rem; transition: opacity 220ms ease-out, transform 260ms var(--aus); }
.split:not(.has-detail) .detail-in { opacity: 0; transform: translateX(24px); }
.detail-in { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lift); padding: 20px; max-height: calc(100dvh - 60px); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.detail-head { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-bottom: 16px; }
.detail-head .thumb { width: 58px; }
.plat { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.plat .row { flex-wrap: wrap; row-gap: 4px; }
.plat .err-text { grid-column: 2 / -1; color: var(--danger); font-size: 12.5px; margin-top: -4px; }
.plat .progress { grid-column: 2 / -1; }
.log { display: flex; flex-direction: column; }
.log-item { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; padding: 7px 0; font-size: 13px; }
.log-item .d { width: 7px; height: 7px; border-radius: 50%; margin-top: 7px; background: var(--faint); }
.log-item .d.success { background: var(--success); }
.log-item .d.error { background: var(--danger); }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); margin: 18px 0 6px; }

/* --- Neues Video: Bühne und Schritte ------------------------------------------- */

.compose { display: grid; grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr); gap: 22px; align-items: start; }
.stage { position: sticky; top: calc(var(--rand) + 18px); }
.phone-wrap { width: min(100%, calc((100dvh - 210px) * 9 / 16)); margin: 0 auto; transition: width var(--t-lang) var(--aus); }
.phone-wrap.landscape { width: 100%; }
.phone { position: relative; width: 100%; aspect-ratio: 9 / 16; border-radius: 30px; background: #070807; overflow: hidden; container-type: size;
  box-shadow: 0 0 0 1px var(--border), 0 0 0 7px var(--surface), 0 0 0 8px var(--border), var(--shadow-lift); transition: border-radius var(--t-lang) var(--aus); }
.phone.landscape { border-radius: 18px; }
.phone video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.phone .sub { position: absolute; left: 10%; right: 10%; bottom: 24%; text-align: center; pointer-events: none;
  font-family: "Subline", var(--display); font-weight: 800; font-size: 6.15cqmin; line-height: 1.22; color: #fff;
  -webkit-text-stroke: 1.3cqmin #000; paint-order: stroke fill; text-shadow: 0.3cqmin 0.3cqmin 0 rgb(0 0 0 / 0.5); transition: opacity var(--t-kurz); }
.phone .sub:empty { opacity: 0; }
.phone.landscape .sub { bottom: 10%; }
.phone .tag { position: absolute; top: 12px; left: 12px; right: 12px; pointer-events: none; }
.phone .tag .badge { background: rgb(12 14 13 / 0.72); color: #f1f4ec; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.phone .tag .badge.ok::before { background: #46d08b; }
.phone .tag .badge.warn::before { background: #f4a938; }
.drop { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center;
  border-radius: inherit; background: var(--surface); cursor: pointer; transition: background-color var(--t-mittel); }
.drop::before { content: ""; position: absolute; inset: 10px; border-radius: 22px; border: 2px dashed var(--border-strong); transition: border-color var(--t-mittel), inset var(--t-mittel) var(--aus); }
.drop:hover::before, .drop.over::before { border-color: var(--akzent-tief); inset: 6px; }
.drop.over { background: var(--akzent-weich); }
.drop .big { width: 58px; height: 58px; border-radius: 18px; background: var(--akzent); color: var(--akzent-text); display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.45), 0 12px 24px -12px color-mix(in oklab, var(--akzent-tief) 70%, transparent); transition: transform var(--t-mittel) var(--feder); }
.drop:hover .big { transform: translateY(-3px); }
.facts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.chip-fact { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stage-note { margin-top: 12px; }

.steps { display: flex; flex-direction: column; gap: 10px; }
.step { position: relative; will-change: transform; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-card);
  transition: border-color var(--t-mittel) ease-out, opacity var(--t-mittel); }
.step::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: var(--shadow-lift); opacity: 0; pointer-events: none; transition: opacity 260ms ease-out; }
.step.open { border-color: var(--border-strong); }
.step.open::after { opacity: 1; }
.sbody { height: 0; overflow: hidden; }
.step.open > .sbody { height: auto; }
.step-body { contain: layout paint style; }
.steps.moving .sendbar { box-shadow: var(--shadow-card); }
.step.locked { opacity: 0.55; }
.step-head { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 16px 18px; border: 0; background: transparent;
  cursor: pointer; text-align: left; border-radius: 22px; }
.step.locked .step-head { cursor: default; }
.step-num { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font: 700 13px var(--font); background: var(--surface-2); color: var(--muted);
  transition: background-color var(--t-mittel), color var(--t-mittel); }
.step.open .step-num { background: var(--primary); color: var(--primary-text); }
.step.done .step-num { background: var(--success-soft); color: var(--success); }
.step-title { font-family: var(--display); font-weight: 620; font-size: 1.08rem; letter-spacing: -0.02em; }
.step-sum { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 22px;
  transition: opacity var(--t-mittel) ease-out, max-height 300ms var(--gross); }
.step.open .step-sum { opacity: 0; max-height: 0; }
.step-chev { color: var(--faint); transition: transform 300ms var(--aus); }
.step.open .step-chev { transform: rotate(180deg); }
.step-body { padding: 0 18px 18px 60px; }
.step-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.cues { display: flex; flex-direction: column; gap: 2px; max-height: 360px; overflow-y: auto; margin: 0 -6px; padding: 2px 6px; scrollbar-width: thin; }
.cue { display: grid; grid-template-columns: 56px minmax(0, 1fr) 30px; gap: 6px; align-items: center; padding: 3px; border-radius: 12px; transition: background-color var(--t-mittel); }
.cue:hover { background: color-mix(in oklab, var(--surface-2) 60%, transparent); }
.cue.now { background: var(--akzent-weich); }
.cue .tc { border: 0; background: transparent; color: var(--faint); font-size: 12.5px; cursor: pointer; padding: 6px 4px; border-radius: 8px; text-align: left; transition: color var(--t-mittel); }
.cue .tc:hover, .cue.now .tc { color: var(--akzent-tief); }
.cue input { width: 100%; border: 1px solid transparent; background: transparent; padding: 7px 10px; border-radius: 10px; outline: none; font-weight: 550;
  transition: border-color var(--t-mittel), background-color var(--t-mittel), box-shadow var(--t-mittel); }
.cue input:hover { border-color: var(--border); }
.cue input:focus { border-color: var(--ring); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in oklab, var(--akzent) 40%, transparent); }
.cue .x { opacity: 0; transition: opacity var(--t-mittel); }
.cue:hover .x, .cue:focus-within .x { opacity: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; min-height: 44px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: text;
  transition: border-color var(--t-mittel), box-shadow var(--t-mittel); }
.chips:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklab, var(--akzent) 45%, transparent); }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 6px 0 11px; border-radius: 99px; background: var(--surface-2); font-size: 13px; font-weight: 600; animation: auf var(--t-mittel) var(--aus); }
.chip button { border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 3px; display: grid; place-items: center; border-radius: 50%; transition: background var(--t-kurz), color var(--t-kurz); }
.chip button:hover { color: var(--text); background: var(--surface); }
.chips input { flex: 1; min-width: 120px; border: 0; background: transparent; outline: none; padding: 0 6px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.preset { border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 5px 11px; font-size: 12.5px; color: var(--muted); cursor: pointer;
  transition: border-color var(--t-mittel), color var(--t-mittel), background-color var(--t-mittel), scale var(--t-kurz); }
.preset:hover { border-color: var(--border-strong); color: var(--text); }
.preset:active { scale: 0.96; }
.preset.on { border-color: transparent; background: var(--akzent); color: var(--akzent-text); }

.channel { border: 1px solid var(--border); border-radius: 16px; transition: border-color var(--t-mittel), background-color var(--t-mittel), opacity var(--t-mittel); }
.channel + .channel { margin-top: 8px; }
.channel.on { border-color: color-mix(in oklab, var(--akzent-tief) 45%, var(--border)); background: color-mix(in oklab, var(--akzent-weich) 55%, transparent); }
.channel.locked { opacity: 0.6; }
.channel-head { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 13px; }
.channel-head b { display: block; font-size: 14px; }
.channel-head .sub2 { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.disclose { border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; padding: 0 13px 11px 55px; transition: color var(--t-mittel); }
.disclose:hover { color: var(--text); }
.disclose svg { transition: transform 300ms var(--aus); }
.disclose[aria-expanded="true"] svg { transform: rotate(180deg); }
.channel-more { border-top: 1px dashed var(--border-strong); padding: 13px; display: flex; flex-direction: column; gap: 12px; }
.preview-box { background: var(--surface-2); border-radius: 12px; padding: 11px 13px; font-size: 13px; white-space: pre-wrap; word-break: break-word; max-height: 200px; overflow: auto; color: var(--muted); }
.preview-box b { color: var(--text); }
.dt-btn { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 6px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; text-align: left; transition: border-color var(--t-mittel), box-shadow var(--t-mittel); }
.dt-btn:hover { border-color: var(--border-strong); box-shadow: 0 10px 18px -14px rgb(var(--shadow-rgb) / 0.5); }
.sendbar { position: sticky; bottom: calc(var(--rand) + 10px); z-index: 5; margin-top: 4px; padding: 14px; border-radius: 22px; background: var(--surface);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-lift); }
.sendbar .todo { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 10px; min-height: 20px; }
.sendbar .todo svg { color: var(--warning); flex: none; }
.sendbar .todo.ready svg { color: var(--success); }
.sendbar .todo.shake { animation: shake 0.42s var(--aus); }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.check svg { flex: none; margin-top: 2px; }
.check.ok svg { color: var(--success); }
.check.warn svg { color: var(--warning); }
.check.error svg { color: var(--danger); }

/* --- Verbindungen / Nutzer -------------------------------------------------------- */

.conn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.conn-card { display: flex; flex-direction: column; gap: 14px; }
.conn-card .head { display: flex; align-items: center; gap: 12px; }
.conn-card .pf { width: 44px; height: 44px; border-radius: 13px; }
.acc { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.acc img, .avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar { display: grid; place-items: center; background: var(--surface); font-weight: 700; font-size: 12px; }
.hint-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.hint-list li + li { margin-top: 4px; }
.copyline { display: flex; gap: 6px; align-items: center; background: var(--surface-2); border-radius: 12px; padding: 6px 6px 6px 12px; font-size: 12.5px; word-break: break-all; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--faint); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: 0; }

/* --- Fenster, Hinweise, Menüs, Kalender ------------------------------------------- */

.overlay { position: fixed; inset: 0; z-index: 60; background: rgb(8 10 9 / 0.45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade 150ms ease-out; }
.overlay.out { animation: fade 150ms ease-out reverse forwards; }
.modal { width: 100%; max-width: 480px; max-height: calc(100dvh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 26px;
  box-shadow: var(--shadow-lift); padding: 24px; animation: auf 280ms var(--aus); }
.modal.wide { max-width: 640px; }
.overlay.out .modal { animation: auf 160ms ease-in reverse forwards; }
.modal h2 { font-size: 1.35rem; margin-bottom: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

.toasts { position: fixed; z-index: 70; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 380px; padding: 11px 16px; border-radius: 99px; background: var(--primary); color: var(--primary-text);
  box-shadow: var(--shadow-lift); font-size: 14px; font-weight: 550; animation: toastIn 200ms var(--aus); }
.toast.out { animation: toastIn 160ms ease-in reverse forwards; }
.toast.ok svg { color: var(--akzent); }
:root[data-theme="dark"] .toast.ok svg { color: var(--akzent-text); }
.toast.err { background: var(--danger); color: #fff; border-radius: 16px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px) scale(0.98); } }

.pop { position: fixed; z-index: 65; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lift); padding: 14px; width: 320px;
  animation: popIn 150ms var(--aus); transform-origin: var(--origin, top left); }
.pop.out { animation: popIn 130ms ease-in reverse forwards; }
@keyframes popIn { from { opacity: 0; transform: scale(0.96); } }
.menu { width: 230px; padding: 6px; }
.menu .who { padding: 10px 12px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 10px 12px; border-radius: 12px; cursor: pointer; text-align: left; font-size: 14px;
  transition: background-color var(--t-kurz); }
.menu button:hover { background: var(--surface-2); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head b { font-family: var(--display); font-weight: 620; font-size: 15px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal .dow { font-size: 11px; color: var(--faint); font-weight: 650; padding: 4px 0; }
.cal button { height: 38px; border: 0; background: transparent; border-radius: 11px; cursor: pointer; font-size: 13.5px; transition: background-color var(--t-kurz), scale var(--t-kurz); }
.cal button:hover:not(:disabled) { background: var(--surface-2); }
.cal button:active:not(:disabled) { scale: 0.94; }
.cal button.today { box-shadow: inset 0 0 0 1px var(--border-strong); }
.cal button.sel { background: var(--primary); color: var(--primary-text); font-weight: 700; }
.cal button:disabled { opacity: 0.35; cursor: default; }
.cal button.other { color: var(--faint); }
.time-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.stepper { display: flex; align-items: center; background: var(--surface-2); border-radius: 12px; }
.stepper button { width: 32px; height: 38px; border: 0; background: transparent; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.stepper button:hover { color: var(--text); }
.stepper input { width: 34px; border: 0; background: transparent; text-align: center; font-weight: 700; font-size: 16px; outline: none; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Blatt von unten (Handy) */
.sheet-scrim { position: fixed; inset: 0; z-index: 55; background: rgb(8 10 9 / 0.4); animation: fade 150ms ease-out; }
.sheet-scrim.out { animation: fade 150ms ease-out reverse forwards; }

/* --- Handy ------------------------------------------------------------------------- */

.on-touch { display: none; }
@media (hover: none) { .on-touch { display: inline; } .on-mouse { display: none; } }

@media (max-width: 1180px) {
  .top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
  .top .held { grid-column: 1 / -1; }
  .split.has-detail { grid-template-columns: minmax(0, 1fr) 24rem; }
  .detail-in { width: 24rem; }
  .conn-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .compose { grid-template-columns: minmax(0, 1fr); }
  .stage { position: static; }
  .phone-wrap { width: min(100%, 300px); }
  .phone-wrap.landscape { width: 100%; }
  .phone:has(.drop) { aspect-ratio: auto; height: 230px; }
  .phone-wrap:has(.drop) { width: 100%; }
  .split, .split.has-detail { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .detail { position: fixed; z-index: 56; left: 0; right: 0; bottom: 0; top: auto; max-height: 88dvh; transform: translateY(105%); transition: transform 360ms var(--gross); }
  .detail.open { transform: none; }
  .detail-in { width: auto; border-radius: 26px 26px 0 0; max-height: 88dvh; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .split:not(.has-detail) .detail-in { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  .shell { padding: 18px 16px calc(110px + env(safe-area-inset-bottom)); }
  .frame { display: none; }
  .side { top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: auto; height: auto; flex-direction: row; padding: 6px; border-radius: 24px; }
  .brand { display: none; }
  .nav { flex-direction: row; padding: 0; gap: 0; }
  .nav a { width: 68px; }
  .side-foot { margin: 0 0 0 4px; }
  .me-btn { width: 40px; height: 40px; }
  h1 { font-size: 1.7rem; }
  .step-body { padding: 0 16px 16px; }
  .top { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 12px 14px; }
  .stat .v { font-size: 1.7rem; }
  .stat .tiny { display: none; }
  .toasts { left: 16px; right: 16px; bottom: calc(90px + env(safe-area-inset-bottom)); align-items: center; }
  .pop { left: 16px !important; right: 16px; width: auto; }
  .sendbar { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .table th:nth-child(4), .table td:nth-child(4) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
