/* Painel do Yoru (02/11/2026, mistura A + C do Emannuel): a estrutura do painel de antes, arrumada (barra lateral com nomes,
   números no topo, abas embaixo no celular), com o céu e a lua do site no começo. Uma folha só, no lugar de style, brand e
   dashboard.css. Nada de estilo inline nem imagem data: (a CSP do Worker é style-src 'self', default-src 'self').
   Tamanhos: nenhum texto abaixo de 12 px; alvos de toque com 44 px. */

@font-face { font-family: 'Inter Variable'; src: url('./inter-latin-wght-normal-Dx4kXJAl.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Bricolage Grotesque Variable'; src: url('./bricolage-grotesque-latin-wght-normal-DLoelf7F.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }

:root {
  /* cores do yoruapp.com.br */
  --bg: #090a10; --rail: #0d0e16; --surface: #111522; --surface-2: #151a2a; --elevated: #1c2033; --line: #2a3048; --line-soft: #222739;
  --ink: #f4f2ff; --dim: #b4b0cc; --faint: #8f8bab;
  --accent: #a78bfa; --accent-ink: #d9ccff; --accent-soft: #a78bfa1f; --primary: #7c3aed; --primary-hover: #8b5cf6; --on-primary: #ffffff;
  --ok: #92dbc0; --ok-soft: #92dbc01a; --warn: #e9c78a; --warn-soft: #e9c78a1a; --danger: #ef9fb8; --danger-fill: #a83f62; --danger-soft: #a8466014;
  --moon: #ece6ff;
  --display: 'Bricolage Grotesque Variable', 'Segoe UI', system-ui, sans-serif;
  --body: 'Inter Variable', 'Segoe UI', system-ui, sans-serif;
  --rail-w: 240px; --tabbar-h: 64px;
  color-scheme: dark;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--body);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 85% 0%, #7c3aed12, transparent 55%), var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.15; text-wrap: balance; color: var(--ink); }
p { margin: 0; color: var(--dim); line-height: 1.65; }
a { color: var(--accent); text-underline-offset: 3px; }
section[id], div[id='overview'] { scroll-margin-top: 24px; }

/* ---------- barra lateral ---------- */
aside { position: fixed; inset: 0 auto 0 0; width: var(--rail-w); padding: 28px 16px; background: var(--rail); border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 28px; overflow-y: auto; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); padding: 0 6px; }
.brand img { border-radius: 12px; box-shadow: 0 0 24px #8b5cf61f; flex: none; }
.brand-name { font: 700 20px/1.1 var(--display); letter-spacing: .14em; display: block; white-space: nowrap; }
.brand-name small { display: inline; color: var(--accent); font-size: 18px; letter-spacing: 0; margin-left: 4px; }
.brand-name > span { display: block; margin-top: 6px; font: 600 12px/1 var(--body); letter-spacing: .12em; color: var(--faint); }
.section-nav { display: grid; gap: 4px; }
.section-nav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 11px; color: var(--dim); text-decoration: none;
  font-size: 14.5px; font-weight: 500; border: 1px solid transparent; transition: background .2s, color .2s; }
.section-nav svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.section-nav .short { display: none; }
.section-nav a:hover { background: var(--surface); color: var(--ink); }
.section-nav a.is-active { background: #7c3aed24; color: var(--accent-ink); border-color: #8b5cf633; box-shadow: inset 3px 0 var(--accent); }
.site-link { display: flex; align-items: center; min-height: 44px; padding: 0 12px; margin-top: auto; border-top: 1px solid var(--line-soft); color: var(--dim);
  text-decoration: none; font-size: 13.5px; }
.site-link:hover { color: var(--accent-ink); }
.aside-note { padding: 0 12px; display: grid; gap: 6px; }
.aside-note strong { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.aside-note p { font-size: 13px; color: var(--faint); }
.moon-mark { font-size: 30px; color: var(--accent); line-height: 1; }
.workspace-tag { font: 600 12px/1 var(--body); letter-spacing: .12em; color: var(--faint); border-top: 1px solid var(--line-soft); padding-top: 14px; margin-top: 6px; }

/* ---------- conteúdo ---------- */
main { margin-left: var(--rail-w); max-width: 1640px; padding-block: 36px 64px;
  padding-left: max(clamp(20px, 3vw, 56px), env(safe-area-inset-left, 0px)); padding-right: max(clamp(20px, 3vw, 56px), env(safe-area-inset-right, 0px)); }
main > header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
main > header > div:first-child { display: grid; gap: 8px; min-width: 0; }
h1 { font-size: clamp(28px, 3vw, 40px); font-weight: 650; letter-spacing: -.02em; }
.title-dot { color: var(--accent); }
main > header p { font-size: 14.5px; color: var(--faint); }
.eyebrow { font: 600 12px/1.2 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#refresh::before { content: '↻'; font-size: 16px; margin-right: 8px; }
#logout { background: transparent; border-color: transparent; color: var(--dim); }
#logout:hover { color: var(--ink); border-color: var(--line); }

/* ---------- controles ---------- */
button { font: 600 14px/1 var(--body); min-height: 44px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line); background: var(--elevated);
  color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .2s, border-color .2s, transform .15s; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }
.primary { background: var(--primary); border-color: #9c75ff; color: var(--on-primary); box-shadow: 0 4px 14px #7c3aed33; }
.primary:hover:not(:disabled) { background: var(--primary-hover); }
.danger { background: var(--danger-fill); border-color: #bd5978; color: #fff; }
.danger:hover:not(:disabled) { background: #ba4a70; border-color: #da89a3; }
.danger-quiet { min-height: 36px; padding: 0 12px; font-size: 13px; color: var(--danger); background: var(--danger-soft); border-color: #a8466040; }
.danger-quiet:hover:not(:disabled) { border-color: #b25976; background: #a8466026; }
label { display: grid; gap: 7px; font-size: 13.5px; font-weight: 500; color: var(--dim); }
input, select, textarea { font: 400 14.5px/1.4 var(--body); color: var(--ink); background: #161a29; border: 1px solid #343b57; border-radius: 11px; min-height: 44px;
  padding: 10px 12px; width: 100%; min-width: 0; }
textarea { resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #7d7998; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); }
select { padding-right: 32px; }
:is(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- entrada ---------- */
#login { max-width: 560px; margin: 48px auto; padding: 30px; background: radial-gradient(ellipse at top right, #8b5cf614, transparent 70%), var(--surface);
  border: 1px solid #3f3462; border-radius: 18px; box-shadow: 0 24px 90px #0005; display: grid; gap: 14px; }
#login h2 { font-size: 24px; letter-spacing: -.01em; }
#login > p { font-size: 15px; }
#login-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 6px; }
#login-form > label { flex: 1 1 260px; }
#login small { font-size: 13px; color: var(--faint); }
#auth-extra { width: 100%; display: grid; gap: 16px; padding-top: 6px; }
#auth-extra label:has(#claim-new) { display: flex; align-items: center; gap: 10px; }
#auth-extra textarea { font-size: 13.5px; }
#auth-extra .note { font-size: 13px; }
#message { font-size: 14px; color: var(--accent-ink); margin-top: 12px; }

/* ---------- topo: céu e lua (do C) ---------- */
.hero { position: relative; overflow: hidden; border-radius: 22px; border: 1px solid #2f2a52; margin-bottom: 22px; padding: 30px 32px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
  background: radial-gradient(ellipse at 82% -10%, #7c3aed40, transparent 60%), linear-gradient(180deg, #121530, #0d0f1d); }
.sky { position: absolute; inset: 0; pointer-events: none; opacity: .9;
  background:
    radial-gradient(1px 1px at 8% 24%, #fffc 50%, transparent 51%), radial-gradient(1px 1px at 18% 68%, #fff8 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 30% 16%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 41% 52%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 53% 22%, #fffb 50%, transparent 51%), radial-gradient(1.5px 1.5px at 62% 74%, #fffa 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 34%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 79% 82%, #fff7 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 18%, #fffd 50%, transparent 51%), radial-gradient(1px 1px at 95% 60%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 24% 88%, #fff6 50%, transparent 51%), radial-gradient(1px 1px at 47% 90%, #fff7 50%, transparent 51%); }
.hero-copy { position: relative; display: grid; gap: 6px; min-width: 0; }
.hero-number { line-height: .9; margin: 6px 0 2px; }
.hero-number strong { font: 750 clamp(64px, 9vw, 120px)/.9 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff, #b9a4ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-number strong.is-empty { font-size: clamp(40px, 5vw, 64px); color: var(--faint); background: none; }
.hero h2 { font-size: clamp(19px, 2vw, 24px); font-weight: 500; letter-spacing: -.01em; }
.hero-sentence { margin-top: 12px; font-size: 15.5px; color: var(--ink); max-width: 62ch; padding: 12px 16px; border-radius: 14px; background: #ffffff0a;
  border: 1px solid #ffffff14; justify-self: start; }
.moon { position: relative; width: clamp(96px, 12vw, 150px); aspect-ratio: 1; border-radius: 50%; transform: rotate(-20deg);
  background: radial-gradient(circle at 64% 38%, transparent 44%, var(--moon) 45%); filter: drop-shadow(0 0 40px #a78bfa55); animation: moon-rise .9s ease-out backwards; }

/* ---------- atualização ao vivo ---------- */
.live-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 18px; margin-bottom: 28px;
  border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface); }
#live-status { display: flex; align-items: center; gap: 12px; }
#live-status strong { font-size: 14px; font-weight: 600; color: var(--ink); }
#live-status small { display: block; font-size: 13px; color: var(--faint); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); animation: live-pulse 3s infinite; flex: none; }
#live-status[data-state=loading] .live-dot { background: var(--accent); }
#live-status[data-state=paused] .live-dot { background: #8a8299; animation: none; }
#live-status[data-state=offline] .live-dot { background: var(--warn); animation: none; }
.switch-label { display: flex; align-items: center; gap: 10px; position: relative; font-size: 13.5px; min-height: 44px; cursor: pointer; white-space: nowrap; }
.switch-label input { position: absolute; opacity: 0; width: 40px; height: 44px; margin: 0; left: 0; }
.switch-track { width: 38px; height: 22px; border-radius: 99px; background: #43394f; padding: 3px; transition: background .2s; pointer-events: none; flex: none; }
.switch-track::before { content: ''; display: block; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch-label input:checked + .switch-track { background: var(--primary); }
.switch-label input:checked + .switch-track::before { transform: translateX(16px); }
.switch-label input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- seções ---------- */
.section-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section-title > div { display: grid; gap: 6px; }
.section-title h2 { font-size: 24px; font-weight: 650; letter-spacing: -.01em; }
.source-pill { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); white-space: nowrap; }
.source-pill span { font-weight: 400; color: var(--faint); }
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 18px; padding: 24px; margin-bottom: 22px; min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head > div { display: grid; gap: 6px; }
.panel h2 { font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.panel h3 { font-size: 16px; font-weight: 600; }
.subtle-label { font: 600 12px/1 var(--body); letter-spacing: .1em; color: var(--faint); }
.note, small { font-size: 13px; color: var(--faint); line-height: 1.6; }
.section-head + .note { max-width: 90ch; margin-bottom: 18px; }
.finance-note { margin: 0 0 18px; }
#accounts, #activity, #access { margin-top: 10px; }

/* filtros */
details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '›'; font-size: 22px; line-height: 1; color: var(--accent); transition: transform .2s; }
details[open] > summary::before { transform: rotate(90deg); }
details > summary span { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--faint); text-align: right; }
.filter-drawer { padding: 0; margin-bottom: 12px; }
.filter-drawer > summary { padding: 6px 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-drawer .filters { border-top: 1px solid var(--line-soft); padding: 18px; }
.filters label { flex: 1 1 150px; }
.quick-periods { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 14px; margin-top: 4px; }
.quick-periods span { font-size: 13px; color: var(--faint); margin-right: 6px; }
.quick-periods button { min-height: 40px; font-size: 13.5px; border-radius: 999px; }

/* cartões de números (A: fileira no topo) */
.currency-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.card { position: relative; overflow: hidden; display: grid; align-content: start; gap: 4px; padding: 18px 20px; min-height: 136px; border-radius: 16px;
  border: 1px solid var(--line-soft); background: linear-gradient(150deg, var(--surface-2), var(--surface) 70%); }
.card small { font-size: 13.5px; font-weight: 500; color: var(--dim); line-height: 1.4; }
.card strong { font: 650 clamp(26px, 2.4vw, 34px)/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 14px 0 4px; overflow-wrap: anywhere; }
.card em { font-style: normal; font-size: 13px; color: var(--faint); }
.currency-cards .card:first-child { border-color: #5b44a8; background: linear-gradient(150deg, #2a1f4d, var(--surface) 75%); }
.currency-cards .card:first-child strong { color: var(--accent-ink); }
.metric-changed { animation: metric-highlight 1.4s ease-out; }
.account-cards, .activity-cards { display: grid; gap: 14px; margin: 4px 0 16px; }
.activity-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.activity-cards .card strong { color: #c8ecd8; }
.account-cards .card:first-child { border-color: #5b44a8; background: linear-gradient(150deg, #2a1f4d, var(--surface) 75%); }

/* receita por mês e planos */
.columns { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 22px; }
.month { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; color: var(--dim); }
.month:last-child { border-bottom: 0; }
.month strong { color: var(--accent-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.month meter { grid-column: 1 / -1; width: 100%; height: 6px; appearance: none; border: 0; background: #252031; border-radius: 99px; }
.month meter::-webkit-meter-bar { background: #252031; border: 0; border-radius: 99px; }
.month meter::-webkit-meter-optimum-value { background: linear-gradient(90deg, #8460d8, #c5a3ff); border-radius: 99px; }
.month meter::-moz-meter-bar { background: linear-gradient(90deg, #8460d8, #c5a3ff); border-radius: 99px; }

/* tabelas */
.scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #44364f transparent; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; white-space: nowrap; }
th { font-size: 12.5px; font-weight: 600; color: var(--faint); padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); color: var(--dim); font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { padding-left: 4px; }
td:first-child { color: var(--ink); font-weight: 500; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #a78bfa08; }
.status-active { color: var(--ok) !important; } .status-grace { color: var(--warn) !important; } .status-expired { color: var(--faint) !important; }
.access-state { font-weight: 600; }
.state-claimed { color: var(--ok); } .state-pending { color: var(--accent-ink); } .state-revoked, .state-burned { color: var(--faint); }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 16px; font-size: 13.5px; color: var(--faint); }

/* gráfico de atividade */
.chart-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.chart-header h3 { font-size: 16px; }
.chart-header label { display: flex; align-items: center; gap: 10px; }
.chart-header select { width: auto; }
.activity-chart { margin: 14px 0; padding: 16px 12px 8px; border-radius: 14px; border: 1px solid var(--line-soft); background: #0d1019; }
.activity-chart p { text-align: center; padding: 48px 16px; font-size: 14px; }
.activity-chart svg { display: block; width: 100%; height: auto; max-height: 290px; }
.chart-grid { stroke: var(--line-soft); stroke-width: 1; stroke-dasharray: 2 6; }
.chart-area { fill: #a78bfa14; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px #a78bfa40); }
.chart-point { fill: #c5a7ff; stroke: var(--bg); stroke-width: 2; }
.activity-chart text { fill: var(--faint); font: 12px var(--body); }

/* histórico, vínculo manual e acessos */
.history-details { border-block: 1px solid var(--line-soft); padding: 8px 0; margin: 20px 0 14px; }
.activity-history { margin-top: 16px; }
.history-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.history-three h2 { font-size: 16px; margin-bottom: 8px; }
.history-three .scroll { max-height: 280px; overflow-y: auto; }
.manual-link { padding: 12px 22px; background: #0e1018; }
.manual-link h2 { margin: 16px 0 8px; }
.manual-link > p { max-width: 90ch; }
#link-form { padding-top: 14px; }
#link-form label { flex: 1 1 260px; }
#link-message, #key-status { font-size: 14px; color: var(--accent-ink); }
#generated-key-label { margin: 18px 0; padding: 16px; border: 1px solid #5b44a8; border-radius: 14px; background: var(--accent-soft); }
#generated-key { font-family: ui-monospace, Consolas, monospace; font-size: 14px; color: var(--accent-ink); }
.access-list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line-soft); padding-top: 20px; margin: 22px 0 10px; }
.access-list-head button { min-height: 40px; }
.security-callout { display: flex; gap: 12px; align-items: center; margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: #19141e; border: 1px solid #392a41; }
.security-callout > span { font-size: 22px; color: #c9a3e0; }
.security-callout p { font-size: 13.5px; color: #c3afd2; }

/* confirmação de revogar */
dialog { width: min(480px, calc(100% - 32px)); padding: 28px; border-radius: 20px; border: 1px solid #4c365a; background: #17131f; color: var(--ink); box-shadow: 0 24px 120px #0009; }
dialog::backdrop { background: #08060dcc; backdrop-filter: blur(5px); }
dialog form { display: grid; gap: 10px; }
dialog h2 { font-size: 24px; }
dialog p { font-size: 14.5px; }
.dialog-icon { display: grid; place-items: center; width: 48px; height: 48px; font-size: 26px; border-radius: 14px; background: #bc4b7120; border: 1px solid #bc4b7140; color: #e8a6be; margin-bottom: 8px; }
#revoke-error { font-size: 13.5px; color: var(--danger); min-height: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

footer { font-size: 13px; color: var(--faint); line-height: 1.7; border-top: 1px solid var(--line-soft); padding-top: 20px; margin-top: 26px; max-width: 110ch; }

@keyframes live-pulse { 0%, 100% { box-shadow: 0 0 0 4px #92dbc014; } 50% { box-shadow: 0 0 0 7px #92dbc024; } }
@keyframes metric-highlight { 0% { border-color: #b7a1ffaa; box-shadow: 0 0 22px #a78bfa22; } 100% { box-shadow: none; } }
@keyframes moon-rise { from { opacity: 0; translate: 0 10px; } }

/* ---------- telas médias ---------- */
@media (max-width: 1200px) {
  :root { --rail-w: 212px; }
  .columns { grid-template-columns: minmax(0, 1fr); }
  .currency-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-three { grid-template-columns: minmax(0, 1fr); }
}
/* tablet: a barra vira trilho de ícones */
@media (max-width: 900px) and (min-width: 641px) {
  :root { --rail-w: 80px; }
  aside { padding: 22px 12px; align-items: center; }
  .brand-name, .section-nav .full, .site-link, .aside-note { display: none; }
  .section-nav a { width: 52px; justify-content: center; padding: 0; }
  .section-nav a.is-active { box-shadow: none; }
  .activity-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- celular: barra de cima com a marca, abas embaixo (do A) ---------- */
@media (max-width: 640px) {
  aside { position: sticky; top: 0; inset: auto; width: auto; height: auto; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
    border-right: 0; border-bottom: 1px solid var(--line-soft); overflow: visible; }
  .brand img { width: 32px; height: 32px; }
  .brand-name { font-size: 17px; }
  .brand-name > span, .aside-note { display: none; }
  .site-link { margin: 0; border: 0; padding: 0 4px; font-size: 13.5px; }
  .section-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px;
    padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
    background: #0d0e16f7; border-top: 1px solid var(--line); }
  .section-nav[hidden] { display: none !important; }
  .section-nav a { flex-direction: column; justify-content: center; gap: 3px; min-height: 52px; padding: 4px 0; border-radius: 12px; font-size: 12px; border: 0; }
  .section-nav .full { display: none; } .section-nav .short { display: block; }
  .section-nav a.is-active { box-shadow: none; background: #7c3aed24; }
  main { margin-left: 0; padding-block: 20px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  main > header { align-items: flex-start; margin-bottom: 18px; }
  h1 { font-size: 26px; }
  .header-actions { width: 100%; }
  .header-actions button { flex: 1 1 auto; }
  section[id], div[id='overview'] { scroll-margin-top: 72px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 22px 18px; border-radius: 18px; }
  .moon { position: absolute; right: 14px; top: 14px; width: 74px; }
  .hero-sentence { font-size: 14.5px; }
  .live-toolbar { padding: 10px 14px; }
  .panel { padding: 18px 16px; border-radius: 16px; }
  .currency-cards { gap: 10px; }
  .card { min-height: 0; padding: 14px; }
  .card strong { font-size: 24px; margin-top: 8px; }
  .activity-cards { grid-template-columns: minmax(0, 1fr); }
  .activity-cards .card { grid-template-columns: 1fr auto; align-items: center; }
  .activity-cards .card small, .activity-cards .card em { grid-column: 1; }
  .activity-cards .card strong { grid-column: 2; grid-row: 1 / span 2; margin: 0; font-size: 28px; }
  .section-head > button, .section-head > label { width: 100%; }
  .chart-header label { width: 100%; justify-content: space-between; }
  .filters label { flex-basis: 100%; }
  .filters > button { flex: 1 1 auto; }
  .pagination { justify-content: space-between; }
  details > summary span { display: none; }

  /* tabelas viram cartões; o nome de cada campo vem do cabeçalho da tabela, escrito aqui por coluna */
  .scroll { overflow: visible; }
  :is(#payments, #members, #plans, #access-rows, #activity-tiers) { display: grid; gap: 10px; }
  table:has(:is(#payments, #members, #plans, #access-rows, #activity-tiers)) { white-space: normal; }
  table:has(:is(#payments, #members, #plans, #access-rows, #activity-tiers)) thead { display: none; }
  :is(#payments, #members, #plans, #access-rows, #activity-tiers) tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 14px;
    padding: 14px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface-2); }
  :is(#payments, #members, #plans, #access-rows, #activity-tiers) td { display: grid; gap: 2px; padding: 0; border: 0; color: var(--ink); overflow-wrap: anywhere; }
  :is(#payments, #members, #plans, #access-rows, #activity-tiers) td:first-child { grid-column: 1 / -1; font-weight: 600; }
  :is(#payments, #members, #plans, #access-rows, #activity-tiers) td::before { font-size: 12px; font-weight: 500; color: var(--faint); }
  :is(#payments, #members, #plans, #access-rows, #activity-tiers) td:empty { display: none; }
  #payments td:nth-child(1)::before { content: 'Data'; } #payments td:nth-child(2)::before { content: 'Apoiador'; }
  #payments td:nth-child(3)::before { content: 'Plano'; } #payments td:nth-child(4)::before { content: 'Tipo'; } #payments td:nth-child(5)::before { content: 'Recebido'; }
  #members td:nth-child(1)::before { content: 'Apoiador'; } #members td:nth-child(2)::before { content: 'Plano'; }
  #members td:nth-child(3)::before { content: 'Situação'; } #members td:nth-child(4)::before { content: 'Válida até'; } #members td:nth-child(5)::before { content: 'Mensalidade'; }
  #plans td:nth-child(1)::before { content: 'Plano'; } #plans td:nth-child(2)::before { content: 'Ativos'; }
  #plans td:nth-child(3)::before { content: 'Em graça'; } #plans td:nth-child(4)::before { content: 'Expirados'; } #plans td:nth-child(5)::before { content: 'Mensal estimada'; }
  #activity-tiers td:nth-child(1)::before { content: 'Tier no dia de uso'; } #activity-tiers td:nth-child(2)::before { content: 'Moeda'; }
  #activity-tiers td:nth-child(3)::before { content: 'Hoje'; } #activity-tiers td:nth-child(4)::before { content: 'Na semana'; } #activity-tiers td:nth-child(5)::before { content: 'No mês'; }
  #access-rows td:nth-child(1)::before { content: 'Identificador da chave'; } #access-rows td:nth-child(2)::before { content: 'Conta Yoru'; }
  #access-rows td:nth-child(3)::before { content: 'Situação'; } #access-rows td:nth-child(4)::before { content: 'Criada em'; }
  #access-rows td:nth-child(5)::before { content: 'Sessões'; } #access-rows td:nth-child(6) { grid-column: 1 / -1; }
  /* linha de aviso ("Nenhuma assinatura neste filtro.") ocupa o cartão inteiro, sem rótulo */
  :is(#payments, #members, #plans, #access-rows, #activity-tiers) td[colspan]::before, :is(#payments, #members, #plans, #access-rows, #activity-tiers) tr:has(td:empty) td:first-child::before { content: none; }
  dialog { padding: 22px; }
  #login { margin: 20px 0; padding: 22px; }
  #login-form > button { width: 100%; }
}
@media (max-width: 380px) {
  .brand-name { display: none; }
  .currency-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-height: 720px) and (min-width: 641px) { .aside-note { display: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- entrada (02/11): sem a barra lateral vazia, cartão no centro sob o céu ---------- */
body:has(#login:not([hidden])) aside { display: none; }
body:has(#login:not([hidden])) main { margin-left: 0; max-width: none; min-height: 100vh; display: grid; align-content: center; justify-items: center; gap: 0;
  padding-block: max(28px, env(safe-area-inset-top, 0px)) max(28px, env(safe-area-inset-bottom, 0px));
  background: radial-gradient(ellipse at 50% -10%, #7c3aed30, transparent 60%); }
body:has(#login:not([hidden])) main::before { content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .7;
  background: radial-gradient(1px 1px at 12% 20%, #fffb 50%, transparent 51%), radial-gradient(1px 1px at 28% 70%, #fff8 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 46% 12%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 66% 34%, #fff9 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 82% 16%, #fffc 50%, transparent 51%), radial-gradient(1px 1px at 90% 72%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 86%, #fff7 50%, transparent 51%), radial-gradient(1px 1px at 58% 88%, #fff7 50%, transparent 51%); }
body:has(#login:not([hidden])) main > header { width: min(520px, 100%); margin-bottom: 18px; justify-content: center; text-align: center; position: relative; }
body:has(#login:not([hidden])) main > header > div:first-child { justify-items: center; }
body:has(#login:not([hidden])) h1 { font-size: clamp(26px, 5vw, 34px); }
#login { position: relative; width: min(520px, 100%); margin: 0; padding: clamp(20px, 4vw, 32px); gap: 12px; border-radius: 20px; }
#login h2 { font-size: clamp(21px, 3.4vw, 25px); }
#login p, #login > p { font-size: 15px; line-height: 1.6; }
#login-form { flex-direction: column; align-items: stretch; gap: 14px; }
#login-form > label, #login-form > button, #auth-extra { width: 100%; flex: none; }
#login-form input, #login-form textarea { font-size: 15px; min-height: 48px; }
#login .note, #auth-extra .note, #auth-extra p, #login small { font-size: 13.5px; line-height: 1.6; color: var(--dim); }
#auth-extra { gap: 14px; padding-top: 0; }
#auth-extra a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14.5px; font-weight: 600; }
#auth-extra textarea { min-height: 120px; }
body:has(#login:not([hidden])) #message { width: min(520px, 100%); margin-top: 14px; text-align: center; font-size: 14.5px; line-height: 1.6; position: relative; }
@media (max-width: 640px) {
  body:has(#login:not([hidden])) main { align-content: start; padding-top: max(32px, env(safe-area-inset-top, 0px)); }
  #login { border-radius: 18px; }
}

/* ---------- acabamento (03/11) ---------- */
#login::before { content: ''; width: 56px; height: 56px; border-radius: 16px; background: url('./icon.png') center / cover no-repeat;
  box-shadow: 0 0 0 1px #a78bfa40, 0 8px 30px #7c3aed40; margin-bottom: 4px; }
.panel, .live-toolbar, .card { box-shadow: inset 0 1px 0 #ffffff0a; }
.panel { background-image: linear-gradient(180deg, #a78bfa0a, transparent 120px); }
.primary { background: linear-gradient(180deg, var(--primary-hover), var(--primary)); }
.primary:hover:not(:disabled) { background: linear-gradient(180deg, #9b6dff, var(--primary-hover)); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card { transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
  .card:hover { transform: translateY(-2px); border-color: #5b44a8; box-shadow: inset 0 1px 0 #ffffff0f, 0 10px 30px #00000059; }
}
html { scrollbar-color: #3b3360 var(--bg); scrollbar-width: thin; }
::selection { background: #7c3aed66; color: #fff; }
