/* Smart Sale - smart-ai.css : premium Smart AI look (trial / paywall / thinking / results) */
@property --sai-sweep { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

/* ---------- chips ---------- */
.sai-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.sai-chip--pro { color: #fff; background: linear-gradient(90deg, #7c3aed, #db2777); box-shadow: 0 4px 14px rgba(124, 58, 237, .35); }
.sai-chip--trial { color: #7c2d12; background: #ffedd5; border: 1px solid #fdba74; }
.sai-chip--locked { color: #475569; background: #f1f5f9; border: 1px solid #cbd5e1; }
.sai-menu-chip { margin-left: auto; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; line-height: 1.4; }
.sai-menu-chip[data-state="pro"] { color: #fff; background: linear-gradient(90deg, #7c3aed, #db2777); }
.sai-menu-chip[data-state="trial"] { color: #7c2d12; background: #fed7aa; }
.sai-menu-chip[data-state="locked"] { color: #fff; background: rgba(255, 255, 255, .22); }
#sidebar:not(.expanded) .sai-menu-chip { display: none; }

/* ---------- thinking ---------- */
.sai-thinking { position: relative; overflow: hidden; padding: 28px 20px; border-radius: 18px; color: #e9d5ff; text-align: center;
    background: radial-gradient(120% 120% at 50% 0%, #4c1d95 0%, #1e1b4b 55%, #0f172a 100%); box-shadow: 0 20px 50px rgba(76, 29, 149, .35); }
.sai-thinking__title { font-weight: 800; font-size: 17px; color: #fff; margin: 14px 0 12px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.sai-orb { position: relative; width: 74px; height: 74px; margin: 0 auto; }
.sai-orb span { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: #c084fc; animation: sai-spin 1.1s linear infinite; }
.sai-orb span:nth-child(2) { inset: 10px; border-top-color: #f472b6; animation-duration: 1.6s; animation-direction: reverse; }
.sai-orb span:nth-child(3) { inset: 22px; background: radial-gradient(circle, #f0abfc 0%, #a855f7 60%, transparent 70%); border: 0; animation: sai-pulse 1.2s ease-in-out infinite; }
.sai-steps { list-style: none; margin: 0 auto; padding: 0; max-width: 420px; text-align: left; display: grid; gap: 6px; }
.sai-steps li { position: relative; padding: 6px 10px 6px 30px; border-radius: 10px; font-size: 13px; color: rgba(233, 213, 255, .45); transition: color .25s, background .25s; }
.sai-steps li::before { content: ''; position: absolute; left: 10px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; border: 2px solid rgba(233, 213, 255, .35); }
.sai-steps li.is-active { color: #fff; background: rgba(255, 255, 255, .08); }
.sai-steps li.is-active::before { border-color: #f0abfc; border-top-color: transparent; animation: sai-spin .7s linear infinite; }
.sai-steps li.is-done { color: #d8b4fe; }
.sai-steps li.is-done::before { content: '✓'; border: 0; width: auto; height: auto; margin-top: -9px; color: #86efac; font-weight: 900; font-size: 13px; }
.sai-progress { height: 4px; margin: 16px auto 0; max-width: 420px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.sai-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #a855f7, #ec4899, #f59e0b); transition: width .3s ease; }

/* ---------- results ---------- */
.sai-panel { border: 1px solid transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(120deg, #a855f7, #ec4899, #f59e0b) border-box; box-shadow: 0 18px 40px rgba(124, 58, 237, .12); }
.sai-hero { margin: -16px -16px 0; padding: 16px; border-radius: 8px 8px 0 0; background: linear-gradient(120deg, #faf5ff, #fdf2f8 60%, #fff7ed); }
.sai-hero__title { margin: 0; font-weight: 900; font-size: 17px; background: linear-gradient(90deg, #6d28d9, #db2777); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sai-hero__spark { display: inline-block; color: #a855f7; -webkit-text-fill-color: #a855f7; animation: sai-twinkle 2.4s ease-in-out infinite; }
.sai-hero__headline { margin: 8px 0 0; font-size: 14px; font-weight: 700; color: #3b0764; line-height: 1.55; min-height: 1.55em; }
.sai-hero__headline.is-typing::after { content: '▍'; color: #a855f7; animation: sai-blink .8s step-end infinite; }
.sai-hero__meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px; font-size: 11.5px; color: #64748b; }
.sai-conf { padding: 2px 8px; border-radius: 999px; font-weight: 800; border: 1px solid #cbd5e1; background: #fff; color: #475569; }
.sai-conf--emerald { color: #047857; border-color: #6ee7b7; }
.sai-conf--amber { color: #b45309; border-color: #fcd34d; }

.smart-rec-ring { background: conic-gradient(var(--sai-c, #8b5cf6) var(--sai-sweep), #e2e8f0 0); --sai-sweep: var(--sai-deg, 0deg); }
.sai-reveal .smart-rec-ring { animation: sai-ring 1s cubic-bezier(.2, .8, .2, 1) both; }
.sai-reveal .smart-rec-plan { animation: sai-rise .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--sai-i, 0) * 120ms + 150ms); }
.sai-reveal .smart-rec-info, .sai-reveal details, .sai-reveal .smart-rec-plans + * { animation: sai-rise .5s ease both; animation-delay: .55s; }
.smart-rec-plan { position: relative; transition: transform .2s ease, box-shadow .2s ease; }
.smart-rec-plan:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 23, 42, .08); }
.smart-rec-plan--featured { box-shadow: 0 0 0 2px #a855f7 inset, 0 12px 28px rgba(168, 85, 247, .22); }
.sai-ribbon { position: absolute; top: -10px; right: 12px; padding: 2px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 900; color: #fff;
    background: linear-gradient(90deg, #7c3aed, #db2777); box-shadow: 0 6px 14px rgba(219, 39, 119, .35); }
.sai-mix { display: flex; height: 8px; margin-top: 10px; border-radius: 6px; overflow: hidden; background: #e2e8f0; gap: 2px; }
.sai-mix i { display: block; min-width: 4px; }
.sai-mix-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 11px; color: #475569; }
.sai-mix-legend b { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* ---------- paywall ---------- */
.sai-paywall { position: relative; min-height: 380px; border-radius: 18px; overflow: hidden; background: linear-gradient(160deg, #faf5ff, #fdf2f8); border: 1px solid #e9d5ff; }
.sai-preview { position: absolute; inset: 0; padding: 24px; filter: blur(6px); opacity: .55; pointer-events: none; user-select: none; display: grid; gap: 12px; align-content: start; }
.sai-preview__row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px; border-radius: 12px; background: #fff; border: 1px solid #e9d5ff; font-weight: 800; color: #4c1d95; }
.sai-preview__row i { grid-column: 1 / -1; height: 8px; border-radius: 6px; background: linear-gradient(90deg, #a855f7, #ec4899); }
.sai-preview__row--hot { box-shadow: 0 0 0 2px #a855f7 inset; }
.sai-preview__text { padding: 14px; border-radius: 12px; background: #fff; color: #334155; }
.sai-paywall__card { position: relative; margin: 28px auto; max-width: 420px; padding: 24px 22px; border-radius: 20px; text-align: center; color: #fff;
    background: radial-gradient(120% 120% at 50% 0%, #6d28d9 0%, #3b0764 60%, #1e1b4b 100%); box-shadow: 0 24px 60px rgba(59, 7, 100, .45); }
.sai-paywall__spark { width: 56px; height: 56px; margin: 0 auto 8px; display: grid; place-items: center; border-radius: 16px; font-size: 26px;
    background: linear-gradient(135deg, #f0abfc, #a855f7 50%, #f59e0b); animation: sai-float 3s ease-in-out infinite; }
.sai-paywall__card h4 { margin: 0 0 6px; font-size: 19px; font-weight: 900; }
.sai-paywall__card p { margin: 0 0 12px; font-size: 13px; color: #e9d5ff; }
.sai-paywall__card ul { list-style: none; margin: 0 0 16px; padding: 0; text-align: left; display: grid; gap: 6px; font-size: 13px; }
.sai-paywall__card li::before { content: '✦ '; color: #f0abfc; font-weight: 900; }
.sai-cta { display: block; padding: 12px 16px; border-radius: 14px; font-weight: 900; font-size: 15px; color: #052e16; text-decoration: none;
    background: linear-gradient(90deg, #4ade80, #22c55e); box-shadow: 0 10px 24px rgba(34, 197, 94, .4); min-height: 44px; }
.sai-cta:hover { filter: brightness(1.05); }
.sai-cta--static { color: #3b0764; background: #f5f3ff; box-shadow: none; }
.sai-paywall__card small { display: block; margin-top: 10px; font-size: 11px; color: #c4b5fd; }

/* ---------- keyframes ---------- */
@keyframes sai-spin { to { transform: rotate(360deg); } }
@keyframes sai-pulse { 0%, 100% { transform: scale(.85); opacity: .8; } 50% { transform: scale(1.05); opacity: 1; } }
@keyframes sai-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sai-ring { from { --sai-sweep: 0deg; } to { --sai-sweep: var(--sai-deg, 0deg); } }
@keyframes sai-twinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(1.25) rotate(20deg); opacity: .7; } }
@keyframes sai-blink { 50% { opacity: 0; } }
@keyframes sai-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

@media (max-width: 640px) {
    .sai-thinking { padding: 22px 14px; }
    .sai-paywall__card { margin: 16px 12px; padding: 20px 16px; }
    .sai-hero__title { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .sai-thinking *, .sai-reveal *, .sai-hero__spark, .sai-paywall__spark { animation: none !important; transition: none !important; }
}
@media print {
    .sai-thinking, .sai-paywall, .sai-ribbon { display: none !important; }
}
