.toolbar-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.btn-tool {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.btn-tool:hover { background: var(--bg-subtle); color: var(--text-main); border-color: var(--border-strong); }
.btn-tool.mobile-back-btn { display: none; }
.btn-primary, .btn-tool.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.btn-primary:hover, .btn-tool.btn-primary:hover { background: var(--primary-hover); color: #fff; border-color: var(--primary-hover); }
.btn-primary:disabled, .btn-tool:disabled { opacity: 0.5; cursor: not-allowed; }

.reading-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 22px 90px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.reading-scroll > * { flex-shrink: 0; }
.conversation-header {
  background: var(--bg-surface);
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.conversation-subject { font-size: 17px; font-weight: 700; margin: 0; line-height: 1.35; color: var(--text-main); }
.conversation-submeta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.conversation-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); flex-shrink: 0; flex-wrap: nowrap; white-space: nowrap; }

.msg-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.msg-header {
  padding: 12px 18px;
  background: var(--bg-card-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.msg-author { display: flex; align-items: flex-start; gap: 10px; min-width: 0; flex: 1; }
.msg-author > div:not(.avatar) { min-width: 0; flex: 1; }
.msg-author-name, .author-name {
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 6px;
  row-gap: 2px;
  color: var(--text-main);
}
.msg-author-role { font-size: 11.5px; color: var(--text-secondary); }
.msg-recipients, .author-email { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.msg-date-wrap { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); flex-shrink: 0; }
.msg-body {
  padding: 18px 20px;
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--text-main);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}

/* Inline Reply */
.reply-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 16px;
  overflow: hidden;
}
.reply-box-header {
  padding: 8px 14px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.quick-replies { display: flex; gap: 5px; flex-wrap: wrap; }
.quick-chip {
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
}
.quick-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.reply-textarea {
  width: 100%;
  min-height: 120px;
  border: none;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-main);
  background: var(--bg-surface);
  outline: none;
  resize: vertical;
}
.reply-footer {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-card-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* GMAIL-STYLE MULTI-COMPOSER BOTTOM DOCK */
.composer-dock {
  position: fixed;
  bottom: 0;
  right: 18px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  z-index: 800;
  pointer-events: none;
}
.composer-card {
  width: min(640px, calc(100vw - 36px));
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  transition: width 0.15s ease;
}
.composer-card.minimized { width: min(380px, calc(100vw - 36px)); }
.composer-card.minimized .composer-body,
.composer-card.minimized .composer-footer { display: none; }
.composer-card.maximized {
  position: fixed;
  top: 56px;
  left: 256px;
  right: 16px;
  bottom: 16px;
  width: auto;
  border-radius: 12px;
  border-bottom: 1px solid var(--border-strong);
  z-index: 950;
}
.composer-card.maximized .composer-textarea { flex: 1; height: 100%; }
.composer-header {
  background: var(--bg-topbar);
  color: #f8fafc;
  padding: 9px 12px;
  border-radius: 9px 9px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}
.composer-title-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.composer-title { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.draft-status { font-size: 10.5px; color: #38bdf8; white-space: nowrap; flex-shrink: 0; }
.composer-controls { display: flex; align-items: center; gap: 4px; }
.composer-ctrl-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.composer-ctrl-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
.composer-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.composer-field-row { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.composer-field-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); width: 48px; flex-shrink: 0; }
.composer-input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 12.5px;
  color: var(--text-main);
  background: transparent;
  font-family: inherit;
}
.composer-textarea {
  width: 100%;
  min-height: 220px;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-main);
  background: transparent;
  resize: vertical;
  padding-top: 6px;
}
.recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--border-strong);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.recipient-chip button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0 2px;
  font-size: 11px;
  line-height: 1;
}
.composer-format-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.empty-state-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.empty-state-actions {
  display: flex;
  gap: 8px;
}
.msg-provisional-loading {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
