/* ========================================
   Input Area - AMC Deep Mimicry
   ======================================== */
#input-area {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    padding: 8px 20px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    gap: 8px;

    /* Theme-specific variables scoped for input area (AMC light/dark themes) */
    --amc-bg-input: #ffffff;
    --amc-border: #D9D9E3;
    --amc-border-focus: #40414F;
    --amc-btn-hover: #ECECF1;
    --amc-text-primary: #000000;
    --amc-text-secondary: #000000;
    --amc-text-tertiary: #666666;
    --amc-icon-color: #323232;
    --amc-accent: #40414F;
    --amc-accent-hover: #202123;
    --amc-accent-text: #ffffff;
    --amc-danger: #DF3434;
    --amc-danger-hover: #B32929;
    --amc-success-bg: rgba(22, 163, 74, 0.1);
    --amc-success-text: #16a34a;
}

[data-theme="dark"] #input-area {
    --amc-bg-input: #121214; /* Zinc 925 - Very deep input area */
    --amc-border: #27272a; /* Zinc 800 */
    --amc-border-focus: #3b82f6; /* Blue 500 */
    --amc-btn-hover: #18181b; /* Zinc 900 */
    --amc-text-primary: #f4f4f5; /* Zinc 100 */
    --amc-text-secondary: #a1a1aa; /* Zinc 400 */
    --amc-text-tertiary: #52525b; /* Zinc 600 */
    --amc-icon-color: #a1a1aa;
    --amc-accent: #3b82f6;
    --amc-accent-hover: #2563eb;
    --amc-accent-text: #ffffff;
    --amc-danger: #7f1d1d; /* Red 900 */
    --amc-danger-hover: #991b1b;
    --amc-success-bg: rgba(16, 185, 129, 0.15); /* Emerald 900-ish tint */
    --amc-success-text: #34d399; /* Emerald 400 */
}

.input-box {
    width: 90%;
    max-width: 820px;
    background-color: var(--amc-bg-input);
    border: 1px solid var(--amc-border);
    border-radius: 26px;
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-sizing: border-box;
}

[data-theme="dark"] .input-box {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

.input-box:focus-within {
    border-color: var(--amc-border-focus);
    box-shadow: 0 0 0 1px var(--amc-border-focus), 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    background-color: var(--amc-bg-input);
}

[data-theme="dark"] .input-box:focus-within {
    box-shadow: 0 0 0 1px var(--amc-border-focus), 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

#user-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 2px 4px 0 4px;
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: var(--amc-text-primary);
    outline: none;
    resize: none;
    max-height: 200px;
    height: 38px;
    min-height: 26px;
    overflow-y: hidden;
    font-family: inherit;
    box-sizing: border-box;
    transition: height var(--transition-fast);
}

#user-input::placeholder {
    color: var(--amc-text-tertiary);
}

.input-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border-top: none;
    padding-top: 4px;
}

.input-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Toolbar button styling (search engine & deep search) - AMC borderless style */
.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid transparent;
    background-color: transparent;
    color: var(--amc-text-secondary);
    border-radius: 9999px; /* rounded-full */
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.toolbar-btn:hover {
    background-color: var(--amc-btn-hover);
    color: var(--amc-text-primary);
}

.toolbar-btn:focus-visible {
    border-color: var(--amc-border-focus);
    box-shadow: 0 0 0 2px var(--amc-border-focus);
}

.toolbar-btn .icon-svg {
    width: 16px;
    height: 16px;
    color: var(--amc-icon-color);
    transition: color 0.2s ease;
    display: block;
}

.toolbar-btn:hover .icon-svg {
    color: var(--amc-text-primary);
}

.toolbar-btn .toolbar-symbol {
    width: 16px;
    height: 16px;
    color: var(--amc-icon-color);
    font-size: 16px;
    line-height: 1;
    transition: color 0.2s ease;
}

.toolbar-btn:hover .toolbar-symbol {
    color: var(--amc-text-primary);
}

.toolbar-btn .chevron-svg {
    width: 14px;
    height: 14px;
    color: var(--amc-text-tertiary);
    margin-left: -2px;
    display: block;
}

/* Quick Engine Dropdown */
.quick-engine-wrapper {
    position: relative;
}

.quick-dropdown-menu {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background-color: var(--amc-bg-input);
    border: 1px solid var(--amc-border);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    z-index: 1000;
    overflow: hidden;
    padding: 6px 0;
    animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.quick-dropdown-menu.active {
    display: block;
}

.quick-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--amc-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
}

.quick-dropdown-item:hover {
    background-color: var(--amc-btn-hover);
    color: var(--amc-text-primary);
}

.quick-dropdown-item.active {
    background-color: var(--amc-btn-hover);
    color: var(--amc-border-focus);
    font-weight: 600;
}

.engine-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    color: var(--amc-text-tertiary);
    transition: color 0.15s ease, fill 0.15s ease;
    flex-shrink: 0;
    display: block;
}

.engine-icon.logo-duckduckgo {
    color: #DE5833 !important;
}

.engine-icon.logo-google {
    color: #4285F4 !important;
}

.engine-icon.logo-bing {
    color: #0078D4 !important;
}

.engine-icon.logo-sogou {
    color: #FF4A00 !important;
}

.engine-icon.logo-brave {
    color: #FB542B !important;
}

.engine-icon.logo-searxng {
    color: #00A9E0 !important;
}

.quick-dropdown-item:hover .engine-icon:not(.logo-duckduckgo):not(.logo-google):not(.logo-bing):not(.logo-sogou):not(.logo-brave):not(.logo-searxng) {
    color: var(--amc-text-primary);
}

.quick-dropdown-item.active .engine-icon:not(.logo-duckduckgo):not(.logo-google):not(.logo-bing):not(.logo-sogou):not(.logo-brave):not(.logo-searxng) {
    color: var(--amc-border-focus);
}

#quick-engine-icon-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

#quick-engine-icon-container .engine-icon {
    color: var(--amc-icon-color);
    transition: color 0.2s ease;
}

.toolbar-btn:hover #quick-engine-icon-container .engine-icon {
    color: var(--amc-text-primary);
}

/* Deep Search Toggle - AMC active styles */
.quick-interactive-wrapper {
    display: flex;
    align-items: center;
}

.quick-live-artifacts-wrapper {
    display: flex;
    align-items: center;
}

#quick-interactive-btn.active {
    background-color: var(--amc-success-bg);
    color: var(--amc-success-text);
}

#quick-live-artifacts-btn.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

#quick-interactive-btn.active .icon-svg,
#quick-interactive-btn.active .toolbar-symbol {
    color: var(--amc-success-text);
}

#quick-live-artifacts-btn.active .icon-svg,
#quick-live-artifacts-btn.active .toolbar-symbol {
    color: var(--primary);
}

.interactive-status-badge,
.live-artifacts-status-badge {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--amc-text-tertiary);
    margin-left: 2px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

#quick-interactive-btn.active .interactive-status-badge {
    background-color: var(--amc-success-text);
    box-shadow: 0 0 4px var(--amc-success-text);
}

#quick-live-artifacts-btn.active .live-artifacts-status-badge {
    background-color: var(--primary);
    box-shadow: 0 0 4px var(--primary);
}

/* Submit/Send Button - Morphing and Animations */
#send-btn {
    width: 40px;
    height: 40px;
    background-color: var(--amc-accent);
    border: none;
    color: var(--amc-accent-text);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px; /* rounded-full */
    transition: background-color 0.15s ease, color 0.15s ease, border-radius 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

#send-btn:hover {
    background-color: var(--amc-accent-hover);
}

#send-btn:disabled, #send-btn.inactive {
    background-color: var(--amc-btn-hover);
    color: var(--amc-text-tertiary);
    cursor: not-allowed;
    transform: none !important;
}

/* Processing/Stop state morphing */
#send-btn.processing {
    background-color: var(--amc-danger);
    color: var(--amc-accent-text);
    border-radius: 10px; /* morph from circle to rounded square */
}

#send-btn.processing:hover {
    background-color: var(--amc-danger-hover);
}

/* Send & Stop Icons transition */
#send-btn .send-icon-svg,
#send-btn .stop-icon-svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1) rotate(0);
    opacity: 1;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
    display: block;
}

/* Regular state: show send, hide stop */
#send-btn .stop-icon-svg {
    transform: translate(-50%, -50%) scale(0.5) rotate(-90deg);
    opacity: 0;
    pointer-events: none;
}

/* Processing/Stop state: hide send, show stop */
#send-btn.processing .send-icon-svg {
    transform: translate(-50%, -50%) scale(0.5) rotate(-90deg);
    opacity: 0;
    pointer-events: none;
}

#send-btn.processing .stop-icon-svg {
    transform: translate(-50%, -50%) scale(1) rotate(0);
    opacity: 1;
}

/* ========================================
   Modals
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg-elevated);
    margin: 5vh auto;
    padding: 0;
    border-radius: var(--radius-lg);
    width: 440px;
    max-width: 90vw;
    max-height: 85vh;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 0;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.close-btn {
    cursor: pointer;
    font-size: 22px;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    line-height: 1;
}

.close-btn:hover {
    background-color: var(--error-light);
    color: var(--error);
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background-color: var(--bg-input);
    color: var(--text-primary);
    box-sizing: border-box;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 44px;
}

.password-toggle-btn {
    position: absolute;
    right: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.password-toggle-btn:hover {
    color: var(--primary);
}

.password-toggle-btn span {
    font-size: 20px;
}

/* --- Modal Buttons --- */
.modal-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background-color: var(--bg-elevated);
    position: sticky;
    bottom: 0;
    z-index: 5;
}

.modal-actions button {
    flex: 1;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.save-btn {
    background-color: var(--primary);
    color: var(--text-inverse);
    border: none;
}

.save-btn:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.secondary-btn {
    background-color: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-primary);
}

.secondary-btn:hover {
    background-color: var(--bg-secondary);
    border-color: var(--text-muted);
}

.danger-btn {
    background-color: transparent;
    border: 1.5px solid var(--error);
    color: var(--error);
}

.danger-btn:hover {
    background-color: var(--error);
    color: white;
}

/* ========================================
   Blinking Cursor (Streaming)
   ======================================== */
.blinking-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background-color: var(--primary);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
    border-radius: 1px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ========================================
   AMC-inspired Settings Modal
   ======================================== */
#settings-modal.modal.active {
    align-items: center;
    justify-content: center;
}

.amc-settings-modal {
    --amc-modal-width: 1120px;
    --amc-sidebar-width: 256px;
    --amc-content-width: 768px;
    --amc-radius: 8px;
    --amc-radius-lg: 12px;
}

.settings-modal-content {
    width: min(90vw, var(--amc-modal-width));
    height: min(85vh, 800px);
    min-height: 560px;
    max-width: 95vw;
    max-height: 85vh;
    margin: 0;
    padding: 0;
    border-radius: var(--amc-radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg);
    box-shadow: var(--shadow-xl);
}

.settings-modal-layout {
    display: flex;
    height: 100%;
    width: 100%;
}

.settings-sidebar {
    width: var(--amc-sidebar-width);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-height: 0;
}

.settings-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 20px;
    flex-shrink: 0;
}

.settings-sidebar-close-btn {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--amc-radius);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.settings-sidebar-close-btn:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.settings-sidebar-close-btn .material-symbols-rounded {
    font-size: 20px;
}

.settings-mobile-title,
.settings-mobile-spacer {
    display: none;
}

.settings-tabs {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 12px 12px;
    scrollbar-width: thin;
}

.settings-tab-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-tab-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 14px;
    background: transparent;
    border: 0;
    border-radius: var(--amc-radius);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.settings-tab-btn:hover {
    background: color-mix(in srgb, var(--bg-elevated) 60%, var(--border-light));
    color: var(--text-primary);
}

.settings-tab-btn.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-weight: 600;
}

.settings-tab-btn .material-symbols-rounded {
    color: var(--text-muted);
    font-size: 19px;
    transition: color var(--transition-fast);
}

.settings-tab-btn.active .material-symbols-rounded {
    color: var(--text-primary);
}



.settings-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--bg);
    overflow: hidden;
}

.settings-panels {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 32px 36px 28px;
    scrollbar-width: thin;
}

.settings-panel {
    display: none;
    flex-direction: column;
    gap: 22px;
    width: 100%;
    max-width: var(--amc-content-width);
    margin: 0 auto;
    animation: tabFadeIn 0.18s ease-out;
}

.settings-panel.active {
    display: flex;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.settings-section-heading {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 2px;
}

.api-settings-heading {
    align-items: flex-start;
    flex-direction: row;
    justify-content: space-between;
    gap: 16px;
}

.settings-section-kicker {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.panel-header-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 650;
    line-height: 1.25;
}

.settings-save-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: var(--amc-radius);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.settings-save-status .material-symbols-rounded {
    font-size: 16px;
}

.settings-save-status.is-saved {
    border-color: color-mix(in srgb, var(--success) 28%, var(--border));
    background: var(--success-light);
    color: var(--success);
}

.settings-save-status.is-pending,
.settings-save-status.is-saving {
    border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
    background: var(--primary-light);
    color: var(--primary);
}

.settings-save-status.is-invalid,
.settings-save-status.is-error {
    border-color: color-mix(in srgb, var(--warning) 38%, var(--border));
    background: var(--warning-light);
    color: var(--warning);
}

.settings-save-status.is-saving .material-symbols-rounded {
    animation: api-verify-spin 0.85s linear infinite;
}

.settings-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: transparent;
}

.settings-card > .form-group,
.settings-card > .settings-field-row,
.settings-card > .form-grid {
    padding: 14px 0;
}

.settings-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0;
}

.settings-field-copy {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.field-desc,
.toggle-desc {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 0;
}

.form-group label,
.settings-field-copy label {
    display: block;
    margin: 0 0 7px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 650;
}

.settings-field-copy label {
    margin: 0;
}

.toggle-label {
    color: var(--text-primary) !important;
    font-size: 14px !important;
    margin: 0 !important;
}

.form-group input,
.form-group select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: var(--amc-radius);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.settings-field-row > select,
.settings-field-row > input {
    width: min(280px, 45%);
    flex-shrink: 0;
}

.engine-check-row {
    align-items: flex-start;
}

.engine-check-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 104px;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: var(--amc-radius);
    font-size: 13px;
    font-weight: 650;
}

.engine-check-btn .material-symbols-rounded {
    font-size: 18px;
}

.engine-check-btn:disabled {
    cursor: wait;
    opacity: 0.72;
}

.engine-check-btn.is-checking .material-symbols-rounded,
.engine-check-pending .material-symbols-rounded {
    display: inline-flex;
    animation: api-verify-spin 0.85s linear infinite;
}

.engine-check-results {
    display: none;
    padding: 2px 0 12px;
}

.engine-check-results.active {
    display: block;
}

.engine-check-query {
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.engine-check-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.engine-check-result,
.engine-check-pending,
.engine-check-empty {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 9px 10px;
    border-radius: var(--amc-radius);
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.engine-check-result .material-symbols-rounded,
.engine-check-pending .material-symbols-rounded,
.engine-check-empty .material-symbols-rounded {
    flex: 0 0 auto;
    font-size: 19px;
}

.engine-check-result.available {
    background: var(--success-light);
    color: var(--success);
}

.engine-check-result.unavailable {
    background: var(--error-light);
    color: var(--error);
}

.engine-check-copy {
    min-width: 0;
}

.engine-check-name {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
}

.engine-check-detail {
    margin-top: 2px;
    color: currentColor;
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--border-focus) 18%, transparent);
    outline: none;
}

.toggle-group {
    background: transparent;
    border: 0;
    border-radius: 0;
}

.ios-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 24px;
    transition: background-color 0.22s ease;
}

.ios-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ios-switch input:checked + .ios-slider {
    background: var(--text-primary);
}

.ios-switch input:checked + .ios-slider::before {
    transform: translateX(20px);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

.form-grid .form-group {
    min-width: 0;
}

.api-label-row {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
}


.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 78px !important;
}

.password-actions-wrapper {
    position: absolute;
    right: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.password-actions-wrapper .password-toggle-btn {
    position: static;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: var(--amc-radius);
    color: var(--text-muted);
}

.password-actions-wrapper .password-toggle-btn:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.password-toggle-btn.is-validating {
    color: var(--primary);
    cursor: wait;
}

.password-toggle-btn.is-validating span {
    display: inline-flex;
    animation: api-verify-spin 0.85s linear infinite;
}

@keyframes api-verify-spin {
    to {
        transform: rotate(360deg);
    }
}

.about-hero {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
    padding: 32px 20px 24px;
    text-align: center;
    background: transparent;
    margin-bottom: 0;
}

.about-logo {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: transform var(--transition-normal);
}

.about-logo::before {
    position: absolute;
    inset: -12px -24px;
    content: "";
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
    filter: blur(16px);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.about-logo:hover {
    transform: scale(1.03);
}

.about-logo:hover::before {
    opacity: 1;
}

.about-logo-img {
    height: 48px;
    border-radius: var(--radius-sm);
}

.about-logo-light {
    width: 190px;
    object-fit: cover;
    object-position: center;
    background: #ffffff;
}

.about-logo-dark {
    width: auto;
    object-fit: contain;
    background: transparent;
    display: none;
}

[data-theme="dark"] .about-logo-light {
    display: none;
}

[data-theme="dark"] .about-logo-dark {
    display: block;
}

.about-version-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 32px;
    padding: 1px;
    overflow: hidden;
    border-radius: var(--radius-full);
    color: var(--text-primary);
    text-decoration: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.about-version-pill::before {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(90deg, #10b981, #06b6d4, #3b82f6);
    opacity: 0.72;
    z-index: 0;
}

.about-version-pill > span {
    position: relative;
    z-index: 1;
}

.about-version-pill > span:not(.about-version-separator) {
    display: inline-flex;
    align-items: center;
}

.about-version-pill::after {
    position: absolute;
    inset: 1px;
    content: "";
    border-radius: inherit;
    background: var(--bg);
    z-index: 0;
}

.about-version-pill:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

#about-version {
    padding-left: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
}

.about-version-pill .material-symbols-rounded {
    padding-right: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.about-version-separator {
    width: 1px;
    height: 12px;
    background: var(--border);
}

.about-status-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}

.about-description {
    max-width: 480px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 13.5px;
    line-height: 1.6;
}

.about-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.about-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 150px;
    min-height: 38px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.about-action-link:hover {
    border-color: var(--border-focus);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.about-action-link.github-primary {
    border-color: #24292f;
    background: #24292f;
    color: #ffffff;
}

.about-action-link.github-primary:hover {
    border-color: #111827;
    background: #111827;
}

[data-theme="dark"] .about-action-link.github-primary {
    border-color: #ffffff;
    background: #ffffff;
    color: #111827;
}

[data-theme="dark"] .about-action-link.github-primary:hover {
    border-color: #e5e7eb;
    background: #e5e7eb;
}

.about-action-link .material-symbols-rounded {
    color: #f59e0b;
    font-size: 16px;
}

#about-stars-count {
    font-variant-numeric: tabular-nums;
}

.history-transfer-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 16px;
}

.history-transfer-card .maintenance-card {
    padding: 12px 0;
}

.history-transfer-card .maintenance-card + .maintenance-card {
    border-top: 1px solid var(--border-light);
}

.history-transfer-card .maintenance-title {
    color: var(--text-primary);
}

.history-transfer-card .maintenance-desc {
    color: var(--text-secondary);
}

.history-transfer-card .secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    width: auto;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--amc-radius);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 650;
}

.history-transfer-card .secondary-btn:hover {
    border-color: var(--border-focus);
    background: var(--bg-secondary);
}

.history-transfer-card .secondary-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.history-transfer-card .material-symbols-rounded {
    font-size: 17px;
}

.about-meta-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
    padding: 12px 20px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.about-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.about-meta-label {
    color: var(--text-muted);
    font-weight: 550;
}

.about-meta-value {
    color: var(--text-secondary);
}

.about-meta-dot {
    color: var(--border);
    font-size: 14px;
    user-select: none;
}

.settings-danger-zone {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-radius: var(--amc-radius-lg);
    border: 1px solid rgba(127, 29, 29, 0.35);
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #ffffff;
    box-shadow: var(--shadow-lg);
}

.settings-danger-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 4px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.settings-danger-header .material-symbols-rounded {
    font-size: 18px;
}

.maintenance-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 0;
}

.maintenance-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.maintenance-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 650;
}

.maintenance-desc {
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    line-height: 1.5;
}

.maintenance-card button {
    flex-shrink: 0;
    width: auto !important;
    min-height: 34px;
    padding: 7px 12px !important;
    border-radius: var(--amc-radius) !important;
    font-size: 12px !important;
    font-weight: 650 !important;
}

.settings-danger-zone .secondary-btn,
.settings-danger-zone .danger-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
}

.settings-danger-zone .secondary-btn:hover,
.settings-danger-zone .danger-btn:hover {
    background: rgba(255, 255, 255, 0.18) !important;
}

.danger-btn.fill {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 36px 24px;
    background: color-mix(in srgb, var(--bg) 94%, var(--bg-secondary));
    flex-shrink: 0;
}

.settings-actions button {
    min-height: 40px;
    padding: 9px 16px;
    border-radius: var(--amc-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 650;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.settings-actions .save-btn {
    background: var(--text-primary);
    color: var(--bg);
    border: 1px solid var(--text-primary);
}

.settings-actions .save-btn:hover {
    background: var(--text-secondary);
    border-color: var(--text-secondary);
    box-shadow: none;
}

.settings-actions .secondary-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.settings-actions .secondary-btn:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

@media (max-width: 760px) {
    #settings-modal.modal.active {
        align-items: stretch;
    }

    .settings-modal-content {
        width: 100vw;
        height: 100dvh;
        min-height: 0;
        max-width: 100vw;
        max-height: 100dvh;
        border-radius: 0;
    }

    .settings-modal-layout {
        flex-direction: column;
    }

    .settings-sidebar {
        width: 100%;
        min-height: 0;
        border-right: 0;
    }

    .settings-sidebar-header {
        min-height: 56px;
        padding: 10px 14px;
    }

    .settings-mobile-title {
        display: inline-flex;
        color: var(--text-primary);
        font-size: 15px;
        font-weight: 700;
    }

    .settings-mobile-spacer {
        display: block;
        width: 36px;
        height: 36px;
    }

    .settings-tabs {
        flex: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 12px 10px;
        -webkit-overflow-scrolling: touch;
    }

    .settings-tab-group {
        flex-direction: row;
        gap: 6px;
        width: max-content;
    }

    .settings-tab-btn {
        width: auto;
        min-height: 38px;
        white-space: nowrap;
        padding: 8px 11px;
        font-size: 13px;
    }

    .settings-tab-btn .material-symbols-rounded {
        font-size: 18px;
    }


    .settings-main {
        min-height: 0;
    }

    .settings-panels {
        padding: 22px 18px;
    }

    .settings-panel {
        max-width: none;
        gap: 20px;
    }

    .panel-header-title {
        font-size: 19px;
    }

    .settings-field-row {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .settings-field-row > select,
    .settings-field-row > input {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .api-label-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .settings-danger-zone {
        padding: 16px;
    }

    .about-hero {
        min-height: 0;
        gap: 16px;
        padding: 4px 0 0;
    }

    .about-logo {
        gap: 10px;
    }

    .about-version-pill {
        max-width: 100%;
    }

    .about-description {
        font-size: 13px;
    }

    .about-action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .about-action-link {
        width: 100%;
    }

    .about-meta-grid {
        flex-direction: column;
        gap: 8px;
        margin-top: 24px;
    }

    .about-meta-dot {
        display: none;
    }

    .maintenance-card {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .maintenance-card button {
        width: 100% !important;
    }

    .settings-actions {
        padding: 12px 18px 16px;
    }

    .settings-actions button {
        flex: 1;
    }

    .provider-grid {
        grid-template-columns: 1fr;
    }

    .workflow-step-models-container {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Model List Settings Rows Styling
   ======================================== */
.provider-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.api-settings-card {
    gap: 14px;
}

.api-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 2px;
}

.api-card-title {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
}

.api-card-subtitle,
.workflow-model-subtitle {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.workflow-model-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
    padding: 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--amc-radius);
    background: color-mix(in srgb, var(--bg-secondary) 58%, transparent);
}

.workflow-model-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 28px;
}

.workflow-model-title {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
}

.workflow-step-models-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.workflow-step-model-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.workflow-step-model-row label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 650;
}

.workflow-step-model-select {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: var(--amc-radius);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
}

.provider-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: var(--amc-radius);
    border: 1px solid var(--border-light);
    background: var(--bg-input);
    box-shadow: var(--shadow-xs);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.provider-card:hover {
    border-color: var(--border);
}

.provider-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
}

.provider-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 1;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.provider-collapse-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.provider-title-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.provider-card-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.provider-default-badge {
    display: none;
    flex: 0 0 auto;
    min-height: 20px;
    padding: 3px 7px;
    border-radius: var(--amc-radius);
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.provider-card.is-default .provider-default-badge {
    display: inline-flex;
    align-items: center;
}

.provider-card-subtitle {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.2;
    word-break: break-all;
}

.provider-summary-row {
    display: none;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.provider-card.collapsed .provider-summary-row {
    display: flex;
}

.provider-summary-pill {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: min(100%, 260px);
    min-height: 24px;
    padding: 4px 8px;
    border-radius: var(--amc-radius);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.2;
}

.provider-summary-base-url {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.provider-summary-key-status.is-empty {
    color: var(--warning);
    background: var(--warning-light);
}

.provider-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.provider-default-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 650;
}

.provider-default-label input {
    margin: 0;
}

.provider-collapse-icon {
    font-size: 20px;
    color: var(--text-muted);
    transition: transform var(--transition-fast) ease;
}

.provider-card.collapsed .provider-collapse-icon {
    transform: rotate(-90deg);
}

.provider-card-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0 14px 14px;
}

.provider-card.collapsed .provider-card-body {
    display: none;
}

.provider-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.provider-card .form-group.has-error input,
.provider-card .form-group.has-error select,
.model-settings-group.has-error .model-panel-toggle {
    border-color: var(--warning);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 14%, transparent);
}

.provider-field-error {
    margin-top: 6px;
    color: var(--warning);
    font-size: 12px;
    line-height: 1.35;
}

.remove-provider-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--amc-radius);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast) ease;
}

.remove-provider-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color, #ef4444);
    border-color: rgba(239, 68, 68, 0.2);
}

.provider-card-quick-actions {
    display: none;
}

.model-settings-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.model-panel-header {
    display: flex;
    align-items: center;
}

.model-panel-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--amc-radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
}

.model-panel-title {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 650;
}

.model-panel-summary {
    flex: 1;
    min-width: 0;
    color: var(--text-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-panel-icon {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 18px;
}

.model-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 4px;
}

.model-settings-group.collapsed .model-list-container,
.model-settings-group.collapsed .provider-add-model-btn {
    display: none;
}

.model-row {
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn var(--transition-fast) ease-out;
}

.model-row .model-id-input,
.model-row .model-name-input {
    flex: 1;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: var(--amc-radius);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13.5px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.model-row .model-id-input:focus,
.model-row .model-name-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--border-focus) 18%, transparent);
    outline: none;
}

.model-row .remove-model-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-height: 36px;
    border-radius: var(--amc-radius);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast) ease;
}

.model-row .remove-model-btn:hover {
    background-color: var(--hover-bg, rgba(239, 68, 68, 0.1));
    color: var(--danger-color, #ef4444);
    border-color: rgba(239, 68, 68, 0.2);
}

.add-model-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    min-height: 38px;
    width: fit-content;
    border-radius: var(--amc-radius);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
}

.add-model-btn:hover {
    background-color: var(--hover-bg, #f4f4f5);
    border-color: var(--border-focus);
}

[data-theme="dark"] .add-model-btn:hover {
    background-color: var(--amc-btn-hover);
}

.add-model-btn .material-symbols-rounded {
    font-size: 18px;
}

@media (max-width: 760px) {
    .api-settings-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .settings-save-status {
        align-self: flex-start;
    }

    .api-card-header {
        align-items: stretch;
        flex-direction: column;
    }

    #add-provider-btn {
        width: 100%;
    }

    .provider-card-header {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .provider-collapse-btn {
        width: 100%;
    }

    .provider-card-actions {
        justify-content: space-between;
        width: 100%;
    }

    .provider-grid,
    .workflow-step-models-container {
        grid-template-columns: 1fr;
    }

    .model-row {
        align-items: stretch;
        display: grid;
        grid-template-columns: 1fr 1fr 36px;
    }
}

@media (max-width: 480px) {
    .settings-panels {
        padding: 20px 16px;
    }

    .provider-card-header {
        padding: 13px;
    }

    .provider-card-body {
        padding: 0 13px 13px;
    }

    .model-row {
        grid-template-columns: 1fr;
    }

    .model-row .remove-model-btn {
        justify-self: end;
    }
}
