/* Messages page only. Loaded last, unlayered, so these rules beat the
   layered legacy sheets (including @layer screens) without !important.
   Every selector is scoped to body.route-messages. Other routes, including
   Ask session tabs that share .ty-tab, are untouched.

   Palette matches customers-refine.css. The unread dot stays #2196F3.
   Sent bubbles and the send button use --msg-sent-blue (#156FD2).
   Weights are Satoshi 400 / 500 / 700. 700 is the unread name. */

html body.route-messages {
  --msg-canvas: #171818;
  --msg-page: #1A1B1B;
  --msg-card: #1F2121;
  --msg-raised: #252727;
  --msg-hover: #2B2D2D;
  --msg-border: #2F3232;
  --msg-border-strong: #3B3E3E;
  --msg-text: #ECEDEC;
  --msg-text-2: #A6ABAB;
  --msg-text-3: #7A7F7F;
  --msg-accent: #2196F3;
  --msg-sent-blue: #156FD2;
  font-family: "Satoshi", system-ui, sans-serif;
}

html body.route-messages #main,
html body.route-messages #main-content,
html body.route-messages .main-content,
html body.route-messages .msg-view,
html body.route-messages .msg-split,
html body.route-messages .msg-right-pane,
html body.route-messages .msg-thread-pane,
html body.route-messages .msg-bubble-stream {
  background: var(--msg-page);
  background-image: none;
  color: var(--msg-text);
  box-shadow: none;
}

html body.route-messages aside.sidebar#sidebar .sidebar-quick-item.active {
  background: var(--msg-hover);
  background-image: none;
  color: var(--msg-text);
  box-shadow: none;
}

html body.route-messages aside.sidebar#sidebar .sidebar-quick-item.active .sqi-icon,
html body.route-messages aside.sidebar#sidebar .sidebar-quick-item.active .sqi-label {
  background: transparent;
  background-image: none;
  color: var(--msg-text);
  font-weight: 500;
}

html body.route-messages .footer-org-tier-badge {
  background: transparent;
  background-image: none;
  color: var(--msg-text-3);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: auto;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

/* Same rounded pills as Ask. #218 flattened these to plain text. */
html body.route-messages .msg-view > .msg-tabs-bar,
html body.route-messages .msg-view > .msg-tabs-bar.ty-agent-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--msg-border);
  border-radius: 0;
  background: var(--msg-page);
  background-image: none;
  box-shadow: none;
  overflow: hidden;
}

html body.route-messages .msg-tabs-bar .ty-session-scroller {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
}

html body.route-messages .msg-tab,
html body.route-messages .ty-agent-tabs .msg-tab,
html body.route-messages .ty-agent-tabs .msg-tab.ty-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  min-height: 32px;
  max-width: 280px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--msg-border);
  border-radius: 999px;
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: var(--msg-text-2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
}

html body.route-messages .msg-tab:hover,
html body.route-messages .ty-agent-tabs .msg-tab:hover {
  background: var(--msg-hover);
  border-color: var(--msg-border);
  color: var(--msg-text);
}

html body.route-messages .msg-tab.is-active,
html body.route-messages .ty-agent-tabs .msg-tab.is-active,
html body.route-messages .ty-agent-tabs .msg-tab.ty-tab.is-active {
  background: var(--msg-raised);
  background-image: none;
  border-color: var(--msg-border);
  color: var(--msg-text);
  font-weight: 500;
  box-shadow: none;
}

html body.route-messages .msg-tab:focus,
html body.route-messages .msg-tab-add:focus,
html body.route-messages .msg-tab-dashboard:focus {
  outline: none;
}

html body.route-messages .msg-tab:focus-visible,
html body.route-messages .msg-tab-add:focus-visible,
html body.route-messages .msg-tab-dashboard:focus-visible {
  outline: 1px solid var(--msg-border-strong);
  outline-offset: 2px;
}

html body.route-messages .msg-tab > svg,
html body.route-messages .msg-tab-dashboard > svg {
  display: none;
}

html body.route-messages .msg-tab-label,
html body.route-messages .msg-tab > span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: inherit;
}

html body.route-messages .msg-tab-settings {
  width: 20px;
  height: 20px;
  margin-left: 2px;
  border-radius: 6px;
  background: transparent;
  color: var(--msg-text-3);
}

html body.route-messages .msg-tab.is-active .msg-tab-settings,
html body.route-messages .msg-tab-settings:hover {
  background: transparent;
  color: var(--msg-text-2);
}

html body.route-messages .msg-tab-add,
html body.route-messages .ty-agent-tabs .msg-tab-add {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--msg-border);
  border-radius: 999px;
  background: transparent;
  color: var(--msg-text-2);
  font-size: 16px;
  font-weight: 500;
  box-shadow: none;
}

html body.route-messages .msg-tab-add:hover {
  background: var(--msg-hover);
  border-color: var(--msg-border);
  color: var(--msg-text);
}

html body.route-messages .msg-tab-dashboard {
  display: inline-flex;
  align-items: center;
  height: 32px;
  margin-left: auto;
  padding: 0 14px;
  border: 1px solid var(--msg-border);
  border-radius: 999px;
  background: transparent;
  color: var(--msg-text-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

html body.route-messages .msg-tab-dashboard:hover {
  background: var(--msg-hover);
  color: var(--msg-text);
}

/* The list and the conversation fill the viewport. shell.css reserves
   88px under non-Ask pages for the floating Ask pill, and a 100vh
   frame sits taller than the visible 100dvh, so both columns stopped
   short of the bottom. One small inset, plus the iOS safe area. */
@media (min-width: 821px) {
  html body.route-messages {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  html body.route-messages #main.main {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  html body.route-messages #main-content,
  html body.route-messages .main-content,
  html body.route-messages main#main-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    max-height: 100%;
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
  }

  html body.route-messages .msg-view {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: hidden;
  }

  html body.route-messages .msg-split.msg-split-2col {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    flex: 1 1 auto;
    align-items: stretch;
    gap: 0;
    min-height: 0;
    height: auto;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)) 0;
    box-sizing: border-box;
    background: var(--msg-page);
    overflow: hidden;
  }

  html body.route-messages .msg-left-pane {
    display: flex;
    flex-direction: column;
    width: auto;
    height: auto;
    min-height: 0;
    align-self: stretch;
    margin: 0 0 0 12px;
    border: 1px solid var(--msg-border);
    border-radius: 10px;
    background: var(--msg-card);
    background-image: none;
    box-shadow: none;
    overflow: hidden;
  }

  html body.route-messages .msg-thread-pane,
  html body.route-messages .msg-right-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  html body.route-messages .msg-bubble-stream {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }

  html body.route-messages .msg-composer {
    flex: 0 0 auto;
    margin: 0 12px 0;
  }
}

html body.route-messages .msg-left-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

html body.route-messages .msg-left-header,
html body.route-messages .msg-left-scroll,
html body.route-messages .msg-threads-list {
  background: transparent;
  background-image: none;
  box-shadow: none;
}

html body.route-messages .msg-left-header {
  border: 0;
  border-bottom: 1px solid var(--msg-border);
  padding: 12px;
}

html body.route-messages .msg-search {
  height: 40px;
  border-radius: 6px;
  border: 1px solid var(--msg-border);
  background: var(--msg-raised);
  background-image: none;
  color: var(--msg-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  box-shadow: none;
}

html body.route-messages .msg-search::placeholder {
  color: var(--msg-text-3);
  font-weight: 400;
}

html body.route-messages .msg-search:focus {
  border-color: var(--msg-border-strong);
  outline: none;
  box-shadow: none;
}

html body.route-messages .msg-search-icon,
html body.route-messages .msg-filter-toggle,
html body.route-messages .msg-compose-btn {
  color: var(--msg-text-3);
  background: transparent;
  background-image: none;
  box-shadow: none;
}

html body.route-messages .msg-filter-toggle,
html body.route-messages .msg-compose-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
}

html body.route-messages .msg-filter-toggle:hover,
html body.route-messages .msg-filter-toggle[aria-expanded="true"],
html body.route-messages .msg-compose-btn:hover {
  background: var(--msg-hover);
  color: var(--msg-text);
}

html body.route-messages .msg-select-chip,
html body.route-messages .msg-range-custom-pop {
  border: 1px solid var(--msg-border);
  border-radius: 6px;
  background: var(--msg-card);
  color: var(--msg-text-2);
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
}

html body.route-messages .msg-thread-row,
html[data-app-theme="dark"] body.route-messages .msg-thread-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin: 0;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--msg-border);
  border-radius: 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: var(--msg-text);
  text-decoration: none;
}

html body.route-messages .msg-threads-list .msg-thread-row:last-child {
  border-bottom: 0;
}

html body.route-messages .msg-thread-row:hover,
html[data-app-theme="dark"] body.route-messages .msg-thread-row:hover,
html body.route-messages .msg-thread-row.is-active,
html[data-app-theme="dark"] body.route-messages .msg-thread-row.is-active {
  background: var(--msg-hover);
  background-image: none;
  box-shadow: none;
}

html body.route-messages .msg-thread-row.is-active .msg-thread-name {
  color: var(--msg-text);
}

html body.route-messages .msg-thread-avatar,
html body.route-messages .msg-thread-header-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: var(--msg-hover);
  background-image: none;
  box-shadow: none;
  color: var(--msg-text-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

html body.route-messages .msg-thread-row.is-active .msg-thread-avatar {
  background: var(--msg-raised);
}

html body.route-messages .msg-thread-name,
html body.route-messages .msg-thread-name-big {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--msg-text);
}

html body.route-messages .msg-thread-row.is-unread .msg-thread-name {
  font-weight: 700;
}

html body.route-messages .msg-thread-row.is-unread .msg-thread-preview {
  font-weight: 400;
  color: var(--msg-text-2);
}

html body.route-messages .msg-thread-time {
  font-size: 12px;
  font-weight: 400;
  color: var(--msg-text-3);
  font-variant-numeric: tabular-nums;
}

html body.route-messages .msg-thread-preview,
html body.route-messages .msg-preview-prefix {
  font-size: 13px;
  font-weight: 400;
  color: var(--msg-text-3);
}

html body.route-messages .msg-unread-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--msg-accent);
  box-shadow: none;
}

html body.route-messages .msg-pill::before,
html body.route-messages .msg-pill-optout::before {
  content: none;
  display: none;
  background: transparent;
}

html body.route-messages .msg-outreach-count,
html body.route-messages .msg-thread-row.is-unread .msg-outreach-count,
html body.route-messages .msg-pill,
html body.route-messages .msg-pill-optout {
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: var(--msg-text-3);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

html body.route-messages .msg-thread-header {
  min-height: 56px;
  padding: 8px 16px;
  border: 0;
  border-bottom: 1px solid var(--msg-border);
  background: transparent;
  background-image: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html body.route-messages .msg-thread-link {
  background: transparent;
  background-image: none;
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  color: var(--msg-text-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

html body.route-messages .msg-thread-link:hover {
  background: transparent;
  color: var(--msg-text);
  text-decoration: underline;
}

html body.route-messages .msg-thread-back,
html body.route-messages .msg-thread-close {
  color: var(--msg-text-2);
  background: transparent;
  border-radius: 6px;
}

html body.route-messages .msg-empty,
html body.route-messages .msg-empty-large {
  background: transparent;
  box-shadow: none;
}

html body.route-messages .msg-empty-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--msg-text-2);
}

html body.route-messages .msg-empty-sub,
html body.route-messages .msg-empty-copy,
html body.route-messages .msg-empty-hint {
  font-size: 13px;
  font-weight: 400;
  color: var(--msg-text-3);
}

html body.route-messages .msg-bubble {
  border-radius: 10px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}

/* Flat sent fill. Queued and sending stay this blue; the receipt line
   carries the status. Failed keeps the existing messages treatment. */
html body.route-messages .msg-bubble-out:not(.is-failed) .msg-bubble:not(.msg-bubble-syslog) {
  background: var(--msg-sent-blue);
  background-color: var(--msg-sent-blue);
  background-image: none;
  color: #FFFFFF;
  border: 0;
  box-shadow: none;
  filter: none;
  opacity: 1;
}

html body.route-messages .msg-bubble-out.is-failed .msg-bubble,
html body.route-messages .msg-bubble-out .msg-bubble.msg-bubble-syslog {
  background: var(--msg-raised);
  background-color: var(--msg-raised);
  background-image: none;
  color: var(--msg-text);
  border: 0;
  box-shadow: none;
  filter: none;
  opacity: 1;
}

html body.route-messages .msg-bubble-in .msg-bubble {
  background: var(--msg-raised);
  background-image: none;
  color: var(--msg-text);
  border: 1px solid var(--msg-border-strong);
}

html body.route-messages .msg-bubble-foot {
  font-size: 12px;
  font-weight: 400;
  color: var(--msg-text-3);
  text-transform: none;
  letter-spacing: 0;
}

html body.route-messages .msg-date-sep span {
  font-size: 12px;
  font-weight: 500;
  color: var(--msg-text-3);
  background: transparent;
  text-transform: none;
  letter-spacing: 0;
}

html body.route-messages .msg-composer-field {
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
}

html body.route-messages .msg-composer-input,
html[data-app-theme="dark"] body.route-messages .msg-composer-input {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
}

html body.route-messages .msg-composer-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 4px 4px 6px;
  box-sizing: border-box;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

html body.route-messages .msg-composer-attach-list[hidden] {
  display: none;
  margin: 0;
  padding: 0;
}

html body.route-messages .msg-composer,
html[data-app-theme="dark"] body.route-messages .msg-composer {
  flex: 0 0 auto;
  margin: 0 12px 0;
  padding: 6px;
  gap: 4px;
  align-items: flex-end;
  max-width: calc(100% - 24px);
  box-sizing: border-box;
  border: 1px solid var(--msg-border);
  border-radius: 10px;
  background: var(--msg-raised);
  background-image: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html body.route-messages .msg-composer.is-loading {
  opacity: 0.45;
  pointer-events: none;
}

html body.route-messages .msg-composer.is-loading .msg-composer-input,
html body.route-messages .msg-composer.is-loading .msg-composer-input::placeholder {
  color: var(--msg-text-3);
}

html body.route-messages .msg-composer-input,
html[data-app-theme="dark"] body.route-messages .msg-composer-input {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--msg-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  box-shadow: none;
}

html body.route-messages .msg-composer-input::placeholder {
  color: var(--msg-text-3);
}

html body.route-messages .msg-composer-input:focus {
  outline: none;
  box-shadow: none;
}

html body.route-messages .msg-composer-plus,
html body.route-messages .msg-composer-templates,
html body.route-messages .msg-composer-mic,
html body.route-messages .msg-composer-emoji {
  color: var(--msg-text-2);
  background: transparent;
  background-image: none;
  box-shadow: none;
}

html body.route-messages .msg-composer-send,
html[data-app-theme="dark"] body.route-messages .msg-composer-send {
  border: 0;
  border-radius: 6px;
  background: var(--msg-sent-blue);
  background-color: var(--msg-sent-blue);
  background-image: none;
  color: #FFFFFF;
  box-shadow: none;
  filter: none;
}

html body.route-messages .msg-composer-send:hover:not(:disabled) {
  background: color-mix(in srgb, var(--msg-sent-blue) 88%, #000);
  background-color: color-mix(in srgb, var(--msg-sent-blue) 88%, #000);
  background-image: none;
  color: #FFFFFF;
  box-shadow: none;
  filter: none;
}

html body.route-messages .msg-composer-send:active:not(:disabled) {
  background: color-mix(in srgb, var(--msg-sent-blue) 76%, #000);
  background-color: color-mix(in srgb, var(--msg-sent-blue) 76%, #000);
  background-image: none;
  color: #FFFFFF;
  box-shadow: none;
  filter: none;
}

html body.route-messages .msg-composer-send:disabled,
html body.route-messages .msg-composer-send:disabled:hover,
html body.route-messages .msg-composer-send:disabled:active {
  background: var(--msg-hover);
  background-color: var(--msg-hover);
  background-image: none;
  color: var(--msg-text-3);
  box-shadow: none;
  filter: none;
}

html body.route-messages .msg-composer-plus-menu,
html body.route-messages .msg-emoji-panel,
html body.route-messages .msg-new-compose-bar {
  background: var(--msg-raised);
  border: 1px solid var(--msg-border);
  border-radius: 10px;
  box-shadow: none;
}

/* New Message To: bar. One rounded bar. The inner tel input must not draw
   the global [tabindex]:focus-visible ring (2px solid accent, offset 2px),
   which sat as a hard blue rectangle inside the bar. Focus is a 1px border
   color on the bar. The caret stays the accent blue. */
html body.route-messages .msg-new-compose-input,
html body.route-messages .msg-new-compose-input:focus,
html body.route-messages .msg-new-compose-input:focus-visible {
  outline: none;
  outline-offset: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  background-image: none;
  caret-color: #2196F3;
  -webkit-appearance: none;
  appearance: none;
}

html body.route-messages .msg-new-compose-bar:focus-within {
  border-color: var(--msg-border-strong);
  outline: none;
  box-shadow: none;
}

/* Loading matches a real row: avatar, short name, longer preview,
   one divider. The layout-review ::before/::after bars stacked on
   top of these lines and read as a doubled skeleton. */
html body.route-messages .msg-skel {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
}

html body.route-messages .msg-skel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: auto;
  min-height: 56px;
  margin: 0;
  padding: 10px 14px;
  position: static;
  border: 0;
  border-bottom: 1px solid var(--msg-border);
  background: transparent;
  box-shadow: none;
}

html body.route-messages .msg-skel-row::before,
html body.route-messages .msg-skel-row::after {
  content: none;
  display: none;
}

html body.route-messages .msg-skel-avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: var(--msg-raised);
  background-image: none;
  box-shadow: none;
  animation: msg-skel-pulse 1.6s ease-in-out infinite;
}

html body.route-messages .msg-skel-lines {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

html body.route-messages .msg-skel .skeleton-line {
  display: block;
  height: 10px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: var(--msg-raised);
  background-image: none;
  box-shadow: none;
  animation: msg-skel-pulse 1.6s ease-in-out infinite;
}

html body.route-messages .msg-skel-l1 { width: 38%; }
html body.route-messages .msg-skel-row:nth-child(3n) .msg-skel-l1 { width: 28%; }
html body.route-messages .msg-skel-row:nth-child(3n + 1) .msg-skel-l1 { width: 46%; }
html body.route-messages .msg-skel-l2 { width: 72%; height: 8px; }

html body.route-messages .msg-skel--thread {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 16px;
}

html body.route-messages .msg-skel .skeleton-line.msg-skel-bubble {
  height: 36px;
  border-radius: 10px;
  background: var(--msg-raised);
  background-image: none;
}

html body.route-messages .msg-skel-in { align-self: flex-start; }
html body.route-messages .msg-skel-out { align-self: flex-end; }
html body.route-messages .msg-skel-w35 { width: 35%; }
html body.route-messages .msg-skel-w40 { width: 40%; height: 28px; }
html body.route-messages .msg-skel-w55 { width: 55%; }
html body.route-messages .msg-skel-w60 { width: 60%; }
html body.route-messages .msg-skel-w70 { width: 70%; height: 44px; }

html body.route-messages .msg-thread-header--loading .msg-thread-header-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: transparent;
}

html body.route-messages .msg-skel-name {
  display: block;
  width: 120px;
  height: 12px;
  border-radius: 6px;
  background: var(--msg-raised);
  background-image: none;
  animation: msg-skel-pulse 1.6s ease-in-out infinite;
}

@keyframes msg-skel-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  html body.route-messages .msg-skel-avatar,
  html body.route-messages .msg-skel .skeleton-line,
  html body.route-messages .msg-skel-name {
    animation: none;
  }
}

html body.route-messages .msg-campaign-settings-cta,
html body.route-messages .lc-back-btn {
  background: transparent;
  color: var(--msg-text-2);
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  font-weight: 500;
}

/* Phone: the list is the page. No sideways scroll. 44px hit targets stay. */
@media (max-width: 820px) {
  html body.route-messages,
  html body.route-messages #main,
  html body.route-messages #main-content,
  html body.route-messages .main-content,
  html body.route-messages .msg-view,
  html body.route-messages .msg-split,
  html body.route-messages .msg-left-pane,
  html body.route-messages .msg-thread-pane {
    overflow-x: hidden;
    max-width: 100%;
  }

  html body.route-messages:not(.msg-mobile-thread) .msg-view,
  html body.route-messages:not(.msg-mobile-thread) .msg-split {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
  }

  html body.route-messages:not(.msg-mobile-thread) .msg-left-pane {
    visibility: visible;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: var(--msg-page);
  }

  html body.route-messages .msg-left-header {
    padding-right: 58px;
  }

  html body.route-messages .msg-search,
  html body.route-messages .msg-composer-input,
  html body.route-messages .msg-new-compose-input {
    font-size: 16px;
  }

  html body.route-messages .msg-new-compose-bar {
    margin-left: 12px;
    margin-right: 12px;
    max-width: calc(100% - 24px);
    box-sizing: border-box;
  }

  html body.route-messages .msg-filter-toggle,
  html body.route-messages .msg-compose-btn,
  html body.route-messages .msg-settings-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  html body.route-messages .msg-settings-btn {
    border: 0;
    border-radius: 6px;
    background: var(--msg-card);
    color: var(--msg-text-2);
    box-shadow: none;
  }

  html body.route-messages .msg-composer {
    margin: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100% - 24px);
    box-sizing: border-box;
  }

  html body.route-messages .msg-view.is-settings-open .msg-tabs-bar {
    background: var(--msg-card);
    border: 1px solid var(--msg-border);
    border-radius: 10px;
    box-shadow: none;
  }

  html body.route-messages .msg-view.is-settings-open .msg-tab,
  html body.route-messages .msg-view.is-settings-open .msg-tab-add,
  html body.route-messages .msg-view.is-settings-open .msg-tab-dashboard {
    border-radius: 6px;
    background: transparent;
    color: var(--msg-text-2);
    font-size: 14px;
    font-weight: 500;
  }

  html body.route-messages .msg-view.is-settings-open .msg-tab.is-active {
    background: var(--msg-hover);
    color: var(--msg-text);
  }
}

/* legacy-n-base is the first layer, so !important here beats the phone
   sheet's 100lvh thread pane and its #000 fill. Height is the visible
   viewport. With the keyboard open, --vv-h is that viewport, so the
   composer sits on the keyboard without a second inset. */
@layer legacy-n-base {
  @media (max-width: 820px) {
    body.msg-mobile-thread.route-messages .msg-thread-pane,
    html[data-app-theme="dark"] body.msg-mobile-thread.route-messages .msg-thread-pane {
      position: fixed !important;
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      bottom: auto !important;
      width: 100% !important;
      height: 100dvh !important;
      max-height: 100dvh !important;
      min-height: 0 !important;
      padding-bottom: 0 !important;
      box-sizing: border-box !important;
      background: #1A1B1B !important;
      background-color: #1A1B1B !important;
      box-shadow: none !important;
    }

    body.kb-open.msg-mobile-thread.route-messages .msg-thread-pane,
    html[data-app-theme="dark"] body.kb-open.msg-mobile-thread.route-messages .msg-thread-pane {
      height: var(--vv-h, 100dvh) !important;
      max-height: var(--vv-h, 100dvh) !important;
      padding-bottom: 0 !important;
    }
  }
}

/* Campaign settings. Flat sections, same fields as before. */
html body.route-messages #lc-mount {
  background: #171818;
}

html body.route-messages #lc-mount .stl-builder,
html body.route-messages .stl-builder.lc-plain {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px 48px;
  box-sizing: border-box;
  background: #171818;
  color: #ECEDEC;
  font-family: "Satoshi", system-ui, sans-serif;
  font-weight: 400;
}

html body.route-messages .stl-builder .lc-summary {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: #ECEDEC;
}

html body.route-messages .stl-builder .stl-top,
html body.route-messages .stl-builder .stl-stages,
html body.route-messages .stl-builder .stl-controls {
  max-width: none;
  margin: 0;
  padding: 0;
}

html body.route-messages .stl-builder .stl-top-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

html body.route-messages .stl-builder .stl-top-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
  color: #ECEDEC;
  font-family: "Satoshi", system-ui, sans-serif;
}

html body.route-messages .stl-builder .stl-meta-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  margin-top: 12px;
}

html body.route-messages .stl-builder .lc-sec,
html body.route-messages .stl-builder .lc-advanced {
  background: #1F2121;
  border: 1px solid #2F3232;
  border-radius: 10px;
  box-shadow: none;
}

html body.route-messages .stl-builder .lc-sec {
  padding: 16px;
}

html body.route-messages .stl-builder .lc-sec h2,
html body.route-messages .stl-builder .lc-advanced-attach h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #ECEDEC;
  font-family: "Satoshi", system-ui, sans-serif;
}

html body.route-messages .stl-builder .lc-lead,
html body.route-messages .stl-builder .lc-hint,
html body.route-messages .stl-builder .lc-people,
html body.route-messages .stl-builder .lc-mode-note,
html body.route-messages .stl-builder .stl-kill-note,
html body.route-messages .stl-builder .stl-stage-delay-hint,
html body.route-messages .stl-builder .stl-attach-hint {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: #7A7F7F;
}

html body.route-messages .stl-builder .lc-people {
  color: #A6ABAB;
}

html body.route-messages .stl-builder .lc-people b {
  color: #ECEDEC;
  font-weight: 700;
}

html body.route-messages .stl-builder .lc-mode-line {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: #7A7F7F;
}

html body.route-messages .stl-builder .lc-mode-line.is-current {
  color: #ECEDEC;
  font-weight: 500;
}

html body.route-messages .stl-builder .lc-mode-note {
  color: #A6ABAB;
}

html body.route-messages .stl-builder .lc-kv {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 12px;
  margin-top: 12px;
}

html body.route-messages .stl-builder .lc-k,
html body.route-messages .stl-builder .stl-meta-label,
html body.route-messages .stl-builder .stl-stage-field-label,
html body.route-messages .stl-builder .stl-stage-inline-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: #7A7F7F;
  font-family: "Satoshi", system-ui, sans-serif;
  background: transparent;
  border: 0;
}

html body.route-messages .stl-builder .lc-v,
html body.route-messages .stl-builder .lc-sent-today {
  color: #ECEDEC;
  font-weight: 500;
  font-size: 14px;
}

html body.route-messages .stl-builder .lc-sent-today {
  margin: 8px 0 0;
  font-size: 20px;
  font-weight: 700;
}

html body.route-messages .stl-builder .lc-v.is-reject,
html body.route-messages .stl-builder .lc-reject {
  color: #ECEDEC;
  font-weight: 700;
  font-size: 13px;
}

html body.route-messages .stl-builder .lc-reject {
  margin: 8px 0 0;
}

html body.route-messages .stl-builder [hidden] {
  display: none;
}

html body.route-messages .stl-builder .lc-hours {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

html body.route-messages .stl-builder .lc-hour {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  color: #7A7F7F;
}

html body.route-messages .stl-builder .lcp-meta-input,
html body.route-messages .stl-builder .lcp-meta-select,
html body.route-messages .stl-builder .lcp-meta-num,
html body.route-messages .stl-builder .stl-stage-body,
html body.route-messages .stl-builder input.stl-stage-num,
html body.route-messages .stl-builder .lc-hour input {
  width: 100%;
  box-sizing: border-box;
  background: #252727;
  background-image: none;
  border: 1px solid #2F3232;
  border-radius: 6px;
  color: #ECEDEC;
  font-family: "Satoshi", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  box-shadow: none;
  filter: none;
}

html body.route-messages .stl-builder .lc-hour input,
html body.route-messages .stl-builder .lcp-meta-input,
html body.route-messages .stl-builder .lcp-meta-select,
html body.route-messages .stl-builder .lcp-meta-num,
html body.route-messages .stl-builder input.stl-stage-num {
  min-height: 40px;
  padding: 8px 10px;
}

html body.route-messages .stl-builder .stl-stage-body {
  min-height: 96px;
  padding: 10px 12px;
  line-height: 1.45;
}

html body.route-messages .stl-builder .lcp-meta-input:focus,
html body.route-messages .stl-builder .lcp-meta-select:focus,
html body.route-messages .stl-builder .lcp-meta-num:focus,
html body.route-messages .stl-builder .stl-stage-body:focus,
html body.route-messages .stl-builder input.stl-stage-num:focus,
html body.route-messages .stl-builder .lc-hour input:focus {
  outline: none;
  border-color: #2196F3;
  box-shadow: none;
  background: #252727;
}

html body.route-messages .stl-builder .lcp-start-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 8px 16px;
  border: 1px solid #2196F3;
  border-radius: 999px;
  background: #2196F3;
  background-image: none;
  color: #fff;
  font-family: "Satoshi", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
  filter: none;
}

html body.route-messages .stl-builder .lcp-start-btn.is-active {
  background: transparent;
  color: #ECEDEC;
  border-color: #2F3232;
}

html body.route-messages .stl-builder .lcp-start-btn:hover,
html body.route-messages .stl-builder .lcp-start-btn:focus {
  filter: none;
  box-shadow: none;
}

html body.route-messages .stl-builder .lcp-start-btn.is-preview:hover {
  background: #1E88E5;
  border-color: #1E88E5;
}

html body.route-messages .stl-builder .lcp-start-btn.is-active:hover {
  background: #2B2D2D;
}

html body.route-messages .stl-builder .lcp-delete-btn {
  margin-left: auto;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #A6ABAB;
  font-family: "Satoshi", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
}

html body.route-messages .stl-builder .lcp-delete-btn:hover {
  background: #2B2D2D;
  color: #ECEDEC;
}

html body.route-messages .stl-builder .lcp-sms-toggle,
html body.route-messages .stl-builder .stl-stage-save,
html body.route-messages .stl-builder .stl-attach-btn {
  appearance: none;
  align-self: flex-start;
  width: auto;
  max-width: 100%;
  border: 1px solid #2F3232;
  border-radius: 999px;
  background: #252727;
  background-image: none;
  color: #ECEDEC;
  font-family: "Satoshi", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
  filter: none;
  cursor: pointer;
}

html body.route-messages .stl-builder .lcp-sms-toggle {
  padding: 8px 14px;
  font-size: 14px;
}

html body.route-messages .stl-builder .lcp-sms-toggle.is-on,
html body.route-messages .stl-builder .lcp-sms-toggle.is-off {
  background: #252727;
  color: #ECEDEC;
  border-color: #2F3232;
}

html body.route-messages .stl-builder .lcp-sms-toggle.is-on {
  border-color: #2196F3;
  color: #2196F3;
}

html body.route-messages .stl-builder .lcp-sms-toggle:hover,
html body.route-messages .stl-builder .stl-stage-save:hover,
html body.route-messages .stl-builder .stl-attach-btn:hover {
  filter: none;
  background: #2B2D2D;
  border-color: #2F3232;
  color: #ECEDEC;
  box-shadow: none;
}

html body.route-messages .stl-builder .stl-meta-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

html body.route-messages .stl-builder .stl-to-bar {
  background: #252727;
  border: 1px solid #2F3232;
  border-radius: 10px;
  box-shadow: none;
}

html body.route-messages .stl-builder .stl-to-chip {
  background: #1F2121;
  border: 1px solid #2F3232;
  color: #ECEDEC;
  border-radius: 999px;
}

html body.route-messages .stl-builder .stl-stage {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(160px, 220px);
  gap: 12px;
  align-items: start;
  margin: 12px 0 0;
  padding: 12px;
  background: #252727;
  border: 1px solid #2F3232;
  border-radius: 10px;
  box-shadow: none;
}

html body.route-messages .stl-builder .stl-stage-compose,
html body.route-messages .stl-builder .stl-stage-head,
html body.route-messages .stl-builder .stl-stage-field,
html body.route-messages .stl-builder .stl-stage-actions,
html body.route-messages .stl-builder .stl-stage-phone {
  background: transparent;
  background-color: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  min-width: 0;
  max-width: 100%;
}

html body.route-messages .stl-builder .stl-stage-phone,
html body.route-messages .stl-builder .stl-phone-thread,
html body.route-messages .stl-builder .stl-stage-preview-wrap {
  min-width: 0;
  max-width: 100%;
}

html body.route-messages .stl-builder .stl-stage-title {
  font-size: 16px;
  font-weight: 700;
  color: #ECEDEC;
  font-family: "Satoshi", system-ui, sans-serif;
}

html body.route-messages .stl-builder .stl-stage-rail .stl-stage-index {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #1F2121;
  border: 1px solid #2F3232;
  color: #A6ABAB;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
}

html body.route-messages .stl-builder .stl-stage-rail::after {
  display: none;
}

html body.route-messages .stl-builder .lc-bound-source {
  display: none;
}

html body.route-messages .stl-builder .stl-wait-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

html body.route-messages .stl-builder .stl-stage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

html body.route-messages .stl-builder .stl-phone-bezel {
  width: 100%;
  max-width: 220px;
  min-height: 0;
  padding: 12px;
  background: #1F2121;
  border: 1px solid #2F3232;
  border-radius: 10px;
  box-shadow: none;
}

html body.route-messages .stl-builder .stl-phone-notch {
  display: none;
}

html body.route-messages .stl-builder .stl-phone-avatar {
  background: #252727;
  color: #ECEDEC;
  border-radius: 999px;
  box-shadow: none;
}

html body.route-messages .stl-builder .stl-phone-name,
html body.route-messages .stl-builder .stl-phone-composer {
  color: #A6ABAB;
  font-size: 12px;
  font-weight: 500;
}

html body.route-messages .stl-builder .stl-phone-composer {
  border: 1px solid #2F3232;
  border-radius: 6px;
  background: transparent;
}

html body.route-messages .stl-builder .stl-stage-preview-bubble,
html body.route-messages .stl-builder .stl-stage-preview-bubble.msg-bubble {
  width: auto;
  max-width: 100%;
  background: var(--msg-sent-blue);
  background-color: var(--msg-sent-blue);
  background-image: none;
  color: #FFFFFF;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

html body.route-messages .stl-builder .lc-advanced > summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  color: #ECEDEC;
  font-family: "Satoshi", system-ui, sans-serif;
}

html body.route-messages .stl-builder .lc-advanced > summary::-webkit-details-marker {
  display: none;
}

html body.route-messages .stl-builder .lc-advanced-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 16px;
}

html body.route-messages .stl-builder .lc-advanced-attach h4 {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: #A6ABAB;
}

html body.route-messages .stl-builder .lc-machine-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

html body.route-messages .stl-builder .lc-machine-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #2F3232;
  border-radius: 6px;
  background: #252727;
  color: #A6ABAB;
  font-size: 13px;
  font-weight: 400;
}

html body.route-messages .stl-builder .lc-machine-name {
  color: #ECEDEC;
  font-weight: 500;
}

html body.route-messages .stl-builder .lc-machine-state.is-on {
  color: #2196F3;
  font-weight: 700;
}

html body.route-messages .stl-builder .stl-attach-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

html body.route-messages .stl-builder .stl-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 8px;
  border: 1px solid #2F3232;
  border-radius: 999px;
  background: #1F2121;
  color: #ECEDEC;
  font-size: 12px;
}

html body.route-messages .stl-builder .stl-stage-counter {
  margin-top: 4px;
  font-size: 12px;
  color: #7A7F7F;
  text-align: right;
}

@media (max-width: 820px) {
  html body.route-messages #lc-mount .stl-builder,
  html body.route-messages .stl-builder.lc-plain {
    padding: 12px 12px 32px;
  }

  html body.route-messages .stl-builder .stl-top-title {
    font-size: 20px;
  }

  html body.route-messages .stl-builder .stl-stage {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  html body.route-messages .stl-builder .stl-stage-phone {
    grid-column: 1 / -1;
  }

  html body.route-messages .stl-builder .stl-phone-bezel {
    max-width: none;
  }

  html body.route-messages .stl-builder .lcp-delete-btn {
    margin-left: 0;
  }

  html body.route-messages .stl-builder .lcp-meta-input,
  html body.route-messages .stl-builder .lcp-meta-select,
  html body.route-messages .stl-builder .lcp-meta-num,
  html body.route-messages .stl-builder .stl-stage-body,
  html body.route-messages .stl-builder input.stl-stage-num,
  html body.route-messages .stl-builder .lc-hour input {
    font-size: 16px;
  }
}


/* Message contacts. Own panel beside the thread on desktop, and a separate
   view on a phone. Never a child of the bubble stream. No send. */
html body.route-messages .msg-contact-host {
  display: none;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #2F3232;
  border-radius: 10px;
  background: #1F2121;
  background-image: none;
  color: #ECEDEC;
  font-family: "Satoshi", system-ui, sans-serif;
}

html body.route-messages .msg-split.is-contact-open .msg-contact-host:not([hidden]) {
  display: flex;
}

html body.route-messages .msg-contact-host[hidden] {
  display: none;
}

html body.route-messages .msg-contact-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: transparent;
  background-image: none;
}

html body.route-messages .msg-contact-panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 48px;
  margin: 0;
  padding: 8px 8px 8px 14px;
  border-bottom: 1px solid #2F3232;
  background: #1F2121;
  background-image: none;
}

html body.route-messages .msg-contact-panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #ECEDEC;
}

html body.route-messages .msg-contact-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  background-image: none;
  color: #A6ABAB;
  cursor: pointer;
}

html body.route-messages .msg-contact-close:hover {
  background: #2B2D2D;
  background-image: none;
  color: #ECEDEC;
}

html body.route-messages .msg-contact-close:focus-visible {
  outline: 1px solid #2196F3;
  outline-offset: 1px;
}

html body.route-messages .msg-contact-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: transparent;
  background-image: none;
}

@media (min-width: 821px) {
  html body.route-messages .msg-split.msg-split-2col.is-contact-open {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr) minmax(260px, 320px);
  }

  html body.route-messages .msg-split.is-contact-open .msg-contact-host:not([hidden]) {
    height: 100%;
    max-height: 100%;
    margin: 0 0 0 12px;
  }

  html body.route-messages .msg-contact-panel .msg-contact-card,
  html body.route-messages .msg-contact-panel .msg-contact-form {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    background-image: none;
  }
}

html body.route-messages .msg-thread-link[data-action="contact-menu"] {
  color: #2196F3;
  font-size: 14px;
  font-weight: 500;
  font-family: "Satoshi", system-ui, sans-serif;
}

html body.route-messages .msg-contact-card,
html body.route-messages .msg-contact-form {
  margin: 12px 16px 0;
  border: 1px solid #2F3232;
  border-radius: 10px;
  background: #1F2121;
  background-image: none;
  color: #ECEDEC;
  font-family: "Satoshi", system-ui, sans-serif;
}

html body.route-messages .msg-contact-card {
  padding: 0;
  overflow: hidden;
}

html body.route-messages .msg-contact-form {
  padding: 14px;
}

html body.route-messages .msg-contact-form h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: #ECEDEC;
}

html body.route-messages .msg-contact-match {
  padding: 12px 14px;
  border-bottom: 1px solid #2F3232;
}

html body.route-messages .msg-contact-match-name {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: #ECEDEC;
}

html body.route-messages .msg-contact-match-note,
html body.route-messages .msg-contact-result-meta,
html body.route-messages .msg-contact-picked {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  color: #7A7F7F;
}

html body.route-messages .msg-contact-save,
html body.route-messages .msg-contact-link-btn,
html body.route-messages .msg-contact-action,
html body.route-messages .msg-contact-submit {
  border: 0;
  background: transparent;
  background-image: none;
  color: #2196F3;
  font-family: "Satoshi", system-ui, sans-serif;
  font-weight: 500;
  cursor: pointer;
}

html body.route-messages .msg-contact-save {
  margin-top: 8px;
  padding: 0;
  font-size: 14px;
}

html body.route-messages .msg-contact-action {
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border-radius: 0;
  font-size: 16px;
  text-align: left;
}

html body.route-messages .msg-contact-action + .msg-contact-action {
  border-top: 1px solid #2F3232;
}

html body.route-messages .msg-contact-action:hover,
html body.route-messages .msg-contact-result:hover {
  background: #2B2D2D;
  background-image: none;
}

html body.route-messages .msg-contact-setup,
html body.route-messages .msg-contact-note {
  margin: 0;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #A6ABAB;
}

html body.route-messages .msg-contact-form .msg-contact-note,
html body.route-messages .msg-contact-form .msg-contact-setup {
  padding: 0 0 10px;
}

html body.route-messages .msg-contact-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 500;
  color: #A6ABAB;
}

html body.route-messages .msg-contact-field input,
html body.route-messages .msg-contact-field textarea {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #2F3232;
  border-radius: 6px;
  background: #252727;
  background-image: none;
  color: #ECEDEC;
  font-family: "Satoshi", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
}

html body.route-messages .msg-contact-field textarea {
  min-height: 72px;
  resize: vertical;
}

html body.route-messages .msg-contact-field input:focus-visible,
html body.route-messages .msg-contact-field textarea:focus-visible,
html body.route-messages .msg-contact-action:focus-visible,
html body.route-messages .msg-contact-submit:focus-visible,
html body.route-messages .msg-contact-cancel:focus-visible {
  outline: 1px solid #2196F3;
  outline-offset: 1px;
}

html body.route-messages .msg-contact-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 10px;
}

html body.route-messages .msg-contact-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #2F3232;
  border-radius: 6px;
  background: #252727;
  background-image: none;
}

html body.route-messages .msg-contact-result-name {
  font-size: 14px;
  font-weight: 500;
  color: #ECEDEC;
}

html body.route-messages .msg-contact-link-btn {
  flex: 0 0 auto;
  padding: 0;
  font-size: 13px;
}

html body.route-messages .msg-contact-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

html body.route-messages .msg-contact-cancel,
html body.route-messages .msg-contact-submit {
  padding: 8px 12px;
  border: 1px solid #2F3232;
  border-radius: 6px;
  background: #252727;
  background-image: none;
  font-size: 14px;
}

html body.route-messages .msg-contact-cancel {
  color: #ECEDEC;
}

@media (max-width: 820px) {
  html body.msg-mobile-thread.route-messages .msg-split.is-contact-open > .msg-thread-pane {
    display: none;
  }

  html body.msg-mobile-thread.route-messages .msg-split.is-contact-open .msg-contact-host:not([hidden]) {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    width: 100%;
    height: 100%;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #1A1B1B;
    background-image: none;
  }

  html body.route-messages .msg-contact-panel-bar {
    min-height: 44px;
    padding-top: env(safe-area-inset-top, 0px);
    background: #1A1B1B;
    background-image: none;
  }

  html body.route-messages .msg-contact-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  html body.route-messages .msg-contact-card,
  html body.route-messages .msg-contact-form {
    margin-left: 12px;
    margin-right: 12px;
  }

  html body.route-messages .msg-contact-field input,
  html body.route-messages .msg-contact-field textarea {
    font-size: 16px;
  }
}

/* Phone thread and inbox. One header row, 78% bubbles, composer on the
   keyboard. The list is the full width under the app bar. */
@media (max-width: 820px) {
  html body.route-messages .main,
  html body.route-messages section#main.main,
  html body.route-messages #main-content,
  html body.route-messages .main-content,
  html body.route-messages .msg-view,
  html body.route-messages .msg-split,
  html body.route-messages .msg-split.msg-split-2col {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  html body.route-messages:not(.msg-mobile-thread) .msg-view,
  html body.route-messages:not(.msg-mobile-thread) .msg-split,
  html body.route-messages:not(.msg-mobile-thread) .msg-split.msg-split-2col,
  html body.route-messages:not(.msg-mobile-thread) .msg-left-pane {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    height: auto;
    grid-template-columns: none;
  }

  html body.route-messages:not(.msg-mobile-thread) .msg-thread-pane {
    display: none;
  }

  html body.route-messages .msg-left-scroll {
    flex: 1 1 auto;
    min-height: 0;
  }

  html body.route-messages .msg-search-wrap {
    display: flex;
    align-items: center;
    gap: 2px;
    width: 100%;
    min-width: 0;
  }

  html body.route-messages .msg-search {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  html body.route-messages .msg-thread-main,
  html body.route-messages .msg-thread-name,
  html body.route-messages .msg-thread-preview {
    min-width: 0;
  }

  html body.route-messages .msg-thread-name,
  html body.route-messages .msg-thread-preview {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body.msg-mobile-thread.route-messages .msg-settings-btn {
    display: none;
  }

  html body.msg-mobile-thread.route-messages .msg-thread-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    flex: 0 0 auto;
    min-height: 44px;
    height: auto;
    margin: 0;
    padding: env(safe-area-inset-top, 0px) 2px 0;
    background: var(--msg-page);
    background-color: var(--msg-page);
    border-bottom: 1px solid var(--msg-border);
  }

  html body.msg-mobile-thread.route-messages .msg-thread-header-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
  }

  html body.msg-mobile-thread.route-messages .msg-thread-header-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  html body.msg-mobile-thread.route-messages .msg-thread-name-big {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    text-align: left;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
  }

  html body.msg-mobile-thread.route-messages .msg-thread-header-actions {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 0 0 auto;
    min-width: 0;
  }

  html body.msg-mobile-thread.route-messages .msg-thread-back,
  html body.msg-mobile-thread.route-messages .msg-thread-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--msg-text-2);
  }

  html body.msg-mobile-thread.route-messages .msg-thread-close svg {
    width: 20px;
    height: 20px;
  }

  html body.msg-mobile-thread.route-messages .msg-thread-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    margin: 0;
    padding: 0 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--msg-text-2);
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
  }

  html body.msg-mobile-thread.route-messages .msg-bubble-stream {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 12px 4px;
    background: var(--msg-page);
    background-color: var(--msg-page);
  }

  html body.msg-mobile-thread.route-messages .msg-bubble-stream::before {
    content: "";
    flex: 1 1 auto;
    min-height: 0;
  }

  html body.route-messages .msg-bubble-row {
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: 78%;
    margin: 0 0 2px;
    gap: 1px;
    min-width: 0;
  }

  html body.route-messages .msg-bubble-row.msg-bubble-out {
    align-self: flex-end;
    align-items: flex-end;
  }

  html body.route-messages .msg-bubble-row.msg-bubble-in {
    align-self: flex-start;
    align-items: flex-start;
  }

  html body.route-messages .msg-bubble {
    width: auto;
    max-width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.35;
  }

  html body.route-messages .msg-bubble-foot,
  html body.route-messages .msg-bubble-foot-failed {
    display: block;
    width: auto;
    max-width: 100%;
    margin: 0 2px 4px;
    padding: 0;
    font-size: 12px;
    font-weight: 400;
    font-style: normal;
    line-height: 1.2;
    letter-spacing: 0;
    text-align: right;
    text-transform: none;
    color: var(--msg-text-3);
    background: transparent;
  }

  html body.route-messages .msg-date-sep {
    margin: 10px 0 6px;
  }

  html body.route-messages .msg-date-sep span {
    padding: 0;
    border-radius: 0;
    background: transparent;
  }

  html body.msg-mobile-thread.route-messages .msg-composer,
  html[data-app-theme="dark"] body.msg-mobile-thread.route-messages .msg-composer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 6px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    border: 0;
    border-top: 1px solid var(--msg-border);
    border-radius: 0;
    background: var(--msg-card);
    background-color: var(--msg-card);
  }

  html body.kb-open.msg-mobile-thread.route-messages .msg-composer {
    padding-bottom: 8px;
  }

  html body.msg-mobile-thread.route-messages .msg-composer-field {
    flex: 1 1 auto;
    min-width: 0;
    align-self: center;
  }

  html body.msg-mobile-thread.route-messages .msg-composer-input,
  html[data-app-theme="dark"] body.msg-mobile-thread.route-messages .msg-composer-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 36px;
    max-height: 120px;
    padding: 8px 64px 8px 4px;
    font-size: 16px;
    line-height: 1.35;
    resize: none;
  }

  html body.msg-mobile-thread.route-messages .msg-composer-plus,
  html body.msg-mobile-thread.route-messages .msg-composer-templates,
  html body.msg-mobile-thread.route-messages .msg-composer-send {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  html body.msg-mobile-thread.route-messages .msg-composer-plus,
  html body.msg-mobile-thread.route-messages .msg-composer-templates {
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--msg-text-2);
  }

  html body.msg-mobile-thread.route-messages .msg-composer-mic,
  html body.msg-mobile-thread.route-messages .msg-composer-emoji {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    color: var(--msg-text-3);
  }

  html body.msg-mobile-thread.route-messages .msg-composer-send svg {
    width: 18px;
    height: 18px;
  }
}
