.support-chat-shell,.support-desk { min-width:0; }
.support-chat-shell { border:1px solid #eee0d8; border-radius:18px; overflow:hidden; background:#fffaf6; }
.support-chat-title { padding:14px 16px; color:#fff; background:linear-gradient(120deg,#a13e28,#ca6335); }
.support-chat-title p { margin:4px 0 0; }
.support-messages { height:clamp(210px,46vh,460px); overflow:auto; padding:14px; background:#fff8f3; display:flex; flex-direction:column; gap:12px; }
.support-empty { text-align:center; color:#795d51; }
.support-message { align-self:flex-start; max-width:85%; min-width:0; }
.support-own { align-self:flex-end; }
.support-meta { display:block; color:#735b4e; font-size:12px; margin:0 0 4px; }
.support-own .support-meta { text-align:right; }
.support-bubble,#shop-view .support-bubble { margin:0; padding:8px 11px; border-radius:4px 13px 13px; background:#fff; border:1px solid #f0e1d9; color:#392923; overflow-wrap:anywhere; white-space:pre-wrap; }
.support-own .support-bubble,#shop-view .support-own .support-bubble { border-radius:13px 4px 13px 13px; background:#ffe9dc; }
.support-compose { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:8px; padding:10px; background:#fff; border-top:1px solid #f0e1d9; }
.support-compose textarea { min-width:0; min-height:44px; resize:vertical; border:1px solid #ebd9ce; border-radius:11px; padding:9px; background:#fffbf7; color:#392923; font:inherit; }
.support-compose button { min-height:44px; padding:8px 14px; border:0; border-radius:11px; background:#a5412a; color:#fff; cursor:pointer; }
.support-compose button:disabled { opacity:.6; }
.support-feedback:empty { display:none; }
.support-feedback,#shop-view .support-feedback { color:#a4412d; padding:5px 14px; }
.support-desk { display:grid; grid-template-columns:minmax(125px,230px) minmax(0,1fr); gap:12px; }
.support-conversations { display:grid; align-content:start; gap:6px; max-height:57vh; overflow:auto; }
.support-conversations button { display:grid; text-align:left; gap:3px; }
.support-conversations small { color:#795e51; }
@media(max-width:700px){.support-desk{grid-template-columns:1fr}.support-conversations{max-height:150px}}

.support-tools,.support-emojis,.support-preview { grid-column:1/-1; display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.support-tools button,.support-emojis button,.support-preview button { min-height:34px; padding:5px 10px; background:#fff0e7; color:#893b2a; }
.support-emojis { padding:6px; border:1px solid #f0e1d9; border-radius:11px; background:#fffbf8; }
.support-emojis[hidden],.support-preview[hidden] { display:none; }
.support-emojis button { font-size:18px; background:transparent; }
.support-media { display:block; max-width:min(100%,300px); border-radius:10px; }
img.support-media { max-height:240px; object-fit:contain; }
.support-message button.support-photo-open {
  display:block; max-width:min(100%,300px); padding:0; border:0; border-radius:10px; background:transparent; cursor:zoom-in;
}
.support-photo-open img { max-width:100%; }
dialog.support-photo-dialog {
  position:fixed; inset:0; margin:auto; width:fit-content; height:fit-content;
  max-width:calc(100vw - 24px); max-height:min(calc(100dvh - 24px), calc(100svh - 24px));
  padding:0; border:0; border-radius:12px; background:#191919;
}
.support-photo-dialog::backdrop { background:#000c; }
.support-photo-dialog img {
  display:block; max-width:100%;
  max-height:min(calc(100dvh - 24px), calc(100svh - 24px));
  object-fit:contain;
}
.support-photo-dialog button {
  position:absolute; top:8px; right:8px; width:40px; height:40px;
  border:1px solid #fff6; border-radius:50%; background:#202020d9; color:white; font-size:25px; cursor:pointer;
}
audio.support-media { width:min(235px,100%); }
.support-preview img.support-media { max-height:95px; max-width:145px; }

.support-time { align-self:center; padding:3px 9px; border-radius:9px; background:#f4e8df; color:#72584c; font-size:12px; font-variant-numeric:tabular-nums; }
.support-compose [hidden] { display:none; }
.support-compose .support-hold { width:100%; min-height:46px; border:1px solid #ead3c5; background:#fff4ec; color:#793325; font-weight:650; touch-action:none; user-select:none; -webkit-touch-callout:none; }
.support-compose .support-hold:active { background:#f3dacb; }
.support-tools button[aria-pressed="true"] { background:#a5412a; color:white; }
.support-message .support-voice { display:block; min-height:42px; width:var(--voice-width,96px); max-width:100%; cursor:pointer; text-align:left; font:inherit; font-variant-numeric:tabular-nums; }
.support-own .support-voice { text-align:right; }

.admin-top .admin-support-entry[aria-pressed="true"] { background:#92543c; border-color:#aa6a50; }
.admin-support-count:not(:empty) { display:inline-grid; place-items:center; border-radius:99px; padding:0 5px; min-width:18px; margin-left:6px; font-size:11px; background:#f6d2b9; color:#553226; }
.support-desk { gap:0; grid-template-columns:minmax(225px,30%) minmax(0,1fr); border:1px solid #eaded6; border-radius:14px; overflow:hidden; background:#f8f5f2; }
.support-sidebar { min-width:0; min-height:150px; padding:12px 0 0; border-right:1px solid #e9ddd5; background:#f0e9e4; }
.support-sidebar input { display:block; width:calc(100% - 24px); margin:0 12px 10px; }
.support-conversations { display:block; max-height:calc(60vh - 55px); }
.support-conversations .support-conversation { display:flex; align-items:center; gap:9px; width:100%; padding:10px 12px; border:0; border-radius:0; background:transparent; }
.support-conversation:hover { background:#e9ded6; }
.support-conversation[aria-pressed="true"] { background:#e6d4c8; }
.support-avatar { display:grid; flex:0 0 34px; height:34px; place-items:center; border-radius:10px; color:#fff; background:#9c5039; }
.support-thread-details { flex:1; min-width:0; }
.support-thread-line { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:3px 6px; }
.support-thread-line time { font-size:11px; color:#68574d; }
.support-conversation .support-awaiting { color:#983e29; font-weight:650; }
.support-thread { min-width:0; display:grid; }
.support-thread-empty { align-self:center; justify-self:center; color:#715c50; padding:18px; }
.support-list-empty { padding:12px; color:#715c50; }
.support-thread .support-chat-shell { border:0; border-radius:0; }
.support-thread .support-chat-title { border-bottom:1px solid #eaded6; background:#fcfaf8; color:#392923; }
.support-thread .support-messages { height:clamp(250px,53vh,620px); background:#f8f5f2; }
@media(max-width:700px){
  .support-desk { grid-template-columns:1fr; }
  .support-sidebar { min-height:0; border-right:0; border-bottom:1px solid #e9ddd5; }
  .support-conversations { max-height:170px; }
}

.support-desk {
  grid-template-columns:60px minmax(210px,29%) minmax(0,1fr);
  min-height:clamp(440px,72vh,780px);
  overflow:hidden;
}
.support-rail {
  display:flex; align-items:flex-start; justify-content:center; padding:12px 5px;
  background:#3b2e28;
}
.support-rail button {
  width:46px; padding:7px 2px; border:1px solid #98715f;
  background:#654838; color:#fff3eb; font-size:13px;
}
.support-sidebar { display:flex; flex-direction:column; padding-top:12px; }
.support-sidebar-title { margin:0 12px 8px; font-size:16px; }
.support-conversations { max-height:clamp(310px,62vh,670px); }
.support-thread { grid-template-rows:auto minmax(0,1fr); background:#fcfaf8; }
.support-thread .support-chat-shell { grid-row:1/-1; display:flex; flex-direction:column; }
.support-thread .support-chat-shell > div { display:flex; flex:1; flex-direction:column; min-height:0; }
.support-thread .support-chat-title { min-height:51px; }
.support-thread .support-messages {
  flex:1; height:clamp(250px,50vh,550px); min-height:240px; max-height:550px;
}
.support-thread .support-compose { margin-top:auto; padding:10px 12px; }
.support-thread .support-compose textarea { min-height:60px; }
@media(max-width:760px){
  .support-desk { grid-template-columns:minmax(0,1fr); min-height:0; }
  .support-rail { justify-content:flex-start; padding:6px 12px; }
  .support-sidebar { border-right:0; border-bottom:1px solid #e9ddd5; }
  .support-conversations { max-height:160px; }
  .support-thread-empty { min-height:112px; display:grid; place-items:center; }
}

.support-thread .support-idle { min-height:clamp(365px,64vh,720px); }
.support-idle .support-thread-empty { display:grid; align-content:center; justify-items:center; flex:1; text-align:center; }
.support-idle .support-thread-empty p { margin:6px 0 12px; }
.support-idle .support-thread-empty a { color:#8d3825; text-underline-offset:3px; }
.support-thread .support-idle-compose { margin:0; border:0; border-top:1px solid #f0e1d9; min-inline-size:0; }
@media(max-width:760px){.support-thread .support-idle{min-height:330px}}

/* Desktop support workspace */
.support-desk { border-color:#d3d9d6; border-radius:8px; background:#f4f6f5; grid-template-columns:56px minmax(195px,27%) minmax(0,1fr); }
.support-rail { background:#263230; }
.support-rail button { border:0; border-radius:7px; background:#345a4e; color:#d9f7e9; }
.support-sidebar { background:#e8eeeb; border-color:#d4ddd8; color:#24322d; }
.support-sidebar input { background:#f6f8f7; border-color:#cdd8d2; border-radius:7px; }
.support-conversations .support-conversation:hover { background:#dce6e0; }
.support-conversations .support-conversation[aria-pressed="true"] { background:#cdded4; color:#24322d; }
.support-avatar { background:#487b67; }
.support-conversations small,.support-thread-line time,.support-list-empty { color:#54655d; }
.support-conversation .support-awaiting { color:#215f48; }
.support-thread,.support-thread .support-chat-title { background:#f4f6f5; color:#24322d; }
.support-thread .support-chat-title { border-color:#dce4df; }
.support-thread .support-messages { background:#f4f6f5; padding:16px 20px; }
.support-thread .support-time { background:#e5ebe7; color:#52645b; }
.support-thread .support-meta,.support-thread .support-thread-empty { color:#54655d; }
.support-thread .support-bubble { background:#fff; color:#20302a; border-color:#dce5df; }
.support-thread .support-own .support-bubble { background:#bce9cf; border-color:#a9dcbf; }
.support-thread .support-compose { border-color:#dce4df; background:#fff; }
.support-thread .support-compose textarea { background:#fff; border-color:#dce4df; }
.support-thread .support-compose textarea:focus-visible { outline:2px solid #40856a; outline-offset:1px; }
.support-thread .support-compose button { background:#236a50; }
.support-thread .support-tools button,.support-thread .support-emojis button,.support-thread .support-preview button,.support-thread .support-hold { background:#eaf2ed; color:#245b46; border-color:#d8e6dd; }
.support-thread .support-tools button[aria-pressed="true"] { background:#cde8d8; }
.support-thread .support-idle a { color:#236a50; }
@media(max-width:760px){.support-desk{grid-template-columns:minmax(0,1fr)}}

.support-quote-action { display:block; margin-top:4px; padding:2px 7px; color:#685c55; font-size:12px; background:transparent; border:1px solid transparent; border-radius:6px; cursor:pointer; }
.support-quote-action:hover,.support-quote-action:focus-visible { border-color:#cbd7d0; background:#fff; }
.support-own .support-quote-action { margin-left:auto; }
.support-quote,.support-quote-draft { margin:0 0 4px; padding:5px 8px; border-inline-start:3px solid #a2b3aa; border-radius:5px; background:#e9eeeb; color:#43534b; font-size:12px; overflow-wrap:anywhere; }
.support-quote-draft { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.support-quote-draft[hidden] { display:none; }
.support-quote-draft button { min-height:30px; padding:3px 8px; flex-shrink:0; }

/* Keep the desktop composer distinct from the compact storefront composer. */
.support-desk { grid-template-columns:54px minmax(190px,24%) minmax(0,1fr); border-radius:10px; }
.support-rail { background:#303735; }
.support-sidebar { background:#edf0ee; }
.support-sidebar input { min-height:35px; padding:5px 9px; }
.support-conversations .support-conversation { min-height:62px; }
.support-thread .support-chat-title { background:#fafbfa; }
.support-thread .support-messages { padding:18px 18px 20px; gap:11px; }
.support-thread .support-time { background:transparent; }
.support-thread .support-compose {
  grid-template-columns:minmax(0,1fr);
  gap:6px;
  padding:8px 12px 10px;
  background:#fafbfa;
}
.support-thread .support-tools { gap:4px; }
.support-thread .support-tools button { min-height:30px; background:transparent; }
.support-thread .support-tools button:hover,.support-thread .support-tools button[aria-pressed="true"] { background:#dcebe3; }
.support-thread .support-compose textarea {
  width:100%; min-height:74px; padding:6px 8px; border:0; border-radius:5px;
  background:transparent; resize:vertical;
}
.support-thread .support-compose > button:not(.support-hold) { justify-self:end; min-width:85px; min-height:34px; padding:5px 14px; }
@media(max-width:760px){
  .support-desk { grid-template-columns:minmax(0,1fr); }
  .support-thread .support-compose textarea { min-height:52px; }
}

.support-thread .support-chat-title { display:flex; align-items:center; flex-wrap:wrap; justify-content:space-between; gap:8px; }
.support-thread .support-chat-title strong { overflow-wrap:anywhere; }
.support-thread-actions,.support-name-editor { display:flex; gap:6px; }
.support-thread-actions button,.support-name-editor button { padding:4px 8px; font-size:12px; }
.support-name-editor { flex:1 0 100%; }
.support-name-editor input { flex:1; min-width:0; }
.support-name-editor[hidden] { display:none; }

.support-thread-summary { display:flex; align-items:baseline; gap:5px; min-width:0; }
.support-thread-summary small { flex-shrink:0; }
.support-thread-preview { min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:#54655d; font-size:12px; }

.shop-support-back { display:none; }
@media screen{
  #shop-view .shop-support-chat {
    position:fixed; inset:0; z-index:1000; height:100dvh; display:flex; flex-direction:column;
    border:0; border-radius:0; background:#eef1ef; color:#22312a;
  }
  #shop-view .shop-support-chat .support-chat-title {
    display:grid; grid-template-columns:44px minmax(0,1fr) 44px; align-items:center;
    padding:env(safe-area-inset-top) 8px 0; min-height:50px; background:#fafbf9;
    color:#22312a; border-bottom:1px solid #dce3de;
  }
  #shop-view .shop-support-chat h2 { margin:0; text-align:center; }
  #shop-view .shop-support-chat .support-chat-title p {
    grid-column:1/-1; padding:4px 6px; margin:0 0 5px; text-align:center; color:#56665d; font-size:11px;
  }
  .shop-support-back {
    display:grid; place-items:center; min-height:44px; color:inherit; text-decoration:none; font-size:28px;
  }
  .shop-support-chat > div { display:flex; flex:1; min-height:0; flex-direction:column; }
  .shop-support-chat .support-messages { flex:1; min-height:0; height:auto; background:#eef1ef; }
  .shop-support-chat .support-time { background:transparent; color:#52645b; }
  #shop-view .shop-support-chat .support-bubble { background:#fff; border-color:#dce5df; color:#20302a; }
  #shop-view .shop-support-chat .support-own .support-bubble { background:#bbe9d0; border-color:#a9dcbe; }
  .shop-support-chat .support-compose {
    padding:7px 8px max(7px,env(safe-area-inset-bottom)); gap:5px;
    background:#fafbf9; border-color:#dce3de; align-items:center;
  }
  .shop-support-chat .support-compose textarea {
    min-height:40px; max-height:100px; resize:none; padding:8px; background:#fff; border-color:#dce3de; font-size:16px;
  }
  .shop-support-chat .support-tools button,.shop-support-chat .support-hold {
    background:#e4eee8; color:#245b46; border-color:#d2e2d8;
  }
  .shop-support-chat .support-tools button[aria-pressed="true"] { background:#cee7d8; }
  .shop-support-chat .support-compose > button[type="submit"] { background:#236a50; min-height:40px; }
  #shop-view .shop-support-chat .support-feedback { margin:0; padding:4px 12px; }
}

.support-unread,.support-read { flex:none; border-radius:5px; padding:0 4px; font-size:11px; line-height:17px; }
.support-unread { color:#fff; background:#b72b38; animation:support-unread-pulse 1.35s ease-in-out infinite; }
.support-read { color:#52645b; background:#e1ebe4; }
@keyframes support-unread-pulse { 50% { background:#972330; box-shadow:0 0 0 3px #b72b3835; } }
@media(prefers-reduced-motion:reduce){.support-unread{animation:none}}

#shop-view .shop-support-info summary { cursor:pointer; list-style:none; text-align:center; }
@media screen{
  body:has(.shop-support-chat) { overflow:hidden; }
  #shop-view:has(.shop-support-chat) { transform:none !important; animation:none !important; }
  #shop-view .shop-support-chat .support-chat-title { position:relative; z-index:1; flex:none; }
  .shop-support-info summary { line-height:44px; font-size:21px; }
  #shop-view .shop-support-chat .shop-support-info p {
    position:absolute; inset:auto 8px auto; padding:10px; background:#fff;
    border-radius:8px; box-shadow:0 2px 14px #0002; font-size:13px;
  }
  .shop-support-chat .support-message { position:relative; margin-left:44px; align-self:flex-start; max-width:calc(100% - 53px); }
  .shop-support-chat .support-message.support-own { align-self:flex-end; margin-left:0; margin-right:44px; }
  .shop-support-chat .support-message::before {
    content:"客服"; position:absolute; top:0; left:-44px; width:34px; height:34px;
    display:grid; place-items:center; border-radius:9px; background:#426d5d; color:white; font-size:11px;
  }
  .shop-support-chat .support-own::before { content:"我"; left:auto; right:-44px; background:#56727c; }
  .shop-support-chat .support-meta { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  #shop-view .shop-support-chat .support-bubble { position:relative; padding:7px 11px; border-radius:9px; text-align:left; }
  .shop-support-chat .support-bubble::before {
    content:""; position:absolute; top:11px; left:-4px; width:7px; height:7px;
    transform:rotate(45deg); background:inherit;
  }
  .shop-support-chat .support-own .support-bubble::before { left:auto; right:-4px; }
  .shop-support-chat .support-compose {
    flex:none; grid-template-columns:42px minmax(0,1fr) 42px 42px;
    grid-template-areas:"quote quote quote quote" "preview preview preview preview" "voice entry emoji photo" "panel panel panel panel" "send send send send";
  }
  .shop-support-chat .support-tools { display:contents; }
  .shop-support-chat .support-tools button {
    padding:0; min-height:40px; border-radius:50%; background:transparent; color:#24332d; font-size:0;
  }
  .shop-support-chat .support-tools button:nth-of-type(1) { grid-area:photo; }
  .shop-support-chat .support-tools button:nth-of-type(2) { grid-area:voice; }
  .shop-support-chat .support-tools button:nth-of-type(3) { grid-area:emoji; }
  .shop-support-chat .support-tools button::before { font-size:23px; }
  .shop-support-chat .support-tools button:nth-of-type(1)::before { content:"＋"; }
  .shop-support-chat .support-tools button:nth-of-type(2)::before { content:"◖))"; font-size:16px; }
  .shop-support-chat .support-tools button:nth-of-type(2)[aria-pressed="true"]::before { content:"⌨"; font-size:23px; }
  .shop-support-chat .support-tools button:nth-of-type(3)::before { content:"☻"; }
  .shop-support-chat .support-compose textarea,.shop-support-chat .support-hold { grid-area:entry; width:100%; }
  .shop-support-chat .support-hold { border-radius:18px; background:#fff; }
  .shop-support-chat .support-quote-draft { grid-area:quote; }
  .shop-support-chat .support-preview { grid-area:preview; }
  .shop-support-chat .support-emojis { grid-area:panel; }
  .shop-support-chat .support-compose > button[type="submit"] { grid-area:send; justify-self:end; }
  .shop-support-chat .support-compose:has(textarea:placeholder-shown):not(:has(.support-preview:not([hidden]))) > button[type="submit"] { display:none; }
}

@media screen{
  body:has(.shop-support-chat) :is(.pagetop1,.foot_nav) { display:none !important; }
  .shop-support-chat .support-compose textarea { height:44px; }
}

@media(min-width:641px){
  body:has(.shop-support-chat) { background:#e4e9e6; }
  #shop-view .shop-support-chat {
    width:460px; inset:0 0 0; margin-inline:auto;
    box-shadow:0 0 0 1px #cfd9d3, 0 12px 46px #263b3026;
  }
}

#shop-view .shop-support-chat {
  top:var(--chat-top,0px); bottom:auto; height:var(--chat-height,100dvh);
  background:#ededed; color:#191919;
}
#shop-view .shop-support-chat .support-chat-title {
  height:calc(48px + env(safe-area-inset-top));
  background:#ededed; border-color:#e2e2e2; color:#191919;
}
#shop-view .shop-support-chat h2 { font-size:17px; font-weight:700; }
.shop-support-info summary { font-size:26px; }
#shop-view .shop-support-chat .support-messages {
  background:#ededed; padding:16px; gap:16px; scrollbar-width:none;
  overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
}
.shop-support-chat .support-messages::-webkit-scrollbar { display:none; }
.shop-support-chat .support-time { color:#707070; font-size:12px; padding:2px 0; }
.shop-support-chat .support-message { margin-left:51px; max-width:calc(100% - 68px); }
.shop-support-chat .support-message.support-own { margin-left:0; margin-right:51px; }
.shop-support-chat .support-message::before { left:-51px; width:40px; height:40px; border-radius:5px; }
.shop-support-chat .support-own::before { left:auto; right:-51px; }
.shop-support-chat .support-own.support-has-avatar::before { content:none; }
.shop-support-chat .support-own-avatar {
  position:absolute; top:0; right:-51px; width:40px; height:40px;
  max-width:none; margin:0; border-radius:5px; object-fit:cover; pointer-events:none;
}
#shop-view .shop-support-chat .support-bubble {
  padding:10px 12px; border:0; border-radius:7px; color:#191919; font-size:16px; line-height:1.4;
}
#shop-view .shop-support-chat .support-own .support-bubble { background:#a5e884; }
.shop-support-chat .support-quote-action { font-size:0; padding:0; min-height:24px; min-width:28px; }
.shop-support-chat .support-quote-action::before { content:"↩"; font-size:15px; }
.shop-support-chat .support-compose {
  min-height:56px; padding-top:6px; padding-bottom:max(6px,env(safe-area-inset-bottom));
  background:#f7f7f7; border-color:#e5e5e5; row-gap:0;
}
.shop-support-chat .support-compose textarea {
  field-sizing:content; height:auto; min-height:42px; max-height:110px; overflow-y:auto;
  padding:8px 12px; border:1px solid #ebebeb; border-radius:6px;
}
.shop-support-chat .support-compose :is(.support-quote-draft,.support-preview,.support-emojis):not([hidden]) { margin-block:5px; }
.shop-support-chat .support-tools button { min-height:40px; }
.shop-support-chat .support-tools button::before {
  display:inline-grid; place-items:center; width:26px; height:26px;
  border:1.5px solid currentColor; border-radius:50%; line-height:1;
}
.shop-support-chat .support-tools button:nth-of-type(3)::before { content:"☺"; }

#shop-view:has(.shop-support-chat) > h1 { display:none; }
#shop-view .shop-support-chat .support-compose {
  box-sizing:border-box; grid-template-columns:40px minmax(0,1fr) 40px 40px;
  column-gap:6px;
}
#shop-view .shop-support-chat .support-compose :is(textarea,.support-hold) {
  box-sizing:border-box; width:100%; min-width:0; max-width:100%; margin:0;
}
#shop-view .shop-support-chat .support-tools button { box-sizing:border-box; min-width:0; width:40px; margin:0; }

.shop-support-chat .support-tools button:nth-of-type(3)::before {
  font-size:28px;
}

.shop-support-chat .support-emojis:not([hidden]) {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(36px,1fr)); gap:3px;
  max-height:min(220px,32dvh); overflow:auto; overscroll-behavior:contain;
}
.shop-support-chat .support-emojis button { padding:0; min-height:36px; font-size:21px; }
.shop-support-chat .support-emojis button:hover { background:#e5ebe7; }

.shop-support-chat .support-tools button { position:relative; }
.shop-support-chat .support-tools button::before { box-sizing:border-box; width:28px; height:28px; border:1.5px solid currentColor; }
.shop-support-chat .support-tools button:nth-of-type(3)::before {
  content:"";
  background:radial-gradient(circle at 8px 9px,currentColor 1.35px,transparent 1.65px),
             radial-gradient(circle at 17px 9px,currentColor 1.35px,transparent 1.65px);
}
.shop-support-chat .support-tools button:nth-of-type(3)::after {
  content:""; position:absolute; top:calc(50% + 1px); left:50%; transform:translateX(-50%);
  width:11px; height:5px; border:1.5px solid currentColor; border-top:0; border-radius:0 0 8px 8px;
}
.shop-support-chat .support-tools button:nth-of-type(2)::before {
  content:""; width:30px; height:30px; border:2px solid currentColor;
  background:radial-gradient(circle at 8px 50%,currentColor 1.35px,transparent 1.65px);
}
.shop-support-chat .support-tools button:nth-of-type(2)::after {
  content:""; position:absolute; top:50%; left:calc(50% + 3px);
  transform:translate(-50%,-50%); width:13px; height:17px;
  border:0; border-radius:0; box-shadow:none;
  background:radial-gradient(ellipse 6px 8px at 1px center,
    transparent 65%,currentColor 74% 91%,transparent 100%),
    radial-gradient(ellipse 11px 13px at 1px center,
    transparent 78%,currentColor 85% 94%,transparent 100%);
}
.shop-support-chat .support-tools button:nth-of-type(2)[aria-pressed="true"]::before { content:""; background:none; }
.shop-support-chat .support-tools button:nth-of-type(2)[aria-pressed="true"]::after {
  left:50%; width:16px; height:12px; top:50%; border:0; border-radius:0;
  background:repeating-linear-gradient(90deg,currentColor 0 2.6px,transparent 2.6px 4.5px) 0 0/16px 2.6px no-repeat,
             repeating-linear-gradient(90deg,currentColor 0 2.6px,transparent 2.6px 4.5px) 0 4.5px/16px 2.6px no-repeat,
             linear-gradient(currentColor,currentColor) center 10px/9px 2px no-repeat;
}

.support-thread .support-emojis:not([hidden]) {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(36px,1fr));
  max-height:min(220px,32vh); overflow:auto; overscroll-behavior:contain;
}
.support-thread .support-emojis button { min-height:36px; padding:0; }

.support-voice-line { display:flex; align-items:center; gap:8px; }
.support-own .support-voice-line { flex-direction:row-reverse; }
.support-message .support-voice {
  display:flex; align-items:center; gap:8px; min-height:42px; max-width:100%;
  justify-content:flex-start; font-variant-numeric:tabular-nums;
}
.support-own .support-voice { flex-direction:row-reverse; }
.support-voice-wave {
  position:relative; width:17px; height:20px; flex:none;
  background:radial-gradient(circle at 4px 50%, currentColor 1.4px, transparent 1.8px);
}
.support-own .support-voice-wave { transform:scaleX(-1); }
.support-voice-wave::before,.support-voice-wave::after {
  content:""; position:absolute; top:50%; left:2px; transform:translateY(-50%);
  width:8px; height:12px; border-right:1.6px solid currentColor; border-radius:50%;
}
.support-voice-wave::after { width:12px; height:19px; }
.support-voice-playing .support-voice-wave::after { animation:support-wave .8s ease-in-out infinite alternate; }
@keyframes support-wave { to { opacity:.28; } }
.support-voice-dot { flex:none; width:8px; height:8px; border-radius:50%; background:#e6444f; }
.support-voice-dot[hidden] { display:none; }
@media(prefers-reduced-motion:reduce){.support-voice-playing .support-voice-wave::after{animation:none}}

.support-thread .support-receipt { display:block; text-align:right; margin-top:3px; color:#68706b; font-size:11px; }
.support-thread .support-receipt-seen { color:#206149; }

.shop-support-heading { display:flex; align-items:center; justify-content:center; gap:.32em; }
.shop-support-badge {
  position:relative; display:inline-block; flex:none;
  width:clamp(15px,1em,19px); height:clamp(15px,1em,19px);
  background:url("/support-badge.png") center/contain no-repeat;
}
.shop-support-badge::after {
  content:""; position:absolute; inset:0;
  -webkit-mask:url("/support-badge.png") center/contain no-repeat;
  mask:url("/support-badge.png") center/contain no-repeat;
  background:linear-gradient(115deg,transparent 28%,#fffE 50%,transparent 72%) -22px 0/22px 100% no-repeat;
  opacity:0; pointer-events:none; animation:shop-badge-glint 4s .2s ease-in-out infinite;
}
@keyframes shop-badge-glint {
  0% { background-position:-22px 0; opacity:0; }
  8%,22% { opacity:1; }
  30%,100% { background-position:22px 0; opacity:0; }
}
@media(prefers-reduced-motion:reduce){.shop-support-badge::after{animation:none}}

#shop-view .shop-support-badge {
  box-sizing:content-box; width:clamp(15px,1em,19px); height:clamp(15px,1em,19px);
  padding:5px; margin:-5px; border:0; border-radius:6px; background-size:clamp(15px,1em,19px);
  font:inherit; cursor:pointer;
}
#shop-view .shop-support-badge::after { inset:5px; }
#shop-view .shop-support-badge:focus-visible { outline:2px solid #236a50; outline-offset:2px; }
dialog.shop-certification {
  position:fixed; inset:0; margin:auto; height:fit-content; overflow:auto;
  box-sizing:border-box; width:min(350px,calc(100% - 32px)); max-width:calc(100vw - 32px);
  max-height:min(calc(100dvh - 24px), calc(100svh - 24px));
  -webkit-overflow-scrolling:touch;
  padding:22px; border:1px solid #d8e2dd; border-radius:16px; background:#fff;
  color:#22312a; box-shadow:0 12px 46px #14241d33;
}
.shop-certification::backdrop { background:#14241d66; }
.shop-certification h2 { text-align:left; margin:0 30px 17px 0; font-size:clamp(16px,4.5vw,18px); }
.shop-certification p { padding:0; margin:12px 0 16px; color:#53645b; line-height:1.55; }
.shop-certification-status { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:11px; border-radius:8px; background:#f1f5f3; }
.shop-certification-state { font-size:12px; color:#644817; background:#fff1cd; padding:3px 8px; border-radius:6px; }
.shop-certification-close { position:absolute; top:12px; right:12px; border:0; background:transparent; font-size:22px; cursor:pointer; min-width:36px; min-height:36px; }
.shop-certification-apply { margin-top:14px; width:100%; min-height:42px; border:0; border-radius:9px; color:#fff; background:#236a50; cursor:pointer; font:inherit; }

.shop-certification-state[data-status="verified"] {
  display:inline-flex; align-items:center; gap:5px; color:#08763d; background:#e5f6ec;
}
.shop-certification-state[data-status="verified"]::before {
  content:""; width:5px; height:9px; border:solid #07a052;
  border-width:0 2px 2px 0; transform:rotate(45deg); margin-top:-2px;
}

@media(prefers-reduced-motion:no-preference){
  dialog.shop-certification[open] {
    animation:shop-certification-enter 240ms cubic-bezier(.2,.75,.25,1) both;
  }
  .shop-certification[open]::backdrop {
    animation:shop-certification-backdrop 210ms ease-out both;
  }
}
@keyframes shop-certification-enter {
  from { opacity:0; transform:translateY(10px) scale(.98); }
  to { opacity:1; transform:translateY(0) scale(1); }
}
@keyframes shop-certification-backdrop { from { opacity:0; } to { opacity:1; } }

#shop-view .shop-support-chat .support-hold {
  font-size:15px; font-weight:600; border-radius:12px; border-color:#e1e6e2; color:#4e6459;
}
#shop-view .shop-support-chat .support-media-menu {
  grid-area:panel; display:flex; gap:8px; padding:8px 0 4px;
}
#shop-view .shop-support-chat .support-media-menu[hidden] { display:none; }
#shop-view .shop-support-chat .support-media-menu button { min-height:36px; background:#e4eee8; color:#245b46; }

#shop-view .shop-support-chat .support-compose :is(textarea,.support-hold) {
  font-size:17px; line-height:1.35;
}
#shop-view .shop-support-chat .support-compose textarea::placeholder { font-size:inherit; }

.shop-support-chat .support-gesture-layer {
  position:absolute; inset:0; z-index:5; display:grid; place-content:center; justify-items:center;
  pointer-events:none; background:#101c18c9; color:#fff; padding:16px;
}
.shop-support-chat .support-gesture-layer[hidden] { display:none; }
.support-gesture-bubble {
  min-width:95px; max-width:min(320px,80vw); max-height:35dvh; overflow:hidden;
  padding:12px 16px; border-radius:13px; background:#a5e884; color:#162b1d;
  text-align:center; overflow-wrap:anywhere;
}
.support-gesture-layer[data-mode="voice"] .support-gesture-bubble::before {
  content:""; display:block; width:43px; height:18px; margin:0 auto;
  background:repeating-linear-gradient(90deg,#246140 0 2px,transparent 2px 4px);
  clip-path:polygon(0 36%,15% 26%,28% 34%,43% 3%,58% 26%,73% 15%,100% 34%,100% 64%,78% 77%,63% 66%,45% 97%,28% 64%,15% 72%,0 63%);
}
.support-gesture-layer[data-action="cancel"] .support-gesture-bubble { background:#e46b76; color:#241519; }
.support-gesture-hint { margin-top:9px; font-size:13px; }
.support-gesture-actions { position:absolute; inset:auto 16px 55px; display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.support-gesture-zone { padding:13px 4px; text-align:center; border-radius:16px; background:#fff2; }
.support-gesture-layer[data-action="cancel"] .support-gesture-zone:first-child,
.support-gesture-layer[data-action="edit"] .support-gesture-zone:last-child { background:#fff; color:#26352e; }

.support-time .support-time-toggle,
.support-time .support-time-toggle[aria-pressed="true"] {
  appearance:none; padding:2px 5px; margin:0; border:0; border-radius:4px;
  background:transparent; color:inherit; font:inherit; cursor:pointer;
}
.support-time-toggle:focus-visible { outline:1px solid currentColor; outline-offset:2px; }

.support-rail { flex-direction:column; justify-content:flex-start; align-items:center; gap:6px; }
.support-rail button[aria-current="false"],.support-rail button:not([aria-current]) { background:transparent; color:#e0ebe6; }
@media(max-width:760px){.support-rail{flex-direction:row;justify-content:flex-start}}
