/* ==========================================================================
   MTI Dev-Support — Embed Overrides
   Applied when chat is loaded inside an iframe (embed-chat.html)
   ========================================================================== */

/* Fill iframe container — no margin, no overflow on body */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--color-bg-primary);
}

/* App wrapper fills viewport */
.ds-embed-app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Embed Header ── */
.ds-embed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid rgba(45, 212, 191, 0.15);
  flex-shrink: 0;
  position: relative;
}

.ds-embed-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  opacity: 0.5;
}

.ds-embed-header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.ds-embed-header__icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.35);
}

.ds-embed-header__title {
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  letter-spacing: 0.03em;
}

.ds-embed-header__project {
  font-size: var(--text-xs);
  color: var(--color-accent);
  font-weight: var(--weight-semibold);
  padding: var(--space-1) var(--space-3);
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}

/* ── Embed Panels ── */
.ds-embed-panels {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ── Chat Panel (Left) ── */
.ds-embed-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid rgba(45, 212, 191, 0.1);
}

.ds-embed-chat__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.08), rgba(56, 189, 248, 0.08));
  flex-shrink: 0;
}

.ds-embed-chat__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(45, 212, 191, 0.35);
}

.ds-embed-chat__info { flex: 1; }

.ds-embed-chat__name {
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
}

.ds-embed-chat__status {
  font-size: var(--text-xs);
  color: var(--color-success);
  display: flex;
  align-items: center;
  gap: 4px;
}

.ds-embed-chat__status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 6px var(--color-success);
}

/* Messages */
.ds-embed-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ds-embed-msg {
  max-width: 85%;
  display: flex;
  gap: var(--space-2);
}

.ds-embed-msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ds-embed-msg--ai { align-self: flex-start; }
.ds-embed-msg--system { align-self: center; max-width: 90%; }

.ds-embed-msg__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.ds-embed-msg__bubble {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  word-break: break-word;
}

.ds-embed-msg--ai .ds-embed-msg__bubble {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  border-bottom-left-radius: 2px;
  border: 1px solid rgba(45, 212, 191, 0.08);
}

.ds-embed-msg--user .ds-embed-msg__bubble {
  background: var(--color-accent);
  color: var(--color-text-on-accent);
  border-bottom-right-radius: 2px;
  box-shadow: 0 0 8px rgba(45, 212, 191, 0.35);
}

.ds-embed-msg--system .ds-embed-msg__bubble {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  text-align: center;
  font-weight: var(--weight-semibold);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.ds-embed-msg__time {
  font-size: 10px;
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

/* Typing Indicator */
.ds-embed-typing {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  align-self: flex-start;
}

.ds-embed-typing__dots {
  display: flex;
  gap: 4px;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
}

.ds-embed-typing__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
  animation: ds-embed-typing-bounce 1.4s infinite;
}

.ds-embed-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.ds-embed-typing__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes ds-embed-typing-bounce {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* Input Area */
.ds-embed-input {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  flex-shrink: 0;
}

.ds-embed-input__attach {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg-primary);
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: all 0.2s;
}

.ds-embed-input__attach:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.ds-embed-input__textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-family: inherit;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: var(--leading-normal);
  max-height: 100px;
  outline: none;
  transition: border-color 0.2s;
}

.ds-embed-input__textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.35);
}

.ds-embed-input__textarea::placeholder {
  color: var(--color-text-tertiary);
}

.ds-embed-input__send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--color-accent);
  color: var(--color-text-on-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.35);
}

.ds-embed-input__send:hover {
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.6);
}

.ds-embed-input__send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  box-shadow: none;
}

/* Attachment Preview Strip */
.ds-embed-attach-preview {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
}

/* ── Preview Panel (Right) ── */
.ds-embed-preview {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-secondary);
}

.ds-embed-preview__header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.08), rgba(56, 189, 248, 0.08));
  flex-shrink: 0;
}

.ds-embed-preview__tabs {
  display: flex;
  gap: var(--space-1);
}

.ds-embed-preview__tab {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-tertiary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.ds-embed-preview__tab:hover {
  color: var(--color-text-secondary);
}

.ds-embed-preview__tab--active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.ds-embed-preview__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ds-embed-preview__body--hidden {
  display: none !important;
}

/* Draft Fields */
.ds-embed-draft {
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(45, 212, 191, 0.08);
  border-radius: var(--radius-sm);
  background: var(--color-bg-primary);
  transition: all 0.3s;
}

.ds-embed-draft--filled {
  border-color: rgba(45, 212, 191, 0.2);
  box-shadow: 0 0 8px rgba(45, 212, 191, 0.05);
}

.ds-embed-draft__label {
  font-size: 10px;
  font-weight: var(--weight-semibold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.ds-embed-draft__value {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  word-break: break-word;
}

.ds-embed-draft--filled .ds-embed-draft__value {
  color: var(--color-text-primary);
}

/* Draft edit inputs */
.ds-embed-draft__input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-family: inherit;
  outline: none;
}

.ds-embed-draft__input:focus {
  border-color: var(--color-accent);
}

.ds-embed-draft__input--textarea {
  resize: vertical;
  min-height: 60px;
}

/* Progress */
.ds-embed-preview__footer {
  padding: var(--space-4);
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.ds-embed-progress {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.ds-embed-progress__bar {
  flex: 1;
  height: 4px;
  background: var(--color-bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.ds-embed-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), #38bdf8);
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0%;
  box-shadow: 0 0 6px rgba(45, 212, 191, 0.35);
}

.ds-embed-progress__text {
  font-size: 10px;
  color: var(--color-text-tertiary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── My Ticket Items ── */
.ds-embed-ticket-item {
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(45, 212, 191, 0.08);
  border-radius: var(--radius-sm);
  background: var(--color-bg-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.ds-embed-ticket-item:hover {
  border-color: rgba(45, 212, 191, 0.2);
  box-shadow: 0 0 8px rgba(45, 212, 191, 0.1);
}

.ds-embed-ticket-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-1);
}

.ds-embed-ticket-item__number {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-accent);
  font-weight: var(--weight-semibold);
}

.ds-embed-ticket-item__time {
  font-size: 10px;
  color: var(--color-text-tertiary);
}

.ds-embed-ticket-item__title {
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  font-weight: var(--weight-medium);
  display: block;
  margin-bottom: var(--space-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-embed-ticket-item__badges {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.ds-embed-ticket-item__badge {
  font-size: 10px;
  padding: 1px var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  font-weight: var(--weight-medium);
}

/* ── Ticket Detail Modal ── */
.ds-embed-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--space-4);
}

.ds-embed-modal-overlay--visible {
  display: flex;
}

.ds-embed-modal {
  background: var(--color-bg-elevated);
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(45, 212, 191, 0.15);
  position: relative;
}

.ds-embed-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), #38bdf8, transparent);
}

.ds-embed-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.ds-embed-modal__title {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  font-family: var(--font-mono);
}

.ds-embed-modal__close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}

.ds-embed-modal__close:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.ds-embed-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
}

/* Ticket Info in Modal */
.ds-embed-modal__status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.ds-embed-modal__badge {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  font-weight: var(--weight-semibold);
}

.ds-embed-modal__ticket-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.ds-embed-modal__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(45, 212, 191, 0.08);
}

.ds-embed-modal__meta-label {
  font-size: 10px;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 2px;
}

.ds-embed-modal__meta-value {
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  font-weight: var(--weight-medium);
}

.ds-embed-modal__section {
  margin-bottom: var(--space-4);
}

.ds-embed-modal__section-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
  display: block;
}

.ds-embed-modal__section-content {
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  line-height: var(--leading-relaxed);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Comments in Modal */
.ds-embed-modal__comments-header {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.ds-embed-modal__comments-count {
  font-size: var(--text-xs);
  background: var(--color-bg-tertiary);
  padding: 1px var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
}

.ds-embed-modal__comments-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: var(--space-3) 0;
  max-height: 200px;
  overflow-y: auto;
}

.ds-embed-modal__comments-empty {
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: var(--text-sm);
  padding: var(--space-4);
}

.ds-embed-modal__comment {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(45, 212, 191, 0.05);
}

.ds-embed-modal__comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.ds-embed-modal__comment-body { flex: 1; min-width: 0; }

.ds-embed-modal__comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-1);
}

.ds-embed-modal__comment-author {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

.ds-embed-modal__comment-time {
  font-size: 10px;
  color: var(--color-text-tertiary);
}

.ds-embed-modal__comment-content {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Comment Input */
.ds-embed-modal__comment-input {
  display: flex;
  gap: var(--space-2);
  align-items: flex-end;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.ds-embed-modal__comment-textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-family: inherit;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  outline: none;
  max-height: 80px;
}

.ds-embed-modal__comment-textarea:focus {
  border-color: var(--color-accent);
}

/* ── Empty States ── */
.ds-embed-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-4);
  text-align: center;
}

.ds-embed-empty__icon {
  font-size: 2rem;
  opacity: 0.5;
}

.ds-embed-empty__text {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

/* ── Loading Spinner ── */
.ds-embed-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-bg-tertiary);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: ds-embed-spin 0.6s linear infinite;
}

@keyframes ds-embed-spin {
  to { transform: rotate(360deg); }
}

/* ── Toast (minimal for embed) ── */
.ds-embed-toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ds-embed-toast {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
}

.ds-embed-toast--visible {
  transform: translateX(0);
  opacity: 1;
}

.ds-embed-toast--success { border-color: var(--color-success); }
.ds-embed-toast--error { border-color: var(--color-danger); }
.ds-embed-toast--warning { border-color: var(--color-warning); }

/* ── Mobile Preview Toggle ── */
.ds-embed-preview-toggle {
  display: none;
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--color-accent);
  color: var(--color-text-on-accent);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.4);
}

/* ── Futuristic scan lines ── */
.ds-embed-app::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(45, 212, 191, 0.02) 2px, rgba(45, 212, 191, 0.02) 4px);
  pointer-events: none;
  z-index: 999;
  opacity: 0.3;
}

/* ── Sessions Sidebar ── */
.ds-embed-sessions {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  overflow: hidden;
}

.ds-embed-sessions__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  min-height: 49px;
  flex-shrink: 0;
}

.ds-embed-sessions__header span {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
  letter-spacing: 0.02em;
}

.ds-embed-sessions__new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ds-embed-sessions__new-btn:hover {
  background: rgba(45, 212, 191, 0.1);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.ds-embed-sessions__list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.ds-embed-session-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  border-left: 2px solid transparent;
  position: relative;
}

.ds-embed-session-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.ds-embed-session-item--active {
  border-left-color: var(--color-accent);
  background: rgba(45, 212, 191, 0.08);
}

.ds-embed-session-item__title {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: var(--space-5);
}

.ds-embed-session-item__delete {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 11px;
  transition: color 0.15s, background 0.15s;
}

.ds-embed-session-item:hover .ds-embed-session-item__delete {
  display: flex;
}

.ds-embed-session-item__delete:hover {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.1);
}

.ds-embed-session-item__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 10px;
  color: var(--color-text-tertiary);
}

.ds-embed-session-item__badge {
  display: inline-flex;
  align-items: center;
  padding: 1px var(--space-1);
  background: var(--color-bg-tertiary);
  border-radius: 2px;
  font-size: 9px;
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ds-embed-sessions__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: var(--text-xs);
  gap: var(--space-2);
}

.ds-embed-sessions__empty-icon {
  font-size: 1.5rem;
  opacity: 0.4;
}

/* Mobile sessions toggle button */
.ds-embed-sessions-toggle {
  display: none;
  position: fixed;
  bottom: var(--space-4);
  left: var(--space-4);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--color-accent);
  color: var(--color-text-on-accent);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.4);
  align-items: center;
  justify-content: center;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: rgba(45, 212, 191, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(45, 212, 191, 0.5); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .ds-embed-panels {
    flex-direction: column;
  }

  .ds-embed-sessions {
    display: none;
    width: 100%;
    position: fixed;
    inset: 0;
    z-index: 85;
  }

  .ds-embed-sessions--visible {
    display: flex;
  }

  .ds-embed-sessions-toggle {
    display: flex;
  }

  .ds-embed-chat {
    border-right: none;
  }

  .ds-embed-preview {
    display: none;
    width: 100%;
    position: fixed;
    inset: 0;
    z-index: 90;
  }

  .ds-embed-preview--visible {
    display: flex;
  }

  .ds-embed-preview-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .ds-embed-typing__dot,
  .ds-embed-spinner {
    animation: none;
  }

  .ds-embed-toast,
  .ds-embed-draft,
  .ds-embed-progress__fill {
    transition: none;
  }
}
