:root {
  --cursor-bg: #fafafa;
  --cursor-surface: #ffffff;
  --cursor-border: #ebebeb;
  --cursor-border-strong: #e0e0e0;
  --cursor-text: #111111;
  --cursor-text-secondary: #737373;
  --cursor-muted: #9ca3af;
  --cursor-hover: #f5f5f5;
  --cursor-active: #ebebeb;
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.1);
  --accent-border: rgba(99, 102, 241, 0.18);
  --ok: #059669;
  --fail: #e11d48;
  --sidebar-width: 240px;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(17, 17, 17, 0.04), 0 12px 40px rgba(17, 17, 17, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cursor-bg);
  color: var(--cursor-text);
}

button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }

/* Shell + sidebar */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cursor-surface);
  border-right: 1px solid var(--cursor-border);
  padding: 18px 12px 16px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  margin-bottom: 14px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #d2d2d7;
  background: #e8e8ed;
  color: #1d1d1f;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}

.brand-mark--accent {
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.sidebar-org {
  position: relative;
  margin: 0 4px 18px;
  z-index: 20;
}

.sidebar-org__label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--cursor-muted);
  margin: 0 4px 8px;
}

.org-select {
  position: relative;
}

.org-select__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--cursor-border);
  border-radius: 12px;
  background: var(--cursor-bg);
  color: var(--cursor-text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.org-select__trigger:hover {
  background: #f3f3f5;
  border-color: var(--cursor-border-strong);
}

.org-select--open .org-select__trigger {
  background: var(--cursor-surface);
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.org-select__avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: #4338ca;
  background: linear-gradient(160deg, #eef2ff, #e0e7ff);
  border: 1px solid rgba(99, 102, 241, 0.14);
}

.org-select__avatar--sm {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 10px;
}

.org-select__meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.org-select__name {
  display: block;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.02em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-select__role {
  display: block;
  font-size: 11px;
  color: var(--cursor-muted);
  line-height: 1.2;
}

.org-select__chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--cursor-muted);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, color 0.15s ease;
}

.org-select__chevron svg {
  width: 16px;
  height: 16px;
}

.org-select--open .org-select__chevron {
  transform: rotate(180deg);
  color: var(--cursor-text-secondary);
}

.org-select__menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  padding: 6px;
  border: 1px solid var(--cursor-border);
  border-radius: 12px;
  background: var(--cursor-surface);
  box-shadow: 0 8px 28px rgba(17, 17, 17, 0.1), 0 1px 2px rgba(17, 17, 17, 0.04);
  max-height: min(280px, 50vh);
  overflow: auto;
}

.org-select__option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--cursor-text);
  cursor: pointer;
  text-align: left;
}

.org-select__option:hover {
  background: var(--cursor-hover);
}

.org-select__option--active {
  background: var(--accent-soft);
}

.org-select__option .org-select__name {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.org-select__check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--accent);
  display: grid;
  place-items: center;
}

.org-select__check svg {
  width: 14px;
  height: 14px;
}

.org-select--empty {
  padding: 10px 12px;
  border: 1px dashed var(--cursor-border-strong);
  border-radius: 12px;
  background: var(--cursor-bg);
}

.org-select__hint {
  font-size: 12px;
  color: var(--cursor-muted);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--cursor-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.side-link:hover {
  background: var(--cursor-hover);
  color: var(--cursor-text);
}

.side-link--active {
  background: var(--cursor-active);
  color: var(--cursor-text);
}

.side-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-footer {
  border-top: 1px solid var(--cursor-border);
  padding-top: 12px;
  margin-top: 12px;
}

.sidebar-user {
  padding: 0 10px 10px;
  font-size: 12px;
  color: var(--cursor-text-secondary);
  word-break: break-all;
}

.content {
  min-width: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(99, 102, 241, 0.08), transparent 55%),
    var(--cursor-bg);
}

.content-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px clamp(16px, 3vw, 36px) 56px;
}

.content-inner:has(.crm-board) {
  max-width: 1280px;
}

.page-head {
  margin-bottom: 22px;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.page-head p {
  margin: 0;
  color: var(--cursor-text-secondary);
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #4338ca;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 999px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.btn-primary, .btn-secondary, .btn-ghost, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  min-height: 38px;
  padding: 0 14px;
}

.btn-primary {
  background: var(--cursor-text);
  color: #fff;
  border: none;
}

.btn-primary:hover { opacity: 0.92; }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-secondary {
  background: var(--cursor-surface);
  color: var(--cursor-text);
  border: 1px solid var(--cursor-border-strong);
}

.btn-secondary:hover { background: var(--cursor-hover); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--cursor-border);
  color: var(--cursor-text-secondary);
  min-height: 32px;
  font-size: 12px;
  padding: 0 10px;
}

.btn-danger {
  background: transparent;
  border: 1px solid rgba(225, 29, 72, 0.25);
  color: var(--fail);
  min-height: 32px;
  font-size: 12px;
  padding: 0 10px;
}

.panel {
  background: var(--cursor-surface);
  border: 1px solid var(--cursor-border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.03);
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.grid-2 {
  display: grid;
  gap: 12px;
}

@media (min-width: 760px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cursor-text-secondary);
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--cursor-border-strong);
  border-radius: 10px;
  background: var(--cursor-surface);
  color: var(--cursor-text);
  outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: #c7c7c7;
  box-shadow: 0 0 0 3px rgba(17,17,17,.08);
}

.channel-card, .member-card, .log-card {
  border: 1px solid var(--cursor-border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--cursor-bg);
}

.channel-card__top, .member-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.muted { color: var(--cursor-text-secondary); font-size: 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.error-text { color: var(--fail); font-size: 13px; margin: 0 0 12px; }

/* Auth */
.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(99, 102, 241, 0.1), transparent 55%),
    var(--cursor-bg);
}
@media (min-width: 900px) {
  .auth-layout { grid-template-columns: minmax(0, 1.05fr) minmax(380px, 480px); }
}
.auth-brand {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 5vw, 56px);
  background:
    radial-gradient(ellipse 90% 70% at 10% 0%, rgba(99, 102, 241, 0.14), transparent 55%),
    linear-gradient(165deg, #f8f8fc 0%, var(--cursor-bg) 48%, #f5f5f5 100%);
  border-right: 1px solid var(--cursor-border);
}
@media (min-width: 900px) { .auth-brand { display: flex; } }
.auth-brand h2 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.2;
}
.auth-brand p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--cursor-text-secondary);
  max-width: 28rem;
}
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--cursor-surface);
  border: 1px solid var(--cursor-border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.auth-card h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.auth-card .lead {
  margin: 0 0 22px;
  font-size: 14px;
  color: var(--cursor-text-secondary);
}
.auth-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.auth-actions .btn-primary { width: 100%; min-height: 44px; border-radius: 12px; }
.auth-switch {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--cursor-text-secondary);
}
.auth-switch button {
  background: none;
  border: none;
  color: var(--cursor-text);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* Kanban / CRM board (Studio-like) */
.page-head--board h1 { margin-bottom: 6px; }
.page-head--board p { margin: 0; }

.board-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 14px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--cursor-border);
  border-radius: 12px;
  background: var(--cursor-surface);
}
.board-filters__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.board-filters__group--grow { flex: 1; min-width: 220px; }
.board-filters__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cursor-muted);
  margin-right: 4px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--cursor-border);
  background: var(--cursor-bg);
  color: var(--cursor-text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.filter-chip:hover { border-color: #d4d4d4; color: var(--cursor-text); }
.filter-chip--on {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: #4338ca;
}
.filter-chip__plat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.7;
}

.crm-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
  margin-top: 8px;
}
@media (min-width: 1024px) {
  .crm-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.crm-column {
  background: var(--cursor-surface);
  border: 1px solid var(--cursor-border);
  border-radius: 12px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.crm-column-header {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--cursor-border);
  background: rgba(0, 0, 0, 0.02);
}

.crm-column-header__title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.crm-column-header__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.crm-stat-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.04);
  font-size: 12px;
  font-weight: 500;
}

.crm-column-body {
  padding: 10px;
  flex: 1;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crm-card {
  border: 1px solid var(--cursor-border);
  border-radius: 10px;
  padding: 10px;
  background: var(--cursor-bg);
  cursor: pointer;
  position: relative;
  text-align: left;
}

.crm-card:hover {
  border-color: #d4d4d4;
  box-shadow: 0 4px 16px rgba(17, 17, 17, 0.04);
}

.crm-card-drag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--cursor-muted);
  cursor: grab;
  user-select: none;
}

.crm-card-preview {
  font-size: 13px;
  line-height: 1.45;
  max-height: 96px;
  overflow: hidden;
  padding-right: 18px;
}

.crm-card-img {
  width: 100%;
  max-height: 110px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 8px;
  border: 1px solid var(--cursor-border);
}

.crm-card-meta {
  margin-top: 8px;
  font-size: 11px;
  color: var(--cursor-muted);
  line-height: 1.35;
}

.crm-card-actions-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.notes-toolbar-btn {
  border: 1px solid var(--cursor-border);
  background: var(--cursor-surface);
  color: var(--cursor-text-secondary);
  border-radius: 8px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.notes-toolbar-btn:hover {
  color: var(--cursor-text);
  background: var(--cursor-hover);
}
.notes-toolbar-btn--danger {
  color: var(--fail);
  border-color: rgba(225, 29, 72, 0.28);
  margin-left: auto;
}
.notes-toolbar-btn--danger:hover {
  color: #be123c;
  background: rgba(225, 29, 72, 0.06);
}

.crm-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--cursor-muted);
  font-size: 13px;
  border: 1px dashed var(--cursor-border);
  border-radius: 10px;
}

.crm-card--create {
  width: 100%;
  min-height: 114px;
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed #93c5fd;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.06);
  color: var(--cursor-text);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.crm-card--create:hover {
  border-color: #60a5fa;
  background: rgba(37, 99, 235, 0.09);
}
.crm-create-card__content { display: grid; gap: 6px; min-width: 0; }
.crm-create-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.crm-create-card__badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--cursor-hover);
  color: var(--cursor-text-secondary);
}
.crm-create-card__title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.crm-create-card__excerpt {
  font-size: 12px;
  line-height: 1.4;
  color: var(--cursor-text-secondary);
}
.crm-create-card__actions { display: flex; }
.crm-create-card__btn {
  flex: 1;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--cursor-text);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}

.markdown-preview { font-size: 13px; line-height: 1.45; }
.markdown-preview strong { font-weight: 700; }
.markdown-preview em { font-style: italic; }
.markdown-preview a { color: #4f46e5; text-decoration: underline; }
.status-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--cursor-border);
}
.pill.ok {
  color: var(--ok);
  border-color: rgba(5, 150, 105, 0.35);
  background: rgba(5, 150, 105, 0.06);
}
.pill.fail {
  color: var(--fail);
  border-color: rgba(225, 29, 72, 0.3);
  background: rgba(225, 29, 72, 0.05);
}
.pill__err {
  font-weight: 450;
  opacity: 0.92;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(17, 17, 17, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow: auto;
  background: var(--cursor-surface);
  border: 1px solid var(--cursor-border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
  position: relative;
}
.modal--composer {
  max-width: min(1120px, calc(100vw - 24px));
  width: 100%;
}
.modal--studio {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(94vh, 960px);
}
.composer-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.composer-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}
@media (min-width: 960px) {
  .composer-split {
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.9fr);
  }
}
.composer-main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 4px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.composer-preview {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--cursor-border);
  background:
    linear-gradient(180deg, #f7f8fa 0%, #eef1f5 100%);
}
@media (min-width: 960px) {
  .composer-preview {
    border-top: none;
    border-left: 1px solid var(--cursor-border);
  }
}
.composer-preview__title {
  font-size: 13px;
  font-weight: 650;
  margin: 0 0 4px;
}
.composer-preview__hint {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.4;
}
.composer-preview__hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(17, 17, 17, 0.06);
}
.composer-preview__stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg-preview__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.msg-preview__badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.msg-preview__badge--telegram {
  background: #229ED9;
  color: #fff;
}
.msg-preview__badge--max {
  background: #1a66ff;
  color: #fff;
}
.msg-preview__channel {
  font-size: 12px;
  font-weight: 550;
  color: var(--cursor-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-preview__phone {
  border-radius: 16px;
  padding: 12px;
  background: #fff;
  border: 1px solid rgba(17, 17, 17, 0.06);
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.06);
}
.msg-preview--telegram .msg-preview__phone {
  background: #c8d9e8
    url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30h60M30 0v60' stroke='%23b7c9db' stroke-width='0.5'/%3E%3C/svg%3E");
}
.msg-preview--max .msg-preview__phone {
  background: #e8edf7;
}
.msg-preview__bubble {
  background: #fff;
  border-radius: 12px 12px 12px 4px;
  padding: 8px 10px 10px;
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.08);
  max-width: 100%;
}
.msg-preview--max .msg-preview__bubble {
  border-radius: 14px;
  border: 1px solid rgba(26, 102, 255, 0.12);
}
.msg-preview__media {
  margin: -2px -4px 8px;
  border-radius: 10px;
  overflow: hidden;
}
.msg-preview__media img {
  display: block;
  width: 100%;
  max-height: 140px;
  object-fit: cover;
}
.msg-preview__text {
  font-size: 14px;
  line-height: 1.45;
  color: #111;
  word-break: break-word;
}
.msg-preview__text strong { font-weight: 700; }
.msg-preview__text em { font-style: italic; }
.msg-preview__text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: rgba(17, 17, 17, 0.06);
  padding: 1px 4px;
  border-radius: 4px;
}
.msg-preview__text a { color: #2481cc; }
.msg-preview--max .msg-preview__text a { color: #1a66ff; }
.msg-preview__placeholder {
  font-size: 13px;
  color: var(--cursor-muted);
  font-style: italic;
}
.md-li { display: block; }

.modal--studio > .composer-topbar {
  padding-left: 20px;
  padding-right: 20px;
  flex-shrink: 0;
}
.modal--studio > .composer-footer {
  flex-shrink: 0;
  margin-top: 0;
  padding: 12px 20px 16px;
  background: #fff;
  border-top: 1px solid var(--cursor-border);
}

.composer-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--cursor-border);
}
.composer-topbar__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 600;
}
.btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--cursor-muted);
  cursor: pointer;
  font-size: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--cursor-hover); color: var(--cursor-text); }
.btn-icon:disabled { opacity: 0.4; cursor: default; }

.tg-card--studio {
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}
.tg-card--studio .tg-card__editor {
  min-height: 140px;
  font-size: 15px;
  line-height: 1.55;
}
.emoji-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  padding-bottom: 4px;
}
.emoji-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background 0.15s ease;
}
.emoji-btn:hover:not(:disabled) { background: var(--cursor-hover); }
.emoji-btn:disabled { opacity: 0.45; cursor: default; }

.composer-meta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}
.field--schedule { margin-bottom: 0; }
.field--dest { margin-bottom: 0; }

.composer-grid {
  display: grid;
  gap: 14px;
  margin: 8px 0 0;
}
@media (min-width: 720px) {
  .composer-grid { grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
}

/* Channel destination picker — compact + collapsible */
.dest-picker {
  border: 1px solid var(--cursor-border);
  border-radius: 12px;
  background: var(--cursor-bg);
  overflow: hidden;
}
.dest-picker--disabled { opacity: 0.65; pointer-events: none; }
.dest-picker--empty {
  padding: 14px 16px;
  border-style: dashed;
}
.dest-picker__summary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  background: #fff;
  cursor: pointer;
  text-align: left;
  min-height: 48px;
}
.dest-picker__summary:hover { background: var(--cursor-hover); }
.dest-picker--open .dest-picker__summary {
  border-bottom: 1px solid var(--cursor-border);
}
.dest-picker__summary-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dest-picker__summary-count {
  font-size: 13px;
  font-weight: 600;
}
.dest-picker__summary-names {
  font-size: 12px;
  color: var(--cursor-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dest-picker__summary-cta {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.dest-picker__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.dest-chip {
  display: inline-flex;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #4338ca;
  font-size: 11px;
  font-weight: 550;
}
.dest-chip--max {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}
.dest-chip--more {
  background: var(--cursor-hover);
  color: var(--cursor-text-secondary);
}
.dest-picker__panel { padding: 8px 8px 10px; }
.dest-picker__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.dest-picker__bulk {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}
.dest-picker__link {
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 550;
  color: var(--accent);
  cursor: pointer;
}
.dest-picker__link:hover:not(:disabled) { text-decoration: underline; }
.dest-picker__link:disabled { opacity: 0.35; cursor: default; text-decoration: none; }
.dest-picker__sep { color: var(--cursor-muted); font-size: 12px; }

.dest-picker__search {
  position: relative;
  margin: 10px 12px 8px;
}
.dest-picker__search--inline {
  margin: 0;
  flex: 1;
  min-width: 140px;
}
.dest-picker__search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cursor-muted);
  pointer-events: none;
}
.dest-picker__search input {
  width: 100%;
  min-height: 34px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--cursor-border-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}
.dest-picker__search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dest-picker__clear-q {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--cursor-muted);
  cursor: pointer;
}
.dest-picker__clear-q:hover { background: var(--cursor-hover); color: var(--cursor-text); }

.dest-picker__filters {
  display: flex;
  gap: 6px;
  padding: 0 2px 6px;
  flex-wrap: wrap;
}
.dest-filter {
  border: 1px solid var(--cursor-border);
  background: #fff;
  border-radius: 999px;
  min-height: 26px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 550;
  color: var(--cursor-text-secondary);
  cursor: pointer;
}
.dest-filter--on {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: #4338ca;
}
.dest-filter:disabled { opacity: 0.5; cursor: default; }

.dest-picker__list {
  max-height: min(220px, 32vh);
  overflow: auto;
  padding: 0;
  overscroll-behavior: contain;
  border: 1px solid var(--cursor-border);
  border-radius: 10px;
  background: #fff;
}
.dest-picker__empty {
  padding: 20px 12px;
  text-align: center;
  color: var(--cursor-muted);
  font-size: 13px;
}
.dest-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.12s ease;
  border-bottom: 1px solid var(--cursor-border);
  margin: 0;
}
.dest-row:last-child { border-bottom: none; }
.dest-row:hover { background: rgba(0,0,0,0.03); }
.dest-row--on { background: var(--accent-soft); }
.dest-row input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.dest-row__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #8b5cf6;
}
.dest-row__dot--max { background: #2563eb; }
.dest-row__avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.dest-row__avatar--max {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
}
.dest-row__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dest-row__body {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.dest-row__title {
  font-size: 13px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dest-row__meta {
  font-size: 11px;
  color: var(--cursor-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}
.dest-row__plat {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cursor-muted);
  flex-shrink: 0;
}
.dest-row__check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--cursor-border-strong);
  background: #fff;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: transparent;
  transition: all 0.12s ease;
}
.dest-row__check--on {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.channel-pick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--cursor-border);
  border-radius: 10px;
  background: var(--cursor-bg);
}
.channel-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.channel-chip:hover { background: rgba(0,0,0,0.03); }
.channel-chip--on { background: var(--accent-soft); }
.channel-chip input { margin: 0; }
.channel-chip__platform {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cursor-muted);
  min-width: 54px;
}
.channel-chip__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-save {
  border: 1px solid var(--cursor-border-strong) !important;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
}

.composer-layout {
  display: grid;
  gap: 16px;
}
@media (min-width: 840px) {
  .composer-layout { grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr); align-items: start; }
}

.tg-card {
  border: 1px solid var(--cursor-border);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.04);
}
.tg-card__channel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.tg-card__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.tg-card__channel-name { font-size: 14px; font-weight: 600; }
.tg-card__channel-sub { font-size: 11px; color: var(--cursor-muted); }
.tg-card__media {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--cursor-border);
  margin-bottom: 10px;
  background: #f3f4f6;
  min-height: 120px;
}
.tg-card__media img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
}
.tg-card__media--empty {
  min-height: 120px;
  border-style: dashed;
  background:
    linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
}
.tg-card__media-placeholder {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--cursor-text-secondary);
  font-size: 13px;
  padding: 16px;
  text-align: center;
}
.tg-card__media-icon {
  font-size: 22px;
  line-height: 1;
  opacity: 0.7;
  margin-bottom: 2px;
}
.tg-card__media--busy img,
.tg-card__media--busy .tg-card__media-placeholder {
  filter: blur(1.5px) brightness(0.92);
}
.media-busy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(4px);
  color: var(--cursor-text);
  font-size: 13px;
  font-weight: 550;
  z-index: 2;
  text-align: center;
  padding: 16px;
}
.tg-card__media-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  border: none;
  border-radius: 8px;
  background: rgba(17, 17, 17, 0.72);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.tg-card__media-clear:hover { background: rgba(17, 17, 17, 0.88); }
.tg-card__editor {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 8px;
  resize: vertical;
  min-height: 140px;
  background: transparent;
  line-height: 1.45;
}
.tg-card__editor:focus {
  outline: none;
  border-color: var(--accent-border);
  background: var(--cursor-bg);
}
.tg-card__editor:disabled { opacity: 0.55; }
.tg-card__editor-wrap {
  position: relative;
}
.tg-card__editor-wrap--busy .tg-card__editor {
  filter: blur(0.6px);
  opacity: 0.55;
}
.editor-busy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(3px);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 550;
  color: var(--cursor-text);
  z-index: 2;
}
.format-hint {
  margin: 6px 0 0;
  font-size: 12px;
}
.tg-card__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 6px;
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--cursor-border-strong);
  background: #fff;
  color: var(--cursor-text);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.tool-btn:hover:not(:disabled) { background: var(--cursor-hover); }
.tool-btn:disabled { opacity: 0.5; cursor: default; }
.tool-btn--on {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: #4338ca;
}
.tool-btn--busy {
  border-color: var(--accent-border);
  color: #4338ca;
}
.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 9px;
}

.composer-side .field { margin-bottom: 12px; }
.transcribe-box {
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--cursor-border-strong);
  background: var(--cursor-bg);
  margin-top: 6px;
}

.composer-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--cursor-border);
}
.composer-footer__start,
.composer-footer__end {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.btn-aida {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: #4338ca;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.btn-aida:hover { background: rgba(99, 102, 241, 0.16); }
.btn-aida:disabled { opacity: 0.55; cursor: not-allowed; }

/* Custom select (каналы / платформа) */
.c-select { position: relative; }
.c-select__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--cursor-border-strong);
  border-radius: 12px;
  background: var(--cursor-surface);
  color: var(--cursor-text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.c-select__trigger:hover { background: var(--cursor-hover); }
.c-select--open .c-select__trigger {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--cursor-surface);
}
.c-select__meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.c-select__name {
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.c-select__hint {
  font-size: 11px;
  color: var(--cursor-muted);
  line-height: 1.2;
}
.c-select__chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--cursor-muted);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}
.c-select__chevron svg { width: 16px; height: 16px; }
.c-select--open .c-select__chevron { transform: rotate(180deg); color: var(--cursor-text-secondary); }
.c-select__menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  padding: 6px;
  border: 1px solid var(--cursor-border);
  border-radius: 12px;
  background: var(--cursor-surface);
  box-shadow: 0 8px 28px rgba(17, 17, 17, 0.1), 0 1px 2px rgba(17, 17, 17, 0.04);
}
.c-select__option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--cursor-text);
  cursor: pointer;
  text-align: left;
}
.c-select__option:hover { background: var(--cursor-hover); }
.c-select__option--active { background: var(--accent-soft); }
.c-select__check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--accent);
  display: grid;
  place-items: center;
}
.c-select__check svg { width: 14px; height: 14px; }

/* Aida chat modal (Studio-like) */
.aida-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 12px;
}
.aida-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.45);
}
.aida-modal__chat {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 24px));
  height: min(680px, calc(100dvh - 24px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--cursor-surface);
  border: 1px solid var(--cursor-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(17, 17, 17, 0.18);
}
.aida-modal__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--cursor-border);
  background: var(--cursor-surface);
}
.aida-modal__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e5e7eb;
}
.aida-modal__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.aida-modal__meta { min-width: 0; flex: 1; }
.aida-modal__name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.aida-modal__status {
  margin: 2px 0 0;
  font-size: 12px;
  color: #16a34a;
  display: flex;
  align-items: center;
  gap: 6px;
}
.aida-modal__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
}
.aida-modal__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--cursor-text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.aida-modal__close:hover { background: var(--cursor-hover); color: var(--cursor-text); }
.aida-modal__messages {
  min-height: 0;
  padding: 18px 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--cursor-bg);
}
.aida-bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.aida-bubble--assistant {
  align-self: flex-start;
  background: #ececf0;
  color: var(--cursor-text);
  border-bottom-left-radius: 6px;
}
.aida-bubble--user {
  align-self: flex-end;
  background: #111;
  color: #fff;
  border-bottom-right-radius: 6px;
}
.aida-bubble--typing {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 12px 16px;
  width: fit-content;
}
.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.typing-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  display: block;
  animation: typing-bounce 1.05s ease-in-out infinite;
}
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.aida-dock {
  border-top: 1px solid var(--cursor-border);
  background: linear-gradient(180deg, var(--cursor-bg) 0%, var(--cursor-surface) 100%);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
}
.aida-dock__chat {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--cursor-border);
}
.aida-dock__label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.aida-dock__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cursor-text-secondary);
}
.aida-dock__label-hint {
  font-size: 12px;
  color: var(--cursor-text-secondary);
  text-align: right;
}
.aida-dock__input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.aida-dock__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 52px;
  max-height: 120px;
  padding: 12px 14px;
  border: 1px solid var(--cursor-border);
  border-radius: 14px;
  background: var(--cursor-surface);
  font: inherit;
  font-size: 15px;
  line-height: 1.55;
  color: var(--cursor-text);
  resize: vertical;
}
.aida-dock__input:focus {
  outline: none;
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.22);
}
.aida-dock__input:disabled { opacity: 0.55; }
.aida-dock__send {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.aida-dock__send:hover:not(:disabled) { transform: translateY(-1px); }
.aida-dock__send:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.aida-dock__cta { padding: 12px 16px 16px; }
.aida-dock__make-post {
  width: 100%;
  min-height: 56px;
  padding: 10px 16px;
  border: 1px solid rgba(167, 139, 250, 0.45);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  color: #5b21b6;
  background: linear-gradient(135deg, rgba(237, 233, 254, 0.95) 0%, rgba(245, 243, 255, 0.98) 100%);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.08);
}
.aida-dock__make-post:hover:not(:disabled) {
  border-color: #a78bfa;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.18);
}
.aida-dock__make-post:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  border-color: var(--cursor-border);
  color: var(--cursor-text-secondary);
  background: var(--cursor-bg);
  box-shadow: none;
}
.aida-dock__make-post-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}
.aida-dock__make-post:disabled .aida-dock__make-post-icon {
  background: rgba(120, 120, 128, 0.1);
  color: var(--cursor-text-secondary);
}
.aida-dock__make-post-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.aida-dock__make-post-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.aida-dock__make-post-sub {
  font-size: 12px;
  color: var(--cursor-text-secondary);
}
.aida-dock__make-post:not(:disabled) .aida-dock__make-post-sub {
  color: #6d28d9;
  opacity: 0.85;
}

@media (max-width: 560px) {
  .aida-modal__chat {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
  }
  .aida-dock__label-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .aida-dock__label-hint { text-align: left; }
}

.preview-box {
  border: 1px solid var(--cursor-border);
  border-radius: 10px;
  padding: 12px;
  background: var(--cursor-bg);
  margin-bottom: 12px;
  min-height: 48px;
}
.check-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-card .log-msg { font-size: 13px; margin: 0 0 4px; font-weight: 500; }
.log-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.log-action-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  max-width: 42%;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--cursor-bg);
  border: 1px solid var(--cursor-border);
  color: var(--cursor-text-secondary);
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--cursor-surface);
  border: 1px solid var(--cursor-border);
  border-radius: 14px;
}
.log-filters__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.log-filters__field label {
  font-size: 11px;
  font-weight: 550;
  color: var(--cursor-muted);
}
.log-filters__field select,
.log-filters__field input[type="date"] {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--cursor-border-strong);
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
  color: var(--cursor-text);
  font-size: 13px;
}
.log-filters__field select:focus,
.log-filters__field input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.log-filters__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.log-filters__meta {
  margin: 0 0 12px;
  font-size: 12px;
}
.loading {
  color: var(--cursor-text-secondary);
  padding: 48px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
}
.loading--page {
  min-height: 100vh;
}
.ui-spinner {
  display: inline-block;
  border: 2px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ui-spin 0.7s linear infinite;
  flex-shrink: 0;
  vertical-align: middle;
}
@keyframes ui-spin {
  to { transform: rotate(360deg); }
}
.invite-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 18px;
  letter-spacing: 0.12em;
  padding: 12px;
  border-radius: 10px;
  background: var(--cursor-bg);
  border: 1px dashed var(--cursor-border-strong);
  text-align: center;
}

.bot-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.bot-card__title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}
.bot-channels {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bot-channels--modal {
  max-height: 280px;
  overflow: auto;
  margin-bottom: 12px;
}
.bot-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--cursor-border);
  border-radius: 12px;
  background: var(--cursor-bg);
  cursor: pointer;
}
.bot-channel--on {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}
.bot-channel input { margin: 0; flex-shrink: 0; }
.bot-channel__avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: #e8e8ed;
  color: #333;
}
.bot-channel__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bot-channel__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bot-channel__title {
  font-size: 13px;
  font-weight: 600;
}
.modal--bot { max-width: 520px; }
.modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal__head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--cursor-border);
  }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-link { width: auto; }
}
