.tune-button,
.tune-heading,
.tune-heading h2 {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tune-button { white-space: nowrap; padding: 8px 12px; }
.tune-dialog {
    width: min(580px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card);
    color: var(--ink);
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
}
.tune-dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
.tune-heading { justify-content: space-between; }
.tune-heading h2 { margin: 0; font-size: 1.25rem; }
.tune-dialog p { line-height: 1.5; }
.tune-repeater { font-weight: 700; }
.tune-fields { grid-template-columns: minmax(0, 1fr) 100px; }
.tune-dialog #tune-status { color: var(--accent-strong); }
.tune-dialog[aria-busy="true"] #tune-status::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: tune-spin 1s linear infinite;
}
@keyframes tune-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .tune-dialog[aria-busy="true"] #tune-status::before { animation: none; }
}
.tune-diagnostics { margin-top: 20px; }
.tune-diagnostics summary { cursor: pointer; margin-bottom: 14px; }
.tune-diagnostics input { max-width: 100px; }
.tune-diagnostics pre { max-height: 180px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.8rem; }
.tune-dialog button:disabled { opacity: 0.6; cursor: wait; }
@media (max-width: 420px) {
    .tune-dialog { padding: 18px; }
    .tune-fields { grid-template-columns: 1fr; }
}
