:root {
  color-scheme: dark;
  --bg: #16181d;
  --panel: #1f2229;
  --panel-2: #262a33;
  --line: #343946;
  --text: #e8e9ee;
  --muted: #9aa0ad;
  --accent: #ffb454;
  --accent-2: #4fd1c5;
  --danger: #ff6b6b;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { padding: 24px 20px 48px; line-height: 1.45; font-size: 15px; }
main, header.top, footer { max-width: 980px; margin: 0 auto; }
header.top { margin-bottom: 20px; }
h1 { font-size: 30px; letter-spacing: 0.5px; margin: 0 0 6px; }
h1::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 10px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
h2 { font-size: 17px; margin: 0 0 12px; font-weight: 600; }
.tagline { margin: 0; color: var(--muted); max-width: 70ch; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--panel-2); padding: 1px 5px; border-radius: 5px; }
kbd { border: 1px solid var(--line); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px 28px; }
.field > label { display: block; font-weight: 600; margin-bottom: 6px; }
.field > label .muted { font-weight: 400; }
.inline { display: inline-flex; align-items: center; gap: 6px; }
.unit { color: var(--muted); font-size: 13px; }
.checks { margin-top: 8px; gap: 8px 18px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }

input[type="text"], input[type="number"], select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 14px;
}
input[type="text"] { width: 100%; max-width: 360px; }
input[type="number"] { width: 84px; }
select { max-width: 100%; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
button { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; font: inherit; cursor: pointer; }
button:hover { border-color: var(--muted); }
button.small { padding: 5px 10px; font-size: 13px; }
button.primary { background: var(--accent); color: #1a1200; border-color: transparent; font-weight: 600; }
button.primary:hover { filter: brightness(1.07); }
button:disabled { opacity: 0.55; cursor: default; }

.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 44px 20px; text-align: center; cursor: pointer; margin-bottom: 16px; transition: border-color .15s, background .15s; }
.drop:hover, .drop:focus { border-color: var(--accent); }
.drop.over { border-color: var(--accent-2); background: rgba(79, 209, 197, 0.08); }
.drop-inner { display: flex; flex-direction: column; gap: 6px; }
.drop-inner strong { font-size: 18px; }
.drop-inner span { color: var(--muted); }
.drop.compact { padding: 18px; }

canvas#wave { width: 100%; height: 110px; display: block; background: var(--panel-2); border-radius: 8px; }

.keyboard { position: relative; height: 130px; margin-top: 6px; user-select: none; -webkit-user-select: none; }
.key { position: absolute; top: 0; margin: 0; padding: 0; border-radius: 0 0 5px 5px; cursor: pointer; touch-action: none; }
.key.white { height: 100%; background: #f3f3f0; border: 1px solid #b9b9b4; color: #444; z-index: 1; }
.key.black { height: 62%; background: #2b2b2f; border: 1px solid #111; z-index: 2; color: #ccc; }
.key.white:hover { background: #ffffff; }
.key.black:hover { background: #3a3a40; }
.key.playing.white { background: #ffe1ad; }
.key.playing.black { background: #7a5a24; }
.key.rendered.white::after, .key.rendered.black::after { content: ""; position: absolute; bottom: 7px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent-2); }
.key.root { box-shadow: inset 0 -6px 0 var(--accent); }
.key .label { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 10px; pointer-events: none; }

progress { width: 100%; height: 10px; margin-top: 12px; accent-color: var(--accent); }
.result { margin-top: 14px; padding: 14px 16px; background: var(--panel-2); border-radius: 8px; }
.result h3 { margin: 0 0 8px; font-size: 15px; }
.result ol { margin: 6px 0 10px; padding-left: 20px; }
.result li { margin: 4px 0; }
.result .path { display: inline-block; word-break: break-all; }
.error { color: var(--danger); }
footer { margin-top: 28px; color: var(--muted); font-size: 13px; }

@media (max-width: 600px) {
  body { padding: 16px 12px 40px; }
  .card { padding: 14px; }
  .keyboard { height: 100px; }
  .key .label { display: none; }
}
