/* Car log (2026-10-29, /malitools/cars/log): on top of calc.css (cc-*) and
   food.css (fd-btn, fd-mali, fd-actions), like /lists. */

/* the cars: one chip each, the picked one lit, then "+ add a car" */
.cl-cars { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-cars:empty { display: none; }
.cl-car { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 14px 6px 8px; border: 2px solid var(--edge, #111111); border-radius: 999px;
  background: var(--bg); color: var(--text); font: 800 14.5px/1.2 var(--font-body); cursor: pointer; box-shadow: none; max-width: 100%; }
.cl-car img { width: 26px; height: 26px; flex: none; }
.cl-car span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-car[aria-pressed="true"] { background: var(--app, #ffc21a); color: var(--app-ink, #111111); box-shadow: 0 3px 0 var(--ink-sh, var(--ink, #111111)); }
.cl-car.add { padding: 6px 14px; border-style: dashed; background: none; color: var(--muted); }
.cl-car.edit { padding: 6px 12px; border-color: var(--line-strong); color: var(--muted); font-size: 13px; background: none; }
.cl-carform { display: grid; gap: 14px; padding-top: 4px; }
.cl-seg { display: flex; }
.cl-seg button { flex: 1; padding: 6px 8px; }
.cl-danger { color: var(--accent, #ff4b2b); }

/* today's price under the amounts */
.cl-price { margin: -4px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); line-height: 1.5; }
.cl-link { border: 0; background: none; padding: 0; color: var(--accent, #ff4b2b); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; box-shadow: none; }

/* the full-tank switch (the same as the fuel split's) */
.bf-toggle { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15px; color: var(--text); cursor: pointer; position: relative; }
.bf-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.bf-switch { width: 46px; height: 28px; flex: none; position: relative; border: 2px solid var(--edge, #111111); border-radius: 999px; background: var(--bg); transition: background .2s; }
.bf-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--edge, #111111); box-sizing: border-box; transition: transform .25s cubic-bezier(.22,1,.36,1); }
.bf-toggle input:checked + .bf-switch { background: var(--app, #ffc21a); }
.bf-toggle input:checked + .bf-switch::after { transform: translateX(18px); }
.bf-toggle input:focus-visible + .bf-switch { outline: 3px solid color-mix(in srgb, var(--app, #ffc21a) 45%, transparent); outline-offset: 2px; }

/* the history: newest first */
.cl-hist { list-style: none; margin: 0; padding: 0; display: grid; }
.cl-hist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line-strong); }
.cl-hist li:last-child { border-bottom: 0; }
.cl-hist li.on { background: var(--app-soft, #fff1c2); margin: 0 -10px; padding: 10px; border-radius: 12px; }
.cl-main { display: grid; gap: 2px; min-width: 0; }
.cl-main b { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cl-main span { font-size: 13.5px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.cl-main small { font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cl-main em { font-style: normal; display: inline-block; padding: 1px 8px; border-radius: 999px; background: #c9f2d8; color: #111111; font-size: 12px; font-weight: 800; }
.cl-main em.part { background: var(--bg); color: var(--muted); border: 1px solid var(--line-strong); }
.cl-main .warn { color: var(--accent, #ff4b2b); }
.cl-acts { display: flex; gap: 6px; }
.cl-acts button { min-height: 36px; padding: 4px 12px; border: 2px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: 800 13px/1 var(--font-body); cursor: pointer; box-shadow: none; }
.cl-acts button.sure { border-color: var(--accent, #ff4b2b); color: var(--accent, #ff4b2b); }

/* the month chart: one series (money per month), so no legend; the table under it has every number */
.cl-chart { margin: 0; display: grid; gap: 8px; }
.cl-chart figcaption { font-size: 13px; font-weight: 800; color: var(--muted); }
.cl-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.cl-chart .bar { fill: var(--accent, #ff4b2b); }
.cl-chart .bar.now { fill: var(--app, #ffc21a); stroke: var(--edge, #111111); stroke-width: 1.5px; }
.cl-chart .hit { fill: transparent; cursor: default; }
.cl-chart .hit:hover + .bar, .cl-chart .hit:focus + .bar { opacity: .8; }
.cl-chart .base { stroke: var(--line-strong); stroke-width: 1px; }
.cl-chart text { fill: var(--muted); font: 700 11px/1 var(--font-body); }
.cl-chart text.v { fill: var(--text); font-weight: 800; }
#clToFuel img, #clDriveCard .fd-btn img { width: 22px; height: 22px; }
#clDriveCard .cc-rows:empty { display: none; }

/* phones: the cards in one column, the numbers right under the car picker
   (not after a long history) */
@media (max-width: 899px) {
  .cl-page #clMain > .cc-col:first-child { display: contents; }
  .cl-page #clMain > .cc-col:first-child > :first-child { order: 1; }
  .cl-page #clSide { order: 2; }
  .cl-page #clFillCard { order: 3; }
  .cl-page #clHistCard { order: 4; }
  .cl-page #clDriveCard { order: 5; }
}
