/* RNR ordering portal (WCA Store Reorder). Look: the RNR Tire Express affiliate portal design
   (rnrdemo.netlify.app). Built for handheld scanners: 360-480px wide, gloves, bright shops. */

@font-face {
  font-family: "Inter";
  src: url("/brand/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* RNR design tokens */
  --ink: #1a1d22;
  --dark: #20242b;
  --red: #e4002b;
  --red-deep: #b30020;
  --gold: #ffb800;
  --paper: #ffffff;
  --band: #f4f6f8;
  --line: #dce0e5;
  --muted: #6b7280;
  --text: #374151;
  --label: #5a626e;

  /* names the app's components use */
  --bg: var(--band);
  --surface: var(--paper);
  --brand: var(--ink);
  --accent: var(--red);
  --accent-ink: #ffffff;
  --ok: #15803d;
  --ok-bg: #e7f5ec;
  --warn: #a15c00;
  --warn-bg: #fff4dc;
  --bad: #c4001f;
  --bad-bg: #fdecef;
  --radius: 8px;
  --tap: 48px;
  --shadow: 0 1px 2px rgba(26, 29, 34, .06), 0 2px 10px rgba(26, 29, 34, .05);
  --font: "Inter", Arial, Helvetica, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Roboto Mono", monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 16px/1.45 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
img { max-width: 100%; }

#app { min-height: 100%; display: flex; flex-direction: column; }
#view { flex: 1; padding: 14px 14px calc(84px + env(safe-area-inset-bottom)); max-width: 720px; width: 100%; margin: 0 auto; outline: none; }
.booting #view::before { content: "Loading..."; display: block; padding: 40px; text-align: center; color: var(--muted); }

/* ---- utility bar: "Powered by West Coast Wheel Accessories" ---- */
.util { background: var(--ink); color: #c9ced6; font-size: 12.5px; padding-top: env(safe-area-inset-top); }
.util .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; }
.util-left { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.util-left .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); flex: none; }
.util-left b { color: #fff; font-weight: 600; }
.util a { text-decoration: none; white-space: nowrap; }
.util a:hover { color: #fff; }
.util .short { display: none; }
@media (max-width: 479px) {
  .util .long { display: none; }
  .util .short { display: inline; }
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 14px; }

/* ---- app header: RNR logo, store, menu ---- */
.top { position: sticky; top: 0; z-index: 20; }
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px 6px 14px; min-height: 58px;
  background: var(--paper); color: var(--ink);
  border-bottom: 3px solid var(--red);
}
.brand-logo { height: 26px; width: auto; display: block; flex: none; }
.who { min-width: 0; flex: 1; text-align: right; line-height: 1.2; }
.store-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-name { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) {
  .topbar { gap: 8px; padding-left: 12px; }
  .topbar .brand-logo { height: 21px; }
  .store-name { font-size: 13.5px; }
}
.icon-btn { width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:active { background: var(--band); }

.menu {
  position: fixed; top: calc(56px + env(safe-area-inset-top)); right: 8px; z-index: 40; min-width: 250px;
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: var(--radius);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .35); padding: 6px;
}
.menu .menu-head { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 14px; color: var(--muted); }
.menu button, .menu a { display: block; width: 100%; text-align: left; padding: 12px; border: 0; background: none; border-radius: 5px; text-decoration: none; color: var(--ink); font-weight: 500; cursor: pointer; min-height: var(--tap); }
.menu button:hover, .menu a:hover { background: var(--band); }
.menu select { width: 100%; min-height: var(--tap); margin: 4px 0 8px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 5px; background: #fbfbfc; }

/* ---- bottom tabs ---- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 14px rgba(26, 29, 34, .06);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; min-height: 60px; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.tab svg { width: 25px; height: 25px; }
.tab.active { color: var(--red); }
.tab.active::before { content: ""; position: absolute; top: 0; left: 20%; right: 20%; height: 3px; background: var(--red); }
.badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.badge.alert { background: var(--red); }

/* ---- building blocks ---- */
h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin: 4px 0 12px; }
h2 { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--label); margin: 20px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 10px; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border-radius: 5px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .16s, border-color .16s, transform .12s;
}
.btn:hover { border-color: #c4cad2; }
.btn:active { transform: translateY(1px); }
.btn.primary, .btn.go, .btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover, .btn.go:hover, .btn-red:hover { background: var(--red-deep); border-color: var(--red-deep); }
.btn.approve { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); border-color: #efb9c3; }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.block { width: 100%; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: default; }

.field { display: block; }
.field > span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--label); margin-bottom: 6px; }
.input, .field input, .field textarea, .field select {
  width: 100%; min-height: var(--tap); padding: 10px 13px; border: 1.5px solid var(--line); border-radius: 5px; background: #fbfbfc;
  transition: border-color .16s, box-shadow .16s;
}
.input:focus, .field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(228, 0, 43, .14); background: #fff; }
textarea { resize: vertical; }

.pill { display: inline-block; padding: 3px 9px; border-radius: 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pill.pending { background: var(--warn-bg); color: var(--warn); }
.pill.approved { background: var(--ok-bg); color: var(--ok); }
.pill.rejected, .pill.cancelled { background: var(--bad-bg); color: var(--bad); }

.stock { font-weight: 800; }
.stock.ok { color: var(--ok); }
.stock.low { color: var(--warn); }
.stock.out { color: var(--bad); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 3px; background: var(--dark); color: #fff; letter-spacing: .02em; white-space: nowrap; }

.notice { padding: 10px 12px; border-radius: 5px; font-size: 14px; border-left: 4px solid transparent; }
.notice.warn { background: var(--warn-bg); color: #5f3a00; border-left-color: var(--gold); }
.notice.bad { background: var(--bad-bg); color: #7a0f20; border-left-color: var(--red); }
.notice.ok { background: var(--ok-bg); color: #0f4a24; border-left-color: var(--ok); }
.notice.info { background: #eef1f5; color: var(--text); border-left-color: var(--dark); }

.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

/* ---- sign in: the RNR portal landing (dark hero, sign-in card, footer) ---- */
#app.auth #view { padding: 0; max-width: none; }
.mast { background: #fff; border-bottom: 1px solid var(--line); }
.mast .wrap { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.mast .brand-logo { height: 30px; }
.new-franchise { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.nf-label { font-size: 14.5px; font-weight: 600; color: var(--text); }
.new-franchise .btn { min-height: 40px; font-size: 14px; padding: 0 16px; }

.hero { position: relative; background: var(--ink); overflow: hidden; padding: 34px 0 40px; }
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg .grad { position: absolute; inset: 0; background: radial-gradient(130% 130% at 50% 0%, #2b303a 0%, #15171c 70%); }
.hero-bg .glow { position: absolute; top: 50%; left: 50%; width: 640px; height: 640px; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(228, 0, 43, .2), transparent 62%); }
.hero-bg .tread { position: absolute; inset: 0; opacity: .05; background-image: repeating-linear-gradient(115deg, #fff 0 9px, transparent 9px 24px); }
.hero-bg .stripe { position: absolute; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--red), var(--red-deep)); }
.hero-bg .stripe.top { top: 0; }
.hero-bg .stripe.bottom { bottom: 0; }
.hero .wrap { position: relative; z-index: 3; display: grid; grid-template-columns: 1fr; gap: 30px; justify-items: center; }
.login-col { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 410px; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.login-card { background: #fff; border-radius: 10px; width: 100%; padding: 26px 22px 22px; box-shadow: 0 30px 70px -26px rgba(0, 0, 0, .7); border-top: 4px solid var(--red); }
.login-card h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; text-transform: none; color: var(--ink); margin: 0; }
.login-card .hint { font-size: 13px; color: var(--muted); margin: 5px 0 18px; }
.login-card .notice { margin-bottom: 14px; }
.lfield { margin-bottom: 14px; }
.lfield label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--label); margin-bottom: 6px; }
.lfield input { width: 100%; font-size: 16px; min-height: var(--tap); padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 5px; background: #fbfbfc; transition: border-color .16s, box-shadow .16s; }
.lfield input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(228, 0, 43, .14); background: #fff; }
.login-row { display: flex; justify-content: flex-end; font-size: 13px; margin: 2px 0 16px; }
.login-row a, .newdealer a { text-decoration: none; }
.login-row a { color: var(--red); font-weight: 600; }
.login-row a:hover { text-decoration: underline; }
.login-card .btn { min-height: 50px; }
.newdealer { text-align: center; font-size: 13px; color: var(--muted); margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.newdealer a { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--red); padding-bottom: 1px; }
.product-col { display: flex; justify-content: center; }
.hero-product { width: 100%; max-width: 360px; height: auto; filter: drop-shadow(0 26px 44px rgba(0, 0, 0, .55)); }

.site-foot { background: var(--ink); color: #a3aab4; padding-top: 34px; padding-bottom: env(safe-area-inset-bottom); }
.foot-top { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; padding-bottom: 26px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.foot-brand { grid-column: 1 / -1; }
.foot-logo { height: 28px; width: auto; filter: invert(1) brightness(2); margin-bottom: 12px; display: block; }
.foot-brand .addr { font-size: 13.5px; line-height: 1.8; margin: 0; }
.fcol h4 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; margin: 0 0 10px; }
.fcol a { display: block; font-size: 14px; padding: 5px 0; text-decoration: none; }
.fcol a:hover { color: #fff; }
.foot-bottom { padding: 16px 0 22px; font-size: 12.5px; }
.foot-bottom b { color: #c9ced6; font-weight: 600; }

@media (min-width: 600px) {
  .wrap { padding: 0 24px; }
  .foot-top { grid-template-columns: 1.5fr 1fr 1fr; }
  .foot-brand { grid-column: auto; }
}
@media (min-width: 861px) {
  .mast .wrap { min-height: 84px; }
  .mast .brand-logo { height: 38px; }
  .hero { padding: 52px 0; min-height: 460px; display: flex; align-items: center; }
  .hero .wrap { width: 100%; grid-template-columns: minmax(320px, 400px) 1fr; gap: 46px; align-items: center; justify-items: stretch; }
  .login-col { align-items: flex-start; }
  .login-card { padding: 32px 32px 28px; }
  .hero-product { max-width: 460px; }
}
@media (max-width: 599px) {
  .nf-label { display: none; }
  .mast .brand-logo { height: 26px; }
}

/* ---- scan ---- */
.scanbox { display: flex; gap: 8px; }
.scanbox .input::placeholder { font-family: var(--font); font-size: 16px; letter-spacing: 0; color: #8a929d; }
.scanbox .input { font-size: 20px; font-family: var(--mono); letter-spacing: .02em; min-height: 56px; background: #fff; }
.scanbox .btn { min-height: 56px; min-width: 56px; padding: 0 12px; }
.scan-help { font-size: 13px; color: var(--muted); margin: 7px 2px 0; }
.scan-ready { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: middle; box-shadow: 0 0 0 3px rgba(21, 128, 61, .18); }

.item-card { margin-top: 12px; border-top: 4px solid var(--red); }
.item-card .part { font-family: var(--mono); font-size: 22px; font-weight: 800; letter-spacing: .01em; word-break: break-all; }
.item-card .name { font-size: 15px; color: var(--text); margin: 2px 0 10px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 12px; }
.fact { background: var(--band); border-radius: 5px; padding: 9px 11px; }
.fact .k { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--label); }
.fact .v { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fact .v.small { font-size: 14px; font-weight: 600; }

.qty { display: flex; align-items: stretch; gap: 6px; }
.qty button { width: 56px; min-height: 56px; font-size: 26px; font-weight: 700; border: 1.5px solid var(--line); border-radius: 5px; background: var(--surface); cursor: pointer; }
.qty button:active { background: var(--band); }
.qty input { width: 100%; min-width: 0; text-align: center; font-size: 26px; font-weight: 800; font-family: var(--mono); border: 2px solid var(--ink); border-radius: 5px; min-height: 56px; background: #fff; }
.qty input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(228, 0, 43, .14); }
.qty.compact button { width: 40px; min-height: 40px; font-size: 20px; }
.qty.compact input { font-size: 18px; min-height: 40px; border-width: 1.5px; border-color: var(--line); width: 64px; flex: none; }
.add-row { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
.add-row .btn { min-height: 52px; font-size: 16px; }

.recent { margin-top: 14px; }
.recent h2 { margin: 0; }
.recent li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
ul.plain { list-style: none; padding: 0; margin: 0; }

.suggest { margin-top: 8px; }
.suggest button { display: block; width: 100%; text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 5px; padding: 10px 12px; margin-top: 6px; cursor: pointer; }

/* ---- order ---- */
.line { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .part { font-family: var(--mono); font-weight: 800; }
.line .name { font-size: 14px; color: var(--muted); }
.line .meta { font-size: 13px; }
.line .right { text-align: right; }
.line .ext { font-weight: 800; font-variant-numeric: tabular-nums; }
.line .remove { border: 0; background: none; color: var(--bad); font-size: 13px; font-weight: 700; cursor: pointer; padding: 6px 0; min-height: 32px; }
.totals { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; font-weight: 800; padding: 12px 2px 4px; font-variant-numeric: tabular-nums; }
.sticky-actions { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(244, 246, 248, 0), var(--bg) 45%); padding-top: 22px; padding-bottom: 8px; }
.sticky-actions .btn.primary, .sticky-actions .btn.go { min-height: 54px; font-size: 16px; box-shadow: 0 10px 24px -10px rgba(228, 0, 43, .6); }

/* ---- rack ---- */
.rack-row h2 { display: flex; align-items: center; gap: 8px; }
.bin { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; margin-top: 6px; cursor: pointer; }
.bin .pos { font-family: var(--mono); font-weight: 800; font-size: 15px; text-align: center; background: var(--dark); color: #fff; border-radius: 4px; padding: 8px 0; }
.bin .part { display: block; font-family: var(--mono); font-weight: 800; font-size: 14px; }
.bin .name { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bin > span { min-width: 0; }
.bin .right { white-space: nowrap; text-align: right; font-size: 13px; }
.bin.on-order { border-color: var(--red); box-shadow: inset 4px 0 0 var(--red); }
.bin.on-order .pos { background: var(--red); }

/* ---- ask ---- */
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 10px 13px; border-radius: 10px; white-space: pre-wrap; word-wrap: break-word; font-size: 15px; }
.msg.user { align-self: flex-end; background: var(--dark); color: #fff; border-bottom-right-radius: 3px; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.msg.bot.error { background: var(--bad-bg); border-color: #f3c2cb; }
.typing { align-self: flex-start; color: var(--muted); font-size: 14px; padding: 6px 4px; }
.typing::after { content: "..."; animation: dots 1.2s steps(4, end) infinite; display: inline-block; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes dots { 0% { width: 0; } 100% { width: 1.2em; } }
.cards { align-self: stretch; }
.cards h3 { font-size: 12.5px; margin: 4px 2px 6px; color: var(--label); text-transform: uppercase; letter-spacing: .08em; }
.pcard { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; }
.pcard .part { font-family: var(--mono); font-weight: 800; }
.pcard .name { font-size: 14px; }
.pcard .note { font-size: 13px; color: var(--muted); grid-column: 1 / -1; }
.pcard .facts-inline { font-size: 13px; grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.pcard .actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14px; cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--red); }
.composer { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 10px 0 2px; background: var(--bg); }
.composer textarea { flex: 1; min-height: 52px; max-height: 140px; padding: 12px; border: 1.5px solid var(--line); border-radius: 6px; resize: none; background: #fff; }
.composer textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(228, 0, 43, .14); }

/* ---- orders ---- */
.order-row { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-top: 8px; cursor: pointer; }
.order-row .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-row .no { font-family: var(--mono); font-weight: 800; }
.order-row .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.order-row.needs-me { border-color: var(--gold); box-shadow: inset 4px 0 0 var(--gold); }
.segmented { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.segmented button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.detail-lines { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.detail-lines th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--label); border-bottom: 2px solid var(--line); padding: 6px 4px; }
.detail-lines td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.detail-lines .r { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- toast + camera ---- */
.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; max-width: calc(100% - 24px); padding: 12px 16px; border-radius: 6px; background: var(--ink); color: #fff; font-weight: 600; border-left: 4px solid var(--red); box-shadow: 0 12px 28px rgba(0, 0, 0, .3); }
.toast.bad { background: var(--bad); border-left-color: #fff; }
.camera { padding: 0; border: 0; width: 100%; max-width: 560px; background: #000; color: #fff; border-radius: 10px; overflow: hidden; }
.camera::backdrop { background: rgba(0, 0, 0, .7); }
.camera video { display: block; width: 100%; max-height: 70vh; object-fit: cover; }
.camera-frame { position: absolute; left: 12%; right: 12%; top: 30%; height: 22%; border: 3px solid var(--red); border-radius: 8px; pointer-events: none; }
.camera-hint { text-align: center; margin: 8px; }
.camera .btn { display: flex; margin: 0 12px 12px; width: calc(100% - 24px); }

@media (min-width: 760px) {
  #view { padding-top: 22px; }
  .facts { grid-template-columns: repeat(4, 1fr); }
}

/* ---- spacing helpers (the CSP forbids inline style attributes) ---- */
.mt8 { margin-top: 8px; }
.mt10 { margin-top: 10px; }
.mt12 { margin-top: 12px; }
.mb10 { margin-bottom: 10px; }
.m0 { margin: 0; }
.px6 { padding: 0 6px; display: block; }
.minw0 { min-width: 0; }

/* ---- tip banner (burnt orange carousel under the header) ---- */
:root { --burnt: #bf5700; --burnt-dark: #9e4700; }
.banner {
  position: relative;
  display: grid; grid-template-columns: 36px 1fr 36px; align-items: center;
  min-height: 46px; padding: 4px 2px 10px;
  background: var(--burnt); color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
.banner.single { grid-template-columns: 12px 1fr 12px; padding-bottom: 4px; }
.banner.single .banner-nav, .banner.single .banner-dots { display: none; }
.banner-nav { height: 36px; display: grid; place-items: center; border: 0; background: none; color: #fff; opacity: .85; cursor: pointer; border-radius: 5px; }
.banner-nav:active { background: var(--burnt-dark); }
.banner-body { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; text-align: center; touch-action: pan-y; }
.banner-text { font-weight: 700; font-size: 15px; line-height: 1.25; text-wrap: balance; }
.banner-text.fade { animation: banner-in .35s ease-out; }
@keyframes banner-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.banner-add { flex: none; border: 2px solid #fff; background: #fff; color: var(--burnt-dark); font-weight: 800; font-size: 13px; border-radius: 999px; padding: 4px 12px; min-height: 32px; cursor: pointer; }
.banner-add:active { background: #ffe9d9; }
.banner-dots { position: absolute; left: 0; right: 0; bottom: 3px; display: flex; justify-content: center; gap: 5px; }
.banner-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.banner-dots span.on { background: #fff; }
.banner-text.linked { cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .banner-text.fade { animation: none; }
  * { transition: none !important; }
}
