:root {
  --bg: #141821;
  --surface: #1B2029;
  --surface-2: #262C37;
  --line: #2E3542;
  --text: #F3F5F8;
  --muted: #A3ACB9;
  --accent: #E5252A;
  --accent-soft: #FF8589;
  --warn: #F2A541;
  --ok: #4CC38A;
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--font); }
body { padding-bottom: env(safe-area-inset-bottom, 0px); -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line); }
.logo { font-weight: 900; font-size: 20px; letter-spacing: .02em; display: flex; align-items: baseline; gap: 10px; }
.logo span { font-weight: 400; font-size: 13px; color: var(--muted); letter-spacing: 0; }

main { padding: 16px; max-width: 640px; margin: 0 auto; }
h1 { font-size: 26px; line-height: 1.15; margin: 4px 0 4px; font-weight: 900; }
h2 { font-size: 17px; margin: 24px 0 10px; font-weight: 700; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: 14px; }

.search { position: relative; margin-bottom: 20px; }
.search input { width: 100%; height: 50px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; padding: 0 16px; }
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--accent); outline: none; }

.brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.brand { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  min-height: 64px; display: flex; flex-direction: column; justify-content: space-between; }
.brand b { font-size: 16px; }
.brand small { color: var(--muted); font-size: 12px; }

.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px;
  min-height: 52px; background: var(--surface); border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .meta { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }
.chev { color: var(--muted); }

.code { font-family: var(--mono); font-weight: 700; letter-spacing: .01em; }

/* комплектация */
.config { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  margin-bottom: 8px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.config .line1 { font-size: 16px; }
.config .line2 { color: var(--muted); font-size: 13px; }
.config .chev { grid-row: 1 / 3; grid-column: 2; align-self: center; }

.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); margin-right: 6px; }
.tag.warn { background: rgba(242,165,65,.15); color: var(--warn); }
.tag.draft { background: rgba(163,172,185,.12); }
.tag.ok { background: rgba(76,195,138,.15); color: var(--ok); }

/* карточка машины */
.tabs { display: flex; gap: 6px; margin: 18px 0 14px; }
.tabs button { flex: 1; height: 44px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 500; }
.tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.unit-head { background: var(--surface-2); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.unit-head .code { font-size: 26px; display: block; }
.unit-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.issue { border: 1px solid var(--line); border-left: 0; border-radius: 12px; background: var(--surface);
  padding: 14px 16px; margin-bottom: 8px; position: relative; overflow: hidden; }
.issue::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--muted); }
.issue.crit::before { background: var(--accent); }
.issue.mid::before { background: var(--warn); }
.issue h3 { margin: 0 0 6px; font-size: 16px; }
.issue dl { margin: 8px 0 0; display: grid; gap: 6px; }
.issue dt { color: var(--muted); font-size: 12px; }
.issue dd { margin: 0; font-size: 14px; }

.empty { border: 1px dashed var(--line); border-radius: 12px; padding: 18px 16px; color: var(--muted); font-size: 14px; }
.notice { background: rgba(242,165,65,.1); color: var(--warn); border-radius: 12px; padding: 12px 14px;
  font-size: 14px; margin-bottom: 12px; }
.error { color: var(--accent-soft); padding: 24px 0; }
.loading { color: var(--muted); padding: 24px 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
