:root {
  --rail: #00182c;
  --rail-soft: #0a2e50;
  --bg: #f5f6f8;
  --panel: #fff;
  --line: #e6e9ef;
  --text: #00182c;
  --muted: #66727e;
  --blue: #2196f3;
  --blue-dark: #10578f;
  --green: #02ce79;
  --green-dark: #02b56a;
  --orange: #ff6646;
  --yellow: #fdab3d;
  --red: #f54e67;
  --shadow: 0 18px 42px rgba(0, 24, 44, .12);
  --soft-shadow: 0 10px 24px rgba(0, 24, 44, .08);
  --button-shadow: 0 12px 26px rgba(33, 150, 243, .22);
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Montserrat, Inter, Arial, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

button,
.ghost,
.primary,
.top-link,
.funnel-tab,
.deal-card,
.column-actions button,
.drawer-head button,
.thread-more,
.stage-form button,
.composer button,
.modal-card footer button,
.merge-search-row button,
.all-reminder-item button,
.quick-reply-item {
  transition:
    background-color .16s ease,
    border-color .16s ease,
    color .16s ease,
    box-shadow .16s ease,
    transform .16s ease,
    opacity .16s ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(33, 150, 243, .24);
  outline-offset: 2px;
}

@keyframes okoButtonWiggle {
  25% { transform: translateY(-1px) scale(.985, 1.025); }
  50% { transform: translateY(-1px) scale(1.018, .992); }
  75% { transform: translateY(-1px) scale(.992, 1.018); }
}

@keyframes okoSoftAppear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.crm {
  height: 100dvh;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  background: #e6e9ef;
}

.rail {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px 7px;
  background:
    linear-gradient(180deg, rgba(33, 150, 243, .14), rgba(2, 206, 121, .04) 36%, transparent),
    var(--rail);
  color: #d8e6ef;
  box-shadow: 8px 0 24px rgba(0, 24, 44, .14);
}
.rail-logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(33, 150, 243, .28);
}
.rail-item {
  position: relative;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
}
.rail-item::before {
  content: attr(data-letter);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .08);
  color: currentColor;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}
.rail-item.active,
.rail-item:hover {
  background: rgba(255, 255, 255, .11);
  color: #fff;
  transform: translateY(-1px);
}
.rail-item.active::before,
.rail-item:hover::before {
  border-color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .18);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
}
.rail-item span {
  position: absolute;
  left: 62px;
  top: 50%;
  z-index: 30;
  transform: translateY(-50%);
  display: none;
  border-radius: 8px;
  background: #0f2636;
  color: #fff;
  padding: 7px 9px;
  white-space: nowrap;
  font-size: 12px;
  box-shadow: var(--shadow);
}
.rail-item:hover span { display: block; }

.surface {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 66px auto minmax(0, 1fr);
  background:
    radial-gradient(circle at 0 0, rgba(33, 150, 243, .08), transparent 28%),
    var(--bg);
}

.topbar {
  min-width: 0;
  display: grid;
  grid-template-columns: 270px minmax(260px, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background:
    linear-gradient(135deg, #00182c 0%, #0a2e50 58%, #112e48 100%);
  padding: 10px 16px;
  color: #fff;
  box-shadow: var(--soft-shadow);
}
h1, h2, p { margin: 0; }
.topbar h1 { font-size: 18px; line-height: 1.1; }
.topbar p { margin-top: 4px; color: #aeb9c5; font-size: 12px; }
.search input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--radius);
  background: #fff;
  padding: 0 12px;
  outline: 0;
  box-shadow: 0 8px 20px rgba(0, 24, 44, .08);
}
.ghost, .primary {
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #25313b;
  padding: 0 14px;
  font-weight: 700;
}
.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  box-shadow: 0 12px 28px rgba(2, 206, 121, .24);
}
.primary:hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
  animation: okoButtonWiggle .56s ease;
}
.primary:active,
.ghost:active,
.funnel-tab:active,
.composer button:active,
.drawer-head button:active {
  transform: translateY(1px) scale(.985);
}
.topbar .ghost {
  border-color: rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .09);
  color: #fff;
}
.topbar .ghost:hover {
  border-color: rgba(255, 255, 255, .42);
  background: rgba(255, 255, 255, .16);
  transform: translateY(-1px);
}
.top-link { white-space: nowrap; }

.funnel-tabs {
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow: auto;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px 16px;
  scrollbar-width: thin;
  box-shadow: 0 1px 0 rgba(0, 24, 44, .03);
}
.funnel-tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #25313b;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}
.funnel-tab b {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f0f2f5;
  color: var(--muted);
  font-size: 11px;
}
.funnel-unread {
  position: absolute;
  right: 3px;
  bottom: 2px;
  min-width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  padding: 0 4px;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}
.funnel-unread[hidden] {
  display: none;
}
.funnel-tab.active,
.funnel-tab:hover {
  border-color: rgba(33, 150, 243, .34);
  background: #f4faff;
  color: var(--blue);
  box-shadow: 0 8px 20px rgba(33, 150, 243, .11);
  transform: translateY(-1px);
}
.funnel-tab.avito.active,
.funnel-tab.avito:hover {
  border-color: rgba(2, 206, 121, .42);
  background: #effaf3;
  color: #037447;
}
.funnel-tab.telegram.active,
.funnel-tab.telegram:hover {
  border-color: #229ed9;
  background: #eef9ff;
  color: #1688bd;
}
.funnel-tab.max.active,
.funnel-tab.max:hover {
  border-color: #7c3aed;
  background: #f6f0ff;
  color: #6d28d9;
}

.board {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 300px);
  gap: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  padding: 14px;
  animation: okoSoftAppear .24s ease both;
}
.board.recent-board {
  display: block;
  overflow: auto;
}
.column {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--soft-shadow);
}
.column-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 12px 12px 10px;
  border-top: 3px solid var(--yellow);
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.column:nth-child(2n) .column-head { border-top-color: #6aaee8; }
.column:nth-child(3n) .column-head { border-top-color: #8bd17c; }
.column:nth-child(4n) .column-head { border-top-color: #ff9f68; }
.column-avito .column-head { border-top-color: #0a66c2; }
.column-telegram .column-head { border-top-color: #229ed9; }
.column-max .column-head { border-top-color: #7c3aed; }
.column-crm .column-head { border-top-color: #667085; }
.recent-column {
  width: 100%;
  max-width: 100%;
  margin: 0;
}
.recent-column .column-head {
  border-top-color: #123246;
}
.recent-column .cards {
  grid-template-columns: 1fr;
}
.recent-column .deal-card {
  width: 100%;
}
.recent-column .deal-card em {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.35;
}
.column.drop-target {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
.column.stage-column-dragging {
  opacity: .62;
}
.column.stage-drop-before {
  box-shadow: inset 4px 0 0 var(--blue);
}
.column.stage-drop-after {
  box-shadow: inset -4px 0 0 var(--blue);
}
.column-readonly .column-head {
  opacity: .78;
}
.column-head[draggable="true"] {
  cursor: grab;
}
.column-head[draggable="true"]:active {
  cursor: grabbing;
}
.column-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.column-head span { color: var(--muted); font-size: 12px; }
.column-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.column-actions {
  display: inline-flex;
  gap: 3px;
}
.column-actions button {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #344054;
  padding: 0;
  font-size: 13px;
  font-weight: 900;
}
.column-actions button:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(33, 150, 243, .13);
}
.cards {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 8px;
}
.deal-card {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 9px;
  color: var(--text);
  text-align: left;
  box-shadow: 0 1px 2px rgba(0, 24, 44, .05);
}
.deal-card[draggable="true"] { cursor: grab; }
.deal-card.dragging {
  opacity: .55;
  cursor: grabbing;
}
.deal-card.source-avito { border-left: 4px solid #0a66c2; }
.deal-card.source-telegram { border-left: 4px solid #229ed9; }
.deal-card.source-max { border-left: 4px solid #7c3aed; }
.deal-card.has-phone {
  background: linear-gradient(180deg, #fff, #f8fff9);
}
.duplicate-badge {
  justify-self: end;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #f0c36a;
  border-radius: 999px;
  background: #fff6d8;
  color: #8a5a00;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  margin-top: -3px;
}
.duplicate-badge[hidden] { display: none; }
.duplicate-badge.soft-link {
  border-color: #8cc5ff;
  background: #edf7ff;
  color: #0a5f9e;
}
.merge-hint {
  appearance: none;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 22px;
  border: 1px solid #f0c36a;
  border-radius: var(--radius);
  background: #fff8e6;
  color: #7a4d00;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
}
.merge-hint.soft-link {
  border-color: #8cc5ff;
  background: #edf7ff;
  color: #0a5f9e;
}
.merge-hint:disabled {
  cursor: default;
  opacity: .72;
}
.merge-hint[hidden] { display: none; }
.deal-card:hover,
.deal-card.active {
  border-color: rgba(33, 150, 243, .48);
  box-shadow: 0 12px 24px rgba(0, 24, 44, .10), 0 0 0 2px rgba(33, 150, 243, .10);
  transform: translateY(-2px);
}
.deal-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.deal-card strong,
.deal-card em,
.source-line span,
.phone-line,
.city-line {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deal-card strong { font-size: 14px; line-height: 1.2; }
.city-line {
  color: #667085;
  font-size: 12px;
  line-height: 1.15;
  margin-top: -3px;
}
.city-line[hidden] { display: none; }
.deal-card em { color: var(--muted); font-size: 12px; font-style: normal; }
.pending-preview {
  min-width: 0;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  color: #3b5568;
  font-size: 11px;
  font-weight: 800;
}
.pending-preview[hidden] { display: none; }
.pending-preview-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pending-preview.failed {
  color: #8f1f1f;
}
.source-line {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  color: #475467;
  font-size: 11px;
}
.source-line i {
  min-width: 28px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f0f2f5;
  color: #344054;
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}
.source-avito .source-line i { background: #e8f2ff; color: #0a66c2; }
.source-telegram .source-line i { background: #e8f7ff; color: #1688bd; }
.source-max .source-line i { background: #f4efff; color: #6d28d9; }
.phone-line {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-self: stretch;
  max-width: 100%;
  border: 1px solid #8fd3a8;
  border-radius: var(--radius);
  background: #effaf3;
  color: #02633f;
  padding: 7px 8px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.1;
}
.phone-line b {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
}
.phone-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phone-line[hidden] { display: none; }
.task {
  justify-self: end;
  color: #d38b00;
  font-size: 11px;
}
.task.unread,
.task.unanswered {
  border-radius: 999px;
  background: #fff1f1;
  color: #c01818;
  padding: 2px 7px;
  font-weight: 900;
}
.task.unanswered {
  animation: unansweredPulse 2.6s ease-in-out infinite;
}
@keyframes unansweredPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(192, 24, 24, 0); }
  50% { box-shadow: 0 0 0 3px rgba(192, 24, 24, .12); }
}
.task.overdue {
  border-radius: 999px;
  background: #fff1f1;
  color: #c01818;
  padding: 2px 7px;
  font-weight: 900;
}

.chat-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 50;
  width: min(430px, 100vw);
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-left: 1px solid var(--line);
  background: #f5f6f8;
  transform: translateX(100%);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
  box-shadow: var(--shadow);
}
body.drawer-open .chat-drawer { transform: translateX(0); }
.drawer-head {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 66px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
}
.drawer-head button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 20px;
}
.drawer-head button:hover,
.thread-more:hover,
.modal-card header button:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(33, 150, 243, .12);
}
.drawer-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.drawer-title-row {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "title title"
    "route route"
    "reminder merge"
    "delete delete";
  gap: 6px;
  align-items: center;
}
.drawer-head h2 {
  grid-area: title;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}
.drawer-head .route-toggle {
  grid-area: route;
  justify-self: stretch;
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 9px;
  border-color: #b9d8f7;
  background: #f4faff;
  color: #155a9e;
  font-size: 11.5px;
  font-weight: 900;
  white-space: nowrap;
}
.drawer-head .route-toggle:disabled {
  opacity: .55;
  cursor: default;
}
.drawer-head .route-toggle[aria-expanded="true"] {
  background: #dff0ff;
  border-color: var(--blue);
}
.drawer-head .reminder-toggle,
.drawer-head .merge-toggle,
.drawer-head .delete-dialog-toggle {
  width: 100%;
  min-width: 0;
  height: 30px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #25313b;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.drawer-head .reminder-toggle {
  grid-area: reminder;
  border-color: #bbd7c5;
  background: #effaf3;
  color: #087443;
}
.drawer-head .merge-toggle {
  grid-area: merge;
}
.drawer-head .delete-dialog-toggle {
  grid-area: delete;
  border-color: #f0c6c6;
  background: #fff6f6;
  color: #b62929;
}
.drawer-head .reminder-toggle:disabled,
.drawer-head .merge-toggle:disabled,
.drawer-head .delete-dialog-toggle:disabled {
  opacity: .45;
}
.drawer-head p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.drawer-phone {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  border-radius: 999px;
  background: #effaf3;
  color: #027a48;
  padding: 3px 8px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}
.drawer-phone[hidden] { display: none; }
.reminder-panel {
  display: grid;
  gap: 5px;
  margin-top: 6px;
}
.reminder-panel[hidden] {
  display: none;
}
.reminder-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 6px;
  align-items: center;
  border: 1px solid #cce6d4;
  border-radius: 7px;
  background: #f3fbf5;
  color: #14532d;
  padding: 6px 7px;
  font-size: 12px;
  font-weight: 750;
}
.reminder-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reminder-item button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #dbeee1;
  color: #166534;
  font-size: 15px;
  line-height: 20px;
}
.thread {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 14px;
}
.thread-more {
  align-self: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
}
.bubble {
  position: relative;
  max-width: 86%;
  display: grid;
  gap: 5px;
  border: 1px solid #dfe5ec;
  border-radius: var(--radius);
  background: #fff;
  padding: 9px 10px;
}
.message-delete {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #7b8794;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.message-delete:hover {
  color: #d92d20;
}
.bubble.inbound { align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.outbound {
  align-self: flex-end;
  border-color: rgba(2, 206, 121, .28);
  border-bottom-right-radius: 4px;
  background: #e9fbf2;
  padding-right: 34px;
}
.bubble.system {
  align-self: center;
  max-width: 92%;
  background: #fff8e6;
  color: #8a5a00;
  text-align: center;
}
.bubble.handoff-start {
  border-color: #b7e4c7;
  background: #ecfdf3;
  color: #02633f;
  font-weight: 800;
}
.bubble.send-failed {
  align-self: flex-end;
  border-color: #f0b4b4;
  background: #fff1f1;
  color: #8f1f1f;
}
.send-error {
  color: #8f1f1f;
  font-size: 12px;
  font-weight: 700;
  margin-top: 6px;
}
.send-progress {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  color: #3b5568;
  font-size: 11px;
  font-weight: 800;
}
.send-progress-label {
  min-width: 0;
  overflow-wrap: anywhere;
}
.send-progress-ring {
  --progress: 0%;
  width: 16px;
  height: 16px;
  display: inline-block;
  border-radius: 999px;
  background: conic-gradient(#1688bd var(--progress), rgba(22, 136, 189, .18) 0);
  position: relative;
  animation: sendProgressSpin 1s linear infinite;
}
.send-progress-ring::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  background: #fff;
}
.send-progress.sent .send-progress-ring,
.send-progress.failed .send-progress-ring,
.pending-preview.failed .send-progress-ring {
  animation: none;
}
.bubble.send-failed .send-progress {
  color: #8f1f1f;
}
.bubble.send-failed .send-progress-ring,
.send-progress.failed .send-progress-ring,
.pending-preview.failed .send-progress-ring {
  background: conic-gradient(#d92d20 var(--progress), rgba(217, 45, 32, .16) 0);
}
@keyframes sendProgressSpin {
  to { transform: rotate(360deg); }
}
.bubble small { color: var(--muted); font-size: 11px; }
.bubble p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.42; }
.msg-receipt {
  position: absolute;
  right: 8px;
  bottom: 7px;
  min-width: 14px;
  display: inline-flex;
  justify-content: flex-end;
  gap: 1px;
  color: #4f7f9f;
  user-select: none;
}
.msg-receipt i {
  width: 5px;
  height: 9px;
  display: block;
  border-right: 1.7px solid currentColor;
  border-bottom: 1.7px solid currentColor;
  transform: rotate(45deg);
}
.msg-receipt i + i {
  margin-left: -2px;
}
.msg-receipt[data-status="accepted"] {
  color: #6b7b88;
}
.msg-receipt[data-status="sent"] {
  color: #1688bd;
}
.msg-receipt[data-status="delivered"] {
  color: #1688bd;
}
.msg-receipt[data-status="read"] {
  color: #d92d20;
}
.attachments {
  display: grid;
  gap: 7px;
}
.attachments[hidden] { display: none; }
.attachments img {
  max-width: 100%;
  max-height: 260px;
  display: block;
  border-radius: 8px;
  object-fit: contain;
  background: #eef1f4;
}
.attachments audio {
  width: 100%;
  max-width: 280px;
}
.attachments video {
  width: 100%;
  max-width: 320px;
  max-height: 260px;
  border-radius: 8px;
  background: #111827;
}
.attachment-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.attachment-label.unavailable {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #f7f9fb;
  color: var(--ink);
}
.attachments a {
  color: var(--blue);
  overflow-wrap: anywhere;
  font-weight: 700;
}
.stage-form,
.composer {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 10px;
}
.stage-form {
  grid-template-columns: minmax(0, 1fr) 118px;
  align-items: end;
}
.stage-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.stage-form select {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0 9px;
}
.stage-form button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #25313b;
  font-weight: 700;
}
.stage-form button:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-1px);
  box-shadow: var(--button-shadow);
}
.composer {
  display: grid;
  grid-template-columns: repeat(4, minmax(64px, .92fr)) minmax(104px, 1.25fr);
}
.send-route {
  margin-top: 7px;
  display: grid;
  grid-template-columns: minmax(82px, 96px) minmax(110px, 140px) minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}
.send-route[hidden] {
  display: none;
}
.send-route label {
  min-width: 0;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.send-route select,
.send-route input {
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0 9px;
}
.send-route small {
  grid-column: 1 / -1;
  min-height: 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}
.composer textarea {
  grid-column: 1 / -1;
  min-height: 44px;
  max-height: 130px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  outline: 0;
}
.search input:focus,
.send-route select:focus,
.send-route input:focus,
.stage-form select:focus,
.composer textarea:focus,
.modal-card input:focus,
.modal-card select:focus,
.modal-card textarea:focus {
  border-color: rgba(33, 150, 243, .58);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, .12);
}
.composer button {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#sendButton {
  min-width: 104px;
  padding: 0 9px;
}
.composer button:hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(2, 206, 121, .20);
}
.composer button[type="submit"]:hover {
  animation: okoButtonWiggle .56s ease;
}
.composer .voice-button {
  border-color: var(--line);
  background: #fff;
  color: #25313b;
}
.composer .quick-button,
.composer .catalog-button,
.composer .file-button {
  border-color: var(--line);
  background: #fff;
  color: #25313b;
}
.composer .voice-button:hover,
.composer .quick-button:hover,
.composer .file-button:hover {
  border-color: var(--blue);
  background: #f4faff;
  color: var(--blue);
}
.composer .catalog-button {
  border-color: rgba(2, 206, 121, .32);
  background: #effaf3;
  color: #087443;
}
.composer .catalog-button:hover {
  border-color: var(--green);
  background: #dcf9ea;
  color: #027a48;
}
.composer .catalog-button[hidden] {
  display: none;
}
.composer .catalog-button:disabled {
  opacity: .55;
  cursor: default;
}
.catalog-send-control {
  min-width: 0;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
  gap: 6px;
  align-items: center;
}
.catalog-send-control[hidden] {
  display: none;
}
.composer-attachments {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.composer-attachments[hidden] {
  display: none;
}
.composer-attachment {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: #25313b;
  padding: 4px 5px 4px 8px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
}
.composer-attachment span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.composer-attachment-remove {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 14px;
  font-weight: 900;
  line-height: 18px;
  padding: 0;
  cursor: pointer;
}
.composer-attachment-remove:hover {
  background: #fee2e2;
  color: var(--red);
}
.composer .voice-button.recording {
  border-color: var(--red);
  background: #fff1f1;
  color: var(--red);
}
.composer .voice-button.has-voice {
  border-color: var(--green);
  background: #ecfdf3;
  color: #027a48;
}
@media (max-width: 560px) {
  .composer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .composer button {
    min-height: 36px;
  }
}
.stage-form[hidden] { display: none; }
.empty {
  margin: auto;
  color: var(--muted);
  text-align: center;
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  border-radius: var(--radius);
  background: #111827;
  color: #fff;
  padding: 11px 13px;
  box-shadow: var(--shadow);
  font-size: 13px;
}
.notify-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 82;
  display: grid;
  gap: 8px;
  width: min(330px, calc(100vw - 36px));
}
.notify-toast {
  position: relative;
  display: grid;
  gap: 3px;
  border: 1px solid #f2b8b5;
  border-left: 4px solid #d92d20;
  border-radius: var(--radius);
  background: #fff;
  color: #25313b;
  padding: 10px 38px 10px 12px;
  text-align: left;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.notify-close {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 24px;
  height: 24px;
  border: 1px solid #f2b8b5;
  border-radius: var(--radius);
  background: #fff;
  color: #b42318;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}
.notify-close:hover {
  background: #fee4e2;
}
.notify-toast strong {
  color: #c01818;
  font-size: 12px;
}
.notify-toast span {
  font-size: 13px;
  font-weight: 900;
}
.notify-toast em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .42);
  padding: 18px;
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(460px, 100%);
  display: grid;
  gap: 12px;
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow);
}
.modal-card header,
.modal-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.modal-card header strong { font-size: 16px; }
.modal-card header button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 20px;
}
.modal-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.modal-card input,
.modal-card select,
.modal-card textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  outline: 0;
}
.modal-card textarea {
  min-height: 96px;
  resize: vertical;
}
.modal-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.modal-card footer {
  justify-content: flex-end;
}
.modal-card footer button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #25313b;
  padding: 0 10px;
  font-weight: 800;
}
.modal-card footer button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.modal-card footer button:hover,
.merge-search-row button:hover,
.quick-reply-item:hover,
.all-reminder-item button:hover {
  transform: translateY(-1px);
  box-shadow: var(--button-shadow);
}
.merge-card {
  width: min(620px, 100%);
}
.stage-requirement-card {
  width: min(420px, 100%);
}
.reminders-card {
  width: min(620px, 100%);
}
.all-reminders-list {
  display: grid;
  gap: 7px;
  max-height: min(520px, 64dvh);
  overflow: auto;
}
.all-reminder-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #25313b;
  padding: 10px 11px;
  text-align: left;
}
.all-reminder-item button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: #344054;
  padding: 0;
  font-weight: 900;
}
.all-reminder-main {
  min-width: 0;
  display: grid;
  gap: 4px;
  cursor: pointer;
}
.all-reminder-main strong,
.all-reminder-main span,
.all-reminder-main em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.all-reminder-main strong {
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.25;
}
.all-reminder-main span {
  color: var(--muted);
  white-space: nowrap;
  font-size: 12px;
}
.all-reminder-main em {
  color: #344054;
  white-space: normal;
  font-size: 13px;
  font-style: normal;
  line-height: 1.3;
}
.all-reminders-empty {
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  padding: 14px;
  font-size: 14px;
}
.merge-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
}
.merge-search-row button {
  min-height: 40px;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}
.merge-list {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
}
.merge-item {
  display: grid;
  grid-template-rows: 2.75em 2.6em;
  gap: 6px;
  min-height: 92px;
  max-height: 92px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #25313b;
  padding: 10px 11px;
  text-align: left;
  overflow: hidden;
}
.merge-item.active {
  border-color: var(--blue);
  background: #edf7ff;
}
.merge-item-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name time"
    "source source";
  column-gap: 10px;
  row-gap: 3px;
  align-items: center;
  min-width: 0;
  color: #25313b;
  max-height: 2.75em;
  overflow: hidden;
}
.merge-item strong {
  grid-area: name;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 800;
}
.merge-item time {
  grid-area: time;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
}
.merge-source {
  grid-area: source;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.3;
}
.merge-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.merge-item em,
.merge-empty {
  color: var(--muted);
  font-size: 14px;
}
.quick-replies-card {
  width: min(560px, 100%);
}
.quick-replies-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}
.quick-reply-item {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #25313b;
  padding: 7px 9px;
  text-align: left;
  font-weight: 800;
}
.quick-reply-item-title,
.quick-reply-item small,
.quick-reply-attachments span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-reply-item-title {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}
.quick-reply-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}
.quick-reply-item.active {
  border-color: var(--blue);
  background: #f4faff;
  color: #075985;
}
.catalog-select {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #25313b;
  padding: 0 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}
.catalog-select[hidden] { display: none; }
.quick-reply-catalog-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 8px 10px;
  color: #25313b;
  font-size: 13px;
  font-weight: 800;
}
.quick-reply-catalog-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}
.quick-reply-catalog-toggle span {
  min-width: 0;
}
.quick-reply-catalog-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.quick-reply-catalog-options[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}
.quick-reply-attachments {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 8px;
}
.quick-reply-attachments[hidden] { display: none; }
.quick-reply-attachments span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}
.quick-reply-attachments span b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-reply-attachment-remove {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #667085;
  cursor: pointer;
}

@media (max-width: 1000px) {
  .crm { grid-template-columns: 56px minmax(0, 1fr); }
  .topbar { grid-template-columns: 1fr; height: auto; }
  .quick-reply-catalog-options { grid-template-columns: 1fr; }
}
