/* Auth is deliberately outside this layer. Every visual rule owns appShell. */
#appShell {
  --wx-canvas: #f5f2eb;
  --wx-surface: #fffdf8;
  --wx-ink: #21332a;
  --wx-muted: #64705f;
  --wx-line: #e1e3d8;
  --wx-soft: #eeeede;
  --wx-gold: #d4b573;
  --wx-gold-soft: #f4ecd6;
  --wx-lilac: #ddd7e9;
  --wx-sidebar: #14271f;
  --wx-side-text: #f1eee5;
  --wx-shadow: 0 16px 55px #25392b0a;
  background: var(--wx-canvas);
  color: var(--wx-ink);
  font-weight: 400;
}
:root[data-theme="dark"] #appShell {
  --wx-canvas: #111c17;
  --wx-surface: #1b2922;
  --wx-ink: #f3f1e7;
  --wx-muted: #acb8ab;
  --wx-line: #35443a;
  --wx-soft: #25362b;
  --wx-gold: #dec38a;
  --wx-gold-soft: #3c3929;
  --wx-lilac: #4a455a;
  --wx-sidebar: #0b1710;
  --wx-side-text: #f1eee5;
  --wx-shadow: 0 16px 55px #00000012;
}
#appShell :is(button,input,textarea,select) { font-family: inherit; }
#appShell button { font-weight: 600; }
#appShell .workspace { min-width: 0; padding: 0 32px 24px; background: var(--wx-canvas); }
#appShell .topbar { height: 86px; min-height: 86px; padding: 16px 0; background: transparent; border-bottom: 1px solid var(--wx-line); box-shadow: none; }
#appShell .topbar h2 { color: var(--wx-ink); font-family: var(--display-serif,Georgia,serif); font-size: 31px; font-weight: 600; letter-spacing: -.02em; }
#appShell .topbar .eyebrow { color: var(--wx-muted); font-size: 11px; letter-spacing: .1em; font-weight: 500; }
#appShell .topbar-title { flex: 1 1 auto; min-width: 0; }
#appShell .topbar-actions { flex: 0 0 auto; gap: 8px; }
#appShell .topbar :is(.theme-toggle,.topbar-profile-button) { width: 42px; height: 42px; min-height: 42px; background: var(--wx-surface); color: var(--wx-ink); border: 1px solid var(--wx-line); border-radius: 50%; }
#appShell .token-balance { min-height: 42px; color: var(--wx-ink); background: var(--wx-gold-soft); border: 1px solid transparent; border-radius: 24px; font-size: 12px; }
#appShell .sidebar { padding: 28px 18px 18px; color: var(--wx-side-text); background: var(--wx-sidebar); border-right: 0; }
#appShell .sidebar .sidebar-brand { padding: 0 12px 25px; margin-bottom: 15px; border-bottom: 1px solid #ffffff16; }
#appShell .sidebar .sidebar-brand strong { font-family: var(--display-serif,Georgia,serif); color: var(--wx-side-text); font-size: 32px; font-weight: 600; }
#appShell .sidebar .brand-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
#appShell .sidebar .presence { color: #a5b2a3; font-size: 11px; }
#appShell .main-nav { gap: 6px; }
#appShell .main-nav :is(button,.nav-more summary) { min-height: 49px; color: #c3cfc1; background: transparent; border: 1px solid transparent; border-radius: 12px; font-size: 13px; font-weight: 500; }
#appShell .main-nav button.active { background: #e7d9b4; color: #203329; }
#appShell .main-nav :is(button,.nav-more summary):hover { background: #ffffff0e; color: white; }
#appShell .main-nav button.active:hover { background: #ecdfbf; color: #203329; }
#appShell .main-nav svg { width: 19px; height: 19px; }
#appShell .sidebar-bottom { padding-top: 18px; border-top: 1px solid #ffffff16; }
#appShell .sidebar-profile { background: #ffffff08; color: #eeeade; border-color: #ffffff15; border-radius: 12px; }
#appShell .sidebar-profile-copy :is(strong,small) { color: #d6dfd1; }
#appShell .sidebar-logout { color: #b5c2b1; background: transparent; border-color: transparent; }
#appShell .view { width: min(1180px,100%); padding: 18px 0 30px; }
#appShell .primary { border: 1px solid var(--wx-ink); border-radius: 12px; background: var(--wx-ink); color: var(--wx-surface); }
#appShell .primary:hover { filter: brightness(1.12); }
#appShell .secondary { color: var(--wx-ink); background: var(--wx-surface); border: 1px solid var(--wx-line); border-radius: 12px; }
#appShell .ghost { color: var(--wx-ink); border-color: transparent; background: transparent; }
#appShell :is(button,a,input,textarea,select):focus-visible { outline: 3px solid var(--wx-gold); outline-offset: 3px; }

/* The conversation stays the destination, discovery is optional inside it. */
#appShell #view-chat .support-intent { align-items: center; justify-content: space-between; grid-template-columns: auto auto; gap: 16px; padding: 0 3px 10px; margin-bottom: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
#appShell #view-chat .support-intent-copy :is(.soft-label,h2,p) { display: none; }
#appShell #view-chat .mode-help { color: var(--wx-muted); font-size: 11px; min-height: 36px; text-decoration: none; }
#appShell #view-chat .mode-help::after { content: " ↗"; }
#appShell #view-chat .support-intent-control { gap: 3px; padding: 3px; border: 1px solid var(--wx-line); background: var(--wx-soft); border-radius: 24px; }
#appShell #view-chat .support-intent-control button { min-height: 34px; padding: 6px 17px; font-size: 12px; border: 0; border-radius: 20px; color: var(--wx-muted); background: transparent; }
#appShell #view-chat .support-intent-control button.active { color: var(--wx-ink); background: var(--wx-surface); box-shadow: 0 2px 7px #172e1f0a; }
#appShell #view-chat .support-intent-control svg { width: 15px; height: 15px; }
#appShell #view-chat .chat-layout { display: grid; grid-template-columns: minmax(0,1fr); height: calc(100dvh - 172px); min-height: 520px; gap: 0; }
#appShell #view-chat.active { display: flex; flex-direction: column; height: calc(100dvh - 110px); min-height: 430px; padding-bottom: 0; }
#appShell #view-chat.active .chat-layout { flex: 1 1 auto; height: auto; min-height: 0; }
/* The legacy fill:both entrance kept the whole chat at opacity 0 during its
   delay, including with reduced motion. Essential controls render immediately. */
#appShell #view-chat.active,
#appShell #view-chat.active .support-intent,
#appShell #view-chat.active .chat-layout { animation: none; opacity: 1; transform: none; }
#appShell #view-chat .action-rail { display: none; }
#appShell #view-chat .conversation-panel { height: 100%; min-height: 0; display: flex; flex-direction: column; padding: 0; background: var(--wx-surface); border: 1px solid var(--wx-line); border-radius: 22px; overflow: hidden; box-shadow: var(--wx-shadow); }
#appShell #chatPresence { flex: 0 0 auto; display: flex; align-items: center; min-height: 59px; padding: 10px 20px; background: var(--wx-surface); border-bottom: 1px solid var(--wx-line); }
#appShell #chatPresence .conversation-presence-person img { width: 34px; height: 34px; border-radius: 50%; }
#appShell #chatPresence strong { color: var(--wx-ink); font-size: 13px; }
#appShell #chatPresence small { color: var(--wx-muted); font-size: 11px; }
#appShell #chatPresence .conversation-presence-wave { display: none; }
#appShell .wx-discovery-toggle { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; min-height: 35px; padding: 6px 11px; color: var(--wx-ink); background: var(--wx-gold-soft); border: 1px solid transparent; border-radius: 18px; font-size: 11px; }
#appShell .wx-discovery-toggle svg { width: 14px; height: 14px; }
#appShell .wx-discovery-toggle[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
#appShell .wx-discovery { flex: 0 1 auto; display: grid; grid-template-columns: .9fr 1.1fr; gap: 26px; min-height: 0; max-height: 470px; overflow-y: auto; padding: 30px; border-bottom: 1px solid var(--wx-line); background: radial-gradient(ellipse at 0 0,var(--wx-gold-soft),transparent 75%),var(--wx-surface); scrollbar-width: thin; }
#appShell .wx-discovery[hidden], #appShell .wx-insight[hidden], #appShell .wx-laboratory[hidden], #appShell .wx-lab-return[hidden], #appShell .wx-lab-resume[hidden] { display: none; }
#appShell[data-wx-discovery="open"] .wx-discovery { flex: 1 1 auto; max-height: none; }
#appShell[data-wx-discovery="open"] #chatMessages { display: none; }
#appShell .wx-welcome { align-self: center; }
#appShell .wx-overline { display: block; color: var(--wx-muted); font-size: 11px; line-height: 1.5; font-weight: 650; letter-spacing: .15em; }
#appShell .wx-welcome h2 { margin: 12px 0 14px; font-family: var(--display-serif,Georgia,serif); font-size: clamp(35px,3.4vw,53px); line-height: .98; font-weight: 600; letter-spacing: -.025em; color: var(--wx-ink); }
#appShell .wx-welcome h2 em { font-weight: 600; color: #a88746; }
#appShell .wx-welcome > p { max-width: 320px; margin: 0 0 21px; color: var(--wx-muted); font-size: 13px; line-height: 1.65; }
#appShell .wx-primary { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 46px; padding: 12px 18px; border: 1px solid transparent; border-radius: 12px; background: var(--wx-ink); color: var(--wx-surface); font-size: 12px; font-weight: 600; }
#appShell .wx-primary svg { width: 17px; height: 17px; }
#appShell .wx-primary:hover { transform: translateY(-1px); filter: brightness(1.12); }
#appShell .wx-primary:disabled { cursor: wait; transform: none; opacity: .5; }
#appShell .wx-tour-link { display: block; padding: 10px 0; min-height: 35px; border: 0; background: transparent; color: var(--wx-muted); font-size: 11px; text-align: left; }
#appShell .wx-signature { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
#appShell .wx-signature img { width: 37px; height: 37px; object-fit: cover; border-radius: 50%; }
#appShell .wx-signature > span { color: var(--wx-ink); font-family: var(--display-serif,Georgia,serif); font-size: 21px; line-height: 1; }
#appShell .wx-signature small { display: block; margin-top: 5px; font-family: Inter,sans-serif; font-size: 11px; line-height: 1.3; color: var(--wx-muted); }
#appShell .wx-demo { align-self: center; min-width: 0; overflow: hidden; background: var(--wx-canvas); border: 1px solid var(--wx-line); border-radius: 18px; }
#appShell .wx-demo-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 17px; border-bottom: 1px solid var(--wx-line); }
#appShell .wx-demo-top > span { display: flex; align-items: center; gap: 7px; color: var(--wx-muted); font-size: 11px; line-height: 1.4; font-weight: 650; letter-spacing: .08em; }
#appShell .wx-demo-top i { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: #bca15e; }
#appShell .wx-demo-top > small { color: var(--wx-muted); font-size: 11px; white-space: nowrap; }
#appShell .wx-scene-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; padding: 9px; }
#appShell .wx-scene-tabs button { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 35px; padding: 5px; border: 1px solid transparent; border-radius: 8px; color: var(--wx-muted); background: transparent; font-size: 11px; white-space: nowrap; }
#appShell .wx-scene-tabs button[aria-selected="true"] { color: var(--wx-ink); border-color: var(--wx-line); background: var(--wx-surface); box-shadow: 0 2px 5px #28392d06; }
#appShell .wx-scene-tabs svg { width: 14px; height: 14px; }
#appShell .wx-scene { min-width: 0; padding: 13px 18px 17px; }
#appShell .wx-example-label { margin-bottom: 13px; color: var(--wx-muted); font-size: 11px; letter-spacing: .13em; font-weight: 650; }
#appShell .wx-bubble { width: fit-content; max-width: 89%; margin: 9px 0; padding: 10px 13px; border-radius: 12px 12px 12px 3px; background: var(--wx-surface); border: 1px solid var(--wx-line); font-size: 14px; line-height: 1.45; color: var(--wx-ink); }
#appShell .wx-bubble small { display: block; margin-top: 4px; color: var(--wx-muted); font-size: 11px; }
#appShell .wx-bubble-own { margin-left: auto; background: var(--wx-lilac); border-color: transparent; border-radius: 12px 12px 3px 12px; }
#appShell .wx-evidence { position: relative; }
#appShell .wx-is-revealed .wx-evidence { background: var(--wx-gold-soft); border-color: var(--wx-gold); box-shadow: 0 0 0 2px #d4b57314; }
#appShell .wx-reveal { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 39px; padding: 9px 0 3px; border: 0; border-radius: 0; color: var(--wx-ink); background: transparent; text-align: left; font-size: 11px; }
#appShell .wx-reveal > span { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid var(--wx-line); border-radius: 50%; font-size: 16px; }
#appShell .wx-insight { margin-top: 11px; padding: 14px; background: var(--wx-gold-soft); border: 1px solid #baa35e30; border-radius: 11px; color: var(--wx-ink); }
#appShell .wx-insight-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; }
#appShell .wx-insight p { margin: 7px 0 0; font-size: 14px; line-height: 1.65; }
#appShell .wx-insight-question { margin-top: 10px; padding-top: 10px; border-top: 1px solid #a88b4430; font-size: 11px; line-height: 1.55; color: var(--wx-muted); }
#appShell .wx-demo-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 17px; border-top: 1px solid var(--wx-line); }
#appShell .wx-demo-footer small { max-width: 180px; color: var(--wx-muted); font-size: 11px; line-height: 1.4; }
#appShell .wx-demo-footer button { min-height: 32px; padding: 5px 0; border: 0; background: transparent; color: var(--wx-ink); font-size: 11px; white-space: nowrap; }
#appShell .wx-timeline { display: grid; gap: 0; }
#appShell .wx-timeline > div { display: flex; align-items: flex-start; gap: 12px; padding: 9px; border: 1px solid transparent; border-radius: 10px; }
#appShell .wx-timeline > div > span { display: grid; place-items: center; flex: 0 0 27px; width: 27px; height: 27px; margin-top: 1px; border: 1px solid var(--wx-line); border-radius: 50%; color: var(--wx-muted); font-size: 11px; }
#appShell .wx-timeline p { margin: 0; font-size: 12px; line-height: 1.4; color: var(--wx-ink); }
#appShell .wx-timeline small { display: block; margin-top: 3px; color: var(--wx-muted); font-size: 11px; }
#appShell .wx-branches { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
#appShell .wx-branches > div { padding: 14px 11px; border: 1px solid var(--wx-line); border-radius: 11px; background: var(--wx-surface); }
#appShell .wx-branches span { font-size: 11px; letter-spacing: .1em; color: var(--wx-muted); }
#appShell .wx-branches strong { display: block; margin-top: 7px; font-size: 12px; font-weight: 600; }
#appShell .wx-branches p { color: var(--wx-muted); margin: 8px 0 0; font-size: 11px; line-height: 1.5; }
#appShell .wx-scene-note { margin: 14px 0 0; color: var(--wx-muted); font-size: 11px; line-height: 1.6; }
#appShell .wx-reaction-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 0; border-bottom: 1px solid var(--wx-line); }
#appShell .wx-reaction-row span { font-size: 12px; color: var(--wx-muted); }
#appShell .wx-reaction-row strong { font-size: 13px; font-weight: 600; text-align: right; }
#appShell .wx-pattern { display: flex; align-items: center; gap: 12px; margin: 11px 0; padding: 15px; border: 1px solid var(--wx-line); border-radius: 12px; background: var(--wx-surface); }
#appShell .wx-pattern-icon { display: grid; place-items: center; flex: 0 0 35px; height: 35px; border-radius: 50%; background: var(--wx-lilac); font-size: 21px; }
#appShell .wx-pattern-exception .wx-pattern-icon { background: var(--wx-gold-soft); }
#appShell .wx-pattern strong { font-size: 12px; font-weight: 600; }
#appShell .wx-pattern p { margin: 4px 0 0; color: var(--wx-muted); font-size: 11px; }

/* Existing message, recording and billing controls keep their native handlers. */
#appShell #view-chat .messages { flex: 1 1 auto; min-height: 70px; overflow-y: auto; padding: 22px 25px; background: var(--wx-surface); }
#appShell #view-chat .message { max-width: min(88%,730px); font-size: 14px; }
#appShell #view-chat .message-body { padding: 14px 17px; color: var(--wx-ink); background: var(--wx-canvas); border: 1px solid var(--wx-line); border-radius: 3px 17px 17px; line-height: 1.7; box-shadow: none; }
#appShell #view-chat .message.user .message-body { color: var(--wx-ink); background: var(--wx-soft); border-color: transparent; border-radius: 17px 3px 17px 17px; }
#appShell #view-chat .message.user .message-body p { color: var(--wx-ink); font-weight: 400; }
#appShell #view-chat .message-body > strong { color: var(--wx-muted); font-size: 11px; font-weight: 500; }
#appShell #view-chat .message-avatar { width: 30px; height: 30px; border-radius: 50%; }
#appShell #view-chat .chat-intent-row { display: none; }
#appShell #view-chat .chat-media-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 18px 0; border: 0; background: var(--wx-surface); }
#appShell #view-chat .chat-media-actions button { display: inline-flex; align-items: center; justify-content: center; flex-direction: row; gap: 5px; width: auto; min-width: 0; min-height: 34px; padding: 6px 9px; border-radius: 9px; color: var(--wx-muted); background: var(--wx-canvas); border: 1px solid var(--wx-line); font-size: 11px; }
#appShell #view-chat .chat-media-actions svg { width: 14px; height: 14px; }
#appShell #view-chat .chat-media-actions .button-label { font-size: 11px; }
#appShell #view-chat .media-token-cost { font-size: 11px; color: var(--wx-muted); }
#appShell #view-chat #chatMediaHint { display: none; }
#appShell #view-chat #chatMediaHint[data-visible="true"] { display: block; flex-basis: 100%; grid-column: 1 / -1; font-size: 11px; }
#appShell #view-chat .composer { flex: 0 0 auto; grid-template-columns: minmax(0,1fr) auto; gap: 10px; margin: 9px 18px 0; padding: 8px 8px 8px 14px; border: 1px solid var(--wx-line); border-radius: 16px; background: var(--wx-canvas); }
#appShell #view-chat .composer textarea { min-height: 36px; max-height: 145px; padding: 8px 0; border: 0; color: var(--wx-ink); background: transparent; font-size: 15px; line-height: 1.45; }
#appShell #view-chat .composer textarea::placeholder { color: var(--wx-muted); }
#appShell #view-chat .composer-submit { display: grid; place-items: center; width: 39px; height: 39px; min-height: 39px; padding: 0; border-radius: 12px; background: var(--wx-ink); color: var(--wx-surface); }
#appShell #view-chat .composer-submit span { display: none; }
#appShell #view-chat .chat-text-cost { flex: 0 0 auto; min-height: 18px; margin: 0; padding: 5px 20px 8px; color: var(--wx-muted); background: var(--wx-surface); font-size: 11px; }
#appShell .active-lab-notice { flex: 0 0 auto; margin: 8px 15px; border-radius: 12px; }

/* The laboratory demonstrates all six real tools before an explicit launch. */
#appShell .wx-laboratory { margin-bottom: 20px; }
#appShell .wx-lab-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
#appShell .wx-lab-heading h2 { margin: 8px 0 7px; font-family: var(--display-serif,Georgia,serif); color: var(--wx-ink); font-size: 47px; line-height: 1; font-weight: 600; letter-spacing: -.02em; }
#appShell .wx-lab-heading p { margin: 0; color: var(--wx-muted); font-size: 13px; }
#appShell .wx-lab-resume { min-height: 39px; padding: 9px 13px; border: 1px solid var(--wx-line); border-radius: 10px; background: var(--wx-surface); color: var(--wx-ink); font-size: 11px; }
#appShell .wx-lab-showcase { display: grid; grid-template-columns: minmax(210px,.65fr) minmax(0,1.6fr); gap: 16px; }
#appShell .wx-tool-tabs { display: grid; align-content: start; gap: 7px; }
#appShell .wx-tool-tabs button { display: grid; grid-template-columns: 20px minmax(0,1fr) 14px; align-items: center; gap: 13px; min-height: 65px; padding: 13px 17px; text-align: left; border: 1px solid var(--wx-line); border-radius: 13px; background: var(--wx-surface); color: var(--wx-ink); font-size: 12px; font-weight: 600; }
#appShell .wx-tool-tabs button[aria-selected="true"] { background: var(--wx-gold-soft); border-color: var(--wx-gold); }
#appShell .wx-tool-tabs button > svg { width: 19px; height: 19px; color: var(--wx-muted); }
#appShell .wx-tool-tabs small { display: block; margin-top: 4px; color: var(--wx-muted); font-size: 11px; font-weight: 400; }
#appShell .wx-tool-tabs button > span:last-child { color: var(--wx-muted); }
#appShell .wx-lab-result { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--wx-line); border-radius: 18px; overflow: hidden; background: var(--wx-surface); box-shadow: var(--wx-shadow); }
#appShell .wx-lab-result .wx-demo-top { padding: 17px 23px; }
#appShell .wx-lab-result .wx-scene { flex: 1; padding: 25px; background: linear-gradient(155deg,var(--wx-canvas),var(--wx-surface)); }
#appShell .wx-lab-result .wx-bubble { font-size: 14px; padding: 13px 16px; }
#appShell .wx-lab-result .wx-bubble small { font-size: 11px; }
#appShell .wx-lab-result .wx-reveal { min-height: 44px; margin-top: 12px; font-size: 12px; }
#appShell .wx-lab-result .wx-insight p { font-size: 14px; }
#appShell .wx-lab-result .wx-timeline p { font-size: 14px; }
#appShell .wx-lab-result .wx-timeline small { font-size: 12px; }
#appShell .wx-lab-result .wx-timeline > div { padding: 13px 10px; }
#appShell .wx-lab-action { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; border-top: 1px solid var(--wx-line); }
#appShell .wx-lab-action strong { display: block; color: var(--wx-ink); font-size: 12px; font-weight: 500; }
#appShell .wx-lab-action small { display: block; margin-top: 5px; color: var(--wx-muted); font-size: 11px; }
#appShell .wx-lab-action .wx-primary { white-space: nowrap; }
#appShell .wx-lab-fineprint { margin: 12px 0 0; color: var(--wx-muted); text-align: right; font-size: 11px; }
#appShell .wx-lab-return { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 11px 15px; border: 1px solid var(--wx-line); border-radius: 12px; background: var(--wx-surface); }
#appShell .wx-lab-return > span { font-size: 12px; color: var(--wx-muted); }
#appShell .wx-lab-return button { min-height: 35px; padding: 5px 0; color: var(--wx-ink); background: transparent; border: 0; font-size: 11px; }
#appShell[data-wx-ready="1"][data-wx-lab-active="0"] #view-lab .lab-mode-banner { display: none; }
#appShell[data-wx-ready="1"][data-wx-catalog-enhanced="1"] #view-lab > .split-view { grid-template-columns: minmax(0,1fr); }
#appShell[data-wx-ready="1"][data-wx-catalog-enhanced="1"] #view-lab > .split-view > section:first-child { display: none; }
#appShell[data-wx-ready="1"][data-wx-lab-active="0"][data-wx-catalog-enhanced="1"] #view-lab > .split-view > .work-panel { display: none; }
#appShell #view-lab .work-panel { border-radius: 18px; border-color: var(--wx-line); background: var(--wx-surface); }
#appShell #view-lab .lab-principle-details { margin-top: 20px; }
#appShell .wx-scene-arrival { animation: wxSceneArrival .22s ease-out; }
@keyframes wxSceneArrival { from { opacity: .35; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* An optional reading trail belongs to the visitor, never an invented summary. */
#appShell .wx-presence-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; flex: 0 0 auto; }
#appShell .wx-presence-actions .wx-discovery-toggle { margin-left: 0; }
#appShell .wx-thread-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 35px; padding: 6px 11px; border: 1px solid var(--wx-line); border-radius: 18px; color: var(--wx-ink); background: var(--wx-surface); font-size: 11px; }
#appShell .wx-thread-toggle svg { width: 15px; height: 15px; }
#appShell .wx-thread-short-label { display: none; }
#appShell .wx-thread-toggle b { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 1px 4px; background: var(--wx-soft); border-radius: 6px; color: var(--wx-muted); font-size: 11px; font-weight: 500; }
#appShell .wx-thread-toggle[aria-expanded="true"] { background: var(--wx-lilac); border-color: transparent; }
#appShell .wx-thread-toggle[hidden], #appShell .wx-thread[hidden] { display: none; }
#appShell .wx-thread { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; padding: 23px; gap: 13px; background: linear-gradient(140deg,var(--wx-gold-soft),transparent 65%),var(--wx-canvas); }
#appShell[data-wx-thread="open"] #chatMessages { display: none; }
#appShell .wx-thread > header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
#appShell .wx-thread h3 { margin: 6px 0 0; color: var(--wx-ink); font-family: var(--display-serif,Georgia,serif); font-size: 32px; line-height: 1.05; font-weight: 600; }
#appShell .wx-thread > header button { display: grid; place-items: center; width: 40px; height: 40px; min-height: 40px; flex: 0 0 40px; border: 1px solid var(--wx-line); border-radius: 50%; color: var(--wx-ink); background: var(--wx-surface); }
#appShell .wx-thread > header button svg { width: 16px; height: 16px; }
#appShell .wx-thread-caption { max-width: 560px; margin: 0; color: var(--wx-muted); font-size: 13px; line-height: 1.55; }
#appShell .wx-thread-items { display: grid; gap: 10px; }
#appShell .wx-thread-card { padding: 16px 18px 7px; border: 1px solid var(--wx-line); border-radius: 15px; background: var(--wx-surface); }
#appShell .wx-thread-label { display: block; font-size: 11px; letter-spacing: .07em; color: var(--wx-muted); font-weight: 600; }
#appShell .wx-thread-card blockquote { margin: 9px 0 11px; border: 0; padding: 0; color: var(--wx-ink); font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
#appShell .wx-thread-card > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; border-top: 1px solid var(--wx-line); }
#appShell .wx-thread-card button { min-height: 43px; padding: 8px 0; color: var(--wx-ink); background: transparent; border: 0; font-size: 12px; }
#appShell .wx-thread-card button:last-child { color: var(--wx-muted); }
#appShell .wx-thread-status { margin: 0; color: var(--wx-ink); font-size: 12px; line-height: 1.5; }
#appShell .wx-thread-status:empty { display: none; }
#appShell .wx-thread-note { color: var(--wx-muted); font-size: 11px; line-height: 1.5; }
#appShell #chatMessages .wx-history-focus .message-body { outline: 2px solid var(--wx-gold); outline-offset: 3px; }

/* Small interactive scenes, inspired by an output-first product showcase. */
#appShell .wx-demo { border-color: #b7b997; box-shadow: 0 15px 36px #1b2d2010; }
#appShell .wx-discovery { align-content: start; }
#appShell .wx-discovery .wx-demo { align-self: start; }
#appShell .wx-discovery .wx-welcome { align-self: start; padding-block: 18px; }
#appShell .wx-demo > .wx-demo-top { color: #f9f7ee; background: #22372b; border-bottom-color: #ffffff12; }
#appShell .wx-demo > .wx-demo-top :is(span,small) { color: #f9f7ee; }
#appShell .wx-demo > .wx-demo-top > span { max-width: 360px; letter-spacing: .04em; }
#appShell .wx-demo > .wx-demo-top i { background: #e2eaa3; }
#appShell .wx-demo[data-scene="situation"] .wx-scene-tabs button[aria-selected="true"] { background: var(--wx-lilac); border-color: transparent; }
#appShell .wx-demo[data-scene="conflict"] .wx-scene-tabs button[aria-selected="true"] { background: var(--wx-gold-soft); border-color: transparent; }
#appShell .wx-detail-choice { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--wx-line); }
#appShell .wx-detail-choice > strong { display: block; margin-bottom: 9px; color: var(--wx-ink); font-size: 13px; line-height: 1.4; }
#appShell .wx-detail-choice > div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
#appShell .wx-detail-choice button { min-height: 52px; padding: 10px; text-align: left; color: var(--wx-ink); background: var(--wx-surface); border: 1px solid var(--wx-line); border-radius: 10px; font-size: 12px; line-height: 1.4; }
#appShell .wx-detail-choice button[aria-pressed="true"] { border-color: var(--wx-gold); background: var(--wx-gold-soft); box-shadow: 0 0 0 2px #d4b57316; }
#appShell .wx-detail-feedback { margin: 10px 0 0; font-size: 12px; line-height: 1.55; color: var(--wx-ink); }
#appShell .wx-detail-feedback[hidden] { display: none; }

/* Each real tool has its own cover, with no simulated processing or scores. */
#appShell .wx-lab-heading h2 { line-height: 1.01; }
#appShell .wx-lab-heading h2 em { color: #a88746; font-weight: inherit; }
:root[data-theme="dark"] #appShell .wx-lab-heading h2 em { color: var(--wx-gold); }
#appShell .wx-lab-result { --wx-cover-tone: #e5eab4; }
#appShell .wx-lab-result[data-tool="situation"] { --wx-cover-tone: #e0d6ee; }
#appShell .wx-lab-result[data-tool="conflict"] { --wx-cover-tone: #f0d5bd; }
#appShell .wx-lab-result[data-tool="telepath"] { --wx-cover-tone: #d5e6ca; }
#appShell .wx-lab-result[data-tool="radar"] { --wx-cover-tone: #ccdee2; }
#appShell .wx-lab-result[data-tool="artifacts"] { --wx-cover-tone: #ead8be; }
#appShell .wx-lab-cover { display: flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 128px; padding: 23px 25px; color: #21352b; background: var(--wx-cover-tone); overflow: hidden; }
#appShell .wx-lab-cover .wx-overline { color: #49604f; font-size: 11px; letter-spacing: .09em; }
#appShell .wx-lab-cover h3 { margin: 9px 0 0; color: #21352b; font-family: var(--display-serif,Georgia,serif); font-size: 39px; line-height: 1; letter-spacing: -.02em; font-weight: 600; }
#appShell .wx-cover-symbol { display: grid; place-items: center; width: 71px; height: 71px; flex: 0 0 71px; border: 1px solid #21352b38; border-radius: 50%; color: #21352b; font-family: Georgia,serif; font-size: 51px; line-height: 1; transform: rotate(-10deg); }
#appShell .wx-tool-tabs button { grid-template-columns: 38px minmax(0,1fr) 14px; gap: 11px; }
#appShell .wx-tool-tabs button > svg { width: 36px; height: 36px; padding: 9px; border-radius: 11px; color: #2b4434; background: #e5eab4; }
#appShell .wx-tool-tabs [data-wx-tool="situation"] > svg { background: #e0d6ee; }
#appShell .wx-tool-tabs [data-wx-tool="conflict"] > svg { background: #f0d5bd; }
#appShell .wx-tool-tabs [data-wx-tool="telepath"] > svg { background: #d5e6ca; }
#appShell .wx-tool-tabs [data-wx-tool="radar"] > svg { background: #ccdee2; }
#appShell .wx-tool-tabs [data-wx-tool="artifacts"] > svg { background: #ead8be; }
#appShell .wx-journey { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 17px 22px; margin-top: 14px; border: 1px solid var(--wx-line); border-radius: 13px; background: var(--wx-surface); color: var(--wx-ink); }
#appShell .wx-journey > span { display: flex; align-items: center; gap: 10px; font-size: 12px; }
#appShell .wx-journey b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--wx-gold-soft); font-size: 11px; font-weight: 600; }
#appShell .wx-journey > i { font-style: normal; color: var(--wx-muted); }

@media (min-width: 1500px) {
  #appShell .workspace { padding-inline: 48px; }
  #appShell .wx-discovery { padding: 44px; gap: 48px; }
  #appShell .wx-demo { width: min(100%,530px); justify-self: center; }
}
@media (max-width: 1100px) and (min-width: 961px) {
  #appShell .workspace { padding-inline: 20px; }
  #appShell .wx-discovery { padding: 22px; gap: 18px; }
  #appShell .wx-welcome h2 { font-size: 36px; }
  #appShell .wx-signature { display: none; }
  #appShell .wx-lab-showcase { grid-template-columns: 210px minmax(0,1fr); }
  #appShell .wx-lab-action { align-items: stretch; flex-direction: column; gap: 12px; }
}
@media (max-width: 960px) {
  #appShell .workspace { padding: 0 12px 0; }
  #appShell .sidebar { display: none; }
  #appShell .topbar { height: 62px; min-height: 62px; padding: 9px 1px; gap: 12px; border-bottom: 0; }
  #appShell .topbar h2 { font-size: 25px; line-height: 1; }
  #appShell .topbar .eyebrow { display: none; }
  #appShell .topbar-actions { gap: 5px; }
  #appShell .topbar :is(.theme-toggle,.topbar-profile-button) { width: 44px; height: 44px; min-height: 44px; }
  #appShell .token-balance { min-height: 37px; padding-inline: 10px; gap: 4px; }
  #appShell .topbar-profile-button { display: none; }
  #appShell .bottom-nav { min-height: 67px; padding: 6px 6px calc(6px + env(safe-area-inset-bottom,0px)); border: 1px solid var(--wx-line); border-bottom: 0; border-radius: 18px 18px 0 0; background: var(--wx-surface); box-shadow: 0 -3px 24px #192e2107; }
  #appShell .bottom-nav button { min-height: 47px; border-radius: 12px; font-size: 11px; color: var(--wx-muted); }
  #appShell .bottom-nav button.active { color: var(--wx-ink); background: var(--wx-gold-soft); }
  #appShell .bottom-nav svg { width: 19px; height: 19px; }
  #appShell .view { padding-top: 8px; }
  #appShell #view-chat.active { display: flex; flex-direction: column; gap: 7px; height: calc(min(var(--app-vh,100dvh),100dvh) - 135px - env(safe-area-inset-bottom,0px)); min-height: 260px; padding: 0; }
  #appShell #view-chat .support-intent { display: flex; flex: 0 0 auto; padding: 0 2px; gap: 10px; }
  #appShell #view-chat .support-intent-control { margin-left: auto; }
  #appShell #view-chat .support-intent-control button { min-height: 36px; padding: 5px 10px; font-size: 12px; }
  #appShell #view-chat .mode-help { font-size: 12px; white-space: nowrap; }
  #appShell #view-chat .chat-layout { flex: 1 1 auto; height: auto; min-height: 0; }
  #appShell #view-chat .conversation-panel { border-radius: 17px; }
  #appShell #chatPresence { display: flex; min-height: 48px; padding: 7px 12px; }
  #appShell #chatPresence .conversation-presence-person img { width: 29px; height: 29px; }
  #appShell #chatPresence strong { font-size: 12px; }
  #appShell #chatPresence small { font-size: 11px; }
  #appShell .wx-discovery-toggle { gap: 5px; min-height: 32px; padding: 5px 9px; font-size: 11px; }
  #appShell .wx-discovery-toggle svg { width: 12px; height: 12px; }
  #appShell .wx-presence-actions { gap: 5px; }
  #appShell .wx-thread-toggle { width: auto; min-height: 40px; padding: 6px 8px; gap: 4px; }
  #appShell .wx-thread-toggle > svg, #appShell .wx-thread-full-label { display: none; }
  #appShell .wx-thread-short-label { display: inline; }
  #appShell #chatPresence .conversation-presence-person small { display: none; }
  #appShell .wx-thread { padding: 17px 13px; gap: 11px; }
  #appShell .wx-thread h3 { font-size: 28px; }
  #appShell .wx-thread > header button { width: 40px; height: 40px; min-height: 40px; flex-basis: 40px; }
  #appShell .wx-thread-caption { font-size: 12px; }
  #appShell .wx-thread-card { padding: 13px 13px 4px; }
  #appShell .wx-thread-card blockquote { font-size: 14px; }
  #appShell .wx-thread-card button { font-size: 11px; }
  #appShell .wx-discovery { grid-template-columns: minmax(0,1fr); gap: 16px; padding: 19px; max-height: 70dvh; overscroll-behavior: contain; }
  #appShell .wx-welcome { align-self: start; }
  #appShell .wx-discovery .wx-welcome { padding-block: 0; }
  #appShell .wx-welcome > .wx-overline { display: none; }
  #appShell .wx-overline { font-size: 11px; }
  #appShell .wx-welcome h2 { margin: 9px 0 10px; font-size: 36px; line-height: .97; }
  #appShell .wx-welcome h2 br { display: none; }
  #appShell .wx-welcome h2 em { display: block; }
  #appShell .wx-welcome > p { max-width: none; margin-bottom: 0; font-size: 14px; line-height: 1.55; }
  #appShell .wx-welcome > .wx-primary, #appShell .wx-signature, #appShell .wx-tour-link { display: none; }
  #appShell .wx-demo { width: 100%; align-self: start; border-radius: 12px; }
  #appShell .wx-demo-top { padding: 10px 12px; }
  #appShell .wx-demo-top > span { font-size: 11px; }
  #appShell .wx-demo-top > small { font-size: 11px; }
  #appShell .wx-scene-tabs { padding: 6px; }
  #appShell .wx-scene-tabs button { min-height: 34px; font-size: 11px; gap: 4px; }
  #appShell .wx-scene-tabs svg { width: 12px; height: 12px; }
  #appShell .wx-scene { padding: 10px 12px 12px; }
  #appShell .wx-example-label { margin-bottom: 9px; font-size: 11px; }
  #appShell #workspaceChatDemo .wx-example-label { display: none; }
  #appShell .wx-bubble { max-width: 100%; padding: 9px 11px; margin: 7px 0; font-size: 14px; }
  #appShell .wx-reveal { min-height: 44px; font-size: 12px; }
  #appShell .wx-insight { padding: 11px; }
  #appShell .wx-insight p { font-size: 14px; }
  #appShell .wx-insight-question { font-size: 12px; }
  #appShell .wx-demo-footer { padding: 8px 12px; }
  #appShell .wx-demo-footer small { max-width: 150px; font-size: 11px; }
  #appShell .wx-demo-footer button { min-height: 44px; font-size: 12px; }
  #appShell #view-chat .messages { min-height: 60px; padding: 16px 12px; }
  #appShell #view-chat .message { max-width: 94%; font-size: 14px; }
  #appShell #view-chat .message-body { padding: 12px 13px; font-size: 14px; line-height: 1.65; }
  #appShell #view-chat .message-avatar { width: 25px; height: 25px; }
  #appShell #view-chat .chat-media-actions { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; padding: 6px 9px 0; }
  #appShell #view-chat .chat-media-actions button { width: 100%; min-height: 57px; padding: 5px 2px; gap: 2px; border-radius: 8px; flex-direction: column; flex-wrap: nowrap; }
  #appShell #view-chat .chat-media-actions svg { width: 13px; height: 13px; }
  #appShell #view-chat .chat-media-actions .button-label { font-size: 11px; line-height: 1.2; }
  #appShell #view-chat .media-token-cost { flex-basis: auto; justify-content: center; font-size: 11px; line-height: 1.1; }
  #appShell #view-chat .composer { margin: 7px 9px 0; padding: 6px 6px 6px 12px; gap: 6px; border-radius: 13px; }
  #appShell #view-chat .composer textarea { min-height: 34px; font-size: 16px; }
  #appShell #view-chat .composer-submit { width: 44px; height: 44px; min-height: 44px; flex-shrink: 0; border-radius: 11px; }
  #appShell #view-chat .chat-text-cost { min-height: 17px; padding: 4px 13px 7px; font-size: 11px; }
  #appShell .wx-lab-heading { margin-bottom: 17px; align-items: flex-start; }
  #appShell .wx-lab-heading { flex-direction: column; gap: 12px; }
  #appShell .wx-lab-heading h2 { margin-top: 7px; font-size: 37px; }
  #appShell .wx-lab-heading p { font-size: 11px; line-height: 1.5; max-width: 280px; }
  #appShell .wx-lab-showcase { grid-template-columns: minmax(0,1fr); gap: 12px; }
  #appShell .wx-tool-tabs { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  #appShell .wx-tool-tabs button { display: flex; flex-direction: column; justify-content: center; gap: 7px; min-height: 77px; padding: 10px 4px; border-radius: 11px; text-align: center; font-size: 11px; line-height: 1.2; }
  #appShell .wx-tool-tabs button > svg { width: 17px; height: 17px; }
  #appShell .wx-tool-tabs small, #appShell .wx-tool-tabs button > span:last-child { display: none; }
  #appShell .wx-lab-result { border-radius: 14px; }
  #appShell .wx-lab-result .wx-demo-top { padding: 12px 15px; }
  #appShell .wx-lab-result .wx-scene { padding: 17px; }
  #appShell .wx-lab-result .wx-bubble { font-size: 13px; padding: 10px 13px; }
  #appShell .wx-lab-result .wx-bubble small { font-size: 11px; }
  #appShell .wx-lab-result .wx-reveal { margin-top: 7px; font-size: 11px; }
  #appShell .wx-lab-result .wx-insight p { font-size: 12px; }
  #appShell .wx-lab-cover { min-height: 84px; padding: 12px 15px; gap: 14px; }
  #appShell .wx-lab-cover .wx-overline { display: none; }
  #appShell .wx-lab-cover h3 { margin: 0; font-size: 28px; overflow-wrap: anywhere; }
  #appShell .wx-cover-symbol { width: 42px; height: 42px; flex-basis: 42px; font-size: 30px; }
  #appShell .wx-tool-tabs button > svg { width: 30px; height: 30px; padding: 6px; border-radius: 9px; }
  #appShell .wx-journey { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; padding: 0; border: 0; background: transparent; }
  #appShell .wx-journey > i { display: none; }
  #appShell .wx-journey > span { min-height: 34px; justify-content: center; padding: 6px; text-align: center; line-height: 1.4; font-size: 11px; border: 1px solid var(--wx-line); border-radius: 10px; background: var(--wx-surface); }
  #appShell .wx-journey b { display: none; }
  #appShell .wx-detail-choice > div { grid-template-columns: minmax(0,1fr); }
  #appShell .wx-detail-choice button { min-height: 44px; }
  #appShell .wx-lab-result .wx-timeline p { font-size: 13px; }
  #appShell .wx-lab-result .wx-timeline small { font-size: 11px; }
  #appShell .wx-lab-action { flex-direction: column; align-items: stretch; gap: 13px; padding: 16px 17px; }
  #appShell .wx-lab-action .wx-primary { width: 100%; white-space: normal; min-height: 46px; }
  #appShell .wx-lab-action strong { font-size: 11px; }
  #appShell .wx-lab-action small { font-size: 11px; }
  #appShell .wx-lab-fineprint { margin-top: 10px; text-align: left; font-size: 11px; line-height: 1.5; }
  #appShell .wx-lab-return { padding: 9px 12px; gap: 8px; }
  #appShell .wx-lab-return > span { font-size: 11px; }
  #appShell .wx-lab-return button { font-size: 11px; text-align: right; }
  #appShell .wx-branches { grid-template-columns: minmax(0,1fr); gap: 7px; }
  #appShell .wx-branches > div { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 3px 8px; padding: 11px; }
  #appShell .wx-branches strong { margin: 0; }
  #appShell .wx-branches p { grid-column: 2; margin-top: 1px; }
  :root[data-keyboard] #appShell #view-chat.active { height: calc(min(var(--app-vh,100dvh),100dvh) - 61px); min-height: 150px; }
  :root[data-keyboard] #appShell #view-chat .support-intent,
  :root[data-keyboard] #appShell .wx-discovery,
  :root[data-keyboard] #appShell .wx-thread,
  :root[data-keyboard] #appShell #chatPresence { display: none !important; }
  :root[data-keyboard] #appShell #chatMessages { display: block !important; }
}
@media (max-width: 360px) {
  #appShell .workspace { padding-inline: 8px; }
  #appShell .wx-discovery { padding: 15px; gap: 12px; }
  #appShell .wx-welcome h2 { font-size: 32px; }
  #appShell .wx-scene-tabs svg { display: none; }
  #appShell .wx-tool-tabs button { font-size: 11px; }
  #appShell #view-chat .support-intent-control button { padding-inline: 9px; }
  #appShell #view-chat .mode-help { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  #appShell .wx-scene-arrival { animation: none; }
  #appShell .wx-primary:hover { transform: none; }
}
