/* Shared by every page: things the designs don't define themselves, the phone layout, and small pieces of behavior. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 3px solid #A5B4FC; outline-offset: 2px; }
button { font: inherit; }
[hidden] { display: none !important; }
img { max-width: 100%; }
[data-in], [data-out] { } /* shown or hidden by the script once it knows who is signed in */
body.out [data-in], body.in [data-out], body.unknown [data-in] { display: none !important; }
.soon { cursor: default; }
.logo { text-decoration: none; }
#spend { position: absolute; right: 14px; top: -8px; font-size: 13px; font-weight: 700; color: #B91C1C; pointer-events: none; }
#spend.show { animation: spendUp 1.2s ease forwards; }
@keyframes spendUp { 0% { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-22px); } }

/* Toasts */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(480px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 14px; background: #111827; color: #FFFFFF; font-family: Inter, sans-serif; font-size: 15px; box-shadow: 0 12px 30px rgba(17,24,39,.25); animation: toastIn .25s ease; }
.toast button { margin-left: auto; border: 0; background: none; color: #A5B4FC; font-weight: 600; cursor: pointer; min-height: 36px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* Dialog (agree to a monthly charge, account menu) */
dialog { border: 0; border-radius: 20px; padding: 28px; width: min(460px, calc(100vw - 32px)); font-family: Inter, sans-serif; color: #111827; box-shadow: 0 30px 60px rgba(17,24,39,.25); }
dialog::backdrop { background: rgba(17,24,39,.45); }
dialog h2 { margin: 0; font-family: Outfit, sans-serif; font-size: 22px; letter-spacing: -.01em; }
dialog p, dialog li { color: #4B5563; line-height: 1.6; font-size: 15px; }
dialog ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
dialog label { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: #111827; cursor: pointer; }
dialog input[type=checkbox] { width: 20px; height: 20px; accent-color: #4338CA; margin: 1px 0 0; flex: none; }
.dlg { display: flex; flex-direction: column; gap: 16px; }
.dlg .acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.dlg .err { color: #B91C1C; font-size: 14px; margin: 0; }
.b { font: inherit; font-size: 15px; font-weight: 600; min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid #D1D5DB; background: #FFFFFF; color: #111827; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.b.main { background: #4338CA; color: #FFFFFF; border-color: #4338CA; }
.b[disabled] { opacity: .45; cursor: not-allowed; }

/* Account menu on the credits page */
#acct-menu { position: absolute; right: 0; top: 52px; min-width: 220px; padding: 8px; border-radius: 14px; background: #FFFFFF; border: 1px solid #E5E7EB; box-shadow: 0 18px 40px rgba(17,24,39,.14); display: flex; flex-direction: column; z-index: 20; }
#acct-menu a, #acct-menu button { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: #374151; font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
#acct-menu a:hover, #acct-menu button:hover { background: #F3F4F6; }

/* ---------------- Phones and small screens ---------------- */
@media (max-width: 860px) {
  .top { padding: 16px 20px !important; gap: 12px !important; }
  .top-links { gap: 8px 18px !important; font-size: 15px !important; width: 100%; justify-content: space-between; }
  .pad-section { padding: 72px 20px !important; gap: 36px !important; }
  .hero { padding: 64px 20px 72px !important; gap: 48px !important; }
  .hero > div:not([aria-hidden]) { flex-basis: 100% !important; }
  .foot { padding: 48px 20px 28px !important; gap: 32px !important; }
  .foot-cols { gap: 40px !important; }
  .photo-band { padding: 32px 24px !important; gap: 28px !important; }
  .wide { padding-left: 20px !important; padding-right: 20px !important; }
  .stack-sm { flex-direction: column !important; align-items: stretch !important; }
}
@media (max-width: 600px) {
  .top-links { justify-content: flex-start; }
  .top-links .cta { order: 3; }
  .foot-cols > div { min-width: 120px; }
  .grid-1 { grid-template-columns: minmax(0, 1fr) !important; }
  h1 { font-size: clamp(30px, 9vw, 44px) !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Log in page on phones: the form comes first, then a compact version of the side panel. */
@media (max-width: 860px) {
  .login { flex-direction: column !important; flex-wrap: nowrap !important; min-height: 0 !important; }
  .login-main { order: 1; flex: none !important; width: 100%; padding: 20px !important; }
  .login-side { order: 2; flex: none !important; padding: 40px 24px !important; gap: 28px !important; }
}