.wrap { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }
.main { padding-top: 28px; padding-bottom: calc(var(--tabbar-h) + 40px); min-height: calc(100vh - var(--header-h)); }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 40; height: var(--header-h); background: rgba(15, 15, 15, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.site-header__inner { display: flex; align-items: center; gap: 24px; height: 100%; }
.site-header__spacer { flex: 1; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.1em; font-size: 14px; color: var(--text); }
.brand:hover { color: var(--text); text-decoration: none; }
.brand__logo { display: block; width: auto; height: 32px; flex: none; }
@media (max-width: 600px) { .site-header__inner { gap: 12px; } .brand__logo { height: 30px; } }
@media (max-width: 360px) {
  .site-header__inner { gap: 8px; }
  .brand__logo { height: 26px; }
  .header__wallet .wallet-chip__balance { padding-left: 8px; padding-right: 8px; }
}
.nav { display: none; gap: 2px; height: 100%; }
.nav__link { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--text-3); font-weight: 500; font-size: 14px; transition: color var(--ease), background var(--ease); }
.nav__link:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav__link.is-active { color: var(--text); }
.nav__link.is-active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; }
.header__wallet, .header__account { display: flex; align-items: center; gap: 10px; }
.account__email { display: none; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: 13px; }
/* Optional account linking lives in the account menu at every viewport size. */
.account__loading { width: 60px; height: 28px; background: var(--surface); }

/* mobile tabs */
.tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: var(--tabbar-h); display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom); background: rgba(23, 23, 23, 0.96); border-top: 1px solid var(--border); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 11px; font-weight: 500; transition: color var(--ease), background var(--ease); }
.tab:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.tab.is-active { color: var(--accent); }
.tab.is-active::before { content: ''; position: absolute; top: 0; width: 28px; height: 2px; background: var(--accent); }
.tab .count { position: absolute; top: 6px; left: calc(50% + 8px); min-width: 16px; height: 16px; font-size: 10px; }

.site-footer { border-top: 1px solid var(--border); padding: 20px 0 calc(var(--tabbar-h) + 20px); color: var(--text-3); font-size: 12.5px; }
.site-footer__legal { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; }
.site-footer__legal a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.legal { max-width: 760px; padding: 28px 0 40px; }
.legal h1 { font-size: 26px; margin: 0 0 6px; }
.legal__section { margin-top: 24px; }
.legal__section h2 { font-size: 17px; margin: 0 0 8px; }
.legal__section p, .legal__section li { color: var(--text-2); line-height: 1.6; }
.legal__section ul { padding-left: 20px; margin: 8px 0; }

/* pages */
.page { display: flex; flex-direction: column; gap: 22px; }
.page__head { display: flex; flex-direction: column; gap: 6px; }
.page__head h1 { font-size: 30px; }
.page__head p { color: var(--text-2); max-width: 70ch; }
.page__foot { color: var(--text-3); font-size: 12.5px; }
.section { display: flex; flex-direction: column; gap: 14px; }
.section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section__head h2 { font-size: 16px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13.5px; width: fit-content; }
.back-link:hover { color: var(--text); text-decoration: none; }

/* toasts */
.toasts { position: fixed; z-index: 90; right: 16px; left: 16px; bottom: calc(var(--tabbar-h) + 12px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 12px 14px; background: var(--surface-2); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent); animation: toast-in 0.18s ease-out; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: all 0.18s; }
.toast__icon { color: var(--accent); }
.toast__body { flex: 1; min-width: 0; }
.toast__title { display: block; font-size: 14px; }
.toast__message { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.toast__action { margin-top: 6px; background: none; border: 0; color: var(--accent); font-weight: 600; padding: 0; }
.toast__close { background: none; border: 0; color: var(--text-3); padding: 2px; transition: color var(--ease); }
.toast__close:hover { color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (min-width: 860px) {
  .nav { display: flex; }
  .tabbar { display: none; }
  .main { padding-top: 40px; padding-bottom: 72px; }
  .site-footer { padding-bottom: 28px; }
  .account__email { display: block; }
  .toasts { left: auto; width: 380px; bottom: 20px; }
  .page__head h1 { font-size: 34px; }
}
.header__account .account__open { display: inline-flex; }

/* Email verification reminder between the header and the page. */
.verify-banner { margin-top: 16px; }
.verify-banner:empty { display: none; }
