/* ==========================================================================
 * 专业调音器 /tools/tuner — 样式
 * 设计令牌 + 5 套主题（专业暗黑 / 赛博霓虹 / 高亮清爽 / 复古琥珀 / 深海静蓝）
 * ========================================================================== */
.tn-page {
    --tn-accent: #ff6a1a;
    --tn-accent-2: #ff9d4d;
    --tn-accent-soft: rgba(255, 106, 26, .14);
    --tn-accent-ring: rgba(255, 106, 26, .32);
    --tn-bg: #0a0a0c;
    --tn-surface: #141419;
    --tn-inset: #1c1c22;
    --tn-inset-2: #26262e;
    --tn-line: #2a2a32;
    --tn-line-strong: #40404b;
    --tn-text: #f2f2f4;
    --tn-muted: #a2a2ae;
    --tn-dim: #6f6f7d;
    --tn-ok: #22c55e;
    --tn-warn: #f59e0b;
    --tn-bad: #ef4444;
    --tn-radius: 16px;
    --tn-radius-sm: 10px;
    --tn-gap: 14px;

    max-width: 1120px;
    margin: 0 auto;
    padding: 16px 14px 44px;
    display: flex;
    flex-direction: column;
    gap: var(--tn-gap);
    color: var(--tn-text);
    font-size: 15px;
    line-height: 1.55;
    background: var(--tn-bg);
}

/* ---------- 主题 ---------- */
.tn-page[data-tn-theme="neon"] {
    --tn-accent: #00e5ff;
    --tn-accent-2: #ff2fd0;
    --tn-accent-soft: rgba(0, 229, 255, .14);
    --tn-accent-ring: rgba(0, 229, 255, .34);
    --tn-bg: #06060f;
    --tn-surface: #100f22;
    --tn-inset: #171534;
    --tn-inset-2: #211e46;
    --tn-line: #2c2857;
    --tn-line-strong: #453f80;
    --tn-text: #eaf2ff;
    --tn-muted: #9aa6d6;
    --tn-ok: #4ade80;
}
.tn-page[data-tn-theme="clean"] {
    --tn-accent: #2563eb;
    --tn-accent-2: #1d4ed8;
    --tn-accent-soft: rgba(37, 99, 235, .10);
    --tn-accent-ring: rgba(37, 99, 235, .28);
    --tn-bg: #f4f5f7;
    --tn-surface: #ffffff;
    --tn-inset: #f2f3f5;
    --tn-inset-2: #e6e8ec;
    --tn-line: #dfe1e6;
    --tn-line-strong: #c3c7cf;
    --tn-text: #16181d;
    --tn-muted: #565b66;
    --tn-dim: #767c88;
    --tn-ok: #16a34a;
}
.tn-page[data-tn-theme="amber"] {
    --tn-accent: #f5b642;
    --tn-accent-2: #ffd98a;
    --tn-accent-soft: rgba(245, 182, 66, .14);
    --tn-accent-ring: rgba(245, 182, 66, .30);
    --tn-bg: #17120d;
    --tn-surface: #221a12;
    --tn-inset: #2c2218;
    --tn-inset-2: #3a2d1f;
    --tn-line: #40331f;
    --tn-line-strong: #5a4630;
    --tn-text: #f8f0e2;
    --tn-muted: #bba98c;
    --tn-ok: #86c33f;
}
.tn-page[data-tn-theme="ocean"] {
    --tn-accent: #38bdf8;
    --tn-accent-2: #7dd3fc;
    --tn-accent-soft: rgba(56, 189, 248, .13);
    --tn-accent-ring: rgba(56, 189, 248, .30);
    --tn-bg: #061019;
    --tn-surface: #0d1a26;
    --tn-inset: #122433;
    --tn-inset-2: #1a3346;
    --tn-line: #1e3a4d;
    --tn-line-strong: #2d5670;
    --tn-text: #e6f4ff;
    --tn-muted: #9ab4c8;
    --tn-ok: #34d399;
}

/* 站点浅色主题下：默认主题改为清爽（除非用户手动选了别的） */
[data-theme="light"] .tn-page[data-tn-theme="pro"] {
    --tn-bg: #f4f5f7;
    --tn-surface: #ffffff;
    --tn-inset: #f2f3f5;
    --tn-inset-2: #e6e8ec;
    --tn-line: #dfe1e6;
    --tn-line-strong: #c3c7cf;
    --tn-text: #16181d;
    --tn-muted: #565b66;
    --tn-dim: #767c88;
}

.tn-page *, .tn-page *::before, .tn-page *::after { box-sizing: border-box; }
.tn-page button, .tn-page select, .tn-page input { font-family: inherit; }

/* ---------- 顶栏 ---------- */
.tn-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tn-top__l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tn-logo {
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border-radius: 14px;
    font-size: 24px;
    background: var(--tn-accent-soft);
    border: 1px solid var(--tn-line);
    flex-shrink: 0;
}
.tn-top__t { min-width: 0; }
.tn-title { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.tn-top__sub { margin: 2px 0 0; font-size: 12px; color: var(--tn-muted); }
.tn-top__r { display: flex; align-items: center; gap: 8px; }

/* ---------- 通用控件 ---------- */
.tn-btn {
    min-height: 40px;
    padding: 9px 16px;
    border-radius: var(--tn-radius-sm);
    background: var(--tn-inset);
    border: 1px solid var(--tn-line);
    color: var(--tn-text);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, transform .08s;
    display: inline-flex; align-items: center; gap: 6px;
}
.tn-btn:hover { border-color: var(--tn-line-strong); background: var(--tn-inset-2); }
.tn-btn:active { transform: translateY(1px); }
.tn-btn--sm { min-height: 34px; padding: 6px 11px; font-size: 12.5px; }
.tn-btn--primary { background: var(--tn-accent); border-color: var(--tn-accent); color: #fff; }
.tn-btn--primary:hover { background: var(--tn-accent-2); border-color: var(--tn-accent-2); }
.tn-btn--danger { color: var(--tn-bad); border-color: var(--tn-line); }
.tn-btn--mic { min-height: 44px; padding: 10px 18px; }
.tn-btn.is-on { background: var(--tn-accent); border-color: var(--tn-accent); color: #fff; }
.tn-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--tn-dim);
    display: inline-block;
    transition: background .15s, box-shadow .15s;
}
.tn-btn.is-on .tn-dot { background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .18); }
.tn-icon-btn {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: var(--tn-radius-sm);
    background: var(--tn-inset);
    border: 1px solid var(--tn-line);
    color: var(--tn-muted);
    font-size: 15px;
    cursor: pointer;
    transition: .15s;
}
.tn-icon-btn:hover { color: var(--tn-accent); border-color: var(--tn-accent); }

.tn-select, .tn-input {
    min-height: 40px;
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--tn-radius-sm);
    background: var(--tn-inset);
    border: 1px solid var(--tn-line);
    color: var(--tn-text);
    font-size: 13.5px;
    font-weight: 600;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.tn-select:focus, .tn-input:focus { border-color: var(--tn-accent); box-shadow: 0 0 0 3px var(--tn-accent-ring); }

.tn-range { width: 100%; height: 34px; -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
.tn-range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--tn-inset-2); }
.tn-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 20px; height: 20px; margin-top: -7px;
    border-radius: 50%; background: var(--tn-accent);
    border: 3px solid var(--tn-surface);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.tn-range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--tn-inset-2); }
.tn-range::-moz-range-thumb { width: 18px; height: 18px; border: 3px solid var(--tn-surface); border-radius: 50%; background: var(--tn-accent); }

.tn-switch { display: flex; align-items: center; gap: 10px; min-height: 38px; cursor: pointer; }
.tn-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.tn-switch__track {
    width: 42px; height: 24px; flex-shrink: 0;
    border-radius: 999px; background: var(--tn-inset-2);
    border: 1px solid var(--tn-line);
    position: relative; transition: background .18s, border-color .18s;
}
.tn-switch__track::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--tn-muted); transition: transform .18s, background .18s;
}
.tn-switch input:checked + .tn-switch__track { background: var(--tn-accent); border-color: var(--tn-accent); }
.tn-switch input:checked + .tn-switch__track::after { transform: translateX(18px); background: #fff; }
.tn-switch__text { font-size: 13px; color: var(--tn-muted); }
.tn-switch input:checked ~ .tn-switch__text { color: var(--tn-text); }
.tn-switch input:focus-visible + .tn-switch__track { box-shadow: 0 0 0 3px var(--tn-accent-ring); }

.tn-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--tn-muted); cursor: pointer; }

.tn-page :focus-visible { outline: none; box-shadow: 0 0 0 3px var(--tn-accent-ring); }

/* ---------- 页签 ---------- */
.tn-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--tn-line); overflow-x: auto; padding-bottom: 2px; }
.tn-tab {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 9px 14px;
    border-radius: var(--tn-radius-sm) var(--tn-radius-sm) 0 0;
    font-size: 13px; font-weight: 700;
    color: var(--tn-muted);
    border-bottom: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: .15s;
}
.tn-tab:hover { color: var(--tn-text); background: var(--tn-inset); }
.tn-tab.is-active { color: var(--tn-accent); border-bottom-color: var(--tn-accent); background: var(--tn-accent-soft); }

/* ---------- 卡片 ---------- */
.tn-pane { display: flex; flex-direction: column; gap: var(--tn-gap); }
.tn-card {
    background: var(--tn-surface);
    border: 1px solid var(--tn-line);
    border-radius: var(--tn-radius);
    padding: 16px;
}
.tn-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; justify-content: space-between; }
.tn-card__label {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
    color: var(--tn-muted);
}
.tn-card__label::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--tn-accent); }

.tn-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--tn-gap); }
.tn-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--tn-gap); }
.tn-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tn-spacer { flex: 1 1 auto; }
.tn-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tn-field--btns { flex-direction: row; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.tn-label { font-size: 11.5px; font-weight: 700; color: var(--tn-muted); }
.tn-val { color: var(--tn-accent); font-weight: 800; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tn-hint { margin: 8px 0 0; font-size: 12px; color: var(--tn-dim); line-height: 1.6; }
.tn-tip { margin: 10px 0 0; font-size: 12.5px; color: var(--tn-muted); line-height: 1.65; padding: 10px 12px; background: var(--tn-inset); border-radius: var(--tn-radius-sm); border-left: 3px solid var(--tn-accent); }

.tn-selectors { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(140px, 1.2fr) auto; gap: 12px; align-items: end; }

/* ---------- 段控件 ---------- */
.tn-seg { display: inline-flex; background: var(--tn-inset); border: 1px solid var(--tn-line); border-radius: var(--tn-radius-sm); padding: 3px; gap: 3px; flex-wrap: wrap; }
.tn-seg__btn {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 7px;
    background: transparent;
    border: 0;
    color: var(--tn-muted);
    font-size: 12.5px; font-weight: 700;
    cursor: pointer;
    transition: .15s;
    white-space: nowrap;
}
.tn-seg__btn:hover { color: var(--tn-text); }
.tn-seg__btn.is-active { background: var(--tn-accent-soft); border-color: var(--tn-accent); color: var(--tn-accent); box-shadow: inset 0 0 0 1px var(--tn-accent); }
.tn-seg--sm .tn-seg__btn { min-height: 30px; padding: 5px 10px; font-size: 12px; }
.tn-seg--wave .tn-seg__btn, .tn-seg--theme .tn-seg__btn { font-size: 12px; }

/* ---------- 表盘 ---------- */
.tn-dial-card { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tn-dial-wrap { position: relative; width: 100%; max-width: 640px; }
.tn-dial-wrap canvas { display: block; width: 100%; height: auto; }
.tn-readout {
    position: absolute;
    left: 50%; top: 52%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tn-note {
    font-size: 54px; font-weight: 800; line-height: 1;
    letter-spacing: -.02em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--tn-text);
    text-shadow: 0 2px 18px rgba(0, 0, 0, .45);
}
.tn-note.is-ok { color: var(--tn-ok); }
.tn-cents { font-size: 15px; font-weight: 800; color: var(--tn-muted); font-family: ui-monospace, Menlo, Consolas, monospace; }
.tn-cents.is-ok { color: var(--tn-ok); }
.tn-cents.is-flat { color: var(--tn-warn); }
.tn-cents.is-sharp { color: var(--tn-warn); }
.tn-freq { font-size: 12.5px; color: var(--tn-dim); font-family: ui-monospace, Menlo, Consolas, monospace; }
.tn-target { font-size: 12px; color: var(--tn-accent); font-weight: 700; }
.tn-status { margin: 0; font-size: 12.5px; color: var(--tn-muted); text-align: center; }
.tn-status.is-ok { color: var(--tn-ok); }
.tn-status.is-err { color: var(--tn-bad); }

/* ---------- 电平 ---------- */
.tn-meters { display: flex; gap: 18px; width: 100%; justify-content: center; flex-wrap: wrap; }
.tn-meter { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--tn-muted); }
.tn-bar { display: block; width: 120px; height: 8px; border-radius: 4px; background: var(--tn-inset-2); overflow: hidden; }
.tn-bar > i { display: block; height: 100%; width: 0; background: var(--tn-accent); transition: width .08s linear; }
.tn-bar--ok > i { background: var(--tn-ok); }
.tn-meter__v { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; color: var(--tn-text); min-width: 44px; }

/* ---------- 弦位 ---------- */
.tn-strings { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.tn-string {
    min-height: 76px;
    border-radius: var(--tn-radius-sm);
    background: var(--tn-inset);
    border: 1px solid var(--tn-line);
    color: var(--tn-text);
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    transition: .15s;
    position: relative;
    padding: 8px 4px;
}
.tn-string:hover { background: var(--tn-inset-2); border-color: var(--tn-line-strong); }
.tn-string__no { font-size: 10.5px; color: var(--tn-dim); font-weight: 700; }
.tn-string__note { font-size: 21px; font-weight: 800; font-family: ui-monospace, Menlo, Consolas, monospace; }
.tn-string__hz { font-size: 10.5px; color: var(--tn-dim); font-family: ui-monospace, Menlo, Consolas, monospace; }
.tn-string.is-target { background: var(--tn-accent-soft); border-color: var(--tn-accent); color: var(--tn-accent); box-shadow: 0 0 0 3px var(--tn-accent-ring); }
.tn-string.is-hit { background: rgba(34, 197, 94, .14); border-color: var(--tn-ok); color: var(--tn-ok); }
.tn-string.is-playing { border-color: var(--tn-accent); }

/* ---------- 参考音 ---------- */
.tn-refs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.tn-ref {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    padding: 9px 10px;
    border-radius: var(--tn-radius-sm);
    background: var(--tn-inset);
    border: 1px solid var(--tn-line);
    cursor: pointer;
    transition: .15s;
}
.tn-ref:hover { background: var(--tn-inset-2); border-color: var(--tn-accent); }
.tn-ref__note { font-size: 16px; font-weight: 800; font-family: ui-monospace, Menlo, Consolas, monospace; }
.tn-ref__no { font-size: 10.5px; color: var(--tn-dim); }
.tn-ref__play { font-size: 12px; color: var(--tn-accent); }

/* ---------- 半音键盘 ---------- */
.tn-keyboard { display: flex; gap: 4px; padding: 10px; background: var(--tn-inset); border-radius: var(--tn-radius-sm); overflow-x: auto; }
.tn-key {
    position: relative;
    flex: 1 1 0;
    min-width: 40px;
    height: 128px;
    border-radius: 0 0 8px 8px;
    background: linear-gradient(180deg, var(--tn-surface), var(--tn-inset-2));
    border: 1px solid var(--tn-line-strong);
    color: var(--tn-text);
    cursor: pointer;
    display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 8px;
    font-size: 11px; font-weight: 700;
    transition: .08s;
}
.tn-key:hover { border-color: var(--tn-accent); }
.tn-key.is-black {
    flex: 0 0 34px;
    min-width: 34px;
    height: 82px;
    background: linear-gradient(180deg, #2a2a32, #101014);
    color: #d8d8e0;
    border-color: #0c0c10;
    z-index: 2;
    margin: 0 -17px;
}
.tn-key:active, .tn-key.is-on { background: var(--tn-accent); color: #fff; border-color: var(--tn-accent); }
.tn-octave { display: inline-flex; align-items: center; gap: 8px; }
.tn-octave__val { font-size: 16px; font-weight: 800; font-family: ui-monospace, Menlo, Consolas, monospace; min-width: 20px; text-align: center; }

/* ---------- 频谱 ---------- */
.tn-pane canvas { width: 100%; height: auto; border-radius: var(--tn-radius-sm); background: var(--tn-inset); }
#tnSpecCanvas { background: var(--tn-inset); }

/* ---------- 自定义定弦模态 ---------- */
.tn-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(4, 4, 8, .68); backdrop-filter: blur(3px); }
.tn-modal__box {
    width: 100%; max-width: 520px;
    max-height: 86vh; overflow: auto;
    background: var(--tn-surface);
    border: 1px solid var(--tn-line);
    border-radius: var(--tn-radius);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.tn-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--tn-line); }
.tn-modal__head h3 { margin: 0; font-size: 15px; font-weight: 800; }
.tn-modal__x { width: 32px; height: 32px; border-radius: 8px; background: var(--tn-inset); border: 1px solid var(--tn-line); color: var(--tn-muted); cursor: pointer; }
.tn-modal__body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.tn-modal__foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--tn-line); }
.tn-strings-edit { display: flex; flex-direction: column; gap: 8px; }
.tn-str-edit { display: grid; grid-template-columns: 62px minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.tn-str-edit__no { font-size: 12px; color: var(--tn-muted); font-weight: 700; }

/* ---------- 提示条 / Toast ---------- */
.tn-warn {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--tn-radius-sm);
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .4);
    color: #fecaca;
    font-size: 12.5px;
}
.tn-toast {
    position: fixed;
    left: 50%; bottom: 26px;
    transform: translate(-50%, 14px);
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--tn-surface);
    border: 1px solid var(--tn-line-strong);
    color: var(--tn-text);
    font-size: 13px; font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
    opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 90;
}
.tn-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 原理文档 ---------- */
.tn-doc { line-height: 1.75; }
.tn-doc__h { margin: 0 0 12px; font-size: 16px; font-weight: 800; }
.tn-doc h3 { margin: 18px 0 6px; font-size: 14px; font-weight: 800; color: var(--tn-accent); }
.tn-doc p, .tn-doc li { font-size: 13.5px; color: var(--tn-muted); margin: 6px 0; }
.tn-doc ul { margin: 6px 0; padding-left: 20px; }
.tn-doc li { list-style: disc; }
.tn-doc b { color: var(--tn-text); }
.tn-doc em { color: var(--tn-text); font-style: normal; font-weight: 700; }
.tn-formula {
    margin: 10px 0;
    padding: 10px 12px;
    background: var(--tn-inset);
    border-radius: var(--tn-radius-sm);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px; color: var(--tn-text); text-align: center;
}
.tn-foot { margin: 6px 0 0; text-align: center; font-size: 12px; color: var(--tn-dim); }

/* ==========================================================================
 * 响应式
 * ========================================================================== */
@media (min-width: 1200px) {
    .tn-page { max-width: 1200px; padding: 20px 18px 52px; }
    .tn-note { font-size: 62px; }
}

@media (max-width: 980px) {
    .tn-grid2 { grid-template-columns: minmax(0, 1fr); }
    .tn-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tn-selectors { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .tn-field--btns { grid-column: 1 / -1; }
    .tn-strings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .tn-page { padding: 12px 12px 40px; gap: 12px; font-size: 14.5px; }
    .tn-card { padding: 13px; }
    .tn-top__sub { display: none; }
    .tn-title { font-size: 17px; }
    .tn-logo { width: 40px; height: 40px; font-size: 20px; }
    .tn-btn { min-height: 40px; }
    .tn-btn--sm { min-height: 36px; }
    .tn-note { font-size: 40px; }
    .tn-readout { top: 55%; }
    .tn-grid3 { grid-template-columns: minmax(0, 1fr); }
    .tn-strings { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .tn-string { min-height: 68px; }
    .tn-string__note { font-size: 18px; }
    .tn-meters { gap: 12px; }
    .tn-bar { width: 92px; }
    .tn-key { min-width: 34px; height: 108px; }
    .tn-key.is-black { flex: 0 0 28px; min-width: 28px; height: 68px; margin: 0 -14px; }
    .tn-modal__box { max-height: 90vh; }
}

@media (max-width: 400px) {
    .tn-strings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tn-refs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tn-top__r { width: 100%; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
    .tn-page *, .tn-page *::before, .tn-page *::after { transition: none !important; animation: none !important; }
}
