:root {
    --aiw-space: 16px;
    --aiw-radius: 18px;
    --aiw-border: rgba(15, 118, 110, 0.2);
    --aiw-bg-muted: #f1f9f6;
    --aiw-bg-card: #ffffff;
    --aiw-text-muted: #0f5132;
    --aiw-brand: #10b981;
    --aiw-brand-dark: #059669;
    --aiw-brand-accent: #34d399;
    --aiw-shadow: 0 25px 60px rgba(15, 118, 110, 0.15);
}

.aiw-settings-page-wrapper {
    margin: 24px 0 48px;
    padding: clamp(24px, 4vw, 40px);
    background: linear-gradient(140deg, rgba(241, 253, 247, 0.95), rgba(214, 249, 238, 0.85));
    border-radius: 28px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: var(--aiw-shadow);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.aiw-settings-page-wrapper::before,
.aiw-settings-page-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 120% -10%, rgba(52, 211, 153, 0.25), transparent 65%);
    z-index: -1;
}

.aiw-settings-page-wrapper::after {
    background: radial-gradient(circle at -10% 130%, rgba(129, 212, 250, 0.12), transparent 70%);
}

.acw-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: clamp(20px, 3vw, 32px);
    border-radius: 26px;
    background: radial-gradient(circle at top left, rgba(16, 185, 129, 0.18), rgba(247, 254, 252, 0));
    border: 1px solid rgba(16, 185, 129, 0.18);
}

.acw-page-header h1 {
    margin: 6px 0;
    font-size: clamp(26px, 3.2vw, 34px);
    font-weight: 700;
    background: linear-gradient(120deg, #022b26, var(--aiw-brand), var(--aiw-brand-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.acw-page-header p {
    margin: 0;
    color: rgba(2, 43, 38, 0.85);
    font-size: 15px;
    max-width: 620px;
}

.aiw-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    font-weight: 600;
    color: var(--aiw-brand-dark);
    margin: 0;
}

.aiw-upgrade-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--aiw-brand), var(--aiw-brand-dark));
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(15, 118, 110, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.aiw-upgrade-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(15, 118, 110, 0.45);
}

.aiw-settings-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin: 28px 0 6px;
}

.aiw-metric-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    padding: 20px;
    border: 1px solid rgba(16, 185, 129, 0.18);
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.aiw-metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 36px rgba(15, 118, 110, 0.18);
}

.aiw-metric-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    color: rgba(15, 81, 50, 0.7);
}

.aiw-metric-card strong {
    display: block;
    font-size: 20px;
    margin: 6px 0;
    color: #022b26;
}

.aiw-metric-card p {
    margin: 0 0 12px;
    color: rgba(2, 43, 38, 0.65);
    font-size: 13px;
}

.aiw-metric-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    text-decoration: none;
}

.aiw-metric-pill.is-accent {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--aiw-brand-dark);
}

.aiw-metric-pill.is-muted {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.3);
    color: rgba(15, 23, 42, 0.6);
}

.aiw-settings-main {
    margin-top: 32px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 28px;
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid rgba(16, 185, 129, 0.12);
    box-shadow: 0 25px 60px rgba(15, 118, 110, 0.08);
}

.aiw-inline-notice {
    margin: 20px 0 0;
    border-radius: 16px;
    border: 1px solid rgba(220, 38, 38, 0.2);
    box-shadow: 0 12px 24px rgba(220, 38, 38, 0.12);
}

.ai-content-wizard-tabs {
    margin-top: 32px;
}

.ai-content-wizard-tabs .tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 999px;
    border: none;
    box-shadow: 0 15px 35px rgba(15, 118, 110, 0.12);
    backdrop-filter: blur(8px);
}

.ai-content-wizard-tabs .tab-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    background: transparent;
    border: none;
    color: #0b2f2d;
    font-weight: 600;
    transition: all 0.2s ease;
}

.ai-content-wizard-tabs .tab-link .tab-icon {
    width: 18px;
    height: 18px;
    color: inherit;
}

.ai-content-wizard-tabs .tab-link.active {
    background: linear-gradient(120deg, rgba(16, 185, 129, 0.9), rgba(5, 150, 105, 0.9));
    color: #fff;
    box-shadow: 0 15px 35px rgba(15, 118, 110, 0.3);
    transform: translateY(-1px);
}

.ai-content-wizard-tabs .tab-link .pro-badge {
    margin-left: 6px;
    font-size: 10px;
    padding: 2px 6px;
}

.ai-content-wizard-form {
    margin-top: 24px;
}

.tab-content {
    display: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 254, 250, 0.95));
    border-radius: 22px;
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid rgba(15, 118, 110, 0.12);
    box-shadow: 0 25px 45px rgba(15, 118, 110, 0.08);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.tab-content.active {
    display: block;
}

.tab-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 15% 20%, rgba(52, 211, 153, 0.08), transparent 55%);
    pointer-events: none;
}

.tab-content > * {
    position: relative;
    z-index: 1;
}

.aiw-settings-header {
    margin: 0 0 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    font-size: 24px;
    font-weight: 700;
    color: #022b26;
    position: relative;
    letter-spacing: -0.4px;
    padding: 18px 22px 34px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    border: 1px solid rgba(15, 118, 110, 0.15);
    box-shadow: 0 20px 40px rgba(15, 118, 110, 0.12);
}

.aiw-settings-header::after {
    content: '';
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 12px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--aiw-brand), var(--aiw-brand-accent));
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.ai-content-wizard-model-name {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
    background: linear-gradient(120deg, var(--aiw-brand-dark), var(--aiw-brand));
    padding: 4px 12px;
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.ai-content-wizard-change-model-link {
    color: var(--aiw-brand-dark);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.ai-content-wizard-change-model-link:hover {
    color: var(--aiw-brand);
    transform: translateX(2px);
}

.ai-content-wizard-setting {
    background: rgba(248, 252, 250, 0.92);
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(15, 118, 110, 0.12);
    margin-bottom: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.06);
}

.ai-content-wizard-setting:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(15, 118, 110, 0.12);
}

.ai-content-wizard-setting label {
    font-weight: 600;
    color: #0b2f2d;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-content-wizard-setting select,
.ai-content-wizard-setting textarea,
.ai-content-wizard-setting input[type="text"] {
    width: 100%;
    margin-top: 10px;
    border-radius: 10px;
    border: 1px solid rgba(15, 118, 110, 0.2);
    padding: 10px 12px;
    font-size: 14px;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(15, 118, 110, 0.05);
}

.ai-content-wizard-setting .switch {
    margin-right: 10px;
}

.ai-content-wizard-setting .pro-badge {
    background: var(--aiw-brand);
    border-radius: 999px;
}

.aiw-locked-setting {
    opacity: 0.55;
    pointer-events: none;
}

.aiw-highlight-card {
    border: 1px solid rgba(255, 193, 7, 0.4);
    background: linear-gradient(180deg, #fff9e6 0%, #ffe7a3 100%);
    color: #4d2d00;
    box-shadow: 0 12px 24px rgba(255, 193, 7, 0.25);
}

.aiw-tab-note {
    color: var(--aiw-text-muted);
    font-size: 13px;
    margin-top: -6px;
    margin-bottom: 14px;
}

.aiw-settings-page-wrapper .notice {
    margin-top: 24px;
    border-radius: 12px;
}

.aiw-settings-page-wrapper .button-primary {
    padding: 10px 26px;
    font-size: 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--aiw-brand), var(--aiw-brand-accent));
    border: none;
    box-shadow: 0 12px 24px rgba(108, 92, 231, 0.25);
}

.aiw-settings-page-wrapper .button-primary:hover {
    opacity: 0.95;
}

@media (max-width: 782px) {
    .acw-page-header {
        flex-direction: column;
        text-align: center;
    }

    .aiw-upgrade-link {
        width: 100%;
        justify-content: center;
    }

    .ai-content-wizard-tabs .tabs {
        flex-direction: column;
    }

    .ai-content-wizard-tabs .tab-link {
        width: 100%;
        justify-content: center;
    }
}
