/* TableTopRelay web shop. Colors come from the TableTopRelay logo: forged-iron black,
   lime "power" green and arcane violet. Dark-first ("game night"), with a light mode. */
:root {
  --bg: #0B0A10; --bg-2: #121019; --surface: #17141F; --surface-2: #201C2B; --line: #2E2840;
  --ink: #EEEAF6; --muted: #A49DB5; --brand: #9BE22D; --brand-ink: #0B0A10; --brand-2: #C3F56A;
  --violet: #A855F7; --violet-2: #C99BFF; --amber: #F5B841;
  --good: #7CE38B; --warn: #F5B841; --bad: #FF7A7A; --info-bg: #241F33;
  --radius: 14px; --glow: 0 0 0 1px rgba(155,226,45,.35), 0 8px 30px rgba(155,226,45,.12);
  --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F5F3F9; --bg-2: #ECE8F4; --surface: #FFFFFF; --surface-2: #F3F0F9; --line: #DDD6EA;
    --ink: #17131F; --muted: #5F5870; --brand: #3F7D0B; --brand-ink: #FFFFFF; --brand-2: #4F9A10;
    --violet: #7A2BD1; --violet-2: #6420B5; --amber: #9A5B00;
    --good: #1E7A3C; --warn: #9A5B00; --bad: #B3261E; --info-bg: #EFE8FB;
    --glow: 0 0 0 1px rgba(63,125,11,.35), 0 8px 24px rgba(63,125,11,.12);
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background-image: radial-gradient(1200px 500px at 85% -10%, rgba(168,85,247,.16), transparent 60%), radial-gradient(900px 400px at -10% 0%, rgba(155,226,45,.08), transparent 60%);
  background-attachment: fixed; }
a { color: var(--brand); }
img { max-width: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

/* Header */
.topbar { background: rgba(11,10,16,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #fff; position: sticky; top: 0; z-index: 20; border-bottom: 1px solid #2E2840; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 68px; }
.brand { color: #fff; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: .02em; display: flex; align-items: center; gap: 10px; }
.brand img { height: 44px; width: auto; filter: drop-shadow(0 2px 10px rgba(155,226,45,.3)); }
.brand span b { color: #9BE22D; font-weight: 700; }
nav { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }
nav a { color: #CFC8DD; text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: .95rem; }
nav a:hover, nav a.active { background: rgba(155,226,45,.12); color: #fff; }
nav a.scan-link { color: #0B0A10; background: #9BE22D; }
nav a.scan-link:hover { background: #C3F56A; color: #0B0A10; }
nav a.button { background: #9333EA; color: #fff; border-color: #9333EA; }

main { padding-top: 26px; padding-bottom: 56px; min-height: 70vh; }
h1, h2.display, .display { font-family: var(--display); }
h1 { font-size: 2rem; line-height: 1.15; margin: 0 0 10px; text-wrap: balance; letter-spacing: .01em; }
h2 { font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 30px 0 12px; font-weight: 700; }
h3 { margin: 0 0 6px; font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.price { font-family: var(--display); font-size: 1.7rem; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.glow { box-shadow: var(--glow); border-color: transparent; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.rows { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.row .title { font-weight: 600; }
a.row { text-decoration: none; color: inherit; }
a.row:hover { border-color: var(--brand); }
.two-col { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }

/* Product cards */
.product { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; padding: 0; overflow: hidden; transition: transform .15s, border-color .15s, box-shadow .15s; }
.product:hover, .product:focus-visible { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--glow); }
.product .thumb { aspect-ratio: 1; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.product .thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.product .thumb img.ph { width: 46%; height: auto; background: transparent; opacity: .35; }
.product .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product .name { font-weight: 600; line-height: 1.3; }
.product .price { font-size: 1.2rem; }
.product .row { margin-top: auto; }
.product.sold-out .price { color: var(--muted); }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--violet-2); }

/* Pills and badges */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--info-bg); color: var(--violet-2); white-space: nowrap; }
.pill.good { color: var(--good); background: rgba(124,227,139,.12); } .pill.warn { color: var(--warn); background: rgba(245,184,65,.12); }
.pill.muted { color: var(--muted); } .pill.bad { color: var(--bad); background: rgba(255,122,122,.12); }
.pill.good::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }

/* Buttons and forms */
.button, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); border-radius: 12px; padding: 10px 18px; cursor: pointer; text-decoration: none; transition: filter .15s, transform .05s; }
.button:hover, button:hover { filter: brightness(1.08); }
.button:active, button:active { transform: translateY(1px); }
.button.secondary, button.secondary { background: transparent; color: var(--brand); }
.button.violet, button.violet { background: #9333EA; border-color: #9333EA; color: #fff; }
.button.danger, button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.button.small, button.small { padding: 6px 12px; font-size: .88rem; border-radius: 10px; }
.button.big { padding: 14px 24px; font-size: 1.05rem; }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
form.stack { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .92rem; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
input, select, textarea { max-width: 100%; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
/* A solid 2px ring plus glow: visible focus on both themes (WCAG 2.4.7). */
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--brand); outline: 2px solid var(--brand); outline-offset: 1px; box-shadow: 0 0 0 4px rgba(155,226,45,.25); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
.fields { display: grid; grid-template-columns: 2fr 1fr 1.2fr; gap: 10px; }
.fields.two { grid-template-columns: 1fr 1fr; }
.inline { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.inline input[type=number] { width: 90px; }
.searchbar { display: flex; gap: 8px; margin: 14px 0 18px; }
.searchbar input { flex: 1; min-width: 0; padding: 14px 16px; font-size: 1.05rem; border-radius: 14px; }

.alert { background: rgba(255,122,122,.1); color: var(--bad); border: 1px solid rgba(255,122,122,.35); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.flash { background: rgba(155,226,45,.1); color: var(--brand); border: 1px solid rgba(155,226,45,.3); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-weight: 600; }
.notice { background: var(--info-bg); border-radius: 12px; padding: 12px 14px; }
.empty { text-align: center; padding: 56px 16px; }
.empty h1, .empty .empty-title { font-size: 1.4rem; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0 0 8px; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); margin-top: 12px; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.table-wrap { overflow-x: auto; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Grid and flex children may shrink below their content (file pickers, long words), so nothing pushes a phone screen sideways. */
.split > *, .two-col > *, .grid > *, .fields > *, .rows > *, .stat-row > * { min-width: 0; }
.card, .row > * { overflow-wrap: anywhere; }
input[type=file] { width: 100%; }

/* Home */
.hero { position: relative; display: grid; grid-template-columns: 1.3fr .9fr; gap: 28px; align-items: center; padding: 34px 30px; border-radius: 22px; overflow: hidden;
  background: linear-gradient(135deg, #17141F 0%, #1E1530 55%, #14220A 100%); border: 1px solid #2E2840; color: #EEEAF6; margin-bottom: 8px; }
.hero::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 42px), repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 42px); pointer-events: none; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); color: #fff; }
.hero h1 em { font-style: normal; color: #9BE22D; text-shadow: 0 0 24px rgba(155,226,45,.45); }
.hero p { color: #CFC8DD; max-width: 560px; }
.hero .logo-big { justify-self: center; width: min(320px, 100%); filter: drop-shadow(0 12px 40px rgba(168,85,247,.35)); }
.hero .searchbar input { background: rgba(11,10,16,.7); border-color: #3B3352; color: #fff; }
.hero .ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.chip:hover, .chip.on { border-color: var(--brand); color: var(--brand); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 18px; }
.features .card h3 { font-family: var(--display); color: var(--brand); }

/* Product page */
.media { aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; }
.media img { width: 100%; height: 100%; object-fit: contain; }
.media.placeholder { background: var(--surface-2); }
.media.placeholder img { width: 45%; height: auto; opacity: .45; }
.qr { background: #fff; padding: 10px; border-radius: 12px; width: 150px; height: 150px; }
.qr img, .qr svg { width: 100%; height: 100%; display: block; }
.lore { border-left: 3px solid var(--violet); }
.linklist { display: flex; flex-wrap: wrap; gap: 8px; }
.linklist a { text-decoration: none; }
.stores .store { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stores .store:last-child { border-bottom: 0; }
/* Store names are tap targets on phones: at least 24px tall (WCAG 2.5.8). */
.stores .store a, .linklist a, a.chip, .subnav a, .copy-list button { display: inline-flex; align-items: center; min-height: 28px; }
details.tools summary { cursor: pointer; font-weight: 700; color: var(--violet-2); }
details.tools[open] summary { margin-bottom: 12px; }

/* Seller area */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.subnav a { padding: 7px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: .92rem; }
.subnav a:hover { color: var(--ink); background: var(--surface); }
.subnav a.on { color: var(--brand-ink); background: var(--brand); }
.subnav .count { background: #9333EA; color: #fff; border-radius: 999px; padding: 0 7px; margin-left: 4px; font-size: .78rem; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.stat b { display: block; font-family: var(--display); font-size: 1.6rem; color: var(--brand); }
.code-big { font-family: var(--display); font-size: 2.2rem; letter-spacing: .25em; color: var(--brand); }
.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--violet)); width: 0; transition: width .2s; }
.copy-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.copy-list { list-style: none; padding: 0; margin: 0; }
.aisle { margin-bottom: 18px; }
.aisle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cell { display: block; text-decoration: none; color: inherit; padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.cell:hover { border-color: var(--brand); }
.cell b { display: block; font-family: var(--display); }

/* Scanner */
.scanner { position: relative; border-radius: 18px; overflow: hidden; background: #000; aspect-ratio: 4/3; max-width: 560px; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .reticle { position: absolute; inset: 22% 12%; border: 3px solid #9BE22D; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0,0,0,.35), 0 0 24px rgba(155,226,45,.6); pointer-events: none; }

/* Printable tags */
.tags { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.shelf-tag { background: #fff; color: #111; border: 2px solid #111; border-radius: 10px; padding: 10px; display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; break-inside: avoid; page-break-inside: avoid; }
.shelf-tag .q { width: 96px; height: 96px; }
.shelf-tag .t { font-family: var(--display); font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.shelf-tag .s { font-size: .78rem; color: #444; }
.shelf-tag.bin { grid-template-columns: 120px 1fr; }
.shelf-tag.bin .q { width: 120px; height: 120px; }
.shelf-tag.bin .t { font-size: 1.35rem; }
.no-print { }
@media print {
  body { background: #fff; color: #000; }
  .topbar, .footer, .subnav, .no-print, .flash { display: none !important; }
  main { padding: 0; }
  .tags { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}

.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .85rem; padding-top: 18px; padding-bottom: 32px; border-top: 1px solid var(--line); }
.footer a { color: var(--muted); }
.footer .tm { display: flex; align-items: center; gap: 8px; }
.footer .tm img { height: 26px; width: auto; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 24px 18px; }
  .hero .logo-big { width: 180px; grid-row: 1; }
  .split, .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .fields, .fields.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fields > :first-child { grid-column: 1 / -1; }
  h1 { font-size: 1.55rem; }
  .brand > span { display: none; }
  nav a { padding: 7px 9px; font-size: .9rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Visually hidden, still read by screen readers. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Seller dashboard: stat cards are links; ones needing action glow. */
.stat-links a.stat { text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; }
.stat-links a.stat:hover { border-color: var(--brand); }
.stat-links a.stat.attention { box-shadow: var(--glow); border-color: transparent; color: var(--ink); }
.copy-list li > span { flex: 1; min-width: 0; }
.copy-list button, [data-copy] { flex: none; white-space: nowrap; }
/* File pickers in the shop's style instead of the browser's gray button. */
input[type=file] { padding: 8px; cursor: pointer; }
input[type=file]::file-selector-button { font: inherit; font-weight: 700; margin-right: 12px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--brand); background: transparent; color: var(--brand); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: rgba(155,226,45,.12); }
/* Notifications bell with unread badge. */
nav a.bell { position: relative; display: inline-flex; align-items: center; }
nav a.bell svg { width: 20px; height: 20px; }
nav a.bell .badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #9333EA; color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center; line-height: 1; }

/* For stores (the sales page for shops) */
.hero .hero-checks { color: #CFC8DD; margin: 12px 0 0; }
.chips a.chip { scroll-margin-top: 90px; }
h2[id] { scroll-margin-top: 90px; }
.steps .card { position: relative; }
.step { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-family: var(--display); font-weight: 700; margin-bottom: 8px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 14px 0 10px; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 6px; }
.plan h3 { font-family: var(--display); font-size: 1.25rem; }
.plan .price { margin: 4px 0; }
.plan .per { font-size: .95rem; color: var(--muted); font-weight: 600; }
.plan .pill { align-self: flex-start; }
.plan .button { margin-top: auto; }
.ticks { list-style: none; padding: 0; margin: 4px 0 14px; display: flex; flex-direction: column; gap: 6px; }
.ticks li { padding-left: 24px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--brand); font-weight: 800; }
.faq details summary { cursor: pointer; font-weight: 700; min-height: 28px; display: flex; align-items: center; }
.faq details[open] summary { color: var(--brand); margin-bottom: 4px; }
.faq details p { margin: 6px 0 0; }
.cta-end { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 28px; padding: 24px; }
.cta-end h3 { font-size: 1.4rem; }
.cta-end .ctas { display: flex; gap: 10px; flex-wrap: wrap; }

/* Privacy and terms */
.doc { max-width: 780px; margin: 0 auto; padding: 28px; }
.doc h2 { font-family: var(--display); font-size: 1.15rem; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 26px 0 8px; }
.doc .updated { color: var(--muted); margin-top: 0; }
.doc li { margin-bottom: 6px; }
.features.three { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.notice a { color: var(--violet-2); }
