:root {
  color-scheme: light;
  --paper: #f6f5f0;
  --ink: #243e35;
  --muted: #66736c;
  --green: #2b5143;
  --line: #e3e7df;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 50% 380px, #e8eee3 0, transparent 540px), var(--paper);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a, label, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, a:focus-visible, summary:focus-visible, .file-picker:focus-within {
  outline: 3px solid #658e76;
  outline-offset: 5px;
}
.sr-only, .file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.page { max-width: 1040px; min-height: 100svh; margin: auto; padding: 0 40px; display: flex; flex-direction: column; }
.masthead { display: flex; justify-content: center; padding: 30px 0; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 24px; font-weight: 600; letter-spacing: -1px; }
.brand-mark { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid #698073; border-radius: 50%; font: italic 25px Georgia, serif; }
.brand-mark span { margin-left: -7px; transform: translateY(4px); }
main { width: 100%; }
.search-card { max-width: 500px; margin: auto; padding: 30px 34px 22px; background: #fffffff0; border: 1px solid #ffffff; border-radius: 28px; box-shadow: 0 20px 70px #314f3610, 0 2px 8px #314f3604; }
.record-surface { text-align: center; padding-top: 7px; }
#record { display: inline-flex; flex-direction: column; align-items: center; gap: 18px; padding: 8px 20px; border: 0; border-radius: 18px; color: var(--ink); background: none; font-size: 17px; font-weight: 600; }
.record-symbol { width: 112px; height: 112px; border-radius: 50%; box-shadow: 0 0 0 9px #eef2ea, 0 0 0 10px #e5ebe0, 0 9px 22px #234e3824; transition: transform .2s, box-shadow .2s; }
.record-disc { fill: var(--green); transition: fill .2s; }
.microphone-symbol { fill: none; stroke: #fbfcf6; stroke-width: 1.8; stroke-linecap: round; }
.stop-symbol { display: none; fill: #fff9f5; }
#record:hover:not(:disabled) .record-symbol { transform: translateY(-2px); box-shadow: 0 0 0 11px #eef2ea, 0 0 0 12px #e5ebe0, 0 12px 26px #234e3826; }
#record:active:not(:disabled) .record-symbol { transform: scale(.96); }
.recording .record-disc { fill: #9b4b40; }
.recording .record-symbol, .recording #record:hover:not(:disabled) .record-symbol { box-shadow: 0 0 0 9px #f7ebe6, 0 0 0 10px #efddd5; }
.recording .microphone-symbol { display: none; }
.recording .stop-symbol { display: block; }
.waveform { height: 22px; margin: 3px 0 5px; display: flex; justify-content: center; align-items: center; gap: 4px; color: #b3c2b2; }
.waveform i { width: 2px; height: 4px; border-radius: 2px; background: currentColor; }
.waveform i:nth-child(3n) { height: 10px; }
.waveform i:nth-child(4n) { height: 17px; }
.waveform i:nth-child(5n) { height: 12px; }
.waveform.is-recording { color: #a46758; }
.waveform.is-recording i { animation: wave .65s infinite alternate ease-in-out; }
.waveform.is-recording i:nth-child(2n) { animation-delay: -.3s; }
.waveform.is-recording i:nth-child(3n) { animation-delay: -.5s; }
@keyframes wave { from { transform: scaleY(.4); } to { transform: scaleY(1.25); } }
#record-hint { margin: 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.upload-option { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.file-picker { position: relative; display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 48px; padding: 12px; border: 1px solid #dce3d8; border-radius: 12px; color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s, border-color .15s; }
.file-picker:hover { background: #f3f6ef; border-color: #a6b8a5; }
.file-picker.is-disabled { pointer-events: none; opacity: .5; }
.file-picker svg, .privacy-note svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.privacy-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.privacy-note svg { width: 12px; height: 12px; }
.clip { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 14px; }
.clip-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.clip-heading strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 500; }
.text-button { min-height: 44px; padding: 10px 4px; border: 0; background: none; color: var(--muted); font-size: 13px; text-underline-offset: 4px; }
.text-button:hover { color: var(--ink); text-decoration: underline; }
.clip audio { width: 100%; height: 42px; margin: 4px 0 16px; }
.button { min-height: 48px; padding: 12px 24px; border: 0; border-radius: 12px; font-weight: 500; transition: background .15s; }
.primary { background: var(--green); color: #fcfdf8; }
.primary:hover:not(:disabled) { background: #3b6250; }
.wide { width: 100%; }
.troubleshooting { margin-top: 16px; color: var(--muted); font-size: 12px; }
.troubleshooting summary { width: fit-content; min-height: 36px; margin: auto; padding: 8px; }
.troubleshooting p { margin: 8px 0 12px; }
.diagnostic-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.diagnostic-links a { color: var(--green); min-height: 36px; padding: 8px 0; text-underline-offset: 4px; }
.progress-panel { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 10px; }
.progress-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
progress { display: block; width: 100%; height: 5px; margin: 5px 0; border: 0; border-radius: 5px; overflow: hidden; accent-color: #597d60; background: #e9eee4; }
progress::-webkit-progress-bar { background: #e9eee4; }
progress::-webkit-progress-value { background: #597d60; border-radius: 5px; }
.engine-status { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.error { margin: 18px 0 0; padding: 12px 14px; border-radius: 10px; background: #fcf0e9; color: #874237; font-size: 14px; }
.capture-notice { margin: 0 0 24px; padding: 14px 16px; border: 1px solid #deca9d; border-radius: 12px; background: #fff6e3; color: #694f27; font-size: 13px; }
.capture-notice p { margin: 6px 0; overflow-wrap: anywhere; }
.results { max-width: 500px; margin: 36px auto 0; scroll-margin-top: 28px; }
.results h2 { font: normal 27px/1.2 Georgia, serif; letter-spacing: -.5px; margin: 0 0 18px; }
.results ol { display: grid; gap: 10px; list-style: none; padding: 0; margin: 0; }
.match { padding: 20px 24px; border: 1px solid #e3e7de; border-radius: 16px; background: #ffffffa6; overflow-wrap: anywhere; }
.match:first-child { padding: 23px 24px; border-color: #cbd9c5; background: #edf2e7; }
.match .composer { margin: 0 0 7px; color: #526b55; font-size: 13px; }
.match h3 { margin: 0; font: normal 21px/1.35 Georgia, serif; letter-spacing: -.2px; }
.match .movement { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.match-playback { margin-top: 17px; }
.listen-options { display: flex; flex-wrap: wrap; gap: 8px; }
.listen-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 14px; border: 1px solid #ced9ce; border-radius: 24px; background: #ffffff80; color: var(--green); font: inherit; font-size: 13px; cursor: pointer; }
.listen-button.is-selected, .listen-button:hover { background: #e2eadd; }
.listen-button.is-playing { background: var(--green); border-color: var(--green); color: white; }
.listen-icon { width: 12px; height: 12px; display: inline-block; position: relative; flex-shrink: 0; }
.listen-icon::before { content: ''; display: block; margin: 1px 0 0 3px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid currentColor; }
.is-playing .listen-icon::before { width: 9px; height: 11px; margin: 0 0 0 2px; border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.listen-timeline { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.listen-seek { flex: 1; width: 0; min-width: 0; height: 44px; margin: 0; accent-color: var(--green); cursor: pointer; }
.listen-time { flex-shrink: 0; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.listen-error { margin: 10px 0 0; font-size: 12px; color: #874237; }
.empty-results { padding: 20px 0; color: var(--muted); font-size: 14px; }
footer { margin-top: auto; padding: 28px 0; display: flex; justify-content: center; color: var(--muted); font-size: 12px; }
.privacy { width: 100%; max-width: 440px; text-align: center; }
.privacy summary { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 16px; list-style: none; }
.privacy summary::-webkit-details-marker { display: none; }
.privacy summary:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.privacy[open] summary { color: var(--ink); }
.privacy p { margin: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #ffffff85; text-align: left; line-height: 1.7; }
noscript { display: block; max-width: 440px; margin: 24px auto; padding: 16px; text-align: center; }
@media (max-width: 600px) {
  .page { padding: 0 22px; }
  .masthead { padding: 23px 0; }
  .wordmark { font-size: 22px; }
  .brand-mark { width: 31px; height: 31px; font-size: 23px; }
  .search-card { padding: 24px 24px 20px; border-radius: 24px; }
  .record-symbol { width: 100px; height: 100px; }
  #record { font-size: 16px; gap: 17px; }
  .upload-option { margin-top: 22px; padding-top: 20px; }
  .results { margin-top: 30px; }
  .match, .match:first-child { padding: 20px; }
  footer { padding: 20px 0; }
}
@media (max-width: 350px) {
  .page { padding: 0 16px; }
  .search-card { padding-left: 20px; padding-right: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Keep the first screen focused on the two ways to search. */
.brand-title { margin: 0; font: inherit; letter-spacing: normal; }
.is-loading .listen-icon::before { width: 12px; height: 12px; margin: 0; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: piano-loading .8s linear infinite; }
@keyframes piano-loading { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .is-loading .listen-icon::before { animation: none; } }
.credits-link { display: inline-block; padding: 12px; color: var(--muted); font-size: 12px; }
