.theme-toggle-form {
    margin: 0;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
}

.theme-toggle span {
    width: 18px;
    font-size: 18px;
    line-height: 1;
    text-align: center;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --paper: #0d1722;
    --white: #152331;
    --ink: #e6eef5;
    --muted: #9cafbd;
    --border: #2a3d4e;
    --blue: #53b6ee;
    --cyan: #45c6e5;
    --green: #55d2a0;
    --amber: #f0ad4e;
    --red: #ff7d87;
    --shadow: 0 12px 32px rgba(0, 0, 0, .26);
}

html[data-theme="dark"] body {
    background: var(--paper);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    color: var(--ink);
    background: #101d29;
    border-color: #385064;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #778d9e;
}

html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover,
html[data-theme="dark"] input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ink);
    box-shadow: 0 0 0 1000px #101d29 inset;
}

html[data-theme="dark"] th,
html[data-theme="dark"] .settings-actions,
html[data-theme="dark"] .html-editor-toolbar {
    background: #101d29;
}

html[data-theme="dark"] .button.secondary,
html[data-theme="dark"] .pagination-pages a,
html[data-theme="dark"] .pagination-edge,
html[data-theme="dark"] .html-editor,
html[data-theme="dark"] .html-editor-toolbar button,
html[data-theme="dark"] .html-editor-toolbar select,
html[data-theme="dark"] .login-card {
    color: var(--ink);
    background: var(--white);
    border-color: var(--border);
}

html[data-theme="dark"] .button.primary,
html[data-theme="dark"] .pagination-current {
    color: #071521;
}

html[data-theme="dark"] .pagination-current {
    background: var(--blue);
    border-color: var(--blue);
}

html[data-theme="dark"] .settings-unit {
    color: var(--muted);
    background: #101d29;
    border-color: #385064;
}

html[data-theme="dark"] .settings-field > label,
html[data-theme="dark"] .settings-provider-block h3,
html[data-theme="dark"] .advanced-settings summary,
html[data-theme="dark"] .indicator-row legend,
html[data-theme="dark"] .html-editor-toolbar button,
html[data-theme="dark"] .html-editor-toolbar select,
html[data-theme="dark"] .campaign-message-tab:hover,
html[data-theme="dark"] .settings-tab:hover,
html[data-theme="dark"] .campaign-placeholder-chip {
    color: var(--ink);
}

html[data-theme="dark"] .html-editor-content {
    color: var(--ink);
    background: #101d29;
}

html[data-theme="dark"] .html-editor-toolbar button.is-active {
    color: #071521;
    background: var(--blue);
}

html[data-theme="dark"] .email-html-preview,
html[data-theme="dark"] .campaign-placeholder-chip {
    background: #101d29;
}

html[data-theme="dark"] .campaign-placeholder-chip:hover {
    color: var(--cyan);
    background: #173548;
    border-color: var(--cyan);
}

html[data-theme="dark"] .badge,
html[data-theme="dark"] .status-none {
    color: #c3d2dd;
    background: #293b4b;
}

html[data-theme="dark"] .status-matched,
html[data-theme="dark"] .status-confirmed,
html[data-theme="dark"] .status-completed,
html[data-theme="dark"] .status-won,
html[data-theme="dark"] .status-qualified {
    color: #7ce0b8;
    background: #173d32;
}

html[data-theme="dark"] .status-failed,
html[data-theme="dark"] .status-lost,
html[data-theme="dark"] .status-excluded {
    color: #ffabb1;
    background: #4a252c;
}

html[data-theme="dark"] .status-running,
html[data-theme="dark"] .status-scanning,
html[data-theme="dark"] .status-contacted {
    color: #8dd5ff;
    background: #19384c;
}

html[data-theme="dark"] .status-unreachable,
html[data-theme="dark"] .status-review,
html[data-theme="dark"] .status-probable,
html[data-theme="dark"] .status-unchanged {
    color: #f6c875;
    background: #46351e;
}

html[data-theme="dark"] .status-stopped,
html[data-theme="dark"] .status-archived {
    color: #b4c3ce;
    background: #293641;
}

html[data-theme="dark"] .message {
    color: #a8dcfb;
    background: #18384c;
}

html[data-theme="dark"] .message.success {
    color: #83e2bd;
    background: #183d32;
}

html[data-theme="dark"] .message.error {
    color: #ffb0b6;
    background: #49262c;
}

html[data-theme="dark"] .progress {
    background: #283a49;
}

html[data-theme="dark"] .score {
    color: #071521;
    background: var(--cyan);
}

html[data-theme="dark"] ::selection {
    color: #071521;
    background: var(--cyan);
}

@media (prefers-reduced-motion: no-preference) {
    html[data-theme="dark"] body,
    html[data-theme="dark"] .panel,
    html[data-theme="dark"] .stat,
    html[data-theme="dark"] input,
    html[data-theme="dark"] select,
    html[data-theme="dark"] textarea {
        transition: background-color .16s ease, color .16s ease, border-color .16s ease;
    }
}
