/* AIBA "seven smarts" demo — services/business-assistants.html
   Scenes are plain HTML; aiba-demo.js adds .s1…sN to the active scene.
   Elements with data-s="n" appear once step n is reached. */

.aiba-demo { --ad-o: var(--accent-orange, #ff6b00); --ad-line: rgba(15, 23, 42, 0.09); --ad-soft: #f6f8fc; --ad-good: #059669; --ad-warn: #b45309; }

.aiba-demo .ad-badge { border-color: rgba(255, 107, 0, 0.25); color: var(--ad-o); margin-bottom: 12px; }
.aiba-demo .ad-intro { max-width: 620px; margin: 0 auto 26px; }

/* name box */
.ad-namebox { max-width: 440px; margin: 0 auto 36px; text-align: left; }
.ad-namebox label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); margin-bottom: 8px; }
.ad-namebox input { width: 100%; padding: 13px 16px; border-radius: 10px; border: 1px solid rgba(255, 107, 0, 0.3); background: #fff; color: var(--text-primary); font: 500 1rem var(--font-body); outline: none; transition: border-color .2s, box-shadow .2s; }
.ad-namebox input::placeholder { color: var(--text-muted); }
.ad-namebox input:focus { border-color: var(--ad-o); box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.12); }
.ad-born { margin: 10px 0 0; font-size: 0.88rem; color: var(--text-secondary); }
.ad-born strong { color: var(--ad-o); letter-spacing: 0.04em; font-family: var(--font-display); font-size: 1.02rem; }

/* player layout */
.ad-player { display: grid; grid-template-columns: minmax(250px, 320px) 1fr; gap: 22px; align-items: stretch; }
.ad-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ad-item { position: relative; display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid transparent; background: transparent; cursor: pointer; overflow: hidden; color: var(--text-secondary); font: inherit; transition: background .2s, border-color .2s, color .2s; }
.ad-item svg { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; color: var(--text-muted); transition: color .2s; }
.ad-item span { display: flex; flex-direction: column; gap: 2px; }
.ad-item b { font: 600 0.95rem var(--font-display); color: var(--text-primary); }
.ad-item small { font-size: 0.8rem; line-height: 1.4; display: none; }
.ad-item:hover { background: rgba(255, 255, 255, 0.7); }
.ad-item:focus-visible { outline: 2px solid var(--ad-o); outline-offset: 2px; }
.ad-item.is-on { background: #fff; border-color: rgba(255, 107, 0, 0.22); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06); }
.ad-item.is-on svg { color: var(--ad-o); }
.ad-item.is-on small { display: block; }
.ad-prog { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--ad-o); opacity: 0; }
.ad-item.is-on .ad-prog { opacity: 1; }

/* screen */
.ad-screen { background: #fff; border: 1px solid var(--ad-line); border-radius: 18px; box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.ad-bar { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--ad-line); font-size: 0.85rem; color: var(--text-secondary); }
.ad-logo { width: 26px; height: 26px; border-radius: 8px; background: var(--ad-o); color: #fff; display: grid; place-items: center; font: 700 0.85rem var(--font-display); }
.ad-sys { font: 700 0.92rem var(--font-display); color: var(--text-primary); letter-spacing: 0.03em; }
.ad-dot { color: var(--text-muted); }
.ad-bar .ad-biz { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ad-tag { margin-left: auto; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ad-o); border: 1px solid rgba(255, 107, 0, 0.3); border-radius: 999px; padding: 2px 9px; }
.ad-stage { position: relative; flex: 1; min-height: 420px; padding: 26px; background: var(--ad-soft); display: flex; align-items: center; justify-content: center; }
.ad-scene { width: 100%; max-width: 640px; position: relative; }
.aiba-demo.ad-js .ad-scene { display: none; }
.aiba-demo.ad-js .ad-scene.is-on { display: block; animation: adIn .45s ease both; }
@keyframes adIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* step reveal */
.aiba-demo.ad-js [data-s] { opacity: 0; transform: translateY(6px); transition: opacity .45s ease, transform .45s ease; }
.aiba-demo.ad-js [data-s].on { opacity: 1; transform: none; }

/* shared parts */
.ad-card { background: #fff; border: 1px solid var(--ad-line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05); text-align: left; min-width: 0; }
.ad-wide { width: 100%; }
.ad-split { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 18px; align-items: center; }
.ad-person { display: flex; gap: 12px; align-items: center; }
.ad-person small, .ad-head small { display: block; color: var(--text-secondary); font-size: 0.8rem; }
.ad-av { width: 38px; height: 38px; border-radius: 50%; background: rgba(0, 98, 255, 0.1); color: var(--accent-blue); display: grid; place-items: center; font: 700 0.8rem var(--font-display); }
.ad-row, .ad-kv { display: flex; justify-content: space-between; gap: 12px; font-size: 0.86rem; color: var(--text-secondary); }
.ad-kv b, .ad-row code { color: var(--text-primary); font-weight: 600; text-align: right; }
.ad-row { padding: 10px 12px; border-radius: 10px; background: var(--ad-soft); align-items: center; }
.ad-row code, .ad-note code { font-family: var(--font-mono); font-size: 0.8rem; }
.ad-new { background: rgba(245, 158, 11, 0.1); box-shadow: inset 3px 0 0 #f59e0b; }
.ad-note { margin: 0; font-size: 0.85rem; color: var(--text-secondary); }
.ad-pill { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 7px 12px; border-radius: 999px; font-size: 0.84rem; font-weight: 600; }
.ad-pill svg { width: 15px; height: 15px; }
.ad-amber { background: rgba(245, 158, 11, 0.12); color: var(--ad-warn); }
.ad-green { background: rgba(16, 185, 129, 0.12); color: var(--ad-good); }
.ad-good { color: var(--ad-good) !important; }
.ad-warn { color: var(--ad-warn); }
.ad-actions, .ad-foot { display: flex; gap: 8px; align-items: center; }
.ad-foot { justify-content: space-between; font-size: 0.84rem; color: var(--text-secondary); padding-top: 4px; border-top: 1px dashed var(--ad-line); }
.ad-btn { display: inline-block; padding: 7px 16px; border-radius: 8px; border: 1px solid var(--ad-line); font-size: 0.84rem; font-weight: 600; color: var(--text-primary); background: #fff; }
.ad-btn-go { background: var(--ad-o); border-color: var(--ad-o); color: #fff; }
.ad-srcname { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 4px; }
.ad-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ad-head b { font-family: var(--font-display); }

/* 1 bank: the text floats over the card's corner */
.ad-float { position: absolute; right: -6px; bottom: -14px; width: min(290px, 70%); }
.ad-sms { background: #0f172a; color: #e2e8f0; border-radius: 16px; padding: 14px 16px; box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25); font-size: 0.84rem; }
.ad-sms p { margin: 6px 0 8px; line-height: 1.45; color: #fff; }
.ad-sms small { color: #94a3b8; font-size: 0.74rem; display: flex; gap: 6px; align-items: center; }
.ad-sms .ad-ok { color: #6ee7b7; }
.ad-sms svg { width: 13px; height: 13px; }

/* 2 ABN */
.ad-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.ad-search { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid rgba(255, 107, 0, 0.35); border-radius: 10px; font-size: 0.95rem; min-height: 44px; }
.ad-search svg { width: 17px; height: 17px; color: var(--text-muted); }
.aiba-demo.ad-js .ad-search .ad-type { opacity: 1; transform: none; }
.ad-caret { width: 2px; height: 18px; background: var(--ad-o); animation: adBlink 1s steps(1) infinite; margin-left: -8px; }
@keyframes adBlink { 50% { opacity: 0; } }
.ad-drop { padding: 10px 14px; border-radius: 10px; background: rgba(255, 107, 0, 0.06); border: 1px solid rgba(255, 107, 0, 0.18); display: flex; flex-direction: column; font-size: 0.9rem; }
.ad-drop small { color: var(--text-secondary); font-size: 0.78rem; }
.ad-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ad-src { display: flex; flex-direction: column; gap: 7px; padding: 12px; border-radius: 10px; background: var(--ad-soft); }

/* 3 receipt and 5 QR poster: a scan line passes over them */
.ad-receipt, .ad-poster { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--ad-line); border-radius: 6px; padding: 18px 16px; font-family: var(--font-mono); font-size: 0.78rem; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08); transform: rotate(-1.5deg); }
.ad-receipt hr { border: 0; border-top: 1px dashed var(--ad-line); margin: 4px 0; width: 100%; }
.ad-receipt small, .ad-poster small { color: var(--text-secondary); }
.ad-scanline { position: absolute; left: 0; right: 0; top: -10%; height: 34px; background: linear-gradient(180deg, rgba(255, 107, 0, 0), rgba(255, 107, 0, 0.22), rgba(255, 107, 0, 0)); border-bottom: 2px solid rgba(255, 107, 0, 0.7); opacity: 0; pointer-events: none; }
.ad-scene.s1 .ad-scanline { animation: adScan 1.3s ease-in-out 1 forwards; }
@keyframes adScan { 0% { top: -10%; opacity: 1; } 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
.ad-convert { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--ad-soft); font-size: 0.9rem; }
.ad-convert svg { width: 15px; height: 15px; color: var(--ad-o); }
.ad-convert small { flex-basis: 100%; color: var(--text-secondary); font-size: 0.78rem; }
.ad-ask { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ad-ask small { flex-basis: 100%; font-weight: 600; color: var(--text-primary); font-size: 0.86rem; }
.ad-chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--ad-line); font-size: 0.82rem; transition: background .3s, color .3s, border-color .3s; }
.ad-scene.s5 .ad-pick { background: var(--ad-o); border-color: var(--ad-o); color: #fff; }

/* 4 payment gates */
.ad-stage-row { padding: 12px 14px; border-radius: 10px; background: var(--ad-soft); display: flex; flex-direction: column; gap: 8px; transition: background .4s, box-shadow .4s; }
.ad-st-top { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9rem; }
.ad-st-top b { display: inline-flex; align-items: center; gap: 6px; }
.ad-st-top svg { width: 15px; height: 15px; }
.ad-st-amt { font-weight: 600; color: var(--text-secondary); }
.ad-meter { height: 8px; border-radius: 99px; background: rgba(15, 23, 42, 0.08); overflow: hidden; }
.ad-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--ad-o); transition: width 1s ease, background .4s; }
.ad-gates.s1 .ad-fill { width: 25%; }
.ad-gates.s3 .ad-fill { width: 100%; background: var(--ad-good); }
.ad-st-msg { font-size: 0.8rem; color: var(--text-secondary); }
.ad-st-msg .ad-full, .ad-unlock-i { display: none; }
.ad-gates.s3 .ad-st1 .ad-part { display: none; }
.ad-gates.s3 .ad-st1 .ad-full { display: inline; color: var(--ad-good); font-weight: 600; }
.ad-locked { color: var(--text-muted); }
.ad-locked .ad-st-top b { color: var(--text-secondary); }
.ad-gates.s4 .ad-st2 { background: rgba(16, 185, 129, 0.08); box-shadow: inset 3px 0 0 var(--ad-good); }
.ad-gates.s4 .ad-st2 .ad-lock-i, .ad-gates.s4 .ad-st2 .ad-part { display: none; }
.ad-gates.s4 .ad-st2 .ad-unlock-i { display: inline-flex; color: var(--ad-good); }
.ad-gates.s4 .ad-st2 .ad-full { display: inline; font-weight: 600; }
.ad-gates.s4 .ad-st2 .ad-st-top b { color: var(--text-primary); }
.ad-lock-i { display: inline-flex; }
.ad-gates.s4 .ad-hold { display: none; }

/* 5 QR */
.ad-poster { align-items: center; text-align: center; font-family: var(--font-body); padding: 20px; }
.ad-poster b { font-family: var(--font-display); font-size: 0.95rem; }
.ad-qr { width: 120px; height: 120px; display: grid; grid-template-columns: repeat(21, 1fr); gap: 0; }
.ad-qr i { background: #0f172a; }
.ad-qr i.o { background: transparent; }
.ad-att { display: flex; flex-direction: column; gap: 6px; }
.ad-arow { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 10px; align-items: center; font-size: 0.82rem; color: var(--text-secondary); padding: 8px 10px; border-radius: 8px; background: var(--ad-soft); }
.ad-arow b { color: var(--text-primary); font-weight: 600; }
.ad-auto { font-style: italic; }

/* 6 BAS */
.ad-boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ad-box { padding: 12px; border-radius: 10px; background: var(--ad-soft); border: 1px solid transparent; display: flex; flex-direction: column; gap: 6px; transition: border-color .3s, box-shadow .3s; }
.ad-box small { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.3; }
.ad-box b { font: 700 1.05rem var(--font-display); font-variant-numeric: tabular-nums; }
.ad-scene.s2 .ad-g1 { border-color: var(--ad-o); box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.12); }
.ad-behind { display: flex; flex-direction: column; gap: 6px; }
.ad-more { font-size: 0.78rem; color: var(--text-muted); padding-left: 10px; }

/* 7 messages */
.ad-phone { background: #0f172a; border-radius: 26px; padding: 14px 12px 18px; min-height: 280px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22); }
.ad-phone-top { text-align: center; color: #fff; padding-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.ad-phone-top b { display: block; font: 600 0.88rem var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-phone-top small { color: #94a3b8; font-size: 0.72rem; }
.ad-bubble { align-self: flex-start; max-width: 92%; background: #1e293b; color: #f1f5f9; padding: 10px 12px; border-radius: 14px 14px 14px 4px; font-size: 0.82rem; line-height: 1.45; }
.ad-facts { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--text-secondary); }

.ad-caption { text-align: center; margin: 14px 0 0; font-size: 0.78rem; color: var(--text-muted); }

/* tablet and phone: scenes become a row of chips above the screen */
@media (max-width: 900px) {
  .ad-player { grid-template-columns: 1fr; }
  .ad-list { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .ad-list::-webkit-scrollbar { display: none; }
  .ad-list li { flex: 0 0 auto; }
  .ad-item { padding: 8px 12px; border-color: var(--ad-line); background: #fff; align-items: center; }
  .ad-item b { font-size: 0.82rem; white-space: nowrap; }
  .ad-item.is-on small { display: none; }
}
@media (max-width: 640px) {
  .ad-stage { padding: 16px; min-height: 0; align-items: flex-start; }
  .ad-split, .ad-grid2 { grid-template-columns: 1fr; }
  .ad-boxes { grid-template-columns: 1fr 1fr; }
  .ad-receipt, .ad-poster { transform: none; }
  .ad-float { position: static; width: auto; margin-top: 12px; }
  .ad-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .ad-row code { text-align: left; }
  .ad-arow { grid-template-columns: 1fr auto; }
  .ad-arow span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .ad-qr { width: 96px; height: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  .aiba-demo.ad-js [data-s] { transition: none; }
  .ad-scanline, .ad-caret { display: none; }
  .aiba-demo.ad-js .ad-scene.is-on { animation: none; }
  .ad-fill { transition: none; }
}

/* ===== Inside AIBA: product screens redrawn with sample data (#inside-aiba) ===== */
.aiba-inside { --ad-o: var(--accent-orange, #ff6b00); --ai-navy: #0b2a66; --ai-line: rgba(15, 23, 42, 0.09); --ai-soft: #f4f6fa; --ai-good: #059669; --ai-amber: #d97706; --ai-red: #dc2626; }
.aiba-inside .ad-badge { border-color: rgba(255, 107, 0, 0.25); color: var(--accent-orange); margin-bottom: 12px; }
.ai-intro { max-width: 640px; margin: 0 auto; }
.ai-tabs { display: flex; gap: 4px; margin: 30px auto 18px; overflow-x: auto; scrollbar-width: none; width: max-content; max-width: 100%; padding: 2px; }
.ai-tabs::-webkit-scrollbar { display: none; }
.ai-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--ai-line); background: #fff; color: var(--text-secondary); font: 600 0.84rem var(--font-display); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.ai-tab svg { width: 16px; height: 16px; }
.ai-tab:hover { color: var(--text-primary); }
.ai-tab:focus-visible { outline: 2px solid var(--accent-orange); outline-offset: 2px; }
.ai-tab.is-on { background: var(--ai-navy); border-color: var(--ai-navy); color: #fff; }
.ai-lead { text-align: center; max-width: 640px; margin: 0 auto 18px; color: var(--text-secondary); font-size: 0.95rem; }
.ai-pane.is-on { animation: adIn .4s ease both; }

.ai-win { background: #fff; border: 1px solid var(--ai-line); border-radius: 18px; box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08); overflow: hidden; text-align: left; }
.ai-winbar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--ai-line); font-size: 0.86rem; flex-wrap: wrap; }
.ai-winbar > b { font-family: var(--font-display); color: var(--text-primary); }
.ai-winbar > small { color: var(--text-secondary); }
.ai-winbar .ai-badge, .ai-winbar .ai-seg { margin-left: auto; }
.ai-nav { display: flex; gap: 16px; font-size: 0.86rem; color: var(--text-secondary); }
.ai-nav b { color: var(--ai-navy); box-shadow: inset 0 -2px 0 var(--ai-navy); padding-bottom: 2px; }
.ai-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--ai-soft); font-size: 0.75rem; }
.ai-seg > * { padding: 3px 10px; border-radius: 999px; color: var(--text-secondary); font-weight: 600; }
.ai-seg b { background: var(--ai-navy); color: #fff; }
.ai-body { padding: 20px; background: #fafbfd; display: flex; flex-direction: column; gap: 16px; }

.ai-badge { display: inline-block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.ai-b-green { background: rgba(16, 185, 129, 0.12); color: var(--ai-good); }
.ai-b-amber { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.ai-b-red { background: rgba(239, 68, 68, 0.12); color: var(--ai-red); }
.ai-good { color: var(--ai-good) !important; }
.ai-bad { color: var(--ai-red) !important; }
.ai-warn { color: #b45309 !important; }
.ai-muted { color: var(--text-muted); font-size: 0.76rem; display: inline-flex; align-items: center; gap: 5px; }
.ai-muted svg { width: 13px; height: 13px; }

/* projects: milestone chevrons fill in turn */
.ai-chevs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.ai-chev { position: relative; padding: 10px 22px 10px 16px; color: #fff; background: #cbd5e1; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 10px 50%); display: flex; flex-direction: column; gap: 1px; min-width: 0; transition: background .5s ease calc(var(--d) * 160ms); }
.ai-chev:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); border-radius: 8px 0 0 8px; }
.ai-chev small { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: .85; }
.ai-chev b { font: 600 0.92rem var(--font-display); }
.ai-chev span { font-size: 0.8rem; opacity: .95; }
.ai-pane.go .ai-paid { background: #0f8a5f; }
.ai-pane.go .ai-live { background: #e07a10; }
.ai-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }
.ai-cols-even { grid-template-columns: 1fr 1fr; }
.ai-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ai-mini { background: #fff; border: 1px solid var(--ai-line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ai-mini h4, .ai-advisor h4 { margin: 0; display: flex; align-items: center; gap: 7px; font: 700 0.72rem var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.ai-mini h4 svg, .ai-advisor h4 svg { width: 15px; height: 15px; color: var(--ai-navy); }
.ai-mini h4 em { margin-left: auto; font-style: normal; background: var(--ai-soft); border-radius: 99px; padding: 1px 8px; color: var(--text-primary); }
.ai-big { font: 700 1.4rem var(--font-display); color: var(--ai-navy); }
.ai-kv { display: flex; justify-content: space-between; gap: 8px; font-size: 0.8rem; color: var(--text-secondary); }
.ai-kv b { color: var(--text-primary); font-weight: 600; white-space: nowrap; }
.ai-meter { height: 6px; border-radius: 99px; background: var(--ai-soft); overflow: hidden; }
.ai-meter span, .ai-track i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 1s cubic-bezier(.2, .7, .2, 1) .2s; }
.ai-meter span { background: var(--ai-good); }
.ai-pane.go .ai-meter span, .ai-pane.go .ai-track i { width: var(--w); }
.ai-advisor { background: var(--ai-navy); color: #e2e8f0; border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ai-advisor h4 { color: #c7d2fe; }
.ai-advisor h4 svg { color: #fbbf24; }
.ai-advisor ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.84rem; line-height: 1.45; color: #fff; }
.ai-advisor li { opacity: 0; transform: translateY(4px); transition: opacity .4s ease, transform .4s ease; }
.ai-pane.go .ai-advisor li { opacity: 1; transform: none; }
.ai-pane.go .ai-advisor li:nth-child(1) { transition-delay: .6s; }
.ai-pane.go .ai-advisor li:nth-child(2) { transition-delay: 1.2s; }
.ai-pane.go .ai-advisor li:nth-child(3) { transition-delay: 1.8s; }
.ai-advisor .ai-muted { color: #94a3b8; }
.ai-ask { margin-top: auto; display: flex; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, 0.08); border-radius: 10px; padding: 9px 12px; font-size: 0.8rem; color: #cbd5e1; }
.ai-ask svg { width: 16px; height: 16px; color: #fff; }

/* commercials */
.ai-recon { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--ai-good); font-weight: 600; }
.ai-recon svg { width: 16px; height: 16px; }
.ai-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.ai-kpis > div { background: #fff; border: 1px solid var(--ai-line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.ai-kpis small { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.ai-kpis b { font: 700 1.2rem var(--font-display); color: var(--ai-navy); font-variant-numeric: tabular-nums; }
.ai-kpis em { font-style: normal; font-size: 0.74rem; color: var(--text-muted); }
.ai-bars { display: flex; flex-direction: column; gap: 10px; }
.ai-barrow, .ai-cat { display: grid; grid-template-columns: 90px 1fr 80px; gap: 12px; align-items: center; font-size: 0.82rem; color: var(--text-secondary); }
.ai-barrow b, .ai-cat b { text-align: right; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ai-track { height: 8px; border-radius: 99px; background: #e9edf3; overflow: hidden; }
.ai-navy { background: var(--ai-navy); }
.ai-amber { background: #f59e0b; }
.ai-green { background: #10b981; }
.ai-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--ai-line); border-radius: 12px; }
.ai-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; font-variant-numeric: tabular-nums; }
.ai-table th { text-align: right; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); padding: 10px 14px; border-bottom: 1px solid var(--ai-line); white-space: nowrap; }
.ai-table td { text-align: right; padding: 10px 14px; border-bottom: 1px solid var(--ai-line); color: var(--text-primary); white-space: nowrap; }
.ai-table th:first-child, .ai-table td:first-child { text-align: left; }
.ai-table tr:last-child td { border-bottom: 0; }
.ai-table td .ai-badge { margin-left: 6px; vertical-align: 1px; }
.ai-flag td { background: rgba(245, 158, 11, 0.06); }
.ai-flag-red td { background: rgba(239, 68, 68, 0.06); }

/* money in and out */
.ai-strip { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 10px 14px; border-radius: 10px; background: #eef1f6; font-size: 0.8rem; color: var(--text-secondary); }
.ai-strip b { color: var(--text-primary); }
.ai-sub { margin: 4px 0 -6px; font: 700 0.72rem var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.ai-list { background: #fff; border: 1px solid var(--ai-line); border-radius: 12px; }
.ai-li { display: grid; grid-template-columns: 84px 1.4fr 90px 1.3fr 84px; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--ai-line); font-size: 0.83rem; opacity: 0; transform: translateX(-8px); transition: opacity .4s ease, transform .4s ease; }
.ai-li:last-child { border-bottom: 0; }
.ai-pane.go .ai-li { opacity: 1; transform: none; }
.ai-pane.go .ai-list .ai-li:nth-child(2) { transition-delay: .12s; }
.ai-pane.go .ai-list .ai-li:nth-child(3) { transition-delay: .24s; }
.ai-li code { font: 700 0.78rem var(--font-mono); color: var(--text-primary); }
.ai-li > b { text-align: right; font-variant-numeric: tabular-nums; }
.ai-li .ai-badge { justify-self: start; }
.ai-who { display: flex; flex-direction: column; color: var(--text-primary); min-width: 0; }
.ai-who small { color: var(--text-muted); font-size: 0.74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-steps { display: flex; align-items: center; }
.ai-steps i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 700 0.62rem var(--font-body); font-style: normal; border: 1.5px solid #cbd5e1; color: #94a3b8; background: #fff; position: relative; }
.ai-steps i + i { margin-left: 10px; }
.ai-steps i + i::before { content: ""; position: absolute; right: 100%; top: 50%; width: 11px; height: 1.5px; background: #cbd5e1; }
.ai-steps i.f { background: var(--ai-navy); border-color: var(--ai-navy); color: #fff; }
.ai-steps i.f + i::before { background: var(--ai-navy); }
.ai-steps i.p { border-color: #f59e0b; color: #d97706; }
.ai-ai { justify-self: start; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; border: 1px solid #c7d2fe; background: #f5f7ff; font-size: 0.74rem; color: var(--ai-navy); white-space: nowrap; }
.ai-ai b { color: var(--ai-good); }
.ai-ai svg { width: 13px; height: 13px; }
.ai-ai svg:last-child { color: var(--ai-good); }

/* pipeline: jobs float along the line, rings show progress */
.ai-pipe { --ph: 360px; --r: 26px; position: relative; height: var(--ph); padding: 0; background: linear-gradient(90deg, #f6f7f9 0 34%, #eef6f2 34% 100%); }
.ai-zones { position: absolute; top: 14px; left: 18px; right: 18px; display: grid; grid-template-columns: 11.3% 11.3% 11.3% 1fr; font: 700 0.7rem var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.ai-zone-live { color: #0f8a5f !important; padding-left: 4%; }
.ai-track-line { position: absolute; left: 18px; right: 18px; top: 50%; height: 10px; margin-top: -5px; border-radius: 99px; background: linear-gradient(90deg, #d5d9e0 0 34%, #a7dcc4 34% 100%); }
.ai-convert { position: absolute; left: 34%; top: 50%; transform: translate(-50%, -50%); background: #fff; border: 1px solid var(--ai-line); border-radius: 999px; padding: 4px 12px; font: 700 0.68rem var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-primary); white-space: nowrap; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08); }
.ai-done { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: inline-flex; gap: 6px; align-items: center; background: #fff; border: 1.5px solid #34d399; border-radius: 999px; padding: 5px 12px; font: 700 0.7rem var(--font-body); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ai-good); white-space: nowrap; }
.ai-done svg { width: 14px; height: 14px; }
.ai-node { position: absolute; left: var(--x); top: var(--y); width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 700 0.8rem var(--font-display); background: var(--c); box-shadow: 0 0 0 4px #fff, 0 6px 16px rgba(15, 23, 42, 0.18); animation: aiFloat 4.5s ease-in-out var(--t) infinite; }
.ai-node::after { content: ""; position: absolute; left: 50%; top: 100%; width: 0; height: calc(var(--ph) * .3 - var(--r)); border-left: 1.5px dashed #b6bdc8; }
.ai-node[style*="--y:7"]::after { top: auto; bottom: 100%; height: calc(var(--ph) * .2 - var(--r)); }
.ai-node em { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid var(--ai-line); border-radius: 99px; padding: 1px 7px; font: 700 0.66rem var(--font-body); font-style: normal; color: var(--text-primary); z-index: 1; }
.ai-n-live, .ai-n-due { background: conic-gradient(var(--ring) var(--p), rgba(255, 255, 255, 0.25) 0) border-box; }
.ai-n-live b, .ai-n-due b { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--c); }
.ai-n-cold { --c: #3b82f6; }
.ai-n-mid { --c: #f59e0b; }
.ai-n-hot { --c: #ea580c; }
.ai-n-live { --c: var(--ai-navy); --ring: #0b2a66; background: conic-gradient(#0b2a66 var(--p), #dfe4ec 0); }
.ai-n-due { --c: #b91c1c; background: conic-gradient(#b91c1c var(--p), #f3d3d3 0); }
@keyframes aiFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.ai-key { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 14px; background: #fff; border: 1px solid var(--ai-line); border-radius: 999px; padding: 6px 14px; font-size: 0.72rem; color: var(--text-secondary); white-space: nowrap; }
.ai-key span { display: inline-flex; align-items: center; gap: 5px; }
.ai-key i { width: 9px; height: 9px; border-radius: 50%; }
.k-cold { background: #3b82f6; } .k-mid { background: #f59e0b; } .k-hot { background: #ea580c; } .k-live { background: #0b2a66; } .k-due { background: #b91c1c; }

/* reports: check-in calendar */
.ai-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ai-cal i { aspect-ratio: 2.4; border-radius: 5px; background: #eceff4; font: 600 0.62rem var(--font-body); font-style: normal; color: #94a3b8; padding: 3px 4px; }
.ai-cal i.x { background: transparent; }
.ai-cal i.c1 { background: #a7f3d0; color: #065f46; }
.ai-cal i.c2 { background: #34d399; color: #064e3b; }
.ai-cal i.c3 { background: #059669; color: #fff; }
.ai-legend { display: flex; gap: 12px; font-size: 0.72rem; color: var(--text-secondary); }
.ai-legend span { display: inline-flex; gap: 5px; align-items: center; }
.ai-legend i { width: 10px; height: 10px; border-radius: 3px; }
.ai-legend .c1 { background: #a7f3d0; } .ai-legend .c2 { background: #34d399; } .ai-legend .c3 { background: #059669; }

@media (max-width: 980px) {
  .ai-cols, .ai-cols-even { grid-template-columns: 1fr; }
  .ai-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .ai-tabs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; scrollbar-width: none; }
  .ai-tab { flex: 0 0 auto; }
  .ai-chevs { grid-template-columns: repeat(5, minmax(96px, 1fr)); overflow-x: auto; }
  .ai-cards { grid-template-columns: 1fr; }
  .ai-kpis { grid-template-columns: 1fr 1fr; }
  .ai-li { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .ai-li code { grid-column: 1; }
  .ai-li > b { grid-column: 2; grid-row: 1; }
  .ai-li .ai-who { grid-column: 1 / -1; }
  .ai-li .ai-steps { grid-column: 1; }
  .ai-li .ai-badge, .ai-li .ai-ai { grid-column: 2; justify-self: end; }
  .ai-barrow, .ai-cat { grid-template-columns: 80px 1fr 64px; }
  .ai-pipe { --ph: 420px; --r: 21px; }
  .ai-node { width: 42px; height: 42px; margin: -21px 0 0 -21px; font-size: 0.7rem; }
  .ai-n-live b, .ai-n-due b { width: 34px; height: 34px; }
  .ai-key { flex-wrap: wrap; justify-content: center; white-space: normal; width: calc(100% - 28px); border-radius: 14px; }
  .ai-zones { font-size: 0.6rem; }
  .ai-winbar .ai-nav { overflow-x: auto; scrollbar-width: none; gap: 12px; min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-node { animation: none; }
  .ai-pane.is-on { animation: none; }
  .ai-li, .ai-advisor li { transition: none; }
  .ai-meter span, .ai-track i, .ai-chev { transition: none; }
}

/* Inside AIBA, second set: scope, timeline, people, sites and files */
.ai-scope { display: flex; flex-direction: column; gap: 10px; }
.ai-sc { background: #fff; border: 1px solid var(--ai-line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ai-sc-top, .ai-sc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 0.84rem; }
.ai-sc-top span { font-size: 0.78rem; font-weight: 700; }
.ai-sc-foot { color: var(--text-secondary); font-size: 0.78rem; }
.ai-sc-foot b { color: var(--text-primary); }
.ai-stg { display: flex; gap: 4px; }
.ai-stg i { font-style: normal; font-size: 0.7rem; border: 1px solid var(--ai-line); border-radius: 5px; padding: 1px 7px; color: var(--text-secondary); }
.ai-meter-lg { height: 8px; }
.ai-meter-live span { background: #f59e0b; }
.ai-works td small { color: var(--text-muted); font-size: 0.72rem; margin-left: 4px; }
.ai-works .ai-hl { background: rgba(11, 42, 102, 0.045); box-shadow: inset 1px 0 0 rgba(11, 42, 102, 0.25), inset -1px 0 0 rgba(11, 42, 102, 0.25); }
.ai-works .ai-gw { color: #2563eb; }
.ai-works .ai-total td { font-weight: 700; background: #eef3ff; border-top: 1.5px solid var(--ai-navy); }
.ai-works .ai-total td.ai-hl { background: #e3eafc; }
.ai-works .ai-sum td { color: var(--text-secondary); font-size: 0.8rem; padding-top: 7px; padding-bottom: 7px; }
.ai-works .ai-sum td:first-child { padding-left: 26px; }

/* timeline */
.ai-zoom { margin-left: auto; display: inline-flex; gap: 10px; color: var(--text-secondary); }
.ai-zoom svg { width: 16px; height: 16px; }
.ai-tl-body { gap: 12px; }
.ai-tl { overflow-x: auto; background: #fff; border: 1px solid var(--ai-line); border-radius: 12px; cursor: grab; scrollbar-width: thin; }
.ai-tl:active { cursor: grabbing; }
.ai-tl:focus-visible { outline: 2px solid var(--accent-orange); outline-offset: 2px; }
.ai-tl-inner { position: relative; min-width: 1320px; padding: 34px 0 10px; background-image: repeating-linear-gradient(90deg, transparent 0 calc(3% - 1px), #eef1f5 calc(3% - 1px) 3%); background-position: 120px 0; }
.ai-tl-axis { position: absolute; left: 120px; right: 0; top: 10px; height: 16px; font-size: 0.7rem; color: var(--text-muted); }
.ai-tl-axis span, .ai-lane .ai-dot, .ai-today { position: absolute; left: var(--x); }
.ai-tl-axis span { transform: translateX(-50%); white-space: nowrap; }
.ai-lane { position: relative; height: 44px; border-top: 1px solid #eef1f5; margin-left: 120px; }
.ai-lane > b { position: absolute; right: 100%; width: 120px; top: 0; bottom: 0; display: flex; align-items: center; gap: 7px; padding-left: 14px; font: 700 0.68rem var(--font-body); letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-secondary); background: #fff; }
.ai-lane > b svg { width: 14px; height: 14px; color: var(--ai-navy); }
.ai-dot { top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25); transform: scale(0); transition: transform .35s cubic-bezier(.3, 1.6, .5, 1) calc(var(--n) * 90ms); }
.ai-pane.go .ai-dot { transform: scale(1); }
.ai-d-flag, .k-flag { background: #64748b; }
.ai-d-live { background: #e07a10; box-shadow: 0 0 0 4px rgba(224, 122, 16, 0.2); }
.ai-d-in, .k-in { background: #10b981; }
.ai-d-out, .k-out { background: #f59e0b; }
.ai-d-act, .k-act { background: var(--ai-navy); }
.ai-d-msg, .k-msg { background: #8b5cf6; }
.ai-today { top: 24px; bottom: 0; margin-left: 120px; border-left: 1.5px dashed #e07a10; font-size: 0.66rem; font-weight: 700; color: #e07a10; padding-left: 4px; text-transform: uppercase; letter-spacing: 0.06em; }
.ai-today { left: calc(120px + (100% - 120px) * 0.93); margin-left: 0; }
.ai-key-static { position: static; transform: none; align-self: center; }

/* people */
.ai-cols-people { grid-template-columns: 1fr 1.25fr; }
.ai-filter { display: flex; gap: 14px; font-size: 0.8rem; color: var(--text-secondary); border-bottom: 1px solid var(--ai-line); padding-bottom: 6px; }
.ai-filter b { color: var(--ai-navy); box-shadow: 0 8px 0 -6px var(--ai-navy); }
.ai-person { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid #f1f3f7; opacity: 0; transform: translateY(4px); transition: opacity .35s ease, transform .35s ease; }
.ai-person:last-child { border-bottom: 0; }
.ai-pane.go .ai-person { opacity: 1; transform: none; }
.ai-pane.go .ai-person:nth-of-type(2) { transition-delay: .08s; } .ai-pane.go .ai-person:nth-of-type(3) { transition-delay: .16s; } .ai-pane.go .ai-person:nth-of-type(4) { transition-delay: .24s; } .ai-pane.go .ai-person:nth-of-type(5) { transition-delay: .32s; } .ai-pane.go .ai-person:nth-of-type(6) { transition-delay: .4s; }
.ai-person > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; font-size: 0.84rem; }
.ai-person small { color: var(--text-muted); font-size: 0.74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-av { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font: 700 0.78rem var(--font-display); }
.ai-av-blue { background: #dbeafe; color: #1e3a8a; } .ai-av-amber { background: #fef3c7; color: #92400e; } .ai-av-green { background: #d1fae5; color: #065f46; } .ai-av-violet { background: #ede9fe; color: #5b21b6; }
.ai-tag { font-style: normal; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 7px; border-radius: 5px; }
.t-client { background: #dbeafe; color: #1e40af; } .t-supplier { background: #e2e8f0; color: #334155; } .t-prospect { background: #d1fae5; color: #047857; } .t-partner { background: #ede9fe; color: #6d28d9; }
.ai-h-note { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-muted); }
.ai-ref { display: flex; flex-direction: column; gap: 8px; }
.ai-ref-row { display: grid; grid-template-columns: 1fr 16px 1fr 40px auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; background: var(--ai-soft); font-size: 0.82rem; }
.ai-ref-row > span:not(.ai-badge):not(.ai-pct) { display: flex; flex-direction: column; min-width: 0; }
.ai-ref-row b { color: var(--ai-navy); }
.ai-ref-row small { color: var(--text-muted); font-size: 0.72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-ref-row svg { width: 15px; height: 15px; color: var(--text-muted); }
.ai-pct { font-weight: 700; text-align: right; }
.ai-commission { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px dashed #a7f3d0; background: #f0fdf7; font-size: 0.82rem; color: var(--text-secondary); }
.ai-commission svg { flex: 0 0 18px; width: 18px; height: 18px; color: var(--ai-good); }

/* sites and files */
.ai-site { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--ai-soft); }
.ai-site > span:first-child { display: flex; flex-direction: column; font-size: 0.84rem; }
.ai-site small { color: var(--text-secondary); font-size: 0.75rem; }
.ai-site-act { display: flex; gap: 10px; color: var(--ai-good); }
.ai-site-act svg { width: 16px; height: 16px; }
.ai-map { width: 100%; height: auto; border-radius: 10px; display: block; }
.ai-pin { transform-box: fill-box; transform-origin: 50% 100%; }
.ai-pane.go .ai-pin { animation: aiDrop .7s cubic-bezier(.3, 1.4, .5, 1) .2s both; }
@keyframes aiDrop { 0% { transform: translateY(-40px); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
.ai-folders { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-folders span { display: inline-flex; gap: 5px; align-items: center; font-size: 0.76rem; padding: 4px 9px; border-radius: 7px; background: var(--ai-soft); color: var(--text-secondary); }
.ai-folders span.is-on { background: #e3eafc; color: var(--ai-navy); font-weight: 600; }
.ai-folders svg { width: 14px; height: 14px; }
.ai-file { display: grid; grid-template-columns: 18px 1fr auto; gap: 9px; align-items: center; font-size: 0.82rem; padding: 6px 0; border-bottom: 1px solid #f1f3f7; }
.ai-file svg { width: 16px; height: 16px; color: var(--text-secondary); }
.ai-file small { color: var(--text-muted); font-size: 0.74rem; }
.ai-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 980px) {
  .ai-cols-people { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .ai-ref-row { grid-template-columns: 1fr 14px 1fr; }
  .ai-ref-row .ai-pct, .ai-ref-row .ai-badge { grid-row: 2; }
  .ai-ref-row .ai-pct { grid-column: 1; text-align: left; }
  .ai-ref-row .ai-badge { grid-column: 3; justify-self: end; }
  .ai-sc-foot { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-dot, .ai-person { transition: none; }
  .ai-pane.go .ai-pin { animation: none; }
}

.ai-tl-wrap { position: relative; }
.ai-tl-labels { position: absolute; left: 1px; top: 1px; width: 120px; padding-top: 33px; background: #fff; border-radius: 12px 0 0 0; z-index: 2; pointer-events: none; box-shadow: 1px 0 0 #e5e9f0, 6px 0 10px -6px rgba(15, 23, 42, 0.12); }
.ai-tl-labels b { height: 44px; border-top: 1px solid #eef1f5; display: flex; align-items: center; gap: 7px; padding-left: 14px; font: 700 0.68rem var(--font-body); letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-secondary); }
.ai-tl-labels svg { width: 14px; height: 14px; color: var(--ai-navy); }
.ai-tl-wrap .ai-lane > b { visibility: hidden; }
@media (max-width: 720px) {
  .ai-tl-labels { width: 92px; }
  .ai-tl-labels b { font-size: 0.6rem; padding-left: 8px; gap: 5px; }
}

/* Shaped to your business: a two-column settings list */
.ab-shape { list-style: none; margin: 40px auto 0; padding: 0; max-width: 980px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.ab-shape li { display: flex; gap: 14px; align-items: flex-start; padding: 18px 4px; border-top: 1px solid rgba(15, 23, 42, 0.08); }
.ab-shape li svg { flex: 0 0 22px; width: 22px; height: 22px; color: var(--accent-orange); margin-top: 2px; }
.ab-shape span { display: flex; flex-direction: column; gap: 3px; font-size: 0.93rem; color: var(--text-secondary); line-height: 1.5; }
.ab-shape b { font: 600 1rem var(--font-display); color: var(--text-primary); }
@media (max-width: 720px) { .ab-shape { grid-template-columns: 1fr; } }

/* clickable window nav (Receivables, Payables, Commercials, BAS) */
.ai-navbtn { background: none; border: 0; padding: 2px 0; font: inherit; font-size: 0.86rem; color: var(--text-secondary); cursor: pointer; white-space: nowrap; transition: color .2s, box-shadow .2s; }
.ai-navbtn:hover { color: var(--text-primary); }
.ai-navbtn:focus-visible { outline: 2px solid var(--accent-orange); outline-offset: 3px; border-radius: 3px; }
.ai-navbtn.is-on { color: var(--ai-navy); font-weight: 700; box-shadow: inset 0 -2px 0 var(--ai-navy); }
.ai-view { display: flex; flex-direction: column; gap: 16px; }
.ai-view[hidden] { display: none; }
.ai-view.is-in { animation: adIn .35s ease both; }
.ai-b-blue { background: rgba(0, 98, 255, 0.1); color: #1d4ed8; }
.ai-kpis-4 { grid-template-columns: repeat(4, 1fr); }
.ai-bas-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--ai-line); font-size: 0.88rem; color: var(--text-secondary); }
.ai-bas-foot b { color: var(--ai-navy); font: 700 1.1rem var(--font-display); margin-left: 6px; }
@media (max-width: 720px) { .ai-kpis-4 { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .ai-view.is-in { animation: none; } }

/* People: directory filter, leads */
.ai-fbtn { background: none; border: 0; padding: 0 0 2px; font: inherit; font-size: 0.8rem; color: var(--text-secondary); cursor: pointer; }
.ai-fbtn:hover { color: var(--text-primary); }
.ai-fbtn:focus-visible { outline: 2px solid var(--accent-orange); outline-offset: 3px; border-radius: 3px; }
.ai-fbtn.is-on { color: var(--ai-navy); font-weight: 700; box-shadow: 0 8px 0 -6px var(--ai-navy); }
.ai-dir-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.ai-dir-grid .ai-person[hidden] { display: none; }
.ai-leads { display: flex; flex-direction: column; gap: 10px; }
.ai-lead-card { background: #fff; border: 1px solid var(--ai-line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ai-lead-card.ai-hot { border-color: rgba(234, 88, 12, 0.35); box-shadow: inset 3px 0 0 #ea580c; }
.ai-lead-top { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; }
.ai-lead-top > span:nth-child(2) { display: flex; flex-direction: column; font-size: 0.86rem; }
.ai-lead-top small { color: var(--text-muted); font-size: 0.75rem; }
.ai-lead-card p { margin: 0; display: flex; gap: 7px; align-items: flex-start; font-size: 0.82rem; color: var(--text-secondary); }
.ai-lead-card p svg { flex: 0 0 14px; width: 14px; height: 14px; color: #d97706; margin-top: 2px; }
.ai-lead-card p b { color: var(--text-primary); }
.ai-temp { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.ai-temp svg { width: 13px; height: 13px; }
.t-hot { background: #ffedd5; color: #c2410c; } .t-mid { background: #fef3c7; color: #b45309; } .t-cold { background: #dbeafe; color: #1d4ed8; }
@media (max-width: 720px) { .ai-dir-grid { grid-template-columns: 1fr; } .ai-filter { overflow-x: auto; scrollbar-width: none; } }

/* working controls: GST and period switches, zoom, folders, ask box */
.ai-seg button { border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; padding: 3px 10px; border-radius: 999px; color: var(--text-secondary); transition: background .2s, color .2s; }
.ai-seg button:hover { color: var(--text-primary); }
.ai-seg button.is-on { background: var(--ai-navy); color: #fff; }
.ai-seg button:focus-visible, .ai-zoom button:focus-visible, .ai-ask:focus-visible, .ai-folders button:focus-visible { outline: 2px solid var(--accent-orange); outline-offset: 2px; }
.ai-gstnote { margin-top: -8px; }
.ai-zoom button { border: 0; background: none; padding: 4px; border-radius: 6px; color: var(--text-secondary); cursor: pointer; display: grid; place-items: center; }
.ai-zoom button:hover { background: var(--ai-soft); color: var(--text-primary); }
.ai-zoom button:disabled { opacity: .35; cursor: default; background: none; }
.ai-tl-inner { transition: min-width .35s ease; }
.ai-folders button { display: inline-flex; gap: 5px; align-items: center; font: inherit; font-size: 0.76rem; padding: 4px 9px; border-radius: 7px; border: 0; background: var(--ai-soft); color: var(--text-secondary); cursor: pointer; }
.ai-folders button:hover { color: var(--text-primary); }
.ai-folders button.is-on { background: #e3eafc; color: var(--ai-navy); font-weight: 600; }
.ai-folders svg { width: 14px; height: 14px; }
.ai-filelist { display: flex; flex-direction: column; min-height: 168px; }
.ai-filelist .ai-file { animation: adIn .3s ease both; }
button.ai-ask { width: 100%; border: 1px solid rgba(255, 255, 255, 0.14); font: inherit; font-size: 0.8rem; cursor: pointer; text-align: left; transition: background .2s, border-color .2s; }
button.ai-ask:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.3); color: #fff; }
.ai-q { margin: 0; align-self: flex-end; max-width: 90%; background: rgba(255, 255, 255, 0.12); color: #fff; padding: 7px 11px; border-radius: 12px 12px 4px 12px; font-size: 0.8rem; }
.ai-answer.is-new li { animation: aiLi .4s ease both; transition: none; }
.ai-answer.is-new li:nth-child(1) { animation-delay: .35s; } .ai-answer.is-new li:nth-child(2) { animation-delay: .8s; } .ai-answer.is-new li:nth-child(3) { animation-delay: 1.25s; }
@keyframes aiLi { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ai-rep tbody tr { animation: adIn .3s ease both; }
@media (prefers-reduced-motion: reduce) { .ai-answer.is-new li { animation: none; opacity: 1; transform: none; } .ai-rep tbody tr, .ai-filelist .ai-file { animation: none; } .ai-tl-inner { transition: none; } }

/* ===== Dark mode (html[data-theme="dark"]) =====
   Design: docs/plans/dark-mode-design-system.md (section d, the DARK APP WINDOW). Tokens, stage and window hooks live in styles.css.
   Every AIBA screen is a real dark app window: frame --dk-edge, body s2, title bar and panels s3, named recesses s1; hover and
   selected are tints, never a fourth level. No white, no shadows, no glows. Light mode is untouched (every rule is dark-only). */

/* ---- 1. Window scope: frame, body, and the page's own light custom properties re-pointed ----
   `.aiba-demo` / `.aiba-inside` define --ad-o etc. with light literals and var(--accent-orange): a var() is resolved where it is
   declared, so the window must re-declare them. (--accent-* are already the soft tints inside .ad-screen/.ai-win, styles.css section 9.) */
:root[data-theme="dark"] :is(.ad-screen,.ai-win){
  color-scheme:dark;
  background:var(--dk-s2); border-color:var(--dk-edge); box-shadow:inset 0 1px 0 var(--dk-edge-hi); color:var(--text-primary);
  --ad-o:var(--orange-text); --ad-line:var(--dk-line-3); --ad-soft:rgba(150,175,230,.07); --ad-good:var(--green-text); --ad-warn:var(--amber-text);
  --ai-navy:var(--blue-text); --ai-line:var(--dk-line-3); --ai-soft:rgba(150,175,230,.07);
  --ai-good:var(--green-text); --ai-amber:var(--amber-text); --ai-red:var(--red-text);
  /* solid fill that carries light ink */
  --n-live:#183d86;
}
:root[data-theme="dark"] :is(.ad-screen,.ai-win) :focus-visible{ outline-color:var(--dk-focus); }
/* mono values in the app windows are plain text, not chips (light has no chip here); (0,3,1) beats the foundation code rule (0,2,2) */
:root[data-theme="dark"] :is(.ad-screen,.ai-win,.aq) code{ background:transparent; border:0; border-radius:0; padding:0; color:var(--text-primary); }
:root[data-theme="dark"] .ad-note code{ color:var(--text-secondary); }
:root[data-theme="dark"] :is(.ad-bar,.ai-winbar){ background:var(--dk-s3); border-bottom-color:var(--dk-line-3); }
:root[data-theme="dark"] .ad-stage{ background:var(--dk-s2); }
:root[data-theme="dark"] .ai-body{ background:var(--dk-s2); }

/* ---- 2. Demo chrome on the band (#aiba-presentation-suite is .service-alt, a band = s1) ---- */
/* the name box is a field on the band: recess (canvas) with a --dk-control edge; focus is the global blue ring, no glow */
:root[data-theme="dark"] .ad-namebox input{ background:var(--dk-canvas); border-color:var(--dk-control); color:var(--text-primary); }
:root[data-theme="dark"] .ad-namebox input:focus{ border-color:var(--blue-text); outline:2px solid var(--dk-focus); outline-offset:0; box-shadow:none; }
:root[data-theme="dark"] .ad-namebox label{ color:var(--text-secondary); }
:root[data-theme="dark"] .ad-born strong{ color:var(--orange-text); }
/* the list: transparent rows, the chosen row is a lifted card with an orange-tint edge (this page's accent) */
:root[data-theme="dark"] .ad-item:hover{ background:rgba(150,175,230,.06); }
:root[data-theme="dark"] .ad-item.is-on{ background:var(--dk-s3); border-color:rgba(243,157,94,.30); box-shadow:inset 0 1px 0 var(--dk-light-top); }
:root[data-theme="dark"] .ad-item.is-on svg{ color:var(--orange-text); }
:root[data-theme="dark"] .ad-prog{ background:var(--orange-text); }
@media (max-width:900px){
  :root[data-theme="dark"] .ad-item{ background:var(--dk-s2); border-color:var(--dk-line-3); }
  :root[data-theme="dark"] .ad-item.is-on{ background:var(--dk-s3); border-color:rgba(243,157,94,.45); }
}
/* badges (also used on sandbox.html): the global rule makes them blue; this page's badges are orange tints */
:root[data-theme="dark"] .aiba-demo .service-hero-badge.ad-badge,
:root[data-theme="dark"] .aiba-inside .service-hero-badge.ad-badge{ color:var(--orange-text); border-color:rgba(243,157,94,.35); }

/* ---- 3. The ad-screen scenes (window host: the band, so body s2, panels s3, recesses s1) ---- */
:root[data-theme="dark"] .ad-logo{ background:var(--btn-orange); color:var(--btn-orange-ink); }
:root[data-theme="dark"] .ad-tag{ color:var(--orange-text); border-color:rgba(243,157,94,.35); }
:root[data-theme="dark"] .ad-card{ background:var(--dk-s3); border-color:var(--dk-line-3); box-shadow:inset 0 1px 0 var(--dk-light-top); }
:root[data-theme="dark"] .ad-av{ background:rgba(129,170,247,.16); color:var(--blue-text); }
:root[data-theme="dark"] .ad-new{ background:rgba(150,175,230,.07); box-shadow:inset 3px 0 0 var(--amber-text); }
/* amber and warm chips: a neutral blue-grey fill with amber/orange ink and a 1px inset ring (a warm alpha tint over navy mixes to grey-brown) */
:root[data-theme="dark"] .ad-amber{ background:rgba(150,175,230,.10); color:var(--amber-text); box-shadow:inset 0 0 0 1px rgba(248,198,85,.40); }
:root[data-theme="dark"] .ad-green{ background:rgba(107,207,157,.14); color:var(--green-text); }
:root[data-theme="dark"] .ad-btn{ background:rgba(150,175,230,.05); border-color:var(--dk-edge); color:var(--text-primary); }
:root[data-theme="dark"] .ad-btn-go{ background:var(--btn-orange); border-color:var(--btn-orange); color:var(--btn-orange-ink); }
:root[data-theme="dark"] .ad-foot{ border-top-color:var(--dk-line-3); }
/* the floating text message and the phone are objects lying on the screen: raised, lighter than the stage, never a black hole */
:root[data-theme="dark"] .ad-sms{ background:var(--dk-s4); border:1px solid var(--dk-edge); box-shadow:0 14px 28px -16px rgba(1,2,11,.7); color:var(--text-secondary); }
:root[data-theme="dark"] .ad-sms p{ color:var(--text-primary); }
:root[data-theme="dark"] .ad-sms small{ color:var(--text-muted); }
:root[data-theme="dark"] .ad-sms .ad-ok{ color:var(--green-text); }
:root[data-theme="dark"] .ad-phone{ background:var(--dk-s3); border:1px solid var(--dk-edge); box-shadow:inset 0 1px 0 var(--dk-light-top); }
:root[data-theme="dark"] .ad-phone-top{ color:var(--text-primary); border-bottom-color:var(--dk-line-3); }
:root[data-theme="dark"] .ad-phone-top small{ color:var(--text-muted); }
:root[data-theme="dark"] .ad-bubble{ background:var(--dk-s2); border:1px solid var(--dk-line-2); color:var(--text-primary); }
/* the receipt and the QR poster are paper in light; here slate paper (no white), the QR modules turn light */
:root[data-theme="dark"] :is(.ad-receipt,.ad-poster){ background:var(--dk-s4); border-color:var(--dk-edge); box-shadow:inset 0 1px 0 var(--dk-light-top); color:var(--text-primary); }
:root[data-theme="dark"] .ad-receipt hr{ border-top-color:var(--dk-line-3); }
:root[data-theme="dark"] .ad-qr i{ background:var(--text-primary); }
:root[data-theme="dark"] .ad-qr i.o{ background:transparent; }
:root[data-theme="dark"] .ad-scanline{ background:linear-gradient(180deg,rgba(243,157,94,0),rgba(243,157,94,.22),rgba(243,157,94,0)); border-bottom-color:rgba(243,157,94,.7); }
:root[data-theme="dark"] .ad-search{ background:var(--dk-s1); border-color:var(--dk-control); color:var(--text-primary); }
:root[data-theme="dark"] .ad-caret{ background:var(--orange-text); }
:root[data-theme="dark"] .ad-drop{ background:rgba(150,175,230,.08); border-color:rgba(243,157,94,.40); }
:root[data-theme="dark"] .ad-chip{ border-color:var(--dk-line-3); }
:root[data-theme="dark"] .ad-scene.s5 .ad-pick{ background:rgba(150,175,230,.16); border-color:rgba(243,157,94,.70); color:var(--text-primary); }
:root[data-theme="dark"] .ad-meter{ background:rgba(150,175,230,.16); }
:root[data-theme="dark"] .ad-gates.s4 .ad-st2{ background:rgba(107,207,157,.10); box-shadow:inset 3px 0 0 var(--green-text); }
:root[data-theme="dark"] .ad-scene.s2 .ad-g1{ border-color:var(--orange-text); box-shadow:0 0 0 1px rgba(243,157,94,.40); }

/* ---- 4. Inside AIBA: the page-level tabs (on the canvas) and the window ---- */
:root[data-theme="dark"] .ai-tab{ background:var(--dk-s1); border-color:var(--dk-line-3); color:var(--text-secondary); }
:root[data-theme="dark"] .ai-tab:hover{ background:var(--dk-s2); color:var(--text-primary); }
:root[data-theme="dark"] .ai-tab.is-on{ background:rgba(129,170,247,.22); border-color:rgba(129,170,247,.55); color:var(--text-primary); }
:root[data-theme="dark"] .ai-tab:focus-visible{ outline-color:var(--dk-focus); }
:root[data-theme="dark"] .ai-seg{ background:rgba(150,175,230,.08); }
:root[data-theme="dark"] .ai-seg b,
:root[data-theme="dark"] .ai-seg button.is-on{ background:rgba(129,170,247,.22); color:var(--text-primary); box-shadow:inset 0 0 0 1px rgba(129,170,247,.55); }
/* status chips: 14% tint + tint text + 1px inset ring (an inset ring never changes the box) */
:root[data-theme="dark"] .ai-b-green{ background:rgba(107,207,157,.14); color:var(--green-text); box-shadow:inset 0 0 0 1px rgba(107,207,157,.28); }
:root[data-theme="dark"] .ai-b-amber{ background:rgba(150,175,230,.10); color:var(--amber-text); box-shadow:inset 0 0 0 1px rgba(248,198,85,.40); }
:root[data-theme="dark"] .ai-b-red{ background:rgba(234,136,133,.14); color:var(--red-text-hi); box-shadow:inset 0 0 0 1px rgba(234,136,133,.28); }   /* -hi: 4.3:1 became 5.0:1 on the tint */
:root[data-theme="dark"] .ai-b-blue{ background:rgba(129,170,247,.14); color:var(--blue-text); box-shadow:inset 0 0 0 1px rgba(129,170,247,.28); }
:root[data-theme="dark"] .ai-win .ai-warn{ color:var(--amber-text) !important; }   /* light carries !important on a literal */
/* projects: milestone chevrons (clip-path shapes cannot have borders, so reached = a solid 22% tint mix) */
:root[data-theme="dark"] .ai-chev{ background:var(--dk-s3); color:var(--text-secondary); }
:root[data-theme="dark"] .ai-chev b{ color:var(--text-primary); }
:root[data-theme="dark"] .ai-pane.go .ai-paid{ background:color-mix(in srgb,var(--green-text) 22%,var(--dk-s2)); color:var(--green-text); }
:root[data-theme="dark"] .ai-pane.go .ai-live{ background:var(--dk-s4); color:var(--orange-text); box-shadow:inset 0 -3px 0 var(--orange-text); }   /* orange on navy mixes to brown, so the in-progress step is a lifted slab with an orange base line */
/* panels */
:root[data-theme="dark"] :is(.ai-mini,.ai-kpis > div,.ai-list,.ai-table-wrap,.ai-sc,.ai-tl,.ai-bas-foot,.ai-lead-card){ background:var(--dk-s3); border-color:var(--dk-line-3); }
:root[data-theme="dark"] .ai-mini{ box-shadow:inset 0 1px 0 var(--dk-light-top); }
:root[data-theme="dark"] .ai-strip{ background:var(--dk-s3); box-shadow:inset 0 0 0 1px var(--dk-line-3); }
:root[data-theme="dark"] .ai-meter,:root[data-theme="dark"] .ai-track{ background:rgba(150,175,230,.16); }
:root[data-theme="dark"] .ai-navy{ background:var(--blue-text); }
:root[data-theme="dark"] .ai-amber{ background:var(--amber-text); }
:root[data-theme="dark"] .ai-green{ background:var(--green-text); }
:root[data-theme="dark"] .ai-meter-live span{ background:var(--amber-text); }
/* the advisor is the AI panel: the body colour with a 7% blue tint (a hole would read as black), a blue-tint edge and a 2px top bar */
:root[data-theme="dark"] .ai-advisor{ background:color-mix(in srgb,var(--blue-text) 7%,var(--dk-s2)); border:1px solid rgba(129,170,247,.30); box-shadow:inset 0 2px 0 var(--blue-text); color:var(--text-secondary); }
:root[data-theme="dark"] .ai-advisor h4{ color:var(--text-secondary); }
:root[data-theme="dark"] .ai-advisor h4 svg{ color:var(--amber-text); }
:root[data-theme="dark"] .ai-advisor ul{ color:var(--text-primary); }
:root[data-theme="dark"] .ai-advisor .ai-muted{ color:var(--text-muted); }
:root[data-theme="dark"] .ai-ask{ background:rgba(150,175,230,.08); color:var(--text-secondary); }
:root[data-theme="dark"] .ai-ask svg{ color:var(--blue-text); }
:root[data-theme="dark"] button.ai-ask{ border-color:var(--dk-line-3); }
:root[data-theme="dark"] button.ai-ask:hover{ background:rgba(150,175,230,.14); border-color:var(--dk-edge); color:var(--text-primary); }
:root[data-theme="dark"] .ai-q{ background:#183d86; color:#eef3ff; }       /* the user's own message: outgoing bubble blue */
/* tables */
:root[data-theme="dark"] .ai-table th{ background:transparent; color:var(--text-secondary); border-color:var(--dk-line-3); }
:root[data-theme="dark"] .ai-table td{ border-color:var(--dk-line-3); }
:root[data-theme="dark"] .ai-table tbody tr:nth-child(even){ background:transparent; }
:root[data-theme="dark"] .ai-flag td{ background:rgba(150,175,230,.05); }
:root[data-theme="dark"] .ai-flag td:first-child{ box-shadow:inset 3px 0 0 var(--amber-text); }
:root[data-theme="dark"] .ai-flag-red td{ background:rgba(234,136,133,.08); }
:root[data-theme="dark"] .ai-works .ai-hl{ background:rgba(129,170,247,.07); box-shadow:inset 1px 0 0 rgba(129,170,247,.30),inset -1px 0 0 rgba(129,170,247,.30); }
:root[data-theme="dark"] .ai-works .ai-gw{ color:var(--blue-text); }
:root[data-theme="dark"] .ai-works .ai-total td{ background:rgba(129,170,247,.10); border-top:1.5px solid var(--blue-text); }
:root[data-theme="dark"] .ai-works .ai-total td.ai-hl{ background:rgba(129,170,247,.16); }
:root[data-theme="dark"] .ai-works :is(.ai-total td,td.ai-hl) small{ color:var(--text-secondary); }   /* muted drops to 4.4:1 on the blue highlight column */
/* money in and out */
:root[data-theme="dark"] .ai-li{ border-bottom-color:var(--dk-line-3); }
:root[data-theme="dark"] .ai-steps i{ border-color:var(--dk-line-3); color:var(--text-muted); background:var(--dk-s3); }
:root[data-theme="dark"] .ai-steps i + i::before{ background:var(--dk-line-3); }
:root[data-theme="dark"] .ai-steps i.f{ background:var(--n-live); border-color:var(--blue-text); color:#eef3ff; }
:root[data-theme="dark"] .ai-steps i.f + i::before{ background:var(--blue-text); }
:root[data-theme="dark"] .ai-steps i.p{ border-color:var(--amber-text); color:var(--amber-text); }
:root[data-theme="dark"] .ai-ai{ background:rgba(129,170,247,.12); border-color:rgba(129,170,247,.35); color:var(--blue-text); }
/* pipeline: jobs float along the line; the live zone is a faint green tint */
:root[data-theme="dark"] .ai-pipe{ background:linear-gradient(90deg,var(--dk-s3) 0 34%,color-mix(in srgb,var(--green-text) 8%,var(--dk-s3)) 34% 100%); }
:root[data-theme="dark"] .ai-zone-live{ color:var(--green-text) !important; }
:root[data-theme="dark"] .ai-track-line{ background:linear-gradient(90deg,var(--dk-line-3) 0 34%,rgba(107,207,157,.40) 34% 100%); }
:root[data-theme="dark"] .ai-convert{ background:var(--dk-s4); border-color:var(--dk-edge); box-shadow:none; color:var(--text-primary); }
:root[data-theme="dark"] .ai-done{ background:var(--dk-s4); border-color:var(--green-text); color:var(--green-text); }
:root[data-theme="dark"] .ai-node{ box-shadow:0 0 0 4px var(--dk-s3); color:var(--text-primary); }
:root[data-theme="dark"] .ai-node::after{ border-left-color:var(--dk-edge); }
:root[data-theme="dark"] .ai-node em{ background:var(--dk-s4); border-color:var(--dk-edge); color:var(--text-primary); }
:root[data-theme="dark"] .ai-n-cold{ --c:color-mix(in srgb,var(--blue-text) 16%,var(--dk-s3)); color:var(--blue-text);   box-shadow:0 0 0 4px var(--dk-s3), inset 0 0 0 1.5px var(--blue-text); }
:root[data-theme="dark"] .ai-n-mid{  --c:var(--dk-s4); color:var(--amber-text);  box-shadow:0 0 0 4px var(--dk-s3), inset 0 0 0 1.5px var(--amber-text); }
:root[data-theme="dark"] .ai-n-hot{  --c:var(--dk-s4); color:var(--orange-text); box-shadow:0 0 0 4px var(--dk-s3), inset 0 0 0 1.5px var(--orange-text); }
:root[data-theme="dark"] .ai-n-live{ --c:color-mix(in srgb,var(--blue-text) 22%,var(--dk-s4)); --ring:var(--blue-text); color:var(--text-primary); background:conic-gradient(var(--blue-text) var(--p),var(--dk-line-3) 0); }
:root[data-theme="dark"] .ai-n-due{  --c:color-mix(in srgb,var(--red-text) 20%,var(--dk-s4));  --ring:var(--red-text);  color:var(--red-text-hi); background:conic-gradient(var(--red-text) var(--p),rgba(234,136,133,.25) 0); }
:root[data-theme="dark"] .ai-key{ background:var(--dk-s4); border-color:var(--dk-edge); color:var(--text-secondary); }
/* legend swatches: the solid kind colours (readable against the s4 key); Active is a blue-tint disc with a blue ring */
:root[data-theme="dark"] .k-cold{ background:var(--blue-text); }
:root[data-theme="dark"] .k-mid{ background:var(--amber-text); }
:root[data-theme="dark"] .k-hot{ background:var(--orange-text); }
:root[data-theme="dark"] .k-due{ background:var(--red-text); }
:root[data-theme="dark"] .k-live{ background:color-mix(in srgb,var(--blue-text) 22%,var(--dk-s4)); box-shadow:inset 0 0 0 2px var(--blue-text); }
/* reports: check-in calendar */
:root[data-theme="dark"] .ai-cal i{ background:rgba(150,175,230,.10); color:var(--text-muted); }
:root[data-theme="dark"] .ai-cal i.x{ background:transparent; }
:root[data-theme="dark"] .ai-cal i.c1,:root[data-theme="dark"] .ai-legend .c1{ background:rgba(107,207,157,.22); color:var(--green-text); }
:root[data-theme="dark"] .ai-cal i.c2,:root[data-theme="dark"] .ai-legend .c2{ background:rgba(107,207,157,.30); color:var(--text-primary); }
:root[data-theme="dark"] .ai-cal i.c3,:root[data-theme="dark"] .ai-legend .c3{ background:#01764c; color:#fff; }
/* scope */
:root[data-theme="dark"] .ai-stg i{ border-color:var(--dk-line-3); }
/* timeline */
:root[data-theme="dark"] .ai-tl-inner{ background-image:repeating-linear-gradient(90deg,transparent 0 calc(3% - 1px),rgba(150,175,230,.08) calc(3% - 1px) 3%); }
:root[data-theme="dark"] .ai-lane{ border-top-color:var(--dk-line-2); }
:root[data-theme="dark"] .ai-lane > b{ background:var(--dk-s3); }
:root[data-theme="dark"] .ai-tl-labels{ background:var(--dk-s3); box-shadow:1px 0 0 var(--dk-line-3); }
:root[data-theme="dark"] .ai-tl-labels b{ border-top-color:var(--dk-line-2); }
:root[data-theme="dark"] .ai-dot{ border-color:var(--dk-s3); box-shadow:none; }
:root[data-theme="dark"] .ai-d-flag,:root[data-theme="dark"] .k-flag{ background:var(--text-muted); }
:root[data-theme="dark"] .ai-d-live{ background:var(--orange-text); box-shadow:0 0 0 3px rgba(243,157,94,.30); }
:root[data-theme="dark"] .ai-d-in,:root[data-theme="dark"] .k-in{ background:var(--green-text); }
:root[data-theme="dark"] .ai-d-out,:root[data-theme="dark"] .k-out{ background:var(--amber-text); }
:root[data-theme="dark"] .ai-d-act,:root[data-theme="dark"] .k-act{ background:var(--blue-text); }
:root[data-theme="dark"] .ai-d-msg,:root[data-theme="dark"] .k-msg{ background:var(--violet-text); }
:root[data-theme="dark"] .ai-today{ border-left-color:var(--orange-text); color:var(--orange-text); }
/* people */
:root[data-theme="dark"] .ai-person{ border-bottom-color:var(--dk-line-2); }
:root[data-theme="dark"] .ai-filter{ border-bottom-color:var(--dk-line-3); }
:root[data-theme="dark"] .ai-av-blue,:root[data-theme="dark"] .t-client,:root[data-theme="dark"] .t-cold{ background:rgba(129,170,247,.16); color:var(--blue-text); }
:root[data-theme="dark"] .ai-av-amber,
:root[data-theme="dark"] .t-mid{ background:rgba(150,175,230,.12); color:var(--amber-text); box-shadow:inset 0 0 0 1px rgba(248,198,85,.40); }
:root[data-theme="dark"] .ai-av-green,:root[data-theme="dark"] .t-prospect{ background:rgba(107,207,157,.16); color:var(--green-text); }
:root[data-theme="dark"] .ai-av-violet,:root[data-theme="dark"] .t-partner{ background:rgba(176,155,238,.16); color:var(--violet-text); }
:root[data-theme="dark"] .t-supplier{ background:rgba(150,175,230,.14); color:var(--text-secondary); }
:root[data-theme="dark"] .t-hot{ background:rgba(150,175,230,.12); color:var(--orange-text); box-shadow:inset 0 0 0 1px rgba(243,157,94,.40); }
:root[data-theme="dark"] .ai-ref-row{ background:var(--ai-soft); }
:root[data-theme="dark"] .ai-commission{ border-color:rgba(107,207,157,.40); background:rgba(107,207,157,.07); }
:root[data-theme="dark"] .ai-lead-card.ai-hot{ border-color:rgba(243,157,94,.45); box-shadow:inset 3px 0 0 var(--orange-text); }
:root[data-theme="dark"] .ai-lead-card p svg{ color:var(--amber-text); }
/* sites and files: the map is redrawn in the dark palette (its colours are SVG presentation attributes, which CSS overrides) */
:root[data-theme="dark"] .ai-map{ outline:1px solid var(--dk-line-2); outline-offset:-1px; }
:root[data-theme="dark"] .ai-map > rect{ fill:var(--dk-s2); }
:root[data-theme="dark"] .ai-map > path[fill="#d7ebd5"]{ fill:rgba(107,207,157,.10); }
:root[data-theme="dark"] .ai-map > path[stroke="#b9d8f0"]{ stroke:rgba(129,170,247,.28); }
:root[data-theme="dark"] .ai-map g[stroke="#ffffff"]{ stroke:rgba(150,175,230,.20); }
:root[data-theme="dark"] .ai-map g[stroke="#ffffff"][opacity]{ stroke:rgba(150,175,230,.12); }
:root[data-theme="dark"] .ai-map g[stroke="#f6d38a"]{ stroke:rgba(150,175,230,.34); }
/* main roads: neutral slate, one step brighter than the minor roads (.20 and .12) so the hierarchy stays. Warm alpha over navy goes khaki. */
:root[data-theme="dark"] .ai-map .ai-pin path{ fill:var(--red-text); }
:root[data-theme="dark"] .ai-map .ai-pin circle{ fill:var(--dk-s2); }
:root[data-theme="dark"] .ai-map .ai-pin-shadow{ fill:#01020b; }
:root[data-theme="dark"] .ai-folders span,:root[data-theme="dark"] .ai-folders button{ background:rgba(150,175,230,.10); }
:root[data-theme="dark"] .ai-folders span.is-on,:root[data-theme="dark"] .ai-folders button.is-on{ background:rgba(129,170,247,.16); color:var(--blue-text); }
:root[data-theme="dark"] .ai-file{ border-bottom-color:var(--dk-line-2); }
/* "Shaped to your business" settings list (page content on the canvas) */
:root[data-theme="dark"] .ab-shape li{ border-top-color:var(--dk-line-1); }
:root[data-theme="dark"] .ab-shape li svg{ color:var(--orange-text); }

/* ===== Phones (Mars, 25 Nov): one scene name at a time with arrows, and a screen that fits each scene =====
   aiba-demo.js wraps the list in .ad-nav with two arrows and adds the dots; on wider screens they stay
   out of the way. The screen's height is set per scene by aiba-demo.js and eases between scenes. */
.ad-nav { display: contents; }
.ad-nav-arrow, .ad-dots { display: none; }
@media (max-width: 767px) {
  .aiba-demo .ad-nav { display: grid; grid-template-columns: 30px minmax(0, 1fr) 30px; align-items: center; gap: 6px; }
  .aiba-demo .ad-nav-arrow {
    display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 50%; cursor: pointer;
    border: 1px solid rgba(15, 23, 42, 0.12); background: rgba(255, 255, 255, 0.7); color: var(--text-primary);
  }
  .aiba-demo .ad-nav-arrow svg { width: 16px; height: 16px; }
  .aiba-demo .ad-nav-arrow:focus-visible { outline: 2px solid var(--ad-o); outline-offset: 2px; }
  .aiba-demo .ad-list { display: block; overflow: visible; padding: 0; }
  .aiba-demo.ad-js .ad-list li { display: none; }
  .aiba-demo.ad-js .ad-list li.is-on { display: block; }
  .aiba-demo .ad-item { align-items: center; height: 58px; padding: 8px 14px; }
  .aiba-demo .ad-item b { white-space: normal; font-size: 0.92rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .aiba-demo .ad-item.is-on small { display: none; }
  /* steps still to come show as a faint blurred preview that comes into focus as AIBA does each one,
     so the card is never an empty box (the height doesn't change either way) */
  .aiba-demo.ad-js [data-s] { transition: opacity .45s ease, transform .45s ease, filter .45s ease; }
  .aiba-demo.ad-js [data-s]:not(.on) { opacity: 0.16; filter: blur(4px); transform: none; }
  .aiba-demo .ad-dots { display: flex; justify-content: center; gap: 5px; margin: 10px 0 12px; }
  .aiba-demo .ad-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-muted, #94a3b8); opacity: 0.4; transition: width 0.25s ease, opacity 0.25s ease; }
  .aiba-demo .ad-dots i.is-on { width: 14px; border-radius: 3px; opacity: 1; background: var(--ad-o); }
  .aiba-demo .ad-player { gap: 0; }
  .aiba-demo .ad-stage { transition: height .5s cubic-bezier(0.16, 1, 0.3, 1); }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) { .aiba-demo .ad-stage { transition: none; } }
:root[data-theme="dark"] .aiba-demo .ad-nav-arrow { background: var(--dk-s3); border-color: var(--dk-line-3); color: var(--text-primary); }
:root[data-theme="dark"] .aiba-demo .ad-dots i.is-on { background: var(--orange-text); }

/* ===== Inside AIBA on phones (Mars, 25 Nov) =====
   aiba-demo.js wraps the tab row in .ai-tabnav with two arrows, adds the dots and the
   "Days on site and history" fold. Wider screens: the wrapper is display:contents, the extras hidden. */
.ai-tabnav { display: contents; }
.ai-tabnav-arrow, .ai-tabdots, .ai-more { display: none; }
@media (max-width: 767px) {
  #inside-aiba .ai-tabnav { display: grid; grid-template-columns: 30px minmax(0, 1fr) 30px; align-items: center; gap: 6px; margin-top: 24px; }
  #inside-aiba .ai-tabnav-arrow {
    display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 50%; cursor: pointer;
    border: 1px solid rgba(15, 23, 42, 0.12); background: rgba(255, 255, 255, 0.7); color: var(--text-primary);
  }
  #inside-aiba .ai-tabnav-arrow svg { width: 16px; height: 16px; }
  #inside-aiba .ai-tabnav-arrow:focus-visible { outline: 2px solid var(--accent-orange); outline-offset: 2px; }
  #inside-aiba .ai-tabs { display: block; margin: 0; width: auto; overflow: visible; padding: 0; }
  #inside-aiba .ai-tab { display: none; }
  #inside-aiba .ai-tab.is-on { display: flex; width: 100%; height: 44px; justify-content: center; }
  #inside-aiba .ai-tabdots { display: flex; justify-content: center; gap: 5px; margin: 10px 0 18px; }
  #inside-aiba .ai-tabdots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-muted, #94a3b8); opacity: 0.4; transition: width 0.25s ease, opacity 0.25s ease; }
  #inside-aiba .ai-tabdots i.is-on { width: 14px; border-radius: 3px; opacity: 1; background: var(--accent-orange); }

  /* Projects: the five stages fit one row (number and colour; the amounts are in Payment below) */
  #inside-aiba .ai-chevs { grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; gap: 3px; }
  #inside-aiba .ai-chev { padding: 9px 10px 9px 14px; align-items: center; }
  #inside-aiba .ai-chev small, #inside-aiba .ai-chev span { display: none; }
  #inside-aiba .ai-chev b { font-size: 0.74rem; white-space: nowrap; }

  /* Projects: Days on site and History fold away under Payment */
  #inside-aiba .ai-more {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 10px; border: 0; background: none;
    cursor: pointer; font: inherit; font-size: .85rem; font-weight: 600; color: var(--accent-blue);
  }
  #inside-aiba .ai-more svg { width: 16px; height: 16px; transition: transform .3s ease; }
  #inside-aiba .ai-cards.is-open .ai-more svg { transform: rotate(180deg); }
  #inside-aiba .ai-cards:not(.is-open) .ai-mini ~ .ai-mini { display: none; }
}
:root[data-theme="dark"] #inside-aiba .ai-tabnav-arrow { background: var(--dk-s3); border-color: var(--dk-line-3); color: var(--text-primary); }
:root[data-theme="dark"] #inside-aiba .ai-tabdots i.is-on { background: var(--orange-text); }
:root[data-theme="dark"] #inside-aiba .ai-more { color: var(--blue-text, #81aaf7); }

/* ===== Inside AIBA on phones, the other screens (Mars, 25 Nov): nothing scrolls sideways =====
   Tables keep their key columns only; the screen menus and filters share the width evenly.
   The Timeline still drags sideways on purpose. Wider screens unchanged. */
@media (max-width: 767px) {
  #inside-aiba .ai-table-wrap { overflow: visible; }
  #inside-aiba .ai-table { font-size: 0.8rem; }
  #inside-aiba .ai-table th, #inside-aiba .ai-table td { padding: 9px 10px; }
  #inside-aiba .ai-table td:first-child { white-space: normal; }
  #inside-aiba .ai-table td .ai-badge { display: inline-block; margin: 4px 0 0; }
  /* Scope & works: item, contract + variations, delivered */
  #inside-aiba .ai-works :is(th, td):is(:nth-child(2), :nth-child(3), :nth-child(5), :nth-child(7)) { display: none; }
  #inside-aiba .ai-works th { white-space: normal; }
  #inside-aiba .ai-works td small, #inside-aiba .ai-works .ai-sum { display: none; }
  /* Reports: the September calendar fits the card */
  #inside-aiba .ai-cal { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  #inside-aiba .ai-cal i { min-width: 0; padding: 3px 2px; }
  /* Commercials: scope item, sold for, margin */
  #inside-aiba .ai-table:not(.ai-works):not(.ai-rep) :is(th, td):is(:nth-child(3), :nth-child(4)) { display: none; }
  /* Reports: project, margin, used */
  #inside-aiba .ai-rep :is(th, td):is(:nth-child(2), :nth-child(3), :nth-child(4)) { display: none; }

  /* Money in & out, People: the screen menu takes its own row and shares the width */
  #inside-aiba .ai-winbar .ai-nav { flex: 1 1 100%; order: 2; justify-content: space-between; gap: 0; overflow: visible; }
  #inside-aiba .ai-navbtn { font-size: 0.8rem; }
  /* People, Sites & files: the filters share the width */
  #inside-aiba .ai-filter { justify-content: space-between; gap: 6px; overflow: visible; }
  #inside-aiba .ai-fbtn { font-size: 0.76rem; }
}

/* ===== Phones (Mars, 26 Nov): the picker stays in view with the screen =====
   The demo's scene picker and Inside AIBA's screen picker (arrows, name, dots) pin under the 60px header
   while you scroll through the screen below them, so there's always room for both. The buttons inside a
   demo scene are live: they press and move on to the next scene (aiba-demo.js). */
@media (max-width: 767px) {
  .aiba-demo .ad-nav, #inside-aiba .ai-tabnav {
    position: sticky; top: 60px; z-index: 6;
    margin-left: -16px; margin-right: -16px; padding: 8px 16px 8px;
    background: color-mix(in srgb, var(--bg-primary, #fff) 97%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  .aiba-demo .ad-dots, #inside-aiba .ai-tabdots { grid-column: 1 / -1; margin: 8px 0 0; }
  .aiba-demo .ad-screen { margin-top: 10px; }
  #inside-aiba .ai-tabnav { margin-top: 16px; margin-bottom: 14px; }
}
/* the buttons in a demo scene are live at every width (Mars, 26 Nov): they press and move on to the next scene */
.aiba-demo .ad-scene :is(.ad-btn, .ad-chip) { cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.aiba-demo .ad-scene :is(.ad-btn, .ad-chip).is-pressed { transform: scale(.94); filter: brightness(1.15); }
