/* Unified order inbox and platform support. All selectors stay inside msg-* namespace. */
.msg-page { max-width: 1220px; margin: 40px auto 64px; color: var(--ink, #172033); }
.msg-page [hidden] { display: none !important; }
.msg-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.msg-page-head h1 { margin: 0 0 8px; font-size: 1.75rem; line-height: 1.25; font-weight: 650; text-wrap: balance; }
.msg-page-head p { margin: 0; max-width: 65ch; color: var(--muted, #5c6575); line-height: 1.65; }
.msg-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-head-actions > button { min-height: 44px; }
.msg-page .msg-support-cta,.msg-page .msg-primary-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding-inline: 16px; border: 1px solid #d7e0ee; border-radius: 8px; background: white; color: #135bd8; font-weight: 600; text-decoration: none; }
.msg-page .msg-primary-link { border-color: #145de0; background: #1263ed; color: white; }
.msg-tabs { display: flex; gap: 30px; border-bottom: 1px solid var(--line, #e2e6ec); }
.msg-tab { display: inline-flex; align-items: center; min-height: 50px; padding-inline: 6px; border-bottom: 2px solid transparent; color: var(--muted, #5c6575); text-decoration: none; font-size: .9375rem; }
.msg-tab:hover,.msg-tab[aria-current="page"] { color: #135bd8; }
.msg-tab.is-active { border-bottom-color: #1767e8; font-weight: 650; }
.msg-filters { display: flex; align-items: center; gap: 12px; padding: 20px 0 10px; }
.msg-search-label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 150px; min-height: 46px; padding-inline: 12px; border: 1px solid #dce2eb; border-radius: 8px; background: white; }
.msg-search-icon { color: #45546d; font-size: 1.25rem; }
.msg-search-label input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink, #172033); font: inherit; }
.msg-search-label input::placeholder { color: #555f70; opacity: 1; }
.msg-unread-filter { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink, #172033); font-size: .875rem; white-space: nowrap; }
.msg-unread-filter input { width: 18px; height: 18px; accent-color: #1767e8; }
.msg-page .msg-filters > button { min-height: 44px; }
.msg-list { border-top: 1px solid var(--line, #e2e6ec); }
.msg-row { display: grid; grid-template-columns: 48px minmax(0,1fr) auto 16px; align-items: center; gap: 16px; min-height: 112px; padding: 18px 10px; border-bottom: 1px solid var(--line, #e2e6ec); color: inherit; text-decoration: none; transition: background-color 160ms ease; }
.msg-row:hover { background: #f7f9fc; }
.msg-avatar { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid #dce2eb; border-radius: 50%; background: #eef3fa; color: #344765; font-size: 1.125rem; font-weight: 650; }
.msg-ticket-icon { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #dce2eb; border-radius: 12px; color: #185ac8; background: #f4f7fb; }
.msg-row-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.msg-row-title,.msg-row-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; min-width: 0; }
.msg-row-title { justify-content: space-between; }
.msg-row-title strong { overflow: hidden; color: var(--ink, #172033); font-size: .9375rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.msg-row-time,.msg-row-order,.msg-row-meta { color: #515f74; font-size: .8125rem; }
.msg-row-order,.msg-row-summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row-summary { color: #35445c; font-size: .875rem; }
.msg-row-meta { align-items: center; gap: 8px; margin-top: 2px; }
.msg-status { padding: 3px 9px; border-radius: 6px; background: #eff4fa; color: #344969; }
.msg-needs-reply { color: #995700; }
.msg-unread { min-width: 22px; padding: 3px 6px; border-radius: 999px; background: #1767e8; color: white; text-align: center; font-size: .75rem; font-weight: 650; }
.msg-chevron { color: #475974; font-size: 1.3rem; }
.msg-more { display: flex; justify-content: center; padding: 22px 0; }
.msg-more .btn { min-width: 176px; min-height: 44px; }
.msg-footnote { margin: 18px 0 0; color: #515f74; font-size: .8125rem; }
.msg-empty { display: grid; justify-items: center; gap: 10px; min-height: 280px; align-content: center; text-align: center; }
.msg-empty h2 { margin: 0; font-size: 1.125rem; }
.msg-empty p { margin: 0 0 8px; max-width: 48ch; color: #515f74; line-height: 1.7; }
.msg-inline-error { margin: 16px 0; color: #8c2e25; font-size: .875rem; }
.msg-inline-error button { margin-left: 8px; color: inherit; text-decoration: underline; }
.msg-skeleton { display: grid; gap: 18px; padding: 24px 0; }
.msg-skeleton i { display: block; height: 76px; border-radius: 8px; background: linear-gradient(90deg,#f0f2f5,#f8f9fb,#f0f2f5); background-size: 200% 100%; animation: msg-shimmer 1.4s ease-in-out infinite; }
@keyframes msg-shimmer { to { background-position: -200% 0; } }
.msg-back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 16px; color: #145de0; text-decoration: none; }
.msg-support-badge { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 10px; border-radius: 999px; background: #edf4ff; color: #185ac8; font-size: .8125rem; font-weight: 600; }
.msg-support-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(240px,.65fr); gap: 48px; align-items: start; padding-top: 18px; }
.msg-support-form { display: flex; flex-direction: column; gap: 18px; min-width: 0; padding: 26px; border: 1px solid #e1e6ed; border-radius: 12px; background: #fff; }
.msg-support-form h2,.msg-support-aside h2,.msg-ticket-history h2 { margin: 0; font-size: 1.125rem; font-weight: 650; }
.msg-support-form label { display: flex; flex-direction: column; gap: 8px; font-size: .875rem; font-weight: 550; }
.msg-support-form :is(input,select,textarea) { box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd4e0; border-radius: 7px; background: white; color: #172033; font: inherit; }
.msg-support-form textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.msg-support-form :is(input,select,textarea)::placeholder { color: #5b6573; opacity: 1; }
.msg-support-form .btn { min-height: 46px; align-self: flex-start; padding-inline: 22px; }
.msg-support-aside { padding: 20px 0; }
.msg-support-aside p,.msg-guest-note,.msg-history-empty { color: #4e5a6c; font-size: .875rem; line-height: 1.75; }
.msg-support-aside a { display: inline-flex; align-items: center; min-height: 42px; color: #145de0; }
.msg-aside-rule,.msg-safety-note { padding: 12px 14px; border-radius: 8px; background: #f1f5fa; color: #34445e; font-size: .8125rem; line-height: 1.7; }
.msg-safety-note { margin: 0 0 18px; }
.msg-ticket-history { margin-top: 36px; }
.msg-ticket-history h2 { margin-bottom: 8px; }
.msg-support-chat { min-width: 0; }
.msg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.msg-page :is(a,button,input,select,textarea):focus-visible { outline: 2px solid #145de0; outline-offset: 3px; }
.msg-page button:disabled { opacity: .58; cursor: not-allowed; }
.msg-page .order-chat { border-radius: 10px; }
.msg-guest-ticket-card { min-width: 0; padding: 22px; border: 1px solid #e1e6ed; border-radius: 12px; background: #fff; }
.msg-guest-ticket-card h2 { margin: 0 0 16px; font-size: 1.125rem; }
.msg-guest-ticket-card form,.msg-guest-reply { display: flex; flex-direction: column; gap: 14px; }
.msg-guest-ticket-card label,.msg-guest-reply label { display: flex; flex-direction: column; gap: 7px; color: #26354b; font-size: .875rem; font-weight: 550; }
.msg-guest-ticket-card :is(input,select,textarea),.msg-guest-reply textarea { box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd4e0; border-radius: 7px; background: #fff; color: #172033; font: inherit; }
.msg-guest-ticket-card textarea,.msg-guest-reply textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.msg-guest-ticket-card button,.msg-guest-reply button { align-self: flex-start; min-height: 44px; padding-inline: 20px; }
.msg-guest-thread { display: grid; gap: 12px; max-width: 800px; margin: 20px 0; }
.msg-guest-message { padding: 14px 16px; border: 1px solid #dfe5ed; border-radius: 10px; background: #f5f7fa; }
.msg-guest-message.is-support { border-color: #d1e2ff; background: #eef5ff; }
.msg-guest-message header { display: flex; justify-content: space-between; gap: 12px; color: #44536a; font-size: .8125rem; }
.msg-guest-message p { margin: 10px 0 0; color: #1f2c40; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-guest-clear { margin-top: 18px; color: #5b3440; }
@media (max-width: 760px) {
  .msg-page { margin: 22px 16px 40px; }
  .msg-page-head { align-items: center; gap: 10px; margin-bottom: 20px; }
  .msg-page-head h1 { font-size: 1.5rem; }
  .msg-page-head p { font-size: .875rem; }
  .msg-head-actions { justify-content: flex-end; }
  .msg-page .msg-support-cta { min-height: 42px; padding-inline: 10px; font-size: .8125rem; white-space: nowrap; }
  .msg-tabs { gap: 18px; }
  .msg-tab { flex: 1; justify-content: center; min-height: 48px; padding-inline: 2px; font-size: .875rem; }
  .msg-filters { flex-wrap: wrap; gap: 8px; padding-top: 14px; }
  .msg-search-label { flex-basis: 100%; }
  .msg-unread-filter { flex: 1; }
  .msg-row { grid-template-columns: 42px minmax(0,1fr) auto 10px; gap: 10px; min-height: 102px; padding: 14px 2px; }
  .msg-avatar,.msg-ticket-icon { width: 40px; height: 40px; }
  .msg-row-title strong { max-width: calc(100% - 72px); }
  .msg-row-meta { font-size: .75rem; }
  .msg-support-layout { grid-template-columns: minmax(0,1fr); gap: 18px; padding-top: 4px; }
  .msg-support-form { padding: 18px 14px; gap: 16px; }
  .msg-support-aside { padding: 8px 2px; }
  .msg-safety-note { margin-bottom: 14px; }
  .msg-guest-ticket-card { padding: 17px 14px; }
  .msg-guest-message { padding: 12px; }
}
@media (max-width: 420px) {
  .msg-page-head { align-items: stretch; flex-direction: column; }
  .msg-head-actions { justify-content: flex-start; }
  .msg-head-actions > * { flex: 0 1 auto; }
  .msg-page .msg-support-cta { white-space: normal; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .msg-row,.msg-skeleton i { transition: none; animation: none; } }
