:root {
  color-scheme: dark;
  --bg: #09090b;
  --bg-2: #0f0f12;
  --surface: #131316;
  --surface-2: #1b1b20;
  --border: #26262d;
  --border-strong: #34343d;
  --text: #f4f1ea;
  --muted: #9b978d;
  --accent: #d9ad4a;
  --accent-2: #f3d58a;
  --accent-ink: #1a1405;
  --gold-grad: linear-gradient(135deg, #f6dc94 0%, #d9ad4a 45%, #a77a1f 100%);
  --buy: #22c55e;
  --buy-bg: rgba(34, 197, 94, 0.12);
  --sell: #ef4444;
  --sell-bg: rgba(239, 68, 68, 0.12);
  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.12);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --glow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), 0 10px 40px color-mix(in srgb, var(--accent) 14%, transparent);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #faf8f3;
  --bg-2: #f3efe5;
  --surface: #ffffff;
  --surface-2: #f5f2ea;
  --border: #e8e1d1;
  --border-strong: #d8cfba;
  --text: #17150f;
  --muted: #6f6a5d;
  --accent: #a87b14;
  --accent-2: #c99a2e;
  --accent-ink: #ffffff;
  --gold-grad: linear-gradient(135deg, #d9ad4a 0%, #b38420 55%, #8d6512 100%);
  --buy: #15803d;
  --buy-bg: rgba(21, 128, 61, 0.1);
  --sell: #dc2626;
  --sell-bg: rgba(220, 38, 38, 0.09);
  --info: #2563eb;
  --info-bg: rgba(37, 99, 235, 0.08);
  --shadow: 0 8px 28px rgba(60, 45, 10, 0.08);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #faf8f3;
    --bg-2: #f3efe5;
    --surface: #ffffff;
    --surface-2: #f5f2ea;
    --border: #e8e1d1;
    --border-strong: #d8cfba;
    --text: #17150f;
    --muted: #6f6a5d;
    --accent: #a87b14;
    --accent-2: #c99a2e;
    --accent-ink: #ffffff;
    --gold-grad: linear-gradient(135deg, #d9ad4a 0%, #b38420 55%, #8d6512 100%);
    --buy: #15803d;
    --buy-bg: rgba(21, 128, 61, 0.1);
    --sell: #dc2626;
    --sell-bg: rgba(220, 38, 38, 0.09);
    --info: #2563eb;
    --info-bg: rgba(37, 99, 235, 0.08);
    --shadow: 0 8px 28px rgba(60, 45, 10, 0.08);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* header */
.topbar > .container:not(.topbar-in) { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav { display: flex; gap: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 9px 16px; border-radius: 12px; font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: border-color .15s, background .15s, transform .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--gold-grad); color: var(--accent-ink); border-color: transparent; font-weight: 800; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 28%, transparent); }
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-1px); border-color: transparent; }
.btn-danger { color: var(--sell); }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* hero */
.hero { padding: 48px 0 24px; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 8px; font-weight: 900; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--muted); margin: 0; max-width: 620px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.stat-value { font-size: 1.6rem; font-weight: 800; margin-top: 4px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin: 8px 0 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 6px 14px; border-radius: 999px; font: inherit; font-size: 0.88rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }

/* signal cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; padding-bottom: 32px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.asset { font-weight: 800; font-size: 1.1rem; }
.meta { color: var(--muted); font-size: 0.8rem; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-size: 0.75rem; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.buy { background: var(--buy-bg); color: var(--buy); font-weight: 700; }
.badge.sell { background: var(--sell-bg); color: var(--sell); font-weight: 700; }
.badge.active { background: var(--info-bg); color: var(--info); }
.badge.tp { background: var(--buy-bg); color: var(--buy); }
.badge.sl { background: var(--sell-bg); color: var(--sell); }
.levels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.level { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.level .k { color: var(--muted); font-size: 0.75rem; }
.level .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.level .d { font-size: 0.72rem; color: var(--muted); margin-inline-start: 4px; }
.level.stop .v { color: var(--sell); }
.level.target .v { color: var(--buy); }
.note { color: var(--muted); font-size: 0.88rem; border-top: 1px dashed var(--border); padding-top: 10px; }
.result { font-weight: 800; }
.result.pos { color: var(--buy); }
.result.neg { color: var(--sell); }

.empty { text-align: center; color: var(--muted); padding: 48px 0; grid-column: 1 / -1; }
.disclaimer { color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--border); padding: 20px 0 32px; }

/* admin */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 24px 0; }
.panel h2 { margin: 0 0 16px; font-size: 1.15rem; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 820px) { .form-grid { grid-template-columns: repeat(2, 1fr); } }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 0.82rem; color: var(--muted); }
input, select, textarea { font: inherit; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 70px; resize: vertical; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.check { display: flex; gap: 6px; align-items: center; font-size: 0.88rem; color: var(--muted); }
.check input { width: auto; }
.msg { font-size: 0.88rem; }
.msg.err { color: var(--sell); }
.msg.ok { color: var(--buy); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
td .row-actions { display: flex; gap: 4px; }
.login { max-width: 380px; margin: 80px auto; }
.hidden { display: none !important; }

/* locked (non-subscriber) signals */
.locked { position: relative; }
.levels.blurred { filter: blur(6px); user-select: none; pointer-events: none; }
.locked-over { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; font-size: 0.88rem; font-weight: 700; padding: 8px; }
.lock-banner { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-size: 0.92rem; }
.lock-banner a { color: var(--accent); font-weight: 800; }
.nav { align-items: center; }
.fine { color: var(--muted); font-size: 0.82rem; }

/* features switched on by the server (/features.js) */
.ai-only { display: none !important; }
html.ai-on .ai-only { display: revert !important; }

/* ================= site chrome ================= */
body { background: radial-gradient(1200px 500px at 85% -120px, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%) no-repeat, var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html.no-scroll { overflow: hidden; }
.ico { width: 20px; height: 20px; flex: none; }
.btn .ico { width: 18px; height: 18px; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface); }
.btn-tg { background: #229ed9; border-color: #229ed9; color: #fff; }
.btn-tg:hover { border-color: #229ed9; filter: brightness(1.08); }

.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s, background .2s; }
.topbar.scrolled, .topbar:has(> .container:not(.topbar-in)) { border-bottom-color: var(--border); background: color-mix(in srgb, var(--bg) 90%, transparent); }
.topbar-in { display: flex; align-items: center; gap: 10px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; font-weight: 900; }
.brand-logo { width: 40px; height: 40px; border-radius: 11px; display: block; box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), 0 4px 14px rgba(0,0,0,.35); }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt b { font-weight: 900; font-size: 1.05rem; }
.brand-txt small { font-size: 0.58rem; letter-spacing: .28em; color: var(--accent); font-weight: 700; direction: ltr; text-align: right; }
.mainnav { display: flex; gap: 2px; margin-inline-start: 18px; flex: 1; }
.mainnav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-size: 0.92rem; font-weight: 600; transition: color .15s, background .15s; }
.mainnav a:hover { color: var(--text); background: var(--surface); }
.mainnav a[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.topbar .nav { display: flex; gap: 6px; align-items: center; margin-inline-start: auto; }
.btn-account { padding-inline: 12px; position: relative; }
.dot-warn { position: absolute; top: 6px; inset-inline-end: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--sell); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; flex: none; transition: border-color .15s; }
.icon-btn:hover { border-color: var(--accent); }
.menu-btn { display: none; }
@media (max-width: 1080px) { .mainnav { display: none; } .menu-btn { display: inline-grid; } }
@media (max-width: 480px) { .hide-xs { display: none !important; } .brand-txt small { display: none; } .topbar .nav .btn { padding: 8px 12px; } #themeBtn { display: none; } }

/* drawer */
.drawer { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.drawer-back { position: absolute; inset: 0; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .25s; }
.drawer-panel { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(320px, 86vw); background: var(--bg-2); border-inline-end: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 14px; transform: translateX(105%); transition: transform .28s ease; overflow-y: auto; }
.drawer.open { pointer-events: auto; }
.drawer.open .drawer-back { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-links { display: flex; flex-direction: column; gap: 2px; }
.drawer-links a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 600; }
.drawer-links a .ico { color: var(--muted); }
.drawer-links a:hover { background: var(--surface); }
.drawer-links a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.drawer-links a[aria-current="page"] .ico { color: var(--accent); }
.drawer-user { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }

/* ticker */
.ticker { border-bottom: 1px solid var(--border); background: var(--bg-2); overflow: hidden; height: 38px; font-size: 0.82rem; }
.ticker:not(.ready) { visibility: hidden; }
.tk-track { display: flex; width: max-content; animation: tk-move 70s linear infinite; }
.ticker:hover .tk-track { animation-play-state: paused; }
.tk-row { display: flex; }
.tk { display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; height: 38px; text-decoration: none; color: var(--text); border-inline-end: 1px solid var(--border); white-space: nowrap; }
.tk-n { color: var(--muted); }
.tk-v { font-weight: 800; font-variant-numeric: tabular-nums; }
.chg { font-size: 0.76rem; font-weight: 700; }
.chg.up { color: var(--buy); } .chg.down { color: var(--sell); } .chg.flat { color: var(--muted); }
@keyframes tk-move { from { transform: translateX(0); } to { transform: translateX(50%); } }
@media (prefers-reduced-motion: reduce) { .tk-track { animation: none; } .ticker { overflow-x: auto; } }

/* footer */
.site-footer { margin-top: 56px; border-top: 1px solid var(--border); background: var(--bg-2); padding: 40px 0 24px; font-size: 0.9rem; }
.f-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; }
@media (max-width: 820px) { .f-grid { grid-template-columns: 1fr 1fr; } .f-brand { grid-column: 1 / -1; } }
.f-brand p { color: var(--muted); margin: 12px 0 14px; max-width: 360px; }
.f-grid h4 { margin: 4px 0 12px; font-size: 0.95rem; }
.f-grid > div > a:not(.brand):not(.btn) { display: block; color: var(--muted); text-decoration: none; padding: 4px 0; }
.f-grid > div > a:not(.brand):not(.btn):hover { color: var(--accent); }
.f-disc { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 0.8rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 28px 0 18px; }
.f-disc .ico { color: var(--accent); width: 18px; height: 18px; margin-top: 2px; }
.f-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 0.8rem; }

/* bottom tab bar (phones) */
.tabbar { display: none; }
@media (max-width: 720px) {
  body.has-tabbar { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; inset-inline: 0; bottom: 0; z-index: 40; background: color-mix(in srgb, var(--bg-2) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 8px; font-size: 0.7rem; color: var(--muted); text-decoration: none; position: relative; }
  .tabbar a .ico { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--accent); font-weight: 800; }
  .tabbar a[aria-current="page"]::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .site-footer { padding-bottom: 12px; }
}

/* toasts */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
@media (max-width: 720px) { .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); } }
.toast { background: var(--surface); border: 1px solid var(--border-strong); border-inline-start: 4px solid var(--buy); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 0.9rem; animation: toast-in .25s ease; transition: opacity .4s, transform .4s; }
.toast.err { border-inline-start-color: var(--sell); }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* shared page pieces */
.page-head { padding: 40px 0 20px; }
.page-head h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin: 0 0 8px; font-weight: 900; line-height: 1.3; }
.page-head h1 span, .hero h1 span { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head p { color: var(--muted); margin: 0; max-width: 680px; }
.card, .panel, .stat { transition: border-color .2s, transform .2s, box-shadow .2s; }
.card:hover { border-color: var(--border-strong); }
.stat { position: relative; overflow: hidden; }
.stat::after { content: ''; position: absolute; inset-inline-end: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%); pointer-events: none; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 48px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.es-ico { width: 64px; height: 64px; border-radius: 18px; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); margin-bottom: 12px; }
.es-ico .ico { width: 30px; height: 30px; }
.empty-state h3 { margin: 0 0 6px; }
.empty-state p { color: var(--muted); margin: 0 auto 16px; max-width: 460px; }
.empty-state .cta-row { justify-content: center; margin-top: 0; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sk 1.4s ease infinite; border-radius: 10px; min-height: 18px; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.chip { transition: border-color .15s, color .15s; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--gold-grad); border-color: transparent; color: var(--accent-ink); }
.section-title { position: relative; }
.kicker { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 800; font-size: 0.8rem; letter-spacing: .02em; margin-bottom: 6px; }
.up { color: var(--buy); } .down { color: var(--sell); }
small.muted { color: var(--muted); font-size: .8em; font-weight: 400; }

/* admin: two-step login card */
.sec-panel { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 20px; }
.sec-panel:empty { display: none; }
.sec-panel p { margin: 4px 0 0; }
.sec-panel.warn { border-color: color-mix(in srgb, #f59e0b 55%, var(--border)); }
.sec-panel.on { border-color: color-mix(in srgb, var(--buy) 45%, var(--border)); }

/* admin: users + signup chart */
.user-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.vchk { color: var(--buy); font-weight: 900; } .vno { color: var(--muted); }
.mini-tag { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); margin: 1px 2px; white-space: nowrap; }
.signup-chart h2 { font-size: 1rem; }
.sbars { display: flex; align-items: flex-end; gap: 6px; height: 140px; direction: rtl; }
.sb { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.sb i { display: block; width: 70%; max-width: 28px; background: var(--gold-grad, var(--accent)); border-radius: 6px 6px 0 0; }
.sb-n { font-size: .7rem; color: var(--text); margin-bottom: 3px; }
.sb-d { font-size: .62rem; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* admin on phones: the action buttons (last column) stay pinned while the table scrolls sideways */
@media (max-width: 760px) {
  #adminView .table-wrap:not(:has(#userRows)) th:last-child, #adminView .table-wrap:not(:has(#userRows)) td:last-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 6px 0 8px -6px rgba(0,0,0,.35); }
}

/* ---- drawer extras: plans, channel, support, theme ---- */
.drawer-extra { display: grid; gap: 8px; padding: 10px 0 4px; border-top: 1px solid var(--border); margin-top: 6px; }
.drawer-buy { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; font-weight: 700; text-decoration: none; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.drawer-row { display: flex; flex-wrap: wrap; gap: 6px; }
.drawer-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: .85rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.drawer-chip .ico, .drawer-buy .ico { width: 18px; height: 18px; }
.drawer-chip:hover { border-color: var(--border-strong, var(--accent)); }

/* ---- back to top ---- */
.to-top { position: fixed; left: 16px; bottom: 24px; z-index: 40; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); color: var(--text); display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.25); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; }
.to-top svg { width: 20px; height: 20px; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
body.has-tabbar .to-top { bottom: calc(80px + env(safe-area-inset-bottom)); }
@media (min-width: 721px) { body.has-tabbar .to-top { bottom: 24px; } }

/* ---- touch targets: at least ~40px tall on phones ---- */
@media (hover: none), (max-width: 760px) {
  details > summary { padding-block: 10px; min-height: 44px; display: flex; align-items: center; gap: 6px; }
  .btn-sm { min-height: 38px; padding: 6px 12px; }
  .chart-btn, .share-btn, .open-btn { min-height: 40px; padding-inline: 14px; }
  .how-link, .sig-back { display: inline-flex; align-items: center; min-height: 40px; }
}
