/* Billie — The A.I. The canvas renders the scene through a convex lens.
   No optical bitmap, shared glass material, or browser-specific backdrop filter. */
.billie-orb,
.billie-orb-edge {
  display: none;
}

html.ivy-duo-mode #billie-orb {
  --billie-orb-diameter: min(152px, 42vw, 38svh);
  position: fixed;
  z-index: 12020;
  top: max(18px, calc(env(safe-area-inset-top, 0px) + 10px));
  left: calc(var(--duo-workspace-width, 81dvw) / 2 - var(--billie-orb-diameter) / 2);
  width: var(--billie-orb-diameter);
  height: var(--billie-orb-diameter);
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  /* The merged glass contour has no outer shadow; match it in every state. */
  box-shadow: none !important;
  transform-origin: 50% 50%;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  cursor: grab;
}

html.ivy-duo-mode #billie-orb:not([hidden]) {
  display: block;
}

html.ivy-duo-mode #billie-orb[data-moving="true"] {
  will-change: transform !important;
}

html.ivy-duo-mode #billie-orb[data-dragging="true"] {
  cursor: grabbing;
}

html.ivy-duo-mode #billie-orb > canvas {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  pointer-events: none;
}

/* A tiny, transient flex of the top edge as the lens passes through it.
   This is independent vector geometry, not another glass material. */
html.ivy-duo-mode #billie-orb-edge:not([hidden]) {
  display: block;
  position: fixed;
  top: 0;
  height: 14px;
  z-index: 12021;
  overflow: visible;
  pointer-events: none;
  contain: layout style;
}

#billie-orb-edge .billie-orb-edge__lip {
  fill: #101116;
}

#billie-orb-edge .billie-orb-edge__glint {
  fill: none;
  stroke: rgb(255 255 255 / 22%);
  stroke-width: .5px;
}


/* Status stays outside the accepted, empty lens. */
.billie-status {display:none;}
html.ivy-duo-mode .billie-status:not([hidden]) {
 position:fixed;z-index:12022;display:block;transform:translateX(-50%);
 max-width:calc(81vw - 24px);font:500 12px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
 color:#63636b;text-align:center;pointer-events:none;white-space:nowrap;
}
html.ivy-duo-mode.dark-mode .billie-status {color:#b8b8c0;}
html.ivy-duo-mode #billie-orb:focus-visible {outline:2px solid #007aff;outline-offset:5px;}

/* A speech capsule inside the lens; never part of the captured scene. */
html.ivy-duo-mode #billie-orb .billie-subtitle {
 position:absolute;left:50%;top:50%;width:88%;height:50px;max-height:72%;
 transform:translate(-50%,-50%);box-sizing:border-box;padding:0;
 border-radius:20px;background:#111216!important;color:#f5f5f7!important;
 -webkit-text-fill-color:currentColor;font:400 13px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
 text-align:left;overflow:hidden;overflow-wrap:anywhere;pointer-events:none;
 box-shadow:0 2px 8px #0002!important;
}
html.ivy-duo-mode #billie-orb .billie-subtitle[hidden] {display:none!important;}
html.ivy-duo-mode.dark-mode #billie-orb .billie-subtitle {background:#202124!important;color:#f5f5f7!important;}

html.ivy-duo-mode :is(#billie-orb,.billie-user-bubble) .billie-subtitle-line {
 position:absolute;left:0;right:0;top:8px;display:block;line-height:20px;white-space:nowrap;opacity:var(--caption-opacity,1)!important;filter:blur(var(--caption-blur,0px))!important;
 transition:transform 540ms cubic-bezier(.22,1,.36,1),color 420ms ease,opacity 420ms cubic-bezier(.4,0,.2,1),filter 420ms cubic-bezier(.4,0,.2,1)!important;
}
html.ivy-duo-mode #billie-orb .billie-subtitle-line.is-past {color:#a0a0a8;}
html.ivy-duo-mode.dark-mode #billie-orb .billie-subtitle-line.is-past {color:#a0a0a8;}
@media(prefers-reduced-motion:reduce) {
 html.ivy-duo-mode :is(#billie-orb,.billie-user-bubble) .billie-subtitle-line {transition:none!important;}
}

/* Give the blurred departing line room above the text inset, then feather it
   to zero before clipping. Mask only the words, never the glass or inset. */
html.ivy-duo-mode :is(#billie-orb,.billie-user-bubble) .billie-caption-window {
 position:absolute;inset:0 14px 8px;overflow:hidden;
 -webkit-mask-image:linear-gradient(to bottom,transparent 0,rgba(0,0,0,.08) 2px,rgba(0,0,0,.36) 5px,rgba(0,0,0,.78) 8px,#000 10px,#000 calc(100% - 3px),transparent 100%);
 mask-image:linear-gradient(to bottom,transparent 0,rgba(0,0,0,.08) 2px,rgba(0,0,0,.36) 5px,rgba(0,0,0,.78) 8px,#000 10px,#000 calc(100% - 3px),transparent 100%);
}

/* One spring owns the geometry: browser transitions must not lag behind
   the canvas or separately move its child outside the lens. */
html.ivy-duo-mode #billie-orb {transition:none!important;overflow:hidden;}
html.ivy-duo-mode #billie-orb .billie-subtitle {
 animation:none!important;transition:none!important;translate:none!important;scale:none!important;
 opacity:var(--caption-reveal,0);transform:translate(-50%,-50%);
}
html.ivy-duo-mode #billie-orb .billie-word {color:#b5b5bd;-webkit-text-fill-color:currentColor;transition:color 180ms ease!important;}
html.ivy-duo-mode #billie-orb .billie-word.is-latest {color:#fff;}
html.ivy-duo-mode.dark-mode #billie-orb .billie-word {color:#b5b5bd;}
html.ivy-duo-mode.dark-mode #billie-orb .billie-word.is-latest {color:#f5f5f7;}


html.ivy-duo-mode #billie-orb .billie-word.billie-go-ahead {color:#ff9f0a;-webkit-text-fill-color:currentColor;}
.billie-user-bubble {display:none;}
html.ivy-duo-mode .billie-user-bubble:not([hidden]) {
 display:block;position:fixed;z-index:12019;box-sizing:border-box;
 border-radius:999px;background:transparent!important;overflow:hidden;
 box-shadow:none!important;
 pointer-events:auto;touch-action:none;transition:none!important;animation:none!important;
}
.billie-user-bubble>canvas {display:block;width:100%;height:100%;border-radius:inherit;}
html.ivy-duo-mode .billie-user-inset {
 position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:88%;height:50px;max-height:72%;
 box-sizing:border-box;padding:8px 14px;border-radius:20px;background:#f6f6f8!important;color:#1c1c1e!important;
 -webkit-text-fill-color:currentColor;font:400 13px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
 box-shadow:0 2px 8px #0002!important;overflow:hidden;transition:opacity 300ms ease!important;
}
@media(prefers-reduced-motion:reduce){html.ivy-duo-mode .billie-user-inset {transition:none!important;}}

html.ivy-duo-mode .billie-merged-glass {position:fixed;z-index:12019;pointer-events:none;transition:none!important;}
.billie-merged-glass[hidden] {display:none!important;}

html.ivy-duo-mode .billie-user-bubble .billie-word {color:#696970;transition:color 180ms ease!important;}
html.ivy-duo-mode .billie-user-bubble .billie-word.is-latest {color:#1c1c1e;}

html.ivy-duo-mode .billie-user-bubble[data-dragging]{cursor:grabbing}
html.ivy-duo-mode .billie-user-bubble[data-absorbing] .billie-user-inset{transition:opacity 100ms ease!important}

/* A quiet reading surface within the same optical shell. */
html.ivy-duo-mode #billie-orb .billie-caption-window{opacity:calc(1 - var(--reading-reveal,0));}
html.ivy-duo-mode #billie-orb .billie-caption-review{position:absolute;inset:14px 18px 32px;padding:3px 0 8px;box-sizing:border-box;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none;pointer-events:auto;touch-action:none;font:400 13px/1.6 -apple-system,BlinkMacSystemFont,sans-serif;white-space:normal;overflow-wrap:anywhere;text-align:left;color:#f5f5f7;opacity:var(--reading-reveal,0);-webkit-mask-image:linear-gradient(transparent,#000 3px,#000 calc(100% - 6px),transparent);mask-image:linear-gradient(transparent,#000 3px,#000 calc(100% - 6px),transparent);}
html.ivy-duo-mode #billie-orb .billie-caption-review .is-latest{color:#f5f5f7;}
html.ivy-duo-mode #billie-orb .billie-caption-review .billie-go-ahead{color:#ff9f0a;}
html.ivy-duo-mode #billie-orb .billie-caption-collapse{position:absolute;right:12px;bottom:3px;width:36px;height:28px;display:grid;place-items:center;background:none;border:0;padding:0;color:inherit;opacity:var(--reading-reveal,0);pointer-events:auto;touch-action:manipulation;cursor:pointer;}
html.ivy-duo-mode #billie-orb .billie-caption-collapse svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
html.ivy-duo-mode #billie-orb :is(.billie-caption-review,.billie-caption-collapse)[hidden]{display:none!important;}
html.ivy-duo-mode.dark-mode #billie-orb .billie-caption-review{color:#f5f5f7;}
html.ivy-duo-mode.dark-mode #billie-orb .billie-caption-review .is-latest{color:#f5f5f7;}
html.ivy-duo-mode.dark-mode .billie-user-inset{background:#202124!important;color:#f5f5f7!important;}
html.ivy-duo-mode.dark-mode .billie-user-bubble .billie-word{color:#b5b5bd;}
html.ivy-duo-mode.dark-mode .billie-user-bubble .billie-word.is-latest{color:#f5f5f7;}

/* Emphasis remains text, so copying and assistive reading keep the clean reply. */
html.ivy-duo-mode #billie-orb :is(.billie-word,.billie-caption-review) strong{font-size:inherit;font-weight:650;color:inherit;}
html.ivy-duo-mode #billie-orb :is(.billie-word,.billie-caption-review) em{font-size:inherit;font-style:italic;color:inherit;}
html.ivy-duo-mode #billie-orb .billie-reading-letter{animation:billie-letter-reveal 360ms cubic-bezier(.22,1,.36,1) var(--letter-delay,0ms) both!important;}
@keyframes billie-letter-reveal{from{color:#b5b5bd;}to{color:#f5f5f7;}}
@media(prefers-reduced-motion:reduce){html.ivy-duo-mode #billie-orb .billie-reading-letter{animation:none!important;}}
