:root, [data-theme="claro"] {
  --bg: #f6f7f9; --bg-img: none; --card: #fff; --solid: #fff; --nav: #fff; --line: #e6e8ec; --line2: #f1f2f4; --hov: #cfd3da;
  --txt: #111827; --mut: #6b7280; --dim: #9ca3af; --input: #fff; --on: #fff; --shadow: #0002;
  --acc: #4f46e5; --acc-hov: #4338ca; --acc2: #a5b4fc; --accbg: #eef2ff; --acc-txt: #4338ca; --on-acc: #fff;
  --ok: #059669; --okbg: #ecfdf5; --ok-txt: #065f46; --bad: #dc2626; --badbg: #fef2f2;
  --b-bg: #f3f4f6; --b-txt: #374151; --info-bg: #e0f2fe; --info-txt: #075985; --warn-bg: #fef3c7; --warn-txt: #92400e;
  --backdrop: #1118274d; --toast: #111827; --blur: none; --radius: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { background: var(--bg-img), var(--bg); background-attachment: fixed; color: var(--txt); font: 14px/1.45 Inter, system-ui, sans-serif; display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
button, select, input, textarea { font: inherit; color: inherit; }
button, select { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-weight: 500; cursor: pointer; }
/* Native bits (dropdown lists, checkboxes, scrollbars, placeholders) follow the theme too. --card can be a gradient,
   which leaves a select with no background colour and its dropdown list white, so selects get a solid colour. */
select { background: var(--input); }
.period-custom { display: inline-flex; align-items: center; gap: 6px; }
.period-custom[hidden] { display: none; }
.period-custom input { width: 64px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--input); color: inherit; }
option, optgroup { background: var(--solid); color: var(--txt); }
option:checked { background: var(--accbg); }
:root { accent-color: var(--acc); scrollbar-color: var(--hov) transparent; }
::placeholder { color: var(--dim); opacity: 1; }
::selection { background: var(--acc); color: var(--on-acc); }
button:hover, select:hover { border-color: var(--hov); }
button.primary { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }
button.primary:hover { background: var(--acc-hov); border-color: var(--acc-hov); }
button.ghost { border: 0; background: none; color: var(--mut); padding: 4px 8px; }
button.ghost:hover { color: var(--bad); }
input { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--input); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accbg); border-color: var(--acc); }
.muted { color: var(--mut); } .small { font-size: 12px; } .strong { font-weight: 500; }
h1 { font-size: 22px; font-weight: 600; } h2 { font-size: 15px; font-weight: 600; } h3 { font-size: 13px; font-weight: 600; margin: 4px 0 6px; }

nav { background: var(--nav); backdrop-filter: var(--blur); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.logo { display: flex; align-items: center; padding: 0 10px 22px; }
.logo img { display: block; height: 34px; width: auto; max-width: 100%; }
.logo .icon { display: none; }
nav a { padding: 9px 12px; border-radius: 8px; color: var(--mut); font-weight: 500; text-decoration: none; }
nav a:hover { background: var(--bg); }
nav a.on { background: var(--accbg); color: var(--acc); }
nav a.soon { color: var(--dim); cursor: default; } nav a.soon:hover { background: none; }
nav .ico { display: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
nav .short, nav .more-btn { display: none; }
/* Jogos */
#view-jogos { display: flex; flex-direction: column; gap: 16px; }
#view-jogos[hidden] { display: none !important; }
#gm-groups { display: flex; flex-direction: column; gap: 16px; }
.gm-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.gm-game { display: grid; grid-template-columns: 44px minmax(120px, 1fr) repeat(5, 84px) 120px; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; border: 1px solid var(--line2); }
.gm-game:hover { border-color: var(--hov); }
.gm-game img, .gm-noicon { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--line2); display: block; }
.gm-name { min-width: 0; } .gm-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-n { text-align: right; } .gm-n b { display: block; font-size: 15px; font-weight: 600; } .gm-n small { color: var(--mut); font-size: 11px; }
.gm-n .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); margin-right: 6px; vertical-align: middle; }
.gm-game.live .gm-n .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--okbg); }
.gm-spark { width: 120px; height: 28px; } .gm-spark polyline { fill: none; stroke: var(--acc); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.gm-row { display: flex; align-items: center; gap: 6px; } .gm-row .gm-game { flex: 1; min-width: 0; }
.gm-row .gm-eye { opacity: 0; transition: opacity .15s; font-size: 14px; } .gm-row:hover .gm-eye, .gm-row.is-hidden .gm-eye { opacity: .8; }
.gm-row.is-hidden .gm-game { opacity: .5; }
.gm-group .ct { flex-wrap: wrap; } .gm-tools { margin-left: auto; display: flex; gap: 4px; }
.gm-tools button[disabled] { opacity: .3; cursor: default; }
.gm-group.folded { opacity: .75; padding-top: 12px; padding-bottom: 12px; } .gm-group.folded .ct { margin: 0; }
.gm-hidden { margin-top: 8px; } .gm-hidden summary { cursor: pointer; }
@media (hover: none) { .gm-row .gm-eye { opacity: .6; } }
.gm-form { display: flex; gap: 8px; margin: 8px 0; }
.gm-robux { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 6px 0 8px; padding: 10px 12px; border-radius: 10px; background: var(--line2); }
.gm-robux b { display: block; font-size: 15px; } .gm-robux small { color: var(--mut); font-size: 11px; }
@media (max-width: 900px) { .gm-robux { grid-template-columns: repeat(2, 1fr); } }
.empty-card { color: var(--mut); }
@media (max-width: 900px) {
  .gm-game { grid-template-columns: 40px 1fr repeat(2, 70px); }
  .gm-game .gm-n:nth-of-type(n+4), .gm-spark { display: none; }
}
nav .sec { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; padding: 18px 12px 6px; }
.user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
.av { width: 32px; height: 32px; border-radius: 50%; background: var(--accbg); color: var(--acc-txt); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; }

main { padding: 26px 32px 40px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
section { display: flex; flex-direction: column; gap: 16px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.acts { display: flex; gap: 10px; } .acts.end { justify-content: flex-end; margin-top: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: var(--blur); padding: 18px 20px; min-width: 0; }
.card.narrow { max-width: 640px; display: flex; flex-direction: column; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpis:has(> #gm-store-card:not([hidden])) { grid-template-columns: repeat(5, 1fr); }
.kpi > span:first-child { color: var(--mut); font-size: 13px; }
.kpi b { display: block; font-size: 26px; font-weight: 600; margin: 6px 0 4px; letter-spacing: -.01em; }
/* Stripe tab: two sub-tabs stacked tight; [hidden] must win over display:flex */
.stripe-stack { display: flex; flex-direction: column; gap: 10px; }
.stripe-stack[hidden] { display: none; }
.stripe-tabs { align-self: flex-start; }
.stripe-form { display: grid; grid-template-columns: 170px 1fr auto auto; gap: 10px; align-items: center; }
.stripe-check { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; }
.stripe-result { margin-top: 10px; word-break: break-all; }
.stripe-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stripe-edit input[name=name] { flex: 1 1 200px; }
.stripe-edit input[name=amount] { width: 120px; }
.stripe-acts { white-space: nowrap; text-align: right; }
.stripe-acts button + button { margin-left: 6px; }
#view-stripe .card { padding: 12px 14px; }
#view-stripe .ct { margin-bottom: 8px; }
#view-stripe .kpis { gap: 10px; }
#view-stripe .kpi b { margin: 2px 0; }
#view-stripe .rows td, #view-stripe .rows th { padding-top: 6px; padding-bottom: 6px; }
@media (max-width: 900px) {
  .stripe-form { grid-template-columns: 1fr 1fr; }
  .stripe-form input[name=description] { grid-column: span 2; }
  .stripe-form button { width: 100%; }
  .stripe-tabs { align-self: stretch; }
  .stripe-tabs span { flex: 1; text-align: center; }
  .stripe-acts { white-space: normal; }
  .stripe-acts button { margin: 2px 0 2px 4px; }
  /* phone cards (see table.rows below): item/name on top-left, net/price on top-right, the rest underneath */
  table.rows.st-sales td:nth-child(2), table.rows.st-links td:nth-child(1) {
    order: 1; flex: 1 1 calc(100% - 120px); min-width: 0; font-size: 14px; font-weight: 500; color: var(--txt); text-align: left; }
  table.rows.st-sales td:nth-child(5), table.rows.st-links td:nth-child(2) {
    order: 2; flex: 0 0 104px; text-align: right; font-size: 15px; font-weight: 600; color: var(--txt); }
  table.rows.st-sales td:nth-child(3), table.rows.st-links td:nth-child(3) { order: 3; flex: initial; font-size: 12px; font-weight: 400; color: var(--mut); }
  table.rows.st-sales td[data-l]::before { content: attr(data-l) " "; }
  table.rows.st-links td[colspan] { flex: 1 1 100%; }
}
.kpi .d { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }  /* the store's product list */
/* the eye: money hidden for screen shares (money() already prints •••; Robux and the money KPIs are blurred) */
.eye { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; }
.eye .shut, body.privacy .eye .open { display: none; }
body.privacy .eye .shut { display: block; }
body.privacy .eye { color: var(--accent, #8b5cf6); }
body.privacy .kpi:not(.pub) b, body.privacy .kpi:not(.pub) .d, body.privacy .gm-robux b, body.privacy .gm-row .gm-n:last-child b,
body.privacy #gm-groups p.muted.small, body.privacy .msg.card-action > span { filter: blur(7px); user-select: none; }
.d { font-size: 12px; font-weight: 500; } .d.up { color: var(--ok); } .d.down { color: var(--bad); }
.d em { font-style: normal; color: var(--dim); font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 340px; gap: 16px; }
.ct { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.seg { display: flex; background: var(--bg); border-radius: 8px; padding: 3px; font-size: 12px; }
.seg span { padding: 5px 10px; border-radius: 6px; color: var(--mut); cursor: pointer; }
.seg.big { font-size: 13px; font-weight: 500; align-items: center; }
.seg.big span { padding: 6px 12px; }
.seg span.on { background: var(--on); color: var(--txt); box-shadow: 0 1px 2px #0001; }
.link { color: var(--acc); font-size: 13px; font-weight: 500; text-decoration: none; }
.leg { display: flex; gap: 16px; font-size: 12px; color: var(--mut); }
.leg span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; background: var(--c); }
.chart { height: 200px; display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--line); }
.chart div { flex: 1; max-width: 36px; display: flex; flex-direction: column-reverse; gap: 2px; min-width: 2px; height: 100%; justify-content: flex-start; }
.chart i { display: block; border-radius: 3px 3px 0 0; }
.chart .empty { align-self: center; color: var(--dim); font-size: 13px; flex-direction: row; justify-content: center; }
.xl { display: flex; justify-content: space-between; color: var(--dim); font-size: 11px; margin-top: 6px; }
.row { display: flex; justify-content: space-between; padding: 6px 0; } .row b { font-weight: 600; }
.sbar { height: 8px; border-radius: 4px; display: flex; overflow: hidden; margin: 8px 0 16px; background: var(--line2); }
.game { display: grid; grid-template-columns: 96px 1fr 70px; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.game .t { height: 6px; background: var(--bg); border-radius: 3px; } .game .t i { display: block; height: 100%; border-radius: 3px; background: var(--acc); }
.game span:last-child { text-align: right; color: var(--mut); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--mut); font-weight: 500; font-size: 12px; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); }
td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--line2); vertical-align: middle; }
td.num, th.num { text-align: right; white-space: nowrap; }
td select { padding: 3px 6px; font-size: 13px; border-color: transparent; background: transparent; }
td select:hover { border-color: var(--line); }
td .sub { display: block; color: var(--mut); font-size: 12px; }
.neg { color: var(--bad); }
.b { display: inline-block; font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 99px; background: var(--b-bg); color: var(--b-txt); }
.b.ticket { background: var(--accbg); color: var(--acc-txt); } .b.paypal { background: var(--info-bg); color: var(--info-txt); }
.b.robux { background: var(--okbg); color: var(--ok-txt); } .b.rec { background: var(--warn-bg); color: var(--warn-txt); }
.empty-state { color: var(--mut); padding: 24px 0; text-align: center; }

.steps { padding-left: 18px; color: var(--mut); display: flex; flex-direction: column; gap: 6px; }
.steps b { color: var(--txt); font-weight: 500; }
.drop { border: 1.5px dashed var(--hov); border-radius: 12px; padding: 34px; text-align: center; color: var(--mut); cursor: pointer; }
.drop.over, .drop:hover { border-color: var(--acc); color: var(--acc); background: var(--accbg); }
.field { display: flex; align-items: center; gap: 10px; color: var(--mut); } .field input { width: auto; }
.result { background: var(--okbg); color: var(--ok-txt); border-radius: 10px; padding: 12px 14px; }
.result.err { background: var(--badbg); color: var(--bad); }

dialog { margin: auto; border: 0; border-radius: 14px; padding: 22px; width: 460px; max-width: calc(100vw - 32px); box-shadow: 0 20px 50px #0003; background: var(--solid); color: var(--txt); }
dialog::backdrop { background: var(--backdrop); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.fields label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--mut); font-weight: 500; }
.fields label.wide { grid-column: span 2; }
.fields label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--txt); }
.fields label.check input { width: auto; }
.fields select { width: 100%; padding: 8px 10px; font-weight: 400; }
.error { color: var(--bad); font-size: 13px; margin-top: 10px; min-height: 1em; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--toast); color: #fff; padding: 10px 16px; z-index: 60; border-radius: 10px; font-size: 13px; }

td.editable { cursor: text; }
td.editable:hover { background: var(--accbg); }
input.inline { width: 90px; padding: 3px 6px; text-align: right; }
nav a .count { float: right; background: var(--okbg); color: var(--ok); border-radius: 99px; font-size: 11px; padding: 1px 7px; }
nav a .count:empty { display: none; }
.b.sale { background: var(--okbg); color: var(--ok); } .b.staff, .b.unknown, .b.pending { background: var(--b-bg); color: var(--mut); }
.tick { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.tick:last-child { border-bottom: 0; }
.tick .main { min-width: 0; }
.tick small { display: block; color: var(--mut); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tick .side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tick select { padding: 3px 6px; font-size: 12px; }
button.small { padding: 5px 10px; font-size: 12px; }
nav .settings-link { margin-top: auto; }
.user { margin-top: 0; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; cursor: pointer; font-weight: 400; }
.user:hover { background: var(--bg); }
.user .chev { margin-left: auto; color: var(--dim); }
.profile-menu { background: var(--solid); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px var(--shadow); padding: 4px; margin-bottom: 6px; display: flex; flex-direction: column; }
.profile-menu button { border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; display: flex; flex-direction: column; font-weight: 400; }
.profile-menu button:hover, .profile-menu button.on { background: var(--accbg); }
.profile-menu button b { font-weight: 500; } .profile-menu button span { font-size: 12px; color: var(--mut); }
textarea { background: var(--input); color: var(--txt); font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); width: 100%; resize: vertical; }
.card.narrow .row { padding: 8px 0; border-bottom: 1px solid var(--line2); } .card.narrow .row:last-child { border-bottom: 0; }

/* ---------- phone ---------- */
@media (max-width: 900px) {
  body { grid-template-columns: minmax(0, 1fr); font-size: 15px; }
  nav a .count { float: none; margin-left: 4px; }
  .head { flex-direction: column; align-items: stretch; }
  .head .acts .seg { flex: 0 0 auto; }
  /* a tab bar at the bottom, like a phone app: the thumb reaches it, and it no longer scrolls sideways */
  nav { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 40; height: auto; flex-direction: row;
        align-items: stretch; gap: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); border-right: 0;
        border-top: 1px solid var(--line); background: var(--solid); }
  nav > :not(.tab):not(.profile-menu) { display: none; }
  nav .tab { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
             gap: 2px; padding: 6px 2px; font-size: 11px; font-weight: 500; color: var(--mut); border: 0; background: none;
             border-radius: 10px; position: relative; -webkit-tap-highlight-color: transparent; }
  nav .tab .ico { display: block; }
  nav .tab .full { display: none; } nav .tab .short { display: inline; }
  nav a.tab.on, nav .more-btn.on { background: none; color: var(--acc); }
  nav a.tab .count { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; padding: 0 5px; font-size: 10px; line-height: 16px; }
  /* "Mais": the other pages and the profile, in a sheet above the bar */
  nav.more > a:not(.tab), nav.more > .user { display: flex; }
  nav.more { flex-wrap: wrap; }
  nav.more > a:not(.tab), nav.more > .user { order: -1; flex: 1 1 calc(50% - 8px); margin: 4px; padding: 14px 12px;
        background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--txt); font-size: 14px; }
  nav.more > .user { flex-basis: calc(100% - 8px); }
  nav [hidden], nav.more > a.soon { display: none !important; }  /* the partner's hidden pages, and "em breve" */
  /* Side hustles (KDP…) sit inside a folding group, so "Mais" didn't list them: open the group into the sheet
     (folded or not, the fold button is desktop-only) */
  body:not(.partner) nav.more > .hustles { display: contents !important; }
  nav.more > .hustles > a:not(.soon) { display: flex; order: -1; flex: 1 1 calc(50% - 8px); margin: 4px; padding: 14px 12px;
        background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--txt); font-size: 14px; }
  nav.more > .hustles > a.soon { display: none; }
  .user > div:not(.av) { min-width: 0; } .user .chev { display: none; }
  .profile-menu { position: fixed; bottom: calc(70px + env(safe-area-inset-bottom)); top: auto; right: 10px; left: 10px; z-index: 50; }
  main { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); gap: 14px; }
  .head h1 { font-size: 20px; }
  .head .acts { flex-wrap: wrap; width: 100%; gap: 8px; }
  .head .acts #period { flex: 1; }
  .head .acts button { flex: 1 1 40%; }
  /* the :has() one is the Jogos page with the store card: it forced 5 columns on the phone too (seen 2026-11-06) */
  .kpis, .kpis:has(> #gm-store-card:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpis > .kpi:nth-child(5) { grid-column: span 2; }
  .kpi .d { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .kpi { padding: 14px; } .kpi b { font-size: 20px; }
  .grid2 { grid-template-columns: 1fr; }
  .card { padding: 14px; overflow-x: auto; }
  .card table { min-width: 560px; }
  /* sales and expenses: one card per row (item and amount on top, the details under), no sideways scrolling */
  table.rows { display: block; min-width: 0 !important; }
  table.rows tbody { display: block; }
  table.rows tr:has(th) { display: none; }
  table.rows tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 11px 0; border-bottom: 1px solid var(--line2); }
  table.rows tr:last-child { border-bottom: 0; }
  table.rows td { order: 3; border: 0; padding: 0; font-size: 12px; color: var(--mut); }
  table.rows td:nth-child(3) { order: 1; flex: 1 1 calc(100% - 120px); min-width: 0; font-size: 14px; font-weight: 500; color: var(--txt); }
  table.sales:not(.edit) td:nth-child(6), table.sales.edit td:nth-child(7), table.exp td:nth-child(6) {
    order: 2; flex: 0 0 104px; text-align: right; font-size: 15px; font-weight: 600; color: var(--txt); }
  table.rows td .neg, table.rows td.neg { color: var(--bad); }
  table.sales.edit td:nth-child(6) { display: none; }  /* the fee: in the full table on the PC */
  table.rows td:last-child:has(button) { order: 4; margin-left: auto; }
  table.rows td select { padding: 2px 4px; font-size: 12px; color: var(--mut); }
  #recent td:nth-child(4), #recent td:nth-child(5) { display: none; }
  .chart { height: 150px; }
  .tick { flex-wrap: wrap; } .tick .side { width: 100%; justify-content: flex-end; }
  dialog { padding: 18px; }
  .fields { grid-template-columns: 1fr 1fr; gap: 10px; }
  #toast { bottom: 16px; width: max-content; max-width: calc(100vw - 32px); }
}

/* login */
#login { position: fixed; inset: 0; z-index: 50; background: var(--bg-img), var(--bg); display: grid; place-items: center; padding: 16px; }
#login form { width: 340px; max-width: 100%; display: flex; flex-direction: column; gap: 14px; }
#login h1 { font-size: 18px; }
#login label { display: flex; flex-direction: column; gap: 6px; color: var(--mut); }
#login select { width: 100%; }
#login .err { color: var(--bad); }
body.partner .admin-only { display: none !important; }
.partner-only { display: none !important; }
body.partner .partner-only { display: flex !important; }

/* Jarvis */
.card.chat { display: flex; flex-direction: column; max-width: 820px; height: calc(100vh - 150px); min-height: 420px; }
.card.chat .ct { margin-bottom: 10px; }
#jarvis-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 12px; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.msg.bot { background: var(--bg); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.me { background: var(--acc); color: var(--on-acc); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.err { background: var(--badbg); color: var(--bad); }
.msg.card-action { align-self: flex-start; border: 1px solid var(--line); background: var(--card); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.msg.card-action .side { display: flex; gap: 6px; margin-left: auto; }
/* automatic notices: one small line each (click = read it all); older ones in a run fold away */
.msg.note { align-self: stretch; max-width: none; padding: 1px 4px; border-radius: 6px; font-size: 12px; line-height: 1.5; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; flex: none; }
.msg.note:hover { color: inherit; }
.msg.note.open { white-space: normal; background: var(--bg); padding: 6px 9px; }
.msg.note:not(.open) br { display: none; }
details.notes { align-self: stretch; display: flex; flex-direction: column; gap: 4px; flex: none; }
details.notes summary { font-size: 12px; color: var(--dim); cursor: pointer; padding: 1px 4px; }
details.notes[open] summary { margin-bottom: 4px; }
#jarvis-form { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line2); }
#jarvis-form input { flex: 1; }
body.on-jarvis .head .acts { display: none; }
@media (max-width: 900px) {
  /* the chat fills the screen between the top and the tab bar; the page title would only take room */
  body.on-jarvis .head { display: none; }
  .card.chat { height: calc(100dvh - 112px - env(safe-area-inset-bottom)); min-height: 320px; overflow-x: hidden; max-width: none; }
  .msg { max-width: 88%; font-size: 15px; }
  #jarvis-form { gap: 6px; }
  #jarvis-form input { font-size: 16px; min-width: 0; padding: 10px 12px; }
  #jarvis-form .mic, #jarvis-form button.primary { min-width: 44px; min-height: 44px; justify-content: center; }
}
#jarvis-form .mic { padding: 8px 11px; display: flex; align-items: center; color: var(--mut); }
#jarvis-form .mic.rec { background: var(--bad); border-color: var(--bad); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px #dc262626; } }
#jarvis-form .mic.wake.on { color: var(--acc); border-color: var(--acc); }
#jarvis-form .mic.wake.heard { background: var(--acc); border-color: var(--acc); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.offline { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.offline[hidden] { display: none; }
.offline-card { max-width: 360px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.offline-card p { color: var(--mut); margin: 0; line-height: 1.5; }
.msg.bot { position: relative; padding-right: 34px; }
.msg .say { position: absolute; right: 6px; bottom: 6px; border: 0; background: none; padding: 3px; color: var(--dim); display: flex; }
.msg .say:hover { color: var(--acc); }

/* ---------- Definições: settings on the left, look panel on the right ---------- */
#view-definicoes { display: grid; grid-template-columns: minmax(0, 640px) minmax(340px, 460px); gap: 16px; align-items: start; }
.set-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.set-look { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 12px; }
.set-look .ct { margin-bottom: 0; }
.set-look h3 { margin: 6px 0 0; }
@media (max-width: 1150px) {
  #view-definicoes { grid-template-columns: minmax(0, 1fr); }
  .set-main .card.narrow { max-width: none; }
  .set-look { position: static; }
}
.preview { aspect-ratio: 16 / 10; display: grid; grid-template-columns: 24% 1fr; border-radius: 10px; overflow: hidden;
           border: 1px solid var(--line); background: var(--bg-img), var(--bg); color: var(--txt); transition: background .25s; }
.pv-nav { background: var(--nav); border-right: 1px solid var(--line); padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; }
.pv-nav img { height: 16px; width: auto; max-width: 100%; object-fit: contain; object-position: left; margin-bottom: 6px; }
.pv-nav i { height: 8px; border-radius: 3px; background: var(--line2); }
.pv-nav i.on { background: var(--accbg); box-shadow: inset 2px 0 var(--acc); }
.pv-av { margin-top: auto; width: 16px; height: 16px; border-radius: 50%; background: var(--accbg); }
.pv-main { padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.pv-head { display: flex; justify-content: space-between; align-items: center; }
.pv-head b { width: 38%; height: 10px; border-radius: 3px; background: var(--txt); opacity: .85; }
.pv-btn { width: 22%; height: 16px; border-radius: 5px; background: var(--acc); }
.pv-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pv-card { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) / 2); padding: 7px; }
.pv-card small { display: block; width: 55%; height: 4px; border-radius: 2px; background: var(--mut); opacity: .6; }
.pv-card b { display: block; width: 75%; height: 9px; border-radius: 3px; background: var(--txt); margin-top: 6px; }
.pv-chart { flex: 1; display: flex; align-items: flex-end; gap: 7px; padding: 10px 10px 0; min-height: 0; }
.pv-chart i { flex: 1; border-radius: 3px 3px 0 0; background: linear-gradient(var(--acc), var(--acc2)); }
#look-profile { align-self: flex-start; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.pick.logos { grid-template-columns: repeat(3, 1fr); }
.pick button { display: flex; flex-direction: column; align-items: stretch; gap: 7px; padding: 8px; text-align: left; font-weight: 500; font-size: 13px; }
.pick button.on { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.pick .logo-tile { height: 44px; display: grid; place-items: center; border-radius: 6px; background: var(--bg); }
.pick .logo-tile img { max-height: 26px; max-width: 88%; }
.pick .swatch { height: 40px; border-radius: 6px; border: 1px solid #8882; display: grid; grid-template-columns: 28% 1fr; gap: 5px; padding: 5px; overflow: hidden; }
.pick .swatch i { border-radius: 3px; }
.pick .swatch span { display: flex; flex-direction: column; gap: 4px; }
.pick .swatch span i { height: 9px; } .pick .swatch span i:last-child { flex: 1; }
.login-logo { height: 34px; width: auto; align-self: flex-start; }

/* ---------- themes (per profile) ---------- */
/* Built from the references in mockups/referencias. Light is the original look.
   Plain [data-theme] selectors so the preview in Definições can show any theme inside the page. */
[data-theme="roxo"] {
  --bg: #0b0b11; --card: linear-gradient(180deg, #17161f, #121119); --solid: #16151d; --nav: #0e0d14;
  --line: #24232e; --line2: #1c1b25; --hov: #3a3848;
  --txt: #f3f3f7; --mut: #8d8c9c; --dim: #5f5e6e; --input: #0f0e15; --on: #2a2838; --shadow: #0008;
  --acc: #6e4bff; --acc-hov: #8164ff; --acc2: #b1a0ff; --accbg: #6e4bff26; --acc-txt: #b9a8ff; --on-acc: #fff;
  --ok: #34d399; --okbg: #10b98122; --ok-txt: #6ee7b7; --bad: #f87171; --badbg: #f8717120;
  --b-bg: #ffffff12; --b-txt: #c9c8d6; --info-bg: #38bdf81f; --info-txt: #7dd3fc; --warn-bg: #f59e0b22; --warn-txt: #fcd34d;
  --backdrop: #000a; --toast: #2a2838; color-scheme: dark;
}
[data-theme="lavanda"] {
  --bg: #0c0b11;
  --bg-img: radial-gradient(900px 520px at 78% -8%, #8a78d655, transparent 70%), radial-gradient(700px 500px at -5% 105%, #5a4aa033, transparent 70%);
  --card: #1a1824b3; --solid: #1a1824; --nav: #13121ab3; --blur: blur(18px);
  --line: #ffffff14; --line2: #ffffff0b; --hov: #ffffff2e;
  --txt: #f1eefb; --mut: #9a95b0; --dim: #686380; --input: #0f0e16cc; --on: #ffffff1c; --shadow: #0009;
  --acc: #b7a6ff; --acc-hov: #c9bcff; --acc2: #6c5bc9; --accbg: #b7a6ff22; --acc-txt: #cfc4ff; --on-acc: #17132b;
  --ok: #4ade80; --okbg: #22c55e1f; --ok-txt: #86efac; --bad: #fb7185; --badbg: #fb71851f;
  --b-bg: #ffffff12; --b-txt: #d0cce0; --info-bg: #a5b4fc1f; --info-txt: #c7d2fe; --warn-bg: #fbbf241f; --warn-txt: #fde68a;
  --backdrop: #000a; --toast: #2a2640; --radius: 16px; color-scheme: dark;
}
[data-theme="laranja"] {
  --bg: #050505;
  --bg-img: radial-gradient(1100px 600px at 30% -10%, #ffffff12, transparent 65%);
  --card: linear-gradient(160deg, #1b1b1b, #0e0e0e); --solid: #151515; --nav: linear-gradient(180deg, #161616, #090909);
  --line: #262626; --line2: #1b1b1b; --hov: #3d3d3d;
  --txt: #f5f5f5; --mut: #8f8f8f; --dim: #5c5c5c; --input: #0b0b0b; --on: #2e2e2e; --shadow: #000c;
  --acc: #ff4d12; --acc-hov: #ff6a38; --acc2: #d4d4d4; --accbg: #ff4d1221; --acc-txt: #ff8a5f; --on-acc: #fff;
  --ok: #22c55e; --okbg: #22c55e1c; --ok-txt: #86efac; --bad: #ef4444; --badbg: #ef44441f;
  --b-bg: #ffffff10; --b-txt: #cfcfcf; --info-bg: #ffffff14; --info-txt: #e5e5e5; --warn-bg: #ff4d121c; --warn-txt: #ffb08f;
  --backdrop: #000b; --toast: #262626; color-scheme: dark;
}
[data-theme="azul"] {
  --bg: #060b2e;
  --bg-img: radial-gradient(1000px 640px at 85% -10%, #6c4cf566, transparent 65%), radial-gradient(900px 700px at 0% 110%, #1d4ed866, transparent 65%), linear-gradient(160deg, #0a1446, #060a28);
  --card: linear-gradient(127deg, #060b28f2, #0a0e23b3); --solid: #0b1236; --nav: linear-gradient(160deg, #060b28f0, #0a0e23cc); --blur: blur(14px);
  --line: #ffffff14; --line2: #ffffff0a; --hov: #ffffff30;
  --txt: #ffffff; --mut: #a0aec0; --dim: #6b7a99; --input: #0f1535; --on: #1a1f37; --shadow: #000a;
  --acc: #0075ff; --acc-hov: #2b8cff; --acc2: #21d4fd; --accbg: #0075ff26; --acc-txt: #6fb4ff; --on-acc: #fff;
  --ok: #01b574; --okbg: #01b5741f; --ok-txt: #4ade9b; --bad: #e31a1a; --badbg: #e31a1a24;
  --b-bg: #ffffff12; --b-txt: #cbd5e1; --info-bg: #21d4fd1f; --info-txt: #7ee7ff; --warn-bg: #fbbf241f; --warn-txt: #fde68a;
  --backdrop: #020515b0; --toast: #1a1f37; --radius: 18px; color-scheme: dark;
}

/* ---------- dropdowns ----------
   Customizable <select> (Edge/Chrome 135+): the list is drawn by us, in the theme's colours.
   Older browsers (and the phone's own picker) keep the native list with the colours set above. */
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { display: inline-flex; align-items: center; gap: 10px; transition: border-color .15s, box-shadow .15s; }
  select::picker-icon {
    content: ""; width: 10px; height: 10px; margin-left: auto; flex-shrink: 0; background: var(--mut);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 3.5 5 7l3.5-3.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: rotate .2s, background-color .15s;
  }
  select:open { border-color: var(--acc); box-shadow: 0 0 0 3px var(--accbg); }
  select:open::picker-icon { rotate: 180deg; background: var(--acc); }

  ::picker(select) {
    background: var(--solid); color: var(--txt); border: 1px solid var(--line); border-radius: 12px;
    padding: 5px; margin-block: 6px; min-width: anchor-size(width); max-height: min(320px, 60vh);
    box-shadow: 0 18px 40px -8px var(--shadow), 0 0 0 1px #0000000d;
  }

  option {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
    background: transparent; color: var(--txt); font-weight: 400; cursor: pointer; white-space: nowrap;
  }
  option:hover, option:focus-visible { background: var(--line2); outline: none; }
  option:checked { background: var(--accbg); color: var(--acc-txt); font-weight: 500; }
  option::checkmark { content: "✓"; order: 1; margin-left: auto; color: var(--acc); font-size: 12px; }
  option:disabled { color: var(--dim); cursor: default; }
}

/* ---------- loading overlay (server restarting) ---------- */
#boot { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px;
        background: var(--backdrop); backdrop-filter: blur(6px); animation: boot-in .2s ease; }
.boot-card { width: 340px; max-width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
             padding: 28px 24px 24px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg-img), var(--solid);
             box-shadow: 0 24px 60px -12px var(--shadow); }
.boot-card img { height: 38px; width: auto; max-width: 80%; margin-bottom: 12px; }
.boot-card b { font-size: 15px; font-weight: 600; }
.boot-card span { color: var(--mut); font-size: 13px; }
.boot-bar { width: 70%; height: 4px; border-radius: 4px; background: var(--line2); overflow: hidden; margin-top: 16px; }
.boot-bar i { display: block; width: 35%; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--acc), var(--acc2));
              animation: boot-slide 1.3s ease-in-out infinite; }
@keyframes boot-slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@keyframes boot-in { from { opacity: 0; } }

/* Loading bar (app.js busy()) and instant tap feedback: on the phone a tap must always visibly do something. */
#busy { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200; pointer-events: none; opacity: 0;
        background: linear-gradient(90deg, transparent, var(--acc), transparent); background-size: 50% 100%;
        background-repeat: no-repeat; transition: opacity .15s; }
#busy.on { opacity: 1; animation: busy 0.9s linear infinite; }
@keyframes busy { from { background-position: -50% 0; } to { background-position: 150% 0; } }
button, a, [role="button"] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:active:not(:disabled) { transform: scale(.97); }

/* ---------- Side hustles → KDP ---------- */
.hustles-btn { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0; cursor: pointer;
  font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; padding: 18px 12px 6px; text-align: left; }
.hustles-btn .chev { margin-left: auto; transition: transform .15s; }
.hustles-btn[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.hustles { display: flex; flex-direction: column; } .hustles[hidden] { display: none; }
.hustles a { padding-left: 22px; }
.kdp-note { margin-bottom: 16px; font-size: 13px; line-height: 1.6; } .kdp-note button { margin-left: 10px; }
.kdp-note.warn { background: var(--warn-bg); color: var(--warn-txt); }
#view-kdp .kpis { margin-bottom: 16px; }
.b.kdp-on { background: var(--okbg); color: var(--ok-txt); } .b.kdp-off { background: var(--warn-bg); color: var(--warn-txt); }
table.kdp td { vertical-align: middle; } table.kdp td button { margin-left: 6px; }
table.kdp .gm-spark { width: 70px; height: 16px; vertical-align: middle; }
.kdp-budget { display: flex; gap: 6px; align-items: center; } .kdp-budget input { width: 70px; }
@media (max-width: 900px) {  /* phone: one card per campaign — name and spend on top, numbers under, buttons last */
  table.kdp td:nth-child(1) { order: 1; flex: 1 1 calc(100% - 120px); min-width: 0; font-size: 14px; font-weight: 500; color: var(--txt); }
  table.kdp td:nth-child(2) { order: 2; flex: 0 0 104px; text-align: right; font-size: 15px; font-weight: 600; color: var(--txt); }
  /* columns: 1 name, 2 spend, 3 impressions, 4 clicks, 5 sales, 6 ACOS, 7 status, 8 €/day */
  table.kdp td:nth-child(3), table.kdp td:nth-child(4) { order: 3; flex: 0 0 auto; font-size: 12px; font-weight: 400; color: var(--mut); }
  table.kdp td:nth-child(3)::after { content: " impressões"; } table.kdp td:nth-child(4)::after { content: " cliques"; }
  table.kdp td:nth-child(6)::before { content: "ACOS "; }
  table.kdp td:nth-child(7), table.kdp td:nth-child(8) { order: 4; }
  table.kdp td:nth-child(8) { margin-left: auto; }
  .kdp-note button { margin: 8px 0 0; display: block; }
}
