/* Reading takes priority. The message and editor share one scroll container. */
.topbar { height: 48px; }
.inbox-page { padding: 15px 22px 10px; gap: 12px; }
.inbox-page > .heading { flex: 0 0 auto; }
.inbox-page > .heading h1 { font-size: 21px; margin-bottom: 4px; }
.inbox-page > .heading p { font-size: 11px; }
.inbox-page > .metrics { flex: 0 0 auto; gap: 8px; }
.inbox-page .metric { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border-radius: 8px; }
.inbox-page .metric-label { font-size: 11px; }
.inbox-page .metric-row { margin-top: 0; margin-left: auto; }
.inbox-page .metric-value { font-size: 21px; }
.inbox-page .metric-hint, .inbox-page .metric-icon { display: none; }
.inbox-page > .page-footer { flex: 0 0 auto; }
.inbox { grid-template-columns: 290px minmax(0, 1fr); }
.detail { overflow: hidden; }
.detail-header { flex: 0 0 auto; padding: 10px 19px 12px; }
.detail-eyebrow { margin-bottom: 4px; }
.detail-header h2 { font-size: 17px; line-height: 1.5; margin-bottom: 8px; overflow-wrap: anywhere; }
.detail-eyebrow .btn { font-size: 11px; }
.thread-layout { overflow: hidden; }
.thread-main { overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.messages { flex: 0 0 auto; overflow: visible; padding: 16px 22px 8px; }
.reading-label { font-size: 11px; color: #52755f; font-weight: 650; letter-spacing: .5px; margin-bottom: 17px; }
.message { margin-bottom: 22px; }
.message-head { align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.message-head > div { min-width: 0; }
.message-head .sender { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.message-head .sub { font-size: 11px; }
.message-head time { flex-shrink: 0; padding-top: 4px; font-size: 10px; }
.message .body { font-size: 14px; line-height: 1.9; padding-left: 0; color: #374b40; }
.message.note .body { font-size: 12px; }
.message.outbound { padding: 16px; }
.thread-history { margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.thread-history > summary { cursor: pointer; padding: 1px 0 13px; color: #73846d; font-size: 12px; line-height: 1.7; }
.thread-history > summary span { float: right; font-size: 10px; color: #899781; }
.thread-history > summary:focus-visible { outline: 2px solid #82a895; outline-offset: 3px; }
.history-messages { padding: 12px 0 1px; }
.composer { flex: 0 0 auto; padding: 10px 20px 13px; margin-top: auto; background: #fff; }
.composer.is-collapsed { position: sticky; bottom: 0; border-top: 1px solid var(--line); }
.composer.is-open { position: static; margin-top: 0; }
.reply-launcher { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reply-launcher .btn { font-size: 12px; padding: 9px 12px; }
.reply-launcher .demo-incoming { margin-left: auto; font-size: 10px; }
.compose-tabs { padding: 6px 10px; gap: 5px; }
.compose-tabs > div { display: flex; flex-shrink: 0; }
.compose-tabs .from { margin-left: auto; font-size: 10px; }
.compose-tabs > .icon-btn { min-width: 28px; min-height: 28px; }
.compose-box textarea { height: clamp(90px, 17vh, 150px); min-height: 80px; max-height: 35vh; font-size: 14px; line-height: 1.8; }
.compose-footer { padding: 7px 10px; }
.compose-footer .hint { font-size: 10px; }
.compose-footer .btn { font-size: 12px; }
.compose-notice { margin: 7px 0 0; }
.context-panel { width: 190px; padding: 17px 14px; }
.context-section { margin-top: 18px; }
.context-customer { margin-bottom: 15px; }
.reader-focus .inbox-page > .heading,
.reader-focus .inbox-page > .metrics,
.reader-focus .inbox-page > .page-footer { display: none; }
.reader-focus .inbox { grid-template-columns: minmax(0, 1fr); }
.reader-focus .inbox-list, .reader-focus .context-panel { display: none; }
.reader-focus .messages { width: 100%; max-width: 980px; margin-inline: auto; padding: 22px 32px; }
.reader-focus .composer { width: 100%; max-width: 980px; margin-inline: auto; }
.reader-focus .detail-header { padding-inline: 25px; }
@media (max-width: 1150px) {
  .context-panel { display: none; }
  .inbox { grid-template-columns: 265px minmax(0, 1fr); }
  .inbox-page { padding-inline: 14px; }
}
@media (max-height: 740px) and (min-width: 721px) {
  .show-detail .inbox-page > .heading p, .show-detail .inbox-page > .page-footer { display: none; }
  .show-detail .inbox-page > .heading h1 { margin-bottom: 0; font-size: 18px; }
  .show-detail .inbox-page > .heading .btn { padding: 7px 10px; }
  .inbox-page { padding-block: 10px; gap: 8px; }
  .detail-header { padding-block: 7px 9px; }
}
@media (max-width: 720px) {
  .topbar { height: 43px; padding-inline: 12px; }
  .inbox-page { padding: 12px 10px 6px; gap: 10px; }
  .inbox-page .metric { padding: 9px 7px; flex-direction: column; gap: 6px; }
  .inbox-page .metric-row { margin: 0; }
  .inbox-page .metric-label { font-size: 9px; }
  .show-detail .inbox-page { padding: 5px 6px; }
  .detail-header, .reader-focus .detail-header { padding: 7px 12px 10px; }
  .detail-header h2 { font-size: 15px; line-height: 1.5; margin-bottom: 6px; }
  .detail-header .reader-toggle { display: none; }
  .detail-header .case-number { font-size: 9px; }
  .detail-eyebrow { margin-bottom: 2px; }
  .detail-meta .small { font-size: 10px; }
  .messages, .reader-focus .messages { padding: 15px 14px 5px; }
  .thread-history > summary span { display: none; }
  .message-head .sender { font-size: 12px; }
  .message-head .sub { font-size: 10px; }
  .message-head time { font-size: 9px; }
  .message .body { font-size: 14px; line-height: 1.85; }
  .message-head .avatar { width: 28px; height: 28px; }
  .composer { padding: 9px 12px; }
  .reply-launcher { gap: 6px; }
  .reply-launcher .btn { font-size: 11px; padding: 9px 10px; }
  .reply-launcher .demo-incoming { font-size: 9px; padding-inline: 4px; }
  .compose-tabs .from { display: none; }
  .compose-tabs > .icon-btn { margin-left: auto; }
  .compose-box textarea { font-size: 16px; height: 120px; max-height: 40vh; }
  .compose-footer .hint { font-size: 9px; max-width: 130px; }
  .sidebar { height: 58px; }
}
@media (max-height: 480px) {
  .show-detail .inbox-page > .heading, .show-detail .inbox-page > .metrics { display: none; }
  .topbar { height: 35px; }
  .detail-header { padding-block: 3px 7px; }
  .detail-header h2 { margin: 0 0 4px; font-size: 14px; }
  .detail-header .detail-eyebrow { margin: 0; }
}
