/* Bully Max Rewards — shared styles (claim page + admin). Black #000, white text, one orange accent #F05A12.
   Anton headings / Oswald labels+buttons / Fira Sans body (same system as the time clock app). */
:root {
  --bg: #000000; --fg: #ffffff; --muted: #9a9a9a; --line: #262626; --panel: #0d0d0d; --panel-2: #161616;
  --orange: #F05A12; --orange-dark: #C4450A; --danger: #ff4d4d; --ok: #4cd964; --radius: 4px;
  --head: 'Anton', 'Oswald', Impact, sans-serif; --label: 'Oswald', 'Fira Sans', sans-serif; --body: 'Fira Sans', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font-family: var(--body); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
a { color: var(--orange); }
button { font-family: var(--label); cursor: pointer; border: 0; border-radius: var(--radius); color: var(--fg); background: var(--panel-2); text-transform: uppercase; letter-spacing: .08em; -webkit-tap-highlight-color: transparent; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .35; cursor: default; }
input, select, textarea { font-family: var(--body); color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; font-size: 16px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: 0; border-color: var(--orange); }
input[type=checkbox] { width: auto; }
h1, h2, h3 { font-family: var(--head); font-weight: 400; letter-spacing: .02em; text-transform: uppercase; margin: 0; }
h1 { font-size: clamp(30px, 6vw, 48px); line-height: 1; }
h2 { font-size: clamp(22px, 4vw, 30px); }
h3 { font-size: 18px; letter-spacing: .04em; }
.label, label { font-family: var(--label); text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; }
.orange { color: var(--orange); } .muted { color: var(--muted); } .danger { color: var(--danger); } .ok { color: var(--ok); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
img.wordmark { display: block; height: auto; width: 100%; max-width: 260px; }
.btn { height: 48px; padding: 0 18px; font-size: 15px; font-weight: 500; border: 1px solid var(--line); background: var(--panel-2); display: inline-grid; place-items: center; text-decoration: none; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #000; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; }
.btn.xs { height: 28px; padding: 0 8px; font-size: 11px; }
.field { margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .row2, .row3 { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.fine { font-size: 13px; color: var(--muted); line-height: 1.45; }
.err { color: var(--danger); font-size: 14px; min-height: 18px; margin-top: 8px; }
.tag { display: inline-block; font-family: var(--label); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; line-height: 1; padding: 4px 6px; border-radius: 3px; border: 1.5px solid var(--orange); color: var(--orange); white-space: nowrap; }
.tag.solid { background: var(--orange); color: #000; }
.tag.grey { border-color: var(--muted); color: var(--muted); }
.tag.red { border-color: var(--danger); color: var(--danger); }
.tag.green { border-color: var(--ok); color: var(--ok); }

/* ---------- CLAIM PAGE ---------- */
.claim { max-width: 640px; margin: 0 auto; padding: 28px 16px 60px; }
.claim-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.claim-head p { margin: 0; color: #ddd; font-size: 17px; line-height: 1.45; }
.channels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 480px) { .channels { grid-template-columns: repeat(2, 1fr); } }
.channels button { height: 54px; font-size: 14px; border: 1px solid var(--line); background: var(--panel); text-transform: none; letter-spacing: .02em; }
.channels button.on { border-color: var(--orange); color: var(--orange); }
.success { text-align: center; padding: 30px 10px; }
.success .check { width: 84px; height: 84px; margin: 0 auto 14px; border: 3px solid var(--orange); border-radius: 50%; display: grid; place-items: center; font-size: 44px; color: var(--orange); }
.banner { border: 1px solid var(--orange); color: var(--orange); padding: 10px 12px; border-radius: var(--radius); font-family: var(--label); letter-spacing: .06em; text-transform: uppercase; font-size: 13px; }
.drop { border: 1px dashed var(--line); padding: 14px; border-radius: var(--radius); text-align: center; color: var(--muted); font-size: 14px; }
.drop input { display: none; }
.drop.has { border-color: var(--orange); color: var(--fg); }

/* ---------- ADMIN ---------- */
.login { max-width: 420px; margin: 10vh auto; padding: 24px; display: grid; gap: 14px; }
.admin { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.topbar .wordmark { max-width: 160px; }
.topbar h1 { font-size: 22px; }
.topbar .spacer { flex: 1; }
.topbar .me { font-size: 13px; color: var(--muted); }
.tabs { display: flex; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: transparent; color: var(--muted); padding: 10px 14px; border-radius: 0; border-bottom: 2px solid transparent; font-size: 14px; white-space: nowrap; }
.tabs button.on { color: var(--fg); border-bottom-color: var(--orange); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--orange); color: #000; font-size: 12px; margin-left: 6px; }
.content { padding: 18px; max-width: 1400px; width: 100%; margin: 0 auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tile .v { font-family: var(--head); font-size: 34px; line-height: 1; }
.tile .k { font-family: var(--label); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--muted); margin-top: 6px; }
.tile .s { font-size: 12px; color: var(--muted); margin-top: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { font-family: var(--label); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:hover td { background: var(--panel); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 200px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 6px 12px; font-size: 14px; }
.kv b { color: var(--muted); font-weight: 400; font-family: var(--label); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
dialog { background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; max-width: 720px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0,0,0,.7); }
.receipt { max-width: 100%; max-height: 60vh; border: 1px solid var(--line); border-radius: var(--radius); background: #111; }
.flag { display: inline-block; background: #2a1208; border: 1px solid var(--orange); color: var(--orange); border-radius: 3px; padding: 2px 6px; font-size: 11px; margin: 1px 2px 1px 0; font-family: var(--label); letter-spacing: .04em; }
.flag.red { background: #2a0808; border-color: var(--danger); color: var(--danger); }
pre { background: var(--panel-2); padding: 10px; border-radius: var(--radius); overflow: auto; font-size: 12px; }
.drag { cursor: grab; color: var(--muted); }
.sortable tr.dragging td { opacity: .4; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--orange); color: #000; padding: 10px 16px; border-radius: var(--radius); font-family: var(--label); letter-spacing: .06em; z-index: 50; }
.toast.err { background: var(--danger); color: #fff; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.inline { display: inline-flex; gap: 8px; align-items: center; }

/* ---------- ADMIN: mobile / no horizontal page scroll (Matt, iPhone, Oct 18 2026) ----------
   Root cause: the .admin grid track sized to its content (min-width:auto), so wide tables pushed the whole page to ~980 px
   and the topbar never wrapped. Rule: the page never scrolls sideways; only tables (inside .tbl-wrap) and the tab row do. */
html, body { overflow-x: clip; max-width: 100%; }
.admin { grid-template-columns: minmax(0, 1fr); }
.admin > *, .content, .content *, .grid2 > *, .tiles > *, .kv > *, .panel, .toolbar > * { min-width: 0; }
.content { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); overflow-wrap: anywhere; }
.content img, .content video, dialog img { max-width: 100%; height: auto; }
.content pre, dialog pre { max-width: 100%; white-space: pre-wrap; word-break: break-word; }
.tbl-wrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; margin: 0 0 4px; }
.tbl-wrap > table { min-width: 100%; }
.tbl-wrap td { overflow-wrap: normal; }
.topbar { flex-wrap: wrap; row-gap: 6px; padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
.topbar .me { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain; scroll-padding: 0 12px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 0 0 auto; min-height: 44px; }
.toolbar input, .toolbar select { min-width: min(200px, 100%); max-width: 100%; }
dialog { max-width: min(720px, calc(100vw - 24px)); width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow: auto; }
@media (max-width: 640px) {
  .content { padding: 14px 12px calc(88px + env(safe-area-inset-bottom, 0px)); } /* clear the Shopify mobile bottom bar */
  .topbar { padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .topbar .wordmark { max-width: 120px; }
  .topbar h1 { font-size: 20px; }
  .topbar .spacer { display: none; }
  .topbar .me { flex-basis: 100%; font-size: 12px; }
  .tabs { padding: 4px 4px 0; }
  .tabs button { padding: 10px 12px; font-size: 13px; }
  .toolbar { gap: 8px; }
  .toolbar input, .toolbar select { flex: 1 1 100%; width: 100%; }
  .btn { max-width: 100%; }
  .inline { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 12px 10px; }
  .tile .v { font-size: clamp(20px, 6.6vw, 30px); overflow-wrap: anywhere; }
  .tile .k { font-size: 11px; letter-spacing: .06em; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }   /* label above value */
  .kv > b { margin-top: 10px; }
  .kv > b:first-child { margin-top: 0; }
  table { font-size: 13px; }
  th, td { padding: 8px 8px; }
}

/* Pass 48 (Oct 20 2026): design-system hover/pressed = dark orange #C4450A (no pure black or grey hover on the primary), surface panel on ghost hover, orange focus ring. */
.btn.primary:hover, .btn.primary:focus-visible { background: var(--orange-dark); border-color: var(--orange-dark); color: #fff; }
.btn.ghost:hover, .btn.ghost:focus-visible { background: var(--panel-2); color: var(--fg); }
a:hover { color: var(--orange-dark); }
.btn:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* NAV-4: "Back to My Account" bar on /claim when opened from the shop's account hub (hub referrer or ?from=hub). Sticky, full width, one tap target. */
.hubbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); color: var(--fg); text-decoration: none; font-family: var(--label); font-size: 15px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.hubbar:hover, .hubbar:focus-visible { color: var(--orange); outline-offset: -2px; }
.hubbar-chev { color: var(--orange); font-size: 26px; line-height: 1; margin-top: -3px; }
.hubbar.hidden { display: none; }
body.has-hubbar .claim { padding-top: 16px; }
