/* Bolt's brain (public/bolt-brain.js): Bella's diary card and the chat with Bolt. Uses app.css's
   tokens, so both themes follow. */

/* ── Bella's diary ── */
.bolt-diary { margin: 12px 0 0; padding: 16px 20px 16px; overflow: hidden; }
.bolt-diary::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--copper-2); }
.bolt-diary + .strip { margin-top: 12px; }
.bd-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.bd-eyebrow { display: flex; align-items: center; gap: 8px; margin: 0; font-family: var(--ff-body); font-size: var(--fs-sm); font-weight: 600; color: var(--copper); }
.bd-eyebrow svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.bd-eyebrow time { color: var(--ink-3); font-weight: 500; }
.bd-eyebrow time::before { content: '·'; margin-right: 8px; color: var(--ink-3); }
.bd-by { font-size: var(--fs-sm); color: var(--ink-3); white-space: nowrap; }
.bd-text { margin: 0; font-family: var(--ff-display); font-size: var(--fs-lg); line-height: 1.5; color: var(--ink); white-space: pre-line; max-width: 36em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-variation-settings: 'opsz' 24; }
.bolt-diary[data-open="1"] .bd-text { display: block; -webkit-line-clamp: unset; }
.bd-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.bd-more { border: 0; background: none; min-height: 44px; padding: 4px 0; font: 600 var(--fs-md) var(--ff-body); color: var(--copper); cursor: pointer; text-decoration: underline; text-decoration-color: var(--copper-3); text-underline-offset: 3px; }
.bd-more:hover { color: var(--copper-light); }
.bolt-diary.bd-short .bd-more { visibility: hidden; }
.bd-acts { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.bb-ic { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }

/* "Ask Bolt", in the live scene's corner (Bolt hovers in there) */
.bolt-ask { position: absolute; z-index: 6; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: var(--r-pill);
  border: 1px solid var(--glass-edge); background: var(--glass-strong); color: var(--ink); font: 600 var(--fs-sm) var(--ff-body); cursor: pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: color .2s, border-color .2s; }
.bolt-ask .bb-ic { color: var(--copper); }
.bolt-ask:hover { color: var(--copper); border-color: var(--line-2); }
.bolt-ask:focus-visible, .bd-more:focus-visible, .bc-chip:focus-visible, .bc-send:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }

/* ── Chat with Bolt ── */
.bolt-chat { position: fixed; inset: 0; z-index: 120; pointer-events: none; }
.bolt-chat[hidden] { display: none; }
.bc-scrim { position: absolute; inset: 0; background: rgba(20,12,8,.32); opacity: 0; transition: opacity .2s; pointer-events: auto; }
.bolt-chat:not(.bc-sheet) .bc-scrim { background: transparent; }
.bc-panel { position: absolute; display: flex; flex-direction: column; pointer-events: auto; border-radius: var(--r-card); background: var(--glass-solid); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg); overflow: hidden; opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .2s, transform .25s var(--ease); }
.bolt-chat.in .bc-scrim, .bolt-chat.in .bc-panel { opacity: 1; }
.bolt-chat.in .bc-panel { transform: none; }
.bc-grab { display: none; }
.bc-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px 16px; border-bottom: 1px solid var(--line); }
.bc-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--copper-wash); color: var(--copper); flex: none; }
.bc-avatar .bb-ic { width: 24px; height: 24px; }
.bc-who { flex: 1; min-width: 0; }
.bc-who h2 { margin: 0; font-family: var(--ff-display); font-size: var(--fs-lg); font-weight: 600; line-height: 1.15; color: var(--ink); }
.bc-who p { margin: 0 0 0; font-size: var(--fs-sm); color: var(--ink-3); }
.bc-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.bc-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bc-log { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 16px 16px 8px; list-style: none; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.bc-msg { display: flex; }
.bc-assistant { flex-direction: column; align-items: flex-start; gap: 8px; }
.bc-user { justify-content: flex-end; }
.bc-bubble { margin: 0; max-width: 86%; padding: 8px 12px; border-radius: var(--r-card); font-size: var(--fs-md); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.bc-assistant .bc-bubble { background: var(--sand); color: var(--ink); border-bottom-left-radius: 6px; }
.bc-user .bc-bubble { background: var(--copper); color: var(--on-accent); border-bottom-right-radius: 6px; }
.bc-state .bc-bubble { background: var(--well); color: var(--ink-2); border: 1px dashed var(--line-2); }
.bc-tired .bc-bubble::before { content: '🔋 '; }
.bc-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.bc-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: bc-dot 1.2s infinite ease-in-out; }
.bc-dots i:nth-child(2) { animation-delay: .15s; } .bc-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bc-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.bc-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 8px; }
.bc-chips[hidden] { display: none; }
.bc-chip { border: 1px solid var(--line-2); background: var(--glass-strong); color: var(--ink); border-radius: var(--r-pill); padding: 8px 12px; font: 500 var(--fs-sm) var(--ff-body); cursor: pointer; text-align: left; transition: border-color .2s, color .2s; }
.bc-chip:hover { border-color: var(--copper); color: var(--copper); }
.bc-form { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 8px 8px 8px 16px; border: 1px solid var(--line-2); border-radius: var(--r-card); background: var(--paper); }
.bc-form:focus-within { border-color: var(--copper-2); }
.bc-form textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font: 15px/1.4 var(--ff-body); padding: 8px 0; max-height: 120px; }
.bc-form textarea::placeholder { color: var(--ink-3); }
.bc-send { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--copper); color: var(--on-accent); cursor: pointer; }
.bc-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.bc-send:disabled, .bc-form textarea:disabled { opacity: .45; cursor: default; }
.bc-note { margin: 8px 16px 12px; font-size: var(--fs-xs); line-height: 1.35; color: var(--ink-3); text-align: center; }

/* phones: a bottom sheet */
.bolt-chat.bc-sheet .bc-panel { left: 0; right: 0; bottom: 0; top: auto; width: auto !important; height: auto !important; max-height: min(82vh, 640px); min-height: 52vh;
  border-radius: var(--r-panel) var(--r-panel) 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); transform: translateY(40px); }
.bolt-chat.bc-sheet.in .bc-panel { transform: none; }
.bolt-chat.bc-sheet .bc-grab { display: block; width: 44px; height: 5px; margin: 8px auto 0; border-radius: var(--r-mark); background: var(--line-2); cursor: grab; touch-action: none; flex: none; }
.bolt-chat.bc-sheet .bc-head { padding-top: 8px; }
html.bc-lock body { overflow: hidden; }

/* ── what Bolt looked at: step rows (one per tool), page links, actions, follow-ups ── */
.bc-trace { list-style: none; margin: 0; padding: 0; width: min(100%, 360px); display: flex; flex-direction: column; border-left: 2px solid var(--line-2); padding-left: 8px; }
.bc-trace[hidden] { display: none; }
.bc-step-h { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 4px 8px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--ink-2); font: 500 var(--fs-sm) var(--ff-body); text-align: left; cursor: pointer; }
.bc-step-h:hover:not(:disabled) { background: var(--well); color: var(--ink); }
.bc-step-h:disabled { cursor: default; }
.bc-step-h:focus-visible { outline: 2px solid var(--copper); outline-offset: 1px; }
.bc-step-ic { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--copper-wash); color: var(--copper); }
.bc-step-ic svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.bc-step-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-step-ms { flex: none; font: 500 var(--fs-xs) var(--ff-mono); color: var(--ink-3); }
.bc-chev { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease); }
.bc-step-h[aria-expanded="true"] .bc-chev { transform: rotate(90deg); }
.bc-step[data-status="running"] .bc-step-ic { animation: bc-pulse 1.1s ease-in-out infinite; }
.bc-step[data-status="running"] .bc-chev { visibility: hidden; }
.bc-step[data-status="error"] .bc-step-ic, .bc-step[data-status="cancelled"] .bc-step-ic { background: var(--well); color: var(--ink-3); }
@keyframes bc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.bc-step-d { margin: 0 0 8px 38px; padding: 8px 12px; border-radius: var(--r-ctl); background: var(--well); }
.bc-step-dl { display: grid; gap: 4px; margin: 0; font-size: var(--fs-sm); }
.bc-step-dl div { display: flex; gap: 8px; }
.bc-step-dl dt { flex: none; min-width: 96px; color: var(--ink-3); }
.bc-step-dl dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.bc-step-none { margin: 0; font-size: var(--fs-sm); color: var(--ink-3); }
.bc-cites { display: flex; flex-wrap: wrap; gap: 8px; }
.bc-cite { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 4px 12px 4px 8px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: transparent; color: var(--copper); font: 600 var(--fs-sm) var(--ff-body); cursor: pointer; }
.bc-cite svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bc-cite:hover { border-color: var(--copper); background: var(--copper-wash); }
.bc-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.bc-act { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 4px 8px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--ink-3); font: 500 var(--fs-sm) var(--ff-body); cursor: pointer; }
.bc-act svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.bc-act:hover { color: var(--ink); background: var(--well); }
.bc-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: var(--r-pill); background: var(--well); color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; }
.bc-follow { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.bc-act:focus-visible, .bc-cite:focus-visible, .bc-mic:focus-visible, .bc-jump:focus-visible, .bc-starter:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.bc-check { margin-left: 8px; font-size: var(--fs-sm); color: var(--ink-3); }
.bc-local .bc-bubble { background: var(--well); border: 1px solid var(--line); }
.bc-diary-msg .bc-bubble { font-family: var(--ff-display); font-size: var(--fs-base); }

/* keep place: the pill when new text arrives below what you're reading */
.bc-jump { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 4px 12px 4px 8px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--glass-solid); color: var(--ink); font: 600 var(--fs-sm) var(--ff-body); box-shadow: var(--shadow); cursor: pointer; }
.bc-jump[hidden] { display: none; }
.bc-jump svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* the empty sheet */
.bc-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; margin: auto 0; padding: 16px 8px; }
.bc-empty-av { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--copper-wash); color: var(--copper); }
.bc-empty-av .bb-ic { width: 38px; height: 38px; }
.bc-empty-h { margin: 4px 0 0; font-family: var(--ff-display); font-size: var(--fs-xl); font-weight: 600; color: var(--ink); }
.bc-empty-p { margin: 0 0 8px; max-width: 30ch; font-size: var(--fs-md); line-height: 1.45; color: var(--ink-2); }
.bc-starters { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 320px; }
.bc-starter { min-height: 44px; padding: 8px 16px; border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--paper); color: var(--ink); font: 500 var(--fs-md) var(--ff-body); text-align: left; cursor: pointer; }
.bc-starter:hover { border-color: var(--copper); color: var(--copper); }

/* state cards: out of energy, charging, off, errors */
.bc-card { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid var(--line-2); border-radius: var(--r-card); background: var(--paper); }
.bc-card-ic { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-ctl); background: var(--copper-wash); color: var(--copper); }
.bc-card-ic svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bc-card-ic .i-fill { fill: currentColor; stroke: none; }
.bc-card-tired .bc-card-ic .i-fill { animation: bc-pulse 1.6s ease-in-out infinite; }
.bc-card-error .bc-card-ic, .bc-card-busy .bc-card-ic, .bc-card-slow_down .bc-card-ic { background: var(--well); color: var(--bad); }
.bc-card-b { flex: 1; min-width: 0; }
.bc-card-h { margin: 0; font-weight: 700; font-size: var(--fs-base); color: var(--ink); }
.bc-card-p { margin: 4px 0 0; font-size: var(--fs-md); line-height: 1.45; color: var(--ink-2); }
.bc-card-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bc-card-acts .btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bc-card-when { font: 500 var(--fs-sm) var(--ff-mono); color: var(--ink-3); }

/* the composer: mic, read-aloud toggle, Stop */
.bc-mic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--ink-3); cursor: pointer; }
.bc-mic[hidden] { display: none; }
.bc-mic svg, .bc-speak svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.bc-mic:hover { color: var(--ink); background: var(--well); }
.bc-mic[aria-pressed="true"] { color: var(--on-accent); background: var(--bad); animation: bc-pulse 1.2s ease-in-out infinite; }
.bc-mic:disabled { opacity: .45; cursor: default; }
.bc-speak[hidden] { display: none; }
.bc-speak[aria-pressed="false"] .i-wave { opacity: .25; }
.bc-speak[aria-pressed="true"] { color: var(--copper); }
.bc-send[data-mode="stop"] { background: var(--ink); color: var(--paper); }
.bc-send[data-mode="stop"] svg { fill: currentColor; stroke: none; }

@media (max-width: 700px) {
  .bolt-diary { padding: 16px 16px 12px; }
  .bd-text { font-size: var(--fs-lg); -webkit-line-clamp: 3; }
  .bd-head { flex-wrap: wrap; row-gap: 0; }
  .bolt-ask { top: 8px; right: 8px; padding: 4px 8px 4px 8px; font-size: var(--fs-xs); }
}
@media (prefers-reduced-motion: reduce) {
  .bc-panel, .bc-scrim, .bolt-ask { transition: none; }
  .bc-dots i { animation: none; opacity: .7; }
  .bc-step[data-status="running"] .bc-step-ic, .bc-card-tired .bc-card-ic .i-fill, .bc-mic[aria-pressed="true"] { animation: none; }
  .bc-chev { transition: none; }
}
