/* BannerApp – Oberfläche */
:root {
  --brand: #ff5a36;
  --brand-dark: #e2421f;
  --ink: #1d2433;
  --ink-2: #4a5468;
  --muted: #7a8396;
  --line: #e3e6ee;
  --bg: #f5f6fa;
  --panel: #ffffff;
  --ok: #1f9d6b;
  --warn: #c77700;
  --err: #d0342c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 28, 45, .06), 0 4px 16px rgba(20, 28, 45, .06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; font-size: 15px; line-height: 1.45; }
a { color: var(--brand-dark); }
h1 { font-size: 1.6rem; margin: 0 0 .6rem; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

/* Kopfzeile */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1.4rem; background: var(--ink); color: #fff; }
.brand { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--brand); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 7px 5px; background: #fff; border-radius: 2px; }
.nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.nav a, .linklike { color: #dfe3ec; text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.nav a:hover, .linklike:hover { color: #fff; }
form.inline { display: inline; margin: 0; }

main.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.6rem 1.4rem 2.4rem; flex: 1; }
main.narrow { max-width: 460px; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; }
.editor-page .footer { display: none; }

/* Karten & Formulare */
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.2rem; }
.form { display: flex; flex-direction: column; gap: .85rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea {
  font: inherit; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; padding: .5rem .6rem; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(255, 90, 54, .35); border-color: var(--brand); }
input.invalid { border-color: var(--err); }
textarea { resize: vertical; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.danger-zone { border: 1px solid #f3c9c6; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; font: inherit; font-weight: 600; font-size: .9rem;
  padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #c9cede; background: #fafbfd; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger-ghost { color: var(--err); }
.btn-small { padding: .3rem .6rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .4rem; }

.alert { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .92rem; }
.alert-error { background: #fdecea; color: #8e1f19; }
.alert-success { background: #e6f6ef; color: #135c40; }
.alert-info { background: #eaf1fd; color: #1c3f7a; }

/* Dashboard */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.2rem; }
.empty { text-align: center; padding: 3rem 1rem; }
.banner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; }
.banner-card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.thumb { display: flex; align-items: center; justify-content: center; height: 170px; background:
  repeating-conic-gradient(#eef0f5 0% 25%, #f8f9fb 0% 50%) 50% / 18px 18px; }
.thumb img { max-width: 92%; max-height: 150px; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.thumb-empty { color: var(--muted); font-weight: 600; }
.banner-meta { padding: .8rem 1rem .4rem; }
.banner-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats { list-style: none; display: flex; gap: 1rem; padding: 0; margin: .5rem 0 0; font-size: .85rem; color: var(--ink-2); }
.banner-actions { display: flex; flex-wrap: wrap; gap: .35rem; padding: .6rem 1rem 1rem; margin-top: auto; }
.banner-actions .btn { padding: .3rem .55rem; font-size: .8rem; }

/* Dialoge */
.dialog { border: 0; border-radius: 12px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.3); max-width: min(640px, 94vw); width: 100%; }
.dialog-wide { max-width: min(980px, 96vw); }
.dialog::backdrop { background: rgba(20, 26, 40, .55); }
.dialog-inner { padding: 1.3rem; display: flex; flex-direction: column; gap: .7rem; }
.dialog-inner textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; }
.dialog-buttons { display: flex; justify-content: flex-end; gap: .5rem; }
.dialog-preview { display: flex; justify-content: center; overflow: auto; max-height: 50vh; background: var(--bg); border-radius: 8px; padding: .6rem; }
.preview-frame { border: 0; display: block; }
progress { width: 100%; height: 14px; }

/* ---------------------------------------------------------------- Editor */
.editor-page { height: 100vh; overflow: hidden; }
.editor-main { flex: 1; min-height: 0; display: flex; }
.editor { flex: 1; min-height: 0; display: grid; grid-template-columns: 190px 1fr 310px; grid-template-rows: auto 1fr; }
.ed-toolbar { grid-column: 1 / -1; display: flex; align-items: center; gap: .8rem; padding: .5rem 1rem; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.title-input { max-width: 300px; font-weight: 700; }
.ed-toolbar-group { display: flex; gap: .4rem; margin-left: auto; flex-wrap: wrap; }
.ed-status { font-size: .82rem; color: var(--muted); }
.ed-status.ok { color: var(--ok); }
.ed-status.warn { color: var(--warn); }

.ed-left, .ed-right { background: #fff; overflow-y: auto; min-height: 0; }
.ed-left { border-right: 1px solid var(--line); padding: .7rem; }
.ed-right { border-left: 1px solid var(--line); padding: .7rem .8rem 2rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.panel-head h2 { margin: 0; font-size: .95rem; }

.slide-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.slide-item { border: 2px solid transparent; border-radius: 8px; padding: .35rem; cursor: pointer; background: var(--bg); }
.slide-item.active { border-color: var(--brand); background: #fff4f1; }
.slide-item canvas { display: block; margin: 0 auto .3rem; max-width: 100%; box-shadow: 0 1px 4px rgba(0,0,0,.15); background: #fff; }
.slide-meta { display: flex; justify-content: space-between; font-size: .78rem; font-weight: 600; }
.slide-btns { display: flex; justify-content: space-between; margin-top: .25rem; }
.icon-btn { border: 0; background: transparent; cursor: pointer; font-size: .85rem; padding: .15rem .35rem; border-radius: 5px; color: var(--ink-2); }
.icon-btn:hover { background: rgba(0,0,0,.07); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.danger:hover { color: var(--err); }

.ed-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ed-insert { display: flex; gap: .4rem; align-items: center; padding: .5rem .8rem; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ed-insert .spacer { flex: 1; }
.zoom { display: flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--muted); }
.zoom select { width: auto; padding: .3rem; }
.stage-wrap { flex: 1; min-height: 0; overflow: auto; display: flex; padding: 24px;
  background: repeating-conic-gradient(#e9ebf1 0% 25%, #f3f4f8 0% 50%) 50% / 20px 20px; }
.stage { position: relative; margin: auto; flex: none; box-shadow: 0 4px 24px rgba(0,0,0,.18); }
.stage canvas { display: block; }
.overlay { position: absolute; inset: 0; outline: none; touch-action: none; }
.is-playing .overlay { pointer-events: auto; cursor: default; }
.sel { position: absolute; border: 1.5px solid var(--brand); box-shadow: 0 0 0 1px rgba(255,255,255,.8); pointer-events: none; transform-origin: center center; }
.handle { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid var(--brand); border-radius: 3px; pointer-events: auto; }
.handle-se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.handle-rot { left: 50%; top: -26px; margin-left: -6px; border-radius: 50%; cursor: grab; }
.handle-rot::after { content: ""; position: absolute; left: 3px; top: 10px; width: 2px; height: 12px; background: var(--brand); }
.guide { position: absolute; background: #2f7cf6; pointer-events: none; }
.guide-x { top: 0; bottom: 0; width: 1px; }
.guide-y { left: 0; right: 0; height: 1px; }

.layers { background: #fff; border-top: 1px solid var(--line); padding: .5rem .8rem; max-height: 30vh; overflow-y: auto; }
.layer-list { list-style: none; margin: 0; padding: 0; }
.layer { display: flex; align-items: center; gap: .5rem; padding: .3rem .4rem; border-radius: 6px; cursor: pointer; font-size: .85rem; }
.layer:hover { background: var(--bg); }
.layer.active { background: #fff0ec; }
.layer-icon { width: 22px; text-align: center; font-weight: 700; color: var(--ink-2); }
.layer-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-btns { display: flex; gap: 2px; }
.empty-layer { padding: .4rem; }

.prop-section { border-bottom: 1px solid var(--line); padding: .45rem 0; }
.prop-section > summary { cursor: pointer; font-weight: 700; font-size: .85rem; padding: .25rem 0; color: var(--ink-2); list-style-position: inside; }
.prop-body { display: flex; flex-direction: column; gap: .55rem; padding-top: .45rem; }
.field { display: flex; flex-direction: column; gap: .2rem; min-width: 0; flex: 1; }
.field-label { font-size: .75rem; font-weight: 600; color: var(--muted); }
.field-hint { font-size: .72rem; color: var(--muted); }
.field input, .field select, .field textarea { padding: .35rem .45rem; font-size: .85rem; }
.row { display: flex; gap: .5rem; }
.toggles { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.check { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; cursor: pointer; }
.color-field { display: flex; align-items: center; gap: .35rem; }
.color-field input[type=color] { width: 100%; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.color-field input[type=color]:disabled { opacity: .35; }
.range { display: flex; align-items: center; gap: .4rem; }
.range input { flex: 1; min-width: 0; }
.range output { font-size: .75rem; color: var(--ink-2); min-width: 42px; text-align: right; }
.anim-group { border: 1px dashed var(--line); border-radius: 8px; padding: .5rem; display: flex; flex-direction: column; gap: .4rem; }

/* Mediathek */
.media-tabs { display: flex; flex-wrap: wrap; gap: .3rem; }
.tab { font: inherit; font-size: .82rem; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .25rem .7rem; cursor: pointer; }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.media-upload { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; max-height: 58vh; overflow-y: auto; padding: .2rem; }
.media-tile { position: relative; }
.media-pick { width: 100%; border: 1px solid var(--line); border-radius: 8px; background:
  repeating-conic-gradient(#eef0f5 0% 25%, #fff 0% 50%) 50% / 14px 14px; padding: .4rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.media-pick:hover { border-color: var(--brand); }
.media-pick img { width: 100%; height: 84px; object-fit: contain; }
.media-name { font-size: .7rem; color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-del { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 50%; width: 22px; height: 22px; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: .7rem; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff;
  padding: .65rem 1.1rem; border-radius: 9px; opacity: 0; pointer-events: none; transition: .2s; max-width: 90vw; z-index: 50; font-size: .9rem; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast-error { background: var(--err); }
.toast-success { background: var(--ok); }

@media (max-width: 1000px) {
  .editor { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr auto; }
  .editor-page { height: auto; overflow: auto; }
  .ed-left { border-right: 0; border-bottom: 1px solid var(--line); max-height: 180px; }
  .slide-list { flex-direction: row; overflow-x: auto; }
  .slide-item { min-width: 150px; }
  .stage-wrap { min-height: 60vh; }
  .ed-right { border-left: 0; border-top: 1px solid var(--line); }
}
.ed-right .panel-head { flex-wrap: wrap; }

/* ---------------------------------------------------------------- Version 2.1 */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); z-index: 30; min-width: 260px; padding: .3rem; display: flex; flex-direction: column; }
.menu button { text-align: left; border: 0; background: none; padding: .5rem .7rem; border-radius: 6px; font: inherit; font-size: .88rem; cursor: pointer; }
.menu button:hover { background: var(--bg); }
.align-bar { display: flex; align-items: center; gap: .3rem; padding: .3rem .8rem; background: #fff7f4; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.timeline { display: flex; align-items: center; gap: .5rem; padding: .35rem .8rem; background: #fff; border-top: 1px solid var(--line); }
.timeline input[type=range] { flex: 1; }
.timeline output { font-size: .8rem; min-width: 52px; color: var(--ink-2); }
.icon-btn.on { background: #ffe5dd; color: var(--brand-dark); }
.sel.multi { border-style: dashed; }
.sel.locked { border-color: #8a93a6; }
.path-svg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.path-svg polyline { fill: none; stroke: #2f7cf6; stroke-width: 2; stroke-dasharray: 5 4; }
.path-svg circle { fill: #fff; stroke: #2f7cf6; stroke-width: 2; }
.layer.is-hidden .layer-name { opacity: .45; text-decoration: line-through; }
.kf-list { list-style: none; margin: 0; padding: 0; font-size: .82rem; }
.kf-list li { display: flex; align-items: center; gap: .4rem; padding: .15rem 0; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; max-height: 65vh; overflow-y: auto; }
.tpl-card { display: flex; flex-direction: column; align-items: center; gap: .35rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: .7rem; cursor: pointer; font: inherit; }
.tpl-card:hover { border-color: var(--brand); }
.tpl-card canvas { box-shadow: 0 2px 8px rgba(0,0,0,.15); max-width: 100%; }
.formats-list { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem .8rem; max-height: 50vh; overflow-y: auto; }
.brand-colors { display: flex; flex-wrap: wrap; gap: .4rem; min-height: 32px; }
.swatch-wrap { display: inline-flex; align-items: center; gap: 2px; }
.swatch { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); display: inline-block; }
.brand-logo-prev { max-height: 40px; max-width: 120px; }
.font-list { display: flex; flex-direction: column; gap: .3rem; }
.font-row { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 7px; padding: .3rem .6rem; }
.font-sample { font-size: 1.1rem; }
.dialog hr { border: 0; border-top: 1px solid var(--line); width: 100%; }
.dialog h3 { margin: 0; }

/* Dashboard: Ordner, Suche, Sparkline */
.toolbar-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar-row input[type=search] { max-width: 280px; }
.folder-tabs { display: flex; gap: .3rem; flex-wrap: wrap; }
.sparkline { display: block; width: 100%; height: 28px; margin-top: .4rem; }
.badge { display: inline-block; font-size: .72rem; padding: .05rem .45rem; border-radius: 999px; background: #eef0f5; color: var(--ink-2); margin-left: .3rem; vertical-align: middle; }
.badge-warn { background: #fff1d6; color: #8a5300; }
.badge-ok { background: #e6f6ef; color: #135c40; }

/* Statistik / Platzierungen / Admin */
.chart { width: 100%; height: 240px; display: block; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.table td.num, .table th.num { text-align: right; }
.inline-form { display: inline; }
.qr { background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 8px; display: inline-block; }
.codes { font-family: ui-monospace, Menlo, Consolas, monospace; display: grid; grid-template-columns: repeat(2, auto); gap: .2rem 1.2rem; }
.legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 12px; height: 3px; vertical-align: middle; margin-right: .3rem; }
.lg-views { background: #ff5a36; }
.lg-clicks { background: #2f7cf6; }
.stats-kpis { display: flex; gap: 2rem; flex-wrap: wrap; margin-bottom: .8rem; }
.stats-kpis div strong { display: block; font-size: 1.6rem; }
.pl-banners { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .5rem; max-height: 45vh; overflow-y: auto; }
.pl-item { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; }
.pl-item input[type=number] { width: 64px; }
.pl-card { margin-bottom: 1rem; }
.pl-card .table td { font-size: .85rem; }
.winner { color: var(--ok); font-weight: 700; }

/* ================================================================ Editor 2.2 – neues Layout */
.editor-page .topbar { display: none; }
.editor.ed22 { display: grid; grid-template-columns: 68px auto minmax(0, 1fr) 320px; grid-template-rows: auto minmax(0, 1fr); height: 100vh; }
.ed-top { grid-column: 1 / -1; display: flex; align-items: center; gap: .7rem; padding: .45rem .8rem; background: #fff; border-bottom: 1px solid var(--line); min-height: 52px; flex-wrap: wrap; }
.ed-back { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: var(--ink); color: #fff; text-decoration: none; font-weight: 700; }
.ed-titlebox { display: flex; flex-direction: column; min-width: 180px; flex: 0 1 280px; }
.ed-titlebox .title-input { font-weight: 700; border-color: transparent; padding: .25rem .4rem; }
.ed-titlebox .title-input:hover { border-color: var(--line); }
.ed-titlebox .ed-status { padding-left: .45rem; line-height: 1.1; }
.ed-top-group { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.ed-top-right { margin-left: auto; }
.ed-top .sep { width: 1px; height: 24px; background: var(--line); margin: 0 .2rem; }
select.compact { width: auto; padding: .35rem .45rem; font-size: .85rem; }
.icon-btn.big { font-size: 1.15rem; padding: .25rem .5rem; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: .25rem 0; }

.ed-rail { grid-row: 2; grid-column: 1; display: flex; flex-direction: column; gap: 2px; padding: .5rem .3rem; background: var(--ink); overflow-y: auto; }
.rail-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent; color: #c9cfdc; font-size: .68rem; padding: .5rem .1rem; border-radius: 8px; cursor: pointer; }
.rail-btn span { font-size: 1.2rem; line-height: 1; }
.rail-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.rail-btn.active { background: var(--brand); color: #fff; }

.ed-drawer { grid-row: 2; grid-column: 2; width: 0; overflow: hidden; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; transition: width .15s ease; }
.drawer-open .ed-drawer { width: 290px; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: .6rem .8rem .3rem; }
.drawer-head h2 { font-size: 1rem; margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: .2rem .8rem 1.5rem; min-width: 290px; box-sizing: border-box; }
.drawer-body h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: .9rem 0 .4rem; }
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; aspect-ratio: 1 / .9; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; cursor: pointer; padding: .3rem; color: var(--ink); }
.tile:hover { border-color: var(--brand); background: #fff6f3; }
.tile-glyph { font-size: 1.45rem; line-height: 1; }
.tile-label { font-size: .7rem; text-align: center; line-height: 1.15; }
.text-presets { display: flex; flex-direction: column; gap: .4rem; }
.text-preset { display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; padding: .55rem .7rem; cursor: pointer; text-align: left; }
.text-preset:hover { border-color: var(--brand); background: #fff6f3; }
.tp-sample { font-weight: 700; color: var(--ink); }
.tp-h1 .tp-sample { font-size: 1.4rem; } .tp-h2 .tp-sample { font-size: 1.05rem; font-weight: 500; } .tp-p .tp-sample { font-size: .85rem; font-weight: 400; }
.tp-price .tp-sample { font-size: 1.3rem; color: var(--brand); } .tp-neon .tp-sample { color: #fff; background: #111827; padding: 0 .4rem; border-radius: 4px; text-shadow: 0 0 6px #00e5ff, 0 0 12px #00e5ff; }
.tp-outline .tp-sample { color: #fff; -webkit-text-stroke: 1px var(--ink); font-size: 1.2rem; } .tp-tag .tp-sample { background: var(--brand); color: #fff; padding: 0 .4rem; border-radius: 4px; font-size: .8rem; }
.seg { display: flex; flex-wrap: wrap; gap: 2px; background: var(--bg); border-radius: 8px; padding: 2px; margin-bottom: .6rem; }
.seg-btn { flex: 1; border: 0; background: transparent; border-radius: 6px; padding: .35rem .4rem; font-size: .78rem; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.seg-btn.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.media-grid.compact { grid-template-columns: repeat(2, 1fr); gap: .45rem; margin-top: .5rem; }
.media-glyph { display: flex; align-items: center; justify-content: center; height: 70px; font-size: 1.8rem; color: var(--ink-2); background: var(--bg); border-radius: 6px; }
.upload-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.icon-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; margin-top: .6rem; }
.icon-pick { border: 1px solid transparent; background: #fafbfd; border-radius: 8px; padding: .35rem; cursor: pointer; aspect-ratio: 1; }
.icon-pick:hover { border-color: var(--brand); background: #fff6f3; }
.icon-pick img { width: 100%; height: 100%; display: block; }
.swatch-row { display: flex; flex-wrap: wrap; gap: .35rem; }
.swatch.big { width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(0,0,0,.12); cursor: pointer; }
.drawer-body .tpl-grid { grid-template-columns: 1fr; }
.drawer-body .tpl-card canvas { max-width: 100%; height: auto; }

.ed22 .ed-center { grid-row: 2; grid-column: 3; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #e9ebf1; }
.ed22 .align-bar { background: #fff; border-bottom: 1px solid var(--line); padding: .3rem .8rem; }
.ed22 .stage-wrap { padding: 44px 40px 40px 48px; }
.stage .ruler { position: absolute; background: #f3f4f8; cursor: crosshair; z-index: 2; }
.stage .ruler-x { left: 0; top: -22px; }
.stage .ruler-y { top: 0; left: -22px; }
.no-rulers .stage .ruler { display: none; }
.guide-user { position: absolute; z-index: 3; pointer-events: auto; background: #00a2ff; }
.guide-user.guide-x { top: -22px; bottom: 0; width: 1px; cursor: ew-resize; }
.guide-user.guide-y { left: -22px; right: 0; height: 1px; cursor: ns-resize; }
.guide-user::before { content: ""; position: absolute; inset: -4px; }
.ed-bottom { background: #fff; border-top: 1px solid var(--line); }
.ed22 .timeline { border: 0; border-bottom: 1px solid var(--line); padding: .35rem .8rem; }
.filmstrip { display: flex; align-items: stretch; gap: .5rem; padding: .5rem .8rem; overflow-x: auto; }
.filmstrip .slide-list { flex-direction: row; gap: .5rem; }
.filmstrip .slide-item { width: 150px; flex: none; }
.filmstrip .slide-item canvas { max-height: 74px; }
.slide-add { flex: none; width: 70px; border: 2px dashed var(--line); background: #fafbfd; border-radius: 8px; cursor: pointer; font-size: 1.4rem; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.slide-add span { font-size: .72rem; }
.slide-add:hover { border-color: var(--brand); color: var(--brand); }

.ed22 .ed-right { grid-row: 2; grid-column: 4; display: flex; flex-direction: column; padding: 0; min-height: 0; overflow: hidden; }
.prop-tabs { display: flex; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 1; }
.prop-tab { flex: 1; border: 0; background: transparent; padding: .65rem .4rem; font-weight: 600; font-size: .85rem; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.prop-tab.active { color: var(--ink); border-bottom-color: var(--brand); }
.prop-tab:disabled { opacity: .4; cursor: default; }
.ed22 .props { flex: 1; overflow-y: auto; padding: .6rem .8rem 2rem; }
.color-field { display: flex; align-items: center; gap: .3rem; }
.eyedrop { font-size: .9rem; }
.picking .overlay { cursor: crosshair !important; }
.readonly .ed-rail .rail-btn:not([data-panel="layers"]) { opacity: .4; }
.lang-active #lang-select { border-color: var(--brand); background: #fff6f3; font-weight: 600; }

/* Dialoge 2.2 */
.version-wrap { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: start; }
.version-list { display: flex; flex-direction: column; gap: .4rem; max-height: 55vh; overflow-y: auto; }
.version-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 8px; }
.version-prev { max-width: 320px; background: var(--bg); border-radius: 6px; }
.comment-list { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-direction: column; gap: .45rem; }
.comment { border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; background: #fff; }
.comment p { margin: .2rem 0 0; white-space: pre-wrap; }
.comment.kind-approve { border-color: #b7e4cf; background: #f2fbf7; }
.comment.kind-changes { border-color: #f3d29d; background: #fff9ef; }
.badge { display: inline-block; font-size: .72rem; padding: .1rem .45rem; border-radius: 99px; background: var(--bg); color: var(--ink-2); margin: 0 .15rem; }
.badge.ok { background: #e3f6ee; color: var(--ok); } .badge.warn { background: #fff2dd; color: var(--warn); }
.grow { flex: 1; }
.bg-wrap { display: flex; justify-content: center; padding: .6rem; border-radius: 8px; margin-bottom: .6rem; }
.checker { background-color: #fff; background-image: linear-gradient(45deg, #ddd 25%, transparent 25%), linear-gradient(-45deg, #ddd 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ddd 75%), linear-gradient(-45deg, transparent 75%, #ddd 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.formats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .2rem .8rem; margin-top: .5rem; }
kbd { font-family: inherit; font-size: .78rem; background: var(--bg); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: .05rem .35rem; white-space: nowrap; }
.lang-row { align-items: center; border-bottom: 1px solid var(--line); padding: .3rem 0; }
.btn-warn { color: var(--warn); border-color: #f0c987; }

/* Freigabe-Seite */
.review { max-width: 980px; margin: 0 auto; }
.review-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.review-stage { display: flex; justify-content: center; background: #e9ebf1; border-radius: 12px; padding: 1.5rem; margin: .8rem 0 1.2rem; overflow: auto; }
.review-form { margin-bottom: 1.4rem; }

@media (max-width: 1150px) {
  .editor.ed22 { grid-template-columns: 60px auto minmax(0, 1fr) 280px; }
  .drawer-open .ed-drawer { width: 250px; }
  .drawer-body { min-width: 250px; }
}
.drawer-body .row { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.drawer-body .row input[type=search] { flex: 1 1 120px; width: auto; min-width: 0; }
.drawer-body .row select { flex: 0 0 auto; width: auto; }
.drawer-body > input[type=search] { margin-bottom: .2rem; }
.review-page .topbar .nav { display: none; }

/* ===================================================================== Version 3.0 */
.tpl-sep { grid-column: 1 / -1; font-size: .9rem; color: var(--ink-2); margin: .4rem 0 0; }
.tpl-card { position: relative; }
.tpl-del { position: absolute; top: .3rem; right: .4rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--err); font-size: .8rem; }
.tpl-del:hover { background: var(--err); color: #fff; }
.rich-bar { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; margin-bottom: .3rem; }
.rich-bar .btn { min-width: 2rem; padding: .2rem .45rem; }
.rich-bar input[type=color] { width: 2rem; height: 1.8rem; padding: 0; border: 1px solid var(--line); border-radius: 6px; }
.rb-b { font-weight: 700; } .rb-i { font-style: italic; } .rb-u { text-decoration: underline; }
.rb-ai { margin-left: auto; }
.ai-out { display: flex; flex-direction: column; gap: .35rem; margin-top: .6rem; }
.ai-item { display: flex; gap: .5rem; align-items: center; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.grow { flex: 1; min-width: 0; }
.check-group { margin-top: .8rem; }
.check-group h3 { margin-bottom: .3rem; }
.check-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .3rem; }
.chk { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .35rem .5rem; border-radius: 8px; background: var(--bg); font-size: .9rem; }
.chk input[type=text] { flex-basis: 100%; }
.chk-icon { width: 1.3rem; height: 1.3rem; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; color: #fff; flex: none; }
.chk-ok .chk-icon { background: var(--ok); } .chk-warn .chk-icon { background: var(--warn); } .chk-err .chk-icon { background: var(--err); } .chk-info .chk-icon { background: var(--muted); }
.activity-list, .link-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
.activity-list li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.trash-card { opacity: .85; }
.rules-box { border: 1px dashed var(--line); border-radius: 8px; padding: .5rem .6rem; margin-top: .4rem; display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; }
.rules-box .days { display: flex; gap: .3rem; flex-wrap: wrap; }
.rules-box .days label { display: inline-flex; gap: .2rem; align-items: center; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; width: 100%; }
.mt { margin-top: 1rem; }
