.eml-view {
  font-family: var(--fonts-body);
  color: var(--color-text);
  line-height: 1.5;
  background: var(--color-body);
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

details.eml-headers {
  background: var(--color-box-body);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem 0.75rem;
  margin-bottom: 1rem;
}

details.eml-headers summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  outline: none;
}

details.eml-headers summary::-webkit-details-marker {
  display: none;
}

details.eml-headers summary::before {
  content: "▸";
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

details.eml-headers[open] summary::before {
  transform: rotate(90deg);
}

details.eml-headers table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}

details.eml-headers th {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--color-text-light);
  padding: 0.35rem 0.6rem;
  width: 7.5rem;
  border-right: 1px solid var(--color-border);
  background: var(--color-box-header);
  vertical-align: top;
}

details.eml-headers td {
  padding: 0.35rem 0.6rem;
  background: var(--color-box-body);
  border-bottom: 1px solid var(--color-border);
  word-break: break-word;
}

.eml-bodies {
  background: var(--color-box-body);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.eml-body {
  margin-bottom: 1.5rem;
}

.eml-body:last-child {
  margin-bottom: 0;
}

.eml-body.text {
  font-family: var(--fonts-code);
  white-space: pre-wrap;
}

.eml-body.text a {
  color: var(--color-primary);
}

.eml-body.html img {
  max-width: 100%;
  height: auto;
}

.eml-body blockquote {
  margin: 0.8rem 0;
  padding: 0.45rem 0.9rem;
  border-left: 3px solid var(--color-primary);
  background: var(--color-box-header);
  color: var(--color-text);
  border-radius: 4px;
}

.eml-attachments ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.eml-attachments li {
  background: var(--color-box-body);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
}

.eml-attachment-meta {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.eml-attachment-preview {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border: 1px dashed var(--color-border);
  border-radius: 4px;
  background: var(--color-box-header);
}

.eml-attachment-preview.image img,
.eml-attachment-preview.video video,
.eml-attachment-preview.audio audio,
.eml-attachment-preview.pdf img {
  max-width: 100%;
  height: auto;
  display: block;
}

.eml-attachment-preview.audio audio,
.eml-attachment-preview.video video {
  width: 100%;
}

.eml-attachment-preview.pdf iframe,
.eml-pdf-viewer,
.eml-attachment-preview.pdf embed {
  width: 100%;
  min-height: 320px;
  border: none;
  background: var(--color-body);
}

.eml-attachment-preview.text,
.eml-attachment-preview.html {
  overflow-x: auto;
}

.eml-attachment-preview.docx {
  overflow-x: auto;
  line-height: 1.6;
}

.eml-attachment-preview.unavailable {
  font-style: italic;
  color: var(--color-text-light);
}

.eml-attachments strong {
  color: var(--color-accent);
}

.eml-attachments a {
  color: var(--color-primary);
  text-decoration: none;
}

.eml-attachments a:hover {
  text-decoration: underline;
}

.eml-attachment-note {
  color: var(--color-text-light);
  font-size: 0.85rem;
}
