/* Nealey Hub — phone first. Brand: Brick Red #bd392d, Steel Blue #2e3d4f, Silver #8f8f8e; Industry type
   (served on *.nealeytire.com only; Saira Semi Condensed stands in elsewhere). Look follows the Hub mockup
   (artifact 6M2P1cEGPdgAMpKtEAuKUn): Steel Blue header, white rounded cards, white bottom bar, red for "active". */
:root {
  --red: #bd392d; --red-dark: #8f2a21; --red-soft: #fbe9e7; --steel: #2e3d4f; --steel-2: #3b4d63; --silver: #8f8f8e;
  --bg: #f4f3f1; --card: #ffffff; --ink: #1f2933; --muted: #5b6570; --line: #e0ddd8; --chip: #e6e3df; --ok: #2f7d4f; --warn: #9a5b00;
  --head: "Industry", "Saira Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --tabs-h: 64px; --r: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--body); -webkit-text-size-adjust: 100%; }
a { color: var(--red); }
button { font-family: inherit; }
h1, h2, h3, h4, .t-head { font-family: var(--head); }
h2 { font-size: 1.15rem; margin: 18px 0 8px; font-weight: 700; }
h3 { font-size: 1.05rem; margin: 14px 0 6px; font-weight: 600; }
h4 { font-size: 1rem; margin: 12px 0 4px; font-weight: 600; }

/* header */
.head { background: var(--steel); color: #fff; padding: calc(14px + env(safe-area-inset-top)) 18px 16px; position: sticky; top: 0; z-index: 10; }
.head .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.head .eyebrow { font-size: 12.5px; color: #c9d1da; letter-spacing: .08em; text-transform: uppercase; }
.head h1 { font-size: 30px; line-height: 1.05; margin: 2px 0 0; font-weight: 700; }
.head .logo { height: 22px; opacity: .95; margin-top: 4px; }
.head .back { color: #c9d1da; text-decoration: none; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.head .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.head .stat { background: rgba(255,255,255,.08); border-radius: 10px; padding: 8px 10px; }
.head .stat b { display: block; font-size: 19px; font-family: var(--head); }
.head .stat span { font-size: 12px; color: #c9d1da; }
.viewas { height: 44px; background: var(--red); color: #fff; font-size: 13.5px; padding: 8px 14px calc(8px) ; display: flex; justify-content: space-between; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 11; }
.viewas button { background: #fff; color: var(--red); border: 0; border-radius: 16px; padding: 6px 12px; font-weight: 700; font-size: 13px; min-height: 32px; }

main { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(var(--tabs-h) + 28px + env(safe-area-inset-bottom)); }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
.muted { color: var(--muted); } .small { font-size: 13.5px; }
.stack > * + * { margin-top: 12px; }

/* cards */
.card { background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.06); display: block; color: inherit; text-decoration: none; }
.card + .card { margin-top: 12px; }
.card .ttl { font-weight: 700; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card .sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.card.hot { background: var(--red); color: #fff; display: flex; gap: 12px; align-items: center; }
.card.hot .sub { color: #fff; opacity: .92; }
.card.steel { background: var(--steel); color: #fff; } .card.steel .sub { color: #c9d1da; }
.card .ic { width: 46px; height: 46px; flex: none; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.card .ic svg { width: 24px; height: 24px; stroke: #fff; }
a.card:active, button.card:active { filter: brightness(.97); }
.go { margin-left: auto; color: var(--silver); font-size: 22px; }

.bar { height: 8px; background: var(--chip); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--red); border-radius: 4px; }
.bar.ok > i { background: var(--ok); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 0;
  background: var(--red); color: #fff; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; }
.btn:active { background: var(--red-dark); }
.btn.block { width: 100%; }
.btn.steel { background: var(--steel); }
.btn.ghost { background: #fff; color: var(--steel); border: 1px solid #cfcac3; }
.btn[disabled] { opacity: .55; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--chip); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.seg a { min-height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--steel); text-decoration: none; }
.seg a.on { background: #fff; font-weight: 700; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; scrollbar-width: none; }
.chip { flex: none; min-height: 40px; padding: 0 15px; border-radius: 20px; border: 1px solid #cfcac3; background: #fff; color: var(--steel); font-size: 14px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--steel); border-color: var(--steel); color: #fff; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; background: var(--chip); color: var(--steel); white-space: nowrap; }
.tag.red { background: var(--red-soft); color: var(--red-dark); } .tag.ok { background: #dcefe3; color: var(--ok); } .tag.warn { background: #fdf0d9; color: var(--warn); }

/* lists */
.rows { background: #fff; border-radius: var(--r); box-shadow: 0 1px 2px rgba(0,0,0,.06); overflow: hidden; }
.rows > a, .rows > div, .rows > button { display: flex; gap: 12px; align-items: center; padding: 12px 14px; min-height: 56px; text-decoration: none; color: inherit; border: 0; border-top: 1px solid var(--line); background: #fff; width: 100%; text-align: left; font: inherit; }
.rows > :first-child { border-top: 0; }
.rows .grow { flex: 1; min-width: 0; }
.rows .name { font-weight: 600; font-size: 15px; }
.rows .meta { color: var(--muted); font-size: 13px; }
.rows .em { width: 28px; text-align: center; font-size: 20px; flex: none; }
.rows .bar { margin-top: 6px; }

/* badges */
.badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.badge { background: #fff; border-radius: var(--r); padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.06); border: 0; font: inherit; color: inherit; cursor: pointer; }
.medal { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 3px rgba(255,255,255,.35); }
.medal svg { width: 26px; height: 26px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge b { font-size: 13px; line-height: 1.15; }
.badge span { font-size: 11px; color: var(--muted); }
.badge.locked .medal { opacity: .8; }
.sheet { position: fixed; inset: 0; background: rgba(20,26,33,.5); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet > div { background: #fff; width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }

/* board */
.lb { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 14px; border-radius: 12px; background: #fff; border: 2px solid transparent; margin-bottom: 8px; }
.lb.me { background: var(--red-soft); border-color: var(--red); }
.lb .rk { width: 30px; font-family: var(--head); font-size: 22px; font-weight: 700; color: var(--steel); }
.lb .v { font-weight: 700; font-size: 16px; }

/* reader */
.page { background: #fff; border-radius: var(--r); padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.06); overflow-wrap: anywhere; }
.page img { max-width: 100%; height: auto; border-radius: 6px; }
.page p.gap { margin: .35rem 0; }
.page ul.tasks { list-style: none; padding-left: .2rem; } .page ul.tasks .box { margin-right: .4rem; }
.page .table-wrap { overflow-x: auto; margin: .8rem 0; }
.page table { border-collapse: collapse; min-width: 100%; font-size: 14px; }
.page td, .page th { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; text-align: left; }
.page th { background: #f6f5f3; }
.page hr { border: 0; border-top: 2px solid var(--line); margin: 1rem 0; }
.page .video { position: relative; padding-top: 56.25%; margin: .8rem 0; background: #000; border-radius: 8px; overflow: hidden; }
.page .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.page .img-missing { border: 1px dashed var(--silver); color: var(--muted); font-size: 13px; padding: 10px; border-radius: 8px; margin: .6rem 0; background: #fafafa; }
.link-card { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: .6rem 0; text-decoration: none; color: inherit; background: #fafbfc; }
.link-card .lc-title { display: block; font-weight: 600; color: var(--steel); }
.link-card .lc-note { display: block; font-size: 13px; color: var(--muted); }
.dock { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding: 10px 16px; background: linear-gradient(rgba(244,243,241,0), var(--bg) 30%); z-index: 9; }
.dock > div { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; }
.dock .btn { flex: 1; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 8px; }

/* quiz + forms */
.q { background: #fff; border-radius: var(--r); padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.q .qt { font-weight: 700; margin-bottom: 8px; }
.q label { display: flex; gap: 10px; align-items: center; min-height: 46px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; cursor: pointer; }
.q input { width: 20px; height: 20px; accent-color: var(--steel); flex: none; }
.q.wrong { box-shadow: inset 4px 0 0 var(--red), 0 1px 2px rgba(0,0,0,.06); }
.q.right { box-shadow: inset 4px 0 0 var(--ok), 0 1px 2px rgba(0,0,0,.06); }
.q .opt.correct { color: var(--ok); font-weight: 600; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 4px; color: var(--steel); }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; border: 1px solid #cfcac3; border-radius: 10px; padding: 10px 12px; font: 16px var(--body); background: #fff; color: var(--ink); }
.field textarea { min-height: 80px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin: 12px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--steel); flex: none; margin-top: 1px; }
.item-row { display: grid; grid-template-columns: 1fr 96px 64px 40px; gap: 6px; align-items: end; margin-bottom: 8px; }
.item-row select, .item-row input { min-height: 44px; border: 1px solid #cfcac3; border-radius: 10px; padding: 6px 8px; font: 15px var(--body); background: #fff; width: 100%; }
.item-row button { min-height: 44px; border: 0; background: var(--chip); border-radius: 10px; font-size: 18px; }

/* shop tools */
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tool { min-height: 104px; border-radius: var(--r); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px 6px; box-shadow: 0 1px 2px rgba(0,0,0,.06); text-align: center; text-decoration: none; color: var(--ink); }
.tool svg { width: 28px; height: 28px; stroke: var(--steel); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool b { font-size: 13px; line-height: 1.15; } .tool span { font-size: 11px; color: var(--muted); }
.tool.hot { background: var(--red); color: #fff; } .tool.hot svg { stroke: #fff; } .tool.hot span { color: #fff; opacity: .9; }

.signin { text-align: center; padding: 30px 6px; }
.signin .btn { width: 100%; max-width: 340px; margin-top: 18px; }
.notice { background: #fff8e6; border: 1px solid #f0d9a8; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.error { background: #fbeaea; border: 1px solid #efc4c0; color: var(--red-dark); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.ok-box { background: #e7f4ec; border: 1px solid #bfe0cb; color: #1f5a37; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + 20px + env(safe-area-inset-bottom)); background: var(--steel); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 40; font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.2); max-width: 90vw; }

/* bottom tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: #fff; border-top: 1px solid var(--line);
  padding: 4px 4px env(safe-area-inset-bottom); height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--red); font-weight: 700; }

@media (min-width: 760px) { .head h1 { font-size: 34px; } .badges { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tools { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mini { width: 18px; height: 18px; stroke: var(--red); margin-right: 6px; vertical-align: -3px; }
.rows .em svg { width: 22px; height: 22px; stroke: var(--steel); }
.ttl svg { flex: none; }

body.va .head { top: 44px; }
.item-row { grid-template-columns: 1fr 72px 44px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.item-row .ui { grid-column: 1 / -1; }
