/* Drive review. Builds on style.css tokens: same hairline grid, flat panels. */
:root { --pedal: #a2a9b1; --brake: #e0433a; }

.review .back { display: none; }
.rv { display: block; }
.drives, .pl { display: grid; gap: 1px; background: var(--line); align-content: start; }
.row { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.file { cursor: pointer; }
.hint { margin: 10px 0 0; font-size: 12.5px; color: var(--text-3); }
.code-row { margin-top: 10px; }
.code-row input { flex: 1; min-width: 0; height: 30px; padding: 0 10px; background: var(--bg); color: var(--text); border: 1px solid var(--line-2); border-radius: 2px; font: 14px var(--mono); letter-spacing: .08em; }
.summary-note { margin: 0; color: var(--text-2); font-size: 13px; }
.clip-list button:disabled { cursor: default; }
.clip-list button:disabled:hover { background: none; }
.hint code { font: 12px var(--mono); color: var(--text-2); }

/* ---- drive list ---- */
.drive-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.drive-list li { background: var(--panel); display: flex; align-items: center; }
.drive-list li .btn.dl { margin-right: 12px; flex: none; }
.drive-list button.open {
  all: unset; box-sizing: border-box; flex: 1; min-width: 0; cursor: pointer;
  display: grid; grid-template-columns: 3px 1fr auto; column-gap: 12px; padding: 11px 16px 11px 0;
}
.drive-list button.open:hover { background: var(--panel-2); }
.drive-list button.open:focus-visible { outline: 2px solid var(--eng); outline-offset: -2px; }
.drive-list li.on, .drive-list li.on button.open { background: var(--panel-2); }
.drive-list .k { background: var(--line-2); }
.drive-list li.on .k { background: var(--eng); }
.drive-list .when { font-weight: 600; }
.drive-list .meta { grid-column: 2; color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.drive-list .side, .drive-list .meta { min-width: 0; }
.drive-list .side { grid-row: 1 / span 2; grid-column: 3; align-self: center; text-align: right; font: 12px var(--mono); color: var(--text-3); }
.drive-list .side b { display: block; font: 600 15px var(--font); color: var(--text); }
.drive-list .empty { padding: 14px 16px; color: var(--text-3); font-size: 13px; }

/* ---- player ---- */
.empty-state { display: grid; place-items: center; min-height: 50vh; color: var(--text-3); }
.review[data-view="list"] .player { display: none; }

.head-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.head h1 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: .01em; }
.head .sub { color: var(--text-3); font-size: 12.5px; }
.cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin-top: 14px; }
.cells dd { font-size: 20px; font-weight: 600; margin-top: 2px; }
.c-eng { color: var(--eng); }
.cells dd.c-int { color: var(--int); } .cells dd.c-dis { color: var(--dis); }

.tl canvas { height: 40px; cursor: pointer; touch-action: none; }
.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.transport .clock { font: 13px var(--mono); color: var(--text-3); margin-right: auto; }
.transport .clock b { color: var(--text); font-weight: 600; }
.btn.icon.primary { width: 38px; }

.now { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; }
.now .state { grid-column: 1 / -1; position: relative; }
.now .state::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--off); }
.now .state[data-mode="eng"]::before { background: var(--eng); }
.now .state[data-mode="int"]::before { background: var(--int); }
.now .state[data-mode="dis"]::before { background: var(--dis); }
.st { font-size: 20px; font-weight: 650; text-transform: uppercase; letter-spacing: .02em; margin: 4px 0 10px; color: var(--text-2); }
.state[data-mode="eng"] .st { color: var(--eng); }
.state[data-mode="int"] .st { color: var(--int); }
.state[data-mode="dis"] .st { color: var(--dis); }
.kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; }
.kv.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kv dd { font-size: 15px; font-weight: 600; margin-top: 2px; }
.wheel-p .wheel { max-width: 104px; margin: 8px auto 10px; }
#gg { height: 140px; margin: 6px 0 10px; }

.charts .row-head { margin: 12px 0 6px; }
.charts .row-head:first-child { margin-top: 0; }
.cv { height: 110px; cursor: pointer; touch-action: none; }
.cv.short { height: 70px; }
.legend .k-long { background: var(--long); } .legend .k-lat { background: var(--lat); }
.legend .k-pedal { background: var(--pedal); } .legend .k-brake { background: var(--brake); height: 6px; }

.clip-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); max-height: 420px; overflow-y: auto; }
.clip-list li { background: var(--panel); }
.clip-list button { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: 3px 1fr auto; column-gap: 12px; padding: 9px 4px 9px 0; }
.clip-list button:hover, .clip-list li.on button { background: var(--panel-2); }
.clip-list button:focus-visible { outline: 2px solid var(--eng); outline-offset: -2px; }
.clip-list .k { background: var(--off); }
.clip-list .k-eng { background: var(--eng); } .clip-list .k-int { background: var(--int); } .clip-list .k-dis { background: var(--dis); }
.clip-list .k-harsh { background: var(--long); }
.clip-list .k-park { background: var(--park-dot); }
.clip-list .ev { font-weight: 600; font-size: 13.5px; }
.clip-list time { display: block; color: var(--text-3); font: 12px var(--mono); }
.clip-list .spd { align-self: center; color: var(--text-2); font: 12px var(--mono); }
.clip-list .empty { padding: 10px 0; color: var(--text-3); font-size: 13px; }

/* ---- phone: list and player are separate screens ---- */
@media (max-width: 899px) {
  .review[data-view="drive"] .drives { display: none; }
  .review[data-view="drive"] .player { display: block; }
  .review[data-view="drive"] .back { display: inline-flex; }
  .review[data-view="drive"] .brand { display: none; }
}
@media (max-width: 420px) {
  .cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transport .seg button { padding: 0 7px; }
}

/* ---- wide: list on the left, player on the right ---- */
@media (min-width: 900px) {
  .rv { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: calc(100dvh - var(--bar-h)); }
  .drives { border-right: 1px solid var(--line); position: sticky; top: var(--bar-h); align-self: start; max-height: calc(100dvh - var(--bar-h)); overflow-y: auto; }
  .review[data-view] .player { display: block; }
  .now { grid-template-columns: 1.4fr 1fr 1fr; }
  .now .state { grid-column: auto; }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1300px) {
  .cells { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .pl { grid-template-columns: minmax(0, 1fr) 340px; }
  .pl > .head, .pl > .tl, .pl > .now { grid-column: 1 / -1; }
  .clips { grid-row: span 1; }
  .clip-list { max-height: 560px; }
  .cv { height: 130px; }
}
