:root {
  --bg: #f5f7fa;
  --paper: rgba(255, 255, 255, 0.94);
  --ink: #333333;
  --muted: #777777;
  --line: #dbe3ea;
  --accent: #1d8fbd;
  --accent-strong: #156d91;
  --accent-soft: #e6f0ff;
  --warm: #ff6b6b;
  --warn: #ff6b6b;
  --success: #25d366;
  --shadow: 0 18px 40px rgba(29, 143, 189, 0.12);
  --viewport-height: 100vh;
  --visual-viewport-height: var(--viewport-height);
  --visual-viewport-offset-top: 0px;
}

@supports (height: 100dvh) {
  :root {
    --viewport-height: 100dvh;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(29, 143, 189, 0.15), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 107, 107, 0.14), transparent 22%),
    linear-gradient(180deg, #ffffff 0%, #f5f7fa 100%);
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1580px, calc(100vw - 20px));
  height: calc(var(--viewport-height) - 20px);
  max-height: calc(var(--viewport-height) - 20px);
  margin: 10px auto;
  padding: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.app-shell.is-booting {
  visibility: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.95fr);
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(219, 227, 234, 0.88);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.topbar-copy {
  display: flex;
  align-items: center;
  min-width: 0;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 5px;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 0.98;
}

h2 {
  font-size: 22px;
  line-height: 1.04;
}

.lead {
  margin-top: 8px;
  max-width: 760px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.topbar-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.topbar-service-controls {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-start;
  min-width: 0;
}

.topbar-sync-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.topbar-service-controls .sidebar-service-strip {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.topbar-service-controls .sidebar-automation-links {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 8px;
}

.topbar-service-controls .sidebar-memory-button {
  min-height: 40px;
}

.topbar-service-controls .sidebar-icon-button {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  min-height: 40px;
  font-size: 20px;
}

.sync-status-card,
.metric-card,
.panel,
.conversation-card,
.info-card,
.visit-card,
.bubble {
  border: 1px solid rgba(219, 227, 234, 0.82);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.sync-status-card {
  padding: 11px 13px;
  border-radius: 16px;
  background: linear-gradient(150deg, #156d91, #1d8fbd);
  color: white;
  min-width: 250px;
  flex: 1 1 250px;
}

.sync-status-label {
  display: block;
  font-weight: 700;
  font-size: 13px;
}

.sync-status-meta {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.3;
  font-size: 12px;
}

.ghost-button,
.primary-button {
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
  font-size: 13px;
}

.ghost-button {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  font-weight: 700;
}

.danger-button {
  color: var(--warn);
  border-color: rgba(255, 107, 107, 0.3);
  background: rgba(255, 107, 107, 0.08);
}

.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.danger-button:hover {
  border-color: rgba(255, 107, 107, 0.5);
  background: rgba(255, 107, 107, 0.12);
}

.ghost-button:disabled,
.primary-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.overview-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.service-launchpad {
  display: block;
}

.service-launchpad-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px 18px;
  border-radius: 20px;
  border: 1px solid rgba(219, 227, 234, 0.88);
  background:
    radial-gradient(circle at top right, rgba(42, 159, 223, 0.14), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(246, 252, 255, 0.94));
  box-shadow: var(--shadow);
}

.service-launchpad-copy {
  min-width: 0;
}

.service-launchpad-copy h2 {
  font-size: 24px;
  line-height: 1.04;
}

.service-launchpad-lead,
.service-launchpad-caption {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.service-launchpad-lead {
  margin-top: 8px;
}

.service-launchpad-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.service-launchpad-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(220, 236, 243, 0.88);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.service-launchpad-pill.warn {
  background: rgba(255, 107, 107, 0.14);
  color: var(--warn);
}

.service-launchpad-pill.success {
  background: rgba(37, 211, 102, 0.14);
  color: var(--success);
}

.service-launchpad-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.metric-card {
  padding: 9px 12px;
  border-radius: 16px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.2;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(290px, 340px) minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

.topbar.hidden + .workspace {
  grid-row: 1 / -1;
}

.workspace.details-open {
  grid-template-columns: minmax(290px, 340px) minmax(0, 1fr) minmax(300px, 360px);
}

.panel {
  padding: 12px;
  border-radius: 18px;
  min-height: 0;
  max-height: 100%;
}

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.details-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.details-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.details-panel-head h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
}

.details-panel-scroll {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  margin-top: 10px;
  padding-right: 2px;
}

.details-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

  .details-summary-block {
    padding: 8px 10px;
  border: 1px solid rgba(219, 227, 234, 0.8);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

  .details-summary-row {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 4px 0;
}

.details-summary-row + .details-summary-row {
  border-top: 1px solid rgba(219, 227, 234, 0.52);
}

.details-summary-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.details-summary-value {
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.details-visits {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 2px;
}

.sidebar-head,
.chat-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-head {
  align-items: center;
  margin-bottom: 8px;
}

.chat-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "copy actions";
  align-items: flex-start;
  justify-items: stretch;
  position: relative;
  z-index: 20;
  overflow: visible;
}

.sidebar-head-copy {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}

.sidebar-create-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(29, 143, 189, 0.22);
  border-radius: 999px;
  background: rgba(220, 236, 243, 0.88);
  color: var(--accent-strong);
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background-color 0.16s ease,
    opacity 0.16s ease;
}

.sidebar-create-button:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 143, 189, 0.4);
  background: rgba(220, 236, 243, 0.98);
}

.sidebar-create-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.sidebar-automation-toggles {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  flex: 1 1 auto;
  min-width: 0;
}

.sidebar-automation-controls {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 0;
  margin-top: 0;
  padding-bottom: 0;
}

.sidebar-automation-controls:empty,
.sidebar-automation-controls:not(:has(*)) {
  display: none;
  margin-top: 0;
}

.sidebar-switch-inline-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sidebar-inline-settings-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  color: var(--accent-strong);
  background: rgba(220, 236, 243, 0.78);
  border-color: rgba(29, 143, 189, 0.22);
  font-size: 17px;
  line-height: 1;
}

.sidebar-inline-settings-button:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 143, 189, 0.42);
  background: rgba(220, 236, 243, 0.98);
}

.sidebar-hidden-chats-button {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(29, 143, 189, 0.22);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  gap: 5px;
}

.sidebar-hidden-chats-button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: rgba(29, 143, 189, 0.48);
  box-shadow: 0 10px 26px rgba(29, 143, 189, 0.2);
}

.sidebar-hidden-chats-label {
  white-space: nowrap;
}

.sidebar-language-switcher {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 90;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.sidebar-language-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(29, 143, 189, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: inherit;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(18, 60, 78, 0.08);
}

.sidebar-language-button:hover,
.sidebar-language-button[aria-expanded="true"] {
  border-color: rgba(29, 143, 189, 0.42);
  background: rgba(220, 236, 243, 0.98);
}

.sidebar-language-current {
  display: none;
}

.sidebar-language-flag {
  font-size: 17px;
  line-height: 1;
}

.sidebar-language-caret {
  color: var(--accent-strong);
  font-size: 9px;
  line-height: 1;
  transform: translateY(1px);
}

.sidebar-language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 4px;
  min-width: 174px;
  padding: 7px;
  border: 1px solid rgba(29, 143, 189, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 38px rgba(18, 60, 78, 0.16);
  animation: language-menu-in 140ms ease-out;
}

.sidebar-language-option {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #000;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sidebar-language-option:hover,
.sidebar-language-option.active {
  background: rgba(220, 236, 243, 0.95);
}

.sidebar-language-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-version-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(29, 143, 189, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

@keyframes language-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sidebar-switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sidebar-automation-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.sidebar-memory-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding-inline: 14px;
  text-align: center;
  white-space: nowrap;
}

.sidebar-icon-button {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 999px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.sidebar-service-strip {
  padding: 10px 12px;
  border: 1px solid rgba(219, 227, 234, 0.82);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
}

.sidebar-auto-settings {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(219, 227, 234, 0.82);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
}

.sidebar-auto-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-auto-settings-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-auto-settings-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sidebar-auto-mode-chip {
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(219, 227, 234, 0.9);
  background: rgba(255, 255, 255, 0.96);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.sidebar-auto-mode-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 143, 189, 0.36);
}

.sidebar-auto-mode-chip.active {
  border-color: rgba(29, 143, 189, 0.34);
  background: rgba(220, 236, 243, 0.96);
  color: var(--accent-strong);
}

.sidebar-auto-mode-chip:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
}

.sidebar-switch {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-height: 72px;
  padding: 10px 11px;
  border-radius: 16px;
  border: 1px solid rgba(219, 227, 234, 0.9);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.sidebar-switch:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 143, 189, 0.38);
}

.sidebar-switch:disabled,
.sidebar-switch:disabled:hover {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
  border-color: rgba(219, 227, 234, 0.9);
  background: rgba(245, 247, 250, 0.94);
}

.sidebar-switch.active {
  border-color: rgba(29, 143, 189, 0.42);
  background: linear-gradient(180deg, rgba(220, 236, 243, 0.9), rgba(246, 251, 254, 0.96));
  box-shadow: 0 10px 20px rgba(29, 143, 189, 0.08);
}

.sidebar-switch-compact {
  width: auto;
  min-height: 0;
  padding: 6px 8px;
  border-radius: 999px;
  gap: 0;
}

.sidebar-switch-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-switch-compact .sidebar-switch-top {
  align-items: center;
  gap: 8px;
}

.sidebar-switch-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.sidebar-switch-compact .sidebar-switch-title {
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.sidebar-switch-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.sidebar-switch-description {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.sidebar-switch-status {
  grid-column: 1 / -1;
  min-height: 0;
}

.sidebar-switch-status.sidebar-switch-status-waiting {
  border-style: dashed;
}

.sidebar-switch-status.sidebar-switch-status-muted {
  opacity: 0.8;
}

.sidebar-codeword-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 2px;
  cursor: default;
}

.sidebar-codeword-control:hover {
  transform: none;
}

.sidebar-codeword-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-codeword-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar-codeword-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-codeword-description {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.sidebar-codeword-state-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.sidebar-codeword-state-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-codeword-state-value {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-codeword-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-codeword-actions {
  display: flex;
  justify-content: flex-start;
}

.sidebar-codeword-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 128px;
  min-height: 34px;
  padding: 5px 8px 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(219, 227, 234, 0.9);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.sidebar-codeword-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 143, 189, 0.38);
}

.sidebar-codeword-toggle.active {
  border-color: rgba(29, 143, 189, 0.42);
  background: linear-gradient(180deg, rgba(220, 236, 243, 0.96), rgba(246, 251, 254, 0.98));
  box-shadow: 0 8px 16px rgba(29, 143, 189, 0.08);
}

.sidebar-codeword-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

.sidebar-codeword-toggle-label {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.sidebar-codeword-badge {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(219, 227, 234, 0.9);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.sidebar-codeword-badge.active {
  border-color: rgba(29, 143, 189, 0.28);
  background: rgba(220, 236, 243, 0.9);
  color: var(--accent-strong);
}

.sidebar-switch-indicator {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: rgba(157, 170, 183, 0.72);
  transition: background-color 0.16s ease;
}

.sidebar-switch-compact .sidebar-switch-indicator {
  width: 30px;
  height: 18px;
}

.sidebar-switch-indicator::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 2px 5px rgba(29, 143, 189, 0.18);
  transition: transform 0.16s ease;
}

.sidebar-switch-compact .sidebar-switch-indicator::after {
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
}

.sidebar-switch.active .sidebar-switch-indicator {
  background: rgba(29, 143, 189, 0.86);
}

.sidebar-switch.active .sidebar-switch-indicator::after {
  transform: translateX(14px);
}

.sidebar-switch-compact.active .sidebar-switch-indicator::after {
  transform: translateX(12px);
}

.sidebar h2 {
  font-size: 17px;
}

.chat-panel h2 {
  font-size: 30px;
  line-height: 0.96;
}

.channel-filters {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 8px;
  margin-top: 8px;
  min-height: 92px;
}

.conversation-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.conversation-search-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.conversation-search-shell.has-create-button {
  grid-template-columns: auto minmax(0, 1fr);
}

.conversation-search-shell .conversation-search {
  min-width: 0;
}

.conversation-search-input-wrap {
  position: relative;
  min-width: 0;
}

.conversation-search-create-button {
  width: 38px;
  height: 38px;
  font-size: 22px;
}

.conversation-search-input {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid rgba(219, 227, 234, 0.9);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.conversation-search-input::-webkit-search-cancel-button,
.conversation-search-input::-webkit-search-decoration {
  display: none;
  -webkit-appearance: none;
}

.conversation-search-input-wrap.has-value .conversation-search-input {
  padding-right: 42px;
}

.conversation-search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(29, 143, 189, 0.12);
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.conversation-search-clear[hidden] {
  display: none;
}

.conversation-search-clear:hover,
.conversation-search-clear:focus-visible {
  background: rgba(29, 143, 189, 0.2);
  color: #0e6f94;
  outline: none;
}

.conversation-search-clear:active {
  transform: translateY(-50%) scale(0.94);
}

.conversation-search-input:focus {
  outline: none;
  border-color: rgba(29, 143, 189, 0.45);
  box-shadow: 0 0 0 3px rgba(29, 143, 189, 0.08);
}

.conversation-search-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(29, 143, 189, 0.18);
  background: rgba(220, 236, 243, 0.72);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.conversation-search-button:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 143, 189, 0.32);
  background: rgba(220, 236, 243, 0.9);
}

.conversation-search-button:focus {
  outline: none;
  border-color: rgba(29, 143, 189, 0.45);
  box-shadow: 0 0 0 3px rgba(29, 143, 189, 0.08);
}

.conversation-search-status {
  margin-top: -2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}

.channel-filter-toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid rgba(219, 227, 234, 0.9);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.channel-filter-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 143, 189, 0.4);
}

.channel-filter-toggle.open {
  background: rgba(250, 252, 254, 0.98);
}

.channel-filter-toggle-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.channel-filter-panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(219, 227, 234, 0.76);
  background: rgba(255, 255, 255, 0.78);
}

.channel-filter-statuses,
.channel-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.channel-filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(219, 227, 234, 0.9);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.channel-filter-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 143, 189, 0.4);
}

.channel-filter-chip.active {
  border-color: rgba(29, 143, 189, 0.34);
  background: rgba(220, 236, 243, 0.96);
  color: var(--accent-strong);
}

.channel-filter-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(8, 35, 47, 0.08);
  font-size: 13px;
  line-height: 1;
}

.channel-filter-label {
  min-width: 0;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(219, 227, 234, 0.76);
  border-radius: 0;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  transform: translate3d(0, var(--conversation-pull-offset, 0px), 0);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.conversation-list.is-pull-refresh-dragging {
  transition: none;
}

.pwa-install-panel {
  display: none;
}

.pwa-install-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: stretch;
  gap: 8px;
}

.pwa-install-button {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(29, 143, 189, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(232, 245, 251, 0.98), rgba(255, 255, 255, 0.96));
  color: var(--accent-strong);
  box-shadow:
    0 10px 22px rgba(29, 143, 189, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  cursor: pointer;
  text-align: left;
}

.pwa-install-dismiss {
  width: 44px;
  min-width: 44px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(29, 143, 189, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--accent-strong);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  box-shadow:
    0 10px 22px rgba(29, 143, 189, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.pwa-install-button:focus-visible,
.pwa-install-dismiss:focus-visible {
  outline: 3px solid rgba(29, 143, 189, 0.28);
  outline-offset: 2px;
}

.pwa-install-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 6px 12px rgba(29, 143, 189, 0.2);
}

.pwa-install-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pwa-install-title {
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
}

.pwa-install-lead {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.22;
}

.conversation-pull-refresh {
  position: relative;
  height: 0;
  flex: 0 0 0;
  z-index: 3;
  pointer-events: none;
}

.conversation-pull-refresh-indicator {
  --conversation-pull-progress: 0;
  --conversation-pull-indicator-offset: 0px;
  --conversation-pull-rotation: 0deg;
  position: absolute;
  top: 10px;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(29, 143, 189, 0.18);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 28px rgba(15, 63, 88, 0.08);
  color: var(--accent-strong);
  opacity: 0;
  transform: translate3d(-50%, calc(-14px + var(--conversation-pull-indicator-offset)), 0) scale(calc(0.94 + var(--conversation-pull-progress) * 0.06));
  transition: opacity 0.16s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.conversation-pull-refresh-indicator.is-visible {
  opacity: 1;
}

.conversation-pull-refresh-indicator.is-dragging {
  transition: opacity 0.1s ease, border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.conversation-pull-refresh-indicator.is-armed {
  border-color: rgba(29, 143, 189, 0.34);
  box-shadow: 0 18px 34px rgba(15, 63, 88, 0.12);
  background: rgba(244, 250, 253, 0.98);
}

.conversation-pull-refresh-indicator.is-refreshing {
  border-color: rgba(29, 143, 189, 0.28);
}

.conversation-pull-refresh-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2.4px solid rgba(29, 143, 189, 0.16);
  border-top-color: rgba(29, 143, 189, 0.94);
  border-radius: 999px;
  transform: rotate(var(--conversation-pull-rotation));
  transition: transform 0.12s linear, border-color 0.16s ease;
}

.conversation-pull-refresh-indicator.is-dragging .conversation-pull-refresh-spinner {
  transition: none;
}

.conversation-pull-refresh-indicator.is-refreshing .conversation-pull-refresh-spinner {
  animation: conversation-pull-refresh-spin 0.78s linear infinite;
}

.conversation-pull-refresh-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

@keyframes conversation-pull-refresh-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.conversation-card {
  width: 100%;
  padding: 11px 13px;
  border: none;
  border-bottom: 1px solid rgba(219, 227, 234, 0.72);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.9);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: none;
  transition: background-color 0.16s ease, border-color 0.16s ease;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}

.conversation-avatar-frame {
  position: relative;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  align-self: center;
  contain: layout paint;
  transform: translateZ(0);
}

.conversation-avatar-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 28%, #f4f7f9 0 26%, #d8e0e7 27% 100%);
  box-shadow:
    inset 0 0 0 1px rgba(118, 135, 148, 0.18),
    0 4px 10px rgba(38, 62, 80, 0.09);
  transform: translateZ(0);
}

.conversation-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.conversation-avatar-fallback {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8b99a6;
}

.conversation-avatar-fallback svg {
  width: 72%;
  height: 72%;
  fill: currentColor;
  display: block;
}

.conversation-avatar-circle.has-image .conversation-avatar-fallback {
  display: none;
}

.conversation-avatar-circle.is-fallback .conversation-avatar-image {
  display: none;
}

.conversation-avatar-circle.is-fallback .conversation-avatar-fallback {
  display: inline-flex;
}

.conversation-avatar-channel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.conversation-avatar-channel .channel-badge {
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  box-shadow: 0 2px 7px rgba(16, 32, 44, 0.18);
}

.conversation-avatar-channel .channel-badge-icon {
  width: 12px;
  height: 12px;
}

.conversation-avatar-channel .channel-badge-textmark {
  font-size: 7px;
}

.conversation-card:first-child {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.conversation-card:last-of-type {
  border-bottom: none;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.conversation-card.active {
  position: relative;
  background:
    linear-gradient(180deg, rgba(228, 239, 246, 0.98), rgba(244, 249, 252, 0.98));
  box-shadow:
    inset 4px 0 0 rgba(29, 143, 189, 0.88),
    inset 0 0 0 1px rgba(29, 143, 189, 0.14),
    0 14px 24px rgba(29, 143, 189, 0.12);
  z-index: 1;
}

.conversation-card.active .conversation-card-top strong {
  color: var(--accent-strong);
}

.conversation-card.active .conversation-time,
.conversation-card.active .conversation-card-bottom p {
  color: color-mix(in srgb, var(--accent-strong) 76%, var(--ink) 24%);
}

.conversation-card:hover {
  background: rgba(245, 249, 252, 0.98);
}

.conversation-card-top,
.bubble-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.bubble-meta {
  justify-content: flex-start;
}

.conversation-card-main {
  min-width: 0;
  flex: 1 1 auto;
}

.conversation-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: nowrap;
}

.conversation-title-text {
  flex: 0 1 auto;
  max-width: 100%;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.conversation-title-phone {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
}

.conversation-inline-number {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

@media (min-width: 761px) {
  .conversation-card-top {
    align-items: flex-start;
  }

  .conversation-title-row {
    flex: 1 1 auto;
    max-width: 100%;
    flex-wrap: wrap;
    row-gap: 0;
  }

  .conversation-title-text:not(.conversation-title-phone) {
    flex: 0 0 auto;
    max-width: 100%;
  }

  .conversation-inline-number {
    flex: 1 1 12ch;
    max-width: 100%;
  }
}

.channel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  color: #fff;
  flex: 0 0 auto;
  line-height: 0;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 1px 2px rgba(34, 55, 71, 0.12);
}

.channel-badge.channel-badge-compact {
  width: 22px;
  height: 22px;
}

.channel-badge-icon {
  width: 15px;
  height: 15px;
  display: block;
  flex: 0 0 auto;
  color: #fff;
  fill: currentColor;
}

.channel-badge-icon:not(.channel-badge-icon-max) * {
  fill: currentColor !important;
}

.channel-badge.channel-badge-compact .channel-badge-icon {
  width: 13px;
  height: 13px;
}

.channel-badge-textmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  color: #fff;
}

.channel-badge.channel-badge-compact .channel-badge-textmark {
  font-size: 8px;
}

.channel-badge-whatsapp {
  background: #25d366;
}

.channel-badge-telegram {
  background: #2a9fdf;
}

.channel-badge-instagram {
  background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af);
}

.channel-badge-viber {
  background: linear-gradient(135deg, #8b7aff, #7360f2 58%, #5946c8);
}

.channel-badge-viber .channel-badge-icon-viber path:nth-child(2) {
  fill: #7360f2 !important;
}

.channel-badge-vk {
  background: #3d7af1;
}

.channel-badge-max {
  background: linear-gradient(135deg, #2fb6ff, #0d6dd8 58%, #0856b5);
}

.channel-badge-wazzup,
.channel-badge-default {
  background: #70828f;
}

.conversation-card-top span,
.conversation-card-bottom,
.bubble-meta span,
.bubble-foot,
.chat-subtitle,
.chat-toolbar-meta,
.visit-empty,
.empty-list {
  color: var(--muted);
}

.conversation-time {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-size: 13px;
  line-height: 1.05;
  white-space: nowrap;
}

.conversation-time-date,
.conversation-time-clock {
  display: block;
}

.conversation-time-date {
  font-size: 0.88em;
}

.conversation-card-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 3px;
  min-height: 42px;
  font-size: 12px;
}

.conversation-card-status {
  display: inline-flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 4px;
  min-width: 64px;
  text-align: right;
}

.conversation-client-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.conversation-client-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
}

.client-status-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.client-status-icon::before {
  content: "";
  display: block;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.client-status-icon.new::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.conversation-client-badge.existing {
  background: rgba(37, 211, 102, 0.12);
  color: var(--success);
}

.conversation-client-badge.new {
  background: rgba(255, 107, 107, 0.12);
  color: var(--warm);
}

.client-status-icon.existing {
  background: rgba(37, 211, 102, 0.16);
  color: var(--success);
}

.client-status-icon.existing::before {
  width: 8px;
  height: 4px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  background: transparent;
  border-radius: 0;
  transform: rotate(-45deg) translateY(-1px);
}

.client-status-icon.new {
  background: rgba(255, 107, 107, 0.16);
  color: var(--warm);
}

.conversation-card p {
  margin-top: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.conversation-preview-media {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
}

.conversation-preview-icon {
  flex: 0 0 auto;
  line-height: 1;
}

.conversation-preview-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-counter,
.conversation-delivered {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.conversation-counter {
  background: var(--warn);
  color: white;
}

.conversation-delivered {
  color: #999999;
}

.conversation-delivered.read {
  color: var(--accent);
}

.conversation-delivered.error {
  color: var(--warn);
}

.conversation-list-note {
  padding: 12px 14px;
  border-top: 1px solid rgba(219, 227, 234, 0.72);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
}

.badge,
.badge-soft,
.badge-warn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  white-space: nowrap;
}

.badge,
.badge-soft {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.badge.warn,
.badge-warn {
  background: rgba(231, 76, 60, 0.14);
  color: var(--warn);
}

.badge.suppressed {
  background: rgba(231, 76, 60, 0.12);
  color: var(--warn);
}

.badge.client-existing {
  background: rgba(37, 211, 102, 0.12);
  color: var(--success);
}

.badge.client-new {
  background: rgba(255, 107, 107, 0.12);
  color: var(--warm);
}

.chat-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.chat-panel.is-transitioning::after {
  content: "Открываю диалог…";
  position: absolute;
  inset: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(6px);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  z-index: 3;
}

.chat-panel.is-transitioning .chat-scroll,
.chat-panel.is-transitioning .assistant-context-strip,
.chat-panel.is-transitioning .assistant-suggestion,
.chat-panel.is-transitioning .chat-composer,
.chat-panel.is-transitioning .chat-toolbar,
.chat-panel.is-transitioning .chat-location-strip,
.chat-panel.is-transitioning .chat-head {
  pointer-events: none;
}

.chat-head-copy {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  width: 100%;
  max-width: none;
}

.chat-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-title-row h2 {
  min-width: 0;
}

.mobile-chat-back-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 14px 30px rgba(29, 143, 189, 0.28);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.mobile-chat-back-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(29, 143, 189, 0.34);
}

.chat-head-topline {
  display: none;
}

.chat-id-button {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.chat-id-button:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.chat-id-button.is-static {
  cursor: default;
  pointer-events: none;
  text-decoration: none;
  color: var(--muted);
}

.chat-head-actions {
  grid-area: actions;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  position: relative;
  z-index: 22;
  overflow: visible;
  justify-content: flex-end;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  margin-bottom: 2px;
  margin-left: auto;
}

.icon-action-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  font-size: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.icon-action-button > span {
  font-size: 15px;
  line-height: 1;
}

.chat-subtitle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 0;
}

.chat-subtitle {
  margin-top: 0;
  font-size: 15px;
  line-height: 1.35;
}

.chat-channel-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  max-height: 52px;
  max-width: 100%;
  opacity: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px 2px 3px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  transition:
    max-height 0.22s ease,
    opacity 0.18s ease,
    margin-top 0.18s ease,
    padding 0.18s ease,
    visibility 0.18s ease;
}

.chat-channel-tabs::-webkit-scrollbar {
  display: none;
}

.chat-channel-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 230px;
  padding: 6px 9px 6px 7px;
  border: 1px solid rgba(185, 207, 221, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(34, 55, 71, 0.06);
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.chat-channel-tab:hover {
  border-color: rgba(29, 143, 189, 0.34);
  background: rgba(235, 246, 251, 0.96);
}

.chat-channel-tab.active {
  border-color: rgba(29, 143, 189, 0.58);
  background: linear-gradient(180deg, rgba(227, 244, 251, 0.98), rgba(245, 251, 255, 0.96));
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(29, 143, 189, 0.08), 0 3px 10px rgba(29, 143, 189, 0.12);
}

.chat-channel-tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-channel-tab-label {
  flex: 0 1 auto;
}

.chat-channel-tab-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff6b6b;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.chat-channel-tab-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  border: 1px solid rgba(29, 143, 189, 0.32);
  border-radius: 999px;
  background: rgba(235, 246, 251, 0.96);
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(29, 143, 189, 0.12);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease;
}

.chat-channel-tab-add:hover,
.chat-channel-tab-add:focus-visible {
  outline: none;
  background: rgba(220, 240, 249, 0.98);
  box-shadow: 0 8px 18px rgba(29, 143, 189, 0.18);
  transform: translateY(-1px);
}

.chat-location-strip {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 12px 14px 14px;
  padding: 13px 16px;
  border: 2px solid #d84b4b;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 232, 238, 0.98), rgba(255, 219, 229, 0.96));
  color: #4f0c17;
  box-shadow:
    0 10px 22px rgba(216, 75, 75, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
  transform-origin: top left;
  transition:
    margin 0.22s ease,
    padding 0.22s ease,
    border-radius 0.22s ease,
    border-width 0.22s ease,
    box-shadow 0.22s ease,
    width 0.22s ease,
    max-width 0.22s ease,
    opacity 0.18s ease;
  will-change: transform, opacity;
}

.chat-location-strip-kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 900;
  color: #a72735;
}

.chat-location-strip-value {
  min-width: 0;
  color: #3f0811;
  font-size: 18px;
  font-weight: 900;
  width: 100%;
  overflow-wrap: anywhere;
}

.chat-location-strip-source {
  color: rgba(79, 12, 23, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.chat-title-identity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chat-title-copy,
.chat-subtitle-copy {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

.chat-title-copy.copied,
.chat-subtitle-copy.copied {
  border-radius: 6px;
  background: rgba(29, 143, 189, 0.12);
}

.copy-text-icon {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72em;
  font-weight: 800;
  line-height: 1;
}

.app-copy-feedback-toast {
  position: fixed;
  z-index: 20000;
  left: 50%;
  top: 50%;
  width: max-content;
  max-width: min(280px, 82vw);
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(12, 29, 39, 0.94);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  box-shadow: 0 14px 34px rgba(12, 29, 39, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.96);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.app-copy-feedback-toast.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.chat-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-badges {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

.chat-badges::-webkit-scrollbar {
  display: none;
}

.badge.badge-icon-only {
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  position: relative;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.badge-icon-counter {
  position: absolute;
  right: -3px;
  top: -3px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: #ff6b6b;
  color: white;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
}

.tooltip-trigger {
  position: relative;
}

.tooltip-trigger::after,
.tooltip-trigger::before {
  content: none;
}

.app-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  max-width: min(240px, calc(100vw - 24px));
  padding: 6px 9px;
  border-radius: 9px;
  background: rgba(29, 143, 189, 0.94);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 4px, 0);
  transition: opacity 0.06s ease, transform 0.06s ease, visibility 0.06s ease;
  z-index: 9999;
}

.app-tooltip:not(.hidden) {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
}

.app-tooltip.multiline {
  white-space: normal;
}

.app-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 8px;
  height: 8px;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(29, 143, 189, 0.94);
}

.app-tooltip.is-bottom::after {
  top: -4px;
  bottom: auto;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.info-card {
  padding: 9px 11px;
  border-radius: 12px;
}

.info-card span,
.visit-card small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.info-card strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.25;
}

.visit-strip {
  display: flex;
  gap: 8px;
  overflow: auto;
  margin-top: 10px;
  padding-bottom: 2px;
}

.visit-card {
  min-width: 175px;
  padding: 9px 11px;
  border-radius: 12px;
}

.details-visit-card {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid rgba(29, 143, 189, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(246, 250, 252, 0.96));
  box-shadow: 0 12px 24px rgba(29, 143, 189, 0.08);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}

.details-visit-card:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 143, 189, 0.32);
}

.details-visit-card.active {
  border-color: rgba(29, 143, 189, 0.62);
  background:
    linear-gradient(180deg, rgba(220, 236, 243, 0.98), rgba(242, 249, 252, 0.96));
  box-shadow: 0 16px 28px rgba(29, 143, 189, 0.16);
}

.visit-card strong {
  font-size: 13px;
}

.details-visit-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.details-visit-head strong {
  font-size: 14px;
  line-height: 1.25;
}

.details-visit-amount {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.details-visit-body {
  margin-top: 8px;
}

.details-visit-salon {
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.details-visit-address {
  color: var(--muted);
}

.visit-card span,
.visit-card p,
.visit-card small {
  margin-top: 4px;
  font-size: 11px;
}

.details-visit-body p {
  line-height: 1.4;
}

.visit-empty {
  padding: 8px 2px 2px;
  font-size: 11px;
}

.chat-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.chat-translate-button {
  flex: 0 0 auto;
  border-color: rgba(216, 75, 75, 0.28);
  background: linear-gradient(135deg, rgba(255, 230, 238, 0.96), rgba(255, 244, 247, 0.92));
  color: #9e2634;
  box-shadow: 0 8px 18px rgba(216, 75, 75, 0.08);
}

.chat-head-actions .chat-translate-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.chat-head-actions .chat-translate-button > span {
  font-size: 15px;
  line-height: 1;
}

.chat-translate-button.active {
  border-color: rgba(216, 75, 75, 0.5);
  background: linear-gradient(135deg, rgba(255, 214, 226, 0.98), rgba(255, 236, 242, 0.96));
  color: #801b28;
}

.chat-translate-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.chat-translation-status {
  flex: 1 1 auto;
  min-width: 0;
  color: #9e2634;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-toolbar-meta {
  flex: 0 0 auto;
  min-width: 0;
  font-size: 12px;
  white-space: nowrap;
}

.chat-search-nav {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
}

.chat-search-nav-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.compact {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 13px;
}

.chat-scroll {
  flex: 1 1 auto;
  margin-top: 8px;
  padding: 10px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 247, 250, 0.9)),
    rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(219, 227, 234, 0.7);
  min-height: 0;
  height: auto;
  overflow: auto;
  overscroll-behavior: contain;
  overscroll-behavior-x: none;
}

.assistant-context-strip {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(29, 143, 189, 0.12);
  background: rgba(243, 249, 252, 0.88);
  min-height: 0;
  overflow: hidden;
}

.assistant-context-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.assistant-context-head-copy {
  min-width: 0;
}

.assistant-context-head-title {
  display: inline-flex;
  align-items: center;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.assistant-suggestion {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(29, 143, 189, 0.18);
  background:
    linear-gradient(180deg, rgba(237, 247, 251, 0.96), rgba(250, 252, 254, 0.98));
  box-shadow: 0 14px 28px rgba(29, 143, 189, 0.08);
  min-height: 112px;
  flex: 0 0 auto;
  overflow: hidden;
}

.assistant-context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px 6px;
  min-width: 0;
}

.assistant-context-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 4px 5px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
}

.assistant-context-label {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
  white-space: normal;
}

.assistant-context-value {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: 11px;
  line-height: 1.15;
  color: var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.assistant-context-item.missing .assistant-context-value {
  color: #e74c3c;
}

.assistant-context-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 36px;
}

.assistant-context-actions-spacer {
  display: block;
  width: 1px;
  height: 36px;
  opacity: 0;
}

.assistant-suggestion-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.assistant-suggestion-head-copy {
  min-width: 0;
}

.assistant-suggestion-kicker {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assistant-suggestion-summary {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.assistant-suggestion-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(29, 143, 189, 0.12);
  color: var(--accent-strong);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.assistant-suggestion-body {
  margin-top: 5px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
  min-height: 44px;
  overflow-wrap: anywhere;
}

.assistant-suggestion-body.loading {
  min-height: 48px;
  display: flex;
  align-items: center;
}

.message-help-ai-preview {
  border: 1px solid rgba(29, 143, 189, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 248, 252, 0.96));
  color: #000;
  font-weight: 500;
}

.message-help-ai-source {
  display: grid;
  gap: 3px;
  margin-top: 7px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(219, 227, 234, 0.68);
}

.message-help-ai-source span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.message-help-ai-source strong {
  color: #000;
  font-size: 13px;
  font-weight: 800;
}

.message-help-ai-source p {
  margin: 0;
  color: #000;
  font-size: 13px;
  line-height: 1.35;
}

.assistant-suggestion-loading-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.assistant-loading-inline-bullet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(29, 143, 189, 0.08);
}

.assistant-suggestion-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
  position: relative;
  z-index: 1;
}

.chat-composer {
  --composer-input-min-height: 64px;
  --composer-input-max-height: 136px;
  --composer-attachment-button-width: 48px;
  --composer-send-button-width: auto;
  display: grid;
  grid-template-columns: var(--composer-attachment-button-width) minmax(0, 1fr) var(--composer-send-button-width);
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(219, 227, 234, 0.7);
  min-height: calc(var(--composer-input-min-height) + 8px);
  align-items: end;
  flex: 0 0 auto;
}

.chat-attachment-wrap {
  position: relative;
  align-self: end;
}

.chat-attachment-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--composer-attachment-button-width);
  height: var(--composer-input-min-height);
  min-height: var(--composer-input-min-height);
  max-height: var(--composer-input-min-height);
  border: 1px solid rgba(29, 143, 189, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 245, 251, 0.94));
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.chat-attachment-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.chat-attachment-button:focus-visible {
  outline: 3px solid rgba(29, 143, 189, 0.34);
  outline-offset: 2px;
}

.chat-attachment-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 24;
  display: grid;
  width: min(260px, calc(100vw - 32px));
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(29, 143, 189, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(29, 143, 189, 0.12), transparent 36%),
    rgba(255, 255, 255, 0.98);
  box-shadow:
    0 22px 48px rgba(11, 38, 52, 0.18),
    0 2px 8px rgba(29, 143, 189, 0.12);
  transform-origin: left bottom;
  animation: chatAttachmentMenuIn 150ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.chat-attachment-menu.hidden {
  display: none !important;
}

.chat-attachment-menu button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #07121c;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
}

.chat-attachment-menu button:hover,
.chat-attachment-menu button:focus-visible {
  background: rgba(29, 143, 189, 0.1);
  outline: none;
}

.chat-attachment-input {
  display: none;
}

.chat-composer-input {
  display: block;
  width: 100%;
  height: var(--composer-input-min-height);
  min-height: var(--composer-input-min-height);
  max-height: var(--composer-input-max-height);
  resize: none;
  overflow-y: hidden;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(219, 227, 234, 0.9);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}

.chat-composer-input:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.chat-composer-input:read-only {
  cursor: progress;
}

#chat-send-button {
  height: var(--composer-input-min-height);
  min-height: var(--composer-input-min-height);
  max-height: var(--composer-input-min-height);
  align-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: 14px;
}

.chat-send-icon {
  display: none;
}

.scroll-to-bottom-button {
  position: absolute;
  right: 18px;
  bottom: 98px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 14px 30px rgba(29, 143, 189, 0.28);
  cursor: pointer;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  transition: opacity 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.scroll-to-bottom-button.hidden {
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px) scale(0.94);
}

.scroll-to-bottom-button:not(.hidden):hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(29, 143, 189, 0.34);
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.bubble-row {
  display: flex;
}

.bubble-row.search-current {
  position: relative;
}

.bubble-row.search-focus-flash .bubble {
  box-shadow: 0 0 0 3px rgba(29, 143, 189, 0.34), 0 14px 28px rgba(29, 143, 189, 0.14);
}

.bubble-row.message-help-active .bubble {
  border-color: rgba(29, 143, 189, 0.45);
  box-shadow:
    0 0 0 3px rgba(29, 143, 189, 0.12),
    0 14px 28px rgba(29, 143, 189, 0.16);
}

.day-divider {
  display: flex;
  justify-content: center;
  margin: 8px 0 4px;
}

.day-divider span {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(29, 143, 189, 0.1);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.visit-event-row {
  display: flex;
  justify-content: center;
  margin: 4px 0 6px;
}

.visit-event-card {
  width: 86%;
  max-width: 680px;
  padding: 11px 14px 12px;
  border: 1px solid rgba(217, 58, 74, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 244, 247, 0.96), rgba(245, 251, 255, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 14px 30px rgba(217, 58, 74, 0.09);
}

.visit-event-kicker {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 7px;
  color: #b53a46;
  color: color-mix(in srgb, var(--warm) 76%, var(--ink) 24%);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  min-width: 0;
}

.visit-event-kicker strong {
  color: var(--warm);
  text-transform: uppercase;
}

.visit-event-kicker .visit-event-time {
  color: var(--warm);
  font-weight: 800;
  white-space: nowrap;
}

.visit-event-kicker .visit-event-author {
  color: var(--muted);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visit-event-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--warm);
  box-shadow: 0 0 0 5px rgba(217, 58, 74, 0.11);
}

.visit-event-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 16px;
  margin-top: 9px;
}

.visit-event-line {
  min-width: 0;
}

.visit-event-line span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.visit-event-line strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.bubble-row.inbound {
  justify-content: flex-start;
}

.bubble-row.outbound {
  justify-content: flex-end;
}

.bubble {
  max-width: min(72ch, 78%);
  padding: 10px 12px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
}

.bubble-row.inbound .bubble {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.bubble-row.inbound .bubble,
.bubble-row.inbound .bubble * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.bubble.search-hit {
  border: 1px solid rgba(29, 143, 189, 0.35);
}

.bubble.search-current {
  border: 1px solid rgba(29, 143, 189, 0.58);
  background: linear-gradient(180deg, rgba(230, 240, 255, 0.98), rgba(245, 247, 250, 0.98));
  box-shadow: 0 10px 22px rgba(29, 143, 189, 0.12);
}

.bubble-row.outbound .bubble {
  background: linear-gradient(180deg, rgba(220, 236, 243, 0.96), rgba(245, 251, 255, 0.95));
}

.bubble.translated,
.bubble-row.outbound .bubble.translated {
  border: 1px solid rgba(218, 170, 40, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 252, 230, 0.98), rgba(255, 247, 211, 0.98));
}

.bubble-row.outbound .bubble.send-error {
  border: 1px solid rgba(217, 58, 74, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 239, 243, 0.98), rgba(255, 246, 248, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(217, 58, 74, 0.08),
    0 12px 26px rgba(217, 58, 74, 0.12);
}

.bubble.call-event-bubble,
.bubble-row.outbound .bubble.call-event-bubble {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 250, 0.98));
  border: 1px solid rgba(29, 143, 189, 0.32);
  box-shadow: 0 8px 18px rgba(29, 143, 189, 0.08);
}

.bubble-row.outbound .bubble.search-current {
  background: linear-gradient(180deg, rgba(230, 240, 255, 0.98), rgba(245, 247, 250, 0.98));
}

.bubble-meta {
  align-items: baseline;
  margin-bottom: 5px;
  font-size: 12px;
}

.bubble-row.outbound .bubble-meta {
  justify-content: flex-end;
  text-align: right;
}

.message-author-label {
  font-weight: 700;
}

.message-copy-token {
  position: relative;
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

.message-copy-token {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.message-copy-token.copied {
  border-radius: 5px;
  background: rgba(29, 143, 189, 0.14);
}

.message-text-link {
  color: #146f9a;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.message-translation-marker {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  color: #745800;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.bubble-row.inbound .message-translation-marker {
  justify-content: flex-start;
}

.message-translation-marker-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 4px 12px rgba(139, 105, 8, 0.1);
}

.message-translation-original-button {
  border: 1px solid rgba(176, 132, 20, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #5d4700;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 9px;
}

.message-translation-original-button:hover,
.message-translation-original-button:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(176, 132, 20, 0.5);
}

.message-service-notice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #66747c;
  font-size: 14px;
  font-weight: 700;
}

.message-service-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: rgba(29, 143, 189, 0.14);
  color: #1d6f91;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.message-attachment-placeholder {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 100%;
  color: #5f6d75;
}

.message-attachment-placeholder-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: rgba(29, 143, 189, 0.14);
  color: #1d6f91;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.message-attachment-placeholder-copy {
  display: grid;
  gap: 4px;
}

.message-attachment-placeholder-copy strong {
  font-weight: 750;
}

.message-attachment-placeholder-caption {
  color: #2d363b;
}

.bubble-body {
  font-size: 15px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

.message-media-button {
  display: inline-block;
  max-width: min(100%, 280px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: zoom-in;
  font: inherit;
  line-height: 0;
}

.message-media-image {
  display: block;
  max-width: 100%;
  max-height: 360px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px rgba(45, 35, 24, 0.12);
}

.message-media-button:focus-visible {
  outline: 3px solid rgba(29, 143, 189, 0.42);
  outline-offset: 3px;
}

.message-media-caption {
  margin-top: 8px;
}

.message-video-card {
  display: block;
  max-width: min(100%, 320px);
  overflow: hidden;
  border-radius: 16px;
  background: rgba(5, 16, 24, 0.08);
  box-shadow: 0 8px 18px rgba(45, 35, 24, 0.12);
}

.message-video-player {
  display: block;
  width: 100%;
  max-height: 360px;
  border-radius: 16px;
  background: #07121c;
}

.message-audio-button {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: min(100%, 320px);
  padding: 12px 14px;
  border: 1px solid rgba(29, 143, 189, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(233, 246, 252, 0.96), rgba(215, 234, 244, 0.94));
  color: #113043;
  cursor: pointer;
  text-align: left;
  box-shadow:
    0 10px 24px rgba(29, 143, 189, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.message-audio-button:focus-visible {
  outline: 3px solid rgba(29, 143, 189, 0.42);
  outline-offset: 3px;
}

.message-audio-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d8fbd, #155f80);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(21, 95, 128, 0.24);
}

.message-audio-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.message-audio-copy strong {
  font-size: 14px;
  font-weight: 800;
  color: #113043;
}

.message-audio-copy span {
  font-size: 12px;
  line-height: 1.35;
  color: rgba(17, 48, 67, 0.78);
}

.message-audio-caption {
  margin-top: 8px;
}

.message-sticker-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: min(100%, 340px);
  padding: 11px 12px;
  border: 1px solid rgba(29, 143, 189, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(29, 143, 189, 0.16), transparent 40%),
    rgba(255, 255, 255, 0.9);
  color: #07121c;
  box-shadow:
    0 10px 24px rgba(29, 143, 189, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.message-sticker-animation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 86px;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(135deg, #eaf7ef, #d6eef8);
}

.message-sticker-animation svg {
  width: 100% !important;
  height: 100% !important;
}

.message-sticker-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eaf7ef, #d6eef8);
  color: var(--accent-strong);
  font-size: 20px;
  font-weight: 900;
}

.message-sticker-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.message-sticker-copy strong {
  color: #07121c;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
}

.message-sticker-link {
  color: rgba(7, 18, 28, 0.72);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.message-sticker-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.message-media-modal {
  position: fixed;
  inset: 0;
  z-index: 12200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.message-media-modal.hidden {
  display: none !important;
}

.message-media-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 16, 24, 0.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 180ms ease;
}

.message-media-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1120px, calc(100vw - 48px));
  height: min(860px, calc(var(--viewport-height) - 48px));
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.2), transparent 36%),
    rgba(9, 21, 30, 0.9);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.42),
    0 8px 22px rgba(29, 143, 189, 0.18);
  animation: messageMediaModalIn 180ms cubic-bezier(0.2, 0.9, 0.2, 1);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease;
  will-change: transform, opacity;
}

.message-media-modal.is-dragging .message-media-modal-backdrop,
.message-media-modal.is-dragging .message-media-modal-panel {
  transition: none;
}

.message-media-modal-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
}

.message-media-modal-stage.is-pannable {
  cursor: grab;
}

.message-media-modal-stage.is-pannable:active {
  cursor: grabbing;
}

.message-media-modal-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: none;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

.message-media-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #07121c;
  cursor: pointer;
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.message-media-modal-close:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.64);
  outline-offset: 3px;
}

body.message-media-modal-open {
  overflow: hidden;
}

.message-audio-modal {
  position: fixed;
  inset: 0;
  z-index: 12220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.message-audio-modal.hidden {
  display: none !important;
}

.message-audio-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 16, 24, 0.56);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.message-audio-modal-panel {
  position: relative;
  z-index: 1;
  width: min(460px, calc(100vw - 48px));
  padding: 28px 24px 24px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    radial-gradient(circle at top left, rgba(29, 143, 189, 0.18), transparent 42%),
    rgba(8, 18, 27, 0.94);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.42),
    0 10px 28px rgba(29, 143, 189, 0.16);
  animation: messageMediaModalIn 180ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.message-audio-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #07121c;
  cursor: pointer;
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.message-audio-modal-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.message-audio-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d8fbd, #0f5e82);
  color: #fff;
  font-size: 30px;
  box-shadow:
    0 16px 28px rgba(29, 143, 189, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.message-audio-modal-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(151, 218, 244, 0.9);
}

.message-audio-modal-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  color: #fff;
}

.message-audio-modal-subtitle {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(223, 236, 243, 0.82);
}

.message-audio-player {
  width: min(100%, 360px);
  margin-top: 6px;
  accent-color: #1d8fbd;
}

body.message-audio-modal-open {
  overflow: hidden;
}

.message-attachment-link {
  color: #1f5b87;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.call-message-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  font-size: 15px;
  vertical-align: text-top;
}

.call-message-text {
  display: inline;
}

.call-event-bubble .bubble-meta strong {
  color: #167a9c;
}

.message-search-mark {
  padding: 0 2px;
  border-radius: 4px;
  background: rgba(29, 143, 189, 0.72);
  color: inherit;
}

.bubble-foot {
  margin-top: 6px;
  font-size: 11px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  line-height: 1.15;
}

.bubble-time {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.no-reply-button {
  margin-top: 8px;
  color: white;
  background: linear-gradient(135deg, #e74c3c, #c62828);
  border: none;
  font-weight: 700;
}

.no-reply-button:hover {
  transform: translateY(-1px);
}

.restore-reply-button {
  margin-top: 8px;
  color: white;
  background: linear-gradient(135deg, #25d366, #1f9d57);
  border: none;
  font-weight: 700;
}

.restore-reply-button:hover {
  transform: translateY(-1px);
}

.no-reply-marker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-end;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(198, 40, 40, 0.18);
  background: rgba(231, 76, 60, 0.09);
  color: #9f1f18;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.bubble-row.inbound .no-reply-marker {
  align-self: flex-start;
}

.no-reply-marker-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(231, 76, 60, 0.14);
  font-size: 11px;
}

.message-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  min-width: 18px;
  min-height: 16px;
  font-size: 12px;
  font-weight: 700;
}

.message-status.sent,
.message-status.delivered {
  color: #999999;
}

.message-status.read {
  color: var(--accent);
}

.message-status-label {
  color: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.message-status.local,
.message-status.plain {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.message-status.error {
  gap: 5px;
  color: #d93a4a;
}

.message-status-error-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #e6495c;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.history-cap {
  align-self: center;
  margin: 0 auto 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 107, 107, 0.12);
  color: var(--warm);
  font-size: 12px;
  font-weight: 700;
}

.message-help-popover {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 12000;
  display: grid;
  width: min(310px, calc(100vw - 20px));
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(29, 143, 189, 0.2);
  border-radius: 20px;
  background:
    radial-gradient(circle at top left, rgba(29, 143, 189, 0.2), transparent 42%),
    rgba(255, 255, 255, 0.94);
  box-shadow:
    0 22px 46px rgba(34, 55, 71, 0.22),
    0 6px 16px rgba(29, 143, 189, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: auto;
  transform-origin: 50% 100%;
}

.message-help-popover.is-open {
  animation: messageHelpPopoverIn 180ms cubic-bezier(0.2, 0.9, 0.2, 1.18);
}

.message-help-action {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 42px;
  padding: 10px 14px;
  border: none;
  border-radius: 15px;
  background: rgba(220, 236, 243, 0.82);
  color: #000;
  cursor: pointer;
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  transition:
    background-color 0.14s ease,
    transform 0.14s ease,
    box-shadow 0.14s ease;
}

.message-help-action-icon,
.message-help-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.message-help-action:hover,
.message-help-action:focus-visible {
  outline: none;
  background: rgba(198, 225, 238, 0.96);
  box-shadow: inset 0 0 0 1px rgba(29, 143, 189, 0.18);
  transform: translateY(-1px);
}

.message-help-action:disabled,
.message-help-action[aria-disabled="true"] {
  cursor: not-allowed;
  color: rgba(34, 43, 51, 0.48);
  background: rgba(230, 235, 239, 0.88);
  box-shadow: none;
  opacity: 0.82;
  transform: none;
}

.message-help-action:disabled .message-help-action-icon,
.message-help-action[aria-disabled="true"] .message-help-action-icon,
.message-help-ai-forward-disabled .message-help-button-icon {
  color: rgba(34, 43, 51, 0.48);
  background: rgba(255, 255, 255, 0.62);
}

.message-help-action:disabled:hover,
.message-help-action[aria-disabled="true"]:hover,
.message-help-action:disabled:focus-visible,
.message-help-action[aria-disabled="true"]:focus-visible {
  background: rgba(230, 235, 239, 0.88);
  box-shadow: none;
  transform: none;
}

.conversation-create-modal {
  position: fixed;
  inset: 0;
  z-index: 12250;
  display: grid;
  place-items: center;
  padding: 24px;
}

.conversation-create-modal.hidden {
  display: none !important;
}

.conversation-create-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 18, 28, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.conversation-create-panel {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid rgba(185, 207, 221, 0.86);
  border-radius: 26px;
  background:
    radial-gradient(circle at top left, rgba(29, 143, 189, 0.16), transparent 44%),
    rgba(255, 255, 255, 0.96);
  box-shadow:
    0 32px 90px rgba(7, 18, 28, 0.24),
    0 10px 28px rgba(29, 143, 189, 0.12);
  animation: conversationCreatePanelIn 180ms cubic-bezier(0.2, 0.9, 0.2, 1.12);
}

.conversation-create-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
}

.conversation-create-kicker {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.conversation-create-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 27px;
  font-weight: 900;
  line-height: 1.03;
}

.conversation-create-head p:not(.conversation-create-kicker) {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.conversation-create-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(185, 207, 221, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  cursor: pointer;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.conversation-create-form {
  display: grid;
  gap: 13px;
}

.conversation-create-field {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.conversation-create-field input,
.conversation-create-field select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(185, 207, 221, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
}

.conversation-create-field input:focus,
.conversation-create-field select:focus {
  outline: none;
  border-color: rgba(29, 143, 189, 0.62);
  box-shadow: 0 0 0 4px rgba(29, 143, 189, 0.12);
}

.conversation-create-channel-field {
  gap: 9px;
}

.conversation-create-channel-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 8px 11px;
  border: 1px solid rgba(185, 207, 221, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
}

.conversation-create-channel-toggle:focus-visible {
  outline: none;
  border-color: rgba(29, 143, 189, 0.62);
  box-shadow: 0 0 0 4px rgba(29, 143, 189, 0.12);
}

.conversation-create-channel-toggle.open .conversation-create-channel-arrow {
  transform: rotate(180deg);
}

.conversation-create-channel-selected {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.conversation-create-channel-arrow {
  color: var(--accent-strong);
  font-size: 18px;
  line-height: 1;
  transition: transform 0.14s ease;
}

.conversation-create-channel-list {
  display: grid;
  gap: 8px;
  max-height: min(42vh, 330px);
  overflow: auto;
  padding: 2px;
}

.conversation-create-channel-option {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid rgba(185, 207, 221, 0.82);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
  transition: border-color 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease;
}

.conversation-create-channel-option:hover,
.conversation-create-channel-option:focus-visible {
  outline: none;
  border-color: rgba(29, 143, 189, 0.45);
  background: rgba(239, 248, 252, 0.96);
}

.conversation-create-channel-option.selected {
  border-color: rgba(29, 143, 189, 0.62);
  background: rgba(228, 244, 251, 0.96);
  box-shadow: inset 0 0 0 1px rgba(29, 143, 189, 0.12);
}

.conversation-create-channel-option .channel-badge.channel-badge-compact {
  width: 18px;
  height: 18px;
}

.conversation-create-channel-option .channel-badge.channel-badge-compact .channel-badge-icon {
  width: 11px;
  height: 11px;
}

.conversation-create-channel-option .channel-badge.channel-badge-compact .channel-badge-textmark {
  font-size: 7px;
}

.conversation-create-channel-flag {
  font-size: 16px;
  line-height: 1;
}

.conversation-create-channel-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-create-client {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(185, 207, 221, 0.72);
  border-radius: 18px;
  background: rgba(240, 247, 250, 0.84);
}

.conversation-create-client strong,
.conversation-create-client span {
  display: block;
}

.conversation-create-client strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.conversation-create-client span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.conversation-create-error,
.conversation-create-conflicts {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid rgba(212, 75, 65, 0.24);
  border-radius: 16px;
  background: rgba(255, 238, 238, 0.88);
  color: #8f2f2a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.conversation-create-conflicts p {
  margin: 0 0 8px;
}

.conversation-create-conflicts ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.conversation-create-conflicts li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #5e201d;
}

.conversation-create-conflicts span {
  color: #8f2f2a;
}

.conversation-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

body.conversation-create-modal-open {
  overflow: hidden;
}

@keyframes conversationCreatePanelIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message-forward-sheet {
  position: fixed;
  inset: 0;
  z-index: 12100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.message-forward-sheet.hidden {
  display: none !important;
}

.message-forward-sheet.message-help-ai-sheet-open {
  align-items: center;
  padding: 24px;
}

.message-forward-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 18, 28, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.message-forward-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(420px, 100%);
  max-height: min(78vh, 620px);
  gap: 12px;
  padding: 10px 12px 14px;
  border-radius: 26px;
  border: 1px solid rgba(219, 227, 234, 0.78);
  background:
    radial-gradient(circle at top left, rgba(29, 143, 189, 0.16), transparent 38%),
    rgba(255, 255, 255, 0.96);
  box-shadow:
    0 28px 56px rgba(7, 18, 28, 0.24),
    0 8px 20px rgba(29, 143, 189, 0.12);
  animation: messageForwardSheetIn 210ms cubic-bezier(0.2, 0.9, 0.2, 1.04);
  overflow: auto;
}

.message-help-ai-sheet {
  width: min(760px, 100%);
  max-height: min(86vh, 760px);
}

.pwa-install-modal {
  position: fixed;
  inset: 0;
  z-index: 12300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.pwa-install-modal.hidden {
  display: none !important;
}

.pwa-install-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 18, 28, 0.34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pwa-install-sheet {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: min(86vh, 760px);
  display: grid;
  gap: 12px;
  padding: 12px 14px 16px;
  overflow: auto;
  border: 1px solid rgba(219, 227, 234, 0.82);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(29, 143, 189, 0.16), transparent 38%),
    rgba(255, 255, 255, 0.98);
  box-shadow:
    0 30px 70px rgba(7, 18, 28, 0.25),
    0 8px 20px rgba(29, 143, 189, 0.12);
  animation: messageForwardSheetIn 210ms cubic-bezier(0.2, 0.9, 0.2, 1.04);
}

.pwa-install-confirm-sheet {
  max-width: 420px;
}

.pwa-install-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pwa-install-sheet-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.08;
}

.pwa-install-sheet-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.pwa-install-close {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(219, 227, 234, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-strong);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.pwa-install-image {
  width: 100%;
  height: auto;
  border: 1px solid rgba(219, 227, 234, 0.82);
  border-radius: 18px;
  background: #f3f9fc;
}

.pwa-install-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pwa-install-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.pwa-install-steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(29, 143, 189, 0.14);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.pwa-install-note {
  margin: 0;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(255, 241, 214, 0.78);
  color: #5f4310;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.32;
}

.pwa-install-done {
  justify-self: stretch;
  min-height: 42px;
}

.pwa-install-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pwa-install-confirm-actions button {
  min-height: 44px;
  justify-content: center;
}

.pwa-install-confirm-hide {
  color: #b93640;
  border-color: rgba(216, 73, 83, 0.32);
  background: rgba(255, 239, 241, 0.86);
}

.message-forward-handle {
  width: 42px;
  height: 4px;
  justify-self: center;
  border-radius: 999px;
  background: rgba(94, 108, 117, 0.28);
}

.message-forward-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.message-forward-kicker {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.message-forward-head h3 {
  margin: 0;
  color: #000;
  font-size: 22px;
  line-height: 1.08;
}

.message-forward-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: rgba(220, 236, 243, 0.86);
  color: #000;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.message-forward-preview {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(241, 248, 251, 0.92);
  border: 1px solid rgba(29, 143, 189, 0.12);
}

.message-forward-preview span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.message-forward-preview p {
  margin: 0;
  color: #000;
  font-size: 15px;
  line-height: 1.35;
}

.message-help-ai-message {
  gap: 6px;
}

.message-help-ai-message strong {
  color: #000;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.message-help-ai-message p {
  max-height: min(34vh, 260px);
  overflow: auto;
  white-space: pre-wrap;
}

.message-help-ai-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
  gap: 12px;
  align-items: start;
}

.message-help-ai-draft-column {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.message-help-ai-draft {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(29, 143, 189, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(247, 253, 255, 0.98), rgba(232, 245, 251, 0.98));
  color: #000;
  box-shadow: 0 10px 24px rgba(29, 143, 189, 0.1);
}

.message-help-ai-draft-head {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.message-help-ai-draft-text {
  min-height: 72px;
  outline: none;
  color: #000;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.38;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-help-ai-draft-text.editing {
  min-height: 108px;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(29, 143, 189, 0.24),
    0 0 0 3px rgba(150, 210, 234, 0.18);
}

.message-help-ai-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.message-help-ai-edit {
  min-height: 44px;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.message-help-ai-forward-disabled {
  min-height: 44px;
  justify-content: center;
  gap: 8px;
  border-color: rgba(148, 163, 177, 0.42) !important;
  background: rgba(229, 234, 238, 0.94) !important;
  color: rgba(34, 43, 51, 0.52) !important;
  cursor: not-allowed;
  box-shadow: none !important;
  opacity: 1;
  transform: none !important;
}

.message-help-ai-forward-disabled:hover,
.message-help-ai-forward-disabled:focus-visible {
  border-color: rgba(148, 163, 177, 0.42) !important;
  background: rgba(229, 234, 238, 0.94) !important;
  box-shadow: none !important;
  transform: none !important;
}

.message-help-ai-close {
  min-height: 44px;
  justify-content: center;
}

.message-help-ai-status {
  margin: 0;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(232, 236, 240, 0.9);
  color: rgba(34, 43, 51, 0.72);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

@media (max-width: 760px) {
  .message-forward-sheet.message-help-ai-sheet-open {
    align-items: flex-end;
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .message-help-ai-sheet {
    width: 100%;
    max-height: min(86vh, 760px);
    border-radius: 24px 24px 20px 20px;
  }

  .message-help-ai-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .message-help-ai-message p {
    max-height: min(24vh, 180px);
  }

  .message-help-ai-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .message-help-ai-draft-text {
    min-height: 88px;
    font-size: 15px;
  }
}

.message-forward-list {
  display: grid;
  gap: 8px;
}

.message-forward-contact {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(219, 227, 234, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  color: #000;
  text-align: left;
  transition:
    border-color 0.14s ease,
    box-shadow 0.14s ease,
    transform 0.14s ease;
}

.message-forward-contact.selected {
  border-color: rgba(29, 143, 189, 0.42);
  box-shadow:
    inset 0 0 0 1px rgba(29, 143, 189, 0.24),
    0 10px 22px rgba(29, 143, 189, 0.12);
  transform: translateY(-1px);
}

.message-forward-contact-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.message-forward-contact-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.message-forward-contact-copy strong {
  color: #000;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
}

.message-forward-contact-copy span {
  color: #000;
  font-size: 13px;
  line-height: 1.25;
  opacity: 0.74;
}

.message-forward-status {
  margin: 0;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(234, 247, 239, 0.92);
  color: #0e5d33;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

@keyframes messageHelpPopoverIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes messageForwardSheetIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes messageMediaModalIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes chatAttachmentMenuIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  overflow: auto;
  background:
    radial-gradient(circle at 18% 12%, rgba(29, 143, 189, 0.22), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(255, 107, 107, 0.18), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #eef7fb 100%);
  -webkit-overflow-scrolling: touch;
}

.auth-card {
  width: min(460px, calc(100vw - 36px));
  padding: 30px;
  border: 1px solid rgba(29, 143, 189, 0.2);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(18, 60, 78, 0.18);
  animation: auth-card-in 180ms ease-out;
}

.auth-kicker {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-card h1 {
  font-size: clamp(30px, 6vw, 42px);
  line-height: 1;
}

.auth-description {
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.35;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.auth-field {
  display: grid;
  gap: 7px;
  color: #000;
  font-size: 14px;
  font-weight: 800;
}

.auth-field input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid rgba(29, 143, 189, 0.24);
  border-radius: 18px;
  background: #fff;
  color: #000;
  font-size: 20px;
  outline: none;
}

.auth-field input:focus {
  border-color: rgba(29, 143, 189, 0.72);
  box-shadow: 0 0 0 4px rgba(29, 143, 189, 0.12);
}

.auth-error {
  padding: 10px 12px;
  border: 1px solid rgba(255, 107, 107, 0.38);
  border-radius: 14px;
  background: rgba(255, 107, 107, 0.1);
  color: #aa2f2f;
  font-size: 14px;
  font-weight: 800;
}

.auth-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.auth-submit {
  min-height: 48px;
  padding-inline: 22px;
  font-size: 15px;
  font-weight: 800;
}

.auth-change-phone {
  min-height: 48px;
  font-weight: 800;
}

.auth-language-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(219, 227, 234, 0.9);
}

.auth-language-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(29, 143, 189, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #000;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.auth-language-button:hover,
.auth-language-button.active {
  border-color: rgba(29, 143, 189, 0.5);
  background: rgba(220, 236, 243, 0.98);
}

.auth-language-button.active {
  box-shadow: inset 0 0 0 1px rgba(29, 143, 189, 0.22);
}

.auth-language-flag {
  font-size: 18px;
  line-height: 1;
}

.auth-language-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes auth-card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hidden {
  display: none !important;
}

.empty-chat,
.empty-list {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  line-height: 1.35;
  font-size: 14px;
}

@media (max-width: 760px) {
  body {
    overflow: hidden;
  }

  .auth-overlay {
    align-items: start;
    place-items: start stretch;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  .auth-card {
    width: 100%;
    max-width: none;
    min-height: calc(var(--viewport-height) - max(24px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(22px, 7vw, 34px) 18px 18px;
    border-radius: 24px;
  }

  .auth-kicker {
    font-size: 11px;
  }

  .auth-card h1 {
    font-size: clamp(34px, 10vw, 44px);
    letter-spacing: -0.02em;
  }

  .auth-description {
    max-width: 320px;
    font-size: 17px;
  }

  .auth-form {
    gap: 13px;
    margin-top: 24px;
  }

  .auth-field {
    font-size: 15px;
  }

  .auth-field input {
    min-height: 58px;
    border-radius: 20px;
    font-size: 20px;
  }

  .auth-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .auth-submit,
  .auth-change-phone {
    width: 100%;
    min-height: 54px;
    justify-content: center;
    font-size: 16px;
  }

  .auth-language-switcher {
    margin-top: auto;
    padding-top: 18px;
  }

  .auth-language-button {
    min-height: 46px;
    gap: 5px;
    padding-inline: 7px;
    font-size: 12px;
  }

  .auth-language-flag {
    font-size: 17px;
  }

  .message-media-modal {
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .message-audio-modal {
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .message-media-modal-panel {
    width: calc(100vw - 20px);
    height: calc(var(--viewport-height) - 20px);
    max-height: calc(var(--viewport-height) - 20px);
    border-radius: 20px;
  }

  .message-audio-modal-panel {
    width: calc(100vw - 20px);
    padding: 24px 16px 18px;
    border-radius: 22px;
  }

  .message-media-modal-stage {
    padding: 10px;
  }

  .message-media-modal-close {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    font-size: 29px;
  }

  .message-audio-modal-close {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    font-size: 28px;
  }

  .message-audio-modal-title {
    font-size: 24px;
  }

  .message-audio-player {
    width: 100%;
  }

  .app-shell {
    width: 100vw;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
    height: var(--viewport-height);
    max-height: var(--viewport-height);
    min-height: var(--viewport-height);
  }

  .workspace {
    grid-template-columns: 1fr;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  .workspace.details-open {
    grid-template-columns: 1fr;
  }

  .service-launchpad-card {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar,
  .chat-panel,
  .details-panel {
    overflow: hidden;
  }

  .conversation-list,
  .chat-scroll,
  .details-panel-scroll {
    overflow: auto;
  }
}

@media (max-width: 760px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    display: block;
    width: 100vw;
    margin: 0;
    height: var(--viewport-height);
    max-height: var(--viewport-height);
    min-height: var(--viewport-height);
    padding: 0;
    gap: 0;
  }

  .topbar,
  .service-launchpad {
    display: none !important;
  }

  .pwa-install-panel:not(.hidden) {
    display: block;
    width: 100%;
    margin: 0 0 8px;
  }

  .pwa-install-card {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
  }

  .pwa-install-button {
    min-height: 50px;
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 8px 10px;
    border-radius: 14px;
  }

  .pwa-install-dismiss {
    width: 42px;
    min-width: 42px;
    min-height: 50px;
    padding: 0 11px;
    border-radius: 14px;
    font-size: 27px;
  }

  .pwa-install-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }

  .pwa-install-title {
    font-size: 15px;
  }

  .pwa-install-lead {
    font-size: 12px;
  }

  .pwa-install-modal {
    padding: 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .pwa-install-sheet {
    width: 100%;
    max-height: min(88vh, 720px);
    border-radius: 22px;
  }

  .pwa-install-confirm-actions {
    grid-template-columns: 1fr;
  }

  .workspace {
    display: block;
    position: relative;
    height: var(--viewport-height);
    max-height: var(--viewport-height);
    min-height: var(--viewport-height);
    overflow: hidden;
    --mobile-sidebar-offset: 0%;
    --mobile-chat-offset: 100%;
    --mobile-details-offset: 100%;
  }

  .workspace,
  .workspace button,
  .workspace input,
  .workspace textarea,
  .workspace * {
    font-family: "Roboto", "Helvetica Neue", Arial, sans-serif !important;
    letter-spacing: 0 !important;
  }

  .conversation-card {
    gap: 10px;
    padding: 13px 13px 13px 14px;
    align-items: center;
    min-height: 83px;
  }

  .conversation-avatar-frame {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  .conversation-avatar-circle {
    width: 49px;
    height: 49px;
  }

  .conversation-avatar-channel {
    width: 18px;
    height: 18px;
  }

  .conversation-avatar-channel .channel-badge {
    width: 18px;
    height: 18px;
    border-width: 1.5px;
  }

  .conversation-avatar-channel .channel-badge-icon {
    width: 10px;
    height: 10px;
  }

  .conversation-card-top strong,
  .conversation-card.active .conversation-card-top strong {
    color: #000;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
  }

  .conversation-inline-number,
  .conversation-card-bottom {
    color: #000;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.22;
  }

  .conversation-time,
  .conversation-card p,
  .conversation-card.active .conversation-time,
  .conversation-card.active .conversation-card-bottom p,
  .conversation-card.active .conversation-inline-number {
    color: #000;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.22;
  }

  .conversation-card-bottom {
    margin-top: 0;
    min-height: 28px;
    gap: 8px;
  }

  .conversation-card-status {
    gap: 2px;
    min-width: 50px;
  }

  .conversation-counter,
  .conversation-delivered {
    font-size: 14px;
    font-weight: 500;
  }

  .conversation-client-badge {
    font-size: 13px;
    font-weight: 700;
  }

  .channel-badge-textmark,
  .channel-badge.channel-badge-compact .channel-badge-textmark {
    font-size: 12px;
    font-weight: 800;
  }

  .chat-id-button,
  .badge,
  .badge-soft {
    color: #000;
    font-size: 14px;
    font-weight: 500;
  }

  .chat-panel h2 {
    color: #000;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.05;
  }

  .chat-subtitle,
  .day-divider span,
  .message-status-label,
  .panel-kicker {
    color: #000;
    font-size: 15px;
    font-weight: 500;
  }

  .bubble-meta {
    color: #000;
    font-size: 14px;
    font-weight: 400;
  }

  .bubble-meta strong {
    color: #000;
    font-weight: 700;
  }

  .bubble-body {
    color: #000;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.34;
  }

  .bubble-foot,
  .message-status.local,
  .message-status.plain {
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
  }

  .message-status-label {
    color: inherit;
  }

  .bubble-time {
    font-size: 15px;
  }

  .chat-composer-input {
    color: #000;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.35;
  }

  .details-panel h3 {
    color: #000;
    font-size: 26px;
    font-weight: 700;
  }

  .info-card strong,
  .visit-card strong {
    color: #000;
    font-size: 17px;
    font-weight: 700;
  }

  .info-card span,
  .visit-card span,
  .visit-card p {
    color: #000;
    font-size: 15px;
    font-weight: 400;
  }

  .conversation-search-input,
  .conversation-search-input::placeholder {
    color: #000;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.3;
    opacity: 1;
  }

  .conversation-search-button,
  .channel-filter-toggle,
  .channel-filter-chip,
  .sidebar-switch,
  .sidebar-auto-mode-chip,
  .sidebar-codeword-toggle,
  .ghost-button,
  .primary-button,
  .compact {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.15;
  }

  .channel-filter-toggle,
  .channel-filter-toggle-meta,
  .channel-filter-chip,
  .channel-filter-chip.active,
  .conversation-search-status,
  .conversation-list-note,
  .empty-list,
  .empty-chat {
    color: #000;
  }

  .channel-filter-toggle {
    font-weight: 500;
  }

  .channel-filter-toggle-meta,
  .conversation-search-status,
  .conversation-list-note {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
  }

  .channel-filter-chip {
    font-size: 14px;
    font-weight: 500;
  }

  .sidebar-switch-title,
  .sidebar-codeword-title,
  .sidebar-codeword-state-value,
  .sidebar-codeword-toggle-label,
  .sidebar-auto-settings-title {
    color: #000;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.15;
  }

  .sidebar-switch-meta,
  .sidebar-switch-description,
  .sidebar-codeword-description,
  .sidebar-codeword-state-label,
  .sidebar-auto-settings,
  .sidebar-automation-links,
  .sidebar-memory-button,
  .sidebar-inline-settings-button,
  .sidebar-hidden-chats-button {
    color: #000;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.25;
  }

  .sidebar-automation-toggles,
  .sidebar-automation-toggles * {
    font-family: "Roboto", "Helvetica Neue", Arial, sans-serif !important;
    color: #000 !important;
    letter-spacing: 0 !important;
  }

  .sidebar-automation-toggles .app-version-badge {
    min-height: 28px;
    padding-inline: 8px;
    font-size: 12px;
    font-weight: 700;
  }

  .sidebar-automation-toggles .sidebar-switch,
  .sidebar-automation-toggles .sidebar-inline-settings-button {
    opacity: 1;
  }

  .sidebar-automation-toggles .sidebar-switch:disabled,
  .sidebar-automation-toggles .sidebar-switch:disabled:hover,
  .sidebar-automation-toggles .sidebar-inline-settings-button:disabled,
  .sidebar-automation-toggles .sidebar-inline-settings-button:disabled:hover {
    opacity: 1;
    color: #000 !important;
  }

  .sidebar-automation-toggles .sidebar-switch-compact .sidebar-switch-title {
    color: #000 !important;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.18;
  }

  .sidebar-automation-toggles .sidebar-inline-settings-button {
    font-size: 17px;
    font-weight: 500;
    line-height: 1;
  }

  .sidebar-language-switcher {
    font-size: 14px;
    font-weight: 500;
  }

  .sidebar-language-button {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
  }

  .sidebar-language-flag {
    font-size: 18px;
  }

  .sidebar-language-menu {
    right: -44px;
    min-width: 176px;
  }

  .sidebar-language-option {
    min-height: 38px;
    font-size: 16px;
  }

  .chat-toolbar-meta,
  .chat-search-nav-meta,
  .history-cap,
  .visit-empty {
    color: #000;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
  }

  .assistant-context-head-title,
  .assistant-context-label,
  .assistant-context-value,
  .assistant-suggestion-kicker,
  .assistant-suggestion-summary,
  .assistant-suggestion-chip,
  .assistant-suggestion-body,
  .assistant-suggestion-loading-line {
    color: #000;
  }

  .assistant-context-head-title,
  .assistant-suggestion-kicker,
  .assistant-suggestion-chip {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
  }

  .assistant-context-label {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
  }

  .assistant-context-value,
  .assistant-suggestion-summary,
  .assistant-suggestion-body,
  .assistant-suggestion-loading-line {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.3;
  }

  .details-summary-label,
  .details-summary-value,
  .details-visit-head strong,
  .details-visit-amount,
  .details-visit-salon,
  .details-visit-address,
  .details-visit-body,
  .details-visit-body p,
  .details-visit-body strong {
    color: #000;
  }

  .details-summary-label {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.18;
  }

  .details-summary-value,
  .details-visit-head strong,
  .details-visit-amount,
  .details-visit-salon {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.18;
  }

  .details-summary-label,
  .details-summary-value {
    font-family: "Roboto", "Helvetica Neue", Arial, sans-serif !important;
  }

  .details-visit-address,
  .details-visit-body p,
  .visit-empty {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.35;
  }

  .details-visit-card {
    cursor: default;
    touch-action: pan-y;
  }

  .details-visit-card:hover {
    transform: none;
    border-color: rgba(29, 143, 189, 0.18);
  }

  .message-media-caption,
  .message-attachment-link,
  .message-text-link,
  .message-sticker-copy strong,
  .message-sticker-link,
  .call-message-icon,
  .call-message-text,
  .message-service-notice,
  .message-search-mark {
    color: #000;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.34;
  }

  .scroll-to-bottom-button,
  .mobile-chat-back-button,
  #details-button,
  #close-details-button,
  #load-older-button {
    font-weight: 500;
  }

  .badge-icon-counter {
    font-family: "Roboto", "Helvetica Neue", Arial, sans-serif !important;
    font-size: 11px;
    font-weight: 700;
  }

  .chat-badge-last-reply,
  .chat-badge-no-reply,
  .chat-badge-future-visit,
  .chat-badge-customer-name {
    display: none !important;
  }

  .workspace.mobile-chat-view {
    --mobile-sidebar-offset: -100%;
    --mobile-chat-offset: 0%;
    --mobile-details-offset: 100%;
  }

  .workspace.mobile-details-view {
    --mobile-sidebar-offset: -100%;
    --mobile-chat-offset: -100%;
    --mobile-details-offset: 0%;
  }

  .sidebar,
  .chat-panel,
  .details-panel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    min-height: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
    box-shadow: none;
    transition: transform 320ms cubic-bezier(0.22, 0.98, 0.36, 1);
    will-change: transform;
    touch-action: pan-y;
  }

  .sidebar {
    gap: 8px;
    overflow: hidden;
    z-index: 1;
    transform: translate3d(var(--mobile-sidebar-offset), 0, 0);
  }

  .chat-panel {
    overflow: hidden;
    z-index: 2;
    transform: translate3d(var(--mobile-chat-offset), 0, 0);
  }

  .details-panel {
    z-index: 3;
    transform: translate3d(var(--mobile-details-offset), 0, 0);
  }

  .workspace.mobile-list-view .sidebar,
  .workspace.mobile-chat-view .chat-panel,
  .workspace.mobile-details-view .details-panel {
    pointer-events: auto;
  }

  .workspace.mobile-list-view .chat-panel,
  .workspace.mobile-list-view .details-panel,
  .workspace.mobile-chat-view .sidebar,
  .workspace.mobile-chat-view .details-panel,
  .workspace.mobile-details-view .sidebar,
  .workspace.mobile-details-view .chat-panel {
    pointer-events: none;
  }

  .workspace.mobile-chat-view .chat-panel.is-mobile-opening-conversation .chat-scroll,
  .workspace.mobile-chat-view .chat-panel.is-mobile-opening-conversation .assistant-context-strip,
  .workspace.mobile-chat-view .chat-panel.is-mobile-opening-conversation .assistant-suggestion,
  .workspace.mobile-chat-view .chat-panel.is-mobile-opening-conversation .scroll-to-bottom-button {
    opacity: 0;
    visibility: hidden;
  }

  .workspace.mobile-chat-view .chat-panel.is-mobile-opening-conversation.is-transitioning::after {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: none;
  }

  .workspace.is-mobile-panel-dragging .sidebar,
  .workspace.is-mobile-panel-dragging .chat-panel,
  .workspace.is-mobile-panel-dragging .details-panel {
    transition: none;
    touch-action: none;
  }

  .workspace.is-mobile-panel-dragging .chat-scroll,
  .workspace.is-mobile-panel-dragging .details-panel-scroll,
  .workspace.is-mobile-panel-dragging .conversation-list {
    overflow: hidden;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    touch-action: none;
  }

  .workspace.is-mobile-panel-gesture-active .sidebar,
  .workspace.is-mobile-panel-gesture-active .sidebar *,
  .workspace.is-mobile-panel-gesture-active .chat-panel,
  .workspace.is-mobile-panel-gesture-active .chat-panel *,
  .workspace.is-mobile-panel-gesture-active .details-panel,
  .workspace.is-mobile-panel-gesture-active .details-panel * {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
  }

  .sidebar-head,
  .chat-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .sidebar-head {
    margin-bottom: 0;
  }

  .sidebar-head-copy {
    gap: 8px;
  }

  .details-panel-head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-areas: "back copy";
    align-items: start;
    gap: 8px;
  }

  .details-panel-head > div {
    grid-area: copy;
    min-width: 0;
  }

  #close-details-button {
    grid-area: back;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(219, 227, 234, 0.9);
    background: rgba(255, 255, 255, 0.92);
    color: var(--accent-strong);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
  }

  .sidebar-automation-controls,
  .channel-filters {
    margin-top: 0;
  }

  .channel-filters {
    min-height: 0;
  }

  .conversation-list {
    margin-top: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }

  .channel-filter-toggle:hover {
    transform: none;
  }

  .chat-head {
    gap: 8px;
  }

  .chat-head-copy {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: 25px 17px auto;
    column-gap: 8px;
    row-gap: 0;
    align-items: start;
  }

  .chat-head-topline {
    display: none;
  }

  .chat-title-row {
    display: contents;
    gap: 8px;
  }

  .mobile-chat-view .mobile-chat-back-button:not(.hidden) {
    display: inline-flex;
  }

  .mobile-chat-back-button {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: start;
  }

  .chat-panel h2 {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    font-size: 25px;
    line-height: 1;
    transform: translateY(-2px);
  }

  .chat-subtitle-row {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    gap: 4px 8px;
    margin-left: 0;
    transform: translateY(1px);
  }

  .chat-subtitle-row .chat-subtitle,
  .chat-subtitle-row .chat-subtitle-copy {
    line-height: 1;
  }

  .chat-channel-tabs {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 10px;
    padding-bottom: 4px;
  }

  .chat-channel-tab {
    max-width: 178px;
    padding: 6px 8px 6px 6px;
    font-size: 11px;
  }

  .chat-channel-tab-add {
    width: 30px;
    min-width: 30px;
    height: 30px;
    font-size: 18px;
  }

  .chat-head {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "copy actions";
    align-items: flex-start;
  }

  .chat-head-actions,
  .chat-badges {
    align-items: center;
    justify-content: flex-end;
  }

  .chat-toolbar {
    margin-top: 4px;
  }

  .chat-scroll {
    overflow: auto;
    overflow-anchor: none;
    margin-top: 1px;
    padding-inline: 4px;
  }

  .chat-thread {
    overflow-anchor: none;
  }

  .assistant-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assistant-suggestion,
  .assistant-context-strip {
    margin-top: 8px;
  }

  .chat-composer {
    --composer-input-min-height: 46px;
    --composer-input-max-height: 84px;
    --composer-attachment-button-width: 46px;
    --composer-send-button-width: 50px;
    align-items: end;
    gap: 8px;
    margin-top: 6px;
    padding-top: 6px;
    min-height: calc(var(--composer-input-min-height) + 6px);
  }

  .scroll-to-bottom-button {
    right: 16px;
    bottom: 122px;
  }

  .chat-composer-input {
    height: var(--composer-input-min-height);
    min-height: var(--composer-input-min-height);
    max-height: var(--composer-input-max-height);
    line-height: 1.3;
    font-size: 16px;
    padding: 9px 12px;
  }

  #chat-send-button {
    width: var(--composer-send-button-width);
    min-width: var(--composer-send-button-width);
    height: var(--composer-input-min-height);
    min-height: var(--composer-input-min-height);
    max-height: var(--composer-input-min-height);
    align-self: end;
    padding: 0;
    border-radius: 14px;
    font-size: 22px;
    line-height: 1;
  }

  body.is-mobile-keyboard-open {
    height: var(--visual-viewport-height);
    max-height: var(--visual-viewport-height);
    min-height: var(--visual-viewport-height);
  }

  body.is-mobile-keyboard-open .app-shell {
    position: fixed;
    inset: var(--visual-viewport-offset-top) 0 auto 0;
    width: 100vw;
    height: var(--visual-viewport-height);
    max-height: var(--visual-viewport-height);
    min-height: var(--visual-viewport-height);
  }

  body.is-mobile-keyboard-open .workspace.mobile-chat-view {
    height: var(--visual-viewport-height);
    max-height: var(--visual-viewport-height);
    min-height: var(--visual-viewport-height);
  }

  body.is-mobile-keyboard-open .workspace.mobile-chat-view .chat-panel {
    height: var(--visual-viewport-height);
    max-height: var(--visual-viewport-height);
    min-height: var(--visual-viewport-height);
    padding: max(8px, env(safe-area-inset-top)) 8px 0;
  }

  body.is-mobile-keyboard-open .workspace.mobile-chat-view .chat-head {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy";
    gap: 6px;
  }

  body.is-mobile-keyboard-open .workspace.mobile-chat-view .chat-head-copy {
    grid-column: 1 / -1;
    width: 100%;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto auto 0;
    row-gap: 3px;
  }

  body.is-mobile-keyboard-open .workspace.mobile-chat-view .chat-head-actions {
    position: absolute;
    top: 0;
    right: 0;
    width: auto;
    margin: 0;
  }

  body.is-mobile-keyboard-open .workspace.mobile-chat-view .mobile-chat-back-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    grid-row: 1 / 3;
  }

  body.is-mobile-keyboard-open .workspace.mobile-chat-view .chat-panel h2 {
    font-size: 22px;
    line-height: 1.05;
    padding-right: 44px;
    transform: none;
  }

  body.is-mobile-keyboard-open .workspace.mobile-chat-view .chat-subtitle-row {
    padding-right: 44px;
    transform: none;
  }

  body.is-mobile-keyboard-open .workspace.mobile-chat-view .chat-channel-tabs {
    grid-row: 4;
    max-height: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    visibility: hidden;
  }

  body.is-mobile-keyboard-open .workspace.mobile-chat-view .chat-location-strip {
    position: static;
    grid-column: 1 / -1;
    grid-row: 3;
    top: auto;
    z-index: 1;
    width: auto;
    max-width: none;
    margin: 5px 4px 0;
    padding: 9px 12px;
    border-width: 2px;
    border-radius: 12px;
    box-shadow:
      0 4px 12px rgba(216, 75, 75, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.74);
  }

  body.is-mobile-keyboard-open .workspace.mobile-chat-view .chat-location-strip-value {
    font-size: 16px;
    line-height: 1.15;
    text-align: center;
  }

  body.is-mobile-keyboard-open .workspace.mobile-chat-view .chat-scroll {
    margin-top: 2px;
    padding: 6px;
  }

  body.is-mobile-keyboard-open .workspace.mobile-chat-view .chat-composer {
    margin-top: 5px;
    padding-top: 5px;
    margin-bottom: 0;
    padding-bottom: 5px;
  }

  body.is-pwa-standalone .workspace.mobile-chat-view .chat-composer {
    margin: 6px -12px calc(-12px - env(safe-area-inset-bottom));
    padding: 7px 12px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(29, 143, 189, 0.22);
    background:
      linear-gradient(180deg, rgba(236, 247, 252, 0.98), rgba(220, 236, 243, 0.98));
    box-shadow:
      0 -1px 0 rgba(29, 143, 189, 0.08),
      0 -10px 22px rgba(29, 143, 189, 0.06);
  }

  body.is-pwa-standalone.is-mobile-keyboard-open .workspace.mobile-chat-view .chat-composer {
    margin: 5px -8px 0;
    padding: 5px 8px;
  }

  .chat-send-label {
    display: none;
  }

  .chat-send-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateX(1px);
  }

  .bubble-row.inbound {
    padding-right: 10%;
  }

  .bubble-row.outbound {
    padding-left: 10%;
  }

  .visit-event-card {
    width: 100%;
    max-width: 380px;
    padding: 10px 12px 11px;
    border-radius: 16px;
  }

  .visit-event-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 12px;
  }

  .visit-event-kicker {
    font-size: 14px;
    line-height: 1.2;
  }

  .visit-event-line span {
    font-size: 11px;
    line-height: 1.15;
  }

  .visit-event-line strong {
    font-size: 17px;
    line-height: 1.18;
  }

  .bubble {
    max-width: 100%;
  }

  .conversation-create-modal {
    align-items: end;
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .conversation-create-panel {
    width: 100%;
    padding: 18px;
    border-radius: 24px;
  }

  .conversation-create-head h3 {
    font-size: 23px;
  }

  .conversation-create-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
