/* =========================================================
   ONL core.css — truly shared, sitewide styles only.
   Loaded on EVERY page, in addition to that page's own
   scoped CSS file (search-results.css, blog-all-posts.css,
   other-tools.css, my-private-quizzes.css, etc).

   Includes:
     - :root design tokens
     - shared wrap / logo / footer chrome
     - mobile nav
     - header / footer / search overlay / buttons

   Do NOT add page-specific rules here. If a page needs its
   own look, it overrides these classes inside its own
   .page-xxx-scoped file — same pattern already used by
   search-results.css / blog-all-posts.css.
   ========================================================= */

:root {
  --page: #ffffff;
  --card: #fff;
  --ink: #161616;
  --ink-soft: #303b4a;
  --muted: #6b6b6b;
  --muted-2: #8a8a8a;
  --border: #dedede;
  --border-2: #ececec;
  --teal: #4F46E5;
  --teal-h: #4338CA;
  --teal-soft: #ECEAFB;
  --navy: #16202c;
  --indigo: #4338e0;
  --indigo-h: #372cc9;
  --soft: #ecebff;
  --purple: #7b2ba0;
  --blue: #3257e0;
  --orange: #f5891f;
  --green: #15a34a;
  /* Canonical type stacks — use var(--sans) for UI/body, var(--serif) for display headings */
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow-sm: none;
  --shadow-md: none;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Hide calculator/game explore + related links on all pages */
.more-tools-section,
.related-links,
.related-links-section,
.panel.related-links,
.calc-bottom:has(.related-links) {
  display: none !important;
}

.page-calculator .calc-side,
.math-calculator .calc-side,
.conversion-calc .calc-side,
.financial-calc .calc-side,
.word-text-calc .calc-side,
.page-time-date-calculators .calc-side,
.page-all-calculators-tools .calc-side,
.page-other-tools .calc-side,
.page-utility-tools .calc-side,
.page-time-tools .calc-side,
.page-time-tool .calc-side,
.page-calendar .calc-side {
  display: none !important;
}

.page-calculator .calc-layout,
.math-calculator .calc-layout,
.conversion-calc .calc-layout,
.financial-calc .calc-layout,
.word-text-calc .calc-layout,
.page-time-date-calculators .calc-layout,
.page-all-calculators-tools .calc-layout,
.page-other-tools .calc-layout,
.page-utility-tools .calc-layout,
.page-time-tools .calc-layout,
.page-calendar .calc-layout {
  grid-template-columns: 1fr !important;
}

/* Shared layout chrome — header/footer when using .site-shell
   or when header sits inside a page scope (.page-blog, etc.) */
.wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

@media (min-width: 1600px) {
  .wrap {
    max-width: 1400px;
  }
}

.nav a,
footer a,
#siteFooter a {
  color: inherit;
  text-decoration: none;
}

.nav svg,
footer svg,
#siteFooter svg {
  display: block;
}

.ico {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav > .wrap.nav-in {
  width: 100%;
  max-width: 1220px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.nav .logo-img,
.foot-brand .logo-img {
  display: block;
  height: 42px;
  width: auto;
  max-width: none;
  background: none;
  object-fit: contain;
}

footer,
#siteFooter {
  margin-top: 48px;
  background: #fff;
  border-top: 1px solid #e2e7ef;
  padding: 48px 0 28px;
}

footer .wrap,
#siteFooter .wrap {
  width: 100%;
  max-width: 1220px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.affiliate {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted-2);
  line-height: 1.6;
  text-align: center;
}

.copyright {
  text-align: center;
  margin-top: 20px;
  padding-top: 0;
  border-top: 0;
  font-size: 12.5px;
  color: var(--muted-2);
}

/* =========================================================
   Shared header (nav / brand / search pill / mobile toggle)
   ========================================================= */

/* Isolate site header from Bootstrap .nav (flex nav component) */
header.nav,
header#siteNav {
  display: block !important;
  flex-wrap: nowrap !important;
  padding: 0 !important;
  margin-bottom: 0 !important;
  list-style: none !important;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(223, 228, 236, .88);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .78);
}

.nav-in {
  display: flex;
  align-items: center;
  height: 84px;
  min-height: 84px;
  gap: 22px;
}

.brand {
  font-family: var(--serif);
  font-weight: 800;
  font-size: 23px;
  letter-spacing: .2px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
}

.nav-links {
  display: flex;
  gap: 30px;
  flex: 1;
  align-items: center;
}

.nav-links a {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  color: #314055;
  letter-spacing: .01em;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--teal);
  text-decoration: underline;
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 172px;
  height: 36px;
  padding: 0 8px 0 13px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: var(--card);
  color: var(--muted-2);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s;
  box-shadow: 0 3px 9px rgba(22, 31, 43, .06), 0 1px 2px rgba(22, 31, 43, .04) !important;
}

.nav-search:hover {
  border-color: #cfd4dc;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .06);
}

.nav-search .ico {
  width: 16px;
  height: 16px;
  color: var(--muted-2);
  flex: none;
}

.nav-search .ns-text {
  flex: 1;
  text-align: left;
  white-space: nowrap;
}

.nav-search .ns-kbd {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pages using .site-shell without home.css / style.css — match unified header */
.site-shell .nav > .wrap.nav-in {
  width: 100%;
  max-width: 1220px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
}

.site-shell .nav {
  position: sticky !important;
  top: 0 !important;
  z-index: 40 !important;
  background: rgba(255, 255, 255, .93) !important;
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(223, 228, 236, .88) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .78) !important;
}

.site-shell .nav-in {
  display: flex !important;
  align-items: center !important;
  height: 84px !important;
  min-height: 84px !important;
  gap: 22px !important;
}

.site-shell .nav-links {
  display: flex !important;
  gap: 30px !important;
  flex: 1 !important;
  align-items: center !important;
  min-width: 0;
}

.site-shell .nav-links a {
  font-family: var(--sans) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #314055 !important;
  letter-spacing: .01em !important;
  white-space: nowrap !important;
  padding: 0 !important;
  margin: 0 !important;
  text-decoration: none !important;
}

.site-shell .nav-links a:hover {
  color: var(--teal) !important;
  text-decoration: underline !important;
}

.site-shell .nav .logo-img {
  height: 42px !important;
  width: auto !important;
  background: none !important;
}

/* Pin search pill + auth button (beat Bootstrap .btn / button resets on site-shell pages) */
.site-shell .nav-search,
.site-shell button.nav-search {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  width: 172px !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  padding: 0 8px 0 13px !important;
  border: 1px solid var(--border) !important;
  border-radius: 21px !important;
  background: var(--card) !important;
  color: var(--muted-2) !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: normal !important;
  cursor: pointer !important;
  flex: none !important;
  box-sizing: border-box !important;
  box-shadow: 0 3px 9px rgba(22, 31, 43, .06), 0 1px 2px rgba(22, 31, 43, .04) !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.site-shell .nav-search:hover,
.site-shell button.nav-search:hover {
  border-color: #cfd4dc !important;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .06) !important;
}

.site-shell .nav-search .ico {
  width: 16px !important;
  height: 16px !important;
  color: var(--muted-2) !important;
  flex: none !important;
}

.site-shell .nav-search .ns-text {
  flex: 1 !important;
  text-align: left !important;
  white-space: nowrap !important;
}

.site-shell .nav-search .ns-kbd {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: var(--ink-soft) !important;
  background: var(--page) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  min-width: 22px !important;
  height: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.site-shell .btn.nav-login,
.site-shell a.nav-login,
.site-shell .nav-login {
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  padding: 0 16px !important;
  border-radius: 999px !important;
  gap: 8px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: normal !important;
  background: var(--card) !important;
  color: var(--ink) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 3px 9px rgba(22, 31, 43, .06), 0 1px 2px rgba(22, 31, 43, .04) !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: none !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

.site-shell .btn.nav-login:hover,
.site-shell a.nav-login:hover,
.site-shell .nav-login:hover {
  border-color: #cfd4dc !important;
  color: var(--ink) !important;
  background: var(--card) !important;
}

.site-shell .btn.nav-login .ico,
.site-shell a.nav-login .ico,
.site-shell .nav-login .ico {
  width: 15px !important;
  height: 15px !important;
  flex: none !important;
}

/* Site-shell footer polish (former style.css .page-home rules) */
.site-shell footer .foot-col:has(.tagwrap),
.site-shell #siteFooter .foot-col:has(.tagwrap) {
  display: none !important;
}

.site-shell .foot-grid,
.site-shell footer .foot-grid,
.site-shell #siteFooter .foot-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.7fr) minmax(140px, 1fr) minmax(140px, 1fr) !important;
  gap: 56px !important;
  align-items: start !important;
}

.site-shell .foot-brand > a {
  display: inline-block;
  line-height: 0;
}

.site-shell .foot-brand .logo-img {
  display: block !important;
  height: 42px !important;
  width: auto !important;
  max-width: none !important;
  background: none !important;
  object-fit: contain !important;
  margin-bottom: 16px !important;
}

.site-shell .foot-brand p {
  font-size: 13px !important;
  color: var(--muted) !important;
  line-height: 1.65 !important;
  max-width: 420px !important;
  margin: 0 0 18px !important;
}

/* Site-shell footer chrome (match home.css .page-home footer) */
.site-shell .page {
  width: 100%;
  max-width: none;
}

.site-shell footer,
.site-shell #siteFooter {
  margin-top: 48px !important;
  background: #fff !important;
  border-top: 1px solid #e2e7ef !important;
  padding: 48px 0 28px !important;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, .8) !important;
}

.site-shell footer .wrap,
.site-shell #siteFooter .wrap {
  width: 100%;
  max-width: 1220px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.site-shell .foot-col h5 {
  margin: 4px 0 18px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .16em !important;
  text-transform: uppercase !important;
  color: #5e6879 !important;
}

.site-shell .foot-col ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.site-shell .foot-col li {
  margin-bottom: 12px !important;
  font-size: 14px !important;
  color: #475367 !important;
}

.site-shell .foot-col li a:hover {
  color: var(--teal) !important;
}

.site-shell .affiliate {
  margin-top: 32px !important;
  padding-top: 22px !important;
  border-top: 1px solid var(--border) !important;
  font-size: 12px !important;
  color: var(--muted-2) !important;
  line-height: 1.6 !important;
  text-align: center;
}

.site-shell .copyright {
  text-align: center !important;
  margin-top: 20px !important;
  padding-top: 0 !important;
  border-top: 0 !important;
  font-size: 12.5px !important;
  color: var(--muted-2) !important;
}

@media (max-width: 1000px) {
  .site-shell footer .foot-grid,
  .site-shell #siteFooter .foot-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 32px !important;
  }

  .site-shell footer .foot-brand,
  .site-shell #siteFooter .foot-brand {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 640px) {
  .site-shell footer,
  .site-shell #siteFooter {
    margin-top: 34px !important;
    padding: 34px 0 24px !important;
  }

  .site-shell footer .wrap,
  .site-shell #siteFooter .wrap {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .site-shell footer .foot-grid,
  .site-shell #siteFooter .foot-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 26px 18px !important;
  }

  .site-shell footer .foot-brand,
  .site-shell #siteFooter .foot-brand {
    grid-column: 1 / -1 !important;
  }

  .site-shell footer .foot-brand p,
  .site-shell #siteFooter .foot-brand p {
    max-width: none !important;
  }

  .site-shell footer .foot-col h5,
  .site-shell #siteFooter .foot-col h5 {
    margin-bottom: 12px !important;
  }

  .site-shell footer .foot-col li,
  .site-shell #siteFooter .foot-col li {
    margin-bottom: 10px !important;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 13.5px;
  border-radius: 11px;
  padding: 11px 18px;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}

.btn:active {
  transform: translateY(1px);
}

.btn .ico {
  width: 16px;
  height: 16px;
}

.btn-teal {
  background: var(--teal);
  color: #fff;
}

.btn-teal:hover,
.btn-teal:focus,
.btn-teal:active,
a.btn-teal:visited {
  background: var(--teal-h);
  color: #fff;
}

.btn-navy {
  background: var(--navy);
  color: #fff;
}

.btn-navy:hover,
.btn-navy:focus,
.btn-navy:active,
a.btn-navy:visited {
  background: var(--navy-h);
  color: #fff;
}

.btn-ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: #cfd4dc;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card);
  cursor: pointer;
  flex: none;
  padding: 0 11px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink-soft);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

.nav.open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav.open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.nav.open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-gift-mobile {
  display: none;
}

/* =========================================================
   Shared footer
   ========================================================= */

.foot-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1.3fr;
  gap: 36px;
}

.foot-brand .logo-img {
  margin-bottom: 16px;
}

.foot-brand p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 340px;
  margin: 0 0 18px;
}

.socials {
  display: flex;
  gap: 10px;
}

.socials a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--page);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.socials a:hover {
  color: var(--teal);
  border-color: var(--teal);
}

.socials .ico {
  width: 15px;
  height: 15px;
}

.foot-col h5 {
  margin: 4px 0 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.foot-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.foot-col li {
  margin-bottom: 12px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.foot-col li a:hover {
  color: var(--teal);
}

/* =========================================================
   Shared search overlay (header-search-overlay.html: #cmdOverlay)
   ========================================================= */

.cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(18, 26, 38, .44);
  backdrop-filter: blur(2px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 96px;
}

.cmd-overlay.open {
  display: flex;
}

.cmd-panel {
  width: 620px;
  max-width: calc(100vw - 32px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(18, 26, 38, .3);
  overflow: hidden;
}

.cmd-inputrow {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 16px;
  height: 60px;
  border-bottom: 1px solid var(--border);
}

.cmd-inputrow .ico {
  width: 21px;
  height: 21px;
  color: var(--muted-2);
  flex: none;
}

.cmd-inputrow input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 17px;
  color: var(--ink);
  min-width: 0;
  padding: 0;
}

.cmd-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--page);
  color: var(--muted-2);
  cursor: pointer;
}

.cmd-results {
  max-height: 54vh;
  overflow-y: auto;
  padding: 8px;
}

.cmd-group-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 12px 12px 6px;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 12px;
  border-radius: 11px;
  cursor: pointer;
}

.cmd-item .ci-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: #fff;
}

.cmd-item .ci-ico .ico {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

/* Search popup icon backgrounds (header-scripts.html: bg-blue, bg-teal, …) */
.bg-teal { background: var(--teal); }
.bg-blue { background: var(--blue); }
.bg-purple { background: var(--purple); }
.bg-orange { background: var(--orange); }
.bg-green { background: var(--green); }
.bg-sky { background: #2f9bd6; }
.bg-slate { background: #6b7280; }
.bg-indigo { background: #5b54d6; }

.cmd-item .ci-body {
  flex: 1;
  min-width: 0;
}

.cmd-item .ci-t {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.cmd-item .ci-s {
  font-size: 12px;
  color: var(--muted);
}

.cmd-item .ci-go {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
  opacity: 0;
}

.cmd-item.active {
  background: var(--page);
}

.cmd-item.active .ci-go {
  opacity: 1;
  color: var(--teal);
}

.cmd-empty {
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

/* =========================================================
   Shared auth modal (header-auth-overlay.html)
   Moved to static/css/auth.css — login & register pages only.
   ========================================================= */

.btn.nav-login,
a.nav-login,
.nav-login {
  height: 40px;
  padding: 0 16px !important;
  border-radius: 999px;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 3px 9px rgba(22, 31, 43, .06), 0 1px 2px rgba(22, 31, 43, .04);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 0;
  white-space: nowrap;
}

.btn.nav-login .ico,
a.nav-login .ico,
.nav-login .ico {
  width: 15px;
  height: 15px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-logout .ico {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 1000px) {
  .foot-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .foot-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .nav > .wrap.nav-in {
    padding-left: 16px;
    padding-right: 16px;
  }

  .nav-in {
    height: 60px;
    min-height: 60px;
    gap: 10px;
  }

  .nav .logo-img,
  .foot-brand .logo-img {
    height: 36px;
    width: auto;
  }

  .brand {
    flex: none;
    min-width: 0;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-search {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    height: 40px;
    padding: 0 10px;
    justify-content: center;
  }

  .nav-search .ns-kbd {
    display: none;
  }

  .nav-links {
    position: absolute;
    left: 0;
    right: 0;
    top: 60px;
    display: none;
    flex: none;
    flex-direction: column;
    gap: 2px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 32px rgba(18, 26, 38, .1);
    padding: 12px 16px 18px;
    z-index: 39;
    align-items: stretch;
  }

  .nav.open .nav-links {
    display: flex;
  }

  .nav-links a {
    padding: 13px 12px;
    border-radius: 10px;
    font-size: 15px;
  }

  .nav-links a:active {
    background: var(--page);
  }

  .nav-gift-desktop {
    display: none;
  }

  .nav-gift-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding: 14px;
    border-radius: 12px;
    background: var(--teal-soft);
    border: 1px solid rgba(79, 70, 229, .25);
    color: var(--teal-h);
    font-size: 15px;
    font-weight: 700;
  }

  /* Beat desktop .site-shell nav pin rules on mobile (search, facts, namedays, etc.) */
  .site-shell .nav > .wrap.nav-in {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .site-shell .nav-in {
    height: 60px !important;
    min-height: 60px !important;
    gap: 10px !important;
  }

  .site-shell .nav .logo-img {
    height: 36px !important;
  }

  .site-shell .nav-search {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 40px !important;
    padding: 0 10px !important;
    justify-content: center !important;
  }

  .site-shell .nav-links {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 60px !important;
    display: none !important;
    flex: none !important;
    flex-direction: column !important;
    gap: 2px !important;
    background: var(--card) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: 0 16px 32px rgba(18, 26, 38, .1) !important;
    padding: 12px 16px 18px !important;
    z-index: 39 !important;
    align-items: stretch !important;
  }

  .site-shell .nav.open .nav-links {
    display: flex !important;
  }

  .site-shell .nav-links a {
    padding: 13px 12px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    white-space: normal !important;
  }

  .site-shell .nav-links a:active {
    background: var(--page) !important;
  }

  footer,
  #siteFooter {
    margin-top: 34px;
    padding: 34px 0 24px;
  }

  footer .wrap,
  #siteFooter .wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .foot-grid {
    grid-template-columns: 1fr 1fr;
    gap: 26px 18px;
  }

  .foot-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .btn.nav-login .ns-text,
  a.nav-login .ns-text,
  .nav-login .login-text {
    display: none;
  }

  .btn.nav-login,
  a.nav-login,
  .nav-login {
    width: 42px !important;
    min-width: 42px;
    padding: 0 !important;
    border-radius: 50%;
  }

  .btn.nav-login .ico,
  a.nav-login .ico,
  .nav-login .ico {
    width: 18px;
    height: 18px;
    margin: 0;
  }
}

/* Log out lives in the mobile menu; desktop users log out from /dashboard */
.nav-links .nav-auth-menu {
  display: none;
}

@media (max-width: 980px) {
  .site-shell .nav-links .nav-auth-menu,
  .nav-links .nav-auth-menu {
    display: block;
  }
}

/* User manage pages: log out from My Dashboard — hide nav link (incl. mobile) */
body.page-manage-countdowns .nav-links .nav-auth-menu,
body.page-manage-polls .nav-links .nav-auth-menu,
body.page-my-private-quizzes .nav-links .nav-auth-menu,
body.page-private-quiz-manage .nav-links .nav-auth-menu,
body.page-create-private-trivia .nav-links .nav-auth-menu {
  display: none !important;
}
