:root {
  --bg: #f6f4ef; --card: #ffffff; --ink: #1f2a2e; --muted: #6b7478; --line: #e3dfd6;
  --brand: #a8781c; --brand-ink: #ffffff; --brand-2: #d4af37; --gold-soft: #fbf3dc; --gold-line: #ecd9a0; --accent: #e8590c; --error: #b42318; --ok: #15803d;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", "Noto Sans", sans-serif; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: linear-gradient(90deg, #8a5f12, var(--brand) 40%, var(--brand-2)); color: var(--brand-ink); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.top a { color: var(--brand-ink); text-decoration: none; }
.brand { font-size: 1.05rem; }
#nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#nav a, #nav button { color: var(--brand-ink); background: transparent; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 4px 10px; font: inherit; cursor: pointer; text-decoration: none; }
#nav select { font: inherit; border-radius: 8px; padding: 3px 6px; width: auto; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.auth { max-width: 420px; margin: 10vh auto; padding: 0 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--error); }
.warn-text { color: #b45309; }
label.vol-row { flex-direction: row; align-items: center; gap: 10px; }
.vol { flex: 1 1 auto; max-width: 360px; accent-color: var(--brand); }
.vol-out { min-width: 48px; }
.ok { color: var(--ok); }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
input[type=text], input[type=url], input[type=password], select, textarea {
  font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink); width: 100%;
}
textarea { min-height: 64px; resize: vertical; }
.btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 9px; padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.warn { color: var(--error); }
.btn.small { padding: 4px 9px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: default; }
.steps { counter-reset: step; }
.step > h2::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .9rem; }
.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.job { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); }
.job .pic { aspect-ratio: 4/3; background: #e8e4da center/cover no-repeat; display: grid; place-items: center; font-size: 2rem; }
.job .pic img { width: 100%; height: 100%; object-fit: cover; }
.job .meta { padding: 10px 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.img { border: 2px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.img.sel { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(168,120,28,.22); }
.img .pic { position: relative; aspect-ratio: 4/3; background: #eee; }
.img .pic img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.img .badge { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.65); color: #fff; border-radius: 6px; padding: 1px 6px; font-size: .78rem; }
.img .badge.enh { left: auto; right: 6px; background: var(--accent); color: #1f2a2e; }
.img .body { padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; font-size: .85rem; }
.img .tools { display: flex; gap: 4px; flex-wrap: wrap; }
.img .pic img { touch-action: pan-y; user-select: none; -webkit-user-drag: none; }
.img .badge.score { top: auto; bottom: 6px; }
.img .badge.pos { background: var(--brand); }
.img .label { font-weight: 600; line-height: 1.3; }
.type-sel { padding: 4px 6px; font-size: .85rem; }
.type-sel.set { border-color: var(--accent); background: #fffbeb; }
/* Timeline bleibt beim Scrollen durch den Bildvorrat oben stehen (unter der Kopfzeile) */
.tl-box { position: sticky; top: var(--top-h, 52px); z-index: 4; background: var(--card); padding: 8px 0; margin: -8px 0; }
.timeline { display: flex; gap: 10px; overflow-x: auto; padding: 10px; min-height: 172px; align-items: flex-start;
  border: 2px dashed var(--line); border-radius: 12px; background: #fbfaf6; scroll-behavior: smooth; }
.timeline.drop-over { border-color: var(--accent); background: #fffbeb; }
.timeline.drop-end { box-shadow: inset -5px 0 0 var(--accent); }
.tl-item { position: relative; flex: 0 0 104px; display: flex; flex-direction: column; gap: 4px; }
.tl-item img { width: 104px; height: 138px; object-fit: cover; border-radius: 9px; border: 2px solid var(--brand);
  cursor: grab; touch-action: none; user-select: none; -webkit-user-drag: none; background: #ddd; }
.tl-item img:active { cursor: grabbing; }
.tl-item.unused img { border-color: var(--line); opacity: .4; }
.tl-item.drop-before::before { content: ""; position: absolute; left: -8px; top: 0; height: 138px; width: 5px; border-radius: 3px; background: var(--accent); }
.tl-num { position: absolute; top: 5px; left: 5px; background: var(--brand); color: #fff; border-radius: 6px; padding: 0 6px; font-size: .8rem; font-weight: 700; }
.tl-item.unused .tl-num { background: #9ca3af; }
.tl-type { position: absolute; top: 4px; right: 6px; font-size: .9rem; }
.tl-note { font-size: .72rem; color: var(--muted); text-align: center; }
.tl-x { position: absolute; top: 112px; right: 4px; border: 0; border-radius: 50%; width: 22px; height: 22px; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: .75rem; }
.tl-tr { flex: 0 0 auto; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: -24px; }
.tr-icon { font-size: 1.1rem; color: var(--brand); }
.tr-sel { width: 96px; padding: 3px 4px; font-size: .75rem; border-radius: 7px; }
.tl-tr.set .tr-sel { border-color: var(--accent); background: #fffbeb; }
.tl-end { flex: 0 0 80px; height: 138px; border-radius: 9px; border: 2px dashed var(--brand); display: grid; place-content: center; text-align: center; gap: 4px; font-size: 1.4rem; color: var(--brand); }
.tl-end span { font-size: .75rem; }
.tl-empty { margin: auto; }
.dragging { opacity: .35; }
.drag-ghost { position: fixed; width: 80px; height: 80px; object-fit: cover; border-radius: 10px; opacity: .9; pointer-events: none; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.outs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.out { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.out img, .out video { width: 100%; border-radius: 6px; background: #111; max-height: 380px; object-fit: contain; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips label.check { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; background: #fff; }
.progress { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--gold-soft); border: 1px solid var(--gold-line); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--gold-line); border-top-color: var(--brand); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ov-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.ov-row { position: relative; display: flex; gap: 8px; align-items: stretch; }
.ov-row img, .ov-none { flex: 0 0 52px; width: 52px; height: 70px; object-fit: cover; border-radius: 7px; background: #ddd; display: grid; place-items: center; }
.ov-row .tl-num { top: 3px; left: 3px; font-size: .7rem; }
.ov-row textarea { min-height: 70px; }
.ov-row.ov-extra { opacity: .55; }
.lang-block { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 12px; }
.facts { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 10px 12px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #1f2a2e; color: #fff; padding: 10px 16px; border-radius: 10px; max-width: 90vw; z-index: 20; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .cols2 { grid-template-columns: 1fr; } .grid { grid-template-columns: repeat(2, 1fr); }
  .tl-box { position: static; } }   /* am Handy wäre die klebende Timeline zu groß – dort Bilder antippen */
/* Kostenleiste unter dem Titel (gut sichtbar) */
.costbar { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 8px 14px; margin: 0 0 12px;
  background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 10px; font-size: .9rem; }
.costbar b { color: #7a5410; }
.btn.primary { background: linear-gradient(180deg, var(--brand-2), var(--brand)); border-color: var(--brand); }
/* Text-Design-Auswahl mit Vorschau */
.tdp-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.tdp { position: relative; height: 128px; border-radius: 10px; border: 2px solid var(--line); background: #333 center/cover;
  cursor: pointer; padding: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; font: inherit; }
.tdp::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 20%, rgba(0,0,0,.55)); }
.tdp.on { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(212,175,55,.45); }
.tdp-in { position: relative; flex: 1; display: grid; place-items: center; font-size: 19px; }
.tdp-name { position: relative; background: rgba(0,0,0,.6); color: #fff; font-size: .75rem; padding: 3px 6px; text-align: center; }
.ov-col { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ov-col .type-sel { align-self: flex-start; }
.tdp.special { border-color: var(--brand-2); }
.tdp-badge { position: absolute; top: 5px; left: 5px; z-index: 2; background: var(--brand); color: #fff; font-size: .68rem;
  font-weight: 800; padding: 1px 6px; border-radius: 5px; letter-spacing: .04em; }
.tdp-mix { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tdp-name { font-weight: 600; }
