/* Epika Multi-Session v1 */
.epika-broker-item > a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.epika-broker-item.is-active > a {
  font-weight: 700 !important;
  color: #0b57d0 !important;
  background: #e8f0fe !important;
}
.epika-add-account > a {
  font-weight: 650 !important;
}
.epika-logout-all > a {
  color: #b42318 !important;
}
.epika-login-mode {
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid #d7e3f8;
  border-radius: 12px;
  background: #f4f8ff;
  color: #44546a;
  font: 600 13px/1.35 Arial, sans-serif;
  text-align: center;
}
.epika-login-cancel {
  display: block;
  width: 100%;
  margin: 12px 0 0;
  padding: 10px 14px;
  border: 1px solid #d7dee9;
  border-radius: 12px;
  background: #fff;
  color: #44546a;
  font: 600 13px/1.2 Arial, sans-serif;
  cursor: pointer;
}
.epika-login-cancel:hover {
  background: #f6f8fb;
  border-color: #bac6d6;
}

/* EPIKA_MULTISESSION_VIEWPORT_MENU_V1_BEGIN */

/*
 * Çok sayıda hesap olduğunda hesap menüsünün ekranın altından
 * taşmasını engeller. Native menü yapısını değiştirmez.
 */
#top-system-dropdown-id + menu.dropdown-menu,
#top-system-dropdown-id ~ menu.dropdown-menu,
#top-system-dropdown-id + .dropdown-menu {
  max-height: calc(100vh - 70px);
  max-height: calc(100dvh - 70px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/*
 * SnappyMail sürümüne göre toggle ile menu doğrudan kardeş olmayabilir.
 * Dropdown container içindeki gerçek menüyü de kapsa.
 */
#top-system-dropdown-id {
  position: relative;
}

#top-system-dropdown-id ~ menu.dropdown-menu,
.dropdown:has(#top-system-dropdown-id) > menu.dropdown-menu {
  max-height: calc(100vh - 70px);
  max-height: calc(100dvh - 70px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

/* Küçük/yatay olarak dar ekranlarda biraz daha fazla güvenli alan bırak. */
@media (max-height: 760px) {
  .dropdown:has(#top-system-dropdown-id) > menu.dropdown-menu {
    max-height: calc(100vh - 50px);
    max-height: calc(100dvh - 50px);
  }
}

/* EPIKA_MULTISESSION_VIEWPORT_MENU_V1_END */


/* EPIKA_MULTISESSION_UNREAD_STYLE_V1_BEGIN */
.epika-broker-item > a {
  display: flex;
  align-items: center;
  min-width: 0;
}

.epika-broker-item > a > .epika-broker-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epika-broker-item > a > .epika-broker-unread {
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* EPIKA_MULTISESSION_UNREAD_STYLE_V1_END */


/* =========================================================
   EPIKMAIL_PHASE_90C_GMAIL_ACCOUNT_UI
   ========================================================= */


/* ---------------------------------------------------------
   TOP BAR
   --------------------------------------------------------- */

.epika-top-account-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 5px;
  vertical-align: middle;
}


.epika-top-action {
  appearance: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 40px;
  height: 40px;

  margin: 0;
  padding: 0;

  border: 0;
  border-radius: 50%;

  background: transparent;
  color: #444746;

  cursor: pointer;

  transition:
    background-color .12s ease,
    color .12s ease;
}


.epika-top-action:hover {
  background: #eef2f7;
}


.epika-top-action:focus-visible {
  outline: 2px solid #0b57d0;
  outline-offset: 1px;
}


.epika-top-action svg {
  width: 21px;
  height: 21px;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/*
 * Native button remains the dropdown controller.
 * Only its presentation becomes the profile picture.
 */
#top-system-dropdown-id[data-epika-profile-toggle="1"] {
  box-sizing: border-box !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;

  height: 44px !important;
  min-height: 44px !important;

  margin: 0 !important;
  padding: 2px !important;

  overflow: visible !important;

  border: 0 !important;
  border-radius: 50% !important;

  background: transparent !important;
  box-shadow: none !important;

  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
}


#top-system-dropdown-id[data-epika-profile-toggle="1"]::before,
#top-system-dropdown-id[data-epika-profile-toggle="1"]::after {
  display: none !important;
  content: none !important;
}


#top-system-dropdown-id[data-epika-profile-toggle="1"]:hover {
  background: #eef2f7 !important;
}


#top-system-dropdown-id[data-epika-profile-toggle="1"]:focus-visible {
  outline: 2px solid #0b57d0 !important;
  outline-offset: 1px;
}


.epika-top-profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 38px;
  height: 38px;

  font-size: 14px;
  line-height: 1;

  pointer-events: none;
}


/* ---------------------------------------------------------
   SHARED AVATARS
   --------------------------------------------------------- */

.epika-account-avatar {
  box-sizing: border-box;

  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  border-radius: 50%;

  background: #dbe7fb;
  color: #174ea6;

  font-family:
    Arial,
    sans-serif;

  font-weight: 700;

  user-select: none;
}


.epika-account-avatar img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
}


.epika-account-avatar.is-top {
  width: 38px;
  height: 38px;

  border: 2px solid #fff;

  box-shadow:
    0 0 0 2px #1a73e8;

  font-size: 15px;
}


.epika-account-avatar.is-row {
  width: 38px;
  height: 38px;

  font-size: 14px;
}


.epika-account-avatar.is-hero {
  width: 72px;
  height: 72px;

  border: 3px solid #fff;

  box-shadow:
    0 0 0 3px #1a73e8;

  font-size: 26px;
}


/* ---------------------------------------------------------
   NATIVE DROPDOWN → GMAIL PANEL
   --------------------------------------------------------- */

.epika-account-dropdown
  > menu.dropdown-menu {
  box-sizing: border-box !important;

  width: 390px !important;
  min-width: 390px !important;
  max-width: min(
    390px,
    calc(100vw - 18px)
  ) !important;

  max-height:
    calc(100dvh - 78px) !important;

  padding: 8px !important;

  overflow: hidden !important;

  border: 0 !important;
  border-radius: 28px !important;

  background: #edf3fc !important;

  box-shadow:
    0 8px 30px rgba(32, 33, 36, .22) !important;
}


/*
 * Native items stay in DOM and keep handling:
 * - switching
 * - unread synchronisation
 * - add-account
 * - logout
 *
 * They are only visually hidden.
 */
.epika-account-dropdown
  > menu.dropdown-menu
  > li:not(.epika-gmail-account-shell) {
  display: none !important;
}


.epika-gmail-account-shell {
  display: block !important;

  margin: 0 !important;
  padding: 0 !important;

  list-style: none !important;
}


.epika-gmail-account-panel {
  box-sizing: border-box;

  display: flex;
  flex-direction: column;

  width: 100%;
  max-height:
    calc(100dvh - 94px);

  overflow: hidden;

  color: #1f1f1f;

  font-family:
    Arial,
    sans-serif;
}


/* ---------------------------------------------------------
   ACTIVE ACCOUNT HERO
   --------------------------------------------------------- */

.epika-account-hero {
  box-sizing: border-box;

  display: grid;
  grid-template-columns:
    76px
    minmax(0, 1fr)
    auto;

  align-items: center;
  gap: 14px;

  min-height: 112px;

  padding:
    18px
    18px
    18px
    20px;

  border-radius:
    20px
    20px
    5px
    5px;

  background: #fff;
}


.epika-account-hero-meta {
  min-width: 0;
}


.epika-account-active-label {
  display: block;

  margin-bottom: 4px;

  color: #5f6368;

  font-size: 12px;
  font-weight: 500;
}


.epika-account-active-email {
  display: block;

  overflow: hidden;

  color: #202124;

  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;

  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ---------------------------------------------------------
   OTHER ACCOUNTS
   --------------------------------------------------------- */

.epika-account-list {
  margin-top: 2px;

  max-height:
    min(410px, 48dvh);

  overflow-x: hidden;
  overflow-y: auto;

  overscroll-behavior: contain;

  border-radius: 5px;

  background: #fff;

  scrollbar-gutter: stable;
}


.epika-account-row {
  appearance: none;

  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  width: 100%;
  min-height: 59px;

  margin: 0;
  padding: 10px 16px;

  border: 0;
  border-bottom: 1px solid #e7ebf0;

  background: #fff;
  color: #202124;

  font: inherit;

  text-align: left;

  cursor: pointer;
}


.epika-account-row:last-child {
  border-bottom: 0;
}


.epika-account-row:hover {
  background: #f4f7fc;
}


.epika-account-row:disabled {
  opacity: .65;
  cursor: progress;
}


.epika-account-row-main {
  display: flex;
  align-items: center;
  gap: 12px;

  min-width: 0;
}


.epika-account-row-email {
  display: block;

  min-width: 0;

  overflow: hidden;

  font-size: 14px;
  font-weight: 500;

  text-overflow: ellipsis;
  white-space: nowrap;
}


.epika-account-unread {
  flex: 0 0 auto;

  color: #3c4043;

  font-size: 13px;
  font-weight: 600;

  font-variant-numeric:
    tabular-nums;

  white-space: nowrap;
}


.epika-account-unread:empty {
  display: none;
}


.epika-account-unread.is-hero {
  align-self: center;

  color: #0b57d0;

  font-size: 13px;
}


/* ---------------------------------------------------------
   ADD / LOGOUT
   --------------------------------------------------------- */

.epika-account-utility {
  appearance: none;

  box-sizing: border-box;

  display: flex;
  align-items: center;
  gap: 13px;

  width: 100%;
  min-height: 54px;

  margin: 2px 0 0;
  padding: 9px 17px;

  border: 0;

  background: #fff;
  color: #202124;

  font:
    500
    14px/1.25
    Arial,
    sans-serif;

  text-align: left;

  cursor: pointer;
}


.epika-account-utility:hover {
  background: #f4f7fc;
}


.epika-account-add {
  margin-top: 2px;

  border-radius:
    5px
    5px
    20px
    20px;
}


.epika-account-utility-icon {
  display: inline-flex;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;

  width: 38px;
  height: 38px;
}


.epika-account-utility-icon svg {
  width: 22px;
  height: 22px;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}


.epika-account-footer {
  margin-top: 8px;

  overflow: hidden;

  border-radius: 20px;

  background: #fff;
}


.epika-account-footer
  .epika-account-utility {
  margin: 0;

  border-bottom:
    1px solid #e7ebf0;
}


.epika-account-footer
  .epika-account-utility:last-child {
  border-bottom: 0;
}


/*
 * Calendar has now moved into the top toolbar.
 * Keep the existing launcher as the functional bridge,
 * but do not show the duplicate in the left sidebar.
 */
html.epika-account-ui-ready
  #epika-calendar-launcher {
  display: none !important;
}


/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 760px) {

  .epika-top-account-actions {
    gap: 0;
    margin-right: 1px;
  }

  .epika-top-action {
    width: 36px;
    height: 36px;
  }

  .epika-top-action svg {
    width: 19px;
    height: 19px;
  }

  #top-system-dropdown-id[data-epika-profile-toggle="1"] {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
  }

  .epika-top-profile-avatar,
  .epika-account-avatar.is-top {
    width: 34px;
    height: 34px;
  }

  .epika-account-dropdown
    > menu.dropdown-menu {
    width:
      calc(100vw - 16px) !important;

    min-width:
      0 !important;

    max-width:
      calc(100vw - 16px) !important;
  }

}




/* =========================================================
   EPIKMAIL PHASE 90K - PROFILE TOGGLE CLEANUP

   Gmail-style top-right account button must show only
   the epikmail profile avatar. Hide SnappyMail's native
   email/title/icon children without changing dropdown logic.
   ========================================================= */

#top-system-dropdown-id[data-epika-profile-toggle="1"]
  > :not(.epika-top-profile-avatar) {
  display: none !important;
}

#top-system-dropdown-id[data-epika-profile-toggle="1"]
  .epika-top-profile-avatar {
  display: flex !important;
}



/* =========================================================
   EPIKMAIL PHASE 90M - DISPLAY NAME ACCOUNT UI
   ========================================================= */

.epika-account-hero {
  grid-template-columns:
    76px
    minmax(0, 1fr) !important;

  gap: 16px !important;

  min-height: 122px !important;
}


.epika-account-hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  min-width: 0;
}


.epika-account-active-name {
  display: block;

  width: 100%;

  overflow: hidden;

  color: #202124;

  font-size: 18px;
  font-weight: 600;
  line-height: 1.28;

  text-overflow: ellipsis;
  white-space: nowrap;
}


.epika-account-active-email {
  display: block;

  width: 100%;
  margin-top: 2px;

  overflow: hidden;

  color: #5f6368;

  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.3;

  text-overflow: ellipsis;
  white-space: nowrap;
}


.epika-account-unread.is-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  align-self: flex-start;

  min-width: 0;
  height: 22px;

  margin-top: 7px;
  padding: 0 8px;

  border: 1px solid #aecbfa;
  border-radius: 999px;

  background: #e8f0fe;

  color: #0b57d0;

  font-size: 11.5px;
  font-weight: 700;
  line-height: 20px;
}


.epika-account-unread.is-hero:empty {
  display: none;
}


.epika-account-row {
  min-height: 64px;

  padding-top: 8px;
  padding-bottom: 8px;
}


.epika-account-row-main {
  flex: 1 1 auto;

  min-width: 0;
}


.epika-account-row-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;

  min-width: 0;
}


.epika-account-row-name {
  display: block;

  width: 100%;

  overflow: hidden;

  color: #202124;

  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;

  text-overflow: ellipsis;
  white-space: nowrap;
}


.epika-account-row-email {
  display: block;

  width: 100%;
  margin-top: 2px;

  overflow: hidden;

  color: #6b7280;

  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.2;

  text-overflow: ellipsis;
  white-space: nowrap;
}


.epika-account-unread:not(.is-hero) {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;

  min-width: 26px;
  height: 23px;

  margin-left: 8px;
  padding: 0 7px;

  border-radius: 999px;

  background: #eef3fb;

  color: #3c4043;

  font-size: 11.5px;
  font-weight: 700;
  line-height: 23px;

  font-variant-numeric:
    tabular-nums;
}


.epika-account-unread:not(.is-hero):empty {
  display: none;
}


@media (max-width: 760px) {

  .epika-account-active-name {
    font-size: 17px;
  }

  .epika-account-row-name {
    font-size: 13px;
  }

  .epika-account-row-email {
    font-size: 11px;
  }

}

