.tuning-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 10, 20, 0.72);
    padding: 1rem;
}

.tuning-modal-overlay[hidden] {
    display: none !important;
}

.tuning-modal-content {
    position: relative;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(160deg, rgba(14, 24, 42, 0.98), rgba(8, 14, 28, 0.99));
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 18px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    padding: 1.25rem 1.35rem 1.4rem;
    display: grid;
    gap: 1.1rem;
    color: rgba(238, 243, 249, 0.92);
    font-family: inherit;
}

.tuning-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.tuning-modal-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(190, 220, 255, 0.85);
}

.tuning-modal-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(200, 220, 245, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.tuning-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.10);
    color: rgba(230, 240, 255, 0.95);
}

.tuning-modal-section {
    display: grid;
    gap: 0.55rem;
}

.tuning-modal-section-label {
    font-size: 0.63rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(170, 200, 240, 0.55);
}

.tuning-modal-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.45rem;
}

.tuning-modal-preset-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.55rem 0.75rem;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.tuning-modal-preset-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(173, 206, 236, 0.22);
}

.tuning-modal-preset-card--active {
    background: rgba(69, 142, 214, 0.20);
    border-color: rgba(126, 193, 255, 0.45);
}

.tuning-modal-preset-card--active:hover {
    background: rgba(69, 142, 214, 0.28);
}

.tuning-modal-card-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(235, 245, 255, 0.92);
}

.tuning-modal-card-notes {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: rgba(170, 200, 240, 0.60);
    font-family: monospace;
}

.tuning-modal-custom-list {
    display: grid;
    gap: 0.35rem;
}

.tuning-modal-custom-empty {
    font-size: 0.72rem;
    color: rgba(180, 200, 230, 0.42);
    padding: 0.3rem 0;
}

.tuning-modal-custom-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
}

.tuning-modal-custom-row--active {
    background: rgba(69, 142, 214, 0.18);
    border-color: rgba(126, 193, 255, 0.38);
}

.tuning-modal-custom-select {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    background: none;
    border: none;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    padding: 0;
    min-width: 0;
}

.tuning-modal-custom-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: rgba(235, 245, 255, 0.90);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.tuning-modal-custom-notes {
    font-size: 0.60rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(170, 200, 240, 0.55);
    font-family: monospace;
}

.tuning-modal-custom-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(200, 210, 230, 0.55);
    font-size: 0.9rem;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.tuning-modal-custom-delete:hover {
    background: rgba(220, 60, 60, 0.22);
    border-color: rgba(255, 100, 100, 0.30);
    color: rgba(255, 170, 170, 0.90);
}

.tuning-modal-add-form {
    display: grid;
    gap: 0.6rem;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.tuning-modal-add-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: rgba(185, 215, 250, 0.65);
    text-transform: uppercase;
}

.tuning-modal-add-name-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.55rem;
}

.tuning-modal-add-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(185, 210, 240, 0.60);
    white-space: nowrap;
}

.tuning-modal-name-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    color: rgba(235, 245, 255, 0.92);
    font-family: inherit;
    font-size: 0.78rem;
    padding: 0.3rem 0.55rem;
    outline: none;
    transition: border-color 0.15s;
}

.tuning-modal-name-input:focus {
    border-color: rgba(126, 193, 255, 0.45);
}

.tuning-modal-strings-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.35rem;
}

.tuning-modal-string-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.tuning-modal-string-label {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(170, 200, 240, 0.50);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

.tuning-modal-note-select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 7px;
    color: rgba(230, 242, 255, 0.90);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.15rem;
    width: 100%;
    text-align: center;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
}

.tuning-modal-note-select:focus {
    border-color: rgba(126, 193, 255, 0.45);
}

.tuning-modal-add-error {
    font-size: 0.70rem;
    color: rgba(255, 160, 130, 0.90);
    padding: 0.25rem 0;
}

.tuning-modal-save-btn {
    justify-self: start;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    border: 1px solid rgba(126, 193, 255, 0.30);
    background: rgba(69, 142, 214, 0.18);
    color: rgba(180, 218, 255, 0.90);
    font-family: inherit;
    font-size: 0.73rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.tuning-modal-save-btn:hover {
    background: rgba(69, 142, 214, 0.30);
    border-color: rgba(126, 193, 255, 0.50);
}

.find-interval-settings-utility-tuning {
    display: flex;
    align-items: center;
}

.find-interval-settings-tuning-btn {
    display: flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.25rem 0.55rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(200, 225, 255, 0.78);
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.find-interval-settings-tuning-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(173, 206, 236, 0.22);
    color: rgba(220, 238, 255, 0.95);
}

.find-interval-settings-tuning-btn[data-tuning-active="true"] {
    background: rgba(69, 142, 214, 0.18);
    border-color: rgba(126, 193, 255, 0.38);
    color: rgba(180, 218, 255, 0.95);
}
