/* ── WooFAQ AI Admin ─────────────────────────────────────────────────────── */
.epwf-admin-wrap{max-width:1060px;padding-top:0;}

/* Header */
.epwf-header{background:linear-gradient(135deg,#7c3aed,#4f46e5);border-radius:12px;max-width:1060px;margin:10px 0 0 20px;margin-bottom:0;box-shadow:0 4px 18px rgba(124,58,237,.22);}
.epwf-header-inner{display:flex;align-items:center;justify-content:space-between;padding:22px 28px;}
.epwf-logo{display:flex;align-items:center;gap:14px;}
.epwf-logo-icon{font-size:2.2rem;}
.epwf-logo h1{color:#fff;margin:0;font-size:1.6rem;line-height:1.2;}
.epwf-logo p{color:rgba(255,255,255,.8);margin:4px 0 0;font-size:.88rem;}
.epwf-version-badge{background:rgba(255,255,255,.2);color:#fff;padding:4px 12px;border-radius:20px;font-size:.8rem;font-weight:600;}

/* Tabs wrapper */
.epwf-tabs-wrap{background:#fff;border:1px solid #e2e8f0;border-radius:12px;overflow:hidden;margin-bottom:0;}

/* Tab nav */
.epwf-tab-nav{display:flex;background:#f8fafc;border-bottom:2px solid #e2e8f0;padding:0 6px;gap:2px;}
.epwf-tab-btn{display:flex;align-items:center;gap:7px;padding:13px 18px;background:none;border:none;border-bottom:3px solid transparent;cursor:pointer;font-size:.88rem;font-weight:600;color:#64748b;transition:color .15s,border-color .15s;white-space:nowrap;margin-bottom:-2px;}
.epwf-tab-btn:hover{color:#7c3aed;}
.epwf-tab-btn.is-active{color:#7c3aed;border-bottom-color:#7c3aed;background:#fff;}
.tab-icon{font-size:1rem;}

/* Tab panels */
.epwf-tab-panel{display:none;padding:24px;}
.epwf-tab-panel.is-active{display:block;}

/* Cards */
.epwf-card{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:20px 22px;margin-bottom:18px;}
.epwf-card:last-child{margin-bottom:0;}
.epwf-card-title{font-size:.95rem;font-weight:700;color:#0f172a;margin:0 0 14px;padding-bottom:12px;border-bottom:1px solid #f1f5f9;}
.epwf-card-desc{color:#64748b;font-size:.85rem;margin:-6px 0 16px;}

/* Field rows */
.epwf-field-row{display:grid;grid-template-columns:180px 1fr;gap:10px 18px;align-items:start;padding:12px 0;border-bottom:1px solid #f8fafc;}
.epwf-field-row:last-child{border-bottom:none;padding-bottom:0;}
.epwf-label{font-size:.85rem;font-weight:600;color:#374151;padding-top:7px;}
.epwf-field-val{display:flex;flex-direction:column;gap:4px;}
.epwf-hint{font-size:.78rem;color:#94a3b8;}
.epwf-hint a,.epwf-get-key-link{color:#7c3aed;text-decoration:none;font-size:.78rem;}
.epwf-input-sm{width:80px;padding:6px 10px;border:1px solid #d1d5db;border-radius:6px;font-size:.88rem;}

/* Toggle */
.epwf-toggle{display:inline-flex;align-items:center;gap:8px;cursor:pointer;}
.epwf-toggle input{display:none;}
.epwf-toggle-track{width:42px;height:23px;background:#cbd5e1;border-radius:12px;position:relative;transition:background .2s;flex-shrink:0;}
.epwf-toggle-thumb{width:17px;height:17px;background:#fff;border-radius:50%;position:absolute;top:3px;left:3px;transition:transform .2s;box-shadow:0 1px 3px rgba(0,0,0,.2);}
.epwf-toggle input:checked~.epwf-toggle-track,.epwf-toggle input:checked+.epwf-toggle-track{background:#7c3aed;}
.epwf-toggle input:checked~.epwf-toggle-track .epwf-toggle-thumb,
.epwf-toggle input:checked+.epwf-toggle-track .epwf-toggle-thumb{transform:translateX(19px);}

/* API Key row */
.epwf-key-row{display:flex;gap:6px;max-width:420px;}
.epwf-key-input{flex:1;}
.epwf-show-key{flex-shrink:0;padding:0 10px!important;}

/* Model grid */
.epwf-model-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(185px,1fr));gap:12px;}
.epwf-provider-col{border:1px solid #e2e8f0;border-radius:8px;overflow:hidden;}
.epwf-provider-header{display:flex;align-items:center;gap:8px;padding:10px 12px;background:#f8fafc;font-size:.82rem;border-bottom:1px solid #e2e8f0;}
.epwf-model-row{display:flex;align-items:center;gap:9px;padding:9px 12px;cursor:pointer;font-size:.84rem;color:#374151;border-bottom:1px solid #f1f5f9;transition:background .12s;}
.epwf-model-row:last-child{border-bottom:none;}
.epwf-model-row:hover{background:#f8fafc;}
.epwf-model-row.is-active{background:#faf5ff;color:#7c3aed;font-weight:600;}
.epwf-model-radio{accent-color:#7c3aed;flex-shrink:0;}
.epwf-model-label{flex:1;}
.epwf-active-tick{color:#7c3aed;font-weight:700;font-size:.9rem;}

/* ── Hook Tab ── */
.epwf-hook-layout{display:grid;grid-template-columns:1fr 300px;gap:18px;align-items:start;}
.epwf-hook-card{margin-bottom:0;}
.epwf-hook-list{display:flex;flex-direction:column;border:1px solid #e2e8f0;border-radius:8px;overflow:hidden;}
.epwf-hook-item{display:flex;align-items:center;gap:10px;padding:11px 14px;cursor:pointer;border-bottom:1px solid #f1f5f9;font-size:.86rem;color:#374151;transition:background .12s;position:relative;}
.epwf-hook-item:last-child{border-bottom:none;}
.epwf-hook-item:hover{background:#f8fafc;}
.epwf-hook-item.is-active{background:#faf5ff;border-left:3px solid #7c3aed;padding-left:11px;}
.epwf-hook-radio{accent-color:#7c3aed;}
.epwf-hook-dot{width:8px;height:8px;border-radius:50%;background:#cbd5e1;transition:background .15s;flex-shrink:0;}
.epwf-hook-item.is-active .epwf-hook-dot{background:#7c3aed;}
.epwf-hook-label{flex:1;}
.epwf-active-badge{background:#7c3aed;color:#fff;font-size:.7rem;font-weight:700;padding:2px 7px;border-radius:20px;}
.epwf-code-preview{margin-top:16px;background:#1e1e2e;border-radius:8px;padding:10px 14px;}
.epwf-code-preview code{color:#cdd6f4;font-size:.78rem;white-space:nowrap;}

/* Product Mockup */
.epwf-mockup-wrap{display:flex;flex-direction:column;gap:10px;}
.epwf-mockup-title{font-size:.78rem;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:.05em;}
.epwf-mockup{border:1px solid #e2e8f0;border-radius:10px;overflow:hidden;background:#f8fafc;display:flex;flex-direction:column;}
.epwf-mockup-body{display:flex;}
.epwf-mockup-img{width:90px;min-height:80px;background:#e2e8f0;flex-shrink:0;}
.epwf-mockup-info{flex:1;display:flex;flex-direction:column;padding:4px 0;}
.epwf-mockup-bar{height:8px;border-radius:4px;margin:5px 10px;}
.epwf-mockup-bar--title{background:#cbd5e1;width:80%;}
.epwf-mockup-bar--price{background:#e2e8f0;width:40%;}
.epwf-mz{padding:7px 10px;font-size:.72rem;font-weight:600;color:#94a3b8;border:1px dashed #cbd5e1;margin:4px;border-radius:4px;background:#fff;text-align:center;transition:all .15s;}
.epwf-mz.is-active,.epwf-mz--star.is-active{border-color:#7c3aed;background:#faf5ff;color:#7c3aed;box-shadow:0 0 0 2px rgba(124,58,237,.12);}
.epwf-mz--star{border-style:solid;border-color:#a78bfa;}

/* ── Style Tab ── */
.epwf-style-picker{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;}
.epwf-style-card{border:2px solid #e2e8f0;border-radius:10px;cursor:pointer;overflow:hidden;position:relative;transition:border-color .2s,box-shadow .2s;background:#fff;display:flex;flex-direction:column;}
.epwf-style-card input{display:none;}
.epwf-style-card:hover{border-color:#a78bfa;box-shadow:0 4px 14px rgba(124,58,237,.12);}
.epwf-style-card.is-active{border-color:#7c3aed;box-shadow:0 0 0 3px rgba(124,58,237,.18);}
.epwf-style-preview{background:#f8fafc;padding:16px;border-bottom:1px solid #e2e8f0;min-height:80px;display:flex;flex-direction:column;justify-content:center;}
.epwf-sp-q{font-size:.82rem;font-weight:700;color:#374151;margin-bottom:6px;display:flex;align-items:center;justify-content:space-between;}
.epwf-sp-a{font-size:.76rem;color:#64748b;}
.epwf-sp--modern{border-left:3px solid #7c3aed;}
.epwf-sp--minimal{border-top:2px solid #0f172a;}
.epwf-sp--boxed{border:1px solid #d1d5db;border-radius:5px;margin:4px;}
.epwf-style-info{padding:12px 16px;flex:1;}
.epwf-style-info strong{display:block;font-size:.88rem;color:#0f172a;margin-bottom:3px;font-weight:700;}
.epwf-style-info span{font-size:.78rem;color:#94a3b8;line-height:1.4;}
.epwf-style-active{position:absolute;top:8px;right:8px;background:#7c3aed;color:#fff;font-size:.7rem;font-weight:700;padding:2px 8px;border-radius:20px;}

/* Range */
.epwf-range-wrap{display:flex;align-items:center;gap:12px;}
.epwf-range{width:180px;accent-color:#7c3aed;}
.epwf-range-val{font-weight:700;color:#7c3aed;min-width:38px;font-size:.9rem;}

/* Colors */
.epwf-color-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px;}
.epwf-color-item{display:flex;align-items:flex-start;gap:10px;padding:10px;border:1px solid #f1f5f9;border-radius:8px;background:#fafafa;}
.epwf-color-swatch{width:34px;height:34px;border-radius:6px;border:1px solid rgba(0,0,0,.1);flex-shrink:0;}
.epwf-color-details{flex:1;}
.epwf-color-name{font-size:.82rem;font-weight:600;color:#374151;display:block;margin-bottom:2px;}
.epwf-color-desc{font-size:.74rem;color:#94a3b8;display:block;margin-bottom:6px;}

/* Display tab */
.epwf-schema-info{display:flex;gap:14px;background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px;padding:16px;}
.epwf-schema-icon{font-size:1.5rem;flex-shrink:0;}
.epwf-schema-info strong{display:block;margin-bottom:4px;}
.epwf-schema-info p{margin:0;font-size:.85rem;color:#374151;}

/* Save bar */
.epwf-save-bar{padding:16px 24px;background:#f8fafc;border-top:1px solid #e2e8f0;border-radius:0 0 12px 12px;}
.epwf-save-btn.button-primary{background:#7c3aed!important;border-color:#6d28d9!important;color:#fff!important;padding:9px 26px!important;border-radius:7px!important;font-size:.93rem!important;box-shadow:0 2px 8px rgba(124,58,237,.28)!important;}
.epwf-save-btn.button-primary:hover{background:#6d28d9!important;}

/* ── Meta Box ── */
.epwf-mb{padding:2px 0;}
.epwf-mb-header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-bottom:10px;}
.epwf-mb-model{background:#ede9fe;color:#5b21b6;font-size:.76rem;font-weight:600;padding:3px 10px;border-radius:20px;}
.epwf-mb-alert{padding:8px 12px;border-radius:6px;font-size:.84rem;margin-bottom:8px;}
.epwf-mb-alert--warn{background:#fef9c3;border-left:3px solid #eab308;}
.epwf-mb-alert--err{background:#fee2e2;border-left:3px solid #ef4444;}
.epwf-mb-alert--info{background:#dbeafe;border-left:3px solid #3b82f6;}
.epwf-mb-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:10px 0;}
.epwf-gen-msg{font-size:.84rem;}
.epwf-spin{display:none!important;}
.epwf-spin.is-active{display:inline-block!important;}
.epwf-mb-count{background:#ede9fe;color:#5b21b6;font-size:.76rem;font-weight:600;padding:2px 8px;border-radius:20px;}
.epwf-mb-faqs{border:1px solid #e2e8f0;border-radius:8px;overflow:hidden;margin-bottom:10px;}
.epwf-mb-faqs-head{display:flex;align-items:center;gap:8px;padding:8px 12px;background:#f8fafc;border-bottom:1px solid #e2e8f0;font-size:.84rem;}
.epwf-pill{font-size:.7rem;font-weight:700;padding:2px 8px;border-radius:20px;}
.epwf-pill--ai{background:#d1fae5;color:#065f46;}
.epwf-pill--manual{background:#fed7aa;color:#92400e;}
.epwf-faq-row{display:flex;align-items:flex-start;gap:8px;padding:9px 12px;border-bottom:1px solid #f1f5f9;}
.epwf-faq-row:last-child{border-bottom:none;}
.epwf-drag{color:#cbd5e1;cursor:move;padding-top:5px;font-size:1rem;}
.epwf-faq-fields{flex:1;display:flex;flex-direction:column;gap:5px;}
.epwf-del-row{background:none!important;border:none!important;color:#ef4444!important;cursor:pointer;font-size:1rem;padding:2px 6px!important;box-shadow:none!important;margin-top:2px;}
.epwf-empty-msg{color:#94a3b8;font-style:italic;margin:12px;font-size:.84rem;}

/* Fix #5: disclosure notice */
.epwf-disclosure-notice{margin-bottom:16px!important;border-left-color:#7c3aed!important;}
.epwf-disclosure-notice p{margin:.5em 0;}

/* Fix #7: key saved indicator */
.epwf-key-saved{font-size:.78rem;color:#16a34a;display:block;margin-top:2px;}

/* ── Two-column style tab layout ─────────────────────────────────────────── */
.epwf-style-two-col{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:start;}
@media(max-width:900px){.epwf-style-two-col{grid-template-columns:1fr;}}
.epwf-style-col{display:flex;flex-direction:column;gap:0;}

/* ── Color list (single column, full-width rows) ─────────────────────────── */
.epwf-color-list{display:flex;flex-direction:column;gap:0;}
.epwf-color-list .epwf-color-item{display:grid;grid-template-columns:36px 1fr auto;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid #f0eefb;}
.epwf-color-list .epwf-color-item:last-child{border-bottom:none;}
.epwf-color-list .epwf-color-swatch{width:36px;height:36px;border-radius:8px;flex-shrink:0;border:2px solid rgba(0,0,0,.08);cursor:pointer;box-shadow:0 2px 6px rgba(0,0,0,.1);transition:transform .15s;}
.epwf-color-list .epwf-color-swatch:hover{transform:scale(1.1);}
.epwf-color-list .epwf-color-details{display:flex;flex-direction:column;gap:2px;min-width:0;}
.epwf-color-list .epwf-color-name{font-weight:600;font-size:13px;color:#3d3355;white-space:nowrap;}
.epwf-color-list .epwf-color-desc{font-size:11px;color:#8b82a7;}
.epwf-color-input-wrap{display:flex;align-items:center;gap:6px;flex-shrink:0;}
.epwf-color-hex-display{font-size:12px;font-family:monospace;color:#5b4d8a;background:#f4f0ff;border:1px solid #ddd6fe;border-radius:4px;padding:3px 7px;min-width:68px;text-align:center;letter-spacing:.5px;user-select:all;cursor:text;}
.epwf-color-list .wp-picker-container{display:flex;align-items:center;gap:6px;}
.epwf-color-list .wp-picker-container .wp-color-result{width:36px!important;height:36px!important;min-width:0!important;padding:0!important;border-radius:8px!important;border:2px solid rgba(0,0,0,.08)!important;box-shadow:0 2px 6px rgba(0,0,0,.1)!important;}
.epwf-color-list .wp-picker-container .wp-color-result-text{display:none!important;}
.epwf-color-list .wp-picker-container input.wp-color-picker{width:80px!important;font-family:monospace!important;font-size:12px!important;padding:4px 6px!important;border-radius:4px!important;background:#f4f0ff!important;border-color:#ddd6fe!important;color:#5b4d8a!important;letter-spacing:.5px;}
.epwf-color-list .wp-picker-container .wp-picker-clear{display:none!important;}
.epwf-color-list .wp-picker-holder{position:absolute;z-index:9999;}

/* ── AI Config two-column layout ─────────────────────────────────────────── */
.epwf-ai-two-col{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:start;}
@media(max-width:900px){.epwf-ai-two-col{grid-template-columns:1fr;}}
.epwf-ai-col{display:flex;flex-direction:column;}

/* ── Provider + Model select dropdowns ───────────────────────────────────── */
.epwf-select{width:100%!important;max-width:320px;padding:8px 12px!important;border:1.5px solid #ddd6fe!important;border-radius:8px!important;font-size:14px!important;color:#3d3355!important;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237c3aed' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center!important;-webkit-appearance:none!important;appearance:none!important;cursor:pointer;transition:border-color .15s,box-shadow .15s;}
.epwf-select:focus{border-color:#7c3aed!important;box-shadow:0 0 0 3px rgba(124,58,237,.15)!important;outline:none!important;}
.epwf-select option{padding:6px;}

/* ── API key fields — hide non-active provider by default ────────────────── */
.epwf-key-field{display:none;}

/* ── Rich error notices (meta box + AJAX gen) ────────────────────────────── */
.epwf-notice-box{display:block;padding:10px 14px;border-radius:6px;border-left:4px solid #dc2626;background:#fef2f2;font-size:13px;line-height:1.5;margin-top:8px;}
.epwf-notice-box strong{font-weight:700;}
.epwf-notice-invalid_key{border-color:#dc2626;background:#fef2f2;color:#991b1b;}
.epwf-notice-quota_exceeded{border-color:#d97706;background:#fffbeb;color:#92400e;}
.epwf-notice-timeout{border-color:#7c3aed;background:#f5f3ff;color:#4c1d95;}
.epwf-notice-malformed{border-color:#0284c7;background:#f0f9ff;color:#075985;}
.epwf-notice-rate_limit{border-color:#16a34a;background:#f0fdf4;color:#14532d;}
.epwf-notice-error{border-color:#dc2626;background:#fef2f2;color:#7f1d1d;}

/* ── Schema status banners ───────────────────────────────────────────────── */
.epwf-schema-info{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-radius:8px;margin-top:12px;}
.epwf-schema-active{background:#f0fdf4;border:1px solid #bbf7d0;}
.epwf-schema-active strong{color:#166534;}
.epwf-schema-active p{color:#4ade80;font-size:12px;margin:4px 0 0;}
.epwf-schema-disabled{background:#fafafa;border:1px solid #e5e7eb;}
.epwf-schema-disabled strong{color:#6b7280;}
.epwf-schema-disabled p{color:#9ca3af;font-size:12px;margin:4px 0 0;}
.epwf-schema-info span{font-size:20px;line-height:1;flex-shrink:0;}
