/* App-layout ovanpå designsystemet (retro.css). Bara struktur — inga nya
   färger/radier/skuggor, allt via tokens. */
.wrap { max-width: 460px; margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 24px 0; }
.stack > * + * { margin-top: 16px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.big-actions { display: grid; gap: 14px; margin-top: 8px; }
.big-actions .btn { height: 64px; font-size: 20px; justify-content: center; }
.count-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.count-grid .card { text-align: center; }
.count-grid .n { font-family: var(--font-display); font-size: 40px; display: block; line-height: 1; }
.count-grid .lbl { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.plate-xl { display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap; max-width: 100%; padding: 16px 22px; border: var(--border-heavy);
  border-radius: var(--radius-hero-card); background: var(--yellow);
  box-shadow: var(--shadow-heavy); font-family: var(--font-display);
  font-size: clamp(30px, 11vw, 42px); line-height: 1; }
.errbox { border: var(--border); border-radius: var(--radius-btn); background: var(--red);
  color: var(--cream); padding: 10px 14px; font-weight: 700; }
.warnbox { border: var(--border); border-radius: var(--radius-btn); background: var(--yellow);
  color: var(--ink); padding: 10px 14px; font-weight: 700; }
.adminnav { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px var(--gutter); background: var(--surface); border-bottom: 2px solid var(--ink); }
.adminnav a { text-decoration: none; }
table .plate { font-size: 14px; height: 30px; min-width: 42px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; }
.kv dt { font-weight: 700; }
.kv dd { margin: 0; }
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { padding: 8px 0; border-bottom: 2px dashed var(--ink); font-size: 14px; }
/* ==========================================================================
   UTSKRIFTSBLAD (A5). Skärm = förhandsvisning, print = exakt A5.
   Styrs av mm-mått (ärver inte layout.css-kolumnen). Raka ränder, inget skew.
   Bladet fyller hela sidan: flex-kolumn + space-between.
   ========================================================================== */
.sheet {
  width: 124mm; max-width: 100%; margin: 0 auto;
  background: #fff; color: var(--ink);
  border: var(--border-heavy); border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
}
.sheet > * { flex: 0 0 auto; }
.sheet-brand {
  background: var(--ink); color: var(--cream);
  font-family: var(--font-display); text-transform: uppercase;
  text-align: center; line-height: 1.05; word-break: break-word;
  padding: 3mm 6mm; font-size: 17pt;
}
.sheet .stripes > i { height: 8px; }               /* raka ränder, ingen transform */
.sheet-plate { text-align: center; padding: 3mm 8mm 0; }
.sheet .plopp-nr {
  display: inline-block; font-family: var(--font-display); line-height: 1;
  font-size: 26pt; padding: 2.5mm 6mm;
  border: var(--border-heavy); border-radius: 8px; background: var(--yellow);
}
.sheet-qr { text-align: center; padding: 0 8mm; }
.sheet .qr { background: #fff; padding: 1.5mm; border: var(--border); display: inline-block; }
.sheet .qr svg { width: 50mm; height: 50mm; display: block; }
.sheet-reserve { text-align: center; padding: 0 8mm; }
.sheet .reserve-lead { font-size: 11pt; line-height: 1.25; margin: 0 0 1.5mm; }
.sheet .reserve-code {
  font-family: ui-monospace, Menlo, monospace; font-weight: 700;
  font-size: 22pt; letter-spacing: 0.10em; margin: 0;
}
.sheet .steps { display: flex; flex-direction: column; gap: 2mm; padding: 0 8mm; }
.sheet .steps .step { display: flex; align-items: center; gap: 4mm; font-size: 14pt; }
.sheet .step-nr { width: 9mm; height: 9mm; flex: 0 0 auto; font-size: 12pt; }
.sheet-info { padding: 0 8mm; }
.sheet-info p { font-size: 11pt; line-height: 1.25; margin: 0 0 1.5mm; }
.sheet-foot {
  background: var(--ink); color: var(--cream); text-align: center;
  font-size: 10.5pt; font-weight: 600; padding: 2.5mm;
}

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .page, .page--wide { max-width: none; margin: 0; padding: 0; }   /* ärv inte kolumnen */
  main { margin: 0 !important; }
  .sheet {
    width: 124mm; height: 186mm; max-width: none; margin: 0;
    border: var(--border-heavy); border-radius: 0; box-shadow: none;
  }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* batteriindikator i portaltabellen (Portaler). Husfärger: gul=ok, orange=låg,
   röd=kritisk. Procent clampas till 100 i servicen (MAX17048 kan visa >100). */
.batt { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.batt__bar { position: relative; width: 56px; height: 13px; border: 2px solid var(--ink);
             border-radius: 3px; background: var(--surface); overflow: hidden; }
.batt__bar::after { content: ""; position: absolute; right: -5px; top: 3px; width: 3px;
             height: 7px; background: var(--ink); border-radius: 0 2px 2px 0; }
.batt__fill { position: absolute; left: 0; top: 0; bottom: 0; }
.batt--ok   .batt__fill { background: var(--yellow); }
.batt--low  .batt__fill { background: var(--orange); }
.batt--crit .batt__fill { background: var(--red); }
.batt__txt { font-size: 13px; font-variant-numeric: tabular-nums; }

/* Inramning av snabbaste mellantid/varv i utvidgad förardetalj */
.rb-best { outline: 2px solid var(--green, #2e9e5b); border-radius: 4px;
           padding: 0 5px; font-weight: 700; }

/* placering per varv (N) i live-tavlans varvkolumner */
.lappos { opacity: .55; font-size: .82em; font-weight: 400; }
