/* Farben aus nownow/marke/nownow-design.md (chill; Flieder = nownow-Begleitfarbe #C9B8EC, helle Akzentschrift #4B3F8F) */
:root, :root[data-theme="chill"][data-mode="dunkel"] {
  --ground: #000000; --surface: #0D0F0D; --surface2: #171A17; --line: #2E342E; --line2: #4C5A4C; --ctrl: #7A8F7A;
  --ink: #FFFFFF; --muted: #D4E0D4; --accent: #C0D8C0; --accent-hover: #D3E6D3; --accent-ink: #C0D8C0;
  --on-accent: #000000; --focus: #FFFFFF; --tint: #2A302A; --sel: #121512; --warn: #E0E0E0; color-scheme: dark;
}
:root[data-theme="chill"][data-mode="hell"] {
  --ground: #FFFFFF; --surface: #FFFFFF; --surface2: #EEF3EC; --line: #D5DDD3; --line2: #9DB59D; --ctrl: #6F8F6F;
  --ink: #141714; --muted: #3E4A3E; --accent: #C0D8C0; --accent-hover: #AECBAE; --accent-ink: #3D7A4D;
  --on-accent: #000000; --focus: #141714; --tint: #E4ECE2; --sel: #F4F8F3; --warn: #3E4A3E; color-scheme: light;
}
:root[data-theme="flieder"][data-mode="dunkel"] {
  --ground: #000000; --surface: #0E0D12; --surface2: #1A1822; --line: #332F40; --line2: #5E5478; --ctrl: #8B82A3;
  --ink: #FFFFFF; --muted: #DCD4EE; --accent: #C9B8EC; --accent-hover: #D9CDF3; --accent-ink: #C9B8EC;
  --on-accent: #000000; --focus: #FFFFFF; --tint: #2A2636; --sel: #15131B; --warn: #E0E0E0; color-scheme: dark;
}
:root[data-theme="flieder"][data-mode="hell"] {
  --ground: #FFFFFF; --surface: #FFFFFF; --surface2: #F1EEF8; --line: #E0DAEE; --line2: #B3A6D6; --ctrl: #7F739E;
  --ink: #15121C; --muted: #4A4060; --accent: #C9B8EC; --accent-hover: #B8A4E4; --accent-ink: #4B3F8F;
  --on-accent: #000000; --focus: #15121C; --tint: #ECE6F7; --sel: #F7F5FC; --warn: #4A4060; color-scheme: light;
}
:root {
  --font-mark: "Instrument Serif", Georgia, serif;
  --font-display: "Noto Sans", system-ui, "Segoe UI", sans-serif;
  --font-text: "Noto Sans", system-ui, "Segoe UI", sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r1: 6px; --r2: 10px; --r3: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.5 var(--font-text); padding-bottom: env(safe-area-inset-bottom); }
h1, h2 { font-family: var(--font-display); font-weight: 600; }
h2 { font-size: 20px; margin: 0 0 var(--s2); }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.row { display: flex; gap: var(--s2); align-items: center; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: var(--s3);
  padding: calc(var(--s3) + env(safe-area-inset-top)) var(--s4) var(--s3); background: var(--ground); border-bottom: 1px solid var(--line); }
.brand { margin: 0; font: 400 30px/1 var(--font-mark); color: var(--accent-ink); letter-spacing: -0.01em; }
.transport { display: flex; align-items: center; gap: var(--s3); }
.bpm { display: flex; align-items: center; gap: var(--s2); font-size: 14px; color: var(--muted); }
.bpm input { width: 64px; }
main { max-width: 760px; margin: 0 auto; padding: var(--s4); display: grid; gap: var(--s6); }
section { min-width: 0; }

input[type=number], select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--ctrl); border-radius: var(--r1); padding: 6px 8px; min-height: 40px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4);
  font: 600 15px var(--font-text); color: var(--ink); background: var(--surface2); border: 1px solid var(--ctrl); border-radius: var(--r2); cursor: pointer;
  transition: transform 150ms var(--ease), background 150ms var(--ease); text-decoration: none; }
.btn:hover { background: var(--tint); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.small { min-height: 36px; padding: 0 var(--s3); font-size: 14px; }
.btn.icon { width: 44px; padding: 0; }
.btn.on { background: var(--accent); color: #000; border-color: var(--accent); }
.btn.rec { background: var(--accent); color: #000; border-color: var(--accent); outline: 4px solid var(--tint); }
.add { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.big { min-height: 52px; flex: 1 1 160px; font-size: 16px; }
.status { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 14px; }

.snippets { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); padding: var(--s4); border-left: 6px solid var(--hue, var(--line)); display: grid; gap: var(--s3); }
.card.sel { outline: 2px solid var(--accent); outline-offset: 2px; background: var(--sel); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.card-name { font: 600 18px var(--font-display); margin: 0; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: var(--s2); }
.tag { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface2); font-size: 14px; }
.tag b { font-weight: 700; }
.tag .en { color: var(--muted); }
.tag.hue { background: var(--hue-bg); color: var(--hue-ink); }
.tag.hue .en { color: inherit; opacity: 0.8; }
.fit { font-size: 13px; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.fit.gut { background: var(--accent); color: #000; } .fit.geht { background: transparent; color: var(--accent-ink); border: 1.5px dashed var(--accent-ink); } .fit.beisst { background: transparent; color: var(--warn); border: 1.5px solid var(--warn); } .fit.frei { background: var(--surface2); color: var(--muted); }
.ctrls { display: grid; gap: var(--s3); }
.ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: 14px; }
.ctrl .lbl { color: var(--muted); min-width: 84px; }
.stepper { display: inline-flex; align-items: center; gap: var(--s1); }
.stepper output { min-width: 4.5em; text-align: center; font-variant-numeric: tabular-nums; }
.range2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s2); flex: 1 1 240px; }
details.wissen { font-size: 14px; color: var(--muted); }
details.wissen summary { cursor: pointer; color: var(--ink); }
details.wissen dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--s3); margin: var(--s2) 0 0; }
details.wissen dt { color: var(--muted); } details.wissen dd { margin: 0; color: var(--ink); }
canvas.wave { width: 100%; height: 48px; display: block; border-radius: var(--r1); background: var(--surface2); }

.radwrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
#rad { width: 100%; max-width: 420px; justify-self: center; }
#rad g { cursor: pointer; }
.radinfo { font-size: 15px; }
@media (min-width: 720px) { .radwrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; } }

.lanes-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); }
.lanes { display: grid; gap: 2px; padding: var(--s2); min-width: max-content; position: relative; }
.lane { display: grid; grid-auto-flow: column; grid-auto-columns: 34px; gap: 2px; height: 48px; position: relative; }
.cell { border: 1px solid var(--ctrl); border-radius: 4px; background: var(--surface2); cursor: pointer; padding: 0; }
.cell.bar { border-left: 3px solid var(--ctrl); }
.cell:hover { background: var(--tint); }
.clip { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; border: 0; padding: 0 6px; font: 600 12px var(--font-text); text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; background: var(--hue-bg); color: var(--hue-ink); }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); pointer-events: none; left: 0; opacity: 0; }
.foot { max-width: 760px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s7); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.themes { display: flex; gap: var(--s1); }
.themes .btn { min-height: 44px; padding: 0 var(--s3); font-size: 14px; }
@media (max-width: 520px) { .top { flex-wrap: wrap; } .bpm > span:first-child { display: none; } }
.suggest { margin-top: var(--s4); padding: var(--s3) var(--s4); border: 1px solid var(--line2); border-radius: var(--r2); }
.card-name { border-bottom: 1px dashed var(--ctrl) !important; border-radius: 0; padding: 2px 0; }
.card-name:focus { border-bottom-style: solid !important; }
input[type=range] { accent-color: var(--ctrl); }
.tabs { display: flex; gap: var(--s2); max-width: 760px; margin: 0 auto; padding: var(--s3) var(--s4) 0; }
.tab { min-height: 44px; padding: 0 var(--s4); font: 600 15px var(--font-text); color: var(--ink); background: transparent; border: 1px solid var(--ctrl); border-radius: var(--r2); cursor: pointer; }
.tab.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
main[hidden] { display: none; }
.mb { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* Ruhigere Knöpfe: nur Hauptaktionen gefüllt, alle anderen gleich hoch und ohne Fläche */
.btn { background: transparent; }
.btn.small { min-height: 40px; font-weight: 600; }
.btn.small.icon { width: 40px; }
.themes .btn, .btn.small, .tab { border-radius: var(--r2); }
.row { gap: var(--s2); }
.ctrls .row.wrap { align-items: flex-start; }
details.more { display: contents; }
details.more > summary { list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { background: var(--tint); }
details.more > div { flex-basis: 100%; }
.opts { gap: var(--s3); margin-bottom: var(--s3); }
.keys { display: grid; grid-template-columns: repeat(var(--n, 12), minmax(44px, 1fr)); gap: 4px; overflow-x: auto; }
.key { min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid var(--ctrl); border-bottom: 5px solid var(--hue); border-radius: var(--r1); background: var(--surface); color: var(--ink); font: 600 14px var(--font-text); cursor: pointer; padding: 4px 2px; }
.key span { font-size: 11px; color: var(--muted); font-weight: 600; }
.key.on { background: var(--hue-bg); color: var(--hue-ink); border-color: var(--hue); }
.key.on span { color: inherit; }
@media (max-width: 560px) { .keys { grid-template-columns: repeat(6, minmax(44px, 1fr)); } }
.grid { display: grid; gap: 4px; padding: var(--s2); min-width: max-content; }
.grow { display: flex; gap: 3px; align-items: stretch; }
.glab { width: 92px; flex: none; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; background: transparent; border: 0; color: var(--ink); font: 600 13px var(--font-text); cursor: pointer; padding: 0 4px; text-align: left; }
.glab span { font-size: 11px; color: var(--muted); }
.gcell { width: 30px; height: 40px; flex: none; border: 1px solid var(--ctrl); border-radius: 4px; background: var(--surface2); cursor: pointer; padding: 0; }
.gcell.beat { border-left: 3px solid var(--ctrl); }
.gcell.on { background: var(--accent); border-color: var(--accent); }
