:root {
  --bg: #f6f5f2; --panel: #ffffff; --ink: #1d1d1b; --muted: #6b6a66; --line: #e4e2dc;
  --accent: #b4234a; --accent-ink: #fff; --ok: #2f7d4f; --warn: #b26b00; --err: #b4232a;
  --radius: 10px; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; }
header { display: flex; align-items: center; gap: 24px; padding: 14px 28px; background: var(--ink); color: #fff; }
header .brand { font-weight: 700; letter-spacing: .08em; text-decoration: none; }
header nav { display: flex; gap: 18px; flex-wrap: wrap; flex: 1; }
header nav a { text-decoration: none; opacity: .75; font-size: 14px; }
header nav a:hover, header nav a.active { opacity: 1; }
header form { margin: 0; }
header button { background: none; border: 1px solid #ffffff55; color: #fff; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
main { max-width: 1100px; margin: 0 auto; padding: 28px; }
h1 { font-size: 26px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.lead { color: var(--muted); margin: 0 0 24px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
a.card { text-decoration: none; display: block; transition: border-color .15s; }
a.card:hover { border-color: var(--ink); }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.meta { margin-top: 12px; font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.two { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 800px) { .two { grid-template-columns: 1fr; } header { flex-wrap: wrap; } }
.stack > * + * { margin-top: 16px; }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.help { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=text], input[type=number], input[type=password], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
textarea { min-height: 80px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.field + .field { margin-top: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
button.btn, .btn { border: 0; border-radius: 8px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--ink); color: #fff; }
.btn.secondary { background: #ecebe6; color: var(--ink); }
.btn.danger { background: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #ecebe6; }
.pill.ok { background: #e3f1e8; color: var(--ok); }
.pill.fehler, .pill.err { background: #f8e2e2; color: var(--err); }
.pill.running, .pill.warn { background: #fbefd9; color: var(--warn); }
.alert { padding: 12px 14px; border-radius: 8px; background: #f8e2e2; color: var(--err); margin-bottom: 16px; }
.alert.info { background: #ecebe6; color: var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
pre.log { background: #151514; color: #e9e7e1; padding: 16px; border-radius: var(--radius); font: 12.5px/1.5 var(--mono);
  max-height: 70vh; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.files { font: 12.5px/1.6 var(--mono); color: var(--muted); max-height: 180px; overflow: auto; margin: 8px 0 0; padding: 0; list-style: none; }
.path { font: 12px var(--mono); color: var(--muted); word-break: break-all; }
.preview img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; }
.login { max-width: 360px; margin: 12vh auto; }

/* Produktion */
.namebar { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin: -10px 0 14px; font-size: 14px; }
.namebar .btn { padding: 4px 12px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.vcard { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.vcard img, .vcard video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; background: #000; }
.vcard img.dim { opacity: .45; }
.vcard textarea { font-size: 12px; }
.vcard form.inline { display: inline-block; margin: 0 6px 0 0; }
.vcard details summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.help.err { color: var(--err); }
.brandlist { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.warnt { color: var(--warn); font-weight: 600; }
#profiles .card { margin-top: 10px; }
.cats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; margin-top: 4px; }
.cats .dim { opacity: .45; }
.bulkbar { position: sticky; top: 8px; z-index: 5; margin-bottom: 14px; }
.bulkrow { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.vcard .pick { font-size: 13px; }
.customtext { margin-top: 8px; }
.customtext summary { cursor: pointer; font-size: 14px; }
.nowrap { white-space: nowrap; }

/* Performance */
.perfbar { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.perfbar form { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.tile .k { color: var(--muted); font-size: 13px; }
.tile .v { font-size: 24px; font-weight: 700; margin-top: 2px; }
.scroll { overflow-x: auto; padding: 6px; }
table.perf td, table.perf th { padding: 7px 8px; }
tr.dim td, .dim { opacity: .55; }
td.up { color: var(--ok); font-weight: 600; }
td.down { color: var(--err); font-weight: 600; }
.sig { font-size: 12.5px; min-width: 200px; }
.s-red { color: var(--err); }
.s-yellow { color: var(--warn); }
.s-green { color: var(--ok); }
.s-info { color: var(--muted); }
.est { color: var(--warn); font-weight: 700; margin-right: 2px; }
.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 26px; }
.spark i { display: block; width: 5px; min-height: 1px; background: var(--ink); opacity: .7; border-radius: 1px; }
.linkcard { margin-bottom: 12px; }
.linkcard summary { cursor: pointer; }
form.inline { display: inline-block; margin: 0 4px 0 0; }
.btn.small { padding: 4px 10px; font-size: 13px; }
form.assign { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.assign input[type=text] { width: 200px; }
input[type=date] { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
tr.assignrow td { background: #faf9f6; }
.subnav { display: flex; gap: 10px; margin: -6px 0 18px; flex-wrap: wrap; }
details.resolve { margin-top: 6px; }
details.resolve summary { display: inline-block; list-style: none; cursor: pointer; }
details.resolve summary::-webkit-details-marker { display: none; }
details.resolve form { margin-top: 8px; }
select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
form.assign select { width: auto; max-width: 220px; }
div.up { color: var(--ok); font-weight: 600; font-size: 12.5px; }
div.down { color: var(--err); font-weight: 600; font-size: 12.5px; }

/* Research */
main.wide { max-width: 1700px; padding: 20px 24px; }
.rlayout { display: grid; grid-template-columns: 210px 1fr; gap: 22px; align-items: start; }
@media (max-width: 800px) { .rlayout { grid-template-columns: 1fr; } .rside { position: static; } }
.rside { position: sticky; top: 12px; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 12px 8px;
  max-height: calc(100vh - 24px); overflow: auto; }
.rside a { display: flex; justify-content: space-between; gap: 6px; padding: 6px 10px; border-radius: 7px;
  text-decoration: none; font-size: 14px; opacity: .8; }
.rside a:hover { opacity: 1; background: #ffffff14; }
.rside a.active { opacity: 1; background: #ffffff26; font-weight: 600; }
.rside .n { opacity: .65; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rside-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .5; padding: 12px 10px 4px; }
.rside-title:first-child { padding-top: 2px; }
.rtop { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.rfilter { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.rfilter select, .rfilter input[type=text] { width: auto; padding: 6px 10px; font-size: 14px; }
.rfilter input[type=text] { min-width: 220px; }
.rstatus { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
details.dropdown { position: relative; }
details.dropdown summary, details.more summary { list-style: none; cursor: pointer; }
details.dropdown summary::-webkit-details-marker, details.more summary::-webkit-details-marker { display: none; }
.dropdown-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 420px; max-width: 90vw;
  box-shadow: 0 10px 30px #0002; display: flex; flex-direction: column; gap: 10px; }
.explain table td { font-size: 13px; padding: 6px; }
.formula { font: 12px var(--mono); background: #f2f1ec; padding: 8px 10px; border-radius: 6px; overflow-x: auto; margin: 0; }
.rcount { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; }
.rcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: visible;
  display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s; }
.rcard:hover { border-color: #c9c6be; box-shadow: 0 4px 14px #0000000f; }
.rcard .media { position: relative; aspect-ratio: 9 / 16; background: #1d1d1b; border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden; }
.rcard .media[data-video] { cursor: pointer; }
.rcard .media img, .rcard .media video, .rcard .nocover { width: 100%; height: 100%; object-fit: cover; display: block; }
.rcard .media span { position: absolute; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 8px; }
.rcard .rank { top: 7px; left: 7px; background: var(--ink); color: #fff; }
.rcard .dur { bottom: 7px; right: 7px; background: #000a; color: #fff; font-weight: 600; }
.rcard .play { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; padding: 0 !important;
  display: grid; place-items: center; background: #0008; color: #fff; font-size: 17px; opacity: 0; transition: opacity .15s; }
.rcard .media:hover .play { opacity: 1; }
.rcard .novideo { bottom: 7px; left: 7px; background: #fbefd9; color: var(--warn); font-weight: 600; }
.rcard .state { top: 7px; right: 7px; background: #fff; color: var(--ink); }
.rcard .state.s-used { background: #e3f1e8; color: var(--ok); }
.rcard .state.s-reserved { background: #fbefd9; color: var(--warn); }
.rcard .body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 5px; }
.rcard .title { display: flex; justify-content: space-between; gap: 6px; font-size: 13.5px; font-weight: 600; min-width: 0; }
.rcard .title a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcard .title a:hover { text-decoration: underline; }
.rcard .title span { color: var(--muted); font-weight: 400; font-size: 12px; white-space: nowrap; }
.rcard .stats { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.rcard .stats b { color: var(--ink); }
.rcard .tags { display: flex; flex-wrap: wrap; gap: 4px; min-height: 20px; }
.rcard .tags span { font-size: 11.5px; background: #ecebe6; border-radius: 5px; padding: 1px 7px; }
.rcard .tags .res { background: #e8eef8; color: #2a4f8a; }
.rcard .acts { display: flex; gap: 5px; align-items: center; margin-top: 2px; }
.rcard .acts .grow { flex: 1; text-align: center; }
.btn.icon { padding: 4px 9px; }
details.more { position: relative; }
details.more .menu { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 20; width: 240px; padding: 8px;
  box-shadow: 0 10px 30px #0002; display: flex; flex-direction: column; gap: 4px; }
details.more .menu form { margin: 0; }
details.more .menu button { width: 100%; text-align: left; background: none; border: 0; padding: 7px 8px; border-radius: 6px;
  font: inherit; font-size: 13.5px; cursor: pointer; }
details.more .menu button:hover { background: #f2f1ec; }
details.more .menu .cap { max-height: 7em; overflow: auto; margin: 4px 8px; }
details.more .menu .help { margin: 2px 8px; }
.research-src video { max-width: 240px; aspect-ratio: 9 / 16; border-radius: 8px; background: #111; display: block; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 18px; }
.rside a.suggest { margin-top: 6px; background: #ffffff12; }
.sbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.scard { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 16px; margin-bottom: 12px; padding: 14px; }
.scard.weak { opacity: .8; }
@media (max-width: 900px) { .scard { grid-template-columns: 1fr; } }
.shead { display: flex; gap: 8px; align-items: center; font-size: 16px; }
.shead a { text-decoration: none; }
.sstats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); margin: 8px 0 4px; }
.sstats b { color: var(--ink); }
.reasons { list-style: none; padding: 0; margin: 4px 0 10px; font-size: 13px; }
.reasons li { color: var(--ok); }
.reasons li.bad { color: var(--err); }
.sact .cats { margin-bottom: 8px; }
.sact .row { display: flex; gap: 6px; }
.sstrip { display: grid; grid-template-columns: repeat(6, minmax(70px, 1fr)); gap: 8px; align-content: start; }
.sthumb { position: relative; aspect-ratio: 9 / 16; background: #1d1d1b; border-radius: 8px; overflow: hidden; display: block; }
.sthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sthumb span { position: absolute; font-size: 11px; font-weight: 700; color: #fff; background: #000a; border-radius: 999px; padding: 1px 6px; }
.sthumb .v { left: 5px; bottom: 5px; }
.sthumb .d { right: 5px; top: 5px; }
