/* ASA OS look: Instrument (ui-directions). Applied by html[data-theme="instrument"]; with no data-theme nothing here matches.
 * The gauge and the spec sheet: brushed aluminium, engraved hairlines, readouts in the DIN face used on instrument clusters
 * and road signs, status as telltale lamps. Dense and exact for an advisor's long day at a desk: 14px text, 44px rows,
 * every number tabular. The one memorable thing is the progress track drawn as a measuring scale with a pointer.
 * Cascade rules: see workshop.css. */

:root:root[data-theme="instrument"], .lk-mini[data-preview="instrument"] {
  --canvas: #eceef0; --surface: #ffffff; --surface-2: #f6f7f8;
  --ink: #101418; --ink-2: #4a5562; --ink-3: #636d79;
  --hair: rgba(16, 20, 24, 0.11); --hair-strong: rgba(16, 20, 24, 0.24);
  --fill: rgba(16, 20, 24, 0.06); --fill-hover: rgba(16, 20, 24, 0.1);
  --accent: #006b80; --accent-ink: #ffffff; --accent-soft: rgba(0, 107, 128, 0.1);
  --green: #1b7a38; --green-soft: rgba(27, 122, 56, 0.1); --amber: #9c4f00; --amber-soft: rgba(214, 120, 0, 0.13);
  --red: #be0019; --red-soft: rgba(190, 0, 25, 0.09);
  --side: #f6f7f8; --r-s: 3px; --r-m: 4px; --r-l: 6px; --radius-ui: 4px;
  --shadow-pop: 0 0 0 1px rgba(16, 20, 24, 0.18), 0 14px 36px rgba(16, 20, 24, 0.16);
  /* the look's own tokens */
  --font-num: "DIN Alternate", "Bahnschrift", "D-DIN", "Roboto Condensed", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --lamp-off: rgba(16, 20, 24, 0.28);
  --tick: rgba(16, 20, 24, 0.32);
}
@media (prefers-color-scheme: dark) {
  /* the cluster at night: black glass, backlit cyan */
  :root:root[data-theme="instrument"], .lk-mini[data-preview="instrument"] {
    --canvas: #0b0e11; --surface: #14181c; --surface-2: #1a1f24;
    --ink: #e6eaed; --ink-2: #9aa5af; --ink-3: #7d8892;
    --hair: rgba(255, 255, 255, 0.09); --hair-strong: rgba(255, 255, 255, 0.2);
    --fill: rgba(255, 255, 255, 0.07); --fill-hover: rgba(255, 255, 255, 0.12);
    --accent: #38bdd3; --accent-ink: #071014; --accent-soft: rgba(56, 189, 211, 0.16);
    --green: #3dd07a; --green-soft: rgba(61, 208, 122, 0.14); --amber: #ffb547; --amber-soft: rgba(255, 181, 71, 0.14);
    --red: #ff6b70; --red-soft: rgba(255, 107, 112, 0.14);
    --side: #101317; --shadow-pop: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 14px 36px rgba(0, 0, 0, 0.6);
    --lamp-off: rgba(255, 255, 255, 0.26); --tick: rgba(255, 255, 255, 0.34);
  }
}
:root[data-theme="instrument"]:not([data-brand-font="custom"]) body, :root[data-theme="instrument"][data-look-brand="off"] body, .lk-mini[data-preview="instrument"] {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="instrument"][data-look-brand="off"] body { --accent: #006b80; --accent-ink: #ffffff; --accent-soft: rgba(0, 107, 128, 0.1); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="instrument"][data-look-brand="off"] body { --accent: #38bdd3; --accent-ink: #071014; --accent-soft: rgba(56, 189, 211, 0.16); }
}

:where(:root[data-theme="instrument"]) {
  /* ---------- base: smaller, tighter, exact ---------- */
  & :is(body, body.focus-app) { font-size: 14px; line-height: 1.45; letter-spacing: 0; font-variant-numeric: tabular-nums; }
  & :is(h1, .focus-app h1) { font: 600 24px/1.15 var(--font-display); letter-spacing: -0.012em; }
  & :is(h2, .focus-app h2) { font: 600 16px/1.3 var(--font-display); letter-spacing: -0.006em; }
  & .pg-head { margin-bottom: 18px; }
  & :is(.pg-title, .focus-app .pg-title) { font: 600 26px/1.1 var(--font-display); letter-spacing: -0.014em; }
  & .pg-kicker { font-size: 12px; }
  & :is(a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible) {
    outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; border-radius: var(--r-s); }
  & .job-row:focus-visible { box-shadow: inset 3px 0 0 var(--accent), inset 0 0 0 1px var(--accent); }

  /* ---------- controls: small radius, flat, crisp ---------- */
  & :is(button, .btn, a.btn, .focus-app button) { border-radius: var(--r-m); min-height: 32px; padding: 0 12px; font-size: 13.5px; letter-spacing: 0; }
  & :is(button.primary, a.btn.primary-link, .btn.primary, .focus-app button.primary) { font-weight: 600; }
  & :is(button.quiet, .btn.quiet) { min-height: 28px; padding: 0 6px; }
  & button.jc-chip { border-radius: 999px; }
  & :is(input, select, textarea) { border-radius: var(--r-s); min-height: 32px; font-size: 14px; }
  & .seg { border-radius: var(--r-m); }
  & .shop-on .seg button { border-radius: var(--r-s); min-height: 26px; font-size: 12.5px; }
  & .chip { border-radius: var(--r-s); }

  /* ---------- containers: engraved hairlines, no float ---------- */
  & :is(.card, .focus-app .card), & :is(.panel, .next, .est, .insp, .hist, .empty, .tinsights, .job-head, .ji-sec, .ji-sum-n, .ji-cust-n, .jobs) {
    border-radius: var(--r-l); box-shadow: 0 0 0 1px var(--hair-strong); }
  & .panel, & .next { padding: 14px 16px; }
  & .panel h2 { font-size: 12.5px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; margin-bottom: 8px; }
  & .panel-row { font-size: 13px; padding: 6px 0; }
  & .next-l { font-size: 11.5px; }
  & .next-t { font-size: 15px; font-weight: 600; }
  & .notice { border-radius: var(--r-m); font-size: 13.5px; }

  /* ---------- Today: readouts (label above, value large and tabular) ---------- */
  & .today-strip { gap: 0; margin-bottom: 20px; border-radius: var(--r-l); box-shadow: 0 0 0 1px var(--hair-strong); background: var(--surface); overflow: hidden; }
  & .shop-on .today-stat { display: flex; flex-direction: column-reverse; align-items: stretch; justify-content: flex-end; gap: 6px; border-radius: 0; box-shadow: none; padding: 12px 16px 14px;
    border-left: 1px solid var(--hair); }
  & .shop-on .today-stat:first-child { border-left: 0; }
  & .shop-on .today-stat[aria-pressed="true"] { box-shadow: inset 0 -3px 0 var(--accent); background: var(--surface-2); }
  & .today-stat-n { font: 700 34px/1 var(--font-num); letter-spacing: 0; text-align: right; }
  & .today-stat[aria-pressed="true"] .today-stat-n { color: var(--accent); }
  & .today-stat.is-alert .today-stat-n { color: var(--red); }
  & .today-stat-l { font-size: 12px; font-weight: 500; margin: 0; }
  & .today-search { border-radius: var(--r-m); min-height: 32px; }
  & .jobs-head { font-size: 11.5px; font-weight: 600; min-height: 30px; }
  & .job-row { min-height: 44px; font-size: 13.5px; }
  & .job-no { font: 700 13.5px/1 var(--font-num); color: var(--ink-2); }
  & .job-cust { font-weight: 600; }
  & :is(.job-amt, .job-when) { font-family: var(--font-num); font-weight: 700; font-size: 13.5px; }
  & .job-amt.is-none { font-family: var(--font); font-weight: 400; font-size: 12.5px; }

  /* stage pill -> telltale lamp: a small lit square, the label beside it, no capsule */
  & .stage { background: transparent; padding: 0; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink); border-radius: 0; }
  & .stage::before { width: 9px; height: 9px; border-radius: 2px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--lamp-off); }
  & .stage.s-quote { background: transparent; color: var(--ink-2); } & .stage.s-quote::before { background: transparent; }
  & .stage.s-scheduled { background: transparent; } & .stage.s-scheduled::before { background: #6b5bd2; box-shadow: 0 0 0 3px rgba(107, 91, 210, 0.18); }
  & .stage.s-inshop { background: transparent; } & .stage.s-inshop::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 8px var(--accent-soft); }
  & .stage.s-attention { background: transparent; } & .stage.s-attention::before { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
  & .stage.s-done { background: transparent; } & .stage.s-done::before { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

  /* ---------- job workspace ---------- */
  & .job-head { padding: 18px 20px 0; }
  & .job-who h1 { font: 600 26px/1.15 var(--font-display); letter-spacing: -0.016em; }
  & .job-meta { font-size: 13px; gap: 4px 16px; }
  & .job-facts { gap: 0; padding: 12px 0; }
  & .job-fact { padding: 0 18px; border-left: 1px solid var(--hair); min-width: 0; }
  & .job-fact:first-child { padding-left: 0; border-left: 0; }
  & .job-fact-l { font-size: 11.5px; }
  & .job-fact-v { font: 700 16px/1.25 var(--font-num); margin-top: 3px; }
  & .job-fact-v.is-none { font-family: var(--font); font-weight: 400; font-size: 13px; }
  /* progress track -> measuring scale: a major tick per stage, minor ticks between, a pointer on where the car is now */
  & .track { margin: 8px 0 2px; }
  & .track-step { font-size: 11.5px; padding-top: 17px; }
  & .track-step::before { top: 0; right: 0; left: 0; height: 9px; border-radius: 0;
    background:
      linear-gradient(var(--tick), var(--tick)) left top / 1.5px 100% no-repeat,
      repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 20%) 0 100% / 100% 4px no-repeat,
      linear-gradient(var(--hair-strong), var(--hair-strong)) left bottom / 100% 1px no-repeat; }
  & .track-step.is-done::before { background:
      linear-gradient(var(--accent), var(--accent)) left top / 1.5px 100% no-repeat,
      repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 20%) 0 100% / 100% 4px no-repeat,
      linear-gradient(var(--accent), var(--accent)) left bottom / 100% 3px no-repeat; }
  & .track-step.is-now { color: var(--accent); font-weight: 700; }
  & .track-step.is-now::before { background:
      linear-gradient(var(--accent), var(--accent)) left top / 2px 100% no-repeat,
      repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 20%) 0 100% / 100% 4px no-repeat,
      linear-gradient(var(--hair-strong), var(--hair-strong)) left bottom / 100% 1px no-repeat; }
  & .track-step.is-now::after { content: ""; position: absolute; left: -5px; top: -7px; border: 6px solid transparent; border-top-color: var(--accent); border-bottom: 0; }
  & .job-tab { font-size: 13.5px; padding: 10px 10px 11px; }
  & .job-tab[aria-current="page"] { border-bottom-color: var(--accent); }
  & .job-body { gap: 16px; }
  & .job-aside { gap: 10px; }

  /* estimate + inspection: readout numbers */
  & .est-top h2 { font-size: 15px; }
  & .svc-name { font-size: 14px; font-weight: 600; }
  & .svc-total { font-family: var(--font-num); font-weight: 700; }
  & .lines td { font-size: 13px; }
  & :is(.lines .l-qty, .lines .l-unit, .lines .l-amt) { font-family: var(--font-num); }
  & .lines .l-amt { font-weight: 700; }
  & .est-sum { font-size: 13px; }
  & .est-sum .v { font-family: var(--font-num); font-weight: 700; }
  & .est-sum .total { font: 700 24px/1.1 var(--font-num); letter-spacing: 0; }
  & .ji { gap: 10px; }
  & .ji-head h2 { font-size: 18px; }
  & .ji-sum { gap: 0; border-radius: var(--r-l); box-shadow: 0 0 0 1px var(--hair-strong); background: var(--surface); overflow: hidden; }
  & .ji-sum-n { box-shadow: none; border-radius: 0; border-left: 1px solid var(--hair); }
  & .ji-sum-n:first-child { border-left: 0; }
  & :is(.ji-sum-n strong, .ji-cust-n strong) { font: 700 28px/1 var(--font-num); }
  & .ji-sum-bar { border-radius: 0; height: 3px; }
  & .ji-pos { border-radius: var(--r-m); box-shadow: 0 0 0 1px var(--hair); }
  & .ji .ji-num { font: 700 26px/1 var(--font-num); }
  & .ji-modes { border-radius: var(--r-m); }
  & .ji .ji-mode { border-radius: var(--r-s); min-height: 30px; }
  & .ji .ji-segb { border-radius: var(--r-s); }
  & .ji-cam { border-radius: var(--r-m); }
  & .ji-dot::before { border-radius: 2px; width: 9px; height: 9px; }
  & .hist li { font-size: 13px; padding: 8px 16px; }

  /* ---------- phone tab bar ---------- */
  & .shop-tab[aria-current="page"] { box-shadow: inset 0 2px 0 var(--accent); }

  /* ---------- customer approval page (/c/<token>) ---------- */
  & .c-main { font-family: var(--font); font-variant-numeric: tabular-nums; }
  & .c-hero h1 { font: 600 26px/1.15 var(--font-display); letter-spacing: -0.016em; }
  & .c-card { border-radius: var(--r-l); box-shadow: 0 0 0 1px var(--hair-strong); }
  & .c-card h2 { font-size: 16px; }
  & .c-dot { border-radius: 2px; }
  & :is(.c-choice, .c-btn, .c-zoom-x) { border-radius: var(--r-m); }
  & :is(.c-item-price, .c-r-amt) { font-family: var(--font-num); font-weight: 700; }
  & .c-total-v { font: 700 30px/1 var(--font-num); letter-spacing: 0; }
  & .c-sign input { border-radius: var(--r-m); border-color: var(--hair-strong); }
}

@media (min-width: 641px) {
  :where(:root[data-theme="instrument"]) {
    & .est-top { padding: 12px 16px; }
    & .svc-head { padding: 12px 16px 4px; }
    & .lines td { padding-top: 5px; padding-bottom: 5px; }
    & .lines td:first-child { padding-left: 16px; }
    & .est-sum { padding: 12px 16px 14px; }
  }
}
@media (max-width: 860px) {
  :where(:root[data-theme="instrument"]) {
    & .shop-on .today-stat:nth-child(3) { border-left: 0; }
    & .shop-on .today-stat:nth-child(n+3) { border-top: 1px solid var(--hair); }
  }
}
@media (max-width: 640px) {
  :where(:root[data-theme="instrument"]) {
    & .track-step { font-size: 0; }
    & .track-step.is-now { font-size: 11.5px; }
    & .job-facts { gap: 10px 0; }
    & .job-fact, & .job-fact:first-child { padding: 0 12px 0 0; border-left: 0; }
    & .ji-sum-n { padding: 10px 12px; }
  }
}

/* sidebar: compact, the current item marked by a lit edge — unless the company brand's dark sidebar is shown */
:root[data-theme="instrument"]:is(:not([data-brand-side="dark"]), [data-look-brand="off"]) {
  & .shop-side { background: var(--side); padding: 16px 10px 12px; -webkit-backdrop-filter: none; backdrop-filter: none; }
  & .shop-side .shop-brand-mark:not(.has-logo) { border-radius: var(--r-s); }
  & .shop-side .shop-brand-name { font-size: 14px; color: var(--ink); }
  & .shop-side .shop-nav-label { font-size: 11px; color: var(--ink-3); }
  & .shop-side .shop-nav-item { border-radius: var(--r-s); padding: 6px 10px; font-size: 13.5px; color: var(--ink); }
  & .shop-side .shop-nav-item svg { width: 16px; height: 16px; }
  & .shop-side .shop-nav-item[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600;
    box-shadow: inset 2px 0 0 var(--accent), 0 0 0 1px var(--hair); }
  & .shop-side .shop-nav-item[aria-current="page"] svg { color: var(--accent); }
  & .shop-side .shop-side-foot button { color: var(--accent); }
  & .shop-side :is(.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="instrument"] {
  font-variant-numeric: tabular-nums;
  & .lk-title { font-size: 16px; font-weight: 600; }
  & .lk-nav.is-current { background: var(--surface); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent), 0 0 0 1px var(--hair); border-radius: 2px; }
  & .lk-tiles { gap: 0; box-shadow: 0 0 0 1px var(--hair-strong); border-radius: 4px; background: var(--surface); }
  & .lk-tile { flex-direction: column-reverse; box-shadow: none; border-radius: 0; border-left: 1px solid var(--hair); }
  & .lk-tile:first-child { border-left: 0; }
  & .lk-tile.is-on { box-shadow: inset 0 -2px 0 var(--accent); }
  & .lk-tile.is-on b { color: var(--accent); }
  & .lk-tile b { font: 700 22px/1 var(--font-num); text-align: right; }
  & .lk-row { border-radius: 4px; box-shadow: 0 0 0 1px var(--hair-strong); }
  & .lk-amt { font-family: var(--font-num); font-weight: 700; }
  & .lk-pill { background: transparent; padding: 0 0 0 13px; position: relative; border-radius: 0; }
  & .lk-pill::before { content: ""; position: absolute; left: 0; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 1.5px; background: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft); }
  & .lk-track { gap: 0; }
  & .lk-track span { height: 7px; border-radius: 0; background:
      linear-gradient(var(--tick), var(--tick)) left top / 1px 100% no-repeat,
      linear-gradient(var(--hair-strong), var(--hair-strong)) left bottom / 100% 1px no-repeat; }
  & .lk-track .is-done { background:
      linear-gradient(var(--accent), var(--accent)) left top / 1px 100% no-repeat,
      linear-gradient(var(--accent), var(--accent)) left bottom / 100% 2px no-repeat; }
  & .lk-track .is-now { position: relative; background: linear-gradient(var(--accent), var(--accent)) left top / 2px 100% no-repeat,
      linear-gradient(var(--hair-strong), var(--hair-strong)) left bottom / 100% 1px no-repeat; }
  & .lk-track .is-now::after { content: ""; position: absolute; left: -4px; top: -6px; border: 5px solid transparent; border-top-color: var(--accent); border-bottom: 0; }
  & .lk-btn { border-radius: 4px; }
}
