/* fix08 (r3) — owner review: nothing decorative ends in a hard edge, centered composition,
   conventional FAQ, account dashboard. Loaded after fix07.css on every page. */

/* ---------- 1. Decorative elements: fade out, never cut ---------- */

/* Home hero globe. The canvas drew the globe at 0.48 × its width, so the rim glow (1.14 r) ran past
   the canvas on the left/right/top and was cut by the canvas rectangle; the bottom ran past the hero.
   The canvas is now 25 % larger with the globe drawn at 0.384 (same on-screen size), so the glow has
   room, and a mask fades the glow out radially and towards the bottom of the stage. */
.hero .stage {
  --gw: min(1180px, 118vw);
  --gs: clamp(560px, 50vw, 720px);
}
.hero .stage .stage__globe {
  width: calc(var(--gw) * 1.25);
  top: calc(-36px - var(--gw) * .125);
  --fade-end: calc(var(--gs) - 40px + 36px + var(--gw) * .125);
  -webkit-mask-image: linear-gradient(#000 0, #000 calc(var(--fade-end) - 300px), #0000 var(--fade-end)), radial-gradient(closest-side, #000 84%, #0000 100%);
  mask-image: linear-gradient(#000 0, #000 calc(var(--fade-end) - 300px), #0000 var(--fade-end)), radial-gradient(closest-side, #000 84%, #0000 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.hero .stage .globe::before { background: radial-gradient(closest-side, var(--globe-halo, #288cff47), transparent 58%); }
@media (width <= 700px) {
  .hero .stage { --gs: 560px; }
  .hero .stage .stage__globe {
    width: 950px;
    top: calc(12% - 95px);
    --fade-end: 548px;
  }
}

/* Servers page globe: glow reached the canvas edge (0.44 × 1.14 = 0.50) — drawn smaller now
   (data-scale 0.40) and faded radially. */
.page-hero .globe, .page-hero__art .globe {
  -webkit-mask-image: radial-gradient(closest-side, #000 86%, #0000 100%);
  mask-image: radial-gradient(closest-side, #000 86%, #0000 100%);
}

.plans-section .beam {
  -webkit-mask-image: linear-gradient(#0000 0%, #000 22%, #000 32%, #0000 min(95%, 620px));
  mask-image: linear-gradient(#0000 0%, #000 22%, #000 32%, #0000 min(95%, 620px));
}

/* Closing CTA: the 1040 px rings were cut by the section's top and bottom edges. */
.cta .cta__rings {
  width: auto; height: auto; inset: 0; top: 0; left: 0; translate: none;
  -webkit-mask-image: linear-gradient(#0000 0%, #000 22%, #000 72%, #0000 100%);
  mask-image: linear-gradient(#0000 0%, #000 22%, #000 72%, #0000 100%);
}
.cta .cta__rings span { top: 45%; }
.cta .cta__glow {
  -webkit-mask-image: linear-gradient(#0000 0%, #000 20%, #000 80%, #0000 100%);
  mask-image: linear-gradient(#0000 0%, #000 20%, #000 80%, #0000 100%);
}

/* Account sign-in stage: three big rings were cut by the stage box. */
.signin-stage .signin-stage__bg {
  -webkit-mask-image: linear-gradient(#0000 0%, #000 18%, #000 70%, #0000 100%), radial-gradient(60% 70% at 50% 42%, #000 55%, #0000 100%);
  mask-image: linear-gradient(#0000 0%, #000 18%, #000 70%, #0000 100%), radial-gradient(60% 70% at 50% 42%, #000 55%, #0000 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

/* Page-hero glow / grid on inner pages: soften the bottom so the next section never starts on a seam */
.page-hero .page-hero__glow, .page-hero .grid-bg {
  -webkit-mask-image: linear-gradient(#000 55%, #0000 100%);
  mask-image: linear-gradient(#000 55%, #0000 100%);
}

/* ---------- 2. Centered composition ---------- */
.section > .container > .section-head,
.section > .container > div > .section-head.faq-head {
  text-align: center; justify-items: center; margin-inline: auto;
}
.section > .container > .section-head .lead { margin-inline: auto; }
.section > .container > .section-head .eyebrow { justify-content: center; }

/* Home: dApp Store section — header, cards, CTA row centered as one block */
.section.dapp .container { display: grid; justify-items: center; text-align: center; }
.section.dapp .container > .lead { margin-inline: auto; }
.section.dapp .dapp__grid { width: 100%; max-width: 1040px; text-align: left; }
.section.dapp .dapp__links { justify-content: center; }

/* Home: privacy statement */
.section.manifesto .container { justify-items: center; text-align: center; }
.section.manifesto .manifesto__text { margin-inline: auto; }

/* "More" links under sections, and the trailing links row on pricing FAQ */
.more { text-align: center; }
.container:has(> .faq) > p { text-align: center; }

/* Pricing / download / protocols: card rows directly under a centered head are centered as a block */
.section > .container > .grid:not(.dl) { justify-content: center; }

/* ---------- 3. FAQ: centered head, one centered column, button under the list ---------- */
.faq-wrap { max-width: 820px; margin-inline: auto; }
.faq-wrap .section-head { margin-inline: auto; }
.faq-more { display: flex; justify-content: center; margin-top: 32px; }
.container:has(> .faq) { max-width: calc(820px + 2 * var(--gutter)); }
.faq summary { text-align: left; }

/* Help: one centered column of questions (topics are linked from the hero chips; documents are in the footer) */
.help-layout { grid-template-columns: minmax(0, 1fr) !important; max-width: calc(820px + 2 * var(--gutter)); }
.help-layout .help-toc { display: none; }
.help-sections__title { justify-content: center; }

/* ---------- 4. Account dashboard (logged in) ---------- */
.acct .d2 { display: grid; gap: 20px; }
.d2__top { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; }
.d2__cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.d2__main, .d2__side { display: grid; gap: 20px; min-width: 0; }
.d2-card {
  border-radius: var(--r-lg); border: 1px solid var(--border);
  background: var(--surface); padding: clamp(20px, 2.4vw, 28px); min-width: 0;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.d2-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.d2-card__head h2, .d2-card__head .h3 { margin: 0; }
.d2-label { font-size: var(--fs-xs); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }

/* plan hero */
.d2-plan {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: calc(var(--r-lg) + 4px); padding: clamp(22px, 2.8vw, 32px);
  border: 1px solid var(--border-strong);
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%), linear-gradient(180deg, var(--surface-2), var(--surface));
  display: grid; gap: 20px; align-content: start;
}
.d2-plan[data-tier-kind="premium"] {
  border-color: color-mix(in srgb, var(--accent-2) 70%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-2) 35%, transparent) inset, 0 24px 60px -30px color-mix(in srgb, var(--accent-2) 60%, transparent);
}
.d2-plan__id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.d2-plan__id > div { display: grid; min-width: 0; }
.d2-plan__who { font-size: var(--fs-lg); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d2-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: #fff; background: linear-gradient(140deg, #3ec8ff, #1e7be0);
  box-shadow: 0 8px 24px -10px #3ec8ffaa;
}
.d2-tierpill {
  margin-left: auto; flex: none; height: 30px; padding: 0 12px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; letter-spacing: .12em;
  color: var(--text-2); border: 1px solid var(--border-strong); background: var(--surface);
}
.d2-plan[data-tier-kind="premium"] .d2-tierpill { color: #04121f; background: var(--accent-grad); border-color: transparent; }
:root[data-theme=light] .d2-plan[data-tier-kind="premium"] .d2-tierpill { color: #fff; }
.d2-plan__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: end; border-top: 1px solid var(--border); padding-top: 20px; }
.d2-plan__name { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin: 0 0 10px; }
.d2-plan__text { margin-top: 10px; max-width: 46ch; font-size: var(--fs-sm); }
.d2-status {
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
}
.d2-status[data-kind="off"] { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.d2-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.d2-plan__exp { display: grid; justify-items: end; text-align: right; gap: 2px; }
.d2-count {
  font-family: var(--font-display); font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); line-height: 1.05; letter-spacing: -.02em;
  color: var(--ok); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.d2-plan[data-tier-kind="free"] .d2-count { color: var(--accent-text); }
.d2-plan__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.d2-plan [data-tier-badge] { display: none !important; }

/* usage */
.d2-usage { display: grid; gap: 12px; align-content: start; background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.d2-usage__big strong { font-family: var(--font-display); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem); line-height: 1.1; letter-spacing: -.02em; }
.d2-bar { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--text-3) 22%, transparent); overflow: hidden; }
.d2-bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--ok), var(--accent-2)); transition: width .8s var(--ease); }
.d2-usage[data-kind="unlimited"] .d2-bar > span { width: 100% !important; opacity: .55; background: repeating-linear-gradient(90deg, var(--accent-2) 0 14px, color-mix(in srgb, var(--accent-2) 55%, transparent) 14px 22px); }
.d2-usage[data-kind="over"] .d2-bar > span { background: var(--warn); }
.d2-usage__meta { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); }
.d2-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.d2-mini { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); min-width: 0; }
.d2-mini strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.d2-mini .subtle { font-size: var(--fs-xs); }
.d2-mini .subtle svg { display: inline-block; vertical-align: -3px; }

/* linked methods */
.d2-methods { list-style: none; display: grid; gap: 10px; margin: 0; padding: 0; }
.d2-method { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); min-width: 0; }
.d2-method__ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; }
.d2-method__ico--tg { background: linear-gradient(140deg, #37aee2, #1e96c8); }
.d2-method__ico--g { background: #fff; border: 1px solid var(--border); }
.d2-method__ico--sol { background: linear-gradient(140deg, #9945ff, #14f195); }
.d2-method__txt { display: grid; min-width: 0; flex: 1; }
.d2-method__txt strong { font-size: var(--fs-sm); }
.d2-method__txt span { font-size: var(--fs-xs); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d2-method__state { flex: none; font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); }
.d2-method[data-linked] .d2-method__state { color: var(--ok); }
.d2-note { font-size: var(--fs-xs); color: var(--text-3); margin-top: 12px; }

/* referral (reuses the existing invite block) */
.dash-invite .d2-code { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 14px 0 10px; }
.dash-invite .d2-code strong { font-family: var(--font-display); font-size: 1.7rem; letter-spacing: .06em; }
.dash-invite .invite-link { flex-wrap: wrap; }
.d2-card.dash-invite .invite-link[data-invite] input[data-invite-url] { flex: 1 1 100%; width: 100%; }
.dash-invite .invite-link .btn { flex: 1 1 0; }
.dash-invite > * + * { margin-top: 12px; }

/* app block */
.d2-app { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: center; }
.d2-qr { width: 112px; height: 112px; border-radius: 14px; background: #fff; padding: 8px; display: block; }
.d2-qr svg { width: 100%; height: 100%; display: block; }
.d2-app__txt { display: grid; gap: 8px; justify-items: start; }
.d2-app__ver { font-family: var(--font-mono, ui-monospace, monospace); font-size: var(--fs-xs); color: var(--accent-text); }

/* support */
.d2-links { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.d2-links a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); font-size: var(--fs-sm); font-weight: 600; }
.d2-links a:hover { border-color: var(--border-strong); }
.d2-links a span.subtle { margin-left: auto; font-weight: 500; font-size: var(--fs-xs); }
.d2-links svg { color: var(--accent); flex: none; }

/* sign out */
.d2-out { display: grid; gap: 10px; justify-items: start; }

/* skeleton + error */
.acct .dsk[hidden], .acct .acct-error2[hidden], .acct .d2[hidden], .acct [data-ref-only][hidden] { display: none !important; }
.dsk { display: grid; gap: 20px; }
.dsk__top, .dsk__cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; }
.sk { border-radius: var(--r-lg); border: 1px solid var(--border); position: relative; overflow: hidden;
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%; }
@media (prefers-reduced-motion: no-preference) { .sk { animation: sk 1.4s linear infinite; } }
@keyframes sk { to { background-position: -150% 0; } }
.sk--plan { height: 300px; } .sk--usage { height: 300px; } .sk--tall { height: 720px; } .sk--side { height: 720px; }
.acct-error2 { display: grid; justify-items: center; text-align: center; gap: 12px; max-width: 560px; margin: 24px auto; padding: 36px 28px; }
.acct-error2__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 6px; }

@media (width <= 1000px) {
  .d2__top, .d2__cols, .dsk__top, .dsk__cols { grid-template-columns: minmax(0, 1fr); }
  .sk--tall, .sk--side { height: 420px; }
}
@media (width <= 560px) {
  .d2-plan__body { grid-template-columns: minmax(0, 1fr); }
  .d2-plan__exp { justify-items: start; text-align: left; }
  .d2-plan__actions .btn { flex: 1 1 100%; }
  .d2-app { grid-template-columns: 96px minmax(0, 1fr); }
  .d2-qr { width: 96px; height: 96px; }
}

/* dashboard fixes */
.d2__main, .d2__side { grid-template-columns: minmax(0, 1fr); }
.d2 .pc__cards { display: none; }
.d2-card.dash-invite .invite-link[data-invite] { flex-direction: row; flex-wrap: wrap; }
.d2-card.dash-invite .invite-link[data-invite] input[data-invite-url] { flex: 1 1 100%; height: 44px; }
.acct-hero .acct-id { display: none !important; }
/* keep the page title while loading / on error, so nothing jumps when the dashboard arrives */
main:has(#acct[data-state="loading"]) .acct-hero[hidden],
main:has(#acct[data-state="error"]) .acct-hero[hidden] { display: block !important; }
.sk--plan, .sk--usage { height: 340px; } .sk--tall, .sk--side { height: 980px; }
:root[data-theme=light] .sk { background: linear-gradient(100deg, var(--surface) 30%, var(--bg-sunken) 50%, var(--surface) 70%) 0 0 / 300% 100%; }
@media (width <= 560px) {
  .d2 .hist .table { min-width: 0 !important; width: 100%; }
  .d2 .hist .table:has(td[data-label]) thead { display: none; }
  .d2 .hist tbody tr:has(td[data-label]) { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  .d2 .hist tbody td[data-label] { display: grid; gap: 2px; padding: 0; border: 0; }
  .d2 .hist tbody td[data-label]::before { content: attr(data-label); font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
}

/* round 2 (leader): balanced columns, full-width bottom row, wrapping subtitles, sign-out card */
.d2__bottom { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.d2__bottom > .d2-card { display: grid; align-content: start; gap: 12px; }
.d2__bottom .d2-card__head { margin-bottom: 0; }
.d2-method__txt span { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; }
.d2-out > div { display: grid; gap: 8px; }
.d2-out h2 { margin: 0 0 2px; }
.d2-out .muted { font-size: var(--fs-sm); }
.d2-out .subtle { font-size: var(--fs-xs); }
.d2-out > .btn { justify-self: start; margin-top: 4px; }
@media (width <= 1100px) { .d2__bottom { grid-template-columns: 1fr 1fr; } .d2__bottom > .d2-out { grid-column: 1 / -1; } }
@media (width <= 700px) { .d2__bottom { grid-template-columns: minmax(0, 1fr); } }
/* equal column bottoms whatever the data: the last card of each column takes up the slack */
@media (width > 1000px) {
  .d2__cols { align-items: stretch; }
  .d2__main, .d2__side { display: flex; flex-direction: column; }
  .d2__main > :last-child, .d2__side > :last-child { flex: 1 1 auto; }
}

/* round 2: stronger centering where component styles won */
section.section.manifesto > .container.container { justify-items: center; text-align: center; }
section.section.manifesto .manifesto__text { max-width: 24em; }
/* hero without artwork (protocols): centered like the home and help heroes */
.page-hero:not(.page-hero--art) .page-hero__copy { text-align: center; display: grid; justify-items: center; margin-inline: auto; max-width: 860px; }
.page-hero:not(.page-hero--art) .page-hero__copy .lead { margin-inline: auto; }
.page-hero:not(.page-hero--art) .page-hero__copy > :is(.pill, .eyebrow) { justify-self: center; }
p.safety { justify-content: center; text-align: center; }

/* round 2: the globe must never be cut by the viewport either — on desktop it fits (≤ 94vw),
   on phones it stays a big backdrop but fades out softly 60 px before each screen edge. */
.hero .stage { --gw: min(1180px, 94vw); }
.hero .stage .stage__globe {
  -webkit-mask-image: linear-gradient(#000 0, #000 calc(var(--fade-end) - 300px), #0000 var(--fade-end)), radial-gradient(closest-side, #000 84%, #0000 100%), linear-gradient(90deg, #0000 calc(50% - 50vw), #000 calc(50% - 50vw + 60px), #000 calc(50% + 50vw - 60px), #0000 calc(50% + 50vw));
  mask-image: linear-gradient(#000 0, #000 calc(var(--fade-end) - 300px), #0000 var(--fade-end)), radial-gradient(closest-side, #000 84%, #0000 100%), linear-gradient(90deg, #0000 calc(50% - 50vw), #000 calc(50% - 50vw + 60px), #000 calc(50% + 50vw - 60px), #0000 calc(50% + 50vw));
  -webkit-mask-composite: source-in, source-in;
  mask-composite: intersect, intersect;
}

/* round 3 (leader): Premium usage = compact statement, no empty tiles, no fake bar */
.d2-usage__line { font-size: var(--fs-sm); max-width: 34ch; }
.d2-usage:not([data-kind="unlimited"]) .d2-usage__line { display: none; }
.d2-usage[data-kind="unlimited"]:not([data-has-numbers]) :is(.d2-bar, .d2-usage__meta, .d2-split) { display: none; }
.d2-usage[data-kind="unlimited"] [data-usage-kind] { display: none; }
.d2-usage[data-kind="unlimited"]:not([data-has-numbers]) { align-content: center; }
.d2-usage[data-kind="unlimited"]:not([data-has-numbers]) .d2-card__head { position: absolute; top: clamp(20px, 2.4vw, 28px); left: clamp(20px, 2.4vw, 28px); right: clamp(20px, 2.4vw, 28px); }
.d2-usage { position: relative; }
.d2-usage[data-kind="unlimited"]:not([data-has-numbers]) .d2-usage__big strong { color: var(--ok); }
.d2-usage[data-kind="unlimited"]:not([data-has-numbers]) .d2-usage__big::before {
  content: "∞"; display: block; font-family: var(--font-display); font-size: 3.4rem; line-height: 1; color: var(--accent-2); margin-bottom: 6px;
}

/* round 3: sign-in stack — Google's own button and our rows share one size, shape and layout */
.signin .signin__buttons { width: 100%; max-width: 400px; margin-inline: auto; gap: 12px; }
.signin .signin__buttons .signin__btn {
  min-height: 0; height: 44px; border-radius: 999px; padding: 0 14px 0 6px;
  grid-template-columns: 32px 1fr 32px; gap: 8px; font-size: 14px; font-weight: 500; letter-spacing: .01em; text-align: center;
}
.signin .signin__buttons .signin__btn .signin__ico { width: 32px; height: 32px; border-radius: 50%; }
.signin .signin__buttons .signin__btn .signin__ico svg { width: 18px; height: 18px; }
.signin .signin__buttons .signin__btn .signin__go { justify-self: end; }
:root[data-theme=dark] .signin .signin__buttons .signin__btn { background: #202124; border-color: #202124; color: #e8eaed; }
:root[data-theme=dark] .signin .signin__buttons .signin__btn:hover { border-color: #5f6368; }
:root[data-theme=light] .signin .signin__buttons .signin__btn { background: #fff; border-color: #dadce0; color: #1f1f1f; }
.signin .signin__gsi[data-gsi] { min-height: 44px; display: flex; justify-content: center; align-items: center; }
.signin .signin__gsi[data-gsi] > div, .signin .signin__gsi iframe { margin: 0 auto !important; }
/* rows: no trailing arrow (Google's button has none); text centred on the whole row like Google's */
.signin .signin__buttons .signin__btn { grid-template-columns: 32px 1fr; padding: 0 44px 0 6px; white-space: nowrap; }
.signin .signin__buttons .signin__btn .signin__go { display: none; }

/* Google's iframe draws its button 10 px inside each edge of the requested width; inset our rows the same */
.signin .signin__buttons .signin__btn { width: calc(100% - 20px); justify-self: center; }
