:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #14161b;
  color: #f5f3f0;
  font-size: 16px;
  line-height: 1.6;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden], .mobile { display: none !important; }
body { margin: 0; }
main { width: min(100% - 48px, 740px); margin: clamp(36px, 8vw, 96px) auto 48px; }
header { margin-bottom: 32px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 650; }
.keys { display: inline-flex; align-items: end; gap: 2px; width: 24px; height: 20px; }
.keys i { display: block; width: 6px; height: 16px; background: #d0f693; border-radius: 2px; }
.keys i:nth-child(2) { height: 20px; }
h1 { margin: 20px 0 8px; font-size: clamp(30px, 6vw, 52px); line-height: 1.18; letter-spacing: -.025em; }
header p { max-width: 560px; margin: 0; color: #bec2cb; }
.panel { padding: clamp(18px, 4vw, 32px); border: 1px solid #343842; border-radius: 20px; background: #1c1f26; }
fieldset { padding: 0; margin: 0 0 22px; border: 0; min-width: 0; }
legend, .file-label { margin: 0 0 8px; font-weight: 650; }
.file-label { display: block; }
.modes { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.modes label { display: flex; align-items: center; gap: 10px; padding: 12px; min-height: 66px; border-radius: 10px; border: 1px solid #535864; cursor: pointer; }
.modes label:has(input:checked) { border-color: #c9ed98; background: #293127; }
input[type="radio"] { flex: 0 0 auto; margin: 0; width: 17px; height: 17px; accent-color: #d0f693; }
.modes small { display: block; color: #c5c9d1; font-size: 13px; }
input[type="file"] { max-width: 100%; width: 100%; font: inherit; font-size: 14px; color: #dddfe7; }
input::file-selector-button, button, .download {
  font: inherit; font-weight: 650; border-radius: 8px; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 17px; cursor: pointer;
}
input::file-selector-button { color: #f0f1f5; background: #343844; margin-right: 12px; margin-top: 2px; }
button, .download { text-decoration: none; color: #14200b; background: #d0f693; }
button.secondary { color: #f0f1f5; background: transparent; border-color: #717785; }
button:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 2px solid #d0f693; outline-offset: 4px; }
.hint { margin: 5px 0 0; color: #b7bdca; font-size: 13px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.feedback { margin-top: 18px; border-top: 1px solid #343842; padding-top: 12px; }
.feedback p { margin: 0; color: #d9dce3; overflow-wrap: anywhere; }
.feedback p#error { color: #ffc2bc; }
progress { width: min(100%, 430px); height: 14px; accent-color: #d0f693; }
.midi-preview { margin-top: 14px; }
.preview-heading, .preview-controls { display: flex; align-items: center; gap: 14px; }
.preview-heading { justify-content: space-between; margin-bottom: 12px; }
.preview-heading h2 { margin: 0; font-size: 17px; }
#midi-time { flex-shrink: 0; font-variant-numeric: tabular-nums; font-size: 13px; color: #c5c9d1; }
.piano-roll { position: relative; overflow: hidden; border: 1px solid #343842; border-radius: 9px; background: #14161b; }
#midi-roll { display: block; width: 100%; height: clamp(168px, 34vw, 220px); }
#midi-playhead { position: absolute; top: 0; bottom: 22px; width: 2px; background: #f5f3f0; pointer-events: none; }
.preview-controls { margin-top: 10px; }
#midi-play { min-width: 98px; }
#midi-seek { min-width: 0; min-height: 44px; flex: 1; margin: 0; accent-color: #d0f693; cursor: pointer; }
.preview-error { margin: 6px 0 0; color: #ffc2bc; font-size: 14px; }
.sample-credit { display: inline-block; margin-top: 7px; color: #b7bdca; font-size: 12px; }
.score-preview { margin-top: 14px; }
.score-heading, .score-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.score-heading h2 { margin: 0; font-size: 17px; }
.score-beta { padding: 2px 8px; border: 1px solid #626877; border-radius: 5px; color: #e2e4e8; font-size: 12px; }
.score-actions { margin-top: 12px; }
#score-status { font-size: 14px; color: #c5c9d1; }
#score-status.score-error { color: #ffc2bc; }
.score-paper { margin-top: 14px; padding: 8px; overflow-x: auto; background: #fffdf8; border-radius: 8px; color: #181818; color-scheme: light; }
@media (max-width: 490px) {
  main { width: calc(100% - 32px); }
  .modes { grid-template-columns: 1fr; }
  .mobile { display: initial !important; }
}

a { color: #d0f693; text-underline-offset: .18em; }
.guide { margin-top: 38px; }
.guide h2 { margin: 24px 0 8px; font-size: 22px; line-height: 1.35; }
.guide p, .guide ol, .guide dl { margin: 0 0 16px; color: #d9dce3; }
.guide ol { padding-left: 24px; }
.guide li + li, .guide dd + dt { margin-top: 8px; }
.guide dd { margin-left: 0; }
.site-footer { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 32px; padding-top: 12px; border-top: 1px solid #343842; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
.caution { color: #ffd69a; }
.hint:empty { display: none; }
.ad-slot { display: grid; place-content: center; min-height: 250px; margin: 32px 0; border: 1px dashed #535864; color: #bec2cb; }
.narrow-link { display: inline-block; margin-top: 16px; }
