:root {
  --bg: #f7f4ef; --surface: #fff; --surface2: #f1ece5; --text: #221d18; --muted: #75695c;
  --line: #e3dbd0; --accent: #b4531f; --accent-soft: #f6e3d6; --accent-text: #fff;
  --ok: #2f7d4f; --ok-soft: #dcefe3; --warn: #a15c00; --warn-soft: #fbead0; --bad: #b3261e; --bad-soft: #f8dcd9;
  --radius: 12px; --shadow: 0 1px 2px rgba(40,25,10,.06), 0 4px 16px rgba(40,25,10,.05);
  --d1: #d9f0e1; --d2: #e2f2d6; --d3: #ecf3cc; --d4: #f7f0c4; --d5: #fbe6c0; --d6: #fbd8c0; --d7: #f8cbc0; --d8: #f4c0c8; --d9: #ecc4dd; --d10: #ddc8ee;
  --junior: #e2ecf7; --bronze: #f0d8c2; --silber: #e5e7ea; --gold: #f7e7b0;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    --bg: #171411; --surface: #211d19; --surface2: #2a2520; --text: #efe8df; --muted: #a89a8a;
    --line: #3a332c; --accent: #e07a3f; --accent-soft: #3d2618; --accent-text: #1a0f08;
    --ok: #6cc28f; --ok-soft: #1d3326; --warn: #f0b060; --warn-soft: #3a2a12; --bad: #f08a80; --bad-soft: #3d1c19;
    --d1: #1d3326; --d2: #23341e; --d3: #2f3419; --d4: #3a3415; --d5: #3d2e14; --d6: #3d2618; --d7: #3d201a; --d8: #3d1c22; --d9: #381b30; --d10: #2c1d3d;
    --junior: #1d2a3a; --bronze: #3b2819; --silber: #2f3236; --gold: #3a3114;
    color-scheme: dark;
  }
}
:root[data-mode="dark"] {
    --bg: #171411; --surface: #211d19; --surface2: #2a2520; --text: #efe8df; --muted: #a89a8a;
    --line: #3a332c; --accent: #e07a3f; --accent-soft: #3d2618; --accent-text: #1a0f08;
    --ok: #6cc28f; --ok-soft: #1d3326; --warn: #f0b060; --warn-soft: #3a2a12; --bad: #f08a80; --bad-soft: #3d1c19;
    --d1: #1d3326; --d2: #23341e; --d3: #2f3419; --d4: #3a3415; --d5: #3d2e14; --d6: #3d2618; --d7: #3d201a; --d8: #3d1c22; --d9: #381b30; --d10: #2c1d3d;
    --junior: #1d2a3a; --bronze: #3b2819; --silber: #2f3236; --gold: #3a3114;
    color-scheme: dark;
  }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: .2em 0 .4em; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .7em; }
h3 { font-size: 1rem; margin: 1em 0 .5em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.warn { color: var(--warn); font-weight: 600; }
code { background: var(--surface2); padding: 0 .3em; border-radius: 4px; }

/* Kopfzeile */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1.2rem; padding: .6rem 1.2rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); font-size: 1.05rem; }
.brand img { width: 28px; height: 28px; }
.top nav { display: flex; gap: .2rem; flex: 1; overflow-x: auto; }
.top nav a { padding: .4rem .75rem; border-radius: 8px; color: var(--muted); white-space: nowrap; }
.top nav a.on, .top nav a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.me { display: flex; gap: .8rem; white-space: nowrap; }

main { max-width: 1400px; margin: 0 auto; padding: 1.2rem; }
main.narrow { max-width: 440px; padding-top: 10vh; }

/* Karten & Formulare */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); margin-bottom: .7rem; }
label.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--text); font-size: .9rem; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; width: 100%; min-width: 0; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem .3rem; margin: 0 0 .8rem; }
legend { font-size: .85rem; color: var(--muted); padding: 0 .3rem; }
.row2, .row3, .row4 { display: grid; gap: .7rem; }
.row2 { grid-template-columns: 1fr 1fr; }
.row3 { grid-template-columns: repeat(3, 1fr); }
.row4 { grid-template-columns: repeat(4, 1fr); }
.row-form { display: flex; gap: .7rem; align-items: flex-end; flex-wrap: wrap; }
.row-form label { flex: 1 1 160px; margin: 0; }
.hint { margin: -.3rem 0 .8rem; font-size: .85rem; color: var(--muted); }

button, .btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .5rem .9rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none !important; white-space: nowrap; }
button:hover, .btn:hover { border-color: var(--accent); }
.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.primary:hover { filter: brightness(1.07); }
.small.btn, .btn.small { padding: .3rem .6rem; font-size: .85rem; }
.wide { width: 100%; }
.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); background: var(--bad-soft); }
.btn.ok { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
button.link { background: none; border: 0; padding: 0; font-size: .85rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .4rem; }
.actions form { margin: 0; }
.actions.sticky { position: sticky; bottom: 0; background: var(--surface); padding: .7rem 0 .2rem; border-top: 1px solid var(--line); }
.alert { background: var(--warn-soft); color: var(--text); border-radius: 8px; padding: .6rem .8rem; }
.alert.ok { background: var(--ok-soft); }
.danger-zone { display: flex; gap: 1rem; align-items: center; margin: -.4rem 0 1rem; flex-wrap: wrap; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .4rem; }
.chip { margin: 0; flex-direction: row; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: .28rem .65rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: .83rem; cursor: pointer; user-select: none; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.chip-btn { padding: .2rem .5rem; font-size: .8rem; border-radius: 999px; }
.chip-btn.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: .3rem; margin: .45rem 0 .2rem; }
.b { display: inline-block; padding: .1rem .5rem; border-radius: 6px; font-size: .78rem; background: var(--surface2); color: var(--text); white-space: nowrap; }
.b.key { background: var(--accent-soft); }
.b.range { font-variant-numeric: tabular-nums; }
.d1.b, .lvl-chip.d1 span { background: var(--d1); } .d2.b, .lvl-chip.d2 span { background: var(--d2); } .d3.b, .lvl-chip.d3 span { background: var(--d3); } .d4.b, .lvl-chip.d4 span { background: var(--d4); } .d5.b, .lvl-chip.d5 span { background: var(--d5); } .d6.b, .lvl-chip.d6 span { background: var(--d6); } .d7.b, .lvl-chip.d7 span { background: var(--d7); } .d8.b, .lvl-chip.d8 span { background: var(--d8); } .d9.b, .lvl-chip.d9 span { background: var(--d9); } .d10.b, .lvl-chip.d10 span { background: var(--d10); }
.lv-junior, .b.lv-junior { background: var(--junior); } .b.lv-bronze { background: var(--bronze); } .b.lv-silber { background: var(--silber); } .b.lv-gold { background: var(--gold); }
.b.ok { background: var(--ok-soft); color: var(--ok); } .b.bad { background: var(--bad-soft); color: var(--bad); }
.b.conf-low { background: var(--bad-soft); color: var(--bad); } .b.conf-medium { background: var(--warn-soft); color: var(--warn); } .b.conf-high { background: var(--ok-soft); color: var(--ok); }

/* Suche */
.layout { display: grid; grid-template-columns: 290px 1fr; gap: 1.4rem; align-items: start; }
.filters { position: sticky; top: 70px; max-height: calc(100vh - 85px); overflow-y: auto; padding-right: .3rem; }
.filters .search { margin-bottom: .6rem; padding: .6rem .8rem; }
.filters details { border-bottom: 1px solid var(--line); padding: .5rem 0; }
.filters summary { cursor: pointer; font-weight: 600; font-size: .9rem; padding: .2rem 0 .5rem; }
.filters > form > label { margin-top: .7rem; }
.results-head { display: flex; align-items: baseline; gap: .8rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .9rem; }
.piece-card { display: flex; gap: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; box-shadow: var(--shadow); }
.piece-card .thumb { flex: 0 0 78px; }
.piece-card .thumb img, .rthumb img { width: 78px; aspect-ratio: 0.77; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--line); background: #fff; display: block; }
.piece-card .body { min-width: 0; flex: 1; }
.title-row { display: flex; align-items: flex-start; gap: .4rem; }
.title { font-weight: 650; color: var(--text); flex: 1; line-height: 1.25; }
.meta { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .2rem; }
.empty { text-align: center; padding: 2.5rem 1rem; }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: 1.5rem 0; }
.only-mobile { display: none; }

.wish-form { margin: 0; }
.wish { padding: .2rem; border: 0; background: none; line-height: 0; }
.wish svg { fill: none; stroke: var(--muted); stroke-width: 1.8; transition: transform .15s; }
.wish:hover svg { stroke: #d33a5a; transform: scale(1.1); }
.wish.on svg { fill: #d33a5a; stroke: #d33a5a; }

/* Stück */
.piece-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: .8rem; }
.head-actions { display: flex; gap: .5rem; align-items: center; }
.head-actions .wish svg { width: 28px; height: 28px; }
.piece-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.piece-layout:not(:has(.viewer)) { grid-template-columns: minmax(0, 720px); }
.viewer { position: sticky; top: 70px; padding: .7rem; }
.viewer-head { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; }
.pages { max-height: calc(100vh - 150px); overflow-y: auto; display: flex; flex-direction: column; gap: .8rem; }
.pages figure { margin: 0; }
.pages img { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; display: block; }
.pages figure.peek img { opacity: .6; }
.pages figcaption { text-align: center; font-size: .8rem; color: var(--muted); }
.viewer iframe { width: 100%; height: calc(100vh - 150px); border: 0; border-radius: 6px; background: #fff; }
.form-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.form-head h2 { margin: 0 0 .7rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.media { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1rem; }
.media-head { display: flex; gap: .5rem; align-items: center; margin-bottom: .35rem; }
.media-head form { margin-left: auto; }
.media audio, .media video { width: 100%; }
.speed { display: flex; gap: .3rem; align-items: center; margin-top: .3rem; flex-wrap: wrap; }
.yt { position: relative; aspect-ratio: 16/9; } .yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }
.media-add { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .3rem; }

/* Import */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.drop { border: 2px dashed var(--line); border-radius: 10px; padding: 1.6rem; text-align: center; cursor: pointer; color: var(--text); position: relative; }
.drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.progress { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; min-width: 120px; margin-bottom: .2rem; }
.progress > div { height: 100%; background: var(--accent); transition: width .5s; }
.book-head .status-line { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin: .8rem 0 .3rem; }
.book-head .status-line .progress { flex: 0 0 200px; margin: 0; }
.review-list { display: flex; flex-direction: column; }
.review-row { display: flex; gap: .8rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.review-row.done { opacity: .7; }
.rthumb img { width: 56px; }
.rbody { flex: 1; min-width: 0; }
.add-piece { margin-top: 1rem; }

/* Schüler */
details.student summary { display: flex; gap: .5rem; align-items: center; cursor: pointer; flex-wrap: wrap; list-style: none; }
details.student summary::-webkit-details-marker { display: none; }
details.student[open] summary { margin-bottom: 1rem; }

.login { text-align: center; }
.login form { text-align: left; margin-top: 1rem; }
.login-icon { width: 56px; height: 56px; }

@media (max-width: 1000px) {
  .piece-layout { grid-template-columns: 1fr; }
  .viewer { position: static; }
  .pages { max-height: 70vh; }
}
@media (max-width: 800px) {
  main { padding: 1rem; }
  .top { gap: .6rem; padding: .5rem 1rem; flex-wrap: wrap; }
  .top nav { order: 3; flex-basis: 100%; }
  .me { margin-left: auto; }
  .layout { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; display: none; }
  body.show-filters .filters { display: block; }
  .only-mobile { display: inline-flex; margin-left: auto; }
  .row3, .row4, .two-col { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr; }
  .piece-head { flex-direction: column; }
}
@media (max-width: 480px) {
  .row2, .row3, .row4, .two-col { grid-template-columns: 1fr; }
}
.pdf-att { display: flex; gap: .5rem; align-items: center; }
.pdf-icon { font-size: .7rem; font-weight: 700; color: #fff; background: var(--bad); border-radius: 4px; padding: .25rem .4rem; }

/* Sammelbände */
.band-card { grid-column: 1 / -1; display: flex; gap: 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.band-card .cover img, .cover-lg { width: 120px; aspect-ratio: .77; object-fit: cover; object-position: top; border-radius: 4px 8px 8px 4px; border: 1px solid var(--line); background: #fff; display: block; box-shadow: 3px 3px 0 var(--surface2), 4px 4px 0 var(--line); }
.band-card .body { flex: 1; min-width: 0; }
.kicker { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 700; }
.title.big { font-size: 1.2rem; display: block; margin: .1rem 0; }
.match { font-size: .85rem; margin: .5rem 0 .1rem; font-weight: 600; }
.band-pieces { list-style: none; padding: 0; margin: .5rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); column-gap: 1.2rem; }
.band-pieces.full { grid-template-columns: 1fr; }
.prow { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; border-bottom: 1px solid var(--line); min-width: 0; }
.prow .ptitle { color: var(--text); font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .pinfo { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.prow .wish svg { width: 18px; height: 18px; }
.more summary { cursor: pointer; color: var(--accent); font-size: .9rem; margin: .2rem 0; }
.band-head { display: flex; gap: 1.4rem; margin-top: .5rem; }
.cover-lg { width: 170px; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.band-filter { max-width: 260px; }
.breadcrumb { font-size: .9rem; margin-bottom: .2rem; }
@media (max-width: 800px) {
  .band-card, .band-head { flex-direction: column; }
  .band-card .cover img { width: 90px; }
  .cover-lg { width: 120px; }
  .band-pieces { grid-template-columns: 1fr; }
  .prow { flex-wrap: wrap; }
  .prow .ptitle { flex-basis: calc(100% - 40px); white-space: normal; }
}

/* Kategorien & kompaktes Formular */
.tree .chips.sub { margin: .1rem 0 .45rem; padding: .45rem .5rem; background: var(--surface2); border-radius: 8px; }
.tree .chips.sub[hidden] { display: none; }
.sublabel { font-size: .78rem; color: var(--muted); align-self: center; margin-right: .1rem; }
.chip.main span { font-weight: 600; }
.field { margin-bottom: .8rem; }
.flabel { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.field.checks { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.field.checks label { margin: 0; }
details.more-fields { border-top: 1px solid var(--line); padding-top: .6rem; margin-bottom: .4rem; }
details.more-fields summary { cursor: pointer; font-weight: 600; font-size: .9rem; margin-bottom: .6rem; }
.results.loading { opacity: .55; transition: opacity .15s; }

/* Tag-Auswahl */
.tagpicker { position: relative; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.tp-tags { display: contents; }
.tp-tag { display: inline-flex; align-items: center; gap: .25rem; padding: .22rem .3rem .22rem .6rem; border-radius: 999px; background: var(--accent-soft); font-size: .83rem; }
.tp-tag .tp-main { color: var(--muted); }
.tp-tag button { border: 0; background: none; padding: 0 .25rem; font-size: 1rem; line-height: 1; color: var(--muted); }
.tp-tag button:hover { color: var(--bad); }
.tp-add { padding: .22rem .6rem; font-size: .83rem; border-radius: 999px; border-style: dashed; color: var(--muted); }
.tp-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; width: min(420px, 90vw); max-height: 360px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: .6rem; }
.tp-search { margin-bottom: .5rem; }
.tp-group { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.tp-group:last-child { border-bottom: 0; }
.tp-subs { display: flex; flex-wrap: wrap; gap: .25rem; margin: .3rem 0 0 .4rem; }
.tp-opt { padding: .18rem .55rem; font-size: .8rem; border-radius: 999px; }
.tp-opt.main { font-weight: 650; border: 0; padding-left: .2rem; background: none; }
.tp-opt.main.on { color: var(--accent); }
.tp-opt.main.on::before.tp-opt:not(.main).on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.tags-row .field { margin-bottom: .6rem; }
.tags-row .field:last-child .tp-pop { left: auto; right: 0; }
.tp-opt.main.on::after { content: " ✓"; }

/* Haupt-/Zusatzfeld */
.opt { font-size: .75rem; color: var(--muted); opacity: .8; }
.ms-sub:disabled { opacity: .5; }
.key-range { align-items: start; }

/* Schieberegler Tonumfang */
.rslider { user-select: none; }
.rs-head { display: flex; align-items: center; justify-content: space-between; min-height: 1.4rem; }
.rs-label { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text); }
.rslider.unset .rs-label { color: var(--muted); font-weight: 400; }
.rs-clear { border: 0; background: none; padding: 0 .3rem; color: var(--muted); font-size: 1.1rem; line-height: 1; }
.rslider.unset .rs-clear { visibility: hidden; }
.rs-track { position: relative; height: 28px; }
.rs-rail, .rs-fill { position: absolute; top: 12px; height: 4px; border-radius: 2px; }
.rs-rail { left: 0; right: 0; background: var(--line); }
.rs-fill { background: var(--accent); }
.rslider.unset .rs-fill { background: var(--line); }
.rs-track input[type=range] { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none;
  -webkit-appearance: none; appearance: none; border: 0; padding: 0; height: 28px; outline: none; }
.rs-track input[type=range]::-webkit-slider-runnable-track { background: none; height: 28px; }
.rs-track input[type=range]::-moz-range-track { background: none; }
.rs-track input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; margin-top: 4px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: grab; }
.rs-track input[type=range]::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: var(--surface);
  border: 2px solid var(--accent); cursor: grab; }
.rslider.unset input[type=range]::-webkit-slider-thumb { border-color: var(--muted); }
.rs-track input[type=range]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.rs-scale { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: -2px; }

.filepath { margin: .6rem 0 0; word-break: break-word; }

/* Kaskaden-Auswahl */
.cascade { position: relative; }
.cz-field { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; min-height: 40px; padding: .3rem 2rem .3rem .45rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; position: relative; }
.cz-field:hover, .cascade.open .cz-field { border-color: var(--accent); }
.cz-field:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.cz-chips { display: contents; }
.cz-ph { color: var(--muted); padding-left: .2rem; }
.cz-caret { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .8rem; }
.cz-chip { display: inline-flex; align-items: center; padding: .15rem .25rem .15rem .6rem; border-radius: 999px; background: var(--accent-soft);
  font-size: .85rem; font-weight: 600; line-height: 1.5; }
.cz-sub { font-weight: 400; color: var(--muted); }
.cz-x { border: 0; background: none; padding: 0 .3rem; margin-left: .1rem; font-size: 1rem; line-height: 1; color: var(--muted); }
.cz-x:hover { color: var(--bad); }
.cz-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; display: grid; grid-template-columns: max-content minmax(220px, max-content);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.16); overflow: hidden; }
.cz-pop[hidden] { display: none; }
.cz-mains { border-right: 1px solid var(--line); padding: .35rem; }
.cz-subs { padding: .35rem; background: var(--surface2); }
.cz-m, .cz-s { display: flex; align-items: center; width: 100%; text-align: left; border: 0; background: none; border-radius: 7px;
  padding: .42rem .6rem; font-size: .9rem; justify-content: flex-start; gap: .4rem; white-space: nowrap; }
.cz-m:hover, .cz-m.focus { background: var(--surface2); }
.cz-m.on { font-weight: 650; color: var(--accent); }
.cz-check { width: 1rem; color: var(--accent); flex: none; }
.cz-arrow { margin-left: auto; padding-left: 1rem; color: var(--muted); }
.cz-head { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .4rem .5rem .3rem; font-weight: 650; }
.cz-s:hover { background: var(--surface); }
.cz-s.on { background: var(--accent); color: var(--accent-text); }
.cz-s.on::after { content: "✓"; margin-left: auto; }
.cz-none { padding: .4rem .5rem; }
.cz-custom { margin-top: .4rem; font-size: .85rem; padding: .4rem .5rem; }
.tags2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-bottom: .7rem; }
.tags2 .field { margin: 0; }
.tags2 .field:last-child .cz-pop { left: auto; right: 0; }
@media (max-width: 700px) {
  .tags2 { grid-template-columns: 1fr; }
  .cz-pop { grid-template-columns: 1fr 1fr; width: calc(100vw - 48px); }
  .tags2 .field:last-child .cz-pop { left: 0; right: auto; }
}

/* ---------- Farbthemen ---------- */
:root[data-accent="messing"] { --accent: #b4531f; --accent-soft: #f6e3d6; --bg: #f7f4ef; --surface2: #f1ece5; --line: #e3dbd0; --accent-text: #fff; }
:root[data-accent="wald"] { --accent: #2f6f4f; --accent-soft: #dcede3; --bg: #f3f6f3; --surface2: #e9efea; --line: #d6e0d8; --accent-text: #fff; }
:root[data-accent="ozean"] { --accent: #1f5f9e; --accent-soft: #dce8f6; --bg: #f2f5f9; --surface2: #e8eef5; --line: #d4dde8; --accent-text: #fff; }
:root[data-accent="bordeaux"] { --accent: #8e2440; --accent-soft: #f4dde3; --bg: #f8f3f4; --surface2: #f1e8ea; --line: #e4d4d8; --accent-text: #fff; }
:root[data-accent="lavendel"] { --accent: #5f47a8; --accent-soft: #e6e0f6; --bg: #f5f3f9; --surface2: #ece8f4; --line: #dcd6e8; --accent-text: #fff; }
:root[data-accent="graphit"] { --accent: #2f3a46; --accent-soft: #e1e5ea; --bg: #f4f4f5; --surface2: #ebebed; --line: #dcdde0; --accent-text: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"])[data-accent="messing"] { --accent: #e07a3f; --accent-soft: #3d2618; --bg: #171411; --surface: #211d19; --surface2: #2a2520; --line: #3a332c; --accent-text: #171411; }
  :root:not([data-mode="light"])[data-accent="wald"] { --accent: #5cc08e; --accent-soft: #183126; --bg: #111613; --surface: #19201c; --surface2: #212a24; --line: #2f3a33; --accent-text: #111613; }
  :root:not([data-mode="light"])[data-accent="ozean"] { --accent: #5ea3e8; --accent-soft: #16283c; --bg: #10141a; --surface: #171d25; --surface2: #1f2732; --line: #2c3644; --accent-text: #10141a; }
  :root:not([data-mode="light"])[data-accent="bordeaux"] { --accent: #e27393; --accent-soft: #3a1824; --bg: #161112; --surface: #1f181a; --surface2: #281f22; --line: #3a2c30; --accent-text: #161112; }
  :root:not([data-mode="light"])[data-accent="lavendel"] { --accent: #a690f0; --accent-soft: #2a2244; --bg: #131218; --surface: #1b1a22; --surface2: #24222d; --line: #34313f; --accent-text: #131218; }
  :root:not([data-mode="light"])[data-accent="graphit"] { --accent: #b9c4d0; --accent-soft: #2a3038; --bg: #121314; --surface: #1a1b1d; --surface2: #232427; --line: #33353a; --accent-text: #121314; }
}
:root[data-mode="dark"][data-accent="messing"] { --accent: #e07a3f; --accent-soft: #3d2618; --bg: #171411; --surface: #211d19; --surface2: #2a2520; --line: #3a332c; --accent-text: #171411; }
:root[data-mode="dark"][data-accent="wald"] { --accent: #5cc08e; --accent-soft: #183126; --bg: #111613; --surface: #19201c; --surface2: #212a24; --line: #2f3a33; --accent-text: #111613; }
:root[data-mode="dark"][data-accent="ozean"] { --accent: #5ea3e8; --accent-soft: #16283c; --bg: #10141a; --surface: #171d25; --surface2: #1f2732; --line: #2c3644; --accent-text: #10141a; }
:root[data-mode="dark"][data-accent="bordeaux"] { --accent: #e27393; --accent-soft: #3a1824; --bg: #161112; --surface: #1f181a; --surface2: #281f22; --line: #3a2c30; --accent-text: #161112; }
:root[data-mode="dark"][data-accent="lavendel"] { --accent: #a690f0; --accent-soft: #2a2244; --bg: #131218; --surface: #1b1a22; --surface2: #24222d; --line: #34313f; --accent-text: #131218; }
:root[data-mode="dark"][data-accent="graphit"] { --accent: #b9c4d0; --accent-soft: #2a3038; --bg: #121314; --surface: #1a1b1d; --surface2: #232427; --line: #33353a; --accent-text: #121314; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; margin: .4rem 0 1rem; }
.swatch { position: relative; margin: 0; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch .sw { display: flex; flex-direction: column; gap: .45rem; padding: .7rem; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font-size: .9rem; font-weight: 600; }
.swatch .dots { display: flex; gap: .3rem; }
.swatch .dots i { width: 22px; height: 22px; border-radius: 50%; display: block; border: 1px solid rgba(0,0,0,.08); }
.swatch input:checked + .sw { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.swatch input:focus-visible + .sw { outline: 2px solid var(--accent); }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--surface2); gap: 2px; margin: .3rem 0 1rem; }
.segmented label { margin: 0; flex-direction: row; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; padding: .4rem .9rem; border-radius: 8px; color: var(--muted); font-size: .9rem; }
.segmented input:checked + span { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
main.settings { max-width: 760px; }

/* ---------- Seitenleiste & Übersicht ---------- */
.filters { padding-right: 18px; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.filters::-webkit-scrollbar { width: 8px; }
.filters::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.filters::-webkit-scrollbar-track { background: transparent; }
.layout { gap: 1.8rem; }
.grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); align-items: start; }
.band-card { grid-column: auto; flex-direction: column; gap: .5rem; padding: .9rem 1rem .6rem; }
.band-top { display: flex; gap: .9rem; }
.band-card .cover img { width: 72px; }
.band-card .body { min-width: 0; }
.band-card .title.big { font-size: 1.05rem; }
.band-card .band-pieces { grid-template-columns: 1fr; margin: .2rem 0 0; }
.band-card .prow { padding: .3rem 0; }
.band-card .prow .ptitle { font-weight: 550; }
.band-card .match { margin: .2rem 0 0; font-size: .82rem; color: var(--accent); }
.band-card .more { margin: 0; }
.band-card .more summary { list-style: none; padding: .4rem 0 .1rem; font-size: .88rem; }
.band-card .more summary::-webkit-details-marker { display: none; }
.band-card .more summary::before { content: "▸ "; }
.band-card .more[open] summary::before { content: "▾ "; }
.more .when-open { display: none; }
.more[open] .when-open { display: inline; }
.more[open] .when-closed { display: none; }
@media (max-width: 800px) { .grid { grid-template-columns: 1fr; } }

/* ---------- Player ---------- */
.player { padding: .9rem 1rem 1rem; }
.pl-tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .6rem; }
.pl-tab { padding: .3rem .7rem; border-radius: 999px; font-size: .84rem; }
.pl-tab.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.pl-tab small { opacity: .75; margin-left: .3rem; }
.pl-stage { position: relative; background: #000; border-radius: 10px; overflow: hidden; }
.pl-stage video { width: 100%; display: block; max-height: 60vh; }
.pl-stage.audio { background: var(--accent-soft); height: 64px; }
.pl-stage.audio video { height: 0; }
.pl-audio-art { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; font-size: 2rem; color: var(--accent); }
.pl-stage.audio .pl-audio-art { display: flex; }
.pl-bar { position: relative; height: 14px; margin: .8rem 0 .5rem; background: var(--line); border-radius: 7px; cursor: pointer; }
.pl-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 7px; width: 0; pointer-events: none; }
.pl-loop { position: absolute; top: -3px; bottom: -3px; background: color-mix(in srgb, var(--accent) 22%, transparent);
  border: 1px solid var(--accent); border-radius: 6px; display: none; pointer-events: none; }
.pl-mark { position: absolute; top: -20px; transform: translateX(-50%); font-size: .7rem; font-weight: 700; color: var(--accent); display: none; pointer-events: none; }
.pl-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.pl-btn { padding: .4rem .7rem; font-size: .9rem; }
.pl-btn.sm { padding: .3rem .6rem; min-width: 2.2rem; }
.pl-play { width: 3rem; height: 3rem; border-radius: 50%; background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-size: 1.1rem; }
.pl-time { font-variant-numeric: tabular-nums; margin-left: .3rem; }
.pl-status { margin-left: auto; }
.pl-ctrls { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.pl-group { display: flex; align-items: center; gap: .35rem; }
.pl-label { font-size: .8rem; color: var(--muted); margin-right: .2rem; }
.pl-rate { width: 130px; accent-color: var(--accent); padding: 0; border: 0; }
.pl-val { min-width: 3.4rem; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; padding: .3rem .4rem; }
span.pl-val { min-width: 2.4rem; }
.pl-loopbtn.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.att-list { list-style: none; padding: 0; margin: 0; }
.att { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.att:last-child { border-bottom: 0; }
.att-ico { font-size: 1.1rem; width: 1.6rem; text-align: center; }
.att-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: .1rem .5rem; align-items: baseline; }
.att-act { display: flex; gap: .4rem; align-items: center; }
.att-act form { margin: 0; }
.filters summary { list-style: none; display: flex; align-items: center; gap: .4rem; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary::before { content: ""; box-sizing: content-box; width: 5px; height: 5px; flex: none; margin: 0 .2rem 0 .1rem;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.filters details[open] > summary::before { transform: rotate(45deg) translate(-2px, -1px); }

/* Sammelband-Karte: großes Titelbild, Infos, darunter Meta */
.band-card { flex-direction: row; gap: 1.1rem; padding: 1rem; align-items: flex-start; }
.band-card .cover { flex: none; }
.band-card .cover img { width: 130px; box-shadow: 3px 3px 0 var(--surface2), 4px 4px 0 var(--line), 0 6px 14px rgba(0,0,0,.08); transition: transform .15s; }
.band-card .cover:hover img { transform: translateY(-2px); }
.band-card .body { display: flex; flex-direction: column; gap: .15rem; padding-top: .2rem; }
.band-card .title.big { font-size: 1.15rem; line-height: 1.25; }
.band-card .badges { margin-top: .6rem; }
.band-card .match { display: inline-block; margin-top: .5rem; font-size: .85rem; font-weight: 600; color: var(--accent); }
@media (max-width: 480px) { .band-card .cover img { width: 100px; } }

/* ---------- Kategorien-Editor ---------- */
main.settings { max-width: 860px; }
.tx-tabs { margin-bottom: .8rem; }
.tx-list { display: flex; flex-direction: column; gap: .5rem; }
.tx-main { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: .45rem .6rem .55rem; }
.tx-main.dragging, .tx-sub.dragging { opacity: .4; }
.tx-row { display: flex; align-items: center; gap: .45rem; }
.tx-handle { cursor: grab; color: var(--muted); user-select: none; padding: 0 .15rem; font-size: 1rem; line-height: 1; }
.tx-handle:active { cursor: grabbing; }
.tx-name { flex: 1; font-weight: 650; border-color: transparent; background: transparent; padding: .3rem .4rem; }
.tx-name:hover { border-color: var(--line); }
.tx-count { font-size: .75rem; color: var(--muted); background: var(--surface2); border-radius: 999px; padding: .1rem .5rem; min-width: 1.8rem; text-align: center; }
.tx-del { border: 0; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; padding: .1rem .35rem; }
.tx-del:hover { color: var(--bad); }
.tx-subs { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .4rem 0 0 1.6rem; min-height: 1.8rem; }
.tx-sub { display: inline-flex; align-items: center; gap: .1rem; background: var(--surface2); border-radius: 999px; padding: .1rem .2rem .1rem .45rem; font-size: .85rem; }
.tx-sub input { border: 0; background: transparent; padding: .15rem .1rem; width: auto; font-size: .85rem; min-width: 3rem; }
.tx-sub input:focus { outline: 1px solid var(--accent); border-radius: 4px; }
.tx-sub em { font-style: normal; font-size: .7rem; color: var(--muted); margin: 0 .1rem; }
.tx-sub .tx-handle { font-size: .85rem; }
.tx-sub .tx-del { font-size: .95rem; }
.tx-addsub { width: 11rem; font-size: .83rem; padding: .25rem .5rem; border-style: dashed; border-radius: 999px; background: transparent; }
.tx-addmain { margin: .6rem 0 .2rem; }
.tx-addmain input { border-style: dashed; }
.tx-editor .actions { margin-top: .8rem; }
.tx-handle { touch-action: none; }
body.tx-dragging, body.tx-dragging * { cursor: grabbing !important; user-select: none; }
.tx-main.dragging, .tx-sub.dragging { opacity: .55; outline: 2px dashed var(--accent); outline-offset: 2px; }
button:disabled, .btn:disabled { opacity: .45; cursor: default; filter: none; }

/* ---------- Uploader ---------- */
.up-drop { display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center; color: var(--text);
  border: 2px dashed var(--line); border-radius: 12px; padding: 1.3rem 1rem; cursor: pointer; position: relative; margin: 0 0 .6rem;
  transition: background .15s, border-color .15s; }
.up-drop:hover, .up-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.up-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.up-icon { font-size: 1.6rem; color: var(--accent); line-height: 1; }
.up-review { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem; margin-bottom: .8rem; background: var(--surface); }
.up-head { margin-bottom: .4rem; }
.up-row { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.up-row:last-child { border-bottom: 0; }
.up-row.unsure { background: linear-gradient(90deg, var(--warn-soft), transparent 60%); border-radius: 6px; padding-left: .4rem; }
.up-row.done { opacity: .6; }
.up-file { display: flex; gap: .5rem; align-items: baseline; margin-bottom: .35rem; min-width: 0; }
.up-name { font-weight: 600; word-break: break-all; }
.up-ki { color: var(--accent); }
.up-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: .4rem; align-items: center; padding-left: 1.6rem; }
.uploader[data-piece]:not([data-piece=""]) .up-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; }
.up-fields select, .up-fields input { padding: .35rem .5rem; font-size: .88rem; }
.up-del { border: 0; background: none; color: var(--muted); font-size: 1.2rem; padding: 0 .3rem; }
.up-del:hover { color: var(--bad); }
.up-bar { height: 3px; background: transparent; margin: .45rem 0 0 1.6rem; border-radius: 2px; overflow: hidden; }
.up-bar div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.yt-add { display: flex; gap: .4rem; margin: .2rem 0 .4rem; }
.yt-add input { flex: 1; }
.yt-add select { width: auto; }
@media (max-width: 700px) { .up-fields, .uploader[data-piece]:not([data-piece=""]) .up-fields { grid-template-columns: 1fr 1fr; padding-left: 0; } }

/* Tonartwechsel */
.keychanges { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-top: .35rem; }
.kc-chip { display: inline-flex; align-items: center; gap: .15rem; background: var(--accent-soft); border-radius: 999px;
  padding: .12rem .2rem .12rem .55rem; font-size: .82rem; color: var(--text); }
.kc-x { border: 0; background: none; color: var(--muted); padding: 0 .3rem; font-size: 1rem; line-height: 1; }
.kc-x:hover { color: var(--bad); }
.kc-add { width: auto; font-size: .82rem; padding: .2rem .4rem; border-style: dashed; border-radius: 999px; color: var(--muted); }
.b.key.mod { background: var(--warn-soft); }
.keycheck-msg { margin: .4rem 0 0; }
.keycheck-msg.running { color: var(--accent); }
.band-head .actions form, .book-head .actions form { margin: 0; }

/* Tempo */
.tempo-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .7rem; margin-bottom: .7rem; align-items: end; }
.tempo-row label { margin: 0; }
.mm-wrap { display: flex; align-items: center; gap: .35rem; }
.mm-wrap select { width: auto; min-width: 9.5rem; font-family: inherit, "Segoe UI Symbol", "Noto Music", sans-serif; }
.mm-wrap input { width: 5.2rem; }
.mm-eq { color: var(--muted); font-weight: 600; }
.b.tempo, .tempo-val { font-family: inherit, "Segoe UI Symbol", "Noto Music", sans-serif; }
@media (max-width: 480px) { .tempo-row { grid-template-columns: 1fr; } }

input.flash { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); transition: box-shadow .2s; }

/* Bände einer Reihe */
.vol { display: inline-block; font-size: .62em; font-weight: 600; vertical-align: .2em; padding: .15em .55em; margin-left: .3em;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; letter-spacing: .01em; }
.books-table .vol, .review-row .vol { font-size: .75em; }
.series { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: .6rem 0 .2rem; }
.vol-chip { font-size: .82rem; padding: .25rem .7rem; border-radius: 999px; border: 1px solid var(--line); color: inherit; text-decoration: none; background: var(--surface); }
.vol-chip:hover { border-color: var(--accent); color: var(--accent); }
.vol-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.row-form .grow2 { flex: 2 1 16rem; }
.series-line a { color: var(--accent); }

/* Band aus gefilterter Suche */
.match-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .55rem .8rem; margin: .2rem 0 .6rem;
  border-radius: 10px; background: var(--accent-soft); color: var(--text, inherit); font-size: .92rem; }
.match-bar .spacer { flex: 1; }
.band-pieces.filtered .prow.nohit { display: none; }
.band-pieces.filtered.show-all .prow.nohit { display: flex; opacity: .45; }
.band-pieces.filtered.show-all .prow.hit { box-shadow: inset 3px 0 0 var(--accent); padding-left: .6rem; }

/* Stimmen */
.b.part i { font-style: normal; font-weight: 600; opacity: .75; margin-right: .2em; }
.b.part.fit { box-shadow: 0 0 0 2px var(--accent); }
.parts-range { display: flex; flex-wrap: wrap; gap: .3rem; margin: .25rem 0; }
.parts-nav { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .6rem; }
.part-chip { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; font-size: .82rem; }
.part-chip a { padding: .22rem .65rem; color: inherit; text-decoration: none; }
.part-chip a:hover { background: var(--accent-soft); color: var(--accent); }
.part-chip a small { opacity: .6; margin-left: .2em; }
.part-chip a.pdf { border-left: 1px solid var(--line); font-size: .72rem; font-weight: 600; color: var(--accent); }
.part-chip.role-score { border-color: var(--accent); }
.parts-edit { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .4rem; }
.parts-edit > summary { cursor: pointer; font-weight: 600; margin-bottom: .5rem; }
.parts-rows { display: grid; gap: .35rem; margin-bottom: .5rem; }
.pr, .pr-head { display: grid; grid-template-columns: minmax(5.5rem, 1fr) minmax(8.2rem, 1fr) 6.6rem minmax(9rem, 1.3fr) 2rem; gap: .35rem; align-items: center; }
.parts-edit:not(:has(.pr-pages)) .pr, .parts-edit:not(:has(.pr-pages)) .pr-head { grid-template-columns: minmax(6rem, 1.3fr) minmax(6.5rem, 1fr) minmax(9rem, 1.4fr) 2rem; }
.pr-head { font-size: .75rem; opacity: .65; }
.pr input, .pr select { margin: 0; min-width: 0; }
.pr-pages { display: flex; align-items: center; gap: .2rem; }
.pr-pages input { width: 0; flex: 1; padding-left: .4rem; padding-right: .3rem; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.pr-pages input::-webkit-outer-spin-button, .pr-pages input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pr-head span { text-align: left; }
.pr-range { display: flex; gap: .25rem; }
.pr-range select { flex: 1; }
.pr-x { border: 0; background: none; font-size: 1.2rem; cursor: pointer; opacity: .55; color: inherit; }
.pr-x:hover { opacity: 1; color: #b33; }
@media (max-width: 700px) {
  .pr, .pr-head { grid-template-columns: 1fr 1fr; }
  .pr-head { display: none; }
}
.pr:not(:has(select[name="part_role"] option[value="trumpet"]:checked)) .pr-range { visibility: hidden; }

/* KI-Einstellungen */
.ai-modes { display: grid; gap: .4rem; margin: .3rem 0 .8rem; }
.ai-mode { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.ai-mode:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ai-mode input { margin-top: .25rem; }
.ai-mode span { display: flex; flex-direction: column; gap: .1rem; }
.ai-mode small { opacity: .75; }
.ai-form:has(input[value="claude"]:checked) .ai-local { opacity: .5; }
.ai-model { display: flex; gap: .35rem; }
.ai-model input { flex: 1; min-width: 0; }
.ai-status.ok { color: #2e7d32; }
.ai-status.err { color: #b33; }
/* Vergleich */
.cmp-summary { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: .6rem; }
.cmp-summary > div { display: flex; flex-direction: column; }
.cmp-summary b { font-size: 1.5rem; }
.cmp-summary span { font-size: .8rem; opacity: .7; }
.cmp { overflow-x: auto; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.cmp-table th { text-align: left; font-size: .75rem; opacity: .7; padding: .3rem .5rem; border-bottom: 1px solid var(--line); }
.cmp-table td { padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.cmp-table td.same { background: color-mix(in srgb, #2e7d32 8%, transparent); }
.cmp-table td.diff { background: color-mix(in srgb, #c62828 9%, transparent); }
.cmp-table .loc { color: #b33; font-size: .82rem; }
.cmp-table tr.extra td:first-child { font-style: italic; }

/* Notenerkennung */
.omr-box { border: 1px dashed var(--line); border-radius: 10px; padding: .45rem .7rem; margin: .1rem 0 .7rem; font-size: .9rem; }
.omr-box.ok { border-style: solid; border-color: color-mix(in srgb, #2e7d32 45%, var(--line)); }
.omr-box.bad { border-style: solid; border-color: color-mix(in srgb, #c77700 55%, var(--line)); }
.omr-line { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.omr-line .spacer { flex: 1; }
.omr-line.nlevel { margin-top: .35rem; }
.omr-more summary { cursor: pointer; margin-top: .2rem; }
.omr-more > div { margin: .25rem 0 0 .2rem; }
.b.ok-b { background: color-mix(in srgb, #2e7d32 15%, transparent); color: #2e7d32; }
.b.warn-b { background: color-mix(in srgb, #c77700 15%, transparent); color: #a35f00; }
.omr-status.ok { color: #2e7d32; } .omr-status.err { color: #b33; }

form.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: 0; padding: 0 .2rem; color: var(--accent); cursor: pointer; text-decoration: underline; font: inherit; }
.btn.danger-soft { color: #b33; border-color: color-mix(in srgb, #b33 35%, var(--line)); }
.omr-cancel { display: block; margin: -.3rem 0 .3rem; }
div.keycheck-msg { margin: .3rem 0; }

/* Aufgaben */
.jobs { display: grid; gap: .5rem; margin: .5rem 0; }
.job { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; background: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.job.queued { background: none; border-style: dashed; padding: .35rem .7rem; }
.job-head { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.job-head .spacer { flex: 1; }
.job .progress { margin: .4rem 0 .2rem; }
.job-now { margin-top: .15rem; }
.spin { width: .8em; height: .8em; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%;
  display: inline-block; animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.jobs-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); text-decoration: none; font-size: .85rem; margin-right: .4rem; }
.jobs-pill[hidden] { display: none; }

.pages-sec { margin: .8rem 0 .3rem; padding: .3rem .6rem; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: .9rem; }
.pages-sec:first-child { margin-top: 0; }
.part-chip.on { border-color: var(--accent); background: var(--accent-soft); }
.pages figure img { height: auto; }

/* Gegenprobe */
.xcheck { border: 1px solid var(--line); border-radius: 10px; padding: .45rem .7rem; margin: .1rem 0 .7rem; font-size: .88rem; }
.xc-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.xc { width: 100%; border-collapse: collapse; }
.xc th { text-align: left; font-weight: 600; padding: .2rem .4rem .2rem 0; white-space: nowrap; width: 1%; }
.xc td { padding: .2rem .4rem; }
.xc .src { font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; opacity: .55; margin-right: .15rem; }
.xc .xc-st { width: 1.2rem; text-align: center; }
.xc tr.st-ok .xc-st { color: #2e7d32; }
.xc tr.st-conflict { background: color-mix(in srgb, #c77700 10%, transparent); }
.xc tr.st-conflict .xc-st { color: #a35f00; }
.xc .xc-act { text-align: right; white-space: nowrap; }
.linkbtn.on { font-weight: 700; text-decoration: none; }
.list-head .segmented a { padding: .2rem .6rem; text-decoration: none; color: inherit; border-radius: 999px; }
.list-head .segmented a.on { background: var(--accent-soft); color: var(--accent); }
/* Werte dürfen umbrechen, Knöpfe stehen bei Platzmangel untereinander – nichts ragt aus dem Rahmen */
.xc td { white-space: normal; overflow-wrap: break-word; }
.xc .src { white-space: nowrap; }
.xc .xc-act { white-space: normal; width: 1%; }
.xc .xc-act .linkbtn { display: block; margin-left: auto; white-space: nowrap; text-align: right; padding: .05rem 0; }
@media (max-width: 640px) {      /* schmal: Zeile = Feld + Status, darunter KI | Noten, darunter die Knöpfe */
  .xc, .xc tbody { display: block; }
  .xc tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: .6rem; padding: .3rem .2rem; border-bottom: 1px solid var(--line); }
  .xc th { grid-column: 1; width: auto; padding: 0; }
  .xc .xc-st { grid-column: 2; grid-row: 1; width: auto; text-align: right; }
  .xc td { padding: .1rem 0; }
  .xc .xc-act { grid-column: 1 / -1; width: auto; display: flex; justify-content: flex-end; gap: 1rem; }
  .xc .xc-act:empty { display: none; }
  .xc .xc-act .linkbtn { display: inline; margin: 0; }
}

/* Kompakte Stückansicht */
.facts-flags { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.facts-flags a.b { text-decoration: none; }
.facts-card .facts dd.notes { white-space: pre-wrap; }

/* Blättern im Band */
.piece-nav { display: flex; align-items: center; gap: .6rem; margin: -.2rem 0 .8rem; }
.piece-nav a.muted { text-decoration: none; }
.piece-nav a.muted:hover { color: var(--accent); }
.btn.disabled { opacity: .35; pointer-events: none; }

/* ---------------------------------------------------------------- Vollbild-Noten */
body.fs-open { overflow: hidden; }
.fs { position: fixed; inset: 0; z-index: 1000; background: #2b2724; color: #f3ede6; display: flex; flex-direction: column; }
.fs[hidden] { display: none; }
.fs-bar { background: rgba(28, 25, 22, .94); backdrop-filter: blur(6px); transition: opacity .35s, transform .35s; z-index: 3; }
.fs-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: .5rem; padding: .45rem .8rem; flex-wrap: wrap; }
.fs-top .fs-title { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; }
.fs-top .btn, .fs-top select, .fs-settings .btn, .fs-bottom .fs-more { background: #3a3530; color: #f3ede6; border-color: #57504a; }
.fs-top .btn.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.fs-top .segmented { background: #3a3530; }
.fs-top .segmented span { color: #e6ded5; }
.fs-bottom { position: absolute; left: 0; right: 0; bottom: 0; max-height: 46vh; overflow: auto; }
.fs-bottom[hidden] { display: none; }
.fs.idle .fs-bar { opacity: 0; pointer-events: none; }
.fs.idle .fs-top { transform: translateY(-100%); }
.fs.idle .fs-bottom { transform: translateY(100%); }
.fs-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; outline: none; scrollbar-width: thin; touch-action: pan-y; }
.fs-scroll.v-page, .fs-scroll.v-two { overflow: hidden; }
.fs-scroll.v-width { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 3.6rem 0 45vh; }
.fs-screen { height: 100%; box-sizing: border-box; display: flex; justify-content: center; align-items: center; gap: 10px; }
.fs-page { position: relative; background: #fff; box-shadow: 0 2px 14px rgba(0, 0, 0, .45); flex: none; user-select: none; -webkit-user-select: none; }
.fs-page img { width: 100%; height: 100%; display: block; object-fit: contain; pointer-events: none; }
.fs-pno { position: absolute; right: 6px; bottom: 4px; font-size: .7rem; color: #999; }
.fs-hl { position: absolute; left: 0; right: 0; background: rgba(224, 122, 63, .14); border-left: 4px solid var(--accent);
  pointer-events: none; transition: top .25s ease, height .25s ease; }
.fs-info { position: absolute; left: 50%; top: 3.3rem; transform: translateX(-50%); font-size: .75rem; color: #cfc6bc;
  background: rgba(28, 25, 22, .7); padding: .1rem .6rem; border-radius: 99px; pointer-events: none; z-index: 2; }
.fs-info.flash { background: var(--ok); color: #fff; }
.fs.idle .fs-info { top: .4rem; opacity: .6; }
.fs-settings { position: absolute; top: 3.2rem; right: .8rem; z-index: 4; width: min(28rem, calc(100vw - 1.6rem));
  background: #24201c; border: 1px solid #4a433d; border-radius: var(--radius); padding: .8rem 1rem; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.fs-settings h3 { margin: 0 0 .3rem; font-size: 1rem; }
.fs-settings input { width: 5em; background: #3a3530; color: #f3ede6; border: 1px solid #57504a; border-radius: 6px; padding: .2rem .4rem; }
.fs-settings .muted { color: #b5aa9e; }
.fs-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.fs-rec { position: absolute; top: 3.2rem; left: .8rem; right: .8rem; z-index: 4; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  background: #5c1f17; border: 1px solid #b3261e; border-radius: var(--radius); padding: .5rem .8rem; }
.fs-rec[hidden] { display: none; }
.fs.recording .fs-page { cursor: crosshair; }
.fs.recording .fs-hl { background: rgba(179, 38, 30, .18); border-left-color: #e05a4e; }
/* Player als Leiste unten */
.fs .player { margin: 0; border-radius: 0; border: 0; background: transparent; color: inherit; box-shadow: none; padding: .5rem .9rem .6rem; }
.fs .player .pl-stage { display: none; }
.fs .player .pl-tabs { margin-bottom: .3rem; }
.fs .player .btn, .fs .player .pl-btn, .fs .player .pl-val { background: #3a3530; color: #f3ede6; border-color: #57504a; }
.fs .player .pl-tab.on { background: var(--accent); color: var(--accent-text); }
.fs .player .pl-ctrls { margin-top: .3rem; }
.fs .player .muted, .fs .player .pl-label { color: #b5aa9e; }
.fs-more { display: none; }
@media (max-width: 700px) {
  .fs-top .fs-title { display: none; }
  .fs .player .pl-ctrls { gap: .4rem .9rem; }
  .fs-more { display: inline-block; margin: .4rem .9rem 0; }
  .fs:not(.more) .player .pl-ctrls { display: none; }
  .fs-top { gap: .35rem; padding: .35rem .5rem; }
}

/* Vollbild-Symbol im Notenviewer (halbtransparent, rechts oben) */
.pages-wrap { position: relative; }
.fs-fab { position: absolute; top: 10px; right: 22px; z-index: 5; width: 38px; height: 38px; border-radius: 9px;
  display: grid; place-items: center; padding: 0; border: 0; cursor: pointer;
  background: rgba(30, 26, 22, .45); color: #fff; opacity: .65; transition: opacity .2s, background .2s, transform .15s;
  backdrop-filter: blur(2px); }
.fs-fab:hover, .fs-fab:focus-visible { opacity: 1; background: rgba(30, 26, 22, .75); transform: scale(1.06); }
@media (hover: none) { .fs-fab { opacity: .8; } }

/* Abspielen direkt aus der Übersicht */
.mini-play { border: 0; background: none; padding: .1rem .25rem; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; line-height: 1; }
.mini-play:hover { background: var(--accent-soft); }
.mini-play.playing { background: var(--accent); color: var(--accent-text); }
.meta .mini-play { font-size: inherit; }
.mini-bar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 900; width: min(560px, calc(100vw - 24px));
  display: flex; align-items: center; gap: .7rem; padding: .55rem .8rem; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0, 0, 0, .18); }
.mini-bar[hidden] { display: none; }
.mb-play { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-text); cursor: pointer; font-size: 1rem; flex: none; }
.mb-main { flex: 1; min-width: 0; }
.mb-title { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-seek { height: 6px; background: var(--surface2); border-radius: 3px; margin-top: .35rem; cursor: pointer; overflow: hidden; }
.mb-fill { height: 100%; width: 0; background: var(--accent); }
.mb-time { font-size: .75rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mb-close { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
body.has-mini main { padding-bottom: 5rem; }

/* Material für den ganzen Band */
.book-media { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .3rem 1rem; }
.book-media li { display: flex; align-items: center; gap: .45rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.book-media .bm-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.book-media form.inline { margin-left: auto; }
.b.book-wide { background: var(--accent-soft); color: var(--accent); }
.up-allbook { margin-left: auto; }
.up-head { display: flex; align-items: baseline; gap: .3rem; flex-wrap: wrap; }
/* Blätter-Pfeile im Vollbild (Seite / 2 Seiten) */
.fs-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 52px; height: 96px; border: 0; border-radius: 12px;
  background: rgba(20, 18, 16, .45); color: #fff; font-size: 2.6rem; line-height: 1; cursor: pointer; opacity: .55; transition: opacity .2s, background .2s; }
.fs-nav:hover { opacity: 1; background: rgba(20, 18, 16, .75); }
.fs-nav:disabled { opacity: .12; cursor: default; }
.fs-prev { left: 10px; } .fs-next { right: 10px; }
.fs[data-view="width"] .fs-nav { display: none; }
.fs.idle .fs-nav { opacity: 0; pointer-events: none; }
@media (hover: none) { .fs-nav { width: 40px; height: 72px; font-size: 2rem; } }

/* Brotkrumen: Übersicht › Band › Stück */
.crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .45rem; font-size: .9rem; margin-bottom: .3rem; min-width: 0; }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { color: var(--muted); }
.crumbs .cur { color: var(--muted); max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

select.auto-set { outline: 2px solid var(--accent); outline-offset: 1px; transition: outline-color .3s; }

/* Einzelanalyse per KI */
.ai-box { display: flex; align-items: center; gap: .6rem; border: 1px dashed var(--line); border-radius: 10px; padding: .4rem .7rem; margin: .1rem 0 .7rem; }
.ai-box.ok { border-style: solid; border-color: color-mix(in srgb, #2e7d32 45%, var(--line)); }
.ai-box.bad { border-style: solid; border-color: color-mix(in srgb, #c77700 55%, var(--line)); }

/* Anklickbare Etiketten (Filter) */
a.b.fb { text-decoration: none; color: inherit; cursor: pointer; }
a.b.fb:hover { outline: 1px solid currentColor; outline-offset: -1px; }
.meta a.fg { color: inherit; text-decoration: none; }
.meta a.fg:hover { text-decoration: underline; color: var(--accent); }

/* Ansichten der Übersicht */
.view-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: -.3rem 0 .9rem; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--surface); }
.segmented a { padding: .25rem .75rem; border-radius: 999px; text-decoration: none; color: inherit; font-size: .9rem; white-space: nowrap; }
.segmented a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.group-by { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.group-by select { width: auto; }
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ptable { width: 100%; border-collapse: collapse; font-size: .92rem; }
.ptable th { text-align: left; font-weight: 600; font-size: .8rem; color: var(--muted); padding: .55rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ptable th a { color: inherit; text-decoration: none; }
.ptable th a.on, .ptable th a:hover { color: var(--accent); }
.ptable td { padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ptable tr:last-child td { border-bottom: 0; }
.ptable tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.ptable .c-title a { font-weight: 600; color: var(--text); text-decoration: none; }
.ptable .c-title a:hover { color: var(--accent); }
.ptable .c-book a { text-decoration: none; }
.ptable .c-ico { white-space: nowrap; text-align: right; }
.ptable .c-ico > * { vertical-align: middle; }
.ptable .c-ico .wish-form { display: inline-block; }
.ptable .c-ico .wish svg { width: 18px; height: 18px; }
.ptable td .b { white-space: nowrap; }
.ptable .badges { margin: 0; }
.btable .bt-title { display: inline-flex; align-items: center; gap: .6rem; }
.btable .bt-title img { width: 34px; height: 46px; object-fit: cover; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.group-nav { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: 0 0 .8rem; }
.group-nav a { text-decoration: none; }
details.grp { padding: .3rem .9rem .9rem; margin-bottom: 1rem; }
details.grp > summary { cursor: pointer; list-style: none; }
details.grp > summary::-webkit-details-marker { display: none; }
details.grp > summary h2 { display: inline-flex; align-items: baseline; gap: .5rem; margin: .4rem 0 .6rem; }
details.grp > summary h2::before { content: '▾'; color: var(--muted); font-size: .9rem; }
details.grp:not([open]) > summary h2::before { content: '▸'; }
details.grp .tbl-wrap { border: 0; border-radius: 0; background: none; }
@media (max-width: 900px) { .ptable .c-book, .ptable .c-tempo { display: none; } }
@media (max-width: 640px) { .ptable .c-comp, .ptable .c-key { display: none; } .ptable { font-size: .86rem; } }

/* Sammelbearbeitung */
.band-tools { display: flex; align-items: center; gap: 1rem; margin: .2rem 0 .4rem; }
.band-tools .check { margin: 0; }
.prow .bulk-cb { width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--accent); }
.band-pieces.selectable .prow { cursor: default; }
.prow.picked { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.bulk-panel { position: fixed; left: 50%; transform: translateX(-50%); bottom: .8rem; z-index: 40; width: min(1040px, calc(100vw - 1.2rem));
  border: 2px solid var(--accent); border-radius: 14px; padding: .55rem .9rem; background: var(--surface);
  box-shadow: 0 10px 40px rgba(0,0,0,.25); max-height: calc(100vh - 2rem); overflow: auto; }
body.has-bulk main, body.has-bulk .wrap { padding-bottom: 5rem; }
body.has-mini .bulk-panel { bottom: 4.6rem; }
.bulk-fields { margin-top: .5rem; }
.bulk-hint { margin: 0 0 .5rem; }
.bulk-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.seg-mode { display: flex; gap: .8rem; font-size: .82rem; margin-top: .25rem; color: var(--muted); }
.seg-mode label { display: inline-flex; flex-direction: row; align-items: center; gap: .3rem; margin: 0; font-weight: 400; white-space: nowrap; }
.seg-mode input { width: auto; margin: 0; }
.flash.ok { color: var(--ok); margin: .2rem 0 .4rem; }
.results { min-width: 0; }
.tbl-wrap { max-width: 100%; }
@media (max-width: 640px) { .segmented a { padding: .25rem .55rem; } }

.ptable .c-tempo { white-space: nowrap; }
@media (min-width: 901px) {           /* gruppierte Ansicht: gleiche Spaltenbreiten in allen Blöcken */
  details.grp .ptable { table-layout: fixed; }
  details.grp .ptable th:nth-child(1) { width: 19%; } details.grp .ptable th:nth-child(2) { width: 15%; }
  details.grp .ptable th:nth-child(3) { width: 14%; } details.grp .ptable th:nth-child(4) { width: 8%; }
  details.grp .ptable th:nth-child(5) { width: 13%; } details.grp .ptable th:nth-child(6) { width: 12%; }
  details.grp .ptable th:nth-child(7) { width: 9%; } details.grp .ptable th:nth-child(8) { width: 6%; }
  details.grp .ptable th:nth-child(9) { width: 8%; }
  details.grp .btable th:nth-child(1) { width: 38%; } details.grp .btable th:nth-child(2) { width: 18%; }
  details.grp .btable th:nth-child(3) { width: 8%; } details.grp .btable th:nth-child(4) { width: 36%; }
  details.grp .ptable td .b { white-space: normal; }
}

/* KI-Analyse mehrerer Stücke */
.ai-band { margin: .2rem 0 .5rem; padding: .4rem .7rem; border-radius: 10px; border: 1px dashed var(--line); }
.ai-band.done { border-style: solid; }
.ai-band summary { cursor: pointer; }
.ai-band ul { margin: .4rem 0 .1rem; padding-left: 1.1rem; }
.ai-band li.bad { color: var(--warn); }
.prow.ai-run .ptitle::after { content: ' 🤖 läuft …'; font-weight: 400; font-size: .8rem; color: var(--muted); }

.review-row .bulk-cb { width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--accent); }
.review-row.picked { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.review-row.ai-run .title::after { content: ' 🤖 läuft …'; font-weight: 400; font-size: .8rem; color: var(--muted); }

/* ---------------------------------------------------------------- Übe-Werkzeuge: Metronom & Stimmgerät */
.pdock { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: flex; flex-direction: column; gap: .6rem;
  width: min(360px, calc(100vw - 1.4rem)); max-height: calc(100vh - 2rem); overflow: auto; pointer-events: none; }
.pdock > .ptool { pointer-events: auto; }
body.has-mini .pdock { bottom: 5rem; }
.fs .pdock { position: absolute; bottom: 5.2rem; z-index: 6; color: var(--text); }
.pdock.inline { position: static; width: auto; max-height: none; overflow: visible; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; pointer-events: auto; }
.ptool { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .7rem .9rem .8rem;
  box-shadow: 0 10px 34px rgba(0,0,0,.22); }
.pdock.inline .ptool { box-shadow: var(--shadow); }
.ptool[hidden] { display: none; }
.ptool header { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .5rem; }
.ptool .pt-close { background: none; border: 0; font-size: 1rem; color: var(--muted); cursor: pointer; padding: 0 .2rem; }
.ptool .mt-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: .4rem .6rem; margin: .5rem 0; }
.ptool .mt-opts label { font-size: .8rem; margin: 0; }
.ptool .mt-opts select { width: 100%; }
.ptool .mt-foot { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-top: .3rem; }
[data-tool].on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* Metronom */
.ptool.metro { padding-bottom: .9rem; }
.mt-src { display: flex; align-items: center; justify-content: center; gap: .4rem; font-size: .8rem; color: var(--muted); margin: -.2rem 0 .5rem; }
.mt-src[hidden] { display: none; }
.mt-tag { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: .05rem .5rem; font-weight: 600; font-size: .72rem; }
.mt-tag.off { background: var(--surface2); color: var(--muted); }
.mt-hero { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .1rem 0 .7rem; }
.mt-round { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--surface2);
  color: var(--text); font-size: 1.5rem; line-height: 1; cursor: pointer; transition: background .15s, transform .08s; }
.mt-round:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.mt-round:active { transform: scale(.92); }
.mt-read { text-align: center; flex: 1; min-width: 0; }
.mt-num { display: flex; align-items: baseline; justify-content: center; gap: .25rem; }
.mt-num .mt-unit { font-size: 1.15rem; color: var(--muted); white-space: nowrap; }
.mt-num .mt-eq { color: var(--muted); font-size: 1.1rem; }
.ptool .mt-bpm { width: 4.6ch; border: 0; background: transparent; font-size: 3rem; font-weight: 800; line-height: 1; text-align: center;
  padding: 0; color: var(--text); font-variant-numeric: tabular-nums; -moz-appearance: textfield; letter-spacing: -.02em; }
.ptool .mt-bpm::-webkit-outer-spin-button, .ptool .mt-bpm::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ptool .mt-bpm:focus { outline: 2px solid var(--accent-soft); border-radius: 8px; }
.mt-name { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-top: .15rem; }
.mt-beats { display: flex; gap: 6px; margin: 0 0 .8rem; height: 30px; }
.mt-beats span { flex: 1; position: relative; border-radius: 7px; background: var(--surface2); border: 1px solid var(--line);
  transition: background .25s ease-out, transform .25s ease-out; display: flex; align-items: center; justify-content: center; }
.mt-beats span i { font-style: normal; font-size: .72rem; font-weight: 700; color: var(--muted); }
.mt-beats span.one { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.mt-beats span.one i { color: var(--accent); }
.mt-beats span.mid { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.mt-beats span.hit { background: var(--accent); border-color: var(--accent); transition: none; transform: scaleY(1.12); }
.mt-beats span.hit i { color: var(--accent-text); }
.mt-beats span.one.hit { background: var(--bad); border-color: var(--bad); }
.mt-beats.many span i { display: none; }
.mt-slide { display: flex; align-items: center; gap: .6rem; }
.ptool .mt-slider { flex: 1; margin: 0; accent-color: var(--accent); }
.mt-tap { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: .3rem .9rem;
  font-weight: 600; font-size: .85rem; cursor: pointer; }
.mt-tap:active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.mt-pct { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: .55rem 0 .2rem; }
.mt-pct:empty { display: none; }
.mt-pct-now { font-size: .78rem; color: var(--accent); font-weight: 600; margin-left: .2rem; }
.chipbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .12rem .55rem; font-size: .76rem; cursor: pointer; color: inherit; }
.chipbtn:hover { border-color: var(--accent); }
.chipbtn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.mt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .6rem; margin: .7rem 0 .5rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.mt-grid label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; font-weight: 600; }
.mt-grid select { width: 100%; margin-top: .15rem; font-size: .88rem; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 400; padding: .3rem .45rem; }
.mt-trainer { border-top: 1px solid var(--line); padding-top: .5rem; font-size: .88rem; }
.mt-trainer summary { cursor: pointer; font-weight: 600; list-style: none; }
.mt-trainer summary::-webkit-details-marker { display: none; }
.mt-trainer summary::before { content: '▸ '; color: var(--muted); }
.mt-trainer[open] summary::before { content: '▾ '; }
.mt-trainer .check { margin: .45rem 0 .3rem; }
.tr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.tr-grid label { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0; font-weight: 600; }
.tr-in { display: flex; align-items: center; gap: .2rem; margin-top: .15rem; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 400; font-size: .8rem; white-space: nowrap; }
.tr-in input { width: 100%; min-width: 0; padding: .2rem .3rem; text-align: center; }
.tr-state { margin-top: .4rem; font-size: .82rem; display: flex; align-items: center; gap: .5rem; }
.tr-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface2); overflow: hidden; }
.tr-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.ptool.metro .mt-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: .7rem; }
.mt-go { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-text); cursor: pointer;
  font-size: 1.5rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent);
  transition: transform .08s, background .2s; }
.mt-go:hover { transform: scale(1.04); }
.mt-go:active { transform: scale(.95); }
.mt-go .mt-go-ico { margin-left: 3px; }
.mt-go.on { background: var(--bad); box-shadow: 0 4px 14px color-mix(in srgb, var(--bad) 40%, transparent); }
.mt-go.on .mt-go-ico { margin-left: 0; font-size: 1.2rem; }
.mt-vol { display: flex; flex-direction: row; align-items: center; gap: .3rem; margin: 0; justify-self: start; }
.mt-vol input { width: 82px; accent-color: var(--accent); }
.mt-key { justify-self: end; border: 1px solid var(--line); border-radius: 5px; padding: 0 .35rem; font-size: .7rem; }
.ptool.metro { transition: box-shadow .25s ease-out; }
.ptool.metro.flash1 { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 45%, transparent), 0 10px 34px rgba(0,0,0,.22); transition: box-shadow 0s; }
.ptool.metro.flash { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent), 0 10px 34px rgba(0,0,0,.22); transition: box-shadow 0s; }
[data-tool="metro"].on.beat { animation: beatpulse .18s ease-out; }
@keyframes beatpulse { from { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 60%, transparent); } to { box-shadow: none; } }
@media (hover: none) { .mt-key { display: none; } }

/* Stimmgerät */
.tu-display { text-align: center; padding: .2rem 0 .3rem; }
.tu-note { font-size: 3rem; font-weight: 700; line-height: 1.1; min-height: 3.3rem; color: var(--muted); font-family: Georgia, 'Times New Roman', serif; }
.ptool.tuner.live .tu-note { color: var(--text); }
.ptool.tuner.in .tu-note { color: var(--ok); }
.tu-meter { position: relative; height: 34px; margin: .4rem .4rem .3rem; border-radius: 8px;
  background: linear-gradient(90deg, var(--bad-soft), var(--warn-soft) 35%, var(--ok-soft) 45%, var(--ok-soft) 55%, var(--warn-soft) 65%, var(--bad-soft)); }
.tu-scale { position: absolute; inset: auto 0 -1.05rem 0; display: flex; justify-content: space-between; font-size: .68rem; color: var(--muted); }
.tu-zone { position: absolute; left: 45%; width: 10%; top: 0; bottom: 0; border-left: 1px dashed var(--ok); border-right: 1px dashed var(--ok); }
.tu-needle { position: absolute; top: -4px; bottom: -4px; left: 50%; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--muted);
  transition: left .12s ease-out; opacity: .35; }
.ptool.tuner.live .tu-needle { opacity: 1; background: var(--warn); }
.ptool.tuner.near .tu-needle { background: var(--warn); }
.ptool.tuner.in .tu-needle { background: var(--ok); }
.tu-info { margin-top: 1.2rem; min-height: 1.2em; }
.tu-go.on { background: var(--bad); border-color: var(--bad); }
.tu-warn { background: var(--warn-soft); color: var(--text); border-radius: 8px; padding: .5rem .6rem; margin: .5rem 0 0; }
.tu-warn code { font-size: .85em; }
@media (max-width: 640px) {
  .pdock { right: .6rem; bottom: .6rem; }
  .head-actions [data-tool] { padding-left: .6rem; padding-right: .6rem; }
}
.head-actions { flex-wrap: wrap; }
.ptool header b { white-space: nowrap; }
@media (max-width: 640px) { .ptool header { flex-wrap: wrap; } .ptool header .mt-src { order: 3; flex-basis: 100%; } }

.fs .pdock { top: 5.2rem; bottom: auto; max-height: calc(100% - 5.2rem - 8.5rem); }
.fs.idle .pdock { opacity: .9; }

.mt-pct { display: grid; grid-template-columns: repeat(6, 1fr); gap: .25rem; }
.mt-pct .chipbtn { padding: .12rem 0; text-align: center; }
.mt-pct .mt-pct-now { grid-column: 1 / -1; text-align: center; margin: 0; }
.tr-grid label { white-space: nowrap; }

/* Duplikate */
.dup-box { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 40%, var(--surface)); }
.dup-box ul { margin: .3rem 0; padding-left: 1.2rem; }
.dup-group { border: 1px solid var(--line); border-radius: 10px; padding: .4rem .7rem; margin: .5rem 0; background: var(--surface); }
.dup-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .7rem; padding: .25rem 0; }
.dup-row + .dup-row { border-top: 1px dashed var(--line); }

/* Werkzeuge platzieren: frei, gestapelt (Standard) oder in der rechten Spalte eingerastet */
.ptool header { cursor: grab; touch-action: none; user-select: none; }
.pdock.inline .ptool header { cursor: default; }
.pt-grip { color: var(--muted); font-size: 1rem; line-height: 1; margin-right: .1rem; letter-spacing: -.1em; }
.pt-pin { background: none; border: 0; cursor: pointer; font-size: .85rem; padding: 0 .2rem; opacity: .55; filter: grayscale(1); }
.pt-pin:hover { opacity: 1; filter: none; }
.ptool.docked .pt-pin { opacity: 1; filter: none; }
.ptool.free { position: fixed; z-index: 70; width: min(360px, calc(100vw - 1.2rem)); max-height: calc(100vh - 12px); overflow: auto; }
.ptool.dragging { opacity: .92; box-shadow: 0 18px 50px rgba(0,0,0,.35); cursor: grabbing; transition: none !important; }
.ptool.docked { position: static; width: auto; max-height: none; overflow: visible; box-shadow: var(--shadow); margin-bottom: 1rem; pointer-events: auto; }
body.tool-dragging, body.tool-dragging * { user-select: none !important; cursor: grabbing !important; }
section.info.drop-target { outline: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 6px; border-radius: 12px; }
.dock-ph { height: 64px; border: 2px dashed var(--accent); border-radius: 14px; margin-bottom: 1rem; display: flex; align-items: center;
  justify-content: center; color: var(--accent); font-size: .85rem; font-weight: 600; background: var(--accent-soft); }

/* Rechte Spalte: Karten ein-/ausklappen */
.pn-bar { display: flex; justify-content: flex-end; margin: -.4rem 0 .3rem; min-height: 1.2rem; }
.pn-head { display: flex; align-items: center; gap: .5rem; margin: -.2rem 0 .5rem; }
.pn-head .pn-title { font-size: .95rem; }
.pn-has-toggle { display: flex; align-items: center; gap: .5rem; }
h2.pn-has-toggle .pn-toggle, .pn-head .pn-toggle { margin-left: auto; }
.pn-toggle { background: none; border: 1px solid transparent; border-radius: 6px; color: var(--muted); cursor: pointer; font-size: .95rem;
  width: 1.7rem; height: 1.7rem; line-height: 1; flex: none; transition: transform .15s; }
.pn-toggle:hover { border-color: var(--line); color: var(--accent); }
[data-panel].collapsed .pn-toggle { transform: rotate(-90deg); }
[data-panel].collapsed > :not(header):not(.form-head):not(h2):not(.pn-head) { display: none !important; }
[data-panel].collapsed { padding-bottom: .55rem; }
[data-panel].collapsed > .pn-head, [data-panel].collapsed > h2, [data-panel].collapsed > header, [data-panel].collapsed > .form-head { margin-bottom: 0; }
.ptool.metro.collapsed .mt-beats { display: none; }
section.info > [data-panel] > h2, section.info > [data-panel] > .form-head h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
.pn-head .pn-title { font-size: 1.05rem; }
section.info > .ptool header b { font-size: 1.05rem; }

.ai-start { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; border: 2px solid var(--accent); border-radius: 12px;
  padding: .7rem .9rem; margin: .3rem 0 .8rem; background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.ai-start-text { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: .2rem; }

/* Einstellungen: Schwierigkeitsstufen */
.lv-row { border: 1px solid var(--line); border-radius: 10px; margin-bottom: .4rem; background: var(--surface); }
.lv-row summary { cursor: pointer; padding: .45rem .7rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.lv-row[open] summary { border-bottom: 1px solid var(--line); }
.lv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem .7rem; padding: .6rem .7rem .8rem; }
.lv-grid label { margin: 0; font-size: .82rem; }
.lv-grid .wide { grid-column: span 2; }
.lv-grid textarea { min-height: 2.6rem; }
.lv-h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.lv-badges { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .4rem .8rem; margin-bottom: .8rem; }
.lv-badge { display: flex; align-items: center; gap: .35rem; font-size: .9rem; }
.lv-badge select { width: auto; padding: .15rem .3rem; }
@media (max-width: 700px) { .lv-grid { grid-template-columns: 1fr 1fr; } }

/* Schwierigkeit 1–10: Filter */
.lvl-chips { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.lvl-chip { margin: 0; cursor: pointer; }
.lvl-chip input { position: absolute; opacity: 0; pointer-events: none; }
.lvl-chip span { display: flex; align-items: center; justify-content: center; height: 28px; border-radius: 7px; font-weight: 700;
  font-size: .85rem; border: 2px solid transparent; color: var(--text); opacity: .75; transition: opacity .15s, border-color .15s; }
.lvl-chip:hover span { opacity: 1; }
.lvl-chip input:checked + span { border-color: var(--accent); opacity: 1; box-shadow: 0 0 0 1px var(--accent); }
.lvl-caps { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); margin-top: .2rem; }
.lvl-caps .c-mid { text-align: center; }
.diff-warn { color: var(--warn); font-size: .8rem; }

.lvl-caps-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 0 3px; margin-top: .25rem; font-size: .68rem; color: var(--muted); line-height: 1.25; }
.lvl-caps-grid .cap { white-space: nowrap; justify-self: center; }
.lvl-caps-grid .r1 { grid-row: 1; } .lvl-caps-grid .r2 { grid-row: 2; }
.lvl-caps-grid .k1 { justify-self: start; } .lvl-caps-grid .k10 { justify-self: end; }

/* Schulen: Kapitelbaum – Einrückung je Ebene mit Führungslinie, damit sichtbar ist, wo ein Kapitel endet */
.chap-head { list-style: none; font-weight: 700; color: var(--accent); margin: 0; padding: .9rem 0 .2rem; border-bottom: 1px solid var(--line); }
.chap-head.d0 { font-size: 1.08rem; }
.chap-head.d1 { font-size: .98rem; }
.chap-head.d2 { font-size: .92rem; border-bottom-style: dotted; }
.chap-head.d3, .chap-head.d4, .chap-head.d5 { font-size: .88rem; border-bottom: 0; }
:root { --guide: color-mix(in srgb, var(--accent) 35%, transparent); --ind: 1.2rem; }
.chap-head.d1, .prow.depth1, .review-row.depth1 { padding-left: var(--ind); }
.chap-head.d2, .prow.depth2, .review-row.depth2 { padding-left: calc(var(--ind) * 2); }
.chap-head.d3, .prow.depth3, .review-row.depth3 { padding-left: calc(var(--ind) * 3); }
.chap-head.d4, .chap-head.d5, .prow.depth4, .review-row.depth4, .prow.depth5, .review-row.depth5 { padding-left: calc(var(--ind) * 4); }
.chap-head.d1, .prow.depth1, .review-row.depth1,
.chap-head.d2, .prow.depth2, .review-row.depth2,
.chap-head.d3, .prow.depth3, .review-row.depth3,
.chap-head.d4, .prow.depth4, .review-row.depth4, .chap-head.d5, .prow.depth5, .review-row.depth5 {
  background-repeat: no-repeat; background-size: 2px 100%;
  background-image: linear-gradient(var(--guide), var(--guide)), linear-gradient(var(--guide), var(--guide)),
                    linear-gradient(var(--guide), var(--guide)), linear-gradient(var(--guide), var(--guide)); }
.chap-head.d1, .prow.depth1, .review-row.depth1 { background-position: .35rem 0, -9rem 0, -9rem 0, -9rem 0; }
.chap-head.d2, .prow.depth2, .review-row.depth2 { background-position: .35rem 0, calc(var(--ind) + .35rem) 0, -9rem 0, -9rem 0; }
.chap-head.d3, .prow.depth3, .review-row.depth3 { background-position: .35rem 0, calc(var(--ind) + .35rem) 0, calc(var(--ind) * 2 + .35rem) 0, -9rem 0; }
.chap-head.d4, .prow.depth4, .review-row.depth4, .chap-head.d5, .prow.depth5, .review-row.depth5 {
  background-position: .35rem 0, calc(var(--ind) + .35rem) 0, calc(var(--ind) * 2 + .35rem) 0, calc(var(--ind) * 3 + .35rem) 0; }
.prow.theory .ptitle::before { content: "📖 "; }
.crumbs .chap { color: var(--muted); }
@media (max-width: 640px) { :root { --ind: .8rem; } }
.lvl-caps-grid .cap.k1 { grid-column: 1 / 4 !important; justify-self: start; } .lvl-caps-grid .cap.k10 { grid-column: 8 / 11 !important; justify-self: end; }
/* Anhang bearbeiten */
.att { flex-wrap: wrap; }
.att-edit { flex-basis: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .7rem; padding: .6rem; margin-top: .3rem;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface)); border: 1px solid var(--line); border-radius: 8px; }
.att-edit[hidden] { display: none; }
.att-edit label { margin: 0; font-size: .85rem; }
.att-edit .wide, .att-edit-act { grid-column: 1 / -1; }
.att-edit-act { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
@media (max-width: 640px) { .att-edit { grid-template-columns: 1fr; } }
/* Stimmen-Editor: Kopfzeile nur mit Zeilen, Abstand des Knopfs */
.parts-rows:not(:has(.pr)) .pr-head { display: none; }
.parts-rows:not(:has(.pr)) { margin-bottom: 0; }
.pr-head span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.parts-edit .pr-add { margin: .1rem 0 .8rem; }
/* Sternebewertung */
.stars-b { color: #c98a00; font-weight: 650; font-size: .82rem; white-space: nowrap; }
.stars-b small { color: var(--muted); font-weight: 400; }
.rate { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .35rem; }
.rate-form { display: inline-flex; margin: 0; }
.rate-form .star { border: 0; background: none; padding: 0 .08rem; font-size: 1.35rem; line-height: 1; cursor: pointer; color: var(--line); transition: color .1s, transform .1s; }
.rate-form .star.on { color: #e0a800; }
.rate-form:hover .star { color: #f0c040; }
.rate-form .star:hover ~ .star { color: var(--line); }
.rate-form .star:hover { transform: scale(1.15); }
.rate-form .star:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
.ptable .c-rate { white-space: nowrap; }
/* Stimmen als PDF */
.stimmen-btns { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 .6rem; }
.stimmen-sel summary { cursor: pointer; color: var(--muted); }
.stimmen-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .1rem .8rem; max-height: 16rem; overflow: auto; margin-top: .3rem; }
.stimmen-list .check { margin: 0; }
.part-pdfs { display: inline-flex; flex-wrap: wrap; gap: .2rem; }
.part-pdfs a { font-size: .7rem; padding: .05rem .4rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.part-pdfs a:hover { color: var(--accent); border-color: var(--accent); }
/* Bewertung rechts unter den Knöpfen */
.head-side { display: flex; flex-direction: column; align-items: flex-end; gap: .55rem; }
.rate.rate-side { margin: 0; padding: .35rem .7rem .35rem .55rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow); gap: .6rem; }
.rate-side .rate-form .star { font-size: 1.7rem; padding: 0 .1rem; }
.rate-side .rate-info { font-size: .85rem; }
@media (max-width: 900px) { .head-side { align-items: flex-start; } .rate.rate-side { border-radius: 12px; } }
@media (max-width: 480px) { .rate-side .rate-form .star { font-size: 1.5rem; } .rate-side .rate-info { font-size: .78rem; } }
/* Einstellungen: Bereiche mit Seitenleiste */
main.settings { max-width: 1100px; }
.set-layout { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.set-nav { position: sticky; top: 4.5rem; display: flex; flex-direction: column; gap: .15rem; }
.set-nav a { display: flex; gap: .55rem; align-items: center; padding: .55rem .75rem; border-radius: 10px; color: var(--text); text-decoration: none; }
.set-nav a:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.set-nav a.on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 650; }
.js .set-pane:not(.on) { display: none; }
.set-pane > .card:first-child { margin-top: 0; }
@media (max-width: 760px) {
  .set-layout { grid-template-columns: minmax(0, 1fr); }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; gap: .3rem; padding-bottom: .3rem; scrollbar-width: thin; }
  .set-nav a { white-space: nowrap; padding: .45rem .7rem; border: 1px solid var(--line); background: var(--surface); }
}
.partbooks { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .6rem; } .partbooks summary { cursor: pointer; font-weight: 600; } .partbooks form { margin-top: .5rem; }
/* Hinweis statt Neuladen, solange gearbeitet wird */
.np-refresh { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 60; display: flex; gap: .7rem; align-items: center;
  flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 2rem); padding: .6rem .9rem; background: var(--surface);
  border: 1px solid var(--accent); border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
/* Hinweisfenster „KI-Analyse starten?“ */
#ai-prompts { position: fixed; right: 1rem; bottom: 1rem; z-index: 70; display: flex; flex-direction: column; gap: .6rem; width: min(24rem, calc(100vw - 2rem)); }
.aip { position: relative; background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; padding: .8rem .9rem;
  box-shadow: 0 8px 28px rgba(0,0,0,.2); animation: aip-in .25s ease-out; }
.aip b { display: block; padding-right: 1.4rem; }
.aip p { margin: .25rem 0 .55rem; }
.aip-act { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.aip-x { position: absolute; top: .35rem; right: .45rem; border: 0; background: none; font-size: 1.2rem; color: var(--muted); cursor: pointer; }
.after-upload { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; margin: .4rem 0 .9rem; }
.after-upload legend { font-weight: 600; padding: 0 .3rem; }
.after-upload .check { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: .5rem;
  margin: .3rem 0; text-align: left; width: auto; }
.after-upload .check input { width: auto; flex: 0 0 auto; margin: 0; }
@keyframes aip-in { from { transform: translateY(12px); opacity: 0; } }

/* Band: Inhalt auf einen Blick */
.band-contents { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .45rem; margin: -.2rem 0 .8rem; font-size: .9rem; }
.band-contents b { margin-right: .2rem; }
.band-contents .bc { background: var(--surface2); border: 1px solid var(--line); border-radius: 999px; padding: .1rem .6rem; }
.band-contents .bc-piano { background: none; color: var(--muted); }

/* Notenerkennung auf dem Mini-PC */
.omr-remote { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; margin: .6rem 0 .9rem; }
.omr-remote legend { font-weight: 600; padding: 0 .3rem; }
.omr-remote .check { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: .5rem; margin: .25rem 0; }
.omr-remote .check input { width: auto; flex: 0 0 auto; margin: 0; }
.omr-remote-fields { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: .5rem; align-items: end; margin-top: .5rem; }
.omr-remote-fields label { margin: 0; }
@media (max-width: 700px) { .omr-remote-fields { grid-template-columns: 1fr; } }
.omr-remote-status.ok { color: var(--ok); } .omr-remote-status.err { color: var(--bad); }

.update-pill { font-size: .8rem; padding: .15rem .6rem; border-radius: 999px; background: var(--warn-soft); color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line)); text-decoration: none; white-space: nowrap; }
.update-pill[hidden] { display: none; }

/* Uploader: mehrere markieren */
.up-file { cursor: pointer; user-select: none; }
.up-file .up-sel { margin: 0 .1rem 0 0; width: auto; align-self: center; cursor: pointer; }
.up-row.sel { background: var(--accent-soft); border-radius: 6px; }
.up-bulk { display: inline-flex; align-items: center; gap: .5rem; margin-left: .8rem; }
.up-bulk[hidden] { display: none; }
.up-all { display: inline-flex; flex-direction: row; align-items: center; gap: .3rem; margin: 0; font-size: .85rem; color: var(--text); }
.up-all input { width: auto; margin: 0; }
.up-allkind { padding: .25rem .5rem; font-size: .85rem; width: auto; }

/* „Gespeichert.“ als kurzer Hinweis unten (Seite bleibt an der Stelle, Bearbeitungsmodus bleibt offen) */
.saved-toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 60; margin: 0;
  box-shadow: var(--shadow); animation: np-toast 3s ease forwards; pointer-events: none; }
@keyframes np-toast { 0%, 75% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

.tempi-text { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; line-height: 1.45; }
.mm-est { display: block; margin-top: .25rem; }

/* Kapitel auf-/zuklappen und verwalten */
.chap-head { cursor: pointer; user-select: none; }
.chap-head:hover { color: var(--text); }
.chap-caret { display: inline-block; width: 1.1em; transition: transform .15s; color: var(--muted); }
.chap-head.folded .chap-caret { transform: rotate(-90deg); }
.chap-n { font-size: .75rem; font-weight: 500; color: var(--muted); background: var(--surface2); border-radius: 999px; padding: 0 .45rem; margin-left: .3rem; }
.chap-hidden { display: none !important; }
.chap-manage { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.chap-manage > summary { cursor: pointer; font-weight: 600; }
.chap-row { display: flex; gap: .4rem; align-items: center; margin: .35rem 0; padding-left: calc(var(--lv, 0) * 1.4rem); }
.chap-row input[name=new] { flex: 1; margin: 0; }

/* ================================================================ Neues UI (Okt. 2026) */
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Filterleiste oben statt Seitenleiste */
.layout.topfilters { display: block; }
.topfilters .filters { position: relative; top: auto; max-height: none; overflow: visible; padding: 0; display: block; }
.fbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem; margin: 0 0 1.4rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.fbar > label, .fbar label.fbar-search { margin: 0; }
.fbar-search { flex: 1 1 240px; display: flex !important; flex-direction: row !important; align-items: center; gap: .5rem;
  height: 42px; padding: 0 .8rem; border-radius: 10px; background: var(--bg); color: var(--muted); }
.fbar-search input.search { flex: 1; border: 0; background: transparent; padding: 0; margin: 0; height: 100%; font-size: .95rem; box-shadow: none; outline: none; }
.fdrop { position: relative; border: 0 !important; padding: 0 !important; }
.fdrop > summary { list-style: none; display: flex; align-items: center; gap: .35rem; height: 42px; padding: 0 .85rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 500; font-size: .9rem; cursor: pointer; white-space: nowrap; user-select: none; }
.fdrop > summary::-webkit-details-marker { display: none; }
.fdrop > summary::after { content: "▾"; color: var(--muted); font-size: .8rem; order: 3; }
.topfilters .fdrop > summary::before { content: none; border: 0; transform: none; width: auto; height: auto; margin: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
.fdrop.more > summary { border-style: dashed; color: var(--muted); }
.fdrop.active > summary { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 650; }
.topfilters .fdrop > summary[data-n]:not([data-n=""])::before { content: attr(data-n); order: 2; min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); font-size: .72rem; display: inline-flex; align-items: center; justify-content: center;
  transform: none; border: 0; margin: 0; box-sizing: border-box; width: auto; }
.fdrop[open] > summary { border-color: var(--accent); }
.fpanel { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 330px; max-width: calc(100vw - 2rem); max-height: 70vh; overflow-y: auto;
  padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(30,20,10,.16); }
.fpanel.wide { width: 440px; }
.fdrop.more .fpanel { left: auto; right: 0; }
.fpanel h4 { margin: 1rem 0 .45rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fpanel h4:first-child { margin-top: 0; }
.fmore-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1rem; }
.fmore-row label:last-child:nth-child(odd) { grid-column: 1 / -1; }
.fsort { display: flex !important; flex-direction: row !important; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted); margin-left: auto !important; }
.fsort select { height: 42px; width: auto; margin: 0; }
.fbar .actions { margin: 0; display: flex; }
.fbar .freset { height: 42px; display: inline-flex; align-items: center; }
@media (max-width: 800px) {
  .topfilters .filters { display: block; }
  .fpanel, .fpanel.wide { position: fixed; left: 1rem !important; right: 1rem !important; top: auto; bottom: 1rem; width: auto; max-height: 65vh; }
  .fsort { margin-left: 0 !important; }
}

/* Karten mit großem Cover */
.topfilters .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.6rem 1.2rem; align-items: start; }
.cv-card { position: relative; display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.cv-cover { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: #fff;
  border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(30,20,10,.08), 0 8px 22px rgba(30,20,10,.09); transition: transform .15s, box-shadow .15s; color: var(--text); text-decoration: none; }
.cv-cover:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(30,20,10,.1), 0 14px 30px rgba(30,20,10,.14); }
.cv-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.cv-cover.noimg { background: repeating-linear-gradient(to bottom, transparent 0 34%, transparent 34%), var(--surface2); }
.cv-count { position: absolute; top: .55rem; right: .55rem; padding: .2rem .6rem; border-radius: 999px; background: rgba(255,255,255,.94); color: #221d18;
  font-size: .75rem; font-weight: 650; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.cv-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; margin-top: .15rem; }
.cv-title { font-weight: 650; font-size: 1rem; line-height: 1.25; color: var(--text); text-decoration: none; }
.cv-title:hover { color: var(--accent); }
.cv-comp { font-size: .88rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--accent); opacity: .35; }
.cv-wish { position: absolute; top: .45rem; right: .45rem; }
.cv-wish .wish { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.94); display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.cv-wish .wish svg { width: 18px; height: 18px; }
.cv-card .badges { margin: .15rem 0 0; gap: .3rem; }
.cv-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }
.cv-meta .match { margin: 0; font-size: .82rem; color: var(--accent); font-weight: 600; }
.cv-meta .fg { color: inherit; }
@media (max-width: 480px) { .topfilters .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem .8rem; } }

/* Bandansicht */
.band-head2 { display: flex; gap: 1.6rem; align-items: flex-end; flex-wrap: wrap; margin: .6rem 0 1.4rem; }
.bh-cover { width: 170px; aspect-ratio: .77; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  box-shadow: 0 2px 4px rgba(30,20,10,.08), 0 12px 28px rgba(30,20,10,.12); }
.bh-body { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.bh-body h1 { margin: 0; font-size: 2rem; line-height: 1.15; letter-spacing: -.01em; }
.bh-comp { font-size: 1.05rem; color: var(--muted); }
.bh-body .badges { margin: .3rem 0 0; }
.bh-body .band-contents { margin: .1rem 0 0; }
.bh-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.bh-actions .btn { height: 44px; display: inline-flex; align-items: center; gap: .35rem; padding: 0 1rem; }
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; min-width: 44px; justify-content: center; }
details.menu > summary[aria-label] { font-size: 1.2rem; letter-spacing: .05em; }
.book-drop { margin-top: .9rem; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 260px; padding: .4rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(30,20,10,.16); display: flex; flex-direction: column; }
.menu-pop form { margin: 0; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: .6rem .75rem; border: 0; border-radius: 8px; background: none;
  color: var(--text); font: inherit; font-size: .92rem; text-decoration: none; cursor: pointer; min-height: 40px; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface2); }
.menu-pop button.danger { color: var(--bad); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: .3rem 0; }
.menu-note { margin: .3rem .75rem .4rem; padding-top: .5rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); word-break: break-word; }
.fold-card > summary { list-style: none; cursor: pointer; }
.fold-card > summary::-webkit-details-marker { display: none; }
.fold-card > summary h2 { margin: 0; display: inline; }
.fold-card > summary::after { content: " ▸"; color: var(--muted); }
.fold-card[open] > summary::after { content: " ▾"; }
.fold-card[open] > summary { margin-bottom: .8rem; }
.list-modes { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; align-items: center; margin: .2rem 0 .8rem; }
.lm-group { display: inline-flex; align-items: center; gap: .5rem; }
.seg2 { display: inline-flex; background: var(--surface2); border-radius: 9px; padding: 3px; }
.seg2 a { padding: .35rem .8rem; border-radius: 7px; font-size: .85rem; color: var(--text); text-decoration: none; }
.seg2 a.on { background: var(--surface); font-weight: 650; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.prow .ppage { width: 2.2rem; flex: none; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.grp-genre .chap-head, .grp-none .chap-head { padding-left: 0; }
@media (max-width: 640px) { .bh-cover { width: 120px; } .bh-body h1 { font-size: 1.5rem; } }

/* Stückseite: Angaben als Raster */
.mus, .tsym, .unit-pick span { font-family: "Noto Music", "Segoe UI Symbol", "Apple Symbols", "Bravura Text", serif; }
.piece-comp { font-size: 1.05rem; }
.fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; }
.fact { background: var(--surface); padding: .7rem .85rem; display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.fact .fl { font-size: .75rem; color: var(--muted); }
.fact .fv { font-size: 1.02rem; font-weight: 600; display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem; }
.fact .fv .b { font-weight: 600; }
.fact .fsub { font-weight: 400; font-size: .9rem; color: var(--muted); }
.fact .fx { line-height: 1.35; }
.fact .tsym { font-size: 1.35rem; line-height: 1; font-weight: 400; }
.fact .fparts { display: flex; flex-direction: column; gap: .1rem; font-weight: 500; font-size: .92rem; }
.fact .fparts b { font-weight: 650; }
.fact a.fg { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
.fact a.fg:hover { color: var(--accent); }
.facts-card .facts-flags { margin-bottom: .7rem; }
.facts-more { margin-top: .8rem; }

/* Stückseite: Bearbeiten mit Knöpfen statt Auswahllisten */
.pills { display: flex; flex-wrap: wrap; gap: .35rem; }
.pill { margin: 0; flex-direction: row; cursor: pointer; }
.pill input, .unit-pick input, .lvl-pick input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 .85rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: .9rem; user-select: none; }
.pill input:checked + span { background: var(--text); border-color: var(--text); color: var(--surface); font-weight: 600; }
.pill.lv-junior input:checked + span { background: var(--junior); color: var(--text); border-color: var(--text); }
.pill.lv-bronze input:checked + span { background: var(--bronze); color: var(--text); border-color: var(--text); }
.pill.lv-silber input:checked + span { background: var(--silber); color: var(--text); border-color: var(--text); }
.pill.lv-gold input:checked + span { background: var(--gold); color: var(--text); border-color: var(--text); }
.pill input:focus-visible + span, .unit-pick input:focus-visible + span, .lvl-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.lvl-pick { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.lvl-pick .lvl-chip { margin: 0; cursor: pointer; }
.lvl-pick .lvl-chip span { height: 38px; opacity: .55; border: 2px solid transparent; }
.lvl-pick .lvl-chip:hover span { opacity: .85; }
.lvl-pick .lvl-chip input:checked + span { opacity: 1; border-color: var(--text); box-shadow: none; }
.lvl-pick .lp-none span { background: var(--surface2); }
.diff-field .lp-name { font-weight: 400; }
.keypick { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.keypick input[type=range] { flex: 1 1 160px; accent-color: var(--accent); margin: 0; }
.keypick input[type=range].unset { opacity: .45; }
.keypick .kp-end { font-size: .8rem; color: var(--muted); }
.keypick .kp-out { min-width: 5.5rem; font-weight: 650; }
.unit-pick { display: inline-flex; background: var(--surface2); border-radius: 9px; padding: 3px; gap: 1px; }
.unit-pick label { margin: 0; cursor: pointer; }
.unit-pick span { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 .2rem; border-radius: 7px;
  font-size: 1.25rem; color: var(--muted); }
.unit-pick input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tempo-row .mm-wrap { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }

/* Player kompakt */
.player .pl-stage.audio { display: none; }
.fact .fsep { margin-left: -.3rem; }

/* Vollbild: Noten in voller Höhe, schmale schwebende Playerleiste, Fortschritt am Rand */
.fs-scroll.v-width { padding-top: 0; padding-bottom: 0; }
.fs-screen { padding: 0 !important; }
.fs-bottom { left: 50%; right: auto; bottom: 14px; width: min(760px, calc(100vw - 24px)); transform: translateX(-50%); border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); max-height: 60vh; }
.fs.idle .fs-bottom { transform: translate(-50%, calc(100% + 20px)); }
.fs-bottom .fs-more { display: inline-block; position: absolute; right: .7rem; top: .55rem; z-index: 2; margin: 0; }
.fs .player { padding: .55rem .9rem .55rem; }
.fs .player .pl-row { padding-right: 7.5rem; }
.fs:not(.more) .player .pl-ctrls, .fs:not(.more) .player .pl-tabs { display: none; }
.fs .player .pl-bar { margin-right: 8.6rem; }

/* Notenpulte: Steuerfenster (conductor.js) und Verwaltung (/pulte) */
.pult-btn.live { border-color: var(--accent); color: var(--accent); }
.pult-btn .pb-n { font-size: .75rem; color: var(--muted); font-weight: 400; }
.fs [data-pulte-open].on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.pulte-panel { position: fixed; right: 1rem; top: 4.5rem; z-index: 1200; width: min(400px, calc(100vw - 2rem)); max-height: calc(100vh - 6rem); overflow-y: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 44px rgba(20,12,4,.25);
  padding: .9rem; display: flex; flex-direction: column; gap: .75rem; }
.fs .pulte-panel { top: 3.6rem; }
.pp-head { display: flex; align-items: center; gap: .5rem; }
.pp-x { border: 0; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--muted); width: 36px; height: 36px; }
.pp-send { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.pp-state { color: var(--ok); font-weight: 600; }
.pp-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.pp-tg { display: flex !important; flex-direction: row !important; gap: .5rem; align-items: flex-start; padding: .55rem .6rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; margin: 0; }
.pp-tg input { margin-top: .2rem; accent-color: var(--accent); width: 18px; height: 18px; }
.pp-tg span { display: flex; flex-direction: column; gap: .1rem; font-size: .9rem; }
.pp-tg small { color: var(--muted); font-size: .75rem; }
.pp-tg:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pp-acts { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.pp-acts .btn.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.pp-eyes-text { flex: 1 1 140px; margin: 0; }
.pp-sets label { display: flex; flex-direction: row; align-items: center; gap: .5rem; margin: 0; }
.pp-sets select { margin: 0; width: auto; }
.pp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pp-list li { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.pp-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pp-name small { color: var(--muted); font-size: .75rem; }
.pp-list select { margin: 0; width: auto; max-width: 150px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #c9c1b6; flex: none; }
.dot.on { background: #3fa66b; box-shadow: 0 0 0 3px rgba(63,166,107,.2); }
.pp-ring { position: absolute; width: 70px; height: 70px; margin: -35px 0 0 -35px; border-radius: 50%; border: 4px solid var(--accent); pointer-events: none;
  animation: ppring 1.6s ease-out forwards; z-index: 5; }
@keyframes ppring { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.pulte-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.pair-form { display: flex; flex-direction: column; gap: .3rem; }
.pair-form .code-in { font-size: 1.6rem; letter-spacing: .2em; font-variant-numeric: tabular-nums; max-width: 10rem; }
.pair-form button { align-self: flex-start; margin-top: .4rem; }
.set-list, .pult-list { list-style: none; margin: 0 0 .8rem; padding: 0; }
.set-list li, .pult-list li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.set-list li > div { flex: 1; min-width: 0; }
.set-list form, .pult-list form { margin: 0; }
.pult-edit { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.pult-edit input, .pult-edit select { margin: 0; width: auto; }
.pult-info { flex: 1; min-width: 8rem; }
.row-inline { display: flex; gap: .5rem; flex-wrap: wrap; }
.row-inline input { flex: 1 1 180px; margin: 0; }
.flash.bad { color: var(--bad); }
.btn.ghost { background: transparent; }
.topfilters .view-bar { margin-bottom: .7rem; }

/* Etiketten: Farben aus den Einstellungen (base.html <html data-meta… style="--m-…">) */
.b.key { background: var(--m-key, var(--accent-soft)); color: var(--m-key-ink, var(--text)); }
.b.range { background: var(--m-range, var(--surface2)); color: var(--m-range-ink, var(--text)); }
:is(.badges, .pinfo, .ptable td) .b:not(.diff):not(.key):not(.range):not(.level):not(.ok):not(.bad):not(.warn-b):not(.ok-b) {
  background: var(--m-other, var(--surface2)); color: var(--m-other-ink, var(--text)); }
[data-meta-diff="one"] .b.diff { background: var(--m-diff, #f4c0c8); color: var(--m-diff-ink, #221d18); }
[data-meta-level="plain"] .b.level { background: var(--m-other, var(--surface2)); color: var(--m-other-ink, var(--text)); }

/* Schlichter Text: klickbarer Text mit Punkten dazwischen, Stufe mit farbigem Punkt */
html[data-meta="text"] :is(.badges, .pinfo, .ptable td) .b:is(.diff, .key, .range, .level, .fb, .part),
html[data-meta="text"] .badges .b {
  background: none !important; padding: 0; border-radius: 0; color: var(--muted) !important; font-size: .85rem; font-weight: 400; }
html[data-meta="text"] .badges { gap: .15rem 0; align-items: center; }
html[data-meta="text"] .badges > .b + .b::before, html[data-meta="text"] .badges > * + .b::before { content: "·"; margin: 0 .45rem; color: var(--muted); opacity: .6; }
html[data-meta="text"] :is(.badges, .pinfo, .ptable td) .b.diff { color: var(--text) !important; font-weight: 600; }
html[data-meta="text"] :is(.badges, .pinfo, .ptable td) .b.diff::after { content: ""; display: inline-block; width: .55em; height: .55em; border-radius: 50%; margin-left: .35em; vertical-align: .05em; background: var(--dot, var(--accent)); }
html[data-meta="text"] .b.fb:hover { color: var(--accent) !important; text-decoration: underline; }
.d1, .d2 { --dot: #3e9a6e; } .d3, .d4 { --dot: #7aa64c; } .d5, .d6 { --dot: #d18a2a; } .d7, .d8 { --dot: #c8592a; } .d9, .d10 { --dot: #9a3f9e; }
.meta-preview { padding: .8rem 1rem; border: 1px dashed var(--line); border-radius: 10px; margin: .4rem 0 .8rem; background: var(--bg); }
.meta-preview .badges { margin: 0; }
.color-row { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; margin: .6rem 0 .4rem; }
.col-in { display: flex !important; flex-direction: row !important; align-items: center; gap: .5rem; font-size: .9rem; margin: 0; }
.col-in input[type=color] { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); margin: 0; cursor: pointer; }

/* Übersicht: „gruppiert nach“ und Sortierung in einer Zeile */
.view-bar .group-by { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: .5rem; margin: 0; }
.view-bar .group-by select, .fsort select { margin: 0 !important; height: 40px; width: auto; }
.view-bar .segmented { margin: 0; }
.fbar .fsort { align-self: center; }
.fbar .fsort { margin: 0 0 0 auto !important; }
.fbar .fsort select { height: 42px; }
.view-bar .group-by { margin: 0 !important; }
@media (max-width: 800px) { .fbar .fsort { margin: 0 !important; } }

/* Vollbild: im Ruhezustand auch den Mauszeiger ausblenden */
.fs.idle, .fs.idle * { cursor: none !important; }
/* Mitscrollen = nur Bildlauf, keine farbige Zeilenmarkierung (außer beim Zeilen-Mittippen) */
.fs:not(.recording) .fs-hl { display: none !important; }
.pp-tg input { flex: none; margin: .15rem 0 0; }
