/* Anwendung des Cowork-Servers (/app): Fensterrahmen und allgemeine Bausteine im dunklen Farbschema der DAW (theme.rs: Grund #1b1d21,
   Fläche #26292e, Akzent #3b8eea) – Song-Reiter, Menüleiste, Arbeitsfläche, Statuszeile. Die Song-Ansicht selbst steht in daw.css.
   Grenzen: nur das dunkle Thema; Schrift Open Sans statt Noto Sans der DAW (schon eingebettet, kein zweiter Schriftsatz); keine fremden
   Quellen; unter 760px Breite wandert die Menüleiste als Leiste an den unteren Rand. */
@font-face { font-family: "Open Sans"; src: url("/fonts/opensans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  color-scheme: dark;
  --ground: #1b1d21; --soft: #26292e; --raised: #303642; --lane-a: #202226; --lane-b: #23252a; --line: #35383f; --line-strong: #4a4f59;
  --ink: #d5d9e0; --ink-soft: #9299a4; --bright: #f2f4f7; --on-accent: #0b1017;
  --accent: #3b8eea; --accent-hi: #63a6f0; --danger: #e05a4a; --solo: #e8b03a; --ok: #4cc26a;
  --ok-bg: #1d3a28; --ok-ink: #93dba9; --wait-bg: #3d3216; --wait-ink: #ecc76c; --bad-bg: #45211d; --bad-ink: #f3a196; --info-bg: #1c3350; --info-ink: #93c3f6;
  --r: 6px; --pad: 16px; --page: 24px;
  --text: "Open Sans", "Noto Sans", system-ui, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { scrollbar-color: var(--line-strong) transparent; height: 100%; }
body { margin: 0; min-height: 100%; background: var(--ground); color: var(--ink); font: 400 14px/1.5 var(--text); -webkit-font-smoothing: antialiased; }
body.signed-in { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100vh; height: 100dvh; overflow: hidden; }
::selection { background: var(--accent); color: var(--on-accent); }
h1, h2, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--accent-hi); text-underline-offset: 3px; }
a:hover { color: var(--bright); }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }
code { font: 13px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
.ic { width: 18px; height: 18px; flex: none; }

.skip { position: absolute; left: 8px; top: -60px; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: var(--r); z-index: 30; }
.skip:focus { top: 8px; color: var(--on-accent); }
.mark { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.mark img { display: block; height: 20px; width: auto; }
.mark .badge { height: 30px; }
.mark.big { flex-direction: column; gap: 14px; }
.mark.big img { height: 40px; }
.mark.big .badge { height: 112px; }

/* Fensterrahmen: Song-Reiter, Menüleiste */
.frame { background: var(--soft); border-bottom: 1px solid #111316; min-width: 0; }
.songtabs { display: flex; align-items: stretch; gap: 2px; height: 32px; padding: 4px 8px 0; background: var(--ground); overflow-x: auto; scrollbar-width: none; }
.songtab { display: inline-flex; align-items: center; flex: none; max-width: 240px; border-radius: 5px 5px 0 0; color: var(--ink-soft); font-size: 13px; }
.songtab a { color: inherit; text-decoration: none; padding: 0 4px 0 12px; height: 100%; display: inline-flex; align-items: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.songtab button { width: 24px; height: 24px; margin-right: 2px; border: 0; border-radius: 4px; background: none; color: inherit; display: grid; place-items: center; cursor: pointer; flex: none; }
.songtab button .ic { width: 12px; height: 12px; }
.songtab button:hover { background: var(--raised); color: var(--bright); }
.songtab:hover { color: var(--ink); background: var(--lane-b); }
.songtab.on { background: var(--soft); color: var(--bright); font-weight: 600; }
a.songtab.add { gap: 4px; padding: 0 10px; text-decoration: none; }
a.songtab.add .ic { width: 14px; height: 14px; }
.menubar { display: flex; align-items: center; gap: 16px; height: 38px; padding: 0 12px 0 6px; }
.menu { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.menu a { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 4px; color: var(--ink); text-decoration: none; white-space: nowrap; transition: background-color .12s var(--ease); }
.menu a:hover { background: var(--raised); color: var(--bright); }
.menu a.on { background: var(--raised); color: var(--bright); box-shadow: inset 0 -2px 0 var(--accent); }
.menu a .ic { width: 16px; height: 16px; color: var(--ink-soft); }
.menu a span { max-width: 20ch; overflow: hidden; text-overflow: ellipsis; }
.menu-gap { flex: 1; }
.tabs { display: none; }
.status { display: flex; justify-content: space-between; gap: 24px; height: 24px; align-items: center; padding: 0 12px; background: var(--soft); border-top: 1px solid #111316; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.status span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

main > * { min-width: 0; width: min(100%, 1120px); margin-inline: auto; }
main { padding: 24px var(--page) 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; outline: 0; overflow: auto; min-height: 0; }
main.fill { padding: 0; overflow: hidden; display: block; }
main.fill > * { width: auto; margin: 0; }
main[aria-busy="true"] { opacity: .55; transition: opacity .2s .15s; }
.loading { color: var(--ink-soft); padding: 48px 0; }
.noscript { max-width: 60ch; margin: 48px auto; padding: 0 var(--page); }

/* Kopf einer Ansicht */
.head { display: grid; gap: 4px; }
.head h1 { font: 600 22px/1.2 var(--text); color: var(--bright); overflow-wrap: anywhere; min-width: 0; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 2px; margin-left: -4px; color: var(--ink-soft); font-weight: 600; font-size: 13px; text-decoration: none; justify-self: start; min-height: 28px; }
.back:hover { color: var(--bright); }
.sub { color: var(--ink-soft); max-width: 70ch; }
.sub.meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.acts.start { justify-content: flex-start; }

/* Knöpfe und Felder */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--raised); color: var(--ink); font: 600 13px/1 var(--text); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease); }
.btn:hover { background: #3a4150; border-color: var(--ink-soft); color: var(--bright); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); color: var(--on-accent); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.btn.danger:hover { background: #ea7466; border-color: #ea7466; color: var(--on-accent); }
.btn.danger-quiet { color: var(--bad-ink); }
.btn.danger-quiet:hover { border-color: var(--danger); background: var(--bad-bg); color: var(--bad-ink); }
.btn.icon { width: 34px; padding: 0; color: var(--ink-soft); }
.btn.small { min-height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.icon.small { width: 28px; padding: 0; }
.btn.small .ic { width: 16px; height: 16px; }
.btn.wide { width: 100%; min-height: 40px; font-size: 14px; }
button:disabled, .btn[aria-busy] { opacity: .55; cursor: default; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=file], select, textarea {
  width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--ground); color: var(--ink); font: 400 14px/1.4 var(--text);
}
textarea { resize: vertical; min-height: 72px; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-soft); }
input::placeholder, textarea::placeholder { color: #858c97; }
input[type=file] { padding: 7px 8px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; margin: 0; }
input[type=range] { accent-color: var(--accent); min-width: 0; height: 28px; margin: 0; }
select { appearance: auto; }
form { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; min-width: 0; }
.lab { font-weight: 600; font-size: 13px; }
.hint { color: var(--ink-soft); font-size: 13px; }
.hint:empty { display: none; }
.hint.warn { color: var(--bad-ink); }
.check { display: flex; align-items: center; gap: 10px; min-height: 34px; cursor: pointer; }
form.inline { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
form.inline:has(label) { align-items: end; }
.item .meter { margin-top: 8px; max-width: 420px; }
.grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-form .span { grid-column: 1 / -1; }

/* Flächen und Listen */
.panel { background: var(--soft); border: 1px solid var(--line); border-radius: var(--r); padding: var(--pad); display: grid; gap: 14px; align-content: start; min-width: 0; }
.panel > h2 { font: 700 12px/1.3 var(--text); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.split.wide-left { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.split.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.side { display: grid; gap: 20px; min-width: 0; }

.rows { background: var(--soft); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.rows.flat { background: none; border: 0; border-radius: 0; margin: -6px 0; }
.rows > li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 16px; padding: 9px var(--pad); min-height: 52px; color: var(--ink); text-decoration: none; }
.rows.flat .row { padding: 8px 0; min-height: 46px; }
a.row { transition: background-color .15s var(--ease); }
a.row:hover { background: var(--raised); color: var(--bright); }
.rows.flat a.row:hover { background: none; }
.rows.flat a.row:hover .row-t { color: var(--accent-hi); }
.row-main { display: grid; gap: 1px; flex: 1; min-width: 0; }
.row-t { font-weight: 600; color: var(--bright); overflow-wrap: anywhere; }
.row-s { color: var(--ink-soft); font-size: 13px; overflow-wrap: anywhere; }
.row-n { color: var(--ink-soft); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
a.row.only-phone { display: none; }

.items { background: var(--soft); border: 1px solid var(--line); border-radius: var(--r); }
.item { display: flex; gap: 16px; padding: 14px var(--pad); align-items: flex-start; justify-content: space-between; }
.item + .item { border-top: 1px solid var(--line); }
.item.off .item-main { opacity: .6; }
.item-main { display: grid; gap: 3px; min-width: 0; flex: 1; }
.item-d { max-width: 70ch; overflow-wrap: anywhere; white-space: pre-line; }
.item-side { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pills { display: flex; gap: 6px; }
.ver { font-weight: 400; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.sha { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }

.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px; background: var(--raised); color: var(--ink-soft); font-size: 12.5px; font-weight: 600; white-space: nowrap; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill.wait { background: var(--wait-bg); color: var(--wait-ink); }
.pill.bad { background: var(--bad-bg); color: var(--bad-ink); }
.pill.info { background: var(--info-bg); color: var(--info-ink); }

.empty { border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 28px var(--pad); display: grid; gap: 8px; justify-items: start; color: var(--ink-soft); }
.empty p { max-width: 60ch; }
.empty-t { color: var(--bright); font-weight: 600; }
.empty.error { border-style: solid; border-color: var(--bad-bg); background: var(--bad-bg); }
.empty.error .empty-t { color: var(--bad-ink); }
.panel .empty { border: 0; padding: 4px 0; }

.filter { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.seg { display: flex; gap: 2px; padding: 3px; background: var(--soft); border-radius: var(--r); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg a { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 4px; color: var(--ink-soft); font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
.seg a:hover { color: var(--bright); }
.seg a.on { background: var(--raised); color: var(--bright); box-shadow: inset 0 -2px 0 var(--accent); }

.kvs { display: grid; gap: 0; }
.kv { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 9px 0; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv dt { color: var(--ink-soft); }
.kv dd { font-weight: 600; color: var(--bright); overflow-wrap: anywhere; }

.figure { font-size: 20px; font-weight: 700; color: var(--bright); font-variant-numeric: tabular-nums; }
.unit { font-size: 14px; font-weight: 400; color: var(--ink-soft); }
.meter { height: 8px; border-radius: 2px; background: var(--ground); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 2px; min-width: 4px; }
.meter.full i { background: var(--danger); }
.meter.zero i { display: none; }

/* Anmelden */
.auth { width: 100%; display: grid; gap: 24px; justify-items: center; align-content: center; min-height: calc(100vh - 160px); min-height: calc(100dvh - 160px); }
.auth-card { width: min(100%, 380px); background: var(--soft); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; display: grid; gap: 20px; }
.auth-card h1 { font: 600 18px/1.2 var(--text); color: var(--bright); }
.auth-foot { color: var(--ink-soft); font-size: 14px; text-align: center; }

.quote { padding: 8px 12px; background: var(--ground); border-radius: var(--r); max-width: 70ch; overflow-wrap: anywhere; white-space: pre-line; }

/* Rückfrage und Meldung */
.dlg { width: min(440px, calc(100vw - 32px)); border: 1px solid var(--line-strong); border-radius: 8px; padding: 20px; background: var(--soft); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.dlg::backdrop { background: rgba(8, 9, 11, .6); }
.dlg h2 { font: 600 16px/1.3 var(--text); color: var(--bright); overflow-wrap: anywhere; }
.dlg form { gap: 14px; }
.dlg .acts { margin-top: 6px; }
.dlg[open] { animation: rise .18s var(--ease); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 40; max-width: min(520px, calc(100vw - 32px)); padding: 10px 16px; border-radius: var(--r); background: var(--bright); color: var(--on-accent); font-weight: 600; font-size: 13px; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .18s var(--ease), transform .18s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.error { background: var(--danger); }
.toast { bottom: 40px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.98); } }

@media (max-width: 900px) {
  .split, .split.wide-left, .split.even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  :root { --page: 16px; --pad: 14px; }
  body { font-size: 16px; }
  body.signed-in { grid-template-rows: auto minmax(0, 1fr) auto; }
  .menu, .status { display: none; }
  .menubar { justify-content: flex-end; height: 36px; }
  main { padding: 16px var(--page) 32px; }
  .tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--soft); border-top: 1px solid #111316; padding: 3px 4px calc(3px + env(safe-area-inset-bottom)); }
  .tabs a { display: grid; justify-items: center; gap: 1px; padding: 6px 2px 4px; border-radius: var(--r); color: var(--ink-soft); font-size: 11.5px; font-weight: 600; text-decoration: none; min-height: 50px; }
  .tabs a.on { color: var(--bright); background: var(--raised); }
  .tabs .ic { width: 22px; height: 22px; }
  .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; }
  .btn.icon, .btn.icon.small { width: 44px; min-height: 44px; }
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=file], select, textarea { font-size: 16px; min-height: 44px; }
  .grid-form { grid-template-columns: minmax(0, 1fr); }
  .item { flex-direction: column; gap: 10px; }
  .item-side { justify-content: space-between; width: 100%; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  a.row.only-phone { display: flex; background: var(--soft); border: 1px solid var(--line); border-radius: var(--r); }
  .auth { min-height: calc(100dvh - 120px); }
  .auth-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Anhänge an Tickets: Auswahl im Formular, Vorschau und Zeilen in der Meldung, Großansicht. */
.attach-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.attach-pick { display: grid; gap: 8px; position: relative; min-width: 0; }
.attach-bar { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.attach-list, .attached { display: grid; gap: 6px; min-width: 0; }
.attach-list:empty { display: none; }
.attached { margin-top: 6px; }
.attach-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.attach-thumb { width: 36px; height: 36px; flex: none; border-radius: 4px; border: 1px solid var(--line); background: var(--ground); object-fit: cover; display: grid; place-items: center; color: var(--ink-soft); }
.attach-thumb .ic { width: 18px; height: 18px; }
.attach-name { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.attach-size { flex: none; color: var(--ink-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
.attach-shot { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.attach-shot .attach-row { width: min(100%, 420px); }
.shot { display: block; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--ground); overflow: hidden; cursor: zoom-in; max-width: min(100%, 420px); }
.shot:disabled { cursor: progress; min-width: 120px; min-height: 60px; }
.shot:hover:not(:disabled) { border-color: var(--accent-hi); }
.shot-img { display: block; max-width: 100%; max-height: 260px; }
.dlg.viewer { width: fit-content; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); padding: 12px; }
.dlg.viewer[open] { display: grid; gap: 10px; grid-template-rows: minmax(0, 1fr) auto; }
.viewer-pane { overflow: auto; min-height: 0; border-radius: 4px; }
.viewer-pane img { display: block; max-width: 100%; margin: 0 auto; }
.viewer-bar { display: flex; align-items: center; gap: 12px; min-width: 0; }
