:root {
  --bg: #0d1117;
  --panel: #141b24;
  --card: #18212c;
  --card-2: #1f2a37;
  --line: #29384a;
  --text: #e9eef4;
  --dim: #92a3b5;
  --accent: #ff6b2c;
  --accent-ink: #1b0b02;
  --accent-soft: rgba(255, 107, 44, .14);
  --ok: #3fd67f;
  --ok-soft: rgba(63, 214, 127, .14);
  --warn: #f2b705;
  --warn-soft: rgba(242, 183, 5, .15);
  --bad: #ff5d63;
  --bad-soft: rgba(255, 93, 99, .15);
  --stage: #10171f;
  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 12px 34px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef1f5; --panel: #ffffff; --card: #ffffff; --card-2: #f4f6f9; --line: #d6dde5;
    --text: #141c25; --dim: #5b6977; --accent: #d9480f; --accent-ink: #ffffff;
    --accent-soft: rgba(217, 72, 15, .09); --stage: #e4e9ef; --shadow: 0 12px 34px rgba(20, 30, 40, .12);
    --ok: #1a8f4c; --warn: #a77a00; --bad: #c92a2a;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #eef1f5; --panel: #ffffff; --card: #ffffff; --card-2: #f4f6f9; --line: #d6dde5;
  --text: #141c25; --dim: #5b6977; --accent: #d9480f; --accent-ink: #ffffff;
  --accent-soft: rgba(217, 72, 15, .09); --stage: #e4e9ef; --shadow: 0 12px 34px rgba(20, 30, 40, .12);
  --ok: #1a8f4c; --warn: #a77a00; --bad: #c92a2a;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.dim { color: var(--dim); }
.small { font-size: .82rem; }
h2, h3, h4 { margin: 0; }

/* ---------- Cabecera ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .back { background: none; border: 0; color: var(--accent); font-size: 1.5rem; line-height: 1; padding: 4px 8px 4px 0; }
.topbar .titles { flex: 1; min-width: 0; }
.topbar h1 { margin: 0; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .01em; }
.topbar .sub { display: block; font-size: .78rem; color: var(--dim); }
.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 11px;
  border: 1px solid var(--line); background: var(--card);
  display: grid; place-items: center; font-size: 1.1rem;
}

main { max-width: 860px; margin: 0 auto; padding: 16px 16px 120px; }
body.wide main { max-width: 1340px; }
body.has-savebar main { padding-bottom: 190px; }

/* ---------- Botones y campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--card); font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost-danger { color: var(--bad); }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 11px; font-size: .85rem; border-radius: 9px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.fld { display: flex; flex-direction: column; gap: 5px; font-size: .84rem; color: var(--dim); margin-bottom: 12px; }
.fld input, .fld select, .fld textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--card-2); color: var(--text); font-size: .95rem;
}
.fld textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

.tag {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
  font-size: .74rem; font-weight: 600; background: var(--card-2); border: 1px solid var(--line); color: var(--dim);
}
.tag.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.tag.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.tag.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.tag.ghost { background: transparent; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags:empty { display: none; }

/* ---------- Garaje ---------- */
.garage-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 18px; flex-wrap: wrap; }
.garage-head h2 { font-size: 1.4rem; }
.garage-head p { margin: 4px 0 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.car-card {
  display: flex; gap: 14px; align-items: center; text-align: left;
  padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card);
}
.car-card:hover { border-color: var(--accent); }
.car-card .mini { width: 64px; height: 92px; flex: none; background: var(--stage); border-radius: 12px; padding: 4px; }
.car-card .info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.car-card .name { font-weight: 700; font-size: 1.05rem; }
.dorsal { color: var(--accent); margin-right: 6px; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 40px 16px; border: 1px dashed var(--line); border-radius: var(--r); }
.empty.small { padding: 24px 16px; }
.empty-car { width: 120px; height: 150px; }
.empty h3 { margin: 8px 0 4px; }
.empty p { max-width: 460px; margin: 0 auto 16px; }

/* ---------- Pestañas del coche ---------- */
.tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 16px; overflow-x: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
}
.tabs button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border: 0; background: none; border-radius: 10px; color: var(--dim); font-weight: 600; white-space: nowrap;
}
.tabs button.on { background: var(--card-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: .72rem; background: var(--card-2); border: 1px solid var(--line); color: var(--dim);
}
.badge.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge:empty { display: none; }

/* ---------- Hoja de setup ---------- */
.setup-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

.block, .panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 8px;
}
.block h3, .panel h3 {
  display: flex; align-items: center; gap: 8px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--dim); margin: 0 0 8px;
}
.panel h3 { font-size: .86rem; color: var(--text); letter-spacing: .03em; text-transform: none; }
.panel h3 .n, .wtabs .n {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: .7rem; display: inline-grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); margin-left: auto;
}
.wtabs .n { margin-left: 6px; }
.wk {
  font-weight: 800; font-size: .8rem; padding: 2px 7px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent); letter-spacing: .04em;
}

.head-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 1100px) { .head-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .head-grid { grid-template-columns: 1fr; } }

/* Fila de campo: etiqueta | valor + unidad | evolución */
.f {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) 30px; align-items: center; gap: 4px 8px;
  padding: 3px 0;
}
.f .lbl { font-size: .86rem; color: var(--dim); }
.f .inp {
  display: flex; align-items: center; min-width: 0;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 9px;
}
.f .inp:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.f input, .f textarea {
  flex: 1; min-width: 0; width: 100%; padding: 7px 9px; border: 0; background: none; outline: none;
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.f textarea { font-weight: 400; resize: vertical; }
.f input[type="date"] { font-weight: 500; }
.f .u { padding-right: 9px; font-size: .74rem; color: var(--dim); white-space: nowrap; }
.f .was { grid-column: 1 / -1; font-size: .75rem; color: var(--accent); text-align: right; padding-right: 38px; }
.f .was:empty { display: none; }
.f.chg .inp { border-color: var(--accent); background: var(--accent-soft); }
.f.chg .lbl { color: var(--text); }
.hbtn {
  width: 30px; height: 30px; border-radius: 8px; border: 0; background: none; color: var(--dim);
  display: grid; place-items: center; position: relative; padding: 0;
}
.hbtn:hover { background: var(--card-2); color: var(--accent); }
.hbtn.none { pointer-events: none; }
.hbtn svg { width: 17px; height: 17px; }
.hbtn i { position: absolute; top: 0; right: 0; font-style: normal; font-size: .62rem; font-weight: 700; color: var(--accent); }

/* Pesos: rejilla 2x2 como las esquinas del coche */
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pcell { grid-template-columns: 26px minmax(0, 1fr); padding: 0; }
.pcell label { font-weight: 700; font-size: .8rem; color: var(--dim); }
.pcell .was { padding-right: 0; grid-column: 2; }
.ptot { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--dim); padding: 9px 0 4px; }
.ptot b { color: var(--text); }

/* Tablero: rueda | coche | rueda */
.board {
  display: grid; gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px) minmax(0, 1fr);
  grid-template-areas: "di car dd" "ti car td" "dif notas notas";
}
.p-DI { grid-area: di; } .p-DD { grid-area: dd; } .p-TI { grid-area: ti; } .p-TD { grid-area: td; }
.p-DIF { grid-area: dif; } .p-notas { grid-area: notas; } .carzone { grid-area: car; }
.p-notas .f { grid-template-columns: 1fr 30px; }
.p-notas .f .lbl { display: none; }
.wtabs { display: none; }
.panel.flash { animation: flash 1s ease; }
@keyframes flash { 0%, 40% { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); } }

.carzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--stage); border: 1px solid var(--line); border-radius: var(--r); padding: 12px;
}
.carzone svg.car { width: 100%; max-height: 600px; }
svg .front { font-size: 9px; letter-spacing: .14em; fill: var(--dim); font-weight: 700; }
.hot { cursor: pointer; outline: none; }
.hot .ring { fill: transparent; stroke: transparent; stroke-width: 2.5; }
.hot:hover .ring, .hot:focus-visible .ring { stroke: var(--dim); }
.hot.chg .ring { stroke: var(--accent); stroke-dasharray: 4 3; }
.hot.on .ring { stroke: var(--accent); fill: var(--accent-soft); stroke-dasharray: none; }
.hot .wl { font-size: 15px; font-weight: 800; fill: var(--text); }
.hot.on .wl { fill: var(--accent); }
.hot .wv { font-size: 9.5px; fill: var(--dim); font-variant-numeric: tabular-nums; }
.balance { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; text-align: center; }
.balance div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 2px; }
.balance b { display: block; font-size: .9rem; font-variant-numeric: tabular-nums; }
.balance span { font-size: .68rem; color: var(--dim); }
.balance p { grid-column: 1 / -1; margin: 0; }

@media (max-width: 999px) {
  .board { grid-template-columns: 1fr; grid-template-areas: none; }
  .board > * { grid-area: auto !important; }
  .carzone { order: 1; flex-direction: row; flex-wrap: wrap; }
  .carzone svg.car { width: 46%; max-width: 230px; max-height: 300px; }
  .carzone .balance { width: auto; flex: 1; min-width: 150px; grid-template-columns: 1fr 1fr; }
  .wtabs {
    order: 2; display: flex; gap: 4px; padding: 4px; overflow-x: auto;
    position: sticky; top: 61px; z-index: 5;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  }
  .wtabs button {
    flex: 1; padding: 9px 10px; border: 0; background: none; border-radius: 10px;
    font-weight: 800; color: var(--dim); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center;
  }
  .wtabs button.on { background: var(--accent); color: var(--accent-ink); }
  .wtabs button.on .n { background: var(--accent-ink); color: var(--accent); }
  .board .panel { order: 3; }
  .board .p-notas { order: 4; }
  .board .panel[data-panel] { display: none; }
  .board[data-active="DI"] .p-DI, .board[data-active="DD"] .p-DD, .board[data-active="TI"] .p-TI,
  .board[data-active="TD"] .p-TD, .board[data-active="DIF"] .p-DIF { display: block; }
}
@media (max-width: 480px) {
  .carzone svg.car { width: 100%; max-width: 260px; margin: 0 auto; }
  .carzone .balance { grid-template-columns: repeat(4, 1fr); flex-basis: 100%; }
}

/* Barra de guardado */
.savebar {
  position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(1300px, calc(100% - 24px)); z-index: 40;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow);
}
.sb-info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 220px; }
.sb-info b { color: var(--accent); }
.sb-info span { font-size: .78rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.savebar input { flex: 2 1 260px; padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card-2); }
.sb-btns { display: flex; gap: 8px; }
@media (max-width: 600px) { .sb-btns { flex: 1 1 100%; } .sb-btns .btn { flex: 1; } }

/* ---------- Histórico ---------- */
.filters { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; margin-bottom: 14px; }
.filters select, .filters input {
  padding: 9px 11px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card); min-width: 0;
}
@media (max-width: 600px) { .filters { grid-template-columns: 1fr 1fr; } .filters input { grid-column: 1 / -1; } }
.hcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; border-left: 3px solid var(--line); }
.hcard.setup { border-left-color: var(--accent); }
.hcard.mant { border-left-color: var(--warn); }
.hcard header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.hcard .when { font-size: .78rem; color: var(--dim); font-variant-numeric: tabular-nums; }
.hcard .ttl { flex: 1 1 200px; }
.changes { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 4px 18px; }
.changes li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: .86rem; }
.changes .lbl { color: var(--dim); }
.vals { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; flex-wrap: wrap; justify-content: flex-end; }
.v.old { color: var(--dim); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--dim) 50%, transparent); }
.v.new { font-weight: 700; }
.arr { color: var(--dim); }
.v.old.nada { text-decoration: none; }
.d { font-size: .74rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 6px; }
.hcard footer { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.evo { list-style: none; padding: 0; margin: 0 0 8px; max-height: 55vh; overflow: auto; }
.evo li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.evo .when { font-size: .78rem; color: var(--dim); margin-bottom: 3px; }
.evo .vals { justify-content: flex-start; }

.cmp-wrap { max-height: 58vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.cmp { width: 100%; border-collapse: collapse; font-size: .86rem; }
.cmp th, .cmp td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.cmp thead th { position: sticky; top: 0; background: var(--card-2); font-size: .76rem; color: var(--dim); }
.cmp td:first-child { color: var(--dim); }
.cmp tr.dif td { background: var(--accent-soft); }
.cmp tr.dif td:nth-child(2), .cmp tr.dif td:nth-child(3) { font-weight: 700; }
.cmp.only-dif tr.same { display: none; }
.check { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .88rem; }

/* ---------- Mantenimiento ---------- */
.mant-top { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: stretch; }
.mant-top > .btn { align-self: center; }
@media (max-width: 600px) { .mant-top { grid-template-columns: 1fr 1fr; } .mant-top > .btn { grid-column: 1 / -1; } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.stat b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.sec { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin: 22px 0 10px; }
.due { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 10px; }
.due-item { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); }
.due-item .pill { align-self: flex-start; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.due-item.pronto { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.due-item.pronto .pill { background: var(--warn-soft); color: var(--warn); }
.due-item.vencido { border-color: color-mix(in srgb, var(--bad) 60%, var(--line)); }
.due-item.vencido .pill { background: var(--bad-soft); color: var(--bad); }
.mlist { display: flex; flex-direction: column; gap: 10px; }
.mcard { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); }
.mdate { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--dim); font-size: .88rem; padding-top: 1px; }
.mbody p { margin: 6px 0 4px; font-size: .9rem; }
.mact { display: flex; gap: 6px; }
@media (max-width: 600px) { .mcard { grid-template-columns: 1fr; gap: 6px; } .mact { justify-content: flex-end; } }

/* ---------- Datos del coche ---------- */
.card-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: var(--c); padding: 0; }
.sw.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.car-preview { display: grid; place-items: center; background: var(--stage); border-radius: var(--r-sm); padding: 8px; margin-bottom: 4px; }
.car-preview svg { width: 120px; height: 170px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.danger-zone p { margin: 3px 0 0; }

/* ---------- Modales y avisos ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .55); display: grid; place-items: center; padding: 16px; }
.sheet {
  width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 16px; box-shadow: var(--shadow);
}
.sheet.wide { width: min(820px, 100%); }
.sheet h3 { font-size: 1.1rem; margin-bottom: 6px; }
.sheet .lead { color: var(--dim); margin: 0 0 14px; }
.grabber { display: none; }
.form-actions { display: flex; gap: 10px; margin-top: 14px; }
.menu-list { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 600px) {
  .modal { place-items: end center; padding: 0; }
  .sheet { border-radius: 18px 18px 0 0; max-height: 92vh; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .grabber { display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: -6px auto 12px; }
}
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 80;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: .9rem;
  transition: .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.has-savebar .toast { bottom: 110px; }

/* ---------- Impresión: misma disposición que la hoja Excel ---------- */
#print { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; color: #000; font-size: 10.5px; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; }
  .ps h2 { font-size: 15px; margin-bottom: 8px; }
  .ps h4 { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; background: #222; color: #fff; padding: 3px 6px; margin: 0; }
  .ps table { width: 100%; border-collapse: collapse; }
  .ps th, .ps td { border: 1px solid #999; padding: 2px 6px; text-align: left; }
  .ps th { font-weight: 500; width: 55%; background: #f2f2f2; }
  .ps td { font-weight: 700; }
  .pb { break-inside: avoid; }
  .ps-head { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
  .ps-board { display: grid; grid-template-columns: 1fr 150px 1fr; gap: 8px; margin-bottom: 10px; }
  .ps-car { grid-row: span 2; display: grid; place-items: center; }
  .ps-car svg { width: 150px; }
  .ps-car .hot .ring { display: none; }
  .ps-car .wv { display: none; }
  .ps-car text { fill: #000; }
  .ps-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
  .notes p { border: 1px solid #999; min-height: 70px; margin: 0; padding: 6px; white-space: pre-wrap; }
  .ps-meta { color: #666; font-size: 9px; margin-top: 8px; }
}
@media (max-width: 600px) {
  .savebar { padding: 8px 10px; gap: 8px; }
  .sb-info span { display: none; }
  .savebar input { flex-basis: 100%; padding: 8px 10px; }
}
