/* Standalone chat surface. Keep the existing result-card styles from preview.css. */
html:has(#stylistChatPage.active),
html:has(#stylistChatHistoryPage.active) {
  height: 100%; overflow: hidden;
  -webkit-text-size-adjust: none !important; text-size-adjust: none !important;
}
body:has(#stylistChatPage.active),
body:has(#stylistChatHistoryPage.active) {
  position: fixed; inset: 0; height: 100%; min-height: 0; overflow: hidden; background: #fff;
  -webkit-text-size-adjust: none !important; text-size-adjust: none !important;
}
body:has(#stylistChatPage.active) .shell,
body:has(#stylistChatHistoryPage.active) .shell {
  position: fixed; top: var(--chat-viewport-top, 0px); left: 0; margin: 0; width: 100%; max-width: none; height: var(--chat-viewport-height, 100dvh); min-height: 0;
  padding: 0; overflow: hidden; background: #fff;
}
body:has(#stylistChatPage.active) .hero,
body:has(#stylistChatHistoryPage.active) .hero,
body:has(#stylistChatPage.active) .tabs,
body:has(#stylistChatHistoryPage.active) .tabs { display: none !important; }
body:has(#stylistChatPage.active) #homeQuickMenu,
body:has(#stylistChatHistoryPage.active) #homeQuickMenu { display: none !important; }
#stylistChatPage.panel.active {
  display: flex; position: relative; flex-direction: column; margin: 0; width: 100%; height: 100%; min-height: 0;
  background: #fff; color: #111; overflow: hidden;
  -webkit-text-size-adjust: none !important; text-size-adjust: none !important;
}
#stylistChatHistoryPage.panel.active {
  display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 22px max(18px, calc((100vw - 760px) / 2));
  width: 100%; height: 100%; min-height: 0; overflow: hidden; scrollbar-width: none; background: #fff;
}
#stylistChatHistoryPage.panel.active::-webkit-scrollbar { display: none; }
.chat-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chat-inline-feature:not(:empty) { margin-top: 18px; }
.chat-inline-feature-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.chat-inline-feature-head strong { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 15px; }
.chat-agent-icon { display: none; flex: none; width: 20px; height: 20px; }
.chat-agent-icon.has-icon { display: inline-grid; place-items: center; }
.chat-agent-icon img { width: 20px; height: 20px; object-fit: contain; }
.chat-inline-feature-head button { flex: none; border: 0; border-radius: 16px; padding: 7px 12px; background: #fff; color: #555; font-size: 12px; cursor: pointer; }
#stylistChatPage .chat-inline-feature > .panel.active { display: block; position: relative; width: 100%; max-width: none; height: auto; min-height: 0; margin: 0; overflow: visible; }
#stylistChatPage .chat-inline-feature #saveProfile,
#stylistChatPage .chat-inline-feature .profile-choice-save { position: static; display: block; width: 100%; max-width: 100%; margin: 16px 0 0; }
#stylistChatPage .chat-inline-feature #profileEdit { padding-bottom: 0; }
#stylistChatPage .chat-inline-feature button { max-width: 100%; }
.chat-assistant:has(.chat-inline-feature > .panel.active) > .chat-after-reply { display: none !important; }
.chat-inline-feature > .chat-wardrobe-field { margin-bottom: 12px; }
.chat-icon { display: grid; place-items: center; width: 38px; height: 38px; padding: 7px; border: 0; background: transparent; color: #111; cursor: pointer; }
.chat-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-icon [data-action-icon] { display: none; place-items: center; width: 27px; height: 27px; }
.chat-icon [data-action-icon].has-icon { display: grid; }
.chat-icon [data-action-icon].has-icon + svg { display: none; }
.chat-icon [data-action-icon] img { display: block; width: 27px; height: 27px; object-fit: contain; }
.chat-messages {
  flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain;
  padding: 24px max(18px, calc((100vw - 760px) / 2)) 28px;
  scrollbar-width: none; scroll-behavior: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  overflow-anchor: none;
}
.chat-messages::-webkit-scrollbar { display: none; }
.chat-empty { display: grid; align-content: center; min-height: 100%; text-align: center; color: #111; }
.chat-empty p { box-sizing: border-box; width: calc(100% - 12px); max-width: 640px; margin: 0 auto; padding: 0; color: #888; font-size: 13.5px; line-height: 1.7; overflow-wrap: anywhere; }
.chat-user {
  width: fit-content; max-width: min(82%, 620px); margin: 0 0 18px auto;
  padding: 14px 17px; border-radius: 18px 18px 4px 18px; background: #f0f0f2;
  color: #161616; font-size: 15px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere;
}
.chat-user-photos { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 8px; }
.chat-user-photos img { width: 88px; height: 88px; flex: none; object-fit: cover; border-radius: 10px; }
.chat-assistant { max-width: 760px; margin: 0 auto 26px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.chat-reply {
  width: fit-content; max-width: min(82%, 620px); margin: 0; padding: 14px 17px;
  border-radius: 18px 18px 18px 4px; background: #f0f0f2;
  color: #161616; font-size: 15px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere;
}
.chat-completion-summary { margin-top: 16px; }
.chat-after-reply:not([hidden]), .chat-inline-feature:not(:empty) {
  margin-top: 16px; padding: 18px; border: 0;
  border-radius: var(--ui-surface-radius, 20px); background: #fff;
  box-shadow: 0 8px 24px rgba(17,17,17,.08);
}
.chat-reasoning { margin: 0 0 16px; padding: 12px 14px; border: 0; border-radius: 13px; background: #f7f7f8; color: #85858a; }
.chat-reasoning-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; font: inherit; font-size: 12px; font-weight: 600; }
.chat-reasoning-heading { display: inline-flex; align-items: center; gap: 6px; }
.chat-reasoning-heading [data-action-icon] { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; }
.chat-reasoning-heading img { display: block; width: 15px; height: 15px; object-fit: contain; opacity: .5; }
.chat-reasoning-chevron { font-size: 16px; line-height: 1; transition: transform .2s ease; }
.chat-reasoning.expanded .chat-reasoning-chevron { transform: rotate(180deg); }
.chat-reasoning-body { max-height: calc(3 * 1.7em + 11px); margin-top: 10px; padding-top: 10px; border-top: 0; color: #88888d; font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; overflow: hidden; }
.chat-reasoning.expanded .chat-reasoning-body { max-height: none; overflow: visible; }
.chat-reasoning.is-running .chat-reasoning-body::after { content: '▍'; animation: chat-reasoning-cursor .8s steps(1) infinite; }
@keyframes chat-reasoning-cursor { 50% { opacity: 0; } }
.chat-inline-feature.chat-feature-submitted .today-control-card { display: none; }
.chat-inline-feature.chat-photo-recognized .editor-upload-actions { display: none; }
.chat-recognition-notice { margin: 8px 0 14px; color: #777; font-size: 13px; line-height: 1.5; }
.chat-wait, .chat-error {
  width: fit-content; max-width: min(82%, 620px); min-height: 46px; margin: 0;
  padding: 14px 17px; border-radius: 18px 18px 18px 4px;
  background: #f0f0f2; color: #161616; font-size: 15px; line-height: 1.7;
}
.chat-wait { display: flex; align-items: center; }
.chat-wait p { margin: 0; font-size: inherit; }
.chat-error { color: #161616; }
.chat-replacement-comparison { margin-top: 14px; width: 100%; }
.chat-replacement-item { margin-top: 12px; padding-top: 10px; border-top: 1px solid #dddde0; }
.chat-replacement-item p { margin: 7px 0; }
.chat-replacement-item dl { margin: 0; }
.chat-replacement-item dl > div { display: flex; gap: 12px; margin: 5px 0; }
.chat-replacement-item dt { flex: 0 0 2.5em; color: #777; }
.chat-replacement-item dd { margin: 0; overflow-wrap: anywhere; }
.chat-replacement-comparison > small { display: block; margin-top: 12px; color: #777; }
.chat-result > button,
.chat-result-actions button { min-height: 46px; padding: 10px 18px; border: 0; border-radius: var(--ui-button-radius, 20px); background: #111; color: #fff; font-weight: 600; box-shadow: var(--ui-control-shadow, 0 5px 13px rgba(17,17,17,.09)); cursor: pointer; }
.chat-result > button:only-of-type { display: block; width: 100%; }
.chat-params.new-outfit-profile-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin: 16px 0; }
.chat-params.new-outfit-profile-grid label { display: block; min-width: 0; height: 84px; min-height: 84px; padding: 10px 12px 8px; border: 0; border-radius: var(--ui-surface-radius,20px); background: #fff; color: #777; font-size: 12px; box-shadow: var(--ui-control-shadow,0 5px 13px rgba(17,17,17,.09)); }
.chat-params.new-outfit-profile-grid input:not([type="hidden"]),
.chat-params.new-outfit-profile-grid .outfit-profile-picker { display: flex; align-items: center; width: 100%; min-width: 0; height: 38px; min-height: 38px; margin-top: 8px; padding: 8px 10px; border: 0; border-radius: var(--ui-input-radius,12px); background: #f3f3f3; color: #111; font-size: 13px; box-shadow: none; }
.chat-params.new-outfit-profile-grid input:not([type="hidden"]) { display: block; }
.chat-params.new-outfit-profile-grid input[type="hidden"] { display: none !important; }
.chat-params.new-outfit-profile-grid .gender-mode-buttons { width: 100%; margin-top: 8px; }
.chat-params.new-outfit-profile-grid .gender-mode-buttons button { min-height: 38px; padding: 0; }
.chat-params.new-outfit-profile-grid .outfit-profile-picker { justify-content: space-between; text-align: left; cursor: pointer; }
.chat-wardrobe-field { grid-column: 1 / -1; }
.chat-wardrobe-field > button { width: 100%; min-height: 42px; border: 0; border-radius: var(--ui-button-radius,20px); background: #111; color: #fff; font-weight: 600; }
.chat-wardrobe-options[hidden] { display: none; }
.chat-wardrobe-options { max-height: 340px; overflow: auto; margin-top: 10px; padding: 10px; border-radius: 18px; background: #f7f7f7; }
.chat-wardrobe-options p { margin: 0 0 10px; color: #777; font-size: 12px; line-height: 1.5; }
.chat-wardrobe-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.chat-wardrobe-grid .cloth-card-compact { display: flex; flex-direction: column; align-items: center; width: 100%; min-width: 0; padding: 7px; border: 2px solid transparent; border-radius: 14px; background: #fff; }
.chat-wardrobe-grid .cloth-card-compact.selected { border-color: #111; }
.chat-wardrobe-grid .cloth-card-compact .thumb { width: 100%; height: 95px; object-fit: cover; border-radius: 9px; background: #eee; }
.chat-wardrobe-grid .cloth-card-compact b { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; text-align: center; }
.chat-result { margin-top: 16px; }
.chat-result-title { font-size: 19px; }
.chat-result-actions { display: flex; gap: 8px; margin-top: 14px; }
.chat-result-actions button { flex: 1; background: #efeff1; color: #111; }
.chat-result > img { display: block; width: min(100%,360px); max-height: 450px; margin: 0 auto 12px; object-fit: contain; border-radius: 12px; }
.chat-generated-image { position: relative; width: fit-content; max-width: 100%; margin: 0 auto 14px; overflow: hidden; border-radius: 12px; }
.chat-generated-image .ai-watermark-frame { width: fit-content; max-width: 100%; margin: 0 auto; }
.chat-generated-image .ai-watermark-frame > img { display: block; width: auto; max-width: 100%; max-height: 560px; object-fit: contain; }
.chat-job-meta { margin: 14px 0 8px; color: #aaa; font-size: 11px; }
.chat-shortcuts {
  display: flex; flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; gap: 7px; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-x;
  padding: 0; background: #fff;
}
.chat-shortcuts::-webkit-scrollbar { display: none; }
.chat-shortcuts button {
  flex: 0 0 auto; min-width: 69px; min-height: 30px; padding: 5px 10px;
  border: 0; border-radius: 18px; background: #fff;
  color: #555; font-size: 11px; white-space: nowrap; cursor: pointer;
}
.chat-shortcuts button[aria-pressed="true"] { border-color: #111; color: #111; }
.chat-photo-preview[hidden], .chat-thinking-bar [hidden] { display: none !important; }
.chat-photo-preview { display: flex; flex: none; gap: 8px; overflow-x: auto; padding: 8px max(16px, calc((100vw - 760px) / 2)); background: #fff; }
.chat-photo-preview span { position: relative; flex: 0 0 64px; height: 64px; }
.chat-photo-preview img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.chat-photo-preview button { position: absolute; top: -5px; right: -5px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: #111; color: #fff; line-height: 1; cursor: pointer; }
.chat-compose-wrap { position: relative; flex: none; background: #fff; }
.chat-tools-menu[hidden] { display: none !important; }
.chat-tools-menu {
  position: absolute; z-index: 30; bottom: calc(100% - 2px); left: max(14px, calc((100vw - 760px) / 2));
  display: flex; flex-direction: column; width: max-content; min-width: 146px; max-width: calc(100vw - 28px); padding: 5px;
  border: 0; border-radius: 18px; background: #fff;
  box-shadow: 0 14px 36px rgba(0,0,0,.16);
}
.chat-tools-menu button { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 42px; padding: 7px 10px; border: 0; border-radius: 11px; background: transparent; color: #111; font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
.chat-tools-menu button:hover, .chat-tools-menu button:focus-visible { background: #f3f3f4; }
.chat-tools-menu button > svg, .chat-tools-menu .chat-menu-icon { flex: none; width: 20px; height: 20px; }
.chat-tools-menu button > svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-tools-menu .chat-menu-icon { display: none; place-items: center; }
.chat-tools-menu .chat-menu-icon.has-icon { display: grid; }
.chat-tools-menu .chat-menu-icon.has-icon + svg { display: none; }
.chat-tools-menu .chat-menu-icon img { display: block; width: 20px; height: 20px; object-fit: contain; }
.chat-thinking-bar { display: flex; align-items: center; justify-content: flex-start; gap: 8px; flex: none; min-width: 0; padding: 6px max(16px, calc((100vw - 760px) / 2)); background: #fff; }
.chat-thinking-bar > #chatThinkingToggle { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 5px 11px; border: 0; border-radius: 16px; background: #fff; color: #777; font-size: 11px; cursor: pointer; }
.chat-thinking-bar > #chatThinkingToggle[aria-pressed="true"] { border-color: #111; background: #111; color: #fff; }
.chat-thinking-icon { display: grid; place-items: center; width: 16px; height: 16px; flex: none; }
.chat-thinking-icon img { width: 15px; height: 15px; object-fit: contain; }
.chat-thinking-bar button[aria-pressed="true"] .chat-thinking-icon img { filter: invert(1); }
.chat-composer {
  display: flex; align-items: center; flex: none; gap: 8px; padding: 8px max(14px, calc((100vw - 760px) / 2));
  border-top: 0; background: #fff;
}
.chat-composer textarea {
  flex: 1; min-width: 0; height: 46px; max-height: 110px; resize: none; padding: 13px 14px;
  border: 0; border-radius: 12px; outline: 0; background: #f1f1f2; color: #111;
  font: inherit; font-size: 16px; line-height: 1.5;
}
#chatComposer #chatInput { margin: 0; align-self: center; }
.chat-composer textarea::placeholder { color: #aaa; }
.chat-plus { display: grid; place-items: center; flex: 0 0 46px; width: 46px; height: 46px; padding: 10px; border: 0; border-radius: 12px; background: #f1f1f2; cursor: pointer; }
.chat-plus [data-action-icon] { display: none; place-items: center; width: 24px; height: 24px; }
.chat-plus [data-action-icon].has-icon { display: grid; }
.chat-plus [data-action-icon].has-icon + svg { display: none; }
.chat-plus [data-action-icon] img, .chat-plus svg { display: block; width: 24px; height: 24px; object-fit: contain; }
.chat-plus svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.chat-plus[aria-expanded="true"] { background: #111; color: #fff; }
#chatSend { flex: 0 0 66px; height: 46px; padding: 0 10px; border: 0; border-radius: 13px; background: #111; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
#chatSend:disabled, .chat-plus:disabled { opacity: .45; cursor: default; }
#chatStatus { flex: none; margin: 0; padding: 0 max(18px, calc((100vw - 760px) / 2)); color: #bd3030; font-size: 11px; line-height: 1.4; }
#chatStatus:empty { display: none; }
.chat-footer-note { flex: none; margin: 0; padding: 3px 0 max(8px, env(safe-area-inset-bottom)); text-align: center; color: #aaa; font-size: 11px; }
#stylistChatHistoryPage .chat-toolbar h1 { margin: 2px 0; font-size: 24px; }
#stylistChatHistoryPage .chat-toolbar small { color: #aaa; font-size: 11px; letter-spacing: .2em; }
#stylistChatHistoryPage .chat-toolbar button,
#stylistChatHistoryPage > button { padding: 10px 16px; border: 0; border-radius: 20px; background: #111; color: #fff; cursor: pointer; }
.chat-meta { color: #888; font-size: 12px; }
.chat-notice { margin: 12px 0; }
.chat-notice .chat-reply > p { margin: 8px 0 0; white-space: pre-wrap; }
.chat-notice-actions { display: flex; gap: 10px; margin-top: 14px; }
.chat-notice-actions > button { position: static; flex: 1; min-width: 0; }
#stylistChatPage .chat-notice-actions > button { box-shadow: 0 2px 5px rgba(17,17,17,.08) !important; }
#stylistChatPage .chat-inline-feature #shoppingCartPage { margin: 0; padding: 0; background: #fff; box-shadow: none; }
#stylistChatPage .chat-inline-feature #shoppingCartContent { margin: 0; background: transparent; }
#stylistChatPage .chat-inline-feature .shopping-cart-empty { padding: 14px 12px 4px; background: transparent; box-shadow: none; }
#stylistChatPage .chat-inline-feature .shopping-cart-note { margin-inline: 8px; }
#stylistChatPage .chat-cart-empty-message { margin: 8px 0 0; color: #777; font-size: 13px; line-height: 1.6; }
#stylistChatPage .chat-cart-analysis:not([hidden]) { margin: 0 0 14px; padding: 14px 16px; border-radius: 18px; background: #fff; color: #161616; font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; }
#chatHistoryList { display: grid; align-content: start; gap: 10px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; }
#chatHistoryList::-webkit-scrollbar { display: none; }
.chat-history-actions { display: flex; align-items: center; gap: 12px; flex: none; padding-bottom: env(safe-area-inset-bottom); }
.chat-history-actions > button { position: static; flex: 1; min-width: 0; height: 46px; margin: 0; padding: 0 16px; background: #111; color: #fff; border: 0; border-radius: 20px; font-size: 15px; font-weight: 700; }
.chat-history-row { display: flex; gap: 8px; padding: 10px; border: 0; border-radius: 18px; background: #fff; }
.chat-history-row button { border: 0; background: transparent; color: #111; cursor: pointer; }
.chat-history-row button:first-child { display: grid; gap: 4px; flex: 1; text-align: left; }
.chat-history-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.chat-history-row small { color: #aaa; font-size: 11px; }
.chat-history-row button:last-child { flex: none; align-self: center; padding: 8px 15px; border-radius: 16px; background: #111; color: #fff; font-size: 13px; }
@media (max-width: 430px) { .chat-messages { padding-top: 16px; } .chat-after-reply:not([hidden]), .chat-inline-feature:not(:empty) { padding: 14px; } }

.chat-welcome-logo { display: none; width: 88px; height: 88px; margin: 0 auto 28px; }
.chat-welcome-logo.has-icon { display: block; }
.chat-welcome-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.chat-execution-state { margin: 0 0 12px; color: #85858a; font-size: 12px; }

.chat-agent-loading { display: grid; justify-items: center; padding: 18px; color: #888; font-size: 12px; }
.chat-agent-loading img { width: 100px; height: 58px; object-fit: contain; }

.chat-execution-state, [data-chat-execution] { display: flex; align-items: center; gap: 6px; }
.chat-waiting-icon { display: none; flex: none; width: 16px; height: 16px; }
.chat-waiting-icon.has-icon { display: inline-flex; }
.chat-waiting-icon img { width: 100%; height: 100%; object-fit: contain; }

.chat-chain-progress{border:0;border-radius:16px;padding:14px 16px;margin:12px 0;font-size:13px;line-height:1.5;color:#555}
.chat-chain-progress ol{list-style:none;padding:0;margin:0;display:grid;gap:10px}
.chat-chain-step{display:flex;align-items:center;gap:8px;min-width:0}
.chat-chain-step>span:nth-child(2){flex:1;min-width:0}
.chat-chain-step small{font-size:11px;white-space:nowrap;color:#8b8b91}
.chat-chain-step.is-done>span:first-child{color:#111}
.chat-chain-step.is-running>span:first-child{animation:chat-step-pulse 1s ease-in-out infinite}
.chat-chain-step.is-failed{color:#d92727}
.chat-chain-progress p{font-size:12px;margin:12px 0 0}
.chat-chain-progress button{margin-top:12px;max-width:100%}
@keyframes chat-step-pulse{50%{opacity:.3;transform:scale(.85)}}

.chat-inline-feature #fitting.chat-result-mode > :not(#fittingResult),
.chat-inline-feature #hairstyle.chat-result-mode > :not(#hairstyleResult){display:none!important}

.chat-source-result-open > .chat-after-reply{display:none}

/* Chat cards retain elevation; compact controls use outline styling below. */
#stylistChatPage .chat-reasoning,
#stylistChatPage .chat-chain-progress,
#stylistChatHistoryPage .chat-history-row { box-shadow: var(--ui-control-shadow, 0 5px 13px rgba(17,17,17,.09)); }
#stylistChatPage .chat-shortcuts { align-items: center; padding: 5px 0; }
#stylistChatPage .chat-thinking-bar { padding-top: 3px; padding-bottom: 3px; }
#stylistChatPage .chat-inline-feature button:not(.active):not([aria-pressed="true"]):not(.selected):not([data-chat-feature-open]):not([data-chat-feature-close]) { border-color: transparent !important; }
#stylistChatPage .chat-inline-feature hr { border-color: transparent; background: transparent; }
#chatToolsToggle { color: #111; -webkit-appearance: none; appearance: none; }
#chatToolsToggle [data-action-icon] img { filter: grayscale(1) brightness(0); }
#chatToolsToggle[aria-expanded="true"] { color: #fff; }
#chatToolsToggle[aria-expanded="true"] [data-action-icon] img { filter: grayscale(1) brightness(0) invert(1); }

/* Explanations live in the chat reply; Agent panels retain concrete results and controls. */
#stylistChatPage .combined-analysis,
#stylistChatPage .analysis-card-list,
#stylistChatPage .new-outfit-advice-list,
#stylistChatPage .wardrobe-suggestion-summary,
#stylistChatPage .wardrobe-shop-advice-card,
#stylistChatPage .outfit-diagnosis-analysis,
#stylistChatPage .hairstyle-analysis { display: none !important; }
#stylistChatPage .chat-reply { white-space: pre-wrap; line-height: 1.8; }
#stylistChatPage .chat-result, #stylistChatPage .chat-inline-feature { border: 0 !important; }
#stylistChatPage .chat-inline-feature .panel { border: 0 !important; }
#stylistChatPage .chat-inline-feature .wardrobe-recommend-new-field { display: none !important; }
#stylistChatPage .chat-assistant :is(button, article, section, hr) { border: 0 !important; }
#stylistChatPage .chat-assistant .new-outfit-more-toggle::before,
#stylistChatPage .chat-assistant .new-outfit-more-toggle::after { display: none; }
#stylistChatPage .chat-assistant button.secondary,
#stylistChatPage .chat-assistant button.recommend-more { box-shadow: var(--ui-control-shadow, 0 5px 13px rgba(17,17,17,.09)); }

/* Restore gray outlines on expand/collapse and the bottom shortcut controls. */
#stylistChatPage .chat-assistant .chat-inline-feature .chat-inline-feature-head button,
#stylistChatPage .chat-shortcuts button {
  box-sizing: border-box; height: 30px;
  border: 1px solid #e5e5e7 !important;
  box-shadow: none !important;
}
#stylistChatPage .chat-shortcuts button[aria-pressed="true"] { border-color: #111 !important; }
#stylistChatPage .chat-thinking-bar > #chatThinkingToggle {
  box-sizing: border-box; height: 30px;
  border: 1px solid #e5e5e7;
  box-shadow: none !important;
}
#stylistChatPage .chat-thinking-bar > #chatThinkingToggle[aria-pressed="true"] { border-color: #111; }

#stylistChatPage .chat-inline-feature .ai-style-report-grid > article {display:none!important}

/* iOS must not auto-zoom the focused composer under shared form styles. */
#stylistChatPage #chatComposer #chatInput {font-size:16px!important;line-height:1.5;padding:11px 14px;max-height:110px}

#stylistChatPage .product-card p,
#stylistChatPage .wardrobe-taobao-advice,
#stylistChatPage .chat-inline-feature .ai-text-result-frame > h3 {display:none!important}

/* Keep conversation copy in bubbles and show a dynamic logo during generation. */
#stylistChatPage .chat-user,
#stylistChatPage .chat-reply,
#stylistChatPage .chat-error,
#stylistChatPage .chat-wait { font-size: 13.5px !important; }
#stylistChatPage .chat-notice .chat-reply > strong,
#stylistChatPage .chat-notice .chat-reply > p { font-size: inherit; }
#stylistChatPage .chat-reasoning-toggle,
#stylistChatPage .chat-reasoning-body { font-size: 10.8px; }
#stylistChatPage .chat-job-meta,
#stylistChatPage .chat-result-title,
#stylistChatPage .chat-result .virtual-products-title > small,
#stylistChatPage .chat-result .virtual-product-cards-host,
#stylistChatPage .chat-result .ai-disclaimer { display: none !important; }
#stylistChatPage .new-outfit-result .today-outfit-inner-card { display: none !important; }
#stylistChatPage .chat-result .today-extra-actions.outfit-extra > button:only-child { grid-column: 1 / -1; width: 100%; }
#stylistChatPage .chat-result .outfit-action-box,
#stylistChatPage .chat-result .new-outfit-fitting-action-host { box-sizing: border-box; min-width: 0; margin-top: 12px; padding-inline: 12px; }
#stylistChatPage .chat-result .outfit-action-box { padding-inline: 12px !important; }
#stylistChatPage .chat-result .wardrobe-base-actions { min-width: 0; margin-top: 16px; }
#stylistChatPage .chat-result .wardrobe-base-actions > .outfit-fitting-open { box-sizing: border-box; width: calc(100% - 24px); margin-inline: 12px; }
#stylistChatPage .chat-result .today-extra-actions.outfit-extra,
#stylistChatPage .chat-result .chat-result-actions { min-width: 0; gap: 10px; }
#stylistChatPage .chat-result .today-extra-actions.outfit-extra > button,
#stylistChatPage .chat-result .chat-result-actions > button,
#stylistChatPage .chat-result .new-outfit-fitting-open { box-sizing: border-box; min-width: 0; max-width: 100%; min-height: 44px; height: auto; padding: 9px 12px; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
#stylistChatPage .chat-result .taobao-affiliate-block > .virtual-products-title { min-width: 0; }
#stylistChatPage .chat-result .taobao-affiliate-block > .virtual-products-title strong { min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
#stylistChatPage .chat-result .taobao-product-offer { flex-wrap: wrap; }
#stylistChatPage .chat-result .taobao-product-button { max-width: 100%; box-sizing: border-box; text-align: center; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 360px) {
  #stylistChatPage .chat-result .today-extra-actions.outfit-extra { grid-template-columns: minmax(0,1fr); }
}
.chat-generation-wait { display: inline-flex; align-items: center; justify-content: center; min-height: 58px; }
.chat-generation-wait img { display: block; width: 100px; height: 58px; object-fit: contain; }
@media (prefers-reduced-motion: no-preference) {
  .chat-generation-wait img { animation: chat-logo-bounce 1.1s ease-in-out infinite; }
}
@keyframes chat-logo-bounce { 50% { transform: translateY(-5px); } }

#stylistChatPage .chat-inline-feature .chat-version-compare { margin:12px 0; padding:14px; border-radius:18px; background:#f7f7f7; }
.chat-version-compare .chat-result-actions { display:none; }
#stylistChatPage .chat-inline-feature .recommend-action-block { padding-inline:12px; }

.chat-memory-row {padding:12px;margin:10px 0;border-radius:16px;background:#f5f5f5;color:#111;overflow-wrap:anywhere}
.chat-memory-row button {min-height:40px;padding:8px 14px;border:0;border-radius:18px;background:#111;color:#fff;box-shadow:none}

.chat-verification {margin:12px 0;color:#777;font-size:12px;line-height:1.6;}

