/* LuzAmiga components for the web: the dashboard, the public download and invite pages, the style guide.
   Load tokens.css first. Component classes start with lz- so this file can sit next to the dashboard's
   current app.css while pages move over one at a time.

   Density: the default is the dashboard (pointer, 14 px body, 36 px controls). Put data-density="touch"
   on a subtree for phone-sized UI (16 px body, 56 px primary controls). */

/* ---------- root ---------- */

.lz {
  --control-h: var(--size-control-pointer);
  --control-h-s: var(--size-control-pointer-s);
  --control-px: var(--space-3);
  --control-radius: var(--radius-sm);
  --control-font-size: var(--type-label-size);
  --control-line: var(--type-label-line);
  --card-radius: var(--radius-md);
  --body-size: var(--type-body-s-size);
  --body-line: var(--type-body-s-line);

  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--body-size);
  line-height: var(--body-line);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

[data-density="touch"] {
  --control-h: var(--size-control-touch);
  --control-h-s: var(--size-control-touch-s);
  --control-px: var(--space-6);
  --control-radius: var(--radius-md);
  --control-font-size: var(--type-label-l-size);
  --control-line: var(--type-label-l-line);
  --card-radius: var(--radius-lg);
  --body-size: var(--type-body-size);
  --body-line: var(--type-body-line);
  font-size: var(--body-size);
  line-height: var(--body-line);
}

.lz *, .lz *::before, .lz *::after { box-sizing: border-box; }

/* Element defaults. :where() gives them the weight of the bare element, so any component class
   wins over them: an <a class="lz-button"> keeps the button's colors, an <h2 class="lz-nav__group">
   the group's type. */
:where(.lz) :is(h1, h2, h3, h4) { margin: 0; text-wrap: balance; }
:where(.lz) h1 { font: var(--type-title-l-weight) var(--type-title-l-size)/var(--type-title-l-line) var(--font-sans); }
:where(.lz) h2 { font: var(--type-title-m-weight) var(--type-title-m-size)/var(--type-title-m-line) var(--font-sans); }
:where(.lz) h3 { font: var(--type-title-s-weight) var(--type-title-s-size)/var(--type-title-s-line) var(--font-sans); }
:where(.lz) h4 { font: var(--type-label-weight) var(--type-label-size)/var(--type-label-line) var(--font-sans); }
:where(.lz) p { margin: 0; text-wrap: pretty; max-width: 72ch; }

:where(.lz) a { color: var(--text-link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
@media (hover: hover) { :where(.lz) a:hover { text-decoration-thickness: 2px; } }

/* Focus: a dark ring that separates the control from a light surface, then the gold light around it. */
.lz :focus-visible {
  outline: 3px solid var(--focus-outer);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--focus-inner);
}

.lz ::selection { background: var(--lampara-200); color: var(--noche-900); }

/* ---------- type roles ---------- */

.lz-t-figure-xl { font: var(--type-figure-xl-weight) var(--type-figure-xl-size)/var(--type-figure-xl-line) var(--font-sans); letter-spacing: var(--type-figure-xl-tracking); font-variant-numeric: tabular-nums; }
.lz-t-figure-l  { font: var(--type-figure-l-weight) var(--type-figure-l-size)/var(--type-figure-l-line) var(--font-sans); letter-spacing: var(--type-figure-l-tracking); font-variant-numeric: tabular-nums; }
.lz-t-figure-m  { font: var(--type-figure-m-weight) var(--type-figure-m-size)/var(--type-figure-m-line) var(--font-sans); font-variant-numeric: tabular-nums; }
.lz-t-title-l   { font: var(--type-title-l-weight) var(--type-title-l-size)/var(--type-title-l-line) var(--font-sans); }
.lz-t-title-m   { font: var(--type-title-m-weight) var(--type-title-m-size)/var(--type-title-m-line) var(--font-sans); }
.lz-t-title-s   { font: var(--type-title-s-weight) var(--type-title-s-size)/var(--type-title-s-line) var(--font-sans); }
.lz-t-body-l    { font: var(--type-body-l-weight) var(--type-body-l-size)/var(--type-body-l-line) var(--font-sans); }
.lz-t-body      { font: var(--type-body-weight) var(--type-body-size)/var(--type-body-line) var(--font-sans); }
.lz-t-body-s    { font: var(--type-body-s-weight) var(--type-body-s-size)/var(--type-body-s-line) var(--font-sans); }
.lz-t-label-l   { font: var(--type-label-l-weight) var(--type-label-l-size)/var(--type-label-l-line) var(--font-sans); }
.lz-t-label     { font: var(--type-label-weight) var(--type-label-size)/var(--type-label-line) var(--font-sans); }
.lz-t-label-s   { font: var(--type-label-s-weight) var(--type-label-s-size)/var(--type-label-s-line) var(--font-sans); letter-spacing: var(--type-label-s-tracking); }
.lz-t-caption   { font: var(--type-caption-weight) var(--type-caption-size)/var(--type-caption-line) var(--font-sans); letter-spacing: var(--type-caption-tracking); }
.lz-t-code      { font: var(--type-code-weight) var(--type-code-size)/var(--type-code-line) var(--font-mono); letter-spacing: var(--type-code-tracking); }
.lz-secondary   { color: var(--text-secondary); }
.lz-num         { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */

.lz-button {
  --_bg: transparent;
  --_fg: var(--action-secondary-fg);
  --_edge: var(--action-secondary-edge);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  padding: 0 var(--control-px);
  border: 1px solid var(--_edge);
  border-radius: var(--control-radius);
  background: var(--_bg);
  color: var(--_fg);
  font: var(--type-label-weight) var(--control-font-size)/var(--control-line) var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition-property: background-color, border-color, color, scale;
  transition-duration: var(--duration-instant), var(--duration-instant), var(--duration-instant), var(--duration-quick);
  transition-timing-function: var(--easing-standard);
}
.lz-button svg { width: var(--size-icon); height: var(--size-icon); flex: none; }
.lz-button:active { scale: var(--press-scale); }

.lz-button--primary { --_bg: var(--action-primary-bg); --_fg: var(--action-primary-fg); --_edge: var(--action-primary-edge); }
.lz-button--quiet   { --_edge: transparent; }
.lz-button--danger  { --_fg: var(--action-danger-ink); --_edge: var(--action-danger-ink); }
.lz-button--block   { width: 100%; }
/* On a phone only the primary action is 56 dp; the others are 48 dp. */
[data-density="touch"] .lz-button:not(.lz-button--primary) { min-height: var(--control-h-s); }
.lz-button--s { min-height: var(--control-h-s); padding: 0 var(--space-3); font-size: var(--type-label-size); line-height: var(--type-label-line); }
/* A small button keeps a 40 px target: the hit area grows past the visible edge. */
.lz-button--s::after { content: ""; position: absolute; inset: calc((var(--size-target-pointer) - 100%) / -2) 0; min-height: var(--size-target-pointer); }

@media (hover: hover) {
  .lz-button:hover { background: var(--action-secondary-bg-hover); border-color: var(--action-secondary-edge-hover); }
  .lz-button--primary:hover { background: var(--action-primary-bg-hover); border-color: var(--action-primary-edge); }
  .lz-button--quiet:hover { background: var(--bg-subtle); border-color: transparent; }
  .lz-button--danger:hover { background: var(--action-danger-bg); border-color: var(--action-danger-bg); color: var(--action-danger-fg); }
}

.lz-button:disabled,
.lz-button[aria-disabled="true"] {
  background: var(--bg-subtle);
  border-color: var(--border-default);
  color: var(--text-disabled);
  cursor: not-allowed;
  scale: 1;
}

/* ---------- status signs ---------- */
/* <svg class="lz-sign" data-status="ok"><use href="#sign-ok"/></svg>. The symbols read the variables below. */

.lz-sign {
  --sign-size: var(--size-sign);
  width: var(--sign-size);
  height: var(--sign-size);
  flex: none;
  vertical-align: middle;
  overflow: visible;
}
.lz-sign--s  { --sign-size: var(--size-sign-s); }
.lz-sign--l  { --sign-size: var(--size-sign-l); }
.lz-sign--xl { --sign-size: var(--size-sign-xl); }
.lz-sign[data-status="ok"],
.lz-sign[data-status="confirmed"] { --sign-fill: var(--status-ok-fill); --sign-glyph: var(--status-ok-glyph); --sign-edge: var(--status-ok-edge); }
.lz-sign[data-status="warn"]      { --sign-fill: var(--status-warn-fill); --sign-glyph: var(--status-warn-glyph); --sign-edge: var(--status-warn-edge); }
.lz-sign[data-status="stop"]      { --sign-fill: var(--status-stop-fill); --sign-glyph: var(--status-stop-glyph); --sign-edge: var(--status-stop-edge); }
.lz-sign[data-status="info"]      { --sign-fill: var(--status-info-fill); --sign-glyph: var(--status-info-glyph); --sign-edge: var(--status-info-edge); }
.lz-sign[data-status="off"],
.lz-sign[data-status="paused"],
.lz-sign[data-status="skipped"]   { --sign-fill: var(--status-off-fill); --sign-glyph: var(--status-off-glyph); --sign-edge: var(--status-off-edge); }
.lz-sign[data-status="live"]      { --sign-fill: var(--status-live-fill); --sign-glyph: var(--status-live-glyph); --sign-edge: var(--status-live-edge); }

/* A state in running text: the sign, then its words. The words carry the meaning. */
.lz-state { display: inline-flex; align-items: center; gap: var(--space-2); }
.lz-state[data-status="warn"] { color: var(--status-warn-ink); font-weight: 600; }
.lz-state[data-status="stop"] { color: var(--status-stop-ink); font-weight: 600; }

/* ---------- plate (device and invite codes) ---------- */

.lz-plate {
  --plate-band: 3px;
  display: inline-block;
  padding: calc(var(--plate-band) + 1px) calc(var(--space-2) - var(--type-code-tracking)) 1px var(--space-2);
  border: 2px solid var(--text-primary);
  border-radius: var(--radius-sm);
  background: linear-gradient(var(--action-primary-bg), var(--action-primary-bg)) top / 100% var(--plate-band) no-repeat, var(--bg-surface);
  color: var(--text-primary);
  font: var(--type-code-weight) var(--type-code-size)/var(--type-code-line) var(--font-mono);
  letter-spacing: var(--type-code-tracking);
  font-variant-numeric: tabular-nums slashed-zero;
  text-decoration: none;
  white-space: nowrap;
}
.lz a.lz-plate { color: var(--text-primary); }
@media (hover: hover) { .lz a.lz-plate:hover { background-color: var(--bg-selected); } }
.lz-plate--m {
  --plate-band: 4px;
  padding: calc(var(--plate-band) + 2px) calc(var(--space-3) - var(--type-code-tracking)) 2px var(--space-3);
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
}
.lz-plate--l {
  --plate-band: 6px;
  padding: calc(var(--plate-band) + var(--space-2)) calc(var(--space-4) - var(--type-code-l-tracking)) var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font: var(--type-code-l-weight) var(--type-code-l-size)/var(--type-code-l-line) var(--font-mono);
  letter-spacing: var(--type-code-l-tracking);
}

/* ---------- platforms ---------- */

.lz-platform { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 600; white-space: nowrap; }
.lz-platform::before {
  content: "";
  flex: none;
  width: 0.75em;
  height: 0.75em;
  border-radius: 3px;
  background: var(--_platform);
  box-shadow: inset 0 0 0 1px var(--elevation-outline);
}
[data-platform="didi"]    { --_platform: var(--platform-didi); }
[data-platform="cabify"]  { --_platform: var(--platform-cabify); }
[data-platform="indrive"] { --_platform: var(--platform-indrive); }
[data-platform="uber"]    { --_platform: var(--platform-uber); }
[data-platform="yango"]   { --_platform: var(--platform-yango); }

/* ---------- badge ---------- */

.lz-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 1px var(--space-2);
  border-radius: var(--radius-full);
  background: var(--_wash, var(--bg-subtle));
  color: var(--_ink, var(--text-secondary));
  box-shadow: inset 0 0 0 1px var(--_edge, var(--border-default));
  font: var(--type-label-s-weight) var(--type-label-s-size)/var(--type-label-s-line) var(--font-sans);
  letter-spacing: var(--type-label-s-tracking);
  white-space: nowrap;
}
.lz-badge .lz-sign { --sign-size: 14px; }
.lz-badge[data-tone="ok"]   { --_wash: var(--status-ok-wash);   --_ink: var(--status-ok-ink);   --_edge: color-mix(in srgb, var(--status-ok-ink) 30%, transparent); }
.lz-badge[data-tone="warn"] { --_wash: var(--status-warn-wash); --_ink: var(--status-warn-ink); --_edge: color-mix(in srgb, var(--status-warn-ink) 30%, transparent); }
.lz-badge[data-tone="stop"] { --_wash: var(--status-stop-wash); --_ink: var(--status-stop-ink); --_edge: color-mix(in srgb, var(--status-stop-ink) 30%, transparent); }
.lz-badge[data-tone="info"] { --_wash: var(--status-info-wash); --_ink: var(--status-info-ink); --_edge: color-mix(in srgb, var(--status-info-ink) 30%, transparent); }
.lz-badge[data-tone="lit"]  { --_wash: var(--action-primary-bg); --_ink: var(--action-primary-fg); --_edge: var(--action-primary-edge); }

/* ---------- surfaces ---------- */

.lz-card {
  background: var(--bg-surface);
  border-radius: var(--card-radius);
  box-shadow: var(--elevation-e1);
  padding: var(--space-4);
}
.lz-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
}

/* ---------- stats ---------- */

/* Spans, or a <dl> whose groups are the stats: <div class="lz-stat"><dt>, then <dd>s. */
.lz-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  margin: 0;
  background: var(--bg-surface);
  border-top: 2px solid var(--text-primary);
  border-bottom: 1px solid var(--border-default);
}
.lz-stat { display: grid; align-content: start; gap: var(--space-1); padding: var(--space-3) var(--space-4) var(--space-4); }
.lz-stat > dd { margin: 0; }
.lz-stats > .lz-stat + .lz-stat { box-shadow: inset 1px 0 0 var(--border-default); }
.lz-stat__label { color: var(--text-secondary); font: var(--type-label-weight) var(--type-label-size)/var(--type-label-line) var(--font-sans); }
.lz-stat__value {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font: var(--type-figure-l-weight) var(--type-figure-l-size)/var(--type-figure-l-line) var(--font-sans);
  letter-spacing: var(--type-figure-l-tracking);
  font-variant-numeric: tabular-nums;
}
.lz-stat__unit { font: var(--type-title-s-weight) var(--type-title-s-size)/var(--type-title-s-line) var(--font-sans); color: var(--text-secondary); }
.lz-stat__note { color: var(--text-secondary); font: var(--type-caption-weight) var(--type-caption-size)/var(--type-caption-line) var(--font-sans); }
[data-density="touch"] .lz-stat__value { font-size: var(--type-figure-m-size); line-height: var(--type-figure-m-line); }

/* ---------- checklist (onboarding steps, Health) ---------- */

.lz-checklist { list-style: none; margin: 0; padding: 0; }
.lz-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.lz-check:last-child { border-bottom: 0; }
.lz-check__title { font-weight: 600; }
.lz-check__detail { display: block; color: var(--text-secondary); font-size: var(--type-body-s-size); line-height: var(--type-body-s-line); }
.lz-check[data-status="stop"] .lz-check__detail { color: var(--status-stop-ink); }
.lz-check[data-status="warn"] .lz-check__detail { color: var(--status-warn-ink); }

/* ---------- lamps: valid days ---------- */

.lz-lamps { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.lz-lamp {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--status-off-edge);
}
.lz-lamp[data-state="lit"] { background: var(--status-live-fill); box-shadow: inset 0 0 0 1.5px var(--status-live-edge); }
.lz-lamp[data-state="today"] { box-shadow: inset 0 0 0 2px var(--status-live-fill); }

/* ---------- step track: where you are in onboarding ---------- */

.lz-steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; list-style: none; margin: 0; padding: 0; }
.lz-steps > li { height: 6px; border-radius: var(--radius-full); background: var(--chart-track); }
.lz-steps > li[data-state="done"] { background: var(--text-primary); }
.lz-steps > li[data-state="current"] { background: var(--action-primary-bg); box-shadow: inset 0 0 0 1px var(--action-primary-edge); }

/* ---------- ranking rows (earnings comparison) ---------- */

.lz-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.lz-rank__row { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); column-gap: var(--space-3); row-gap: var(--space-2); align-items: center; }
.lz-rank__pos { grid-row: span 2; align-self: start; color: var(--text-secondary); font: var(--type-label-weight) var(--type-label-size)/var(--type-label-l-line) var(--font-sans); font-variant-numeric: tabular-nums; }
.lz-rank__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.lz-rank__value { font: var(--type-title-s-weight) var(--type-title-s-size)/var(--type-title-s-line) var(--font-sans); font-variant-numeric: tabular-nums; }
.lz-rank__value small { font: var(--type-body-s-weight) var(--type-body-s-size)/var(--type-body-s-line) var(--font-sans); color: var(--text-secondary); }
.lz-rank__bar { grid-column: 2; height: 10px; border-radius: var(--radius-xs); background: var(--chart-track); overflow: hidden; }
.lz-rank__bar > span { display: block; height: 100%; width: var(--value, 0%); background: var(--_platform); border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
.lz-rank__note { grid-column: 2; color: var(--text-secondary); font: var(--type-caption-weight) var(--type-caption-size)/var(--type-caption-line) var(--font-sans); }

/* ---------- notices ---------- */

.lz-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--space-3);
  row-gap: var(--space-2);
  align-items: start;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--_wash, var(--bg-subtle));
  box-shadow: inset 0 0 0 1px var(--_edge, var(--border-default));
}
.lz-notice > .lz-sign { margin-top: 1px; }
.lz-notice__title { font-weight: 700; }
.lz-notice__body { grid-column: 2; }
.lz-notice__actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.lz-notice[data-tone="ok"]   { --_wash: var(--status-ok-wash);   --_edge: color-mix(in srgb, var(--status-ok-ink) 28%, transparent); }
.lz-notice[data-tone="warn"] { --_wash: var(--status-warn-wash); --_edge: color-mix(in srgb, var(--status-warn-ink) 28%, transparent); }
.lz-notice[data-tone="stop"] { --_wash: var(--status-stop-wash); --_edge: color-mix(in srgb, var(--status-stop-ink) 28%, transparent); }
.lz-notice[data-tone="info"] { --_wash: var(--status-info-wash); --_edge: color-mix(in srgb, var(--status-info-ink) 28%, transparent); }
[data-density="touch"] .lz-notice { border-radius: var(--radius-md); padding: var(--space-4); }

/* ---------- fields ---------- */

.lz-field { display: grid; gap: var(--space-1); }
.lz-field__label { font-weight: 600; }
.lz-field__hint { color: var(--text-secondary); font: var(--type-body-s-weight) var(--type-body-s-size)/var(--type-body-s-line) var(--font-sans); }
.lz-field__error { display: flex; align-items: center; gap: var(--space-2); color: var(--status-stop-ink); font-weight: 600; font-size: var(--type-body-s-size); }

.lz-input {
  width: 100%;
  min-height: var(--control-h);
  padding: 0 var(--space-3);
  border: 1px solid var(--border-input);
  border-radius: var(--control-radius);
  background: var(--bg-surface);
  color: var(--text-primary);
  font: inherit;
  transition-property: border-color, box-shadow;
  transition-duration: var(--duration-instant);
}
.lz-input::placeholder { color: var(--text-disabled); }
.lz-input[aria-invalid="true"] { border-color: var(--status-stop-ink); box-shadow: inset 0 0 0 1px var(--status-stop-ink); }
.lz-input--code { font: var(--type-code-weight) var(--type-title-s-size)/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; font-variant-numeric: slashed-zero; }

/* Money: the currency is part of the field, written as the driver apps write it (S/, $, Bs). */
.lz-money {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  padding: 0 var(--space-3);
  border: 1px solid var(--border-input);
  border-radius: var(--control-radius);
  background: var(--bg-surface);
}
.lz-money:focus-within { outline: 3px solid var(--focus-outer); outline-offset: 2px; box-shadow: 0 0 0 2px var(--focus-inner); }
.lz-money__currency { color: var(--text-secondary); font-weight: 600; }
/* The input fills the field's height, so a tap anywhere on the field lands in it. */
.lz-money input { flex: 1; align-self: stretch; min-width: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.lz-money input:focus-visible { outline: none; box-shadow: none; }

/* A select: the text field's frame with its own chevron, drawn from two gradients so it takes
   the theme's colors (a data URI cannot read a variable). appearance: none makes it look the
   same in every browser. */
.lz-select {
  appearance: none;
  padding-right: calc(var(--space-3) + 20px);
  background-image:
    linear-gradient(45deg, transparent calc(50% - 1px), var(--text-secondary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(-45deg, transparent calc(50% - 1px), var(--text-secondary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px));
  background-position: right 18px center, right 12px center;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
  text-overflow: ellipsis;
}
.lz-select:disabled { cursor: not-allowed; color: var(--text-disabled); }

/* Several lines: notes, a message to copy, JSON. */
.lz-textarea {
  display: block;
  min-height: 92px;
  padding: var(--space-2) var(--space-3);
  line-height: var(--type-body-s-line);
  resize: vertical;
}
.lz-textarea--code { font: 500 13px/20px var(--font-mono); font-variant-numeric: slashed-zero; white-space: pre; tab-size: 2; }

/* A tick box and its words. The box is the browser's own, in the text color. Not to be confused
   with .lz-check, a row of the checklist (onboarding steps, Health). */
.lz-checkbox { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 24px; cursor: pointer; }
.lz-checkbox > input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--text-primary); cursor: pointer; }
/* A group of tick boxes in as many columns as fit, each at least --checkbox-col wide. A group with
   long words, such as each app's package name next to its platform, sets a wider column. */
.lz-checkboxes {
  --checkbox-col: 8rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--checkbox-col)), max-content));
  gap: var(--space-2) var(--space-5);
}

/* A group of fields under one name. The legend sits inside the box: floated, it becomes an
   ordinary grid item instead of a gap in the top edge. */
.lz-fieldset { display: grid; gap: var(--space-2); min-width: 0; margin: 0; padding: var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-sm); }
.lz-fieldset > legend { float: left; width: 100%; padding: 0; font-weight: 600; }

/* ---------- facts: label and value pairs ---------- */

.lz-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px var(--space-5); margin: 0; }
.lz-facts > dt { color: var(--text-secondary); }
.lz-facts > dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- table (dashboard) ---------- */

.lz-table-wrap { overflow-x: auto; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-sm); }
.lz-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.lz-table th, .lz-table td { padding: var(--space-2) var(--space-3); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border-subtle); }
.lz-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font: var(--type-label-s-weight) var(--type-label-s-size)/var(--type-label-s-line) var(--font-sans);
  letter-spacing: var(--type-label-s-tracking);
  white-space: nowrap;
  border-bottom-color: var(--border-strong);
}
.lz-table tbody tr:last-child > * { border-bottom: 0; }
.lz-table .lz-num, .lz-table th.lz-num { text-align: right; }
/* Identifiers and times never break mid-token. */
.lz-table a, .lz-nowrap { white-space: nowrap; }
@media (hover: hover) { .lz-table tbody tr:hover { background: var(--bg-hover); } }
.lz-table tbody tr[aria-selected="true"] { background: var(--bg-selected); }
.lz-table tbody tr[aria-selected="true"] > :first-child { box-shadow: inset 3px 0 0 var(--action-primary-bg); }

/* What an edit changes: a table of keys, the value before in the stop ink, the value after in the ok
   ink and bold. The colors repeat what the column heads say, so the words still carry it. */
.lz-diff__key { font: 500 13px/20px var(--font-mono); overflow-wrap: anywhere; }
.lz-diff__was { color: var(--status-stop-ink); overflow-wrap: anywhere; }
.lz-diff__now { color: var(--status-ok-ink); font-weight: 600; overflow-wrap: anywhere; }

/* ---------- navigation: dashboard ---------- */

.lz-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-6);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-night);
  color: var(--text-on-night);
}
.lz-topbar .lz-input { background: var(--noche-850); border-color: var(--noche-600); color: var(--noche-50); }
.lz-topbar .lz-input::placeholder { color: var(--noche-400); }
.lz-topbar .lz-button { --_fg: var(--noche-50); --_edge: var(--noche-600); }
@media (hover: hover) { .lz-topbar .lz-button:hover { background: var(--noche-800); border-color: var(--noche-300); } }

.lz-brand { display: inline-flex; align-items: center; gap: var(--space-2); color: inherit; font: var(--type-title-s-weight) var(--type-title-s-size)/1 var(--font-sans); text-decoration: none; }
.lz .lz-brand { color: inherit; text-decoration: none; }
.lz-brand svg { width: 22px; height: 22px; flex: none; }

.lz-nav { display: grid; gap: 1px; padding: var(--space-2) 0; }
.lz-nav__group { margin: var(--space-4) var(--space-4) var(--space-1); color: var(--text-secondary); font: var(--type-label-s-weight) var(--type-label-s-size)/var(--type-label-s-line) var(--font-sans); }
.lz-nav__group:first-child { margin-top: 0; }
.lz-nav a { display: block; padding: var(--space-1) var(--space-4); color: var(--text-primary); text-decoration: none; box-shadow: inset 3px 0 0 transparent; }
@media (hover: hover) { .lz-nav a:hover { background: var(--bg-hover); } }
.lz-nav a[aria-current="page"] { background: var(--bg-subtle); box-shadow: inset 3px 0 0 var(--action-primary-bg); font-weight: 600; }

/* ---------- navigation: phone ---------- */

.lz-appbar { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 0 var(--space-2) 0 var(--space-4); }
.lz-appbar__title { flex: 1; font: var(--type-title-s-weight) var(--type-title-s-size)/var(--type-title-s-line) var(--font-sans); }
.lz-iconbutton {
  display: inline-grid;
  place-items: center;
  width: var(--size-target-touch);
  height: var(--size-target-touch);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}
.lz-iconbutton svg { width: var(--size-icon-l); height: var(--size-icon-l); }
@media (hover: hover) { .lz-iconbutton:hover { background: var(--bg-subtle); } }

.lz-bottomnav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: var(--space-2) var(--space-1) var(--space-3); background: var(--bg-surface); box-shadow: 0 -1px 0 var(--border-default); }
.lz-bottomnav a { display: grid; justify-items: center; gap: var(--space-1); color: var(--text-secondary); text-decoration: none; font: var(--type-label-s-weight) var(--type-label-s-size)/var(--type-label-s-line) var(--font-sans); }
.lz-bottomnav a > span:first-child { display: grid; place-items: center; width: 56px; height: 32px; border-radius: var(--radius-full); }
.lz-bottomnav svg { width: var(--size-icon-l); height: var(--size-icon-l); }
.lz-bottomnav a[aria-current="page"] { color: var(--text-primary); }
.lz-bottomnav a[aria-current="page"] > span:first-child { background: var(--bg-selected); box-shadow: inset 0 0 0 1px var(--action-primary-edge); }

/* ---------- day lanes (driver detail) ---------- */

.lz-lanes { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); row-gap: var(--space-2); column-gap: var(--space-3); align-items: center; }
.lz-lanes__track { position: relative; height: 18px; border-radius: var(--radius-xs); background: var(--chart-track); }
.lz-lanes__seg {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--from);
  width: var(--len);
  border-radius: 3px;
  background: color-mix(in srgb, var(--_platform) 38%, var(--bg-surface));
}
.lz-lanes__seg[data-kind="screen"] { top: 4px; bottom: 4px; background: var(--_platform); }
.lz-lanes__axis { grid-column: 2; display: flex; justify-content: space-between; color: var(--chart-label); font: var(--type-caption-weight) var(--type-caption-size)/var(--type-caption-line) var(--font-sans); font-variant-numeric: tabular-nums; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .lz-button { transition-property: background-color, border-color, color; }
  .lz-button:active { scale: 1; }
}

/* ---------- forced colors (Windows high contrast) ---------- */

@media (forced-colors: active) {
  .lz-plate { border-color: CanvasText; background: Canvas; }
  .lz-lamp[data-state="lit"] { background: CanvasText; }
  .lz-button--primary { border: 2px solid ButtonText; }
}
