.bwe-support-shell {
  --bwe-support-ink: #111312;
  --bwe-support-paper: #efefeb;
  --bwe-support-line: #5b5e5b;
  --bwe-support-signal: #ed2533;
  /* V-08:暗面上的信号红文字用提亮阶(#111312 上 7.17:1);描边/渐变仍用 --bwe-support-signal */
  --bwe-support-signal-text: #ff7578;
}

.bwe-support-launch {
  position: fixed;
  z-index: 1029;
  /* D3(2026-09-03 K3):第三方 FAB 占据右下 20~64px,launcher 抬到其上方,垂直成栈 */
  inset: auto 20px 72px auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 236px;
  min-height: 52px;
  padding: 8px 10px;
  /* V-07(2026-09-02 K3):开启器是 <a>,平台方案链接色会压过这里——暗面上「NEED HELP?」
     草稿实测 1.58:1;用 !important 钉死 paper 色 */
  color: var(--bwe-support-paper) !important;
  background: var(--bwe-support-ink);
  border: 1px solid var(--bwe-support-line);
  border-inline-start: 5px solid var(--bwe-support-signal);
  border-radius: 0;
  box-shadow: 5px 5px 0 rgb(0 0 0 / 25%);
  font: 700 13px/1.15 "Courier New", Courier, monospace;
  letter-spacing: 0.04em;
  text-align: left;
  cursor: pointer;
}

.bwe-support-launch__signal {
  width: 10px;
  height: 10px;
  background: var(--bwe-support-paper);
  border: 1px solid currentColor;
  border-radius: 50%;
  animation: bwe-support-pulse 2.4s ease-out infinite;
}

/* 可见性(2026-08-31 店主反馈"找不到入口"):信号点呼吸,吸引视线但不喧哗 */
@keyframes bwe-support-pulse {
  0% { box-shadow: 0 0 0 0 rgb(237 37 51 / 55%); }
  70% { box-shadow: 0 0 0 9px rgb(237 37 51 / 0%); }
  100% { box-shadow: 0 0 0 0 rgb(237 37 51 / 0%); }
}

/* ── 首访提示气泡:锚在入口上方,纸面质感,点正文即开窗 ── */
.bwe-support-nudge {
  position: fixed;
  z-index: 1030;
  /* D3:launcher 抬到 72px 后,nudge 抬到 72+52+8=132,不与 FAB/launcher 相碰 */
  inset: auto 20px calc(var(--bwe-tabbar-total, 88px) + 52px) auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: start;
  width: min(300px, calc(100vw - 40px));
  padding: 10px 12px;
  color: var(--bwe-support-ink);
  background: var(--bwe-support-paper);
  border: 2px solid var(--bwe-support-ink);
  border-inline-start: 5px solid var(--bwe-support-signal);
  box-shadow: 5px 5px 0 rgb(0 0 0 / 25%);
  font: 700 12px/1.45 "Courier New", Courier, monospace;
}

.bwe-support-nudge[hidden] {
  display: none;
}

/* 产品页不出气泡:右下角是变体选择/购买路径,10 秒遮挡得不偿失(入口按钮仍在) */
body[data-page-type="product"] .bwe-support-nudge,
body[data-page-type="cart"] .bwe-support-nudge {
  display: none !important;
}

.bwe-support-nudge__body {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.bwe-support-nudge__body:hover {
  color: #a30e20;
}

.bwe-support-nudge__close {
  min-width: 24px;
  min-height: 24px;
  /* D7(2026-09-03 K3):命中区 44×44(负 margin 保持布局不挤邻居) */
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: -10px;
  color: inherit;
  background: transparent;
  border: 0;
  font: 700 16px/1 "Courier New", Courier, monospace;
  cursor: pointer;
}

.bwe-support-launch__copy {
  display: grid;
  gap: 3px;
}

.bwe-support-launch__copy strong,
.bwe-support-launch__copy small {
  font: inherit;
}

.bwe-support-launch__copy small {
  color: #c8cac5;
  font-size: 13px;
}

.bwe-support-launch__action {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--bwe-support-ink);
  background: var(--bwe-support-paper);
}

.bwe-support-launch:hover,
.bwe-support-launch:focus-visible,
.bwe-product-trust a:hover,
.bwe-product-trust a:focus-visible,
.bwe-support-dialog :is(a, button):focus-visible {
  outline: 3px solid var(--bwe-support-signal);
  outline-offset: 3px;
}

.bwe-support-dialog:not([hidden]) {
  position: fixed;
  z-index: 100100;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: end;
  padding: 20px;
}

.bwe-support-dialog__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  background: rgb(9 10 10 / 72%);
  border: 0;
  cursor: pointer;
}

.bwe-support-dialog__panel {
  position: relative;
  width: min(100%, 480px);
  max-height: min(720px, calc(100dvh - 40px));
  overflow: auto;
  color: var(--bwe-support-ink);
  background: var(--bwe-support-paper);
  border: 2px solid var(--bwe-support-ink);
  box-shadow: 8px 8px 0 rgb(0 0 0 / 35%);
}

.bwe-support-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  color: var(--bwe-support-paper);
  background: var(--bwe-support-ink);
  border-block-end: 5px solid var(--bwe-support-signal);
}

.bwe-support-dialog__header span {
  font: 700 11px/1.2 "Courier New", Courier, monospace;
  letter-spacing: 0.09em;
}

.bwe-support-dialog__header h2 {
  margin: 5px 0 0;
  color: inherit;
  font: 700 clamp(24px, 5vw, 34px)/1.05 "Arial Black", Arial, sans-serif;
  text-transform: uppercase;
}

.bwe-support-dialog__close,
.bwe-support-dialog__dismiss {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid currentColor;
  border-radius: 0;
  font: 700 14px/1 "Courier New", Courier, monospace;
  cursor: pointer;
}

.bwe-support-dialog__close {
  color: var(--bwe-support-paper);
  background: transparent;
  font-size: 26px;
}

.bwe-support-dialog__status {
  padding: 18px;
  border-block-end: 1px solid var(--bwe-support-line);
}

.bwe-support-dialog__status strong {
  font: 700 13px/1.2 "Courier New", Courier, monospace;
  letter-spacing: 0.07em;
}

.bwe-support-dialog__status p,
.bwe-support-dialog__empty {
  margin: 8px 0 0;
  font: 400 15px/1.5 Arial, sans-serif;
}

.bwe-support-dialog__routes {
  display: grid;
}

.bwe-support-dialog__routes a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px 10px;
  min-height: 64px;
  padding: 12px 18px;
  color: var(--bwe-support-ink);
  border-block-end: 1px solid var(--bwe-support-line);
  text-decoration: none;
}

.bwe-support-dialog__routes a > span {
  grid-row: 1 / span 2;
  color: #a30e20;
  font: 700 13px/1.2 "Courier New", Courier, monospace;
}

.bwe-support-dialog__routes strong {
  font: 700 14px/1.2 "Courier New", Courier, monospace;
  letter-spacing: 0.035em;
}

.bwe-support-dialog__routes small {
  font: 400 13px/1.3 Arial, sans-serif;
}

.bwe-support-dialog__empty {
  padding: 18px;
}

.bwe-support-dialog__dismiss {
  width: calc(100% - 36px);
  margin: 18px;
  color: var(--bwe-support-paper);
  background: var(--bwe-support-ink);
}

html.bwe-support-open {
  overflow: hidden;
}

.bwe-product-trust {
  display: grid;
  gap: 10px;
  padding: 14px;
  margin-block-start: 12px;
  color: var(--bwe-support-ink);
  background: rgb(255 255 255 / 38%);
  border: 1px solid var(--bwe-support-line);
  border-inline-start: 5px solid var(--bwe-support-signal);
}

.bwe-product-trust__heading {
  margin: 0;
  font: 700 12px/1.2 "Courier New", Courier, monospace;
  letter-spacing: 0.08em;
}

.bwe-product-trust__routes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bwe-product-trust a {
  display: grid;
  align-content: center;
  min-height: 44px;
  padding: 8px 10px;
  color: inherit;
  background: var(--bwe-support-paper);
  border: 1px solid currentColor;
  font: 700 12px/1.25 "Courier New", Courier, monospace;
  text-align: center;
  text-decoration: none;
}

@media (max-width: 820px) {
  /* 2026-09-04 修复:此覆盖曾为 4/5 列(早于聊天项与沉浸开关入列),第 6 项折到第二行。
     与 public/bwe-archive.css 的 5/6 列对齐,保证标签栏恒为一行;标签 nowrap 防单元格内折行。 */
  .bwe-archive-ui .bigwhite-mobile-tabbar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .bwe-archive-ui .bigwhite-mobile-tabbar--with-fx {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .bwe-archive-ui .bigwhite-mobile-tabbar__item span {
    /* 2026-09-15 可用性:原 nowrap 在 6 列窄格 + 系统大字下必然溢出被裁
       (客户截图 "IMM. OFF" 被切) —— 允许换行,字号/行高在 bwe-archive.css 收口 */
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  /* 2026-08-31 店主反馈:悬浮块占太多可视空间 → 收紧为 44×44(WCAG 触控最小值)。
     长文案 "NEED HELP?" 在窄方块里会折行撑高,移动端改用短标签 HELP(__action)。 */
  .bwe-support-launch {
    inset: auto 12px calc(var(--bwe-tabbar-total, 88px) + 8px) auto;
    min-width: 0;
    width: 44px;
    min-height: 44px;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    justify-items: center;
    gap: 4px;
    padding: 7px 4px;
    border-inline-start-width: 4px;
    box-shadow: 3px 3px 0 rgb(0 0 0 / 25%);
    text-align: center;
  }

  /* D1/D2(2026-09-03 K3):首页底部的 RELEASE FEED/INDEX 控制台条(~113px)是最高的——
     launcher 抬到其上方 120px,不再压条,也不再与 nudge 相碰 */
  body[data-page-type="index"] .bwe-support-launch {
    inset-block-end: calc(140px + env(safe-area-inset-bottom, 0px)); /* D1/D2:实测 deck 条高 120+10 底距,抬到 140 脱开 20px */
  }

  .bwe-support-launch__signal {
    width: 7px;
    height: 7px;
  }

  .bwe-support-launch__copy {
    display: none;
  }

  .bwe-support-launch__action {
    display: block;
    min-width: 0;
    min-height: 0;
    padding: 0;
    color: var(--bwe-support-paper);
    background: transparent;
    font-size: 10px;
    letter-spacing: 0.04em;
  }

  .bwe-support-nudge {
    inset: auto 12px calc(148px + env(safe-area-inset-bottom, 0px)) auto;
    width: min(260px, calc(100vw - 24px));
    font-size: 11px;
  }

  /* D1:nudge 抬到 launcher(120+44)上方 10px,不再压住 INDEX/NEW PRODUCTS 入口 */
  body[data-page-type="index"] .bwe-support-nudge {
    inset-block-end: calc(194px + env(safe-area-inset-bottom, 0px));
  }

  body[data-page-type="product"]:has(.is-sticky > .product-detail__buy-buttons) .bwe-support-launch,
  body[data-page-type="product"]:has(.is-sticky > .block-product-buy-button-group) .bwe-support-launch {
    /* The bottom navigation keeps its Chat entry; avoid covering the variable-height purchase panel. */
    display: none;
    pointer-events: none;
  }

  .bwe-support-dialog:not([hidden]) {
    inset-block-end: var(--bwe-tabbar-total, calc(88px + env(safe-area-inset-bottom, 0px)));
    padding: 10px;
  }

  .bwe-support-dialog__panel {
    width: 100%;
    /* 面板上限跟随实测导航栏高度(大字下栏变高 → 面板相应收窄,不被遮住) */
    max-height: calc(100dvh - var(--bwe-tabbar-total, calc(88px + env(safe-area-inset-bottom, 0px))) - 20px);
  }

  .bwe-product-trust__routes {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 821px) {
  /* Product imagery and purchase fields keep their space; the full desk opens on click. */
  body[data-page-type="product"] .bwe-support-launch {
    min-width: 0;
    width: 64px;
    min-height: 52px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 4px;
    padding: 8px 4px;
    inset-inline-end: 12px;
  }

  body[data-page-type="product"] .bwe-support-launch__copy,
  body[data-page-type="product"] .bwe-support-launch__signal {
    display: none;
  }

  body[data-page-type="product"] .bwe-support-launch__action {
    min-width: 0;
    min-height: 0;
    color: var(--bwe-support-paper);
    background: transparent;
    font-size: 13px;
  }

  body:has(.is-sticky > .product-detail__buy-buttons) .bwe-support-launch,
  body:has(.is-sticky > .block-product-buy-button-group) .bwe-support-launch {
    inset-block-end: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bwe-support-shell *,
  .bwe-support-shell *::before,
  .bwe-support-shell *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* 聊天窗版面板：加宽以容纳聊天与历史 */
/* 弹窗打开期间,未停靠的平台会员插件(悬浮按钮/面板/背板)不得拦截点击;
   弹窗本身抬到接近最高层级,保证压过第三方浮层。 */
html.bwe-support-open #member-system-plugin:not([data-bwe-member-docked]) {
  visibility: hidden !important;
  pointer-events: none !important;
}

.bwe-support-dialog:not([hidden]) {
  z-index: 2147483647;
}

/* 2026-09-15(店主真机复验截图):
   ① 弹窗打开时启动器仍浮在弹窗上(HELP 方块叠在聊天区)——按 aria-expanded 隐藏,
      关闭时 JS 改回 false 自动恢复。
   ② 聊天内容超长时输入区被滚出可视区(截图实证输入框被裁半)——输入区在滚动容器内吸底。 */
/* 弹窗打开时隐藏启动器:唯一真值是 JS 在开/关时加删的 html.bwe-support-open,
   不再依赖 aria-expanded(它会被多个触发器共用,容易在异常路径上粘住,
   导致启动器永久不可见/不可点——2026-09-15 用真机反馈修正)。 */
html.bwe-support-open .bwe-support-launch {
  visibility: hidden !important;
  pointer-events: none !important;
}

.bwe-chat-widget [data-bwe-chat-composer] {
  position: sticky;
  inset-block-end: 0;
  z-index: 2;
  padding-block-end: 4px;
  background: inherit;
}


.bwe-support-dialog__panel--chat {
  display: flex;
  flex-direction: column;
  width: min(480px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 40px));
  overflow: hidden;
}

.bwe-support-dialog__panel--chat > .bwe-support-dialog__header,
.bwe-support-dialog__panel--chat > .bwe-support-dialog__dismiss {
  flex: 0 0 auto;
}

.bwe-support-dialog__panel--chat > .bwe-support-dialog__dismiss {
  margin-block: 8px 12px;
}

.bwe-support-dialog__chat {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 16px;
}

/* Desktop support reserves reading space even with an empty or short history. */
@media (min-width: 821px) {
  .bwe-support-dialog__panel--chat {
    height: min(920px, calc(100dvh - 40px));
    max-height: calc(100dvh - 40px);
  }

  .bwe-support-dialog__panel--chat > .bwe-support-dialog__header {
    align-items: center;
    padding: 12px 16px;
  }

  .bwe-support-dialog__panel--chat .bwe-support-dialog__header h2 {
    margin-block-start: 4px;
    font-size: 24px;
  }

  .bwe-support-dialog__chat {
    flex: 1 1 auto;
  }

  .bwe-support-dialog__chat > .bwe-chat-widget {
    height: 100%;
    min-height: 0;
  }

  .bwe-support-dialog__chat > .bwe-chat-widget > * {
    flex: 0 0 auto;
  }

  .bwe-support-dialog__chat .bwe-chat-widget__history {
    flex: 1 1 0;
    min-height: 160px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .bwe-support-dialog__chat .bwe-chat-msg {
    flex: 0 0 auto;
  }
}

/* This final rule owns the chat budget, including the fixed mobile navigation. */
@media (max-width: 820px) {
  .bwe-support-dialog__panel--chat {
    width: 100%;
    max-height: calc(100dvh - 108px - env(safe-area-inset-bottom, 0px));
  }

  .bwe-support-dialog__header {
    padding: 12px;
  }

  .bwe-support-dialog__header h2 {
    /* 2026-09-15 可用性:固定 24px 在窄屏+系统大字下把 "MEMBERSHIP" 断成
       "MEMBERSHI/P";随屏宽收敛并禁止单词内断行(整词换行) */
    font-size: clamp(20px, 6vw, 24px);
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }

  .bwe-support-dialog__chat {
    padding: 12px;
  }

  .bwe-support-nudge {
    font-size: 13px;
  }
}

.bwe-support-dialog__routes--compact a {
  padding: 8px 16px;
}

.bwe-support-dialog__routes--compact a small {
  display: none;
}

/* Membership shares this desk; its account data and transactions stay in the
   official app. Only a successfully connected app root receives these rules. */
.bwe-support-dialog__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 0 0 auto;
  background: #1a1d1a;
  border-bottom: 1px solid var(--bwe-support-line);
}

.bwe-support-dialog__tabs > button {
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: #c8cac5;
  background: transparent;
  font: 700 12px/1.3 "Courier New", Courier, monospace;
  letter-spacing: .07em;
  cursor: pointer;
}

.bwe-support-dialog__tabs > button[aria-selected="true"] {
  color: var(--bwe-support-paper);
  border-bottom-color: var(--bwe-support-signal);
  background: rgb(255 255 255 / 4%);
}

.bwe-support-dialog__tabs > button:focus-visible {
  outline: 2px solid var(--bwe-support-paper);
  outline-offset: -5px;
}

.bwe-support-dialog__membership {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.bwe-support-dialog__member-host,
#member-system-plugin[data-bwe-member-docked] {
  flex: 1 1 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

/* 2026-09-15(店主真机:点 MEMBERSHIP 黑屏 —— 平台插件的深色全屏面板以 fixed
   形态逃出容器盖住整页)。在停靠根节点上建立包含块 + 兜底裁剪,不论其内部结构
   是否匹配既有中和选择器,浮层都被限制在弹窗会员区内。 */
#member-system-plugin[data-bwe-member-docked] {
  contain: layout paint;
  transform: translateZ(0);
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
}

.bwe-support-dialog__member-host {
  display: flex;
  /* 内部 fixed 浮层关在宿主内(平台插件原为全屏设计) */
  contain: layout paint;
  /* 大字/窄屏下官方会员组件高于弹窗:允许滚动而不是裁掉无法触达的内容(2026-09-15) */
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.bwe-support-dialog__member-status {
  flex: 0 0 auto;
  padding: 12px 16px;
  font: 14px/1.5 Arial, sans-serif;
}

.bwe-support-dialog__member-status button {
  min-height: 44px;
  padding: 8px 12px;
  color: var(--bwe-support-paper);
  background: var(--bwe-support-ink);
  border: 1px solid var(--bwe-support-line);
  font: 700 12px/1.3 "Courier New", Courier, monospace;
}

.bwe-support-dialog__tabs[hidden],
.bwe-support-dialog__chat[hidden],
.bwe-support-dialog__membership[hidden],
.bwe-support-dialog__member-status[hidden],
.bwe-support-dialog__member-status button[hidden],
.bwe-support-shell[data-member-integrated] [data-bwe-chat-chip="member"],
.bwe-support-shell[data-member-integrated] [data-bwe-chat-card="member"],
#member-system-plugin[data-bwe-member-docked] > button[aria-label="Rewards"],
#member-system-plugin[data-bwe-member-docked] > button[aria-label="Close"] {
  display: none !important;
}

#member-system-plugin[data-bwe-member-docked] > [data-bwe-member-panel] {
  position: relative !important;
  inset: auto !important;
  /* 2026-09-15 加固:平台插件原为全屏浮层,停靠后其内部 position:fixed 子元素
     仍以视口为包含块 → 会盖住整页吞掉所有点击。加 transform/contain 让它成为
     内部浮层的包含块,浮层被关在面板内。 */
  transform: translateZ(0) !important;
  contain: layout paint;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  transform: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  /* 2026-09-15(店主真机:插件内容被 DONE 压住不可达)——原为 hidden,
     改为纵向可滚动;平台面板可能自带内联 overflow,故用 !important 兜底。 */
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

[data-bwe-member-panel] > .bwe-support-dialog__header {
  padding: 12px 16px;
}

[data-bwe-member-panel] > .bwe-support-dialog__dismiss {
  margin-block: 8px 12px;
}

[data-bwe-member-panel] > #sl-member-plugin-iframe-id,
[data-bwe-member-panel] #sl-member-plugin-iframe-id > div,
[data-bwe-member-panel] #sl-member-plugin-iframe-id > div > div,
[data-bwe-member-panel] #sl-member-plugin-iframe-id > div > div > div,
[data-bwe-member-panel] .proxy-member-page-layout {
  height: 100% !important;
  min-height: 0;
  max-height: 100%;
}

[data-bwe-member-panel] > #sl-member-plugin-iframe-id {
  min-width: 0;
  overflow: hidden;
}

.bwe-support-shell[data-member-panel="true"] .bwe-support-dialog__member-status {
  display: none;
}

@media (max-width: 820px) {
  .bwe-support-shell[data-support-view="member"] .bwe-support-dialog__panel--chat {
    /* 2026-09-15 店主复验:原为写死 100dvh-108px,内容不足时底部大片留白
       (实测店里那台 852px 视口 → 面板恒 744px)。改为随内容自适应,仅保留上限。 */
    height: auto;
    min-height: min(72vh, 620px); /* 会员区给足空间:平台插件内容丰富(卡+积分+入口) */
    max-height: calc(100dvh - 108px - env(safe-area-inset-bottom, 0px));
  }

  [data-bwe-member-panel] > .bwe-support-dialog__header {
    padding: 12px;
  }
}

/* The storefront's button text rule otherwise makes the official sign-in
   action dark on its dark card. Keep its native action and change contrast. */
[data-bwe-member-panel] .member-signInBtn {
  color: #eceee9 !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Account facts remain visible before the optional native launcher loads. */
.bwe-support-dialog__summary { flex: 0 0 auto; padding: 0; }

.bwe-support-dialog__summary-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--bwe-support-ink);
  background: var(--bwe-support-paper);
  font: 700 12px/1.2 "Courier New", Courier, monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.bwe-support-dialog__summary-toggle::-webkit-details-marker { display: none; }

.bwe-support-dialog__summary-toggle::after {
  content: "+";
  color: var(--bwe-support-signal);
  font-size: 17px;
  line-height: 1;
}

.bwe-support-dialog__summary[open] .bwe-support-dialog__summary-toggle::after { content: "−"; }

.bwe-support-dialog__summary-hint {
  margin-inline-start: auto;
  color: #6d7370;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
}

.bwe-support-dialog__summary > .bwe-member-summary {
  margin: 0 12px 10px;
}

/* 折叠体里的会员卡不再重复自己的头部(标题已在 summary 行) */
.bwe-support-dialog__summary .bwe-member-summary__header { display: none; }

/* 2026-09-15 事故修复:会员卡组件自带 display:grid,会压过浏览器对
   <details> 内容区的默认隐藏 —— 折叠后卡片仍在渲染,压在聊天区上,
   导致弹窗内按钮全被盖住点不动。显式隐藏折叠态内容。 */
.bwe-support-dialog__summary:not([open]) > .bwe-member-summary {
  display: none !important;
}
.bwe-support-shell[data-support-view="member"] .bwe-support-dialog__summary { display: none; }
.bwe-support-dialog__member-overview { flex: 0 0 auto; padding: 10px 12px; }
.bwe-support-shell[data-member-panel="true"] .bwe-support-dialog__member-overview,
.bwe-support-shell [data-bwe-chat-chip="member"],
.bwe-support-shell [data-bwe-chat-card="member"] { display: none !important; }
.bwe-support-shell:not([data-member-panel="true"]) .bwe-support-dialog__membership { overflow-y: auto; }
.bwe-support-shell:not([data-member-panel="true"]) .bwe-support-dialog__member-host { flex: 0 0 auto; height: auto; }

@media (min-width: 821px) {
  .bwe-support-dialog__chat { display: flex; flex-direction: column; }
  .bwe-support-dialog__chat > .bwe-chat-widget { flex: 1 1 auto; height: auto; min-height: 340px; }
}

.bwe-support-dialog__member-status [data-bwe-member-native-link] {
  display: inline-flex; align-items: center; min-height: 44px; margin: 6px;
  padding: 8px 12px; color: #eceee9; background: #121412;
  border: 1px solid #626958; font: 700 12px/1.3 "Courier New", monospace;
}
.bwe-support-dialog__member-status [data-bwe-member-native-link][hidden] { display: none; }

/* Keep cart totals/recovery and mobile empty-state actions unobstructed. */
@media (min-width: 821px) {
  body[data-page-type="cart"] .bwe-support-launch {
    inset: auto auto 20px 20px; min-width: 0; width: 64px; min-height: 52px;
    grid-template-columns: 1fr; justify-items: center; padding: 8px 4px;
  }
  body[data-page-type="cart"] .bwe-support-launch__copy,
  body[data-page-type="cart"] .bwe-support-launch__signal { display: none; }
  body[data-page-type="cart"] .bwe-support-launch__action {
    min-width: 0; min-height: 0; color: var(--bwe-support-paper);
    background: transparent; font-size: 13px;
  }
}
@media (max-width: 820px) {
  body:is([data-page-type="cart"], [data-page-type="search"], [data-page-type="collection"]):has(.bigwhite-mobile-tabbar) .bwe-support-launch,
  body:is([data-page-type="search"], [data-page-type="collection"]):has(.bigwhite-mobile-tabbar) .bwe-support-nudge {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   2026-09-15 店主决定:移动端弹窗直接全屏(终止高度拉锯)
   理由:高度反复调优收益低、易引入新问题;全屏后:
   · 会员插件(平台全屏设计)天然有足够空间,不再被 DONE 压住;
   · 聊天记录区最大化;
   · 不再依赖底栏高度/安全区做偏移计算,减少失效点。
   桌面端(>820px)保持原有右下角卡片形态不变。
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 820px) {
  .bwe-support-dialog:not([hidden]) {
    inset: 0 !important;
    padding: 0 !important;
    align-items: stretch !important;
    justify-items: stretch !important;
  }

  .bwe-support-dialog__panel,
  .bwe-support-dialog__panel--chat,
  .bwe-support-shell[data-support-view="member"] .bwe-support-dialog__panel--chat {
    width: 100% !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    border: 0 !important;
    border-inline: 0 !important;
    box-shadow: none !important;
  }

  /* 内容区占满剩余高度并内部滚动(聊天/会员各自可滚) */
  .bwe-support-dialog__chat {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }

  /* 聊天窗撑满内容区:历史区伸展、输入区贴底(全屏后不再有"上方空一块") */
  .bwe-support-dialog__chat > .bwe-chat-widget {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  .bwe-chat-widget__history {
    flex: 1 1 auto !important;
    min-height: 40px !important;
    overflow-y: auto !important;
  }

  .bwe-support-dialog__member-host {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }

  /* 底部操作行固定贴底 + 安全区留白 */
  .bwe-support-dialog__panel--chat > .bwe-support-dialog__dismiss {
    margin-block: 8px 0 !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
  }
}
