/* JCCA Platform demo: Gaffer (AI) views. All classes prefixed .ai-
   Ask a Document · Ask the Gaffer · Automations · My Actions / My Follow-ups */

:root {
  --ai-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ai-bot: calc(96px + var(--sab, 0px));
  --ai-ubg: #C4FF0E;
  --ai-ufg: #0A0A0A;
  --ai-sb-bg: rgba(245,158,11,.16);
  --ai-sb-fg: #FBBF24;
  --ai-green: #4ADE80;
  --ai-live: #C4FF0E;
  --ai-shim-a: var(--panel-2);
  --ai-shim-b: var(--line);
}
html[data-theme="light"] {
  --ai-ubg: #0A0A0A;
  --ai-ufg: #F5F5F5;
  --ai-sb-bg: rgba(245,158,11,.18);
  --ai-sb-fg: #92400E;
  --ai-green: #15803D;
  --ai-live: #0A0A0A;
  --ai-shim-a: #ECEDE7;
  --ai-shim-b: #DCDED5;
}

/* ---------- shared ---------- */
.ai-root { min-width: 0; }
.ai-root *, .ai-qa * { box-sizing: border-box; }
.ai-mark { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--lime); color: #0A0A0A; box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 6px 14px -6px rgba(196,255,14,.55); }
.ai-mark svg { width: 18px; height: 18px; }
.ai-mark.sm { width: 24px; height: 24px; border-radius: 7px; }
.ai-mark.sm svg { width: 14px; height: 14px; }
.ai-mark.lg { width: 58px; height: 58px; border-radius: 16px; }
.ai-mark.lg svg { width: 30px; height: 30px; }
.ai-badge { display: inline-flex; align-items: center; justify-content: center; flex: none; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 800 10.5px/1 var(--font-display); letter-spacing: .08em; vertical-align: 1px; }
.ai-wby { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.ai-wby i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.ai-ib { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 11px; color: var(--muted); transition: background-color .2s ease, color .2s ease, transform 90ms ease-out; }
.ai-ib:hover { background: var(--hover); color: var(--text); }
.ai-ib:active { transform: scale(.92); }
.ai-ftile { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--on-accent); }
.ai-shimbg, .ai-skel i, .ai-src-sk i, .ai-src-sk .ai-lt, .ai-shim {
  background: linear-gradient(90deg, var(--ai-shim-a) 25%, var(--ai-shim-b) 50%, var(--ai-shim-a) 75%);
  background-size: 200% 100%; animation: ai-shim 1.4s linear infinite;
}
@keyframes ai-shim { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes ai-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ai-pop { 0% { opacity: 0; transform: scale(.4); } 100% { opacity: 1; transform: none; } }
@keyframes ai-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
@keyframes ai-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ai-slide { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes ai-bounce { 0% { transform: scale(.5); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* full-height panes (docqa, assistant) */
@media (min-width: 1024px) {
  .view.ai-mode { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 24px; }
  .ai-root.ai-full { flex: 1; min-height: 0; display: flex; flex-direction: column; }
}
@media (max-width: 1023px) {
  .ai-root.ai-full {
    display: flex; flex-direction: column;
    height: calc(100vh - var(--tb-h) - var(--sat) - 16px - var(--ai-bot));
    height: calc(100dvh - var(--tb-h) - var(--sat) - 16px - var(--ai-bot));
    min-height: 440px;
  }
}

/* chat parts (shared by docqa + assistant) */
.ai-ch-h { display: flex; align-items: center; gap: 10px; flex: none; padding: 12px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.ai-ch-t { flex: 1; min-width: 0; }
.ai-ch-t b { display: flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 650; white-space: nowrap; overflow: hidden; }
.ai-ch-t small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ai-thread { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; }
.ai-msg { display: flex; gap: 10px; min-width: 0; animation: ai-rise .45s var(--spring) both; }
.ai-u { justify-content: flex-end; }
.ai-ub { max-width: 85%; padding: 9px 13px; border-radius: 16px 16px 4px 16px; background: var(--ai-ubg); color: var(--ai-ufg); font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; }
.ai-av { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--lime); color: #0A0A0A; margin-top: 1px; }
.ai-bb { flex: 1; min-width: 0; }
.ai-txt { font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.ai-caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--text); border-radius: 1px; animation: ai-blink 1s steps(1) infinite; }
.ai-cite { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 5px; margin: 0 1px 0 4px; border-radius: 6px; background: var(--accent); color: var(--on-accent); font: 700 11px/1 var(--font); vertical-align: 1px; cursor: pointer; animation: ai-pop .4s var(--bounce) both; transition: transform .2s var(--bounce); }
.ai-cite:hover { transform: scale(1.12); }
.ai-skel { display: grid; gap: 8px; padding-top: 3px; }
.ai-skel-l {
  font-size: 13px; font-weight: 600; justify-self: start;
  background: linear-gradient(90deg, var(--muted) 0%, var(--muted) 35%, var(--text) 50%, var(--muted) 65%, var(--muted) 100%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ai-shim 1.6s linear infinite;
}
.ai-skel i { display: block; height: 10px; border-radius: 5px; width: 100%; }
.ai-skel i.s { width: 60%; }
.ai-sugg { flex: none; display: flex; gap: 8px; padding: 0 14px 10px; overflow-x: auto; scrollbar-width: none; transition: opacity .25s ease; }
.ai-sugg::-webkit-scrollbar { display: none; }
.ai-sc { flex: none; height: 36px; padding: 0 13px; border-radius: 999px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap; transition: background-color .2s ease, transform 90ms ease-out; }
.ai-sc:hover { background: var(--hover); }
.ai-sc:active { transform: scale(.96); }
.ai-busy .ai-sugg { opacity: .4; pointer-events: none; }
.ai-comp { flex: none; padding: 10px 12px 12px; border-top: 1px solid var(--line); margin: 0; }
.ai-comp-row { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 14px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s ease; }
.ai-comp-row:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px var(--lime-soft); }
.ai-in { flex: 1; min-width: 0; height: 40px; padding: 0 8px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; }
.ai-in::placeholder { color: var(--muted); }
.ai-send { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--on-accent); transition: transform .25s var(--bounce), opacity .2s ease; }
.ai-send:active { transform: scale(.9); }
.ai-send:disabled { opacity: .4; cursor: default; }
.ai-comp-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); min-width: 0; }
.ai-comp-meta span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ai-scope { display: inline-flex; align-items: center; gap: 5px; flex: none; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--lime-soft); color: var(--text); font-size: 12px; font-weight: 650; }

/* =========================================================
   1) Ask a Document
   ========================================================= */
.ai-head { display: flex; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; flex: none; margin-bottom: 14px; min-width: 0; }
.ai-head-t { flex: 1 1 260px; min-width: 0; }
.ai-head-t h1 { font-size: 34px; }
.ai-head-t p { margin-top: 4px; font-size: 14px; }
.ai-dpick { max-width: 100%; }
.ai-dpick button { flex: 1 1 auto; }
.ai-dq { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(330px, 1fr); gap: 14px; }
.ai-dq-doc, .ai-dq-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; border-radius: var(--radius); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.ai-dq-doc { background: var(--panel-2); }
.ai-dq-tb { display: flex; align-items: center; gap: 10px; flex: none; padding: 8px 8px 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; }
.ai-dq-tt { flex: 1; min-width: 0; }
.ai-dq-tt b { display: block; font-size: 14px; font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ai-dq-tt small { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; color: var(--muted); min-width: 0; white-space: nowrap; }
.ai-dq-sub { overflow: hidden; text-overflow: ellipsis; }
.ai-sbadge { flex: none; display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; background: var(--ai-sb-bg); color: var(--ai-sb-fg); font-size: 11px; font-weight: 700; }
.ai-pg { flex: none; font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ai-pg b { color: var(--text); }
.ai-zoom { display: flex; align-items: center; flex: none; border-radius: 11px; box-shadow: inset 0 0 0 1px var(--line); }
.ai-zoom .ai-ib { width: 36px; height: 36px; }
.ai-zv { width: 42px; text-align: center; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ai-dq-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px; scrollbar-width: thin; }
.ai-sheets { --z: 1; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ai-sheet {
  width: min(100%, calc(600px * var(--z))); aspect-ratio: 210 / 297; flex: none;
  display: flex; flex-direction: column; padding: calc(34px * var(--z)) calc(38px * var(--z));
  background: #FFFFFF; color: #1A1A1A; border-radius: 4px; font-size: calc(13.5px * var(--z)); line-height: 1.6;
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 10px 30px -10px rgba(0,0,0,.35);
  transition: width .3s var(--spring), padding .3s var(--spring);
}
.ai-sh-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-sh-brand { display: inline-flex; align-items: center; gap: .6em; font: 700 .74em/1 var(--font-display); letter-spacing: .1em; color: #0A0A0A; }
.ai-sh-mk { display: inline-grid; width: 2em; height: 2em; border-radius: .4em; background: #C4FF0E; overflow: hidden; }
.ai-sh-mk svg { width: 100%; height: 100%; display: block; }
.ai-sh-sample { padding: .2em .7em; border: 1.5px solid #B45309; border-radius: 4px; color: #B45309; font: 800 .75em/1 var(--font-display); letter-spacing: .2em; transform: rotate(-3deg); }
.ai-sh-title { margin: 1.1em 0 .35em; color: #0A0A0A; font-size: 1.95em; }
.ai-sh-lead { color: #55574F; font-size: .95em; padding-bottom: 1em; margin-bottom: 1.3em; border-bottom: 1px solid #E6E7E1; }
.ai-sh-run { display: flex; justify-content: space-between; gap: 10px; padding-bottom: .6em; margin-bottom: 1.5em; border-bottom: 1px solid #ECEDE8; color: #8A8C84; font: 700 .72em/1.2 var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
.ai-kick { color: #6B6D64; font: 700 .74em/1.2 var(--font-display); letter-spacing: .16em; text-transform: uppercase; }
.ai-sh-h { margin: .25em 0 .95em; color: #0A0A0A; font-size: 1.45em; }
.ai-cl { position: relative; margin: 0 0 .9em; padding-left: 2.6em; color: #1A1A1A; }
.ai-cn { position: absolute; left: 0; top: 0; font-weight: 700; color: #0A0A0A; font-variant-numeric: tabular-nums; }
.ai-ct {
  padding: .06em .12em; border-radius: 3px;
  background-image: linear-gradient(rgba(196,255,14,.85), rgba(196,255,14,.85)); background-repeat: no-repeat; background-size: 0% 100%; background-position: 0 0;
  transition: background-size 800ms cubic-bezier(.32,.72,0,1);
}
.ai-cl.ai-hl .ai-ct { background-size: 100% 100%; color: #0A0A0A; }
.ai-tag { position: absolute; left: 2.4em; top: -1.25em; z-index: 1; padding: 2px 7px; border-radius: 999px; background: #0A0A0A; color: #C4FF0E; font: 700 10px/1.3 var(--font); letter-spacing: .02em; transform-origin: 0 100%; animation: ai-pop .45s var(--bounce) both; pointer-events: none; }
.ai-sh-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 1.4em; border-top: 1px solid #EEEFEA; color: #9A9C94; font-size: .74em; }
.ai-cchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ai-cchip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 999px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); font-size: 12.5px; font-weight: 600; animation: ai-rise .4s var(--spring) both; animation-delay: calc(var(--i, 0) * 70ms); transition: background-color .2s ease; }
.ai-cchip:hover { background: var(--lime-soft); }

/* =========================================================
   2) Ask the Gaffer
   ========================================================= */
.ai-as { flex: 1; min-height: 0; display: grid; grid-template-columns: 236px minmax(0, 1fr) 312px; overflow: hidden; border-radius: var(--radius); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.ai-hist { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 12px; border-right: 1px solid var(--line); background: var(--panel); }
.ai-newbtn { gap: 8px; flex: none; }
.ai-hl-sc { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.ai-hlbl { margin: 12px 8px 6px; font: 700 11px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ai-hi { display: flex; align-items: center; gap: 8px; width: 100%; height: 38px; padding: 0 10px; border-radius: 10px; color: var(--muted); font-size: 13.5px; font-weight: 550; text-align: left; transition: background-color .2s ease, color .2s ease; }
.ai-hi span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ai-hi:hover { background: var(--hover); color: var(--text); }
.ai-hi.on { background: var(--lime-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--lime-line); }
.ai-hi.fresh span { font-style: italic; }
.ai-meu { display: flex; align-items: center; gap: 10px; flex: none; padding: 10px 4px 2px; border-top: 1px solid var(--line); min-width: 0; }
.ai-meu p { min-width: 0; }
.ai-meu b { display: block; font-size: 13.5px; }
.ai-meu small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ai-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ai-srcs { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--panel-2); }
.ai-srcs-h { display: flex; align-items: center; gap: 8px; flex: none; padding: 15px 14px 10px; }
.ai-srcs-h b { font: 800 16px/1 var(--font-display); letter-spacing: .05em; text-transform: uppercase; }
.ai-cntb { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; }
.ai-srcs-b { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.ai-src { flex: none; padding: 12px; border-radius: 12px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); transition: transform .45s var(--spring), box-shadow .3s ease; min-width: 0; }
.ai-in-anim .ai-src, .ai-srcsheet .ai-src { animation: ai-slide .5s var(--spring) both; animation-delay: calc(var(--i, 0) * 80ms); }
.ai-src.on { transform: translateX(-5px); box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px var(--lime-soft), var(--shadow); }
.ai-src-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-width: 0; }
.ai-lt { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); font: 800 12px/1 var(--font-display); }
.ai-lt.k-C { background: rgba(59,130,246,.16); box-shadow: none; }
.ai-lt.k-T { background: rgba(34,197,94,.16); box-shadow: none; }
.ai-lt.k-G { background: rgba(245,158,11,.18); box-shadow: none; }
.ai-lt.k-P { background: var(--lime-soft); box-shadow: none; }
.ai-lt.k-M { background: rgba(239,68,68,.15); box-shadow: none; }
.ai-path { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font: 500 11px/1.2 var(--ai-mono); }
.ai-sn { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); font-size: 11px; font-weight: 700; color: var(--muted); transition: background-color .3s ease, color .3s ease, box-shadow .3s ease; }
.ai-src.on .ai-sn { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.ai-src-t { display: block; font-size: 13.5px; font-weight: 650; margin-bottom: 4px; }
.ai-src-p { color: var(--muted); font-size: 12.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ai-src-sk i { display: block; height: 9px; border-radius: 5px; margin-top: 8px; }
.ai-src-sk .ai-src-top i { flex: 1; margin: 0; }
.ai-src-sk .ai-lt { box-shadow: none; }
.ai-src-sk .w60 { max-width: 60%; }
.ai-src-sk .w80 { width: 80%; }
.ai-src-empty { padding: 44px 10px; text-align: center; color: var(--muted); font-size: 13px; }
.ai-src-empty svg { opacity: .5; margin: 0 auto 8px; display: block; }
.ai-used { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.ai-used > span { font-size: 12px; font-weight: 650; color: var(--muted); margin-right: 2px; }
.ai-upill { display: inline-flex; align-items: center; gap: 6px; height: 30px; max-width: 100%; padding: 0 10px 0 4px; border-radius: 999px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; font-weight: 600; animation: ai-rise .4s var(--spring) both; animation-delay: calc(var(--i, 0) * 60ms); transition: background-color .2s ease; }
.ai-upill:hover { background: var(--lime-soft); }
.ai-upill b { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 11px; }
.ai-upill span { min-width: 0; max-width: 190px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ai-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin-top: 8px; }
.ai-acts .ai-wby { margin: 0 auto 0 0; padding-right: 6px; }
.ai-act { width: 36px; height: 36px; }
.ai-act.on { color: var(--text); background: var(--lime-soft); }
.ai-empty { margin: auto; max-width: 480px; padding: 24px 6px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; animation: ai-rise .5s var(--spring) both; }
.ai-empty h2 { font-size: 28px; margin-top: 6px; }
.ai-empty-k { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; }
.ai-empty .muted { font-size: 14px; }
.ai-empty .ai-sugg { flex-wrap: wrap; justify-content: center; padding: 8px 0 0; overflow: visible; }
.ai-srcbtn { position: relative; }
.ai-cnt { position: absolute; top: 4px; right: 2px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 700 10px/1 var(--font); font-style: normal; }
.ai-srcsheet { display: flex; flex-direction: column; gap: 10px; padding: 2px 4px 6px; }
.ai-histsheet { display: flex; flex-direction: column; gap: 8px; }
.ai-histsheet .ai-meu { display: none; }
.ai-histsheet .ai-hi { height: 46px; }
@media (min-width: 1024px) and (max-width: 1279px) {
  .ai-as { grid-template-columns: 204px minmax(0, 1fr) 264px; }
}

/* =========================================================
   3) Automations
   ========================================================= */
.ai-au-top { margin-bottom: 14px; }
.ai-au-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 14px; margin-bottom: 16px; }
.ai-au-ht { flex: 1 1 220px; min-width: 0; }
.ai-au-by { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 12px; font-weight: 650; color: var(--muted); }
.ai-au-ht h2 { font-size: 24px; }
.ai-au-ht p { margin-top: 4px; font-size: 13px; color: var(--muted); }
.ai-au-ctl { display: flex; align-items: center; gap: 10px; }
.ai-au-btn { gap: 7px; min-width: 104px; }
.ai-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 650; white-space: nowrap; transition: background-color .3s ease, color .3s ease; }
.ai-pill.is-running { background: var(--lime-soft); color: var(--text); }
.ai-pill.is-done { background: rgba(34,197,94,.15); color: var(--ai-green); }
.ai-pill.is-stopped { background: var(--panel-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.ai-ping { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.ai-pill.is-running .ai-ping { background: var(--ai-live); }
.ai-pill.is-done .ai-ping { background: var(--green); }
.ai-pill.is-running .ai-ping::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ai-live); animation: ai-ping 1.4s cubic-bezier(0,0,.2,1) infinite; }
@keyframes ai-ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(2.6); opacity: 0; } }
.ai-au-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; grid-template-rows: auto 1fr; grid-template-areas: "tl sum" "tl out"; gap: 16px; align-items: start; }
.ai-tl { grid-area: tl; list-style: none; margin: 0; padding: 0; min-width: 0; }
.ai-sum { grid-area: sum; }
.ai-out { grid-area: out; }
.ai-st { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding-bottom: 12px; animation: ai-rise .5s var(--spring) both; animation-delay: calc(var(--i, 0) * 45ms); }
.ai-rail { position: relative; display: flex; justify-content: center; }
.ai-rail::before { content: ""; position: absolute; left: 50%; top: 44px; bottom: -6px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--line); transition: background-color .5s ease; }
.ai-st:last-child .ai-rail::before { display: none; }
.ai-st.is-done .ai-rail::before { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.ai-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; margin-top: 10px; border-radius: 50%; background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); font: 700 13px/1 var(--font); transition: background-color .3s ease, color .3s ease, box-shadow .3s ease; }
.ai-dot > span { grid-area: 1 / 1; display: grid; place-items: center; opacity: 0; transform: scale(.6); transition: opacity .2s ease, transform .3s var(--bounce); }
.is-wait .ai-n, .is-run .ai-eq, .is-done .ai-tick, .is-stop .ai-pz { opacity: 1; transform: none; }
.is-run .ai-dot { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 5px var(--lime-soft); }
.is-done .ai-dot { background: rgba(34,197,94,.16); color: var(--ai-green); box-shadow: none; }
.is-done .ai-tick { animation: ai-bounce .5s var(--bounce) both; }
.is-stop .ai-dot { background: var(--panel-2); color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--muted); }
.ai-eq { display: flex !important; align-items: flex-end; gap: 2px; height: 13px; }
.ai-eq i { display: block; width: 3px; height: 40%; border-radius: 2px; background: currentColor; animation: ai-eq .9s ease-in-out infinite; }
.ai-eq i:nth-child(2) { animation-delay: -.3s; }
.ai-eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes ai-eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }
.ai-card { min-width: 0; overflow: hidden; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .35s ease; }
.is-run .ai-card { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 5px var(--lime-soft), 0 14px 34px -16px rgba(196,255,14,.5); }
.is-stop .ai-card { box-shadow: inset 0 0 0 1.5px var(--muted); }
.ai-card-h { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 11px 10px 11px 14px; text-align: left; }
.ai-card-m { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; min-width: 0; }
.ai-tagc { padding: 3px 8px; border-radius: 6px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font: 600 11.5px/1.3 var(--ai-mono); white-space: nowrap; }
.is-run .ai-tagc { background: var(--lime-soft); color: var(--text); box-shadow: none; }
.ai-st-t { min-width: 0; font-size: 14.5px; font-weight: 600; }
.is-wait .ai-st-t { color: var(--muted); }
.ai-el { font: 500 12px/1 var(--ai-mono); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.is-run .ai-el { color: var(--text); }
.is-stop .ai-el { color: var(--muted); }
.ai-chev { display: grid; place-items: center; width: 28px; height: 28px; color: var(--muted); transition: transform .4s var(--spring); }
.ai-st.open .ai-chev { transform: rotate(180deg); }
.ai-logw { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--spring); }
.ai-st.open .ai-logw { grid-template-rows: 1fr; }
.ai-logi { min-height: 0; overflow: hidden; }
.ai-log { margin: 0 12px 12px; padding: 10px 12px; border-radius: 10px; background: #0B0C0A; box-shadow: inset 0 0 0 1px #1F201C; color: #D6D7D1; font: 12px/1.65 var(--ai-mono); min-height: 36px; }
.ai-ll { white-space: pre-wrap; overflow-wrap: anywhere; animation: ai-ll .35s ease both; }
@keyframes ai-ll { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ai-ll.k-c { color: #7C7E76; }
.ai-ll.k-ok { color: #4ADE80; }
.ai-pr { color: #C4FF0E; margin-right: 8px; font-weight: 700; }
.ai-okk { color: #4ADE80; margin-right: 8px; font-weight: 700; }
.ai-big { display: flex; align-items: baseline; gap: 8px; }
.ai-big-n { font-size: 48px; line-height: 1; }
.ai-big small { color: var(--muted); font-size: 13px; }
.ai-bar { height: 8px; margin: 14px 0 12px; overflow: hidden; border-radius: 4px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.ai-bar i { display: block; width: 0; height: 100%; border-radius: 4px; background: var(--accent); transition: width .25s linear; }
.ai-dl { margin: 0; }
.ai-dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.ai-dl dt { color: var(--muted); font-size: 13.5px; }
.ai-dl dd { margin: 0; font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.ai-out-b { min-height: 110px; }
.ai-shim { height: 11px; margin-bottom: 10px; border-radius: 6px; }
.ai-shim.w70 { width: 70%; }
.ai-stopped .ai-shim { animation-play-state: paused; }
.ai-out-wait { font-size: 13px; margin-top: 12px; }
.ai-out-p { font-size: 14px; line-height: 1.55; animation: ai-fade .5s ease both; }
.ai-files { display: grid; gap: 8px; margin-top: 14px; }
.ai-file { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 10px; border-radius: 12px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); text-align: left; animation: ai-rise .5s var(--spring) both; animation-delay: calc(.15s + var(--i, 0) * .12s); transition: background-color .2s ease; }
.ai-file:hover { background: var(--hover); }
.ai-file-m { flex: 1; min-width: 0; }
.ai-file-m b { display: block; font-size: 13.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ai-file-m small { display: block; font-size: 12px; color: var(--muted); }
.ai-out .ai-wby { animation: ai-fade .5s ease .4s both; }

/* =========================================================
   4) My Actions / My Follow-ups
   ========================================================= */
.ai-actv { max-width: 560px; margin: 0 auto; }
.ai-act-h { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.ai-act-ht { flex: 1; min-width: 0; }
.ai-eyebrow { font-size: 13px; font-weight: 650; color: var(--muted); letter-spacing: .02em; }
.ai-act-ht h1 { font-size: 36px; margin: 2px 0 4px; }
.ai-act-ht p { font-size: 14px; }
.ai-ring { position: relative; flex: none; width: 58px; height: 58px; }
.ai-ring svg { display: block; transform: rotate(-90deg); }
.ai-ring circle { fill: none; stroke-width: 5; }
.ai-ring-bg { stroke: var(--line); }
.ai-ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 760ms var(--spring); }
.ai-ring-t { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 15px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.ai-odo { display: inline-block; height: 1em; line-height: 1em; overflow: hidden; }
.ai-odo-s { display: flex; flex-direction: column; transition: transform 700ms var(--bounce); }
.ai-odo-s span { display: block; height: 1em; line-height: 1em; text-align: right; }
.ai-ring-sl { color: var(--muted); margin: 0 1px; }
.ai-gs { margin-bottom: 18px; padding: 12px; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); animation: ai-rise .5s var(--spring) both; }
.ai-gs-h { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.ai-gs-h b { font-size: 14px; font-weight: 650; }
.ai-gs-h small { flex-basis: 100%; color: var(--muted); font-size: 12px; padding-left: 32px; margin-top: -4px; }
.ai-gs-c { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ai-gchip { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; max-width: 100%; padding: 8px 13px 8px 10px; border-radius: 12px; background: var(--lime-soft); box-shadow: inset 0 0 0 1px var(--lime-line); color: var(--text); font-size: 13.5px; font-weight: 600; text-align: left; transition: transform 90ms ease-out, background-color .2s ease; }
.ai-gchip:active { transform: scale(.97); }
.ai-gchip span { min-width: 0; }
.ai-sec { margin-bottom: 18px; }
.ai-sec-h { display: flex; align-items: center; gap: 8px; margin: 0 4px 8px; }
.ai-sec-h h3 { font-size: 15px; letter-spacing: .08em; }
.ai-cpill { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ai-rows { list-style: none; margin: 0; padding: 0; }
.ai-sec-empty { padding: 16px; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: 14px; text-align: center; }
.ai-row { position: relative; display: grid; grid-template-rows: 1fr; margin-bottom: 8px; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .9s ease, box-shadow .9s ease; }
.ai-row-in { min-height: 0; overflow: hidden; display: flex; align-items: flex-start; gap: 4px; padding: 6px 12px 8px 4px; }
.ai-chk { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; }
.ai-chk svg { overflow: visible; }
.ai-chk-c { fill: transparent; stroke: var(--muted); stroke-width: 1.8; transition: fill .3s ease, stroke .3s ease; }
.ai-chk-t { fill: none; stroke: var(--on-accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .36s ease .1s; }
.ai-chk:hover .ai-chk-c { stroke: var(--text); }
.ai-row.is-done .ai-chk-c { fill: var(--accent); stroke: var(--accent); }
.ai-row.is-done .ai-chk-t { stroke-dashoffset: 0; }
.ai-row.just .ai-chk svg { animation: ai-bounce .5s var(--bounce) both; }
.ai-row-m { flex: 1; min-width: 0; padding-top: 11px; }
.ai-row-t { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; text-align: left; overflow-wrap: anywhere; transition: color .3s ease; }
.ai-row-t.is-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.ai-row.is-done .ai-row-t { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted); }
.ai-row-s { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; margin-top: 5px; font-size: 12.5px; }
.ai-due { color: var(--accent-text); font-weight: 650; }
.ai-due.od { color: var(--red); }
.ai-row.is-done .ai-due { color: var(--muted); font-weight: 600; }
.ai-schip, .ai-gtag, .ai-flag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.ai-schip { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ai-gtag { background: var(--accent); color: var(--on-accent); }
.ai-flag { display: none; background: rgba(59,130,246,.15); color: var(--blue); }
.ai-row.is-flag .ai-flag { display: inline-flex; }
.ai-row.ai-new { animation: ai-drop .6s var(--spring) both; background: color-mix(in srgb, var(--lime) 16%, var(--panel)); box-shadow: inset 0 0 0 1.5px var(--accent); }
.ai-row.ai-new .ai-row-in { animation: ai-drop-in .6s var(--spring) both; }
@keyframes ai-drop { from { grid-template-rows: 0fr; margin-bottom: 0; opacity: 0; } to { grid-template-rows: 1fr; margin-bottom: 8px; opacity: 1; } }
@keyframes ai-drop-in { from { transform: translateY(-12px) scale(.96); } to { transform: none; } }

/* rows wrapped by the shell swipe helper (mobile) */
.ai-rows > .sw { margin-bottom: 8px; border-radius: 14px; }
.ai-rows > .sw > .sw-in { border-radius: 14px; }
.ai-rows > .sw .ai-row { margin-bottom: 0; }
.ai-rows > .sw .ai-row.ai-new { animation-name: ai-drop-sw; }
@keyframes ai-drop-sw { from { grid-template-rows: 0fr; opacity: 0; } to { grid-template-rows: 1fr; opacity: 1; } }

/* quick add */
.ai-qa { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; padding: 5px 5px 5px 14px; border-radius: 999px; background: var(--panel); box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line); position: sticky; bottom: 16px; z-index: 5; transition: box-shadow .2s ease; }
.ai-qa:focus-within { box-shadow: var(--shadow-lg), inset 0 0 0 1.5px var(--accent), 0 0 0 4px var(--lime-soft); }
.ai-qa-plus { display: grid; place-items: center; color: var(--muted); flex: none; }
.ai-qa-in { flex: 1; min-width: 0; height: 44px; padding: 0 4px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.ai-qa-in::placeholder { color: var(--muted); }
.ai-qa-send { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--panel-2); color: var(--muted); transition: background-color .25s ease, color .25s ease, transform .35s var(--bounce); }
.ai-qa.has-text .ai-qa-send { background: var(--accent); color: var(--on-accent); transform: scale(1.04); }
.ai-qa-send:disabled { cursor: default; }
.ai-qa.ai-qa-m {
  position: fixed; z-index: 45; left: calc(12px + var(--sal, 0px)); right: calc(12px + var(--sar, 0px)); bottom: env(safe-area-inset-bottom, 0px);
  max-width: 560px; margin: 0 auto; transition: transform .28s var(--ease), box-shadow .2s ease; will-change: transform;
}
.ai-qa.ai-qa-m.kb { transition: box-shadow .2s ease; }

/* =========================================================
   Menus, row more button, edit, reorder mode
   ========================================================= */
.ai-more { width: 40px; height: 40px; margin: 2px -6px 0 0; color: var(--muted); }
.ai-menu { display: flex; flex-direction: column; gap: 6px; }
.ai-menu-b { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 0 14px; border-radius: 12px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; font-weight: 600; text-align: left; }
.ai-menu-b:hover { background: var(--hover); }
.ai-menu-b.danger { color: var(--red); }
.ai-note { font-size: 12.5px; margin-top: 6px; }
.ai-edit { display: grid; gap: 12px; }
.ai-edit-in { font-size: 16px; }
.ai-ro-btn { margin-left: auto; }
.ai-ro-hint { margin: 0 4px 8px; font-size: 12.5px; color: var(--muted); }
.ai-ro { list-style: none; margin: 0 0 8px; padding: 0; }
.ai-ro-row { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 12px 0 8px; border-radius: 12px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); cursor: grab; }
.ai-ro-g { display: grid; place-items: center; width: 28px; color: var(--muted); flex: none; }
.ai-ro-m { flex: 1; min-width: 0; }
.ai-ro-m b { display: block; font-size: 14.5px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ai-ro-m small { display: block; font-size: 12px; }
.ai-ro-row .ro-grip { display: none; }

/* =========================================================
   5) Lead Review card stack
   ========================================================= */
.ai-rv { max-width: 460px; margin: 0 auto; }
.ai-rv-stage { position: relative; height: 470px; }
.ai-rv-stack { position: absolute; inset: 0; }
.ai-rc {
  position: absolute; inset: 0; border-radius: 22px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line), var(--shadow);
  overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; cursor: grab; transform-origin: 50% 90%;
  transition: transform .45s var(--spring), opacity .3s ease;
}
.ai-rc:first-child { transition: none; }
.ai-rv-stack.dragging .ai-rc { transition: none; }
.ai-rc:active { cursor: grabbing; }
.ai-rc-in { height: 100%; display: flex; flex-direction: column; gap: 14px; padding: 22px 20px; transition: opacity .25s ease; }
.ai-rv-stack.dragging .ai-rc-in { transition: none; }
.ai-rc-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ai-rc-nm { min-width: 0; }
.ai-rc-nm h2 { font-size: 28px; line-height: 1; }
.ai-rc-nm p { margin-top: 4px; color: var(--muted); font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ai-rc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-rc-chips .ai-schip { height: 24px; font-size: 12px; }
.ai-rc-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ai-rc-kv div { padding: 10px; border-radius: 12px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.ai-rc-kv small, .ai-rc-q small { display: block; font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ai-rc-kv b { display: block; margin-top: 3px; font: 800 17px/1.1 var(--font-display); overflow-wrap: anywhere; }
.ai-rc-kv b.ai-yes { color: var(--ai-green); }
.ai-rc-kv b.ai-no { color: var(--red); }
.ai-rc-q p { margin-top: 4px; font-size: 15px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ai-stamp { position: absolute; z-index: 3; top: 26px; padding: 6px 12px; border: 3px solid; border-radius: 10px; font: 800 26px/1 var(--font-display); letter-spacing: .08em; opacity: 0; pointer-events: none; }
.ai-stamp-yes { left: 18px; transform: rotate(-14deg); color: var(--lime); border-color: var(--lime); background: rgba(10,10,10,.55); }
.ai-stamp-no { right: 18px; transform: rotate(14deg); color: #9A9A9A; border-color: #9A9A9A; background: rgba(10,10,10,.4); }
html[data-theme="light"] .ai-stamp-yes { color: #0A0A0A; border-color: #0A0A0A; background: var(--lime); }
html[data-theme="light"] .ai-stamp-no { color: #5F6157; border-color: #5F6157; background: #F0F1EC; }
.ai-rc-back { animation: ai-rc-back .5s var(--spring) both; }
@keyframes ai-rc-back { from { opacity: 0; transform: translateY(-24px) scale(1.04); } to { opacity: 1; transform: none; } }
.ai-rv-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; border-radius: 22px; box-shadow: inset 0 0 0 1.5px var(--line); background: var(--panel); animation: ai-rise .5s var(--spring) both; }
.ai-rv-empty .ai-mark { overflow: hidden; }
.ai-rv-empty .ai-mark svg { width: 100%; height: 100%; }
.ai-rv-empty h2 { font-size: 30px; }
.ai-rv-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.ai-rv-bar.off .ai-rv-btn { opacity: .35; pointer-events: none; }
.ai-rv-count { font: 800 16px/1 var(--font-display); letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.ai-rv-btn { display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 20px 0 16px; border-radius: 999px; font-size: 15px; font-weight: 700; transition: transform .25s var(--bounce), background-color .2s ease; }
.ai-rv-btn:active { transform: scale(.94); }
.ai-rv-btn.no { background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.ai-rv-btn.yes { background: var(--accent); color: var(--on-accent); }

/* =========================================================
   6) Member welcome carousel
   ========================================================= */
html.ai-wel-open, html.ai-wel-open body { overflow: hidden; }
.ai-wel {
  position: fixed; inset: 0; z-index: 9600; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  padding: calc(var(--sat, 0px) + 10px) 0 calc(var(--sab, 0px) + 16px); animation: ai-fade .35s ease both;
  transition: opacity .34s ease, transform .34s var(--ease);
}
.ai-wel.out { opacity: 0; transform: scale(1.04); pointer-events: none; }
.ai-wel-top { display: flex; align-items: center; gap: 10px; padding: 0 calc(12px + var(--sar, 0px)) 0 calc(18px + var(--sal, 0px)); min-height: 48px; }
.ai-wel-mk { width: 32px; height: 32px; font-size: 16px; }
.ai-wel-wm { display: flex; flex-direction: column; line-height: 1; flex: 1; min-width: 0; }
.ai-wel-wm b { font: 800 18px/1 var(--font-display); letter-spacing: .04em; }
.ai-wel-wm small { font: 700 9.5px/1.2 var(--font-display); letter-spacing: .14em; color: var(--muted); margin-top: 3px; }
.ai-wel-skip { min-width: 64px; height: 44px; padding: 0 12px; border-radius: 12px; color: var(--muted); font-size: 15px; font-weight: 650; }
.ai-wel-skip:hover { color: var(--text); background: var(--hover); }
.ai-wel-track { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; touch-action: pan-x; scrollbar-width: none; overscroll-behavior-x: contain; }
.ai-wel-track::-webkit-scrollbar { display: none; }
.ai-wel-pg { flex: 0 0 100%; min-width: 0; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 12px calc(28px + var(--sar, 0px)) 12px calc(28px + var(--sal, 0px)); text-align: center; }
.ai-wel-pg h2 { font-size: clamp(30px, 8.5vw, 44px); max-width: 520px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; }
.ai-wel-pg h2 .ai-badge { height: 26px; padding: 0 9px; font-size: 15px; }
.ai-wel-pg > p { max-width: 420px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.ai-wel-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 calc(20px + var(--sar, 0px)) 0 calc(20px + var(--sal, 0px)); max-width: 560px; width: 100%; margin: 0 auto; }
.ai-wel-dots { display: flex; align-items: center; margin: 0; }
.ai-wdot { display: grid; place-items: center; width: 24px; height: 44px; }
.ai-wdot i { display: block; width: 18px; height: 6px; border-radius: 3px; background: var(--accent); }
.ai-wel-next { min-width: 150px; height: 52px; border-radius: 999px; font-size: 16px; }
.ai-wel-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; width: 100%; max-width: 320px; text-align: left; }
.ai-wel-steps li { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; font-weight: 600; }
.ai-wel-steps li span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--on-accent); flex: none; }

/* illustrations: lime blocks with the 3-bar logo motif */
.ai-ill { position: relative; display: grid; place-items: center; width: min(62vw, 250px); height: min(34vh, 230px); }
.ai-ill-tile { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 9%; width: 78%; aspect-ratio: 1; max-height: 100%; padding: 0 16% 18%; border-radius: 22%; background: var(--lime); box-shadow: 0 24px 60px -18px rgba(196,255,14,.55); }
.ai-ill-logo .ai-ill-tile i { display: block; width: 22%; background: #0A0A0A; border-radius: 3px 3px 0 0; transform-origin: bottom; animation: ai-bar .9s var(--spring) both; }
.ai-ill-logo .ai-ill-tile i:nth-child(1) { height: 38%; clip-path: polygon(38% 0, 100% 0, 100% 100%, 0 100%, 0 42%); animation-delay: .1s; }
.ai-ill-logo .ai-ill-tile i:nth-child(2) { height: 58%; animation-delay: .22s; }
.ai-ill-logo .ai-ill-tile i:nth-child(3) { height: 74%; animation-delay: .34s; }
@keyframes ai-bar { from { transform: scaleY(0); } to { transform: none; } }
.ai-ill-jr { gap: 14px; }
.ai-ill-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 18px; border-radius: 26px; background: var(--lime); width: min(56vw, 210px); box-shadow: 0 24px 60px -18px rgba(196,255,14,.5); }
.ai-ill-grid i { display: block; aspect-ratio: 1; border-radius: 8px; background: rgba(10,10,10,.18); animation: ai-pop .4s var(--bounce) both; animation-delay: calc(var(--i) * 35ms); }
.ai-ill-grid i.d { background: #0A0A0A; }
.ai-ill-grid i.c { background: transparent; box-shadow: inset 0 0 0 3px #0A0A0A; animation: ai-pop .4s var(--bounce) both, ai-cur 1.6s ease-in-out .8s infinite; }
@keyframes ai-cur { 50% { transform: scale(.82); } }
.ai-ill-cap { font: 800 15px/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ai-ill-gf .ai-ill-tile { width: 54%; padding: 0; align-items: center; color: #0A0A0A; }
.ai-ill-gf .ai-ill-tile svg { width: 52%; height: 52%; animation: ai-twinkle 2.4s ease-in-out infinite; }
@keyframes ai-twinkle { 50% { transform: rotate(12deg) scale(.9); } }
.ai-ill-b1, .ai-ill-b2 { position: absolute; padding: 8px 12px; border-radius: 14px; font-size: 12.5px; font-weight: 650; white-space: nowrap; box-shadow: var(--shadow); animation: ai-rise .6s var(--spring) both; }
.ai-ill-b1 { top: 6%; left: -6%; background: var(--ai-ubg); color: var(--ai-ufg); border-bottom-right-radius: 4px; animation-delay: .2s; }
.ai-ill-b2 { bottom: 8%; right: -8%; background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); border-bottom-left-radius: 4px; animation-delay: .5s; }
.ai-ill-b2 em { display: inline-grid; place-items: center; min-width: 18px; height: 17px; margin-left: 4px; border-radius: 5px; background: var(--accent); color: var(--on-accent); font-style: normal; font-size: 10.5px; }
.ai-ill-phone { display: grid; grid-template-columns: repeat(3, 1fr); align-content: start; gap: 12px; width: min(38vw, 140px); aspect-ratio: 9 / 17; max-height: 100%; padding: 26px 14px; border-radius: 26px; background: var(--lime); box-shadow: inset 0 0 0 5px #0A0A0A, 0 24px 60px -18px rgba(196,255,14,.5); }
.ai-ill-phone i, .ai-ill-app { display: block; aspect-ratio: 1; border-radius: 26%; background: rgba(10,10,10,.2); }
.ai-ill-app { background: #0A0A0A; overflow: hidden; padding: 3px; animation: ai-pop .5s var(--bounce) .3s both; }
.ai-ill-app svg { width: 100%; height: 100%; display: block; }
.ai-ill-app svg path { fill: #C4FF0E; }
@media (max-height: 640px) {
  .ai-ill { height: 26vh; }
  .ai-wel-pg { gap: 10px; }
  .ai-wel-pg > p { font-size: 14.5px; }
}
@media (max-width: 1023px) {
  .ai-rv-stage { height: calc(100vh - var(--tb-h) - var(--sat) - 16px - var(--ai-bot) - 96px); height: calc(100dvh - var(--tb-h) - var(--sat) - 16px - var(--ai-bot) - 96px); min-height: 400px; max-height: 560px; }
  .ai-rv { padding-bottom: 8px; }
  .ai-rc-nm h2 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-wel, .ai-wel *, .ai-rc, .ai-rc * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* fallbacks when the shell helpers are missing */
.ai-fb-toast { position: fixed; z-index: 9999; left: 50%; bottom: 110px; transform: translateX(-50%); padding: 10px 16px; border-radius: 12px; background: #0A0A0A; color: #F5F5F5; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.ai-fbs { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: flex-end; justify-content: center; background: var(--scrim, rgba(0,0,0,.5)); }
.ai-fbs-in { width: 100%; max-width: 520px; max-height: 80vh; overflow: auto; border-radius: 20px 20px 0 0; background: var(--panel); padding: 8px 16px calc(20px + var(--sab, 0px)); }
.ai-fbs-h { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 10px; }

/* ---------- mobile ---------- */
@media (max-width: 1023px) {
  .ai-ib { width: 44px; height: 44px; }
  .ai-act { width: 44px; height: 44px; }
  .ai-in { font-size: 16px; height: 44px; }
  .ai-send { width: 44px; height: 44px; }
  .ai-sc { height: 40px; }
  .ai-cchip { height: 38px; }
  .ai-upill { height: 36px; }
  .ai-thread { padding: 14px 12px; }
  .ai-comp { padding: 8px 8px 10px; }

  .ai-head { margin-bottom: 10px; }
  .ai-dpick { width: 100%; }
  .ai-dpick button { height: 40px; }
  .ai-dq { display: flex; flex-direction: column; gap: 10px; }
  .ai-dq-doc { flex: 0 0 40%; }
  .ai-dq-chat { flex: 1 1 0; }
  .ai-dq-tb { padding: 2px 2px 2px 12px; gap: 6px; }
  .ai-dq-tb .ai-ftile, .ai-dq-sub, .ai-zv { display: none; }
  .ai-zoom { box-shadow: none; }
  .ai-zoom .ai-ib { width: 44px; height: 44px; }
  .ai-dq-scroll { padding: 10px; }
  .ai-sheet { padding: calc(18px * var(--z)) calc(18px * var(--z)); font-size: calc(12.5px * var(--z)); }
  .ai-dq-chat .ai-ch-h { padding: 8px 12px; }

  .ai-as { grid-template-columns: minmax(0, 1fr); }
  .ai-hist, .ai-srcs { display: none; }
  .ai-chat .ai-ch-h { padding: 4px 4px 4px 2px; gap: 6px; }
  .ai-chat .ai-ch-h .ai-mark { width: 30px; height: 30px; }
  .ai-empty h2 { font-size: 24px; }
  .ai-comp-meta { margin-top: 6px; }

  .ai-au-head { gap: 12px; }
  .ai-au-head > .ai-mark { display: none; }
  .ai-au-ctl { width: 100%; justify-content: space-between; }
  .ai-au-btn { min-height: 44px; }
  .ai-au-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "sum" "tl" "out"; gap: 14px; }
  .ai-big-n { font-size: 40px; }
  .ai-st { grid-template-columns: 36px minmax(0, 1fr); gap: 8px; }
  .ai-card-h { padding: 10px 6px 10px 12px; }
  .ai-log { margin: 0 8px 8px; padding: 9px 10px; font-size: 11.5px; }

  .ai-actv { padding-bottom: 84px; }
  .ai-act-ht h1 { font-size: 32px; }
}
@media (max-width: 380px) {
  .ai-pg { font-size: 12px; }
  .ai-dq-tt b { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-root *, .ai-qa, .ai-qa * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .ai-caret { animation: none; }
}

/* ===== Fix 17/11: actions view collapsed to a narrow column on desktop ===== */
.ai-root.ai-actv { display: block; width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }
.ai-actv .ai-act-h { width: 100%; }
.ai-actv .ai-act-ht { min-width: 220px; }
.ai-actv > .ai-qa:not(.ai-qa-m) { position: sticky; bottom: 16px; top: auto; width: 100%; }
/* class-name clash: .ai-act is also the 36px chat icon button; the actions page wrapper must not inherit it */
.ai-actv > .ai-act { width: auto; height: auto; display: block; }
@media (max-width: 1023px) { .ai-actv > .ai-act { width: auto; height: auto; } }
.ai-actw { display: block; width: 100%; }

/* ===== Welcome illustrations, redone 17/11 (real JCCA mark, proper phone) ===== */
.ai-ill-mk { display: grid; place-items: center; width: min(46vw, 200px); aspect-ratio: 1; border-radius: 6%; background: #C4FF0E; box-shadow: 0 30px 80px -20px rgba(196,255,14,.55); animation: ai-pop .6s var(--bounce) both; }
.ai-ill-mk svg { width: 100%; height: 100%; display: block; }
.ai-ill-mk svg path { fill: #0A0A0A; transform-origin: 50% 83%; animation: ai-mk-rise .9s var(--spring) .15s both; }
@keyframes ai-mk-rise { from { transform: scaleY(0); } to { transform: none; } }

.ai-ill-hs { height: min(36vh, 250px); }
.ai-ph { position: relative; height: 100%; aspect-ratio: 9 / 19.5; padding: 15% 9% 7%; border-radius: 16% / 7.5%; background: #0A0A0A; box-shadow: inset 0 0 0 3px #2A2A2A, 0 0 0 1px rgba(0,0,0,.08), 0 30px 60px -24px rgba(0,0,0,.45); display: flex; flex-direction: column; animation: ai-pop .6s var(--bounce) both; }
.ai-ph-isl { position: absolute; top: 3.2%; left: 50%; width: 32%; height: 4%; transform: translateX(-50%); border-radius: 99px; background: #000; box-shadow: inset 0 0 0 1px #222; }
.ai-ph-time { position: absolute; top: 3.4%; left: 12%; font: 700 9px/1 var(--font); color: #F5F5F5; }
.ai-ph-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14% 12%; margin-top: 6%; }
.ai-ph-grid > i { display: block; aspect-ratio: 1; border-radius: 26%; background: #2A2A2A; }
.ai-ph-app { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ai-ph-ic { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 26%; background: #C4FF0E; overflow: visible; animation: ai-pop .5s var(--bounce) .45s both; }
.ai-ph-ic svg { width: 100%; height: 100%; display: block; }
.ai-ph-ic svg path { fill: #0A0A0A; }
.ai-ph-ic::after { content: ""; position: absolute; inset: -4px; border-radius: 30%; box-shadow: 0 0 0 2px #C4FF0E; animation: ai-ph-ring 1.8s ease-out 1s infinite; }
@keyframes ai-ph-ring { 0% { opacity: .9; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.35); } }
.ai-ph-app small { font: 600 7px/1 var(--font); color: #F5F5F5; letter-spacing: .02em; }
.ai-ph-dock { margin-top: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12%; padding: 8% 7%; border-radius: 18%; background: rgba(255,255,255,.08); }
.ai-ph-dock i { display: block; aspect-ratio: 1; border-radius: 26%; background: #333; }
@media (prefers-reduced-motion: reduce) { .ai-ill-mk svg path, .ai-ph-ic::after { animation: none !important; } }
/* QA 17/11: phone illustration must never grow past its slot */
.ai-ill.ai-ill-hs { height: auto; width: auto; }
.ai-ph { height: min(30vh, 230px); width: auto; flex: none; }
.ai-ph-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px 8px; margin-top: 10px; }
.ai-ph-app small { font-size: 6.5px; }
@media (max-height: 700px) { .ai-ph { height: 24vh; } }
