:root {
  --blue: #0067A3;
  --blue-deep: #00365A;
  --ink: #0E1C2B;
  --muted: #4B5A69;
  --line: rgba(14, 28, 43, .10);
  --cyan: #18FFF3;
  --cyan-ink: #007C83;
  --mint: #98FFB9;
  --bg: #F3F8FB;
  --glass: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .88);
  --shadow: 0 10px 40px -18px rgba(0, 54, 90, .35);
  --r: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* icon sprite: the CSP blocks inline styles, so it is hidden here */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; }

/* drifting colour fields behind everything */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 26s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 60vmax; height: 60vmax; left: -20vmax; top: -25vmax; background: radial-gradient(circle, rgba(24, 255, 243, .55), transparent 65%); }
.aurora i:nth-child(2) { width: 55vmax; height: 55vmax; right: -22vmax; top: 10vmax; background: radial-gradient(circle, rgba(0, 103, 163, .28), transparent 65%); animation-duration: 32s; animation-delay: -8s; }
.aurora i:nth-child(3) { width: 50vmax; height: 50vmax; left: 10vmax; bottom: -30vmax; background: radial-gradient(circle, rgba(152, 255, 185, .5), transparent 65%); animation-duration: 38s; animation-delay: -15s; }
@keyframes drift { to { transform: translate3d(6vmax, 4vmax, 0) scale(1.12); } }
body[data-state="listening"] .aurora i:nth-child(1) { opacity: .8; }
body[data-state="speaking"] .aurora i:nth-child(2) { opacity: .75; }

/* header */
.bar { display: flex; align-items: center; gap: 14px; padding: 14px 28px; }
.logo { height: 34px; width: auto; }
.divider { width: 1px; height: 28px; background: var(--line); }
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand .name { font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; color: var(--blue-deep); }
.brand .tag { font-family: 'IBM Plex Mono', monospace; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.brand .tag a { color: var(--blue); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--muted); }

/* AI disclosure, always visible */

/* layout */
.layout {
  flex: 1; min-height: 0; width: 100%; max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); gap: 28px; padding: 20px 28px 28px;
}
.stage { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 18px; position: sticky; top: 0; align-self: start; }

/* the orb */
.orb {
  position: relative; width: min(340px, 78vw); aspect-ratio: 1; border: 0; padding: 0; border-radius: 50%;
  background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.orb canvas { position: absolute; inset: -14%; width: 128%; height: 128%; }
.orb:hover:not(:disabled) { transform: scale(1.02); }
.orb:active:not(:disabled) { transform: scale(.97); }
.orb:disabled { cursor: not-allowed; filter: saturate(.5); opacity: .75; }
.orb:focus-visible { outline: none; }
.orb:focus-visible::after { content: ''; position: absolute; inset: 6%; border-radius: 50%; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--blue); }
.orb-mic { position: absolute; left: 50%; top: 50%; width: 22%; height: 22%; transform: translate(-50%, -50%); color: #fff; opacity: .95; transition: opacity .3s, transform .3s; filter: drop-shadow(0 2px 6px rgba(0, 30, 60, .35)); }
body:not([data-state="off"]):not([data-state="idle"]) .orb-mic { opacity: 0; transform: translate(-50%, -50%) scale(.7); }

/* Selly's face: the avatar takes the orb's place; the orb comes back when the avatar is off or could not start */
.face-poster, .face-video, .face-badge, .face-only { display: none; }
body.has-face .face-only { display: inline; }
body.has-face .orb {
  width: min(300px, 70vw); aspect-ratio: 4 / 5; border-radius: 0; overflow: visible; background: none; box-shadow: none;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
/* a soft light behind her shows the conversation state instead of a frame */
body.has-face .orb::before {
  content: ''; position: absolute; left: 8%; right: 8%; top: 10%; bottom: 4%; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, rgba(0, 103, 163, .16), transparent); transition: background .4s, transform .4s;
}
body.has-face[data-state="listening"] .orb::before { background: radial-gradient(closest-side, rgba(0, 184, 191, .42), transparent); transform: scale(1.06); }
body.has-face[data-state="speaking"] .orb::before { background: radial-gradient(closest-side, rgba(0, 103, 163, .34), transparent); transform: scale(1.04); }
body.has-face .orb canvas#orbCanvas { display: none; }
/* the video only feeds the canvas; hidden by size, not display, so iOS keeps decoding it */
.face-src { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; z-index: -1; }
body.has-face .face-poster, body.has-face .face-video {
  display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  /* the frame ends mid-body; fade it out instead of a hard edge */
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 98%); mask-image: linear-gradient(to bottom, #000 72%, transparent 98%);
}
body.has-face .face-video { opacity: 0; transition: opacity .3s; }
body.face-live .face-video { opacity: 1; }
body.face-live .face-poster { opacity: 0; transition: opacity .3s .15s; }
body.has-face .face-badge {
  display: block; position: absolute; left: 0; top: 4px; padding: 3px 8px; border-radius: 999px; background: rgba(0, 30, 60, .72); color: #fff;
  font-family: 'IBM Plex Mono', monospace; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase;
}
body.has-face .orb-mic { top: auto; bottom: 14px; transform: translateX(-50%); width: 46px; height: 46px; padding: 11px; border-radius: 50%; background: var(--blue); box-sizing: border-box; box-shadow: 0 6px 16px -6px rgba(0, 40, 80, .5); }
body.has-face:not([data-state="off"]):not([data-state="idle"]) .orb-mic { opacity: 0; transform: translateX(-50%) scale(.7); }
body.has-face .orb:focus-visible::after { inset: 0; border-radius: 20px; }

.status-line { margin: 4px 0 0; display: flex; align-items: center; gap: 10px; font-family: 'IBM Plex Mono', monospace; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #8A97A4; flex: none; }
body[data-state="idle"] .dot { background: var(--blue); }
body[data-state="listening"] .dot { background: #00B8BF; box-shadow: 0 0 0 0 rgba(0, 184, 191, .6); animation: ping 1.4s infinite; }
body[data-state="thinking"] .dot { background: var(--blue); animation: blink 1s infinite; }
body[data-state="speaking"] .dot { background: var(--blue-deep); animation: ping 1.4s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(0, 184, 191, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 184, 191, 0); } }
@keyframes blink { 50% { opacity: .3; } }

.caption {
  margin: 0; min-height: 2.6em; max-width: 30ch; text-align: center;
  font-size: 1.25rem; font-weight: 300; line-height: 1.3; letter-spacing: -.01em; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.caption:empty::before { content: '\00a0'; }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 100%; }
.chips:empty { display: none; }
.chips li {
  font-family: 'IBM Plex Mono', monospace; font-size: .7rem; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px;
  background: var(--glass-strong); border: 1px solid var(--line); color: var(--ink); animation: rise .35s ease both;
}
.chips li.done { color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }

.controls { display: flex; gap: 8px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px;
  font: inherit; font-size: .85rem; font-weight: 500; color: var(--ink); cursor: pointer;
  background: var(--glass-strong); border: 1px solid var(--line); box-shadow: 0 4px 16px -10px rgba(0, 54, 90, .4);
}
.pill:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.pill:focus-visible, .send:focus-visible, .composer input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.pill:disabled { display: none; }
.pill[hidden] { display: none; }
.pill.icon { width: 36px; padding: 0; justify-content: center; flex: none; }
.pill.icon .ic { width: 18px; height: 18px; }
.pill.icon[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.pill.icon[aria-busy="true"] { opacity: .55; }
.alerts-wrap { position: relative; display: inline-flex; }
.alerts-wrap[hidden] { display: none; }
.alerts-menu {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column;
  min-width: 210px; padding: 6px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 32px -12px rgba(0, 54, 90, .45);
}
.alerts-menu[hidden] { display: none; }
.alerts-menu button { font: inherit; font-size: .88rem; text-align: left; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; white-space: nowrap; }
.alerts-menu .opt { display: flex; align-items: center; gap: 10px; }
.alerts-menu .opt::before { content: ''; flex: none; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--muted); }
.alerts-menu .opt[aria-checked="true"]::before { background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; border-color: var(--blue); }
.alerts-menu .sep { height: 1px; margin: 4px 8px; background: var(--line); }
.alerts-menu button:hover, .alerts-menu button:focus-visible { background: var(--glass-strong); color: var(--blue); outline: none; }
.pill .ic { width: 16px; height: 16px; }
.pill.solid { background: var(--blue); border-color: var(--blue); color: #fff; }
.pill.select { padding-right: 6px; cursor: default; }
.pill.select .ic { color: var(--blue); width: 16px; height: 16px; }
.pill select { font: inherit; font-size: .85rem; border: 0; background: transparent; color: var(--ink); padding: 4px 2px; cursor: pointer; }
.pill select:focus-visible { outline: none; }
.pill.select:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.hint { margin: 0; font-size: .78rem; color: var(--muted); text-align: center; }

.voices { width: 100%; font-size: .82rem; }
.voices summary { cursor: pointer; color: var(--blue); text-align: center; }
.voice-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 8px; }
.voice-row span { color: var(--muted); }
.voice-row select { font: inherit; font-size: .8rem; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 0; }
.btn.small { font: inherit; font-size: .76rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; }

/* conversation */
.convo {
  display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 150px);
  background: var(--glass); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .75); border-radius: 24px; box-shadow: var(--shadow);
}
.transcript { list-style: none; margin: 0; padding: 22px 22px 8px; flex: 1; min-height: 220px; overflow-y: auto; scroll-behavior: smooth; }
.transcript li { margin-bottom: 14px; max-width: 86%; animation: rise .4s cubic-bezier(.2, .8, .2, 1) both; }
.transcript li.user { margin-left: auto; text-align: right; }
.bubble { display: inline-block; padding: 10px 14px; border-radius: 16px; font-size: .95rem; line-height: 1.5; text-align: left; white-space: pre-wrap; }
.assistant .bubble { background: #fff; border: 1px solid var(--line); border-top-left-radius: 6px; color: var(--ink); box-shadow: 0 6px 20px -16px rgba(0, 54, 90, .5); }
.user .bubble { background: linear-gradient(135deg, #0A78B8, var(--blue-deep)); color: #fff; border-top-right-radius: 6px; }
.interim .bubble { background: transparent; color: var(--muted); border: 1px dashed rgba(0, 103, 163, .35); }
.rate { display: inline-flex; gap: 2px; margin-left: 6px; vertical-align: middle; }
.rate button { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.rate button .ic { width: 15px; height: 15px; }
.rate button:hover, .rate button:focus-visible { color: var(--blue); background: var(--glass-strong); outline: none; }
.rate button[aria-pressed="true"] { color: #fff; background: var(--blue); }
.ai-label.with-rate { display: inline-block; }
.ai-label { display: block; margin-top: 4px; font-family: 'IBM Plex Mono', monospace; font-size: .66rem; letter-spacing: .03em; color: var(--muted); }
.tool-line { margin: -6px 0 12px; font-family: 'IBM Plex Mono', monospace; font-size: .68rem; color: var(--muted); }
.system { max-width: 100% !important; text-align: center; font-size: .8rem; color: var(--muted); }

.composer { display: flex; gap: 8px; padding: 12px 14px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); }
.composer input {
  flex: 1; min-width: 0; height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; font: inherit; font-size: 16px; color: var(--ink);
}
.composer input::placeholder { color: #66727E; }
.send {
  width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #0A78B8, var(--blue-deep)); display: grid; place-items: center;
}
.send:disabled, .composer input:disabled { opacity: .55; cursor: not-allowed; }

/* phones and the Teams mobile tab */
@media (max-width: 860px) {
  .bar { padding: 10px 16px; gap: 10px; }
  .logo { height: 24px; }
  .divider { height: 20px; }
  .brand .name { font-size: 1.1rem; }
  .brand .tag { font-size: .6rem; }
  .who span { display: none; }
    .layout { display: flex; flex-direction: column; gap: 10px; padding: 6px 16px 0; }
  .stage { position: static; align-self: stretch; padding-top: 2px; gap: 6px; }
  body:not([data-state="listening"]) .caption:empty { display: none; }
  .orb { width: min(150px, 40vw); }
  body.has-face .orb { width: min(180px, 48vw); }
  body.has-face .orb-mic { width: 38px; height: 38px; padding: 9px; bottom: 10px; }
  .caption { font-size: 1.05rem; min-height: 1.4em; -webkit-line-clamp: 2; }
  .hint { display: none; }
  .convo { flex: 1; max-height: none; border-radius: 22px 22px 0 0; margin: 0 -16px; border-bottom: 0; }
  .transcript { padding: 16px 16px 4px; min-height: 140px; }
  .transcript li { max-width: 92%; }
}
/* inside Teams the host shows name and user already */
body.in-teams .who { display: none; }
@media (max-width: 860px) { body.in-teams .bar { display: none; } body.in-teams 
@media (prefers-reduced-motion: reduce) {
  .aurora i, .dot, .chips li, .transcript li { animation: none !important; }
  .transcript { scroll-behavior: auto; }
}
.tool-line.file-link a { color: var(--blue); font-family: inherit; font-size: .8rem; text-decoration: underline; text-underline-offset: 2px; }

/* EU AI Act notice, permanently next to the input */
.ai-foot { margin: 0; padding: 4px 16px 8px; display: flex; gap: 6px; align-items: flex-start; justify-content: center; text-align: center; font-size: .72rem; line-height: 1.35; color: var(--muted); }
.ai-foot .ic { width: 13px; height: 13px; flex: none; margin-top: 1px; color: var(--blue); }
@media (max-width: 640px) { .ai-foot .de-note { display: none; } .ai-foot { padding: 2px 16px 6px; } }
