/* ============================================================
   CITIZEN — single-page site additions
   ============================================================ */

/* Verified contract address in hero */
.hero__contract { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 20px; padding: 10px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); }
.hero__contract-label { font-size: 12px; font-weight: 600; color: #16c784; white-space: nowrap; }
.hero__contract code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; word-break: break-all; flex: 1 1 auto; min-width: 0; }
.hero__contract-copy { cursor: pointer; font-size: 11px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text); white-space: nowrap; }
.hero__contract-copy:hover { background: var(--line); }
.hero__contract-scan { font-size: 12px; white-space: nowrap; }

/* Collapsible directs list */
.dash__team-toggle { margin: 10px 0 4px; cursor: pointer; font-size: 12px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text); font-family: inherit; }
.dash__team-toggle:hover { background: var(--line); }
#directsList.is-collapsed { display: none; }

/* Inline registration widget in hero */
.reg-widget { padding: 24px; align-self: start; position: relative; }
.reg-widget__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.reg-widget__head b { font-family: 'Space Grotesk'; font-size: 17px; }
.reg-widget .step.is-hidden { display: none; }
.reg-widget .calc { margin: 18px 0; }
.reg-widget .live { margin-bottom: 16px; }
.reg-widget .streams { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 16px; margin-bottom: 16px; }

/* Tighter stream rows inside the widget */
.reg-widget .stream { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.reg-widget .stream:last-child { border-bottom: none; }
.reg-widget .stream__icon { font-size: 18px; }
.reg-widget .stream__info b { font-family: 'Space Grotesk'; font-size: 14px; }
.reg-widget .stream__info span { font-size: 11.5px; }
.reg-widget .stream__val { text-align: right; }
.reg-widget .stream__val b { font-family: 'Space Grotesk'; font-size: 14px; font-variant-numeric: tabular-nums; }
.reg-widget .stream__val span { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; display: block; }

/* ---------- Registration success (widget) ---------- */
.done-confirm { display: flex; gap: 14px; align-items: flex-start; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.done-confirm__check { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #06121b; font-size: 20px; font-weight: 700; display: grid; place-items: center; box-shadow: var(--glow); }
.done-confirm p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.done-confirm p b { color: var(--text); font-family: 'Space Grotesk'; }
#goDashboard { margin-bottom: 10px; }

/* ---------- My Dashboard ---------- */
.dash { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; align-items: start; }
.dash__main { padding: 26px; }
.dash__pos { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.dash__pos-item { display: flex; flex-direction: column; gap: 4px; }
.dash__pos-item span { font-size: 12px; }
.dash__pos-item b { font-family: 'Space Grotesk'; font-size: 20px; font-variant-numeric: tabular-nums; }

.dash__cap { padding: 18px 0; border-bottom: 1px solid var(--line); }
.dash__cap-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 10px; }
.dash__cap-top b { font-family: 'Space Grotesk'; color: var(--text); }
.cap-progress__bar { height: 9px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.cap-progress__fill { height: 100%; width: 0%; background: var(--grad); border-radius: 99px; box-shadow: 0 0 12px rgba(56,225,201,.5); transition: width .25s var(--ease); }
.dash__cap-legend { display: flex; justify-content: space-between; margin-top: 9px; font-size: 12px; color: var(--muted); }
.dash__cap-legend b { color: var(--text); font-family: 'Space Grotesk'; }
.dash__cap-hint { margin-top: 10px; font-size: 11.5px; color: var(--muted-2); line-height: 1.5; }
.dash__cap-hint b { color: var(--muted); }

.dash__incomes { display: flex; flex-direction: column; gap: 4px; padding-top: 18px; }
.dinc { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 13px 6px; border-bottom: 1px solid var(--line); }
.dinc:last-child { border-bottom: none; }
.dinc__icon { font-size: 22px; }
.dinc__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dinc__info b { font-family: 'Space Grotesk'; font-size: 15px; }
.dinc__info span { font-size: 11.5px; }
.dinc__earned { text-align: right; display: flex; flex-direction: column; gap: 1px; }
.dinc__earned b { font-family: 'Space Grotesk'; font-size: 16px; font-variant-numeric: tabular-nums; }
.dinc__earned span { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.dinc__tiers { font-size: 11px; padding: 8px 6px 2px; line-height: 1.7; }
.dinc__tiers:empty { display: none; }
.dinc__tiers b { font-family: 'Space Grotesk'; font-variant-numeric: tabular-nums; color: var(--text); }

.dash__side { padding: 24px; position: sticky; top: 90px; }
.dash__avail { text-align: center; padding: 6px 0 18px; }
.dash__avail span.muted { font-size: 13px; }
.dash__avail-amt { font-family: 'Space Grotesk'; font-weight: 700; margin-top: 8px; display: flex; align-items: baseline; justify-content: center; gap: 7px; }
.dash__avail-amt b { font-size: 32px; font-variant-numeric: tabular-nums; }
.dash__avail-amt span { color: var(--cyan); font-size: 15px; }
.dash__wd { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 16px; margin-bottom: 16px; }
.dash__wd-row { display: flex; justify-content: space-between; padding: 10px 0; font-size: 13.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.dash__wd-row:last-child { border-bottom: none; }
.dash__wd-row b { font-family: 'Space Grotesk'; color: var(--text); font-variant-numeric: tabular-nums; }
.dash__wd-row--net b { font-size: 16px; }
.dash__msg { font-size: 12.5px; color: var(--cyan); min-height: 18px; margin: 12px 0; text-align: center; line-height: 1.5; }
.dash__reinvest { border-top: 1px solid var(--line); padding-top: 18px; }
.dash__reinvest span { font-size: 12.5px; display: block; margin-bottom: 12px; line-height: 1.5; }

@media (max-width: 940px) { .dash { grid-template-columns: 1fr; } .dash__side { position: static; } }
@media (max-width: 560px) { .dash__pos { grid-template-columns: 1fr; } }

/* Web3 toast */
.w3toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 24px); z-index: 200;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 13px 20px;
  font-size: 14px; font-weight: 500; color: var(--text); box-shadow: 0 18px 50px -16px rgba(0,0,0,.8);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); max-width: 90vw; }
.w3toast.show { opacity: 1; transform: translate(-50%, 0); }
.w3toast.ok  { border-color: rgba(56,225,201,.5); }
.w3toast.err { border-color: rgba(255,107,107,.55); color: #ffd9d9; }

/* Highlighted live Royalty Fund banner */
.royalty-fund {
  display: grid; grid-template-columns: 1.2fr 1.4fr; gap: 24px; align-items: center;
  background: linear-gradient(120deg, rgba(233,196,106,.12), rgba(56,225,201,.06));
  border: 1px solid rgba(233,196,106,.4); border-radius: var(--r-lg);
  padding: 26px 28px; margin-bottom: 24px;
  box-shadow: 0 0 60px -20px rgba(233,196,106,.5);
  position: relative; overflow: hidden;
}
.royalty-fund::before { content:""; position:absolute; inset:0; border-radius:inherit; padding:1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity:.35; pointer-events:none; }
.royalty-fund__label { display: flex; align-items: center; gap: 10px; font-family: 'Space Grotesk'; font-weight: 600; font-size: 15px; color: var(--gold-2); }
.royalty-fund__amt { font-family: 'Space Grotesk'; font-weight: 700; margin: 10px 0 6px; display: flex; align-items: baseline; gap: 8px; }
.royalty-fund__amt b { font-size: 40px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.royalty-fund__amt span { color: var(--cyan); font-size: 16px; }
.royalty-fund__sub { font-size: 12.5px; color: var(--muted); }
.royalty-fund__stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.royalty-fund__stats div { background: rgba(7,9,15,.5); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.royalty-fund__stats span { font-size: 11.5px; display: block; margin-bottom: 5px; }
.royalty-fund__stats b { font-family: 'Space Grotesk'; font-size: 22px; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .royalty-fund { grid-template-columns: 1fr; } }

/* Magic Fund variant (cyan/violet instead of gold) */
.royalty-fund--magic { background: linear-gradient(120deg, rgba(56,225,201,.12), rgba(155,109,255,.08)); border-color: rgba(56,225,201,.4); box-shadow: 0 0 60px -20px rgba(56,225,201,.5); }
.royalty-fund--magic .royalty-fund__label { color: var(--cyan); }
.royalty-fund__stats--magic { grid-template-columns: repeat(5,1fr); }
.royalty-fund__stats--magic b { font-size: 18px; }
@media (max-width: 760px) { .royalty-fund__stats--magic { grid-template-columns: repeat(2,1fr); } }

/* Differential cascade explainer */
.cascade { margin-top: 18px; padding: 24px 26px; }
.cascade__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.cascade__head b { font-family: 'Space Grotesk'; font-size: 17px; }
.cascade__head span { font-size: 12.5px; }
.cascade__flow { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 460px; margin: 0 auto; }
.casc-node { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 14px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 13px 18px; }
.casc-node__rank { font-family: 'Space Grotesk'; font-weight: 600; font-size: 15px; }
.casc-node__rank small { color: var(--muted); font-weight: 400; }
.casc-node__earn { font-size: 13.5px; color: var(--muted); }
.casc-node__earn b { font-size: 16px; }
.casc-node__earn small { font-size: 11px; opacity: .8; }
.casc-node--reg { background: rgba(233,196,106,.08); border-color: rgba(233,196,106,.35); }
.casc-node--reg .casc-node__rank { color: var(--gold-2); }
.casc-arrow { color: var(--cyan); font-size: 16px; line-height: 1; opacity: .7; }
.cascade__note { margin-top: 18px; font-size: 13px; color: var(--muted); line-height: 1.6; text-align: center; max-width: 620px; margin-inline: auto; }
.cascade__note b { color: var(--text); }

/* Withdrawal note in widget */
.withdraw-note { font-size: 12px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 14px; margin-bottom: 10px; line-height: 1.5; }
.withdraw-note b { color: var(--text); font-family: 'Space Grotesk'; font-variant-numeric: tabular-nums; }

/* Derived rank badge in calculator */
.rank-badge { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 14px 16px; margin-top: 22px; }
.rank-badge > div { display: flex; flex-direction: column; gap: 2px; }
.rank-badge span.muted { font-size: 12px; }
.rank-badge b { font-family: 'Space Grotesk'; font-size: 20px; }
.rank-badge__hint { font-size: 12px; color: var(--cyan); text-align: right; }

/* Six-tick rank ruler */
.cfield__ticks span:nth-child(n+4) { font-size: 10px; }

/* Hero adjustments for the widget */
.hero { align-items: start; padding-top: 56px; }
.hero__trust { margin-top: 30px; }

/* Section rhythm */
.strip { padding-bottom: 20px; }
.plan-section:first-of-type { padding-top: 40px; }

@media (max-width: 940px) {
  .reg-widget { margin-top: 8px; }
}

/* ---------- Mobile nav (hamburger) ---------- */
.nav__burger { display: none; flex-direction: column; justify-content: center; gap: 4px; width: 42px; height: 40px; padding: 0 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 11px; cursor: pointer; transition: border-color .2s, background .2s; }
.nav__burger:hover { border-color: var(--cyan); background: var(--surface-2); }
.nav__burger span { display: block; height: 2px; width: 100%; border-radius: 2px; background: var(--grad); transition: transform .25s var(--ease), opacity .2s; }
.nav__burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 940px) {
  .nav__inner { gap: 12px; }
  .nav__burger { display: flex; }
  .nav__links { position: absolute; top: 70px; left: 0; right: 0; display: none; flex-direction: column;
    background: rgba(7,9,15,.98); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-2);
    box-shadow: 0 20px 40px -16px rgba(0,0,0,.7); padding: 8px 24px 16px; gap: 0; z-index: 60; }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 13px 2px; border-bottom: 1px solid var(--line); font-size: 15.5px; }
  .nav__links a:last-child { border-bottom: none; }
  .connectBtn, #connectBtn { font-size: 13px; padding: 9px 14px; }
}

/* ---------- Dashboard referral link ---------- */
.dash__ref { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 16px; }
.dash__ref > span.muted { font-size: 12.5px; display: block; margin-bottom: 10px; }
.dash__ref-box { display: flex; gap: 8px; }
.dash__ref-box input { flex: 1; min-width: 0; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 14px; color: var(--gold-2); font-size: 12px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; text-overflow: ellipsis; transition: border-color .2s; }
.dash__ref-box input:focus { outline: none; border-color: var(--cyan); }
.dash__ref-box .btn { padding: 11px 16px; }
.dash__ref-box .btn { flex-shrink: 0; }
.dash__ref-hint { display: block; margin-top: 9px; font-size: 11.5px; color: var(--muted-2); line-height: 1.5; }

/* ---------- Mobile overflow fixes (let grid/flex items shrink) ---------- */
.field__input input, .dash__ref-box input, .ref__box input, .ref__link input { min-width: 0; }
@media (max-width: 940px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .reg-widget, .hero__copy, .dash__main, .dash__side, .calc-inputs, .calc-output,
  .ref, .stake__form, .stake__viz { min-width: 0; }
  .container { overflow-x: clip; }
}

@media (max-width: 760px) {
  .royalty-fund, .royalty-fund__main, .royalty-fund__stats { min-width: 0; }
  .royalty-fund__amt b { font-size: 30px; }
  .royalty-fund__stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .hero__title { font-size: 30px; }
  .reg-widget { padding: 20px; }
}

/* ---------- Withdrawal history ---------- */
.wd-hist { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.wd-hist > span.muted { font-size: 12.5px; display: block; margin-bottom: 10px; }
.wd-hist__empty { font-size: 12.5px; color: var(--muted-2); padding: 6px 0; }
.wd-hist__row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.wd-hist__row:last-of-type { border-bottom: none; }
.wd-hist__amt { display: flex; flex-direction: column; }
.wd-hist__amt b { font-family: 'Space Grotesk'; font-size: 14px; font-variant-numeric: tabular-nums; }
.wd-hist__amt span { font-size: 11px; color: var(--muted-2); }
.wd-hist__row a { font-size: 11.5px; color: var(--cyan); white-space: nowrap; }
.wd-hist__total { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.wd-hist__total b { color: var(--gold-2); font-family: 'Space Grotesk'; }

/* ---------- Dashboard: directs + rank hint (2x2 position grid) ---------- */
.dash__pos { grid-template-columns: repeat(2, 1fr); gap: 16px 14px; }
.dash__pos-hint { display: block; font-size: 11px; color: var(--cyan); margin-top: 3px; }

.dash__wd-row small { color: var(--muted-2); font-size: 10.5px; }

/* ---------- Your directs (team) ---------- */
.dash__team { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; }
.dash__team-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.dash__team-head > span { font-size: 12.5px; }
.dash__team-head b { font-family: 'Space Grotesk'; color: var(--text); }
.dash__team-ref b { font-variant-numeric: tabular-nums; }
.dir__empty { font-size: 12.5px; color: var(--muted-2); padding: 8px 0; line-height: 1.5; }
.dir__row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); }
.dir__row:last-child { border-bottom: none; }
.dir__row > a { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--cyan); }
.dir__roi { text-align: right; display: flex; flex-direction: column; gap: 1px; }
.dir__roi b { font-family: 'Space Grotesk'; font-size: 14px; font-variant-numeric: tabular-nums; }
.dir__roi span { font-size: 10px; }
.btn--sm { padding: 8px 14px; font-size: 12.5px; }

/* ---------- Total withdrawn (from contract state) ---------- */
.wd-total { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 16px; margin: 4px 0 16px; }
.wd-total__row { display: flex; justify-content: space-between; padding: 10px 0; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.wd-total__row:last-child { border-bottom: none; }
.wd-total__row b { font-family: 'Space Grotesk'; font-variant-numeric: tabular-nums; }
