

:root {
  --ink: #141414;
  --ink-soft: #2b2b28;
  --paper: #fafaf8;
  --surface: #ffffff;
  --line: #e4e2dc;
  --line-strong: #cfccc2;
  --muted: #6b6a64;
  --accent: #ffcc33;
  --accent-deep: #eeb800;
  --accent-tint: #fff8dd;
  --read-tint: #e6f1f8;
  --blue: #0073ac;
  --red: #c3002f;
  --amber: #8a5300;
  --radius: 6px;
  --font: -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Segoe UI Mono", monospace;
  --page-width: 1600px;
  --sticky-top: 3.5rem;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { height: 100%; scrollbar-gutter: stable; }
[id] { scroll-margin-top: var(--sticky-top); }
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font: 400 0.9375rem/1.5 var(--font);
}

.topbar {
  background: var(--surface);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem 1.25rem;
  min-height: 3rem;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 24px; display: block; }
.app-name {
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
  margin-left: -0.5rem;
}

.brandstrip {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
}
.brandstrip ul {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.brandstrip a {
  display: flex;
  align-items: center;
  height: 2.75rem;
  padding: 0 1rem;
  white-space: nowrap;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  border-bottom: 3px solid transparent;
}
.brandstrip a:hover { color: var(--ink); background: var(--paper); text-decoration: none; }
.brandstrip a.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.brandstrip .brand-logo { display: block; height: auto; }
.brand-renault  .brand-logo { width: 96px; }
.brand-nissan   .brand-logo { width: 107px; }
.brand-dacia    .brand-logo { width: 107px; }
.brand-alpine   .brand-logo { width: 132px; }
.brand-mercedes .brand-logo { width: 116px; }

.brand-mg       .brand-logo { width: 30px; }
.brand-suzuki   .brand-logo { width: 100px; }
.brand-toyota   .brand-logo { width: 71px; }

.nav-main, .nav-account {
  align-self: stretch;
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  font-size: 0.875rem;
}
.nav-main { margin-left: 0.75rem; }
.nav-account { margin-left: auto; align-items: center; gap: 0.9rem; font-size: 0.8125rem; }
.nav-main a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.6rem;
  color: var(--ink-soft);
  font-weight: 600;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.nav-main a:hover { background: var(--paper); color: var(--ink); text-decoration: none; }
.nav-main a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.nav-account a { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--muted); }
.nav-account a:hover { color: var(--ink); text-decoration: none; }
.nav-account form { display: flex; margin: 0; }

.nav-account .user { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--ink-soft); font-weight: 600; }
.nav-account a.btn { color: var(--ink); }

.nav-icon { position: relative; display: inline-flex; }
.nav-icon.has-waiting { margin-right: 0.45rem; }   
.nav-icon .waiting {
  position: absolute;
  top: -0.45rem;
  right: -0.5rem;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  background: var(--accent);
  border: 1.5px solid var(--surface);
  color: var(--ink);
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 0.8rem;
  text-align: center;
}

svg.icon, td button, td .btn, td details, .calc-warning .sr-only, th.row-actions .sr-only { user-select: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.admin-tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.75rem;
}
.admin-tiles a {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.75rem;
  row-gap: 0.15rem;
  height: 100%;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
}
.admin-tiles a:hover { border-color: var(--accent-deep); background: var(--accent-tint); text-decoration: none; }
.admin-tiles .icon { grid-row: span 2; width: 1.5rem; height: 1.5rem; margin-top: 0.1rem; color: var(--ink-soft); }
.admin-tiles strong { font-weight: 650; }
.admin-tiles span { font-size: 0.8125rem; color: var(--muted); }

main {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.app-footer {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 1.25rem 1.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}
h1 { font-size: 1.375rem; font-weight: 650; letter-spacing: -0.01em; margin: 0.25rem 0 1rem; }
h2 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.3rem;
  margin: 2rem 0 0.75rem;
}
h3 { font-size: 0.9375rem; font-weight: 650; margin: 1rem 0 0.4rem; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.vin, dd.vin, td.vin { font-family: var(--mono); font-size: 0.875em; letter-spacing: 0.02em; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  margin: 0 0 1.25rem;
}

table { font-size: 0.875rem; }
th, td { padding: 0.3rem 0.6rem; text-align: left; vertical-align: middle; }
thead th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 2px solid var(--ink);
  white-space: nowrap;
}

thead th a { color: inherit; text-decoration: none; display: inline-block; width: 100%; }
thead th a:hover { color: var(--ink); text-decoration: none; }

thead th .arrow { margin-left: 0.3rem; font-size: 1.2em; line-height: 1; }
thead th.sorted { color: var(--ink); }

tbody tr { border-top: 1px solid var(--line); }
tbody tr:hover { background: var(--accent-tint); }
td:last-child, th:last-child { text-align: right; white-space: nowrap; }
td:last-child a:not(.btn) { margin-left: 0.75rem; }
td input[type="number"] { width: 5rem; }

:root {
  --st-instock: var(--surface);
  --st-reserved: #fff4d6;
  --st-sold: #eaf4ec;
  --st-archived: #f2f1ed;
  --st-dispatched: #e3eef8;
}
tbody tr.status-instock { background: var(--st-instock); }
tbody tr.status-instock:hover { background: var(--accent-tint); }
tbody tr.status-reserved { background: var(--st-reserved); }
tbody tr.status-reserved:hover { background: #ffedbc; }
tbody tr.status-sold { background: var(--st-sold); }
tbody tr.status-sold:hover { background: #dcecdf; }
tbody tr.status-archived { background: var(--st-archived); color: var(--muted); }
tbody tr.status-archived:hover { background: #e9e7e1; }
tbody tr.status-dispatched { background: var(--st-dispatched); }
tbody tr.status-dispatched:hover { background: #d3e4f3; }

td.markers, th.markers { width: 1%; white-space: nowrap; padding-right: 0.25rem; }
.marker { display: inline-flex; color: var(--muted); }
.marker + .marker { margin-left: 0.3rem; }
.marker-buyer { color: var(--blue); }
.chip {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
}
.chip-warn { border-color: var(--red); color: var(--red); margin-left: 0.4rem; }

.tiles { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 1.25rem; }
.tile { display: flex; flex-direction: column; min-width: 8rem; padding: 0.6rem 0.9rem; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); text-decoration: none; }
.tile-n { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.tile-l { font-size: 0.8125rem; color: var(--muted); }
.tile.warn { border-color: var(--red); }
.tile.warn .tile-n { color: var(--red); }
a.tile:hover { background: var(--accent-tint); text-decoration: none; }
.overview-section { margin: 0 0 1.5rem; }
.overview-section h2 { margin-bottom: 0.4rem; }

.greeting { margin-bottom: 0.4rem; }
.tile-group { display: inline-flex; flex-direction: column; gap: 0.35rem; margin: 0 0 1.25rem; }
.tile-group-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}
.tile-group .tiles { margin: 0; }

.overview-links { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; margin: 0 0 1.5rem; }
.overview-links .btn { font-size: 1rem; font-weight: 600; gap: 0.5rem; padding: 0.4rem 0.8rem; }
.overview-links .count {
  min-width: 1.5em;
  padding: 0 0.45em;
  border-radius: 999px;
  background: var(--line);
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}
.overview-links .count.alert { background: var(--red); color: #fff; }

.tile.with-icon { display: grid; grid-template-columns: auto 1fr; column-gap: 0.75rem; align-items: center; min-width: 11rem; padding: 0.75rem 1rem; }
.tile.with-icon .tile-icon {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--accent-tint);
  border: 1px solid var(--accent);
  color: var(--ink);
}
.tile.with-icon .tile-icon .icon { width: 1.25rem; height: 1.25rem; }
.text-danger { color: var(--red); }

.multiline, td.multiline { white-space: pre-line; }   

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.3rem;
  margin: 2rem 0 0.5rem;
}
.section-head h2 { border: 0; padding: 0; margin: 0; }
.section-head h2 a { color: inherit; }

.problem-group h3 { font-size: 0.875rem; margin: 0.75rem 0 0.25rem; }
.problem-group:first-of-type h3 { margin-top: 0; }
table.problems { table-layout: fixed; margin-bottom: 0.5rem; }
table.problems col.col-car { width: 24rem; }
table.problems col.col-dismiss { width: 6.5rem; }
table.problems td.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

table.problems td.problem-text { text-align: left; white-space: normal; }

.problem-group:not(:has(> .more-toggle:checked)) tr.more { display: none; }
.problem-group:has(> .more-toggle:checked) tr.more-line { display: none; }
.problem-group label { cursor: pointer; }
.problem-group :is(h2, h3) :is(label, a) { display: inline-flex; align-items: center; gap: 0.35rem; font: inherit; color: inherit; margin: 0; text-decoration: none; }
.problem-group :is(h2, h3) .icon { width: 1em; height: 1em; flex: none; color: var(--muted); transform: rotate(-90deg); }
.problem-group:has(> .more-toggle:checked) :is(h2, h3) .icon { transform: none; }
.problem-group :is(h2, h3) :is(label, a):hover .icon { color: var(--ink); }
.more-toggle:focus-visible + :is(h2, h3) label { outline: 2px solid var(--accent); outline-offset: 1px; }
tr.more-line td { padding-top: 0.15rem; padding-bottom: 0.15rem; text-align: left; }
tr.more-line :is(label, a) { display: inline; color: var(--blue); }
tr.more-line :is(label, a):hover { text-decoration: underline; }

details.fold > summary { list-style: none; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary > :is(h2, h3, h4) { display: flex; align-items: center; gap: 0.35rem; }
details.fold > summary .icon { width: 1em; height: 1em; flex: none; color: var(--muted); }
details.fold:not([open]) > summary .icon { transform: rotate(-90deg); }
details.fold > summary:hover .icon { color: var(--ink); }

details.fold details.fold > summary > h3 { font-size: 0.8125rem; margin-top: 0.75rem; }

details.dismiss { position: relative; display: inline-block; text-align: left; }
details.dismiss > summary { list-style: none; }
details.dismiss > summary::-webkit-details-marker { display: none; }
details.dismiss[open] > summary { background: var(--accent-tint); border-color: var(--accent-deep); }
.dismiss-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 10;
  width: 18rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  white-space: normal;
  font-size: 0.8125rem;
}
.dismiss-panel label { display: flex; flex-direction: column; gap: 0.2rem; width: 100%; font-weight: 600; }
.dismiss-panel input[type="text"] { width: 100%; margin: 0; }
.dismiss-panel button { align-self: flex-end; }

.dismiss-panel input[type="date"], .dismiss-panel input[type="number"] { width: 100%; margin: 0; }

.due-extend .dismiss-panel > label:nth-of-type(1) { order: 1; }
.due-extend .dismiss-panel > label:nth-of-type(2) { order: 2; }
.due-quick { display: flex; gap: 0.3rem; order: 3; }
.due-extend .dismiss-panel > .muted { order: 4; }
.due-extend .dismiss-panel > button { order: 5; }

.due-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.due-cell > span { white-space: nowrap; }
table.invoices .due-col { padding-left: 1.75rem; }
.dismiss-panel > .form-error { margin: 0; }

@supports (position-anchor: --a) {
  .table-wrap details.due-extend .dismiss-panel {
    position: fixed;
    top: auto;
    right: auto;
    max-width: calc(100vw - 2rem);
    margin: 0.25rem 0;
    position-area: bottom span-left;
    justify-self: end;
    position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline, --due-centred;
    position-visibility: anchors-visible;
  }
  @position-try --due-centred { position-area: bottom span-all; justify-self: center; }
}
@supports not (position-anchor: --a) {
  .table-wrap details.due-extend { display: block; }
  .table-wrap details.due-extend .dismiss-panel { position: static; margin-top: 0.25rem; width: 16rem; box-shadow: none; }
}
table.problems col.col-dismiss.due { width: 13rem; }

.pager { margin-top: -0.5rem; }

.table-wrap { overflow-x: auto; position: relative; }
td.num, th.num { text-align: right; white-space: nowrap; }
.chip-new { border-color: var(--accent-deep); color: var(--ink); background: var(--accent-tint); margin-left: 0.4rem; }
td.markers .chip-new { margin-left: 0; }
.nowrap { white-space: nowrap; }
ul.changes { margin: 0.25rem 0 0; padding-left: 1rem; font-size: 0.875em; }
fieldset.overwritten { border-color: var(--red); }
fieldset.overwritten legend { color: var(--red); }

.gallery { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0; }
.shot { margin: 0; width: 11rem; }
.shot-open { display: block; }

.shot img {
  display: block;
  width: 11rem;
  height: 8rem;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
}
.shot-open:hover img { border-color: var(--ink-soft); }
.shot figcaption { margin-top: 0.3rem; }

.shot-missing {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
  width: 11rem;
  height: 8rem;
  padding: 0.5rem;
  box-sizing: border-box;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: center;
  overflow-wrap: anywhere;
  overflow: hidden;
}
.shot-missing .chip-warn { margin-left: 0; }

.lightbox { display: none; }
.lightbox:target {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(10, 10, 10, 0.88);
}
.lightbox-backdrop { position: absolute; inset: 0; cursor: zoom-out; }
.lightbox figure { position: relative; margin: 0; max-width: 100%; max-height: 100%; }
.lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 6rem);
  border-radius: var(--radius);
}
.lightbox figcaption {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.6rem;
  color: #e8e6e0;
  font-size: 0.8125rem;
}
.lightbox figcaption a:not(.btn) { color: var(--accent); }

.doc-viewer figure { width: min(100%, 70rem); height: 100%; display: flex; flex-direction: column; }
.doc-viewer iframe { flex: 1; width: 100%; border: 0; border-radius: var(--radius); background: var(--surface); }

.doc { margin: 1rem 0; }
.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}
.doc-head form { display: inline; margin: 0; }
.doc-head span { display: inline-flex; align-items: center; gap: 0.75rem; }
.doc-embed {
  width: 100%;
  height: 60vh;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
.muted { color: var(--muted); }

.details-split { display: grid; grid-template-columns: minmax(0, 44rem) minmax(18rem, 1fr); gap: 0 2rem; align-items: start; }
.details-main, .details-side { min-width: 0; }

.details-side > h2:first-child { margin-top: 1.25rem; }
.details-side .gallery { margin-top: 0.75rem; }

.doc-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.doc-row {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.35rem 0.5rem; border-top: 1px solid var(--line); font-size: 0.875rem;
}
.doc-row:first-child { border-top: 0; }
.doc-row:hover { background: var(--accent-tint); }
.doc-name { display: inline-flex; align-items: center; gap: 0.4rem; overflow-wrap: anywhere; min-width: 0; }
.doc-name .muted { margin-left: 0.25rem; }

.service-notes { color: var(--muted); font-size: 0.8125rem; margin: 0.5rem 0 0.75rem; padding-left: 1.25rem; }

table.service-table { table-layout: fixed; width: 100%; }
table.service-table col.sc-years, table.service-table col.sc-services { width: 7.5rem; }
table.service-table col.sc-price, table.service-table col.sc-factor { width: 7.5rem; }
table.service-table col.sc-lowest { width: 11rem; }
table.service-table col.sc-remove { width: 6rem; }
table.service-table.editing td { padding-top: 0.15rem; padding-bottom: 0.15rem; }
.cell-input { width: 100%; margin: 0; padding: 0.1rem 0.35rem; font-size: inherit; line-height: inherit; }
.cell-input.num { text-align: right; }
table.service-table td .error { display: block; font-size: 0.75rem; text-align: left; }
table.service-table tr.removing td { text-decoration: line-through; color: var(--muted); }

#cenik .table-wrap, #cenik .table-wrap > table { margin-bottom: 0; }
#cenik .table-wrap + .btn-row { margin: 0.9rem 0; }

table.service-table { min-width: 52rem; }
table.service-table.editing { min-width: 60rem; }
.service-notes-edit { display: flex; flex-direction: column; gap: 0.25rem; font-weight: 600; margin-bottom: 1rem; }

.service-notes-edit textarea { font-weight: normal; width: 100%; max-width: 48rem; }
.doc-row form { display: inline; margin: 0; }

table.sheet { table-layout: fixed; border-collapse: collapse; }
table.sheet td { border: 1px solid var(--line); padding: 0 0.25rem; line-height: 1.25; vertical-align: bottom; white-space: pre; overflow: visible; font-size: 0.8125rem; text-align: left; }
table.sheet td.wrap { white-space: pre-line; overflow-wrap: anywhere; }
table.sheet td.clip { overflow: hidden; }
table.sheet td.right { text-align: right; }
table.sheet td.center { text-align: center; }
table.sheet td.top { vertical-align: top; }
table.sheet td.mid { vertical-align: middle; }
table.sheet tr:hover { background: none; }

.sheet-wrap { overflow: auto; max-height: max(20rem, calc(100vh - 18.5rem)); }

.columns-chooser { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 0 2rem; align-items: start; }
.columns-chooser h2 { margin-top: 0.5rem; }
.columns-chooser td.actions button { margin-left: 0.25rem; }

.chiprow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0 0 0.5rem; }
.chiprow-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  min-width: 4.5rem;
}

.chip.toggle, .chip.removable {
  padding: 0.2rem 0.6rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.75rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.chip.toggle:hover, .chip.removable:hover { background: var(--paper); border-color: var(--muted); text-decoration: none; }

.chip.toggle.on {
  background: var(--accent);
  border-color: var(--accent-deep);
  color: var(--ink);
}
.chip.toggle.on:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.chip.toggle .icon { width: 0.9em; height: 0.9em; margin-right: 0.25rem; vertical-align: -0.12em; }

.chip.toggle:not(.on) { padding-inline: calc(0.6rem + (0.9em + 0.25rem) / 2); }
.chip.removable { background: var(--accent-tint); border-color: var(--accent); }
.chip.removable .x { margin-left: 0.4rem; font-weight: 700; color: var(--muted); }
.chip.removable:hover .x { color: var(--red); }

.chipgroup.choice .chip.toggle:not(:has(input:checked)):not(.on) .icon { display: none; }
.chipgroup.choice .chip.toggle:has(input:focus-visible) { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.chipgroup.choice label.chip { position: relative; }
.chipgroup.choice button.chip { font: inherit; font-size: 0.75rem; }

.chipgroup.choice .chip.toggle { font-weight: 400; }

.chipgroup.choice .chip.toggle:is(.on, :has(input:checked)) {
  --ring: var(--ink-soft);
  background: var(--surface);
  border-color: var(--ring);
  box-shadow: inset 0 0 0 1px var(--ring);
  color: var(--ink);
  padding-inline: 0.6rem;
}
.chipgroup.choice .chip.toggle.status-reserved:is(.on, :has(input:checked)) { --ring: #c99700; background: var(--st-reserved); }
.chipgroup.choice .chip.toggle.status-sold:is(.on, :has(input:checked)) { --ring: #5f9a6c; background: var(--st-sold); }
.chipgroup.choice .chip.toggle.status-dispatched:is(.on, :has(input:checked)) { --ring: #5b8fc0; background: var(--st-dispatched); }
.chipgroup.choice .chip.toggle.status-archived:is(.on, :has(input:checked)) { --ring: #8f8c82; background: var(--st-archived); }

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  margin: 0.25rem 0 1rem;
}
.page-head h1 { margin: 0; }

.view-toggle { margin-left: auto; }
.view-toggle .chip.on { cursor: default; }
.filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.5rem;
  margin: 0 0 0.75rem;
}
.filter-search { display: flex; align-items: center; gap: 0.4rem; }

.filter-search input { width: 22rem; margin: 0; }
.chipgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.chipgroup .chiprow-label { min-width: 0; margin-right: 0.2rem; }
.clear-filters { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8125rem; }
.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.legend li { display: inline-flex; align-items: center; gap: 0.35rem; }

.swatch {
  width: 0.85rem;
  height: 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  flex: none;
}
.swatch.status-instock { background: var(--st-instock); }
.swatch.status-reserved { background: var(--st-reserved); }
.swatch.status-sold { background: var(--st-sold); }
.swatch.status-archived { background: var(--st-archived); }
.swatch.status-dispatched { background: var(--st-dispatched); }

table.vehicle-list { table-layout: fixed; }
.vehicle-list th, .vehicle-list td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vehicle-list thead th { vertical-align: bottom; }
.vehicle-list td.col-vin { font-family: var(--mono); font-size: 0.875em; letter-spacing: 0.02em; }

.vehicle-list th.markers, .vehicle-list td.markers { padding: 0.3rem 0.15rem 0.3rem 0.5rem; }

.vehicle-list td.markers { font-size: 0; text-overflow: clip; }
.vehicle-list td.markers .slot { display: inline-block; width: 0.9rem; vertical-align: middle; }
.vehicle-list td.markers .marker .icon { width: 0.875rem; height: 0.875rem; }
.vehicle-list .marker + .marker { margin-left: 0; }
.vehicle-list th.row-actions, .vehicle-list td.row-actions { padding-left: 0.3rem; padding-right: 0.3rem; text-align: center; }

@media (min-width: 721px) {
  .vehicle-list .markers, .vehicle-list .frozen, .vehicle-list .row-actions { position: sticky; z-index: 1; background: inherit; }
  .vehicle-list thead .markers, .vehicle-list thead .frozen, .vehicle-list thead .row-actions { background: var(--surface); }
  .vehicle-list .markers { left: 0; }
  .vehicle-list .frozen { left: var(--frozen-left); box-shadow: inset -1px 0 var(--line); }
  .vehicle-list .row-actions { right: 0; box-shadow: inset 1px 0 var(--line); }
}

form div { margin: 0 0 0.8rem; }
label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
}
input, select, textarea {
  display: block;
  margin-top: 0.25rem;
  width: min(100%, 26rem);
  padding: 0.45rem 0.6rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
textarea { min-height: 4.5rem; resize: vertical; }

input:disabled, select:disabled { background: var(--paper); color: var(--muted); border-color: var(--line); }

abbr.req {
  color: var(--red);
  font-weight: 700;
  text-decoration: none;
  cursor: help;
  margin-left: 0.1rem;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--ink-soft);
}
input[type="checkbox"] {
  display: inline-block;
  width: auto;
  margin: 0 0.35rem 0 0;
  vertical-align: -0.1em;
  accent-color: var(--ink);
}
td input, td select { display: inline-block; margin: 0; }

td input[type="number"] { width: 7rem; }

.form-row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  column-gap: 1rem;
  align-items: start;
  margin: 0 0 0.7rem;
}

.form-row > label { padding-top: 0.5rem; }
.form-row .form-field { margin: 0; min-width: 0; }
.form-row .form-field > input,
.form-row .form-field > select,
.form-row .form-field > textarea { margin-top: 0; }
.form-row .form-field > input[type="checkbox"] { margin-top: 0.65rem; }
.form-row .form-field > span { display: block; margin-top: 0.2rem; }

.form-row .form-field > span.chipgroup { display: flex; margin-top: 0.35rem; }

.form-row .form-field > span.unit { display: inline; margin: 0 0 0 0.4rem; color: var(--muted); }
.form-row .form-field > input:has(+ span.unit) { display: inline-block; }

.form-row .calc-value { margin: 0; padding-top: 0.5rem; min-height: 2rem; font-style: italic; color: var(--muted); }

.form-row > .hint { grid-column: 2; margin: 0.3rem 0 0; }

.form-row .field-warning { margin: 0.3rem 0 0; }
.form-row .field-warning > button { margin-left: 0.4rem; }

fieldset .form-row { grid-template-columns: calc(11rem - 1rem - 1px) minmax(0, 1fr); }

fieldset.field-box .form-row {
  margin: 0 -0.5rem 0.1rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius);
}
fieldset.field-box .form-row:hover { background: var(--accent-tint); }

.form-row.from-doc .form-field > input,
.form-row.from-doc .form-field > select,
.form-row.from-doc .form-field > textarea,
.read-swatch { background: var(--read-tint); border-color: var(--blue); }
.read-legend { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.7rem; color: var(--muted); }
.read-swatch { display: inline-block; width: 1.2rem; height: 0.9rem; border: 1px solid var(--blue); border-radius: 3px; }

.form-field input[type="number"], .form-field input.num { width: 9rem; text-align: right; }
.form-field input[type="date"] { width: 11rem; }
.form-field input.short { width: 12rem; }
.form-field input.vin { width: calc(17ch + 2rem); }
.form-field textarea { width: min(100%, 32rem); }

label.choice { display: block; margin: 0.15rem 0; font-weight: 400; }
label.choice input { width: auto; margin: 0 0.4rem 0 0; vertical-align: -0.1em; }
tbody.legacy-invoice tr:first-child td { border-bottom: 0; }
tr.legacy-car td { padding-top: 0.2rem; padding-bottom: 0.9rem; text-align: left; }
tr.legacy-car td > form { display: inline-block; vertical-align: bottom; margin: 0 1rem 0 0; }
tr.legacy-car .buttons { margin: 0.4rem 0 0; }
.upload-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0; }

.upload-row input[type="file"] {
  display: inline-block;
  flex: 0 1 28rem;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.45rem 0.9rem 0.45rem 2.1rem;
  font: 600 0.875rem/1.4 var(--font);
  color: var(--ink);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b2b28' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E") no-repeat 0.8rem center / 1.05em;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background-color: #f1efe9; }

p.hint.upload-hint { margin: 0.4rem 0 1.25rem; }
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 0.4rem;
  margin: 1.25rem 0;
  background: var(--surface);
}
legend {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  padding: 0 0.4rem;
}

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 1.25rem; }
.filters input, .filters select { display: inline-block; width: auto; margin: 0; }

.filters input[type="text"] { width: min(100%, 19rem); }
.filters a { margin-left: 0.25rem; font-size: 0.875rem; }

button, .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  font: 600 0.875rem/1.4 var(--font);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
}
button:hover, .btn:hover { background: #f1efe9; text-decoration: none; }
.btn-primary, button.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}
.btn-primary:hover, button.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-danger, button.btn-danger { color: var(--red); border-color: #e3a9b6; }
.btn-danger:hover, button.btn-danger:hover { background: #fbeceb; border-color: var(--red); }
.btn-danger-solid, button.btn-danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-solid:hover, button.btn-danger-solid:hover { background: #9e0026; border-color: #9e0026; }
.btn-row, button.btn-row { padding: 0.2rem 0.55rem; font-size: 0.8125rem; gap: 0.3rem; }

.btn-icon, button.btn-icon {
  padding: 0.3rem;
  border-color: transparent;
  background: none;
  color: var(--ink-soft);
}
.btn-icon:hover, button.btn-icon:hover { border-color: var(--line-strong); background: var(--surface); }
button[disabled] { opacity: 0.35; cursor: default; }

.icon { width: 1.05em; height: 1.05em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

a > .icon, span > .icon { vertical-align: -0.15em; }
a.external .icon { margin-left: 0.2rem; width: 0.9em; height: 0.9em; }

a.to-details { font-weight: 600; }

.buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 1.25rem; }

:is(input, select, textarea) + .buttons { margin-top: 0.7rem; }
.buttons form { display: inline; margin: 0; }
td .buttons, figcaption .buttons { margin: 0; gap: 0.35rem; justify-content: flex-end; }

td .buttons { flex-wrap: nowrap; }

dialog.modal[open] {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 1rem;
  border: none;
  background: rgba(20, 20, 20, 0.45);
}
.modal-box {
  width: min(100%, 28rem);
  padding: 1.25rem 1.5rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.modal-box h2 { margin: 0 0 0.5rem; font-size: 1.125rem; text-transform: none; letter-spacing: normal; color: var(--ink); }
.modal-box p { margin: 0 0 1.25rem; }

.modal-text { margin-bottom: 1.25rem; }
.modal-text p { margin: 0 0 0.35rem; }
.modal-buttons { justify-content: flex-end; margin: 0; }

.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
td .confirm { white-space: normal; }
td:last-child .confirm { justify-content: flex-end; }

.confirm input.paid-date { width: 9.5rem; margin: 0; padding: 0.15rem 0.35rem; font-size: 0.8125rem; }
td .confirm span, figcaption .confirm span { font-size: 0.8125rem; color: var(--red); }

dl {
  display: grid;
  grid-template-columns: 11rem 1fr;
  row-gap: 0.3rem;
  column-gap: 1rem;
  max-width: 44rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  font-variant-numeric: tabular-nums;
}
dt { color: var(--muted); font-size: 0.875rem; }
dd { margin: 0; min-height: 1.3em; }

dd.url, .field-table td.url { overflow-wrap: anywhere; }

.field-table td.url a { margin-left: 0; }

.field-box.detail-box { max-width: 44rem; }

.field-table { border: 0; margin: 0 -0.5rem 0.3rem; width: calc(100% + 1rem); background: transparent; font-size: 0.9375rem; }
.field-table tbody tr { border-top: 0; }
.field-table th, .field-table td { padding: 0.3rem 0.5rem; vertical-align: top; text-align: left; white-space: normal; }
.field-table th { width: calc(0.5rem + 11rem - 1rem - 1px + 1rem); padding-right: 1rem;    font-weight: normal; color: var(--muted); font-size: 0.875rem; }
.field-table td { min-height: 1.3em; }

.field-table td.multiline { white-space: pre-line; }

.field-markers { display: inline-flex; gap: 0.2rem; margin-left: 0.35rem; vertical-align: -0.1em; }
.field-marker { display: inline-flex; color: var(--muted); cursor: help; }
.field-marker .icon { width: 0.95em; height: 0.95em; }
.field-marker.marker-warning { color: var(--red); }

dd.calc, td.calc { font-style: italic; color: var(--muted); cursor: help; }

td.calc p.hint { margin: 0.15rem 0 0; font-style: normal; }

.calc-warning { color: var(--red); cursor: help; }
.calc-warning .icon { width: 0.95em; height: 0.95em; vertical-align: -0.12em; }
td .calc-warning { margin-right: 0.25rem; }
td .calc-warning.after { margin-right: 0; margin-left: 0.25rem; }
.legend li.calc-warning { color: inherit; cursor: default; }
.legend li.calc-warning .icon { color: var(--red); }
.legend li.calc .icon { width: 0.9em; height: 0.9em; margin-right: 0.25rem; color: var(--muted); vertical-align: -0.12em; }

.vehicle-list .with-warning { display: inline-block; max-width: 100%; vertical-align: bottom; }
.vehicle-list .with-warning > a { display: inline-block; max-width: calc(100% - 0.95em - 0.25rem); overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }

.car-warnings ul { list-style: none; margin: 0 0 1rem; padding: 0; }

.car-warnings li { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; padding: 0.2rem 0 0.2rem 1.5rem; }
.car-warnings li > .icon { position: absolute; left: 0; top: calc(0.2rem + 0.25em); width: 1em; height: 1em; color: var(--red); }
.car-warnings li.dismissed { color: var(--muted); }
.car-warnings li.dismissed > .icon { color: inherit; }
.car-warnings .dismissed-note { font-style: italic; }

.break-any { overflow-wrap: anywhere; }

.error, .field-validation-error {
  color: var(--red);
  font-size: 0.8125rem;
}
.warning { color: var(--amber); font-size: 0.8125rem; }

p.form-error, p.form-warning { margin: 0 0 0.6rem; }

p.error > .btn, p.form-warning > .btn { display: flex; width: fit-content; margin: 0.4rem 0 0; }

p.field-error { margin: 0.3rem 0 0; }
.notice > .btn { margin-left: 0.4rem; }
.input-validation-error { border-color: var(--red); }
.notice {
  background: var(--accent-tint);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  margin: 0 0 1rem;
}

.tick-list { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; padding-top: 0.45rem; }
.tick-list label { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }

.tick-columns { display: grid; grid-template-columns: minmax(0, 31rem) minmax(0, 15rem); gap: 0.75rem 2rem; padding-top: 0.45rem; }
@media (min-width: 721px) { form.short-labels .form-row { grid-template-columns: 5rem minmax(0, 1fr); } }
.tick-head { font-size: 0.8125rem; font-weight: 600; color: var(--muted); margin: 0 0 0.3rem; border: 0; padding: 0; }
.tick-stack { columns: 2 12rem; column-gap: 1.5rem; }
.tick-columns > div:nth-child(2) .tick-stack { columns: 1; }
.tick-stack label { display: flex; align-items: center; gap: 0.35rem; margin: 0 0 0.25rem; break-inside: avoid; font-weight: normal; }

.commit-split { display: flex; gap: 1.5rem; align-items: flex-start; }
.commit-split .form-pane { flex: 1; min-width: 420px; }
.commit-split .intake-pane { flex: 1.2; min-width: 0; }

.pdf-pane { flex: 1.2; width: 100%; height: 85vh; border: 1px solid var(--line-strong); border-radius: var(--radius); }

.doc-text-pane { flex: 1.2; width: 100%; min-width: 0; }
.doc-text {
  height: 80vh;
  overflow: auto;
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  font-size: 0.8125rem;
  line-height: 1.45;
  white-space: pre-wrap;
  tab-size: 4;
}

.hint { color: var(--muted); font-size: 0.8125rem; }
.intake-box { margin-top: 0; }
.intake-box .hint { margin: 0 0 0.75rem; }

.stats th.num, .stats td.num { text-align: right; white-space: nowrap; }

.stats td:last-child, .stats th:last-child { text-align: left; }
.stats td:last-child.num, .stats th:last-child.num { text-align: right; }
.stats tfoot td {
  font-weight: 650;
  border-top: 2px solid var(--ink);
  background: var(--paper);
}
.stats tbody tr.nodate td { color: var(--muted); font-style: italic; }
.stats th.muted, .stats td.muted { color: var(--muted); font-weight: 400; }
.stats .bar-col { min-width: 11rem; white-space: nowrap; }
.meter {
  display: inline-block;
  vertical-align: middle;
  width: 7rem;
  height: 0.6rem;
  margin-right: 0.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.meter .fill { display: block; height: 100%; background: var(--accent); }
.meter-value { display: inline-block; min-width: 2.5rem; text-align: right; }

body.login { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }

body.frame-error { padding: 1rem 1.25rem; background: var(--surface); }

.login-stage {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 191px)) minmax(22rem, 24rem) repeat(2, minmax(0, 191px));
  gap: 0.5rem;
  align-items: center;
  justify-items: center;
  justify-content: center;
  align-content: center;
  padding: 2rem;
}
.login-stage > img { display: block; width: 100%; max-width: 191px; height: auto; }

.c-velsatis  { grid-column: 1 / 3; grid-row: 1; align-self: end; }
.c-laguna    { grid-column: 3;     grid-row: 1; align-self: end; }
.c-avantime  { grid-column: 4 / 6; grid-row: 1; align-self: end; }
.c-cabriolet { grid-column: 1; grid-row: 2; }
.c-clio      { grid-column: 2; grid-row: 2; }
.c-espace    { grid-column: 4; grid-row: 2; }
.c-scenic    { grid-column: 5; grid-row: 2; }
.c-kangoo    { grid-column: 1; grid-row: 3; }
.c-kangoo4x4 { grid-column: 2; grid-row: 3; }
.login-stage > .c-kangooexp { display: none; }
.c-master    { grid-column: 4; grid-row: 3; }
.c-megane    { grid-column: 5; grid-row: 3; }
.c-trafic    { grid-column: 1 / 3; grid-row: 4; }
.c-rx4       { grid-column: 3;     grid-row: 4; }
.c-twingo    { grid-column: 4 / 6; grid-row: 4; }

.login-card {
  grid-column: 3;
  grid-row: 2 / 4;
  width: min(21rem, calc(100% - 3rem));
  margin: 1.5rem 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(20, 20, 20, 0.08);
  padding: 1.5rem 1.75rem 1.75rem;
}
.login-card .logo { height: 30px; display: block; margin: 0 0 1rem; }
.login-card h1 { margin: 0 0 1rem; }
.login-card input { width: 100%; }
.login-card button { width: 100%; margin-top: 0.5rem; justify-content: center; }

.login-brands { background: var(--surface); border-top: 1px solid var(--line); padding: 1.25rem 2rem; }
.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: center;
  gap: 1rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.badges li { display: block; }
.badges img { display: block; height: 34px; width: auto; }

.badges img.badge-dacia { height: 20px; }

.guide-toc ul { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; list-style: none; padding: 0; margin: 0 0 1.5rem; }
.guide { max-width: 46rem; }
.guide ul { padding-left: 1.25rem; }
.guide li { margin-bottom: 0.3rem; }

.nav-main a { white-space: nowrap; }
@media (max-width: 1340px) {
  .topbar-inner { padding: 0.4rem 1rem 0; flex-wrap: wrap; gap: 0.4rem 0.75rem; }
  .nav-account { flex-wrap: wrap; justify-content: flex-end; gap: 0.3rem 0.7rem; }
  .nav-main { order: 1; flex: 1 1 100%; flex-wrap: wrap; min-width: 0; margin-left: -0.6rem; }
  .nav-main a { min-height: 2.5rem; }
}

@media (max-width: 900px) {
  .details-split { grid-template-columns: minmax(0, 1fr); }
  .details-side > h2:first-child { margin-top: 0; }
  .login-stage {
    grid-template-columns: repeat(3, minmax(0, 191px));
    align-content: start;
    padding: 1.25rem 1rem 1.5rem;
  }
  .login-stage > img,
  .login-stage > .c-kangooexp { display: block; grid-column: auto; grid-row: auto; align-self: center; }
  .login-card { grid-column: 1 / -1; grid-row: auto; width: min(100%, 22rem); margin: 0 0 1rem; }
  .login-brands { padding: 1rem; }
  .badges { gap: 0.75rem 1.25rem; }
  .badges img { height: 26px; }
  .badges img.badge-dacia { height: 15px; }
}

@media (max-width: 720px) {
  .brand img { height: 20px; }
  .app-name { display: none; }
  .filter-search { flex: 1 1 100%; min-width: 0; }
  .filter-search input { flex: 1 1 auto; width: auto; min-width: 0; }
  .brandstrip ul { padding: 0 0.5rem; }
  .brandstrip a { padding: 0.6rem 0.7rem; letter-spacing: 0.06em; }
  main { padding: 1rem; }
  dl { grid-template-columns: 1fr; row-gap: 0; }
  dt { margin-top: 0.5rem; }
  .form-row, fieldset .form-row { grid-template-columns: 1fr; }
  .form-row > label { padding: 0 0 0.25rem; }
  .form-row > .hint { grid-column: 1; }
  .form-row .calc-value { padding-top: 0; min-height: 0; }
  .form-row .form-field > span.chipgroup { margin-top: 0; }
  .form-row .form-field > input[type="checkbox"] { margin-top: 0; }
  table { display: block; overflow-x: auto; }
  table.vehicle-list, table.service-table, table.sheet { display: table; }
  table.problems { display: table; table-layout: auto; }
  table.problems col.col-car, table.problems col.col-dismiss { width: auto; }
  table.problems td.ellipsis { white-space: normal; }
  table.problems td { overflow-wrap: anywhere; }
  .commit-split { flex-direction: column; align-items: stretch; }
  .commit-split .form-pane { min-width: 0; }
  .pdf-pane { width: 100%; height: 60vh; }
  .doc-text { height: 50vh; }
  .tick-columns { grid-template-columns: minmax(0, 1fr); }
  .tile-group { display: flex; }
  .tile-group .tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .tile.with-icon { min-width: 0; padding: 0.6rem 0.7rem; column-gap: 0.55rem; }
  .tile.with-icon .tile-icon { width: 2rem; height: 2rem; }
  .tile.with-icon .tile-icon .icon { width: 1rem; height: 1rem; }
}

@media (prefers-reduced-motion: no-preference) {
  button, .btn, .brandstrip a, .nav-main a, input, select, textarea { transition: background-color 120ms, border-color 120ms, color 120ms; }
}
