.chat-page {
  width: min(100%, 740px);
  margin: clamp(16px, 3.5vh, 36px) auto 28px;
}
.jewelry-chat-frame { min-width:0; }
.jewelry-chat-frame .chat-page { margin:0; width:100%; }
.jewelry-chat-frame .chat-panel { height:100dvh; min-height:0; border:0; border-radius:0; }
.chat-message-sku { font-size:11px; color:var(--muted); }
.chat-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.chat-nav a { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; font-size: 14px; font-weight: 600; text-decoration: none; }
.chat-chevron { display: inline-block; flex: none; width: 8px; height: 8px; border-block-start: 2px solid currentColor; border-inline-end: 2px solid currentColor; transform: rotate(45deg); }
.chat-chevron.start { transform: rotate(-135deg); }
[dir=rtl] .chat-chevron { transform: rotate(-45deg); }
[dir=rtl] .chat-chevron.start { transform: rotate(135deg); }
.chat-panel,.chat-list { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.chat-panel { display: flex; flex-direction: column; height: clamp(380px, calc(100dvh - 200px), 760px); }
.chat-header { display: flex; align-items: center; gap: 13px; padding: 17px 21px 14px; }
.chat-draft-hint { display: block; color: var(--muted); padding: 4px 16px; font-size: 12px; }
.chat-avatar { display: grid; flex: none; width: 44px; height: 44px; place-items: center; border-radius: 50%; background: #e3ece5; color: #315247; font-size: 20px; font-weight: 650; line-height: 1; }
.chat-who { min-width: 0; }
.chat-who p { color: var(--muted); font-size: 12px; margin: 0 0 2px; line-height: 1.4; }
.chat-who h1 { margin: 0; font-size: clamp(21px, 3vw, 28px); overflow-wrap: anywhere; }
.chat-product { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 11px 22px; background: #f5eee6; color: var(--ink); text-decoration: none; }
.chat-product-text { display: grid; gap: 3px; min-width: 0; }
.jewelry-chat-frame .chat-product { justify-content: flex-start; }
.inquiry-current-photo { flex: none; width: 54px; height: 64px; border-radius: 7px; object-fit: cover; }
.inquiry-coupon { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:4px 10px; padding:7px 14px; border-bottom:1px solid var(--line); color:var(--accent); font-size:13px; }
.inquiry-coupon div { display:flex; align-items:baseline; flex-wrap:wrap; gap:2px 8px; }
.inquiry-coupon-value { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; font-size:15px; font-variant-numeric:tabular-nums; }
.inquiry-coupon-value svg { flex:none; align-self:center; }
.inquiry-coupon .btn { min-height:36px; padding:4px 16px; }
.inquiry-coupon a { text-decoration:underline; text-underline-offset:3px; }
.inquiry-styles { padding: 8px 13px; border-block-end: 1px solid var(--line); }
.inquiry-styles h2 { margin: 0 0 5px; color: var(--muted); font-size: 12px; line-height: 1.4; font-weight: 600; }
.inquiry-style-options {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 5px;
  max-height: min(158px, 25dvh); overflow-y: auto; overscroll-behavior: contain;
}
.inquiry-style-options a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 0; min-height: 44px; padding: 3px 2px; border: 1px solid var(--line); border-radius: 7px;
  color: var(--ink); font-size: 11px; font-weight: 600; line-height: 1.25; text-decoration: none;
}
.inquiry-style-options a:hover, .inquiry-style-options a:focus-visible { border-color: var(--accent); }
.inquiry-style-options a:focus-visible { outline-offset: -2px; }
.inquiry-style-options img { width: 42px; height: 48px; object-fit: cover; border-radius: 4px; }
.inquiry-style-options bdi { max-width: 100%; overflow-wrap: anywhere; }
@media (max-height: 410px) {
  .jewelry-chat-frame .inquiry-current-photo { width: 35px; height: 42px; }
  .inquiry-style-options { max-height: 60px; }
  .inquiry-style-options img { width: 29px; height: 33px; }
}
.chat-product strong,.inbox-summary > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-product strong { font-size: 14px; }
.chat-product small { font-size: 12px; overflow-wrap: anywhere; }
.chat-product .chat-chevron,.inbox-meta .chat-chevron { color: var(--muted); }
.chat-scroll { overflow-y: auto; min-height: 0; flex: 1; overscroll-behavior: contain; scrollbar-gutter: stable; }
.chat-feed { list-style: none; padding: 18px 20px; margin: 0; display: flex; min-height: 100%; flex-direction: column; justify-content: flex-end; gap: 11px; }
.chat-message { display: grid; flex: none; gap: 4px; align-self: flex-start; justify-items: start; max-width: min(83%, 35rem); }
.chat-message.outgoing { align-self: flex-end; justify-items: end; }
.chat-bubble { min-width: 0; max-width: 100%; padding: 9px 14px; color: var(--ink); background: #efe8e0; border-radius: 18px; border-end-start-radius: 6px; }
.chat-message.outgoing .chat-bubble { background: var(--accent); color: #fff; border-radius: 18px; border-end-end-radius: 6px; }
.chat-bubble .authored-passage,.chat-bubble .authored-original p { margin: 0; font-size: 15px; line-height: 1.55; text-align: start; }
.chat-bubble .authored-original { margin: 5px 0 0; }
.chat-bubble .authored-original p { margin-top: 3px; }
.chat-message.outgoing .authored-original { color: #fff; }
.chat-message time,.inbox-meta time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chat-message time { padding-inline: 3px; }
.chat-empty { margin: auto; color: var(--muted); text-align: center; padding: 24px 16px; line-height: 1.5; }
.chat-composer,.chat-action { border-block-start: 1px solid var(--line); padding: 12px 16px; }
.chat-action p { margin: 0; font-size: 14px; color: var(--muted); }
.chat-composer { display: flex; align-items: end; gap: 9px; }
.chat-composer textarea { display: block; flex: 1; resize: none; height: 44px; min-height: 44px; max-height: 115px; padding: 10px 16px; border-radius: 22px; font-size: 16px; line-height: 22px; }
.chat-send { display: grid; width: 44px; height: 44px; flex: none; place-items: center; border: 0; border-radius: 50%; color: white; background: var(--accent); }
.chat-send:hover { background: var(--accent-dark); }
.chat-arrow { display: inline-block; width: 3px; height: 18px; position: relative; background: currentColor; border-radius: 2px; }
.chat-arrow::before { content: ""; position: absolute; top: 0; left: -5px; width: 10px; height: 10px; border-top: 3px solid currentColor; border-left: 3px solid currentColor; border-radius: 1px; transform: rotate(45deg); }
.inbox-heading { margin: 4px 0 18px; }
.inbox-heading h1 { margin: 0; font-size: clamp(30px, 4.6vw, 44px); }
.inbox-preview-link { margin-block-start: 12px; }
.chat-list .chat-empty strong { color: var(--ink); }
.chat-list .chat-empty p { margin: 5px auto 0; font-size: 14px; }
.inbox-heading p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.chat-list { margin: 0; padding: 0; list-style: none; }
.chat-list li + li { border-block-start: 1px solid var(--line); }
.inbox-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 18px; text-decoration: none; color: var(--ink); }
.inbox-link:hover,.inbox-link:focus-visible { background: #f5eee6; }
.inbox-link:focus-visible { outline-offset: -3px; }
.inbox-summary,.inbox-meta { display: grid; gap: 4px; min-width: 0; }
.inbox-name { font-size: 16px; }
.inbox-product { font-size: 13px; color: var(--ink); }
.inbox-preview { font-size: 14px; color: var(--muted); }
.inbox-meta { justify-items: end; min-width: 16px; max-width: 10em; }
.inbox-meta time { text-align: end; }
@media (max-width: 880px) {
  .chat-page { margin: 4px auto 0; }
  .chat-panel { height: clamp(270px, calc(100dvh - 215px - env(safe-area-inset-bottom)), 780px); }
}
@media (max-width: 480px) {
  .chat-page { width: 100%; }
  .chat-nav { margin: 0; }
  .chat-panel,.chat-list { border-radius: 16px; }
  .chat-header { padding: 10px 12px; gap: 10px; }
  .chat-header .chat-avatar,.inbox-link .chat-avatar { width: 36px; height: 36px; font-size: 17px; }
  .chat-product { padding: 9px 13px; }
  .chat-feed { padding: 12px 9px; gap: 9px; }
  .chat-message { max-width: 88%; }
  .chat-composer,.chat-action { padding: 8px; }
  .inbox-link { padding: 13px 10px; gap: 8px; }
  .inbox-heading { margin: 3px 0 12px; }
  .inbox-meta { max-width: 5.3em; }
}

@media (max-width: 880px) {
  .chat-keyboarding .chat-page {
    position: fixed;
    z-index: 8;
    top: var(--chat-visible-top, 0px);
    inset-inline: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: var(--chat-visible-height, 100dvh);
    margin: 0;
    padding: 0 6px 4px;
    background: var(--paper);
  }
  .chat-keyboarding .chat-panel { flex: 1; height: auto; min-height: 0; }
  .chat-keyboarding .chat-nav { margin: 0 6px; }
}
[data-chat-pager][hidden], [data-inbox-pager][hidden], [data-chat-older][hidden] { display: none; }
