#context-panel {
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#context-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
}

#context-panel header button {
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary);
  cursor: pointer;
}

#context-panel header button:hover {
  color: var(--text);
}

/* ── collapsed strip (TD-19) ── */
.app-main--context-collapsed #context-panel {
  padding: 8px 0;
  align-items: center;
  gap: 0;
  overflow: hidden;
}

.ctx-expand-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}

.ctx-expand-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ── empty-state when no chat is selected (TD-24) ── */
.context-panel__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  gap: 12px;
  color: var(--mid-coffee);
  text-align: center;
}

.context-panel__empty-icon {
  color: var(--light-coffee);
  opacity: 0.6;
}

.context-panel__empty-icon svg {
  width: 40px;
  height: 40px;
}

.context-panel__empty-text {
  font-size: 14px;
  line-height: 1.4;
  max-width: 200px;
}

.context-section-title {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.context-product-card {
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.context-product-card .image {
  width: 100%;
  height: 130px;
  background-color: var(--bg-hover);
  background-size: cover;
  background-position: center;
}

.context-product-card .info {
  padding: 10px 12px;
}

.context-product-card .title {
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.context-product-card .price {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-top: 6px;
}

.context-product-card .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-secondary);
}

.context-product-card .avito-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent-blue);
  font-size: 10px;
  text-decoration: none;
}

.context-skeleton {
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ── buyer history rows (этап 30.2) ── */
.ctx-history-row {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  align-items: flex-start;
}

.ctx-history-row:last-child {
  border-bottom: 0;
}

.ctx-history-row:hover {
  background: var(--bg-hover);
}

.ctx-history-row .thumb {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.ctx-history-row .info {
  flex: 1;
  min-width: 0;
}

.ctx-history-row .title {
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ctx-history-row .meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 10px;
  color: var(--text-secondary);
}

.ctx-history-row .meta .when {
  margin-left: auto;
  color: var(--text-muted);
  white-space: nowrap;
}

/* small account badge reused in history rows + account status */
.ctx-acct {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 3px;
  padding: 1px 5px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Color rotates by account_id % 6 (этап 36); data-account is decorative. */
.ctx-acct[data-account-color="0"] { background: var(--badge-color-0-bg); color: var(--badge-color-0-text); }
.ctx-acct[data-account-color="1"] { background: var(--badge-color-1-bg); color: var(--badge-color-1-text); }
.ctx-acct[data-account-color="2"] { background: var(--badge-color-2-bg); color: var(--badge-color-2-text); }
.ctx-acct[data-account-color="3"] { background: var(--badge-color-3-bg); color: var(--badge-color-3-text); }
.ctx-acct[data-account-color="4"] { background: var(--badge-color-4-bg); color: var(--badge-color-4-text); }
.ctx-acct[data-account-color="5"] { background: var(--badge-color-5-bg); color: var(--badge-color-5-text); }

/* ── account status (этап 30.2) ── */
.ctx-account-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
}

.ctx-account-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-left: auto;
}

.ctx-account-status .dot.ok { background: #16A34A; }
.ctx-account-status .dot.degraded { background: #B8923D; }
.ctx-account-status .dot.no_webhook { background: #9B9A97; }

.ctx-account-status .status-text {
  font-size: 11px;
  font-weight: 500;
}

.ctx-account-status .status-text.ok { color: #16A34A; }
.ctx-account-status .status-text.degraded { color: #B8923D; }
.ctx-account-status .status-text.no_webhook { color: #9B9A97; }
