:root {
  --primary: #1d4ed8;
  --accent: #0ea5e9;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1b2430;
  --muted: #6b7686;
  --border: #dde2ea;
  --danger: #c62828;
  --ok: #2e7d32;
  --warn: #b26a00;
  --radius: 8px;
  --sidebar: 232px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.45; color: var(--text); background: var(--bg);
}
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }

/* Layout */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: #101828; color: #d6dbe5; display: flex; flex-direction: column; padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem 1rem; font-weight: 600; color: #fff; }
.brand img { max-height: 32px; max-width: 120px; }
.sidebar-version { margin-top: auto; padding: 1rem .75rem .25rem; font-size: .72rem; color: #7d8799; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: #c3cad6; text-decoration: none; padding: .5rem .75rem; border-radius: 6px; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: var(--primary); color: #fff; }
.nav .nav-sep { margin: .75rem .75rem .25rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #7d8799; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .6rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.topbar .spacer { flex: 1; }
.topbar select { max-width: 240px; }
.content { padding: 1.5rem; max-width: 1200px; width: 100%; }
.menu-toggle { display: none; }

/* Seitenkopf */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.page-actions select { width: auto; }
.toast { cursor: pointer; }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1.1rem; text-decoration: none; color: inherit; display: block; }
.stat:hover { border-color: var(--primary); }
.stat .num { font-size: 1.8rem; font-weight: 600; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: .85rem; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .45rem 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; }
.list li:last-child { border-bottom: 0; }

/* Buttons */
.btn { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: .45rem .85rem; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: #b4bdcb; background: #f7f9fc; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary); border-color: var(--primary); filter: brightness(1.1); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); filter: brightness(1.1); }
.btn-small { padding: .25rem .55rem; font-size: .85rem; }
a.btn { display: inline-block; text-decoration: none; color: inherit; }
a.btn-primary { color: #fff; }
.btn-link { border: 0; background: none; padding: 0; color: var(--primary); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Tabellen */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfd; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; }
.row-actions { display: flex; gap: .35rem; justify-content: flex-end; }
.row-muted td { color: var(--muted); }

/* Badges */
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; background: #e8ecf2; color: #3b4658; white-space: nowrap; }
.badge-ok { background: #e3f4e5; color: var(--ok); }
.badge-error { background: #fde8e8; color: var(--danger); }
.badge-warn { background: #fff1d6; color: var(--warn); }
.badge-info { background: #e1effd; color: #1553a8; }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: #aab3c2; margin-right: .4rem; }
.dot-ok { background: #2fb344; }
.dot-off { background: #d33; }
.chips { display: inline-flex; gap: 2px; }
.chip { font-size: .72rem; padding: 0 .3rem; border-radius: 4px; background: #eef1f6; color: #9aa3b2; }
.chip.on { background: var(--primary); color: #fff; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .85rem; }
.field-label { font-size: .85rem; font-weight: 600; }
.field-hint { font-size: .8rem; color: var(--muted); }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=url],
input[type=date], input[type=time], input[type=search], input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 6px; background: #fff;
}
textarea { min-height: 5rem; resize: vertical; }
.check { display: flex; align-items: center; gap: .5rem; margin-bottom: .85rem; }
.check input { width: auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .75rem; }
.days { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .85rem; }
.day { display: inline-flex; align-items: center; gap: .25rem; padding: .25rem .55rem; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; background: #fff; user-select: none; }
.day input { width: auto; margin: 0; }
.radio-row { display: flex; gap: 1rem; margin-bottom: .5rem; }
.radio-row label { display: flex; gap: .35rem; align-items: center; }

/* Dialoge */
.overlay { position: fixed; inset: 0; background: rgba(16,24,40,.5); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; overflow-y: auto; z-index: 50; }
.modal { background: var(--surface); border-radius: 10px; width: 100%; max-width: 480px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal-wide { max-width: 680px; }
.modal-head { padding: 1rem 1.25rem 0; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 1rem 1.25rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .75rem 1.25rem 1rem; border-top: 1px solid var(--border); }
.form-error { margin-top: .5rem; }

/* Hinweise */
.alert { padding: .6rem .8rem; border-radius: 6px; margin-bottom: .75rem; }
.alert-error { background: #fde8e8; color: #8a1c1c; }
.alert-info { background: #e1effd; color: #123f7a; }
.alert-warn { background: #fff1d6; color: #7a4a00; }
.fit-list { margin: .35rem 0 0; padding-left: 1.1rem; font-size: .85rem; }
.fit-list li { margin: .2rem 0; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty .btn { margin-top: .5rem; }
.loading { padding: 2rem; text-align: center; color: var(--muted); }
#toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 100; }
.toast { background: #1b2430; color: #fff; padding: .6rem .9rem; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: 380px; }
.toast-error { background: var(--danger); }

/* Medien */
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar select { width: auto; }
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.view-toggle button { border: 0; background: var(--surface); padding: .4rem .7rem; cursor: pointer; font-size: .85rem; }
.view-toggle button + button { border-left: 1px solid var(--border); }
.view-toggle button.on { background: var(--primary); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.tile.expired { opacity: .7; }
.thumb { aspect-ratio: 16 / 9; background: #0e1420; display: flex; align-items: center; justify-content: center; color: #8e99ad; overflow: hidden; position: relative; cursor: zoom-in; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .thumb-text { padding: .35rem; font-size: .72rem; line-height: 1.25; color: #e6eaf2; overflow: hidden; text-align: center; max-height: 100%; word-break: break-word; }
.thumb .thumb-type { position: absolute; top: .25rem; left: .25rem; opacity: .92; }
.thumb .badge { font-size: .68rem; padding: 0 .4rem; }
.tile-body { padding: .35rem .5rem; display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.tile-name { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { font-size: .75rem; color: var(--muted); display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
.tile-meta .badge { font-size: .68rem; padding: 0 .4rem; }
.tile-foot { padding: 0 .5rem .45rem; display: flex; gap: .3rem; }
.tile-foot .btn { padding: .15rem .45rem; font-size: .75rem; }

/* Listenansicht: eine Zeile pro Medium, kleine Vorschau links */
.grid.list { display: flex; flex-direction: column; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list .tile { flex-direction: row; align-items: center; gap: .75rem; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: .3rem .6rem .3rem .3rem; }
.list .tile:last-child { border-bottom: 0; }
.list .thumb { width: 84px; flex: none; border-radius: 4px; }
.list .tile-body { flex-direction: row; align-items: center; gap: .75rem; padding: 0; }
.list .tile-name { flex: 1; min-width: 0; font-size: .9rem; }
.list .tile-meta { flex: none; flex-wrap: nowrap; justify-content: flex-end; }
.list .tile-foot { padding: 0; flex: none; }

/* Playlist-Editor */
.editor-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1rem; align-items: start; }
.items { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 2rem 54px 1fr 90px auto; gap: .6rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.item:last-child { border-bottom: 0; }
.item .pos { color: var(--muted); text-align: right; }
.item input[type=number] { padding: .3rem .4rem; }
.mini { width: 54px; height: 32px; flex: none; background: #0e1420; border-radius: 4px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #8e99ad; font-size: .65rem; }
.mini img, .mini video { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: cover; display: block; }
.picker { max-height: 480px; overflow-y: auto; }
.pick > span { min-width: 0; overflow-wrap: anywhere; }
.pick { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); padding: .4rem .25rem; cursor: pointer; }
.pick:hover { background: #f4f7fb; }

/* Layout-Editor */
.preview { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0e1420; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.pz { position: absolute; border: 1px solid rgba(255,255,255,.55); font-size: .7rem; color: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; text-align: center; }
.pz-main { background: rgba(29,78,216,.7); }
.pz-ticker { background: rgba(178,106,0,.75); }
.pz-clock { background: rgba(46,125,50,.75); }
.zones-table input, .zones-table select { padding: .3rem .4rem; min-width: 0; }
.zones-table td { padding: .35rem .4rem; }
.zones-table input[type=number] { width: 4.6rem; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; width: 100%; max-width: 380px; box-shadow: 0 10px 30px rgba(16,24,40,.08); }
.login h1 { text-align: center; margin-bottom: 1.25rem; font-size: 1.35rem; }
.login img { display: block; max-height: 56px; max-width: 200px; margin: 0 auto 1rem; }
.login .btn { width: 100%; padding: .6rem; }

/* Mobil */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 250px; transform: translateX(-100%); transition: transform .15s; }
  .shell.nav-open .sidebar { transform: none; }
  .menu-toggle { display: inline-block; }
  .content { padding: 1rem; }
  .editor-cols { grid-template-columns: 1fr; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .item { grid-template-columns: 1.5rem 54px 1fr; }
  .item > :nth-child(n+4) { grid-column: 3; }
  .list .tile-meta { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

.center { text-align: center; }
.login .btn-link { width: auto; padding: 0; }

.preview-big { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; background: #0e1420; border-radius: 6px; }
.preview-text { white-space: pre-wrap; word-break: break-word; font-size: 1.1rem; }

.url-check { min-height: 1.4rem; margin: -.35rem 0 .75rem; font-size: .85rem; }

/* Folien-Editor */
.ed-page { display: flex; flex-direction: column; height: calc(100vh - 7.5rem); min-height: 520px; gap: .6rem; }
.ed-toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.ed-toolbar .ed-name { flex: 0 1 18rem; width: 18rem; min-width: 7rem; max-width: 100%; font-weight: 600; }
.ed-toolbar .ed-status { white-space: nowrap; }
.ed-tools { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.ed-tools .ed-shape-select { width: auto; padding: .25rem .4rem; font-size: .85rem; }
.ed-sep { width: 1px; height: 1.4rem; background: var(--border); margin: 0 .25rem; }
.ed-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.ed-status.dirty { color: var(--warn); font-weight: 600; }
.btn-small { padding: .25rem .55rem; font-size: .85rem; }
.btn.on, .pp-toggle.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.ed-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 214px 1fr 290px; gap: .6rem; }
.ed-sorter { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.ed-slides { flex: 1; overflow-y: auto; padding: .5rem; display: flex; flex-direction: column; gap: .5rem; }
.ed-sorter-add { display: flex; gap: .3rem; padding: .5rem; border-top: 1px solid var(--border); }
.ed-sorter-add select { min-width: 0; padding: .25rem .3rem; font-size: .8rem; }
.ed-slide { position: relative; display: grid; grid-template-columns: 1rem 1fr; gap: .25rem; align-items: start; padding: .3rem; border: 2px solid transparent; border-radius: 6px; cursor: pointer; }
.ed-slide.on { border-color: var(--primary); background: #eef3ff; }
.ed-slide.drop { border-color: var(--accent); }
.ed-num { font-size: .72rem; color: var(--muted); padding-top: .1rem; }
.ed-thumb { position: relative; overflow: hidden; background: #000; border: 1px solid var(--border); grid-column: 2; }
.ed-dur { grid-column: 2; font-size: .7rem; color: var(--muted); }
.ed-slide-actions { grid-column: 2; display: flex; gap: .2rem; }
.ed-slide-actions .btn { padding: .1rem .4rem; }

.ed-stage-wrap { min-width: 0; min-height: 0; display: flex; }
.ed-stage-host { position: relative; flex: 1; overflow: hidden; background: #2a3140; border-radius: var(--radius); outline: none; touch-action: none; user-select: none; }
.ed-stage-host:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.ed-canvas { box-shadow: 0 4px 20px rgba(0,0,0,.45); }
.ed-overlay { position: absolute; left: 0; top: 0; pointer-events: none; --inv: 1; }
.ed-sel, .ed-hover { position: absolute; box-sizing: border-box; pointer-events: none; }
.ed-sel { outline: calc(2px * var(--inv)) solid var(--accent); }
.ed-sel-multi { outline-style: dashed; }
.ed-hover { outline: calc(1px * var(--inv)) solid rgba(14,165,233,.7); }
.ed-group { position: absolute; box-sizing: border-box; outline: calc(1px * var(--inv)) dashed rgba(255,255,255,.7); pointer-events: none; }
.ed-h { position: absolute; width: calc(12px * var(--inv)); height: calc(12px * var(--inv)); margin: calc(-6px * var(--inv)) 0 0 calc(-6px * var(--inv)); background: #fff; border: calc(1.5px * var(--inv)) solid var(--accent); border-radius: 2px; pointer-events: auto; box-sizing: border-box; }
.ed-rot { left: 50%; top: calc(-30px * var(--inv)); border-radius: 50%; cursor: grab; }
.ed-rot-line { position: absolute; left: 50%; top: calc(-30px * var(--inv)); width: calc(1.5px * var(--inv)); height: calc(30px * var(--inv)); background: var(--accent); pointer-events: none; }
.ed-guide { position: absolute; background: #ff3d81; pointer-events: none; }
.ed-guide-x { top: 0; bottom: 0; width: calc(1px * var(--inv)); }
.ed-guide-y { left: 0; right: 0; height: calc(1px * var(--inv)); }
.ed-marquee { position: absolute; border: calc(1px * var(--inv)) solid var(--accent); background: rgba(14,165,233,.15); pointer-events: none; }
.ed-textedit { position: absolute; box-sizing: border-box; pointer-events: auto; outline: calc(2px * var(--inv)) solid var(--accent); overflow: hidden; }

.ed-props { overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .75rem; min-height: 0; }
.pp-sec { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.pp-sec:last-child { border-bottom: 0; }
.pp-sec h3 { margin: 0 0 .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pp-row { display: grid; grid-template-columns: 6.2rem 1fr; gap: .4rem; align-items: center; margin-bottom: .35rem; font-size: .85rem; }
.pp-row input, .pp-row select { padding: .25rem .4rem; font-size: .85rem; min-width: 0; }
.pp-row input[type=color] { padding: 0; height: 1.7rem; width: 100%; }
.pp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.pp-pair .pp-row { grid-template-columns: 1fr; gap: .1rem; }
.pp-pair .pp-label { font-size: .72rem; color: var(--muted); }
.pp-seg, .pp-inline { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; }
.pp-inline .pp-row { display: block; margin: 0; }
.pp-grid { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .4rem; }
.pp-total { margin: .25rem 0 0; }

.ed-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .5rem; margin-top: .5rem; max-height: 50vh; overflow-y: auto; }
.ed-pick { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: .3rem; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: .2rem; }
.ed-pick:hover, .ed-pick:focus-visible { border-color: var(--primary); }
.ed-pick .thumb { cursor: pointer; }

.ed-preview { position: fixed; inset: 0; z-index: 200; background: #000; cursor: pointer; }
.ed-preview-host { position: absolute; inset: 0; }
.ed-preview-label { position: absolute; left: 1rem; bottom: .75rem; color: #fff; background: rgba(0,0,0,.55); padding: .25rem .6rem; border-radius: 6px; font-size: .85rem; }

@media (max-width: 1100px) {
  .ed-body { grid-template-columns: 150px 1fr; grid-template-rows: 1fr auto; }
  .ed-props { grid-column: 1 / 3; max-height: 40vh; }
  .ed-slide { grid-template-columns: 1fr; }
  .ed-num { display: none; }
  .ed-thumb, .ed-dur, .ed-slide-actions { grid-column: 1; }
}

/* Import-Dialog */
.imp-tabs { display: flex; gap: .4rem; margin-bottom: .75rem; }
.imp-tabs .btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.imp-panel[hidden] { display: none !important; }
.imp-warnings { margin: .5rem 0 0; padding-left: 1.2rem; max-height: 50vh; overflow: auto; }
.imp-warnings li { margin-bottom: .3rem; }

/* Wochenübersicht und Zeitdialog */
.scr-week { margin: .5rem 0 .4rem; }
.scr-axis { position: relative; height: 1rem; margin-left: 2rem; font-size: .7rem; color: var(--muted); }
.scr-axis span { position: absolute; transform: translateX(-50%); }
.scr-row { display: flex; align-items: center; gap: .4rem; margin-bottom: 3px; }
.scr-row.today .scr-day { font-weight: 700; color: var(--primary); }
.scr-day { width: 1.6rem; font-size: .75rem; color: var(--muted); }
.scr-bar { position: relative; flex: 1; display: flex; height: 16px; background: #fff; border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
.scr-seg { display: block; height: 100%; }
.scr-seg.gap, .scr-legend i.gap { background: repeating-linear-gradient(45deg, #e5e7eb 0 4px, #f3f4f6 4px 8px); }
.scr-now { position: absolute; top: -1px; bottom: -1px; width: 2px; background: #111827; }
.scr-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; margin: .4rem 0 .6rem; }
.scr-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.scr-legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; }
.scr-modes { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.scr-modes .check { margin-bottom: .4rem; }
.scr-presets { display: flex; gap: .4rem; margin-bottom: .5rem; }
.scr-timed[hidden] { display: none; }

/* Alarm */
.alarm-slot { display: inline-flex; }
.alarm-controls { display: inline-flex; gap: .35rem; margin-right: .5rem; }
.alarm-controls .btn.pulse { animation: sd-pulse 1s infinite; }
@keyframes sd-pulse { 50% { filter: brightness(1.45); } }
.alarm-dialog h3 { margin: 0 0 .25rem; font-size: 1rem; }
.alarm-section { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.alarm-section:last-of-type { border-bottom: 0; }
.alarm-live { border-radius: 8px; padding: 1rem; text-align: center; color: #fff; }
.alarm-live.is-alarm { background: #c4161c; }
.alarm-live.is-test { background: #f4b942; color: #1b1b1b; }
.alarm-live-title { font-size: 1.6rem; font-weight: 700; }
.alarm-live-text { margin: .35rem 0; }
.alarm-count { margin: 1rem 0; }
.alarm-count .bar { margin-top: .4rem; height: .6rem; background: #e8ecf2; border-radius: 99px; overflow: hidden; }
.alarm-count .bar-fill { height: 100%; background: var(--ok); transition: width .4s; }
.alarm-actions { display: flex; justify-content: center; }

/* Präsentationen */
.pres-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pres-title { font-size: 1.25rem; font-weight: 600; border: 1px solid transparent; background: transparent; padding: .25rem .5rem; border-radius: 6px; min-width: 14rem; }
.pres-title:hover, .pres-title:focus { border-color: var(--border); background: var(--surface); }
.error-text { color: var(--danger); }
.pres-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.pres-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem; display: flex; flex-direction: column; gap: .5rem; }
.pres-open { color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: .25rem; }
.pres-open:hover .pres-name { text-decoration: underline; }
.pres-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pres-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; background: #0e1420; border-radius: 6px; padding: 3px; aspect-ratio: 16 / 5; overflow: hidden; }
.pres-strip .mini { width: 100%; height: 100%; background: #1b2436; border-radius: 3px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #8e99ad; font-size: .65rem; }
.pres-strip .mini img, .pres-strip .mini video { width: 100%; height: 100%; object-fit: cover; }
.pres-strip-empty { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; color: #8e99ad; font-size: .85rem; }
.pres-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.pres-empty { border: 2px dashed var(--border); border-radius: 8px; padding: 1.5rem; text-align: center; color: var(--muted); }
.pres-list .item[draggable=true] { cursor: grab; }
.pres-list .item.drop-before { box-shadow: 0 -3px 0 0 var(--primary); }
.pres-list .item.drop-after { box-shadow: 0 3px 0 0 var(--primary); }
.pres-list .pos { white-space: nowrap; }
.pick[draggable=true] { cursor: grab; }
.drop-hint { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(21,83,168,.18); border: 4px dashed var(--primary); font-size: 1.4rem; font-weight: 600; color: var(--primary); pointer-events: none; }
.drop-hint[hidden] { display: none; }

/* Displays zuordnen */
.assign-cols { display: grid; grid-template-columns: 250px 1fr; gap: 1.25rem; align-items: start; }
.pal { position: sticky; top: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.pal h2 { margin: 0 0 .25rem; font-size: 1rem; }
.pal-list { display: flex; flex-direction: column; gap: .4rem; margin-top: .5rem; }
.pal-card { display: grid; grid-template-columns: 54px 1fr auto; gap: .5rem; align-items: center; padding: .35rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: grab; }
.pal-card:hover { border-color: var(--primary); }
.pal-name { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-meta { min-width: 0; }
.tgt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; align-items: start; }
.tgt-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem; display: flex; flex-direction: column; gap: .5rem; }
.tgt-tile.drop-over, .rank-area.drop-over { outline: 3px dashed var(--primary); outline-offset: 2px; background: #f0f6ff; }
.tgt-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tgt-head h2 { margin: 0; font-size: 1.1rem; }
.tgt-devs { display: flex; flex-direction: column; gap: .6rem; margin-top: .25rem; }
.dev-chip { border: 1px solid var(--border); border-radius: 8px; padding: .55rem .65rem; background: #fbfcfe; display: flex; flex-direction: column; gap: .4rem; }
.dev-chip[draggable=true] { cursor: grab; }
.dev-head { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.dev-head.clickable { cursor: pointer; }
.dev-toggle { border: 0; background: none; padding: 0 .2rem; font-size: 1rem; line-height: 1; color: var(--muted); cursor: pointer; }
.dev-playing { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 14rem; }
.dev-body { display: flex; flex-direction: column; gap: .4rem; }
.dev-chip.in-group:not(.open) { padding-top: .4rem; padding-bottom: .4rem; }
.dev-chip.overriding { border-left: 4px solid var(--warn); }
.tgt-sub { margin-top: .25rem; }
.dev-foot { display: flex; gap: .35rem; flex-wrap: wrap; }
.now-line { color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; font-size: .85rem; margin: .5rem 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
@media (max-width: 900px) {
  .assign-cols { grid-template-columns: 1fr; }
  .pal { position: static; max-height: none; }
  .pal-list { flex-direction: row; overflow-x: auto; }
  .pal-card { min-width: 220px; }
}

/* Reihung der Einträge je Gruppe und Display */
.now-line { color: var(--muted); }
.entries { display: flex; flex-direction: column; gap: .45rem; }
.zone-tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.zone-tab { border: 1px solid var(--border); background: #fff; border-radius: 99px; padding: .15rem .7rem; font-size: .82rem; cursor: pointer; }
.zone-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.zone-tab.warn { border-color: var(--warn); color: var(--warn); }
.zone-tab.warn.active { background: var(--warn); color: #fff; }
.rank-area { border: 1px dashed var(--border); border-radius: 8px; padding: .3rem; background: #fff; min-height: 2.4rem; }
.rank-area:not(.empty) { border-style: solid; }
.rank-empty { color: var(--muted); font-size: .9rem; text-align: center; padding: .6rem .4rem; }
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.rank-row { display: grid; grid-template-columns: 1rem 54px minmax(0, 1fr) auto; gap: .5rem; align-items: center; padding: .3rem .35rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.rank-row[draggable=true] { cursor: grab; }
.rank-row.inherited { background: #f1f4f8; color: var(--muted); border-style: dashed; }
.rank-row.off, .rank-row.expired { opacity: .6; }
.rank-row.winner { border-color: var(--ok); box-shadow: inset 3px 0 0 var(--ok); }
.rank-row.drop-before { box-shadow: 0 -3px 0 0 var(--primary); }
.rank-row.drop-after { box-shadow: 0 3px 0 0 var(--primary); }
.rank-row .grip { color: var(--muted); user-select: none; text-align: center; }
.row-main { min-width: 0; }
.row-pl { width: 100%; max-width: 100%; font-weight: 600; padding: .1rem .2rem; border: 1px solid transparent; background: transparent; border-radius: 4px; }
.row-pl:hover, .row-pl:focus { border-color: var(--border); background: #fff; }
.row-pl-name { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-when { font-size: .82rem; color: var(--muted); display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
.row-when .btn-link { font-size: .82rem; text-align: left; }
.rank-row .row-actions { display: flex; gap: .2rem; }
.add-select { flex: 1; min-width: 9rem; }
.scr-period { display: flex; flex-direction: column; gap: .4rem; margin-top: .4rem; }
.scr-period[hidden], .scr-timed[hidden] { display: none; }

/* Lizenz und Anbieter */
.banner-slot:empty { display: none; }
.banner { margin: 0; border-radius: 0; display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: .55rem 1.5rem; }
.banner a { font-weight: 600; white-space: nowrap; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.25rem; margin: 0 0 .75rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.quote { min-height: 2.8rem; margin: .5rem 0 .75rem; }
.inline-form { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; }
.filters { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .75rem; }
.filters select, .filters input { width: auto; min-width: 9rem; }
textarea.codes { width: 100%; min-height: 11rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.data-block { margin-top: 1.25rem; padding-top: .75rem; border-top: 1px solid var(--border, #d8dbe2); }
.terms-list { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .4rem; }
.terms-accept { display: grid; gap: .5rem; margin-top: .75rem; justify-items: start; }

/* Hilfe-Seitenleiste */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.help-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 150; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -8px 0 24px rgba(0, 0, 0, .12); display: flex; flex-direction: column; }
.help-head { display: flex; align-items: center; justify-content: space-between; padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.help-tools { padding: .7rem 1rem; border-bottom: 1px solid var(--border); max-height: 38vh; overflow-y: auto; }
.help-search { width: 100%; margin-bottom: .5rem; }
.help-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.help-topic { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .2rem .7rem; font: inherit; font-size: .82rem; cursor: pointer; color: inherit; }
.help-topic:hover, .help-topic:focus-visible { border-color: var(--primary); }
.help-topic.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.help-body { flex: 1; overflow-y: auto; padding: .5rem 1rem 2rem; font-size: .92rem; line-height: 1.5; outline: none; }
.help-body h3 { margin: .6rem 0 .4rem; font-size: 1.1rem; }
.help-body h4 { margin: 1.1rem 0 .3rem; font-size: .95rem; }
.help-body p, .help-body ul, .help-body ol { margin: .4rem 0; }
.help-body ul, .help-body ol { padding-left: 1.2rem; }
.help-body li { margin: .25rem 0; }
.help-tip { background: #e1effd; color: #123f7a; border-radius: 6px; padding: .5rem .7rem; }
.help-check { display: flex; flex-direction: column; gap: .4rem; margin: .6rem 0; }
.help-step { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: inherit; }
.help-step:hover, .help-step:focus-visible { border-color: var(--primary); }
.help-step .help-hint { display: block; }
.help-mark { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #e8ecf2; color: #3b4658; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .85rem; }
.help-step.done .help-mark { background: var(--ok); color: #fff; }
.help-keys { display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; margin: .4rem 0; }
.help-keys dt, .help-keys dd { margin: 0; }
.help-keys kbd { font: inherit; font-size: .8rem; background: #eef1f6; border: 1px solid var(--border); border-radius: 4px; padding: 0 .35rem; white-space: nowrap; }
@media (max-width: 600px) { .help-drawer { width: 100vw; } }

/* Zwei-Faktor-Anmeldung */
.mfa-qr-wrap { display: flex; justify-content: center; margin: .5rem 0 1rem; }
.mfa-qr { border: 1px solid var(--border); border-radius: 8px; max-width: 100%; height: auto; }
.mfa-secret { background: #f1f4f8; border-radius: 6px; padding: .5rem .7rem; letter-spacing: .08em; word-break: break-all; user-select: all; }
.mfa-manual { margin-bottom: 1rem; }
.mfa-manual summary { cursor: pointer; color: var(--primary); }
.mfa-code-input { font-size: 1.4rem; letter-spacing: .3em; text-align: center; }
.mfa-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem .75rem; background: #f1f4f8; border-radius: 8px; padding: .8rem 1rem; margin: .75rem 0; font-size: 1rem; }
.mfa-forced { max-width: 460px; }
.mfa-forced .btn { width: auto; }
.mfa-flow .row-actions, .mfa-dialog .row-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.mfa-policy { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: space-between; }
.login-alt { text-align: center; margin: .75rem 0 0; }
.mfa-check { margin: 0; }

/* Firmendaten und Angebote */
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.row4 { display: grid; grid-template-columns: 1fr 1fr 1.4fr 1fr; gap: .75rem; }
@media (max-width: 720px) { .row3, .row4 { grid-template-columns: 1fr; } }
.logo-preview { background: repeating-conic-gradient(#f1f4f8 0 25%, #fff 0 50%) 0 0 / 16px 16px; border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; text-align: center; }
.logo-preview img { max-width: 100%; max-height: 120px; }
.color-input { width: 4rem; height: 2.4rem; padding: .15rem; }
.company-form .card h2, .quote-form .card h2 { margin-top: 0; }
.quote-item-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.quote-line-sum { font-weight: 600; margin-right: .5rem; }
.quote-items input[data-bad="1"] { border-color: var(--danger); }
.quote-totals > div { display: flex; justify-content: space-between; max-width: 28rem; margin-left: auto; font-size: 1.05rem; padding: .6rem 0; border-top: 2px solid var(--border); }
.quote-actions { margin: 1rem 0 2rem; }
.quote-head h2 { margin-bottom: .2rem; }
.toolbar { margin-bottom: 1rem; }
.toolbar input[type=search] { max-width: 22rem; }
.toolbar .spacer { flex: 1; }

/* Anfragen von der Startseite */
.tab-count { display: inline-block; margin-left: .4rem; min-width: 1.3rem; padding: 0 .4rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.3rem; text-align: center; }
.inquiry-details { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0 0 1rem; }
.inquiry-details dt { color: var(--muted); }
.inquiry-details dd { margin: 0; }
.inquiry-message { white-space: pre-wrap; overflow-wrap: anywhere; margin: .25rem 0 1rem; }
.row-new td { font-weight: 600; }
.quote-discount { display: grid; grid-template-columns: 1fr; gap: .35rem; }
