/* The attribute alone loses to main's display: grid. */
main[hidden] { display: none; }
#driver { padding: 12px 16px; }
#driver[hidden] { display: none; }
.dtabs { margin: 0 0 12px; }
.dpane { display: grid; gap: 12px; align-items: start; }
.dpane[hidden] { display: none; }
#dpane-dash { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); }
#dpane-maps { grid-template-columns: 240px minmax(0, 1fr); }
@media (max-width: 900px) { #dpane-dash, #dpane-maps { grid-template-columns: 1fr; } }
.dcol { display: grid; gap: 12px; min-width: 0; }

.modes { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.modes button { border: 0; border-radius: 0; background: none; }
.modes button[aria-pressed=true] { background: var(--ink); color: var(--panel); }

.ghead { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 10px 0 6px; }
.ghead:first-child { margin-top: 0; }
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gauge { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--bg); min-width: 0; }
.gname { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gval { font: 600 22px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.gval small { font: 12px system-ui, sans-serif; color: var(--dim); font-weight: 400; }
.gauge.raw .gval { font-size: 17px; color: var(--dim); }
.gbar { height: 3px; background: var(--line); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.gbar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; }
@media (prefers-reduced-motion: reduce) { .gbar i { transition: none; } }

.srow { display: grid; grid-template-columns: 150px 1fr 70px 170px; gap: 8px; align-items: center; margin-bottom: 4px; }
.srow input { width: 100%; accent-color: var(--accent); }
.srow select { font: 11px system-ui, sans-serif; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 2px 4px; }
#dKey { white-space: nowrap; }
#dScen { gap: 6px; }
#dRpmWrap { display: inline-flex; gap: 8px; align-items: center; margin-left: 16px; }
#dRpmWrap[hidden], #dSpdWrap[hidden] { display: none; }
#dSpdWrap { display: inline-flex; gap: 8px; align-items: center; }
#dSpdWrap select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 2px 4px; }

.fault { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.fault:last-child { border-bottom: 0; }
.fcode { font-family: var(--mono); font-weight: 600; color: var(--accent); }
.fid { font: 11px var(--mono); color: var(--dim); }
.ok { color: var(--ok); margin: 0; }

.lights { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.lamp { display: flex; gap: 8px; align-items: center; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--dim); }
.lamp i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--dim); flex: none; }
.lamp.on { color: var(--ink); border-color: var(--ok); }
.lamp.cut.on { border-color: var(--warn); }
.lamp.cut.on i { background: var(--warn); border-color: var(--warn); box-shadow: 0 0 6px var(--warn); }
.lamp.on i { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 6px var(--ok); }

.tl { list-style: none; margin: 0; padding: 0; }
.tl li { padding: 3px 6px; cursor: pointer; border-radius: 3px; }
.tl li:hover, .tl li.sel { background: var(--sel); }
.tl li.sel { box-shadow: inset 3px 0 0 var(--accent); }
.tlist { max-height: calc(100vh - 150px); overflow-y: auto; }
.heatwrap { overflow-x: auto; }
table.heat { width: auto; font-size: 11px; }
table.heat th { color: var(--dim); font-weight: 400; padding: 2px 6px; text-align: right; white-space: nowrap; }
table.heat td { padding: 2px 6px; text-align: right; color: #111; font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) { table.heat td { color: #f2f2f2; } }
table.heat td.now { outline: 2px solid var(--accent); outline-offset: -2px; font-weight: 700; }
svg.curve { width: 100%; max-width: 640px; color: var(--accent); }
svg.curve text { fill: var(--dim); font: 10px var(--mono); }
svg.curve circle { fill: currentColor; }
svg.curve .cursor { stroke: var(--ink); stroke-dasharray: 3 3; }
table.scalars td, table.scalars th { white-space: normal; padding: 3px 10px 3px 0; text-align: left; vertical-align: top; }
table.scalars th { color: var(--dim); font-weight: 400; }

.cav { display: grid; gap: 4px; overflow-x: auto; }
.cavrow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(84px, 1fr); gap: 4px; }
.cavrow:nth-child(2) { padding: 0 42px; }
.cav .c { border: 1px solid var(--line); border-radius: 4px; padding: 3px 5px; min-height: 58px; background: var(--bg); display: flex; flex-direction: column; font-size: 10px; line-height: 1.25; }
.cav .c.empty { opacity: .35; }
.cav .c b { font: 600 11px var(--mono); }
.cav .c span { color: var(--dim); flex: 1; overflow: hidden; }
.cav .c em { font: 600 11px var(--mono); font-style: normal; color: var(--accent); }
.lamp.val b { min-width: 26px; text-align: right; color: var(--ink); }
.tgroup summary { cursor: pointer; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 8px 0 4px; }
.tl li { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.scalars { margin-bottom: 8px; }
