/* ═══════════════════════════════════════════
   AI DEMO — "Do you use AI?" section on product pages
   Markup: <section class="section aid"> … <div class="aid-stage" data-aid='{json}'></div>
   Built and animated by js/ai-demo.js
═══════════════════════════════════════════ */
.aid { --aid-win:#ffffff; --aid-win-bar:#f7f7f5; --aid-line:rgba(55,53,47,.09); --aid-ink:#37352f; --aid-muted:#787774;
       --aid-phone:#0f1411; --aid-screen:#f4f7f5; --aid-bubble:#ffffff; --aid-new:rgba(var(--accent-rgb,164,252,196),.32); --aid-track:rgba(55,53,47,.08); }
html[data-theme="dark"] .aid { --aid-win:#191919; --aid-win-bar:#202020; --aid-line:rgba(255,255,255,.08); --aid-ink:#e8e7e4; --aid-muted:#9b9a97;
       --aid-phone:#050706; --aid-screen:#141a15; --aid-bubble:#1f2922; --aid-new:rgba(var(--accent-rgb,164,252,196),.14); --aid-track:rgba(255,255,255,.09); }

.aid-stage { display:grid; grid-template-columns:320px 1fr; gap:2.5rem; align-items:center; max-width:1000px; margin:0 auto; min-height:584px; }

/* Phone with the AI chat */
.aid-phone { background:var(--aid-phone); border-radius:38px; padding:12px; box-shadow:var(--shadow-xl); }
.aid-screen { background:var(--aid-screen); border-radius:28px; height:560px; display:flex; flex-direction:column; overflow:hidden; }
.aid-top { display:flex; align-items:center; gap:.6rem; padding:1.1rem 1.1rem .8rem; border-bottom:1px solid var(--border); }
.aid-avatar { width:28px; height:28px; border-radius:50%; background:var(--mint); display:grid; place-items:center; flex:none; }
.aid-avatar svg { width:15px; height:15px; }
.aid-top b { font-size:.86rem; color:var(--text); display:block; line-height:1.2; }
.aid-top span { font-size:.72rem; color:var(--text-4); }
.aid-chat { flex:1; padding:1rem; display:flex; flex-direction:column; gap:.7rem; justify-content:flex-end; overflow:hidden; }
.aid-msg { max-width:88%; padding:.7rem .85rem; border-radius:16px; font-size:.84rem; line-height:1.5; display:none; }
.aid-msg.show { display:block; animation:aidIn .35s ease both; }
.aid-user { align-self:flex-end; background:var(--green); color:#fff; border-bottom-right-radius:5px; }
.aid-caret { display:none; width:2px; height:1em; background:var(--mint); vertical-align:-2px; margin-left:1px; animation:aidBlink 1s steps(1) infinite; }
.aid.typing-now .aid-caret { display:inline-block; }
.aid-file { display:flex; align-items:center; gap:.5rem; margin-bottom:.5rem; padding:.45rem .6rem; border-radius:10px; background:rgba(255,255,255,.12); font-size:.76rem; font-weight:700; }
.aid-file svg { width:16px; height:16px; flex:none; }
.aid-bot { align-self:flex-start; background:var(--aid-bubble); color:var(--text-2); border:1px solid var(--border); border-bottom-left-radius:5px; }
.aid-bot b { color:var(--text); }
.aid-dots { display:flex; gap:4px; padding:.2rem 0; }
.aid-dots i { width:6px; height:6px; border-radius:50%; background:var(--text-4); animation:aidDot 1s infinite; }
.aid-dots i:nth-child(2){ animation-delay:.15s } .aid-dots i:nth-child(3){ animation-delay:.3s }
.aid-done { list-style:none; margin:.45rem 0 0; padding:0; display:grid; gap:.3rem; }
.aid-done li { display:flex; gap:.45rem; align-items:center; font-size:.8rem; opacity:0; transition:opacity .3s ease; }
.aid-done li.show { opacity:1; }
.aid-done li::before { content:''; width:14px; height:14px; border-radius:50%; flex:none;
    background:var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%231a4731' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.aid-input { display:flex; align-items:center; gap:.6rem; margin:.4rem .8rem 1rem; padding:.45rem .45rem .45rem 1rem; border-radius:100px; background:var(--aid-bubble); border:1px solid var(--border); }
.aid-input span { flex:1; font-size:.8rem; color:var(--text-4); white-space:nowrap; overflow:hidden; }
.aid-wave { display:none; align-items:center; gap:3px; flex:1; height:22px; }
.aid-wave i { width:3px; border-radius:2px; background:var(--green-text); animation:aidWave .9s ease-in-out infinite; }
.aid-wave i:nth-child(odd){ animation-delay:.2s } .aid-wave i:nth-child(3n){ animation-delay:.4s }
.aid.listening .aid-wave { display:flex; } .aid.listening .aid-input span { display:none; }
.aid-mic { width:38px; height:38px; border-radius:50%; background:var(--mint); display:grid; place-items:center; flex:none; position:relative; }
.aid-mic img { width:24px; height:24px; }
.aid.listening .aid-mic::after { content:''; position:absolute; inset:-5px; border-radius:50%; border:2px solid var(--mint); animation:aidPulse 1.1s ease-out infinite; }

/* Week calendar (planner) */
.aid-week { display:grid; grid-template-columns:repeat(5,1fr); border:1px solid var(--aid-line); border-radius:10px; overflow:hidden; }
.aid-day { min-height:190px; padding:.5rem .4rem; border-right:1px solid var(--aid-line); display:flex; flex-direction:column; gap:.4rem; }
.aid-day:last-child { border-right:0; }
.aid-day-l { font-size:.72rem; font-weight:700; color:var(--aid-muted); padding:0 .2rem .2rem; }
.aid-chip { border:1px solid var(--aid-line); border-radius:6px; padding:.4rem .45rem; font-size:.74rem; display:flex; flex-direction:column; gap:.2rem; background:var(--aid-win); box-shadow:0 1px 2px rgba(0,0,0,.05); }
.aid-chip b { font-weight:700; line-height:1.3; }
.aid-chip .aid-pill { align-self:flex-start; }
.aid-pill-high { background:rgba(var(--accent-rgb,164,252,196),.45); color:rgb(var(--deep-rgb,26,71,49)); }
html[data-theme="dark"] .aid-pill-high { background:rgba(var(--accent-rgb,164,252,196),.22); color:rgb(var(--accent-rgb,164,252,196)); }
.aid-pill-medium { background:rgba(35,131,226,.12); color:#2383e2; }
.aid-pill-low { background:var(--aid-track); color:var(--aid-muted); }

/* Notion window with the template */
.aid-win { background:var(--aid-win); border-radius:14px; box-shadow:var(--shadow-xl); border:1px solid var(--aid-line); overflow:hidden; color:var(--aid-ink); }
.aid-bar { display:flex; align-items:center; gap:.5rem; padding:.6rem .9rem; background:var(--aid-win-bar); border-bottom:1px solid var(--aid-line); font-size:.78rem; color:var(--aid-muted); }
.aid-bar i { width:10px; height:10px; border-radius:50%; background:var(--aid-line); }
.aid-bar img { width:16px; height:16px; margin-left:.4rem; }
.aid-body { padding:1.3rem 1.4rem 1.5rem; }
.aid-h { font-size:1.05rem; font-weight:800; margin:0 0 .8rem; color:var(--aid-ink); line-height:1.3; }
.aid-card { display:flex; flex-wrap:wrap; gap:.4rem .9rem; align-items:center; padding:.75rem .9rem; border:1px solid var(--aid-line); border-radius:10px; font-size:.8rem; color:var(--aid-muted); margin-bottom:1.1rem; opacity:.35; transition:opacity .4s ease, background .6s ease; }
.aid-card.show { opacity:1; }
.aid-card.new, .aid-row.new { background:var(--aid-new); }
.aid-card b { color:var(--aid-ink); font-size:.9rem; }
.aid-card .aid-bar-wrap { flex-basis:100%; }
.aid-pill { padding:2px 8px; border-radius:4px; font-size:.72rem; font-weight:700; background:rgba(var(--deep-rgb,26,71,49),.12); color:var(--green-text); white-space:nowrap; }
.aid-num { font-variant-numeric:tabular-nums; color:var(--aid-ink); font-weight:700; }
.aid-table { width:100%; border-collapse:collapse; font-size:.8rem; }
.aid-table th { text-align:left; font-weight:600; color:var(--aid-muted); padding:.45rem .5rem; border-bottom:1px solid var(--aid-line); font-size:.74rem; }
.aid-table td { padding:.6rem .5rem; border-bottom:1px solid var(--aid-line); vertical-align:middle; font-variant-numeric:tabular-nums; }
.aid-row { transition:background .6s ease, opacity .4s ease; }
.aid-row.pending { opacity:0; }
.aid-row.dim td { color:var(--aid-muted); }
.aid-t { font-weight:700; }
.aid-seq b { font-weight:600; opacity:0; transition:opacity .2s ease; }
.aid-seq b.show { opacity:1; }
.aid-muted { color:var(--aid-muted); font-size:.76rem; }
.aid-nw { white-space:nowrap; }
.aid-badge { display:inline-flex; align-items:center; gap:4px; padding:2px 8px 2px 4px; border-radius:100px; background:var(--mint); color:rgb(var(--deep-rgb,26,71,49)); font-weight:800; font-size:.72rem; white-space:nowrap; transform:scale(0); transition:transform .45s cubic-bezier(.34,1.56,.64,1); }
.aid-badge img { width:16px; height:16px; }
.aid-badge.show { transform:scale(1); }
.aid-check { width:16px; height:16px; border-radius:3px; border:1.5px solid var(--aid-muted); display:inline-block; vertical-align:middle; transition:background .25s ease, border-color .25s ease; }
.aid-check.show { background:var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; border-color:var(--green); }
.aid-progress { display:flex; align-items:center; gap:.5rem; min-width:110px; }
.aid-track { flex:1; height:6px; border-radius:6px; background:var(--aid-track); overflow:hidden; }
.aid-fill { height:100%; width:0; border-radius:6px; background:var(--mint-dim); transition:width 1s cubic-bezier(.4,0,.2,1); }
.aid-pct { font-size:.74rem; font-weight:700; min-width:2.6em; text-align:right; }
.aid-foot { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin-top:1rem; }
.aid-foot p { font-size:.8rem; margin:0; color:var(--text-4); }
.aid-replay { border:1px solid var(--border); background:transparent; color:var(--text-3); border-radius:100px; padding:.35rem .9rem; font:inherit; font-size:.76rem; font-weight:700; cursor:pointer; flex:none; }
.aid-replay:hover { color:var(--green-text); border-color:var(--mint-dim); }

.aid-steps { display:grid; grid-template-columns:repeat(3,1fr); gap:1.25rem; max-width:1000px; margin:3rem auto 0; }
.aid-step { padding:1.1rem 1.2rem; border:1px solid var(--border); border-radius:var(--radius); background:var(--white); }
.aid-step b { display:block; color:var(--text); font-size:.95rem; margin-bottom:.25rem; }
.aid-step p { font-size:.88rem; margin:0; line-height:1.6; }
.aid-step em { font-style:normal; font-weight:800; color:var(--green-text); margin-right:.35rem; }
.aid-note { text-align:center; font-size:.8rem; color:var(--text-4); max-width:70ch; margin:1.5rem auto 0; }

@keyframes aidIn { from { opacity:0; transform:translateY(8px) } to { opacity:1; transform:none } }
@keyframes aidBlink { 50% { opacity:0 } }
@keyframes aidDot { 0%,80%,100% { opacity:.3 } 40% { opacity:1 } }
@keyframes aidWave { 0%,100% { height:5px } 50% { height:20px } }
@keyframes aidPulse { from { transform:scale(.9); opacity:.9 } to { transform:scale(1.35); opacity:0 } }

@media (max-width: 900px) {
  .aid-stage { grid-template-columns:1fr; gap:1.75rem; min-height:0; }
  .aid-phone { max-width:330px; margin:0 auto; width:100%; }
  .aid-screen { height:470px; }
  .aid-steps { grid-template-columns:1fr; }
}
@media (max-width: 560px) {
  .aid-body { padding:1rem; }
  .aid-table thead { display:none; }
  .aid-table, .aid-table tbody, .aid-table tr, .aid-table td { display:block; width:100%; }
  .aid-table tr { padding:.55rem .4rem; border-bottom:1px solid var(--aid-line); }
  .aid-table td { border:0; padding:.12rem 0; }
  .aid-table td:empty { display:none; }
  .aid-table td[data-label]::before { content:attr(data-label) ': '; color:var(--aid-muted); font-size:.74rem; }
  .aid-foot { flex-direction:column; align-items:flex-start; }
  .aid-week { grid-template-columns:1fr; }
  .aid-day { min-height:0; border-right:0; border-bottom:1px solid var(--aid-line); }
  .aid-day:last-child { border-bottom:0; }
}
@media (prefers-reduced-motion: reduce) {
  .aid *, .aid *::before, .aid *::after { animation:none !important; transition:none !important; }
}
