/* ASA OS look: Workshop (ui-directions). Applied by html[data-theme="workshop"]; with no data-theme nothing here matches.
 * The shop floor: sealed concrete, black tool-chest enamel, yellow floor tape where you are, manila parts tags for status.
 * Built for a bay as much as a desk: 16px body, 44px+ targets, heavy weights, drawer outlines instead of hairlines.
 * The one loud thing is the floor tape (hazard stripes) and it only marks "you are here": the current step, filter and tab.
 *
 * Cascade rules shared by every look file:
 *  - Tokens use :root:root[data-theme] (0,3,0) to tie with shop.css's :root[data-look][data-type]; these files load last.
 *  - Component rules sit under :where(:root[data-theme]) (zero specificity), so each one weighs exactly what the shop.css
 *    or feature rule it adjusts weighs, and loses to the same more specific rules that rule loses to.
 *  - Company branding stays on top: shop-branding.js sets --accent/--font on <html> inline. The look's own type is set on
 *    <body> only when the brand font is System (look.js sets data-brand-font="custom" otherwise), and its accent and sidebar
 *    win only while the Look screen's "Show company brand" is off (data-look-brand="off").
 *  - .lk-mini[data-preview] is the small sample on the Look screen; it takes the same tokens. */

:root:root[data-theme="workshop"], .lk-mini[data-preview="workshop"] {
  --canvas: #e3e5e2; --surface: #ffffff; --surface-2: #f4f5f3;
  --ink: #1b1d1f; --ink-2: #4a4f55; --ink-3: #5e656d;
  --hair: rgba(27, 29, 31, 0.13); --hair-strong: rgba(27, 29, 31, 0.3);
  --fill: rgba(27, 29, 31, 0.07); --fill-hover: rgba(27, 29, 31, 0.12);
  --accent: #1b1d1f; --accent-ink: #ffffff; --accent-soft: rgba(27, 29, 31, 0.08);
  --green: #1b7130; --green-soft: rgba(27, 113, 48, 0.13); --amber: #9a4d00; --amber-soft: rgba(230, 140, 0, 0.18);
  --red: #b8001a; --red-soft: rgba(184, 0, 26, 0.1);
  --side: #edefec; --r-s: 4px; --r-m: 6px; --r-l: 8px; --radius-ui: 6px;
  --shadow-pop: 0 0 0 1.5px rgba(27, 29, 31, 0.3), 0 3px 0 1.5px rgba(27, 29, 31, 0.14), 0 22px 44px rgba(27, 29, 31, 0.2);
  /* the look's own tokens */
  --tape: #f2c200; --tape-ink: #1b1d1f;
  --hazard: repeating-linear-gradient(-45deg, #f2c200 0 7px, #1b1d1f 7px 14px);
  --edge: 0 0 0 1.5px var(--hair-strong), 0 3px 0 1.5px rgba(27, 29, 31, 0.1);   /* drawer outline + its lower lip */
  --tag-manila: #e8d7a5; --tag-blue: #cfe0f5; --tag-yellow: #f2c200; --tag-orange: #f59e3b; --tag-green: #1b7130;
}
@media (prefers-color-scheme: dark) {
  /* night shift: asphalt and enamel, the tape and the default buttons turn safety yellow */
  :root:root[data-theme="workshop"], .lk-mini[data-preview="workshop"] {
    --canvas: #141618; --surface: #1e2124; --surface-2: #25292c;
    --ink: #f1f2ef; --ink-2: #b3b8bd; --ink-3: #8a9096;
    --hair: rgba(255, 255, 255, 0.12); --hair-strong: rgba(255, 255, 255, 0.24);
    --fill: rgba(255, 255, 255, 0.08); --fill-hover: rgba(255, 255, 255, 0.13);
    --accent: #f2c200; --accent-ink: #1b1d1f; --accent-soft: rgba(242, 194, 0, 0.16);
    --green: #43c46a; --green-soft: rgba(67, 196, 106, 0.16); --amber: #ffae3d; --amber-soft: rgba(255, 174, 61, 0.16);
    --red: #ff6b63; --red-soft: rgba(255, 107, 99, 0.16);
    --side: #191b1d; --shadow-pop: 0 0 0 1.5px rgba(255, 255, 255, 0.2), 0 22px 44px rgba(0, 0, 0, 0.6);
    --edge: 0 0 0 1.5px var(--hair-strong), 0 3px 0 1.5px rgba(0, 0, 0, 0.5);
  }
}
/* type: signage-condensed display over the system text face */
:root[data-theme="workshop"]:not([data-brand-font="custom"]) body, :root[data-theme="workshop"][data-look-brand="off"] body, .lk-mini[data-preview="workshop"] {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "DIN Condensed", "Bahnschrift Condensed", "Bahnschrift", "Roboto Condensed", "Arial Narrow", sans-serif;
}
:root[data-theme="workshop"][data-look-brand="off"] body { --accent: #1b1d1f; --accent-ink: #ffffff; --accent-soft: rgba(27, 29, 31, 0.08); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="workshop"][data-look-brand="off"] body { --accent: #f2c200; --accent-ink: #1b1d1f; --accent-soft: rgba(242, 194, 0, 0.16); }
}

:where(:root[data-theme="workshop"]) {
  /* ---------- base ---------- */
  & :is(body, body.focus-app) { font-size: 16px; line-height: 1.45; letter-spacing: 0; }
  & :is(h1, .focus-app h1) { font: 700 38px/1 var(--font-display); letter-spacing: 0.005em; }
  & :is(h2, .focus-app h2) { font: 700 22px/1.1 var(--font-display); letter-spacing: 0.01em; }
  & :is(h3, .focus-app h3) { font-weight: 700; font-size: 16px; }
  & :is(.pg-title, .focus-app .pg-title) { font: 700 50px/0.95 var(--font-display); letter-spacing: 0.005em; }
  & .pg-kicker { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
  /* the accent is black enamel here, so plain text links (no class: content links, not nav/rows/tabs) carry an underline */
  & a:not([class]), & .next-alt { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
  & .job-back { font-weight: 600; }
  & :is(a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible) {
    outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 8px var(--tape); border-radius: var(--r-s); }
  & .job-row:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; box-shadow: inset 0 0 0 7px var(--tape); }

  /* ---------- controls: machined, square-shouldered, heavier ---------- */
  & :is(button, .btn, a.btn, .focus-app button) { border-radius: var(--r-m); font-weight: 600; font-size: 15px; letter-spacing: 0; min-height: 40px; padding: 0 16px; }
  & :is(button.primary, a.btn.primary-link, .btn.primary, .focus-app button.primary) { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.28); }
  & :is(button.primary, .btn.primary):active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.28); }
  & :is(button.quiet, .btn.quiet) { min-height: 34px; padding: 0 8px; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
  & button.jc-chip { border-radius: 999px; }
  & :is(input, select, textarea) { border: 1.5px solid var(--hair-strong); border-radius: var(--r-s); min-height: 42px; font-size: 16px; }
  & .seg { border-radius: var(--r-m); background: var(--fill); }
  & .shop-on .seg button { border-radius: var(--r-s); min-height: 34px; font-weight: 600; }
  & .shop-on .seg button[aria-pressed="true"] { box-shadow: 0 0 0 1.5px var(--hair-strong), 0 2px 0 1.5px rgba(0, 0, 0, 0.12); }
  & .chip { border-radius: var(--r-s); font-weight: 600; }

  /* ---------- containers: drawer fronts ---------- */
  & :is(.card, .focus-app .card), & :is(.panel, .next, .est, .insp, .hist, .empty, .tinsights, .job-head, .ji-sec, .ji-sum-n, .ji-cust-n) {
    border-radius: var(--r-l); box-shadow: var(--edge); }
  & .jobs { border-radius: var(--r-l); box-shadow: var(--edge); }
  & .panel h2, & .next-t { font: 700 21px/1.1 var(--font-display); letter-spacing: 0.01em; }
  & .next-l { font-size: 13px; font-weight: 700; color: var(--ink-2); }
  & :is(.next .btn, .next button) { min-height: 52px; font-size: 16px; font-weight: 700; }
  & .notice { border-radius: var(--r-m); font-weight: 500; }

  /* ---------- Today: drawer-front counters, the pressed one taped ---------- */
  & .today-strip { gap: 14px; }
  & .shop-on .today-stat { position: relative; overflow: hidden; border-radius: var(--r-l); box-shadow: var(--edge); padding: 14px 16px 18px; }
  & .shop-on .today-stat[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--ink), 0 3px 0 2.5px rgba(0, 0, 0, 0.14); }
  & .shop-on .today-stat[aria-pressed="true"]::after { content: ""; position: absolute; inset: auto 0 0; height: 7px; background: var(--hazard); }
  & .today-stat-n { font: 700 54px/0.95 var(--font-display); letter-spacing: 0; }
  & .today-stat-l { font-size: 14px; font-weight: 600; margin-top: 4px; }
  & .today-search { border-radius: var(--r-m); min-height: 44px; }
  & .jobs-head { background: var(--ink); color: var(--canvas); font-size: 12.5px; font-weight: 700; min-height: 38px; border-bottom: 0; }
  & .job-row { min-height: 66px; border-bottom: 1.5px solid var(--hair); }
  & .job-no { font: 700 21px/1 var(--font-display); color: var(--ink); letter-spacing: 0.01em; }
  & .job-cust { font-weight: 700; font-size: 16px; }
  & .job-amt { font-weight: 700; }
  & .job-when.is-late { font-weight: 700; }

  /* stage pill -> parts tag: chamfered, punched, colored like the tags on a shop's key board */
  & .stage { position: relative; border-radius: 2px 3px 3px 2px; padding: 4px 10px 4px 20px; font-size: 12.5px; font-weight: 700; color: #1b1d1f;
    background: var(--tag-manila); clip-path: polygon(8px 0, 100% 0, 100% 100%, 8px 100%, 0 calc(100% - 8px), 0 8px); }
  & .stage::before { position: absolute; left: 7px; top: 50%; width: 6px; height: 6px; margin-top: -3px; background: var(--surface);
    box-shadow: inset 0 0 0 1.5px rgba(27, 29, 31, 0.45); }
  & .stage.s-quote { background: var(--tag-manila); } & .stage.s-quote::before { background: var(--surface); }
  & .stage.s-scheduled { background: var(--tag-blue); } & .stage.s-scheduled::before { background: var(--surface); }
  & .stage.s-inshop { background: var(--tag-yellow); } & .stage.s-inshop::before { background: var(--surface); }
  & .stage.s-attention { background: var(--tag-orange); } & .stage.s-attention::before { background: var(--surface); }
  & .stage.s-done { background: var(--tag-green); color: #ffffff; } & .stage.s-done::before { background: var(--surface); box-shadow: none; }

  /* ---------- job workspace ---------- */
  & .job-head { padding: 24px 26px 0; }
  & .job-who h1 { font: 700 48px/0.95 var(--font-display); letter-spacing: 0.005em; }
  & .job-meta { font-size: 15px; }
  & .job-fact-l { font-size: 13px; font-weight: 600; }
  & .job-fact-v { font-size: 16px; font-weight: 700; }
  & .job-facts { border-top: 1.5px solid var(--hair); }
  /* progress track -> floor tape: painted where done, hazard-striped where the car is now */
  & .track { gap: 4px; }
  & .track-step { font-size: 13px; font-weight: 600; padding-top: 14px; }
  & .track-step::before { height: 9px; border-radius: 1px; right: 0; background: var(--fill); }
  & .track-step.is-done::before { background: var(--ink); }
  & .track-step.is-now { font-weight: 800; }
  & .track-step.is-now::before { background: var(--hazard); box-shadow: 0 0 0 1.5px var(--tape-ink); }
  & .job-tabs { gap: 4px; }
  & .job-tab { font-size: 15px; font-weight: 600; padding: 14px 14px 15px; border-bottom-width: 4px; }
  & .job-tab[aria-current="page"] { border-bottom-color: var(--ink); font-weight: 800; }

  /* estimate + inspection: bigger numbers, heavier names */
  & .est-top h2 { font: 700 26px/1 var(--font-display); }
  & .svc-name { font-weight: 700; font-size: 16.5px; }
  & .svc-total { font-weight: 800; }
  & .est-sum .total { font: 700 34px/1 var(--font-display); letter-spacing: 0.01em; }
  & .lines td { font-size: 15px; }
  & .ji-head h2 { font: 700 30px/1 var(--font-display); }
  & .ji-sec-h h3 { font: 700 22px/1 var(--font-display); letter-spacing: 0.01em; }
  & :is(.ji-sum-n strong, .ji-cust-n strong) { font: 700 40px/1 var(--font-display); }
  & .ji-sum-bar { height: 8px; border-radius: 1px; }
  & .ji-pos { border-radius: var(--r-m); box-shadow: 0 0 0 1.5px var(--hair); }
  & .ji .ji-num { font: 700 34px/1 var(--font-display); }
  & .ji-modes { border-radius: var(--r-m); }
  & .ji .ji-mode { border-radius: var(--r-s); font-weight: 700; }
  & .ji-cam { border-radius: var(--r-m); }

  /* ---------- phone tab bar ---------- */
  & .shop-tabbar { background: var(--surface); border-top: 1.5px solid var(--hair-strong); -webkit-backdrop-filter: none; backdrop-filter: none; }
  & .shop-tab { font-size: 11.5px; font-weight: 700; padding: 6px 0 4px; }
  & .shop-tab[aria-current="page"] { color: var(--ink); box-shadow: inset 0 4px 0 var(--tape); }

  /* ---------- customer approval page (/c/<token>) ---------- */
  & .c-main { font-family: var(--font); font-size: 16.5px; }
  & .c-hero h1 { font: 700 44px/0.95 var(--font-display); letter-spacing: 0.005em; }
  & .c-shop-name { font-weight: 700; }
  & .c-card { border-radius: var(--r-l); box-shadow: var(--edge); }
  & .c-card h2 { font: 700 24px/1.05 var(--font-display); letter-spacing: 0.01em; }
  & :is(.c-choice, .c-btn, .c-zoom-x) { border-radius: var(--r-m); min-height: 50px; font-weight: 700; }
  & .c-btn-primary { min-height: 58px; font-size: 17px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.28); }
  & .c-total-v { font: 700 40px/1 var(--font-display); }
  & .c-sign input { border-radius: var(--r-m); border-width: 1.5px; border-color: var(--hair-strong); }
}

@media (max-width: 640px) {
  :where(:root[data-theme="workshop"]) {
    & :is(.pg-title, .focus-app .pg-title) { font-size: 44px; }
    & .job-head { padding: 18px 16px 0; }
    & .job-who h1 { font-size: 38px; }
    & .track-step { font-size: 0; }
    & .track-step.is-now { font-size: 13px; }
    & .today-stat-n { font-size: 46px; }
    & .ji .ji-num { font-size: 30px; }
  }
}

@media (prefers-color-scheme: dark) {
  :where(:root[data-theme="workshop"]) .jobs-head { background: var(--surface-2); color: var(--ink-2); border-bottom: 1.5px solid var(--hair); }
}
/* a brand font of its own is wider than the condensed face: ticket numbers go back to the text size so they keep their column */
:where(:root[data-theme="workshop"][data-brand-font="custom"]:not([data-look-brand="off"])) .job-no { font: 600 14px/1 var(--font); }

/* sidebar: a light drawer with the current item in black enamel and taped — unless the company brand's dark sidebar is shown */
:root[data-theme="workshop"]:is(:not([data-brand-side="dark"]), [data-look-brand="off"]) {
  & .shop-side { background: var(--side); border-right: 2px solid var(--hair-strong); -webkit-backdrop-filter: none; backdrop-filter: none; }
  & .shop-side .shop-brand-mark:not(.has-logo) { background: var(--ink); color: var(--canvas); border-radius: var(--r-s); }
  & .shop-side .shop-brand-name { font: 700 19px/1 var(--font-display); letter-spacing: 0.01em; color: var(--ink); }
  & .shop-side .shop-nav-label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
  & .shop-side .shop-nav-item { border-radius: var(--r-s); padding: 9px 10px; font-size: 15px; font-weight: 600; color: var(--ink); }
  & .shop-side .shop-nav-item:hover { background: var(--fill); }
  & .shop-side .shop-nav-item[aria-current="page"] { background: var(--ink); color: var(--canvas); box-shadow: inset 5px 0 0 var(--tape); font-weight: 700; }
  & .shop-side .shop-side-foot { border-top: 1.5px solid var(--hair-strong); }
  & .shop-side .shop-side-foot button { color: var(--ink); text-decoration: underline; }
  & .shop-side :is(.shop-me-name, .shop-brand-store, .shop-me-role) { color: var(--ink-2); }
  & .shop-side .shop-me-name { color: var(--ink); }
}

/* ---------- Look screen sample ---------- */
.lk-mini[data-preview="workshop"] {
  & .lk-title { font: 700 30px/0.95 var(--font-display); }
  & .lk-side { border-right: 2px solid var(--hair-strong); }
  & .lk-nav.is-current { background: var(--ink); color: var(--canvas); box-shadow: inset 4px 0 0 var(--tape); border-radius: 3px; }
  & .lk-tile { border-radius: 6px; box-shadow: var(--edge); }
  & .lk-tile.is-on { box-shadow: 0 0 0 2px var(--ink); border-bottom: 5px solid transparent; border-image: var(--hazard) 1; }
  & .lk-tile b { font: 700 30px/0.95 var(--font-display); }
  & .lk-row { border-radius: 6px; box-shadow: var(--edge); }
  & .lk-pill { border-radius: 2px; padding-left: 15px; position: relative; font-weight: 700; color: #1b1d1f; background: var(--tag-yellow);
    clip-path: polygon(6px 0, 100% 0, 100% 100%, 6px 100%, 0 calc(100% - 6px), 0 6px); }
  & .lk-pill::before { content: ""; position: absolute; left: 5px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--surface); }
  & .lk-track span { height: 7px; border-radius: 1px; }
  & .lk-track .is-done { background: var(--ink); }
  & .lk-track .is-now { background: var(--hazard); }
  & .lk-btn { border-radius: 6px; font-weight: 700; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.28); }
}

@media (prefers-reduced-motion: reduce) {
  :where(:root[data-theme="workshop"]) :is(button.primary, .btn.primary):active { transform: none; }
}
