:root {
  --bg: #f6f6f4; --bg2: #ffffff; --line: #e3e2dc; --text: #1d1d1b; --muted: #6b6a64; --accent: #d9480f; --accent-text: #fff;
  --ok: #2b8a3e; --err: #c92a2a; --warn: #b35c00; --chip: #efeee9;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #17181b; --bg2: #1f2024; --line: #2e2f34; --text: #ececea; --muted: #9a9993; --accent: #ff7a3d; --accent-text: #1a0d05; --ok: #51cf66; --err: #ff6b6b; --warn: #ffa94d; --chip: #2a2b30; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 24px 0 8px; } h3 { font-size: 15px; margin: 16px 0 6px; }
.muted { color: var(--muted); } .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.center { max-width: 420px; margin: 12vh auto; padding: 0 20px; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.brand { font-weight: 700; font-size: 18px; } .brand b { color: var(--accent); }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--bg2); color: var(--text); border-radius: 8px; padding: 6px 12px; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { color: var(--err); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%; }
textarea { resize: vertical; }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 10px 0 4px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
nav { border-right: 1px solid var(--line); padding: 16px 12px; background: var(--bg2); display: flex; flex-direction: column; gap: 2px; }
nav a { color: var(--text); text-decoration: none; padding: 7px 10px; border-radius: 8px; }
nav a.on { background: var(--chip); font-weight: 600; }
nav .who { margin-top: auto; padding: 10px; font-size: 12.5px; border-top: 1px solid var(--line); }
main { padding: 24px 28px; max-width: 1100px; width: 100%; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 12px 0; }
.stat .n { font-size: 26px; font-weight: 700; } .stat .l { color: var(--muted); font-size: 12.5px; }
table { width: 100%; border-collapse: collapse; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--bg); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.pill.ok { color: var(--ok); } .pill.err { color: var(--err); } .pill.warn { color: var(--warn); } .pill.accent { color: var(--accent); }
.toggle { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.toggle input { width: auto; margin-top: 4px; }
.code { font: 600 28px ui-monospace, Consolas, monospace; letter-spacing: 3px; padding: 10px 16px; background: var(--chip); border-radius: 10px; display: inline-block; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; max-width: 90vw; z-index: 99; }
.hidden { display: none !important; }
.error { color: var(--err); margin-top: 8px; }
.warn { color: var(--warn); }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.bar { height: 8px; background: var(--chip); border-radius: 4px; overflow: hidden; min-width: 60px; }
.bar > div { height: 100%; background: var(--accent); }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; z-index: 50; }
.modal { width: min(560px, 100%); max-height: 84vh; overflow: auto; }
.foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  nav { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); }
  nav .who { display: none; }
  main { padding: 16px; }
  .grid2 { grid-template-columns: 1fr; }
}

/* Project Intelligence (intel.js) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 12px 0 16px; }
.tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.small { font-size: 12.5px; }
.statusbar { margin-bottom: 16px; }
.jobline { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spinner { width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.warnbox { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: var(--chip); color: var(--warn); }
.warnbox.err { color: var(--err); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { border-radius: 999px; padding: 3px 12px; font-size: 13px; }
.chip.on { background: var(--chip); border-color: var(--muted); font-weight: 600; }
.finding { margin: 8px 0; padding: 12px 14px; }
.finding p { margin: 6px 0; }
.finding.rejected { opacity: .6; }
.finding .meta { margin-top: 6px; }
.finding .meta button, .question button { padding: 3px 10px; font-size: 13px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.evidence { list-style: none; padding: 0; margin: 6px 0; }
.evidence li { padding: 4px 0; border-top: 1px dashed var(--line); }
.excerpt { font: 12px ui-monospace, Consolas, monospace; background: var(--chip); border-radius: 6px; padding: 4px 8px; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.question { padding: 10px 0; border-bottom: 1px solid var(--line); }
.question:last-child { border-bottom: none; }
.answer { margin-top: 6px; padding: 8px 10px; background: var(--chip); border-radius: 8px; }
.impact { margin: 8px 0; }
.impact summary { color: var(--text); font-size: 14px; }
.impact h4, .md h4 { margin: 12px 0 4px; font-size: 13.5px; }
.impact table { margin-top: 4px; }
.md p { margin: 6px 0; } .md ul, .impact ul { margin: 4px 0; padding-left: 20px; }
.plain { list-style: none; padding: 0; margin: 0; } .plain li { padding: 3px 0; }
.history div { padding: 3px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
.history div:last-child { border-bottom: none; }
.results { list-style: none; padding: 0; margin: 8px 0 0; } .results li { padding: 6px 0; border-top: 1px solid var(--line); }
mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 3px; }
label.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; white-space: nowrap; color: var(--text); font-size: 13px; }
label.inline input { width: auto; }
.flash { outline: 2px solid var(--accent); outline-offset: 2px; transition: outline-color 1s; }
code { font: 12.5px ui-monospace, Consolas, monospace; background: var(--chip); padding: 0 4px; border-radius: 4px; }

/* Clients (clients.js) */
.client h4 { margin: 14px 0 6px; font-size: 13.5px; }
.keys { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow: auto; padding: 6px 0; }

/* Plan and Work (delivery.js) */
.tabs { flex-wrap: wrap; }
.board { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 10px; margin-top: 16px; overflow-x: auto; }
.board .col h3 { margin: 0 0 8px; font-size: 13.5px; }
.taskcard { padding: 10px 12px; margin-bottom: 8px; font-size: 13px; }
.taskcard .meta { margin-top: 6px; }
.taskcard .meta button, .taskcard .meta select { padding: 3px 8px; font-size: 12.5px; }
.ok { color: var(--ok); }
@media (max-width: 1000px) { .board { grid-template-columns: repeat(5, 220px); } }

/* Client portal (business.js) */
.portal header { padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.portal main { margin: 0 auto; }
.portal .cards a.card:hover { border-color: var(--muted); }

/* Responsibilities, steps and skills (roles.js) */
table.resp td { vertical-align: top; }
table.resp select { width: auto; max-width: 220px; }
.step { margin-bottom: 4px; gap: 4px; }
.step button { padding: 2px 6px; }
.steps { margin: 4px 0; font-size: 12px; }

.prog { margin: 6px 0; }
.prog-bar { height: 6px; border-radius: 3px; background: var(--line, #e5e5e5); overflow: hidden; }
.prog-bar span { display: block; height: 100%; background: var(--accent, #e8590c); transition: width .5s; }

.watch-log { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); font-size: 13px; min-width: min(760px, 85vw); }
.wl { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.wl:last-child { border-bottom: 0; }
.wl-error { color: var(--err, #c33); }
.wl-say i { color: var(--muted); }
.wl pre { max-height: 300px; overflow: auto; margin: 4px 0; }

.taskcard.flash { outline: 2px solid var(--accent); }

.demo { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); z-index: 50; }
.demo-top { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.demo-body { flex: 1; display: grid; grid-template-columns: 1fr 360px; min-height: 0; }
.demo-stage { display: flex; align-items: center; justify-content: center; padding: 16px; min-height: 0; overflow: auto; }
.demo-stage img { max-width: 100%; max-height: 100%; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 30px rgba(0,0,0,.12); }
.demo-noshot { padding: 60px; border: 1px dashed var(--line); border-radius: 8px; max-width: 520px; text-align: center; }
.demo-side { border-left: 1px solid var(--line); padding: 18px; overflow: auto; background: var(--bg2); }
.demo-say { font-size: 16px; line-height: 1.55; }
.demo-steps li.on a { font-weight: 700; color: var(--accent); }
@media (max-width: 800px) { .demo-body { grid-template-columns: 1fr; } .demo-side { border-left: 0; border-top: 1px solid var(--line); } }

/* ---- Munshi, the project chat (hub/web/chat.js) ---- */
:root { --bolt-body: #9adfd3; --bolt-ear: #c7b8f5; --bolt-dark: #34445a; --bolt-eye: #ffffff; --bolt-pupil: #2b3550; --bolt-glow: #a8fff2; --bolt-cheek: #ffb3c1; --bolt-star: #ffd36e; }
@media (prefers-color-scheme: dark) { :root { --bolt-body: #8ad6c9; --bolt-ear: #b7a6f0; --bolt-dark: #26324a; } }
.bolt { width: 100%; height: 100%; overflow: visible; display: block; }
.bolt .b-skull, .bolt .b-body, .bolt .b-hand { fill: var(--bolt-body); }
.bolt .b-ear { fill: var(--bolt-ear); }
.bolt .b-arm { stroke: var(--bolt-body); }
.bolt .b-face { fill: var(--bolt-dark); }
.bolt .b-eye { fill: var(--bolt-eye); }
.bolt .b-pupil { fill: var(--bolt-pupil); }
.bolt .b-mouth { stroke: var(--bolt-glow); }
.bolt .b-cheek { fill: var(--bolt-cheek); opacity: .8; }
.bolt .b-stalk { stroke: var(--bolt-dark); }
.bolt .b-star, .bolt .b-bolt { fill: var(--bolt-star); }
.bolt .b-gear circle { stroke: var(--muted); fill: none; } .bolt .b-gear circle:last-child { fill: var(--muted); stroke: none; }
.bolt .b-dot { fill: var(--muted); }
.bolt .b-gears, .bolt .b-bubbles { opacity: 0; }
.bolt .b-star, .bolt .b-pupils, .bolt .b-gear, .bolt .b-dot, .bolt .b-head, .bolt .b-antenna { transform-box: fill-box; transform-origin: center; }
.bolt .b-antenna { transform-origin: 50% 100%; }
/* idle: a slow blink-like glance now and then */
.bolt .b-pupils { animation: bolt-glance 7s ease-in-out infinite; }
/* thinking: the star spins, the antenna wobbles, eyes look around, gears and dots float up */
.bolt.thinking .b-star { animation: bolt-spin .9s linear infinite; }
.bolt.thinking .b-antenna { animation: bolt-wobble 1.2s ease-in-out infinite; }
.bolt.thinking .b-pupils { animation: bolt-look 2.4s ease-in-out infinite; }
.bolt.thinking .b-head { animation: bolt-bob 1.2s ease-in-out infinite; }
.bolt.thinking .b-gears, .bolt.thinking .b-bubbles { opacity: 1; }
.bolt.thinking .b-gear.g1 { animation: bolt-gear-up 2.2s ease-in infinite; }
.bolt.thinking .b-gear.g2 { animation: bolt-gear-up 2.2s ease-in .9s infinite; }
.bolt.thinking .b-dot { animation: bolt-bubble 1.5s ease-out infinite; }
.bolt.thinking .b-dot.d2 { animation-delay: .25s; } .bolt.thinking .b-dot.d3 { animation-delay: .5s; }
@keyframes bolt-spin { to { transform: rotate(360deg); } }
@keyframes bolt-wobble { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }
@keyframes bolt-look { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-1.6px, -0.8px); } 45% { transform: translate(1.6px, -1px); } 70% { transform: translate(1.2px, 1px); } 85% { transform: translate(-1px, .8px); } }
@keyframes bolt-glance { 0%, 86%, 100% { transform: translate(0, 0); } 90%, 95% { transform: translate(1.4px, -0.6px); } }
@keyframes bolt-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1px) rotate(-2deg); } }
@keyframes bolt-gear-up { 0% { transform: translateY(4px) rotate(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-10px) rotate(240deg); opacity: 0; } }
@keyframes bolt-bubble { 0% { transform: translateY(3px) scale(.5); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-6px) scale(1.1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .bolt *, .bolt-dots i { animation: none !important; }
  .bolt.thinking .b-bubbles { opacity: 1; } .bolt.thinking .b-gears { opacity: .7; }
}
#bolt-fab { position: fixed; right: 20px; bottom: 20px; width: 60px; height: 60px; border-radius: 50%; padding: 6px 7px 4px; z-index: 900;
  background: var(--bg2); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.18); transition: transform .15s; }
#bolt-fab:hover { transform: translateY(-2px); border-color: var(--bolt-body); }
#bolt-fab.on { border-color: var(--bolt-body); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bolt-body) 35%, transparent), 0 6px 18px rgba(0,0,0,.18); }
#bolt-panel { position: fixed; right: 20px; bottom: 92px; width: 400px; max-width: calc(100vw - 32px); height: min(620px, calc(100vh - 120px)); z-index: 901;
  display: flex; flex-direction: column; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.22); overflow: hidden; }
.bolt-loading { padding: 24px; }
.bolt-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.bolt-head .bolt { width: 40px; height: 40px; flex: none; }
.bolt-x { padding: 3px 9px; font-size: 12.5px; }
.bolt-style { display: flex; gap: 0; margin: 8px 12px 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.bolt-style button { flex: 1; border: 0; border-radius: 0; font-size: 12.5px; padding: 4px 8px; background: var(--bg2); color: var(--muted); }
.bolt-style button.on { background: var(--chip); color: var(--text); font-weight: 600; }
.bolt-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.bolt-msg { display: flex; } .bolt-msg.me { justify-content: flex-end; }
.bolt-bubble { max-width: 88%; padding: 8px 11px; border-radius: 12px; background: var(--chip); font-size: 13.5px; overflow-wrap: anywhere; }
.bolt-msg.me .bolt-bubble { background: var(--accent); color: var(--accent-text); border-bottom-right-radius: 4px; }
.bolt-msg.bot .bolt-bubble { border-bottom-left-radius: 4px; }
.bolt-msg.err .bolt-bubble { color: var(--err); }
.bolt-bubble p { margin: 0 0 6px; } .bolt-bubble p:last-child { margin: 0; }
.bolt-bubble ul { margin: 4px 0 6px; padding-left: 18px; } .bolt-bubble li { margin: 2px 0; }
.bolt-bubble code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--bg); padding: 0 4px; border-radius: 4px; }
.bolt-wait { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.bolt-wait .bolt.mini { width: 30px; height: 30px; }
.bolt-dots i { font-style: normal; display: inline-block; animation: bolt-dot 1.2s infinite; } .bolt-dots i:nth-child(2) { animation-delay: .2s; } .bolt-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes bolt-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-3px); opacity: 1; } }
.bolt-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.bolt-form textarea { flex: 1; resize: none; }
.bolt-blocked { padding: 12px; border-top: 1px solid var(--line); color: var(--warn); font-size: 13px; }
@media (max-width: 600px) { #bolt-panel { right: 16px; left: 16px; width: auto; bottom: 88px; } #bolt-fab { right: 16px; bottom: 16px; } }
@media print { #bolt-fab, #bolt-panel { display: none; } }
/* Munshi: big shiny eyes that blink now and then; the organization's own picture with the same animation around it */
.bolt .b-shine { fill: #fff; }
.bolt .b-eyes { transform-box: fill-box; transform-origin: center; animation: bolt-blink 5.5s ease-in-out infinite; }
@keyframes bolt-blink { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.12); } }
.bolt-pic { position: relative; display: block; }
.bolt-pic img { position: absolute; inset: 12% 12% 6% 12%; width: 76%; height: 82%; object-fit: contain; border-radius: 22%; transform-origin: 50% 90%; }
.bolt-pic svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.bolt-pic.thinking img { animation: bolt-pic-wobble 1.1s ease-in-out infinite; }
@keyframes bolt-pic-wobble { 0%, 100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(6deg) translateY(-1.5px); } }
.bolt-preview { width: 84px; height: 84px; flex: none; }
.bolt-preview .bolt { width: 84px; height: 84px; }
@media (prefers-reduced-motion: reduce) { .bolt-pic img, .bolt .b-eyes { animation: none !important; } }
/* Munshi says hello when the chat opens: a little wave and a blink */
.bolt .b-wave { transform-box: fill-box; transform-origin: 0% 100%; }
.bolt.hello .b-wave { animation: bolt-wave .5s ease-in-out 3; }
.bolt.hello .b-eyes { animation: bolt-blink-now .5s ease-in-out .2s 1; }
@keyframes bolt-wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-28deg); } }
@keyframes bolt-blink-now { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.1); } }
@media (prefers-reduced-motion: reduce) { .bolt.hello .b-wave, .bolt.hello .b-eyes { animation: none !important; } }
.bolt-wait.long { color: var(--text); }
/* Munshi keeps the records: a little ledger in its hand */
.bolt .b-book { fill: #f6d39a; } .bolt .b-spine { fill: #d9a35c; } .bolt .b-lines { stroke: #8a6a3e; }
/* Munshi's thinking poses: five turns of 3.2 s on a 16 s loop (1 ponder, 2 laptop, 3 one finger, 4 ledger, 5 head scratch) */
.bolt .p-pose { opacity: 0; }
.bolt.thinking .p-pose, .bolt.thinking .b-gears, .bolt.thinking .b-bubbles, .bolt.thinking .b-wave, .bolt.thinking .b-arm-l, .bolt.thinking .b-ledger { animation-duration: 16s; animation-timing-function: linear; animation-iteration-count: infinite; }
.bolt.thinking .b-gears, .bolt.thinking .b-wave { animation-name: mp-only1; }
.bolt.thinking .b-bubbles { animation-name: mp-1and5; }
.bolt.thinking .b-arm-l, .bolt.thinking .b-ledger { animation-name: mp-not2or4; }
.bolt.thinking .p-laptop { animation-name: mp-2; }
.bolt.thinking .p-finger { animation-name: mp-3; }
.bolt.thinking .p-book { animation-name: mp-4; }
.bolt.thinking .p-scratch { animation-name: mp-5; }
.bolt.thinking .b-pupils { animation: mp-eyes 16s ease-in-out infinite; }
@keyframes mp-only1 { 0%, 19% { opacity: 1; } 20%, 99% { opacity: 0; } 100% { opacity: 1; } }
@keyframes mp-1and5 { 0%, 19% { opacity: 1; } 20%, 79% { opacity: 0; } 80%, 100% { opacity: 1; } }
@keyframes mp-not2or4 { 0%, 19% { opacity: 1; } 20%, 39% { opacity: 0; } 40%, 59% { opacity: 1; } 60%, 79% { opacity: 0; } 80%, 100% { opacity: 1; } }
@keyframes mp-2 { 0%, 19% { opacity: 0; } 20%, 39% { opacity: 1; } 40%, 100% { opacity: 0; } }
@keyframes mp-3 { 0%, 39% { opacity: 0; } 40%, 59% { opacity: 1; } 60%, 100% { opacity: 0; } }
@keyframes mp-4 { 0%, 59% { opacity: 0; } 60%, 79% { opacity: 1; } 80%, 100% { opacity: 0; } }
@keyframes mp-5 { 0%, 79% { opacity: 0; } 80%, 99% { opacity: 1; } 100% { opacity: 0; } }
/* eyes: roam while pondering, at the screen, at you, down at the ledger, rolled up while scratching */
@keyframes mp-eyes { 0% { transform: translate(0, 0); } 5% { transform: translate(-1.6px, -.8px); } 10% { transform: translate(1.6px, -1px); } 15% { transform: translate(1.2px, 1px); }
  19% { transform: translate(0, 0); } 21%, 39% { transform: translate(1.8px, 1.4px); } 41%, 59% { transform: translate(0, 0); } 61%, 79% { transform: translate(0, 1.9px); }
  81%, 99% { transform: translate(-.6px, -2.4px); } 100% { transform: translate(0, 0); } }
/* props and their little movements */
.bolt .p-case { fill: var(--bolt-dark); } .bolt .p-screen { fill: var(--bolt-glow); } .bolt .p-code { stroke: var(--bolt-dark); stroke-dasharray: 9; }
.bolt .p-bubble { fill: #fff; stroke: var(--bolt-dark); stroke-width: .6; } .bolt .p-text { font: 700 5.4px system-ui, sans-serif; fill: var(--bolt-dark); }
.bolt .p-q { font: 800 10px system-ui, sans-serif; fill: var(--accent); }
.bolt .p-page { fill: #fff8e8; stroke: #d9a35c; stroke-width: .5; } .bolt .p-flip { fill: #fff1cf; } .bolt .p-ink { stroke: #8a6a3e; }
.bolt .p-tap, .bolt .p-wag, .bolt .p-flip, .bolt .p-itch, .bolt .p-q, .bolt .p-say { transform-box: fill-box; }
.bolt.thinking .p-tap { animation: mp-tap .3s ease-in-out infinite alternate; } .bolt.thinking .p-tap.t2 { animation-delay: .15s; }
.bolt.thinking .p-screen { animation: mp-flicker .7s steps(2) infinite; }
.bolt.thinking .p-code { animation: mp-type 1.4s linear infinite; }
.bolt .p-wag { transform-origin: 50% 100%; } .bolt.thinking .p-wag { animation: mp-wag .55s ease-in-out infinite alternate; }
.bolt .p-say { transform-origin: 30% 100%; } .bolt.thinking .p-say { animation: mp-pop 3.2s ease-out infinite; }
.bolt .p-flip { transform-origin: 0% 50%; } .bolt.thinking .p-flip { animation: mp-flip 1.1s ease-in-out infinite; }
.bolt.thinking .p-itch { animation: mp-itch .2s linear infinite alternate; }
.bolt.thinking .p-q { animation: mp-bob .8s ease-in-out infinite alternate; }
@keyframes mp-tap { from { transform: translateY(0); } to { transform: translateY(-1.5px); } }
@keyframes mp-flicker { 0% { opacity: 1; } 100% { opacity: .72; } }
@keyframes mp-type { from { stroke-dashoffset: 9; } to { stroke-dashoffset: 0; } }
@keyframes mp-wag { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
@keyframes mp-pop { 0% { transform: scale(.6); } 12%, 100% { transform: scale(1); } }
@keyframes mp-flip { 0% { transform: scaleX(1); } 60%, 100% { transform: scaleX(-1); } }
@keyframes mp-itch { from { transform: translate(-.8px, .5px); } to { transform: translate(.8px, -.5px); } }
@keyframes mp-bob { from { transform: translateY(0); } to { transform: translateY(-2px); } }
/* reduce motion: no pose changes, just the calm "…" (the rule above already stops every animation) */
@media (prefers-reduced-motion: reduce) { .bolt .p-pose { opacity: 0 !important; } .bolt.thinking .b-wave, .bolt.thinking .b-arm-l, .bolt.thinking .b-ledger { opacity: 1; } }
/* arms and hands in the poses: a shade darker, so they show in front of the body */
:root { --bolt-limb: #6fc6b8; } @media (prefers-color-scheme: dark) { :root { --bolt-limb: #63bcae; } }
.bolt .p-pose .b-arm { stroke: var(--bolt-limb); } .bolt .p-pose .b-hand { fill: var(--bolt-limb); stroke: #4fa597; stroke-width: .5; }
/* ---- Munshi's comic touches while thinking ---- */
.bolt .p-smoke circle { fill: #b8b8b8; transform-box: fill-box; transform-origin: center; }
.bolt.thinking .p-smoke circle { animation: mp-smoke 1.5s ease-out infinite; } .bolt.thinking .p-smoke .s2 { animation-delay: .5s; } .bolt.thinking .p-smoke .s3 { animation-delay: 1s; }
@keyframes mp-smoke { 0% { transform: translate(0, 2px) scale(.4); opacity: 0; } 25% { opacity: .9; } 100% { transform: translate(2px, -7px) scale(1.3); opacity: 0; } }
.bolt .p-fly { fill: #fff8e8; stroke: #d9a35c; stroke-width: .4; transform-box: fill-box; transform-origin: center; opacity: 0; }
.bolt.thinking .p-fly.f1 { animation: mp-fly-r 1.6s ease-out infinite; } .bolt.thinking .p-fly.f2 { animation: mp-fly-l 1.6s ease-out .8s infinite; }
@keyframes mp-fly-r { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(9px, -16px) rotate(220deg); opacity: 0; } }
@keyframes mp-fly-l { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(-9px, -15px) rotate(-200deg); opacity: 0; } }
.bolt .p-sweat { fill: #7cc8ff; transform-box: fill-box; }
.bolt.thinking .p-sweat { animation: mp-sweat 1.6s ease-in infinite; }
@keyframes mp-sweat { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(7px); opacity: 0; } }
@keyframes mp-wag { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
.bolt.thinking .p-laptop .p-case:first-of-type { animation: mp-jitter .12s linear infinite alternate; }
@keyframes mp-jitter { from { transform: translateX(-.3px); } to { transform: translateX(.3px); } }

/* ---- Done: a quick happy dance (about 2 s), arms up, joyful eyes, confetti ---- */
.bolt .b-all { transform-box: view-box; transform-origin: 32px 58px; }
.bolt .m-joy, .bolt .m-frown, .bolt .m-water, .bolt .m-hang { opacity: 0; }
.bolt .m-joy path { stroke: #fff; } .bolt .m-frown { stroke: var(--bolt-glow); } .bolt .m-water ellipse { fill: #9fdcff; opacity: .8; } .bolt .m-hang .b-arm { stroke: var(--bolt-body); } .bolt .m-hang .b-hand { fill: var(--bolt-body); }
.bolt.dance .b-all { animation: mp-dance .4s ease-in-out 5 alternate; }
.bolt.dance .p-cheer, .bolt.dance .m-joy, .bolt.dance .p-confetti { opacity: 1; }
.bolt.dance .b-eyes, .bolt.dance .b-wave, .bolt.dance .b-arm-l, .bolt.dance .b-ledger { opacity: 0; }
.bolt.dance .b-antenna { animation: bolt-wobble .2s ease-in-out infinite; }
.bolt.dance .b-star { animation: bolt-spin .5s linear infinite; }
@keyframes mp-dance { from { transform: translate(-2px, 0) rotate(-10deg); } to { transform: translate(2px, -2px) rotate(6deg); } }
.bolt .p-bit { transform-box: fill-box; transform-origin: center; }
.bolt .p-bit.c1 { fill: #ff8fa3; } .bolt .p-bit.c2 { fill: #ffd36e; } .bolt .p-bit.c3 { fill: #8fd3ff; } .bolt .p-bit.c4 { fill: #b49cff; } .bolt .p-spark { fill: #ffd36e; transform-box: fill-box; transform-origin: center; }
.bolt.dance .p-bit { animation: mp-confetti 1s ease-out 2; } .bolt.dance .p-bit.b1, .bolt.dance .p-bit.b5 { animation-delay: .15s; } .bolt.dance .p-bit.b2, .bolt.dance .p-bit.b6 { animation-delay: .3s; }
.bolt.dance .p-spark { animation: mp-sparkle .5s ease-in-out 4 alternate; }
@keyframes mp-confetti { 0% { transform: translateY(6px) rotate(0) scale(.2); opacity: 0; } 25% { opacity: 1; transform: translateY(0) rotate(90deg) scale(1); } 100% { transform: translateY(8px) rotate(300deg) scale(.9); opacity: 0; } }
@keyframes mp-sparkle { from { transform: scale(.4); } to { transform: scale(1.3); } }
.bolt-pic.dance img { animation: mp-pic-dance .4s ease-in-out 5 alternate; }
@keyframes mp-pic-dance { from { transform: translate(-2px, 0) rotate(-9deg); } to { transform: translate(2px, -4px) rotate(9deg); } }

/* ---- Could not answer: sad (tears, frown, droopy antenna, slump, a sigh). Waiting for a plan limit: a sniffle ---- */
.bolt.sad .b-mouth, .bolt.sniffle .b-mouth { opacity: 0; }
.bolt.sad .m-frown, .bolt.sniffle .m-frown, .bolt.sad .m-water, .bolt.sniffle .m-water { opacity: 1; }
.bolt.sad .b-pupils, .bolt.sniffle .b-pupils { animation: none; transform: translate(0, 1.6px); }
.bolt.sad .b-antenna { animation: none; transform: rotate(48deg); transform-origin: 50% 100%; } .bolt.sniffle .b-antenna { animation: none; transform: rotate(26deg); transform-origin: 50% 100%; }
.bolt.sad .b-star, .bolt.sniffle .b-star { animation: none; fill: #c9c3a8; }
.bolt.sad .b-all { transform: translateY(1.6px) rotate(-9deg); }
.bolt.sad .b-wave { opacity: 0; } .bolt.sad .m-hang { opacity: 1; }
.bolt.sad .p-tears, .bolt.sniffle .p-tears, .bolt.sad .p-sigh { opacity: 1; }
.bolt .p-tear { fill: #6cc4ff; transform-box: fill-box; opacity: 0; }
.bolt.sad .p-tear { animation: mp-tear 1.6s ease-in infinite; } .bolt.sad .p-tear.t2 { animation-delay: .8s; }
.bolt.sniffle .p-tear.t1 { animation: mp-tear 3.2s ease-in infinite; }
@keyframes mp-tear { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(9px); opacity: 0; } }
.bolt .p-sigh circle { fill: #c8c8c8; transform-box: fill-box; transform-origin: center; opacity: 0; }
.bolt.sad .p-sigh circle { animation: mp-sigh 3s ease-out infinite; } .bolt.sad .p-sigh circle:nth-child(2) { animation-delay: .15s; } .bolt.sad .p-sigh circle:nth-child(3) { animation-delay: .3s; }
@keyframes mp-sigh { 0%, 40% { opacity: 0; transform: translate(0, 0) scale(.5); } 55% { opacity: .9; } 100% { opacity: 0; transform: translate(-4px, -2px) scale(1.2); } }
/* around an uploaded picture: a little rain cloud, the picture droops and loses colour */
.bolt .p-cloudy { fill: #c3cad3; } .bolt .p-drop { fill: #6cc4ff; transform-box: fill-box; opacity: 0; }
.bolt-pic.sad .p-cloud, .bolt-pic.sniffle .p-cloud { opacity: 1; }
.bolt-pic.sad .p-drop { animation: mp-rain 1.1s linear infinite; } .bolt-pic.sad .p-drop.r2 { animation-delay: .35s; } .bolt-pic.sad .p-drop.r3 { animation-delay: .7s; }
.bolt-pic.sniffle .p-drop.r2 { animation: mp-rain 2.4s linear infinite; }
@keyframes mp-rain { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(8px); opacity: 0; } }
.bolt-pic.sad img { transform: translateY(2px) rotate(-5deg); filter: saturate(.35) brightness(.95); } .bolt-pic.sniffle img { filter: saturate(.6); }
/* reduce motion: no dance or tears; joyful eyes for a moment, or a gentle droop */
@media (prefers-reduced-motion: reduce) { .bolt.dance .b-wave, .bolt.dance .b-arm-l, .bolt.dance .b-ledger { opacity: 1; } }
