/* Stay Collective Phone app — SC design language (greens/gold/cream),
   responsive desktop + mobile. */

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  background: linear-gradient(135deg, #f6f2e8 0%, #edf5ef 100%);
  color: #173c2c;
}

.shell {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 40px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; }

.mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #1b4332;
  color: #d4a853;
  display: grid;
  place-items: center;
  font-family: 'Public Sans', sans-serif;
  font-weight: 800;
}

.brand-name { font-family: 'Public Sans', sans-serif; font-weight: 800; }
.brand-sub { color: #66766d; font-size: 0.85rem; }

/* ===== App picker (sc-20260908-phone-responsive-picker) =====
   Mirrors the established dashboard app picker: same destinations, same
   open/outside-click/Escape/focus behavior. */

.app-picker-anchor { position: relative; }

.mark.app-picker-button {
  position: relative;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: 1rem;
}

.mark.app-picker-button:hover,
.mark.app-picker-button:focus-visible,
.mark.app-picker-button[aria-expanded="true"] {
  background: #25523f;
  outline: 2px solid rgba(212, 168, 83, 0.7);
  outline-offset: 2px;
}

.picker-chevron {
  position: absolute;
  right: 5px;
  bottom: 6px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #d4a853;
}

.app-picker-button[aria-expanded="true"] .picker-chevron { transform: rotate(180deg); }

.app-picker-popover {
  position: absolute;
  top: 50px;
  left: 0;
  z-index: 5000;
  width: min(340px, calc(100vw - 32px));
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(27, 67, 50, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.20);
}

.app-picker-popover[hidden] { display: none; }

.app-picker-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 2px 2px 10px;
}

.app-picker-title { color: #1b4332; font-size: 13px; font-weight: 900; }

.app-picker-close {
  width: 32px;
  height: 32px;
  border: 1px solid #ddd8ca;
  border-radius: 8px;
  background: #fff;
  color: #6b6f66;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.app-picker-close:hover,
.app-picker-close:focus-visible {
  color: #1b4332;
  border-color: rgba(27, 67, 50, 0.24);
  outline: 2px solid rgba(27, 67, 50, 0.12);
}

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

.app-picker-tile {
  min-height: 86px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 10px 6px;
  border: 1px solid rgba(27, 67, 50, 0.10);
  border-radius: 12px;
  background: #fbfaf6;
  color: #1a1a1a;
  text-align: center;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
}

.app-picker-tile:hover,
.app-picker-tile:focus-visible {
  background: #fff8e6;
  border-color: rgba(212, 168, 83, 0.55);
  color: #1b4332;
  outline: 2px solid rgba(212, 168, 83, 0.24);
}

.app-picker-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #edf5ef;
  color: inherit;
  font-size: 20px;
  line-height: 1;
}

.app-picker-tile.current { border-color: rgba(27, 67, 50, 0.35); }
.app-picker-tile.current .app-picker-icon { background: #fff4d7; }

.app-picker-footer {
  display: block;
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #f5f4ef;
  color: #1b4332;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.app-picker-footer:hover,
.app-picker-footer:focus-visible {
  background: #eee8d8;
  outline: 2px solid rgba(27, 67, 50, 0.12);
}

.user { display: flex; align-items: center; gap: 8px; color: #66766d; font-size: 0.95rem; flex-wrap: wrap; }

.logout, .install {
  border: 0;
  background: #1b4332;
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  cursor: pointer;
}
.install { display: none; background: #d4a853; color: #173c2c; }
.install.visible { display: inline-flex; }

.phone-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(27, 67, 50, 0.14);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(21, 55, 40, 0.09);
  padding: 22px 22px 18px;
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.phone-card h1 {
  font-family: 'Public Sans', sans-serif;
  font-size: 1.5rem;
  margin: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f3f4f6;
  font-weight: 700;
  font-size: 0.85rem;
  color: #4b5563;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9ca3af;
}

.status-pill[data-state="ready"] { background: #e8f3ec; color: #1b4332; }
.status-pill[data-state="ready"] .status-dot { background: #1b4332; }
.status-pill[data-state="connected"],
.status-pill[data-state="muted"] { background: #e8f3ec; color: #1b4332; }
.status-pill[data-state="connected"] .status-dot,
.status-pill[data-state="muted"] .status-dot { background: #1b4332; }
.status-pill[data-state="connecting"],
.status-pill[data-state="ringing"] { background: #fdf3e0; color: #b8842f; }
.status-pill[data-state="connecting"] .status-dot,
.status-pill[data-state="ringing"] .status-dot { background: #d4a853; }
.status-pill[data-state="error"],
.status-pill[data-state="permission-denied"] { background: #fef2f2; color: #b91c1c; }
.status-pill[data-state="error"] .status-dot,
.status-pill[data-state="permission-denied"] .status-dot { background: #b91c1c; }

.phone-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
}

.phone-diag {
  color: #66766d;
  font-size: 12px;
  margin: 6px 0 0;
}

.phone-incoming {
  border: 1px solid rgba(27, 67, 50, 0.25);
  border-radius: 10px;
  padding: 12px;
  margin: 14px 0;
  background: #f0fdf4;
}
.phone-incoming-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #374151;
  margin: 0;
}
.phone-incoming-from { font-size: 18px; font-weight: 700; margin: 4px 0 10px; }

.phone-incoming-actions, .phone-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.btn-primary, .btn-secondary {
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 800;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: #1b4332; color: #fff; }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }
.btn-secondary { background: #fff; border-color: rgba(27, 67, 50, 0.25); color: #173c2c; }
.btn-secondary:disabled { color: #9ca3af; border-color: #e5e7eb; cursor: not-allowed; }
.phone-hangup { color: #b91c1c; border-color: #fecaca; }
.phone-hangup:disabled { color: #9ca3af; border-color: #e5e7eb; }

.phone-label { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 4px; }
.phone-dest {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 17px;
  padding: 12px;
  font-family: inherit;
}
.phone-dest:focus-visible { outline: 2px solid #1b4332; outline-offset: 1px; }
.phone-hint { color: #66766d; font-size: 12px; margin: 6px 0 12px; }

.phone-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0 8px;
}
.phone-key {
  border: 1px solid rgba(27, 67, 50, 0.14);
  border-radius: 10px;
  background: #fafaf8;
  font-size: 19px;
  font-weight: 700;
  font-family: inherit;
  color: #173c2c;
  padding: 12px 0;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.phone-key:hover { background: #edf5ef; }
.phone-key:focus-visible { outline: 2px solid #1b4332; outline-offset: 2px; }
.phone-key-sub { font-size: 10px; color: #9ca3af; letter-spacing: 0.08em; }

.phone-footnote { color: #66766d; font-size: 12px; margin-top: 14px; }

/* ===== Login ===== */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.login-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(27, 67, 50, 0.14);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(21, 55, 40, 0.09);
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.login-brand { margin-bottom: 12px; }
.login-logo { width: 72px; height: 72px; border-radius: 16px; }
.login-heading { font-family: 'Public Sans', sans-serif; margin: 0 0 6px; }
.login-subtitle { color: #66766d; margin: 0 0 20px; }
.google-login-section { display: grid; justify-items: center; gap: 12px; }
.error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  padding: 8px 12px;
  font-size: 13px;
}
.domain-note { color: #66766d; font-size: 12px; margin: 4px 0 0; }
.login-help { color: #66766d; font-size: 13px; margin: 14px 0 0; }
.login-help a { color: #1b4332; font-weight: 700; }

/* --- sc-20260908-phone-desk-features: staff access + communication views --- */

.activation-banner {
  background: #fdf3d7;
  border: 1px solid #e5cf8f;
  border-radius: 10px;
  color: #6b4e12;
  padding: 10px 14px;
  font-weight: 700;
  margin: 12px 0 4px;
}

.calling-from {
  font-weight: 800;
  color: #1b4332;
  margin: 10px 0 2px;
}

.reservations-line {
  color: #66766d;
  font-size: 0.85rem;
  margin: 0 0 8px;
}

/* ===== Fluid workspace (sc-20260908-phone-responsive-picker) =====
   Desktop: left sidebar navigation + bounded dialer beside expansive
   communication content. Tablet/mobile: navigation collapses to a
   horizontal tab bar near the top; cards stack. */

.workspace {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.side-nav {
  flex: 0 0 208px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.side-nav .comms-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}

.side-nav .comms-tabs button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(27, 67, 50, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  color: #173c2c;
  font-weight: 800;
  font-size: 0.98rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.side-nav .comms-tabs button:hover { background: #fff; border-color: rgba(27, 67, 50, 0.3); }
.side-nav .comms-tabs button:focus-visible { outline: 2px solid #1b4332; outline-offset: 2px; }

.side-nav .comms-tabs button[aria-selected="true"] {
  background: #1b4332;
  border-color: #1b4332;
  color: #fff;
}

.tab-icon { font-size: 1.1rem; line-height: 1; }

.workarea {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.workarea .phone-card {
  flex: 0 1 420px;
  margin: 0;
}

.workarea .comms-card {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  max-width: none;
}

.comms-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(27, 67, 50, 0.14);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(21, 55, 40, 0.09);
  padding: 18px;
  width: 100%;
}

.comms-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.comms-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  border: 1px solid rgba(27, 67, 50, 0.10);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 0;
}

.comms-cell { min-width: 0; }
.comms-dir { font-weight: 800; color: #1b4332; }
.comms-main { font-weight: 700; overflow-wrap: anywhere; }
.comms-meta { color: #66766d; font-size: 0.85rem; overflow-wrap: anywhere; }
.comms-when { color: #66766d; font-size: 0.85rem; margin-left: auto; overflow-wrap: anywhere; }

.comms-transcript {
  flex-basis: 100%;
  margin: 4px 0 0;
  color: #173c2c;
  font-size: 0.92rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.comms-play {
  border: 0;
  background: #d4a853;
  color: #173c2c;
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 800;
  cursor: pointer;
}
.comms-play:disabled { opacity: 0.6; cursor: default; }

.comms-state { color: #66766d; font-size: 0.9rem; }
.comms-note { color: #66766d; font-size: 0.85rem; margin-top: 0; }

.comms-more { margin-top: 12px; }

#voicemailPlayer { width: 100%; margin-bottom: 12px; }

.install-note {
  max-width: 720px;
  margin: 16px auto 0;
  color: #66766d;
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 560px) {
  .comms-when { margin-left: 0; flex-basis: 100%; }
}

/* ===== Responsive (sc-20260908-phone-responsive-picker) =====
   Kept last so media rules override the workspace base rules above.
   >= 1100px: sidebar + two-column workarea (dialer bounded, comms expansive).
   900–1099px: horizontal tab bar near the top; workarea stays two-column.
   < 900px: tab bar on top; dialer and comms stack full-width.
   < 620px: compact mobile spacing, scrollable tab bar, larger key targets. */
@media (max-width: 1099px) {
  .workspace { flex-direction: column; }
  .side-nav {
    flex: none;
    width: 100%;
    position: static;
    max-height: none;
    overflow: visible;
  }
  .side-nav .comms-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .side-nav .comms-tabs button {
    width: auto;
    flex: 1 1 140px;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 899px) {
  .workarea { flex-direction: column; }
  .workarea .phone-card {
    flex: none;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
  }
  .workarea .comms-card { flex: none; width: 100%; }
}

@media (max-width: 620px) {
  .shell { padding: 16px 12px 32px; }
  .top { align-items: flex-start; }
  .workspace, .workarea { gap: 14px; }
  .phone-card { padding: 18px 14px 14px; }
  .status-row { flex-direction: column; align-items: flex-start; }
  .phone-actions .btn-primary,
  .phone-actions .btn-secondary { flex: 1 1 46%; }
  .phone-key { padding: 14px 0; min-height: 52px; }
  .side-nav .comms-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .side-nav .comms-tabs button {
    flex: 1 0 auto;
    min-width: 96px;
    min-height: 44px;
  }
  .app-picker-popover { left: -8px; }
}

/* Keep the reply controls visible while only the message history scrolls. */
.text-conversation { box-sizing: border-box; width: min(680px, calc(100% - 24px)); height: min(760px, calc(100dvh - 24px)); max-height: calc(100dvh - 24px); padding: 16px; border: 0; border-radius: 16px; color: #1b4332; }
dialog.text-conversation:not(.text-compose) { width: calc(100% - 24px); height: calc(var(--phone-viewport-height, 100dvh) - 24px); max-height: calc(var(--phone-viewport-height, 100dvh) - 24px); }
.text-conversation[open] { display: flex; flex-direction: column; gap: 10px; }
.text-conversation::backdrop { background: #0008; }
.text-conversation h2 { font-size: 16px; margin: 0; overflow-wrap: anywhere; }
.text-conversation > button { align-self: flex-end; }
.text-conversation > p { margin: 0; }
.text-history { flex: 1; min-height: 0; overflow-y: auto; }
.text-bubble { background: #f0f2f1; padding: 10px; margin: 8px 30px 8px 0; border-radius: 10px; overflow-wrap: anywhere; white-space: pre-wrap; }
.text-bubble p { margin: 0 0 4px; }
.text-bubble.outbound { background: #d9eee1; margin: 8px 0 8px 30px; }
.text-reply { display: flex; gap: 8px; flex-shrink: 0; }
.text-reply[hidden] { display: none; }
.text-reply textarea { min-width: 0; flex: 1; resize: none; font: inherit; height: 68px; }
.text-reply button { min-height: 44px; flex-shrink: 0; }

.text-reply { flex-wrap: wrap; }
.text-reply > p { flex-basis: 100%; margin: 0; font-size: 14px; }
.text-compose form { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.text-compose textarea { box-sizing: border-box; width: 100%; min-height: 100px; font: inherit; resize: vertical; }
.text-compose form > button { align-self: flex-end; min-height: 44px; }
@media (max-width: 899px) {
  .workarea:has(#tab-texts:not([hidden])) .comms-card { order: -1; }
}

.phone-identity-type { font-size: .8em; font-weight: 400; color: #52675a; }
.compose-recipient { overflow-wrap: anywhere; }
.compose-recipient:empty { display: none; }

/* Approved grouped-by-number conversations, using the existing Phone palette. */
#groupedConversations > h2 { margin: 0 0 4px; font-size: 24px; }
#groupedConversations > .btn-primary { margin: 8px 0 16px; }
.conversation-row { border: 1px solid #dfe6e1; border-radius: 14px; padding: 16px; margin-bottom: 10px; min-width: 0; }
.conversation-row.unread { border-color: #d5a94e; background: #fffdf5; }
.conversation-open { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px 12px; text-align: left; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; min-width: 0; }
.conversation-open strong { overflow-wrap: anywhere; min-width: 0; font-size: 18px; }
.conversation-open time { color: #667b70; font-size: 13px; white-space: nowrap; }
.conversation-open p { grid-column: 1 / -1; margin: 0; min-width: 0; }
.conversation-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.conversation-counts span { border-radius: 20px; padding: 3px 8px; background: #eef3ef; font-size: 13px; }
.conversation-counts .missed { color: #ba2831; background: #fff2f3; }
.conversation-counts .unread-count { background: #d5a94e; color: #1b4332; }
.conversation-row .comms-note { overflow-wrap: anywhere; }
.spam-reason { color: #906311; font-size: 14px; overflow-wrap: anywhere; }
#spamCount { display: inline-block; min-width: 18px; padding: 1px 5px; border-radius: 12px; background: #edf3ee; color: #1b4332; }
.grouped-timeline { display: flex; flex-direction: column; gap: 12px; width: 100%; height: auto; max-height: none; padding: 0; }
.grouped-timeline .text-history { flex: none; height: min(38vh,340px); min-height: 180px; }
.grouped-timeline .text-reply { flex-shrink: 0; }
.grouped-timeline .text-reply textarea { min-width: 0; }
.timeline-day { text-align: center; color: #667b70; font-size: 13px; }
.timeline-event { border: 1px dashed #c6d2ca; border-radius: 12px; padding: 12px; margin: 8px 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.timeline-event button { margin-left: 10px; }
@media (max-width: 899px) { .workarea:has(#groupedConversations) .comms-card { order: -1; } }
@media (max-width: 620px) {
 .side-nav .comms-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
 .side-nav .comms-tabs button { flex: 1 1 28%; min-width: 0; padding: 10px 5px; font-size: 13px; gap: 5px; }
 .side-nav .comms-tabs .tab-icon { font-size: 16px; }
 .side-nav .comms-tabs button:last-child { flex-grow: 1; }
 .conversation-row { padding: 12px; }
 .conversation-open strong { font-size: 16px; }
 .grouped-timeline h2 { overflow-wrap: anywhere; }
 .grouped-timeline .text-bubble { max-width: 92%; overflow-wrap: anywhere; }
}
.conversation-header { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: center; }
.conversation-header h2 { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 620px) {
 .conversation-header { grid-template-columns: 1fr 1fr; }
 .conversation-header h2 { grid-column: 1 / -1; grid-row: 2; }
 .conversation-header > button { justify-self: start; }
 .conversation-header > button:last-child { justify-self: end; }
}


/* Keep conversation controls in the viewport; very short windows fall back to page scrolling. */
.shell { --phone-card-height: max(380px, calc(var(--phone-viewport-height, 100dvh) - var(--phone-card-top, 90px) - 16px)); }
.workarea .comms-card { height: var(--phone-card-height); display: flex; flex-direction: column; min-height: 0; }
.workarea .phone-card { max-height: var(--phone-card-height); overflow-y: auto; }
#groupedConversations:not([hidden]) { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.conversation-results { flex: 1; min-height: 0; overflow-y: auto; }
.grouped-timeline { flex: 1; min-height: 0; }
.grouped-timeline .text-history { flex: 1; height: auto; min-height: 0; }
.text-history { width: 100%; max-width: 1040px; margin-inline: auto; overscroll-behavior: contain; overflow-anchor: none; }
.text-bubble { width: fit-content; max-width: min(72%, 640px); margin-right: auto; }
.text-bubble.outbound { margin-left: auto; }
.text-conversation > :not(.text-history-frame) { flex-shrink: 0; }
.text-conversation > p:empty { display: none; }
.conversation-header button { min-height: 44px; }
@media (max-width: 899px) {
 .workarea .phone-card { max-height: none; overflow: visible; }
}
@media (max-width: 620px) {
 .text-bubble, .grouped-timeline .text-bubble { max-width: 92%; }
 .conversation-header { grid-template-columns: auto minmax(0,1fr) auto; gap: 8px; }
 .conversation-header h2 { grid-column: auto; grid-row: auto; }
}
@media (max-width: 1099px) { .workarea { width: 100%; } }

.text-history-frame { position: relative; display: flex; flex: 1; min-height: 160px; }
.text-history-frame .text-history { padding-bottom: 64px; }
.new-message-status { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; pointer-events: none; }
.new-message-marker { pointer-events: auto; min-height: 44px; max-width: calc(100% - 24px); padding: 10px 18px; border: 1px solid #1b4332; border-radius: 999px; background: #d5a94e; color: #1b4332; font: inherit; font-weight: 800; box-shadow: 0 2px 8px #173c2c26; cursor: pointer; }
.new-message-marker[hidden] { display: none; }
.new-message-marker:focus-visible { outline: 2px solid #1b4332; outline-offset: 2px; }
#groupedConversations > .btn-primary { align-self: flex-start; }
.comms-card button, .text-conversation:not(.text-compose) button { min-height: 44px; }
