/* SmartGaulle visual refresh: one calm, high-contrast system across the webmail. */
:root {
  --sg7-ink: #152744;
  --sg7-muted: #71819a;
  --sg7-blue: #1769e8;
  --sg7-blue-deep: #0c4fc1;
  --sg7-red: #f12d4d;
  --sg7-border: #e5ebf4;
  --sg7-panel-shadow: 0 16px 42px rgba(26, 54, 92, .09), 0 2px 8px rgba(26, 54, 92, .04);
}

html body.sg7 {
  color: var(--sg7-ink);
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
}

html body.sg7.is-mail,
html body.sg7.is-mail *:not(svg):not(path) {
  font-family: 'Quicksand', 'Segoe UI', sans-serif !important;
}

html body.sg7.is-mail {
  background-color: #eaf1fa !important;
  background-image: linear-gradient(120deg, rgba(237, 244, 253, .22), rgba(244, 248, 255, .06)), url('/assets/sg7-mail-background.png?v=2') !important;
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

html body.sg7.is-mail .sg7-shell {
  grid-template-columns: 276px minmax(0, 1fr) !important;
  background: transparent !important;
  background-image: none !important;
}

/* A dark, quiet navigation rail gives the workspace a clear frame. */
html body.sg7.is-mail .sg7-sidebar {
  padding: 16px 14px 18px !important;
  border-right: 1px solid rgba(255, 255, 255, .08) !important;
  background: linear-gradient(165deg, #102344 0%, #0d1d39 58%, #12294b 100%) !important;
  color: #eaf1ff !important;
  box-shadow: 8px 0 30px rgba(12, 31, 59, .08);
  backdrop-filter: none !important;
}

html body.sg7.is-mail .sg7-sidebar-logo {
  height: 62px !important;
  margin: 0 4px 22px !important;
}

html body.sg7.is-mail .sg7-sidebar-logo img {
  width: 46px;
  height: 46px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .16);
}

html body.sg7.is-mail .sg7-sidebar-logo b { color: #fff !important; }
html body.sg7.is-mail .sg7-sidebar-logo small { color: #a9bddb !important; }

html body.sg7.is-mail .sg7-new-btn {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, .2) !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #3789ff, #1260df) !important;
  box-shadow: 0 10px 24px rgba(0, 83, 214, .28) !important;
  color: #fff !important;
  letter-spacing: .1px;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

html body.sg7.is-mail .sg7-new-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 13px 27px rgba(0, 83, 214, .36) !important;
}

html body.sg7.is-mail .sg7-primary-nav {
  gap: 5px;
  border-bottom-color: rgba(221, 235, 255, .14) !important;
}

html body.sg7.is-mail .sg7-nav-link {
  min-height: 43px;
  border-radius: 12px !important;
  color: #c2d0e5 !important;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

html body.sg7.is-mail .sg7-nav-link:hover {
  background: rgba(225, 237, 255, .09) !important;
  color: #fff !important;
}

html body.sg7.is-mail .sg7-nav-link.active {
  background: linear-gradient(105deg, rgba(54, 126, 236, .27), rgba(54, 126, 236, .12)) !important;
  box-shadow: inset 0 0 0 1px rgba(138, 181, 248, .16);
  color: #fff !important;
}

html body.sg7.is-mail .sg7-nav-link.active:before {
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 5px 5px 0;
  background: #ff5570 !important;
}

html body.sg7.is-mail .sg7-nav-link.active > .sg7-icon { color: #8dbbff !important; }
html body.sg7.is-mail .sg7-folder-heading { color: #91a8c8 !important; }
html body.sg7.is-mail .sg7-folder-heading .sg7-icon-btn { color: #c2d0e5 !important; }
html body.sg7.is-mail .sg7-folder-heading .sg7-icon-btn:hover { background: rgba(255, 255, 255, .1) !important; }
html body.sg7.is-mail .sg7-custom-folders .sg7-nav-link { color: #bdcce1 !important; }
html body.sg7.is-mail .sg7-create-hint { color: #9fb3cf !important; }
html body.sg7.is-mail .sg7-sidebar-end { border-top: 1px solid rgba(221, 235, 255, .12); }
html body.sg7.is-mail .sg7-help-card {
  border-color: rgba(201, 222, 251, .15) !important;
  background: rgba(255, 255, 255, .07) !important;
  color: #e8f0ff !important;
}
html body.sg7.is-mail .sg7-help-card small { color: #a8bbd7 !important; }
html body.sg7.is-mail .sg7-help-card > span:first-child { background: rgba(69, 137, 239, .2) !important; color: #9ec5ff !important; }
html body.sg7.is-mail .sg7-sidebar-end .sg7-nav-link,
html body.sg7.is-mail .sg7-logout { color: #bdcce1 !important; }
html body.sg7.is-mail .sg7-logout:hover { color: #ff8094 !important; }

/* Airy top bar and a softer, more legible message workspace. */
html body.sg7.is-mail .sg7-header {
  height: 76px !important;
  min-height: 76px !important;
  padding: 0 28px !important;
  gap: 18px !important;
  border-bottom: 1px solid rgba(220, 231, 245, .82);
  background: rgba(255, 255, 255, .91) !important;
  box-shadow: 0 5px 22px rgba(32, 61, 100, .035);
  backdrop-filter: blur(18px) !important;
}

html body.sg7.is-mail .sg7-header-search {
  width: min(520px, 44vw) !important;
  height: 46px !important;
  padding: 0 15px !important;
  border: 1px solid #e2eaf5 !important;
  border-radius: 15px !important;
  background: #f5f8fd !important;
  color: #426080 !important;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

html body.sg7.is-mail .sg7-header-search:focus-within {
  border-color: #9fc2f5 !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(37, 111, 223, .09);
}

html body.sg7.is-mail .sg7-header-search input { font-size: 13px !important; }
html body.sg7.is-mail .sg7-header-actions { gap: 9px !important; }
html body.sg7.is-mail .sg7-header-actions .sg7-round {
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #536a88 !important;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
html body.sg7.is-mail .sg7-header-actions .sg7-round:hover {
  border-color: #e0e9f5 !important;
  background: #f3f7fc !important;
  color: var(--sg7-blue) !important;
}
html body.sg7.is-mail .sg7-profile-circle { box-shadow: 0 5px 14px rgba(11, 83, 196, .22); }
html body.sg7.is-mail .sg7-header-profile b { color: #243a59; }
html body.sg7.is-mail .sg7-header-profile small { color: #7b8da6; }

html body.sg7.is-mail .sg7-mail-grid {
  grid-template-columns: minmax(330px, 390px) minmax(0, 1fr) !important;
  gap: 14px !important;
  padding: 16px 18px 18px !important;
}

html body.sg7.is-mail .sg7-list-panel,
html body.sg7.is-mail .sg7-message-card {
  border: 1px solid rgba(224, 233, 245, .96) !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, .97) !important;
  box-shadow: var(--sg7-panel-shadow) !important;
  backdrop-filter: blur(18px) !important;
}

html body.sg7.is-mail .sg7-list-name {
  padding: 20px 20px 11px !important;
}
html body.sg7.is-mail .sg7-list-name > span {
  color: #162b4b !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  letter-spacing: -.5px;
}
html body.sg7.is-mail .sg7-list-name > small { color: #8291a7 !important; font-size: 12px !important; }
html body.sg7.is-mail .sg7-list-tabs {
  border-bottom: 1px solid #edf1f7 !important;
  background: #fff !important;
}
html body.sg7.is-mail .sg7-list-tabs > a { color: #76859b !important; }
html body.sg7.is-mail .sg7-list-tabs > a.active { color: #1769d6 !important; }
html body.sg7.is-mail .sg7-list-tabs > a.active:after { background: #2879ee !important; }
html body.sg7.is-mail .sg7-list-tools {
  min-height: 42px !important;
  padding: 0 17px !important;
  border-bottom: 1px solid #f0f3f8;
  color: #7b8ba1 !important;
}
html body.sg7.is-mail .sg7-list-tools select {
  padding: 5px 8px;
  border: 1px solid #e3eaf3;
  border-radius: 8px;
  background: #fff;
  color: #435974;
}

html body.sg7.is-mail .sg7-message-row {
  min-height: 82px !important;
  padding: 12px 14px !important;
  border-bottom-color: #f0f3f8 !important;
  transition: background .16s ease, box-shadow .16s ease;
}
html body.sg7.is-mail .sg7-message-row:hover { background: #f5f9ff !important; }
html body.sg7.is-mail .sg7-message-row.selected {
  background: #edf5ff !important;
  box-shadow: inset 3px 0 #2879ee !important;
}
html body.sg7.is-mail .sg7-message-row.unread .sg7-row-content b,
html body.sg7.is-mail .sg7-message-row.unread .sg7-row-content strong { color: #182e4f !important; }
html body.sg7.is-mail .sg7-sender-avatar {
  border: 1px solid #e4eaf2 !important;
  box-shadow: 0 3px 10px rgba(27, 50, 82, .06) !important;
}
html body.sg7.is-mail .sg7-list-footer { border-top: 1px solid #edf1f6; color: #8190a7; }

html body.sg7.is-mail .sg7-reader-bar {
  min-height: 58px !important;
  padding: 0 16px !important;
  border-bottom: 1px solid #edf1f7;
  background: #fff !important;
}
html body.sg7.is-mail .sg7-reader-bar > a,
html body.sg7.is-mail .sg7-reader-bar > form button {
  min-height: 36px;
  border: 1px solid #e6edf6 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #536b8a !important;
  font-weight: 700;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
html body.sg7.is-mail .sg7-reader-bar > a:hover,
html body.sg7.is-mail .sg7-reader-bar > form button:hover {
  border-color: #c7dcf7 !important;
  background: #f4f8ff !important;
  color: #1769d6 !important;
  transform: translateY(-1px);
}
html body.sg7.is-mail .sg7-reader-inner { padding: 24px 28px !important; }
html body.sg7.is-mail .sg7-subject h2 {
  color: #192d4b !important;
  font-size: 23px !important;
  font-weight: 800 !important;
  letter-spacing: -.65px !important;
  line-height: 1.35;
}
html body.sg7.is-mail .sg7-folder-tag {
  border: 1px solid #e2ecf8;
  border-radius: 999px !important;
  background: #f3f7fc !important;
  color: #6480a2 !important;
}
html body.sg7.is-mail .sg7-reading-sender b { color: #253c5f !important; }
html body.sg7.is-mail .sg7-reading-sender small,
html body.sg7.is-mail .sg7-reading-sender time { color: #8292a8 !important; }
html body.sg7.is-mail .sg7-message-html { border: 1px solid #e8edf4; border-radius: 14px !important; }

/* The other screens use the same rounded surfaces and blue action color. */
html body.sg7.is-mail .sg7-page-wrap { background: transparent !important; }
html body.sg7.is-mail .sg7-page-head h1 {
  color: #142847;
  font-weight: 800;
  letter-spacing: -.8px;
}
html body.sg7.is-mail .sg7-page-head > div > p {
  color: #2875df;
  font-weight: 800;
  letter-spacing: 1.7px;
}
html body.sg7.is-mail .sg7-page-head > div > span { color: #7587a1; }
html body.sg7.is-mail .sg7-compose-card,
html body.sg7.is-mail .sg7-settings-body,
html body.sg7.is-mail .sg7-documents-card {
  border: 1px solid #e3eaf3 !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: var(--sg7-panel-shadow) !important;
}
html body.sg7.is-mail .sg7-outline {
  border: 1px solid #dfe8f3;
  border-radius: 11px;
  background: rgba(255, 255, 255, .82);
  color: #46617f;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
html body.sg7.is-mail .sg7-outline:hover {
  border-color: #bdd4f3;
  background: #fff;
  color: #1769d6;
}
html body.sg7.is-mail .sg7-send-btn {
  border-radius: 11px !important;
  background: linear-gradient(135deg, #3789ff, #1260df) !important;
  box-shadow: 0 8px 18px rgba(24, 101, 220, .2) !important;
}

/* Login: welcoming and polished while keeping the existing illustration. */
html body.sg7.is-login {
  background-color: #eaf1fa !important;
  background-image: linear-gradient(120deg, rgba(236, 244, 255, .18), rgba(244, 248, 255, .04)), url('/assets/sg7-login-background.png?v=1') !important;
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  font-family: 'Quicksand', 'Segoe UI', sans-serif !important;
}
html body.sg7.is-login .sg7-login {
  background: linear-gradient(115deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .3)) !important;
}
html body.sg7.is-login .sg7-login-card {
  border: 1px solid rgba(255, 255, 255, .88) !important;
  border-top: 3px solid #2676e8 !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, .91) !important;
  box-shadow: 0 28px 80px rgba(22, 50, 91, .18), 0 5px 18px rgba(22, 50, 91, .08) !important;
  backdrop-filter: blur(18px) !important;
}
html body.sg7.is-login .sg7-login-card-brand img {
  border-radius: 17px;
  filter: drop-shadow(0 5px 10px rgba(18, 76, 153, .12));
}
html body.sg7.is-login .sg7-login-card-brand b { color: #142b4d !important; }
html body.sg7.is-login .sg7-input-group {
  border-radius: 11px !important;
  background: #f8faff !important;
}
html body.sg7.is-login .sg7-input-group:focus-within {
  border-color: #7eaceb !important;
  box-shadow: 0 0 0 4px rgba(37, 111, 223, .1) !important;
}
html body.sg7.is-login .sg7-login-submit {
  border-radius: 11px !important;
  background: linear-gradient(135deg, #3789ff, #125bd5) !important;
  box-shadow: 0 9px 20px rgba(21, 92, 201, .2) !important;
  transition: transform .18s ease, box-shadow .18s ease;
}
html body.sg7.is-login .sg7-login-submit:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 12px 24px rgba(21, 92, 201, .27) !important;
}
html body.sg7.is-login .sg7-login-illustration img { filter: drop-shadow(0 18px 24px rgba(35, 76, 133, .12)); }

@media (min-width: 651px) and (max-width: 1180px) {
  html body.sg7.is-mail .sg7-shell { grid-template-columns: 236px minmax(0, 1fr) !important; }
  html body.sg7.is-mail .sg7-mail-grid { grid-template-columns: minmax(320px, 39%) minmax(0, 1fr) !important; }
}

@media (min-width: 651px) and (max-width: 1024px) {
  html body.sg7.is-mail .sg7-shell { grid-template-columns: 78px minmax(0, 1fr) !important; }
  html body.sg7.is-mail .sg7-sidebar { align-items: stretch; padding: 12px 8px !important; }
  html body.sg7.is-mail .sg7-sidebar-logo { justify-content: center; margin: 0 0 18px !important; }
  html body.sg7.is-mail .sg7-sidebar-logo > span,
  html body.sg7.is-mail .sg7-sidebar .sg7-new-btn,
  html body.sg7.is-mail .sg7-sidebar .sg7-nav-link > span:nth-child(2),
  html body.sg7.is-mail .sg7-folder-heading > b,
  html body.sg7.is-mail .sg7-custom-folders,
  html body.sg7.is-mail .sg7-sidebar-end { display: none !important; }
  html body.sg7.is-mail .sg7-sidebar .sg7-nav-link { justify-content: center; padding: 11px 0 !important; }
  html body.sg7.is-mail .sg7-folder-heading { justify-content: center; padding: 10px 0; }
  html body.sg7.is-mail .sg7-mail-grid { grid-template-columns: minmax(290px, 40%) minmax(0, 1fr) !important; }
}

@media (min-width: 651px) and (max-width: 870px) {
  html body.sg7.is-mail .sg7-mail-grid { grid-template-columns: minmax(260px, 40%) minmax(0, 1fr) !important; }
}

@media (max-width: 650px) {
  html body.sg7.is-mail {
    background-attachment: scroll !important;
    background-position: center top;
  }
  html body.sg7.is-mail .sg7-shell {
    background-image: linear-gradient(145deg, rgba(236, 243, 252, .28), rgba(248, 250, 255, .12)), url('/assets/sg7-mail-background.png?v=2') !important;
    background-attachment: scroll !important;
  }
  html body.sg7.is-mail .sg7-sidebar {
    width: 270px;
    border-right: 1px solid rgba(255, 255, 255, .1) !important;
    box-shadow: 18px 0 44px rgba(9, 25, 49, .22);
  }
  html body.sg7.is-mail .sg7-header {
    display: flex !important;
    height: 60px !important;
    min-height: 60px !important;
    padding: 0 10px !important;
    gap: 7px !important;
  }
  html body.sg7.is-mail .sg7-content {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
  }
  html body.sg7.is-mail .sg7-mail-grid {
    display: flex !important;
    width: 100% !important;
    min-height: 0 !important;
    flex: 1 1 0 !important;
    overflow-y: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  html body.sg7.is-mail .sg7-mail-grid.list-only .sg7-list-panel {
    display: flex !important;
    width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 1 1 auto !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  html body.sg7.is-mail .sg7-mail-grid.has-selection .sg7-list-panel { display: none !important; }
  html body.sg7.is-mail .sg7-mail-grid.has-selection .sg7-reader-column {
    display: flex !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
  }
  html body.sg7.is-mail .sg7-header-search {
    height: 40px !important;
    border-radius: 13px !important;
    background: rgba(245, 248, 253, .96) !important;
  }
  html body.sg7.is-mail .sg7-mail-grid { padding: 10px 9px 88px !important; gap: 10px !important; }
  html body.sg7.is-mail .sg7-list-panel,
  html body.sg7.is-mail .sg7-message-card {
    border-radius: 17px !important;
    background: rgba(255, 255, 255, .98) !important;
  }
  html body.sg7.is-mail .sg7-list-name { padding: 16px 16px 9px !important; }
  html body.sg7.is-mail .sg7-list-name > span { font-size: 20px !important; }
  html body.sg7.is-mail .sg7-message-row { min-height: 72px !important; }
  html body.sg7.is-mail .sg7-mobile-bottom-nav {
    border-top-color: rgba(219, 230, 245, .9) !important;
    background: rgba(255, 255, 255, .94) !important;
    box-shadow: 0 -8px 28px rgba(24, 48, 82, .08) !important;
  }
  html body.sg7.is-mail .sg7-mobile-bottom-nav a.active {
    border-radius: 12px !important;
    background: #edf4ff !important;
    color: #1769d6 !important;
  }
  html body.sg7.is-mail .sg7-mobile-bottom-nav a.compose {
    border-radius: 14px !important;
    background: linear-gradient(135deg, #3789ff, #1260df) !important;
    box-shadow: 0 5px 14px rgba(18, 96, 223, .2);
  }
  html body.sg7.is-mail .sg7-reader-bar {
    overflow-x: auto;
    scrollbar-width: none;
  }
  html body.sg7.is-mail .sg7-reader-bar::-webkit-scrollbar { display: none; }
  html body.sg7.is-mail .sg7-page-wrap { padding-right: 12px !important; padding-left: 12px !important; }
}

/* Keep the user's dark theme intact under the new light surfaces. */
html body.sg7.dark.is-mail {
  background-color: #08172d !important;
  background-image: radial-gradient(ellipse at 82% 0%, rgba(30, 70, 125, .34), transparent 48%), linear-gradient(145deg, #0c1c35, #08162a) !important;
}
html body.sg7.dark.is-mail .sg7-shell { background: transparent !important; }
html body.sg7.dark.is-mail .sg7-sidebar {
  background: linear-gradient(165deg, #102344 0%, #0b1931 58%, #102342 100%) !important;
  border-right-color: #243957 !important;
}
html body.sg7.dark.is-mail .sg7-header {
  border-bottom-color: #253a58 !important;
  background: rgba(12, 28, 51, .96) !important;
}
html body.sg7.dark.is-mail .sg7-header-profile b,
html body.sg7.dark.is-mail .sg7-list-name > span,
html body.sg7.dark.is-mail .sg7-subject h2 { color: #e6f0ff !important; }
html body.sg7.dark.is-mail .sg7-header-profile small,
html body.sg7.dark.is-mail .sg7-list-name > small,
html body.sg7.dark.is-mail .sg7-reading-sender small,
html body.sg7.dark.is-mail .sg7-reading-sender time { color: #a6bad4 !important; }
html body.sg7.dark.is-mail .sg7-header-search,
html body.sg7.dark.is-mail .sg7-list-panel,
html body.sg7.dark.is-mail .sg7-message-card,
html body.sg7.dark.is-mail .sg7-compose-card,
html body.sg7.dark.is-mail .sg7-settings-body,
html body.sg7.dark.is-mail .sg7-documents-card {
  border-color: #293e5c !important;
  background: rgba(17, 36, 64, .98) !important;
  color: #e5efff !important;
}
html body.sg7.dark.is-mail .sg7-header-search input,
html body.sg7.dark.is-mail .sg7-list-tools,
html body.sg7.dark.is-mail .sg7-list-tools b,
html body.sg7.dark.is-mail .sg7-row-content > b,
html body.sg7.dark.is-mail .sg7-row-content > span,
html body.sg7.dark.is-mail .sg7-row-content > small,
html body.sg7.dark.is-mail .sg7-list-footer,
html body.sg7.dark.is-mail .sg7-reader-bar > a,
html body.sg7.dark.is-mail .sg7-reader-bar > form button { color: #c6d7ed !important; }
html body.sg7.dark.is-mail .sg7-header-search { border-color: #304766 !important; background: #172f50 !important; }
html body.sg7.dark.is-mail .sg7-list-tabs { border-color: #293e5c !important; background: #112440 !important; }
html body.sg7.dark.is-mail .sg7-list-tabs > a { color: #a8bad2 !important; }
html body.sg7.dark.is-mail .sg7-list-tools { border-color: #293e5c !important; }
html body.sg7.dark.is-mail .sg7-message-row { border-color: #283d5b !important; }
html body.sg7.dark.is-mail .sg7-message-row:hover { background: #172e4e !important; }
html body.sg7.dark.is-mail .sg7-message-row.selected { background: #193b68 !important; }
html body.sg7.dark.is-mail .sg7-reader-bar { border-color: #293e5c !important; background: #112440 !important; }
html body.sg7.dark.is-mail .sg7-reader-bar > a,
html body.sg7.dark.is-mail .sg7-reader-bar > form button { border-color: #334c6e !important; background: #172d4b !important; }
html body.sg7.dark.is-mail .sg7-reader-bar > a:hover,
html body.sg7.dark.is-mail .sg7-reader-bar > form button:hover { background: #203d63 !important; color: #a9ceff !important; }
html body.sg7.dark.is-mail .sg7-folder-tag { border-color: #314865 !important; background: #1a3557 !important; color: #b3c9e5 !important; }
html body.sg7.dark.is-mail .sg7-mobile-bottom-nav { border-color: #2b405e !important; background: rgba(13, 31, 55, .97) !important; }
html body.sg7.dark.is-mail .sg7-mobile-bottom-nav a { color: #a9bad1 !important; }
html body.sg7.dark.is-mail .sg7-mobile-bottom-nav a.active { background: #19365b !important; color: #a9ceff !important; }
html body.sg7.dark.is-mail .sg7-outline { border-color: #334967; background: #142a49; color: #c2d4ec; }
html body.sg7.dark.is-mail .sg7-page-head h1 { color: #e3edfc; }
html body.sg7.dark.is-mail .sg7-page-head > div > span { color: #a6bad4; }

html body.sg7.dark.is-login {
  background-color: #08172d !important;
  background-image: radial-gradient(ellipse at 18% 15%, rgba(46, 91, 153, .36), transparent 44%), linear-gradient(145deg, #0b1b34, #08162a) !important;
}
html body.sg7.dark.is-login .sg7-login-card {
  border-color: #304866 !important;
  background: rgba(17, 36, 64, .96) !important;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .3) !important;
}
html body.sg7.dark.is-login .sg7-login-card-brand b,
html body.sg7.dark.is-login .sg7-login-intro h2,
html body.sg7.dark.is-login .sg7-field-label,
html body.sg7.dark.is-login .sg7-remember b { color: #e6f0ff !important; }
html body.sg7.dark.is-login .sg7-login-intro,
html body.sg7.dark.is-login .sg7-remember small { color: #adc0da !important; }
html body.sg7.dark.is-login .sg7-input-group { border-color: #365173 !important; background: #172f50 !important; }
html body.sg7.dark.is-login .sg7-input-group input { color: #f1f6ff !important; }
html body.sg7.dark.is-login .sg7-login-shorcuts > * { border-color: #304866 !important; background: #172f50 !important; color: #c5d8f0 !important; }
html body.sg7.dark.is-login .sg7-login-shorcuts span:not(.sg7-icon) { color: #c5d8f0 !important; }
html body.sg7.dark.is-login .sg7-login-foot { color: #a6bad4 !important; }

@media (prefers-reduced-motion: reduce) {
  html body.sg7.is-mail .sg7-new-btn,
  html body.sg7.is-mail .sg7-nav-link,
  html body.sg7.is-mail .sg7-header-search,
  html body.sg7.is-mail .sg7-header-actions .sg7-round,
  html body.sg7.is-mail .sg7-reader-bar > a,
  html body.sg7.is-mail .sg7-reader-bar > form button,
  html body.sg7.is-login .sg7-login-submit { transition: none !important; }
}

/* Final light theme: quiet surfaces, clear navigation, and no decorative wallpaper. */
html body.sg7.is-mail,
html body.sg7.is-mail *:not(svg):not(path) {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

html body.sg7.is-mail:not(.dark) {
  background: #f3f6fa !important;
  background-image: none !important;
}

html body.sg7.is-mail:not(.dark) .sg7-shell {
  background: #f3f6fa !important;
  background-image: none !important;
}

html body.sg7.is-mail:not(.dark) .sg7-sidebar {
  border-right: 1px solid #e6ebf2 !important;
  background: #fff !important;
  color: #26364b !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

html body.sg7.is-mail:not(.dark) .sg7-sidebar-logo img {
  border-color: #e7ebf1;
  border-radius: 12px;
  box-shadow: none;
}
html body.sg7.is-mail:not(.dark) .sg7-sidebar-logo b { color: #142a46 !important; }
html body.sg7.is-mail:not(.dark) .sg7-sidebar-logo small { color: #718098 !important; }
html body.sg7.is-mail:not(.dark) .sg7-primary-nav { border-bottom-color: #edf0f4 !important; }

html body.sg7.is-mail:not(.dark) .sg7-new-btn {
  border-color: transparent !important;
  border-radius: 11px !important;
  background: #1769d2 !important;
  box-shadow: 0 4px 10px rgba(23, 105, 210, .14) !important;
}
html body.sg7.is-mail:not(.dark) .sg7-new-btn:hover {
  background: #0e58bd !important;
  box-shadow: 0 5px 13px rgba(23, 105, 210, .2) !important;
}

html body.sg7.is-mail:not(.dark) .sg7-nav-link { color: #53637a !important; }
html body.sg7.is-mail:not(.dark) .sg7-nav-link:hover { background: #f5f7fa !important; color: #253c59 !important; }
html body.sg7.is-mail:not(.dark) .sg7-nav-link.active {
  background: #edf4fc !important;
  box-shadow: none !important;
  color: #145db9 !important;
}
html body.sg7.is-mail:not(.dark) .sg7-nav-link.active:before { background: #2879df !important; }
html body.sg7.is-mail:not(.dark) .sg7-nav-link.active > .sg7-icon { color: #1769d2 !important; }
html body.sg7.is-mail:not(.dark) .sg7-folder-heading { color: #748196 !important; }
html body.sg7.is-mail:not(.dark) .sg7-folder-heading .sg7-icon-btn { color: #596d87 !important; }
html body.sg7.is-mail:not(.dark) .sg7-folder-heading .sg7-icon-btn:hover { background: #f1f5fa !important; }
html body.sg7.is-mail:not(.dark) .sg7-custom-folders .sg7-nav-link { color: #5c6b80 !important; }
html body.sg7.is-mail:not(.dark) .sg7-create-hint { color: #6b7b91 !important; }
html body.sg7.is-mail:not(.dark) .sg7-sidebar-end { border-top-color: #edf0f4; }
html body.sg7.is-mail:not(.dark) .sg7-help-card {
  border-color: #e7ebf1 !important;
  background: #f8fafc !important;
  color: #314963 !important;
}
html body.sg7.is-mail:not(.dark) .sg7-help-card small { color: #77869a !important; }
html body.sg7.is-mail:not(.dark) .sg7-help-card > span:first-child { background: #eaf2fc !important; color: #246bc6 !important; }
html body.sg7.is-mail:not(.dark) .sg7-sidebar-end .sg7-nav-link,
html body.sg7.is-mail:not(.dark) .sg7-logout { color: #586b84 !important; }

html body.sg7.is-mail:not(.dark) .sg7-header {
  border-bottom: 1px solid #e7ecf2 !important;
  background: #fff !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
html body.sg7.is-mail:not(.dark) .sg7-header-search {
  border-color: #e3e9f0 !important;
  border-radius: 11px !important;
  background: #f6f8fb !important;
  box-shadow: none !important;
}
html body.sg7.is-mail:not(.dark) .sg7-header-search:focus-within {
  border-color: #92b8e8 !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(31, 111, 207, .08) !important;
}
html body.sg7.is-mail:not(.dark) .sg7-header-actions .sg7-round { color: #5f7188 !important; }
html body.sg7.is-mail:not(.dark) .sg7-header-actions .sg7-round:hover {
  border-color: #e5eaf0 !important;
  background: #f5f7fa !important;
  color: #1769d2 !important;
}
html body.sg7.is-mail:not(.dark) .sg7-header-profile b { color: #34445b !important; }
html body.sg7.is-mail:not(.dark) .sg7-header-profile small { color: #8290a2 !important; }

html body.sg7.is-mail:not(.dark) .sg7-mail-grid { background: transparent !important; }
html body.sg7.is-mail:not(.dark) .sg7-list-panel,
html body.sg7.is-mail:not(.dark) .sg7-message-card {
  border: 1px solid #e4eaf1 !important;
  border-radius: 15px !important;
  background: #fff !important;
  box-shadow: 0 3px 12px rgba(32, 53, 78, .045) !important;
  backdrop-filter: none !important;
}
html body.sg7.is-mail:not(.dark) .sg7-list-name > span,
html body.sg7.is-mail:not(.dark) .sg7-subject h2 { color: #1c304a !important; }
html body.sg7.is-mail:not(.dark) .sg7-list-name > small { color: #8290a2 !important; }
html body.sg7.is-mail:not(.dark) .sg7-list-tabs { border-bottom-color: #edf0f4 !important; background: #fff !important; }
html body.sg7.is-mail:not(.dark) .sg7-list-tabs > a { color: #6d7b8e !important; }
html body.sg7.is-mail:not(.dark) .sg7-list-tabs > a.active { color: #1769d2 !important; }
html body.sg7.is-mail:not(.dark) .sg7-list-tabs > a.active:after { background: #2675d5 !important; }
html body.sg7.is-mail:not(.dark) .sg7-list-tools { border-bottom-color: #f0f2f5; color: #78879a !important; }
html body.sg7.is-mail:not(.dark) .sg7-message-row { border-bottom-color: #f0f2f5 !important; }
html body.sg7.is-mail:not(.dark) .sg7-message-row:hover { background: #f7f9fc !important; }
html body.sg7.is-mail:not(.dark) .sg7-message-row.selected {
  background: #eef5fd !important;
  box-shadow: inset 3px 0 #2d78d2 !important;
}
html body.sg7.is-mail:not(.dark) .sg7-sender-avatar { box-shadow: none !important; }
html body.sg7.is-mail:not(.dark) .sg7-reader-bar {
  border-bottom: 1px solid #edf0f4;
  background: #fff !important;
}
html body.sg7.is-mail:not(.dark) .sg7-reader-bar > a,
html body.sg7.is-mail:not(.dark) .sg7-reader-bar > form button {
  border-color: #e5eaf0 !important;
  border-radius: 9px !important;
  box-shadow: none !important;
}
html body.sg7.is-mail:not(.dark) .sg7-reader-bar > a:hover,
html body.sg7.is-mail:not(.dark) .sg7-reader-bar > form button:hover {
  border-color: #c7d9ef !important;
  background: #f4f8fd !important;
  color: #1769d2 !important;
  transform: none;
}
html body.sg7.is-mail:not(.dark) .sg7-folder-tag { border-color: #e5ebf2; background: #f5f7fa !important; color: #718097 !important; }
html body.sg7.is-mail:not(.dark) .sg7-page-wrap { background: transparent !important; }
html body.sg7.is-mail:not(.dark) .sg7-compose-card,
html body.sg7.is-mail:not(.dark) .sg7-settings-body,
html body.sg7.is-mail:not(.dark) .sg7-documents-card {
  border-color: #e4eaf1 !important;
  border-radius: 15px !important;
  background: #fff !important;
  box-shadow: 0 3px 12px rgba(32, 53, 78, .045) !important;
}

@media (max-width: 650px) {
  html body.sg7.is-mail:not(.dark),
  html body.sg7.is-mail:not(.dark) .sg7-shell {
    background: #f3f6fa !important;
    background-image: none !important;
  }
  html body.sg7.is-mail:not(.dark) .sg7-sidebar { background: #fff !important; }
  html body.sg7.is-mail:not(.dark) .sg7-list-panel,
  html body.sg7.is-mail:not(.dark) .sg7-message-card { background: #fff !important; }
}

/* Final polish: calm surfaces, sharper hierarchy, and consistent focus states. */
html body.sg7.is-mail:not(.dark) {
  background-color: #f4f7fb !important;
  background-image: radial-gradient(ellipse at 96% 0%, rgba(74, 135, 214, .075), transparent 38%), linear-gradient(180deg, #f8fafd 0%, #f1f4f8 100%) !important;
}
html body.sg7.is-mail:not(.dark) .sg7-shell { background: transparent !important; }
html body.sg7.is-mail:not(.dark) .sg7-header {
  border-bottom-color: #e7edf4 !important;
  box-shadow: 0 1px 0 rgba(28, 50, 78, .025) !important;
}
html body.sg7.is-mail:not(.dark) .sg7-header-ribbons { display: none !important; }
html body.sg7.is-mail:not(.dark) .sg7-app-nav a {
  border-radius: 9px;
  color: #66758a;
  transition: background .16s ease, color .16s ease;
}
html body.sg7.is-mail:not(.dark) .sg7-app-nav a:hover { background: #f2f6fb; color: #175fb8; }
html body.sg7.is-mail:not(.dark) .sg7-app-nav a.active { background: #edf4fc; color: #145db9; }
html body.sg7.is-mail:not(.dark) .sg7-mail-grid { gap: 16px !important; }
html body.sg7.is-mail:not(.dark) .sg7-list-panel,
html body.sg7.is-mail:not(.dark) .sg7-message-card,
html body.sg7.is-mail:not(.dark) .sg7-compose-card,
html body.sg7.is-mail:not(.dark) .sg7-settings-body,
html body.sg7.is-mail:not(.dark) .sg7-documents-card {
  border-color: #e2e9f1 !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 6px rgba(24, 45, 72, .035), 0 12px 30px rgba(24, 45, 72, .035) !important;
}
html body.sg7.is-mail:not(.dark) .sg7-list-name { padding-top: 21px !important; }
html body.sg7.is-mail:not(.dark) .sg7-list-name > span,
html body.sg7.is-mail:not(.dark) .sg7-page-head h1 {
  color: #182b45 !important;
  letter-spacing: -.35px;
}
html body.sg7.is-mail:not(.dark) .sg7-list-tabs > a { transition: color .16s ease, background .16s ease; }
html body.sg7.is-mail:not(.dark) .sg7-message-row {
  outline: none;
  transition: background .16s ease, box-shadow .16s ease;
}
html body.sg7.is-mail:not(.dark) .sg7-message-row:focus-visible {
  box-shadow: inset 0 0 0 2px #79a9e5 !important;
}
html body.sg7.is-mail:not(.dark) .sg7-sender-avatar {
  border-color: #e5ebf2 !important;
  box-shadow: 0 1px 2px rgba(21, 42, 68, .04) !important;
}
html body.sg7.is-mail:not(.dark) .sg7-reader-bar { border-radius: 12px 12px 0 0; }
html body.sg7.is-mail:not(.dark) .sg7-reader-bar > a,
html body.sg7.is-mail:not(.dark) .sg7-reader-bar > form button {
  min-height: 38px;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
html body.sg7.is-mail:not(.dark) .sg7-subject h2 { line-height: 1.3; }
html body.sg7.is-mail:not(.dark) .sg7-reading-sender { border-bottom-color: #edf1f5; }
html body.sg7.is-mail:not(.dark) .sg7-message-body { color: #29394d; line-height: 1.72; }
html body.sg7.is-mail:not(.dark) .sg7-mobile-bottom-nav {
  border-top-color: #e4eaf1 !important;
  background: rgba(255, 255, 255, .97) !important;
  box-shadow: 0 -5px 20px rgba(24, 45, 72, .055) !important;
  backdrop-filter: blur(14px);
}
html body.sg7.is-mail:not(.dark) :is(button, a, input, select, textarea):focus-visible {
  outline: 3px solid rgba(39, 112, 204, .28);
  outline-offset: 2px;
}
html body.sg7.dark.is-mail .sg7-list-panel,
html body.sg7.dark.is-mail .sg7-message-card,
html body.sg7.dark.is-mail .sg7-compose-card,
html body.sg7.dark.is-mail .sg7-settings-body,
html body.sg7.dark.is-mail .sg7-documents-card {
  box-shadow: 0 12px 30px rgba(0, 0, 0, .12) !important;
}
html body.sg7.dark.is-mail :is(button, a, input, select, textarea):focus-visible {
  outline: 3px solid rgba(116, 170, 239, .45);
  outline-offset: 2px;
}
@media (max-width: 650px) {
  html body.sg7.is-mail:not(.dark) { background-image: linear-gradient(180deg, #f7f9fc, #f0f4f8) !important; }
  html body.sg7.is-mail:not(.dark) .sg7-mail-grid { gap: 10px !important; }
  html body.sg7.is-mail:not(.dark) .sg7-list-panel,
  html body.sg7.is-mail:not(.dark) .sg7-message-card { border-radius: 13px !important; }
}
/* Mobile app: keep content in normal document flow so it cannot collapse. */
@media (max-width: 650px) {
  html body.sg7.is-mail {
    height: auto !important;
    min-height: 100dvh !important;
    padding-top: env(safe-area-inset-top) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  html body.sg7.is-mail .sg7-shell {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
  }
  html body.sg7.is-mail .sg7-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 30 !important;
  }
  html body.sg7.is-mail .sg7-content {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
  }
  html body.sg7.is-mail .sg7-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 20 !important;
    flex: 0 0 60px !important;
    height: 60px !important;
    min-height: 60px !important;
  }
  html body.sg7.is-mail .sg7-mail-grid {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    min-height: calc(100dvh - 60px) !important;
    overflow: visible !important;
  }
  html body.sg7.is-mail .sg7-mail-grid.list-only .sg7-list-panel {
    display: flex !important;
    flex: 1 0 auto !important;
    width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }
  html body.sg7.is-mail .sg7-message-scroll {
    flex: 1 0 220px !important;
    min-height: 220px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  html body.sg7.is-mail .sg7-mail-grid.has-selection .sg7-list-panel { display: none !important; }
  html body.sg7.is-mail .sg7-mail-grid.has-selection .sg7-reader-column {
    display: flex !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
  html body.sg7.is-mail .sg7-mail-grid.has-selection .sg7-message-card {
    display: flex !important;
    flex: 0 0 auto !important;
    min-height: 0 !important;
  }
  html body.sg7.is-mail .sg7-page-wrap {
    flex: 0 0 auto !important;
    min-height: calc(100dvh - 60px) !important;
    overflow: visible !important;
    padding-bottom: calc(110px + env(safe-area-inset-bottom)) !important;
  }
  html body.sg7.is-mail .sg7-mobile-bottom-nav {
    position: fixed !important;
    z-index: 30 !important;
    bottom: 0 !important;
  }
}
/* Tighten the gap between message details and the email body. */
html body.sg7.is-mail .sg7-reading-sender {
  padding: 8px 0 !important;
  margin: 0 0 4px !important;
}
html body.sg7.is-mail .sg7-reading-sender + .sg7-message-body {
  margin-top: 8px !important;
}
