/* styles-additions-v11.css — Email composer modal (Step 1) */

/* ============================================================
   OVERLAY + MODAL SHELL
   ============================================================ */
.ec-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 22, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 9000;
  padding: 24px 16px;
  overflow-y: auto;
}
.ec-overlay.ec-open { display: flex; }

.ec-modal {
  background: #FAF8F2;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 720px;
  margin: 24px auto;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  overflow: hidden;
}

.ec-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
}
.ec-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px;
  color: #2C2C2A;
  letter-spacing: -0.01em;
}
.ec-subtitle {
  font-size: 13px;
  color: #5F5E5A;
}
.ec-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #888780;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.ec-close:hover { background: rgba(0,0,0,0.05); color: #2C2C2A; }

.ec-form {
  padding: 18px 24px 0;
  overflow-y: auto;
  flex: 1 1 auto;
}

/* ============================================================
   FORM ROWS / LABELS / INPUTS
   ============================================================ */
.ec-row { margin-bottom: 14px; }
.ec-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 540px) {
  .ec-row-grid { grid-template-columns: 1fr; }
}

.ec-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #5F5E5A;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.ec-label-inline {
  font-size: 12px;
  font-weight: 600;
  color: #5F5E5A;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 8px;
}

.ec-input,
.ec-textarea,
.ec-select,
.ec-form select {
  width: 100%;
  padding: 9px 12px;
  background: #FFF;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  color: #2C2C2A;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ec-input:focus,
.ec-textarea:focus,
.ec-select:focus,
.ec-form select:focus {
  outline: none;
  border-color: #1F2D44;
  box-shadow: 0 0 0 3px rgba(31, 45, 68, 0.12);
}
.ec-textarea {
  font-family: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
  line-height: 1.55;
  resize: vertical;
  min-height: 200px;
}
.ec-subject-input {
  font-size: 15px;
  font-weight: 500;
}

/* ============================================================
   FIELDSET BLOCKS
   ============================================================ */
.ec-fieldset {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 12px 14px 14px;
  margin: 0 0 14px;
  background: rgba(255,255,255,0.5);
}
.ec-legend {
  font-size: 12px;
  font-weight: 600;
  color: #5F5E5A;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 6px;
  margin-left: -6px;
}

/* ============================================================
   SEGMENTED CONTROL (first-outreach radio)
   ============================================================ */
.ec-segmented {
  display: inline-flex;
  background: #F1EFE8;
  border-radius: 8px;
  padding: 3px;
  margin-top: 8px;
  width: fit-content;
}
.ec-seg-opt {
  position: relative;
  cursor: pointer;
}
.ec-seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ec-seg-opt span {
  display: block;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #5F5E5A;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.ec-seg-opt input:checked + span {
  background: #FFF;
  color: #1F2D44;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.ec-followup-detail {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(0,0,0,0.08);
}

/* ============================================================
   CHIP ROW (channel + outcome pickers)
   ============================================================ */
.ec-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ec-chip {
  background: #FFF;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 100px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #5F5E5A;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.ec-chip:hover {
  border-color: #1F2D44;
  color: #1F2D44;
}
.ec-chip.is-active {
  background: #1F2D44;
  color: #FFF;
  border-color: #1F2D44;
}

/* ============================================================
   SUBJECT SUGGESTIONS
   ============================================================ */
.ec-subject-suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.ec-subject-suggestions:empty { display: none; }
.ec-subj-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #FFF;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s ease;
}
.ec-subj-chip:hover {
  border-color: #1F2D44;
  background: rgba(31,45,68,0.03);
}
.ec-subj-chip-strategy {
  flex-shrink: 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1F2D44;
  background: rgba(31,45,68,0.08);
  padding: 3px 7px;
  border-radius: 4px;
  font-weight: 600;
}
.ec-subj-chip-text {
  font-size: 14px;
  color: #2C2C2A;
}

/* ============================================================
   BODY HEADER + WORD COUNT
   ============================================================ */
.ec-body-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.ec-word-count {
  font-size: 11px;
  color: #888780;
  font-family: ui-monospace, monospace;
}

/* ============================================================
   AI BAR
   ============================================================ */
.ec-ai-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 10px 0 14px;
  border-bottom: 1px dashed rgba(0,0,0,0.08);
}
.ec-btn-ai {
  background: linear-gradient(135deg, #1F2D44, #2D5FAB);
  color: #FFF;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  transition: opacity 0.15s ease;
}
.ec-btn-ai:hover { opacity: 0.92; }
.ec-btn-ai:disabled { opacity: 0.6; cursor: wait; }
.ec-btn-ai-icon { font-size: 14px; }
.ec-ai-status {
  font-size: 12px;
  color: #5F5E5A;
  font-family: ui-monospace, monospace;
}

/* ============================================================
   ATTACHMENTS
   ============================================================ */
.ec-attach-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  min-height: 24px;
}
.ec-attach-empty {
  font-size: 13px;
  color: #888780;
  font-style: italic;
}
.ec-attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: #FFF;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  font-size: 13px;
}
.ec-attach-icon { font-size: 14px; }
.ec-attach-name {
  flex: 1;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: #2C2C2A;
}
.ec-attach-remove {
  background: transparent;
  border: none;
  font-size: 16px;
  color: #888780;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.ec-attach-remove:hover { background: rgba(160,69,69,0.12); color: #A04545; }

.ec-picker-popup {
  position: relative;
  background: #FFF;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  margin-top: 10px;
  padding: 12px;
  max-height: 320px;
  overflow-y: auto;
}
.ec-picker-header {
  font-size: 12px;
  font-weight: 600;
  color: #5F5E5A;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.ec-picker-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ec-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  width: 100%;
  transition: background 0.12s ease;
}
.ec-picker-item:hover {
  background: rgba(31,45,68,0.05);
  border-color: rgba(31,45,68,0.15);
}
.ec-picker-icon { font-size: 14px; flex-shrink: 0; }
.ec-picker-label {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #2C2C2A;
}
.ec-picker-filename {
  font-size: 11px;
  color: #888780;
  font-family: ui-monospace, monospace;
}
.ec-picker-close {
  width: 100%;
  margin-top: 8px;
  padding: 6px;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  font-size: 12px;
  color: #5F5E5A;
  cursor: pointer;
  font-family: inherit;
}

/* ============================================================
   FOOTER PREVIEW (collapsible)
   ============================================================ */
.ec-footer-preview {
  margin-bottom: 16px;
  background: rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 8px;
  padding: 8px 12px;
}
.ec-footer-preview summary {
  font-size: 12px;
  font-weight: 600;
  color: #5F5E5A;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  padding: 4px 0;
}
.ec-footer-text {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: #5F5E5A;
  margin: 8px 0 0;
  white-space: pre-wrap;
  background: #FFF;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.06);
}
.ec-footer-note {
  font-size: 11px;
  color: #888780;
  margin: 8px 0 0;
}
.ec-footer-note code {
  background: rgba(0,0,0,0.05);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
}

/* ============================================================
   ERROR BAR
   ============================================================ */
.ec-error {
  background: #F5E0DD;
  color: #6B2929;
  border: 1px solid rgba(160,69,69,0.25);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ============================================================
   SEND BAR (sticky footer)
   ============================================================ */
.ec-send-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0 18px;
  margin-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.06);
  position: sticky;
  bottom: 0;
  background: #FAF8F2;
  flex-wrap: wrap;
}
.ec-send-mode {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ec-send-mode .ec-select {
  width: auto;
  min-width: 160px;
}
.ec-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ec-btn-primary,
.ec-btn-secondary,
.ec-btn-tertiary {
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.ec-btn-primary {
  background: #1F2D44;
  color: #FFF;
  border-color: #1F2D44;
}
.ec-btn-primary:hover { background: #2D3F5C; }
.ec-btn-primary:disabled { opacity: 0.6; cursor: wait; }

.ec-btn-secondary {
  background: #FFF;
  color: #1F2D44;
  border-color: rgba(31,45,68,0.25);
}
.ec-btn-secondary:hover { background: rgba(31,45,68,0.05); }

.ec-btn-tertiary {
  background: transparent;
  color: #5F5E5A;
  border-color: transparent;
}
.ec-btn-tertiary:hover { background: rgba(0,0,0,0.05); color: #2C2C2A; }
