/* TorqWright website tours (F117): the page, the mock v0.41 screens and the spotlight callout.
   Copyright (c) 2026 TorqWright LLC. All rights reserved. See LICENSE.
   The :root blocks below hold values from web/src/styles/tokens.css; regenerate at S0 (plus a few app color names that site.css does not define, from web/src/styles.css).
   Everything after them uses var(--x) only: no literal colors, font sizes from --fs-*, spacing on the 4 px grid, radii --r-*, z-index --z-*.
   visuals: recapture after v0.41 look (see RECAPTURE.md). */
:root {
  --on-brand: #15253b; --on-accent: #ffffff; --brand: #f26a1b;
  --surface-2: #e4e8ec; --accent: #b14a0c; --accent-soft: #fde9dc; --info: #2563a8; --info-soft: #e3edf9; --focus: #b14a0c;
  --chrome-bg: #15253b; --chrome-text: #e8edf3; --chrome-muted: #9daaba; --chrome-line: #2a4061; --chrome-active: #3b2b24;
  --accent-text: #8f3a05;
  --good-soft: #e1f2e8; --warn-soft: #fdf0d5; --bad-soft: #fdecea; --teal: #1c6f63; --teal-soft: #dff3ef; --muted-soft: #e4e8ec;
  --fs-1: 12px; --fs-2: 13px; --fs-3: 14px; --fs-4: 16px; --fs-5: 18px; --fs-6: 22px; --fs-7: 30px;
  --lh-tight: 1.2; --lh-body: 1.45;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(21, 37, 59, .06), 0 1px 3px rgba(21, 37, 59, .08);
  --shadow-2: 0 4px 16px rgba(21, 37, 59, .14);
  --shadow-3: 0 10px 30px rgba(21, 37, 59, .24);
  --ring: 0 0 0 3px var(--focus);
  --z-raised: 1; --z-sticky: 10; --z-dropdown: 20; --z-sheet: 30; --z-dialog: 40; --z-toast: 50; --z-tour: 60;
  --motion-fast: 150ms; --motion-base: 200ms; --ease: cubic-bezier(.2, .7, .2, 1);
  --site-h1: clamp(46px, 7vw, 92px); --site-h2: clamp(32px, 4.5vw, 46px); --site-body: 17px;
  /* tours only: the dimmed page behind the spotlight, and the QR code (always dark on light so phones can scan it) */
  --scrim: rgba(11, 19, 32, .66); --qr-bg: #ffffff; --qr-fg: #15253b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #ff8a47; --accent-soft: #3a2618; --info: #7fb0f0; --info-soft: #1b3150; --focus: #ffb27a;
    --accent-text: #ffa772; --on-accent: #15253b;
    --good-soft: #12301f; --warn-soft: #3a2c0f; --bad-soft: #3d1b18; --teal: #5fd0bf; --teal-soft: #12332e; --muted-soft: #1c3049; --surface-2: #1c3049;
    --chrome-bg: #0a111b; --shadow-1: none; --shadow-2: none; --shadow-3: none;
  }
}
:root[data-theme="dark"] {
  --accent: #ff8a47; --accent-soft: #3a2618; --info: #7fb0f0; --info-soft: #1b3150; --focus: #ffb27a;
  --accent-text: #ffa772; --on-accent: #15253b;
  --good-soft: #12301f; --warn-soft: #3a2c0f; --bad-soft: #3d1b18; --teal: #5fd0bf; --teal-soft: #12332e; --muted-soft: #1c3049; --surface-2: #1c3049;
  --chrome-bg: #0a111b; --shadow-1: none; --shadow-2: none; --shadow-3: none;
}
@media (prefers-reduced-motion: reduce) { :root { --motion-fast: 0ms; --motion-base: 0ms; } }

/* ---------- the /tours pages ---------- */
.tour-page { padding-block: var(--sp-6) var(--sp-7); }
.tour-page h1 { font-family: var(--display); font-size: var(--site-h2); line-height: var(--lh-tight); margin: 0 0 var(--sp-3); }
.tour-lede { font-size: var(--fs-5); color: var(--muted); max-width: 640px; margin: 0 0 var(--sp-5); }
.tour-crumbs { font-size: var(--fs-3); color: var(--muted); margin: 0 0 var(--sp-3); }
.tour-crumbs a { color: var(--accent-text); }
.tour-bar { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-4); }
.tour-bar p { margin: 0; color: var(--muted); font-size: var(--fs-3); }
.tour-end { margin-top: var(--sp-5); padding: var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.tour-end[hidden] { display: none; }
.tour-end:focus { outline: none; box-shadow: var(--ring); }
.tour-end h2 { font-family: var(--display); font-size: var(--fs-6); margin: 0 0 var(--sp-2); }
.tour-end p { margin: 0 0 var(--sp-4); color: var(--muted); }
.tour-cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.tour-more { margin-top: var(--sp-5); display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.tour-more a { color: var(--accent-text); font-weight: 600; }
.tour-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); margin: var(--sp-5) 0; }
.tour-card { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--text); text-decoration: none; }
.tour-card:hover { border-color: var(--accent); }
.tour-card h2 { font-family: var(--display); font-size: var(--fs-6); margin: 0; }
.tour-card p { margin: 0; color: var(--muted); font-size: var(--fs-4); }
.tour-card .tour-meta { font-size: var(--fs-2); color: var(--accent-text); font-weight: 600; }
.tour-phone-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-5); align-items: center; padding: var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.tour-phone-card h2 { font-family: var(--display); font-size: var(--fs-6); margin: 0 0 var(--sp-2); }
.tour-phone-card p { margin: 0 0 var(--sp-3); color: var(--muted); }
.tour-qr { width: 168px; height: 168px; padding: var(--sp-2); background: var(--qr-bg); color: var(--qr-fg); border-radius: var(--r-md); }
.tour-qr svg { display: block; width: 100%; height: 100%; }
.tour-test { margin-top: var(--sp-5); padding: var(--sp-4); border: 1px dashed var(--line); border-radius: var(--r-lg); color: var(--muted); }
.tour-test b { color: var(--text); }
@media (max-width: 600px) { .tour-phone-card { grid-template-columns: minmax(0, 1fr); } .tour-page { padding-block: var(--sp-4) var(--sp-6); } }
.tour-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-4); font-weight: 600; cursor: pointer; text-decoration: none; }
.tour-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.tour-btn:disabled { opacity: .5; cursor: default; }
.tour-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.tour-quiet { background: transparent; }

/* ---------- the stage: a desktop window or a phone ---------- */
.tour-stage { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); overflow: hidden; min-height: 320px; }
.tour-stage[data-frame="phone"] { max-width: 400px; margin-inline: auto; padding: var(--sp-3); border-radius: var(--r-lg); background: var(--chrome-bg); }
.tour-noscript { padding: var(--sp-5); color: var(--muted); }
@media (max-width: 600px) { .tour-stage[data-frame="phone"] { max-width: none; padding: 0; border: 0; border-radius: 0; background: transparent; } }

/* ---------- mock v0.41 screens (m-*) ---------- */
.m-desk { display: grid; grid-template-columns: 160px minmax(0, 1fr); min-height: 420px; background: var(--bg); color: var(--text); font-size: var(--fs-4); line-height: var(--lh-body); }
.m-side { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-4) var(--sp-3); background: var(--chrome-bg); color: var(--chrome-text); }
.m-brand { font-family: var(--display); font-size: var(--fs-5); margin-bottom: var(--sp-3); }
.m-nav { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); color: var(--chrome-muted); font-size: var(--fs-3); }
.m-navg { margin-top: var(--sp-3); padding: 0 var(--sp-3); font-size: var(--fs-1); letter-spacing: .06em; text-transform: uppercase; color: var(--chrome-muted); }
.m-top { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.m-search { flex: 1; max-width: 260px; padding: var(--sp-1) var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--muted); font-size: var(--fs-2); }
.m-new { padding: var(--sp-1) var(--sp-4); border-radius: var(--r-md); background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: var(--fs-3); }
@media (max-width: 600px) { .m-top { display: none; } }
.m-nav.m-on { background: var(--chrome-active); color: var(--chrome-text); }
.m-main { padding: var(--sp-4); min-width: 0; }
.m-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.m-kicker { margin: 0; font-size: var(--fs-2); color: var(--muted); }
.m-title { margin: 0; font-family: var(--display); font-size: var(--fs-6); line-height: var(--lh-tight); }
.m-acts { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
@media (max-width: 600px) { .m-desk { grid-template-columns: minmax(0, 1fr); } .m-side { display: none; } .m-main { padding: var(--sp-3); } }

.m-pill { display: inline-block; padding: 2px var(--sp-2); border-radius: var(--r-pill); font-size: var(--fs-2); font-weight: 600; white-space: nowrap; background: var(--muted-soft); color: var(--muted); }
.m-good { background: var(--good-soft); color: var(--good); } .m-warn { background: var(--warn-soft); color: var(--warn); } .m-bad { background: var(--bad-soft); color: var(--bad); }
.m-info { background: var(--info-soft); color: var(--info); } .m-accent { background: var(--accent-soft); color: var(--accent-text); } .m-teal { background: var(--teal-soft); color: var(--teal); }
.m-btn { display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--sp-3); border-radius: var(--r-md); font-size: var(--fs-3); font-weight: 600; border: 1px solid var(--line); }
.m-btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.m-btn-quiet { background: var(--surface); color: var(--text); }
.m-panel, .m-card, .m-pjob, .m-pcard, .m-stat, .m-sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.m-panel { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.m-panel p, .m-sheet p, .m-pjob p { margin: 0; }
.m-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
@media (max-width: 600px) { .m-split { grid-template-columns: minmax(0, 1fr); } }
.m-wait-h { margin: 0; font-size: var(--fs-2); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.m-note { margin: 0; font-size: var(--fs-3); color: var(--muted); }
.m-line { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; border-top: 1px solid var(--line); font-size: var(--fs-3); }
.m-line b { text-align: right; }
.m-hit { background: var(--accent-soft); border-radius: var(--r-sm); padding-inline: var(--sp-2); }

/* dispatch board */
.m-board-wrap { display: flex; flex-direction: column; gap: var(--sp-3); position: relative; }
.m-board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-2); }
.m-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; border-top: 1px solid var(--line); }
.m-row:first-child { border-top: 0; }
.m-who { display: flex; flex-direction: column; font-size: var(--fs-3); }
.m-who small { font-size: var(--fs-1); color: var(--muted); }
.m-track { position: relative; height: 64px; }
.m-hours .m-track { height: 24px; }
.m-hour { position: absolute; top: var(--sp-1); font-size: var(--fs-1); color: var(--muted); transform: translateX(-50%); }
.m-tile { position: absolute; top: var(--sp-2); bottom: var(--sp-2); padding: var(--sp-1) var(--sp-2); border-radius: var(--r-sm); background: var(--info-soft); border-left: 4px solid var(--info); font-size: var(--fs-1); line-height: var(--lh-tight); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.m-tile b, .m-tile span, .m-tile em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-style: normal; }
.m-tile em { color: var(--muted); }
.m-tile-running { background: var(--accent-soft); border-left-color: var(--accent); }
.m-tile-late { background: var(--warn-soft); border-left-color: var(--warn); }
.m-tile-new { background: var(--good-soft); border-left-color: var(--good); }
.m-tail { position: absolute; top: 24px; height: 16px; border-radius: var(--r-sm); background: repeating-linear-gradient(135deg, var(--steel) 0 4px, transparent 4px 8px); opacity: .7; }
.m-slot { position: absolute; top: var(--sp-2); bottom: var(--sp-2); border: 2px dashed var(--accent); border-radius: var(--r-sm); display: grid; place-items: center; font-size: var(--fs-1); color: var(--accent-text); }
.m-buffer { position: absolute; top: var(--sp-2); bottom: var(--sp-2); border-radius: var(--r-sm); background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; font-size: var(--fs-1); }
.m-wait { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.m-wait .m-wait-h { flex-basis: 100%; }
.m-card { display: flex; flex-direction: column; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-3); }
.m-card span, .m-card em { font-style: normal; color: var(--muted); font-size: var(--fs-2); }
.m-badges { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.m-compare, .m-late { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-size: var(--fs-3); }
.m-compare small { color: var(--muted); }
.m-strike { text-decoration: line-through; color: var(--muted); }
.m-optimize { display: flex; }
.m-toast { align-self: flex-start; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--chrome-bg); color: var(--chrome-text); font-size: var(--fs-3); box-shadow: var(--shadow-2); }
.m-slot span, .m-buffer span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding-inline: var(--sp-1); }
/* a sideways strip (UI-STANDARDS section 4): fade on both edges, scroll-snap, keyboard-scrollable */
.m-strip { overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.m-strip:focus-visible { outline: none; box-shadow: var(--ring); }
@media (max-width: 600px) {
  .m-strip { mask-image: linear-gradient(to right, transparent, var(--text) var(--sp-4), var(--text) calc(100% - var(--sp-4)), transparent); }
  .m-strip .m-board { min-width: 760px; }
  .m-strip .m-tile, .m-strip .m-who { scroll-snap-align: start; }
  .m-row { grid-template-columns: 56px minmax(0, 1fr); }
}

/* phone */
.m-phone-solo { background: var(--bg); }
.tour-stage[data-frame="phone"] .m-phone-solo { border-radius: var(--r-md); overflow: hidden; }
.m-phone { display: flex; flex-direction: column; min-height: 520px; background: var(--bg); color: var(--text); font-size: var(--fs-4); line-height: var(--lh-body); }
.m-phone-bar { display: flex; justify-content: space-between; padding: var(--sp-3) var(--sp-4); background: var(--chrome-bg); color: var(--chrome-text); font-weight: 600; }
.m-phone-time { color: var(--chrome-muted); font-weight: 400; }
.m-phone-body { flex: 1; display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4); min-width: 0; }
.m-phone-foot { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); background: var(--surface); }
.m-hello { margin: 0; color: var(--muted); font-size: var(--fs-3); }
.m-pjob { padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-1); }
.m-pjob-h { display: flex; justify-content: space-between; gap: var(--sp-2); align-items: center; }
.m-dim { opacity: .75; }
.m-what { color: var(--muted); font-size: var(--fs-3); }
.m-swipe { margin-top: var(--sp-2); padding: var(--sp-3); border-radius: var(--r-md); background: var(--info-soft); color: var(--info); font-weight: 600; font-size: var(--fs-3); }
.m-swipe-k { font-size: var(--fs-5); margin-right: var(--sp-2); }
.m-tabs { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.m-chip { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-3); font-weight: 600; }
.m-lines, .m-pb, .m-pay, .m-done { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.m-big { margin: 0; font-family: var(--display); font-size: var(--fs-7); line-height: var(--lh-tight); }
.m-pcard { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-3); margin-bottom: var(--sp-2); font-size: var(--fs-3); }
.m-ptile { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.m-ptile i { font-style: normal; font-weight: 700; } .m-ptile em { font-style: normal; color: var(--muted); }
.m-opts { display: grid; gap: var(--sp-2); }
.m-opts-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
@media (max-width: 600px) { .m-opts-row { grid-template-columns: minmax(0, 1fr); } }
.m-opt { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-3); background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-md); }
.m-opt.m-picked { border-color: var(--accent); background: var(--accent-soft); }
.m-opt-n { margin: 0; font-size: var(--fs-2); font-weight: 700; color: var(--accent-text); text-transform: uppercase; letter-spacing: .04em; }
.m-opt-t { margin: 0; font-weight: 600; }
.m-opt-p { margin: 0; font-family: var(--display); font-size: var(--fs-6); }
.m-opt-m { margin: 0; font-size: var(--fs-3); color: var(--muted); }
.m-rebate { margin: 0; }
.m-sign { padding: var(--sp-3); border-radius: var(--r-md); border: 1px dashed var(--line); background: var(--surface); }
.m-sig { font-style: italic; font-size: var(--fs-6); font-family: var(--display); }

/* sheets, tables, bars */
.m-sheet { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); box-shadow: var(--shadow-2); margin-top: var(--sp-3); max-width: 480px; }
.m-sheet-static { margin-top: 0; }
.m-pipe { display: flex; flex-direction: column; gap: var(--sp-1); }
.m-filters { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.m-prow { background: var(--surface); padding-inline: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: var(--sp-1); flex-wrap: wrap; }
.m-bars { display: flex; flex-direction: column; gap: var(--sp-2); }
.m-bar { display: grid; grid-template-columns: 72px minmax(0, 1fr) 40px; gap: var(--sp-2); align-items: center; font-size: var(--fs-3); }
.m-bar i { display: block; height: 16px; border-radius: var(--r-sm); background: var(--brand); }
.m-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); }
@media (max-width: 600px) { .m-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.m-stat { padding: var(--sp-3); }
.m-stat-l, .m-stat-s { margin: 0; font-size: var(--fs-2); color: var(--muted); }
.m-stat-v { margin: 0; font-family: var(--display); font-size: var(--fs-7); line-height: var(--lh-tight); }
.m-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--fs-3); }
.m-trow { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-top: 1px solid var(--line); }
.m-trow:first-child { border-top: 0; }
.m-thead { font-weight: 700; background: var(--surface-2); }
.m-q { margin: 0; font-weight: 700; font-size: var(--fs-5); }

/* ---------- the spotlight and the callout ---------- */
.tour-root[hidden] { display: none; }
.tour-scrim { position: fixed; inset: 0; z-index: var(--z-tour); background: var(--scrim); }
.tour-ring { position: fixed; z-index: var(--z-tour); pointer-events: none; border: 2px solid var(--brand); border-radius: var(--r-md); box-shadow: var(--ring); transition: left var(--motion-base) var(--ease), top var(--motion-base) var(--ease), width var(--motion-base) var(--ease), height var(--motion-base) var(--ease); }
.tour-ring[hidden] { display: none; }
.tour-callout { position: fixed; z-index: var(--z-tour); width: 360px; max-width: calc(100vw - 32px); padding: var(--sp-4); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); outline: none; }
.tour-callout.tour-sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; border-radius: var(--r-lg) var(--r-lg) 0 0; padding-bottom: calc(var(--sp-4) + env(safe-area-inset-bottom)); }
.tour-progress { margin: 0 0 var(--sp-1); font-size: var(--fs-2); font-weight: 700; color: var(--accent-text); }
.tour-callout .tour-title { margin: 0 0 var(--sp-1); font-family: var(--display); font-size: var(--fs-6); line-height: var(--lh-tight); }
.tour-callout .tour-body { margin: 0 0 var(--sp-3); font-size: var(--fs-4); color: var(--text); }
.tour-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.tour-actions .tour-btn { min-height: 44px; padding: 0 var(--sp-3); }
.tour-actions .tour-primary { flex: 1 1 auto; }
.tour-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .tour-ring { transition: none; } }
