:root { color-scheme: dark; --bg: #0b1020; --panel: #141b2e; --line: #2c3654; --text: #e8edf9; --muted: #9aa6c4; --accent: #c4ccff; --mint: #8ee6d2; }
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; background: radial-gradient(ellipse at top, #18203a, var(--bg) 60%); color: var(--text); font: 15px/1.45 "Segoe UI", system-ui, sans-serif; min-height: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.talk:focus-visible, .primary:focus-visible { outline-offset: 3px; }
.app { max-width: 980px; margin: 0 auto; padding: 18px 18px 8px; display: grid; gap: 12px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand strong { font-size: 22px; letter-spacing: .2px; }
.brand .tag { color: var(--muted); font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); align-self: center; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.status { color: var(--muted); font-size: 13px; }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; }
.ghost:hover { border-color: #56628a; }
.primary { background: var(--accent); color: #141a33; border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 650; }
.primary:hover { filter: brightness(1.06); }

.stage { position: relative; height: min(64vh, 600px); border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #0d1222; }
.stage sv-presenter { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .7s ease; }
.stage[data-booting=false] sv-presenter { opacity: 1; }
.boot-glow { position: absolute; left: 50%; top: 45%; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%;
  background: radial-gradient(circle, #9fb6ff55 0%, #9fb6ff18 45%, transparent 70%); animation: glow 1.6s ease-in-out infinite; pointer-events: none; }
.stage[data-booting=false] .boot-glow { display: none; }
@keyframes glow { 0%, 100% { transform: scale(.85); opacity: .55; } 50% { transform: scale(1.08); opacity: 1; } }
.caption { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); max-width: min(86%, 640px); padding: 10px 16px; border-radius: 14px;
  background: #121a30e8; border: 1px solid #3a4670; font-size: 16px; text-align: center; opacity: 0; transition: opacity .25s; pointer-events: none; }
.caption.on { opacity: 1; }
.caption { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; max-height: calc(3 * 1.45em + 22px); overflow: hidden; overflow-wrap: anywhere; }
.share-pill { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 99px; background: #13233bdd; border: 1px solid #3d8f7f; font-size: 13px; }
.share-pill i { width: 8px; height: 8px; border-radius: 50%; background: #ff5d6c; animation: glow 1.4s infinite; }

.controls { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; }
.talk { display: flex; align-items: center; gap: 8px; border-radius: 12px; border: 1px solid #4b5a8a; background: #1c2542; padding: 10px 16px; font-weight: 600; user-select: none; touch-action: none; }
.talk.on { background: #3b2240; border-color: #ff7a9a; }
.mic { width: 10px; height: 10px; border-radius: 50%; background: #ff7a9a; }
.chat { display: flex; gap: 8px; }
.chat input { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.hint { color: var(--muted); font-size: 13.5px; }
kbd { border: 1px solid #4a557a; border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; font-size: 12px; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 26vh; overflow: auto; }
.log li { overflow-wrap: anywhere; padding: 7px 11px; border-radius: 10px; background: var(--panel); border: 1px solid #222b44; font-size: 14px; }
.log li.user { background: #1b2340; }
.log li b { color: var(--muted); font-weight: 600; margin-right: 6px; }
.foot { max-width: 980px; margin: 4px auto 18px; padding: 0 18px; color: #6f7a99; font-size: 12px; }

dialog { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--text); padding: 0; width: min(92vw, 380px); }
dialog::backdrop { background: #04070fcc; }
.settings { display: grid; gap: 12px; padding: 18px; }
.settings h2 { margin: 0; font-size: 18px; }
.settings p { margin: 0; color: var(--muted); font-size: 14px; }
.settings label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.settings input, .settings select { background: #0f1526; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; color: var(--text); }
.settings menu { margin: 0; padding: 0; display: flex; justify-content: flex-end; }
.error { color: #ff9aa8 !important; }
@media (max-width: 640px) { .controls { grid-template-columns: 1fr 1fr; } .chat { grid-column: 1 / -1; } .brand .tag { display: none; } }

/* ---- screen sharing: guide, live preview, mini-window offer (main window only) ---- */
.side { position: absolute; top: 12px; right: 12px; width: 232px; display: grid; gap: 10px; pointer-events: none; z-index: 2; }
.side > * { pointer-events: auto; }
.guide { list-style: none; margin: 0; padding: 10px 30px 10px 12px; display: grid; gap: 6px; counter-reset: step; position: relative; font-size: 13.5px;
  background: #121a30ee; border: 1px solid #3a4670; border-radius: 14px; transition: opacity .6s; }
.guide.done { opacity: 0; }
.guide li { display: flex; align-items: center; gap: 9px; color: var(--muted); counter-increment: step; }
.guide li::before { content: counter(step); flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 1px solid #4b5a8a; }
.guide li.current { color: var(--text); font-weight: 600; }
.guide li.current::before { background: var(--accent); color: #141a33; border-color: var(--accent); }
.guide li.done { color: #6f7a99; text-decoration: line-through; }
.guide li.done::before { content: "\2713"; background: #1d4a43; color: var(--mint); border-color: #3d8f7f; }
.guide li[hidden] { display: none; }
.guide-x { position: absolute; top: 4px; right: 6px; background: transparent; border: 0; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 5px; }
.nudge { animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 #c4ccff00; } 50% { box-shadow: 0 0 0 6px #c4ccff55; } }
.sharebox { padding: 10px; display: grid; gap: 8px; background: #121a30ee; border: 1px solid #3d8f7f; border-radius: 14px; font-size: 13px; }
.sharebox video { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #05070e; border-radius: 8px; border: 1px solid #2c3654; }
.sharebox-meta { display: grid; gap: 1px; }
.sharebox-meta span { color: var(--muted); font-size: 12.5px; }
.sharebox[data-looking=true] .sharebox-meta span { color: var(--mint); }
.sharebox-actions { display: flex; gap: 8px; }
.sharebox-actions .ghost { flex: 1; padding: 6px 8px; font-size: 13px; }
.sharebox-actions .danger { border-color: #7a3a48; color: #ffb3bf; }
.sharebox-note { margin: 0; color: #8793b3; font-size: 12px; }
.offer { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid #2c3654; color: var(--text); }
.offer .primary { padding: 7px 10px; font-size: 13px; }
@media (max-width: 760px) {
  .side { width: 168px; top: 8px; right: 8px; gap: 6px; }
  .guide { font-size: 12.5px; padding: 8px 26px 8px 9px; }
  .sharebox { padding: 7px; gap: 5px; font-size: 12px; }
  .sharebox-note { display: none; }
  .sharebox-actions .ghost { padding: 4px 6px; font-size: 12px; }
}

.link { background: none; border: 0; padding: 0 0 0 6px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }
.link:hover { filter: brightness(1.15); }
#sample { margin-left: 8px; padding: 5px 12px; border: 1px solid #5b6aa8; border-radius: 99px; text-decoration: none; background: #1c2542; color: #dfe5ff; font-weight: 600; }
#sample:hover { background: #26315a; }
.wake { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); z-index: 3; padding: 16px 28px; border: 0; border-radius: 999px;
  background: var(--accent); color: #141a33; font-size: 19px; font-weight: 700; box-shadow: 0 8px 30px #0009; animation: wake-pulse 1.8s ease-in-out infinite; }
@keyframes wake-pulse { 0%, 100% { box-shadow: 0 8px 30px #0009, 0 0 0 0 #c4ccff66; } 50% { box-shadow: 0 8px 30px #0009, 0 0 0 14px #c4ccff00; } }

/* ---- finish: what she is doing, a speech-bubble caption, a quieter page */
.stage { transition: box-shadow .25s ease, border-color .25s ease; }
.stage[data-state=listening] { border-color: #ff7a9a; box-shadow: 0 0 0 2px #ff7a9a55, 0 0 34px #ff7a9a33; }
.stage[data-state=speaking] { border-color: #6fd6c0; box-shadow: 0 0 0 1px #6fd6c044; }
.state-chip { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: none; gap: 6px; padding: 8px 12px; border-radius: 99px; background: #121a30d9; border: 1px solid #3a4670; }
.state-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: dot 1s ease-in-out infinite; }
.state-chip i:nth-child(2) { animation-delay: .15s; } .state-chip i:nth-child(3) { animation-delay: .3s; }
.stage[data-state=thinking] .state-chip { display: flex; }
.stage[data-state=listening] .state-chip { display: flex; border-color: #ff7a9a; }
.stage[data-state=listening] .state-chip i { background: #ff7a9a; animation-duration: .6s; }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-4px); opacity: 1; } }
.caption { font-size: 15.5px; line-height: 1.45; box-shadow: 0 8px 26px #0007; border-radius: 16px; max-width: min(78%, 520px); bottom: 12px; padding: 8px 14px; }
.history { color: var(--muted); font-size: 13px; }
.history summary { cursor: pointer; width: max-content; padding: 2px 0; list-style-position: inside; }
.history[open] summary { margin-bottom: 8px; }
.hint { font-size: 13px; }
.foot { font-size: 11.5px; opacity: .85; }

.memory-note { font-size: 12px !important; line-height: 1.5; }

/* value recap: "Today with Mio" card, the Watch-for focus line, and the settings field */
.recap { position: absolute; left: 14px; top: 14px; width: min(340px, calc(100% - 28px)); max-height: calc(100% - 28px); overflow: auto; z-index: 4; display: grid; gap: 8px; padding: 14px; border-radius: 16px; background: #121a30f5; border: 1px solid #3d8f7f; box-shadow: 0 10px 30px #0009; font-size: 13.5px; }
.recap[hidden] { display: none; }
.recap h2 { margin: 0; font-size: 16px; }
.recap-counts { margin: 0; color: var(--mint, #6fd6c0); font-size: 12.5px; }
.recap-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.recap-list li { line-height: 1.4; }
.recap-more { color: #8793b3; font-size: 12.5px; }
.rt { display: inline-block; margin-right: 7px; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 600; background: #24304f; color: #c9d3ee; }
.rt-catch { background: #4a2a35; color: #ffb3bf; } .rt-idea { background: #1f3b44; color: #8fe0f0; } .rt-cheer { background: #3b3a1f; color: #f2e08a; } .rt-question { background: #33284f; color: #cdb8ff; }
.recap-actions { display: flex; gap: 8px; justify-content: flex-end; }
.recap-actions button { padding: 6px 14px; font-size: 13px; }
.sharebox-focus { margin: 0; color: var(--mint, #6fd6c0); font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 760px) { .recap { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 62%; padding: 10px; gap: 6px; font-size: 12.5px; } }

/* ---- stream-style conversation feed: lower left of the stage, out of her face, scroll back any time */
.stage > .caption { display: none; }
.feed { position: absolute; left: 12px; bottom: 12px; z-index: 2; width: min(38%, 340px); max-height: 48%; margin: 0; padding: 0 4px 0 0; list-style: none;
  display: flex; flex-direction: column; gap: 6px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3a467088 transparent;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 26%); mask-image: linear-gradient(to bottom, transparent 0, #000 26%); }
.feed:hover { -webkit-mask-image: none; mask-image: none; }
.feed li { flex: none; padding: 7px 11px; border-radius: 12px; background: #121a30e0; border: 1px solid #323d62; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere;
  box-shadow: 0 4px 14px #0006; transition: opacity .6s ease; animation: feed-in .25s ease-out; }
.feed li.user { background: #1d2748e0; border-color: #45538a; align-self: flex-start; }
.feed li b { color: #9fb0e0; font-weight: 650; margin-right: 6px; font-size: 12.5px; }
.feed li.old { opacity: .38; }
.feed:hover li { opacity: 1; }
@keyframes feed-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 760px) { .feed { width: 54%; max-height: 40%; } .feed li { font-size: 13px; } }

.feed { bottom: 44px; }
.feed-toggle { position: absolute; left: 12px; bottom: 10px; z-index: 2; width: 30px; height: 26px; padding: 0; border-radius: 99px; border: 1px solid #45538a; background: #1c2542e6; font-size: 13px; line-height: 1; }
/* the comments switch (main stage and mini window): lit when comments show, dim with a slash when hidden, a dot for unread */
.feed-switch { position: relative; }
#feed-toggle { position: absolute; display: grid; place-items: center; } /* the stage button stays pinned to the lower-left corner */
.feed-switch:hover { border-color: #8ea2d8; }
.feed-switch.off { opacity: .6; filter: grayscale(1); }
.feed-switch.off::after { content: ""; position: absolute; left: 22%; right: 22%; top: 50%; height: 1.5px; background: #c9d3ee; transform: rotate(-35deg); }
.feed-switch i { display: none; position: absolute; right: -2px; top: -2px; width: 8px; height: 8px; border-radius: 50%; background: #ff7a9a; box-shadow: 0 0 0 2px #0d1222; }
.feed-switch.unread i { display: block; }
.feed-switch.unread { opacity: 1; filter: none; }

/* always-on-top mini window (Document Picture-in-Picture): every size is in em, and the base font follows the window */
body.mini { margin: 0; height: 100vh; overflow: hidden; background: #0d1222; position: relative; font-size: clamp(9px, 4vmin, 15px); }
.mini-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; background: #0d1222; }
.mini .caption { bottom: 4.4em; max-width: 92%; font-size: 1em; padding: .5em .8em; border-radius: .9em; }
.mini .share-pill { top: .6em; left: .6em; font-size: .82em; padding: .3em .7em; gap: .45em; }
.mini .share-pill i { width: .55em; height: .55em; }
.mini-status { position: absolute; top: .7em; right: .8em; color: #9aa6c4; font-size: .78em; max-width: 55%; text-align: right; text-shadow: 0 1px 3px #000; }
.mini-bar { position: absolute; left: .55em; right: .55em; bottom: .55em; display: flex; gap: .5em; }
.mini-bar button { font-size: .9em; border-radius: .8em; padding: .6em .7em; white-space: nowrap; }
.mini-bar .talk { flex: 1; min-width: 0; justify-content: center; gap: .5em; background: #1c2542e8; overflow: hidden; }
.mini-bar .talk.on { background: #3b2240; }
.mini-bar .mic { width: .65em; height: .65em; flex: none; }
.mini-bar .ghost { background: #141b2ee8; }
.mini-chat { position: absolute; left: .55em; right: .55em; bottom: 3.6em; top: 30%; display: flex; flex-direction: column; gap: .45em; padding: .55em;
  border-radius: .9em; background: #0f1528f2; border: 1px solid #2c3654; }
.mini-chat .log { flex: 1; min-height: 0; max-height: none; overflow: auto; gap: .35em; }
.mini-chat .log li { font-size: .88em; padding: .4em .6em; border-radius: .7em; }
.mini-chat .chat { gap: .4em; }
.mini-chat .chat input { font-size: .9em; padding: .5em .65em; border-radius: .7em; }
.mini-chat .chat button { font-size: .9em; padding: .4em .7em; border-radius: .7em; }
.mini.chatting .caption { bottom: 5.9em; }
.mini.chatting .mini-bar { display: none; }
@media (max-width: 250px) { .mini-share { display: none; } .mini-talk-label { font-size: .9em; } }
@media (max-height: 210px) { .mini-status, .mini .share-pill span { display: none; } }

.mini .caption { -webkit-line-clamp: 6; max-height: calc(6 * 1.4em + 1em); font-size: .92em; line-height: 1.4; max-width: 94%; }
@media (max-height: 260px) { .mini .caption { -webkit-line-clamp: 4; max-height: calc(4 * 1.35em + .8em); font-size: .82em; line-height: 1.35; padding: .35em .6em; } }
.mini-bar .talk.on .mic { animation: glow .9s ease-in-out infinite; }
.mini-bar .talk.on { border-color: #ff7a9a; }
.mini-bar button:focus-visible, .mini-chat input:focus-visible { outline-offset: -2px; }
@media (min-aspect-ratio: 8/5) { .mini-video { object-fit: contain; object-position: 50% 0; } }
.stage { contain: layout paint; }

/* mini window chat: an input strip, so her face stays in view */
.mini-chat { top: auto; bottom: .55em; background: none; border: 0; padding: 0; gap: .35em; }
.mini-chat .log { display: none; }
.mini-last { align-self: flex-start; max-width: 100%; padding: .25em .6em; border-radius: .7em; background: #1b2340d9; color: #c9d3ee; font-size: .8em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-last:empty { display: none; }
.mini-chat .chat input { background: #0f1528f2; border: 1px solid #3a4670; color: #e8edf9; min-width: 0; flex: 1; }
.mini-chat .chat button { background: #141b2ef2; }
.mini-state { position: absolute; inset: 0; pointer-events: none; border: 2px solid transparent; transition: border-color .2s ease, box-shadow .2s ease; }
body.mini[data-state=listening] .mini-state { border-color: #ff7a9a; box-shadow: inset 0 0 22px #ff7a9a44; }
body.mini[data-state=thinking] .mini-state { border-color: #c4ccff55; }

/* mini window: the same stream-style feed instead of a caption over her */
.mini .caption { display: none !important; }
.mini .feed { left: .55em; right: 28%; bottom: 3.7em; width: auto; max-height: 46%; gap: .35em; padding: 0 .2em 0 0; }
.mini .feed li { font-size: .82em; line-height: 1.35; padding: .4em .65em; border-radius: .8em; animation: none; }
.mini .feed li b { font-size: .9em; margin-right: .4em; }
.mini.chatting .feed { bottom: 3.9em; }
.mini.chatting .mini-last { display: none; }
@media (max-width: 260px) { .mini .feed { right: 8%; } }
@media (max-height: 230px) { .mini .feed { max-height: 40%; } .mini .feed li { font-size: .76em; } }
