/* Lausitz Studio: Lieferanten-Portal. Farben, Schrift, Knoepfe und Formularelemente
   kommen aus /admin/serboflix-controls.css (Sorbflix-Design, gemeinsam mit dem Admin). */
:root {
  --radius: 12px;
  --gutter: clamp(14px, 3vw, 32px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

.topbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  padding: 12px var(--gutter); border-bottom: 1px solid var(--line);
  background: var(--panel); position: sticky; top: 0; z-index: 10;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand img { width: 28px; height: 28px; flex: none; }
.brand strong { color: var(--text); font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; }
.brand-flix { color: var(--red); }
.brand-sub { color: var(--muted); }
.topbar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-btn { min-height: 34px; background: none; border: 0; color: var(--muted); padding: 6px 12px; cursor: pointer; font: inherit; font-size: 0.8rem; font-weight: 600; }
.lang-btn.is-active { background: var(--accent); color: var(--accent-ink); }
/* Profilwahl in der Kopfleiste: kompakt statt volle Breite */
#providerSwitch { width: auto; max-width: 240px; }
/* .btn, .btn-primary, .btn-ghost, .btn-danger, .btn-small: serboflix-controls.css */

.gate { max-width: 520px; margin: 12vh auto; padding: 0 var(--gutter); text-align: center; }

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 60px); }
.nav { padding: 18px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.nav a {
  color: var(--text); text-decoration: none; padding: 10px 14px; border-radius: 10px;
}
.nav a:hover { background: var(--surface); }
.nav a.is-active { background: var(--accent-soft); color: #fff; font-weight: 600; }
.nav .nav-sep { height: 1px; background: var(--line); margin: 8px 0; }
.main { padding: 24px var(--gutter) 80px; min-width: 0; max-width: 960px; }
/* Die Live-Konsole braucht zwei Spalten. */
.main:has(.studio-live) { max-width: 1320px; }

.note { padding: 10px 14px; border-radius: 10px; background: var(--surface-2); margin: 0 0 16px; }
.note.is-error { background: rgba(255,123,134,0.15); color: var(--danger); }
.note.is-success { background: rgba(125,220,154,0.13); color: var(--ok); }
.note.is-warn { background: rgba(240,185,90,0.14); color: var(--warn); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

label.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 0.85rem; color: var(--muted); }
label.field > span { font-weight: 600; }
/* Feldstil (Rahmen, Fokus, Pfeil): serboflix-controls.css; hier nur die Breite. */
label.field :is(input, select, textarea), .card :is(input:not([type="checkbox"], [type="radio"], [type="color"], [type="file"]), select, textarea) { width: 100%; }
textarea { min-height: 110px; }
label.check { display: flex; gap: 10px; align-items: center; min-height: 40px; margin: 8px 0 12px; cursor: pointer; color: var(--text); }
.hint { color: var(--muted); font-size: 0.85rem; margin: 4px 0 0; }
.hint.is-error { color: var(--danger); }
.hint.is-success { color: var(--ok); }

.badge { display: inline-block; font-size: 0.75rem; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge.is-ok { background: rgba(125,220,154,0.15); color: var(--ok); }
.badge.is-warn { background: rgba(240,185,90,0.16); color: var(--warn); }
.badge.is-bad { background: rgba(255,123,134,0.16); color: var(--danger); }

.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.list-item .grow { flex: 1; min-width: 0; }
.list-item .meta { color: var(--muted); font-size: 0.85rem; }
.empty { color: var(--muted); padding: 18px 0; }

.media-preview { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.avatar-prev { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.cover-prev { width: 100%; max-width: 360px; aspect-ratio: 16/6; object-fit: cover; border-radius: 10px; background: var(--surface-2); }

/* Bildergalerie: Vorschau, Bildunterschriften de/hsb/dsb, Reihenfolge */
.gallery-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.gallery-row {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: start;
  padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.gallery-thumb { width: 120px; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.gallery-fields { min-width: 0; }
.gallery-fields label.field { margin-bottom: 6px; }
.gallery-actions { display: flex; flex-direction: column; gap: 6px; }
.accent-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 0.85rem; color: var(--muted); }
.accent-field > span { font-weight: 600; }
.accent-field label.check { margin: 0; color: var(--text); }
input[type=color] { width: 56px; height: 40px; padding: 2px; border: 1px solid var(--field-line); border-radius: 6px; background: var(--field-bg); cursor: pointer; }
input[type=color]:disabled { opacity: 0.4; cursor: not-allowed; }

.drop {
  border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 18px; text-align: center;
  color: var(--muted); cursor: pointer; margin-bottom: 8px;
}
.drop.is-drag, .drop:hover { border-color: var(--accent); color: var(--text); }
.drop.is-uploading { opacity: 0.6; pointer-events: none; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--red); transition: width 0.3s; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tile b { display: block; font-size: 1.7rem; color: #fff; }
.tile span { color: var(--muted); font-size: 0.85rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; font-weight: 600; border-bottom-color: var(--line-strong); }
/* Sprungziele nicht unter der festen Kopfleiste verstecken */
.card, .live-sec, h1, h2 { scroll-margin-top: 72px; }
td.num, th.num { text-align: right; }

/* Meine Bibliothek: Vorschaubild links, rechts Titel, Status, Kategorie und Knoepfe
   (schmal: Bild neben dem Titel, darunter die volle Breite) */
.lib-filters { margin: 4px 0 16px; }
.lib-item {
  display: grid; grid-template-columns: 168px minmax(0, 1fr); column-gap: 14px; row-gap: 10px; align-items: start;
  grid-template-areas: "thumb head" "thumb badges" "thumb controls" "thumb actions";
}
.lib-thumb {
  grid-area: thumb; width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px;
  background: var(--surface-2); display: grid; place-items: center; color: var(--muted); font-size: 1.6rem; font-weight: 700;
}
.lib-head { grid-area: head; min-width: 0; }
.lib-badges { grid-area: badges; }
.lib-badges:empty, .lib-badges:not(:has(> :not([hidden]))) { display: none; }
.lib-controls { grid-area: controls; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lib-controls label.field { margin: 0; }
.lib-actions { grid-area: actions; }
.lib-link-actions { margin-top: 12px; }

@media (max-width: 760px) {
  .lib-item { grid-template-columns: 96px minmax(0, 1fr); grid-template-areas: "thumb head" "badges badges" "controls controls" "actions actions"; }
  .lib-thumb { font-size: 1.2rem; }
  .lib-controls { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; }
  .nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px var(--gutter); gap: 6px; }
  .nav a { white-space: nowrap; padding: 8px 12px; }
  .nav .nav-sep { display: none; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .topbar { position: static; }
  .gallery-row { grid-template-columns: 88px 1fr; }
  .gallery-thumb { width: 88px; }
  .gallery-actions { grid-column: 1 / -1; flex-direction: row; }
}
/* Handy: zwei feste Zeilen statt drei. Oben Logo und Sprache, darunter Profilwahl (Restbreite)
   mit kleinen Knoepfen "Zur Seite" und "Abmelden". */
@media (max-width: 480px) {
  .topbar { gap: 8px; }
  .topbar-actions { display: contents; }
  .topbar .brand { margin-right: auto; }
  .topbar::after { content: ''; order: 1; flex: 0 0 100%; height: 0; }
  #providerSwitch, #backLink, #logoutBtn { order: 2; }
  #providerSwitch { flex: 1 1 0; min-width: 0; max-width: none; }
  #backLink { margin-left: auto; }
  #backLink, #logoutBtn { min-height: 36px; padding: 6px 12px; font-size: 13px; }
}

/* ------------------------------------------------------------------------
   Speicher, Neuer Inhalt, Einbinden (Vertrag 0.24.0). Knoepfe, Felder, Schalter,
   Auswahlkarten (.choice-card) und Chips (.filter-pill) kommen aus
   /admin/serboflix-controls.css; hier nur Anordnung und eigene Bausteine.
   ------------------------------------------------------------------------ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hint.is-warn { color: var(--warn); }
.field-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
div.field { margin-bottom: 12px; }

.storage-meter { margin: 4px 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.storage-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; font-size: 0.9rem; }
.storage-pct { color: var(--muted); font-variant-numeric: tabular-nums; }
.storage-bar { height: 8px; margin-top: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.storage-bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--text); transition: width 0.3s; }
.storage-meter.is-warn .storage-bar > i { background: var(--warn); }
.storage-meter.is-full .storage-bar > i { background: var(--danger); }
.storage-meter .hint { margin-top: 8px; }

.wiz-form .card h2 { font-size: 1.05rem; }
.wiz-form .choice-group + .hint { margin: 8px 0 12px; }
.wiz-form .choice-group, .wiz-form .checkbox-row { margin-bottom: 12px; }
/* Spezifischer als .choice-grid (zwei Spalten) aus serboflix-controls.css, das spaeter laedt */
.choice-grid.choice-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wiz-actions { margin-top: 8px; }
.wiz-seq { max-width: 260px; }
.wiz-file .drop, .wiz-items .drop { margin-bottom: 6px; }
.drop.is-invalid, .drop[aria-invalid="true"] { border-color: var(--danger); color: var(--danger); }
:is(input, select, textarea)[aria-invalid="true"] { border-color: var(--danger); }
.wiz-picked { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 10px; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.wiz-picked-name { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.chip-row { gap: 8px; }

.wiz-item-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wiz-item {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "grip no name actions" "grip no file actions";
  gap: 2px 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.wiz-item.is-dragging { opacity: 0.5; }
.wiz-item.is-drop { border-color: var(--text); }
.wiz-grip { grid-area: grip; cursor: grab; color: var(--muted); letter-spacing: -3px; padding: 6px 4px; user-select: none; }
.wiz-no { grid-area: no; min-width: 1.6em; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.wiz-item-name { grid-area: name; }
.wiz-item-name input { width: 100%; }
.wiz-item-file { grid-area: file; overflow-wrap: anywhere; }
.wiz-item-actions { grid-area: actions; display: flex; gap: 6px; }

.wiz-job .job-steps { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.job-step { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.job-step.is-running { border-color: var(--line-strong, var(--line)); }
.job-step.is-failed { border-color: var(--danger); }
.job-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.job-label { min-width: 0; overflow-wrap: anywhere; }
.job-ctl { margin-top: 8px; }

.emb-url-row { flex-wrap: nowrap; }
.emb-url-row input { flex: 1 1 auto; min-width: 0; }
.emb-head { display: flex; gap: 14px; align-items: flex-start; }
.emb-thumb { width: 168px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: var(--surface-2); flex: none; }
.emb-text { display: grid; gap: 6px; min-width: 0; }
.emb-text strong { overflow-wrap: anywhere; }
.emb-frame { margin-top: 14px; }
.emb-iframe { display: block; width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; background: #000; }
.emb-iframe.is-audio { aspect-ratio: auto; height: 352px; background: transparent; }
.emb-iframe.is-soundcloud { height: 166px; }
.emb-iframe.is-yumpu { aspect-ratio: 4/3; }
.emb-frame video, .emb-frame audio { width: 100%; }
.note ul { margin: 6px 0 0; padding-left: 20px; }
/* Untertyp noch nicht verfuegbar (z. B. Podcast per RSS-Feed) */
.choice-card.is-disabled, .choice-card.is-disabled:hover { opacity: 0.6; cursor: not-allowed; border-color: var(--line-strong, var(--line)); }

@media (max-width: 760px) {
  .choice-grid.choice-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .wiz-item { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "no name" "no file" "actions actions"; }
  .wiz-grip { display: none; }
  .emb-head { flex-direction: column; }
  .emb-thumb { width: 100%; }
  .emb-url-row { flex-wrap: wrap; }
}
