.card, .pane {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.pane { padding: 8px; }
.pane-pad { padding: 20px; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grow { flex: 1; min-width: 180px; }

.btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  font-weight: 600;
}
.btn.primary { background: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.secondary { background: var(--bg-surface); border-color: var(--border-strong); color: var(--text-primary); }
.btn.secondary:hover { background: var(--bg-subtle); }
.btn.ghost { color: var(--text-secondary); }
.btn.ghost:hover { background: var(--bg-subtle); }
.btn.danger { background: var(--danger-tint); color: var(--danger); }
.btn.btn-remove-row {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-weight: 600;
}
.btn.btn-remove-row:hover { background: #fecaca; color: #991b1b; }
.btn.btn-profile-connected {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1.2;
  min-height: 36px;
  height: auto;
  flex-shrink: 0;
  background: var(--success-tint);
  color: var(--success);
  border: 1px solid var(--success);
  cursor: default;
  pointer-events: none;
  font-weight: 600;
}
.avito-apps-zone { margin-top: 8px; }
.avito-app-card {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: white;
  padding: 0;
  overflow: hidden;
}
.avito-app-card--new { padding: 10px 12px; }
.avito-app-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
}
.avito-app-summary::-webkit-details-marker { display: none; }
.avito-app-summary-title { min-width: 0; }
.avito-app-summary-meta { margin-left: auto; }
.avito-app-body {
  padding: 0 12px 12px;
  border-top: 1px solid var(--border-subtle);
}
.avito-profile-inline {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}
.avito-app-actions { flex-wrap: wrap; align-items: center; }

.avito-page-sub { margin: 4px 0 0; color: var(--text-muted); }
.avito-head-actions { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.avito-account-list { display: flex; flex-direction: column; gap: 14px; }
.avito-account-card { overflow: hidden; }
.avito-account-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  flex-wrap: wrap;
}
.avito-account-avatar {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
}
.avito-account-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 220px;
}
.avito-account-name {
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avito-account-app,
.avito-account-meta { overflow-wrap: anywhere; }
.avito-account-status { margin-left: auto; flex: none; }
.avito-account-section { border-top: 1px solid var(--border-subtle); }
.avito-account-section-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-subtle);
  border-radius: 8px;
}
.avito-account-section-summary::-webkit-details-marker { display: none; }
.avito-account-section-summary::after {
  content: "";
  margin-left: auto;
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.avito-account-section[open] > .avito-account-section-summary::after { transform: rotate(-135deg); }
.avito-account-section-summary:hover { background: var(--bg-muted); }
.avito-account-section-sub {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 2px 10px;
}
.avito-account-section-body { padding: 0 16px 14px; }
.avito-export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.avito-export-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-subtle);
}
.avito-export-tile p { margin: 0; flex: 1; }
.avito-export-tile .btn { align-self: flex-start; }
.avito-export-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.avito-period-form { display: flex; flex-direction: column; gap: 8px; }
.avito-period-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.avito-period-label { font-size: 13px; font-weight: 600; }
.avito-period-all { min-height: 36px; }
.avito-period-hint { margin: 0; }
.avito-period-status { margin: 0; }
.avito-period-status.error { color: var(--danger); }
.avito-catalog-settings-form { display: flex; flex-direction: column; gap: 8px; }
.avito-catalog-settings-row { display: flex; gap: 16px; flex-wrap: wrap; }
.avito-catalog-filter-row { display: flex; flex-direction: column; gap: 4px; }
.avito-filter-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}
.avito-filter-input {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font: inherit;
  font-size: 13px;
}
.avito-filter-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-tint);
}
.avito-filter-input:disabled {
  opacity: 0.55;
  background: var(--bg-subtle);
}
.avito-catalog-settings-actions { display: flex; justify-content: flex-end; }
.avito-account-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.avito-account-token { margin-right: auto; }
.avito-danger-link { color: var(--danger); }
.avito-danger-link:hover { background: var(--danger-tint); }
.avito-empty .section-title { margin-bottom: 6px; }

.avito-catalog-panel { padding: 14px 16px; }
.avito-catalog-panel .section-title { margin: 0; }
.avito-catalog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.avito-catalog-sub { margin: 4px 0 0; }
.avito-catalog-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.avito-catalog-export {
  position: relative;
  display: inline-flex;
}
.avito-catalog-export > summary {
  list-style: none;
  user-select: none;
}
.avito-catalog-export-toggle,
.avito-catalog-export-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
}
.avito-catalog-export-toggle::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform .15s ease;
}
.avito-catalog-export[open] > summary::after { transform: rotate(180deg); }
.avito-catalog-export > summary::-webkit-details-marker { display: none; }
.avito-catalog-export > summary::marker { content: ""; }
.avito-catalog-export[open] > summary {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}
.avito-catalog-export-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 132px;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}
.avito-catalog-export-option {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.avito-catalog-export-option:hover:not(:disabled) { background: var(--bg-subtle); }
.avito-catalog-export-option:disabled { color: var(--text-disabled); cursor: default; }
.btn.avito-catalog-import {
  margin-left: auto;
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}
.btn.avito-catalog-import:hover { background: #e0e7ff; }
.avito-catalog-meta { margin: 8px 0 0; }
.avito-catalog-status { margin: 8px 0 0; }
.avito-catalog-load-error {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.avito-catalog-load-error p { margin: 0; }
.avito-catalog-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-subtle);
}
.avito-catalog-spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: avito-catalog-spin 0.8s linear infinite;
}
@keyframes avito-catalog-spin {
  to { transform: rotate(360deg); }
}
.avito-catalog-table-wrap {
  margin-top: 10px;
  overflow: auto;
  max-height: calc(100vh - 330px);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}
.avito-catalog-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.avito-catalog-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.avito-catalog-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.avito-catalog-table tr:last-child td { border-bottom: 0; }
.avito-catalog-table tbody tr:hover { background: #f8fafc; }
.avito-catalog-name { min-width: 260px; max-width: 460px; }
.avito-catalog-title {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.avito-catalog-title:hover { color: var(--primary); text-decoration: underline; }
.avito-catalog-accounts {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.avito-catalog-input {
  width: 100%;
  min-width: 110px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
  font-size: 12px;
}
.avito-catalog-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--primary-tint);
}
.avito-catalog-value { display: block; min-height: 30px; padding: 6px 0; }
.avito-catalog-price {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 120px;
}
.avito-catalog-price strong { font-size: 13px; white-space: nowrap; }
.avito-catalog-warning {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}
.avito-catalog-price-note { flex: 1 1 100%; font-size: 11px; color: #b91c1c; }
.avito-catalog-actions { width: 1%; white-space: nowrap; text-align: right; }
.avito-catalog-pager-wrap { margin-top: 10px; }
.avito-catalog-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.avito-catalog-empty { margin: 0; padding: 20px 12px; text-align: center; }
.avito-catalog-head-actions { margin-left: auto; }
.avito-catalog-results { overflow-x: auto; }
.avito-catalog-views {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg-subtle);
}
.avito-catalog-view {
  padding: 6px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.avito-catalog-view:hover { color: var(--text-primary); }
.avito-catalog-view.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.avito-catalog-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.avito-catalog-search {
  flex: 1 1 280px;
  min-width: 200px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font: inherit;
  font-size: 13px;
}
.avito-catalog-search:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-tint);
}
.avito-catalog-sort {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg-subtle);
}
.avito-catalog-sort-btn {
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.avito-catalog-sort-btn:hover { color: var(--text-primary); }
.avito-catalog-sort-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.avito-catalog-report {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-subtle);
}
.avito-catalog-report-title {
  margin: 0 0 4px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}
.avito-catalog-report-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 12px;
}
.avito-catalog-report-list li.is-error { color: var(--danger); }
.avito-catalog-errors {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--danger);
  font-size: 12px;
}
@media (max-width: 900px) {
  .avito-catalog-table-wrap { max-height: none; }
}

.viewport-scroll-pane { max-height: calc(100vh - 140px); overflow: auto; }
.btn:disabled { opacity: 0.5; cursor: default; }

.ig-select-shell {
  display: inline-flex;
  align-items: stretch;
  min-height: 36px;
  min-width: 10rem;
  max-width: 100%;
  vertical-align: middle;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  overflow: hidden;
  box-sizing: border-box;
}
.ig-select-shell:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-tint);
}
.ig-select-shell select,
.ig-select-shell select.ig-filter {
  border: none !important;
  box-shadow: none !important;
  outline: none;
  border-radius: 0 !important;
  background-color: var(--bg-surface);
}
.ig-select-shell select:focus {
  box-shadow: none !important;
}
.field .ig-select-shell { width: 100%; min-width: 0; }
.field .ig-select-shell select { width: 100% !important; max-width: 100%; }
.grid-2 .field .ig-select-shell { display: flex; width: 100%; min-width: 0; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field span { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.field input, .field select, .field textarea, .search {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}
select,
.field select,
select.ig-filter,
select.ig-rule-select,
.ig-chat-toolbar select,
.ig-filters select,
.ig-rule-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-color: var(--bg-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}
select:focus,
.field select:focus,
select.ig-filter:focus,
.ig-chat-toolbar select:focus,
.ig-filters select:focus {
  border-color: var(--border-focus);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-tint);
}
textarea, .field textarea { width: 100%; min-height: 96px; resize: vertical; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-surface); }
.field input:focus, .field select:focus, .field textarea:focus, .search:focus {
  border-color: var(--border-focus);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-tint);
}

.list-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 36px;
}
.list-item:hover { background: var(--bg-subtle); }
.list-item.active { background: var(--primary-tint); }
.list-item strong { font-weight: 600; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.clip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}
.badge.good { background: var(--success-tint); color: var(--success); }
.badge.wait { background: var(--warning-amber-tint); color: var(--warning-amber); }
.badge.info { background: var(--primary-tint); color: var(--primary); }
.badge.bad { background: var(--danger-tint); color: var(--danger); }

.stats, .stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 18px 20px; }
.stat b, .stat-value { display: block; font-size: 28px; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--text-muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.page-head.row { align-items: flex-start; gap: 12px; }
.ig-connect-btn.active { box-shadow: inset 0 0 0 2px var(--primary); }
.ig-connect-btn--alert {
  box-shadow: inset 0 0 0 2px var(--danger);
  color: var(--danger);
}
.ig-connect-btn--alert.active {
  box-shadow: inset 0 0 0 2px var(--danger);
  color: var(--danger);
}
.ig-token-expired-notice {
  margin: 0 0 4px !important;
  font-size: 12px;
  line-height: 1.4;
}

.ig-home {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ig-profile-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ig-profile-head { align-items: center; gap: 12px; margin-bottom: 0; }
.ig-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.ig-profile-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}
.ig-profile-name { margin: 0 !important; font-size: 16px; }
.ig-profile-meta { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.ig-metrics-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 0;
}
.ig-profile-updated,
.ig-profile-note {
  margin: 0 !important;
  font-size: 11px;
  line-height: 1.3;
}
.ig-profile-note { padding: 6px 8px; }
.ig-metrics-period { display: flex; flex-direction: column; gap: 4px; }
.ig-period-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ig-metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ig-metric {
  background: var(--bg-subtle);
  border-radius: 10px;
  padding: 8px 12px;
  min-height: 0;
}
.ig-metric-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.ig-metric-value {
  display: block;
  font-size: 18px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.ig-kw-stats { gap: 14px; }
.ig-kw-period { display: flex; flex-direction: column; gap: 8px; }
.ig-kw-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ig-kw-card {
  background: var(--bg-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ig-kw-card strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.ig-kw-special {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ig-kw-special-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.ig-tabs { margin: 0 0 8px; flex-wrap: wrap; }
.ig-chat-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 2px 0;
}
.ig-chat-filter-row-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.ig-styled-select {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  z-index: 1;
}
.ig-styled-select.open {
  z-index: 120;
}
.ig-filters .ig-styled-select-menu,
.ig-rule-form .ig-styled-select-menu,
.ig-journal-block .ig-styled-select-menu {
  z-index: 130;
}
.ig-styled-select-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  padding: 6px 34px 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.ig-styled-select-btn:disabled { opacity: 0.55; cursor: default; }
.ig-styled-select.open .ig-styled-select-btn {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-tint);
}
.ig-styled-select-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-width: min(360px, 92vw);
  max-height: 280px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.ig-styled-select-menu--portal {
  position: fixed;
  top: auto;
  left: auto;
  min-width: 0;
  z-index: 2000;
}
.ig-styled-select-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}
.ig-styled-select-menu button:hover,
.ig-styled-select-menu button.active {
  background: var(--primary-tint);
  color: var(--primary);
}
.ig-styled-select-menu button:disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
  background: transparent;
}
.ig-styled-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}
.ig-tabs button { min-width: 120px; }

@media (max-width: 720px) {
  .ig-metric-row,
  .ig-kw-cards { grid-template-columns: 1fr; }
}

.section-title { margin: 0 0 12px; font-size: 15px; }
.ig-block-title { margin-bottom: 8px !important; }
.ig-section-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.ig-section-head .section-title { margin: 0; }
.ig-section-head p { margin: 0; }
.ig-connect-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.ig-token-lifetime-hint { font-weight: 500; }
.ig-token-countdown { gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.ig-token-countdown-label { color: var(--text-muted); font-weight: 600; }
.ig-token-countdown .badge { font-size: 11px; line-height: 1.35; white-space: normal; text-align: left; }
.ig-profile-sub { margin: 2px 0 0 !important; }
.ig-profile-link { color: inherit; text-decoration: none; font-weight: 600; }
.ig-profile-link:hover { color: var(--primary); text-decoration: underline; }

.ig-rule-compact {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-subtle);
  transition: background 0.15s ease;
}
.ig-rule-compact-main { cursor: pointer; }
.ig-rule-compact-main:hover { opacity: 0.92; }
.ig-rule-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}
.ig-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: white;
  color: var(--text-secondary);
  cursor: pointer;
}
.ig-icon-btn:hover { background: var(--bg-subtle); color: var(--primary); }
.ig-icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.ig-icon-btn svg { width: 15px; height: 15px; }
.ig-rule-preview { margin: 4px 0 0 !important; }
.ig-rule-form { margin-top: 4px; }
.ig-rule-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}
.ig-rule-form .field { margin: 0; gap: 4px; min-height: 0; }
.ig-rule-form .field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.ig-rule-form select,
.ig-rule-form input:not([type="hidden"]),
.ig-rule-form textarea {
  width: 100%;
  min-height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 7px 10px;
  font: inherit;
  background-color: var(--bg-surface);
}
.ig-rule-form select.ig-rule-select {
  width: auto;
  max-width: 100%;
  padding: 7px 34px 7px 10px;
}
.ig-rule-form textarea { resize: vertical; min-height: 56px; line-height: 1.35; }
.ig-rule-stats { font-weight: 400; white-space: normal; }
.ig-rule-form .field-full { grid-column: 1 / -1; }
.ig-pub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.ig-pub-head .field-label { margin: 0; }
.ig-pub-count {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-tint);
  color: var(--primary);
  white-space: nowrap;
}
.ig-card-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.ig-card-head .section-title,
.ig-card-head .ig-block-title { margin: 0 !important; }
.ig-card-head p { margin: 0; line-height: 1.4; }
.ig-rules-list { display: flex; flex-direction: column; gap: 8px; }

.ig-funnel-v {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 4px 0 8px;
}
.ig-funnel-v-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 8px;
  background: #e5e7eb;
  color: #1f2937;
  border: 1px solid #d1d5db;
}
.ig-funnel-v-step.is-prechat {
  background: #f3f4f6;
  color: #374151;
  border-color: #e5e7eb;
}
.ig-funnel-v-step.is-progress {
  background: #dcfce7;
  color: #14532d;
  border-color: #bbf7d0;
}
.ig-funnel-v-step.is-result {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #111827;
}
.ig-funnel-v-step-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
}
.ig-funnel-v-step-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ig-funnel-v-step.is-progress .ig-funnel-v-step-num {
  background: rgba(21, 128, 61, 0.12);
  color: #166534;
}
.ig-funnel-v-step.is-result .ig-funnel-v-step-num {
  background: #f3f4f6;
  color: #374151;
}
.ig-funnel-v-step-meta {
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ig-funnel-result-meta {
  display: flex;
  align-items: center;
  gap: 0;
}
.ig-funnel-result-sep {
  font-weight: 600;
  color: #6b7280;
}
.ig-funnel-success-num {
  color: #166534;
  font-weight: 700;
}
.ig-funnel-failed-num {
  color: #b91c1c;
  font-weight: 700;
}
.ig-funnel-v-marker {
  box-sizing: border-box;
  margin: 6px 0;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px dashed var(--primary);
  background: var(--primary-tint);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  line-height: 1.35;
}
.ig-funnel-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.ig-funnel-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: white;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}
.ig-funnel-filter.active {
  border-color: var(--primary);
  background: var(--primary-tint);
  color: var(--primary);
}
.ig-funnel-filter .ig-pending-dot {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ig-metrics-note { margin: 0; font-size: 11px; color: var(--text-muted); }

.ig-publications { display: flex; flex-direction: column; gap: 4px; }
.ig-publications .field-label { font-size: 13px; font-weight: 600; margin: 0; }
.ig-publications-hint { margin: 0 !important; }
.ig-publications-wrap { margin-top: 4px; }

.ig-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: auto;
  margin: 2px 0 6px;
  font-size: 14px;
  cursor: pointer;
}
.ig-inline-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
}
.ig-inline-check span { line-height: 1.3; }
.ig-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding: 2px;
}
.ig-media-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: white;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ig-media-card input { display: none; }
.ig-media-card.selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.ig-media-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-subtle);
}
.ig-media-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.ig-media-caption { font-size: 11px; color: var(--text-muted); line-height: 1.3; min-height: 28px; }
.ig-media-manual {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  padding: 8px 10px;
  font: inherit;
  resize: vertical;
}

.ig-funnel-row { display: flex; flex-wrap: wrap; gap: 16px; }
.ig-funnel-item { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.ig-funnel-item strong { font-size: 20px; font-variant-numeric: tabular-nums; }

.ig-filters { gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 0 !important; overflow: visible; }
.avito-profile-list { list-style: none; margin: 0; padding: 0; }
.avito-profile-list-item { margin: 0; padding: 2px 0; }
.avito-profile-list-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}
.avito-profile-export-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.avito-profile-export-row .avito-profile-name { flex: 1 1 160px; min-width: 120px; }
.avito-profile-bullet { font-weight: 700; line-height: 1; }
.avito-export-progress { margin: 8px 0 2px 14px; display: flex; flex-direction: column; gap: 5px; }
.avito-progress-track {
  position: relative;
  height: 8px;
  width: 100%;
  max-width: 520px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}
.avito-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width .35s ease;
}
.avito-export-progress.is-dialogs .avito-progress-fill {
  background: linear-gradient(90deg, #0ea5e9, #22c55e);
}
.avito-export-progress.is-indeterminate .avito-progress-fill {
  width: 35% !important;
  animation: avito-progress-slide 1.2s ease-in-out infinite;
}
@keyframes avito-progress-slide {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(160%); }
  100% { transform: translateX(-100%); }
}
.avito-progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  max-width: 520px;
}
.avito-progress-meta .small { font-variant-numeric: tabular-nums; }
.avito-progress-meta .muted { margin-left: auto; font-weight: 600; }
.ig-filter {
  min-height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 0 10px;
  background-color: var(--bg-surface);
}
select.ig-filter {
  width: auto;
  padding-left: 10px;
}
.ig-filter.grow { flex: 1; min-width: 180px; }
.ig-chat-panel form textarea.ig-filter {
  padding-top: 10px;
  line-height: 1.4;
}
.block + .block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-subtle); }
.check { display: flex; gap: 8px; align-items: center; min-height: 36px; }
.tabs { display: flex; gap: 4px; background: var(--bg-subtle); padding: 4px; border-radius: 10px; width: fit-content; }
.tabs button { border: 0; background: transparent; min-height: 36px; padding: 0 14px; border-radius: 8px; font-weight: 600; color: var(--text-secondary); }
.tabs button.active { background: white; color: var(--primary); box-shadow: var(--shadow-card); }
.notice {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--primary-tint);
  color: var(--text-secondary);
}
.error { color: var(--danger); min-height: 1.2em; margin: 0 0 8px; }
.empty { padding: 28px 12px; text-align: center; color: var(--text-muted); }
.message {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-subtle);
  margin-bottom: 6px;
}
.message p { margin: 6px 0 0; white-space: pre-wrap; }

.table-wrap { overflow: auto; padding: 0; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: middle;
}
.data-table th {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-subtle);
  white-space: nowrap;
}
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: var(--bg-subtle); }
.data-table tbody tr.active { background: var(--primary-tint); }
.data-table .detail-row { cursor: default; background: var(--bg-subtle); }
.data-table .detail-row:hover { background: var(--bg-subtle); }
.data-table .detail-row td { padding: 8px 12px; }
.table-actions { display: flex; gap: 4px; flex-wrap: wrap; white-space: nowrap; }
.small-btn { min-height: 30px; padding: 0 10px; font-size: 12px; }

.ig-chat-head-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.ig-chat-head-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ig-chat-head-row .section-title { margin: 0 !important; }
.ig-chat-head-row select.ig-filter { width: auto; min-width: 0; }
.ig-chat-head-title .btn.small-btn { flex-shrink: 0; white-space: nowrap; }
.ig-chat-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 12px;
  min-height: 520px;
}
.ig-chat-layout-wide {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
}
.ig-chats-section {
  gap: 4px !important;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin-bottom: 0;
  overflow: hidden;
}
.ig-chats-section.pane-pad { padding-top: 12px; padding-bottom: 12px; }
.ig-chats-section .ig-chat-head-row { margin-bottom: 4px; flex-shrink: 0; }
.ig-chats-section .ig-chat-filter-row {
  margin: 0 !important;
  flex-shrink: 0;
  gap: 6px 10px;
}
.ig-chats-section .ig-deal-filters { margin-bottom: 0; }
.ig-chats-section .ig-chat-layout {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  max-height: none;
  align-items: stretch;
  grid-template-rows: minmax(0, 1fr);
}
.ig-chats-section .ig-chat-layout > * {
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ig-chats-section .ig-chat-list {
  max-height: none;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}
.ig-chats-section .ig-chat-panel,
.ig-chats-section .ig-chat-panel-frame {
  min-height: 0 !important;
  flex: 1 1 0;
  overflow: hidden;
}
.ig-chats-section .ig-chat-messages {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}
.ig-funnel-row-label { margin: 4px 0 2px !important; font-size: 11px; }
.ig-deal-filters { margin-bottom: 0; }
.ig-tab-pending-dot {
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.ig-tabs button { display: inline-flex; align-items: center; justify-content: center; }
.ig-chat-panel-frame {
  border: 1px solid var(--border-subtle);
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
}
.ig-chat-item--needs-reply {
  background: #fff1f2;
  border-color: #fecdd3;
}
.ig-chat-item--needs-reply.active {
  background: #ffe4e6;
  border-color: #fb7185;
}
.ig-chat-item-preview {
  margin: 0 !important;
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ig-chat-peer-name { margin: 0; font-size: 16px; line-height: 1.2; }
.ig-chat-user-head { margin: 0; min-height: 0; }
.ig-chat-context-box,
.avito-item-compact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: white;
  margin-bottom: 4px;
  box-sizing: border-box;
}
.ig-chat-context-box.ig-chat-item-context,
.avito-item-compact.ig-chat-item-context,
.ig-chat-item-context-host .ig-chat-context-box,
.ig-chat-item-context-host .avito-item-compact {
  min-height: 52px;
  justify-content: center;
}
.ig-chat-context-label { display: block; margin-bottom: 2px; }
.ig-chat-head-title .ig-styled-select { flex-shrink: 0; width: auto; max-width: min(420px, 92vw); }
.ig-chat-item-context-host { flex-shrink: 0; margin-bottom: 4px; }
.ig-chat-toolbar .ig-styled-select { max-width: min(420px, 55vw); }
.ig-chat-head-title .ig-select-shell { flex-shrink: 0; }
.ig-chat-head-title .ig-select-shell select { white-space: nowrap; }
.ig-chat-panel .ig-chat-messages { flex: 1; min-height: 0; }
.ig-client-modal .field-compact { margin-bottom: 4px; gap: 3px; }
.ig-client-modal .stack-tight { gap: 4px; }
.ig-client-modal-title { margin: 0 0 6px !important; }
.ig-client-modal-tabs { margin: 0 0 6px; }
.ig-client-modal-actions { margin-top: 8px; }
.ig-client-modal-panes { margin: 0; }
.ig-client-modal .ig-client-group {
  padding-top: 6px;
  margin-top: 4px;
}
.ig-client-modal .ig-client-group-title { margin: 0 0 4px; }
.ig-client-group-head { align-items: center; margin-bottom: 2px; }
.ig-client-group-head .ig-client-group-title { margin: 0; }
.ig-client-match-banner {
  padding: 6px 8px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  margin-bottom: 4px;
}
.ig-client-match-banner .small { margin: 0 0 4px; }
.ig-funnel-filter .ig-funnel-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.ig-chat-panel-frame .ig-chat-toolbar { padding-top: 0; margin-top: 0; }
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 720px) {
  .grid-3 { grid-template-columns: 1fr; }
}
.ig-chat-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 560px;
  overflow: auto;
}
.ig-chat-item {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: white;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ig-chat-item:hover { background: var(--bg-subtle); }
.ig-chat-item.active { border-color: var(--primary); background: var(--primary-tint); }
.ig-chat-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  min-width: 0;
}
.ig-chat-item-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ig-chat-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ig-chat-item-avatar,
.ig-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-subtle);
}
.ig-avatar { width: 36px; height: 36px; }
.ig-user-silhouette {
  object-fit: contain;
  background: #e2e8f0;
  padding: 4px;
  box-sizing: border-box;
}
.ig-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.ig-chat-item-avatar.ig-avatar-fallback { width: 28px; height: 28px; font-size: 11px; }
.ig-avatar.ig-avatar-fallback { width: 36px; height: 36px; }
.ig-chat-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.ig-chat-badges .badge {
  white-space: nowrap;
  font-size: 10px;
  padding: 2px 7px;
  line-height: 1.2;
}
.ig-chat-item-sub {
  margin: 0 !important;
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ig-chat-panel { display: flex; flex-direction: column; gap: 8px; min-height: 480px; }
.ig-chat-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ig-chat-toolbar .field { margin: 0; min-width: 0; gap: 6px; flex: 0 0 auto; }
.ig-chat-toolbar .field.ig-chat-toolbar-field {
  flex-direction: row;
  align-items: center;
}
.ig-chat-toolbar .field > span { font-size: 11px; font-weight: 600; color: var(--text-muted); line-height: 1.2; white-space: nowrap; }
.ig-chat-toolbar select.ig-chat-toolbar-select,
.ig-chat-toolbar .ig-toolbar-btn {
  min-height: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  box-sizing: border-box;
}
.ig-chat-toolbar select.ig-chat-toolbar-select {
  min-width: 140px;
  max-width: 240px;
  padding: 6px 34px 6px 10px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
}
.ig-chat-toolbar .field .ig-select-shell {
  min-width: 140px;
  max-width: 240px;
}
.ig-chat-toolbar .ig-select-shell select { min-width: 140px !important; width: auto !important; max-width: 240px !important; }
.ig-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 0;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ig-toolbar-btn.primary { background: var(--primary); color: white; }
.ig-toolbar-btn.primary:hover { filter: brightness(1.05); }
.ig-toolbar-btn.secondary { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.ig-toolbar-btn.secondary:hover { background: #e0e7ff; }
.ig-chat-user-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.ig-chat-user-head .ig-avatar { width: 36px; height: 36px; }
.ig-chat-origin.ig-chat-context-box {
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
  margin-bottom: 4px;
}
.ig-chat-origin summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ig-chat-origin summary::-webkit-details-marker { display: none; }
.ig-chat-origin-body {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ig-chat-origin-body .ig-pub-inline {
  margin-top: 0;
  max-width: none;
  width: 100%;
  align-items: center;
}
.ig-pub-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  position: relative;
}
.ig-pub-link:hover { text-decoration: underline; }
.ig-pub-preview {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 20;
  width: 180px;
  padding: 6px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}
.ig-pub-link:hover .ig-pub-preview,
.ig-pub-link:focus-within .ig-pub-preview { display: block; }
.ig-pub-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 4px;
}
.ig-pub-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: #f8fafc;
  max-width: 100%;
  box-sizing: border-box;
}
.ig-pub-inline-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ig-pub-inline-body .ig-pub-inline-link {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ig-pub-inline-thumb {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-subtle);
}
.ig-pub-inline-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ig-pub-inline-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  word-break: break-word;
}
.ig-pub-inline-link:hover { text-decoration: underline; }
.ig-pub-inline-wrap { margin: 4px 0; }
.ig-chat-subtabs { margin-bottom: 4px; }
.ig-chat-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding: 4px 2px;
}
.ig-chat-bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.ig-chat-bubble.in { align-self: flex-start; background: white; border: 1px solid var(--border-subtle); }
.ig-chat-bubble.out { align-self: flex-end; background: var(--primary-tint); border: 1px solid transparent; }
.ig-chat-bubble.channel-comment.in { background: #fffbeb; border-color: #fcd34d; }
.ig-chat-bubble.channel-comment.out { background: #fef3c7; border-color: #fbbf24; }
.ig-chat-bubble-meta { display: block; margin-top: 4px; font-size: 11px; color: var(--text-muted); }
.ig-chat-bubble-tag { color: var(--text-secondary); font-style: italic; }
.ig-chat-bubble--system {
  align-self: center;
  max-width: 92%;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  color: var(--text-secondary);
  font-size: 13px;
}
.ig-chat-bubble--image { max-width: min(320px, 85%); }
.ig-chat-image-unavailable {
  display: inline-block;
  padding: 6px 9px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
}
.ig-chat-bubble-image {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  margin-top: 2px;
}
.ig-chat-bubble--file { max-width: min(420px, 92%); white-space: normal; }
.ig-chat-file {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.ig-chat-file-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: #e0f2fe;
  color: #0369a1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.ig-chat-file-text { flex: 1 1 auto; min-width: 0; }
.ig-chat-file-name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ig-chat-file-meta { margin-top: 2px; font-size: 11px; color: var(--text-muted); }
.ig-chat-file-action {
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 6px 9px;
  background: #fff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.ig-chat-file-action { cursor: pointer; font-family: inherit; }
.ig-chat-file-action:hover { background: #f0f9ff; }
.ig-chat-file-note { flex: 0 0 auto; }
.ig-chat-file-error { display: none; margin-top: 4px; color: #b91c1c; line-height: 1.35; }
.ig-chat-file-error.open { display: block; }
.ig-chat-file-error a { color: #0369a1; text-decoration: underline; }
.ig-chat-bubble[role="button"] { cursor: pointer; }
.ig-chat-bubble[role="button"]:hover { filter: brightness(0.98); }
.ig-chat-quote {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-left: 3px solid var(--primary);
  padding: 5px 9px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(248, 250, 252, 0.92);
  border-radius: 6px;
  white-space: normal;
  cursor: pointer;
  transition: background .15s ease;
}
.ig-chat-quote:hover { background: #f1f5f9; }
.ig-chat-quote--in { border-left-color: #0ea5e9; }
.ig-chat-quote--out { border-left-color: #2563eb; }
.ig-chat-quote-head { display: flex; align-items: baseline; min-width: 0; }
.ig-chat-quote-who { font-weight: 700; font-size: 11px; color: #334155; }
.ig-chat-quote-when { font-size: 10px; color: #94a3b8; }
.ig-chat-quote-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  color: #475569;
}
.ig-chat-quote-file {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  overflow-wrap: anywhere;
}
.ig-chat-quote-file-icon {
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 800;
  color: #0369a1;
  background: #e0f2fe;
  border-radius: 5px;
  padding: 2px 4px;
}
.pipeline-msg.is-quote-target .ig-chat-bubble {
  animation: quote-target-pulse 1.3s ease;
}
@keyframes quote-target-pulse {
  0%, 100% { box-shadow: none; }
  20%, 60% { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35); }
}
.ig-chat-reply-bar {
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border-subtle);
  margin-bottom: 6px;
}
.ig-chat-quote-who { font-weight: 600; margin-right: 4px; }
.ig-chat-quote-text { white-space: pre-wrap; }
.ig-chat-quote-thumb {
  display: block;
  max-width: 120px;
  max-height: 80px;
  border-radius: 6px;
  margin-bottom: 4px;
  cursor: zoom-in;
}
.ig-chat-compose-bar { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ig-chat-compose-bar-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: #fff;
}
.ig-chat-compose-input {
  flex: 1;
  min-height: 36px;
  max-height: 120px;
  resize: vertical;
  border: none;
  background: transparent;
  font: inherit;
  padding: 6px 4px;
}
.ig-chat-compose-input:focus { outline: none; }
.ig-chat-compose-attach,
.ig-chat-compose-send {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: #f8fafc;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.ig-chat-compose-send {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}
.ig-chat-compose-attach:disabled,
.ig-chat-compose-send:disabled { opacity: 0.45; cursor: not-allowed; }
.ig-chat-compose-file { display: none; }
.ig-chat-compose-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.ig-chat-compose-preview-img {
  max-height: 64px;
  border-radius: 8px;
}
.ig-chat-compose-preview-remove {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.ig-chat-image-lightbox-stage {
  overflow: hidden;
  width: min(1440px, 96vw);
  height: 94vh;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: zoom-in;
}
.ig-chat-image-lightbox-img {
  transform-origin: center center;
  transition: transform 0.12s ease-out;
}
.ig-chat-peer-threads {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.ig-chat-peer-thread {
  flex: 0 0 auto;
  max-width: min(280px, 72vw);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: #fff;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.ig-chat-peer-thread-line {
  display: flex;
  align-items: baseline;
  gap: 0;
  white-space: nowrap;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
}
.ig-chat-peer-thread-title {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}
.ig-chat-peer-thread-sep { color: var(--text-muted); flex-shrink: 0; }
.ig-chat-peer-thread-date { flex-shrink: 0; font-weight: 600; }
.ig-chat-bubble-image { cursor: zoom-in; }
.ig-chat-image-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.82);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ig-chat-image-lightbox.open { display: flex; }
.ig-chat-image-lightbox-inner { position: relative; max-width: min(1440px, 98vw); max-height: 96vh; }
.ig-chat-image-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 94vh;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.ig-chat-image-lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.ig-chat-peer-thread.active {
  border-color: var(--primary);
  background: var(--primary-tint);
}
.ig-chat-peer-thread-date { font-size: 12px; font-weight: 600; }
.ig-chat-thread-count { color: var(--text-muted); }
.ig-delivery-blocked {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.3;
}
.ig-delivery-blocked-text { color: var(--danger); font-weight: 600; }
.ig-help-hint {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
  user-select: none;
}
.ig-help-hint:hover,
.ig-help-hint:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}
.ig-help-hint-tip {
  display: none;
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  width: min(280px, 70vw);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: #fff;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  z-index: 30;
  text-align: left;
  white-space: normal;
}
.ig-help-hint:hover .ig-help-hint-tip,
.ig-help-hint:focus-visible .ig-help-hint-tip { display: block; }
.ig-chat-bubble.out .ig-help-hint-tip {
  right: calc(100% + 8px);
  left: auto;
}
.ig-field-label-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ig-help-hint--field { vertical-align: middle; }
.ig-help-hint--field .ig-help-hint-tip {
  left: 0;
  top: calc(100% + 6px);
  transform: none;
  width: min(320px, 85vw);
  z-index: 40;
}
.stack-compact { display: flex; flex-direction: column; gap: 6px; }
.detail-compact .message { margin-bottom: 6px; padding: 8px 10px; }
.detail-compact p { margin: 0 0 4px; }
.ig-journal-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ig-journal-meta {
  font-size: 11px;
  line-height: 1.3;
}
.ig-journal-block {
  padding: 4px 8px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border-subtle);
}
.ig-journal-field-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ig-journal-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.ig-journal-field-head .badge {
  font-size: 10px;
  padding: 1px 6px;
  line-height: 1.35;
}
.ig-journal-body {
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
  margin-top: 2px;
}
.ig-journal-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ig-journal-detail .ig-pub-inline {
  margin-top: 0;
  padding: 4px 6px;
  gap: 6px;
  max-width: min(100%, 360px);
}
.ig-journal-detail .ig-pub-inline-thumb {
  width: 36px;
  height: 36px;
}
.ig-journal-detail .ig-pub-inline-body {
  gap: 1px;
  font-size: 11px;
}
.ig-journal-detail .ig-pub-inline-link {
  font-size: 11px;
  font-weight: 600;
}
.ig-journal-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.ig-journal-error {
  margin: 2px 0 0 !important;
  font-size: 11px;
  min-height: 0;
}
.ig-journal-note {
  margin: 0 !important;
  font-size: 11px;
  line-height: 1.3;
}
.ig-journal-detail .ig-delivery-blocked {
  margin-top: 4px;
  font-size: 11px;
}
.ig-client-modal .field-hint {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}
.ig-client-group {
  padding-top: 10px;
  margin-top: 6px;
  border-top: 1px solid var(--border-subtle);
}
.ig-client-group-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
}
.ig-event-log {
  flex: 1;
  max-height: 360px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 8px 10px;
  background: #1a1d21;
  color: #d4d7dc;
  border-radius: 10px;
}
.ig-event-line { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.ig-event-line:last-child { border-bottom: 0; }
.ig-reply-preview {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: #eef2f7;
  font-size: 13px;
}
.ig-reply-preview-row {
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border-subtle);
}
.ig-reply-preview-row:first-child { margin-top: 0; }
.ig-reply-preview-row:last-child { margin-bottom: 0; }
.ig-reply-preview-row strong { font-size: 12px; color: var(--text-secondary); }
.ig-reply-preview-row p { margin: 4px 0 0; }
.ig-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.ig-modal {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.problem-modal { width: min(600px, 100%); }
.problem-modal .home-modal-body { gap: 12px; }
.problem-hint {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}
.problem-text {
  width: 100%;
  min-height: 130px;
  resize: vertical;
}
.problem-attach-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.problem-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--border-strong, #cbd5e1);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.problem-file-btn:hover { background: #f8fafc; }
.problem-file-icon { display: inline-flex; }
.problem-file-icon svg { width: 18px; height: 18px; }
.problem-preview {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.problem-preview.open { display: grid; }
.problem-preview-item {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 4px;
}
.problem-preview img {
  display: block;
  width: 100%;
  height: 86px;
  object-fit: cover;
  border-radius: 7px;
}
.problem-preview-remove {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.problem-error {
  min-height: 16px;
  margin-top: 8px;
  color: #b91c1c;
  font-size: 12px;
}
.problem-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.problem-success {
  padding: 26px 10px;
  text-align: center;
  color: #0f172a;
}
.problem-success p { margin: 8px 0 0; color: #475569; }
.sidebar-problem { color: var(--text-primary); }

@media (max-width: 800px) {
  .stats, .grid-2, .stat-grid { grid-template-columns: 1fr; }
  .data-table { min-width: 720px; }
  .ig-chat-layout { grid-template-columns: 1fr; }
}

.ig-chat-list .ig-chat-load-more,
.ig-chat-messages .ig-chat-load-older {
  align-self: center;
  margin: 6px 0;
  flex-shrink: 0;
}

.pipeline-head { align-items: flex-start; }
.pipeline-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  align-items: center;
}
.pipeline-search { min-width: 260px; }
.pipeline-board-host { height: calc(100vh - 200px); min-height: 320px; display: flex; flex-direction: column; }
.pipeline-board {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 0;
}
.pipeline-col {
  flex: 0 0 280px;
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  box-sizing: border-box;
  background: #e9eef5;
  border: 1px solid #d8e0ea;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.pipeline-col.is-over { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.25); }
.pipeline-col-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 10px 7px;
  font-size: 13px;
  font-weight: 600;
}
.pipeline-col-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.pipeline-col-title { flex: 1 1 auto; }
.pipeline-col-count {
  background: #e2e8f0;
  color: #334155;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
}
.pipeline-col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 7px 9px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  min-height: 60px;
}
.pipeline-col-empty { padding: 10px 4px 16px; }
.pipeline-col-more {
  width: 100%;
  margin: 0;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  cursor: pointer;
}
.pipeline-col-more:hover:not(:disabled) { background: #eef2f7; border-color: #94a3b8; }
.pipeline-col-more:disabled { opacity: .65; cursor: default; }
.pipeline-card {
  background: #fff;
  border: 1px solid #e6ebf2;
  border-left: 3px solid #94a3b8;
  border-radius: 11px;
  padding: 7px 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  cursor: pointer;
  content-visibility: auto;
  contain-intrinsic-size: 110px;
  box-shadow: 0 1px 2px rgba(15,23,42,.06);
  transition: box-shadow .15s ease, transform .15s ease;
}
.pipeline-card:hover { box-shadow: 0 6px 16px rgba(15,23,42,.12); transform: translateY(-1px); }
.pipeline-card.is-dragging { opacity: .45; }
.pipeline-card-top { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; }
.pipeline-card-number { color: #64748b; font-size: 10px; font-weight: 600; letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pipeline-card-unread {
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  padding: 0 5px;
  font-size: 10px;
  line-height: 16px;
  min-width: 16px;
  height: 16px;
  text-align: center;
  flex: 0 0 auto;
}
.pipeline-card-client { font-weight: 600; margin-top: 2px; font-size: 13px; min-width: 0; max-width: 100%; }
.pipeline-card-title { color: #475569; font-size: 11px; margin-top: 1px; min-width: 0; max-width: 100%; }
.pipeline-card-meta { display: flex; align-items: center; gap: 5px; margin-top: 6px; min-width: 0; }
.pipeline-card-amount { font-size: 12px; font-weight: 600; color: #0f172a; }
.pipeline-card-owner {
  margin-left: auto;
  font-size: 11px;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pipeline-card-preview {
  margin-top: 6px;
  color: #334155;
  font-size: 11px;
  line-height: 1.3;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  background: #f1f5f9;
  border-radius: 7px;
  padding: 4px 6px;
}
.pipeline-card-time { margin-top: 5px; }
.pipeline-source {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.pipeline-source-avito { background: #e0f2fe; color: #0369a1; }
.pipeline-source-instagram { background: #fce7f3; color: #9d174d; }
.pipeline-source-mixed, .pipeline-source-other { background: #ede9fe; color: #5b21b6; }
.pipeline-source-manual { background: #f1f5f9; color: #475569; }
.pipeline-attention {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.pipeline-attention-danger { background: #fee2e2; color: #b91c1c; }
.pipeline-attention-info { background: #e0f2fe; color: #0369a1; }

.pipeline-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15,23,42,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.pipeline-deal-modal {
  width: min(1440px, 98vw);
  height: min(920px, 94vh);
  background: #fff;
  border-radius: 16px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(15,23,42,.35);
}
.pipeline-deal-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid #111827;
  background: #1f2530;
  color: #fff;
}
.pipeline-deal-head-main { min-width: 220px; margin-right: auto; }
.pipeline-deal-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn.secondary.pipeline-instagram-sync {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .22);
  color: #e5e7eb;
  white-space: nowrap;
}
.btn.secondary.pipeline-instagram-sync:hover:not(:disabled) { background: rgba(255, 255, 255, .16); }
.btn.secondary.pipeline-instagram-sync:disabled { opacity: .55; cursor: default; }
.pipeline-deal-title { margin: 0; font-size: 18px; color: #fff; }
.pipeline-deal-sub { display: block; margin-top: 2px; color: #cbd5e1; }
.pipeline-head-field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: #64748b; }
.pipeline-head-field .ig-filter { min-width: 190px; }
.pipeline-close {
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: #e5e7eb;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pipeline-close:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.pipeline-deal-left {
  border-right: 1px solid #dbe3ec;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #eef2f7;
}
.pipeline-deal-card {
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pipeline-deal-card-row { display: flex; align-items: center; gap: 8px; }
.pipeline-deal-card-label { font-size: 12px; color: #64748b; }
.pipeline-deal-delete {
  margin-left: auto;
  padding: 3px 8px;
  font-size: 11px;
  white-space: nowrap;
}
.pipeline-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #475569; }
.pipeline-items { display: flex; flex-direction: column; gap: 7px; }
.pipeline-items-head,
.pipeline-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 96px 26px;
  gap: 6px;
  align-items: center;
}
.pipeline-items-head {
  padding: 0 2px;
  font-size: 11px;
  color: #64748b;
}
.pipeline-item-row .pipeline-input {
  padding: 6px 7px;
  font-size: 12px;
}
.pipeline-items-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid #eef2f7;
  font-size: 13px;
  color: #0f172a;
}
.pipeline-items-total-value { font-weight: 700; }
.pipeline-items-add { align-self: stretch; width: 100%; justify-content: center; }
.pipeline-items-save { align-self: stretch; width: 100%; justify-content: center; }
.pipeline-items-save-status {
  display: block;
  min-height: 16px;
  color: #64748b;
  font-size: 11px;
}
.pipeline-item-remove {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px;
  border-radius: 6px;
}
.pipeline-item-remove:hover { color: #dc2626; background: #fef2f2; }
.pipeline-item-remove-placeholder { display: block; }
.pipeline-input {
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  padding: 7px 9px;
  font: inherit;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
}
.pipeline-block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pipeline-block-title { font-weight: 600; font-size: 13px; }
.pipeline-client-line { display: flex; align-items: center; gap: 9px; }
.pipeline-client-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #3730a3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}
.pipeline-client-name { font-weight: 600; }
.pipeline-history { display: flex; flex-direction: column; gap: 4px; }
.pipeline-history-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 6px;
  font-size: 12px;
  padding: 5px 7px;
  border-radius: 7px;
  background: #f8fafc;
}
.pipeline-history-row.is-current { background: #eef2ff; }
.pipeline-history-num { font-weight: 600; color: #475569; }
.pipeline-history-stage { flex: 1 1 auto; color: #334155; }
.pipeline-history-text { flex: 1 1 auto; min-width: 0; color: #334155; line-height: 1.35; overflow-wrap: anywhere; }
.pipeline-history-body { flex: 1 1 auto; min-width: 0; }
.pipeline-history-transition { color: #334155; line-height: 1.35; overflow-wrap: anywhere; }
.pipeline-history-meta { margin-top: 2px; }
.pipeline-history-row .pipeline-stage-dot { margin-top: 4px; }
.pipeline-history-when { margin-left: auto; white-space: nowrap; }
.pipeline-history-user { flex-basis: 100%; text-align: right; }
.pipeline-history-amount { color: #0f172a; font-weight: 600; }
.pipeline-deal-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; background: #fff; }
.pipeline-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #e6ebf2;
}
.pipeline-chat-unread { font-size: 12px; color: #64748b; }
.pipeline-chat-unread.is-active { color: #dc2626; font-weight: 600; }
.pipeline-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
}
.pipeline-chat-empty { padding: 30px 10px; text-align: center; }
.pipeline-load-older { align-self: center; }
.pipeline-chat-day { align-self: center; margin: 4px 0; }
.pipeline-msg { display: flex; flex-direction: column; gap: 2px; max-width: 78%; min-width: 0; flex: 0 0 auto; }
.pipeline-msg-in { align-self: flex-start; }
.pipeline-msg-out { align-self: flex-end; align-items: flex-end; }
.pipeline-msg .ig-msg {
  max-width: 100%;
}
.pipeline-msg .ig-chat-bubble { max-width: 100%; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.pipeline-msg .ig-chat-bubble img { max-width: 100%; height: auto; }
.pipeline-msg-channel { font-size: 10px; color: #94a3b8; padding: 0 4px; }
.pipeline-compose-wrap {
  border-top: 1px solid #e6ebf2;
  background: #fff;
}
.pipeline-compose-hint {
  margin: 0 16px 10px;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  line-height: 1.4;
}
.pipeline-compose-hint[hidden] { display: none; }
.pipeline-compose {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
  padding: 10px 16px 12px;
  background: #fff;
}
.pipeline-compose-input-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
}
.pipeline-compose-input-wrap .pipeline-compose-input {
  flex: 1 1 auto;
  padding-right: 78px;
}
.pipeline-attach-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #64748b;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  border-radius: 8px;
}
.pipeline-attach-btn svg { width: 22px; height: 22px; display: block; }
.pipeline-attach-btn:hover { background: #eef2f7; color: #334155; }
.pipeline-attach-btn:disabled { opacity: .45; cursor: default; }
.pipeline-compose .btn.primary { align-self: center; white-space: nowrap; }
.pipeline-pending-photo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 0;
  background: #fff;
}
.pipeline-pending-photo {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #dbe3ec;
  background: #f8fafc;
}
.pipeline-pending-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pipeline-pending-photo-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.pipeline-pending-photo-remove:hover { background: rgba(15, 23, 42, 0.9); }
.pipeline-pending-photo-remove:disabled { opacity: .55; cursor: default; }
.pipeline-reply-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 0;
  background: #f8fafc;
}
.pipeline-reply-text {
  flex: 1 1 auto;
  min-width: 0;
  border-left: 3px solid #6366f1;
  padding-left: 8px;
}
.pipeline-compose-channel { min-width: 190px; align-self: center; }
.pipeline-compose-input {
  flex: 1 1 auto;
  resize: none;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  min-height: 42px;
  max-height: 140px;
}
@media (max-width: 980px) {
  .pipeline-deal-modal { grid-template-columns: 1fr; grid-template-rows: auto auto minmax(0, 1fr); }
  .pipeline-deal-left { display: none; }
  .pipeline-deal-head { flex-wrap: wrap; }
}
.pipeline-card-client, .pipeline-card-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pipeline-truncated { margin: 0 0 8px; }

.pipeline-title-row { display: flex; align-items: center; gap: 6px; }
.pipeline-stage-row { display: flex; align-items: center; gap: 6px; }
.pipeline-stage-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.pipeline-stage-select { flex: 1 1 auto; min-width: 0; }
.pipeline-responsible-row { display: flex; align-items: center; gap: 6px; }
.pipeline-responsible-select { flex: 1 1 auto; min-width: 0; }
.pipeline-title-row .pipeline-input { flex: 1 1 auto; }
.pipeline-title-actions { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.pipeline-title-actions .btn { white-space: nowrap; }
.pipeline-topics { display: flex; flex-direction: column; gap: 8px; }
.pipeline-topic {
  border: 1px solid #e6ebf2;
  border-radius: 9px;
  padding: 7px;
  background: #f8fafc;
}
.pipeline-topic-label { display: block; font-size: 11px; font-weight: 600; color: #475569; margin-bottom: 5px; }
.pipeline-topic-body { display: flex; gap: 8px; align-items: flex-start; }
.pipeline-topic-thumb {
  width: 48px;
  height: 48px;
  border-radius: 7px;
  object-fit: cover;
  flex: 0 0 auto;
  cursor: zoom-in;
  background: #e2e8f0;
}
.pipeline-topic-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pipeline-topic-title { font-size: 11px; color: #334155; line-height: 1.3; }
.pipeline-topic-link { font-size: 11px; font-weight: 600; color: #2563eb; text-decoration: none; }
.pipeline-topic-link:hover { text-decoration: underline; }
.pipeline-chat-error { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.pipeline-migrating { margin: 0 0 8px; }

.pipeline-card-when {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #64748b;
  white-space: nowrap;
  flex: 0 0 auto;
}

.pipeline-stage-control { position: relative; flex: 1 1 auto; min-width: 0; }
.pipeline-stage-control.is-saving { opacity: .6; pointer-events: none; }
.pipeline-stage-control > summary { list-style: none; cursor: pointer; }
.pipeline-stage-control > summary::-webkit-details-marker { display: none; }
.pipeline-stage-button:hover { filter: brightness(0.99); }
.pipeline-stage-button {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  padding: 7px 9px;
  background: #fff;
  font-size: 13px;
}
.pipeline-stage-current { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-stage-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #94a3b8;
  flex: 0 0 auto;
  transition: transform .15s ease;
}
.pipeline-stage-control[open] .pipeline-stage-caret { transform: rotate(180deg); }
.pipeline-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .18);
  padding: 4px;
  max-height: 280px;
  overflow-y: auto;
}
.pipeline-select-option {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  border: 0;
  background: var(--stage-tint, transparent);
  padding: 7px 8px;
  border-radius: 9px;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  color: #334155;
}
.pipeline-select-option:hover { background: var(--stage-tint-hover, #f1f5f9); }
.pipeline-select-option:disabled { opacity: .6; cursor: default; }
.pipeline-select-option.is-current { background: var(--stage-tint-hover, #eef2f7); font-weight: 600; }
.pipeline-stage-done {
  display: inline-flex;
  align-items: center;
  border-radius: 9px;
  background: #dcfce7;
  color: #166534;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 600;
}
select, .ig-filter { border-radius: 10px; }

.workspace:has(.pipeline-board-host) {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  padding-bottom: 0;
  box-sizing: border-box;
}
.workspace:has(.pipeline-board-host) > .channel-view {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.workspace:has(.pipeline-board-host) .pipeline-head,
.workspace:has(.pipeline-board-host) .pipeline-toolbar {
  flex: 0 0 auto;
}
.workspace:has(.pipeline-board-host) .pipeline-board-host {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

.pipeline-msg-row { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.pipeline-msg-row-out { flex-direction: row-reverse; }
.pipeline-reply-btn {
  opacity: 0;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #64748b;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity .12s ease, background .12s ease;
  padding: 0;
}
.pipeline-reply-btn svg { width: 16px; height: 16px; display: block; }
.pipeline-reply-btn:hover { background: #e2e8f0; color: #0f172a; }
.pipeline-msg:hover .pipeline-reply-btn,
.pipeline-reply-btn:focus-visible { opacity: 1; }

.pipeline-stage-group { margin-top: 4px; border-top: 1px solid #e2e8f0; padding-top: 4px; }
.pipeline-stage-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 7px 8px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  display: flex;
  align-items: center;
  gap: 5px;
}
.pipeline-stage-group > summary::-webkit-details-marker { display: none; }
.pipeline-stage-group > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid #94a3b8;
}
.pipeline-stage-group[open] > summary::before {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #94a3b8;
  border-bottom: 0;
}
.pipeline-stage-group .pipeline-select-option { margin-top: 2px; }
.pipeline-stage-cross { display: flex; align-items: center; gap: 4px; }
.pipeline-stage-cross .pipeline-stage-dot { width: 8px; height: 8px; }

.pipeline-client-tabs { display: flex; gap: 6px; }
.pipeline-client-tab {
  border: 1px solid #dbe3ec;
  background: #fff;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 11px;
  cursor: pointer;
  color: #475569;
}
.pipeline-client-tab.active { background: #e0e7ff; border-color: #a5b4fc; color: #3730a3; font-weight: 600; }
.pipeline-client-list { display: flex; flex-direction: column; gap: 5px; max-height: 220px; overflow-y: auto; }
.pipeline-client-row { border: 1px solid #e6ebf2; border-radius: 8px; padding: 6px; background: #fff; }
.pipeline-client-row.is-current { background: #f8fafc; }
.pipeline-client-row.is-clickable { cursor: pointer; }
.pipeline-client-row.is-clickable:hover { border-color: #a5b4fc; }
.pipeline-client-row-top { display: flex; align-items: center; gap: 5px; min-width: 0; }
.pipeline-client-row-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #94a3b8;
  flex: 0 0 auto;
}
.pipeline-deal-link {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: #2563eb;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pipeline-deal-link:disabled { color: #0f172a; cursor: default; }
.pipeline-client-row-meta { margin-top: 2px; font-size: 11px; color: #64748b; overflow-wrap: anywhere; }
.pipeline-client-row-current { display: block; margin-top: 2px; font-size: 10px; color: #94a3b8; }

.clients-list-column { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.clients-list-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.clients-filters { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; align-items: center; }
.clients-source-filter { position: relative; }
.clients-source-filter > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid #dbe3ec;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.clients-source-filter > summary::-webkit-details-marker { display: none; }
.clients-source-filter[open] > summary,
.clients-source-filter.has-value > summary {
  border-color: #a5b4fc;
  color: #3730a3;
  background: #eef2ff;
}
.clients-source-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #4f46e5;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.clients-source-caret { font-size: 10px; opacity: .6; }
.clients-source-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  min-width: 224px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
}
.clients-source-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.clients-source-option:hover { background: #f1f5f9; }
.clients-source-option.is-active { background: #eef2ff; }
.clients-source-option-label { font-weight: 600; }
.clients-source-check { margin-left: auto; width: 14px; text-align: center; color: #4f46e5; font-weight: 700; }
.clients-sort { min-width: 150px; }
.clients-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}
.clients-list-status { min-height: 16px; }
.clients-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-left: auto; }
.clients-page {
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.clients-page:hover:not(:disabled) { background: #f1f5f9; color: #0f172a; }
.clients-page.is-active {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #3730a3;
}
.clients-page:disabled { opacity: .45; cursor: default; }
.clients-page-gap { padding: 0 2px; color: #94a3b8; font-size: 12px; }
.clients-list-loading { padding: 8px 4px; text-align: center; }
.clients-list { min-width: 0; }
.clients-list-item {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}
.clients-list-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.clients-list-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.clients-list-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clients-list-phone { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clients-deal-count {
  flex: 0 0 auto;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.clients-deal-count.is-empty { background: #f1f5f9; color: #94a3b8; }
.clients-more-wrap { padding: 10px 4px 4px; display: flex; justify-content: center; }
.clients-more { width: 100%; }
.pipeline-source-telegram { background: #e0f2fe; color: #0369a1; }
.pipeline-source-max { background: #ede9fe; color: #5b21b6; }
.pipeline-source-phone { background: #fef3c7; color: #92400e; }
.pipeline-source-offline { background: #f1f5f9; color: #475569; }
.ig-client-deal-clickable { cursor: pointer; }
.ig-client-deal-clickable:hover { border-color: #a5b4fc; background: #f8fafc; }
.ig-client-completed-deal { justify-content: space-between; gap: 8px; padding: 4px 0; }

/* --- Сотрудники (Phase 2A) --- */
.staff-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg-subtle);
}
.staff-subnav-item {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.staff-subnav-item:hover { background: var(--bg-surface); color: var(--text-primary); }
.staff-subnav-item.is-active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-card);
}

.staff-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.staff-notice { margin: 0; }
.staff-notice--error { background: var(--danger-tint); color: var(--danger); }

.staff-list-panel { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.staff-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.staff-search { flex: 1 1 220px; min-width: 160px; max-width: 360px; }
.staff-filter { flex: 0 0 auto; }
.staff-toggle { flex: 0 0 auto; gap: 6px; }
.staff-list-meta { margin: 0; font-variant-numeric: tabular-nums; }
.staff-list { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.staff-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.staff-row:hover { background: var(--bg-subtle); }
.staff-row:focus-visible { border-color: var(--border-focus); }
.staff-row.is-inactive { opacity: 0.72; }
.staff-avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.staff-row.is-inactive .staff-avatar { background: var(--bg-muted); color: var(--text-muted); }
.staff-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.staff-row-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.staff-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.staff-row-sub { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-muted); font-size: 12px; }
.staff-row-sub > span:not(.staff-row-sep) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-row-sep { color: var(--text-disabled); }
.staff-row-login { color: var(--text-secondary); font-size: 11px; }
.staff-row-side { flex: none; display: flex; align-items: center; gap: 6px; }
.staff-row-open {
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}
.staff-row-open:hover { background: var(--primary-tint); }
.staff-row-action { min-height: 30px; padding: 0 10px; font-size: 12px; white-space: nowrap; }
.staff-row-action:disabled { opacity: 0.6; cursor: default; }

.staff-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.staff-empty-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; color: var(--text-disabled); }
.staff-empty-icon svg { width: 24px; height: 24px; }
.staff-empty-text { margin: 0; max-width: 440px; }

.staff-skeleton { display: flex; flex-direction: column; gap: 6px; }
.staff-skeleton-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface);
  animation: staff-shimmer 1.2s ease-in-out infinite;
}
.staff-skeleton-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--bg-muted); }
.staff-skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.staff-skeleton-line { display: block; width: 45%; height: 9px; border-radius: 6px; background: var(--bg-muted); }
.staff-skeleton-line--wide { width: 70%; }
.staff-skeleton--panel .staff-skeleton-line { width: 60%; }
.staff-skeleton--panel .staff-skeleton-line--wide { width: 85%; }
@keyframes staff-shimmer {
  0% { opacity: 0.55; }
  50% { opacity: 1; }
  100% { opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .staff-skeleton-row { animation: none; }
}

.staff-card { display: flex; flex-direction: column; gap: 10px; }
.staff-section { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.staff-section + .staff-section { padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.staff-section > .section-title { margin: 0; }
.staff-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.staff-section-head .section-title { margin: 0; }
.staff-section-head--matrix { margin-top: 2px; }

.staff-form { display: flex; flex-direction: column; gap: 10px; }
.staff-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.staff-form-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.staff-form .field { margin-bottom: 0; }
.staff-field-label { color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.staff-hint, .field .staff-hint { color: var(--text-muted); font-size: 12px; font-weight: 500; line-height: 1.35; }
.staff-field-error { margin: 0; color: var(--danger); font-size: 12px; line-height: 1.35; }
.staff-field-error:empty { display: none; }
.staff-input,
.staff-select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}
textarea.staff-input { min-height: 84px; resize: vertical; }
.staff-input[readonly] { background: var(--bg-subtle); color: var(--text-muted); }
.staff-input:focus,
.staff-select:focus {
  border-color: var(--border-focus);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-tint);
}
.staff-field .ig-styled-select {
  display: flex;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
.staff-field .ig-styled-select-btn { width: 100%; min-width: 0 !important; }
.staff-password-row { display: flex; align-items: stretch; gap: 6px; }
.staff-password-row .staff-input { flex: 1; min-width: 0; }
.staff-password-row .btn { flex: none; }

.staff-department-add { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.staff-inline-add { display: flex; align-items: stretch; gap: 6px; }
.staff-inline-add .staff-inline-input { flex: 1; min-width: 0; }
.staff-inline-add .btn { flex: none; }

.staff-form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.staff-link-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.staff-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.staff-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.staff-dirty { color: var(--warning-amber); font-size: 12px; font-weight: 600; }
.staff-self-warning { margin: 0; background: var(--warning-amber-tint); color: #92400e; }
.staff-self-warning[hidden] { display: none; }
.staff-self-warning--blocked { background: var(--danger-tint); color: var(--danger); }
.staff-dirty[hidden] { display: none; }
.staff-check { align-self: flex-start; }
.staff-form-error { margin: 0; }
.staff-form-error:empty { display: none; }

.staff-matrix { display: flex; flex-direction: column; gap: 10px; }
.staff-matrix-group { display: flex; flex-direction: column; gap: 4px; }
.staff-matrix-title { margin: 0; color: var(--text-secondary); font-size: 13px; }
.staff-matrix-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.staff-matrix-row:last-child { border-bottom: 0; }
.staff-matrix-label { flex: 1 1 180px; min-width: 0; color: var(--text-primary); font-size: 13px; }
.staff-matrix-badge { flex: none; }
.staff-matrix-summary { font-variant-numeric: tabular-nums; }
.staff-matrix-hint { margin: 0; }
.staff-create-rights {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-subtle);
}
.staff-create-rights-summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}
.staff-create-rights .staff-check { align-self: flex-start; min-height: 0; }
.staff-create-rights .staff-matrix { padding-top: 2px; }
.staff-matrix--checks .staff-matrix-row { cursor: pointer; }
.staff-matrix-row--check input { width: 16px; height: 16px; flex: none; }

.staff-tristate {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: var(--bg-subtle);
}
.staff-tristate-btn {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}
.staff-tristate-btn:hover { background: var(--bg-surface); color: var(--text-primary); }
.staff-tristate-btn.is-active {
  border-color: var(--border-subtle);
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-card);
}
.staff-tristate-btn.is-active:nth-child(2) { background: var(--success-tint); color: var(--success); }
.staff-tristate-btn.is-active:nth-child(3) { background: var(--danger-tint); color: var(--danger); }

.staff-tg { display: flex; flex-direction: column; gap: 6px; }
.staff-tg-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.staff-tg-head .section-title { margin: 0; }
.staff-tg-meta { display: flex; flex-direction: column; gap: 2px; }
.staff-tg-row { display: flex; gap: 8px; font-size: 13px; }
.staff-tg-label { flex: 0 0 120px; }
.staff-tg-value { min-width: 0; overflow-wrap: anywhere; }
.staff-tg-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.staff-tg-code-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: var(--bg-subtle);
}
.staff-tg-code { font-size: 22px; font-weight: 700; letter-spacing: 0.18em; }
.staff-tg-hint { margin: 0; }
.staff-tg-wait { margin: 0; color: var(--warning-amber); }
.staff-tg-error { margin: 0; }

.staff-roles-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}
.staff-roles-list { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.staff-roles-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.staff-roles-head .section-title { margin: 0; }
.staff-roles-items { display: flex; flex-direction: column; gap: 2px; }
.staff-role-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
}
.staff-role-item:hover { background: var(--bg-subtle); }
.staff-role-item.is-active { background: var(--primary-tint); border-color: var(--border-subtle); }
.staff-role-item-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.staff-role-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.staff-role-item-meta { font-size: 11px; }
.staff-role-panel { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.staff-role-form { display: flex; flex-direction: column; gap: 10px; }
.staff-role-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.staff-role-counter { font-variant-numeric: tabular-nums; }
.staff-role-delete-hint { margin: 0; }
.staff-role-create {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}
.staff-role-create[hidden] { display: none; }
.staff-role-create-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.staff-role-error { margin: 0; }
.staff-role-error:empty { display: none; }

@media (max-width: 900px) {
  .staff-roles-layout { grid-template-columns: 1fr; }
  .staff-form-grid { grid-template-columns: 1fr; }
  .staff-row-side .staff-row-open { display: none; }
  .staff-matrix-row { align-items: flex-start; }
  .staff-tristate { width: 100%; }
}
@media (max-width: 640px) {
  .staff-toolbar { align-items: stretch; }
  .staff-search { max-width: none; }
  .staff-row-side { flex-direction: column; align-items: flex-end; gap: 4px; }
}
/* --- Главная и профиль (Phase 3) --- */
.home-page-head { align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.home-greeting { margin: 0; }
.home-subtitle { margin: 2px 0 0; }
.home-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 600;
}
.home-profile-btn:hover { background: var(--bg-subtle); color: var(--text-primary); }
.home-avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.home-tabs {
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 10px;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg-subtle);
  overflow-x: auto;
}
.home-tab {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}
.home-tab:hover { background: var(--bg-surface); color: var(--text-primary); }
.home-tab.is-active { background: var(--bg-surface); color: var(--primary); box-shadow: var(--shadow-card); }

.home-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.home-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.home-toolbar-hint { margin: 0; }
.home-refresh { margin-left: auto; }

.home-task-list, .home-assignments { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.home-task-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}
.home-task-card.is-overdue { border-color: var(--danger); box-shadow: inset 3px 0 0 var(--danger); }
.home-task-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.home-task-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.home-task-title { font-size: 14px; overflow-wrap: anywhere; }
.home-task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--text-muted);
  font-size: 12px;
}
.home-task-due.is-overdue { color: var(--danger); font-weight: 600; }
.home-task-id { flex: none; color: var(--text-disabled); font-size: 12px; }

.home-group { display: flex; flex-direction: column; gap: 6px; }
.home-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-top: 2px; }
.home-group-head .section-title { margin: 0; }
.home-group-count { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.home-empty { padding: 20px 12px; }
.home-notice { margin: 0; }
.home-cta { display: flex; flex-direction: column; gap: 6px; }
.home-cta .section-title, .home-cta p { margin: 0; }
.home-cta .btn { align-self: flex-start; }
.home-error-card { display: flex; flex-direction: column; gap: 6px; }
.home-error-card .error { margin: 0; }
.home-error-card .btn { align-self: flex-start; }

.home-skeleton { display: flex; flex-direction: column; gap: 6px; }
.home-skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface);
  animation: staff-shimmer 1.2s ease-in-out infinite;
}
.home-skeleton-line { display: block; width: 45%; height: 9px; border-radius: 6px; background: var(--bg-muted); }
.home-skeleton-line--wide { width: 70%; }

.home-form { display: flex; flex-direction: column; gap: 10px; }
.home-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.home-form-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.home-form-cell--wide { grid-column: 1 / -1; }
.home-field-label { color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.home-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}
.home-input:focus { border-color: var(--border-focus); outline: none; box-shadow: 0 0 0 3px var(--primary-tint); }
textarea.home-input { min-height: 84px; resize: vertical; }
.home-hint { margin: 0; color: var(--text-muted); font-size: 12px; font-weight: 500; line-height: 1.35; }
.home-field-error { margin: 0; color: var(--danger); font-size: 12px; line-height: 1.35; }
.home-field-error:empty { display: none; }
.home-form-error { margin: 0; color: var(--danger); font-size: 12px; }
.home-form-error:empty { display: none; }
.home-form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.home-form .ig-styled-select { display: flex; width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
.home-form .ig-styled-select-btn { width: 100%; min-width: 0 !important; }

.home-due { display: flex; flex-direction: column; gap: 6px; }
.home-due-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.home-due-btn { min-height: 32px; padding: 0 10px; font-size: 12px; }
.home-due-btn.is-active { background: var(--primary-tint); border-color: var(--primary); color: var(--primary); }

.home-success { display: flex; flex-direction: column; gap: 6px; }
.home-success .section-title { margin: 0; }
.home-success-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.home-success-row { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.home-success-label { color: var(--text-muted); font-size: 11px; }
.home-success-value { font-size: 13px; overflow-wrap: anywhere; }

.home-recent { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.home-recent .section-title { margin: 0; }
.home-recent-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.home-recent-row:last-child { border-bottom: 0; }
.home-recent-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.home-recent-side { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex: none; text-align: right; }
.home-recent-when { font-size: 12px; font-variant-numeric: tabular-nums; }
.home-no-access { display: flex; flex-direction: column; gap: 4px; }
.home-no-access .section-title { margin: 0; }
.home-no-access p { margin: 0; }

.home-modal { width: min(620px, 100%); display: flex; flex-direction: column; gap: 10px; }
.home-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.home-modal-title { margin: 0; font-size: 18px; }
.home-modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1;
}
.home-modal-close:hover { background: var(--bg-subtle); color: var(--text-primary); }
.home-modal-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.profile-section { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.profile-section:first-child { padding-top: 0; border-top: 0; }
.profile-section-title { margin: 0; font-size: 14px; }
.profile-section-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.profile-section-head .profile-section-title { margin: 0; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.profile-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.profile-field--wide { grid-column: 1 / -1; }
.profile-label { color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.profile-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}
.profile-input:focus { border-color: var(--border-focus); outline: none; box-shadow: 0 0 0 3px var(--primary-tint); }
.profile-input[readonly] { background: var(--bg-subtle); color: var(--text-muted); }
textarea.profile-input { min-height: 64px; resize: vertical; }
.profile-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.profile-hint { margin: 0; }
.profile-notice { margin: 0; }
.profile-error-text { margin: 0; color: var(--danger); font-size: 12px; line-height: 1.35; }
.profile-error-text:empty { display: none; }
.profile-tg { display: flex; flex-direction: column; gap: 6px; }
.profile-tg-meta { display: flex; flex-direction: column; gap: 2px; }
.profile-row { display: flex; gap: 8px; font-size: 13px; }
.profile-row-label { flex: 0 0 120px; }
.profile-row-value { min-width: 0; overflow-wrap: anywhere; }
.profile-tg-code {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: var(--bg-subtle);
}
.profile-tg-code-value { font-size: 22px; font-weight: 700; letter-spacing: 0.18em; }
.profile-tg-code p { margin: 0; }
.profile-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.profile-wait { margin: 0; color: var(--warning-amber); }
.profile-password { display: flex; flex-direction: column; gap: 8px; }
.profile-error { display: flex; flex-direction: column; gap: 6px; }
.profile-error .error { margin: 0; }
.profile-error .btn { align-self: flex-start; }

@media (prefers-reduced-motion: reduce) {
  .home-skeleton-card { animation: none; }
}
@media (max-width: 900px) {
  .home-page-head { flex-wrap: wrap; }
  .home-profile-text { display: none; }
  .home-profile-btn { padding: 4px; }
  .home-form-grid, .profile-grid, .home-success-grid { grid-template-columns: 1fr; }
  .home-refresh { margin-left: 0; }
  .home-success-row, .profile-field--wide, .home-form-cell--wide { grid-column: auto; }
  .home-task-card { flex-direction: column; }
  .home-task-id { align-self: flex-end; }
  .home-recent-row { flex-direction: column; gap: 4px; }
  .home-recent-side { align-items: flex-start; text-align: left; }
}
.home-new-client { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.home-assign-form { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.home-assign-form .ig-styled-select { display: flex; width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
.home-assign-form .ig-styled-select-btn { width: 100%; min-width: 0 !important; }
/* --- Telegram bot settings (#/bot) --- */
.bot-page { display: flex; flex-direction: column; gap: 10px; }
.bot-page .card { margin: 0; }
.bot-status-card { display: flex; flex-direction: column; gap: 10px; }
.bot-status-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bot-status-head h2 { margin: 0 0 2px; }
.bot-status-details { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.bot-status-message { margin: 0; }
.bot-status-actions { display: flex; justify-content: flex-start; }
.bot-form-card { display: flex; flex-direction: column; gap: 10px; }
.bot-form { display: flex; flex-direction: column; gap: 8px; }
.bot-hint { margin: -4px 0 2px; }
.bot-secret-line { display: flex; gap: 8px; align-items: center; }
.bot-secret-line input { flex: 1 1 auto; min-width: 0; }
.bot-generate { flex: 0 0 auto; white-space: nowrap; }
.bot-check { display: flex; align-items: center; gap: 8px; margin: 2px 0; }
.bot-form-actions { display: flex; justify-content: flex-start; padding-top: 4px; }
.bot-side-card { display: flex; flex-direction: column; gap: 8px; }
.bot-code-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-subtle); }
.bot-code-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bot-code-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.bot-code-value { display: block; font-size: 12px; word-break: break-all; color: var(--text-primary); }
.bot-code-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.bot-copy-btn { padding: 5px 10px; font-size: 12px; }
.bot-copy-status { font-size: 12px; color: var(--success); white-space: nowrap; }
.bot-copy-fallback { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }
.bot-webhook-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); }
.bot-help-card { display: flex; flex-direction: column; gap: 8px; }
.bot-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; color: var(--text-secondary); }
.bot-steps li { padding-left: 2px; }
.bot-task-flag-note { margin: 4px 0 0; }
.bot-notice { margin: 0; }
.bot-skeleton { height: 44px; border-radius: var(--radius-md); background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--bg-muted) 37%, var(--bg-subtle) 63%); background-size: 400% 100%; animation: bot-shimmer 1.4s ease infinite; }
.bot-skeleton.short { height: 28px; width: 55%; }
@keyframes bot-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (max-width: 720px) {
  .bot-code-row { flex-direction: column; }
  .bot-code-actions { width: 100%; justify-content: flex-end; }
  .bot-secret-line { flex-direction: column; align-items: stretch; }
  .bot-generate { align-self: flex-start; }
}

/* --- Home task boards, quick titles, link CTA --- */
.home-board-host { min-width: 0; overflow-x: auto; padding-bottom: 4px; }
.home-board { display: flex; align-items: flex-start; gap: 10px; min-height: 220px; }
.home-board-col { flex: 0 0 280px; display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-subtle); max-height: 68vh; }
.home-board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 2px 2px 4px; }
.home-board-head-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.home-board-title { margin: 0; font-size: 13px; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-board-sub { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-board-count { flex: 0 0 auto; min-width: 22px; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--bg-surface); border: 1px solid var(--border-subtle); font-size: 11px; font-weight: 700; text-align: center; color: var(--text-secondary); }
.home-board-cards { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; padding-right: 2px; }
.home-board .home-task-card { padding: 8px 10px; }
.home-board .home-task-title { font-size: 13px; }
.home-board .home-task-meta { font-size: 11px; gap: 4px 8px; }
.home-board .home-task-id { font-size: 11px; }
.home-title-wrap { display: flex; flex-direction: column; gap: 6px; }
.home-quick-titles { display: flex; flex-wrap: wrap; gap: 6px; }
.home-quick-titles[hidden] { display: none; }
.home-quick-btn { padding: 4px 9px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--bg-surface); color: var(--text-secondary); font-size: 12px; }
.home-quick-btn:hover { border-color: var(--primary); color: var(--primary); }
.home-quick-btn.is-active { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); font-weight: 600; }
.home-link-required { display: flex; flex-direction: column; gap: 10px; max-width: 620px; }
.home-link-required .section-title { margin: 0; }
.home-link-required .muted { margin: 0; }
.home-link-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 720px) {
  .home-board-col { flex-basis: 250px; }
}

/* --- Compact Telegram bot settings v2 --- */
.bot-page { display: flex; flex-direction: column; gap: 8px; }
.bot-page .card { margin: 0; }
.bot-page .pane-pad { padding: 12px 14px; }
.bot-head { align-items: flex-start; justify-content: space-between; gap: 12px; }
.bot-head-text h1 { margin: 0 0 2px; }
.bot-head-text p { margin: 0; color: var(--text-muted); }
.bot-help { position: relative; flex: 0 0 auto; }
.bot-help summary { list-style: none; }
.bot-help summary::-webkit-details-marker { display: none; }
.bot-help-btn { width: 28px; height: 28px; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--bg-surface); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; font-weight: 700; cursor: pointer; user-select: none; }
.bot-help-btn:hover { border-color: var(--primary); color: var(--primary); }
.bot-help-pop { position: absolute; right: 0; top: 36px; z-index: 20; width: min(360px, calc(100vw - 40px)); padding: 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14); }
.bot-help-pop .section-title { margin: 0 0 6px; }
.bot-help-note { margin: 8px 0 0; }
.bot-params summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bot-params summary::-webkit-details-marker { display: none; }
.bot-params-summary .section-title { margin: 0; }
.bot-params-body { padding-top: 10px; }
.bot-form { display: flex; flex-direction: column; gap: 8px; }
.bot-field { display: flex; flex-direction: column; gap: 4px; }
.bot-field-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.bot-field-hint { font-size: 11px; color: var(--text-muted); }
.bot-input { width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-primary); }
.bot-input:focus { outline: 2px solid var(--border-focus); outline-offset: 1px; }
.bot-input:disabled { background: var(--bg-subtle); color: var(--text-muted); }
.bot-secret-line { display: flex; align-items: center; gap: 8px; }
.bot-secret-line .bot-input { flex: 1 1 auto; min-width: 0; }
.bot-secret-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bot-mini { padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.bot-stars { letter-spacing: 2px; font-weight: 700; }
.bot-timeout { max-width: 120px; }
.bot-form-actions { display: flex; justify-content: flex-start; padding-top: 2px; }
.bot-form-error { margin: 0; }
.bot-status-card { display: flex; flex-direction: column; gap: 8px; }
.bot-status-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bot-status-title { display: flex; flex-direction: column; gap: 2px; }
.bot-status-title .section-title { margin: 0; }
.bot-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.bot-switch-label { font-size: 13px; font-weight: 600; }
.bot-switch-control { display: flex; align-items: center; gap: 8px; }
.bot-switch { width: 42px; height: 24px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg-muted); display: flex; align-items: center; transition: background 0.16s ease, border-color 0.16s ease; }
.bot-switch-knob { width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28); transform: translateX(0); transition: transform 0.16s ease; }
.bot-switch.is-on { background: var(--success); border-color: var(--success); }
.bot-switch.is-on .bot-switch-knob { transform: translateX(18px); }
.bot-switch:disabled { opacity: 0.55; cursor: not-allowed; }
.bot-switch-state { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.bot-switch-state.is-on { color: var(--success); }
.bot-status-meta { display: flex; flex-direction: column; gap: 2px; }
.bot-ok { color: var(--success); }
.bot-status-empty { margin: 0; }
.bot-status-actions { display: flex; justify-content: flex-start; }
.bot-notice { margin: 0; }
.bot-loading { display: flex; flex-direction: column; gap: 8px; }
.bot-skeleton { height: 40px; border-radius: var(--radius-md); background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--bg-muted) 37%, var(--bg-subtle) 63%); background-size: 400% 100%; animation: bot-shimmer 1.4s ease infinite; }
.bot-skeleton.short { height: 26px; width: 52%; }
@media (max-width: 640px) {
  .bot-secret-line { flex-direction: column; align-items: stretch; }
  .bot-secret-actions { justify-content: flex-end; }
  .bot-head { flex-direction: column; }
  .bot-help { align-self: flex-end; }
}

/* --- Task filters, cards and detail --- */
.home-select-row { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.home-select-label { color: var(--text-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.home-select {
  min-height: 30px;
  padding: 4px 26px 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  max-width: 100%;
}
.home-select:hover { border-color: var(--primary); }
.home-select:focus { border-color: var(--border-focus); outline: none; box-shadow: 0 0 0 3px var(--primary-tint); }

.home-task-preview {
  margin: 0;
  padding: 4px 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.home-task-card[role="button"] { cursor: pointer; text-align: left; transition: border-color 0.12s ease, box-shadow 0.12s ease; }
.home-task-card[role="button"]:hover { border-color: var(--border-strong); }
.home-task-card[role="button"]:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

.home-task-detail { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.home-task-detail-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.home-task-detail-notice { margin: 0; }
.home-task-detail-status:empty { display: none; }
.home-task-detail-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-subtle);
}
.home-task-detail-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.home-task-detail-title { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.home-task-detail-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-muted); font-size: 12px; }
.home-task-detail-assignees { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--text-secondary); font-size: 12px; }
.home-task-detail-label { color: var(--text-muted); font-weight: 600; }
.home-task-detail-assignee {
  padding: 1px 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
}
.home-task-detail-section { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.home-task-detail-section-title { margin: 0; font-size: 13px; }
.home-task-detail-section > p { margin: 0; }
.home-task-detail-description-wrap { display: flex; flex-direction: column; gap: 6px; }
.home-task-detail-description { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.45; }
textarea.home-task-description-edit { min-height: 96px; }
.home-task-detail-edit { display: flex; flex-direction: column; gap: 8px; }

.home-task-attachments { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
.home-task-attachment {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
}
.home-task-attachment--image { flex-direction: column; align-items: flex-start; padding: 4px; }
.home-task-attachment-thumb {
  display: block;
  max-width: min(220px, 100%);
  max-height: 160px;
  border-radius: 6px;
  object-fit: cover;
  cursor: zoom-in;
}
.home-task-attachment-link { color: var(--primary); font-weight: 600; text-decoration: none; }
.home-task-attachment-link:hover { text-decoration: underline; }
.home-task-attachment-name { overflow-wrap: anywhere; }
.home-task-attachment-caption { margin: 0; color: var(--text-muted); font-size: 12px; }
.home-task-attachment-text {
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-subtle);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.home-task-attachment-missing { display: inline-block; }

.home-task-chat-thread {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding: 2px;
}
.home-task-chat-empty { margin: 0; }
.home-task-chat-bubble {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface);
}
.home-task-chat-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.home-task-chat-author { color: var(--text-secondary); font-size: 12px; }
.home-task-chat-when { font-size: 11px; }
.home-task-chat-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.4; }
.home-task-chat-attachments { margin-top: 2px; }
.home-task-chat-compose-wrap { display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.home-task-chat-compose { display: flex; flex-direction: column; gap: 6px; }
.home-task-chat-input { min-height: 64px; }
.home-task-chat-compose-actions { display: flex; justify-content: flex-end; gap: 6px; }

.home-assignee-block { display: flex; flex-direction: column; gap: 6px; }
.home-assignee-rows { display: flex; flex-direction: column; gap: 6px; }
.home-assignee-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.home-assignee-row .ig-styled-select { flex: 1 1 0; width: auto !important; min-width: 0 !important; }
.home-assignee-row .ig-styled-select-btn { overflow: hidden; text-overflow: ellipsis; }
.home-assignee-remove { flex: 0 0 auto; padding: 5px 9px; font-size: 12px; white-space: nowrap; }
.home-assignee-add { align-self: flex-start; padding: 5px 9px; font-size: 12px; }

.home-due { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.home-due-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.home-due-input { flex: 0 0 auto; width: auto; min-width: 150px; }

.home-upload { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.home-upload-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.home-upload-input { min-height: 38px; padding: 6px 8px; }
.home-upload-input::file-selector-button {
  margin-right: 8px;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.home-upload-caption { min-height: 34px; }
.home-upload-status { margin: 0; }
.home-upload-status:empty { display: none; }

.home-quick-sub { padding: 6px; border: 1px dashed var(--border-strong); border-radius: 8px; background: var(--bg-subtle); }
.home-quick-sub-btn { border-style: dashed; }
.home-quick-sub-back { border-color: var(--border-strong); background: var(--bg-surface); color: var(--text-secondary); font-weight: 600; }
.home-quick-sub-back:hover { border-color: var(--primary); color: var(--primary); }

.home-modal-body { min-height: 0; }

@media (max-width: 720px) {
  .home-task-detail-head { padding: 8px; }
  .home-task-chat-thread { max-height: none; }
  .home-task-attachment--image { width: 100%; }
  .home-assignee-row { align-items: stretch; flex-wrap: wrap; }
  .home-assignee-row .ig-styled-select { width: 100% !important; }
  .home-assignee-remove { align-self: flex-end; }
  .home-upload-row { align-items: stretch; flex-direction: column; }
  .home-due-input { width: 100%; min-width: 0; }
  .home-task-detail-toolbar { flex-wrap: wrap; }
}

/* --- Appointments: sub-tabs, board and detail --- */
.home-subtabs {
  display: flex;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
  overflow-x: auto;
}
.home-subtab {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.home-subtab:hover { background: var(--bg-subtle); color: var(--text-primary); }
.home-subtab.is-active { background: var(--primary-tint); color: var(--primary); }
.home-subtab:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 1px; }

.home-board--appointments { min-height: 180px; }
.home-appt-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.home-appt-card:hover { border-color: var(--border-strong); }
.home-appt-card:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.home-appt-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 6px; }
.home-appt-name { font-size: 13px; overflow-wrap: anywhere; }
.home-appt-preview {
  margin: 0;
  padding: 3px 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.home-appt-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 8px;
  color: var(--text-muted);
  font-size: 11px;
}
.home-appt-when { font-variant-numeric: tabular-nums; color: var(--text-secondary); font-weight: 600; }
.home-appt-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.home-appt-feedback-badge {
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
}
.home-rating { color: var(--warning-amber); font-size: 12px; font-weight: 700; letter-spacing: 1px; }
.home-appt-id { align-self: flex-end; font-size: 11px; }

.home-success-crm {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}
.home-success-crm .btn { padding: 5px 10px; font-size: 12px; }

.home-appt-detail { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.home-appt-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.home-appt-notice { margin: 0; }
.home-appt-status:empty { display: none; }
.home-appt-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-subtle);
}
.home-appt-summary-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.home-appt-summary-title { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.home-appt-summary-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-muted); font-size: 12px; }
.home-appt-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 2px; }

.home-appt-section { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.home-appt-section-title { margin: 0; font-size: 13px; }
.home-appt-section > p { margin: 0; }
.home-appt-rows { display: flex; flex-direction: column; gap: 4px; }
.home-appt-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.home-appt-row-label { flex: 0 0 auto; }
.home-appt-row-value { min-width: 0; font-size: 13px; text-align: right; overflow-wrap: anywhere; }
.home-appt-telegram-state { font-weight: 600; color: var(--success); }
.home-appt-feedback-rating { margin: 0; font-size: 15px; }
.home-appt-feedback-comment {
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-subtle);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .home-subtabs { width: 100%; }
  .home-appt-toolbar { flex-wrap: wrap; }
  .home-appt-row { flex-direction: column; gap: 1px; }
  .home-appt-row-value { text-align: left; }
}


/* --- Board viewport parity with pipeline + home filters --- */
.workspace:has(.home-page--board) {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  padding-bottom: 12px;
  box-sizing: border-box;
}
.home-page--board {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.home-page--board .home-body {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.home-page--board .home-toolbar,
.home-page--board .home-subtabs,
.home-page--board .tabs {
  flex: 0 0 auto;
}
.home-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  overflow: visible;
  min-height: 34px;
}
.home-toolbar .home-select-row { flex: 0 0 auto; }
.home-toolbar .btn { flex: 0 0 auto; }
.home-select-row { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.home-select-row .home-select-label { font-size: 12px; color: var(--text-muted); }
.home-select-row .ig-styled-select { flex: 0 0 auto; }
.home-board-host {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}
.home-board {
  flex: 1 1 0;
  height: 100%;
  min-height: 0;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 0;
}
.home-board-col {
  flex: 0 0 280px;
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  height: 100%;
  max-height: none;
  background: #e9eef5;
  border: 1px solid #d8e0ea;
  border-radius: 14px;
  overflow: hidden;
}
.home-board-head {
  flex: 0 0 auto;
  padding: 10px 10px 7px;
}
.home-board-cards {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 7px 9px;
}
.home-board-count { background: #e2e8f0; color: #334155; border-color: transparent; }
.home-form-cell[hidden] { display: none !important; }

/* Appointment board: narrower columns like pipeline */
.home-appointments-board .home-board-col {
  flex-basis: 260px;
  width: 260px;
  min-width: 260px;
  max-width: 260px;
}
.home-appt-card { cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
.home-appt-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.home-appt-card-name { font-weight: 600; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-appt-card-when { flex: 0 0 auto; font-size: 11px; color: #64748b; white-space: nowrap; }
.home-appt-card-service { font-size: 11px; color: #475569; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.home-appt-card-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.home-capsule { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; }
.home-capsule-partner { background: #dbeafe; color: #1d4ed8; }
.home-capsule-onsite { background: #dcfce7; color: #15803d; }
.home-capsule-offsite { background: #ffedd5; color: #c2410c; }
.home-capsule-rating { background: #fef3c7; color: #b45309; }

/* Task detail: two-column pipeline-style dialog */
.home-task-modal { width: min(1440px, 98vw); height: min(920px, 94vh); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.home-task-modal .home-modal-head { flex: 0 0 auto; }
.home-task-modal .home-modal-body { min-height: 0; overflow: hidden; padding: 0; display: flex; flex-direction: column; flex: 1 1 0; }
.home-task-detail { flex: 1 1 0; height: auto; }
.home-task-detail { display: grid; grid-template-columns: 380px minmax(0, 1fr); height: 100%; min-height: 0; }
.home-task-detail-left { overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: #eef2f7; border-right: 1px solid #dbe3ec; }
.home-task-detail-right { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #fff; }
.home-task-detail-right .home-task-detail-section { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; padding: 0; }
.home-task-chat-panel .home-task-detail-section-title { padding: 12px 16px; border-bottom: 1px solid #e6ebf2; margin: 0; }
.home-task-chat-thread { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 14px 16px; background: #f8fafc; display: flex; flex-direction: column; gap: 8px; }
.home-task-chat-compose-wrap { flex: 0 0 auto; border-top: 1px solid #e6ebf2; padding: 10px 16px 12px; background: #fff; }
.home-task-chat-compose { display: flex; flex-direction: column; gap: 6px; }
.home-task-chat-compose-actions { display: flex; justify-content: flex-end; }
.home-task-chat-input { min-height: 44px; resize: vertical; }
.home-task-detail-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.home-task-detail-toolbar .notice { margin: 0; }
.home-task-detail-head, .home-task-detail-section { margin: 0; }
.home-task-detail-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.home-appt-detail { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 18px; overflow-y: auto; max-height: calc(94vh - 62px); }
.home-appointment-modal { width: min(760px, 96vw); max-height: 94vh; display: flex; flex-direction: column; overflow: hidden; }
.home-appointment-modal .home-modal-body { overflow-y: auto; min-height: 0; padding: 0; }
.home-appt-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.home-appt-summary { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid #e6ebf2; border-radius: 12px; background: #fff; }
.home-appt-summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.home-appt-summary-title { margin: 0; font-size: 18px; }
.home-appt-summary-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: #475569; font-size: 13px; }
.home-appt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.home-appt-section { padding: 12px; border: 1px solid #e6ebf2; border-radius: 12px; background: #fff; }
.home-appt-section-title { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.home-appt-rows { display: flex; flex-direction: column; gap: 6px; }
.home-appt-info-row { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; }
.home-appt-info-label { color: #64748b; flex: 0 0 auto; }
.home-appt-info-value { text-align: right; overflow-wrap: anywhere; }
.home-rating { font-size: 16px; font-weight: 700; color: #b45309; }
.home-appt-feedback-comment { margin: 0; white-space: pre-wrap; }
@media (max-width: 980px) {
  .home-task-modal { width: 98vw; height: 94vh; }
  .home-task-detail { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .home-task-detail-left { max-height: 42%; border-right: 0; border-bottom: 1px solid #dbe3ec; }
}


/* --- Appointment form: dynamic articles, visibility hints --- */
.home-article-section { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.home-article-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.home-article-rows { display: flex; flex-direction: column; gap: 6px; }
.home-article-row { display: grid; grid-template-columns: minmax(160px, 220px) 170px 28px; gap: 6px; align-items: center; justify-content: start; }
.home-article-actions { display: flex; justify-content: flex-start; }
.home-article-remove { width: 28px; height: 32px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-muted); font-size: 18px; line-height: 1; }
.home-article-remove:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); }
.home-article-remove:disabled { opacity: .35; cursor: default; }
.home-article-add { align-self: flex-start; padding: 5px 10px; font-size: 12px; }
.home-form-cell--wide .home-article-section { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .home-article-row { grid-template-columns: minmax(140px, 1fr) 120px 28px; }
}

/* Task detail: highlighted summary + pipeline-style chat */
.home-task-detail-head {
  background: linear-gradient(135deg, #e6f0ff 0%, #f4f8ff 60%, #eef5ff 100%);
  border: 1px solid #bfd4f2;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.10), inset 4px 0 0 #3b82f6;
  border-radius: 12px;
  padding: 12px 14px;
}
.home-task-detail-left { background: #e8eef6; }
.home-task-detail-left .home-task-detail-section {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #d7e1ed;
  border-radius: 12px;
}
.home-task-detail-left .home-task-detail-section-title { color: #334155; font-weight: 700; }
.home-task-description-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}
.home-task-attach-btn { white-space: nowrap; }
.home-task-attach-btn svg { width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; }

.home-task-chat-thread {
  background: #f6f9fc;
  gap: 8px;
  padding: 16px;
  max-height: none;
}
.home-task-chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  min-width: 0;
  flex: 0 0 auto;
}
.home-task-chat-msg--in { align-self: flex-start; }
.home-task-chat-msg--out { align-self: flex-end; align-items: flex-end; }
.home-task-chat-msg .ig-chat-bubble {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.home-task-chat-msg .home-task-chat-bubble {
  display: block;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.home-task-chat-msg .home-task-chat-text { font-size: 14px; }
.home-task-chat-bubble .home-task-chat-attachments { margin-top: 6px; }
.home-task-chat-bubble .home-task-attachment {
  background: rgba(255, 255, 255, 0.8);
}
.home-task-chat-empty { padding: 28px 10px; text-align: center; }

.home-task-chat-compose-wrap {
  padding: 10px 16px 12px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
.home-task-chat-compose { display: flex; flex-direction: column; gap: 8px; }
.home-task-chat-compose-row { display: flex; align-items: flex-end; gap: 8px; }
.home-task-chat-compose-input-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
}
.home-task-chat-compose-input-wrap .home-task-chat-input {
  width: 100%;
  flex: 1 1 auto;
  min-height: 44px;
  max-height: 140px;
  padding: 10px 46px 10px 12px;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  resize: none;
  line-height: 1.4;
}
.home-task-chat-compose-input-wrap .home-task-chat-input:focus {
  outline: 2px solid rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
}
.home-task-chat-attach-btn {
  position: absolute;
  right: 8px;
  bottom: 7px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}
.home-task-chat-attach-btn svg { width: 20px; height: 20px; display: block; }
.home-task-chat-attach-btn:hover { background: #eef2f7; color: #334155; }
.home-task-chat-send { align-self: flex-end; white-space: nowrap; }
.home-task-compose-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.home-task-compose-files[hidden] { display: none; }
.home-task-compose-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 6px 4px 9px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
}
.home-task-compose-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-task-compose-file-remove {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(55, 48, 163, 0.12);
  color: #3730a3;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.home-task-compose-file-remove:hover { background: rgba(55, 48, 163, 0.22); }

/* Assign-task modal: contrast sections and a single-row due selector */
.home-modal.home-assign-modal {
  width: min(780px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home-assign-modal .home-modal-body { min-height: 0; overflow-y: auto; padding-right: 2px; }
.home-assign-form { gap: 12px; }
.home-assign-form .home-form-cell {
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.home-assign-form .home-form-cell:nth-child(2n) { background: #f1f5f9; }
.home-assign-form .home-form-cell:nth-child(3n) { background: #f5f8ff; }
.home-assign-form .home-field-label {
  color: #1e293b;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.home-assign-form .home-input,
.home-assign-form .home-textarea {
  background: #fff;
}
.home-assign-form .home-due {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  background: #eef2ff;
}
.home-assign-form .home-due-quick {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  flex: 0 0 auto;
}
.home-assign-form .home-due-btn { background: #fff; }
.home-assign-form .home-due-btn.is-active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}
.home-assign-form .home-due-input {
  flex: 1 1 140px;
  width: auto;
  min-width: 0;
  background: #fff;
}
.home-description-field { display: flex; flex-direction: column; gap: 8px; }
.home-description-field-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.home-description-field-actions .home-hint { margin: 0; }
.home-assign-form .home-form-actions {
  position: sticky;
  bottom: 0;
  padding: 10px 0 2px;
  background: linear-gradient(180deg, rgba(255,255,255,0), #fff 30%);
}
@media (max-width: 520px) {
  .home-assign-form .home-due { flex-wrap: wrap; }
  .home-assign-form .home-due-quick { flex-wrap: wrap; }
  .home-task-chat-msg { max-width: 92%; }
}

.home-shift-btn { white-space: nowrap; }
.home-shift-btn[hidden],
.home-shift-note[hidden] { display: none; }
.home-shift-note {
  align-self: center;
  max-width: 280px;
  color: var(--text-secondary);
}
.home-shift-note.error { color: var(--danger); }
.home-task-carried {
  color: #b45309;
  font-weight: 600;
  font-size: 12px;
}
.home-task-delete { white-space: nowrap; }

/* Unified dark modal headers like the sales funnel */
.home-modal {
  padding: 0;
  gap: 0;
  overflow: hidden;
}
.home-modal.home-assign-modal { gap: 0; }
.home-modal .home-modal-head {
  padding: 13px 16px;
  background: #1f2530;
  border-bottom: 1px solid #111827;
  color: #fff;
  border-radius: 12px 12px 0 0;
}
.home-modal .home-modal-title { color: #fff; font-size: 17px; }
.home-modal .home-modal-close {
  border: 0;
  background: transparent;
  color: #e5e7eb;
  font-size: 24px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.home-modal .home-modal-close:hover { background: rgba(255,255,255,.12); color: #fff; }
.home-modal .home-modal-body {
  padding: 16px;
  overflow-y: auto;
  min-height: 0;
}
.home-task-modal .home-modal-body,
.home-appointment-modal .home-modal-body { padding: 0; }

.home-confirm-backdrop { z-index: 1400; }
.home-confirm-modal { width: min(460px, 100%); }
.home-confirm-text { margin: 0; line-height: 1.5; }
.chat-notice { display: flex; flex-direction: column; gap: 10px; }
.chat-notice-message { margin: 0; line-height: 1.5; }
.chat-notice-warning .chat-notice-message { color: #b45309; }
.chat-notice-danger .chat-notice-message { color: var(--danger); }
.chat-notice-details {
  margin: 0;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 180px;
  overflow-y: auto;
}
.home-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px 16px;
}

.home-task-detail-left {
  border-radius: 14px;
  border: 1px solid #dbe3ec;
}
.home-task-detail-left .home-task-detail-section { border-radius: 10px; }

/* Appointment cards: equal capsule size, one per line */
.home-appt-card-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}
.home-appt-card-badges .badge,
.home-appt-card-badges .home-capsule {
  font-size: 12px;
  line-height: 1.25;
  padding: 2px 9px;
  max-width: 100%;
  white-space: normal;
}

/* Telegram invite blocks */
.home-invite-block { display: flex; flex-direction: column; gap: 8px; }
.home-invite-label { margin: 0; font-weight: 600; }
.home-invite-link { color: var(--primary); word-break: break-all; }
.home-invite-text {
  margin: 0;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  max-height: 240px;
  overflow: auto;
}
.home-invite-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Partner tabs and tile grid */
.home-section-head .section-title { margin-bottom: 2px; }
.home-partner-add { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.home-partners-toolbar { align-items: center; }
.home-partner-search { flex: 1 1 360px; max-width: 520px; }
.home-partner-grid-host { min-width: 0; }
.home-partner-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.home-partner-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px;
  min-height: 120px;
  cursor: pointer;
  text-align: left;
}
.home-partner-tile:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(37, 99, 235, .12); }
.home-partner-tile-name { font-size: 14px; line-height: 1.25; }
.home-partner-tile-rating { color: #b45309; font-size: 12px; font-weight: 600; }
.home-partner-tile-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-partner-detail { display: flex; flex-direction: column; gap: 12px; }
.home-partner-review { display: flex; flex-direction: column; gap: 2px; padding: 7px 0; border-bottom: 1px solid #eef2f7; }
.home-partner-review:last-child { border-bottom: 0; }
.home-partner-review p { margin: 0; color: var(--text-secondary); font-size: 13px; }
.home-partner-history-row {
  display: grid;
  grid-template-columns: 150px minmax(120px, 1fr) minmax(120px, 1.2fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 8px 6px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.home-partner-history-row:hover { background: #f8fafc; }
.home-partner-history-when { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.home-partner-history-service { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-partner-history-status { color: var(--text-secondary); font-size: 12px; }

@media (max-width: 1180px) {
  .home-partner-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .home-partner-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .home-partner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-partner-history-row { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 480px) {
  .home-partner-grid { grid-template-columns: 1fr; }
}

/* Field labels keep normal capitalization inside the assign modal */
.home-assign-form .home-field-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}

/* Due date controls must stay on a single line */
.home-assign-form .home-due {
  display: grid;
  grid-template-columns: max-content 168px;
  align-items: center;
  justify-content: start;
  flex-wrap: nowrap;
  gap: 8px;
}
.home-assign-form .home-due-quick {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 6px;
}
.home-assign-form .home-due-input {
  width: 168px;
  min-width: 168px;
  height: 36px;
  box-sizing: border-box;
  flex: 0 0 auto;
}
.home-assign-form .home-due-btn {
  height: 36px;
  min-height: 36px;
  box-sizing: border-box;
}
@media (max-width: 520px) {
  .home-assign-form .home-due { grid-template-columns: max-content 150px; }
  .home-assign-form .home-due-input { width: 150px; min-width: 150px; }
}

/* Vertically stacked form fields */
.home-form-stack { display: flex; flex-direction: column; gap: 10px; }

/* Close button icon and hover stay centered */
.home-modal .home-modal-close,
.ig-client-modal-close,
.pipeline-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0;
  line-height: 1;
}
.home-modal .home-modal-close::before,
.ig-client-modal-close::before,
.pipeline-close::before {
  content: "";
  width: 14px;
  height: 14px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 6l12 12M18 6L6 18' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>") center / 14px 14px no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 6l12 12M18 6L6 18' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>") center / 14px 14px no-repeat;
}
.home-assignee-add {
  font-size: 0;
}
.home-assignee-add::before {
  content: "";
  width: 13px;
  height: 13px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 5v14M5 12h14' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>") center / 13px 13px no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 5v14M5 12h14' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/></svg>") center / 13px 13px no-repeat;
}

/* The task modal already has rounded outer corners */
.home-task-detail-left {
  border-radius: 0;
  border: 0;
  border-right: 1px solid #dbe3ec;
}

/* Add/transfer assignee controls */
.home-task-detail-assignees { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.home-assignee-add {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.home-assignee-add:hover { background: var(--primary-tint); }
.home-assignee-add:disabled { opacity: .5; cursor: default; }
.home-task-transfer { margin-left: 4px; }
.home-assignee-add-row { align-self: flex-start; }

.home-picker-modal { width: min(520px, 100%); }
.home-employee-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 50vh;
  overflow-y: auto;
}
.home-employee-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.home-employee-pick:hover { border-color: var(--primary); background: var(--primary-tint); }

/* Pending file previews */
.home-queued-file {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
  padding: 5px 7px;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  background: #eef2ff;
}
.home-queued-thumb {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  object-fit: cover;
  flex: 0 0 auto;
  background: #fff;
  cursor: zoom-in;
}
.home-queued-icon {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex: 0 0 auto;
}
.home-queued-info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.home-queued-name {
  font-size: 12px;
  font-weight: 600;
  color: #3730a3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-queued-size { font-size: 11px; color: #6366f1; }
.home-queued-remove {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(55, 48, 163, .12);
  color: #3730a3;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

/* Access section: compact coloured group cards */
.staff-matrix { gap: 12px; }
.staff-matrix-group {
  gap: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: visible;
}
.staff-matrix-title {
  margin: 0;
  padding: 8px 12px;
  background: #eef2f7;
  color: #1e293b;
  font-size: 13px;
  font-weight: 700;
  border-radius: 11px 11px 0 0;
}
.staff-matrix-row:last-child { border-radius: 0 0 11px 11px; }
.staff-matrix-group:nth-child(4n + 1) .staff-matrix-title { background: #eaf1ff; color: #1d4ed8; }
.staff-matrix-group:nth-child(4n + 2) .staff-matrix-title { background: #e9f8f0; color: #047857; }
.staff-matrix-group:nth-child(4n + 3) .staff-matrix-title { background: #fff4e5; color: #b45309; }
.staff-matrix-group:nth-child(4n + 4) .staff-matrix-title { background: #f3edff; color: #6d28d9; }
.staff-matrix-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid #eef2f7;
}
.staff-matrix-row:last-child { border-bottom: 0; }
.staff-matrix-label { flex: 0 1 auto; font-size: 13px; line-height: 1.3; }
.staff-matrix-state-group {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}
.staff-matrix-option {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.staff-matrix-option:hover { background: #e2e8f0; color: #334155; }
.staff-matrix-option.is-granted.is-active {
  background: var(--success-tint);
  color: var(--success);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, .22);
}
.staff-matrix-option.is-denied.is-active {
  background: var(--danger-tint);
  color: var(--danger);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, .22);
}
.staff-matrix-option.is-inherited.is-active {
  background: #e2e8f0;
  color: #334155;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, .30);
}
.staff-matrix-option:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
@media (max-width: 640px) {
  .staff-matrix-row { flex-wrap: wrap; }
}

/* Same interactive hover for task and appointment cards */
.home-task-card,
.home-appt-card,
.home-partner-tile {
  transition: border-color .15s ease, outline-color .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
.home-task-card:hover,
.home-appt-card:hover,
.home-partner-tile:hover {
  border-color: var(--primary);
  outline: 1px solid var(--primary);
  outline-offset: -1px;
  box-shadow: 0 3px 10px rgba(37, 99, 235, .10);
}

/* Unified client card modal (pipeline + home) */
.ig-client-modal {
  width: min(1040px, 96vw);
  height: min(82vh, 820px);
  max-height: 82vh;
  padding: 0;
  gap: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
}
.ig-client-modal form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.ig-client-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  background: #1f2530;
  border-bottom: 1px solid #111827;
  flex: 0 0 auto;
}
.ig-client-modal-title {
  margin: 0 !important;
  color: #fff;
  font-size: 17px;
}
.ig-client-modal-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
}
.ig-client-modal-close:hover { background: rgba(255,255,255,.12); color: #fff; }
.ig-client-modal-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1 1 auto;
  padding: 14px 16px 8px;
}
.ig-client-modal-tabs {
  margin: 0;
  flex: 0 0 auto;
}
.ig-client-modal-panes {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}
.ig-client-modal-actions {
  margin: 0;
  padding: 0 16px 14px;
  justify-content: flex-end;
  flex: 0 0 auto;
}
.ig-client-modal .clients-services { min-height: 0; }

/* Subsection tabs match the main tabs in size and height */
.home-subtab {
  min-height: 34px;
  padding: 0 13px;
  font-size: 14px;
  border-radius: 8px;
}
.ig-chat-bubble.is-sending { opacity: .65; }
.ig-chat-bubble.is-failed { border-color: #dc2626; }
.ig-chat-deleted { font-style: italic; }
.clients-list-match {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #2563eb;
  font-size: 12px;
  cursor: pointer;
}
.clients-list-match:hover,
.clients-list-match:focus-visible { text-decoration: underline; outline: none; }
.pipeline-delete-msg-btn, .pipeline-start-deal-btn {
  opacity: 0;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #2563eb;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.pipeline-start-deal-btn { color: #2563eb; }
.pipeline-delete-msg-btn { color: #b91c1c; }
.pipeline-delete-msg-btn.is-unavailable { color: #94a3b8; }
.pipeline-reopen-hint {
  margin: 0 0 10px;
  padding: 9px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
  line-height: 1.4;
}
.pipeline-delete-msg-btn svg,
.pipeline-start-deal-btn svg { width: 16px; height: 16px; display: block; }
.pipeline-delete-msg-btn:hover { background: #fee2e2; }
.pipeline-delete-msg-btn.is-unavailable:hover { background: #f1f5f9; }
.pipeline-start-deal-btn:hover { background: #dbeafe; }
.pipeline-msg:hover .pipeline-delete-msg-btn,
.pipeline-msg:hover .pipeline-start-deal-btn,
.pipeline-delete-msg-btn:focus-visible,
.pipeline-start-deal-btn:focus-visible { opacity: 1; }
.pipeline-board-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.pipeline-board-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.pipeline-board-tab:hover { background: #f1f5f9; color: #0f172a; }
.pipeline-board-tab.is-current {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.pipeline-board-tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
}

.pipeline-work-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: min(520px, 100%);
}
.pipeline-work-hint {
  flex-basis: 100%;
  font-size: 11px;
  line-height: 1.35;
  color: #64748b;
  min-width: 0;
  overflow-wrap: anywhere;
}
.pipeline-work-hint a {
  color: #2563eb;
  text-decoration: underline;
}
.pipeline-work-status {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}
.pipeline-work-status.is-online { color: #15803d; }
.pipeline-work-status.is-break { color: #b45309; }
.pipeline-take-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  background: #eff6ff;
}
.pipeline-take-text {
  font-size: 12px;
  line-height: 1.35;
  color: #1e3a8a;
}
.pipeline-take-btn { flex: 0 0 auto; }

.pipeline-joint-stats { display: flex; flex-direction: column; gap: 6px; }
.pipeline-joint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}
.pipeline-joint-row:last-child { border-bottom: 0; }

.pipeline-handoff {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px 1px 4px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 600;
  line-height: 18px;
}
.pipeline-handoff-icon { display: inline-flex; }
.pipeline-handoff-icon svg { width: 13px; height: 13px; display: block; }

.pipeline-quick-reply-btn {
  right: 42px;
  color: #475569;
}
.quick-replies-modal {
  width: min(760px, 95vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.quick-replies-modal .home-modal-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.quick-replies-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.quick-replies-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
.quick-replies-form-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}
.quick-replies-input { width: 100%; }
.quick-replies-textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  box-sizing: border-box;
}
.quick-replies-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.quick-replies-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.quick-replies-list-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}
.quick-replies-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  min-height: 80px;
  padding-right: 2px;
}
.quick-reply-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
}
.quick-reply-main {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.quick-reply-main:hover .quick-reply-title { color: #1d4ed8; }
.quick-reply-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 2px;
}
.quick-reply-preview {
  font-size: 12px;
  line-height: 1.35;
  color: #64748b;
  white-space: pre-wrap;
  max-height: 36px;
  overflow: hidden;
}
.quick-reply-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}
.quick-reply-delete { color: #b91c1c; }

.pipeline-items-read {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px 0 8px;
}
.pipeline-items-read-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 88px;
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #eef2f7;
  font-size: 12px;
}
.pipeline-items-read-row.is-head {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.pipeline-items-read-row > * { min-width: 0; }
.pipeline-items-read-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pipeline-items-read-qty { text-align: right; white-space: nowrap; }
.pipeline-items-read-price { text-align: right; white-space: nowrap; }
.pipeline-items-read-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.pipeline-items-modal {
  width: min(1080px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.pipeline-items-modal-body {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.pipeline-items-modal-head,
.pipeline-items-modal-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.6fr) 70px 100px minmax(100px, 1fr) minmax(100px, 1fr) 28px;
  gap: 8px;
  align-items: center;
}
.pipeline-items-modal-head {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  padding-bottom: 2px;
}
.pipeline-items-modal-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pipeline-items-modal-row .pipeline-input {
  min-width: 0;
}
.pipeline-items-modal-row.is-needs-choice {
  outline: 1px solid #f59e0b;
  outline-offset: 2px;
  border-radius: 7px;
}
.pipeline-item-edit-field {
  position: relative;
  min-width: 0;
}
.pipeline-item-edit-field .pipeline-input {
  width: 100%;
  box-sizing: border-box;
}
.pipeline-item-edit-field .pipeline-catalog-input {
  padding-right: 24px;
}
.pipeline-field-edit-btn {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.pipeline-field-edit-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.pipeline-save-catalog-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 32px;
  padding: 0 12px;
  line-height: 1;
  align-self: center;
  white-space: nowrap;
}
.paste-1c-modal {
  width: min(760px, 95vw);
}
.paste-1c-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.paste-1c-input {
  width: 100%;
  min-height: 240px;
  box-sizing: border-box;
  resize: vertical;
  white-space: pre;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}
.paste-1c-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.pipeline-items-modal-name {
  position: relative;
  min-width: 0;
}
.pipeline-items-modal-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
}
.pipeline-items-modal-total {
  margin-left: auto;
  font-size: 12px;
  color: #475569;
}
.pipeline-item-suggest-host {
  position: relative;
  z-index: 2;
}
.pipeline-item-suggest-layer {
  position: fixed;
  z-index: 2147483002;
  display: none;
}
.pipeline-item-suggest {
  position: static;
  left: auto;
  right: auto;
  top: auto;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
  padding: 4px;
}
.pipeline-item-suggest-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 6px 7px;
  text-align: left;
  cursor: pointer;
}
.pipeline-item-suggest-row:hover {
  background: #eff6ff;
}
.pipeline-item-suggest-title {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}
.pipeline-item-suggest-meta {
  font-size: 11px;
  color: #64748b;
}
.pipeline-item-suggest-hint {
  padding: 5px 7px;
  color: #b45309;
  font-size: 11px;
}
.pipeline-item-suggest-empty {
  position: static;
  padding: 5px 7px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
}
.pipeline-item-edit-catalog {
  padding: 3px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.ig-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ig-direct-sync-status {
  max-width: 320px;
  text-align: right;
}
