/* ── Light theme by default, dark theme opt-in ──────────────────────────── */
:root {
  color-scheme: light;
  --bg: #f1f4f9;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --surface-3: #eaeef6;
  --line: #dde4ef;
  --line-soft: #e9edf4;
  --text: #101422;
  --text-2: #3d4658;
  --muted: #5c6576;
  --accent-solid: #c8f24f;
  --accent-ink: #16200a;
  --accent-text: #4a7209;
  --mint: #0d9d8c;
  --violet: #5b4bd6;
  --pink: #cf3468;
  --bar-top: #86cf2e;
  --bar-bottom: #0fa694;
  --track: #e5eaf2;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 12px 30px rgba(15, 23, 42, .07);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --glow: rgba(91, 75, 214, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1220;
  --surface: #171d2e;
  --surface-2: #1d2437;
  --surface-3: #242c42;
  --line: #2c3448;
  --line-soft: #252c3e;
  --text: #f4f6fb;
  --text-2: #c5ccdb;
  --muted: #9aa3b7;
  --accent-solid: #d8ff65;
  --accent-ink: #101320;
  --accent-text: #d8ff65;
  --mint: #52e0c4;
  --violet: #9b8bf5;
  --pink: #f25f98;
  --bar-top: #d8ff65;
  --bar-bottom: #52e0c4;
  --track: #2a3247;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --glow: rgba(99, 76, 255, .14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; position: relative; z-index: 2; }
.ambient { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .07; pointer-events: none; }
[data-theme="dark"] .ambient { opacity: .16; }
.ambient-one { width: 34rem; height: 34rem; background: var(--violet); top: -16rem; right: -8rem; }
.ambient-two { width: 30rem; height: 30rem; background: var(--mint); top: 70rem; left: -20rem; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.brand > span:last-child > span { color: var(--accent-text); }
.brand small { display: block; margin-top: -2px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.brand-mark { width: 34px; height: 34px; position: relative; display: inline-grid; place-items: center; border-radius: 11px; background: linear-gradient(135deg, var(--accent-solid), var(--mint)); }
.brand-mark i { position: absolute; width: 15px; height: 4px; border-radius: 8px; background: #11152a; }
.brand-mark i:first-child { transform: rotate(60deg); }.brand-mark i:nth-child(2) { transform: rotate(-60deg); }.brand-mark i:nth-child(3) { width: 5px; height: 5px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.personal-pill { padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .09em; box-shadow: var(--shadow-sm); }

.theme-toggle { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm); cursor: pointer; transition: color .18s ease, border-color .18s ease; }
.theme-toggle:hover { color: var(--text); border-color: var(--violet); }
.theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero { padding: 64px 0 88px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: start; gap: 64px; }
.eyebrow { color: var(--accent-text); font-size: 12px; font-weight: 800; letter-spacing: .13em; }
.hero h1 { margin: 14px 0 18px; font-size: clamp(38px, 5vw, 62px); line-height: 1.04; letter-spacing: -.04em; font-weight: 800; }
.hero h1 em, .studio-heading h2 em { color: var(--accent-text); font-style: normal; }
.hero-copy > p { max-width: 620px; color: var(--text-2); font-size: 17px; line-height: 1.6; }
.hero-actions { margin-top: 28px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-actions > span { color: var(--muted); font-size: 14px; }
.primary-button, .ghost-button { min-height: 48px; border: 0; border-radius: 13px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; font-size: 15px; font-weight: 700; text-decoration: none; transition: transform .18s ease, filter .18s ease, border-color .18s ease; }
.primary-button { color: var(--accent-ink); background: var(--accent-solid); box-shadow: var(--shadow-sm); }
.primary-button:hover, .ghost-button:hover { transform: translateY(-1px); filter: brightness(1.04); }
.primary-button:disabled { opacity: .5; cursor: wait; transform: none; }
.primary-button img { width: 21px; height: 21px; }
.ghost-button { border: 1px solid var(--line); color: var(--text-2); background: var(--surface); box-shadow: var(--shadow-sm); }
.ghost-button:hover { color: var(--text); }
.privacy-line { display: flex; align-items: flex-start; gap: 9px; margin-top: 20px; color: var(--muted); font-size: 14px !important; line-height: 1.55; }
.privacy-line i { width: 8px; height: 8px; margin-top: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--mint); }

/* Home right column: the featured card, then the 24h ranking beneath it. */
.hero-side { display: grid; gap: 22px; align-content: start; }
.hero-spotlight { display: block; text-decoration: none; transition: transform .25s ease, box-shadow .25s ease; }
a.hero-spotlight:hover { transform: rotate(0deg) translateY(-4px); box-shadow: 0 36px 80px rgba(15, 23, 42, .32); }
.hero-spotlight.is-placeholder { transform: rotate(-2deg); }
.hero-board { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 20px 22px; }
.hero-board-head h2 { margin: 6px 0 0; font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.hero-leaderboard { margin-top: 12px; }
.hero-leaderboard li { grid-template-columns: 34px 1fr auto; gap: 11px; padding: 9px 0; }
.hero-leaderboard .leaderboard-rank { width: 28px; height: 28px; font-size: 13px; }
.hero-leaderboard .leaderboard-name { font-size: 14px; }
.hero-leaderboard .leaderboard-tokens { font-size: 14px; }
.leaderboard-name-link { color: inherit; text-decoration: none; }
.leaderboard-name-link:hover { color: var(--violet); text-decoration: underline; }

/* Decorative demo card — intentionally keeps its own dark artwork. */
.hero-card { aspect-ratio: 1; border-radius: 32px; padding: 46px; position: relative; overflow: hidden; transform: rotate(2deg); background: radial-gradient(circle at 88% 10%, rgba(67,240,219,.45), transparent 35%), radial-gradient(circle at 20% 90%, rgba(245,82,150,.35), transparent 38%), linear-gradient(145deg, #101634, #352264 58%, #65234e); color: #fff; box-shadow: 0 30px 70px rgba(15, 23, 42, .28); }
.hero-card::before { content: ""; position: absolute; inset: 18px; border: 1px solid rgba(255,255,255,.12); border-radius: 24px; }
.hero-card span, .hero-card b, .hero-card small { position: relative; display: block; }
.hero-card span { margin-top: 26px; color: #d8ff65; font-size: 15px; font-weight: 800; letter-spacing: .12em; }
.hero-card strong { position: relative; display: block; margin: 14px 0 -2px; font-size: clamp(48px, 6vw, 76px); line-height: .95; letter-spacing: -.05em; }
.hero-card b { font-size: 17px; letter-spacing: .04em; }
.hero-card small { margin-top: 36px; padding: 15px; border-radius: 999px; text-align: center; background: rgba(6,9,18,.6); font-size: 11px; font-weight: 800; letter-spacing: .07em; }
.hero-bars { height: 88px; margin-top: 30px; display: flex; align-items: end; gap: 8px; position: relative; }
.hero-bars i { flex: 1; min-height: 8%; border-radius: 7px; background: linear-gradient(#d8ff65, #52e0c4); }
.hero-bars i:nth-child(2n) { height: 38%; }.hero-bars i:nth-child(3n) { height: 72%; }.hero-bars i:nth-child(4n) { height: 92%; }.hero-bars i:nth-child(5n) { height: 55%; }

/* ── Sign-in ────────────────────────────────────────────────────────────── */
.signin-panel { margin-bottom: 72px; padding: 24px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.signin-status { display: flex; align-items: center; gap: 16px; }
.signin-status strong { font-size: 17px; }
.signin-status p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.spinner { width: 24px; height: 24px; flex: 0 0 auto; border: 3px solid var(--track); border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.device-code { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.device-code > div { margin-right: auto; }
.device-code span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .11em; }
.device-code strong { display: block; margin-top: 4px; font: 800 28px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; color: var(--text); }

/* ── Studio ─────────────────────────────────────────────────────────────── */
.dashboard { padding-bottom: 88px; }
.studio-heading { padding: 56px 0 32px; display: grid; grid-template-columns: 1fr .55fr; align-items: end; gap: 36px; }
.studio-heading h2 { max-width: 720px; margin: 12px 0 0; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; letter-spacing: -.035em; font-weight: 780; }
.studio-heading p { margin: 0; color: var(--text-2); font-size: 16px; line-height: 1.6; }
/* Settings on top, the shared result underneath — the order people think in. */
.studio { display: grid; gap: 18px; }
.studio-settings { display: grid; gap: 4px; }
.studio-preview { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 26px; }
.background-field .theme-carousel { grid-template-columns: 40px 1fr 40px; gap: 8px; margin: 0; }
.background-field .theme-carousel button { width: 40px; height: 44px; border-radius: 11px; font-size: 18px; }
.background-field .theme-carousel div { text-align: center; min-width: 0; }
.background-field .theme-carousel strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.background-field .theme-carousel small { font-size: 11px; }
.network-tabs button { flex: 0 1 auto; }
.background-editor { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.background-editor-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.background-hint { flex: 1; min-width: 220px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.background-controls { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; margin-top: 14px; }
.background-controls label { display: block; }
.background-controls input[type="range"] { width: 100%; accent-color: var(--violet); }
.background-controls .ghost-button { min-height: 38px; padding: 0 14px; font-size: 13px; }
/* Dragging reframes the picture, so advertise it. */
.link-card-image.is-draggable { cursor: grab; }
.link-card-image.is-dragging { cursor: grabbing; }
@media (max-width: 620px) { .background-controls { grid-template-columns: 1fr; } }

/* Post mock-up: deliberately close to a real timeline entry, so what you see
   is what lands on the network. */
.post-preview { max-width: 560px; margin: 18px auto 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); padding: 16px; }
.post-author { display: flex; align-items: center; gap: 10px; }
.post-author img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.post-author strong { display: block; font-size: 15px; }
.post-author span { display: block; color: var(--muted); font-size: 13px; }
.post-text { margin: 12px 0; color: var(--text); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.link-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.link-card-image { aspect-ratio: 1200 / 630; background: var(--surface-3); }
.link-card-image canvas { width: 100%; height: 100%; display: block; }
.link-card-meta { padding: 11px 13px; display: grid; gap: 3px; }
.link-card-domain { color: var(--muted); font-size: 12px; }
.link-card-title { font-size: 15px; font-weight: 650; line-height: 1.3; }
.link-card-description { color: var(--muted); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* WhatsApp and Bluesky render a compact card with the image beside the text. */
.post-preview[data-network="whatsapp"] .link-card { display: grid; grid-template-columns: 96px 1fr; align-items: stretch; }
.post-preview[data-network="whatsapp"] .link-card-image { aspect-ratio: 1; }
.post-preview[data-network="whatsapp"] .link-card-description { -webkit-line-clamp: 1; }
.post-preview[data-network="linkedin"] .link-card-meta { background: var(--surface-3); }
.post-preview[data-network="linkedin"] .link-card-description { display: none; }
.post-preview[data-network="facebook"] .link-card-meta { background: var(--surface-3); }
.post-preview[data-network="facebook"] .link-card-domain { text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
.preview-note { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.studio-preview .share-actions { margin-top: 18px; }

.controls-panel, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.controls-panel { padding: 26px; }
.profile-editor { display: grid; grid-template-columns: 68px auto 1fr; gap: 14px; align-items: center; padding-bottom: 22px; border-bottom: 1px solid var(--line-soft); }
.profile-editor img { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent-solid); }
.photo-button { padding: 10px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); cursor: pointer; font-size: 13px; font-weight: 650; text-align: center; }
.photo-button input { display: none; }
label > span, .control-group > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.handle-field input, select, .share-result input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 11px; padding: 0 13px; color: var(--text); background: var(--surface-2); font-size: 15px; outline: none; }
input:focus, select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--glow); }
.field-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 22px; }
.control-group { margin-top: 22px; }
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented button { flex: 1 0 auto; min-height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--muted); background: var(--surface-2); cursor: pointer; font-size: 13px; font-weight: 650; transition: color .16s ease, border-color .16s ease; }
.segmented button:hover { color: var(--text); }
.segmented button.active { color: var(--accent-ink); border-color: var(--accent-solid); background: var(--accent-solid); font-weight: 700; }
.credit-toggle { margin-top: 22px; display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; }
.credit-toggle input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--violet); }
.credit-toggle span { margin: 0; text-transform: none; letter-spacing: normal; font-size: 14px; color: inherit; font-weight: 400; }
.share-actions { margin-top: 22px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 10px; }
.share-result { margin-top: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.share-result > span { color: var(--accent-text); font-size: 11px; font-weight: 800; letter-spacing: .11em; }
.share-result > div:first-of-type { margin-top: 9px; display: flex; gap: 8px; }
.share-result input { min-width: 0; background: var(--surface); }
.share-result > div:first-of-type button { border: 0; border-radius: 10px; padding: 0 15px; color: var(--accent-ink); background: var(--accent-solid); font-weight: 700; cursor: pointer; }
.network-actions { display: flex; gap: 7px; margin-top: 12px; flex-wrap: wrap; }
.network-actions button { min-height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; color: var(--text-2); background: var(--surface); cursor: pointer; font-weight: 650; font-size: 12px; }
.network-actions button:hover { color: var(--text); border-color: var(--violet); }
.share-result p, .feedback { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.feedback { min-height: 20px; color: var(--violet); font-weight: 600; }
.delete-share-button { margin-top: 12px; padding: 0; border: 0; color: var(--pink); background: transparent; font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.theme-carousel { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 14px; margin-bottom: 16px; }
.theme-carousel button { width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 14px; color: var(--text-2); background: var(--surface-2); cursor: pointer; font-size: 22px; transition: color .16s ease, border-color .16s ease; }
.theme-carousel button:hover { color: var(--text); border-color: var(--violet); }
.theme-carousel div { text-align: center; }
.theme-carousel span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.theme-carousel strong { display: block; margin: 3px 0; font-size: 17px; }
.theme-carousel small { color: var(--muted); font-size: 12px; font-weight: 650; }
.theme-dots { display: flex; justify-content: center; gap: 7px; margin-top: 16px; }
.theme-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--track); cursor: pointer; transition: width .16s ease; }
.theme-dots button.active { width: 24px; border-radius: 8px; background: var(--accent-text); }

/* ── Numbers ────────────────────────────────────────────────────────────── */
.numbers-heading { padding: 80px 0 24px; }
.numbers-heading h2 { margin: 8px 0 0; font-size: clamp(26px, 3vw, 38px); line-height: 1.1; letter-spacing: -.035em; font-weight: 780; }
.total-panel { padding: 30px; }
.total-panel > div { display: flex; justify-content: space-between; gap: 15px; color: var(--accent-text); font-size: 12px; font-weight: 800; letter-spacing: .09em; }
.total-panel small { color: var(--muted); font-weight: 500; letter-spacing: 0; font-size: 13px; }
.freshness-line { display: inline-flex; align-items: center; gap: 10px; }
.refresh-button { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 650; letter-spacing: 0; cursor: pointer; transition: color .16s ease, border-color .16s ease; }
.refresh-button:hover:not(:disabled) { color: var(--text); border-color: var(--violet); }
.refresh-button:disabled { opacity: .6; cursor: wait; }
.total-panel > strong { display: inline-block; margin: 14px 10px 4px 0; font-size: clamp(40px, 6vw, 68px); line-height: 1.02; letter-spacing: -.045em; font-weight: 750; }
.total-panel > b { font-size: 19px; color: var(--muted); font-weight: 500; }
.total-panel p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 14px; }
.metric { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.metric span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.metric strong { display: block; margin: 10px 0 4px; font-size: 28px; letter-spacing: -.03em; }
.metric small { color: var(--muted); font-size: 13px; }

.chart-panel, .history-panel { margin-top: 16px; padding: 26px; }
.panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.panel-heading h3 { margin: 6px 0 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.panel-heading > small { color: var(--muted); font-size: 13px; }
.usage-chart { min-height: 320px; margin-top: 22px; overflow-x: auto; }
.usage-chart svg { width: 100%; min-width: 760px; height: 320px; overflow: visible; }
.chart-grid-line { stroke: var(--line); }
.chart-axis-label { fill: var(--muted); }
.chart-bar { cursor: pointer; outline: none; }
.chart-bar rect { transition: opacity .15s ease, stroke .15s ease; }
.chart-bar:hover rect, .chart-bar:focus rect { opacity: .8; stroke: var(--text); stroke-width: 2; }
.chart-footer { display: flex; justify-content: space-between; gap: 24px; margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.chart-footer strong { color: var(--text-2); font-size: 14px; font-weight: 650; }
.chart-footer small { max-width: 480px; color: var(--muted); font-size: 13px; line-height: 1.45; text-align: right; }
.chart-empty { height: 290px; display: grid; place-items: center; color: var(--muted); }

.table-wrap { margin-top: 18px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; }
th { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-bottom-color: var(--line); }
td { color: var(--text-2); font-size: 15px; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td:nth-child(n+2), th:nth-child(n+2) { text-align: right; }
.trend-up { color: var(--mint); font-weight: 650; }
.trend-down { color: var(--pink); font-weight: 650; }

/* ── Public profile page ────────────────────────────────────────────────── */
.profile-page { padding: 56px 0 88px; }
.profile-page h1 { margin: 12px 0 10px; font-size: clamp(32px, 4.4vw, 52px); line-height: 1.05; letter-spacing: -.04em; font-weight: 800; }
.profile-total { margin: 0 0 18px; color: var(--text-2); font-size: 17px; }
.profile-total strong { color: var(--text); font-size: 22px; font-weight: 750; }
.profile-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.profile-link { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 650; text-decoration: none; box-shadow: var(--shadow-sm); }
.profile-link:hover { color: var(--text); border-color: var(--violet); }
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; padding: 0; overflow: hidden; background: var(--line); }
.profile-stats > div { padding: 20px; background: var(--surface); }
.profile-stats span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.profile-stats strong { display: block; margin-top: 8px; font-size: 24px; letter-spacing: -.03em; }
.profile-chart-panel { margin-top: 16px; padding: 24px; }
.profile-chart { display: flex; align-items: flex-end; gap: 2px; height: 160px; margin-top: 18px; }
.profile-chart i { flex: 1; min-width: 2px; border-radius: 3px 3px 0 0; background: linear-gradient(to top, var(--bar-bottom), var(--bar-top)); }
.profile-cta { margin-top: 28px; }

/* ── Leaderboard ────────────────────────────────────────────────────────── */
.leaderboard-panel { margin-top: 16px; padding: 26px; }
.leaderboard-tabs button { flex: 0 1 auto; }
.leaderboard { margin: 20px 0 0; padding: 0; list-style: none; counter-reset: rank; }
.leaderboard li { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.leaderboard li:last-child { border-bottom: 0; }
.leaderboard-rank { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: 14px; font-weight: 700; }
.leaderboard li:nth-child(1) .leaderboard-rank { background: #f3c623; color: #3a2c00; }
.leaderboard li:nth-child(2) .leaderboard-rank { background: #c9ced8; color: #2b2f36; }
.leaderboard li:nth-child(3) .leaderboard-rank { background: #d99457; color: #35200c; }
.leaderboard-who { min-width: 0; }
.leaderboard-name { display: block; font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.leaderboard-links a { padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; font-weight: 650; text-decoration: none; }
.leaderboard-links a:hover { color: var(--text); border-color: var(--violet); }
.leaderboard-tokens { font-size: 16px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.leaderboard-empty { margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.leaderboard-optin { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.leaderboard-note { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.leaderboard-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.leaderboard-fields input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--text); background: var(--surface-2); font-size: 14px; outline: none; }
.leaderboard-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.leaderboard-actions .feedback { margin: 0; }
@media (max-width: 720px) { .leaderboard-panel .panel-heading { flex-direction: column; align-items: flex-start; gap: 12px; } }

.data-panel { margin-top: 16px; padding: 26px; }
.data-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 24px; margin: 18px 0 0; padding: 0; list-style: none; }
.data-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); color: var(--text-2); font-size: 14px; }
.data-list li strong { color: var(--text); font-weight: 650; text-align: right; }
.data-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.data-actions p { margin: 0; flex: 1; min-width: 240px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.danger-button { color: var(--pink); border-color: var(--pink); }
.danger-button:hover:not(:disabled) { color: #fff; background: var(--pink); }
.method-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.method-grid article { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.method-grid article > span { color: var(--accent-text); font-weight: 800; font-size: 12px; letter-spacing: .09em; }
.method-grid h3 { margin: 11px 0 7px; font-size: 16px; font-weight: 700; }
.method-grid p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.6; }

footer { min-height: 84px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 14px; }
footer a { color: var(--accent-text); text-decoration: none; font-weight: 650; }
footer nav { display: flex; gap: 24px; }

/* ── Legal page ─────────────────────────────────────────────────────────── */
.legal-page { padding: 64px 0 96px; position: relative; }
.legal-page h1 { max-width: 780px; margin: 12px 0 20px; font-size: clamp(32px, 4.4vw, 52px); line-height: 1.06; letter-spacing: -.04em; font-weight: 800; }
.legal-page h1 em { color: var(--accent-text); font-style: normal; }
.legal-lead { max-width: 780px; color: var(--text-2); font-size: clamp(16px, 1.6vw, 19px); line-height: 1.6; }
.legal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 40px; }
.legal-grid article { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.legal-grid article > span { color: var(--accent-text); font-weight: 800; font-size: 12px; letter-spacing: .09em; }
.legal-grid h2 { margin: 14px 0 10px; font-size: 20px; font-weight: 700; }
.legal-grid p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.65; }
.legal-back { display: inline-flex; margin-top: 32px; text-decoration: none; }

/* ── Shared card page ───────────────────────────────────────────────────── */
.share-page { display: grid; min-height: 100vh; place-items: center; padding: 40px 20px; }
.share-page main { width: min(680px, 100%); text-align: center; }
.share-brand { display: inline-block; margin-bottom: 24px; text-decoration: none; font-size: 21px; font-weight: 800; }
.share-brand span { color: var(--accent-text); }
.share-brand small { color: var(--muted); font-size: 11px; }
.shared-card { width: 100%; height: auto; border-radius: 26px; box-shadow: 0 30px 70px rgba(15, 23, 42, .25); }
.share-page h1 { margin: 26px 0 8px; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.035em; font-weight: 780; }
.share-page p { color: var(--muted); }
.share-page .primary-button { margin-top: 14px; }

[hidden] { display: none !important; }

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; padding-top: 44px; gap: 48px; }
  .hero-card { width: min(560px, 100%); margin-inline: auto; }
  .studio-heading { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .method-grid { grid-template-columns: 1fr; }
  .legal-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .chart-panel .panel-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .chart-footer { flex-direction: column; gap: 8px; }
  .chart-footer small { text-align: left; }
  footer nav { gap: 14px; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1180px); }
  .topbar { min-height: 68px; }
  .personal-pill { display: none; }
  .brand { font-size: 18px; }
  .hero { padding: 40px 0 64px; gap: 44px; }
  .hero-card { padding: 30px; border-radius: 24px; }
  .hero-card span { margin-top: 18px; }
  .hero-card small { margin-top: 24px; }
  .signin-panel { padding: 20px; }
  .device-code { align-items: stretch; }
  .device-code > div { width: 100%; }
  .device-code button { flex: 1; }
  .studio-heading { padding-top: 40px; }
  .controls-panel, .panel { border-radius: 16px; }
  .controls-panel { padding: 20px; }
  .profile-editor { grid-template-columns: 60px 1fr; }
  .profile-editor img { width: 60px; height: 60px; }
  .handle-field { grid-column: 1 / -1; }
  .field-grid { grid-template-columns: 1fr; }
  .share-actions { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 18px; }
  .metric strong { font-size: 24px; }
  .total-panel { padding: 22px; }
  .total-panel > div { display: block; }
  .total-panel small { display: block; margin-top: 6px; }
  .numbers-heading { padding-top: 56px; }
  footer { flex-direction: column; justify-content: center; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
