body.companion-open { overflow: hidden; }
html.page-scrollbar-hidden, html.page-scrollbar-hidden body, .companion-page .companion-transcript {
  scrollbar-width: none;
}
html.page-scrollbar-hidden::-webkit-scrollbar,
html.page-scrollbar-hidden body::-webkit-scrollbar,
.companion-page .companion-transcript::-webkit-scrollbar { display: none; width: 0; height: 0; }
body.companion-open #root > :not(.aura-header):not(dialog) { display: none !important; }
.companion-page, .companion-load-error {
  position: fixed;
  inset: 18.83dvh auto auto 12.77vw;
  width: 75.05vw;
  height: 66.45dvh;
  color: #526b7b;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  color-scheme: light;
  z-index: 10;
}
.companion-page { display: grid; grid-template-columns: 65.22% minmax(0, 1fr); }
.companion-page * { box-sizing: border-box; }
.companion-page [hidden] { display: none !important; }
.companion-page button, .companion-page textarea, .companion-page select { font: inherit; }
.companion-page button { cursor: pointer; }
.companion-page button:disabled { cursor: default; }
.companion-page button:focus-visible, .companion-page a:focus-visible,
.companion-page select:focus-visible, .companion-settings summary:focus-visible {
  outline: 2px solid #7494a6;
  outline-offset: 3px;
}
.companion-sidebar { position: relative; grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; }
.companion-pet-card { position: absolute; inset: 0; }
.companion-scene {
  position: absolute;
  width: 48vw;
  height: 50.54dvh;
  left: auto;
  right: calc(-12.18vw + 16px);
  bottom: -8.97dvh;
}
.companion-stage { position: absolute; inset: 0; outline: none; touch-action: none; }
.companion-stage:not(.is-pointer-focused):focus-visible { outline: 1px solid #a9bac5; outline-offset: -20px; border-radius: 32px; }
.companion-stage canvas { display: block; width: 100%; height: 100%; }
.companion-stage-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.companion-stage-status[data-error] { inset: auto 0 0; width: 100%; height: auto; overflow: visible; clip-path: none; text-align: center; color: #899ba7; font-size: 10px; }
.companion-chat {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  border: 1px solid #ffffff14;
  border-radius: clamp(24px, 2.17vw, 42px);
  background: #ffffff1f;
  box-shadow: 7px 7px 24px #9f9f9f26, inset 3px 3px 3px #c3c3c326;
  z-index: 1;
}
.companion-settings { position: absolute; top: 13px; right: 20px; z-index: 4; color: #8195a3; }
.companion-settings > summary { display: grid; width: 26px; height: 24px; place-items: center; padding: 0 0 6px; list-style: none; font-size: 19px; letter-spacing: 1px; cursor: pointer; border-radius: 7px; opacity: .5; }
.companion-settings > summary::-webkit-details-marker { display: none; }
.companion-settings > summary:hover, .companion-settings[open] > summary { background: #ffffff80; opacity: 1; }
.companion-settings-panel { position: absolute; right: 0; top: 31px; width: min(280px, 76vw); padding: 15px; border: 1px solid #fff9; border-radius: 15px; background: #f2f4f7f5; box-shadow: 0 12px 35px #7384941f; backdrop-filter: blur(18px); }
.companion-chat-header { display: flex; flex-direction: column; gap: 13px; }
.companion-model select { display: block; width: 100%; padding: 8px; border: 1px solid #dce4e9; border-radius: 8px; background: #ffffff59; color: #607e90; font-size: 11px; cursor: pointer; }
.companion-modes { display: flex; padding: 3px; gap: 3px; border: 1px solid #e0e6eb; border-radius: 9px; background: #e7ecf0; }
.companion-modes button { flex: 1; padding: 7px 12px; border: 0; border-radius: 6px; color: #89979f; background: transparent; font-size: 11px; }
.companion-modes button[aria-pressed=true] { background: #fff; color: #4e6e82; }
.companion-new { display: block; width: 100%; min-height: 36px; margin: 13px 0; border: 1px solid #dde5ea; border-radius: 9px; background: #ffffff70; color: #657c8c; font-size: 11px !important; }
.companion-new:hover { background: #fff; }
.companion-history { display: flex; flex-direction: column; gap: 4px; max-height: 190px; overflow-y: auto; }
.companion-history h2 { margin: 2px 7px 6px; font-size: 10px; color: #97a5ad; font-weight: 400; }
.companion-history button { padding: 9px 7px; border: 0; border-radius: 7px; text-align: left; color: #788995; background: transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; flex-shrink: 0; }
.companion-history button:hover, .companion-history button[aria-current=true] { background: #fff8; color: #536d80; }
.companion-transcript { min-height: 0; margin: 12px 0 0; padding: 24px 30px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c9d5df88 transparent; }
.companion-welcome { display: flex; min-height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: clamp(18px, 2.8dvh, 26px); padding: 16px 0 0; }
.companion-welcome h2 { margin: 0; color: #526b7b; font-size: clamp(23px, 2.1vw, 40px); letter-spacing: -.05em; font-weight: 400; text-align: center; }
.companion-welcome p { margin: -8px 0 0; font-size: clamp(10px, .72vw, 14px); color: #97a7b2; text-align: center; line-height: 1.8; }
.companion-suggestions { display: grid; width: min(62%, 520px); grid-template-columns: 1fr 1fr; gap: clamp(10px, 2.5dvh, 23px) 14px; margin-top: 9px; }
.companion-suggestions button { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 8px 5px; border: 0; border-radius: 8px; background: transparent; color: #7894a5; text-align: left; font-size: clamp(10px, .68vw, 13px); line-height: 1.4; }
.companion-suggestions button:hover { color: #4c7089; background: #ffffff30; }
.companion-suggestions span { color: #a0aeb8; font-size: clamp(9px, .62vw, 12px); line-height: 1.6; }
.companion-message { max-width: 720px; margin: 0 auto 24px; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
.companion-message-user { display: flex; justify-content: flex-end; }
.companion-user-text { max-width: 90%; margin: 0; padding: 11px 16px; border-radius: 16px 16px 4px 16px; background: #dce6ed88; color: #4a6475; white-space: pre-wrap; }
.companion-sender { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; color: #79909e; font-size: 11px; }
.companion-sender::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #b3c7d3; }
.companion-thought { margin: 0 0 13px; }
.companion-message-body { color: #4c5f6d; }
.companion-message-body p { margin: 0 0 12px; white-space: pre-wrap; }
.companion-message-body h3 { margin: 18px 0 9px; font-size: 15px; font-weight: 600; }
.companion-message-body ul, .companion-message-body ol { margin: 9px 0 15px; padding-left: 22px; }
.companion-message-body a { color: #4c7b99; text-decoration: underline; text-underline-offset: 3px; }
.companion-message-body code { font: 12px/1.8 Consolas, "Courier New", monospace; background: #dfe7edaa; padding: 2px 4px; border-radius: 4px; }
.companion-code { margin: 15px 0; border: 1px solid #d5e0e7; border-radius: 12px; overflow: hidden; background: #eef2f588; }
.companion-code-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 13px; border-bottom: 1px solid #d5e0e7; color: #7b8d9b; font-size: 10px; }
.companion-code-actions { display: flex; gap: 12px; }
.companion-code button, .companion-copy-reply { padding: 3px 0; border: 0; background: transparent; color: #7992a3; font-size: 10px; }
.companion-code button:hover, .companion-copy-reply:hover { color: #2b5975; }
.companion-code pre { margin: 0; padding: 15px; max-height: 460px; overflow: auto; tab-size: 2; }
.companion-code pre code { display: block; padding: 0; border-radius: 0; background: transparent; color: #3c586c; white-space: pre; }
.companion-composer-wrap { padding: 0 20px 14px; }
.companion-notice { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; padding: 10px 12px; background: #dce6ed77; color: #748a99; border-radius: 10px; font-size: 11px; line-height: 1.65; }
.companion-notice button { flex-shrink: 0; border: 0; background: transparent; color: #4a7189; font-size: 11px; white-space: nowrap; }
.companion-composer { display: flex; flex-direction: column; padding: 14px 14px 11px; gap: 10px; border: 1px solid #d9e2e947; border-radius: 15px; background: #ffffff05; }
.companion-composer:focus-within { border-color: #b3c8d399; }
.companion-composer textarea { display: block; width: 100%; max-height: 140px; min-height: 42px; padding: 0; resize: none; border: 0; background: transparent; outline: none; color: #5f788a; font-size: 12px; line-height: 1.8; }
.companion-composer textarea::placeholder { color: #a9b5be; }
.companion-composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.companion-input-hint { color: #a5b2bd; font-size: 10px; }
.companion-send { min-width: 56px; min-height: 28px; padding: 5px 9px; border: 0; border-radius: 9px; background: #7897a9; color: #fff; font-size: 10px !important; }
.companion-send:hover { background: #62869e; }
.companion-send:disabled { background: #e2e8ee44; color: #b6c3cd; }
.companion-load-error { display: grid; place-items: center; font-size: 14px; }
@media (max-width: 1100px) {
  .companion-page { inset: 18dvh auto auto 7vw; width: 86vw; height: 67dvh; grid-template-columns: 64% minmax(0, 1fr); }
  .companion-scene { width: 55vw; left: auto; right: calc(-7vw + 16px); }
  .companion-transcript { padding: 22px; }
  .companion-suggestions { width: 80%; }
  .companion-welcome h2 { font-size: 24px; }
  .companion-composer-wrap { padding: 0 15px 12px; }
}
@media (max-width: 700px) {
  .companion-page { inset: 84px 14px 14px; width: auto; height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: 135px minmax(0, 1fr); gap: 8px; }
  .companion-sidebar { grid-column: 1; grid-row: 1; }
  .companion-chat { grid-column: 1; grid-row: 2; border-radius: 23px; }
  .companion-scene { inset: auto 0 -17px auto; width: 100%; height: 165px; }
  .companion-settings { top: 10px; right: 13px; }
  .companion-transcript { margin-top: 17px; padding: 18px; }
  .companion-welcome { padding: 8px 0; gap: 19px; }
  .companion-welcome h2 { font-size: 23px; }
  .companion-welcome p { font-size: 10px; }
  .companion-suggestions { width: 90%; gap: 12px; margin-top: 2px; }
  .companion-suggestions button { font-size: 11px; padding: 7px 4px; }
  .companion-suggestions span { font-size: 9px; }
  .companion-composer-wrap { padding: 0 12px 12px; }
  .companion-composer { padding: 11px; gap: 7px; }
  .companion-composer textarea { min-height: 34px; font-size: 16px; }
  .companion-message { font-size: 12px; margin-bottom: 20px; }
  .companion-input-hint { font-size: 8px; }
}
@media (max-height: 620px) and (min-width: 701px) {
  .companion-page { top: 88px; height: calc(100dvh - 115px); }
  .companion-transcript { padding: 15px 20px; }
  .companion-welcome { gap: 14px; padding: 0; }
  .companion-suggestions { gap: 6px 14px; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .companion-page * { scroll-behavior: auto !important; transition: none !important; }
}

