/* <nv-wiz-mini> — Wizard: a made-up miniature of a dispatcher's ELD portal (drivers with duty status, one driver's log for
   today, the trucks). Markup and behaviour: wiz-mini.js (header). Colours are token names only.
   Size: height follows the element's width only (container query on the element): < 560 px one column (drivers, log,
   trucks), ≥ 560 px drivers on the left (the list takes the column's height), log and trucks on the right.
   The lists hold four rows (the markers are a quarter of a list high). Nothing moves but opacity and transform. */
nv-wiz-mini { display: block; min-width: 0; container-type: inline-size; color: var(--nv-ink); font-family: var(--nv-font, system-ui, sans-serif); line-height: 1.25; }
nv-wiz-mini *, nv-wiz-mini *::before, nv-wiz-mini *::after { box-sizing: border-box; }
nv-wiz-mini p, nv-wiz-mini ol { margin: 0; }

nv-wiz-mini .nvw-win { position: relative; overflow: hidden; border-radius: var(--nv-r-sm, 14px); background: var(--nv-box); font-size: 12.5px; line-height: 1.25; box-shadow: 0 28px 70px -34px color-mix(in srgb, var(--nv-wiz) 50%, transparent); }
nv-wiz-mini .nvw-win::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--nv-line-2); pointer-events: none; }

/* the window's bar: the three sections of the portal and its search */
nv-wiz-mini .nvw-bar { display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 12px; background: var(--nv-tile); border-bottom: 1px solid var(--nv-line); white-space: nowrap; }
nv-wiz-mini .nvw-dots { display: flex; gap: 5px; }
nv-wiz-mini .nvw-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--nv-line-2); }
nv-wiz-mini .nvw-tabs { display: flex; gap: 14px; color: var(--nv-muted); font-weight: 600; }
nv-wiz-mini .nvw-tabs b { position: relative; color: var(--nv-ink); font-weight: 650; }
nv-wiz-mini .nvw-tabs b::after { content: ""; position: absolute; left: 0; right: 0; bottom: -13px; height: 2px; border-radius: 2px; background: var(--nv-wiz); }
nv-wiz-mini .nvw-find { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; color: var(--nv-muted); font-size: 11.5px; background: var(--nv-box); box-shadow: inset 0 0 0 1px var(--nv-line); }

nv-wiz-mini .nvw-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 10px; }
nv-wiz-mini .nvw-log { display: grid; gap: 10px; min-width: 0; align-content: start; }

/* lists: the drivers and the trucks; the chosen row is marked by one layer that slides (transform) */
nv-wiz-mini .nvw-drivers, nv-wiz-mini .nvw-trucks { --rh: 32px; position: relative; isolation: isolate; list-style: none; padding: 0; overflow: hidden; border-radius: 10px; background: var(--nv-tile); box-shadow: inset 0 0 0 1px var(--nv-line); }
nv-wiz-mini .nvw-trucks { --rh: 27px; }
nv-wiz-mini .nvw-drivers::before, nv-wiz-mini .nvw-trucks::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: 25%; background: color-mix(in srgb, var(--nv-wiz) 15%, transparent); box-shadow: inset 3px 0 0 var(--nv-wiz); transform: translateY(calc(var(--i, 0) * 100%)); transition: transform 0.45s var(--nv-ease, ease); }
nv-wiz-mini .nvw-drivers, nv-wiz-mini .nvw-trucks { display: grid; grid-template-rows: repeat(4, minmax(var(--rh), 1fr)); }
nv-wiz-mini .nvw-drivers li, nv-wiz-mini .nvw-trucks li { display: grid; align-items: center; gap: 8px; min-height: var(--rh); padding: 0 10px 0 13px; border-top: 1px solid var(--nv-line); white-space: nowrap; }
nv-wiz-mini .nvw-drivers li:first-child, nv-wiz-mini .nvw-trucks li:first-child { border-top: 0; }
nv-wiz-mini .nvw-drivers li { grid-template-columns: 8px minmax(0, 1fr) auto; }
nv-wiz-mini .nvw-drivers i { width: 8px; height: 8px; border-radius: 50%; }
nv-wiz-mini .nvw-nm { min-width: 0; }
nv-wiz-mini .nvw-nm b { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 650; }
nv-wiz-mini .nvw-nm small { display: none; color: var(--nv-muted); font-size: 11.5px; }
nv-wiz-mini .nvw-st { padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 620; }
nv-wiz-mini .nvw-trucks li { grid-template-columns: 2.6em 4.6em minmax(0, 1fr); font-size: 12px; }
nv-wiz-mini .nvw-trucks b { font-family: var(--nv-mono, ui-monospace, monospace); font-weight: 650; }
nv-wiz-mini .nvw-ts { color: var(--nv-muted); }
nv-wiz-mini .nvw-ts.is-moving { color: var(--nv-ink); font-weight: 600; }
nv-wiz-mini .nvw-pl { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--nv-muted); }

/* duty status: one colour each, the label stays in ink */
nv-wiz-mini .s-d, nv-wiz-mini .b-d { background: var(--nv-ok); fill: var(--nv-ok); }
nv-wiz-mini .s-on, nv-wiz-mini .b-on { background: var(--nv-warn); fill: var(--nv-warn); }
nv-wiz-mini .s-sb, nv-wiz-mini .b-sb { background: var(--nv-info); fill: var(--nv-info); }
nv-wiz-mini .s-off, nv-wiz-mini .b-off { background: var(--nv-dim); fill: var(--nv-dim); }
nv-wiz-mini .nvw-st.s-d { background: color-mix(in srgb, var(--nv-ok) 20%, transparent); }
nv-wiz-mini .nvw-st.s-on { background: color-mix(in srgb, var(--nv-warn) 22%, transparent); }
nv-wiz-mini .nvw-st.s-sb { background: color-mix(in srgb, var(--nv-info) 20%, transparent); }
nv-wiz-mini .nvw-st.s-off { background: color-mix(in srgb, var(--nv-dim) 20%, transparent); }

/* the chosen driver: name, truck and the three clocks; every driver's line is there, one is shown (opacity) */
nv-wiz-mini .nvw-who { display: grid; }
nv-wiz-mini .nvw-who > p { grid-area: 1 / 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; opacity: 0; transition: opacity 0.35s var(--nv-ease, ease); }
nv-wiz-mini .nvw-who > p.is-on { opacity: 1; }
nv-wiz-mini .nvw-who b { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
nv-wiz-mini .nvw-who span { display: flex; gap: 5px; margin-left: auto; }
nv-wiz-mini .nvw-who em { padding: 3px 7px; border-radius: 99px; font-style: normal; font-family: var(--nv-mono, ui-monospace, monospace); font-size: 11px; white-space: nowrap; color: var(--nv-muted); background: var(--nv-tile); box-shadow: inset 0 0 0 1px var(--nv-line); }
nv-wiz-mini .nvw-who em:first-child { color: var(--nv-ink); box-shadow: inset 0 0 0 1px var(--nv-wiz); }

/* the day's log: hours on top, the four duty rows on the left, the plot stretched to the width */
nv-wiz-mini .nvw-chart { display: grid; grid-template-columns: 26px minmax(0, 1fr); grid-template-rows: 15px auto; column-gap: 6px; font-family: var(--nv-mono, ui-monospace, monospace); font-size: 10px; color: var(--nv-muted); }
nv-wiz-mini .nvw-hrs { grid-column: 2; position: relative; }
nv-wiz-mini .nvw-hrs span { position: absolute; top: 0; transform: translateX(-50%); }
nv-wiz-mini .nvw-hrs span:nth-child(1) { left: 0; transform: none; }
nv-wiz-mini .nvw-hrs span:nth-child(2) { left: 25%; }
nv-wiz-mini .nvw-hrs span:nth-child(3) { left: 50%; }
nv-wiz-mini .nvw-hrs span:nth-child(4) { left: 75%; }
nv-wiz-mini .nvw-hrs span:nth-child(5) { left: 100%; transform: translateX(-100%); }
nv-wiz-mini .nvw-rws { grid-row: 2; display: grid; grid-template-rows: repeat(4, 1fr); align-items: center; }
nv-wiz-mini .nvw-plot { grid-row: 2; grid-column: 2; display: block; width: 100%; height: 80px; overflow: hidden; border-radius: 6px; background: var(--nv-tile); }
nv-wiz-mini .nvw-plot line { vector-effect: non-scaling-stroke; fill: none; }
nv-wiz-mini .nvw-plot .g1 { stroke: var(--nv-line); stroke-width: 1; }
nv-wiz-mini .nvw-plot .g6 { stroke: var(--nv-line-2); stroke-width: 1; }
nv-wiz-mini .nvw-plot .nvw-later { fill: color-mix(in srgb, var(--nv-line) 55%, transparent); }
nv-wiz-mini .nvw-plot .nvw-now { stroke: var(--nv-wiz); stroke-width: 1.5; stroke-dasharray: 3 3; }
nv-wiz-mini .nvw-day { opacity: 0; transition: opacity 0.3s var(--nv-ease, ease); }
nv-wiz-mini .nvw-day.is-on { opacity: 1; }
nv-wiz-mini .nvw-day line { stroke: var(--nv-muted); stroke-width: 1.4; }
nv-wiz-mini .nvw-day rect { transform-box: fill-box; transform-origin: 0 50%; }
/* the chosen driver's day draws itself left to right, piece by piece (only while the demo runs) */
nv-wiz-mini.is-live .nvw-day.is-on > rect { animation: nvw-grow 0.42s var(--nv-ease, ease) both; animation-delay: calc(var(--k, 0) * 55ms); }
nv-wiz-mini.is-live .nvw-day.is-on > line { animation: nvw-fade 0.3s var(--nv-ease, ease) both; animation-delay: calc(var(--k, 0) * 55ms); }
@keyframes nvw-grow { from { opacity: 0; transform: scaleX(0); } to { opacity: 1; transform: none; } }
@keyframes nvw-fade { from { opacity: 0; } to { opacity: 1; } }

nv-wiz-mini .nvw-note { margin-top: 8px; padding-left: 2px; color: var(--nv-muted); font-size: 12px; }

@container (min-width: 560px) {
  nv-wiz-mini .nvw-body { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 14px; padding: 14px; }
  nv-wiz-mini .nvw-trucks { align-self: start; }
  nv-wiz-mini .nvw-drivers { --rh: 46px; }
  nv-wiz-mini .nvw-trucks { --rh: 28px; }
  nv-wiz-mini .nvw-nm small { display: block; margin-top: 2px; }
  nv-wiz-mini .nvw-plot { height: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  nv-wiz-mini .nvw-drivers::before, nv-wiz-mini .nvw-trucks::before, nv-wiz-mini .nvw-who > p, nv-wiz-mini .nvw-day { transition: none; }
  nv-wiz-mini .nvw-day > rect, nv-wiz-mini .nvw-day > line { animation: none !important; }
}

/* phones: no label under 11 px */
@media (max-width: 640px) {
  nv-wiz-mini .nvw-chart { font-size: 11px; }
}
