/* Scoped to WOW's fifth smart-card face; the carousel owns its size and pager gutter. */
html body #mainContent #page-dashboard :is(#wfGreetingRobot, #wfRobotSettingsPreview) {
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr) 40px;
  gap: 7px;
  color: var(--text);
  cursor: default;
}

:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-heading {
  display: grid;
  grid-template-rows: 18px 15px;
  gap: 1px;
  min-inline-size: 0;
}

:is(#wfGreetingRobot, #wfRobotSettingsPreview) #wfRobotTitle {
  display: flex;
  align-items: center;
  gap: 6px;
  min-inline-size: 0;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  line-height: 18px;
}

:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-signal {
  flex: 0 0 5px;
  inline-size: 5px;
  block-size: 9px;
  border-radius: 5px;
  background: var(--brand-primary);
  opacity: .7;
}

:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-status {
  overflow: hidden;
  min-inline-size: 0;
  color: var(--text2);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Keep the reference face while letting the card's continuous background show through. */
:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-display {
  display: grid;
  place-items: center;
  justify-self: center;
  align-self: stretch;
  inline-size: min(100%, 260px);
  min-inline-size: 0;
  min-block-size: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
}

/* The same face stays transparent on every dark surface; only its ink changes. */
@media screen {
  html[data-theme="dark"] :is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-display {
    background: transparent;
  }
  html[data-theme="dark"] .wf-robot-face {
    --wf-robot-ink: var(--text, #f2f4f8);
    --wf-robot-glint: var(--wf-reader-paper, var(--card, #171923));
    --wf-robot-soft-glint: color-mix(in srgb, var(--wf-robot-glint) 80%, var(--wf-robot-ink));
  }
  html[data-theme="dark"] .wf-robot-face .wf-robot-eye-open {
    fill: var(--wf-robot-ink);
  }
}

:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-face {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  max-block-size: 88px;
  overflow: visible;
  transform: scale(1.2);
  transform-origin: center;
}

:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-eye-open { stroke: none; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-glint { fill: var(--wf-robot-glint, #fff); }
:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-glint-small { fill: var(--wf-robot-soft-glint, #d7d7dd); }
:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-brow,
:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-eye-closed,
:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-mouth {
  fill: none;
  stroke-linecap: round;
}
:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-brow { stroke: var(--wf-robot-ink, #171923); stroke-width: 7; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-eye-closed { stroke: var(--wf-robot-ink, #171923); stroke-width: 11; opacity: 0; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-mouth { stroke: var(--wf-robot-ink, #171923); stroke-width: 9; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-blink { transform-box: fill-box; transform-origin: center; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-mouth-open {
  display: none;
  transform-box: view-box;
  transform-origin: 300px 258.72px;
}
:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-mouth-cavity { fill: var(--wf-robot-ink, #171923); }
:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-mouth-light { fill: var(--wf-robot-soft-glint, #d7d7dd); }
:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-thinking { display: none; fill: #c5c7cc; }

:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-expression="happy"] .wf-robot-eye-open { ry: 43.5px; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-expression="happy"] .wf-robot-glint { cy: -15.66px; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-expression="happy"] .wf-robot-glint-small { cy: 16.53px; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-expression="thinking"] .wf-robot-eye-left { transform: translate(174px, 139.84px); }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-expression="thinking"] .wf-robot-eye-right { transform: translate(426px, 139.84px); }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-expression="thinking"] .wf-robot-thinking { display: block; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-expression="surprised"] .wf-robot-eye-open { rx: 37px; ry: 62px; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-expression="surprised"] .wf-robot-glint { cy: -22.32px; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-expression="surprised"] .wf-robot-glint-small { cy: 23.56px; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-expression="surprised"] .wf-robot-brow { transform: translateY(-13px); stroke: var(--wf-robot-ink, #171923); }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-expression="surprised"] .wf-robot-mouth { display: none; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-expression="surprised"] .wf-robot-mouth-open { display: block; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-expression="surprised"] .wf-robot-mouth-cavity { rx: 22px; ry: 26px; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-expression="surprised"] .wf-robot-mouth-light { ry: 2px; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-speaking="true"] .wf-robot-mouth { display: none; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-speaking="true"] .wf-robot-mouth-open { display: block; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-speaking="true"] .wf-robot-mouth-cavity { rx: 38px; ry: 39px; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-speaking="true"] .wf-robot-mouth-light { ry: 14px; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-speaking="true"] .wf-robot-signal { opacity: 1; block-size: 12px; }

:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-actions {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-inline-size: 0;
  min-block-size: 0;
}

html body #mainContent #page-dashboard :is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 0;
  min-inline-size: 0;
  min-block-size: 40px;
  block-size: 40px;
  margin: 0;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 19%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand-primary) 6%, var(--card));
  color: var(--text);
  font: inherit;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

html body #mainContent #page-dashboard :is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-report {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

html body #mainContent #page-dashboard :is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-speak { flex: 1 1 0; min-inline-size: 0; }

:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-button span { overflow: hidden; text-overflow: ellipsis; min-inline-size: 0; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview) :is(.wf-robot-report, .wf-robot-speak) span { white-space: normal; text-overflow: clip; line-height: 1.15; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-button svg { flex: 0 0 17px; inline-size: 17px; block-size: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-button .wf-robot-stop-icon { display: none; fill: currentColor; stroke: none; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-voice-active="true"]:is([data-voice-kind="intro"],[data-voice-kind="report"]) .wf-robot-speak-icon { display: none; }
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-voice-active="true"]:is([data-voice-kind="intro"],[data-voice-kind="report"]) .wf-robot-speak .wf-robot-stop-icon { display: block; }

html body #mainContent #page-dashboard :is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-button:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

html body #mainContent #page-dashboard :is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-button:disabled { opacity: .5; cursor: default; }

@media (max-width: 380px) {
  :is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-report .wf-robot-report-icon { display: none; }
}

@media (hover: hover) {
  html body #mainContent #page-dashboard :is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-report:hover:not(:disabled) { filter: brightness(1.08); }
}

@media (prefers-reduced-motion: no-preference) {
  html:not([data-wf-motion="reduced"]) :is(#wfGreetingRobot, #wfRobotSettingsPreview)[aria-hidden="false"]:not([data-idle-motion="false"]) .wf-robot-blink { animation: wf-robot-blink 5.2s infinite; }
  html:not([data-wf-motion="reduced"]) :is(#wfGreetingRobot, #wfRobotSettingsPreview)[aria-hidden="false"]:not([data-idle-motion="false"]) .wf-robot-eye-closed { animation: wf-robot-lids 5.2s infinite; }
  html:not([data-wf-motion="reduced"]) :is(#wfGreetingRobot, #wfRobotSettingsPreview)[aria-hidden="false"]:not([data-idle-motion="false"]) .wf-robot-gaze { animation: wf-robot-glance 11s ease-in-out infinite; }
  /* Web Speech does not expose audio samples. Movement follows start/end and word boundaries. */
  html:not([data-wf-motion="reduced"]) :is(#wfGreetingRobot, #wfRobotSettingsPreview)[aria-hidden="false"][data-speaking="true"] .wf-robot-mouth-open { animation: wf-robot-talk .38s ease-in-out infinite alternate; }
  html:not([data-wf-motion="reduced"]) :is(#wfGreetingRobot, #wfRobotSettingsPreview)[aria-hidden="false"][data-speech-beat="true"] .wf-robot-mouth-open { animation-duration: .24s; }
  html:not([data-wf-motion="reduced"]) :is(#wfGreetingRobot, #wfRobotSettingsPreview)[aria-hidden="false"] .wf-robot-thinking circle { animation: wf-robot-think 1.1s ease-in-out infinite; }
  html:not([data-wf-motion="reduced"]) :is(#wfGreetingRobot, #wfRobotSettingsPreview)[aria-hidden="false"] .wf-robot-thinking circle:nth-child(2) { animation-delay: .17s; }
  html:not([data-wf-motion="reduced"]) :is(#wfGreetingRobot, #wfRobotSettingsPreview)[aria-hidden="false"] .wf-robot-thinking circle:nth-child(3) { animation-delay: .34s; }
  html:not([data-wf-motion="reduced"]) :is(#wfGreetingRobot, #wfRobotSettingsPreview) .wf-robot-button { transition: background-color .18s ease, filter .18s ease; }
}

@keyframes wf-robot-blink {
  0%, 48%, 52%, 100% { transform: scaleY(1); opacity: 1; }
  49.2%, 50.8% { transform: scaleY(.06); opacity: 0; }
}
@keyframes wf-robot-lids {
  0%, 48.8%, 51.2%, 100% { opacity: 0; }
  49.2%, 50.8% { opacity: 1; }
}
@keyframes wf-robot-glance {
  0%, 28%, 43%, 71%, 100% { transform: translate(0, 0); }
  33%, 38% { transform: translate(-16px, 6px); }
  77%, 85% { transform: translate(16px, -6px); }
}
@keyframes wf-robot-talk {
  0% { transform: scale(.92, .2); }
  45% { transform: scale(1, .76); }
  100% { transform: scale(.94, 1); }
}
@keyframes wf-robot-think {
  0%, 45%, 100% { fill: #c5c7cc; }
  60%, 80% { fill: #30323d; }
}

/* Camera movement uses local, normalized coordinates; ordinary idle gaze pauses. */
:is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-tracking="true"] .wf-robot-gaze {
  animation: none !important;
  transform: translate(var(--wf-robot-look-x, 0px), var(--wf-robot-look-y, 0px));
}
@media (prefers-reduced-motion: no-preference) {
  html:not([data-wf-motion="reduced"]) :is(#wfGreetingRobot, #wfRobotSettingsPreview)[data-tracking="true"] .wf-robot-gaze {
    transition: transform .16s ease-out;
  }
}

#wfGreetingRobot .wf-robot-display {cursor:default;}
