:root {
  --bg: #f3f5fa; --panel: #fff; --text: #14244a; --muted: #5b6785; --line: #dde2ee; --hover: #f3f5fa; --tint: 12%;
  --accent: #f8991d; --navy: #14244a; --good: #067647; --bad: #b42318;
  --s-total: #14244a; --s-bounty: #d6336c; --s-bonus: #b08900; --s-connections: #8d6e63; --s-rewards: #7a8b00;
  --s-earnings: #3a9d4a; --s-orderedRevenue: #2f6fed; --s-clicks: #e6c800; --s-pending: #f2661c; --s-conversion: #2f6fed; --s-ordered: #8a4fd3; --s-shipped: #14919b; --s-returned: #d92d20;
}
:root[data-theme="dark"] {
  --bg: #020b1e; --panel: #050f25; --text: #f1f3f8; --muted: #a9b2c8; --line: rgba(255,255,255,.14); --hover: rgba(255,255,255,.07); --tint: 16%;
  --accent: #f8991d; --good: #5bbf85; --bad: #ec7b72;
  --s-total: #e9ebf0; --s-bounty: #dd8aa8; --s-bonus: #d2b866; --s-connections: #b9aaa3; --s-rewards: #aebb5c;
  --s-earnings: #62b877; --s-orderedRevenue: #86a3dd; --s-clicks: #f5d442; --s-pending: #ff7f45; --s-conversion: #86a3dd; --s-ordered: #a98fd6; --s-shipped: #58b0b5; --s-returned: #e5766d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #020b1e; --panel: #050f25; --text: #f1f3f8; --muted: #a9b2c8; --line: rgba(255,255,255,.14); --hover: rgba(255,255,255,.07); --tint: 16%;
    --accent: #f8991d; --good: #5bbf85; --bad: #ec7b72;
    --s-total: #e9ebf0; --s-bounty: #dd8aa8; --s-bonus: #d2b866; --s-connections: #b9aaa3; --s-rewards: #aebb5c;
    --s-earnings: #62b877; --s-orderedRevenue: #86a3dd; --s-clicks: #f5d442; --s-pending: #ff7f45; --s-conversion: #86a3dd; --s-ordered: #a98fd6; --s-shipped: #58b0b5; --s-returned: #e5766d;
  }
}
:root { --font: "Oswald", system-ui, "Segoe UI", sans-serif; color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
@font-face { font-family: "Oswald"; font-weight: 400; font-style: normal; font-display: swap; src: url("../../assets/fonts/Oswald-Regular.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 500; font-style: normal; font-display: swap; src: url("../../assets/fonts/Oswald-Medium.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 600 700; font-style: normal; font-display: swap; src: url("../../assets/fonts/Oswald-SemiBold.woff2") format("woff2"); }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { width: 780px; min-height: 560px; max-height: 600px; overflow-y: auto; background: var(--bg); color: var(--text); font: 500 15px/1.45 var(--font); letter-spacing: .03em; }
.muted { color: var(--muted); } .small { font-size: 13px; }
button, select { font: inherit; color: var(--text); }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel); padding: 9px 16px; border-radius: 5px; }
button:hover { border-color: var(--accent); }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
select { border: 1px solid var(--line); background: var(--panel); padding: 8px 12px; border-radius: 5px; }

.top { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: stretch; gap: 16px; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
main { padding: 12px 16px 24px; }

.tabs { display: flex; gap: 4px; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 9px 18px; font-weight: 600; color: var(--muted); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs button:hover { color: var(--text); }



.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px; margin-top: 12px; }
.panelhead { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.opts { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.opts label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.opts select { padding: 8px 12px; font-size: 13px; }
.chartbox { position: relative; }
.chartbox svg { display: block; width: 100%; height: auto; }
.grid { stroke: var(--line); stroke-width: 1; }
.axis { fill: var(--muted); font-size: 10.5px; }
.cross { stroke: var(--muted); stroke-dasharray: 3 3; }
.tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 8px 12px; font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,.18); white-space: nowrap; z-index: 3; }
.tip div { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tip i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.tip .d { font-weight: 600; margin-bottom: 4px; }
.caption { margin: 0; flex: 1 1 260px; min-width: 0; text-align: right; }
.capline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 8px; }

.subtabs { display: flex; gap: 8px; margin-bottom: 12px; }
.subtabs button { padding: 8px 14px; font-size: 13px; border-radius: 5px; }
.subtabs button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--hover); }
.n { text-align: right; font-variant-numeric: tabular-nums; }
.zero { color: var(--muted); }
td.wrap { white-space: normal; min-width: 240px; max-width: 360px; }
a { color: inherit; }

.state { padding: 24px; text-align: center; }
.state h2 { font-size: 19px; margin: 0 0 8px; }
.state .row { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.banner { margin-bottom: 12px; padding: 12px 16px; border: 1px solid var(--bad); border-radius: 6px; color: var(--bad); background: var(--panel); }

.set h2 { font-size: 19px; margin: 0 0 12px; padding-top: 22px; border-top: 1px solid var(--line); font-weight: 600; }
.set h2:first-of-type { margin-top: 4px; padding-top: 0; border-top: 0; }
.set h2 ~ h2 { margin-top: 26px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.checks label { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); cursor: pointer; }
.set .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.set .foot { display: flex; justify-content: space-between; margin-top: 24px; }

/* Expanded (own window): fill the window instead of the fixed popup size */
body.full { width: auto; max-width: 1280px; max-height: none; margin: 0 auto; }
body.full .checks { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.flag { flex: none; border-radius: 3px; box-shadow: 0 0 0 1px var(--line); vertical-align: -2px; }
.cn { display: inline-flex; align-items: center; gap: 8px; }
.tabs button { display: inline-flex; align-items: center; gap: 8px; }

/* One row: country tabs on the left, period select + date pickers on the right */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.when { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.when select, .when input[type=date] { font-size: 13px; padding: 8px 12px; }
input[type=date] { font: inherit; color: var(--text); border: 1px solid var(--line); background: var(--panel); border-radius: 5px; color-scheme: light dark; }
.rng { white-space: nowrap; }

/* Compact income panel: total + one stacked bar + only the sources that have income */

/* Slim stat strip: replaces six separate cards */
.stat { --c: var(--muted); display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; min-width: 0; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line)); border-radius: 6px; background: color-mix(in srgb, var(--c) var(--tint), var(--panel)); }
.stat i { grid-column: 1; grid-row: 1; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.stat .l { grid-column: 2; grid-row: 1; }
.stat:not(:has(i)) .l { grid-column: 1 / -1; }
.stat b { grid-column: 1 / -1; font-size: 19px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.incomehead .l, .stat .l { color: var(--muted); font-size: 13px; }
.l2 { display: block; }
.stack span { display: block; min-width: 3px; }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--line); }
.progress i { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s; }

/* Header: logo + name | wider total card (centered) | icon buttons */
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; padding-right: 8px; }
.logo { flex: none; border-radius: 5px; }
.brandtext { display: flex; flex-direction: column; min-width: 0; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--navy-on, #14244a); font-weight: 600; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: 6px; }
.stack { display: flex; gap: 2px; height: 6px; border-radius: 5px; overflow: hidden; background: var(--line); }

/* Total-income card: fixed grid, every source always has its column, every cell has the same three lines */
.headtotal { justify-self: stretch; min-width: 0; display: flex; margin-bottom: 23px; }   /* top = top of the logo, bottom = bottom of the Store filter and Refresh button */
.totalcard { flex: 1; justify-content: space-between; display: flex; flex-direction: column; gap: 8px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: default; }
.trow2 { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: start; gap: 20px; }
.thead { display: flex; flex-direction: column; min-width: 0; padding: 6px 10px; border-radius: 5px; border: 1px solid var(--s-earnings); background: color-mix(in srgb, var(--s-earnings) 16%, transparent); }
.thead .l { color: var(--s-earnings); font-weight: 600; font-size: 13px; line-height: 1.3; }
.big { color: var(--s-earnings); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.sub { height: 16px; font-size: 12px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; contain: inline-size; }   /* a long list of other currencies must not widen its column */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(max-content, 1fr)); gap: 0 12px; min-width: 0; } /* columns never narrower than their label + amount */
.tile { min-width: 0; }
.tile.zero { opacity: .45; }
.tl { display: flex; align-items: center; gap: 5px; height: 16px; font-size: 13px; color: var(--muted); white-space: nowrap; line-height: 16px; }
.tl i { flex: none; width: 8px; height: 8px; border-radius: 3px; }
.tl .tn { min-width: 0; }
.tl .pc { flex: none; margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; }
.tile b { display: block; height: 22px; font-size: 17px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* "Updated" sits under the icon buttons */
.tools { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; justify-self: end; }
.btns { display: flex; gap: 8px; }
.tools #status { white-space: nowrap; }
.brandtext strong { font-size: 19px; line-height: 1.2; }

/* Stat cards sit above the toolbar */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 12px; }

/* Metrics multi-select (checkbox) dropdown, next to the period select */
.dd { position: relative; }
.ddsum { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; border-radius: 5px; }
.ddsum .dots { display: inline-flex; gap: 3px; }
.ddsum .dots.flags svg { width: 16px; height: 12px; border-radius: 3px; }
.ddsum .dots i { width: 8px; height: 8px; border-radius: 3px; }
.menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; min-width: 320px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.28); }
.mhead { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 8px; }
.linkbtn { border: 0; background: none; padding: 4px 8px; font-size: 13px; color: var(--accent); }
.linkbtn:hover { text-decoration: underline; }
.mi { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 5px; cursor: pointer; font-size: 15px; }
.mi:hover { background: var(--hover); }
.mi .sw { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.mi span { flex: 1; }
.mi b { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Inline legend above the chart (read-only; toggles live in the Metrics menu) */
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.leg { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--muted); }
.leg i { width: 11px; height: 11px; border-radius: 3px; }
.leg b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Period list: same look as the Metrics menu */
button.mi { width: 100%; border: 0; background: none; text-align: left; padding: 8px; }
.mi .chk { flex: none; width: 14px; color: var(--accent); font-weight: 700; }
.mi em { margin-left: auto; font-style: normal; white-space: nowrap; }
.mi.sel { background: var(--hover); font-weight: 600; }
.permenu { min-width: 320px; }

/* Clickable date range + calendar */
.rngbtn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; border-radius: 5px; }
.rngbtn svg { color: var(--muted); }
.cal { min-width: 352px; padding: 12px; }
.calfoot > span.small { white-space: nowrap; }
.calhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.calnav { width: 32px; height: 32px; padding: 0; border-radius: 5px; font-size: 19px; line-height: 1; }
.calnav:disabled { opacity: .35; cursor: not-allowed; }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; }
.calgrid .wd { font-size: 13px; color: var(--muted); text-align: center; padding: 4px 0; }
.day { height: 34px; padding: 0; border: 0; border-radius: 5px; background: none; font-size: 15px; font-variant-numeric: tabular-nums; }
.day:hover:not(:disabled) { background: var(--hover); }
.day.in { background: color-mix(in srgb, var(--accent) 20%, transparent); border-radius: 0; }
.day.start, .day.end { background: var(--accent); color: var(--navy-on, #14244a); font-weight: 600; }
.day.start { border-radius: 5px 0 0 5px; } .day.end { border-radius: 0 5px 5px 0; } .day.start.end { border-radius: 5px; }
.day.today { box-shadow: inset 0 0 0 1px var(--muted); }
.day:disabled { opacity: .3; cursor: not-allowed; }
.calfoot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.calbtns { display: flex; gap: 8px; }
.calbtns button { padding: 8px 14px; font-size: 13px; }
.calbtns button:disabled { opacity: .45; cursor: not-allowed; }

/* Notifications bell + panel */
.bellbtn { position: relative; }
.bellbadge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 5px; background: var(--bad); color: var(--bg); font-size: 13px; line-height: 18px; font-weight: 600; text-align: center; }
.notifpanel { position: absolute; right: 16px; top: calc(100% + 4px); z-index: 40; }
.npanel { width: 420px; max-width: calc(100vw - 32px); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.28); }
.nhead { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.nhead .linkbtn:disabled { opacity: .4; cursor: not-allowed; }
.nlist { max-height: 340px; overflow-y: auto; }
.nitem { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: start; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.nitem.new { background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.nitem .sw { width: 10px; height: 10px; border-radius: 3px; margin-top: 6px; }
.ntitle { font-weight: 600; } .ntime { white-space: nowrap; }
.nempty { padding: 24px 14px; text-align: center; margin: 0; }
.nset { padding: 12px 14px; }
.set .nset { padding: 4px 0 0; }
.ntoggles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 8px 0; }
.nt { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 15px; }
.nt .sw { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.ndel { border: 0; background: none; padding: 0 6px; height: 24px; border-radius: 3px; color: var(--muted); font-size: 15px; line-height: 1; }
.ndel:hover { background: var(--hover); color: var(--bad); border: 0; }

/* Chart: always-visible last point */
.laststrip { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 4px 14px; margin: 0 auto 0 0; padding: 5px 8px; font-size: 14px; color: var(--muted); background: color-mix(in srgb, var(--s-earnings) 12%, transparent); border-radius: 3px; }
.laststrip .ldate { color: var(--text); font-weight: 600; }
.laststrip .ld { color: var(--s-earnings); font-weight: 600; }
.laststrip span { display: inline-flex; align-items: center; gap: 5px; }
.laststrip span b { color: var(--text); font-variant-numeric: tabular-nums; }
.laststrip i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.laststrip .lx { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 2px; }
.laststrip .lx:hover { color: var(--text); }

.mi svg { flex: none; width: 18px; height: 13px; border-radius: 3px; }
.msep { height: 1px; background: var(--line); margin: 4px 0; }
.allrow { font-weight: 600; }
.locwrap { margin-left: auto; }
.lonly { flex: 1; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.lonly:hover span { text-decoration: underline; }
/* very narrow window: fall back to equal columns with clipped labels rather than overflowing */
@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tl .tn { overflow: hidden; text-overflow: ellipsis; }
}
.nfoot { padding: 10px 14px; border-top: 1px solid var(--line); text-align: center; }

.bdtip { position: fixed; z-index: 60; min-width: 190px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 6px 20px rgba(0,0,0,.28); font-size: 13px; pointer-events: none; }
.bdtip[hidden] { display: none; }
.bdt { font-weight: 600; margin-bottom: 6px; }
.bdr { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 2px 0; }
.bdr span { display: inline-flex; align-items: center; gap: 7px; }
.bdr svg { width: 16px; height: 12px; border-radius: 3px; }
.bdr b { font-variant-numeric: tabular-nums; font-weight: 600; }
.bdr.z { opacity: .5; }
[data-bd] { cursor: default; }


/* logo: separate light / dark artwork (your files, text already outlined) */
.wordmark { overflow: visible; display: block; height: 66px; width: auto; max-width: 100%; }
/* header buttons: 3 x 2 grid so they never run into the middle card */
.btns { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.brow { display: flex; gap: 6px; justify-content: flex-end; }
#close { background: #c8372d; border-color: #c8372d; color: #fff; }
#close:hover { background: #b02a21; border-color: #b02a21; }
.refreshbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 40px; padding: 0 14px; border-radius: 6px; background: var(--accent); border-color: var(--accent); color: var(--navy-on, #14244a); font-weight: 600; }
.refreshbtn:hover { filter: brightness(.95); border-color: var(--accent); }
.iconbtn { width: 36px; height: 36px; border-radius: 6px; }
.tools { align-items: flex-end; }

/* one row at every width: the logo and the card tighten up instead of wrapping */
.top { gap: 12px; }
.thead { min-width: 0; }
.trow2 { grid-template-columns: 150px minmax(0, 1fr); gap: 14px; }
@media (max-width: 1100px) { .wordmark { height: 52px; } .tiles { gap: 0 8px; } .big { font-size: 22px; } }
/* the 5-column card must never spill into the buttons: tighter labels (no percentages) below 1240px, clipped labels as a last resort */
@media (max-width: 1240px) { .tl .pc { display: none; } .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } .tl .tn { overflow: hidden; text-overflow: ellipsis; } }
@media (max-width: 1080px) { .wordmark { height: 44px; } .tl .pc { display: none; } .tl { font-size: 12px; } .trow2 { grid-template-columns: 124px minmax(0, 1fr); gap: 10px; } .tiles { gap: 0 6px; } .big { font-size: 19px; } .tile b { font-size: 15px; } }

.wm-dark { display: none; }
:root[data-theme="dark"] .wm-light { display: none; }
:root[data-theme="dark"] .wm-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wm-light { display: none; }
  :root:not([data-theme="light"]) .wm-dark { display: block; }
}



.help { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; margin-left: 4px; border: 1px solid var(--muted); border-radius: 5px; font-size: 10px; font-weight: 600; line-height: 1; cursor: help; vertical-align: 1px; }
.help:hover, .help:focus { color: var(--text); border-color: var(--text); }

/* Same look as the chart tooltip (.tip), shown on hover/focus; opens leftwards so it stays inside the popup */
.help::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); right: -8px; width: 270px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 4px 16px rgba(0,0,0,.18); color: var(--text); font-size: 13px; font-weight: 400; line-height: 1.4; text-align: left; white-space: normal; pointer-events: none; z-index: 100; opacity: 0; visibility: hidden; }
.help:hover::after, .help:focus::after { opacity: 1; visibility: visible; }

/* "x items" sits at the right of the amount, small; the amount gets all the room left of it */
/* the amount keeps its own line (never overlapped); the item count sits under it */
.stat:has(.cnt) { grid-template-columns: auto minmax(0, 1fr); }
.stat:has(.cnt) .l { grid-column: 2 / -1; }
.stat:has(.cnt) b { grid-row: 2; grid-column: 1 / -1; white-space: nowrap; overflow-wrap: normal; overflow: hidden; text-overflow: ellipsis; }
.stat .cnt { grid-row: 3; grid-column: 1 / -1; padding: 0; color: var(--muted); font-size: 11px; line-height: 14px; white-space: nowrap; }
.stat .xtra { font-size: 11px; margin-left: 2px; }
.stat .l { white-space: nowrap; }
.stat:has(.help) .l { font-size: 12px; }

/* Amazon report gap: last known values kept and marked in orange */
.banner.held { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-color: var(--s-pending); color: var(--text); background: color-mix(in srgb, var(--s-pending) 12%, var(--panel)); font-size: 13px; line-height: 1.4; }
.banner.held .htxt b { color: var(--s-pending); }
.banner.held .hbtns { display: flex; flex: none; gap: 8px; }
.heldband { fill: var(--s-pending); opacity: .22; stroke: var(--s-pending); stroke-width: 1; stroke-dasharray: 3 2; }
.tip .hnote { display: block; max-width: 240px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); white-space: normal; font-size: 12px; line-height: 1.4; color: var(--muted); }
.tip .hnote b { display: block; color: var(--s-pending); }
tr.held td { background: color-mix(in srgb, var(--s-pending) 12%, transparent); }
tr.held td:first-child { box-shadow: inset 3px 0 0 var(--s-pending); }
.hbadge { margin-left: 6px; padding: 1px 6px; border: 1px solid var(--s-pending); border-radius: 5px; color: var(--s-pending); font-size: 10px; font-weight: 600; cursor: help; }

/* Store filter under the logo, Tags filter after Countries */
.storefilter { position: relative; z-index: 6; }
.storefilter { width: 100%; contain: inline-size; }   /* the logo, not the filter, sets the column width: the filter ends exactly where the logo ends */
.storefilter .dd { display: block; }
/* same size, shape and bottom line as the Refresh button on the right */
.storebtn { width: 100%; height: 40px; padding: 0 12px; border-radius: 9px; justify-content: space-between; gap: 8px; align-items: center; font-weight: 600; }
.sline { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; white-space: nowrap; }
.sline b { overflow: hidden; text-overflow: ellipsis; }
.storebtn .more { font-size: 14px; font-weight: 600; }
.brand { align-self: stretch; justify-content: space-between; padding-bottom: 23px; }
.storebtn .sl { font-size: 10px; letter-spacing: .12em; color: var(--muted); }
.storebtn b { font-weight: 600; font-size: 15px; }
.storebtn .more { color: var(--muted); font-size: 12px; }
.storemenu { min-width: 340px; max-height: 70vh; overflow: auto; }
.tagmenu { min-width: 410px; max-height: 70vh; overflow: auto; }
.scrow { display: flex; flex-direction: column; flex: 1; min-width: 0; text-align: left; }
.scrow b { font-weight: 600; }
.scrow small { color: var(--muted); font-size: 12px; }
.ddsum.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
/* "?" next to the Tags filter: fades between its normal and the accent colour while a tag filter is on */
.taghelp { margin-left: 4px; width: 24px; height: 24px; font-size: 15px; border-radius: 7px; }
.taghelp.pulse { animation: helpfade 1.8s ease-in-out infinite; }
@keyframes helpfade {
  0%, 100% { color: var(--muted); border-color: var(--muted); background: transparent; }
  50% { color: #14244a; border-color: var(--accent); background: var(--accent); }
}
@media (prefers-reduced-motion: reduce) { .taghelp.pulse { animation: none; color: var(--accent); border-color: var(--accent); } }

/* menus of the filters on the right open towards the left */
.menuright { left: auto; right: 0; }
/* Desktop alerts checkbox in the notifications popup */
.nhead .deskchk { margin-left: auto; margin-right: 12px; font-size: 13px; color: var(--muted); }
.nhead .deskchk input { accent-color: var(--accent); }
/* Settings: country cards with switches */
.cquick { display: flex; gap: 14px; margin-bottom: 6px; }
.cgroup { margin: 14px 0 8px; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.ccard { position: relative; display: grid; grid-template-columns: 34px 1fr auto 40px; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; }
.ccard input { position: absolute; opacity: 0; pointer-events: none; }
.ccard:hover { border-color: var(--accent); }
.ccard.on { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.ccard:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.cflag svg { width: 30px; height: 20px; border-radius: 3px; }
.cbody { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.cbody b { font-weight: 600; font-size: 15px; }
.cbody small, .cstat small { color: var(--muted); font-size: 12px; }
.cstat { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; text-align: right; }
.cstat b { font-weight: 600; font-size: 14px; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--line); transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--panel); box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .15s; }
.ccard.on .switch { background: var(--accent); }
.ccard.on .switch::after { transform: translateX(16px); }
/* Settings: store cards */
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.scard { position: relative; display: grid; grid-template-columns: 22px 1fr; align-items: start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; }
.scard input { margin-top: 4px; accent-color: var(--accent); }
.scard:hover { border-color: var(--accent); }
.scard.off { opacity: .55; }
.sbody { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.srow1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.srow1 b { font-weight: 600; font-size: 16px; }
.sflags { display: flex; flex-wrap: wrap; gap: 6px; }
.sflags .cchip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; background: var(--hover); }
.sflags svg { width: 16px; height: 11px; border-radius: 2px; }
.sstats { font-size: 14px; } .sstats b { font-weight: 600; } .sstats em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 4px; }

.menu .mi.scoff { opacity: .4; }
.menu .mi.scoff .lonly { cursor: not-allowed; }
.menu .mi.scoff .lonly:hover span { text-decoration: none; }

/* ---- plans: chip, locked controls, upgrade pop-up, Plan card ---- */
.statusrow { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.planchip { padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .06em; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.planchip.pro { color: var(--accent); border-color: var(--accent); }
.planchip.free:hover, .planchip.pro:hover { border-color: var(--accent); color: var(--accent); }
.propill { display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .08em; line-height: 16px; background: var(--accent); color: var(--navy-on, #14244a); vertical-align: 1px; }
.propill.big { margin: 0 0 8px; font-size: 12px; line-height: 20px; padding: 0 10px; }
.locked { cursor: pointer; }
.ddsum.locked, .rngbtn.locked, .subtabs button.locked { color: var(--muted); }
.mi.locked, .nt.locked, .ccard.locked { opacity: .6; }
.ccard.locked { grid-template-columns: 34px 1fr auto; }
.modalbg { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(2, 11, 30, .6); }
.modal { position: relative; width: min(440px, 100%); padding: 22px 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 16px 48px rgba(0, 0, 0, .4); }
.modal h2 { margin: 0 0 6px; font-size: 20px; }
.modal p { margin: 0 0 10px; }
.mclose { position: absolute; top: 8px; right: 8px; border: 0; background: none; font-size: 16px; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.planbtns { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.plancard { padding: 14px 16px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.plancard.pro { border-color: var(--accent); }
.planhead { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.planname { font-size: 18px; font-weight: 600; }
.planlist { margin: 10px 0 12px; padding-left: 18px; columns: 2; column-gap: 24px; font-size: 14px; }
.planlist li { break-inside: avoid; margin-bottom: 2px; }
.plancard input[type="email"], .plankey input { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; margin-bottom: 4px; }
.plankey { display: flex; gap: 8px; margin-top: 10px; }
.plankey input { flex: 1; margin: 0; }
.plantele { margin-top: 12px; align-items: flex-start; }
.banner.plan { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ---- first-run tour ---- */
.tcatch { position: fixed; inset: 0; z-index: 94; }   /* only blocks clicks: the dimming is the spotlight's shadow */
.tspot { position: fixed; z-index: 95; display: none; border-radius: 10px; pointer-events: none; box-shadow: 0 0 0 100vmax rgba(2, 11, 30, .62); outline: 2px solid var(--accent); transition: left .2s, top .2s, width .2s, height .2s; }
.tspot ~ .tcard { z-index: 96; }
.tcard { position: fixed; z-index: 96; width: 320px; max-width: calc(100vw - 24px); padding: 16px 18px; border: 1px solid var(--accent); border-radius: 10px; background: var(--panel); color: var(--text); box-shadow: 0 12px 40px rgba(0, 0, 0, .45); }
.tcard h3 { margin: 2px 0 6px; font-size: 17px; }
.tcard p { margin: 0 0 12px; font-size: 14px; line-height: 1.45; }
.tstep { font-size: 11px; letter-spacing: .08em; color: var(--accent); font-weight: 600; }
.tbtns { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tbtns span { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---- sign-in gate + account row ---- */
.gate { max-width: 560px; margin: 40px auto; padding: 24px 26px; }
.gate .row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.gcode { font-size: 20px; letter-spacing: .12em; color: var(--accent); }
.acctrow { margin: 6px 0 2px; font-size: 14px; color: var(--muted); }
.acctrow .linkbtn { margin-left: 6px; }

/* ---- sign-in screen: only the logo (centered) and a footer ---- */
body.gate-mode { display: flex; flex-direction: column; min-height: 100vh; max-height: none; }
body.gate-mode .top { display: flex; justify-content: center; padding: 18px 16px 14px; }
body.gate-mode .top > :not(.brand) { display: none; }
body.gate-mode .brand { align-items: center; padding-right: 0; }
body.gate-mode #main { flex: 1; }
.pagefooter { margin-top: auto; padding: 22px 16px 26px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
.pagefooter[hidden] { display: none; }
.fwrap { max-width: 760px; margin: 0 auto; }
.flinks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin-bottom: 12px; font-size: 14px; }
.flinks a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.flinks a:hover { border-bottom-color: var(--accent); color: var(--accent); }
.fsmall { margin: 0 0 6px; font-size: 12px; line-height: 1.5; }

/* ---- sign-in forms inside the popup ---- */
.gate .gbtn { width: 100%; display: flex; gap: 10px; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: #1f1f1f; font: 600 15px var(--font); cursor: pointer; margin: 14px 0 0; }
.gate .gbtn:hover:not(:disabled) { border-color: var(--accent); }
.gate .or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 13px; }
.gate .or::before, .gate .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gtabs { display: flex; gap: 6px; margin-bottom: 12px; }
.gtabs button { flex: 1; padding: 7px; }
.gtabs button.on { background: var(--accent); border-color: var(--accent); color: var(--navy-on, #14244a); font-weight: 600; }
.gform { display: grid; gap: 10px; text-align: left; }
.gform label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.gform input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; width: 100%; }
.gform .linkbtn { justify-self: start; }
.gate button:disabled, .gate input:disabled { opacity: .55; cursor: not-allowed; }

/* "Pro is now active" banner: green, closable */
.banner.plan.rate { border-color: var(--line, #8892a6); color: var(--text); }
.banner.plan.rate .hbtns { display: flex; flex: none; gap: 8px; }
.banner.plan.good { border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, var(--panel)); color: var(--text); }
.banner .bclose { flex: none; border: 0; background: none; color: inherit; font-size: 16px; line-height: 1; padding: 2px 8px; cursor: pointer; opacity: .75; }
.banner .bclose:hover { opacity: 1; }

/* stores found in the account but not part of the Free plan: listed, grayed, with a PRO pill */
.storemenu .mi.locked { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; opacity: .55; cursor: pointer; }
.storemenu .mi.locked:hover { opacity: .85; }

.menu .mi.locked { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; opacity: .55; cursor: pointer; }
.menu .mi.locked:hover { opacity: .85; }
.lockrow { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }

/* trial: Pro features stay usable and carry a pill that counts the days */
.propill.trial { background: var(--accent); color: var(--navy-on, #14244a); border: 0; white-space: nowrap; margin-left: 6px; letter-spacing: .03em; }
/* Upgrade button (Free plan) next to the close X; the Refresh button is green */
.brow.r1 { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.upgradebtn { box-sizing: border-box; height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 6px; background: var(--accent); border-color: var(--accent); color: var(--navy-on, #14244a); font-weight: 700; letter-spacing: .03em; cursor: pointer; }
.upgradebtn:hover { filter: brightness(.95); border-color: var(--accent); }
.upgradebtn[hidden] { display: none; }
.refreshbtn { background: #16a34a; border-color: #16a34a; color: #fff; }
.refreshbtn:hover { filter: none; background: #15803d; border-color: #15803d; }

/* pills inside menu rows: a full, un-stretched pill at the end of the row (the generic ".mi span" would stretch it) */
.mi .propill, .mi .propill.trial { flex: none; margin-left: 4px; }

/* header button tooltip: same look as the chart tooltips */
.upwrap { position: relative; display: inline-flex; }
.upwrap[hidden] { display: none; }
.utip { position: absolute; top: calc(100% + 8px); right: 0; width: 300px; z-index: 100; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 4px 16px rgba(0,0,0,.28); font-size: 13px; line-height: 1.4; text-align: left; color: var(--text); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s; pointer-events: none; }
.upwrap:hover .utip, .upwrap:focus-within .utip { opacity: 1; visibility: visible; transform: none; }
.utip .d { font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.utip > div { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0; }
.utip .ubig { align-items: baseline; justify-content: space-between; margin: 0 0 8px; }
.utip .ubig b { font-size: 20px; color: var(--accent); }
.utip .uk { flex: none; color: var(--good); font-weight: 700; }
.utip .hnote { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.utip .ucta { display: block; margin-top: 6px; color: var(--accent); font-size: 13px; }

/* currency menu (same look as the countries menu) and the per-currency lines of the chart tooltip */
.cursym { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px; padding: 0 5px; margin-right: 6px; border-radius: 5px; background: color-mix(in srgb, var(--accent) 22%, transparent); font-size: 12px; font-weight: 700; }
.curdots { display: inline-flex; gap: 3px; margin-right: 8px; }
.curdots .cursym { margin: 0; min-width: 20px; }
.lonly .cursym { flex: 0 0 auto; min-width: 36px; }
.cxnote { margin: 6px 12px 8px; max-width: 250px; }
.tip .cxh { justify-content: flex-start; }
.tip .cxsub { padding-left: 16px; font-size: 12.5px; color: var(--muted); gap: 18px; }
.tip .cxsub b { color: var(--text); }

/* tour step: "tick Desktop alerts" with an animation */
@keyframes tpulse { 0% { box-shadow: 0 0 0 100vmax rgba(2, 11, 30, .62), 0 0 0 0 rgba(255, 153, 0, .75); } 70% { box-shadow: 0 0 0 100vmax rgba(2, 11, 30, .62), 0 0 0 14px rgba(255, 153, 0, 0); } 100% { box-shadow: 0 0 0 100vmax rgba(2, 11, 30, .62), 0 0 0 0 rgba(255, 153, 0, 0); } }
.tspot.pulse { animation: tpulse 1.4s ease-out infinite; }
@keyframes thand { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.thand { position: fixed; z-index: 97; font-size: 26px; line-height: 1; pointer-events: none; animation: thand .9s ease-in-out infinite; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.tdemo { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 8px 10px; border: 1px dashed var(--accent); border-radius: 8px; font-size: 14px; }
.fakebox { width: 20px; height: 20px; border: 2px solid var(--accent); border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; color: #14244a; background: transparent; }
.fakebox svg { width: 14px; height: 14px; stroke-dasharray: 24; stroke-dashoffset: 24; }
.fakebox.on { background: var(--accent); } .fakebox.on svg { stroke-dashoffset: 0; }
@keyframes tick { 0%, 20% { stroke-dashoffset: 24; } 55%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 24; } }
@keyframes tickbg { 0%, 20% { background: transparent; } 55%, 85% { background: var(--accent); } 100% { background: transparent; } }
.fakebox.loop { animation: tickbg 2.4s ease-in-out infinite; } .fakebox.loop svg { animation: tick 2.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .tspot.pulse, .thand, .fakebox.loop, .fakebox.loop svg { animation: none; } .fakebox.loop svg { stroke-dashoffset: 0; } }

/* Settings: the whole plan card sits in the header (same look as the total-income card); the connected account (with its avatar) is always under the logo */
.phcard { display: grid; grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1.1fr); gap: 8px 20px; align-items: start; justify-content: stretch; }
.phcard.pro { grid-template-columns: 170px minmax(0, 1fr); }
.phcard .thead { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); align-self: start; }
.phcard .thead .l { color: var(--accent); }
.phcard .thead .big { color: var(--accent); font-size: 22px; }
.phcard.pro .thead { border-color: var(--s-earnings); background: color-mix(in srgb, var(--s-earnings) 16%, transparent); }
.phcard.pro .thead .l, .phcard.pro .thead .big { color: var(--s-earnings); }
.phcard .psub { font-size: 12px; color: var(--muted); line-height: 1.3; }
.phbody { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.phline { margin: 0; font-size: 14px; line-height: 1.35; }
.phrow { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.phacct { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; color: var(--muted); min-width: 0; }
.phwho { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.phname { color: var(--text); font-weight: 600; font-size: 14px; }
.phacct .linkbtn { margin-left: 6px; }
.phcard .planbtns { margin: 0; flex-wrap: nowrap; }
.phcard .planbtns button { padding: 6px 12px; white-space: nowrap; }
.phmsg { margin: 2px 0 0; }
.phadds { min-width: 0; }
.phadds .planlist { margin: 4px 0 0; padding-left: 16px; columns: 2; column-gap: 16px; font-size: 12.5px; line-height: 1.35; }
.phfoot { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
.phfoot .plankey { margin: 0; }
.phfoot .plankey input { padding: 6px 10px; }
.phline2 { display: flex; align-items: center; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap; }
.phfoot .plantele { margin: 0; font-size: 13px; align-items: center; }
.phchk { white-space: nowrap; }
.phcard { padding-top: 8px; padding-bottom: 8px; }
.avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: hsl(var(--avh, 30) 55% 38%); color: #fff; font-weight: 700; user-select: none; }
.avatar.md { width: 40px; height: 40px; font-size: 18px; } .avatar.sm { width: 20px; height: 20px; font-size: 11px; }
.avatar .ini { line-height: 1; } .avatar .avimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.acctchip { display: flex; align-items: center; gap: 7px; margin-top: 6px; padding: 0 2px; font-size: 12px; color: var(--muted); min-width: 0; }
.acctchip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.flagmore { display: inline-flex; align-items: center; margin-left: 2px; padding: 0 5px; height: 16px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 22%, transparent); font-size: 11px; font-weight: 700; }
/* the chart caption sits at the bottom: its explanation opens upwards */
.help.up::after { top: auto; bottom: calc(100% + 8px); }
/* a store row in the store menu: the flag of the account's country before the store id */
.withflag { display: inline-flex; align-items: center; gap: 7px; }
.withflag .flag { flex: 0 0 auto; }
/* account menu (avatar button in the header + its panel) */
.acctbtn { padding: 0; }
.acctbtn[hidden] { display: none; }
.acctbtn .avatar.sm { width: 26px; height: 26px; font-size: 13px; }
.apanel { width: 280px; max-width: calc(100vw - 32px); margin-left: auto; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.28); }
.apanel .ahead { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; min-width: 0; }
.apanel .awho { display: flex; flex-direction: column; min-width: 0; }
.apanel .awho b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apanel .awho span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--muted); }
.apanel .aplan { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 4px 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.apanel .aplan.pro b { color: var(--good, #1a7f4b); }
.apanel .aplan span { color: var(--muted); }
.apanel .aitem { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.apanel .aitem:hover, .apanel .aitem:focus-visible { background: var(--soft, rgba(127,127,127,.14)); }
a.aitem { text-decoration: none; box-sizing: border-box; }
.apanel .aitem.danger { color: var(--bad, #d64545); }
.apanel .asep { height: 1px; margin: 6px 4px; background: var(--line); }
/* Upgrade / "N days left in Pro" spans the same width as Refresh (Close moved to the icon row) */
.brow.r1 { justify-content: stretch; }
.brow.r1 .upwrap { flex: 1 1 auto; }
.brow.r1 .upwrap .upgradebtn { width: 100%; justify-content: center; }
.brow.r1:has(.upwrap[hidden]) { display: none; }
/* compact Settings: chips for countries, one line per store, two blocks side by side when there is room */
.setgrid { display: grid; grid-template-columns: 1fr; gap: 0 28px; }
@media (min-width: 900px) { .setgrid { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.cquick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 8px; }
.cquick .muted { margin-right: auto; }
.cbxs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.cbx { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; cursor: pointer; user-select: none; }
.cbx input { margin: 0; accent-color: var(--accent); }
.cbx.on { border-color: var(--accent); background: var(--soft, rgba(248,153,29,.1)); }
.cbx.locked { opacity: .65; }
.cbx b { font-weight: 600; letter-spacing: .03em; }
.cmore summary { cursor: pointer; margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
.srows { display: flex; flex-direction: column; gap: 6px; }
.srow { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; cursor: pointer; min-width: 0; }
.srow input { margin: 0; accent-color: var(--accent); }
.srow.off { opacity: .6; }
.srow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow .muted { margin-right: auto; white-space: nowrap; }
.setgrid + h2 { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.setgrid h2 { font-size: 17px; margin-bottom: 8px; }

/* first load: one calm screen until everything is in */
body.booting header.top > :not(.tools), body.booting .tools .btns > .brow.r1, body.booting .tools .brow.r3, body.booting .tools .statusrow,
body.booting #gear, body.booting #bell, body.booting #amazon, body.booting #acct { display: none !important; }
body.booting header.top { display: flex; justify-content: flex-end; border-bottom: 0; background: transparent; }
.boot { max-width: 560px; margin: 0 auto; padding: 8px 16px 28px; text-align: center; animation: bootin .35s ease both; }
@keyframes bootin { from { opacity: 0; transform: translateY(8px); } }
.boot h1 { margin: 14px 0 6px; font-size: 30px; line-height: 1.15; }
.bootsub { margin: 0 0 20px; color: var(--muted); font-size: 15px; }
.bootbars { display: flex; align-items: flex-end; justify-content: center; gap: 7px; height: 54px; }
.bootbars i { width: 12px; border-radius: 4px 4px 0 0; background: var(--s-earnings); animation: bootbar 1.3s ease-in-out infinite; }
.bootbars i:nth-child(1) { animation-delay: 0s; } .bootbars i:nth-child(2) { animation-delay: .12s; } .bootbars i:nth-child(3) { animation-delay: .24s; }
.bootbars i:nth-child(4) { animation-delay: .36s; } .bootbars i:nth-child(5) { animation-delay: .48s; background: #f8991d; }
@keyframes bootbar { 0%, 100% { height: 14px; opacity: .55; } 50% { height: 52px; opacity: 1; } }
.bootbar { height: 10px; border-radius: 10px; overflow: hidden; background: var(--soft, rgba(127,127,127,.18)); }
.bootbar i { display: block; width: 0; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--s-earnings), #f8991d); transition: width .6s ease; }
.bootpct { margin: 6px 0 14px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bootsteps { list-style: none; margin: 0; padding: 0; text-align: left; }
.bootsteps li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 12px; border-radius: 10px; transition: background .3s, opacity .3s; }
.bootsteps li.wait { opacity: .45; }
.bootsteps li.active { background: var(--panel); box-shadow: 0 0 0 1px var(--line, rgba(127,127,127,.25)) inset; }
.bootsteps li > i { flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--line, #8892a6); position: relative; }
.bootsteps li.active > i { border-color: #f8991d; border-right-color: transparent; animation: bootspin .8s linear infinite; }
.bootsteps li.done > i { border-color: var(--good, #1a7f4b); background: var(--good, #1a7f4b); }
.bootsteps li.done > i::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
@keyframes bootspin { to { transform: rotate(360deg); } }
.bootsteps b { display: block; font-size: 15.5px; line-height: 1.3; } .bootsteps span { display: block; font-size: 13px; color: var(--muted); }
.boottip { min-height: 2.6em; margin: 16px 0 0; font-size: 13.5px; color: var(--muted); }
.bootalert { margin-top: 14px; padding: 12px 16px; border: 1px solid var(--s-pending, #f08a4b); border-radius: 10px; font-size: 14px; }
.bootalert p { margin: 0 0 10px; } .bootalert .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .bootbars i, .bootsteps li.active > i, .boot { animation: none; } .bootbars i { height: 34px; } }

/* language chips (Settings and sign-in screen) */
.langpick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.langchip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--line, rgba(127,127,127,.3)); border-radius: 999px; background: var(--panel); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.langchip:hover { border-color: #f8991d; }
.langchip.on { border-color: #f8991d; box-shadow: 0 0 0 1px #f8991d inset; font-weight: 600; }
.langchip .flag { border-radius: 2px; }
.langpick.compact { justify-content: center; gap: 6px; margin: 14px 0 0; }
.langpick.compact .langchip { padding: 4px 10px; font-size: 12.5px; }
