/*
 * RusingaMail Professional
 * Visual refinement layer for Roundcube Elastic 1.7.x
 * ICT Essentials
 */

:root {
  --rm-font: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --rm-text: #263238;
  --rm-muted: #607d8b;
  --rm-border: #e1e7eb;
  --rm-surface: #ffffff;
}

html, body,
#layout,
#layout-content,
#layout-list,
#layout-sidebar,
#layout-menu {
  font-family: var(--rm-font) !important;
}

body {
  color: var(--rm-text);
  font-size: 14px;
}

/* Message header: cleaner and less oversized */
#message-header > .subject {
  font-size: 1.28rem !important;
  line-height: 1.35 !important;
  font-weight: 650 !important;
  letter-spacing: -0.01em;
}

#message-header > .header {
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--rm-border);
}

.header-summary,
.header-summary a,
.header-links a {
  font-family: var(--rm-font) !important;
}

/* The major improvement: readable plain-text messages */
.message-part div.pre {
  font-family: var(--rm-font) !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
  color: var(--rm-text) !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere;
  tab-size: 4;
  max-width: 900px;
  margin: 0 auto !important;
  padding: .25rem 0 1rem;
}

/* Improve ordinary message text and quoted content */
.message-part,
.message-htmlpart {
  font-family: var(--rm-font) !important;
  color: var(--rm-text);
}

.message-part blockquote {
  line-height: 1.5;
}

/* Give the reading area a more deliberate business-email feel */
#message-content {
  padding: 0 .5rem 1rem;
}

/* Toolbar: quieter and less visually heavy */
#message-header + .toolbar,
#messagetoolbar {
  font-family: var(--rm-font) !important;
}

/* Message list typography */
#messagelist,
#messagelist table,
#messagelist tbody,
#messagelist td,
#messagelist th {
  font-family: var(--rm-font) !important;
}

#messagelist tbody tr {
  min-height: 42px;
}

/* Compose/editor typography */
#composebody,
.mce-content-body,
textarea,
input,
select,
button {
  font-family: var(--rm-font) !important;
}

/* Navigation labels */
#layout-menu,
#layout-menu a {
  font-family: var(--rm-font) !important;
}

/* Make the app feel less cramped on desktop while preserving responsiveness */
@media screen and (min-width: 769px) {
  #message-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Keep mobile readable */
@media screen and (max-width: 768px) {
  .message-part div.pre {
    font-size: 15px !important;
    line-height: 1.55 !important;
    max-width: none;
  }

  #message-header > .subject {
    font-size: 1.15rem !important;
  }
}
/* RusingaMail Professional — Identity Test 01 */
#layout-menu {
  background-color: #0b2340 !important;
}
/* RusingaMail account identity — responsive-safe */
.rusingamail-identity {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 .5rem !important;
  line-height: 1.2 !important;
  text-align: center !important;
  white-space: normal !important;
  overflow: hidden !important;
}

.rusingamail-name {
  display: block !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
}

.rusingamail-account {
  display: block !important;
  font-size: .82rem !important;
  font-weight: 400 !important;
  line-height: 1.15 !important;
  opacity: .85;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.rusingamail-name {
  display: block !important;
  font-weight: 700 !important;
}

.rusingamail-account {
  display: block !important;
  font-size: 0.82rem !important;
  font-weight: 400 !important;
  opacity: 0.85;
}

/* Keep RusingaMail's simplified interface */
#taskmenu a.button-settings,
#taskmenu a[data-command="settings"] {
  display: none !important;
}
/* RusingaMail identity — right justified */
.rusingamail-top-identity {
  margin-left: auto !important;
  text-align: right !important;
  padding-right: 1rem !important;
  line-height: 1.15 !important;
}

.rusingamail-top-identity .rusingamail-name {
  display: block !important;
  font-weight: 700 !important;
}

.rusingamail-top-identity .rusingamail-account {
  display: block !important;
  font-size: .82rem !important;
  font-weight: 400 !important;
  opacity: .72;
}
/* RusingaMail identity — two-line right-aligned toolbar block */
.rusingamail-top-identity {
  position: relative !important;
  top: 22px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  align-items: flex-end !important;
  align-self: stretch !important;
  flex: 0 1 210px !important;
  min-width: 0 !important;
  max-width: 210px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  margin-left: auto !important;
  padding: 0 1rem .15rem .75rem !important;
  line-height: 1.05 !important;
  text-align: right !important;
  white-space: nowrap !important;
}

.rusingamail-top-identity .rusingamail-name {
  display: block !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.05 !important;
}

.rusingamail-top-identity .rusingamail-account {
  display: block !important;
  font-size: .82rem !important;
  font-weight: 400 !important;
  line-height: 1.05 !important;
  opacity: .85;
}
/* RusingaMail — compact identity for tighter desktop widths */
@media screen and (max-width: 1200px) {
  .rusingamail-top-identity {
    flex: 0 1 185px !important;
    max-width: 185px !important;
    padding-left: .25rem !important;
    padding-right: .35rem !important;
  }

  .rusingamail-top-identity .rusingamail-name {
    font-size: .9rem !important;
  }

  .rusingamail-top-identity .rusingamail-account {
    font-size: .72rem !important;
  }
}
/* Elegance Pass 02 — refined message-list spacing */
@media screen and (min-width: 769px) {
  #messagelist td {
    padding-top: .25rem !important;
    padding-bottom: .25rem !important;
  }
}
/* Elegance Pass 02 — bring sender and subject closer together */
#messagelist td.subject span {
  line-height: 1.35em !important;
}
/* Elegance Pass 03 — clearer unread sender */
#messagelist tr.unread td.subject span.fromto {
  font-weight: 650 !important;
}
/* Elegance Pass 04C — Compose action area */
#composebodycontainer + .formbuttons {
  padding-top: .65rem !important;
  padding-bottom: .65rem !important;
  border-top: 1px solid var(--rm-border) !important;
  align-items: center !important;
}

#composebodycontainer + .formbuttons .send {
  min-height: 42px !important;
  padding: .5rem 1.15rem !important;
  font-weight: 600 !important;
  border-radius: 5px !important;
  margin: 0 !important;
}
/* Elegance Pass 04C — Compose action area */
#layout-content .formbuttons {
  padding-top: .65rem !important;
  padding-bottom: .65rem !important;
  border-top: 1px solid var(--rm-border) !important;
  align-items: center !important;
}

#layout-content .formbuttons .send {
  min-height: 42px !important;
  padding: .5rem 1.15rem !important;
  font-weight: 600 !important;
  border-radius: 5px !important;
  margin: 0 !important;
}