.tuner { --tuned: #23784a; --off: #b4521a; --tick: #c9cfc2; max-width: 40rem; margin: 0 0 3rem; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); box-shadow: 0 12px 32px #223c3208; overflow: hidden; }
.tuner__screen { padding: 1.5rem 1.25rem 1rem; text-align: center; }
.tuner__note { margin: 0 !important; font-size: clamp(3.5rem, 14vw, 5rem); line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; transition: color .2s, opacity .2s; }
.tuner__note sub { font-size: 0.38em; font-weight: 500; vertical-align: baseline; margin-left: 0.08em; }
.tuner__meter { position: relative; height: 4.5rem; margin: 1rem 0 0.25rem; overflow: hidden;
    background:
        linear-gradient(to right, transparent calc(50% - 3%), #23784a1f calc(50% - 3%) calc(50% + 3%), transparent calc(50% + 3%)),
        repeating-linear-gradient(to right, var(--tick) 0 2px, transparent 2px 25%) 0 0 / calc(100% + 2px) 100% no-repeat,
        repeating-linear-gradient(to right, var(--tick) 0 1px, transparent 1px 5%) 0 50% / calc(100% + 1px) 40% no-repeat; }
.tuner__needle { position: absolute; inset: 0; will-change: transform; }
.tuner__needle::before { content: ''; position: absolute; left: calc(50% - 2px); top: 0; bottom: 0; width: 4px; border-radius: 2px; background: var(--forest); transition: background-color .2s; }
.tuner__scale { display: flex; justify-content: space-between; margin: 0 !important; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tuner__scale span:first-child { transform: translateX(-0.2em); }
.tuner__figures { display: flex; justify-content: center; gap: 1.5rem; margin: 0.75rem 0 0 !important; font-size: 0.95rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tuner__figures output { color: var(--forest); font-weight: 600; }
.tuner__hint { min-height: 1.6em; margin: 0.5rem 0 0 !important; font-size: 1.05rem; font-weight: 600; transition: color .2s; }
.tuner[data-state=idle] .tuner__note, .tuner[data-state=waiting] .tuner__note { opacity: .35; }
.tuner[data-state=idle] .tuner__hint { font-weight: 400; color: var(--muted); }
.tuner[data-state=waiting] .tuner__needle { opacity: .35; }
.tuner[data-state=flat] :is(.tuner__note, .tuner__hint), .tuner[data-state=sharp] :is(.tuner__note, .tuner__hint) { color: var(--off); }
.tuner[data-state=flat] .tuner__needle::before, .tuner[data-state=sharp] .tuner__needle::before { background: var(--off); }
.tuner[data-state=tuned] :is(.tuner__note, .tuner__hint) { color: var(--tuned); }
.tuner[data-state=tuned] .tuner__needle::before { background: var(--tuned); }
.tuner[data-state=tuned] .tuner__hint::before { content: '✓ '; }
.tuner[data-state=flat] .tuner__hint::before { content: '↑ '; }
.tuner[data-state=sharp] .tuner__hint::before { content: '↓ '; }
.tuner__strings { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.4rem; padding: 0 1rem 1rem; }
.tuner button, .tuner select, .tuner input { font: inherit; color: var(--forest); }
.tuner button { cursor: pointer; border: 1px solid var(--border); border-radius: 14px; background: transparent; transition: background-color .15s, border-color .15s, color .15s; }
.tuner__strings button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.1rem; min-height: 4rem; padding: 0.5rem 0.2rem; }
.tuner__string-note { font-size: 1.15rem; font-weight: 600; line-height: 1.2; }
.tuner__string-note sub { font-size: 0.65em; font-weight: 500; vertical-align: baseline; }
.tuner__strings small { font-size: 0.7rem; color: var(--muted); }
.tuner__strings .is-near { border-color: var(--forest); }
.tuner__strings .is-tuned { border-color: var(--tuned); }
.tuner__strings .is-tuned::after { content: '✓'; position: absolute; top: 0.2rem; right: 0.35rem; font-size: 0.7rem; color: var(--tuned); }
.tuner button[aria-pressed=true] { background: var(--forest); border-color: var(--forest); color: var(--surface); }
.tuner button[aria-pressed=true] small, .tuner .is-tuned[aria-pressed=true]::after { color: inherit; }
.tuner__actions { display: flex; gap: 0.5rem; padding: 0 1rem 1rem; }
.tuner__actions button { min-height: 3rem; padding: 0.6rem 1.1rem; font-size: 0.95rem; }
.tuner__actions .tuner__listen { flex: 1; font-weight: 600; background: var(--forest); border-color: var(--forest); color: var(--surface); }
.tuner__actions .tuner__listen[aria-pressed=true] { background: transparent; color: var(--forest); }
:is(.tuner__actions, .tuner__settings) button[aria-pressed=true] { background: #e6eddc; border-color: #bdcbae; color: var(--forest); }
.tuner__listen:disabled { opacity: .5; cursor: wait; }
.tuner__settings { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; padding: 1rem; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--muted); }
.tuner__settings label { display: flex; align-items: center; gap: 0.5rem; }
.tuner__settings select, .tuner__settings input { min-height: 2.75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 0 0.6rem; }
.tuner__settings input { width: 4.5rem; font-variant-numeric: tabular-nums; }
.tuner__a4, .tuner__notation { display: flex; align-items: center; gap: 0.35rem; }
.tuner__a4 button, .tuner__notation button { min-height: 2.75rem; padding: 0 0.7rem; font-size: 0.85rem; }
.tuner__privacy { margin: 0 !important; padding: 0 1rem 1rem; font-size: 0.8rem; color: var(--muted); }
.tuner :focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
@media (max-width: 420px) { .tuner { margin-inline: -0.5rem; border-radius: 18px; } .tuner__strings { gap: 0.3rem; padding-inline: 0.6rem; } .tuner__string-note { font-size: 1rem; } }
@media (prefers-reduced-motion: reduce) { .tuner *, .tuner *::before { transition: none !important; } }
