:root {
  color-scheme: light;
  --font-text: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --ink: #000000;
  --muted: rgba(60, 60, 67, 0.6);
  --line: #c6c6c8;
  --panel: #ffffff;
  --canvas: #e7edf2;
  --deep: #007aff;
  --accent: #007aff;
  --accent-dark: #0062cc;
  --mint: #e5f1ff;
  --outgoing: #007aff;
  --incoming: #ffffff;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.14);
  font-family: var(--font-text);
  font-optical-sizing: auto;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #f2f2f7;
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

.is-hidden {
  display: none !important;
}

.app-shell {
  width: 100%;
  height: 100%;
  padding: clamp(0px, 2vw, 24px);
}

.center-view {
  display: grid;
  width: 100%;
  height: 100%;
  padding-block: 24px;
  overflow-y: auto;
  place-items: center;
}

.center-view > p {
  color: var(--muted);
}

.setup-card,
.auth-card {
  width: min(100%, 460px);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 8px 22px rgba(0, 122, 255, 0.28);
  color: #fff;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
}

.brand-mark-small {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 22px;
}

.brand-lockup-small {
  margin: 0;
}

.brand-lockup h1,
.auth-form h2,
.setup-card h1,
.sidebar h1,
.sidebar h2,
.conversation h2 {
  margin: 0;
}

.auth-form h2,
.sidebar h2,
.conversation h2 {
  font-family: var(--font-display);
  font-weight: 600;
}

.brand-lockup h1,
.setup-card h1 {
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent-dark);
  font-size: 11px;
  font-family: var(--font-text);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.notice {
  padding: 18px;
  border-radius: 16px;
  line-height: 1.55;
}

.notice p {
  margin: 7px 0 0;
  color: #5f5d51;
}

.notice-warning {
  border: 1px solid #eed9a7;
  background: #fff6dc;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(16, 45, 49, 0.08);
  font-size: 0.9em;
}

.auth-form {
  display: grid;
  gap: 20px;
}

.auth-form h2 {
  font-size: 21px;
}

.telegram-login-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 54px;
  background: #229ed9;
  color: #fff;
}

.telegram-login-button:hover {
  background: #168ac2;
}

.telegram-login-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.telegram-login-caption {
  margin: -7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.telegram-code-input {
  height: 58px;
  border-radius: 16px;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: 0.32em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pin-label {
  gap: 10px;
}

.pin-control {
  position: relative;
  display: grid;
  height: 68px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  cursor: text;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.pin-control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.pin-input {
  position: absolute;
  z-index: 2;
  inset: 0;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  caret-color: transparent;
  cursor: text;
}

.pin-input:focus {
  border: 0;
  box-shadow: none;
}

.pin-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
}

.pin-dots > span {
  width: 14px;
  height: 14px;
  border: 1.8px solid #8e8e93;
  border-radius: 50%;
  background: transparent;
  transition: background 100ms ease, border-color 100ms ease, transform 100ms ease;
}

.pin-dots > span.is-filled {
  border-color: var(--accent);
  background: var(--accent);
  transform: scale(1.08);
}

.pin-back-button {
  justify-self: center;
}

.muted {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

label {
  display: grid;
  gap: 8px;
  color: rgba(60, 60, 67, 0.8);
  font-size: 13px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input,
select {
  height: 50px;
  padding: 0 15px;
  border-radius: 13px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  font-family: var(--font-text);
  font-weight: 600;
  transition: transform 150ms ease, background 150ms ease, opacity 150ms ease;
}

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

.button:disabled,
.send-button:disabled,
.attachment-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.button-primary {
  background: var(--deep);
  color: #fff;
}

.button-primary:hover {
  background: var(--accent-dark);
}

.button-secondary {
  width: 100%;
  margin-top: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  cursor: pointer;
  font-family: var(--font-text);
  font-weight: 400;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.qr-form {
  justify-items: stretch;
}

.qr-frame {
  display: grid;
  width: min(100%, 270px);
  aspect-ratio: 1;
  margin: 0 auto;
  place-items: center;
  overflow: hidden;
  border: 10px solid #fff;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(16, 45, 49, 0.14);
}

.qr-frame img {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.qr-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.qr-form .button-secondary {
  margin-top: 0;
}

.form-error {
  margin: 17px 0 0;
  padding: 12px 14px;
  border-radius: 11px;
  background: #fde8e2;
  color: #9e351d;
  font-size: 14px;
}

.security-note {
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.chat-layout {
  --sidebar-width: 390px;
  display: grid;
  width: min(100%, 1480px);
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  grid-template-columns: var(--sidebar-width) 8px minmax(210px, 1fr);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: #ffffff;
}

.sidebar-resizer {
  position: relative;
  z-index: 3;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  outline: none;
  touch-action: none;
}

.sidebar-resizer::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  background: var(--line);
  content: "";
  transition: width 140ms ease, background 140ms ease, left 140ms ease;
}

.sidebar-resizer:hover::before,
.sidebar-resizer:focus-visible::before,
.chat-layout.is-resizing .sidebar-resizer::before {
  left: 2px;
  width: 4px;
  background: var(--accent);
}

.chat-layout.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 10px;
}

.chat-search {
  position: relative;
  display: block;
  min-width: 0;
  flex: 1;
}

.chat-search input {
  height: 38px;
  padding: 0 12px 0 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(239, 239, 244, 0.94);
  box-shadow: inset 0 0 0 0.5px rgba(60, 60, 67, 0.08);
  font-family: var(--font-text);
  font-size: 15px;
  font-weight: 400;
}

.chat-search input::-webkit-search-cancel-button {
  cursor: pointer;
}

.search-icon {
  position: absolute;
  z-index: 1;
  top: 11px;
  left: 12px;
  width: 12px;
  height: 12px;
  border: 1.8px solid #8e8e93;
  border-radius: 50%;
  pointer-events: none;
}

.search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 1.8px;
  border-radius: 999px;
  background: #8e8e93;
  content: "";
  transform: rotate(45deg);
  transform-origin: left center;
}

.sidebar h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f2f2f7;
  color: var(--accent);
  cursor: pointer;
  font-size: 18px;
}

.icon-button:hover {
  background: #e5e5ea;
}

.sidebar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.notification-button {
  width: 36px;
  height: 36px;
  color: #8e8e93;
}

.notification-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.notification-button.is-active {
  background: #e5f1ff;
  color: var(--accent);
}

.notification-button.is-denied {
  color: #c9342f;
}

.notification-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-menu-button {
  width: 36px;
  height: 36px;
}

.burger-icon,
.burger-icon::before,
.burger-icon::after {
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.burger-icon {
  position: relative;
  display: block;
}

.burger-icon::before,
.burger-icon::after {
  position: absolute;
  left: 0;
  content: "";
}

.burger-icon::before {
  top: -6px;
}

.burger-icon::after {
  top: 6px;
}

.app-menu-control {
  position: relative;
}

.app-menu {
  position: absolute;
  z-index: 70;
  top: calc(100% + 7px);
  right: 0;
  display: flex;
  width: 190px;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid rgba(60, 60, 67, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
}

.app-menu-item {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  text-align: left;
}

.app-menu-item:hover,
.app-menu-item:focus-visible {
  outline: none;
  background: #f2f2f7;
}

.app-menu-item.is-danger {
  color: #d70015;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(5px);
}

.delete-dialog-modal {
  width: min(430px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  background: rgba(250, 250, 252, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}

.delete-dialog-copy {
  padding: 22px 24px 18px;
}

.delete-dialog-copy h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.delete-dialog-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.delete-dialog-option {
  display: flex;
  margin-top: 16px;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.35;
}

.delete-dialog-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.delete-dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.delete-dialog-actions button {
  min-height: 48px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
}

.delete-dialog-actions button + button {
  border-left: 1px solid var(--line);
}

.delete-dialog-actions button:hover,
.delete-dialog-actions button:focus-visible {
  outline: none;
  background: rgba(0, 122, 255, 0.07);
}

.delete-dialog-actions button.is-danger {
  color: #d70015;
}

.delete-dialog-actions button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.statistics-modal {
  display: flex;
  width: min(640px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 24px;
  background: #f7f7f9;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}

.statistics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.statistics-header h2 {
  margin: 0;
  font-size: 20px;
}

.statistics-content {
  min-height: 220px;
  padding: 18px;
  overflow-y: auto;
  color: var(--muted);
}

.statistics-loading {
  display: grid;
  min-height: 190px;
  place-items: center;
  font-size: 13px;
}

.statistics-monthly {
  padding: 17px;
  border: 1px solid rgba(0, 122, 255, 0.11);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(36, 66, 103, 0.06);
}

.statistics-period-toolbar,
.statistics-section-heading,
.statistics-distribution-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.statistics-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.statistics-period-toolbar h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.statistics-journal-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(0, 122, 255, 0.22);
  border-radius: 10px;
  background: rgba(0, 122, 255, 0.07);
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.statistics-journal-button:hover,
.statistics-journal-button:focus-visible {
  outline: none;
  background: rgba(0, 122, 255, 0.13);
}

.statistics-date-form {
  display: grid;
  margin-top: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.statistics-date-form label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.statistics-date-form input,
.statistics-date-form button {
  height: 36px;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 10px;
  font: inherit;
}

.statistics-date-form input {
  min-width: 0;
  padding: 0 9px;
  background: #f7f8fa;
  color: var(--ink);
  font-size: 11px;
}

.statistics-date-form button {
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.statistics-date-form button:hover,
.statistics-date-form button:focus-visible {
  outline: none;
  filter: brightness(0.94);
}

.statistics-period-controls {
  display: flex;
  gap: 6px;
}

.statistics-period-controls button {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0 0 3px;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 10px;
  background: #f7f8fa;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 23px;
  place-items: center;
}

.statistics-period-controls button:disabled {
  cursor: default;
  opacity: 0.3;
}

.statistics-monthly-grid,
.statistics-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.statistics-monthly-grid {
  margin-top: 15px;
}

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

.statistics-onboarding-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
}

.statistics-onboarding-heading strong {
  color: var(--ink);
  font-size: 12px;
}

.statistics-onboarding-heading span {
  font-size: 10px;
}

.statistics-onboarding-grid {
  display: grid;
  margin-top: 9px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.statistics-onboarding-grid .statistics-kpi {
  min-height: 70px;
}

.statistics-onboarding-grid .statistics-kpi strong {
  font-size: 21px;
}

.statistics-kpi {
  display: flex;
  min-width: 0;
  min-height: 82px;
  flex-direction: column;
  justify-content: center;
  padding: 12px;
  border: 1px solid rgba(60, 60, 67, 0.07);
  border-radius: 14px;
  background: #f8f9fb;
}

.statistics-kpi strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.statistics-kpi span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.statistics-kpi.is-primary strong { color: #007aff; }
.statistics-kpi.is-green strong { color: #27a95b; }
.statistics-kpi.is-orange strong { color: #e8871e; }
.statistics-kpi.is-purple strong { color: #8b5bd7; }

.statistics-distribution {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid rgba(60, 60, 67, 0.1);
}

.statistics-distribution-title strong,
.statistics-section-heading strong {
  color: var(--ink);
  font-size: 12px;
}

.statistics-distribution-title span,
.statistics-section-heading span {
  font-size: 10px;
}

.statistics-distribution-bar {
  display: flex;
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9ebef;
}

.statistics-distribution-bar span {
  min-width: 2px;
}

.statistics-distribution-bar .is-green,
.statistics-legend i.is-green { background: #34c759; }
.statistics-distribution-bar .is-orange,
.statistics-legend i.is-orange { background: #ff9f0a; }
.statistics-distribution-bar .is-purple,
.statistics-legend i.is-purple { background: #af52de; }
.statistics-distribution-bar .is-gray,
.statistics-legend i.is-gray { background: #a8adb5; }

.statistics-legend {
  display: grid;
  margin-top: 11px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.statistics-legend > div {
  display: grid;
  min-width: 0;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}

.statistics-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.statistics-legend span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-legend strong {
  color: var(--ink);
}

.statistics-group-note,
.statistics-tracking-note {
  margin: 10px 0 0;
  font-size: 10px;
  line-height: 1.4;
}

.statistics-tracking-note {
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(0, 122, 255, 0.07);
  color: #41657f;
}

.statistics-section-heading {
  margin: 18px 2px 9px;
}

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

.statistics-summary article {
  background: #fff;
}

.statistics-type-list {
  margin-top: 14px;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
}

.statistics-type-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
  color: var(--ink);
  font-size: 12px;
}

.statistics-type-list > div:last-child {
  border-bottom: 0;
}

.statistics-type-list strong {
  color: var(--accent);
}

.routing-journal-modal {
  display: flex;
  width: min(900px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 24px;
  background: #f7f7f9;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.routing-journal-eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.routing-journal-content {
  min-height: 300px;
  padding: 16px;
  overflow-y: auto;
}

.routing-journal-period {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
}

.routing-journal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.routing-journal-column {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 17px;
  background: #fff;
}

.routing-journal-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
}

.routing-journal-column.is-onboarding > header {
  background: rgba(52, 199, 89, 0.08);
}

.routing-journal-column.is-ed > header {
  background: rgba(175, 82, 222, 0.08);
}

.routing-journal-column h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.routing-journal-column > header span {
  display: grid;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(60, 60, 67, 0.08);
  color: var(--ink);
  font-size: 10px;
  font-weight: 750;
  place-items: center;
}

.routing-journal-list {
  padding: 0 9px 9px;
}

.routing-journal-day {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 5px 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.routing-journal-day::before,
.routing-journal-day::after {
  height: 1px;
  flex: 1;
  background: rgba(60, 60, 67, 0.1);
  content: "";
}

.routing-journal-item {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 7px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.routing-journal-item:hover,
.routing-journal-item:focus-visible {
  outline: none;
  background: #f3f5f8;
}

.routing-journal-item.is-unavailable {
  cursor: default;
  opacity: 0.52;
}

.routing-journal-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--avatar-color, #8e8e93);
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  place-items: center;
}

.routing-journal-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.routing-journal-copy strong,
.routing-journal-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.routing-journal-copy strong {
  color: var(--ink);
  font-size: 11px;
}

.routing-journal-copy span,
.routing-journal-item time {
  color: var(--muted);
  font-size: 9px;
}

.routing-journal-item time {
  align-self: start;
  padding-top: 2px;
}

.routing-journal-empty {
  margin: 0;
  padding: 24px 12px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

@media (max-width: 560px) {
  .statistics-modal {
    max-height: calc(100vh - 20px);
  }

  .statistics-content {
    padding: 12px;
  }

  .statistics-monthly {
    padding: 14px;
  }

  .statistics-monthly-grid,
  .statistics-legend,
  .statistics-onboarding-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .statistics-date-form button {
    grid-column: 1 / -1;
  }

  .statistics-period-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .statistics-journal-button {
    width: 100%;
  }

  .routing-journal-modal {
    max-height: calc(100vh - 20px);
  }

  .routing-journal-content {
    padding: 12px;
  }

  .routing-journal-grid {
    grid-template-columns: 1fr;
  }
}

.online-panel {
  margin: 0 18px 16px;
  padding: 12px 13px;
  border: 1px solid rgba(52, 199, 89, 0.18);
  border-radius: 14px;
  background: rgba(52, 199, 89, 0.07);
}

.online-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(60, 60, 67, 0.68);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.online-count {
  display: grid;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  background: rgba(52, 199, 89, 0.15);
  color: #248a3d;
  font-size: 10px;
}

.online-employees {
  display: flex;
  min-width: 0;
  margin-top: 9px;
  flex-wrap: wrap;
  gap: 7px 10px;
}

.online-employee {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: #1c1c1e;
  font-size: 12px;
  line-height: 1.25;
}

.online-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 1px rgba(52, 199, 89, 0.28);
}

.online-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dialogs-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px 10px;
}

.dialog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 0 16px 12px;
  padding: 3px;
  border-radius: 10px;
  background: #e9e9ee;
}

.dialog-filter {
  min-width: max-content;
  flex: 1 1 max-content;
  padding: 6px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.dialog-filter.is-active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  color: var(--accent);
}

.cache-status {
  margin: -5px 20px 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialogs-refresh {
  display: flex;
  height: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: -7px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  opacity: 0;
  transform: translateY(-4px);
  transition: height 140ms ease, margin 140ms ease, opacity 120ms ease,
    transform 140ms ease;
}

.dialogs-refresh.is-visible {
  height: 22px;
  margin-bottom: 4px;
  opacity: 1;
  transform: translateY(0);
}

.dialogs-refresh-spinner {
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 1.5px solid rgba(0, 122, 255, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  transform: rotate(var(--pull-rotation, 0deg));
}

.dialogs-refresh.is-ready {
  color: var(--accent);
}

.dialogs-refresh.is-refreshing .dialogs-refresh-spinner {
  animation: dialogs-refresh-spin 700ms linear infinite;
}

@keyframes dialogs-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.dialogs-heading h2 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.counter {
  min-width: 25px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--accent);
  font-size: 11px;
  font-family: var(--font-text);
  font-weight: 600;
  text-align: center;
}

.dialogs-list {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #aeaeb2 #f2f2f7;
}

.dialogs-list::-webkit-scrollbar,
.messages-list::-webkit-scrollbar {
  width: 10px;
}

.dialogs-list::-webkit-scrollbar-track,
.messages-list::-webkit-scrollbar-track {
  background: rgba(242, 242, 247, 0.82);
}

.dialogs-list::-webkit-scrollbar-thumb,
.messages-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #aeaeb2;
  background-clip: padding-box;
}

.dialogs-list::-webkit-scrollbar-thumb:hover,
.messages-list::-webkit-scrollbar-thumb:hover {
  background: #8e8e93;
  background-clip: padding-box;
}

.dialog-item {
  display: grid;
  width: 100%;
  padding: 10px 10px 10px 16px;
  grid-template-columns: 50px minmax(0, 1fr) 44px;
  gap: 3px;
  border: 0;
  border-left: 4px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 140ms ease, border-color 140ms ease;
}

.dialog-item:hover {
  background: #f2f2f7;
}

.dialog-item.is-active {
  border-left-color: transparent;
  background: #e5f1ff;
}

.dialog-context-menu,
.dialog-context-submenu {
  min-width: 238px;
  padding: 5px;
  border: 1px solid rgba(60, 60, 67, 0.22);
  border-radius: 9px;
  background: rgba(252, 252, 252, 0.98);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(20px);
}

.dialog-context-menu {
  position: fixed;
  z-index: 60;
  max-height: calc(100vh - 16px);
  width: 310px;
  max-width: calc(100vw - 16px);
  width: max-content;
}

.dialog-context-label {
  white-space: nowrap;
}

.dialog-context-branch {
  position: relative;
}

.dialog-context-submenu {
  position: absolute;
  z-index: 1;
  top: -6px;
  left: calc(100% - 3px);
  max-height: calc(100vh - 16px);
  overflow: visible;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity 90ms ease, transform 90ms ease, visibility 90ms;
}

.dialog-context-submenu.opens-up {
  top: auto;
  bottom: -6px;
}

.dialog-context-branch:hover > .dialog-context-submenu,
.dialog-context-branch:focus-within > .dialog-context-submenu,
.dialog-context-branch.is-expanded > .dialog-context-submenu {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.dialog-context-menu.opens-left .dialog-context-submenu {
  right: calc(100% - 3px);
  left: auto;
  transform: translateX(4px);
}

.dialog-context-menu.opens-left .dialog-context-branch:hover > .dialog-context-submenu,
.dialog-context-menu.opens-left .dialog-context-branch:focus-within > .dialog-context-submenu,
.dialog-context-menu.opens-left .dialog-context-branch.is-expanded > .dialog-context-submenu {
  transform: translateX(0);
}

.dialog-context-item {
  display: grid;
  width: 100%;
  min-height: 34px;
  padding: 5px 8px;
  grid-template-columns: 18px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #1c1c1e;
  cursor: default;
  font-family: var(--font-text);
  font-size: 13px;
  text-align: left;
}

.dialog-context-item:hover,
.dialog-context-item:focus-visible {
  outline: none;
  background: #0878d1;
  color: #ffffff;
}

.dialog-context-item:disabled {
  color: #a1a1a6;
}

.dialog-context-item:disabled:hover {
  background: transparent;
  color: #a1a1a6;
}

.dialog-context-item.is-danger {
  color: #d70015;
}

.dialog-context-item.is-danger:hover,
.dialog-context-item.is-danger:focus-visible {
  background: #d70015;
  color: #ffffff;
}

.dialog-context-item.is-danger:disabled {
  color: #d9a0a6;
}

.dialog-context-separator {
  height: 1px;
  margin: 5px 7px;
  background: rgba(60, 60, 67, 0.16);
}

.dialog-context-check,
.dialog-context-arrow {
  line-height: 1;
  text-align: center;
}

.dialog-context-check {
  font-size: 12px;
  font-weight: 700;
}

.dialog-context-arrow {
  font-size: 19px;
  font-weight: 400;
}

.dialog-context-label {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.dialog-context-status {
  margin: 4px 7px 2px 32px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.message-context-menu {
  position: fixed;
  z-index: 80;
  width: min(270px, calc(100vw - 16px));
  padding: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(28, 36, 47, 0.98);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  color: #fff;
  backdrop-filter: blur(20px);
}

.message-context-item {
  display: grid;
  width: 100%;
  min-height: 42px;
  padding: 7px 10px;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  text-align: left;
}

.message-context-item:hover,
.message-context-item:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.13);
}

.message-context-item:disabled {
  cursor: wait;
  opacity: 0.46;
}

.message-context-item.is-danger {
  color: #ff5b64;
}

.message-context-icon {
  font-size: 22px;
  line-height: 1;
  text-align: center;
}

.message-context-separator {
  height: 1px;
  margin: 5px 10px;
  background: rgba(255, 255, 255, 0.11);
}

.dialog-avatar {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--avatar-color, #007aff) 72%, white),
    var(--avatar-color, #007aff)
  );
  color: #fff;
  font-family: var(--font-text);
  font-weight: 600;
  text-transform: uppercase;
}

.dialog-copy {
  width: 100%;
  min-width: 0;
  align-self: center;
  overflow: hidden;
}

.dialog-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.dialog-tag {
  min-width: 0;
  overflow: hidden;
  max-width: 56%;
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e5f1ff;
  color: #086cc0;
  font-size: 8px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  flex: 1 1 auto;
  font-family: var(--font-text);
  font-size: 16px;
  font-weight: 600;
  text-overflow: ellipsis;
  line-height: 1.24;
  white-space: nowrap;
}

.dialog-preview {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-aside {
  display: flex;
  width: 44px;
  height: 50px;
  align-items: flex-end;
  flex-direction: column;
  justify-content: space-between;
  gap: 0;
  padding-top: 2px;
  padding-bottom: 1px;
}

.dialog-time {
  color: var(--muted);
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.unread-badge {
  display: grid;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-family: var(--font-text);
  font-weight: 600;
  line-height: 1;
  text-align: center;
}

.list-loader,
.messages-loader {
  padding: 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.dialogs-empty {
  padding: 36px 20px;
  color: var(--muted);
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 400;
  text-align: center;
}

.conversation {
  --contact-panel-width: clamp(440px, 26vw, 560px);
  position: relative;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background-color: #176f83;
  background-image: url("/static/assets/chat-wallpaper-blue.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.attachment-drop-overlay {
  position: absolute;
  z-index: 75;
  inset: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  border: 3px dashed rgba(0, 122, 255, 0.72);
  border-radius: 22px;
  background: rgba(242, 247, 255, 0.94);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: scale(0.985);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  visibility: hidden;
}

.attachment-drop-overlay.is-visible {
  opacity: 1;
  transform: scale(1);
  visibility: visible;
}

.attachment-drop-overlay strong {
  font-size: 18px;
}

.attachment-drop-overlay > span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.attachment-drop-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 30px;
  font-weight: 700;
}

.empty-conversation {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 150px 24px 40px;
  overflow-y: auto;
}

.empty-online-panel {
  position: absolute;
  top: clamp(18px, 4vh, 40px);
  left: 50%;
  width: min(720px, calc(100% - 48px));
  margin: 0;
  text-align: left;
  transform: translateX(-50%);
  border-color: rgba(52, 199, 89, 0.35);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(16px);
}

.empty-online-panel .online-empty {
  color: var(--muted);
  text-shadow: none;
}

.reminders-dashboard {
  width: min(760px, 100%);
  min-height: 220px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  background: rgba(249, 249, 251, 0.92);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
}

.reminders-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.12);
}

.reminders-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.reminders-dashboard h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.reminders-count {
  display: grid;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  place-items: center;
  border-radius: 999px;
  background: #e5f1ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.reminders-list {
  padding: 8px 18px 20px;
}

.reminder-date-group + .reminder-date-group {
  margin-top: 10px;
}

.reminder-date-heading {
  display: flex;
  margin: 13px 4px 9px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.reminder-date-heading::before,
.reminder-date-heading::after {
  height: 1px;
  flex: 1;
  background: rgba(60, 60, 67, 0.15);
  content: "";
}

.reminder-chat-item {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.reminder-chat-item + .reminder-chat-item {
  margin-top: 7px;
}

.reminder-chat-button {
  display: grid;
  width: 100%;
  min-width: 0;
  padding: 10px 8px 10px 12px;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 13px 0 0 13px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.reminder-chat-button:hover,
.reminder-chat-button:focus-visible {
  outline: none;
  background: #eaf4ff;
}

.reminder-chat-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--avatar-color, var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.reminder-chat-copy {
  min-width: 0;
}

.reminder-chat-copy strong,
.reminder-chat-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reminder-chat-copy strong {
  color: var(--ink);
  font-size: 13px;
}

.reminder-chat-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.reminder-complete-button {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-self: center;
  place-items: center;
  border: 1.5px solid rgba(52, 199, 89, 0.45);
  border-radius: 50%;
  background: rgba(52, 199, 89, 0.08);
  color: #20a84e;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.reminder-complete-button:hover,
.reminder-complete-button:focus-visible {
  outline: none;
  background: #34c759;
  color: #fff;
  transform: scale(1.05);
}

.reminder-complete-button:disabled {
  cursor: wait;
  opacity: 0.45;
  transform: none;
}

.reminders-empty {
  max-width: 390px;
  margin: 52px auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.active-conversation {
  display: grid;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr) auto;
  transition: margin-right 200ms ease;
}

.conversation.is-contact-open .active-conversation {
  margin-right: var(--contact-panel-width);
}

.conversation-header {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(249, 249, 249, 0.94);
  backdrop-filter: blur(12px);
  overflow: visible;
}

.reminder-control {
  position: relative;
  flex: 0 0 auto;
}

.reminder-button {
  display: inline-flex;
  min-height: 34px;
  padding: 7px 10px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(0, 122, 255, 0.22);
  border-radius: 10px;
  background: rgba(0, 122, 255, 0.07);
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.reminder-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.reminder-button:hover,
.reminder-button:focus-visible,
.reminder-button.is-active {
  outline: none;
  background: #e1efff;
}

.reminder-button.has-reminder {
  border-color: rgba(255, 149, 0, 0.35);
  background: rgba(255, 149, 0, 0.11);
  color: #b26400;
}

.reminder-calendar {
  position: absolute;
  z-index: 50;
  top: calc(100% + 9px);
  right: 0;
  width: 300px;
  padding: 12px;
  border: 1px solid rgba(60, 60, 67, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.reminder-calendar-header {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
}

.reminder-calendar-header strong {
  text-align: center;
  text-transform: capitalize;
  font-size: 13px;
}

.reminder-calendar-header button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 22px;
}

.reminder-calendar-header button:hover,
.reminder-calendar-header button:focus-visible {
  outline: none;
  background: #eaf4ff;
}

.reminder-weekdays,
.reminder-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.reminder-weekdays {
  margin: 9px 0 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.reminder-calendar-day,
.reminder-calendar-blank {
  aspect-ratio: 1;
}

.reminder-calendar-day {
  position: relative;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

.reminder-calendar-day:hover,
.reminder-calendar-day:focus-visible {
  outline: none;
  background: #eaf4ff;
  color: var(--accent);
}

.reminder-calendar-day.is-today {
  color: var(--accent);
  font-weight: 750;
}

.reminder-calendar-day.is-today:not(.is-selected)::after {
  position: absolute;
  right: 50%;
  bottom: 4px;
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform: translateX(50%);
}

.reminder-calendar-day.is-selected {
  background: var(--accent);
  color: #fff;
  font-weight: 750;
}

.conversation-contact-button {
  display: flex;
  min-width: 0;
  flex: 1 1 0;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.chat-collaboration {
  display: flex;
  width: clamp(150px, 24vw, 320px);
  min-width: 0;
  flex: 0 1 320px;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  overflow: hidden;
  text-align: center;
}

.chat-viewers,
.chat-typing {
  display: block;
  width: 100%;
  overflow: hidden;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-viewers {
  color: var(--muted);
}

.chat-typing {
  color: #b26400;
}

.conversation-contact-button:hover .conversation-title,
.conversation-contact-button:focus-visible .conversation-title {
  opacity: 0.72;
}

.conversation-contact-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.conversation-contact-button .dialog-avatar {
  flex: 0 0 auto;
}

.conversation-title {
  display: flex;
  min-width: 0;
  flex: 1;
  align-self: stretch;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
}

.conversation-contact-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-contact-name {
  min-width: 0;
  max-width: 100%;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.16;
}

.chat-username {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--accent);
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-username.is-chat-type {
  color: var(--muted);
  font-weight: 400;
}

.connection-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.13);
}

.connection-indicator.is-reconnecting {
  background: #ff9f0a;
  box-shadow: 0 0 0 4px rgba(255, 159, 10, 0.14);
  animation: connection-pulse 1.2s ease-in-out infinite;
}

.connection-indicator.is-offline {
  background: #ff3b30;
  box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.13);
}

@keyframes connection-pulse {
  50% {
    opacity: 0.45;
  }
}

.back-button {
  display: grid;
}

.contact-panel {
  position: absolute;
  z-index: 8;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--contact-panel-width);
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: rgba(246, 246, 248, 0.98);
  box-shadow: -14px 0 36px rgba(0, 0, 0, 0.12);
  transform: translateX(102%);
  transition: transform 200ms ease;
}

.contact-panel.is-open {
  transform: translateX(0);
}

.contact-panel-header {
  display: flex;
  min-height: 77px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.contact-panel-header strong {
  font-size: 15px;
  font-weight: 600;
}

.contact-panel-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #e9e9ed;
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.contact-panel-close:hover {
  background: #dedee3;
  color: var(--ink);
}

.contact-panel-body {
  display: flex;
  height: calc(100% - 77px);
  min-height: 0;
  flex-direction: column;
  padding: 18px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  text-align: left;
}

.contact-tags-sticky {
  position: sticky;
  z-index: 4;
  top: -18px;
  flex: 0 0 auto;
  margin: -18px -18px 14px;
  padding: 14px 18px 3px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
  background: rgba(247, 247, 249, 0.94);
  box-shadow: 0 7px 18px rgba(34, 34, 38, 0.04);
  backdrop-filter: blur(18px);
}

.contact-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
  padding: 0 2px 15px;
}

.contact-panel-avatar {
  display: grid;
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--avatar-color, #007aff) 72%, white),
    var(--avatar-color, #007aff)
  );
  color: #fff;
  font-size: 25px;
  font-weight: 600;
}

.contact-identity-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.contact-identity.has-participants .contact-identity-copy {
  min-height: 74px;
  justify-content: space-between;
}

.contact-identity-copy h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 650;
}

.contact-identity.has-participants .contact-identity-copy h2 {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-identity.has-participants .contact-panel-username {
  margin: 0;
}

.contact-panel-username {
  min-height: 20px;
  margin: 5px 0 0;
  color: var(--accent);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.contact-panel-username.is-empty {
  color: var(--muted);
}

.show-participants-button {
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.show-participants-button:hover,
.show-participants-button:focus-visible {
  outline: none;
  text-decoration: underline;
}

.contact-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.contact-controls.is-single {
  grid-template-columns: calc((100% - 10px) / 2);
  justify-content: center;
}

.contact-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}

.contact-field select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  border: 1px solid rgba(60, 60, 67, 0.18);
  border-radius: 18px;
  outline: none;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  text-align: center;
  text-align-last: center;
  white-space: nowrap;
}

.contact-field option {
  white-space: nowrap;
}

.contact-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.contact-field select:disabled {
  cursor: wait;
  opacity: 0.65;
}

.contact-save-status {
  min-height: 18px;
  margin: 7px 0 3px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.contact-save-status.is-error {
  color: #c9342f;
}

.client-notes-section {
  display: flex;
  min-height: 250px;
  flex: 1 0 250px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 18px;
  background: rgba(229, 229, 234, 0.55);
  cursor: text;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.participants-section {
  display: flex;
  min-height: 250px;
  flex: 0 0 250px;
  flex-direction: column;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 18px;
  background: #fff;
}

.participants-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px 9px 13px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
  background: rgba(255, 255, 255, 0.92);
}

.participants-heading h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.participants-heading-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.participants-count {
  display: grid;
  min-width: 23px;
  height: 23px;
  padding: 0 7px;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

.participants-close {
  display: grid;
  width: 26px;
  height: 26px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #e9e9ed;
  color: var(--muted);
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
}

.participants-close:hover,
.participants-close:focus-visible {
  outline: none;
  background: #dedee3;
  color: var(--ink);
}

.participants-list {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

.participant-item {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 38px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 0;
  border-bottom: 1px solid rgba(60, 60, 67, 0.08);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.participant-item:last-child {
  border-bottom: 0;
}

.participant-item:hover,
.participant-item:focus-visible {
  outline: none;
  background: rgba(0, 122, 255, 0.07);
}

.participant-item:disabled {
  cursor: default;
  opacity: 0.52;
}

.participant-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--avatar-color, #007aff) 72%, white),
    var(--avatar-color, #007aff)
  );
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}

.participant-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.participant-copy strong,
.participant-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-copy strong {
  font-size: 13px;
  font-weight: 600;
}

.participant-copy span {
  color: var(--muted);
  font-size: 11px;
}

.participant-arrow {
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.participants-empty {
  margin: auto;
  padding: 20px 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.participants-empty.is-error {
  color: #c9342f;
}

.client-notes-section:focus,
.client-notes-section:focus-within {
  border-color: rgba(0, 122, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.client-notes-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px 9px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
  background: rgba(255, 255, 255, 0.82);
}

.client-notes-heading h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.client-notes-count {
  display: grid;
  min-width: 23px;
  height: 23px;
  padding: 0 7px;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

.client-notes-list {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 7px;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

.client-note {
  display: flex;
  justify-content: flex-start;
}

.client-note.is-own {
  justify-content: flex-end;
}

.client-note-bubble {
  position: relative;
  max-width: 88%;
  min-width: 112px;
  padding: 8px 10px 18px;
  border-radius: 14px 14px 14px 5px;
  background: #fff;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.client-note.is-own .client-note-bubble {
  border-radius: 14px 14px 5px;
  background: #dff3ff;
}

.client-note-author {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 650;
}

.client-note-text {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.client-note-time {
  position: absolute;
  right: 8px;
  bottom: 4px;
  color: var(--muted);
  font-size: 9px;
}

.client-notes-empty {
  margin: auto;
  padding: 20px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.client-notes-empty.is-error {
  color: #c9342f;
}

.client-note-form {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 7px;
  padding: 8px;
  border-top: 1px solid rgba(60, 60, 67, 0.12);
  background: rgba(255, 255, 255, 0.92);
}

.client-note-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  max-height: 96px;
  resize: none;
  padding: 8px 11px;
  border: 1px solid rgba(60, 60, 67, 0.18);
  border-radius: 16px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 18px;
}

.client-note-form textarea:focus {
  border-color: var(--accent);
}

.client-note-send {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
}

.client-note-send:disabled {
  cursor: wait;
  opacity: 0.55;
}

.common-chats-section {
  flex: 0 0 auto;
  margin-top: 12px;
  text-align: left;
}

.common-chats-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 9px;
}

.common-chats-heading h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.common-chats-count {
  display: grid;
  min-width: 23px;
  height: 23px;
  padding: 0 7px;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

.common-chats-list {
  max-height: 174px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 18px;
  background: #fff;
}

.common-chat-item {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(60, 60, 67, 0.12);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.common-chat-item:last-child {
  border-bottom: 0;
}

.common-chat-item:hover {
  background: #f2f2f7;
}

.common-chat-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--avatar-color, #007aff) 72%, white),
    var(--avatar-color, #007aff)
  );
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.common-chat-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.common-chat-copy strong,
.common-chat-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.common-chat-copy strong {
  font-size: 13px;
  font-weight: 600;
}

.common-chat-copy span {
  color: var(--muted);
  font-size: 10px;
}

.common-chat-arrow {
  color: #c7c7cc;
  font-size: 24px;
  line-height: 1;
  text-align: right;
}

.common-chats-empty {
  margin: 0;
  padding: 17px 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.common-chats-empty.is-error {
  color: #c9342f;
}

.messages-list {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  padding: 18px clamp(16px, 4vw, 58px);
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #aeaeb2 rgba(242, 242, 247, 0.82);
}

.messages-container {
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
  flex-direction: column;
  gap: 7px;
  margin-top: auto;
}

.message-row {
  display: flex;
  align-items: flex-end;
}

.message-row.is-out {
  justify-content: flex-end;
}

.message-bubble {
  position: relative;
  max-width: min(72%, 680px);
  padding: 5px 11px 2px;
  border-radius: 18px 18px 18px 6px;
  background: var(--incoming);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.message-reply-preview {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 6px;
  padding: 5px 8px;
  overflow: hidden;
  border-left: 3px solid var(--accent);
  border-radius: 4px 9px 9px 4px;
  background: rgba(0, 122, 255, 0.08);
}

.message-row.is-out .message-reply-preview {
  border-left-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.13);
}

.message-reply-preview strong,
.message-reply-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-reply-preview strong {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.message-row.is-out .message-reply-preview strong {
  color: #fff;
}

.message-reply-preview span {
  color: var(--muted);
  font-size: 11px;
}

.message-row.is-out .message-reply-preview span {
  color: rgba(255, 255, 255, 0.8);
}

.message-pin-mark {
  display: inline-block;
  margin-left: 5px;
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
}

.message-row.is-out .message-pin-mark {
  color: rgba(255, 255, 255, 0.85);
}

.message-row.is-out .message-bubble {
  border-radius: 18px 18px 6px 18px;
  background: var(--outgoing);
  color: #ffffff;
}

.message-bubble.has-attachment {
  width: min(330px, 72vw);
  padding: 8px 11px 4px;
}

.message-sender {
  margin: 0 0 4px;
  overflow: hidden;
  color: var(--sender-color, var(--accent));
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-row.is-out .message-sender {
  color: rgba(255, 255, 255, 0.82);
}

.message-attachment {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.message-attachment:hover .message-attachment-name {
  text-decoration: underline;
}

.message-attachment-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 21px;
  font-weight: 700;
}

.message-row.is-out .message-attachment-icon {
  background: rgba(255, 255, 255, 0.23);
}

.message-attachment-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.message-attachment-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-attachment-meta {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.message-row.is-out .message-attachment-meta {
  color: rgba(255, 255, 255, 0.7);
}

.message-bubble.has-attachment .message-text {
  display: block;
  margin-top: 7px;
}

.message-bubble.has-attachment .message-time {
  display: block;
  margin-top: 3px;
  text-align: right;
}

.message-photo-link {
  display: flex;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 17px;
  background: #000000;
  line-height: 0;
}

.message-photo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(420px, 60vh);
  object-fit: contain;
}

.message-bubble.has-photo {
  position: relative;
  width: fit-content;
  max-width: min(72%, 420px);
  padding: 1px;
  overflow: hidden;
}

.message-bubble.has-photo .message-time {
  position: absolute;
  right: 7px;
  bottom: 6px;
  z-index: 1;
  margin: 0;
  padding: 2px 5px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.48);
  color: #ffffff;
  line-height: 1.1;
}

.message-bubble.has-photo .message-sender {
  margin: 6px 9px 5px;
}

.message-bubble.has-photo.has-caption {
  padding-bottom: 4px;
}

.message-bubble.has-photo.has-caption .message-text {
  margin: 6px 9px 1px;
}

.message-bubble.has-photo.has-caption .message-time {
  position: static;
  display: block;
  margin: 2px 8px 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  text-align: right;
}

.message-bubble.has-photo.has-reactions .message-time {
  position: static;
  display: block;
  margin: 2px 8px 3px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  text-align: right;
}

.message-row.is-out .message-bubble.has-photo.has-reactions .message-time {
  color: rgba(255, 255, 255, 0.72);
}

.message-row.is-out .message-bubble.has-photo.has-caption .message-time {
  color: rgba(255, 255, 255, 0.72);
}

.message-text {
  display: inline;
  font-family: var(--font-text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.38;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 5px 0 1px;
}

.message-bubble.has-photo .message-reactions {
  margin: 5px 8px 1px;
}

.message-reaction {
  display: inline-flex;
  min-width: 31px;
  height: 24px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 7px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.09);
  color: var(--accent);
  cursor: default;
  font-family: var(--font-text);
  line-height: 1;
}

.message-reaction.is-chosen {
  border-color: rgba(0, 122, 255, 0.35);
  background: rgba(0, 122, 255, 0.18);
}

.message-reaction-emoji {
  font-size: 14px;
}

.message-reaction-count {
  font-size: 10px;
  font-weight: 600;
}

.message-row.is-out .message-reaction {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.message-row.is-out .message-reaction.is-chosen {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.26);
}

.message-time {
  display: inline-block;
  margin: 0 0 0 7px;
  color: var(--muted);
  font-family: var(--font-text);
  font-size: 8px;
  font-weight: 400;
  line-height: 1;
  vertical-align: -1px;
  white-space: nowrap;
}

.message-row.is-out .message-time {
  color: rgba(255, 255, 255, 0.72);
}

.day-divider {
  align-self: center;
  margin: 12px 0 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(60, 60, 67, 0.56);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.older-button {
  display: block;
  margin: 0 auto 14px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 7px rgba(27, 57, 59, 0.1);
  color: var(--accent);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.composer {
  display: grid;
  padding: 14px clamp(16px, 4vw, 58px) 18px;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: rgba(249, 249, 249, 0.96);
}

.composer-mode {
  display: grid;
  min-width: 0;
  grid-column: 1 / -1;
  grid-template-columns: 3px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  margin: -6px 0 1px;
  padding: 7px 8px 7px 2px;
  border-radius: 12px;
  background: rgba(229, 241, 255, 0.82);
}

.composer-mode-mark {
  width: 3px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent);
}

.composer-mode.is-edit .composer-mode-mark {
  background: #ff9500;
}

.composer-mode-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.composer-mode-copy strong,
.composer-mode-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-mode-copy strong {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.composer-mode.is-edit .composer-mode-copy strong {
  color: #c76700;
}

.composer-mode-copy span {
  color: var(--muted);
  font-size: 11px;
}

.composer-mode-cancel {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(60, 60, 67, 0.1);
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.composer-mode-cancel:hover,
.composer-mode-cancel:focus-visible {
  outline: none;
  background: rgba(60, 60, 67, 0.16);
  color: var(--ink);
}

.composer textarea {
  max-height: 128px;
  min-height: 46px;
  padding: 12px 15px;
  resize: none;
  border-radius: 18px;
  font-family: var(--font-text);
  font-weight: 400;
  line-height: 1.35;
}

.send-button {
  width: 46px;
  height: 46px;
  align-self: end;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.25);
  color: #fff;
  cursor: pointer;
  font-size: 23px;
  font-weight: 700;
}

.send-button:hover {
  background: var(--accent-dark);
}

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

.attachment-button {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #e5e5ea;
  color: var(--accent);
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
}

.attachment-button:hover,
.attachment-button[aria-expanded="true"] {
  background: #d8eaff;
}

.attachment-button:active {
  transform: scale(0.96);
}

.attachment-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.attachment-button.is-busy svg {
  animation: attachment-spin 900ms linear infinite;
}

.attachment-menu {
  position: absolute;
  z-index: 12;
  bottom: calc(100% + 12px);
  left: 0;
  width: min(280px, calc(100vw - 32px));
  max-height: min(480px, calc(100vh - 110px));
  padding: 7px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(60, 60, 67, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
}

.attachment-menu button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}

.attachment-menu button:hover,
.attachment-menu button:focus-visible {
  outline: none;
  background: #f2f2f7;
}

.attachment-menu-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: #e5f1ff;
  color: var(--accent);
  font-size: 16px;
}

.attachment-menu-separator {
  height: 1px;
  margin: 5px 7px;
  background: rgba(60, 60, 67, 0.15);
}

@keyframes attachment-spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100vw - 48px));
  padding: 13px 16px;
  border-radius: 13px;
  background: rgba(44, 44, 46, 0.94);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 13px;
}

.settings-menu-item {
  font-family: var(--font-text);
  font-weight: 400;
}

@media (max-width: 900px) {
  .conversation {
    --contact-panel-width: min(440px, 100%);
  }

  .conversation.is-contact-open .active-conversation {
    margin-right: 0;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding: 0;
  }

  .chat-layout {
    border: 0;
    border-radius: 0;
  }

  .message-bubble {
    max-width: 88%;
  }

  .setup-card,
  .auth-card {
    width: 100%;
    min-height: 100%;
    padding: 32px 24px;
    border: 0;
    border-radius: 0;
  }

  .center-view {
    padding-block: 0;
  }

  .conversation-header {
    padding-inline: 12px;
  }

  .reminder-button span {
    display: none;
  }

  .reminder-button {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .reminder-calendar {
    position: fixed;
    top: 74px;
    right: 12px;
    width: min(300px, calc(100vw - 24px));
  }

  .empty-conversation {
    padding: 142px 12px 24px;
  }

  .empty-online-panel {
    width: calc(100% - 24px);
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
