/* AKHI APP – Web-Oberfläche. Mobil zuerst (iPhone), ab 900 px Desktop-Layout mit Seitenleiste. */

@font-face { font-family: "Anton"; src: url("/fonts/Anton-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #0E0F12; --surface: #16181D; --surface-2: #1E2128; --surface-3: #262a33; --border: #2A2E37;
  --text: #E8EAED; --muted: #8A909C; --accent: #C6FF00; --accent-dim: #9BC800; --on-accent: #0E0F12;
  --danger: #FF4D5E; --ok: #3DDC97; --warn: #FFC93D;
  --radius: 12px; --tabbar-h: 62px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; overscroll-behavior-y: none; }
[v-cloak] { display: none; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0 0 10px; font-weight: 700; }
h2 { font-size: 20px; } h3 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--muted); } .small { font-size: 13px; } .danger { color: var(--danger); } .ok { color: var(--ok); }
.warn { color: var(--warn); } .accent { color: var(--accent); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.spacer { flex: 1; } .center { text-align: center; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack > * + * { margin-top: 12px; }

/* ---------- Logo / Kopf */
.logo { font-family: "Anton", Impact, sans-serif; font-size: 26px; letter-spacing: 1px; line-height: 1; }
.logo b { color: var(--accent); font-weight: normal; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-top)) 16px 10px; background: rgba(14,15,18,.92); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar .title { font-weight: 700; font-size: 17px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.chip.on { color: var(--ok); } .chip.busy { color: var(--accent); }

/* ---------- Layout */
.app { min-height: 100vh; }
.main { padding: 14px 14px calc(var(--tabbar-h) + var(--safe-bottom) + 20px); max-width: 1200px; margin: 0 auto; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom); background: rgba(22,24,29,.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 11px; position: relative; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--accent); }
.badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; display: grid; place-items: center; }

/* Mobil: Abschnitte der Erstellen-Seite in sinnvoller Reihenfolge (Vorschau direkt nach den Hooks) */
@media (max-width: 899px) {
  .desk-cols { display: flex; flex-direction: column; gap: 12px; }
  .desk-cols > .stack, .desk-cols > .desk-sticky { display: contents; }
  .desk-cols > .stack > * { margin-top: 0 !important; }
  .o-videos { order: 1; } .o-options { order: 2; } .o-versions { order: 3; } .o-preview { order: 4; }
  .o-render { order: 5; } .o-jobs { order: 6; }
}

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 220px 1fr; }
  .tabbar { position: sticky; top: 0; height: 100vh; flex-direction: column; justify-content: flex-start; padding: 18px 0;
    border-top: 0; border-right: 1px solid var(--border); gap: 2px; }
  .tabbar .side-logo { display: block !important; padding: 0 20px 22px; }
  .tabbar a { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 20px; font-size: 15px;
    border-left: 3px solid transparent; }
  .tabbar a.active { background: var(--surface-2); border-left-color: var(--accent); color: var(--text); }
  .tabbar a svg { width: 20px; height: 20px; }
  .badge { position: static; margin-left: auto; }
  .topbar .logo { display: none; }
  .main { padding: 20px 28px 40px; }
  .desk-cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
  .desk-sticky { position: sticky; top: 76px; }
}

/* ---------- Karten / Formulare */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.card + .card { margin-top: 12px; }
.card-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 700; }
.card-title .num { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; font-size: 12px; font-weight: 800; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; /* iOS zoomt sonst */ color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); padding: 0; flex: none; }
input[type=color] { padding: 2px; width: 46px; height: 44px; }
input[type=range] { padding: 0; accent-color: var(--accent); background: none; border: 0; height: 32px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; color: var(--muted); padding: 9px 6px; border-radius: 8px; font: inherit;
  font-size: 13px; font-weight: 600; min-height: 38px; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 16px;
  border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit;
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 800; }
.btn.danger { color: var(--danger); }
.btn.ghost { background: none; border-color: transparent; }
.btn.small { min-height: 34px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.iconbtn { width: 40px; height: 40px; padding: 0; min-height: 0; }

/* ---------- Clips (Erstellen) */
.clips { display: grid; gap: 10px; }
.clip { display: grid; grid-template-columns: 74px 1fr auto; gap: 10px; align-items: center; padding: 8px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; }
.clip.sel { border-color: var(--accent); }
.clip img, .thumbbox { width: 74px; height: 74px; object-fit: contain; background: #000; border-radius: 8px; display: block; }
.clip .name { font-weight: 600; font-size: 14px; }
.clip .meta { font-size: 12px; color: var(--muted); }
.addrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.addrow .btn { flex-direction: column; gap: 3px; min-height: 64px; font-size: 12px; padding: 6px; }
.addrow .btn svg { width: 22px; height: 22px; }

.upload { padding: 9px 10px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border); margin-top: 8px; }
.bar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }

/* ---------- Hook-Liste */
.versions .v { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start; padding: 10px 0;
  border-top: 1px solid var(--border); }
.versions .v:first-child { border-top: 0; }
.versions .v .tag { font-size: 11px; color: var(--muted); padding-top: 2px; min-width: 44px; }
.versions .v .txt { font-size: 15px; }
.versions .v .cat { font-size: 11px; color: var(--muted); }
.versions .v.cur .txt { color: var(--accent); }
.vgroup + .vgroup { margin-top: 14px; }
.vgroup-title { font-size: 13px; font-weight: 700; color: var(--muted); }

/* ---------- Vorschau */
.preview { position: relative; width: 100%; max-width: 360px; margin: 0 auto; aspect-ratio: 9 / 16; background: #000;
  border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.preview img, .preview video { width: 100%; height: 100%; object-fit: contain; display: block; }
.preview .overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45);
  color: var(--accent); font-weight: 700; text-align: center; padding: 20px; }
.preview .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; }

/* ---------- Raster (Videos, Verlauf) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
@media (max-width: 420px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 6px; } .grid.reels { grid-template-columns: repeat(2, 1fr); } }
.tile { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  cursor: pointer; user-select: none; -webkit-user-select: none; }
.tile .img { aspect-ratio: 1; background: #000; }
.grid.reels .tile .img { aspect-ratio: 9 / 16; }
.tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tile .cap { padding: 6px 7px; font-size: 11px; line-height: 1.3; }
.tile .cap b { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.tile .tick { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff;
  background: rgba(0,0,0,.35); display: grid; place-items: center; }
.tile.sel .tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tile .missing { position: absolute; top: 6px; left: 6px; font-size: 10px; background: var(--danger); color: #fff; padding: 1px 6px; border-radius: 6px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar input { width: auto; flex: 1 1 100%; }
.toolbar select { width: auto; flex: 1 1 120px; min-width: 0; }
@media (min-width: 900px) { .toolbar input { flex-basis: 240px; } }
.btnrow { display: flex; gap: 8px; margin-bottom: 12px; }
.btnrow .btn { flex: 1; min-height: 40px; padding: 0 8px; font-size: 13px; }
@media (min-width: 900px) { .btnrow .btn { flex: 0 0 auto; padding: 0 14px; } }
.actionbar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-bottom)); z-index: 25;
  display: flex; gap: 8px; padding: 10px 14px; background: rgba(22,24,29,.97); border-top: 1px solid var(--border);
  overflow-x: auto; }
@media (min-width: 900px) { .actionbar { left: 220px; bottom: 0; } }

/* ---------- Listen (Hooks, Jobs) */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.item { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--border); cursor: pointer; }
.item:first-child { border-top: 0; }
.item.off { opacity: .45; }
.item .id { font-size: 12px; color: var(--muted); min-width: 32px; }
.star { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--border); cursor: pointer; padding: 4px 2px; min-width: 32px; }
.star.on { color: var(--accent); }
.pill.danger { color: var(--danger); } .pill.warn { color: var(--warn); }
.paybanner { display: block; margin: 0; padding: 10px 16px; background: rgba(255, 201, 61, .14); color: var(--warn);
  border-bottom: 1px solid var(--border); text-decoration: none; font-size: 13px; }
.paybanner.locked { background: rgba(255, 77, 94, .14); color: var(--danger); }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }

/* ---------- Bottom-Sheet / Dialog */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 640px; max-height: calc(100vh - var(--safe-top) - 30px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px 18px 0 0;
  padding: 8px 16px calc(18px + var(--safe-bottom)); animation: up .2s ease-out; }
.sheet.wide { max-width: 900px; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 4px auto 12px; }
.sheet-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; flex: 1; font-size: 18px; }
@media (min-width: 900px) { .sheet-bg { align-items: center; } .sheet { border-radius: 18px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

/* ---------- Toast */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
  z-index: 60; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--surface-3); border: 1px solid var(--border); border-left: 4px solid var(--accent); padding: 11px 14px;
  border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.5); font-size: 14px; animation: up .2s ease-out; }
.toast.err { border-left-color: var(--danger); }

/* ---------- Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .box { width: min(360px, 100%); text-align: center; }
.login .logo { font-size: 46px; margin-bottom: 6px; }
.login form { margin-top: 26px; display: grid; gap: 12px; }

/* ---------- Jobs */
.job { padding: 10px 0; border-top: 1px solid var(--border); }
.job:first-child { border-top: 0; }
.result { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.result:first-child { border-top: 0; }
.result img { width: 64px; aspect-ratio: 9/16; object-fit: cover; border-radius: 6px; background: #000; }
.spin { width: 16px; height: 16px; border: 2px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Profil "Mein Sound": Musikrichtungen als Auswahl-Knöpfe */
.genres { display: flex; flex-wrap: wrap; gap: 8px; }
.genres button { border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); padding: 9px 14px;
  border-radius: 99px; font: inherit; font-size: 14px; cursor: pointer; }
.genres button.on { color: var(--text); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--accent); }
.onboarding { min-height: 100dvh; display: flex; justify-content: center; padding: 24px 16px; }
.onboarding > .stack { width: 100%; max-width: 560px; }

/* QoL-Paket: Favorit/gepostet-Markierungen, Statistik, Caption, Instagram-Ansicht, Speicher, Einführung */
.tile .favmark { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; color: var(--accent); filter: drop-shadow(0 0 2px #000); }
.tile .favmark svg { width: 22px; height: 22px; fill: var(--accent); }
.tile .postedmark { position: absolute; bottom: 44px; left: 6px; font-size: 10px; background: rgba(0,0,0,.7); color: var(--ok);
  padding: 1px 6px; border-radius: 6px; }
.tile .statmark { position: absolute; top: 6px; left: 6px; font-size: 11px; background: rgba(0,0,0,.72); color: #fff;
  padding: 2px 7px; border-radius: 8px; display: flex; gap: 4px; align-items: center; }
.tile .statmark svg { width: 13px; height: 13px; }
.tile .statmark.win { color: var(--accent); }
.starbtn svg { fill: none; }
.starbtn.on { color: var(--accent); }
.starbtn.on svg { fill: var(--accent); }
.caption-box { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; line-height: 1.45; margin: 6px 0 8px; }
.caption-box textarea { min-height: 120px; }
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.statgrid label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.statgrid input { padding: 8px; text-align: center; }
@media (max-width: 420px) { .statgrid { grid-template-columns: repeat(2, 1fr); } }
.preview { position: relative; }
.igov { position: absolute; inset: 0; pointer-events: none; font-size: 9px; color: #fff; }
.igov > div { position: absolute; background: rgba(255, 60, 60, .28); outline: 1px dashed rgba(255,255,255,.6); }
.igov span { position: absolute; left: 4px; top: 2px; text-shadow: 0 0 3px #000; }
.storebanner { display: block; margin: 0 16px 10px; padding: 10px 14px; border-radius: 10px; font-size: 13px;
  background: rgba(255, 193, 7, .14); border: 1px solid rgba(255, 193, 7, .45); color: var(--text); text-decoration: none; }
.storebanner.crit { background: rgba(255, 70, 70, .14); border-color: rgba(255, 70, 70, .5); }
.intro { text-align: center; }
.intro .big { font-size: 46px; line-height: 1; margin: 6px 0 10px; }
.intro .dots { display: flex; gap: 6px; justify-content: center; margin: 14px 0; }
.intro .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); }
.intro .dots i.on { background: var(--accent); }
.covergrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.covergrid .tile .img { aspect-ratio: 9 / 16; }
.covergrid .tile img { object-fit: cover; }
