/* Sổ tay xe 2.0 — base.css · reset, chữ, tiện ích · © Kiên VC */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--canvas); }
body {
  margin: 0; background: var(--canvas); color: var(--text);
  font: var(--fs-body)/1.45 var(--font);
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; overflow-wrap: break-word;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, [data-go], [data-act], [data-tab], [data-back] { cursor: pointer; }
button { -webkit-touch-callout: none; touch-action: manipulation; }
a { color: var(--accent); text-decoration: none; }
img, svg { max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
.hide { display: none !important; }

/* focus nhìn thấy rõ (bàn phím / công nghệ hỗ trợ) — không hiện khi chạm */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.input:focus-visible { outline: none; }          /* ô nhập có vòng focus riêng (xem components.css) */
#view:focus { outline: none; }
.sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- thang chữ (điện thoại) ---------- */
.h1 { font-size: var(--fs-title); line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin: 12px 0 4px; }
.h2, .sec h2 { font-size: var(--fs-section); line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
.h3 { font-size: var(--fs-card); line-height: 1.3; font-weight: 600; }
.sub { color: var(--text-2); font-size: 14px; margin: 0 0 12px; }
.metric-num { font-size: var(--fs-metric); line-height: 1.1; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); } .faint { color: var(--faint); }
.small { font-size: var(--fs-cap); } .tiny { font-size: var(--fs-tiny); }
.b { font-weight: 600; } .bb { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- khoảng cách / bố cục nhỏ ---------- */
.mt0 { margin-top: 0; } .mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb0 { margin-bottom: 0; } .mb4 { margin-bottom: 4px; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.flex { display: flex; } .col { display: flex; flex-direction: column; }
.between { justify-content: space-between; } .jc-end { justify-content: flex-end; } .jc-center { justify-content: center; }
.aic { align-items: center; } .ais { align-items: flex-start; }
.wrap { flex-wrap: wrap; }
.gap4 { gap: 4px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.grow { flex: 1 1 auto; min-width: 0; }
.noshrink { flex: none; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
hr.sp, .sp { height: 1px; background: var(--border); margin: 16px 0; border: 0; }
.copyright { text-align: center; font-size: var(--fs-tiny); color: var(--faint); margin: 28px 0 4px; line-height: 1.6; }
.copyright b { color: var(--text-2); font-weight: 600; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

@media print {
  #tabbar, .top, #toast, #layer, #offline, .fab-cta, .noprint { display: none !important; }
  :root, :root[data-theme="dark"] { --canvas: #fff; --surface: #fff; --surface-2: #fff; --text: #111; --text-2: #555; --border: #ccc; --sh-1: none; --bg: #fff; --card: #fff; --card2: #fff; --muted: #555; --line: #ccc; color-scheme: light; }
  body { background: #fff; color: #111; }
  #view { padding: 0 !important; }
  .card { box-shadow: none; border: 0; padding: 0; background: #fff; }
}
