.site-account-trigger[aria-expanded="true"] { background: #eaf5ff; color: #0878df; }
.site-account-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #101a2c80;
}
.site-account-overlay[hidden] { display: none; }
.site-account-panel {
  width: min(320px, 100%);
  max-height: min(620px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid #e5e9ee;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 18px 55px #0003;
  color: #20242b;
  font-family: Inter, Arial, sans-serif;
}
.site-account-profile { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; }
.site-account-avatar {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #168cef, #0759b8);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}
.site-account-profile-copy { min-width: 0; flex: 1; }
.site-account-profile-copy h2 { overflow: hidden; margin: 0 0 4px; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.site-account-profile-copy p { overflow: hidden; margin: 0 0 3px; color: #78828f; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.site-account-profile-copy small { color: #8a93a0; font-size: 9px; }
.site-account-close {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #edf6fc;
  color: #445466;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.site-account-close:hover { background: #dcefff; color: #0878df; }
.site-account-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 18px 14px; }
.site-account-stat { padding: 9px 10px; border-radius: 9px; background: #e5f4ff; }
.site-account-stat:hover { background: #d6edff; }
.site-account-stat strong,.site-account-stat span { display: block; }
.site-account-stat strong { color: #155bb2; font-size: 15px; }
.site-account-stat span { margin-top: 3px; color: #708092; font-size: 9px; }
.site-account-menu { display: grid; gap: 2px; padding: 11px 12px; border-top: 1px solid #edf0f3; }
.site-account-menu a {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #20242b;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.site-account-menu a:hover, .site-account-menu a:focus-visible { background: #f1f7fc; }
.site-account-icon { display: grid; width: 26px; height: 26px; flex: 0 0 26px; place-items: center; border-radius: 7px; background: #e8f5ff; color: #34475a; }
.site-account-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.site-account-copy strong,.site-account-copy small { display: block; }
.site-account-copy strong { color: #303945; font-size: 10px; font-weight: 650; }
.site-account-copy small { margin-top: 3px; color: #87909c; font-size: 9px; }
.site-account-logout {
  display: flex;
  width: calc(100% - 24px);
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 12px 12px;
  border: 0;
  border-radius: 9px;
  background: #111;
  color: #fff;
  font: 600 10px Inter, Arial, sans-serif;
  cursor: pointer;
}
.site-account-logout:hover { background: #30343a; }
.site-account-logout svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

/* Flash messages after a redirect (all public pages). */
.site-flash-stack { display: grid; gap: 8px; max-width: 1380px; margin: 16px auto 0; padding: 0 46px; }
.site-flash { margin: 0; padding: 12px 16px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.site-flash-success { background: #e8f7ee; color: #1f6a3d; }
.site-flash-info { background: #eaf4ff; color: #22507e; }
.site-flash-error { background: #fdecec; color: #9b2424; }
@media (max-width: 760px) { .site-flash-stack { padding: 0 16px; } }

/* site.css hides the last topbar icon on phones; that icon is now the real account entry. */
@media (max-width: 760px) { .topbar-actions .icon-button:last-child { display: grid; } }

/* Guest sign-in / sign-up in the topbar (desktop & tablet); phones keep the icon. */
.topbar-login { display: inline-flex; min-height: 44px; align-items: center; padding: 0 10px; border-radius: 10px; color: #0567c9; font-size: 15px; font-weight: 600; }
.topbar-login:hover { background: #f0f5fa; }
.topbar-signup { display: inline-flex; min-height: 44px; align-items: center; padding: 0 18px; border-radius: 12px; background: linear-gradient(180deg, #2d60af, #4f96e1); color: #fff; font-size: 15px; font-weight: 600; }
.topbar-signup:hover { filter: brightness(1.06); }
.account-icon-mobile { display: none !important; }

/* Tablet: the main nav cannot fit its two CTA buttons, so they move up to the topbar. */
.topbar-cta { display: none; }
@media (min-width: 761px) and (max-width: 1150px) {
  .nav-actions { display: none; }
  .topbar-cta { display: inline-flex; }
  .topbar-cta-alt { background: linear-gradient(180deg, #549de5, #85bff2); }
  .topbar-actions { gap: 8px; }
  .topbar-login, .topbar-signup { font-size: 13px; }
}
@media (min-width: 761px) and (max-width: 1000px) { .date { display: none; } }

@media (max-width: 760px) {
  .topbar-login, .topbar-signup, .topbar-cta { display: none; }
  .account-icon-mobile { display: grid !important; }
}

/* Value proposition + sign-up prompts for guests (home page, reading page). */
.join-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin: 22px 0; padding: 16px 20px; border: 1px solid #d6e6f7; border-radius: 14px; background: #f3f8fe; }
.join-banner p { flex: 1 1 420px; margin: 0; color: #33404e; font-size: 15px; line-height: 1.55; }
.join-banner strong { color: #14233a; }
.join-banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.join-banner-cta { display: inline-flex; min-height: 44px; align-items: center; padding: 0 20px; border-radius: 12px; background: linear-gradient(180deg, #2d60af, #4f96e1); color: #fff; font-size: 15px; font-weight: 600; }
.join-banner-cta:hover { filter: brightness(1.06); }
.join-banner-link { display: inline-flex; min-height: 44px; align-items: center; color: #0567c9; font-size: 15px; font-weight: 600; }
.article-join { margin: 32px 0 8px; padding: 22px 24px; border: 1px solid #d6e6f7; border-radius: 14px; background: #f3f8fe; }
.article-join h2 { margin: 0 0 6px; font-size: 19px; }
.article-join p { margin: 0 0 14px; color: #33404e; font-size: 15px; line-height: 1.55; }
@media (max-width: 760px) {
  .join-banner { margin: 16px 0; padding: 14px 16px; }
  .join-banner p { flex-basis: 100%; font-size: 14px; }
}
