:root {
  --bg: #14110f; --panel: #1e1a17; --panel2: #262120; --line: #3a322d; --text: #f1e9df; --muted: #a39685; --accent: #e8b04a; --accent2: #5ec2b7; --paper: #fdfbf7;
}
:root[data-theme="light"] { --bg: #f4efe8; --panel: #fffaf2; --panel2: #f1e9dc; --line: #d8cbb8; --text: #2a221b; --muted: #7b6c5a; --accent: #b8741a; --accent2: #1f8f83; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --bg: #f4efe8; --panel: #fffaf2; --panel2: #f1e9dc; --line: #d8cbb8; --text: #2a221b; --muted: #7b6c5a; --accent: #b8741a; --accent2: #1f8f83; } }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px 60px; }
.top { display: flex; align-items: center; gap: 12px; padding: 18px 0 10px; }
.brand { font-weight: 700; letter-spacing: .02em; color: var(--text); font-size: 15px; }
.brand span { color: var(--accent); }
h1 { font: 700 30px/1.15 Georgia, "Times New Roman", serif; margin: 8px 0 4px; }
.sub { color: var(--muted); margin: 0 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 13px; color: var(--muted); }
.chip b { color: var(--text); font-weight: 600; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
button, select { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 14px; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #1b1408; border-color: var(--accent); font-weight: 700; min-width: 92px; }
button.on { border-color: var(--accent2); color: var(--accent2); }
.tools { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
input[type=range] { accent-color: var(--accent); }
.time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.mixer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ch { display: flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; font-size: 13px; }
.ch i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ch button { padding: 1px 7px; font-size: 12px; border-radius: 6px; }
.ch input { width: 64px; }
.tabs { display: flex; gap: 4px; margin: 18px 0 10px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 14px; color: var(--muted); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.sheet-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
#sheet { background: var(--paper); border-radius: 10px; padding: 12px; overflow: auto; max-height: 78vh; color: #111; }
.roll { overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; max-height: 60vh; }
.roll canvas { display: block; }
.keys { position: relative; height: 92px; margin-top: 14px; user-select: none; background: #000; border-radius: 0 0 10px 10px; overflow: hidden; border: 1px solid var(--line); }
.key-w { position: absolute; top: 0; bottom: 0; background: #f6f2ea; border-right: 1px solid #b9b1a3; }
.key-b { position: absolute; top: 0; height: 58%; background: #1b1714; border-radius: 0 0 3px 3px; z-index: 2; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.melody { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.9; }
.melody div span:first-child { color: var(--muted); display: inline-block; width: 64px; }
.warn { border-color: #c05a3d; color: #ffb59f; margin: 10px 0; }
.dl { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.songs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 18px; }
.songs a.card { color: var(--text); display: block; } .songs a.card:hover { border-color: var(--accent); text-decoration: none; }
.songs h3 { margin: 0 0 6px; font: 700 19px Georgia, serif; }
.empty { color: var(--muted); margin-top: 30px; }
@media print { body { background: #fff; } .top, .transport, .mixer, .tabs, .sheet-tools, .keys, header, .card:not(#sheetcard), .dl, h1, .sub, .chips { display: none !important; } #sheet { max-height: none; overflow: visible; } #sheetcard { border: none; padding: 0; } }
