/* ===========================================================================
   WAIX · X WIDGET  —  floating "Ask X / Feedback" co-pilot
   Self-mounting, bottom-LEFT, lives on top of the real product.
   Uses the platform tokens from shared/styles.css (no :root overrides).
   =========================================================================== */

body {
  --wx-accent: var(--green, #4ade80);
  --wx-accent-bright: var(--green-bright, #5cf28e);
  --wx-accent-deep: var(--green-deep, #16a34a);
  --wx-accent-soft: var(--green-soft, rgba(74,222,128,0.18));
  --wx-accent-glow: var(--green-glow, rgba(74,222,128,0.32));
  --wx-peach: var(--peach, #f7b8a3);
  --wx-peach-glow: var(--peach-glow, rgba(247,184,163,0.28));
  --wx-line: var(--line, rgba(255,255,255,0.06));
  --wx-line-strong: var(--line-strong, rgba(255,255,255,0.12));
  --wx-text: var(--text, #eef2ee);
  --wx-text-dim: var(--text-dim, #98a59c);
  --wx-text-faint: var(--text-faint, #5d6a62);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
body .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
body .serif { font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; }
body button { font-family: inherit; }
body *, body *::before, body *::after { box-sizing: border-box; }

/* ── Dock (launcher) — bottom LEFT ──────────────────────────────────── */
.wx-dock {
  position: fixed; z-index: 2147483000;
  bottom: 24px; left: 24px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 13px;
}

/* Proactive nudge bubble */
.wx-nudge {
  max-width: 280px;
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 15px;
  border-radius: 16px 16px 16px 6px;
  background: linear-gradient(180deg, rgba(20,30,27,0.98), rgba(12,18,18,0.99));
  border: 1px solid var(--wx-line-strong);
  box-shadow: 0 18px 50px -16px rgba(0,0,0,0.7);
  cursor: pointer;
}
.wx-nudge-spark { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; background: url('assets/x-mark.png') center / contain no-repeat; filter: drop-shadow(0 0 6px var(--wx-accent-glow)); }
.wx-nudge--right { border-radius: 16px 16px 6px 16px; }
.wx-nudge--right.wx-nudge--below { border-radius: 16px 6px 16px 16px; }
.wx-nudge--left.wx-nudge--below { border-radius: 6px 16px 16px 16px; }
.wx-nudge-body { font-size: 12.5px; line-height: 1.45; color: var(--wx-text); }
.wx-nudge-body em { font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; color: var(--wx-peach); }
.wx-nudge-close { margin-left: 2px; background: none; border: 0; color: var(--wx-text-faint); cursor: pointer; font-size: 15px; line-height: 1; padding: 0; flex-shrink: 0; }
.wx-nudge-close:hover { color: var(--wx-text); }

/* Launcher — orb */
.wx-orb {
  position: relative;
  width: 60px; height: 60px; border-radius: 50%;
  border: 1px solid var(--wx-accent-soft);
  background: radial-gradient(circle at 50% 38%, rgba(74,222,128,0.18), rgba(10,16,15,0.95) 70%);
  display: grid; place-items: center;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 14px 40px -12px rgba(0,0,0,0.7), inset 0 0 0 1px rgba(255,255,255,0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  padding: 0;
}
.wx-orb:hover { transform: translateY(-2px); border-color: var(--wx-accent); box-shadow: 0 18px 44px -12px rgba(0,0,0,0.75), 0 0 28px -6px var(--wx-accent-glow); }
.wx-orb:active { cursor: grabbing; transform: scale(0.97); }
.wx-orb-grip { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.wx-orb-grip i { width: 3px; height: 3px; border-radius: 50%; background: rgba(255,255,255,0.55); }
.wx-orb:hover .wx-orb-grip { opacity: 0.65; }
.wx-glyph { width: 26px; height: 26px; background: url('assets/x-mark.png') center / contain no-repeat; filter: drop-shadow(0 0 8px var(--wx-accent-glow)); position: relative; z-index: 2; }
.wx-orb .wx-glyph { width: 25px; height: 25px; }
.wx-orb-halo { position: absolute; inset: -8px; border-radius: 50%; background: radial-gradient(circle, var(--wx-accent-glow) 0%, transparent 62%); opacity: 0.7; animation: wx-breathe 5s ease-in-out infinite; pointer-events: none; }
@keyframes wx-breathe { 0%,100% { opacity: 0.5; transform: scale(0.92); } 50% { opacity: 0.95; transform: scale(1.08); } }
.wx-orb-badge { position: absolute; top: -2px; right: -2px; width: 16px; height: 16px; border-radius: 50%; background: var(--wx-peach); color: #2a0d12; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid #0a0f10; box-shadow: 0 0 10px var(--wx-peach-glow); z-index: 3; }

/* ── Console — anchored bottom LEFT ─────────────────────────────────── */
.wx-console {
  position: fixed; z-index: 2147483000;
  bottom: 24px; left: 24px;
  width: 396px; max-width: calc(100vw - 32px);
  height: min(600px, calc(100vh - 48px));
  display: flex; flex-direction: column;
  border-radius: 22px;
  border: 1px solid var(--wx-line-strong);
  background: linear-gradient(180deg, rgba(13,20,19,0.985), rgba(8,12,13,0.99));
  box-shadow: 0 40px 100px -30px rgba(0,0,0,0.85), 0 0 0 1px rgba(255,255,255,0.03);
  overflow: hidden;
}

/* Header */
.wx-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; border-bottom: 1px solid var(--wx-line); }
.wx-head-orb { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(74,222,128,0.2), rgba(10,16,15,0.92) 72%); border: 1px solid var(--wx-accent-soft); flex-shrink: 0; }
.wx-head-orb .wx-glyph { width: 18px; height: 18px; }
.wx-head-orb .wx-orb-halo { inset: -4px; }
.wx-head-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.wx-head-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--wx-text-faint); white-space: nowrap; }
.wx-head-live { width: 6px; height: 6px; border-radius: 50%; background: var(--wx-accent); box-shadow: 0 0 8px var(--wx-accent-glow); animation: wx-blink 2s ease-in-out infinite; }
@keyframes wx-blink { 50% { opacity: 0.4; } }
.wx-head-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--wx-text); }
.wx-head-name .serif { font-weight: 400; color: var(--wx-accent); }
.wx-head-region { margin-left: 7px; padding: 1px 5px 0; border-radius: 5px; background: rgba(74,222,128,0.14); color: var(--wx-accent-bright); font-size: 8.5px; letter-spacing: 0.14em; }
.wx-close { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--wx-line); background: rgba(255,255,255,0.02); color: var(--wx-text-dim); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; transition: color 0.15s, background 0.15s; }
.wx-close:hover { color: var(--wx-text); background: rgba(255,255,255,0.06); }

/* Mode toggle */
.wx-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 12px 16px 0; padding: 4px; background: rgba(7,12,12,0.6); border: 1px solid var(--wx-line); border-radius: 12px; }
.wx-mode { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px; border: 0; background: transparent; color: var(--wx-text-dim); font-size: 13px; font-weight: 500; border-radius: 9px; cursor: pointer; transition: color 0.2s, background 0.2s, box-shadow 0.2s; }
.wx-mode:hover { color: var(--wx-text); }
.wx-mode.is-active { color: #06120c; background: var(--wx-accent); box-shadow: 0 0 16px -4px var(--wx-accent-glow); }
.wx-mode svg { width: 14px; height: 14px; }

/* Context chip */
.wx-context { display: flex; align-items: center; gap: 9px; margin: 12px 16px 0; padding: 9px 12px; border-radius: 11px; background: rgba(74,222,128,0.05); border: 1px solid var(--wx-line); font-size: 11.5px; color: var(--wx-text-dim); min-width: 0; }
.wx-context-label { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--wx-text-faint); white-space: nowrap; }
.wx-context-val { color: var(--wx-text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-context-x { margin-left: auto; width: 13px; height: 13px; background: url('assets/x-mark.png') center / contain no-repeat; opacity: 0.7; flex-shrink: 0; }

/* Scroll body */
.wx-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.wx-scroll::-webkit-scrollbar { width: 8px; }
.wx-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 99px; }

/* Messages */
.wx-msg { display: flex; gap: 9px; align-items: flex-end; }
.wx-msg--me { justify-content: flex-end; }
.wx-msg-orb { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; background: radial-gradient(circle at 50% 40%, rgba(74,222,128,0.25), rgba(10,16,15,0.92) 72%); display: grid; place-items: center; border: 1px solid var(--wx-accent-soft); }
.wx-msg-orb .wx-glyph { width: 12px; height: 12px; }
.wx-bubble { max-width: 78%; padding: 11px 14px; border-radius: 15px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.wx-msg--x .wx-bubble { background: rgba(255,255,255,0.04); border: 1px solid var(--wx-line); border-bottom-left-radius: 5px; color: var(--wx-text); }
.wx-msg--me .wx-bubble { background: linear-gradient(135deg, var(--wx-accent) 0%, var(--wx-accent-deep) 100%); color: #061310; border-bottom-right-radius: 5px; font-weight: 500; }
.wx-bubble .serif { color: var(--wx-peach); }
.wx-msg--x .wx-bubble strong { color: var(--wx-accent-bright); font-weight: 600; }

/* thinking */
.wx-thinking { display: inline-flex; gap: 5px; padding: 4px 2px; }
.wx-thinking span { width: 6px; height: 6px; border-radius: 50%; background: var(--wx-text-faint); animation: wx-dot 1.2s ease-in-out infinite; }
.wx-thinking span:nth-child(2) { animation-delay: 0.18s; }
.wx-thinking span:nth-child(3) { animation-delay: 0.36s; }
@keyframes wx-dot { 0%,60%,100% { opacity: 0.3; } 30% { opacity: 1; } }

/* X greeting block */
.wx-intro { display: flex; flex-direction: column; gap: 6px; padding: 4px 2px 0; }
.wx-intro-hi { font-size: 19px; font-weight: 200; letter-spacing: -0.01em; line-height: 1.3; color: var(--wx-text); }
.wx-intro-hi .serif { font-weight: 300; color: var(--wx-peach); }
.wx-intro-sub { font-size: 13px; color: var(--wx-text-dim); line-height: 1.5; }

/* Suggestion chips */
.wx-suggests { display: flex; flex-direction: column; gap: 8px; }
.wx-suggests-label { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--wx-text-faint); margin-bottom: 2px; }
.wx-chip { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--wx-line); background: rgba(255,255,255,0.02); color: var(--wx-text); font-size: 13px; cursor: pointer; transition: border-color 0.18s, background 0.18s, transform 0.18s; }
.wx-chip:hover { border-color: var(--wx-accent-soft); background: rgba(74,222,128,0.06); transform: translateX(2px); }
.wx-chip-ic { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: rgba(74,222,128,0.08); color: var(--wx-accent); flex-shrink: 0; }
.wx-chip-ic svg { width: 13px; height: 13px; }
.wx-chip-arrow { margin-left: auto; color: var(--wx-text-faint); opacity: 0; transition: opacity 0.18s, transform 0.18s; }
.wx-chip:hover .wx-chip-arrow { opacity: 1; transform: translateX(2px); }

/* ── Feedback mode ──────────────────────────────────────────────────── */
.wx-fb { display: flex; flex-direction: column; gap: 16px; padding: 2px; }
.wx-fb-lede { font-size: 13.5px; color: var(--wx-text-dim); line-height: 1.55; }
.wx-fb-lede .serif { color: var(--wx-peach); }
.wx-fb-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wx-fb-type { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 8px; border-radius: 13px; border: 1px solid var(--wx-line); background: rgba(255,255,255,0.02); color: var(--wx-text-dim); cursor: pointer; transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.18s; }
.wx-fb-type:hover { transform: translateY(-2px); color: var(--wx-text); border-color: var(--wx-line-strong); }
.wx-fb-type.is-on { border-color: var(--wx-accent); background: rgba(74,222,128,0.1); color: var(--wx-text); box-shadow: 0 0 0 1px var(--wx-accent-soft), 0 8px 20px -10px var(--wx-accent-glow); }
.wx-fb-type svg { width: 20px; height: 20px; }
.wx-fb-type span { font-size: 11.5px; font-weight: 500; }
.wx-fb-field { display: flex; flex-direction: column; gap: 8px; }
.wx-fb-field-label { font-size: 11px; letter-spacing: 0.04em; color: var(--wx-text-faint); }
.wx-fb-textarea { width: 100%; min-height: 96px; resize: vertical; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--wx-line-strong); background: rgba(7,12,12,0.6); color: var(--wx-text); font-family: inherit; font-size: 13.5px; line-height: 1.5; outline: 0; transition: border-color 0.18s, box-shadow 0.18s; }
.wx-fb-textarea::placeholder { color: var(--wx-text-faint); }
.wx-fb-textarea:focus { border-color: var(--wx-accent); box-shadow: 0 0 0 1px var(--wx-accent-soft), 0 0 22px -8px var(--wx-accent-glow); }
.wx-fb-attach { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 11px; border: 1px dashed var(--wx-line-strong); background: rgba(255,255,255,0.015); font-size: 11.5px; color: var(--wx-text-dim); }
.wx-fb-attach svg { width: 14px; height: 14px; color: var(--wx-accent); flex-shrink: 0; }
.wx-fb-attach b { color: var(--wx-text); font-weight: 500; }
.wx-fb-attach .wx-swap { margin-left: auto; color: var(--wx-text-faint); cursor: pointer; text-decoration: underline; text-decoration-color: var(--wx-line-strong); }
.wx-fb-send { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 13px; border-radius: 12px; border: 0; background: var(--wx-accent); color: #06120c; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform 0.15s, box-shadow 0.18s, opacity 0.18s; }
.wx-fb-send:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 26px -10px var(--wx-accent-glow); }
.wx-fb-send:disabled { opacity: 0.4; cursor: not-allowed; }
.wx-fb-send svg { width: 15px; height: 15px; }

/* feedback sent */
.wx-fb-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 30px 18px; }
.wx-fb-done-orb { position: relative; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(74,222,128,0.24), rgba(10,16,15,0.9) 72%); border: 1px solid var(--wx-accent-soft); }
.wx-fb-done-orb .wx-glyph { width: 28px; height: 28px; }
.wx-fb-done-orb .wx-orb-halo { inset: -6px; }
.wx-fb-done-title { font-size: 20px; font-weight: 200; letter-spacing: -0.01em; color: var(--wx-text); }
.wx-fb-done-title .serif { font-weight: 300; color: var(--wx-peach); }
.wx-fb-done-sub { font-size: 13px; color: var(--wx-text-dim); line-height: 1.55; max-width: 30ch; }
.wx-fb-done-btn { margin-top: 4px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--wx-line-strong); background: rgba(255,255,255,0.03); color: var(--wx-text); font-size: 13px; cursor: pointer; transition: border-color 0.18s, background 0.18s; }
.wx-fb-done-btn:hover { border-color: var(--wx-accent-soft); background: rgba(74,222,128,0.06); }

/* Composer */
.wx-composer { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; padding: 13px 14px; border-top: 1px solid var(--wx-line); background: rgba(7,10,10,0.5); }
.wx-mic { width: 44px; height: 44px; border-radius: 11px; border: 1px solid var(--wx-line-strong); background: rgba(255,255,255,0.03); color: var(--wx-text-dim); display: grid; place-items: center; cursor: pointer; transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.12s; }
.wx-mic:hover { color: var(--wx-accent); border-color: var(--wx-accent-soft); background: rgba(74,222,128,0.07); transform: translateY(-1px); }
.wx-mic svg { width: 17px; height: 17px; }
.wx-composer input { background: rgba(255,255,255,0.04); border: 1px solid var(--wx-line-strong); border-radius: 11px; padding: 12px 14px; font-family: inherit; font-size: 13.5px; color: var(--wx-text); outline: 0; transition: border-color 0.15s, background 0.15s; }
.wx-composer input::placeholder { color: var(--wx-text-faint); }
.wx-composer input:focus { border-color: var(--wx-accent-soft); background: rgba(255,255,255,0.06); }
.wx-composer button { width: 44px; height: 44px; border-radius: 11px; border: 0; background: var(--wx-accent); color: #06120c; display: grid; place-items: center; cursor: pointer; transition: transform 0.12s, box-shadow 0.15s, opacity 0.15s; }
.wx-composer button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 22px -8px var(--wx-accent-glow); }
.wx-composer button:disabled { opacity: 0.35; cursor: not-allowed; }
.wx-composer button svg { width: 16px; height: 16px; }

.wx-foot { padding: 9px 16px 12px; font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.1em; color: var(--wx-text-faint); text-align: center; line-height: 1.5; border-top: 1px solid var(--wx-line); }

/* ===========================================================================
   VOICE MODE — futuristic full-panel "talk to X"
   =========================================================================== */
.wx-voice {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column;
  background:
    radial-gradient(120% 80% at 50% 38%, rgba(74,222,128,0.12), transparent 60%),
    radial-gradient(90% 70% at 50% 120%, rgba(247,184,163,0.08), transparent 60%),
    linear-gradient(180deg, rgba(9,14,13,0.99), rgba(6,9,10,0.99));
  overflow: hidden;
}
/* faint moving starfield-ish dot grid for depth */
.wx-voice::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 20%, transparent 75%);
}
.wx-voice-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; position: relative; z-index: 2; }
.wx-voice-status { display: inline-flex; align-items: center; gap: 9px; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--wx-accent-bright); }
.wx-voice-live { width: 7px; height: 7px; border-radius: 50%; background: var(--wx-accent); box-shadow: 0 0 10px var(--wx-accent-glow); animation: wx-blink 1.6s ease-in-out infinite; }
.wx-voice-region { display: inline-flex; align-items: center; gap: 6px; font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--wx-text-faint); }
.wx-voice-region b { color: var(--wx-accent-bright); font-weight: 700; }

.wx-voice-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; position: relative; z-index: 2; padding: 8px 20px; }

/* The orb */
.wx-voice-orb { position: relative; width: 188px; height: 188px; display: grid; place-items: center; }
.wx-voice-aura { position: absolute; inset: -8%; border-radius: 50%; background: radial-gradient(circle, var(--wx-accent-glow) 0%, transparent 62%); filter: blur(6px); animation: wx-voice-aura 4.4s ease-in-out infinite; }
@keyframes wx-voice-aura { 0%,100% { opacity: 0.55; transform: scale(0.92); } 50% { opacity: 1; transform: scale(1.08); } }
.wx-voice-ring { position: absolute; border-radius: 50%; border: 1px solid var(--wx-accent); opacity: 0.35; }
.wx-voice-ring.r1 { inset: 34px; animation: wx-voice-ring 3.2s ease-out infinite; }
.wx-voice-ring.r2 { inset: 16px; animation: wx-voice-ring 3.2s ease-out infinite 1.05s; }
.wx-voice-ring.r3 { inset: -4px; animation: wx-voice-ring 3.2s ease-out infinite 2.1s; }
@keyframes wx-voice-ring { 0% { transform: scale(0.62); opacity: 0.6; } 100% { transform: scale(1.28); opacity: 0; } }
.wx-voice-core {
  position: relative; z-index: 3; width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 38%, rgba(92,242,142,0.34), rgba(10,16,15,0.96) 72%);
  border: 1px solid var(--wx-accent-soft);
  box-shadow: 0 0 60px -6px var(--wx-accent-glow), inset 0 0 22px -6px var(--wx-accent-glow);
  animation: wx-voice-breathe 3.6s ease-in-out infinite;
}
.wx-voice-core .wx-glyph { width: 42px; height: 42px; filter: drop-shadow(0 0 12px var(--wx-accent-glow)); }
@keyframes wx-voice-breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* Equalizer */
.wx-voice-eq { display: flex; align-items: center; gap: 5px; height: 52px; }
.wx-voice-eq i { width: 5px; border-radius: 99px; background: linear-gradient(180deg, var(--wx-accent-bright), var(--wx-accent-deep)); box-shadow: 0 0 10px -2px var(--wx-accent-glow); animation: wx-voice-eq 1.1s ease-in-out infinite; }
@keyframes wx-voice-eq { 0%,100% { height: 26%; } 50% { height: 92%; } }
.wx-voice.is-muted .wx-voice-eq i { animation-play-state: paused; opacity: 0.35; }
.wx-voice.is-muted .wx-voice-ring { animation-play-state: paused; opacity: 0.15; }

.wx-voice-caption { text-align: center; max-width: 30ch; }
.wx-voice-caption-main { font-size: 18px; font-weight: 200; letter-spacing: -0.01em; color: var(--wx-text); }
.wx-voice-caption-main .serif { font-style: italic; font-weight: 300; color: var(--wx-peach); }
.wx-voice-caption-sub { margin-top: 6px; font-size: 12.5px; color: var(--wx-text-dim); line-height: 1.5; }

/* Controls */
.wx-voice-controls { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 18px 18px 24px; position: relative; z-index: 2; }
.wx-voice-cbtn { width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--wx-line-strong); background: rgba(255,255,255,0.04); color: var(--wx-text); display: grid; place-items: center; cursor: pointer; transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s; }
.wx-voice-cbtn:hover { transform: translateY(-2px); border-color: var(--wx-accent-soft); background: rgba(74,222,128,0.08); }
.wx-voice-cbtn svg { width: 21px; height: 21px; }
.wx-voice-cbtn.is-muted { border-color: rgba(248,113,113,0.5); background: rgba(248,113,113,0.12); color: #fca5a5; }
.wx-voice-end { width: 60px; height: 60px; border-radius: 50%; border: 0; background: linear-gradient(180deg, #f26d6d, #d83b3b); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 12px 30px -10px rgba(216,59,59,0.6); transition: transform 0.15s, box-shadow 0.15s; }
.wx-voice-end:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -10px rgba(216,59,59,0.7); }
.wx-voice-end svg { width: 24px; height: 24px; }
.wx-voice-cbtn-label, .wx-voice-end-label { display: none; }

@media (prefers-reduced-motion: reduce) {
  .wx-voice-core, .wx-voice-aura, .wx-voice-ring, .wx-voice-eq i { animation: none; }
}

@media (max-width: 480px) {
  .wx-console { width: calc(100vw - 24px); left: 12px; }
  .wx-dock { left: 14px; bottom: 14px; }
}

/* ── Engine pages have a full-width bottom CTA bar (~72px). Lift the
   widget above it so the left corner never covers the stage controls. ── */
body:has(.wfd-foot) body .wx-dock,
body:has(.gov-app) body .wx-dock,
body:has(.fin-app) body .wx-dock,
body:has(.ss-app) body .wx-dock,
body:has(.aira-app) body .wx-dock,
body:has(.pvc-app) body .wx-dock,
body:has(.bmc-app) body .wx-dock,
body:has(.wfd-app) body .wx-dock { bottom: 94px; }

body:has(.wfd-foot) body .wx-console,
body:has(.gov-app) body .wx-console,
body:has(.fin-app) body .wx-console,
body:has(.ss-app) body .wx-console,
body:has(.aira-app) body .wx-console,
body:has(.pvc-app) body .wx-console,
body:has(.bmc-app) body .wx-console,
body:has(.wfd-app) body .wx-console { bottom: 94px; height: min(600px, calc(100vh - 118px)); }

/* ===========================================================================
   LIGHT THEME  (html[data-theme="light"]) — cream surfaces, deeper green.
   Voice mode stays immersive-dark on purpose.
   =========================================================================== */
html[data-theme="light"] body {
  --wx-accent: #16a34a;
  --wx-accent-bright: #15803d;
  --wx-accent-deep: #166534;
  --wx-accent-soft: rgba(22,163,74,0.16);
  --wx-accent-glow: rgba(22,163,74,0.22);
  --wx-peach: #bd6446;
  --wx-line: rgba(26,38,32,0.10);
  --wx-line-strong: rgba(26,38,32,0.18);
  --wx-text: #1c2420;
  --wx-text-dim: #586259;
  --wx-text-faint: #8a948d;
}
html[data-theme="light"] body .wx-console {
  background: linear-gradient(180deg, #ffffff, #f5f7f3);
  box-shadow: 0 30px 80px -28px rgba(20,40,30,0.32), 0 0 0 1px rgba(26,38,32,0.06);
}
html[data-theme="light"] body .wx-nudge {
  background: linear-gradient(180deg, #ffffff, #f3f6f1);
  box-shadow: 0 16px 42px -16px rgba(20,40,30,0.28);
}
html[data-theme="light"] body .wx-orb {
  background: radial-gradient(circle at 50% 36%, #1c2a24, #0a120e 78%);
  border-color: rgba(22,163,74,0.45);
  box-shadow: 0 14px 34px -10px rgba(16,32,24,0.5), 0 0 22px -8px var(--wx-accent-glow);
}
html[data-theme="light"] body .wx-orb:hover { border-color: var(--wx-accent); }
html[data-theme="light"] body .wx-orb-grip i { background: rgba(255,255,255,0.6); }
html[data-theme="light"] body .wx-head-orb,
html[data-theme="light"] body .wx-msg-orb,
html[data-theme="light"] body .wx-fb-done-orb {
  background: radial-gradient(circle at 50% 40%, rgba(22,163,74,0.18), #eef2ec 72%);
}
html[data-theme="light"] body .wx-modes { background: rgba(26,38,32,0.05); }
html[data-theme="light"] body .wx-context { background: rgba(22,163,74,0.08); }
html[data-theme="light"] body .wx-msg--x .wx-bubble { background: rgba(26,38,32,0.05); }
html[data-theme="light"] body .wx-chip { background: rgba(26,38,32,0.03); }
html[data-theme="light"] body .wx-chip:hover { background: rgba(22,163,74,0.09); }
html[data-theme="light"] body .wx-fb-type { background: rgba(26,38,32,0.03); }
html[data-theme="light"] body .wx-fb-textarea { background: #fbfcfa; }
html[data-theme="light"] body .wx-fb-attach { background: rgba(26,38,32,0.02); }
html[data-theme="light"] body .wx-composer { background: rgba(245,247,243,0.7); }
html[data-theme="light"] body .wx-composer input { background: rgba(26,38,32,0.04); }
html[data-theme="light"] body .wx-mic,
html[data-theme="light"] body .wx-close,
html[data-theme="light"] body .wx-fb-done-btn { background: rgba(26,38,32,0.03); }
html[data-theme="light"] body .wx-scroll::-webkit-scrollbar-thumb { background: rgba(26,38,32,0.16); }
html[data-theme="light"] body .wx-composer input:focus { background: rgba(22,163,74,0.06); }

/* Light voice mode */
html[data-theme="light"] body .wx-voice {
  background:
    radial-gradient(120% 80% at 50% 36%, rgba(22,163,74,0.12), transparent 60%),
    radial-gradient(90% 70% at 50% 122%, rgba(189,100,70,0.07), transparent 60%),
    linear-gradient(180deg, #ffffff, #f3f6f1);
}
html[data-theme="light"] body .wx-voice::before {
  background-image: radial-gradient(circle at 1px 1px, rgba(26,38,32,0.08) 1px, transparent 0);
}
html[data-theme="light"] body .wx-voice-core {
  background: radial-gradient(circle at 50% 36%, #20302a, #0a120e 78%);
  box-shadow: 0 14px 38px -10px rgba(16,32,24,0.42), 0 0 52px -6px var(--wx-accent-glow), inset 0 0 22px -8px rgba(92,242,142,0.4);
}
html[data-theme="light"] body .wx-voice-ring { border-color: var(--wx-accent); opacity: 0.42; }
html[data-theme="light"] body .wx-voice-cbtn { background: rgba(26,38,32,0.05); border-color: var(--wx-line-strong); color: var(--wx-text); }
html[data-theme="light"] body .wx-voice-cbtn.is-muted { border-color: rgba(216,59,59,0.45); background: rgba(216,59,59,0.10); color: #c0392b; }
