:root { --blue:#0B3D91; --navy:#0A2A66; --orange:#F7931E; --white:#fff; --bg:#f4f6fb; --text:#16213a; --muted:#5b6782; }
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); }
.sofia { max-width: 760px; height: 100%; margin: 0 auto; display: flex; flex-direction: column; background: var(--white); box-shadow: 0 0 24px rgba(10,42,102,.12); }
.sofia-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: linear-gradient(135deg, var(--navy), var(--blue)); color: var(--white); border-bottom: 4px solid var(--orange); }
.brand { display: flex; align-items: center; gap: 12px; }
.badge { background: var(--orange); color: var(--navy); font-weight: 800; font-size: 12px; letter-spacing: .5px; padding: 6px 8px; border-radius: 6px; }
h1 { font-size: 18px; margin: 0; }
.tagline { margin: 2px 0 0; font-size: 12px; opacity: .85; }
.icon-btn { background: rgba(255,255,255,.12); color: var(--white); border: 1px solid rgba(255,255,255,.35); border-radius: 18px; padding: 6px 12px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.icon-btn[aria-pressed="true"] { background: var(--orange); color: var(--navy); border-color: var(--orange); }
.progress { display: flex; align-items: center; gap: 10px; padding: 8px 18px; font-size: 12px; color: var(--muted); border-bottom: 1px solid #e6e9f2; }
.progress .bar { flex: 1; height: 6px; background: #e6e9f2; border-radius: 3px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--orange); transition: width .3s; }
.log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; line-height: 1.45; font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot { align-self: flex-start; background: #eef2fb; border-top-left-radius: 4px; }
.msg.bot .who { display: block; font-size: 11px; font-weight: 700; color: var(--blue); margin-bottom: 2px; }
.msg.user { align-self: flex-end; background: var(--blue); color: var(--white); border-top-right-radius: 4px; }
.msg.typing { color: var(--muted); font-style: italic; }
.summary-card { align-self: stretch; border: 2px solid var(--blue); border-radius: 12px; padding: 16px 18px; background: var(--white); white-space: normal; }
.summary-card h2 { font-size: 16px; color: var(--navy); margin: 14px 0 6px; }
.summary-card h2:first-child { margin-top: 0; color: var(--blue); font-size: 17px; }
.summary-card ul, .summary-card ol { padding-left: 20px; margin: 6px 0; }
.summary-card li { margin: 3px 0; }
.cta { display: block; width: 100%; margin-top: 16px; padding: 14px; font-size: 16px; font-weight: 700; background: var(--orange); color: var(--navy); border: 0; border-radius: 10px; cursor: pointer; }
.cta:hover { filter: brightness(1.05); } .cta:disabled { opacity: .6; cursor: wait; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 8px; }
.chip { border: 1px solid var(--blue); color: var(--blue); background: var(--white); border-radius: 16px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.chip:hover { background: var(--blue); color: var(--white); }
.upload-row { display: flex; align-items: center; gap: 10px; padding: 0 18px 8px; }
.upload-btn { background: var(--navy); color: var(--white); padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.upload-btn input { display: none; }
.composer { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid #e6e9f2; }
.composer input { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid #cdd4e4; border-radius: 22px; font-size: 15px; outline: none; }
.composer input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,61,145,.15); }
.mic, .send { border: 0; border-radius: 22px; cursor: pointer; font-size: 15px; }
.mic { width: 46px; min-width: 44px; flex: 0 0 46px; background: #eef2fb; } .mic.listening { background: var(--orange); animation: pulse 1s infinite; }
.mic:disabled { opacity: .4; cursor: not-allowed; }
.send { flex: 0 0 auto; padding: 0 18px; background: var(--blue); color: var(--white); font-weight: 600; }
.footnote { margin: 0; padding: 0 18px 12px; font-size: 11px; color: var(--muted); }
.muted { color: var(--muted); font-size: 13px; }
/* avatar (video) layer: sits above the transcript, never replaces it */
.header-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.avatar-panel { position: relative; background: #0A2A66; height: 260px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.avatar-panel video { height: 100%; max-width: 100%; object-fit: contain; }
.ai-label { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 10px; letter-spacing: .3px; }
.avatar-status { position: absolute; color: #fff; font-size: 14px; background: rgba(0,0,0,.45); padding: 6px 12px; border-radius: 14px; }
.avatar-status:empty { display: none; }
.avatar-bar { position: absolute; bottom: 8px; left: 8px; right: 8px; display: flex; gap: 6px; align-items: center; }
.countdown { color: #fff; font-size: 12px; background: rgba(0,0,0,.55); padding: 4px 8px; border-radius: 10px; margin-right: auto; }
.mini-btn { background: rgba(255,255,255,.9); color: var(--navy); border: 0; border-radius: 12px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.talk-btn { background: var(--orange, #F7931E); color: #fff; border: 0; border-radius: 18px; padding: 8px 14px; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.talk-btn.on { background: #fff; color: var(--navy, #0A2A66); box-shadow: 0 0 0 2px var(--orange, #F7931E) inset; }
.talk-mic { margin-right: 6px; border: 1px solid rgba(10,42,102,.25); }
.talk-mic[aria-pressed="true"] { background: #ffe9cc; }
.talk-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.avatar-status[onclick], .avatar-status { cursor: default; }
@media (max-width: 520px) { .talk-btn { padding: 7px 10px; font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { .avatar-panel video { opacity: .98; } }
@media (max-width: 520px) { .avatar-panel { height: 200px; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(247,147,30,.25); } }
@media (max-width: 520px) { h1 { font-size: 15px; } .tagline { display: none; } .msg { max-width: 92%; } }
/* 0.3.25: Save chats / Delete chats / Reset as plain links inside the footnote (no new bar, same look) */
.chat-links { white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; }
.link-btn[aria-pressed="true"] { font-weight: 700; text-decoration: none; }
/* 0.3.30 (James, Oct 18 10:44 PM PT: "the footer should be just links to click"): one row of links, same 11px footnote;
   "Sophia is an AI assistant" opens the full notice in a small popup (✕ or a tap outside closes it) */
.footnote p { margin: 0; }
.foot-line { white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.foot-line::-webkit-scrollbar { display: none; }
.link-btn:focus-visible, .foot-pop-x:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }
.foot-pop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10,42,102,.35); cursor: pointer; white-space: normal; }
.foot-pop[hidden] { display: none; }
.foot-pop-box { position: relative; max-width: 420px; background: var(--white); color: var(--text); border-radius: 12px; padding: 18px 42px 16px 18px; font-size: 13px; line-height: 1.5; box-shadow: 0 8px 30px rgba(10,42,102,.3); cursor: auto; }
.foot-pop-x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; background: none; border: 0; font-size: 16px; line-height: 1; color: var(--muted); cursor: pointer; }
/* 0.3.31: Sophia is waiting for a typed field (company name / website / email): highlight the box */
.composer input.type-here { border-color: var(--blue); background: #f5f8ff; box-shadow: 0 0 0 3px rgba(11,61,145,.22); animation: typeHerePulse 1.6s ease-out 2; }
@keyframes typeHerePulse { 0% { box-shadow: 0 0 0 0 rgba(11,61,145,.45); } 100% { box-shadow: 0 0 0 9px rgba(11,61,145,0); } }
@media (prefers-reduced-motion: reduce) { .composer input.type-here { animation: none; } }
