:root { color-scheme: light; --bg:#f4f4f2; --panel:#fff; --line:#d6d6d2; --muted:#666660; --accent:#303c49; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; background:var(--bg); color:#242424; font:14px/1.6 Arial,Helvetica,sans-serif; letter-spacing:.025em; }
main { max-width:1060px; margin:auto; padding:30px 24px; }
header { display:flex; justify-content:space-between; align-items:center; gap:16px; padding-bottom:20px; border-bottom:1px solid var(--line); }
.logo { font-size:14px; font-weight:700; letter-spacing:.14em; }
.logo span { margin-left:10px; color:var(--muted); font-size:11px; font-weight:400; }
.badge { font-size:10px; letter-spacing:.12em; color:var(--muted); }
.intro { padding:28px 0 18px; }
h1 { font-size:30px; line-height:1.3; font-weight:500; letter-spacing:.035em; margin:0 0 10px; }
.intro p { color:var(--muted); margin:0; }
.panel { background:var(--panel); border:1px solid var(--line); border-radius:3px; padding:24px; }
.upload { margin-bottom:16px; background:#fafaf9; }
.upload.drag { border-color:var(--accent); background:#e9edf0; }
.file-label { display:block; cursor:pointer; }
.file-label strong { display:block; font-weight:500; overflow-wrap:anywhere; }
.file-label small { display:block; color:var(--muted); margin-top:4px; }
#file { display:block; margin-top:16px; max-width:100%; font:inherit; font-size:12px; color:var(--muted); }
#file::file-selector-button { font:inherit; letter-spacing:inherit; background:#fff; color:#242424; border:1px solid #aaa; border-radius:2px; padding:8px 14px; margin-right:12px; cursor:pointer; }
.player { margin-bottom:20px; }
canvas { width:100%; height:90px; display:block; }
.transport { display:flex; align-items:center; gap:12px; margin:12px 0; }
#clock { font-size:12px; font-variant-numeric:tabular-nums; color:var(--muted); }
#rateBadge { margin-left:auto; font-size:12px; color:var(--muted); }
.seek-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
button,select { font:inherit; letter-spacing:inherit; }
button { cursor:pointer; border:1px solid #bcbcb6; border-radius:2px; padding:9px 16px; background:#fff; color:#242424; font-weight:500; }
button:hover:not(:disabled) { background:#eceeec; border-color:#777; }
button:disabled { opacity:.45; cursor:not-allowed; }
button:focus-visible,input:focus-visible,select:focus-visible { outline:2px solid #526a82; outline-offset:4px; }
.primary,#play { background:var(--accent); color:#fff; border-color:var(--accent); }
.primary:hover:not(:disabled),#play:hover:not(:disabled) { background:#445465; }
.workspace { display:grid; grid-template-columns:1fr; gap:20px; align-items:start; }
.section-heading { display:flex; justify-content:space-between; align-items:center; }
h2 { font-size:18px; font-weight:500; letter-spacing:.04em; margin:0 0 12px; }
.section-heading h2 { margin:0; }
.text-button { border:0; background:none; color:var(--muted); font-size:12px; padding:6px; }
.tabs { display:flex; flex-wrap:wrap; gap:0; border-bottom:1px solid var(--line); margin:20px 0 12px; }
.tabs button { border:0; border-bottom:2px solid transparent; border-radius:0; padding:10px 12px; font-size:12px; background:transparent; color:var(--muted); }
.tabs button[aria-selected=true] { border-bottom-color:var(--accent); color:#222; }
[role=tabpanel] { min-height:170px; }
.control { margin-top:24px; }
.control label { display:flex; justify-content:space-between; gap:12px; font-weight:500; font-size:13px; }
.control output { color:var(--accent); font-variant-numeric:tabular-nums; }
.control small,.note { color:var(--muted); font-size:12px; line-height:1.7; }
/* Custom track and handle styling; native range semantics retain keyboard support. */
input[type=range] { appearance:none; -webkit-appearance:none; display:block; width:100%; height:24px; margin:12px 0 8px; padding:0; border:0; border-radius:0; background:transparent; cursor:pointer; --fill:0%; }
input[type=range]::-webkit-slider-runnable-track { height:4px; border-radius:0; background:linear-gradient(to right,var(--accent) 0 var(--fill),#dfdfda var(--fill) 100%); }
input[type=range]::-moz-range-track { height:4px; border-radius:0; background:linear-gradient(to right,var(--accent) 0 var(--fill),#dfdfda var(--fill) 100%); }
input[type=range]::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:12px; height:20px; margin-top:-8px; border:1px solid var(--accent); border-radius:2px; background:#fff; }
input[type=range]::-moz-range-thumb { width:10px; height:18px; border:1px solid var(--accent); border-radius:2px; background:#fff; }
input[type=range]:disabled { opacity:.4; cursor:not-allowed; }
.export>p { color:var(--muted); }
.export>label:not(.checkbox) { display:block; font-size:12px; font-weight:500; margin:20px 0 7px; }
select { appearance:none; -webkit-appearance:none; width:100%; padding:10px 12px; background:#fafaf9; color:#242424; border:1px solid #bcbcb6; border-radius:2px; font-size:12px; cursor:pointer; }
.checkbox { display:flex; align-items:center; gap:10px; font-size:12px; margin-top:20px; color:var(--muted); cursor:pointer; }
/* A text-labelled switch, with no checkmark or other icons. */
.checkbox input { appearance:none; -webkit-appearance:none; position:relative; flex:0 0 36px; width:36px; height:20px; margin:0; border:1px solid #9b9b95; border-radius:2px; background:#e2e2dd; cursor:pointer; }
.checkbox input::before { content:''; position:absolute; top:50%; left:2px; width:14px; height:14px; border-radius:1px; background:#fff; border:1px solid #999; transform:translateY(-50%); transition:transform .12s; }
.checkbox input:checked { background:var(--accent); border-color:var(--accent); }
.checkbox input:checked::before { transform:translate(16px, -50%); border-color:#fff; }
.checkbox input:disabled { opacity:.4; cursor:not-allowed; }
.summary { display:grid; grid-template-columns:1fr auto; gap:9px; font-size:12px; border-top:1px solid var(--line); padding-top:18px; margin:22px 0; }
.summary span { color:var(--muted); }
.summary strong { font-weight:500; }
.export .primary { width:100%; }
#status { border-top:1px solid var(--line); padding:16px 0; font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
footer { color:var(--muted); font-size:11px; text-align:center; padding-top:12px; }
@media(max-width:720px) { .workspace { grid-template-columns:1fr; } main { padding:20px 16px; } .panel { padding:18px; } .badge { display:none; } .logo span { display:block; margin-left:0; margin-top:3px; } .transport { flex-wrap:wrap; } #rateBadge { width:100%; margin:0; } .tabs button { padding:10px 9px; } }

/* Tuner interface */
.tuner-panel { margin-bottom:12px; padding:26px 30px 22px; }
.audio-diagnostics { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:4px 16px; margin:0 0 18px; padding:10px 12px; border:1px solid var(--line); background:#fafaf9; color:var(--muted); font-size:11px; font-variant-numeric:tabular-nums; }
.audio-diagnostics strong { color:#242424; font-weight:600; }
.audio-diagnostics b { color:var(--accent); font-weight:500; }
.tuner-topline,.frequency-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.eyebrow,.frequency-row>span,.meter-labels { color:var(--muted); font-size:10px; letter-spacing:.12em; }
.status-pill { display:inline-flex; align-items:center; gap:7px; color:var(--muted); font-size:11px; }
.status-dot { width:7px; height:7px; border-radius:50%; background:#aaa; }
.status-pill.active { color:#315c45; }
.status-pill.active .status-dot { background:#3b8b5b; box-shadow:0 0 0 3px #e4f0e7; }
.note-readout { text-align:center; padding:10px 0 2px; }
.note-name { min-height:1.2em; color:var(--accent); font-size:clamp(78px,13vw,120px); font-weight:400; letter-spacing:-.07em; line-height:1.15; font-variant-numeric:tabular-nums; }
.note-details { min-height:22px; color:var(--muted); font-size:12px; }
.meter-wrap { max-width:660px; margin:20px auto 14px; }
.meter-labels { display:flex; justify-content:space-between; font-size:9px; }
.meter { position:relative; height:34px; margin:4px 7px 0; }
.meter-track { position:absolute; top:15px; left:0; right:0; height:4px; background:linear-gradient(to right,#d8c9c2,#dfdfda 42%,#b9cbbb 49%,#b9cbbb 51%,#dfdfda 58%,#d8c9c2); }
.meter-center { position:absolute; top:7px; left:50%; height:20px; border-left:1px solid #62756c; }
.meter-needle { position:absolute; z-index:1; top:6px; left:50%; width:2px; height:22px; background:var(--accent); transform:translateX(-1px); transition:left .12s ease-out; }
.cents-readout { min-height:19px; text-align:center; color:var(--muted); font-size:11px; font-variant-numeric:tabular-nums; }
.frequency-row { max-width:660px; margin:16px auto 0; padding-top:15px; border-top:1px solid var(--line); }
.frequency-row strong { font-size:16px; font-weight:500; font-variant-numeric:tabular-nums; }
.frequency-row strong small { color:var(--muted); font-size:11px; font-weight:400; }
.tuner-actions { display:flex; align-items:center; gap:15px; margin-top:20px; }
.action-button { display:inline-flex; align-items:center; justify-content:center; gap:9px; min-width:180px; }
.tuner-actions .note { margin:0; }
.icon { display:inline-flex; flex:0 0 24px; align-items:center; justify-content:center; width:24px; height:24px; font-size:17px; line-height:1; text-align:center; }
.header-actions { display:flex; align-items:center; gap:12px; }
.settings-trigger { display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; padding:0; }
.settings-copy { margin:12px 0 16px; color:var(--muted); font-size:12px; }
.setting-label { display:block; margin-bottom:7px; font-size:12px; font-weight:500; }
.icon-preview { display:flex; align-items:center; gap:15px; margin-top:17px; padding:14px 12px; background:#fafaf9; border:1px solid var(--line); color:var(--muted); font-size:11px; }
.icon-preview .icon { color:var(--accent); font-size:19px; }
.settings-note { margin:14px 0 0; }
.reference-control { margin-top:20px; }
.reference-control output { white-space:nowrap; }
.range-control select { margin-top:10px; }
.chord-mode-control { align-items:center; color:#242424; }
.chord-mode-control strong { font-size:13px; font-weight:500; }
.chord-mode-control small { color:var(--muted); }
.chord-readout { min-height:260px; padding:25px 0 5px; text-align:center; }
.chord-name { margin:8px 0; color:var(--accent); font-size:clamp(38px,7vw,64px); line-height:1.2; overflow-wrap:anywhere; }
.chord-notes { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; min-height:34px; margin:20px 0 8px; }
.chord-notes span { padding:4px 10px; border:1px solid var(--line); background:#fafaf9; color:var(--accent); font-size:13px; font-variant-numeric:tabular-nums; }
.chord-readout .note { margin:12px 0 0; }
body[data-icons="unicode"] .icon { font-family:Arial, sans-serif; font-weight:600; }
body[data-icons="emoji"] .icon { font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; font-weight:400; }
.icon svg,.icon img { display:block; width:20px; height:20px; flex:none; object-fit:contain; }
.primary .icon img { filter:invert(1); }

.settings-popup { position:fixed; z-index:20; inset:0; display:grid; place-items:center; padding:20px; }
.settings-backdrop { position:absolute; inset:0; background:rgba(25,29,32,.38); backdrop-filter:blur(3px); animation:settings-fade-in .16s ease-out; }
.settings-dialog { position:relative; z-index:1; width:min(100%,420px); padding:24px; box-shadow:0 20px 60px rgba(24,30,36,.2); animation:settings-pop-in .18s ease-out; }
.settings-close { display:grid; place-items:center; width:34px; height:34px; padding:0; border-color:transparent; background:transparent; }
.settings-close:hover { background:#f0f0ed; }
.settings-close .icon { font-size:20px; }
@keyframes settings-fade-in { from { opacity:0; } to { opacity:1; } }
@keyframes settings-pop-in { from { opacity:0; transform:translateY(8px) scale(.98); } to { opacity:1; transform:translateY(0) scale(1); } }
@media(prefers-reduced-motion:reduce) { .settings-backdrop,.settings-dialog { animation:none; } }
@media(max-width:720px) {
  .tuner-panel { padding:20px 18px; }
  .tuner-actions { align-items:flex-start; flex-direction:column; gap:10px; }
  .action-button { width:100%; }
  .note-name { font-size:clamp(76px,24vw,108px); }
  .reference-control output { font-size:11px; }
}
