/* QuantyGPT one screen (Beta, QG_ONE_WIDGET): chat, voice call and video call on one full-height screen, app-first.
   Clean look (2 Dec 2026): one calm chat screen, light by default; dark follows the device or the site's theme switch
   (html[data-theme]). Voice call: full screen, the orb only. Video call: her picture fills the screen, one row of five
   controls at the bottom, your camera in a small tile. Phone first (390 px), then laptop; safe areas for the app shell.
   Every box has 2px corners; the only round things are the orb and her small face. */

/* The palette, written once. Light is the default; the dark values are mapped in below. */
.one, .one-launch {
  --o-bg: #ffffff; --o-text: #1f1d1a; --o-muted: #6b655c; --o-line: #dcd4c6; --o-surface: #f3efe8;
  --o-accent: #a8492b; --o-link: #a8492b; --o-on: #ffffff; --o-danger: #c62828; --o-night: #0b1020;
  --o-d-bg: #1c1b19; --o-d-text: #f2ede4; --o-d-muted: #b5ac9f; --o-d-line: #3f3a34; --o-d-surface: #2a2723; --o-d-link: #e3967a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.one, .one-launch) { --o-bg: var(--o-d-bg); --o-text: var(--o-d-text); --o-muted: var(--o-d-muted);
    --o-line: var(--o-d-line); --o-surface: var(--o-d-surface); --o-link: var(--o-d-link); color-scheme: dark; }
}
:root[data-theme="dark"] :is(.one, .one-launch) { --o-bg: var(--o-d-bg); --o-text: var(--o-d-text); --o-muted: var(--o-d-muted);
  --o-line: var(--o-d-line); --o-surface: var(--o-d-surface); --o-link: var(--o-d-link); color-scheme: dark; }

.one {
  position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; height: 100vh; height: 100dvh;
  background: var(--o-bg); color: var(--o-text);
  font: 15px/1.5 var(--sans, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif); -webkit-tap-highlight-color: transparent;
}
:where(.one) *, :where(.one) *::before, :where(.one) *::after { box-sizing: border-box; border-radius: 2px; }
.one [hidden] { display: none !important; }
:where(.one) button, :where(.one) textarea, :where(.one) select { font: inherit; color: inherit; }
:where(.one) button { cursor: pointer; background: none; border: 1px solid transparent; margin: 0; }
:where(.one) p { margin: 0; }
.one :focus-visible { outline: 2px solid var(--o-link); outline-offset: 2px; }
.one svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html.one-open, html.one-open body { overflow: hidden; }
/* Round by clip-path, not by corners: the boxes keep 2px; only her small face and the orb are circles. */
.one-face { width: 32px; height: 32px; clip-path: circle(50%); object-fit: cover; flex: none; }

/* The launcher on a page with no doubt bar */
.one-launch {
  position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 900; display: inline-flex;
  align-items: center; gap: 8px; min-height: 48px; padding: 0 14px 0 8px; border: 1px solid var(--o-accent); border-radius: 2px;
  background: var(--o-accent); color: var(--o-on); font: 600 15px/1 var(--sans, system-ui, -apple-system, "Segoe UI", sans-serif);
  cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.one-launch img { width: 32px; height: 32px; clip-path: circle(50%); object-fit: cover; }
body.one-has-launch { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

/* Chat: a slim header */
.one-top {
  flex: none; display: flex; align-items: center; gap: 6px; min-height: 56px;
  padding: env(safe-area-inset-top) 6px 0; border-bottom: 1px solid var(--o-line); background: var(--o-bg);
}
.one-ib { width: 44px; height: 44px; display: inline-grid; place-items: center; color: var(--o-text); }
.one-ib:hover { background: var(--o-surface); }
.one-ib[aria-pressed="false"] { color: var(--o-muted); }
.one-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.one-who strong { display: block; font-size: 16px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.one-who small { display: block; font-size: 12px; line-height: 1.2; color: var(--o-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.one-beta { display: inline-block; margin-left: 4px; padding: 0 4px; border: 1px solid var(--o-line); color: var(--o-muted);
  font-size: 10px; font-weight: 600; line-height: 1.5; vertical-align: middle; }
.one-about { flex: none; padding: 6px 16px; border-bottom: 1px solid var(--o-line); color: var(--o-muted); font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.one-oncall {
  flex: none; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 16px;
  border: 0; border-bottom: 1px solid var(--o-line); border-radius: 0; background: var(--o-surface); color: var(--o-text);
  font-size: 14px; font-weight: 600; text-align: left;
}
.one-oncall i { width: 8px; height: 8px; background: var(--o-danger); animation: one-blink 1.2s infinite; }
.one-oncall span:last-child { margin-left: auto; color: var(--o-muted); font-weight: 500; font-size: 13px; }
@keyframes one-blink { 50% { opacity: .3; } }

/* Chat: the conversation. Your words in a soft box on the right; her answer as plain text. */
.one-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column;
  gap: 18px; padding: 20px 16px; }
.one-empty { margin: auto 0; display: grid; gap: 12px; padding: 8px 0; }
.one-hello { font-size: 24px; font-weight: 600; line-height: 1.25; }
.one-sub { color: var(--o-muted); font-size: 15px; }
.one-starters { display: grid; gap: 8px; margin-top: 6px; }
.one-st { text-align: left; min-height: 44px; padding: 10px 14px; background: var(--o-bg); border-color: var(--o-line); font-size: 15px; line-height: 1.4; }
.one-st:hover { background: var(--o-surface); }
.one-msg { max-width: 88%; font-size: 16px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.one-you { align-self: flex-end; max-width: 78%; padding: 10px 14px; background: var(--o-surface); }
.one-her { align-self: stretch; max-width: 100%; }
.one-her p + p { margin-top: 10px; }
.one-her pre { margin: 10px 0 0; padding: 10px; overflow-x: auto; background: var(--o-surface); border: 1px solid var(--o-line); white-space: pre; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; }
.one-note { align-self: center; max-width: 94%; color: var(--o-muted); font-size: 13px; text-align: center; }
.one-note a, .one-her a { color: var(--o-link); }
.one-msg .qg-support { margin-top: 10px; }
.one-dots { align-self: flex-start; display: flex; gap: 4px; padding: 8px 0; }
.one-dots i { width: 6px; height: 6px; background: var(--o-muted); animation: one-eq .9s infinite ease-in-out; }
.one-dots i:nth-child(2) { animation-delay: .15s; } .one-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes one-eq { 50% { transform: scaleY(.35); opacity: .5; } }

/* Chat: one composer box at the bottom, one small Beta line under it */
.one-dock { flex: none; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--o-bg); }
.one-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; padding: 6px 10px;
  border: 1px solid var(--o-line); background: var(--o-surface); font-size: 14px; }
.one-bar span { flex: 1 1 8rem; }
.one-bar button { min-height: 36px; min-width: 44px; padding: 0 12px; border-color: var(--o-line); background: var(--o-bg); }
.one-line { margin: 0 0 8px; color: var(--o-muted); font-size: 13px; }
.one-pic { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--o-muted); }
.one-pic img { width: 40px; height: 40px; object-fit: cover; border: 1px solid var(--o-line); }
.one-comp { background: var(--o-bg); border: 1px solid var(--o-line); padding: 4px 6px 6px; }
.one-comp:focus-within { border-color: var(--o-muted); }
.one-comp textarea { display: block; width: 100%; min-height: 44px; max-height: 120px; margin: 0; padding: 10px 8px 6px; resize: none;
  border: 0; outline: 0; background: transparent; font-size: 16px; line-height: 1.4; }
.one-comp textarea:focus-visible { outline: 0; }
.one-comp textarea::placeholder { color: var(--o-muted); }
.one-row { display: flex; align-items: center; gap: 2px; }
.one-row .one-grow { flex: 1; }
.one-row .one-ib { color: var(--o-muted); }
.one-row .one-ib:hover { color: var(--o-text); }
.one-row .one-callb { width: auto; display: inline-flex; gap: 4px; padding: 0 8px; font-size: 14px; }
.one-mic.on { background: var(--o-danger); color: #fff !important; }
.one-send { margin-left: 4px; background: var(--o-accent); color: var(--o-on) !important; }
.one-send:hover { background: var(--o-accent); }
.one-send:disabled { opacity: .35; cursor: default; }
.one-foot { margin-top: 8px; color: var(--o-muted); font-size: 12px; line-height: 1.4; text-align: center; }

/* A page with its own chat (/chat, /workspace): this screen gives the calls only. No box to type in, no starters, no
   New chat; one button back to the page's chat. Under the page's own chat box, one row with the two calls (it takes
   the page's own colours). */
.one-callsonly .one-top [data-one="new"] { display: none; }
.one-backchat { display: block; width: 100%; min-height: 48px; padding: 0 16px; border: 1px solid var(--o-line) !important;
  background: var(--o-surface) !important; color: var(--o-text); font-weight: 600; font-size: 15px; }
.one-callrow { display: flex; gap: 8px; margin: 8px 0 0; }
.one-cr { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 12px;
  border: 1px solid rgba(127, 127, 127, .45); border-radius: 2px; background: transparent; color: inherit;
  font: 600 14px/1.2 var(--sans, system-ui, -apple-system, "Segoe UI", sans-serif); cursor: pointer; }
.one-cr:hover { background: rgba(127, 127, 127, .12); }
.one-cr:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.one-cr svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* /call with the one screen on: a thin page; the old call screen is not shown while the call opens */
html.one-thin .call-main { visibility: hidden; }

/* + sheet */
.one-scrim { position: absolute; inset: 0; z-index: 20; background: rgba(0, 0, 0, .4); border-radius: 0; }
.one-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 21; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--o-bg); border-top: 1px solid var(--o-line); }
.one-sheet h2 { margin: 0 0 10px; color: var(--o-muted); font-size: 13px; font-weight: 600; }
.one-sheet h2 + select { border: 1px solid var(--o-line); background: var(--o-bg); padding: 0 10px; }
.one-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.one-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 72px; padding: 10px 4px;
  background: var(--o-surface); font-size: 12px; }

/* Calls: the shared frame */
.one-call { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; overflow: hidden; }
.one-ctop { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 16px 8px; }
.one-gap { width: 44px; flex: none; }
.one-ctop .one-t { flex: 1; min-width: 0; text-align: center; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Voice call: full screen, the orb only, in the page's own light or dark */
.one-voice { background: var(--o-bg); color: var(--o-text); }
.one-voice .one-ib { background: var(--o-surface); }
.one-voice .one-t { color: var(--o-muted); }
.one-cmid { position: relative; z-index: 2; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 8px 20px; }
.one-voice .one-orb { width: 168px; height: 168px; margin-bottom: 18px; }
.one-cname { font-size: 20px; font-weight: 600; }
.one-time { color: var(--o-muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.one-state { min-height: 1.5em; color: var(--o-muted); font-size: 15px; text-align: center; }
.one-cap { width: min(100%, 520px); min-height: 3em; max-height: 9em; overflow-y: auto; text-align: center; font-size: 17px; line-height: 1.5; }
.one-cbtns { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  width: min(100%, 460px); margin: 0 auto; padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); }
.one-cb { height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--o-surface); border-color: var(--o-line); color: var(--o-text); font-size: 12px; }
.one-cb[aria-pressed="true"] { background: var(--o-bg); border: 2px solid var(--o-text); }
.one-cb.one-end { background: var(--o-danger); border-color: var(--o-danger); color: #fff; font-weight: 600; }

/* Video call: her picture fills the screen, a soft dark scrim top and bottom, one row of five controls */
.one-video { background: var(--o-night); color: #fff; }
.one-fill { position: absolute; inset: 0; z-index: 0; }
.one-fill img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; border-radius: 0; }
.one-fill img.one-blur { filter: blur(26px) brightness(.55); transform: scale(1.15); }
.one-fill img.one-sharp { object-fit: cover; object-position: 50% 30%; }  /* phone: her picture fills the screen */
.one-speaking .one-fill img.one-sharp { animation: one-breathe 3s ease-in-out infinite; }
@keyframes one-breathe { 50% { transform: scale(1.02); } }
.one-fill::before, .one-fill::after { content: ""; position: absolute; left: 0; right: 0; border-radius: 0; }
.one-fill::before { top: 0; height: 160px; background: linear-gradient(rgba(11, 16, 32, .8), rgba(11, 16, 32, 0)); }
.one-fill::after { bottom: 0; height: 340px; background: linear-gradient(rgba(11, 16, 32, 0), rgba(11, 16, 32, .93) 62%); }
.one-video .one-ib { color: #fff; background: rgba(255, 255, 255, .16); }
.one-vwho { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.one-video .one-ctop { gap: 8px; }
.one-vwho strong { font-size: 17px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.one-vwho span { font-size: 13px; color: rgba(255, 255, 255, .88); font-variant-numeric: tabular-nums; white-space: nowrap; }
.one-vlang { flex: none; max-width: 7.5rem; height: 44px; padding: 0 8px; color: #fff; background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28); font-size: 14px; }
.one-vlang option { color: #1f1d1a; background: #fff; }
.one-self { position: absolute; top: calc(76px + env(safe-area-inset-top)); right: 16px; z-index: 3; width: 96px; height: 128px;
  display: grid; place-items: center; overflow: hidden; padding: 8px; background: #1c2540; border: 1px solid rgba(255, 255, 255, .3);
  color: rgba(255, 255, 255, .9); font-size: 12px; text-align: center; line-height: 1.3; white-space: pre-line; }
.one-self:has(video) { padding: 0; }
.one-self video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); border-radius: 0; }
.one-video .one-cmid { align-items: stretch; justify-content: flex-end; gap: 8px; padding: 0 20px 6px; }
.one-strip { max-height: 7.2em; overflow-y: auto; font-size: 18px; font-weight: 500; line-height: 1.4; text-shadow: 0 1px 3px rgba(0, 0, 0, .55); }
.one-strip:empty { display: none; }
.one-strip.one-heard { color: rgba(255, 255, 255, .85); font-style: italic; font-weight: 400; }
.one-nocap .one-strip { display: none; }
.one-vstate { min-height: 1.4em; color: rgba(255, 255, 255, .85); font-size: 13px; }
.one-vbtns { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px;
  width: min(100%, 520px); margin: 0 auto; padding: 10px 16px calc(24px + env(safe-area-inset-bottom)); }
.one-vb { height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0;
  color: #fff; background: rgba(255, 255, 255, .16); font-size: 11px; white-space: nowrap; }
.one-vb[aria-pressed="true"] { background: #fff; color: #1f1d1a; }
.one-vb.one-end { background: var(--o-danger); color: #fff; font-weight: 600; }

/* The orb: round by clip-path; it breathes while she listens and speaks */
.one-orb { position: relative; width: 64px; height: 64px; flex: none; opacity: .75; }
.one-orb::before { content: ""; position: absolute; inset: 0; clip-path: circle(50%);
  background: radial-gradient(circle at 35% 30%, #fff 0, #e9a98e 22%, #a8492b 62%, #5a2312 100%); }
.one-speaking .one-orb { opacity: 1; animation: one-pulse 1.1s ease-in-out infinite; }
.one-listening .one-orb { opacity: .9; animation: one-pulse 2.4s ease-in-out infinite; }
.one-muted .one-orb { opacity: .35; animation: none; }
@keyframes one-pulse { 0%, 100% { transform: scale(.94); } 50% { transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) {
  .one *, .one *::before, .one *::after { animation: none !important; transition: none !important; }
}

/* Welcome clip (QG_WELCOME_CLIP_URL), once per mode, with Skip */
.one-wel { position: absolute; inset: 0; z-index: 30; background: #000; display: flex; flex-direction: column; justify-content: flex-end; }
.one-wel video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.one-skip { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 2; min-height: 44px; padding: 0 16px;
  color: #fff; background: rgba(0, 0, 0, .55); border-color: rgba(255, 255, 255, .5) !important; font-weight: 600; }

/* Laptop: the chat is a readable column; the calls keep their parts in the middle */
@media (min-width: 900px) {
  .one-top { padding-left: 12px; padding-right: 12px; }
  .one-log, .one-dock, .one-about { padding-left: max(24px, calc((100% - 760px) / 2)); padding-right: max(24px, calc((100% - 760px) / 2)); }
  .one-starters { grid-template-columns: repeat(3, 1fr); }
  .one-voice .one-orb { width: 200px; height: 200px; }
  .one-ctop { padding-left: 24px; padding-right: 24px; }
  .one-self { right: 24px; width: 160px; height: 120px; top: calc(80px + env(safe-area-inset-top)); }
  .one-fill img.one-sharp { object-fit: contain; object-position: 50% 0; }  /* laptop: whole, on her blurred picture */
  .one-video .one-cmid { padding-left: max(20px, calc((100% - 760px) / 2)); padding-right: max(20px, calc((100% - 760px) / 2)); }
  .one-strip { text-align: center; }
  .one-vstate { text-align: center; }
}

/* The full page (/chat, signed in; docs/quantygpt/ONE_SCREEN.md): the one screen is the page. A top bar (menu, her
   face and name, speaker, new chat), one greeting, the ask bar; the notes sit in the menu behind one small link. Until
   the sign-in is known the old page stays out of sight; the free-question sheet sits over the screen. */
html.one-page-wait body > * { visibility: hidden; }
html.one-open #limit-sheet { z-index: 1100; }
.one-page .one-top { border-bottom-color: transparent; }
.one-page .one-empty { text-align: center; }
.one-page .one-hello { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.3; }
.one-info { min-height: 44px; padding: 0 12px; color: var(--o-muted); font-size: 12px; text-decoration: underline;
  text-underline-offset: 3px; }
.one-page .one-foot { margin-top: 2px; }
.one-page .one-dock { padding-bottom: calc(2px + env(safe-area-inset-bottom)); }
/* The menu: a drawer from the left, over the scrim */
.one-menu { position: absolute; top: 0; bottom: 0; left: 0; z-index: 21; width: min(320px, 86%); display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain; padding: env(safe-area-inset-top) 0 calc(12px + env(safe-area-inset-bottom));
  background: var(--o-bg); border-right: 1px solid var(--o-line); }
.one-mhead { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 6px 0 14px; }
.one-mhead strong { font-size: 16px; font-weight: 600; }
.one-mhead .one-grow { flex: 1; }
.one-mi { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 48px; padding: 0 16px; color: var(--o-text);
  font-size: 15px; text-align: left; text-decoration: none; }
.one-mi:hover { background: var(--o-surface); }
.one-mi svg { color: var(--o-muted); }
.one-notes { margin: 8px 0 0; padding: 14px 16px 4px; border-top: 1px solid var(--o-line); }
.one-notes:focus { outline: 0; }
.one-notes h2 { margin: 0 0 8px; color: var(--o-muted); font-size: 13px; font-weight: 600; }
.one-notes p { margin: 0 0 10px; color: var(--o-muted); font-size: 13px; line-height: 1.5; }
.one-mfoot { margin: 0; padding: 4px 16px 0; color: var(--o-muted); font-size: 13px; }
.one-mfoot a { display: inline-block; min-height: 44px; line-height: 44px; color: var(--o-link); }
