/* Grant, the live demo agent (SITE_TRY_ME=1). The PaceNotes live look: dark, TC orange, transcript lines, tip cards. */
.tm { --tm-bg: #0b0c10; --tm-panel: #111217; --tm-card: #18181b; --tm-line: #27272a; --tm-edge: #3f3f46; --tm-text: #e4e4e7; --tm-dim: #a1a1aa; --tm-accent: #FF5600; --tm-accent-dark: #e64d00; --tm-navy: #0a2d5c; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, system-ui, sans-serif; color: var(--tm-text); line-height: 1.45; text-align: left; }
.tm *, .tm *::before, .tm *::after { box-sizing: border-box; }
.tm [hidden] { display: none !important; }
.tm .tm-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tm button, .tm input { font: inherit; color: inherit; }
.tm :where(a, button, input):focus-visible { outline: 2px solid var(--tm-accent); outline-offset: 2px; }
.tm a { color: var(--tm-accent); }

/* Page styles never leak in: every page has its own section, header, footer, h2 and button rules, so the widget
   resets them here and every widget rule is scoped under .tm. */
.tm section, .tm header, .tm footer, .tm ol, .tm li, .tm p, .tm h2, .tm form { margin: 0; padding: 0; max-width: none; border: 0; background: none; text-align: left; letter-spacing: normal; text-transform: none; position: static; box-shadow: none; }
.tm button { margin: 0; width: auto; padding: 0; letter-spacing: normal; text-transform: none; box-shadow: none; }
.tm li::marker { content: none; }

/* The character, docked bottom right. The 3D Companion replaces the still one once it loads. */
.tm .tm-buddy { position: fixed; right: 16px; bottom: 16px; z-index: 2147482990; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; border: 0; background: transparent; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.tm .tm-still { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5)); transition: transform 0.2s; animation: tm-bob 3.2s ease-in-out infinite; }
.tm .tm-buddy:hover .tm-still { transform: translateY(-3px) scale(1.04); }
.tm .tm-hint { font-size: 12px; font-weight: 700; color: #fff; background: var(--tm-accent); border-radius: 999px; padding: 3px 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); white-space: nowrap; }
.tm[data-size="small"] .tm-still { width: 64px; height: 64px; }
.tm[data-size="large"] .tm-still { width: 110px; height: 110px; }
.tm.tm-is-open .tm-hint { display: none; }
.tm.tm-left .tm-buddy { right: auto; left: 16px; }
.tm.tm-tuck .tm-buddy { right: 0; bottom: 96px; }
.tm.tm-tuck .tm-still { width: 48px; height: 48px; }
.tm.tm-tuck .tm-hint { display: none; }
.tm.tm-packed:not(.tm-has-3d) .tm-still { width: 52px; height: 52px; animation: none; border-radius: 12px; background: var(--tm-navy); padding: 4px; border: 2px solid var(--tm-accent); }
.tm.tm-packed:not(.tm-has-3d) .tm-hint { display: none; }
.tm.tm-has-3d .tm-buddy { display: none; }
.tm[data-state="speaking"] .tm-still { animation: tm-talk 0.28s ease-in-out infinite alternate; }
.tm[data-state="listening"] .tm-still { animation: tm-bob 1.4s ease-in-out infinite; }
@keyframes tm-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes tm-talk { from { transform: scale(1); } to { transform: scale(1.05) translateY(-2px); } }

/* The live panel */
.tm .tm-panel { position: fixed; right: 16px; bottom: 132px; z-index: 2147482995; width: 380px; max-height: min(620px, calc(100vh - 156px)); display: flex; flex-direction: column; background: var(--tm-panel); border: 1px solid var(--tm-edge); border-radius: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); overflow: hidden; }
.tm .tm-head { display: flex; align-items: center; gap: 10px; padding: 12px 10px 10px 16px; }
.tm .tm-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #52525b; }
.tm .tm-panel[data-state="listening"] .tm-dot { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2); animation: tm-pulse 1.4s infinite; }
.tm .tm-panel[data-state="speaking"] .tm-dot, .tm .tm-panel[data-state="thinking"] .tm-dot { background: var(--tm-accent); box-shadow: 0 0 0 4px rgba(255, 86, 0, 0.22); }
@keyframes tm-pulse { 50% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.06); } }
.tm .tm-who { flex: 1 1 auto; min-width: 0; }
.tm .tm-who h2 { margin: 0; font-size: 16px; font-weight: 700; color: #fafafa; letter-spacing: 0; display: flex; align-items: center; gap: 8px; line-height: 1.2; }
.tm .tm-status { margin: 2px 0 0; font-size: 13px; color: var(--tm-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm .tm-badge { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: #18181b; background: var(--tm-accent); border-radius: 5px; padding: 1px 6px; }
.tm .tm-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--tm-dim); font-size: 24px; line-height: 1; cursor: pointer; }
.tm .tm-icon:hover, .tm .tm-icon[aria-expanded="true"] { color: #fafafa; border-color: var(--tm-edge); }

.tm .tm-meter { display: flex; align-items: center; justify-content: center; gap: 4px; height: 26px; padding: 0 16px; border-bottom: 1px solid var(--tm-line); }
.tm .tm-meter i { display: block; width: 4px; height: 18px; border-radius: 2px; background: var(--tm-edge); transform: scaleY(0.12); transform-origin: center; transition: transform 0.08s linear; }
.tm .tm-panel[data-state="speaking"] .tm-meter i { background: var(--tm-accent); }
.tm .tm-panel[data-state="listening"] .tm-meter i { background: #22c55e; }

.tm .tm-lines { list-style: none; margin: 0; padding: 12px 14px; flex: 1 1 auto; min-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.tm .tm-lines:empty::before { content: 'Ask about PaceNotes, project rooms, pricing or how to start. Out loud, or type it.'; color: var(--tm-dim); font-size: 14px; padding: 18px 4px; text-align: center; }
.tm .tm-line { margin: 0; }
.tm .tm-who-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--tm-dim); margin-bottom: 2px; }
.tm .tm-text { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.tm .tm-you .tm-text { color: #d4d4d8; }
.tm .tm-you.tm-live .tm-text { color: var(--tm-dim); font-style: italic; }
.tm .tm-grant { background: var(--tm-card); border: 1px solid var(--tm-line); border-left: 3px solid var(--tm-accent); border-radius: 12px; padding: 10px 12px; }
.tm .tm-grant .tm-who-label { color: var(--tm-accent); }
.tm .tm-grant .tm-text { color: #fafafa; }
.tm .tm-err .tm-text { color: #fca5a5; }

.tm .tm-controls { padding: 10px 14px 12px; border-top: 1px solid var(--tm-line); display: flex; flex-direction: column; gap: 8px; }
.tm .tm-talk { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 14px; background: var(--tm-accent); color: #fff; font-size: 17px; font-weight: 700; cursor: pointer; }
.tm .tm-talk:hover { background: var(--tm-accent-dark); }
.tm .tm-talk[aria-pressed="true"] { background: #18181b; border: 2px solid #22c55e; color: #fafafa; }
.tm .tm-mic { width: 14px; height: 20px; border: 2.5px solid currentColor; border-radius: 8px; position: relative; }
.tm .tm-mic::after { content: ''; position: absolute; left: 50%; bottom: -8px; width: 2.5px; height: 6px; background: currentColor; transform: translateX(-50%); }
.tm .tm-note { margin: 0; font-size: 12px; color: var(--tm-dim); text-align: center; }
.tm.tm-mic-on .tm-note, .tm.tm-no-voice .tm-talk, .tm.tm-no-voice .tm-note { display: none; }
.tm .tm-type { display: flex; gap: 8px; }
.tm .tm-type input { flex: 1 1 auto; min-width: 0; min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--tm-edge); background: var(--tm-bg); font-size: 16px; }
.tm .tm-type input::placeholder { color: #8b8b94; }
.tm .tm-send { flex: none; min-height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--tm-edge); background: var(--tm-card); font-weight: 600; cursor: pointer; }
.tm .tm-send:hover { border-color: var(--tm-accent); }

.tm .tm-settings { padding: 10px 14px; border-top: 1px solid var(--tm-line); display: flex; flex-direction: column; gap: 10px; background: #0e0f13; max-height: 46vh; overflow-y: auto; }
.tm .tm-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tm .tm-label { flex: none; width: 74px; font-size: 13px; color: var(--tm-dim); }
.tm .tm-seg { display: inline-flex; border: 1px solid var(--tm-edge); border-radius: 10px; overflow: hidden; }
.tm .tm-seg button { min-height: 36px; padding: 0 12px; border: 0; background: transparent; color: var(--tm-dim); font-size: 13px; font-weight: 600; cursor: pointer; }
.tm .tm-seg button[aria-pressed="true"] { background: var(--tm-accent); color: #fff; }
.tm .tm-bodies { display: flex; flex-wrap: wrap; gap: 6px; }
.tm .tm-pill { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--tm-edge); background: transparent; font-size: 13px; cursor: pointer; }
.tm .tm-pill[aria-pressed="true"] { border-color: var(--tm-accent); color: #fff; background: rgba(255, 86, 0, 0.15); }
.tm .tm-swatches { display: flex; flex-direction: column; gap: 8px; flex: 1 1 100%; }
.tm .tm-swatch-row { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.tm .tm-swatch-kind { width: 79px; font-size: 13px; color: var(--tm-dim); text-transform: capitalize; }
.tm .tm-swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--tm-edge); background: #52525b; cursor: pointer; padding: 0; }
.tm .tm-swatch[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 2px var(--tm-accent); }
.tm .tm-btn { min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--tm-edge); background: var(--tm-card); font-size: 13px; font-weight: 600; cursor: pointer; }
.tm .tm-desk { font-size: 13px; font-weight: 600; }
.tm .tm-fine { margin: 0; font-size: 11.5px; color: #8b8b94; }
.tm .tm-fine a { color: inherit; text-decoration: underline; }

.tm .tm-foot { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--tm-line); background: #0e0f13; }
.tm .tm-cta { flex: none; display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 10px; background: #fafafa; color: #111 !important; font-weight: 700; font-size: 14px; text-decoration: none !important; }

/* Settings take the transcript's place while they are open. */
.tm .tm-panel.tm-set-open .tm-lines, .tm .tm-panel.tm-set-open .tm-meter { display: none; }
.tm .tm-panel.tm-set-open .tm-settings { max-height: none; flex: 1 1 auto; }

/* Phones: the panel is a sheet across the bottom, above the character. */
@media (max-width: 600px) {
  .tm .tm-buddy { right: 10px; bottom: 10px; }
  .tm .tm-still { width: 72px; height: 72px; }
  .tm.tm-is-open .tm-buddy { display: none; }
  .tm .tm-panel { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: calc(100dvh - 76px); border-radius: 18px; }
  .tm .tm-lines { min-height: 90px; }
  .tm .tm-foot { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .tm-still, .tm[data-state] .tm-still { animation: none !important; } .tm-meter i { transition: none; } }
@media print { .tm { display: none !important; } }
