/*
 * Promtek Mail — restrained reading-pane polish.
 *
 * This layer only refines Roundcube's own opened-message chrome. It does not
 * alter authored HTML email content, mailbox actions, pane geometry, splitter
 * widths, or the phone layout.
 */

/* Give the native subject/summary/actions group one coherent rhythm. */
html.iframe body.task-mail #message-header {
  border-bottom: 1px solid var(--promtek-border) !important;
  margin-bottom: 1.2rem !important;
  padding-bottom: 1rem !important;
}

html.iframe body.task-mail #message-header > .subject {
  color: var(--promtek-text) !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.012em;
  line-height: 1.25 !important;
  margin: 0 0 0.55rem !important;
}

html.iframe body.task-mail #message-header > .subject .extwin {
  display: inline-flex !important;
  margin-inline-start: 0.3rem !important;
  vertical-align: 0.05em;
}

html.iframe body.task-mail #message-header > .header {
  align-items: flex-start;
}

/* The avatar is intentionally hidden, so its old minimum height is unnecessary. */
html.iframe body.task-mail #message-header .header-content {
  min-height: 0 !important;
}

html.iframe body.task-mail #message-header .header-summary {
  color: var(--promtek-muted) !important;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 !important;
}

/* The sender remains easy to identify without competing with the subject. */
html.iframe body.task-mail #message-header .header-summary a,
html.iframe body.task-mail #message-header .header-summary a:visited {
  color: var(--promtek-text) !important;
  font-weight: 600;
}

/* Details, headers, format controls, and size form one quiet metadata row. */
html.iframe body.task-mail #message-header .header-links {
  align-items: center;
  color: var(--promtek-muted) !important;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.8rem;
  line-height: 1.4;
  margin-top: 0.35rem !important;
}

html.iframe body.task-mail #message-header .header-links a,
html.iframe body.task-mail #message-header .header-links a:visited,
html.iframe body.task-mail #message-header .header-links a::before {
  color: var(--promtek-muted) !important;
}

html.iframe body.task-mail #message-header .header-links a {
  border-radius: 0.25rem;
  margin: 0 !important;
  padding: 0.12rem 0 !important;
}

html.iframe body.task-mail #message-header .header-links a::before {
  height: auto !important;
  line-height: inherit !important;
  margin-inline-end: 0.28rem;
}

html.iframe body.task-mail #message-header .header-links a:hover,
html.iframe body.task-mail #message-header .header-links a:hover::before,
html.iframe body.task-mail #message-header .header-links a:focus-visible,
html.iframe body.task-mail #message-header .header-links a:focus-visible::before {
  color: var(--promtek-link) !important;
}

/* Replace the formerly bright bullet with a neutral metadata divider. */
html.iframe body.task-mail #message-header .promtek-open-message-size {
  border-inline-start: 1px solid var(--promtek-border);
  color: var(--promtek-muted) !important;
  margin-inline-start: 0 !important;
  padding-inline-start: 0.8rem;
}

html.iframe body.task-mail #message-header .promtek-open-message-size::before {
  content: none !important;
}

/* Let the body begin deliberately below the header, without styling email HTML. */
html.iframe body.task-mail #message-content > .rightcol {
  color: var(--promtek-text) !important;
  line-height: 1.55;
}

html.iframe body.task-mail #messagebody > .message-part:first-child,
html.iframe body.task-mail #messagebody > .message-htmlpart:first-child {
  padding-top: 0 !important;
}

html.iframe body.task-mail #messagebody .message-part div.pre {
  color: var(--promtek-text) !important;
  line-height: 1.65;
}

/* Preserve Elastic's compact mobile presentation. */
@media screen and (max-width: 480px) {
  html.iframe body.task-mail #message-header {
    margin-bottom: 0.8rem !important;
    padding-bottom: 0.75rem !important;
  }

  html.iframe body.task-mail #message-header > .subject {
    font-size: 1.2rem !important;
  }

  html.iframe body.task-mail #message-header .header-links {
    gap: 0.15rem 0.6rem;
  }
}
