/*!
 * Meta Ads Format-Check - Oberfläche
 * Dunkles UI, damit die Sujets neutral beurteilt werden können.
 */

/* ---------------------------------------------------------------- Basis -- */
:root {
  --bg: #0b0e14;
  --bg-2: #121824;
  --card: #161d2b;
  --card-2: #1b2333;
  --line: #26304380;
  --line-solid: #263043;
  --txt: #e8edf7;
  --dim: #8e9bb3;
  --dim-2: #7c89a2;      /* gedaempft, aber noch 5.5:1 auf dem Seitengrund */
  --accent: #0866ff;
  --accent-2: #3d8bff;
  --danger: #ff4d5e;
  --warn: #ffb020;
  --ok: #29c17e;
  --safe: 255, 62, 84;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --tile-w: clamp(190px, 21vw, 290px);
  --topbar-h: 62px;
  --foot-h: 54px;
  --panel-w: 310px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--txt);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  /* Kopfzeile, Inhalt und Fusszeile füllen zusammen genau eine Bildschirmhöhe.
     Ohne das entsteht auch bei kurzem Inhalt ein leerer, scrollbarer Streifen. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); font-weight: 600; }
p { margin: 0 0 .6em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }

.dim { color: var(--dim); }
.hint { color: var(--dim); font-size: .8rem; line-height: 1.45; margin: .4em 0 0; }

/* ------------------------------------------------------------- Topbar --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px clamp(12px, 3vw, 24px);
  background: linear-gradient(180deg, #10151f, #0d1219);
  border-bottom: 1px solid var(--line-solid);
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #6b3cff);
  color: #fff;
  flex: none;
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: .98rem; letter-spacing: -.01em; }
.brand-text small { color: var(--dim); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.top-actions { display: flex; gap: 8px; align-items: center; flex: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Sprungmarke: erst sichtbar, wenn sie den Fokus bekommt */
.skip-link {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform .15s;
}
.skip-link:focus { transform: translateY(0); }

/* Fehlerzeile im Uploadbereich */
.dz-error {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: #2a1520;
  border: 1px solid #4a2130;
  color: #ffb3bd;
  font-size: .82rem;
  text-align: left;
  white-space: pre-line;
}

/* ------------------------------------------------------------ Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--card-2);
  color: var(--txt);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s;
  min-height: 40px;
}
.btn:hover { background: #222c40; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 6px 11px; font-size: .82rem; min-height: 34px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; border-color: var(--line-solid); color: var(--dim); }
.btn-ghost:hover { background: #1a2231; color: var(--txt); }
.btn-danger { background: transparent; border-color: #4a2130; color: var(--danger); }
.btn-danger:hover { background: #2a1520; }

.btn-mini, .mini-btn {
  background: #202a3d;
  border: 1px solid var(--line-solid);
  color: var(--dim);
  border-radius: 7px;
  padding: 4px 9px;
  font: inherit;
  font-size: .74rem;
  cursor: pointer;
  white-space: nowrap;
  min-height: 30px;
}
.btn-mini:hover, .mini-btn:hover { color: var(--txt); background: #27334a; }

.linklike {
  background: none;
  border: 0;
  color: var(--accent-2);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--line-solid);
  color: var(--dim);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  flex: none;
}
.icon-btn:hover { color: var(--danger); border-color: #4a2130; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* ------------------------------------------------------------- Layout --- */
.layout {
  display: grid;
  grid-template-columns: var(--panel-w) minmax(0, 1fr);
  gap: 0;
  align-items: start;
  flex: 1 0 auto;
  /* Färbt die Panelspalte durchgehend ein, auch wenn das Panel kürzer ist */
  background: linear-gradient(to right, var(--bg-2) 0 var(--panel-w), transparent var(--panel-w));
}
.layout-single { grid-template-columns: minmax(0, 1fr); background: none; }

.panel {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  max-height: calc(100vh - var(--topbar-h) - var(--foot-h));
  max-height: calc(100dvh - var(--topbar-h) - var(--foot-h));
  scrollbar-width: thin;
  overflow-y: auto;
  background: var(--bg-2);
  border-right: 1px solid var(--line-solid);
  overscroll-behavior: contain;
}
.panel-inner { padding: 16px 18px 28px; display: flex; flex-direction: column; gap: 22px; }

.pgroup { border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.pgroup:last-child { border-bottom: 0; padding-bottom: 0; }

.stage {
  padding: clamp(14px, 2.4vw, 26px);
  min-width: 0;
}
.stage-view { max-width: 1500px; margin: 0 auto; width: 100%; }

/* --------------------------------------------------------- Formulare --- */
.field { margin-bottom: 12px; }
.field label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: .82rem;
  color: var(--dim);
  margin-bottom: 5px;
}
.field output { color: var(--txt); font-variant-numeric: tabular-nums; font-weight: 600; }

input[type="text"], input[type="password"], textarea {
  width: 100%;
  background: #0e1420;
  border: 1px solid var(--line-solid);
  border-radius: var(--radius-sm);
  color: var(--txt);
  font: inherit;
  padding: 9px 11px;
  min-height: 40px;
}
textarea { resize: vertical; line-height: 1.45; }
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
  border-color: var(--accent);
  outline: none;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 3px;
  background: #2a3550;
}
input[type="range"]::-moz-range-track { height: 5px; border-radius: 3px; background: #2a3550; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 19px;
  height: 19px;
  margin-top: -7px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--accent);
}

.check, .chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  font-size: .87rem;
  cursor: pointer;
  color: var(--txt);
}
.check input, .chip input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }

.chip {
  background: var(--card);
  border: 1px solid var(--line-solid);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: .82rem;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  gap: 3px;
  background: #0e1420;
  border: 1px solid var(--line-solid);
  border-radius: 10px;
  padding: 3px;
}
.seg {
  background: transparent;
  border: 0;
  color: var(--dim);
  font: inherit;
  font-size: .82rem;
  font-weight: 550;
  padding: 8px 6px;
  border-radius: 7px;
  cursor: pointer;
  min-height: 36px;
}
.seg:hover { color: var(--txt); }
.seg.active { background: var(--accent); color: #fff; }

.copy-row { display: flex; gap: 6px; }
.copy-row input { flex: 1; min-width: 0; font-size: .8rem; }
.share-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.share-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#saveState { min-height: 1.2em; }
#saveState.error { color: var(--danger); }

.flash {
  margin: 12px clamp(12px, 3vw, 24px) 0;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: #2a1c10;
  border: 1px solid #5a3a17;
  color: #ffd9a0;
  font-size: .87rem;
}

.form-error {
  background: #2a1520;
  border: 1px solid #4a2130;
  color: #ffb3bd;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: .87rem;
}

/* ------------------------------------------------------------ Dropzone -- */
.dropzone {
  border: 2px dashed #2c3750;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #121926, #0f1521);
  padding: clamp(22px, 5vw, 46px) 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 22px;
  position: relative;
}
.dropzone:hover, .dropzone.over {
  border-color: var(--accent);
  background: #131c2e;
}
.dropzone.over { box-shadow: inset 0 0 0 3px rgba(8, 102, 255, .18); }
.dz-inner { color: var(--dim); pointer-events: none; }
.dz-inner .linklike { pointer-events: auto; }
.dz-inner h2 {
  color: var(--txt);
  font-size: 1.05rem;
  text-transform: none;
  letter-spacing: 0;
  margin: 10px 0 2px;
}
.dz-meta { font-size: .78rem; margin-top: 10px; }

.dropzone.compact {
  padding: 14px 18px;
  text-align: left;
  margin-bottom: 18px;
}
.dropzone.compact svg, .dropzone.compact .dz-meta { display: none; }
.dropzone.compact .dz-inner h2 { font-size: .9rem; margin: 0; display: inline; }
.dropzone.compact .dz-inner p { display: inline; margin-left: 6px; font-size: .85rem; }

.dz-progress { margin-top: 14px; }
.dz-progress .bar {
  height: 6px;
  background: #0d1420;
  border-radius: 3px;
  overflow: hidden;
}
.dz-progress .bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #7b5cff);
  transition: width .15s;
}
.dz-progress p { font-size: .78rem; color: var(--dim); margin: 6px 0 0; }

/* --------------------------------------------------------- Asset-Karte -- */
.assets { display: flex; flex-direction: column; gap: 24px; }

.asset {
  background: var(--card);
  border: 1px solid var(--line-solid);
  border-radius: var(--radius);
  padding: 14px clamp(10px, 1.6vw, 18px) 12px;
  box-shadow: var(--shadow);
}

.asset-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.asset-info { min-width: 0; flex: 1; }
.asset-name {
  display: block;
  font-size: .95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-meta { font-size: .78rem; color: var(--dim); font-variant-numeric: tabular-nums; }

.asset-flags { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; max-width: 52%; }
.flag {
  font-size: .72rem;
  padding: 3px 8px;
  border-radius: 6px;
  text-align: right;
  line-height: 1.35;
}
.flag-warn { background: #2c2010; color: #ffcc80; border: 1px solid #5a4318; }
.flag-error { background: #2a1520; color: #ffb3bd; border: 1px solid #4a2130; }
.flag-info { background: #16233a; color: #a8c6ff; border: 1px solid #24406e; }

/* -------------------------------------------------------------- Tiles --- */
.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(10px, 1.6vw, 20px);
  align-items: flex-start;
}

.tile {
  width: var(--tile-w);
  max-width: 100%;
  flex: 0 0 auto;
}

.tile-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  font-size: .74rem;
  color: var(--dim);
  flex-wrap: wrap;
}
.fmt-badge {
  margin-left: auto;
  background: #202a3d;
  border: 1px solid var(--line-solid);
  color: var(--dim);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
}
.tile-source .fmt-badge { background: #2b2350; border-color: #3d3470; color: #c3b6ff; }
.fmt-name {
  color: var(--txt);
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile-head .net-mark { width: 11px; height: 11px; border-radius: 3px; }

.shell {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #2a3348;
}

.frame {
  position: relative;
  width: 100%;
  background: #000;
  overflow: hidden;
  container-type: inline-size;
}
/* Rückfall für Browser ohne aspect-ratio */
@supports not (aspect-ratio: 1 / 1) {
  .frame::before { content: ""; display: block; padding-top: var(--ar-pad, 177.78%); }
  .frame > .media { position: absolute; inset: 0; }
}

.media { position: absolute; inset: 0; }
.media img, .media video, .media canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media video { cursor: pointer; }

.tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  font-size: .73rem;
  color: var(--dim);
}
.crop-info.warn { color: var(--warn); }

/* ----------------------------------------------------------- Overlays --- */
.ov { position: absolute; inset: 0; pointer-events: none; }

.sz {
  position: absolute;
  left: 0;
  right: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(var(--safe), .34) 0 7px,
    rgba(var(--safe), .13) 7px 14px
  );
}
.sz-top { top: 0; border-bottom: 1px solid rgba(var(--safe), .85); }
.sz-bottom { bottom: 0; border-top: 1px solid rgba(var(--safe), .85); }
.sz-side { top: 0; bottom: 0; left: auto; right: auto; }
.sz-left { left: 0; }
.sz-right { right: 0; }

.sz span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(var(--safe), .92);
  color: #fff;
  font-size: 9px;
  font-size: clamp(7px, 3.4cqw, 11px);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.sz-top span { bottom: 3px; }
.sz-bottom span { top: 3px; }

.sz-inner {
  position: absolute;
  border: 1px dashed rgba(255, 255, 255, .55);
  border-radius: 2px;
}
.sz-label {
  position: absolute;
  top: 3px;
  left: 3px;
  font-size: 8px;
  font-size: clamp(6px, 2.8cqw, 10px);
  color: rgba(255, 255, 255, .75);
  background: rgba(0, 0, 0, .45);
  padding: 1px 4px;
  border-radius: 3px;
}

.guide {
  position: absolute;
  border: 2px dashed var(--gc, #22d3ee);
  border-radius: 2px;
}
.guide span {
  position: absolute;
  top: 2px;
  left: 2px;
  background: var(--gc, #22d3ee);
  color: #061018;
  font-size: 9px;
  font-size: clamp(7px, 3.2cqw, 11px);
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}
.guide-0 { --gc: #22d3ee; }
.guide-1 { --gc: #ffc14d; }
.guide-2 { --gc: #b388ff; }

/* ----------------------------------------------- Oberflächen-Mockups --- */
.ui {
  position: absolute;
  inset: 0;
  font-size: clamp(7px, 3.6cqw, 13px);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.ui-avatar {
  display: inline-block;
  width: 2em;
  height: 2em;
  border-radius: 50%;
  background: linear-gradient(135deg, #6b3cff, #ff4d8d);
  border: 1.5px solid rgba(255, 255, 255, .85);
  flex: none;
}
.ui-name { font-weight: 650; }
.ui-sponsored { opacity: .85; font-size: .85em; }
.ui-chevron {
  width: .55em;
  height: .55em;
  border-right: .13em solid currentColor;
  border-bottom: .13em solid currentColor;
  transform: rotate(-45deg);
  display: inline-block;
}
.ui-chevron.up { transform: rotate(-135deg); }

.ui-ico {
  display: block;
  width: 1.7em;
  height: 1.7em;
  border-radius: 4px;
  background: currentColor;
  opacity: .92;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.ui-heart {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' d='M12 20s-7-4.5-7-9.5A3.9 3.9 0 0 1 12 8a3.9 3.9 0 0 1 7 2.5c0 5-7 9.5-7 9.5z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' d='M12 20s-7-4.5-7-9.5A3.9 3.9 0 0 1 12 8a3.9 3.9 0 0 1 7 2.5c0 5-7 9.5-7 9.5z'/%3E%3C/svg%3E");
}
.ui-comment {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' d='M4 12a8 8 0 1 1 3.5 6.6L4 20l1.2-3.3A7.9 7.9 0 0 1 4 12z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' d='M4 12a8 8 0 1 1 3.5 6.6L4 20l1.2-3.3A7.9 7.9 0 0 1 4 12z'/%3E%3C/svg%3E");
}
.ui-send {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' d='M21 3 3 10l7 3 3 7z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' d='M21 3 3 10l7 3 3 7z'/%3E%3C/svg%3E");
}
.ui-dots {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23000'%3E%3Ccircle cx='5' cy='12' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='19' cy='12' r='2'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23000'%3E%3Ccircle cx='5' cy='12' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='19' cy='12' r='2'/%3E%3C/g%3E%3C/svg%3E");
}
.ui-disc {
  width: 1.7em;
  height: 1.7em;
  border-radius: 5px;
  background: linear-gradient(135deg, #ff8a3d, #ff4d8d);
  border: 1px solid rgba(255, 255, 255, .7);
}
.ui-save {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' d='M6 3h12v18l-6-5-6 5z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' d='M6 3h12v18l-6-5-6 5z'/%3E%3C/svg%3E");
}
.ui-avatar.sm { width: 1.6em; height: 1.6em; }
.chrome .ui-avatar { width: 21px; height: 21px; flex: none; }
.chrome .ui-avatar.sm { width: 17px; height: 17px; }
.ui-note {
  display: inline-block;
  width: .8em;
  height: .8em;
  background: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M9 18V6l10-2v12'/%3E%3Ccircle fill='%23000' cx='7' cy='18' r='2.5'/%3E%3Ccircle fill='%23000' cx='17' cy='16' r='2.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M9 18V6l10-2v12'/%3E%3Ccircle fill='%23000' cx='7' cy='18' r='2.5'/%3E%3Ccircle fill='%23000' cx='17' cy='16' r='2.5'/%3E%3C/svg%3E");
  vertical-align: -.05em;
}

/* Reels */
.ui-reels .ui-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 1.1em 1em .4em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, .45), transparent);
}
.ui-title { font-weight: 700; font-size: 1.1em; }
.ui-cam { width: 1.4em; height: 1.4em; border: .12em solid #fff; border-radius: .35em; opacity: .9; }

.ui-reels .ui-side {
  position: absolute;
  right: .7em;
  bottom: 6.5em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45em;
}
.ui-num { font-size: .8em; font-weight: 600; margin-top: -.25em; }

.ui-reels .ui-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1em .9em .9em;
  background: linear-gradient(0deg, rgba(0, 0, 0, .72) 40%, transparent);
}
.ui-account { display: flex; align-items: center; gap: .5em; margin-bottom: .45em; }
.ui-caption {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: .95;
  margin-bottom: .35em;
}
.ui-audio { font-size: .85em; opacity: .9; display: flex; align-items: center; gap: .4em; margin-bottom: .6em; }
.ui-cta-bar {
  background: rgba(255, 255, 255, .96);
  color: #111;
  text-shadow: none;
  font-weight: 650;
  text-align: center;
  padding: .5em;
  border-radius: .5em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  margin-bottom: .55em;
}
.ui-follow {
  border: .09em solid rgba(255, 255, 255, .8);
  border-radius: .35em;
  padding: .1em .45em;
  font-size: .82em;
  font-weight: 600;
}
/* Anzeigenkarte, wie sie Facebook unter Reels einblendet */
.ui-adcard {
  display: flex;
  align-items: center;
  gap: .5em;
  background: rgba(255, 255, 255, .95);
  color: #111;
  text-shadow: none;
  border-radius: .5em;
  padding: .4em .5em;
  margin-bottom: .55em;
}
.ui-adthumb {
  width: 2.2em;
  height: 2.2em;
  border-radius: .3em;
  background: linear-gradient(135deg, #6b3cff, #ff4d8d);
  flex: none;
}
.ui-adtext { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.ui-adtext em { font-style: normal; color: #65676b; font-size: .82em; }
.ui-adcard .ui-close { margin-left: 0; color: #65676b; flex: none; }

/* Stories */
.ui-stories .ui-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: .6em .8em;
  background: linear-gradient(180deg, rgba(0, 0, 0, .5), transparent);
}
.ui-bars { display: flex; gap: .25em; margin-bottom: .6em; }
.ui-bars i {
  flex: 1;
  height: .18em;
  background: rgba(255, 255, 255, .35);
  border-radius: 1em;
}
.ui-bars i.on { background: #fff; }
.ui-stories .ui-account { gap: .45em; }
.ui-close {
  margin-left: auto;
  width: .9em;
  height: .9em;
  background: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath stroke='%23000' stroke-width='2.5' d='M5 5l14 14M19 5L5 19'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath stroke='%23000' stroke-width='2.5' d='M5 5l14 14M19 5L5 19'/%3E%3C/svg%3E");
}
.ui-stories .ui-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.2em .8em .9em;
  display: flex;
  justify-content: center;
  background: linear-gradient(0deg, rgba(0, 0, 0, .55), transparent);
}
.ui-swipe {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25em;
  font-weight: 650;
}
.ui-swipe span:last-child { border-bottom: .12em solid #fff; padding-bottom: .1em; }

/* ---------------------------------- Umgebende Oberflächen (Feed, Karten) -- */
/* Hell gehalten wie die Vorschau im Werbeanzeigenmanager. */
.chrome {
  background: #fff;
  color: #050505;
  display: none;
  font-size: .72rem;
  line-height: 1.35;
}
.tile.with-chrome .chrome { display: block; }
.tile.with-chrome .shell { background: #fff; border-color: #d6dae0; }

.c-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
}
.c-row-sm { padding: 6px 8px; }
.c-name {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  font-weight: 650;
  min-width: 0;
}
.c-name em {
  font-style: normal;
  font-weight: 400;
  color: #65676b;
  font-size: .92em;
  display: flex;
  align-items: center;
  gap: 4px;
}
.c-row .ui-dots { margin-left: auto; width: 15px; height: 15px; color: #65676b; flex: none; }
.c-globe {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid #65676b;
  display: inline-block;
}
.c-copy { padding: 0 9px 8px; color: #050505; }

.c-ctabar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  background: #f0f2f5;
  border-top: 1px solid #e4e6eb;
}
.c-ctatext { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.c-ctatext em { font-style: normal; font-weight: 650; color: #050505; }
.c-ctabar .c-ctatext { color: #65676b; text-transform: uppercase; font-size: .66rem; }
.c-ctabar-ig {
  background: #fff;
  text-transform: none;
  border-bottom: 1px solid #e4e6eb;
}
.c-ctabar-ig .c-ctatext { text-transform: none; font-size: .72rem; font-weight: 600; color: #050505; }

.c-btn {
  background: #e4e6eb;
  color: #050505;
  font-weight: 650;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  flex: none;
}
.c-btn.sm { padding: 4px 8px; font-size: .68rem; }

.c-actions {
  display: flex;
  justify-content: space-around;
  gap: 4px;
  padding: 6px 4px;
  border-top: 1px solid #e4e6eb;
  color: #65676b;
  font-weight: 600;
}
.c-icons { display: flex; gap: 12px; padding: 8px 9px 4px; color: #050505; }
.c-icons .ui-ico { width: 17px; height: 17px; }
.c-icons .ui-save { margin-left: auto; }
.c-caption {
  padding: 0 9px 9px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.c-linkline {
  padding: 8px 9px;
  border-top: 1px solid #e4e6eb;
  font-weight: 600;
}
.c-sponsored { padding: 0 8px 7px; color: #65676b; font-size: .68rem; }

.c-overlaybar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  background: #f0f2f5;
}
.c-overlaybar .c-name { flex: 1; }

/* Rechte Spalte: Bild neben dem Text */
.tile.with-chrome .shell-right {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
}
.shell-right .frame { width: 46%; flex: none; border-radius: 4px; }
.shell-right .chrome { flex: 1; min-width: 0; background: transparent; }
.shell-right .c-row { padding: 0; }
.shell-right .ui-avatar { display: none; }

/* Netzwerk-Markierung */
.net-mark {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  flex: none;
  display: inline-block;
}
.net-mark.net-fb { background: #0866ff; }
.net-mark.net-ig { background: linear-gradient(135deg, #ffb340, #ff4d8d 45%, #8a3ab9); }

/* ---------------------------------------------------------- Steuerung --- */
.asset-controls {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.playbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.play-btn svg { fill: currentColor; }
.play-btn:hover { background: var(--accent-2); }
.seek { flex: 1; min-width: 60px; }
.time { font-size: .78rem; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Platzierungsauswahl im Bedienfeld */
.placements { display: flex; flex-direction: column; gap: 12px; }
.pgrp-title {
  margin: 0 0 2px;
  font-size: .7rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--dim-2);
}
.check-place { padding: 5px 0; gap: 8px; }
.place-label { flex: 1; min-width: 0; }
.place-tag {
  font-size: .64rem;
  color: #ff8a94;
  background: #2a1520;
  border: 1px solid #4a2130;
  border-radius: 5px;
  padding: 1px 5px;
  white-space: nowrap;
}

/* Feste Safe-Zone-Werte (nicht einstellbar - Meta gibt sie vor) */
.zonetable {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.zonetable th {
  font-weight: 500;
  font-size: .7rem;
  color: var(--dim);
  text-align: right;
  padding: 0 0 4px;
}
.zonetable thead th:first-child { text-align: left; }
.zonetable tbody th {
  text-align: left;
  font-size: .8rem;
  color: var(--txt);
  font-weight: 600;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.zonetable td {
  text-align: right;
  padding: 6px 0 6px 8px;
  border-top: 1px solid var(--line);
}
.zonetable td strong { display: block; font-size: .82rem; font-weight: 600; }
.zonetable td span { color: var(--dim); font-size: .68rem; }
.zone-none { text-align: left !important; color: var(--dim); font-size: .78rem; padding: 8px 0 !important; }

/* -------------------------------------------------------- Leseansicht --- */
.view-head { margin-bottom: 16px; }
.view-head h1 { font-size: clamp(1.2rem, 3.4vw, 1.7rem); }
.view-note { color: var(--txt); opacity: .9; max-width: 70ch; white-space: pre-line; }
.view-meta { color: var(--dim); font-size: .82rem; }
.view-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.empty-state {
  max-width: 460px;
  margin: 12vh auto;
  text-align: center;
  padding: 0 20px;
}

.login-card {
  max-width: 380px;
  margin: 10vh auto;
  background: var(--card);
  border: 1px solid var(--line-solid);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 1.25rem; }
.login-card .btn { width: 100%; margin-top: 6px; }

.site-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: space-between;
  align-items: center;
  padding: 14px clamp(12px, 3vw, 24px);
  min-height: var(--foot-h);
  color: var(--dim-2);
  font-size: .75rem;
  border-top: 1px solid var(--line-solid);
  background: var(--bg);
  flex: none;
}

/* --------------------------------------------------- Panel auf Mobile --- */
.panel-toggle {
  display: none;
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 60;
  align-items: center;
  gap: 7px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
  cursor: pointer;
}
.panel-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 45;
}

/* ------------------------------------------------------------ Responsiv - */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); background: none; }

  .panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    max-height: 82vh;
    border-right: 0;
    border-top: 1px solid var(--line-solid);
    border-radius: 18px 18px 0 0;
    transform: translateY(102%);
    transition: transform .22s ease;
    z-index: 50;
    box-shadow: 0 -12px 34px rgba(0, 0, 0, .5);
    padding-bottom: env(safe-area-inset-bottom);
  }
  body.panel-open .panel { transform: translateY(0); }
  .panel-inner::before {
    content: "";
    display: block;
    width: 42px;
    height: 4px;
    border-radius: 2px;
    background: #33405a;
    margin: -6px auto 8px;
  }

  .mode-edit .panel-toggle { display: inline-flex; }
  .stage { padding-bottom: 90px; }

  :root { --tile-w: min(100%, 340px); }
  .tiles { justify-content: center; }
  .asset-flags { max-width: 45%; }

  /* Fingerfreundliche Trefferflaechen (44px), Desktop bleibt kompakt */
  .check, .check-place, .chip { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
  .check input, .chip input { width: 20px; height: 20px; }
  .icon-btn { width: 44px; height: 44px; font-size: 20px; }
  .btn-mini, .mini-btn { min-height: 40px; padding: 8px 12px; }
  .play-btn { width: 46px; height: 46px; }
  .btn-sm { min-height: 40px; }
  .seg { min-height: 44px; }
  input[type="range"] { height: 44px; }
  input[type="range"]::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -10px; }
  input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; }
  .tile-foot { gap: 12px; }
}

@media (max-width: 560px) {
  body { font-size: 14px; }
  .brand-text small { display: none; }
  .asset-head { flex-wrap: wrap; }
  .asset-flags { max-width: 100%; align-items: flex-start; order: 3; width: 100%; }
  .flag { text-align: left; }
  :root { --tile-w: min(100%, 400px); }
  .tile-foot { flex-wrap: wrap; }
  .share-actions .btn { flex: 1; }
}

@media (min-width: 1500px) {
  :root { --tile-w: clamp(220px, 19vw, 320px); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
