/* ============================================
   COMPOSE WINDOW STYLES
   Gmail-like email composition interface
   ============================================ */

/* Compose Overlay */
.compose-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 9000;
  display: none;
  animation: fadeIn 0.2s ease;
}

.compose-overlay.visible {
  display: block;
}

/* Compose Window Container */
.compose-window {
  position: fixed;
  bottom: 0;
  right: 40px;
  width: 550px;
  max-width: calc(100vw - 80px);
  background: #fff;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 9100;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Minimized state */
.compose-window.minimized {
  height: 48px;
  overflow: hidden;
}

/* Fullscreen state */
.compose-window.fullscreen {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  border-radius: 0;
  animation: expandFullscreen 0.2s ease;
}

@keyframes expandFullscreen {
  from {
    transform: scale(0.9);
    opacity: 0.8;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Compose Header */
.compose-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--primary);
  color: white;
  border-radius: 8px 8px 0 0;
  cursor: move;
  user-select: none;
}

.compose-window.fullscreen .compose-header {
  border-radius: 0;
}

.compose-header-title {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
}

.compose-header-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.compose-header-btn {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 16px;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compose-header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.compose-header-btn:active {
  background: rgba(255, 255, 255, 0.3);
}

/* Compose Body */
.compose-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: #fff;
}

.compose-window.minimized .compose-body {
  display: none;
}

/* Recipient Fields */
.compose-recipients {
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.compose-field-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid #e0e0e0;
  min-height: 40px;
}

.compose-field-row:last-child {
  border-bottom: none;
}

.compose-field-label {
  font-size: 13px;
  color: #666;
  min-width: 60px;
  font-weight: 500;
}

.compose-field-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  padding: 4px 8px;
  background: transparent;
  font-family: inherit;
}

.compose-field-input::placeholder {
  color: #aaa;
}

.compose-toggle-cc-bcc {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}

.compose-toggle-cc-bcc:hover {
  background: rgba(0, 51, 102, 0.1);
  text-decoration: underline;
}

/* From Field */
.compose-from-row {
  background: #f8f9fa;
}

.compose-from-address {
  flex: 1;
  font-size: 14px;
  color: #333;
  padding: 4px 8px;
}

.compose-from-select {
  flex: 1;
  border: 1px solid #d0d0d0;
  outline: none;
  font-size: 14px;
  padding: 6px 8px;
  background: white;
  border-radius: 4px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}

.compose-from-select:hover {
  border-color: #aaa;
}

.compose-from-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 51, 102, 0.1);
}

/* Subject Field */
.compose-subject-row {
  background: white;
}

/* Editor Container */
.compose-editor-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: white;
  position: relative; /* Required for absolute positioned children */
}

/* Rich Text Toolbar */
.compose-toolbar {
  display: flex;
  gap: 2px;
  padding: 8px 12px;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
  flex-wrap: wrap;
  align-items: center;
  position: relative;
  z-index: 100;
  flex-shrink: 0; /* Prevent toolbar from shrinking */
}

.compose-toolbar-btn {
  background: white;
  border: 1px solid #d0d0d0;
  color: #333;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
}

.compose-toolbar-btn:hover {
  background: #e8e8e8;
  border-color: #aaa;
}

.compose-toolbar-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary-dark);
}

.compose-toolbar-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.compose-toolbar-divider {
  width: 1px;
  height: 24px;
  background: #d0d0d0;
  margin: 0 4px;
}

/* TipTap Editor Area */
.compose-editor {
  flex: 1 1 auto;
  min-height: 150px;
  overflow-y: auto;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: white;
  position: relative;
}

.compose-editor:focus {
  outline: none;
}

/* TipTap Content Styles */
.compose-editor .ProseMirror {
  outline: none;
  min-height: 150px;
}

.compose-editor .ProseMirror p {
  margin: 0 0 8px 0;
}

.compose-editor .ProseMirror p:last-child {
  margin-bottom: 0;
}

.compose-editor .ProseMirror strong {
  font-weight: 700;
}

.compose-editor .ProseMirror em {
  font-style: italic;
}

.compose-editor .ProseMirror u {
  text-decoration: underline;
}

.compose-editor .ProseMirror s {
  text-decoration: line-through;
}

.compose-editor .ProseMirror a {
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
}

.compose-editor .ProseMirror ul,
.compose-editor .ProseMirror ol {
  padding-left: 24px;
  margin: 8px 0;
}

.compose-editor .ProseMirror li {
  margin: 4px 0;
}

.compose-editor .ProseMirror blockquote {
  border-left: 4px solid #e0e0e0;
  padding-left: 16px;
  margin: 12px 0;
  color: #666;
  font-style: italic;
}

.compose-editor .ProseMirror pre {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 12px;
  overflow-x: auto;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 13px;
  margin: 12px 0;
}

.compose-editor .ProseMirror code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 13px;
}

.compose-editor .ProseMirror img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 8px 0;
}

.compose-editor .ProseMirror table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
}

.compose-editor .ProseMirror th,
.compose-editor .ProseMirror td {
  border: 1px solid #e0e0e0;
  padding: 8px;
  text-align: left;
}

.compose-editor .ProseMirror th {
  background: #f5f5f5;
  font-weight: 600;
}

/* Quoted Email Container (read-only HTML below editor) */
.compose-quoted-container {
  border-top: 1px solid #e0e0e0;
  background: #fafafa;
  max-height: 50vh;
  overflow-y: auto;
}

.compose-quoted-header {
  padding: 12px 16px 8px;
  font-size: 13px;
  color: #666;
  background: #f5f5f5;
  border-bottom: 1px solid #e8e8e8;
}

.compose-quoted-divider {
  color: #999;
  font-size: 12px;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.compose-quoted-meta {
  line-height: 1.5;
}

.compose-quoted-meta strong {
  color: #444;
}

.compose-quoted-content {
  padding: 16px;
  font-size: 14px;
  line-height: 1.5;
  /* Allow original email styles to render */
  color: inherit;
}

/* Ensure images in quoted content are responsive */
.compose-quoted-content img {
  max-width: 100%;
  height: auto;
}

/* Ensure tables in quoted content don't overflow */
.compose-quoted-content table {
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

/* Links in quoted content */
.compose-quoted-content a {
  color: var(--primary, #1a73e8);
}

/* Attachments Area */
.compose-attachments {
  border-top: 1px solid #e0e0e0;
  padding: 12px 16px;
  background: #f8f9fa;
  display: none;
}

.compose-attachments.has-attachments {
  display: block;
}

.compose-attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compose-attachment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 13px;
}

.compose-attachment-icon {
  font-size: 16px;
}

.compose-attachment-name {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compose-attachment-size {
  color: #666;
  font-size: 11px;
}

.compose-attachment-remove {
  background: transparent;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 0;
  font-size: 16px;
  transition: color 0.15s;
}

.compose-attachment-remove:hover {
  color: #e74c3c;
}

/* Dropzone Overlay */
.compose-dropzone-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(90, 159, 212, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

.compose-dropzone-overlay.active {
  display: flex;
}

.compose-dropzone-text {
  color: white;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
}

/* Compose Footer */
.compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.compose-footer-left {
  display: flex;
  gap: 8px;
  align-items: center;
}

.compose-send-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.compose-send-btn:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.compose-send-btn:active:not(:disabled) {
  transform: translateY(0);
}

.compose-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.compose-send-btn.sending {
  position: relative;
}

.compose-send-btn.sending::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.compose-footer-btn {
  background: transparent;
  border: 1px solid #d0d0d0;
  color: #666;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 20px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compose-footer-btn:hover {
  background: #e8e8e8;
  border-color: #aaa;
}

.compose-footer-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.compose-draft-status {
  font-size: 12px;
  color: #666;
  font-style: italic;
}

.compose-draft-status.saved {
  color: var(--success, #10b981);
}

.compose-draft-status.error {
  color: var(--error, #e74c3c);
  font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  /* Full screen compose */
  .compose-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    margin: 0;
  }

  .compose-overlay {
    display: none; /* No overlay needed for fullscreen */
  }

  /* Header */
  .compose-header {
    padding: 12px 16px;
    border-radius: 0;
  }

  .compose-header-title {
    font-size: 16px;
  }

  .compose-header-btn {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  /* Hide fullscreen/minimize on mobile */
  #compose-minimize-btn,
  #compose-fullscreen-btn {
    display: none;
  }

  /* Recipients section */
  .compose-recipients {
    padding: 0 12px;
  }

  .compose-field-row {
    padding: 10px 0;
  }

  .compose-field-label {
    min-width: 50px;
    font-size: 13px;
  }

  .compose-field-input {
    font-size: 16px; /* Prevents iOS zoom */
    padding: 10px;
  }

  /* From selector */
  .compose-from-select {
    font-size: 16px;
    padding: 10px;
  }

  /* Toolbar - scrollable */
  .compose-toolbar {
    padding: 8px 12px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .compose-toolbar-btn {
    min-width: 40px;
    min-height: 40px;
    padding: 8px;
  }

  /* Editor area */
  .compose-editor-container {
    flex: 1;
    min-height: 200px;
  }

  .compose-editor {
    padding: 12px;
    font-size: 16px;
  }

  /* Body - adjust for keyboard */
  .compose-body {
    overflow-y: auto;
    max-height: calc(100vh - 120px);
  }

  /* Footer with send button */
  .compose-footer {
    padding: 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .compose-send-btn {
    flex: 1;
    min-height: 48px;
    font-size: 16px;
  }

  .compose-footer-btn {
    min-width: 48px;
    min-height: 48px;
  }

  /* Attachments list */
  .compose-attachments {
    flex-direction: column;
    padding: 8px 12px;
  }

  .compose-attachment-item {
    width: 100%;
    justify-content: space-between;
  }

  .compose-attachment-name {
    max-width: 120px;
  }
}

/* Small phones - adjust spacing */
@media (max-width: 480px) {
  .compose-field-label {
    display: none; /* Use placeholders instead */
  }

  .compose-field-input::placeholder {
    opacity: 0.7;
  }

  .compose-toolbar-btn {
    min-width: 36px;
    min-height: 36px;
    font-size: 14px;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .compose-window {
    background: #1a1a1a;
  }

  .compose-body,
  .compose-editor {
    background: #1a1a1a;
    color: #e0e0e0;
  }

  .compose-recipients,
  .compose-toolbar,
  .compose-footer,
  .compose-attachments {
    background: #2a2a2a;
    border-color: #444;
  }

  .compose-field-input {
    color: #e0e0e0;
  }

  .compose-toolbar-btn {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
  }

  .compose-toolbar-btn:hover {
    background: #444;
  }

  .compose-attachment-item {
    background: #333;
    border-color: #555;
  }
}

/* Quote/Original Email Display */
.compose-quoted-email {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px solid #e0e0e0;
}

.compose-quote-header {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
  font-style: italic;
}

.compose-quote-body {
  padding-left: 12px;
  border-left: 3px solid #ccc;
  color: #666;
  font-size: 13px;
}

/* ============================================
   AI ASSIST STYLES
   ============================================ */

/* AI Assist Buttons */
.compose-ai-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white !important;
  border-color: #667eea !important;
  font-weight: 600;
}

.compose-ai-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.compose-ai-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Rewrite Dropdown */
.compose-toolbar-dropdown {
  position: relative;
  display: inline-block;
}

.compose-toolbar-dropdown-menu {
  position: fixed;
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9500;
  min-width: 160px;
  display: none;
  overflow: hidden;
}

.compose-toolbar-dropdown-menu.visible {
  display: block;
}

.compose-toolbar-dropdown-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: white;
  text-align: left;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: background 0.15s;
}

.compose-toolbar-dropdown-menu button:hover {
  background: #f5f5f5;
}

.compose-toolbar-dropdown-menu button:active {
  background: #e8e8e8;
}

/* Suggestions Panel */
.compose-suggestions-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 350px;
  max-width: 100%;
  background: white;
  border-left: 1px solid #e0e0e0;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 150; /* Above toolbar */
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.compose-suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  font-size: 14px;
}

.compose-suggestions-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.15s;
}

.compose-suggestions-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.compose-suggestions-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.compose-suggestion-item {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.compose-suggestion-item:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.compose-suggestion-text {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.compose-suggestion-use-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.compose-suggestion-use-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 51, 102, 0.3);
}

.compose-suggestion-use-btn:active {
  transform: translateY(0);
}

/* Mobile adjustments for AI features */
@media (max-width: 768px) {
  .compose-suggestions-panel {
    width: 100%;
    max-width: 100%;
  }

  .compose-toolbar-dropdown-menu {
    left: auto;
    right: 0;
  }

  .compose-ai-btn {
    font-size: 13px;
    padding: 6px 10px;
  }
}

/* ============================================
   AUTOCOMPLETE STYLES
   Contact autocomplete for To/Cc/Bcc fields
   ============================================ */

.compose-autocomplete-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
}

.compose-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 240px;
  overflow-y: auto;
  z-index: 9200;
  display: none;
}

.compose-autocomplete-dropdown.visible {
  display: block;
}

.compose-autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  border-bottom: 1px solid #f0f0f0;
}

.compose-autocomplete-item:last-child {
  border-bottom: none;
}

.compose-autocomplete-item:hover,
.compose-autocomplete-item.selected {
  background-color: #e8f0fe;
}

.compose-autocomplete-main {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: #333;
}

.compose-autocomplete-email {
  color: #666;
  font-size: 13px;
}

.compose-autocomplete-count {
  font-size: 11px;
  color: #888;
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  white-space: nowrap;
}

/* Mobile adjustments for autocomplete */
@media (max-width: 768px) {
  .compose-autocomplete-item {
    padding: 12px;
  }

  .compose-autocomplete-main {
    font-size: 15px;
  }

  .compose-autocomplete-count {
    display: none;
  }
}

/* ============================================
   EMAIL CHIP STYLES
   Outlook-style email chips for To/Cc/Bcc
   ============================================ */

.compose-chip-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 4px;
  padding: 2px 0;
  position: relative;
}

.compose-chip-container.overflow {
  flex-wrap: nowrap;
  overflow: hidden;
}

.compose-chip-container.overflow::after {
  content: '...';
  color: #666;
  padding-left: 4px;
  flex-shrink: 0;
}

.compose-email-chip {
  display: inline-flex;
  align-items: center;
  background: #e8f0fe;
  border-radius: 16px;
  padding: 2px 8px 2px 10px;
  font-size: 13px;
  color: #1a73e8;
  max-width: 200px;
  white-space: nowrap;
  border-bottom: 2px solid #1a73e8;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.compose-email-chip:hover {
  background: #d2e3fc;
}

.compose-email-chip.invalid {
  background: #fce8e6;
  color: #c5221f;
  border-bottom-color: #c5221f;
}

.compose-email-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.compose-email-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.compose-email-chip-remove:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
}

.compose-chip-input {
  flex: 1;
  min-width: 120px;
  border: none;
  outline: none;
  font-size: 14px;
  padding: 4px 0;
  background: transparent;
  font-family: inherit;
}

.compose-chip-input::placeholder {
  color: #aaa;
}

/* Expand container on focus */
.compose-chip-container:focus-within {
  flex-wrap: wrap;
}

.compose-chip-container:focus-within.overflow::after {
  display: none;
}

/* Chip count badge (when collapsed) */
.compose-chip-overflow-count {
  display: none;
  font-size: 12px;
  color: #666;
  background: #e0e0e0;
  padding: 2px 8px;
  border-radius: 12px;
  flex-shrink: 0;
}

.compose-chip-container.overflow .compose-chip-overflow-count {
  display: inline-block;
}
