/* ==========================================================================
   Artwork AI Editorial — style.css v2.0
   ========================================================================== */

/* --- ADMIN: GENERALI --- */
.artwork-ai-box { position: relative; padding: 5px; }
.artwork-ai-box textarea { background: #fafafa; border: 1px solid #ddd; }

/* --- ADMIN: CARDS (legacy aw-panel — alias agli stili .aw-card) --- */
/* Le classi .aw-card / .aw-card-title sono definite nel blocco "Card" più avanti.
   Lasciamo qui solo gli stili specifici delle varianti usate nel metabox. */
.aw-card.aw-card-versions  { background: #fcfcfd; }
.aw-card.aw-card-selective { background: #fff; }
.aw-card.aw-card-generate  { background: #fafbff; border-color: #c5d9ed; }
.aw-card.aw-card-ab        { background: #fffaf3; border-color: #ffd8a8; }
.aw-field {
    margin-bottom: 12px;
}
.aw-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 13px;
}
.aw-field input[type="text"],
.aw-field textarea,
.aw-field input[type="password"] {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}
.aw-field textarea {
    min-height: 70px;
}
.aw-btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.aw-btn-orange {
    border-color: #e65100 !important;
    background-color: #e65100 !important;
    color: #fff !important;
}
.aw-success-badge {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 10px;
}

/* --- ADMIN: FAQ DRAG & DROP --- */
.aw-faq-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.aw-faq-count {
    background: #f0f0f1;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #50575e;
}
.aw-faq-sortable {
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 50px;
    padding: 6px;
    background: #fafafa;
    max-height: 400px;
    overflow-y: auto;
}
.aw-faq-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 6px;
    cursor: default;
    transition: background 0.15s;
}
.aw-faq-item:last-child { margin-bottom: 0; }
.aw-faq-item:hover { background: #f5f9ff; }
.aw-faq-item.aw-faq-dragging {
    background: #e8f0fe !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0.9;
}
.aw-faq-handle {
    cursor: grab;
    color: #aaa;
    font-size: 18px;
    line-height: 1;
    padding-top: 2px;
    user-select: none;
    flex-shrink: 0;
}
.aw-faq-handle:active { cursor: grabbing; }
.aw-faq-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.aw-faq-q-input {
    width: 100%;
    font-weight: 600;
    font-size: 13px;
    color: #1d2327;
    padding: 5px 8px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    box-sizing: border-box;
}
.aw-faq-q-input:hover { background: #f8fafc; border-color: #e2e8f0; }
.aw-faq-q-input:focus { background: #fff; border-color: #7c3aed; outline: none; box-shadow: 0 0 0 2px rgba(124,58,237,.15); }
.aw-faq-a-input {
    width: 100%;
    font-size: 12px;
    color: #475569;
    padding: 5px 8px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    resize: vertical;
    min-height: 32px;
    line-height: 1.4;
    box-sizing: border-box;
    font-family: inherit;
}
.aw-faq-a-input:hover { background: #f8fafc; border-color: #e2e8f0; }
.aw-faq-a-input:focus { background: #fff; border-color: #7c3aed; outline: none; box-shadow: 0 0 0 2px rgba(124,58,237,.15); }
.aw-faq-delete {
    flex-shrink: 0;
    width: 24px; height: 24px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: all .15s;
}
.aw-faq-delete:hover { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
/* Back-compat per FAQ vecchie senza input (rare) */
.aw-faq-q { font-weight: 600; font-size: 13px; color: #1d2327; margin-bottom: 3px; }
.aw-faq-a { font-size: 12px; color: #646970; }
.aw-faq-empty {
    color: #aaa;
    font-style: italic;
    font-size: 13px;
    padding: 10px;
    text-align: center;
}
.aw-save-indicator {
    display: inline-block;
    color: #00a32a;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

/* ==========================================================================
   ADMIN LOADER OVERLAY (v2.23 — SaaS premium redesign)
   ========================================================================== */
#artwork-loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
    z-index: 999999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    animation: aw-loader-fade-in .25s ease-out;
}
.artwork-loader-content {
    background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
    padding: 40px 44px 32px;
    border-radius: 18px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .04),
        0 8px 24px rgba(15, 23, 42, .12),
        0 24px 60px rgba(124, 58, 237, .14);
    border: 1px solid rgba(255, 255, 255, .6);
    min-width: 280px;
    max-width: 380px;
    animation: aw-loader-pop .35s cubic-bezier(.16, 1, .3, 1);
}

/* SVG circle ring */
.aw-loader-ring-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
}
.aw-loader-ring {
    width: 100%; height: 100%;
    animation: aw-loader-rotate 1.4s linear infinite;
    transform-origin: center;
}
.aw-loader-ring-bg  { stroke: rgba(124, 58, 237, .12); }
.aw-loader-ring-fg  {
    stroke: #7c3aed;
    stroke-linecap: round;
    stroke-dasharray: 90 220;
    animation: aw-loader-dash 1.8s ease-in-out infinite;
}
/* Pulse esterno: dà "peso" visivo all'operazione importante */
.aw-loader-ring-wrap::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(124, 58, 237, .18);
    animation: aw-loader-pulse 1.8s ease-out infinite;
    pointer-events: none;
}

.artwork-loading-text {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 0;
}
.artwork-loading-subtext {
    margin: 6px 0 0;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    line-height: 1.45;
    min-height: 16px;
    transition: opacity .25s ease;
}
.artwork-loading-subtext.is-fading { opacity: 0; }

@keyframes aw-loader-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes aw-loader-pop {
    from { opacity: 0; transform: translateY(8px) scale(.96); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}
@keyframes aw-loader-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes aw-loader-dash {
    0%   { stroke-dashoffset: 0;    stroke-dasharray: 1 220; }
    50%  { stroke-dashoffset: -50;  stroke-dasharray: 120 220; }
    100% { stroke-dashoffset: -200; stroke-dasharray: 1 220; }
}
@keyframes aw-loader-pulse {
    0%   { transform: scale(1);    opacity: .8; }
    100% { transform: scale(1.35); opacity: 0; }
}

/* Back-compat: vecchio markup .artwork-spinner viene mappato al nuovo ring */
.artwork-spinner {
    width: 64px; height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    border: 3px solid rgba(124, 58, 237, .12);
    border-top-color: #7c3aed;
    border-right-color: #7c3aed;
    animation: aw-loader-rotate 1.4s linear infinite;
    background: transparent;
    position: relative;
}
.artwork-spinner::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 1px solid rgba(124, 58, 237, .18);
    animation: aw-loader-pulse 1.8s ease-out infinite;
    pointer-events: none;
}

/* ==========================================================================
   FRONTEND
   ========================================================================== */

/* --- SIDEBAR OVERLAY & DRAWER --- */
.artwork-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}
.artwork-sidebar {
    /* Custom properties con default 420px — Settings → "Display Mode" può overridarle.
       L'utente può usare px, vw, vh, %, em, rem. */
    --aw-sidebar-w-deepening: 420px;
    --aw-sidebar-w-faq:       420px;
    --aw-sidebar-w-contact:   420px;

    position: fixed;
    top: 0;
    /* Stato chiuso: spostiamo via translateX → independent da unità della width */
    right: 0;
    width: var(--aw-sidebar-w-deepening); /* default; le classi is-tab-* sovrascrivono */
    max-width: 95vw;
    height: 100%;
    background: #121212;
    color: #ffffff;
    z-index: 9999;
    box-shadow: -2px 0 30px rgba(0,0,0,0.4);
    padding: 30px 28px;
    transform: translateX(110%); /* fuori schermo a destra, indipendente dalla width */
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), width 0.2s ease;
    overflow-y: auto;
    overscroll-behavior: contain; /* fix scroll: blocca propagazione al body */
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}
.artwork-sidebar.active { transform: translateX(0); }
/* Width per tab attivo (l'inject inline da inject_button_colors aggiunge !important per safety) */
.artwork-sidebar.is-tab-deepening { width: var(--aw-sidebar-w-deepening); }
.artwork-sidebar.is-tab-faq       { width: var(--aw-sidebar-w-faq); }
.artwork-sidebar.is-tab-contact   { width: var(--aw-sidebar-w-contact); }

/* Lock body scroll quando la sidebar è aperta — previene scroll del background */
html.aw-sidebar-open,
body.aw-sidebar-open {
    overflow: hidden !important;
    touch-action: none;
}
.artwork-sidebar h3 { color: #ffffff; margin-top: 0; }

#artwork-close-sidebar {
    float: right;
    font-size: 28px;
    line-height: 1;
    border: none;
    background: none;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    padding: 0;
    margin: -5px -5px 0 0;
}
#artwork-close-sidebar:hover { color: #ffffff; }

/* --- APPROFONDIMENTO SIDEBAR (dark bg) --- */
.artwork-deepening-content {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255,255,255,0.8);
}
.artwork-deepening-content h3,
.artwork-deepening-content h4 { margin-top: 24px; margin-bottom: 10px; color: #ffffff; }
.artwork-deepening-content p { color: rgba(255,255,255,0.75); }
.artwork-deepening-content strong { color: #ffffff; }
.artwork-deepening-content a { color: rgba(255,255,255,0.9); text-decoration: underline; }
.artwork-deepening-content a:hover { color: #ffffff; }
.artwork-deepening-content ul { padding-left: 20px; }
.artwork-deepening-content li { margin-bottom: 6px; color: rgba(255,255,255,0.75); }

/* --- FAQ ACCORDION SIDEBAR (dark bg) --- */
.artwork-accordion details {
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 14px;
}
.artwork-accordion details:last-child { border-bottom: none; }
.artwork-accordion summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    font-size: 15px;
    color: #ffffff;
    outline: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}
.artwork-accordion summary::-webkit-details-marker { display: none; }
.artwork-accordion details:not([open]) .artwork-arrow-icon { transform: rotate(180deg); }
.artwork-accordion details[open] .artwork-arrow-icon { transform: rotate(0deg); }
.artwork-arrow-icon { transition: transform 0.25s ease; color: rgba(255,255,255,0.5); flex-shrink: 0; }
.details-content { margin-top: 10px; font-size: 14px; color: rgba(255,255,255,0.75); line-height: 1.65; }
.details-content strong { color: #ffffff; }

/* --- CONTATTACI TAB (dark) --- */
#artwork-tab-contact h3 { color: #ffffff; }
.artwork-global-content { color: rgba(255,255,255,0.8); }
.artwork-global-content h1, .artwork-global-content h2,
.artwork-global-content h4 { color: #ffffff; }
.artwork-global-content p { color: rgba(255,255,255,0.75); }
.artwork-global-content a { color: rgba(255,255,255,0.9); }
.artwork-global-content input, .artwork-global-content textarea {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2) !important;
    color: #ffffff !important;
}
.artwork-global-content input::placeholder, .artwork-global-content textarea::placeholder {
    color: rgba(255,255,255,0.4);
}
.artwork-global-content label { color: rgba(255,255,255,0.7); }
.artwork-global-content .wpcf7-list-item-label { color: rgba(255,255,255,0.7) !important; }
.artwork-global-content .wpcf7-list-item-label a { color: rgba(255,255,255,0.9) !important; }

/* --- FAQ E APPROFONDIMENTO INIETTATI NEL BODY CONTENT --- */
.aw-deepening-block {
    margin-top: 40px;
    padding: 28px 32px;
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}
.aw-deepening-title {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 16px;
    color: #1d2327;
}
.aw-faq-body-block {
    margin-top: 40px;
    padding: 28px 32px;
    background: #f8f9fa;
    border-radius: 4px;
}
.aw-faq-body-title {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 20px;
    color: #1d2327;
}

/* --- FLOATING BAR (CSS Variables per colori configurabili) --- */
:root {
    --aw-btn-bg:     #ffffff;
    --aw-btn-text:   #232323;
    --aw-btn-border: #EAEAEA;
    --aw-btn-radius: 6px;
}

.artwork-floating-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999999;
    width: auto;
    max-width: 92%;
}

.artwork-bar-inner {
    display: flex;
    gap: 0;
    border: 1px solid var(--aw-btn-border);
    border-radius: var(--aw-btn-radius);
    background-color: var(--aw-btn-bg);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
}

.artwork-floating-bar .art-btn {
    white-space: nowrap;
    padding: 12px 24px;
    text-decoration: none;
    transition: background-color 0.2s ease;
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    background-color: transparent;
    color: var(--aw-btn-text) !important;
    border: none;
    border-right: 1px solid var(--aw-btn-border);
    line-height: 1;
    text-decoration: none !important;
}
.artwork-floating-bar .art-btn:last-child {
    border-right: none;
}
.artwork-floating-bar .art-btn:hover {
    background-color: rgba(0,0,0,0.04);
    color: var(--aw-btn-text) !important;
    text-decoration: none !important;
}

@media (max-width: 600px) {
    .artwork-floating-bar .art-btn { padding: 10px 14px; font-size: 12px; }
}

/* ==========================================================================
   METABOX — PANNELLO SELETTIVO (v2.1)
   ========================================================================== */

/* Badge */
.aw-card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}
.aw-card-title-row .aw-card-title {
    margin: 0;
    padding: 0;
    border: none;
}
.aw-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.6;
}
.aw-badge-blue   { background: #e8f0fe; color: #1a73e8; }
.aw-badge-gray   { background: #f0f0f1; color: #50575e; }
.aw-badge-ok     { background: #e8f5e9; color: #2e7d32; }
.aw-badge-cat    { background: #ede9fe; color: #6d28d9; border:1px solid #ddd6fe; }

/* Contesto generazione idee salvate */
.aw-saved-ctx { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.aw-saved-ctx-chip {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 600;
}
.aw-saved-ctx-topic  { background: #eff6ff; color: #1d4ed8; border:1px solid #bfdbfe; }
.aw-saved-ctx-target { background: #fffbeb; color: #92400e; border:1px solid #fde68a; }
.aw-saved-ctx-legacy { background: #f1f5f9; color: #64748b; border:1px solid #e2e8f0; font-style: italic; }
.aw-saved-ctx-date   { font-size: 11px; color: #94a3b8; }

/* Griglia selettiva */
.aw-selective-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.aw-selective-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    background: #fff;
    transition: border-color .18s, background .18s, box-shadow .18s, transform .18s;
    position: relative;
    box-shadow: 0 1px 1px rgba(15, 23, 42, .02);
}
.aw-selective-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .05);
    transform: translateY(-1px);
}
.aw-selective-item:has(input:checked) {
    border-color: #c4b5fd;
    background: #faf5ff;
    box-shadow: 0 2px 6px rgba(124, 58, 237, .08);
}
.aw-selective-item.aw-sel-done {
    border-color: #86efac;
    background: #f0fdf4;
}

.aw-sel-label-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 13px;
    color: #1d2327;
}
.aw-sel-label-wrap input[type="checkbox"] {
    margin: 0;
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}
.aw-sel-icon {
    display: inline-flex; align-items: center; justify-content: center;
    color: #475569;
    line-height: 1;
    flex-shrink: 0;
}
.aw-selective-item:has(input:checked) .aw-sel-icon { color: #7c3aed; }
.aw-sel-name { flex: 1; }

.aw-sel-status {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}
.aw-sel-ok    { color: #2e7d32; }
.aw-sel-empty { color: #bbb; }

.aw-sel-desc {
    font-size: 11px;
    color: #888;
    margin: 0;
    line-height: 1.4;
    padding-left: 22px;
}

/* Selezione rapida */
.aw-sel-shortcuts {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #64748b;
    padding-top: 4px;
}
.aw-sel-shortcuts span { font-size: 12px; }
.aw-sel-shortcut {
    color: #475569;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    transition: background .15s, border-color .15s, color .15s;
}
.aw-sel-shortcut:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
    text-decoration: none;
}

/* Summary */
.aw-sel-summary { color: #50575e; font-size: 12px; }
.aw-sel-summary strong { color: #1d2327; }

/* Collapsible */
.aw-collapsible-trigger { cursor: pointer; user-select: none; }
.aw-collapse-icon { font-size: 16px; color: #888; margin-left: auto; }

/* ==========================================================================
   CANNIBALIZZAZIONE
   ========================================================================== */
.aw-field-row { display: flex; gap: 10px; align-items: flex-end; }
.aw-field-grow { flex: 1; }
.aw-field-shrink { flex-shrink: 0; }

.aw-cannib-box {
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1.6;
    margin-top: 8px;
    margin-bottom: 4px;
}
.aw-cannib-box a { color: inherit; text-decoration: underline; }
.aw-cannib-safe    { background: #edfaee; border: 1px solid #a5d6a7; color: #1b5e20; }
.aw-cannib-warning { background: #fff8e1; border: 1px solid #ffe082; color: #5d4037; }
.aw-cannib-danger  { background: #fdecea; border: 1px solid #f5c6c6; color: #b71c1c; }
.aw-cannib-badge-exact {
    display: inline-block;
    background: #d63638;
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 4px;
    font-weight: 600;
}
.aw-cannib-type { color: #888; font-size: 11px; }

/* ==========================================================================
   STORICO VERSIONI
   ========================================================================== */
.aw-versions-list { display: flex; flex-direction: column; gap: 8px; }

.aw-version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    gap: 10px;
    flex-wrap: wrap;
}
.aw-version-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.aw-version-date { font-weight: 600; font-size: 12px; color: #1d2327; }
.aw-version-kw   { font-size: 11px; color: #0073aa; background: #e8f0fe; padding: 2px 7px; border-radius: 3px; }
.aw-version-len  { font-size: 11px; color: #888; }
.aw-version-actions { display: flex; gap: 6px; align-items: center; }
.aw-version-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: #d63638;
    font-size: 14px;
    padding: 2px 4px;
    line-height: 1;
}
.aw-version-delete:hover { color: #a00; }

/* Modale versione */
#aw-version-preview-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 100000; }
.aw-modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); }
.aw-modal-box {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    width: 680px;
    max-width: 95vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.aw-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: #fff;
}
.aw-modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #555; }
.aw-modal-body  { padding: 18px; font-size: 14px; line-height: 1.7; }

/* ==========================================================================
   A/B TEST META SEO
   ========================================================================== */
.aw-badge-purple { background: #f3e8ff; color: #6d28d9; }

.aw-ab-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fafafa;
    transition: border-color 0.2s, background 0.2s;
}
.aw-ab-card.aw-ab-applied {
    border-color: #00a32a;
    background: #f0fff3;
}
.aw-ab-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.aw-ab-label {
    font-weight: 700;
    font-size: 13px;
    color: #1d2327;
    background: #f0f0f1;
    padding: 3px 10px;
    border-radius: 20px;
}
.aw-ab-field { margin-bottom: 8px; }
.aw-ab-field-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}
.aw-ab-len { font-weight: 600; }
.aw-ab-preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a0dab;
    line-height: 1.4;
}
.aw-ab-preview-desc {
    font-size: 13px;
    color: #4d5156;
    line-height: 1.5;
}

/* ==========================================================================
   LISTA POST — COLONNE AI
   ========================================================================== */
.aw-col-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.column-ai_content, .column-ai_faq, .column-ai_seo,
.column-ai_deepening, .column-ai_actions { width: 70px; text-align: center; }
.column-ai_actions { width: 160px; text-align: left; }

.aw-status-dot { font-size: 14px; line-height: 1; display: inline-block; }
.aw-dot-ok    { color: #2e7d32; }
.aw-dot-empty { color: #ccc; }
.aw-col-count { display: block; font-size: 10px; color: #888; line-height: 1; margin-top: 2px; }

/* Quick actions nella lista */
.aw-quick-actions { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.aw-quick-select  { font-size: 11px; max-width: 105px; padding: 2px 4px; }
.aw-quick-run     { font-size: 11px; padding: 2px 6px !important; min-width: 24px; }
.aw-quick-status  { font-size: 10px; font-weight: 600; display: block; margin-top: 2px; width: 100%; }

/* ==========================================================================
   SCROLL TARGET HIGHLIGHT
   Lampeggio temporaneo quando si scrolla a FAQ o Approfondimento
   ========================================================================== */
@keyframes aw-highlight-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(0,115,170,0); }
    30%  { box-shadow: 0 0 0 8px rgba(0,115,170,0.3); }
    100% { box-shadow: 0 0 0 0 rgba(0,115,170,0); }
}
.aw-block-highlight {
    animation: aw-highlight-pulse 1.8s ease-out;
    border-radius: 4px;
}

/* ==========================================================================
   BLOCCHI NEL BODY CONTENT (Approfondimento + FAQ)
   Stile pulito, coerente con il tema, leggibile da Google e LLM
   ========================================================================== */
.aw-deepening-block {
    margin-top: 48px;
    padding: 32px 36px;
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    border-radius: 0 4px 4px 0;
    scroll-margin-top: 90px; /* offset per header fisso */
}
.aw-deepening-title {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 18px;
    color: #1d2327;
}
.aw-deepening-block h3,
.aw-deepening-block h4 { margin-top: 22px; margin-bottom: 10px; }
.aw-deepening-block p  { line-height: 1.75; }
.aw-deepening-block ul { padding-left: 22px; }
.aw-deepening-block li { margin-bottom: 6px; line-height: 1.65; }
.aw-deepening-block a  { color: #0073aa; }

.aw-faq-body-block {
    margin-top: 48px;
    padding: 32px 36px;
    background: #f8f9fa;
    border-radius: 4px;
    scroll-margin-top: 90px;
}
.aw-faq-body-title {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 22px;
    color: #1d2327;
}

/* FAQ accordion nel body: stile chiaro (non dark come la sidebar) */
.aw-faq-body-block .artwork-accordion details {
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0;
    padding: 0;
}
.aw-faq-body-block .artwork-accordion details:last-child { border-bottom: none; }
.aw-faq-body-block .artwork-accordion summary {
    color: #1d2327;
    padding: 14px 0;
    font-size: 15px;
}
.aw-faq-body-block .artwork-accordion .artwork-arrow-icon { color: #999; }
.aw-faq-body-block .artwork-accordion .details-content {
    color: #444;
    padding-bottom: 14px;
    font-size: 14px;
    line-height: 1.7;
}
.aw-faq-body-block .artwork-accordion .details-content strong { color: #1d2327; }

@media (max-width: 600px) {
    .aw-deepening-block,
    .aw-faq-body-block { padding: 20px 18px; }
}

/* ==========================================================================
   AW-SEO-BLOCK — Contenuto nel DOM per Google/LLM, nascosto visivamente
   Tecnica sr-only standard (Bootstrap/Tailwind) — NON penalizzata da Google
   perché è pratica legittima di accessibilità, non keyword stuffing nascosto
   Il contenuto è leggibile da screen reader e crawler, invisibile all'occhio
   ========================================================================== */
.aw-seo-block {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ============================================================
   ADMIN PAGES — layout condiviso (Piano Editoriale, settings custom)
   Riusa la palette del wizard (nero/grigi + viola wizard come accento solo per primary)
   ============================================================ */

.aw-page-wrap {
    margin: -10px -20px -20px -22px;
    min-height: calc(100vh - 32px);
    background: #f8fafc;
    padding: 32px 24px;
    box-sizing: border-box;
}
.aw-page-inner { max-width: 1280px; margin: 0 auto; }

.aw-page-header {
    display:flex; align-items:flex-start; justify-content:space-between;
    margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.aw-page-title {
    font-size: 24px; font-weight: 700; color:#0f172a; margin: 0 0 4px;
    letter-spacing: -0.01em;
}
.aw-page-sub {
    font-size: 14px; color: #64748b; margin: 0; line-height: 1.5;
}
.aw-page-actions {
    display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}

/* ==========================================================================
   ADMIN SETTINGS — TABS (v2.17.5)
   ========================================================================== */
.aw-settings-form { max-width: 1200px; }
.aw-settings-tabs {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin: 0 0 24px;
    padding: 6px;
    background: #f1f5f9;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.aw-settings-tab {
    appearance: none; -webkit-appearance: none;
    background: transparent;
    border: 1px solid transparent;
    color: #475569;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
    line-height: 1.2;
}
.aw-settings-tab:hover {
    background: #fff;
    color: #0f172a;
}
.aw-settings-tab.is-active {
    background: #fff;
    color: #0f172a;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
.aw-settings-tab:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}
.aw-settings-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 28px 32px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
    margin-bottom: 18px;
}
.aw-settings-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}
.aw-settings-section-title:not(:first-child) {
    margin-top: 32px;
}
.aw-settings-panel .form-table {
    margin-top: 12px;
}
.aw-settings-panel .form-table th {
    padding: 16px 14px 16px 0;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
}
.aw-settings-panel .form-table td {
    padding: 14px 0;
}
.aw-settings-panel .description {
    color: #64748b;
    font-size: 12px;
    margin-top: 6px;
}
@media (max-width: 782px) {
    .aw-settings-panel { padding: 18px 16px; }
    .aw-settings-tabs { padding: 4px; }
    .aw-settings-tab { padding: 8px 10px; font-size: 12px; }
}

/* ==========================================================================
   HEALTH CHECK DASHBOARD (v2.18.0)
   ========================================================================== */
.aw-health-card { max-width: 1200px; }
.aw-health-summary {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 14px;
}
.aw-health-pill {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}
.aw-health-pill strong { font-weight: 700; }
.aw-health-pill-ok    { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.aw-health-pill-warn  { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.aw-health-pill-error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.aw-health-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.aw-health-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    line-height: 1.5;
}
.aw-health-icon {
    flex-shrink: 0;
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 12px;
}
.aw-health-ok    { border-left: 3px solid #16a34a; }
.aw-health-ok    .aw-health-icon { background: #dcfce7; color: #15803d; }
.aw-health-warn  { border-left: 3px solid #f59e0b; }
.aw-health-warn  .aw-health-icon { background: #fef3c7; color: #b45309; }
.aw-health-error { border-left: 3px solid #dc2626; background: #fef2f2; }
.aw-health-error .aw-health-icon { background: #fee2e2; color: #b91c1c; }
.aw-health-body { flex: 1; color: #334155; }
.aw-health-body strong { color: #0f172a; }
.aw-health-fix {
    flex-shrink: 0;
    color: #7c3aed;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
}
.aw-health-fix:hover { color: #5b21b6; }

/* Compact mode quando tutti i check sono OK */
.aw-health-card-compact {
    padding: 10px 16px !important;
    margin-bottom: 18px;
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
}
.aw-health-card-compact .aw-card-title-row { margin: 0 !important; padding: 0 !important; border: none !important; }
.aw-health-wrapper.is-all-ok .aw-health-summary { padding: 4px 0; margin-bottom: 0; }
.aw-health-wrapper.is-all-ok .aw-health-pill-warn,
.aw-health-wrapper.is-all-ok .aw-health-pill-error { display: none; }
.aw-health-allok-msg {
    color: #15803d;
    font-weight: 600;
    font-size: 12px;
    margin-left: 4px;
}
.aw-health-toggle {
    margin-left: auto;
    background: none;
    border: none;
    color: #64748b;
    font-size: 11px;
    cursor: pointer;
    text-decoration: underline;
    padding: 2px 6px;
}
.aw-health-toggle:hover { color: #0f172a; }
.aw-health-toggle .aw-health-toggle-hide { display: none; }
.aw-health-toggle[aria-expanded="true"] .aw-health-toggle-show { display: none; }
.aw-health-toggle[aria-expanded="true"] .aw-health-toggle-hide { display: inline; }
.aw-health-list[hidden] { display: none; }
.aw-health-wrapper.is-all-ok .aw-health-list { margin-top: 10px; }

/* ==========================================================================
   FRONTEND ENHANCEMENTS (v2.20.0) — TOC, badges, author box, AI disclosure
   ========================================================================== */

/* TOC */
.aw-toc {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #7c3aed;
    border-radius: 8px;
    padding: 18px 22px;
    margin: 24px 0;
    font-size: 15px;
}
.aw-toc-title {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.aw-toc-list { margin: 0; padding-left: 22px; counter-reset: aw-toc; }
.aw-toc-list li {
    padding: 4px 0;
    list-style: none;
    counter-increment: aw-toc;
    position: relative;
}
.aw-toc-list li::before {
    content: counter(aw-toc) ".";
    position: absolute;
    left: -22px;
    color: #94a3b8;
    font-weight: 600;
}
.aw-toc-list a {
    color: #475569;
    text-decoration: none;
    transition: color .15s;
}
.aw-toc-list a:hover { color: #7c3aed; text-decoration: underline; }

/* Last reviewed badge */
.aw-last-reviewed {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    color: #15803d;
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 18px;
}
.aw-last-reviewed-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 12px;
}

/* AI disclosure */
.aw-ai-disclosure {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-left: 3px solid #64748b;
    border-radius: 6px;
    margin: 28px 0 12px;
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}
.aw-ai-disclosure-icon {
    color: #64748b;
    font-size: 16px;
    line-height: 1;
}

/* Author box */
.aw-author-box {
    margin: 32px 0 8px;
    padding: 22px 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.aw-author-box-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}
.aw-author-box-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
}
.aw-author-box-meta { flex: 1; min-width: 0; }
.aw-author-box-label {
    color: #94a3b8;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
}
.aw-author-box-name {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    margin: 2px 0;
}
.aw-author-box-name:hover { color: #7c3aed; }
.aw-author-box-role {
    font-size: 13px;
    color: #475569;
}
.aw-author-box-signals {
    display: flex; flex-wrap: wrap; gap: 12px;
    padding: 10px 0;
    border-top: 1px solid #f1f5f9;
    color: #475569;
    font-size: 13px;
}
.aw-author-signal strong { color: #0f172a; }
.aw-author-box-bio {
    margin: 14px 0 0;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    color: #334155;
    font-size: 14px;
    line-height: 1.6;
}

/* ==========================================================================
   SHORTCODE BLOCK [artwork_ai_block] — varianti stile
   ========================================================================== */
.aw-block { margin: 24px 0; }
.aw-block .aw-deepening-block + .aw-faq-body-block { margin-top: 24px; }

/* Compact: padding + spaziature ridotte */
.aw-block-compact .aw-deepening-block,
.aw-block-compact .aw-faq-body-block { padding: 0; }
.aw-block-compact .aw-deepening-title,
.aw-block-compact .aw-faq-body-title {
    font-size: 16px;
    margin: 0 0 10px;
}
.aw-block-compact .artwork-details summary { padding: 8px 12px; }
.aw-block-compact .details-content { padding: 0 12px 10px; }

/* Card: wrapper boxed con shadow */
.aw-block-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 28px 32px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.aw-block-card .aw-deepening-title,
.aw-block-card .aw-faq-body-title {
    font-size: 18px;
    color: #0f172a;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    margin: 0 0 16px;
}

/* Grid 2-column (sidebar + main) */
.aw-grid-2 {
    display: grid; gap: 20px;
    grid-template-columns: 320px 1fr;
}
@media (max-width: 960px) {
    .aw-grid-2 { grid-template-columns: 1fr; }
}

/* Card */
.aw-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.aw-card-sticky {
    position: sticky; top: 46px; align-self: flex-start;
}
.aw-card-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 15px; font-weight: 700; color: #0f172a;
    margin: 0 0 18px;
    padding-bottom: 14px; border-bottom: 1px solid #f1f5f9;
}
.aw-card-title .aw-wiz-icon { color: #475569; }

/* Form */
.aw-form-field { margin-bottom: 14px; }
.aw-form-field label {
    display: block; font-size: 12px; font-weight: 600;
    color: #475569; margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: .03em;
}
.aw-form-field input[type="text"],
.aw-form-field input[type="search"],
.aw-form-field input[type="url"],
.aw-form-field select,
.aw-form-field textarea {
    width: 100%; padding: 10px 12px; box-sizing: border-box;
    border: 1px solid #cbd5e1; border-radius: 8px;
    font-size: 14px; background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
    font-family: inherit;
}
.aw-form-field input:focus,
.aw-form-field select:focus,
.aw-form-field textarea:focus {
    outline: none; border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}

/* Button variants — extend wizard btns */
.aw-btn-block { width: 100%; }
.aw-btn-sm {
    padding: 6px 12px; font-size: 12px; border-radius: 8px;
    gap: 4px;
}
.aw-btn-sm .aw-wiz-icon { width: 14px; height: 14px; }
.aw-btn-danger { color: #dc2626; }
.aw-btn-danger:hover { background: #fef2f2; color: #b91c1c; }
.aw-btn-disabled {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    cursor: default !important;
    pointer-events: none;
}

/* Loader inline */
.aw-loader {
    margin-top: 14px; padding: 12px 14px;
    background: #f5f3ff; border: 1px solid #ddd6fe;
    border-radius: 10px;
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: #6d28d9;
}
.aw-spinner {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid #ddd6fe; border-top-color: #7c3aed;
    animation: aw-spin .8s linear infinite;
    display: inline-block;
}
@keyframes aw-spin { to { transform: rotate(360deg); } }

/* Table moderna */
.aw-table {
    width: 100%; border-collapse: collapse; background: #fff;
    font-size: 13.5px; color: #1e293b;
}
.aw-table thead th {
    text-align: left;
    font-size: 11px; font-weight: 700;
    color: #64748b; text-transform: uppercase; letter-spacing: .04em;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
}
.aw-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.aw-table tbody tr:last-child td { border-bottom: none; }
.aw-table tbody tr:hover td { background: #f8fafc; }
.aw-table strong { color: #0f172a; }
.aw-table-empty {
    text-align: center !important;
    color: #94a3b8;
    padding: 32px !important;
    font-style: italic;
}
.aw-row-done    td { background: #f0fdf4; }
.aw-row-done:hover td { background: #ecfdf5 !important; }
.aw-row-warning td { background: #fffbeb; }
.aw-row-warning:hover td { background: #fef3c7 !important; }
.aw-row-new td { background: #f5f3ff; }
.aw-actions {
    display: flex; gap: 4px; align-items: center;
    white-space: nowrap;
}

/* Badge — varianti */
.aw-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 600; line-height: 1.4;
    text-decoration: none;
    border: 1px solid transparent;
}
.aw-badge .aw-wiz-icon { width: 11px; height: 11px; stroke-width: 2; }
.aw-badge-done    { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.aw-badge-done:hover { background: #d1fae5; color: #065f46; }
.aw-badge-pending { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.aw-badge-warning { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.aw-badge-new     { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.aw-badge-info    { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.aw-badge-neutral { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

.aw-meta-note {
    padding: 10px 14px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px; color: #475569;
    margin-bottom: 14px;
}

/* ============================================================
   SETUP WIZARD — admin.php?page=artwork-ai-wizard
   ============================================================ */

/* Inline SVG icons (Lucide-style, currentColor) */
.aw-wiz-icon { flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* shared buttons (riusabili anche fuori dal wizard) */
.aw-btn-primary, .aw-btn-secondary, .aw-btn-ghost {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 11px 22px; border-radius: 10px;
    font-size: 14px; font-weight: 600; line-height: 1;
    cursor: pointer; border: 1px solid transparent;
    text-decoration: none; transition: all .15s ease;
}
.aw-btn-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: #fff; box-shadow: 0 1px 2px rgba(79,70,229,.25);
}
.aw-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,.35); color:#fff; }
.aw-btn-primary:active { transform: translateY(0); }
.aw-btn-primary:disabled { opacity:.5; cursor:not-allowed; transform:none; box-shadow:none; }
.aw-btn-secondary { background: #fff; color: #1d2327; border-color: #d1d5db; }
.aw-btn-secondary:hover { background: #f9fafb; border-color: #9ca3af; color:#1d2327; }
.aw-btn-ghost { background: transparent; color: #6b7280; }
.aw-btn-ghost:hover { color: #1d2327; background: #f3f4f6; }

/* Wizard wrap (hides default WP padding) */
.aw-wiz-wrap {
    margin: -10px -20px -20px -22px;
    min-height: calc(100vh - 32px);
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    padding: 40px 20px;
    box-sizing: border-box;
}
.aw-wiz-shell {
    max-width: 880px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(15,23,42,.08), 0 1px 3px rgba(15,23,42,.05);
    overflow: hidden;
}

/* Header */
.aw-wiz-header {
    display:flex; align-items:center; justify-content:space-between;
    padding: 22px 32px; border-bottom: 1px solid #f1f5f9;
}
.aw-wiz-brand { display:flex; align-items:center; gap:14px; }
.aw-wiz-brand-name { font-size: 16px; font-weight: 700; color:#0f172a; }
.aw-wiz-brand-sub  { font-size: 12px; color:#64748b; margin-top:2px; }
.aw-wiz-skip {
    font-size: 13px; color: #94a3b8; text-decoration: none;
}
.aw-wiz-skip:hover { color: #475569; }

/* Stepper */
.aw-wiz-stepper {
    display:flex; align-items:center; gap:6px;
    padding: 14px 24px 0; flex-wrap: wrap;
}
.aw-wiz-step-pill {
    display:flex; align-items:center; gap:8px;
    padding: 6px 12px; border-radius: 20px;
    font-size: 12px; color:#94a3b8; cursor: default;
    transition: all .15s ease;
}
.aw-wiz-step-pill .aw-wiz-step-num {
    display:inline-flex; align-items:center; justify-content:center;
    width: 20px; height: 20px; border-radius: 50%;
    background: #f1f5f9; color: #94a3b8; font-weight: 700;
    font-size: 11px;
}
.aw-wiz-step-pill.is-active { background: #f5f3ff; color: #6d28d9; cursor:pointer; }
.aw-wiz-step-pill.is-active .aw-wiz-step-num { background: #7c3aed; color: #fff; }
.aw-wiz-step-pill.is-done { color: #10b981; cursor:pointer; }
.aw-wiz-step-pill.is-done .aw-wiz-step-num { background: #10b981; color: #fff; }
.aw-wiz-step-pill.is-done .aw-wiz-step-num::before { content: "✓"; }
.aw-wiz-step-pill.is-done .aw-wiz-step-num { font-size: 0; }
.aw-wiz-step-pill.is-done .aw-wiz-step-num::before { font-size: 11px; }

/* Progress bar */
.aw-wiz-progress {
    height: 3px; background: #f1f5f9; margin: 14px 32px 0;
    border-radius: 3px; overflow: hidden;
}
.aw-wiz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed 0%, #4f46e5 50%, #06b6d4 100%);
    transition: width .35s cubic-bezier(.4,0,.2,1);
}

/* Body */
.aw-wiz-body { padding: 36px 32px 32px; }
.aw-wiz-h1 { font-size: 26px; font-weight: 700; color:#0f172a; margin: 0 0 8px; line-height: 1.25; }
.aw-wiz-lead { font-size: 15px; color: #475569; margin: 0 0 26px; line-height: 1.55; }
.aw-wiz-hint { font-size: 13px; color:#64748b; margin: 22px 0 0; }
.aw-wiz-step { animation: aw-wiz-fadein .25s ease; }
@keyframes aw-wiz-fadein { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform:none; } }

/* Welcome feature grid */
.aw-wiz-feature-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 18px 0;
}
.aw-wiz-feature {
    padding: 16px; background: #f8fafc; border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.aw-wiz-feature-icon { color: #0f172a; margin-bottom: 10px; display: flex; }
.aw-wiz-feature-title { font-size: 14px; font-weight: 700; color:#0f172a; margin-bottom: 4px; }
.aw-wiz-feature-desc { font-size: 13px; color: #64748b; line-height: 1.5; }

/* Choice (radio) cards */
.aw-wiz-choice-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-bottom: 22px; }
.aw-wiz-choice {
    position: relative; display:block;
    padding: 18px; padding-right: 44px;
    background:#fff; border: 2px solid #e2e8f0; border-radius: 12px;
    cursor: pointer; transition: all .15s ease;
}
.aw-wiz-choice:hover { border-color: #c7d2fe; }
.aw-wiz-choice input { position: absolute; opacity: 0; pointer-events: none; }
.aw-wiz-choice-title { font-size: 15px; font-weight: 700; color:#0f172a; margin-bottom: 4px; }
.aw-wiz-choice-desc  { font-size: 13px; color: #64748b; line-height: 1.5; }
.aw-wiz-choice-check {
    position: absolute; top: 16px; right: 16px;
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid #cbd5e1; color: transparent;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800;
    transition: all .15s ease;
}
.aw-wiz-choice input:checked ~ .aw-wiz-choice-check,
.aw-wiz-choice:has(input:checked) .aw-wiz-choice-check {
    background: #7c3aed; border-color: #7c3aed; color: #fff;
}
.aw-wiz-choice:has(input:checked) { border-color: #7c3aed; background: #faf5ff; }

/* Fields */
.aw-wiz-field { margin-bottom: 20px; }
.aw-wiz-field label { display:block; font-size: 13px; font-weight: 600; color:#334155; margin-bottom: 6px; }
.aw-wiz-field input[type="text"],
.aw-wiz-field input[type="password"],
.aw-wiz-field input[type="url"],
.aw-wiz-field textarea {
    width: 100%; padding: 11px 14px; box-sizing: border-box;
    border: 1px solid #cbd5e1; border-radius: 10px;
    font-size: 14px; color: #0f172a; background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
    font-family: inherit;
}
.aw-wiz-field input:focus,
.aw-wiz-field textarea:focus {
    outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}
.aw-wiz-field-help { font-size: 12px; color: #64748b; margin-top: 6px; line-height: 1.5; }
.aw-wiz-field-help a { color: #6d28d9; }

.aw-wiz-input-group { position: relative; }
.aw-wiz-input-group input { padding-right: 44px; }
.aw-wiz-eye {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border-radius: 8px;
    background: transparent; border: none; cursor: pointer;
    color: #64748b;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0;
}
.aw-wiz-eye:hover { background: #f1f5f9; color: #1d2327; }

/* Test API row */
.aw-wiz-test-row {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 26px;
}
.aw-wiz-test-result { font-size: 13px; }
.aw-wiz-ok      { color: #059669; font-weight: 600; }
.aw-wiz-err     { color: #dc2626; font-weight: 600; }
.aw-wiz-pending { color: #6b7280; }

/* Tone grid */
.aw-wiz-tone-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.aw-wiz-tone {
    position: relative; padding: 14px 16px; padding-right: 40px;
    background:#fff; border: 2px solid #e2e8f0; border-radius: 10px;
    cursor: pointer; transition: all .15s ease;
}
.aw-wiz-tone:hover { border-color: #c7d2fe; }
.aw-wiz-tone input { position: absolute; opacity: 0; pointer-events: none; }
.aw-wiz-tone-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:4px; }
.aw-wiz-tone-name { font-size: 14px; font-weight: 700; color:#0f172a; }
.aw-wiz-tone-check {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid #cbd5e1; color: transparent;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800;
    flex-shrink: 0;
}
.aw-wiz-tone:has(input:checked) { border-color: #7c3aed; background: #faf5ff; }
.aw-wiz-tone:has(input:checked) .aw-wiz-tone-check { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.aw-wiz-tone-desc { font-size: 12px; color: #64748b; line-height: 1.45; }

.aw-wiz-preview {
    margin: 0 0 22px;
    padding: 16px 18px;
    background: #faf5ff; border: 1px dashed #d8b4fe; border-radius: 10px;
}
.aw-wiz-preview-label { font-size: 11px; font-weight: 700; color: #7c3aed; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.aw-wiz-preview-text  { font-size: 14px; color: #1e293b; line-height: 1.6; font-style: italic; }

/* Radio chip rows (audience / content length / register) */
.aw-wiz-radio-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.aw-wiz-radio-chip {
    position: relative;
    padding: 8px 14px; border-radius: 999px;
    background: #fff; border: 1.5px solid #e2e8f0;
    font-size: 13px; color: #475569; cursor: pointer;
    transition: all .15s ease;
    user-select: none;
}
.aw-wiz-radio-chip:hover { border-color: #c7d2fe; }
.aw-wiz-radio-chip input { position: absolute; opacity: 0; pointer-events: none; }
.aw-wiz-radio-chip:has(input:checked) {
    background: #7c3aed; border-color: #7c3aed; color: #fff; font-weight: 600;
}

/* Two-column row */
.aw-wiz-two-col {
    display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
    margin-bottom: 4px;
}
.aw-wiz-two-col .aw-wiz-field { margin-bottom: 16px; }
@media (max-width: 700px) {
    .aw-wiz-two-col { grid-template-columns: 1fr; }
}

/* Wizard step 6 — Suggerimenti AI focus keyword */
.aw-wiz-kw-suggest {
    padding: 16px 18px;
    background: #faf5ff;
    border: 1px solid #d8b4fe;
    border-radius: 12px;
    margin-bottom: 22px;
}
.aw-wiz-kw-suggest-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px; gap: 8px;
}
.aw-wiz-kw-suggest-title {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 700; color: #7c3aed;
    text-transform: uppercase; letter-spacing: .04em;
}
.aw-wiz-kw-loading {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: #6d28d9;
    padding: 6px 0;
}
.aw-wiz-kw-empty {
    padding: 8px 0 4px;
}
.aw-wiz-kw-chips {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 4px;
}
.aw-wiz-kw-chip {
    padding: 8px 14px; border-radius: 999px;
    background: #fff; border: 1.5px solid #e2e8f0;
    font-size: 13px; color: #1e293b; font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
    font-family: inherit;
}
.aw-wiz-kw-chip:hover {
    border-color: #7c3aed; color: #6d28d9; background: #faf5ff;
    transform: translateY(-1px);
}
.aw-wiz-kw-chip.is-selected {
    background: #7c3aed; border-color: #7c3aed; color: #fff;
}
.aw-wiz-kw-error {
    padding: 10px 12px; background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 8px; color: #dc2626; font-size: 13px;
}

/* Chip suggerimenti negative prompt */
.aw-wiz-tips { margin-top: 6px; }
.aw-wiz-tips-title { font-size: 12px; color: #64748b; margin-bottom: 8px; }
.aw-wiz-chip {
    display: inline-block; margin: 0 6px 6px 0;
    padding: 6px 12px; background: #f1f5f9; border: 1px solid #e2e8f0;
    border-radius: 16px; font-size: 12px; color: #475569;
    cursor: pointer; transition: all .15s ease;
}
.aw-wiz-chip:hover { background: #e0e7ff; border-color: #c7d2fe; color: #4338ca; }

/* Action rows */
.aw-wiz-actions {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 26px; padding-top: 22px; border-top: 1px solid #f1f5f9;
    gap: 12px;
}
.aw-wiz-actions-3 { justify-content: flex-end; gap: 10px; }
.aw-wiz-actions-3 .aw-wiz-prev { margin-right: auto; }

/* Done card */
.aw-wiz-done-card { text-align: center; padding: 14px 6px 6px; }
.aw-wiz-done-icon {
    color: #0f172a;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
}
.aw-wiz-summary {
    list-style: none; padding: 18px 22px; margin: 18px auto 24px;
    max-width: 480px; text-align: left;
    background: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0;
}
.aw-wiz-summary li {
    padding: 8px 0; border-bottom: 1px solid #e2e8f0;
    font-size: 14px; color: #334155;
}
.aw-wiz-summary li:last-child { border-bottom: none; }
.aw-wiz-summary strong { color: #0f172a; }
.aw-wiz-cta-grid {
    display: flex; gap: 12px; justify-content: center; margin: 18px 0 8px;
    flex-wrap: wrap;
}
.aw-wiz-cta { min-width: 220px; }

/* First-run admin notice */
.aw-wiz-notice { border-left-color: #7c3aed !important; }
.aw-wiz-notice strong { color: #6d28d9; }

/* Responsive */
@media (max-width: 700px) {
    .aw-wiz-shell { border-radius: 0; }
    .aw-wiz-wrap { padding: 0; margin: -10px -20px -20px -22px; }
    .aw-wiz-body { padding: 24px 18px; }
    .aw-wiz-header { padding: 16px 18px; }
    .aw-wiz-stepper { padding: 12px 14px 0; }
    .aw-wiz-step-pill .aw-wiz-step-lbl { display: none; }
    .aw-wiz-feature-grid,
    .aw-wiz-choice-grid,
    .aw-wiz-tone-grid { grid-template-columns: 1fr; }
    .aw-wiz-actions { flex-direction: column; align-items: stretch; }
    .aw-wiz-actions .aw-btn-primary,
    .aw-wiz-actions .aw-btn-secondary,
    .aw-wiz-actions .aw-btn-ghost { width: 100%; }
}
