:root {
  --ink: #0b0d18; --ink2: #121633; --ink3: #1b2046; --line: rgba(255, 207, 63, 0.18);
  --gold: #ffcf3f; --red: #ff3b3b; --green: #3ddc84; --white: #ffffff; --mute: rgba(255, 255, 255, 0.62);
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tap: 48px; --r: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--white); font-family: var(--body); }
body { display: flex; flex-direction: column; min-height: 100dvh; overflow: hidden; }
button, input, a { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* in-app browser banner */
.inapp { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; background: var(--gold); color: var(--ink);
  font: 700 13px/1.3 var(--mono); padding-top: max(10px, env(safe-area-inset-top)); }
.inapp[hidden] { display: none; }
.inapp p { margin: 0; flex: 1; }
.inapp-btn { background: var(--ink); color: var(--gold); text-decoration: none; padding: 9px 12px; border-radius: 999px; white-space: nowrap; }
.inapp-btn[hidden] { display: none; }
.inapp-x { background: none; border: 0; width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line); position: relative; z-index: 2; background: var(--ink); }
.inapp:not([hidden]) + .top { padding-top: 10px; }
.brand { display: flex; align-items: center; gap: 10px; }
.seal { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--gold); display: grid; place-items: center;
  font: 900 20px/1 var(--display); color: var(--gold); box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 4px rgba(255, 207, 63, 0.5); }
.brand-txt { display: flex; flex-direction: column; line-height: 1; }
.brand-txt b { font: 900 21px/1 var(--display); letter-spacing: 0.04em; text-transform: uppercase; }
.brand-txt small { font: 500 10px/1.4 var(--mono); color: var(--gold); letter-spacing: 0.22em; text-transform: uppercase; margin-top: 3px; }
.count { font: 700 11px/1 var(--mono); color: var(--green); letter-spacing: 0.08em; border: 1px solid rgba(61, 220, 132, 0.4); padding: 7px 10px; border-radius: 999px; }
.count[hidden] { display: none; }

/* layout */
.app { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.stage { position: relative; height: 47dvh; min-height: 260px; flex: none; overflow: hidden;
  background:
    radial-gradient(60% 50% at 50% 38%, rgba(120, 110, 200, 0.35), transparent 70%),
    radial-gradient(40% 18% at 50% 88%, rgba(255, 207, 63, 0.22), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255, 207, 63, 0.035) 0 1px, transparent 1px 22px),
    linear-gradient(180deg, #151935, var(--ink)); }
.view { position: absolute; inset: 0; }
.view canvas { display: block; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; font: 700 12px var(--mono); letter-spacing: 0.18em; color: var(--gold); text-transform: uppercase; }
.loading.done { display: none; }
.hint { position: absolute; left: 16px; bottom: 14px; margin: 0; font: 500 11px var(--mono); color: var(--mute); letter-spacing: 0.12em; text-transform: uppercase; pointer-events: none; transition: opacity .6s; }
.fab { position: absolute; right: 16px; bottom: 12px; height: 52px; padding: 0 18px 0 14px; border-radius: 999px; border: 2px solid var(--gold);
  background: rgba(11, 13, 24, 0.75); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: var(--gold);
  display: flex; align-items: center; gap: 8px; font: 900 20px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.fab:active { transform: scale(0.96); }
.fab.roll svg { animation: roll .5s ease; }
@keyframes roll { to { transform: rotate(360deg); } }

/* sheet */
.sheet { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--ink2); border-radius: 22px 22px 0 0;
  margin-top: -18px; position: relative; z-index: 1; box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4); border-top: 1px solid var(--line); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px 8px; scrollbar-width: none; flex: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.14); background: transparent;
  font: 800 17px/1 var(--display); letter-spacing: 0.05em; text-transform: uppercase; color: var(--mute); }
.tab[aria-selected="true"] { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.panel { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 12px; overscroll-behavior: contain; }
.ctl { margin: 10px 0 18px; }
.ctl h3 { margin: 0 0 10px; font: 700 11px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); display: flex; justify-content: space-between; }
.ctl h3 span { color: var(--mute); letter-spacing: 0.06em; text-transform: none; font-weight: 500; }
.ctl .note { margin: 8px 0 0; font: 500 12px var(--mono); color: var(--mute); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: var(--tap); padding: 0 16px; border-radius: 14px; border: 1.5px solid rgba(255, 255, 255, 0.14); background: var(--ink3);
  font: 600 15px/1 var(--body); color: var(--white); }
.chip[aria-checked="true"] { border-color: var(--gold); background: rgba(255, 207, 63, 0.14); color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; padding: 0; position: relative; background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), inset 0 -6px 10px rgba(0, 0, 0, 0.25); }
.sw[aria-checked="true"]::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2.5px solid var(--gold); }
.sw.none { background: var(--ink3); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.25); }
.sw.none::before { content: ""; position: absolute; left: 50%; top: 10px; bottom: 10px; width: 2px; background: var(--red); transform: rotate(45deg); }
.sw.custom { background: conic-gradient(#ff3b3b, #ffcf3f, #3ddc84, #2f7bff, #8f5bff, #ff3b3b); overflow: hidden; }
.sw.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
.sw.custom.on { background: var(--c); }
.sw.custom.on::before { content: "+"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 18px var(--mono); color: rgba(255,255,255,.85); text-shadow: 0 1px 2px #000; }
.stepper { display: flex; gap: 8px; align-items: center; }
.stepper .chip { width: var(--tap); padding: 0; font-size: 22px; }
.stepper input { width: 88px; height: var(--tap); border-radius: 14px; border: 1.5px solid rgba(255,255,255,.14); background: var(--ink3); color: var(--white); text-align: center; font: 700 20px var(--mono); }
.grouplabel { width: 100%; font: 500 11px var(--mono); color: var(--mute); letter-spacing: 0.1em; text-transform: uppercase; margin: 4px 0 -2px; }
.cta { flex: none; padding: 10px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--ink2); }
.primary { width: 100%; min-height: 56px; border: 0; border-radius: 16px; background: var(--gold); color: var(--ink);
  font: 900 24px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; box-shadow: 0 6px 0 #b8890c, 0 10px 24px rgba(255, 207, 63, 0.25); }
.primary:active { transform: translateY(3px); box-shadow: 0 3px 0 #b8890c; }
.primary:disabled { opacity: 0.6; }
.secondary { display: grid; place-items: center; width: 100%; min-height: 52px; border-radius: 16px; border: 2px solid var(--gold); color: var(--gold); text-decoration: none;
  font: 900 20px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; background: transparent; }
.ghost { min-height: 52px; border: 0; background: transparent; color: var(--mute); font: 700 13px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.foot { margin: 9px 0 0; text-align: center; font: 500 11px var(--mono); color: var(--mute); letter-spacing: 0.04em; }

/* dialogs */
.dlg { border: 1px solid var(--line); border-radius: 22px; background: var(--ink2); color: var(--white); padding: 22px 18px 18px; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.dlg::backdrop { background: rgba(5, 6, 12, 0.78); backdrop-filter: blur(3px); }
.dlg h2 { margin: 2px 0 14px; font: 900 40px/0.95 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.eyebrow { margin: 0; font: 700 11px var(--mono); color: var(--gold); letter-spacing: 0.22em; text-transform: uppercase; }
.field { display: block; font: 700 11px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); margin-bottom: 8px; }
.handle-box { display: flex; align-items: center; border: 2px solid rgba(255, 255, 255, 0.18); border-radius: 14px; background: var(--ink); padding-left: 14px; }
.handle-box:focus-within { border-color: var(--gold); }
.handle-box.bad { border-color: var(--red); }
.handle-box span { font: 700 22px var(--mono); color: var(--gold); }
.handle-box input { flex: 1; min-width: 0; height: 56px; border: 0; background: transparent; font: 700 20px var(--mono); padding: 0 12px 0 4px; outline: none; }
.err { min-height: 18px; margin: 8px 0 0; font: 500 12px var(--mono); color: var(--red); }
.small { font: 500 12px/1.5 var(--mono); color: var(--mute); margin: 10px 0 0; }
.row { display: flex; gap: 10px; margin-top: 16px; align-items: center; }
.row .primary { flex: 1; }
.row.col { flex-direction: column; align-items: stretch; }
.turnstile:empty { display: none; }
.turnstile { margin-top: 10px; }
.dlg-card { padding-top: 18px; }
.dlg-card h2 { font-size: 34px; margin-bottom: 12px; }
.card-fig { margin: 0; display: grid; place-items: center; }
.card-fig img { display: block; width: auto; max-width: 100%; height: auto; max-height: 52dvh; border-radius: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  -webkit-touch-callout: default; user-select: auto; }
.hold { text-align: center; font: 700 12px var(--mono); color: var(--gold); letter-spacing: 0.1em; text-transform: uppercase; margin: 12px 0 0; }
.hold[hidden], [hidden] { display: none !important; }

.toast { position: fixed; left: 50%; bottom: 120px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .25s;
  background: var(--white); color: var(--ink); font: 700 13px var(--mono); padding: 11px 16px; border-radius: 999px; max-width: calc(100vw - 32px); z-index: 10; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* verification */
.pending-bar { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 0 10px; padding: 0 14px; border-radius: 12px;
  border: 1px dashed rgba(255, 207, 63, 0.6); background: rgba(255, 207, 63, 0.08); color: var(--gold); font: 700 13px var(--mono); text-align: left; }
.pending-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; animation: pulse 1.6s infinite; }
.pending-bar span:nth-child(2) { flex: 1; }
.pending-bar .go { font-size: 20px; }
@keyframes pulse { 50% { opacity: .3; } }
.verify { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px 14px; margin: 0 0 14px; background: rgba(11, 13, 24, 0.55); }
.vhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vpill { font: 700 11px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; color: var(--red); border: 1.5px dashed var(--red); }
.vpill.ok { color: var(--ink); background: var(--green); border: 1.5px solid var(--green); }
.vwait { font: 500 11px var(--mono); color: var(--mute); }
.vtext { margin: 10px 0 0; font: 500 14px/1.5 var(--body); }
.vcode { font: 700 16px var(--mono); color: var(--gold); letter-spacing: 0.06em; white-space: nowrap; }
.vrow { display: flex; gap: 10px; margin-top: 12px; }
.vrow > * { flex: 1; min-height: 48px; font-size: 17px; }
.primary.slim { display: grid; place-items: center; min-height: 48px; font-size: 17px; text-decoration: none; box-shadow: 0 4px 0 #b8890c; }
@media (prefers-reduced-motion: reduce) { .pending-bar .dot { animation: none; } }

/* dispute + edit link + footer */
.dcode { margin: 14px 0 4px; text-align: center; }
.dcode .vcode { font-size: 34px; letter-spacing: .08em; }
.linkbox { width: 100%; margin-top: 10px; height: 44px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: var(--ink); color: var(--mute); font: 500 12px var(--mono); padding: 0 10px; }
.ghost.tiny { min-height: 36px; font-size: 11px; width: 100%; margin-top: 6px; }
.ghost.danger { width: 100%; color: var(--red); font-size: 11px; min-height: 40px; margin-top: 6px; }
.foot.fine { margin-top: 4px; font-size: 10px; opacity: .8; }
.foot a { color: inherit; }

#takenTitle, #dTitle { font-size: 30px; overflow-wrap: anywhere; }
.dlg h2 { overflow-wrap: anywhere; }
#editLinkBox .vrow { flex-direction: column; }

/* desktop: stage left, builder right */
@media (min-width: 900px) {
  body { overflow: hidden; }
  .app { flex-direction: row; }
  .stage { height: auto; flex: 1.35; }
  .sheet { flex: 1; max-width: 520px; margin: 0; border-radius: 0; border-top: 0; border-left: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) { .fab.roll svg { animation: none; } .toast { transition: none; } }

/* social links (header icons, "Follow for the show" pills in the card dialog) */
.top-r { display: flex; align-items: center; gap: 10px; }
.socials { display: flex; gap: 2px; }
.socials a { width: 42px; height: 42px; display: grid; place-items: center; color: var(--gold); border-radius: 50%; }
.socials a:hover, .socials a:focus-visible { background: rgba(255, 207, 63, 0.12); }
.socials svg { width: 24px; height: 24px; }
.follow-h { margin-top: 14px; text-align: center; }
.follows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 6px 0 4px; }
.follow { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 6px; border: 1.5px solid var(--gold);
  border-radius: 12px; color: var(--gold); text-decoration: none; font: 700 13px/1 var(--display); letter-spacing: 0.04em; text-transform: uppercase; }
.follow svg { width: 22px; height: 22px; flex: none; }
.follow:hover, .follow:focus-visible { background: var(--gold); color: var(--ink); }
@media (max-width: 360px) { .socials a { width: 38px; height: 38px; } .socials svg { width: 22px; height: 22px; } .follow span { font-size: 11px; } }

/* top nav on every page: CREATE A CITIZEN / FIND A CITIZEN (active = gold) */
.tabsnav { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px 16px 8px; background: var(--ink); border-bottom: 1px solid var(--line); position: relative; z-index: 2; flex: none; }
.tabsnav a { min-height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1.5px solid rgba(255, 255, 255, 0.14); color: var(--mute);
  text-decoration: none; font: 800 17px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; text-align: center; padding: 0 8px; }
.tabsnav a:hover { color: var(--white); border-color: rgba(255, 207, 63, 0.5); }
.tabsnav a[aria-current="page"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.top:has(+ .tabsnav) { border-bottom: 0; }
/* wide screens: the two tabs sit IN the top bar, centred between the logo and the social icons (Yagel 2026-10-25) */
@media (min-width: 900px) {
  body { position: relative; }
  .tabsnav { position: absolute; top: 0; left: 50%; transform: translateX(-50%); grid-template-columns: repeat(2, 210px); justify-content: center;
    padding: 8px 0; background: transparent; border: 0; z-index: 3; }
  .tabsnav a { min-height: 40px; font-size: 15px; }
  .top:has(+ .tabsnav) { border-bottom: 1px solid var(--line); }
}
/* document pages (privacy, edit): normal scrolling */
body.doc { display: block; overflow: auto; }
.fsoc { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.fsoc a { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; text-decoration: none; color: var(--gold); }
.fsoc svg { width: 16px; height: 16px; }
.publicnote { margin: 4px 0 0; font-size: 11px; }
.publicnote a { color: var(--gold); }
.owner-bar { border-style: solid; border-color: rgba(61, 220, 132, 0.55); background: rgba(61, 220, 132, 0.08); color: var(--green); }
.owner-bar .dot { background: var(--green); animation: none; }
#handle[readonly] { color: var(--gold); }
/* the citizen count floats on the stage (the header stays one line on phones: brand + social icons) */
.stage-count { position: absolute; top: 12px; left: 16px; z-index: 1; background: rgba(11, 13, 24, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.brand-txt b, .brand-txt small { white-space: nowrap; }
/* phones: give the builder options room (the tabs row pushed them off screen, Yagel 2026-10-25) */
@media (max-width: 899px) {
  .top { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 6px; }
  .tabsnav { padding: 2px 16px 6px; }
  .tabsnav a { min-height: 38px; font-size: 14px; border-radius: 10px; }
  .stage { height: 36dvh; min-height: 210px; }
  .cta { padding-top: 8px; }
  .cta .foot { margin-top: 6px; }
  .cta .fsoc { display: none; }   /* the header already has the social icons */
}
@media (max-width: 899px) and (max-height: 700px) { .stage { height: 32dvh; min-height: 190px; } }
/* phones: the bottom bar is ONLY the button (Yagel: "Get my passport is just blocking the menu"); fine print moved into the handle dialog */
@media (max-width: 899px) {
  .cta { padding: 8px 16px max(8px, env(safe-area-inset-bottom)); }
  .cta .foot { display: none; }
  .cta .primary { min-height: 48px; font-size: 20px; border-radius: 14px; box-shadow: 0 4px 0 #b8890c; }
  .cta .pending-bar { min-height: 32px; margin: 0 0 6px; font-size: 12px; }
}
/* category row arrows (js/tabarrows.js) */
.tabs-wrap { position: relative; flex: none; }
.tabs-wrap::before, .tabs-wrap::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40px; pointer-events: none; z-index: 1; opacity: 0; transition: opacity .2s; }
.tabs-wrap::before { left: 0; background: linear-gradient(90deg, var(--ink2) 30%, transparent); }
.tabs-wrap::after { right: 0; background: linear-gradient(270deg, var(--ink2) 30%, transparent); }
.tabs-wrap.more-left::before, .tabs-wrap.more-right::after { opacity: 1; }
.tabs-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--gold); background: var(--ink); color: var(--gold); font: 900 24px/1 var(--display); display: grid; place-items: center;
  padding: 0 0 3px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); cursor: pointer; }
.tabs-arrow.left { left: 6px; } .tabs-arrow.right { right: 6px; }
.tabs-arrow[hidden] { display: none; }
