:root {
  --bg: #F5F4EF; --card: #FFFFFF; --ink: #1B1F1D; --muted: #5B625E; --line: #E4E1D8; --field: #CFCCC2;
  --accent: #1E5A43; --accent-dark: #123B2B; --accent-soft: #E9F4EE; --mint: #7FD1A8; --error: #9A3B1E;
  --radius: 14px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1 { font-size: 28px; line-height: 1.15; margin: 4px 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 18px 0 8px; }
p { margin: 0 0 8px; }
[hidden] { display: none !important; }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.dim { color: #C9D6CF; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.ic { flex: none; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8A3418; margin: 0; }

/* Formulare */
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
input[type=text], input[type=password], input[type=search], input[type=number], input:not([type]), select, textarea {
  font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); background: #fff;
  border: 1px solid var(--field); border-radius: 12px; padding: 11px 14px; min-height: 48px; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
fieldset { border: 1px solid var(--line); margin: 0; }
legend { font-weight: 700; padding: 0 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 18px;
  border: none; border-radius: var(--radius); background: var(--accent); color: #fff; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn.ghost { background: #fff; color: var(--accent); border: 1px solid var(--field); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { background: #fff; color: var(--error); border: 1px solid #E3B9AA; }
.btn:disabled { opacity: .5; cursor: default; }
.link-btn, .icon-btn { background: none; border: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 10px 4px; min-height: 44px; }
.icon-btn { color: var(--muted); min-width: 44px; }
.error { color: var(--error); font-weight: 600; margin: 0; }
.flash { background: var(--accent-soft); border: 1px solid #A9D5BE; color: var(--accent-dark); padding: 12px 14px; border-radius: 12px; font-weight: 600; }

/* Kopf */
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; min-height: 44px; }
.topbar { display: flex; justify-content: space-between; align-items: center; }
.topbar-links { display: flex; gap: 16px; }
.topbar-links a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; text-decoration: none; min-height: 44px; }
.login-head { display: flex; flex-direction: column; gap: 12px; margin: 40px 0 8px; }
.logo { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }

/* Reiter, Chips, Badges */
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid #DEDBD1; scrollbar-width: none; }
.tabs.bleed { margin: 0 -16px; padding: 0 12px; }
.tabs a { flex: none; display: flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--muted); font-size: 14px; font-weight: 500;
  text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--accent); font-weight: 700; border-bottom-color: var(--accent); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--field);
  background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; }
.chip.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.st-neu { background: #F8E3DA; color: #8A3418; }
.st-ueben { background: #FBEFD2; color: #6E4A00; }
.st-sitzt { background: #E1F0E8; color: var(--accent); }
.badge.dark { background: var(--ink); color: #fff; }
b.new { color: #8A3418; }

/* Suche */
.search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--field); border-radius: 12px; padding: 0 14px; color: var(--muted); }
.search input { border: none; outline: none; padding: 0; min-height: 46px; background: transparent; }

/* Listen */
.list { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.song-card, .video-item { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; color: var(--ink); text-decoration: none; }
.song-card:hover, .video-item:hover { border-color: var(--field); color: var(--ink); }
.song-card strong { font-size: 16px; }
.song-card > .ic, .video-item > .ic { color: var(--muted); }
.video-item { padding: 12px; border-radius: 14px; }
.video-item .nr { width: 34px; height: 34px; flex: none; border-radius: 10px; background: #EFEDE6; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.video-item.on { border: 2px solid var(--accent); background: var(--accent-soft); padding: 11px; }
.video-item.on .nr { background: var(--accent); color: #fff; }
.file-ic { width: 44px; height: 52px; flex: none; border-radius: 8px; background: #F8E3DA; color: #8A3418; display: flex; align-items: center; justify-content: center; }
.note p { margin: 4px 0 0; }
.note-author { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }

/* Stück */
.song-title { margin-bottom: -8px; }
.song-meta { margin: 0; }
.player { background: #14201B; border-radius: 16px; overflow: hidden; scroll-margin-top: 12px; }
.player video { display: block; width: 100%; max-height: 60vh; background: #000; aspect-ratio: 16 / 9; }
.player-bar { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; color: #fff; }
.player-ctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pill { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid #4A5E55; background: transparent; color: #fff; font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.pill.on { background: var(--mint); border-color: var(--mint); color: #0F1A15; font-weight: 600; }
.pill.loop { margin-left: auto; }
.status-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Schalter */
.switch { width: 56px; height: 32px; flex: none; border-radius: 999px; border: none; background: #B9B5A9; padding: 3px; cursor: pointer; display: flex; transition: background .15s; }
.switch span { width: 26px; height: 26px; border-radius: 999px; background: #fff; transition: transform .15s; }
.switch.on { background: var(--accent); }
.switch.on span { transform: translateX(24px); }

/* Noten + Markierungen */
.score { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; touch-action: pan-y; }
.score img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.marks { position: absolute; inset: 0; }
.mark { position: absolute; background: color-mix(in srgb, var(--c) 38%, transparent); border: 2px solid var(--c); border-radius: 4px;
  font-size: 12px; font-weight: 800; color: var(--ink); padding: 0 3px; line-height: 1.3; mix-blend-mode: multiply; }
.legend { display: flex; flex-direction: column; gap: 6px; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.sw { width: 22px; height: 22px; border-radius: 6px; background: color-mix(in srgb, var(--c) 45%, #fff); border: 2px solid var(--c); }

/* Admin */
.admin-hero { display: flex; align-items: center; gap: 14px; background: var(--accent); color: #fff; border-radius: 18px; padding: 18px; text-decoration: none; }
.admin-hero:hover { background: var(--accent-dark); color: #fff; }
.admin-hero .ic-box { width: 52px; height: 52px; flex: none; border-radius: 14px; background: #2F7358; display: flex; align-items: center; justify-content: center; }
.admin-hero span.sub { font-size: 13px; color: #D6EBE0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; color: var(--ink); text-decoration: none; }
.tile .ic { color: var(--accent); }
.tile:hover { border-color: var(--field); color: var(--ink); }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; border: 1.5px dashed #B9B5A9;
  border-radius: var(--radius); background: #fff; color: var(--accent); font-weight: 600; cursor: pointer; text-align: center; padding: 16px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.progress { height: 8px; background: #E4E1D8; border-radius: 8px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.recognized { display: flex; gap: 10px; align-items: flex-start; background: var(--accent-soft); border: 1px solid #A9D5BE; border-radius: var(--radius); padding: 12px; }
.recognized .ic { color: var(--accent); margin-top: 2px; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row label { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; background: #fff; border: 1px solid var(--field); border-radius: 12px; padding: 0 14px; min-height: 44px; cursor: pointer; }
.radio-row label:has(input:checked) { border: 2px solid var(--accent); background: var(--accent-soft); font-weight: 700; }
.inline { display: flex; gap: 8px; align-items: flex-end; }
.inline > label { flex: 1; }
.num { max-width: 90px; text-align: center; }
.mark-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.letter { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 30%, #fff); font: inherit; font-weight: 800; cursor: pointer; }
.letter.on { outline: 3px solid var(--ink); outline-offset: 1px; }
.score.editing { touch-action: none; cursor: crosshair; }
.score.editing .mark { cursor: pointer; }
.score .mark.draft { border-style: dashed; }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
code { background: #EFEDE6; padding: 2px 6px; border-radius: 6px; font-size: 13px; word-break: break-all; }
button.mark { font: inherit; font-size: 12px; font-weight: 800; display: flex; align-items: flex-start; justify-content: flex-start; cursor: pointer; }
details summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.compress-preview { width: 100%; max-height: 180px; border-radius: 10px; background: #000; }
