/* Header + popup quick action polish for Economic Calendar. */

.ec-topbar {
  position: sticky !important;
  top: 0;
  z-index: 80;
  display: block !important;
  min-height: 0 !important;
  padding: max(10px, env(safe-area-inset-top)) 14px 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  pointer-events: none;
}

.ec-topbar-inner {
  width: min(1120px, 100%);
  min-height: 64px;
  margin: 0 auto;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(14,16,20,.93), rgba(8,9,12,.88));
  box-shadow: 0 18px 48px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.035);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: auto;
}

.ec-back,
.ec-header-cta,
.ec-topbar-inner .ec-brand {
  min-height: 46px;
  border-radius: 14px;
}

.ec-back {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px 0 9px;
  color: #dce1e8;
  border: 1px solid rgba(255,255,255,.075);
  background: rgba(255,255,255,.025);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.ec-back__icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #f5c400;
  background: rgba(245,196,0,.08);
}

.ec-back__icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ec-topbar-inner .ec-brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  color: #fff;
  text-decoration: none;
}

.ec-brand-logo {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.025);
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
}

.ec-brand-logo img {
  width: 34px !important;
  height: 34px !important;
  object-fit: contain;
  filter: none !important;
}

.ec-topbar-inner .ec-brand-copy {
  display: grid;
  gap: 1px;
}

.ec-topbar-inner .ec-brand-copy b {
  color: #fff;
  font-size: 12px;
  letter-spacing: .18em;
}

.ec-topbar-inner .ec-brand-copy small {
  color: #6e7888;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .13em;
}

.ec-header-cta {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  color: #151209;
  background: linear-gradient(135deg, #ffe56d, #f5c400 48%, #b88800);
  box-shadow: 0 10px 26px rgba(245,196,0,.13);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}

.ec-back:hover,
.ec-header-cta:hover {
  transform: translateY(-1px);
}

.ec-back:hover {
  border-color: rgba(245,196,0,.22);
  background: rgba(245,196,0,.045);
}

.ec-header-cta:hover {
  box-shadow: 0 14px 34px rgba(245,196,0,.20);
}

/* Popup action bar: per-news alert next to close. */
.ec-popup-topbar {
  position: relative;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 58px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(148,163,184,.09);
  background: rgba(255,255,255,.012);
}

.ec-popup-topbar .ec-drawer-close {
  width: auto !important;
  min-height: 40px !important;
  padding: 0 10px 0 12px !important;
  border: 1px solid rgba(148,163,184,.10) !important;
  border-radius: 11px !important;
  background: rgba(255,255,255,.018) !important;
}

.ec-popup-quick-alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(244,190,24,.18);
  border-radius: 11px;
  color: #e2c452;
  background: rgba(244,190,24,.045);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, border-color .18s ease, background .18s ease, color .18s ease;
}

.ec-popup-quick-alert svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ec-popup-quick-alert:hover {
  transform: translateY(-1px);
  border-color: rgba(244,190,24,.34);
  background: rgba(244,190,24,.075);
}

.ec-popup-quick-alert.is-active {
  color: #171207;
  border-color: #d8a50d;
  background: linear-gradient(180deg, #f8d75e, #e8b113);
  box-shadow: 0 9px 22px rgba(244,190,24,.11);
}

@media (max-width: 760px) {
  .ec-topbar {
    padding: max(7px, env(safe-area-inset-top)) 8px 0 !important;
  }

  .ec-topbar-inner {
    min-height: 56px;
    padding: 6px;
    gap: 6px;
    border-radius: 16px;
  }

  .ec-back,
  .ec-header-cta,
  .ec-topbar-inner .ec-brand {
    min-height: 42px;
  }

  .ec-back {
    padding: 0 8px;
  }

  .ec-back > span:last-child,
  .ec-header-cta,
  .ec-topbar-inner .ec-brand-copy small {
    font-size: 0;
  }

  .ec-back__icon {
    width: 28px;
    height: 28px;
  }

  .ec-header-cta {
    width: 42px;
    padding: 0;
  }

  .ec-header-cta::before {
    content: "↗";
    font-size: 16px;
    line-height: 1;
  }

  .ec-brand-logo {
    width: 34px;
    height: 34px;
  }

  .ec-brand-logo img {
    width: 30px !important;
    height: 30px !important;
  }

  .ec-topbar-inner .ec-brand-copy b {
    font-size: 10px;
  }

  .ec-popup-topbar {
    min-height: 52px;
    padding: 8px 10px;
  }

  .ec-popup-quick-alert span,
  .ec-popup-topbar .ec-drawer-close span {
    display: none;
  }

  .ec-popup-quick-alert,
  .ec-popup-topbar .ec-drawer-close {
    width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
  }
}
