/* ConsistentBrother look – loaded after style.css, so everything here wins.
   The brand is the sticker: white Bungee lettering, thick black outline, hard offset shadow, on brand yellow.
   So: thick outlines and hard shadows instead of hairlines and blur, yellow for everything you can press,
   Bungee for titles and big numbers, warm cream (light) / near-black (dark) instead of iOS greys. */

:root, :root[data-theme=light] {
  --bg: #fbf3df; --panel: #ffffff; --panel2: #f3e9cf; --ink: #111111; --muted: #6b6150; --line: #e6dcc0;
  --sep: rgba(17, 17, 17, .14); --seg: #f3e9cf; --seg-on: var(--brand);
  --edge: #111111; --shade: #111111; --good: #0e8a43; --bad: #d1271b; --accent: #9a5b00;
  --card-shade: var(--shade);
  --cb-border: 2.5px solid var(--edge); --cb-shadow: 4px 4px 0 var(--card-shade); --cb-shadow-s: 3px 3px 0 var(--shade);
}
:root[data-theme=dark] {
  --bg: #151515; --panel: #222222; --panel2: #2c2c2c; --ink: #ffffff; --muted: #a8a29a; --line: #343434;
  --sep: rgba(255, 255, 255, .10); --seg: #2c2c2c; --seg-on: var(--brand);
  --edge: #000000; --shade: #000000; --card-shade: #f9af17; --good: #3ddc84; --bad: #ff5a4e; --accent: #f9af17;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #151515; --panel: #222222; --panel2: #2c2c2c; --ink: #ffffff; --muted: #a8a29a; --line: #343434;
    --sep: rgba(255, 255, 255, .10); --seg: #2c2c2c; --seg-on: var(--brand);
    --edge: #000000; --shade: #000000; --card-shade: #f9af17; --good: #3ddc84; --bad: #ff5a4e; --accent: #f9af17;
  }
}
html { background: var(--bg); }
html, body { font-family: "Inter", system-ui, "Segoe UI", Roboto, sans-serif; }
body { background: var(--bg); }

/* ---------- type: Bungee for titles, section labels, big numbers ---------- */
.ptitle, .sheet h2, .rc-top b, .welcome h3, .goals h3, .cd-h, #pfV, .hit .pr, .price-big, .pf-v, .ss-total b, .cd-price b {
  font-family: var(--display); font-weight: 400; letter-spacing: .01em;
}
.ptitle { text-transform: uppercase; }
#pfV { font-size: clamp(28px, 10.5vw, 46px); line-height: 1.05; min-width: 0; overflow-wrap: anywhere; }
.hit .pr { font-size: 26px; }
.sec-h { font-family: var(--display); font-weight: 400; font-size: 14px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink); margin: 26px 4px 10px; display: flex; align-items: center; gap: 8px; }
.sec-h::before { content: ""; flex: none; width: 10px; height: 10px; background: var(--brand); border: 2px solid var(--edge); transform: rotate(45deg); }
.sec-h > button, .sec-h > .sec-link, .sec-h > a { margin-left: auto; font-family: "Inter", system-ui, sans-serif; font-size: 14px;
  font-weight: 800; text-transform: none; letter-spacing: 0; }

/* ---------- surfaces: outlined, hard shadow ---------- */
.list:not(.pick):not(:empty), .glist, .setlist > .goals, .welcome, .howto .glist, .card-box, .kpi, .scanbtns > *, .ss-total > div,
.sell-sheet .card-blk, .sell-tiles > *, #sellSum > div, .mk .list, .ss-opts, .cd-tiles > *, .item.cd-row.on {
  border: var(--cb-border) !important; box-shadow: var(--cb-shadow); border-radius: 16px !important;
}
.list:not(.pick):not(:empty), .glist { overflow: hidden; }
.card-box .list:not(.pick), .card-box .glist, .glist .glist, .list .list { border: 0 !important; box-shadow: none; }
/* separators inside a card: a clear line, not a hairline */
.list:not(.pick) > .item + .item::before, .glist .gr + .gr::before, .setlist .setrow + .setrow::before, .setlist .goalrow + .goalrow::before {
  height: 1.5px !important; background: var(--sep) !important; transform: none !important;
}
.hint { color: var(--muted); }

/* ---------- buttons: chunky, press in ---------- */
.btn, .linkbtn.solid, .pf-more, .chip.ichip, .coll-bar > .ichip, #filtBtn, .hdr-gear, .sec-link.btn {
  border: var(--cb-border) !important; box-shadow: var(--cb-shadow-s); font-weight: 800; border-radius: 12px;
  transition: transform .06s, box-shadow .06s;
}
.btn:active, .pf-more:active, .chip.ichip:active, .coll-bar > .ichip:active, #filtBtn:active, .hdr-gear:active, .addbtn:active, .tile .plus:active {
  transform: translate(3px, 3px) !important; box-shadow: 0 0 0 var(--shade) !important;
}
.btn { background: var(--panel); color: var(--ink); }
.btn.primary, .addbtn, .tile .plus, .pk .plus, .sell-main, #sellSum #sellMany {
  border: var(--cb-border) !important; box-shadow: var(--cb-shadow-s) !important; color: #111 !important;
}
.btn.ghost { background: var(--panel); }
.btn.danger, .btn.ghost.danger { color: var(--bad); }
.pf-more { background: var(--brand) !important; color: #111 !important; border-radius: 999px; padding: 8px 16px; }
.hdr-gear { background: var(--brand) !important; color: #111 !important; border-radius: 50% !important; }
.hdr-gear.on { background: #111 !important; color: var(--brand) !important; }
.coll-bar > .ichip, #filtBtn { background: var(--panel); border-radius: 12px !important; }
#filtBtn.on { background: var(--brand) !important; color: #111 !important; }
.addbtn { border-radius: 16px !important; }

/* ---------- segmented controls: outlined, yellow = chosen ---------- */
.seg { background: var(--panel) !important; border: var(--cb-border); border-radius: 14px !important; padding: 3px !important; box-shadow: var(--cb-shadow-s); }
.seg button { border-radius: 10px !important; font-weight: 800 !important; color: var(--muted); }
.seg button.on { background: var(--brand) !important; color: #111 !important; box-shadow: none !important; }
.ranges button.on { background: var(--brand) !important; color: #111 !important; border: 2px solid var(--edge); }
.ranges button { font-weight: 800; }

/* ---------- inputs ---------- */
main input:not([type=checkbox]):not([type=radio]):not([type=range]), main select, main textarea, .sheet input:not([type=checkbox]):not([type=radio]):not([type=range]),
.sheet select, .sheet textarea, #q, #filter, .auth-fields input, #toolView input:not([type=checkbox]), #toolView select {
  border: var(--cb-border) !important; background-color: var(--panel) !important;   /* color only: #q keeps its magnifier image */ color: var(--ink); border-radius: 12px !important; box-shadow: none;
}
#q, #filter { box-shadow: var(--cb-shadow-s) !important; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.auth-fields { border: var(--cb-border); border-radius: 16px; box-shadow: var(--cb-shadow); overflow: hidden; }
.auth-fields input { border: 0 !important; border-radius: 0 !important; }
.auth-fields input + input { border-top: 2px solid var(--sep) !important; }

/* switches: yellow when on, outlined */
input.gchk, .gsw { border: 2px solid var(--edge) !important; }
input.gchk:checked, .gsw.on { background: var(--brand) !important; }

/* ---------- game tags = little stickers ---------- */
.tag { border: 2px solid var(--edge); border-radius: 7px; transform: rotate(-4deg); font-family: var(--display); font-weight: 400;
  letter-spacing: .03em; box-shadow: 2px 2px 0 var(--shade); padding: 1px 6px; }

/* price change pills */
.pill { border: 2px solid var(--edge); box-shadow: 2px 2px 0 var(--shade); font-weight: 800; }
.pill.up { background: var(--good); color: #fff; }
.pill.down { background: var(--bad); color: #fff; }

/* ---------- card pictures: outlined like printed cards ---------- */
.item img, .ctile img, .cv img, .hit img, .carousel img, .pk img {
  border: 2px solid var(--edge); box-shadow: 2px 2px 0 var(--shade);
}
.ctile { border: var(--cb-border); box-shadow: var(--cb-shadow-s); border-radius: 14px; overflow: hidden; background: var(--panel); }
.ctile img { border: 0; box-shadow: none; }
.ctile .qty, .ctile .shiny, .ctile .grade { border: 2px solid var(--edge); font-weight: 800; }

/* the last-scanned card on the Scan screen */
.hit { border: var(--cb-border) !important; box-shadow: var(--cb-shadow) !important; border-radius: 18px !important; background: var(--panel) !important; }

/* ---------- header ---------- */
header.top { background: var(--bg) !important; }
body.scrolled header.top { box-shadow: 0 2.5px 0 var(--edge) !important; }

/* ---------- tab bar: black in both modes, yellow = here ---------- */
.tabs { background: #111111 !important; border-top: 2.5px solid #000 !important; box-shadow: 0 240px 0 0 #111111 !important; }
.tabs button { color: #9b9b9b !important; font-weight: 800 !important; }
.tabs button svg { stroke-width: 2.2 !important; }
.tabs button.on, .tabs .scan-fab.on span { color: var(--brand) !important; }
.tabs button.on:not(.scan-fab) svg { stroke: var(--brand) !important; }
.tabs button.on:not(.scan-fab)::before { background: var(--brand) !important; height: 3px !important; }
.tabs .scan-fab i { background: var(--brand) !important; color: #111 !important; border: 3px solid #000 !important; box-shadow: 3px 3px 0 #000 !important; }
.tabs .scan-fab:active i { transform: translate(3px, 3px) !important; box-shadow: 0 0 0 #000 !important; }

/* ---------- sheets (card page, sell) ---------- */
.sheet .sheet-body, #sheet { border-top: 3px solid var(--edge); }
.sheet h2 { text-transform: uppercase; }
.sheet-actions { border-top: 2.5px solid var(--edge) !important; }

/* ---------- toast: a black sticker with yellow text ---------- */
.toast { background: #111 !important; color: #fff !important; border: 2.5px solid var(--brand) !important; box-shadow: 4px 4px 0 #000 !important;
  border-radius: 14px !important; font-weight: 700; }
.toast button { color: var(--brand) !important; font-weight: 800; }

/* ---------- Settings icon squares: outlined stickers instead of iOS tiles ---------- */
.tico { border: 2px solid var(--edge); box-shadow: 2px 2px 0 var(--shade); border-radius: 9px !important; }

/* ---------- welcome / how it works ---------- */
.welcome .wl-ico { border: var(--cb-border); box-shadow: var(--cb-shadow-s); }
.howto .hw-n { border: 2px solid var(--edge); font-family: var(--display); font-weight: 400; }

/* progress bars */
.prog { background: var(--panel2) !important; border: 2px solid var(--edge); height: 10px !important; border-radius: 999px; }
.prog i { background: var(--brand) !important; border-right: 2px solid var(--edge); }
.prog.done i { background: var(--good) !important; }

@media (prefers-reduced-motion: reduce) { .btn, .pf-more { transition: none; } }

/* details found in the screenshots */
.cd-h span, .cd-h small, .sec-h small, .goals h3 small { font-family: "Inter", system-ui, sans-serif; font-weight: 700; letter-spacing: 0; text-transform: none;
  color: var(--muted); font-size: 13px; }
.pl-btn { border: var(--cb-border) !important; background: var(--panel) !important; }
.cd .pq, .pq { border: var(--cb-border); border-radius: 12px; }
.sec-h { justify-content: flex-start !important; }       /* the old rule spread the diamond and the title apart */

/* Portfolio breakdown: one outlined card with rows, not a stack of separate cards */
.kpis .kpi { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; background: none !important; }
.kpis .kpi + .kpi { border-top: 1.5px solid var(--sep) !important; }
.kpis:not(:empty) { border: var(--cb-border); box-shadow: var(--cb-shadow); border-radius: 16px; overflow: hidden; background: var(--panel); gap: 0 !important; }
/* long e-mail in Settings › Account: shortened with "…", never under the Sign out button */
.glist .gr > .gl { min-width: 0; }
#accountRows .gr > .gl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#accountRows .gr > .gl small { overflow: hidden; text-overflow: ellipsis; }
.glist .gr > .btn { flex: none; }
/* card page: "Show N more versions" row */
.cd-more { width: 100%; background: none; border: 0; font: inherit; font-weight: 800; color: var(--accent); text-align: left; cursor: pointer; }

/* Back buttons on sub-pages (Portfolio, Market prices, tools): same chunky button as the rest – outline, hard
   shadow, presses in – instead of a flat grey pill */
#statsBack, #mkBack, #toolBack { border: var(--cb-border) !important; box-shadow: var(--cb-shadow-s) !important;
  border-radius: 12px !important; background: var(--panel) !important; color: var(--accent) !important;
  font-weight: 800 !important; padding: 7px 14px 7px 10px !important; transition: transform .06s, box-shadow .06s; }
#statsBack:active, #mkBack:active, #toolBack:active { transform: translate(3px, 3px) !important; box-shadow: 0 0 0 var(--shade) !important; }
#tab-stats #statsBack { margin: 0 0 16px !important; }

/* Scan options: a panel that slides up over the lower screen while the camera stays in view (it used to open
   below the camera, so changing a switch meant scrolling the camera off the top) */
#shinePanel { position: fixed; left: 10px; right: 10px; bottom: calc(104px + env(safe-area-inset-bottom)); z-index: 25;
  max-width: 540px; margin: 0 auto; max-height: min(60vh, 560px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel); border: var(--cb-border); border-radius: 18px; box-shadow: var(--cb-shadow); padding: 4px 4px 8px;
  animation: optsUp .18s ease-out; }
#shinePanel .glist { border: 0 !important; box-shadow: none !important; background: none !important; }
.opts-head { position: sticky; top: -4px; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 8px; background: var(--panel); }
.opts-head b { font-family: Bungee, var(--font, sans-serif); font-weight: 400; font-size: 17px; }
.opts-head .btn { padding: 6px 16px; font-size: 15px; }
@keyframes optsUp { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #shinePanel { animation: none; } }

/* checkboxes outside the iOS switches (buy list, pickers) in brand colour instead of browser blue */
input[type=checkbox]:not(.gchk) { accent-color: var(--brand); }
.ptitle.long { font-size: 21px !important; line-height: 1.25; }
#ssFee { display: inline; width: auto; padding: 0; margin: 0; font: inherit; font-weight: 800; }   /* fee % sits inside the sentence */

/* Market: "More…" is a fourth segment button (not an outlined field inside the segment), with a small chevron */
#mkGame select { border: 0 !important; box-shadow: none !important; background-color: transparent !important; border-radius: 10px !important;
  font-weight: 800; font-size: 13px; color: var(--muted); padding: 6px 18px 6px 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 6px center !important; }
#mkGame select.on { background-color: var(--brand) !important; color: #111; }
/* Japanese on/off: an outlined sticker chip with a tick box, like the other controls on the page */
.mk-jp { display: inline-flex; align-items: center; gap: 7px; border: var(--cb-border) !important; box-shadow: var(--cb-shadow-s);
  background: var(--panel); color: var(--ink); font-weight: 800 !important; font-size: 13px !important; padding: 8px 12px; border-radius: 12px; transition: transform .06s, box-shadow .06s; }
.mk-jp::before { content: ""; width: 14px; height: 14px; border: 2px solid var(--edge); border-radius: 4px; box-sizing: border-box; background: var(--panel); }
.mk-jp.on { background: var(--brand); color: #111; }
.mk-jp.on::before { background: #111 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 5.2l2 2 4-4.4' fill='none' stroke='%23f9af17' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/10px no-repeat; border-color: #111; }
.mk-jp:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--shade); }

/* eBay setup: values to paste into the eBay developer portal, each with a Copy button */
.eb-copy { display: flex; align-items: center; gap: 10px; margin: 6px 0; padding: 8px 10px; border: 2px solid var(--sep); border-radius: 10px; background: var(--panel); }
.eb-copy span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.eb-copy code { color: var(--ink); font-size: 12.5px; word-break: break-all; }
.eb-copy .btn { flex: none; padding: 6px 12px; font-size: 13px; }
