@font-face {
  font-family: "Satoshi";
  src: url("../font/Satoshi/Satoshi-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Satoshi";
  src: url("../font/Satoshi/Satoshi-VariableItalic.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --font-sans: "Satoshi", Arial, sans-serif;
  --brand-blue-900: #173b59;
  --brand-blue-800: #1d4668;
  --brand-blue-700: #274663;
  --brand-blue-600: #47647a;
  --brand-blue-500: #5d748a;
  --brand-gray-50: #f6f8fa;
  --brand-gray-75: #f0f3f6;
  --brand-gray-100: #e3e7eb;
  --brand-gray-200: #d2d9e0;
  --brand-gray-300: #b1bcc7;
  --brand-gray-400: #91a1b0;
  --brand-gray-500: #73889a;
  --brand-white: #ffffff;
  --slate-50: var(--brand-gray-50);
  --slate-100: var(--brand-gray-100);
  --slate-200: var(--brand-gray-200);
  --slate-300: var(--brand-gray-300);
  --slate-400: var(--brand-gray-400);
  --slate-500: var(--brand-gray-500);
  --slate-600: var(--brand-blue-500);
  --slate-700: var(--brand-blue-700);
  --slate-800: var(--brand-blue-800);
  --slate-900: #112f48;
  --brand-700: var(--brand-blue-900);
  --red-600: #c4473f;
  --green-600: #3f7b5a;
  --success-bg: color-mix(in srgb, var(--green-600) 14%, var(--white));
  --success-text: #2f6848;
  --danger-bg: color-mix(in srgb, var(--red-600) 12%, var(--white));
  --danger-text: #9c342f;
  --catalog-source-bg: color-mix(in srgb, var(--brand-blue-900) 5%, var(--white));
  --catalog-source-border: color-mix(in srgb, var(--brand-blue-900) 24%, var(--slate-200));
  --surface: var(--brand-white);
  --white: var(--brand-white);
  --shadow-soft: 0 8px 22px color-mix(in srgb, var(--slate-900) 5%, transparent);
  --shadow-tiny: 0 1px 0 color-mix(in srgb, var(--slate-900) 5%, transparent);
  --shadow-focus: 0 0 0 3px color-mix(in srgb, var(--brand-blue-900) 18%, transparent);
  --sidebar-expanded: 16rem;
  --sidebar-collapsed: 5.25rem;
  --sidebar-collapsed-control: 3.75rem;
  --content-max: 1440px;
  --space-2xs: .25rem;
  --space-xs: .5rem;
  --space-sm: .75rem;
  --space-md: 1rem;
  --space-lg: 1.25rem;
  --space-xl: 1.65rem;
  --radius-sm: .35rem;
  --radius-md: .5rem;
  --radius-lg: .75rem;
  --control-min: 2.75rem;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --transition-ui: 160ms var(--ease-out);
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  scroll-behavior: smooth;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--slate-50);
  color: var(--slate-900);
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font-family: var(--font-sans);
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: .75rem;
  z-index: 10;
  transform: translateY(-150%);
  background: var(--brand-blue-900);
  color: var(--white);
  border-radius: .65rem;
  padding: .55rem .8rem;
  font-weight: 700;
  transition: transform 160ms ease-out;
}

.skip-link:focus {
  transform: translateY(0);
}

.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-expanded) 1fr;
  transition: grid-template-columns 210ms var(--ease-out);
}

html.sidebar-collapsed .app-shell {
  grid-template-columns: var(--sidebar-collapsed) 1fr;
}

.mobile-topbar,
.sidebar-scrim {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--slate-100);
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}

.brand img {
  width: 10rem;
  height: auto;
  flex: 0 1 10rem;
  object-fit: contain;
}

.brand-copy,
.nav-label,
.logout-label,
.sidebar-footer .muted {
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 160ms ease, max-width 210ms var(--ease-out), transform 210ms var(--ease-out);
}

.brand-copy,
.nav-label,
.logout-label {
  max-width: 11rem;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 2.35rem;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--brand-blue-900);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.sidebar-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--slate-300);
  background: var(--slate-50);
}

.sidebar-toggle:active {
  transform: translateY(1px) scale(.98);
}

.brand strong {
  color: var(--slate-700);
  font-size: 1.05rem;
  line-height: 1.1;
}

.brand span {
  display: block;
  color: var(--slate-500);
  font-size: .78rem;
  font-weight: 700;
  margin-top: .1rem;
}

.nav {
  display: grid;
  gap: .35rem;
  margin-top: 1.25rem;
}

.nav a,
.logout-button {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  min-height: 2.75rem;
  padding: .65rem .8rem;
  border-radius: var(--radius-md);
  color: var(--slate-700);
  font-weight: 700;
  border: 0;
  background: transparent;
  font: inherit;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.nav a:hover,
.nav a.active,
.logout-button.active,
.logout-button:hover {
  background: var(--white);
}

.nav a.active,
.logout-button.active {
  color: var(--brand-blue-900);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-blue-900) 18%, var(--slate-200));
}

.nav a.active .material-symbols-rounded,
.logout-button.active .material-symbols-rounded {
  color: var(--brand-blue-900);
}

.nav a:hover,
.logout-button:hover {
  transform: translateY(-1px);
}

.nav a:active,
.logout-button:active,
.btn:active {
  transform: translateY(1px) scale(.99);
}

.nav .material-symbols-rounded,
.logout-button .material-symbols-rounded {
  color: var(--slate-500);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--slate-100);
  padding-top: var(--space-md);
}

.sidebar-footer form {
  width: 100%;
}

html.sidebar-collapsed .sidebar {
  padding-inline: .75rem;
}

html.sidebar-collapsed .sidebar-header {
  display: grid;
  justify-items: center;
  gap: .75rem;
}

html.sidebar-collapsed .brand {
  display: none;
  gap: 0;
  justify-content: center;
}

html.sidebar-collapsed .sidebar-toggle {
  order: -1;
  width: var(--sidebar-collapsed-control);
  height: var(--sidebar-collapsed-control);
  flex-basis: var(--sidebar-collapsed-control);
}

html.sidebar-collapsed .brand-copy,
html.sidebar-collapsed .nav-label,
html.sidebar-collapsed .logout-label,
html.sidebar-collapsed .sidebar-footer .muted {
  max-width: 0;
  opacity: 0;
  transform: translateX(-.35rem);
  visibility: hidden;
}

html.sidebar-collapsed .nav a,
html.sidebar-collapsed .logout-button {
  gap: 0;
  width: var(--sidebar-collapsed-control);
  min-height: var(--sidebar-collapsed-control);
  justify-content: center;
  padding: 0;
}

.content {
  min-width: 0;
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: clamp(1rem, 2vw, var(--space-xl));
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: var(--space-lg);
  align-items: flex-start;
  margin-bottom: var(--space-lg);
}

.topbar > div {
  min-width: 0;
}

.topbar > div:first-child {
  flex: 1 1 auto;
}

.topbar > .btn {
  flex: 0 0 auto;
  margin-left: auto;
}

.topbar > .actions {
  flex: 1 1 auto;
  justify-content: flex-end;
  margin-left: auto;
  max-width: 100%;
}

.topbar > .actions form {
  margin: 0;
  flex: 0 0 auto;
}

.topbar h1 {
  margin: 0;
  color: var(--brand-blue-900);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.12;
  text-wrap: balance;
}

.topbar p {
  margin: .25rem 0 0;
  color: var(--slate-500);
  max-width: 48rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.panel {
  padding: var(--space-lg);
}

.section-gap {
  margin-top: var(--space-lg);
}

.section-gap-xs {
  margin-top: var(--space-xs);
}

.block-gap {
  margin-bottom: var(--space-lg);
}

.block-text {
  display: block;
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin: 0 0 var(--space-md);
  color: var(--slate-800);
}

.panel-heading h2,
.panel-heading h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

.panel-heading.flush {
  margin: 0;
}

.disclosure-panel {
  padding: 0;
  overflow: hidden;
}

.disclosure-panel > summary {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 4rem;
  padding: var(--space-md) var(--space-lg);
  color: var(--slate-700);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.disclosure-panel > summary::-webkit-details-marker {
  display: none;
}

.disclosure-panel > summary:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.disclosure-title {
  display: grid;
  gap: .12rem;
  min-width: 0;
}

.disclosure-title strong {
  color: var(--slate-800);
  line-height: 1.2;
}

.disclosure-title span {
  color: var(--slate-500);
  font-size: .9rem;
  line-height: 1.35;
}

.disclosure-panel > summary > .material-symbols-rounded:first-child {
  color: var(--slate-500);
}

.disclosure-chevron {
  margin-left: auto;
  color: var(--slate-500);
  transition: transform 180ms var(--ease-out);
}

.disclosure-panel[open] > summary {
  border-bottom: 1px solid var(--slate-200);
}

.disclosure-panel[open] .disclosure-chevron {
  transform: rotate(180deg);
}

.disclosure-content {
  padding: var(--space-lg);
}

.disclosure-content > :first-child {
  margin-top: 0;
}

.disclosure-content > :last-child {
  margin-bottom: 0;
}

.inline-disclosure {
  border-top: 1px solid var(--slate-200);
  padding-top: var(--space-sm);
}

.inline-disclosure > summary {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--slate-700);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.inline-disclosure > summary::-webkit-details-marker {
  display: none;
}

.inline-disclosure > summary:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.inline-disclosure[open] .disclosure-chevron {
  transform: rotate(180deg);
}

.inline-disclosure > *:not(summary) {
  margin-top: var(--space-sm);
}

.metric-card {
  display: grid;
  gap: var(--space-2xs);
  align-content: start;
}

.metric-card h2 {
  margin: 0;
  color: var(--slate-800);
  font-weight: 700;
}

.metric-card .metric-text {
  font-size: 1rem;
  line-height: 1.25;
}

.metric-card .material-symbols-rounded {
  color: var(--slate-500);
}

.connection-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.connection-rule {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem .85rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--slate-700);
}

.connection-rule .material-symbols-rounded {
  color: var(--slate-500);
}

.connections-table {
  min-width: 76rem;
}

.connection-stack {
  display: grid;
  gap: .18rem;
  color: var(--slate-600);
  font-size: .88rem;
  line-height: 1.3;
}

.site-product-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .35rem;
}

.product-state-content {
  display: grid;
  gap: var(--space-md);
}

.product-state-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-xs);
  padding: var(--space-sm);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.product-state-summary div {
  display: grid;
  gap: .1rem;
  min-width: 0;
}

.product-state-summary strong {
  color: var(--slate-800);
  font-size: 1.15rem;
  line-height: 1.1;
}

.product-state-summary span {
  color: var(--slate-500);
  font-size: .82rem;
  font-weight: 700;
}

.product-state-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
}

.state-filter {
  min-height: 2.25rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: .45rem .75rem;
  background: var(--white);
  color: var(--slate-600);
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
}

.state-filter:hover,
.state-filter.is-active {
  border-color: color-mix(in srgb, var(--slate-700) 32%, var(--slate-200));
  background: var(--slate-700);
  color: var(--white);
}

.product-state-table {
  min-width: 68rem;
}

.connection-detail-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
  align-items: start;
}

.backup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-md);
  align-items: start;
}

.backup-card,
.backup-review-card {
  display: grid;
  gap: var(--space-md);
  min-width: 0;
  padding: var(--space-md);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.backup-collection-list,
.backup-collection-review {
  display: grid;
  gap: var(--space-sm);
  min-width: 0;
}

.backup-collection-list {
  max-height: 18rem;
  overflow: auto;
  padding-right: .25rem;
}

.backup-collection-option {
  align-items: center;
  min-height: 2.35rem;
}

.backup-collection-option.is-sensitive {
  background: var(--danger-bg);
  border-color: color-mix(in srgb, var(--red-600) 25%, var(--slate-200));
}

.backup-modal-body {
  display: grid;
  align-content: start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--surface);
}

.backup-review-head,
.backup-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  justify-content: space-between;
}

.backup-review-actions .field {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.backup-review-actions .field > span {
  color: var(--slate-600);
  font-weight: 700;
}

.backup-conflicts {
  display: grid;
  gap: var(--space-sm);
}

.backup-conflict-row {
  display: grid;
  gap: .55rem;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--slate-200);
}

.backup-conflict-row ul {
  display: grid;
  gap: .45rem;
  margin: 0;
  padding-left: 1.1rem;
}

.backup-conflict-row li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--space-xs);
  align-items: center;
}

.backup-conflict-row code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.backup-error {
  border-color: color-mix(in srgb, var(--red-600) 28%, var(--slate-200));
  background: var(--danger-bg);
  color: var(--danger-text);
}

.compact-copy {
  margin: 0;
  font-size: .92rem;
}

.activity-list {
  display: grid;
  gap: .75rem;
}

.activity-item {
  display: grid;
  gap: .2rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--slate-100);
}

.activity-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.activity-item strong {
  color: var(--slate-800);
}

.activity-item span,
.activity-item time {
  color: var(--slate-500);
  font-size: .9rem;
  overflow-wrap: anywhere;
}

.detail-list {
  display: grid;
  gap: .65rem;
}

.detail-list > div {
  display: grid;
  grid-template-columns: minmax(8rem, .55fr) minmax(0, 1fr);
  gap: var(--space-sm);
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--slate-100);
}

.detail-list > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-list span {
  color: var(--slate-500);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.detail-list strong {
  min-width: 0;
  color: var(--slate-800);
  overflow-wrap: anywhere;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.toolbar.section-gap {
  margin-bottom: 0;
}

.toolbar .panel-heading {
  margin-bottom: 0;
}

.toolbar > .actions {
  margin-left: auto;
  justify-content: flex-end;
}

.search-form {
  display: flex;
  gap: var(--space-xs);
  flex: 1;
  min-width: min(24rem, 100%);
}

.search-form .input {
  min-width: 0;
}

.input,
.textarea,
.select {
  width: 100%;
  max-width: 100%;
  min-height: var(--control-min);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--slate-900);
  font: inherit;
  line-height: 1.35;
  padding: .65rem .85rem;
  outline: none;
  transition: border-color var(--transition-ui), box-shadow var(--transition-ui), background-color var(--transition-ui);
}

.textarea {
  min-height: 6rem;
  resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--brand-blue-700);
  box-shadow: var(--shadow-focus);
}

.input::file-selector-button {
  min-height: 2rem;
  margin: -.25rem .75rem -.25rem -.45rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--slate-100);
  color: var(--slate-700);
  font: inherit;
  font-weight: 700;
  padding: .35rem .65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-width: 0;
  max-width: 100%;
  min-height: var(--control-min);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  padding: .65rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.12;
  white-space: normal;
  text-align: center;
  transition: background-color var(--transition-ui), border-color var(--transition-ui), color var(--transition-ui), transform var(--transition-ui);
}

.btn-primary {
  color: var(--white);
  background: var(--brand-blue-900);
  border-color: var(--brand-blue-900);
  box-shadow: none;
}

.btn-secondary {
  color: var(--slate-700);
  background: var(--white);
  border-color: var(--slate-200);
}

.btn-tertiary {
  color: var(--slate-700);
  background: transparent;
  border-color: transparent;
}

.btn-danger {
  color: var(--white);
  background: var(--red-600);
  border-color: var(--red-600);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
  box-shadow: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary:hover {
  background: var(--brand-blue-800);
  border-color: var(--brand-blue-800);
}

.btn-secondary:hover,
.btn-tertiary:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
}

.btn .material-symbols-rounded {
  flex: 0 0 auto;
  font-size: 1.12rem;
}

.btn:focus-visible,
.nav a:focus-visible,
.logout-button:focus-visible,
.sidebar-toggle:focus-visible,
.skip-link:focus-visible,
.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--slate-700) 28%, transparent);
  outline-offset: 2px;
}

.btn-small {
  min-height: 2.25rem;
  padding: .45rem .7rem;
  font-size: .9rem;
}

.table-wrap {
  overflow-x: auto;
  border-radius: calc(var(--radius-lg) - .25rem);
}

table {
  width: 100%;
  min-width: 58rem;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

th,
td {
  padding: .8rem .9rem;
  border-bottom: 1px solid var(--slate-100);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th {
  color: var(--slate-500);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
  overflow-wrap: normal;
  white-space: nowrap;
}

td strong {
  color: var(--slate-800);
}

tbody tr {
  transition: background-color 140ms ease;
}

tbody tr:hover {
  background: var(--surface);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td:first-child,
th:first-child {
  padding-left: 1rem;
}

td:last-child,
th:last-child {
  padding-right: 1rem;
}

.table-title {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.table-title .material-symbols-rounded {
  color: var(--slate-500);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: .35rem;
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--slate-500);
}

.empty-state .material-symbols-rounded {
  font-size: 2rem;
  color: var(--slate-500);
}

.empty-state strong {
  color: var(--slate-700);
}

.asset-cell {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}

.asset-cell > * {
  min-width: 0;
}

.asset-preview,
.logo-preview {
  display: inline-block;
  width: 3rem;
  height: 3rem;
  flex: 0 0 3rem;
  object-fit: contain;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-md);
  background: var(--white);
  padding: .35rem;
}

.asset-preview--logo-sm {
  width: 2.6rem;
  height: 2.6rem;
  flex-basis: 2.6rem;
}

.asset-preview--logo-lg {
  width: 4rem;
  height: 4rem;
  flex-basis: 4rem;
}

.asset-preview--plain {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.asset-preview--product {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

.asset-placeholder {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--slate-50);
  color: var(--slate-500);
  font-weight: 900;
  letter-spacing: .04em;
}

.asset-grid,
.product-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.asset-card,
.product-image-item {
  display: grid;
  gap: var(--space-xs);
  min-width: 0;
  padding: var(--space-sm);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.asset-card img,
.product-image-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-sm);
  background: var(--white);
}

.asset-card label span,
.product-image-item label span {
  display: block;
  margin-bottom: .3rem;
  color: var(--slate-600);
  font-size: .84rem;
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
  min-width: 0;
}

.detail-item {
  min-width: 0;
  margin: 0;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-800);
  overflow-wrap: anywhere;
}

.detail-item strong {
  display: block;
  margin-bottom: .28rem;
  color: var(--slate-500);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.detail-item--wide {
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  align-items: center;
}

td:last-child .actions,
td:last-child > form,
td:last-child > .btn {
  justify-content: flex-end;
}

.actions form {
  margin: 0;
}

@media (min-width: 641px) {
  .catalog-actions-heading,
  .catalog-actions-cell {
    width: 19rem;
    min-width: 19rem;
  }

  .catalog-row-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    white-space: nowrap;
  }

  .catalog-row-actions form,
  .catalog-row-actions .btn-small {
    flex: 0 0 auto;
  }
}

.catalog-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: var(--space-md);
  align-items: end;
  margin-bottom: var(--space-lg);
}

.catalog-filters .field:first-child {
  grid-column: span 2;
}

.catalog-filter-actions {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
  grid-column: 1 / -1;
}

.catalog-filter-actions .btn {
  white-space: nowrap;
}

.catalog-active-vehicle-filter {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: .72rem .85rem;
  margin: calc(var(--space-sm) * -1) 0 var(--space-md);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--slate-50);
  color: var(--slate-700);
}

.catalog-active-vehicle-filter .material-symbols-rounded {
  color: var(--brand-blue-900);
}

.catalog-active-vehicle-filter strong,
.catalog-active-vehicle-filter span {
  display: block;
}

.catalog-active-vehicle-filter strong {
  color: var(--slate-800);
  line-height: 1.25;
}

.catalog-active-vehicle-filter span {
  color: var(--slate-500);
  font-size: .86rem;
  line-height: 1.35;
}

@media (min-width: 1180px) {
  .catalog-filters {
    grid-template-columns:
      minmax(18rem, 1.6fr)
      minmax(8.5rem, .8fr)
      minmax(8.5rem, .8fr)
      minmax(9rem, .85fr)
      minmax(8.5rem, .8fr)
      minmax(8.5rem, .8fr)
      max-content;
    gap: var(--space-sm);
  }

  .catalog-filters .field:first-child,
  .catalog-filter-actions {
    grid-column: auto;
  }

  .catalog-filter-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
}

.bulk-toolbar {
  display: grid;
  grid-template-columns: minmax(12rem, .85fr) minmax(13rem, 1fr) minmax(13rem, 1fr) auto max-content;
  align-items: end;
  gap: var(--space-sm);
  padding: var(--space-sm);
  margin-bottom: var(--space-md);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.bulk-action-field,
.bulk-category-field {
  width: 100%;
}

.bulk-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-self: end;
  gap: var(--space-xs);
  min-width: 0;
}

.bulk-toolbar-actions .btn {
  white-space: nowrap;
}

.bulk-selection-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  align-self: end;
  min-height: var(--control-min);
  margin-left: 0;
  padding: 0 .35rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

tr.is-selected {
  background: var(--slate-50);
}

tr.is-selected:hover {
  background: var(--slate-100);
}

.table-check {
  width: 3rem;
  min-width: 3rem;
  text-align: center;
}

.table-check input[type="checkbox"] {
  width: 1.18rem;
  height: 1.18rem;
  accent-color: var(--slate-700);
}

.catalog-pagination {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--space-sm);
  align-items: center;
}

.catalog-pagination > .muted {
  justify-self: start;
}

.catalog-pagination > .page-number-list {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
}

.catalog-pagination > .actions {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.catalog-pagination > .btn:first-child {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.catalog-pagination > .btn:last-child {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.catalog-pagination > .btn + .muted {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
}

.page-number-list {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: center;
}

.page-number,
.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.page-number {
  border: 1px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-700);
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.page-number:hover {
  transform: translateY(-1px);
  border-color: var(--slate-300);
  background: var(--slate-50);
}

.page-number.is-current {
  background: var(--brand-blue-900);
  border-color: var(--brand-blue-900);
  color: var(--white);
}

.page-ellipsis {
  color: var(--slate-500);
}

.table-display-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: fit-content;
  max-width: 100%;
  margin: var(--space-md) auto 0;
  padding: .45rem .65rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--slate-600);
  font-size: .9rem;
  font-weight: 700;
}

.table-display-control label,
.table-display-control span {
  white-space: nowrap;
}

.table-display-control-minimal {
  gap: .3rem;
  margin-top: var(--space-sm);
  padding: .16rem .22rem .16rem .42rem;
  border-color: transparent;
  background: transparent;
  color: var(--slate-500);
  font-size: .82rem;
}

.table-display-control-minimal .table-display-icon {
  color: var(--slate-500);
  font-size: 1.05rem;
}

.table-display-control-minimal .compact-select {
  min-width: 3.65rem;
  min-height: 2rem;
  padding: .25rem 1.45rem .25rem .55rem;
  border-radius: var(--radius-sm);
  background-color: var(--white);
  color: var(--slate-700);
  font-size: .85rem;
  font-weight: 800;
}

.compact-select {
  width: auto;
  min-width: 7.25rem;
  min-height: 2.25rem;
  padding-block: .4rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: .25rem .55rem;
  background: var(--surface);
  color: var(--slate-700);
  font-weight: 700;
  font-size: .85rem;
  line-height: 1.25;
  white-space: nowrap;
}

.badge .material-symbols-rounded {
  font-size: 1rem;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: color-mix(in srgb, var(--green-600) 24%, var(--slate-200));
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: color-mix(in srgb, var(--red-600) 24%, var(--slate-200));
}

.badge-neutral {
  background: var(--slate-100);
  color: var(--slate-700);
}

.product-readiness {
  margin-bottom: var(--space-lg);
}

.readiness-toolbar {
  align-items: center;
}

.readiness-body {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(16rem, .75fr);
  gap: var(--space-md);
  align-items: start;
}

.readiness-body strong {
  display: block;
  margin-bottom: .25rem;
  color: var(--slate-900);
  font-size: 1.02rem;
}

.readiness-body p {
  margin: 0;
}

.readiness-missing {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.readiness-missing .badge {
  max-width: 100%;
  white-space: normal;
  text-align: left;
}

.grid {
  display: grid;
  gap: var(--space-md);
  min-width: 0;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-all {
  grid-column: 1 / -1;
}

.category-create-form {
  align-items: end;
}

.user-create-form {
  align-items: end;
}

@media (min-width: 1180px) {
  .category-create-form {
    grid-template-columns: minmax(16rem, 1fr) minmax(16rem, 1fr) max-content max-content;
    gap: var(--space-sm);
  }

  .category-create-form .checkbox-field {
    min-height: 2.875rem;
    align-self: end;
    white-space: nowrap;
  }

  .category-create-form .form-actions {
    grid-column: auto;
    width: auto;
    margin-left: 0;
    justify-content: flex-start;
  }

  .category-create-form .form-actions .btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .user-create-form {
    grid-template-columns: minmax(14rem, 1fr) minmax(14rem, 1fr) minmax(12rem, 1fr) max-content;
    gap: var(--space-sm);
  }

  .user-create-form .submit-row {
    grid-column: auto;
    width: auto;
    margin-left: 0;
    justify-content: flex-start;
  }

  .user-create-form .submit-row .btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

.field label {
  display: block;
  margin-bottom: .35rem;
  color: var(--slate-700);
  font-weight: 700;
}

.field-label-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .35rem;
  min-width: 0;
}

.field-label-row label {
  margin-bottom: 0;
}

.field-help {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.field-help summary {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--slate-600);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
  list-style: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.field-help summary::-webkit-details-marker {
  display: none;
}

.field-help summary:hover,
.field-help[open] summary {
  background: var(--brand-blue-900);
  border-color: var(--brand-blue-900);
  color: var(--white);
}

.field-help summary:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.field-help-popover {
  position: absolute;
  left: -.45rem;
  top: calc(100% + .45rem);
  z-index: 20;
  width: min(20rem, calc(100vw - 2rem));
  padding: .75rem .85rem;
  border: 1px solid var(--brand-blue-900);
  border-radius: var(--radius-md);
  background: var(--brand-blue-900);
  color: var(--white);
  box-shadow: none;
  font-size: .86rem;
  font-weight: 500;
  line-height: 1.35;
}

.field-help-popover::before {
  content: "";
  position: absolute;
  left: .7rem;
  top: -.36rem;
  width: .65rem;
  height: .65rem;
  background: var(--brand-blue-900);
  border-left: 1px solid var(--brand-blue-900);
  border-top: 1px solid var(--brand-blue-900);
  transform: rotate(45deg);
}

.field-hint {
  display: block;
  min-height: 1.15rem;
  margin-top: .3rem;
  color: var(--slate-500);
  font-size: .84rem;
  line-height: 1.35;
}

.html-editor {
  display: grid;
  gap: var(--space-xs);
}

.html-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}

.html-editor-toolbar .btn {
  min-width: 0;
}

.html-editor-toolbar .btn.is-active,
.html-editor-toolbar .btn[aria-pressed="true"] {
  color: var(--white);
  background: var(--brand-blue-900);
  border-color: var(--brand-blue-900);
}

.html-editor-source {
  min-height: 10.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .92rem;
  line-height: 1.5;
}

.html-editor-preview {
  min-height: 7rem;
  overflow-x: auto;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--slate-800);
  padding: var(--space-md);
  line-height: 1.55;
}

.html-editor-preview.is-empty {
  color: var(--slate-500);
  font-style: italic;
}

.html-editor-preview > :first-child {
  margin-top: 0;
}

.html-editor-preview > :last-child {
  margin-bottom: 0;
}

.html-editor-preview h2,
.html-editor-preview h3 {
  color: var(--slate-900);
  line-height: 1.2;
  margin: .9rem 0 .45rem;
}

.html-editor-preview h2 {
  font-size: 1.25rem;
}

.html-editor-preview h3 {
  font-size: 1.05rem;
}

.html-editor-preview p,
.html-editor-preview ul,
.html-editor-preview ol {
  margin: .55rem 0;
}

.html-editor-preview ul,
.html-editor-preview ol {
  padding-left: 1.25rem;
}

.html-editor-preview a {
  color: var(--brand-blue-900);
  text-decoration: underline;
  text-underline-offset: .16em;
}

.html-editor-preview table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  border-spacing: 0;
}

.html-editor-preview th,
.html-editor-preview td {
  padding: .55rem .65rem;
  border: 1px solid var(--slate-100);
  background: var(--white);
  color: var(--slate-800);
  text-align: left;
  vertical-align: top;
}

.html-editor-preview th {
  width: 28%;
  background: var(--slate-50);
  color: var(--slate-900);
  font-weight: 700;
}

.field,
.grid > *,
.scope-option > span {
  min-width: 0;
}

.measure-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem;
  gap: var(--space-xs);
  align-items: center;
}

.relation-builder {
  display: grid;
  grid-template-columns: minmax(10rem, .9fr) minmax(10rem, 1fr) max-content;
  gap: var(--space-xs);
  align-items: center;
  margin-bottom: var(--space-xs);
}

.merchant-assist {
  display: grid;
  gap: var(--space-sm);
  padding: var(--space-md);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--brand-blue-900) 3%, var(--white));
}

.merchant-assist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-width: 0;
}

.merchant-assist h3 {
  margin: 0;
  color: var(--slate-900);
  font-size: 1rem;
  line-height: 1.2;
}

.merchant-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-xs);
}

.suggestion-action {
  display: grid;
  gap: .2rem;
  min-width: 0;
  min-height: 5rem;
  padding: .7rem .75rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--slate-700);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color var(--transition-ui), background-color var(--transition-ui), box-shadow var(--transition-ui);
}

.suggestion-action:hover {
  border-color: var(--brand-blue-700);
  background: color-mix(in srgb, var(--brand-blue-900) 4%, var(--white));
}

.suggestion-action:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.suggestion-action span {
  color: var(--slate-500);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.suggestion-action strong,
.suggestion-action small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-action strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--slate-900);
  font-size: .92rem;
  line-height: 1.25;
}

.suggestion-action small {
  display: block;
  color: var(--slate-500);
  font-size: .78rem;
  line-height: 1.25;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .merchant-suggestion-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .relation-builder {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .merchant-assist-head {
    align-items: stretch;
    flex-direction: column;
  }

  .merchant-assist-head .btn,
  .relation-builder .btn {
    width: 100%;
  }

  .merchant-suggestion-grid,
  .measure-control {
    grid-template-columns: 1fr;
  }

  .html-editor-toolbar .btn {
    flex: 1 1 8.5rem;
  }

  .html-editor-preview th {
    width: auto;
  }
}

.muted {
  color: var(--slate-500);
}

.flash {
  margin-bottom: var(--space-md);
  padding: .85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  background: var(--white);
  font-weight: 700;
}

.flash.error {
  border-color: color-mix(in srgb, var(--red-600) 35%, var(--slate-200));
  background: var(--danger-bg);
  color: var(--danger-text);
}

.flash.success {
  border-color: color-mix(in srgb, var(--green-600) 35%, var(--slate-200));
  background: var(--success-bg);
  color: var(--success-text);
}

.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--slate-50);
}

.login-card {
  width: min(28rem, 100%);
  padding: 2rem;
  box-shadow: none;
  text-align: center;
}

.login-logo {
  display: block;
  width: min(15rem, 82%);
  height: auto;
  margin: 0 auto 1.75rem;
  object-fit: contain;
}

.login-card form,
.login-card .flash {
  text-align: left;
}

.vehicle-row {
  padding: var(--space-md);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-sm);
  background: var(--surface);
  box-shadow: none;
}

.vehicle-row-catalog {
  border-color: var(--catalog-source-border);
  background: var(--catalog-source-bg);
}

.vehicle-row-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
  min-width: 0;
}

.vehicle-origin-badge {
  border-color: var(--catalog-source-border);
  background: color-mix(in srgb, var(--brand-blue-900) 9%, var(--white));
  color: var(--brand-blue-900);
}

.vehicle-origin-badge[hidden] {
  display: none;
}

.logo-cell {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}

.logo-cell .logo-preview {
  border: 0;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.product-image-manager {
  padding-top: var(--space-xs);
}

.product-image-upload {
  display: grid;
  gap: var(--space-xs);
}

.product-image-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 2.35rem;
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--red-600) 28%, var(--slate-200));
  border-radius: var(--radius-sm);
  padding: .55rem .75rem;
  background: var(--danger-bg);
  color: var(--danger-text);
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
  transition:
    background-color var(--transition-ui),
    border-color var(--transition-ui),
    color var(--transition-ui),
    transform var(--transition-ui);
}

.product-image-delete:hover,
.product-image-delete:focus-visible {
  border-color: var(--red-600);
  background: var(--red-600);
  color: var(--white);
  transform: translateY(-1px);
}

.product-image-delete .material-symbols-rounded {
  font-size: 1.1rem;
  line-height: 1;
}

.product-image-delete-note {
  display: block;
  color: var(--slate-500);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.3;
}

.readonly-image-grid {
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
}

.code-box {
  display: block;
  overflow-x: auto;
  padding: .85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  background: var(--slate-50);
  color: var(--slate-800);
  font-family: var(--font-sans);
  overflow-wrap: anywhere;
}

.worker-panel {
  position: relative;
}

.vehicle-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .35rem;
  margin-bottom: var(--space-lg);
  padding: .35rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: none;
  overflow-x: auto;
  scrollbar-width: thin;
}

.vehicle-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: .38rem;
  min-height: 2.45rem;
  padding: .55rem .72rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--slate-600);
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.vehicle-tab:hover,
.vehicle-tab:focus-visible {
  border-color: var(--slate-200);
  background: var(--surface);
  color: var(--slate-800);
}

.vehicle-tab.is-active {
  border-color: var(--brand-blue-900);
  background: var(--brand-blue-900);
  color: var(--white);
  box-shadow: none;
}

.vehicle-tab .material-symbols-rounded {
  color: var(--slate-500);
  font-size: 1.05rem;
}

.vehicle-tab.is-active .material-symbols-rounded {
  color: var(--white);
}

.vehicle-page-sections {
  display: grid;
  gap: calc(var(--space-lg) * 1.15);
  min-width: 0;
}

.vehicle-tab-panel {
  min-width: 0;
}

.vehicle-tab-panel[hidden] {
  display: none;
}

.vehicle-anchor {
  position: relative;
  top: calc(var(--space-lg) * -1);
}

.vehicle-section {
  padding-top: 0;
  border-top: 0;
}

.vehicle-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.vehicle-section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-md);
  align-items: end;
  margin-bottom: var(--space-md);
}

.vehicle-section-header h2,
.vehicle-section-header p {
  margin: 0;
}

.vehicle-section-header h2 {
  color: var(--slate-900);
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1.12;
  text-wrap: balance;
}

.vehicle-section-header p {
  color: var(--slate-600);
  line-height: 1.45;
}

.vehicle-section-header.compact {
  margin-bottom: var(--space-sm);
}

.vehicle-section-kicker {
  display: inline-flex;
  margin-bottom: .35rem;
  color: var(--slate-500);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.logo-upload-form {
  display: grid;
  grid-template-columns: minmax(15rem, .95fr) minmax(14rem, .7fr) minmax(13rem, .7fr);
  gap: var(--space-md);
  align-items: start;
}

.logo-upload-preview {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-height: 4.7rem;
  padding: .7rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.logo-upload-frame {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--white);
}

.logo-upload-frame img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.logo-upload-placeholder {
  color: var(--slate-500);
  font-weight: 900;
  letter-spacing: .04em;
}

.logo-active-toggle {
  align-self: center;
  margin-top: 1.75rem;
}

.logo-upload-form .form-actions {
  display: flex;
  justify-content: flex-end;
  align-self: end;
}

.manual-vehicle-grid {
  display: grid;
  grid-template-columns: minmax(18rem, .82fr) minmax(0, 1.18fr);
  gap: var(--space-md);
  align-items: start;
}

.manual-entry-form {
  align-items: end;
}

.manual-vehicle-grid > .card:first-child .manual-entry-form {
  grid-template-columns: 1fr;
}

.manual-entry-form .form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.maker-brand-cell {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 12rem;
}

.maker-logo {
  width: 2.6rem;
  height: 2.6rem;
  flex-basis: 2.6rem;
}

.maker-logo-placeholder {
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  flex: 0 0 2.6rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--slate-50);
  color: var(--slate-500);
  font-size: .78rem;
  font-weight: 800;
}

.worker-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-sm);
  align-items: center;
}

.worker-progress-track {
  height: .7rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--slate-100);
}

.worker-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green-600);
  transition: width 260ms var(--ease-out);
}

.worker-progress strong {
  color: var(--slate-700);
  font-size: .9rem;
  white-space: nowrap;
}

.worker-metric {
  min-height: 4.75rem;
  padding: var(--space-sm);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.worker-metric strong {
  color: var(--slate-800);
  font-size: 1.05rem;
  line-height: 1.25;
}

.worker-log {
  display: grid;
  gap: .45rem;
  max-height: 13rem;
  overflow: auto;
  font-size: .86rem;
}

.worker-log-row {
  display: grid;
  grid-template-columns: 5.25rem 4.75rem minmax(0, 1fr);
  gap: .65rem;
  align-items: baseline;
}

.worker-log-row span,
.worker-log-row strong {
  color: var(--slate-600);
  font-size: .78rem;
}

.worker-log-row strong {
  text-transform: uppercase;
}

.worker-log-row p {
  margin: 0;
  color: var(--slate-800);
}

.worker-log-row.is-error p,
.worker-log-row.is-error strong {
  color: var(--red-600);
}

.worker-log-empty {
  color: var(--slate-500);
}

.maker-progress-table {
  min-width: 64rem;
}

.coverage-cell {
  min-width: 14rem;
}

.coverage-progress {
  height: .62rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--slate-100);
}

.coverage-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--slate-600);
  transition: width 260ms var(--ease-out), background-color 180ms ease;
}

.coverage-fill.is-complete {
  background: var(--green-600);
}

.coverage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .55rem;
  margin-top: .42rem;
  color: var(--slate-500);
  font-size: .84rem;
  line-height: 1.3;
}

.coverage-meta strong {
  color: var(--slate-800);
}

.vehicle-catalog-panel {
  padding: var(--space-sm);
}

.vehicle-catalog-browser {
  display: grid;
  grid-template-columns: minmax(11.5rem, 15rem) minmax(0, 1fr);
  gap: var(--space-xs);
  height: clamp(44rem, calc(100dvh - 19rem), 58rem);
}

.vehicle-browser-main {
  display: grid;
  grid-template-rows: minmax(14rem, 20rem) minmax(0, 1fr);
  gap: var(--space-xs);
  min-width: 0;
  min-height: 0;
}

.vehicle-browser-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--white);
}

.vehicle-browser-panel--makers,
.vehicle-browser-panel--models,
.vehicle-browser-panel--versions {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.vehicle-browser-title {
  display: flex;
  align-items: center;
  min-height: 2.15rem;
  padding: .45rem .65rem;
  background: var(--brand-blue-900);
  color: var(--white);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.1;
  text-transform: uppercase;
}

.vehicle-browser-list {
  flex: 1;
  min-height: 0;
  max-height: 41.85rem;
  overflow: auto;
}

.vehicle-browser-panel--makers .vehicle-browser-list,
.vehicle-browser-panel--models .vehicle-browser-list {
  max-height: none;
}

.vehicle-browser-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  min-height: 2.18rem;
  padding: .35rem .55rem;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--slate-100) 82%, transparent);
  border-radius: 0;
  background: var(--white);
  color: var(--slate-800);
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.vehicle-browser-row:nth-child(even) {
  background: var(--slate-50);
}

.vehicle-browser-row:hover {
  background: color-mix(in srgb, var(--brand-blue-900) 7%, var(--white));
}

.vehicle-browser-row:focus-visible {
  position: relative;
  z-index: 1;
  outline: none;
  box-shadow: inset 0 0 0 2px var(--brand-blue-900), var(--shadow-focus);
}

.vehicle-browser-row.is-selected {
  background: color-mix(in srgb, var(--brand-blue-900) 13%, var(--white));
  color: var(--brand-blue-900);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-blue-900) 18%, transparent);
}

.vehicle-browser-row-label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: .4rem;
}

.vehicle-browser-row-label strong {
  overflow: hidden;
  color: inherit;
  font-size: .88rem;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vehicle-model-row .vehicle-browser-row-label strong {
  font-weight: 700;
}

.vehicle-maker-logo {
  flex: 0 0 1.75rem;
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
  padding: .12rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--white);
}

.vehicle-maker-logo--fallback {
  display: inline-grid;
  place-items: center;
  color: var(--slate-700);
  font-size: .68rem;
  font-weight: 900;
}

.vehicle-browser-source {
  display: inline-flex;
  align-items: center;
  padding: .08rem .32rem;
  border-radius: var(--radius-sm);
  background: var(--success-bg);
  color: var(--success-text);
  font-size: .65rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
}

.vehicle-browser-empty {
  display: grid;
  place-items: center;
  gap: .25rem;
  min-height: 7.5rem;
  padding: var(--space-md);
  color: var(--slate-500);
  text-align: center;
}

.vehicle-browser-empty .material-symbols-rounded {
  font-size: 1.55rem;
}

.vehicle-browser-empty strong {
  color: var(--slate-700);
  font-size: .92rem;
}

.vehicle-browser-empty span:last-child {
  max-width: 24rem;
  font-size: .84rem;
  line-height: 1.35;
}

.vehicle-version-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.vehicle-version-table {
  min-width: 52rem;
  font-size: .84rem;
}

.vehicle-version-table th,
.vehicle-version-table td {
  padding: .46rem .62rem;
  border-bottom-color: var(--slate-100);
  white-space: nowrap;
}

.vehicle-version-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--white);
}

.vehicle-version-table tbody tr:nth-child(even) {
  background: var(--slate-50);
}

.vehicle-version-table tbody tr:hover {
  background: color-mix(in srgb, var(--brand-blue-900) 6%, var(--white));
}

.vehicle-version-table tbody tr.is-selected {
  background: color-mix(in srgb, var(--brand-blue-900) 11%, var(--white));
}

.vehicle-version-table td:first-child {
  min-width: 16rem;
  white-space: normal;
}

.vehicle-version-table td code {
  color: var(--slate-800);
  font-family: var(--font-sans);
  font-weight: 700;
}

.vehicle-version-subline {
  display: block;
  margin-top: .12rem;
  color: var(--slate-500);
  font-size: .74rem;
  font-weight: 600;
}

.vehicle-version-action-cell {
  width: 3rem;
  text-align: right;
}

.vehicle-version-action {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--slate-700);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.vehicle-version-action:hover,
.vehicle-version-action:focus-visible {
  border-color: var(--brand-blue-900);
  background: var(--brand-blue-900);
  color: var(--white);
  outline: none;
}

.vehicle-version-action .material-symbols-rounded {
  font-size: 1rem;
}

.vehicle-version-empty td {
  height: 12rem;
  color: var(--slate-500);
  text-align: center;
  white-space: normal;
}

.vehicle-version-empty .material-symbols-rounded,
.vehicle-version-empty strong,
.vehicle-version-empty span {
  display: block;
}

.vehicle-version-empty .material-symbols-rounded {
  margin-bottom: .35rem;
  font-size: 1.55rem;
}

.vehicle-version-empty strong {
  color: var(--slate-700);
}

.vehicle-version-empty span:last-child {
  margin-top: .2rem;
  font-size: .84rem;
}

.help-list {
  display: grid;
  gap: .75rem;
  color: var(--slate-700);
}

.help-list p {
  margin: 0;
  line-height: 1.55;
}

.help-list code,
.scope-option code {
  font-family: var(--font-sans);
  color: var(--slate-600);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: .45rem;
  padding: .12rem .35rem;
}

.scope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
}

.scope-grid-compact {
  grid-template-columns: repeat(2, minmax(10rem, 1fr));
  gap: .45rem;
}

.category-scope-grid {
  max-height: 15rem;
  overflow: auto;
  padding-right: .15rem;
}

.scope-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-sm);
  align-items: flex-start;
  min-height: 7.25rem;
  padding: var(--space-sm);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--white);
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.scope-option-compact {
  min-height: auto;
  padding: .55rem;
}

.scope-option-inline {
  width: min(34rem, 100%);
  margin-top: .35rem;
  background: var(--surface);
}

.scope-option:hover {
  transform: translateY(-1px);
  border-color: var(--slate-300);
  background: var(--slate-50);
}

.scope-option input {
  margin-top: .2rem;
  accent-color: var(--slate-700);
  width: 1rem;
  height: 1rem;
}

.scope-option strong,
.scope-option small,
.scope-option code {
  display: block;
}

.scope-option small {
  margin: .2rem 0 .45rem;
  color: var(--slate-500);
  line-height: 1.35;
}

.scope-option-compact small {
  display: none;
}

.scope-option-inline.scope-option-compact small {
  display: block;
  margin-bottom: 0;
}

.scope-list {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}

.scope-pill {
  display: inline-flex;
  align-items: center;
  border-radius: .55rem;
  padding: .25rem .45rem;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  font-size: .85rem;
  font-weight: 700;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.scope-pill-muted {
  background: var(--slate-100);
  color: var(--slate-500);
}

.key-scope-editor {
  margin-top: .55rem;
}

.key-scope-editor summary {
  cursor: pointer;
  color: var(--brand-700);
  font-weight: 800;
}

.key-scope-form {
  display: grid;
  gap: var(--space-sm);
  margin-top: .55rem;
  padding: .75rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--slate-50);
}

.key-scope-section {
  display: grid;
  gap: .45rem;
}

.key-scope-section > strong {
  color: var(--slate-800);
}

.form-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.form-actions .btn {
  flex: 0 1 auto;
}

.form-footer {
  grid-column: 1 / -1;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--slate-100);
}

.compact-input {
  min-height: 2.25rem;
  width: min(14rem, 100%);
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--slate-700);
  font-weight: 700;
}

.checkbox-field input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--slate-700);
}

.clean-import-option {
  align-items: flex-start;
  padding: var(--space-sm);
  border: 1px solid color-mix(in srgb, var(--red-600) 28%, var(--slate-200));
  border-radius: var(--radius-md);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.clean-import-option input {
  margin-top: .2rem;
  accent-color: var(--red-600);
}

.preview-panel {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.preview-panel .logo-preview {
  width: 4rem;
  height: 4rem;
  flex-basis: 4rem;
}

.submit-row {
  grid-column: 1 / -1;
}

.table-actions {
  justify-content: flex-end;
}

.nowrap {
  white-space: nowrap;
}

.push-right {
  margin-left: auto;
}

.product-selection-box {
  display: grid;
  gap: var(--space-sm);
  min-height: 8.5rem;
  padding: var(--space-md);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.product-selection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.product-selection-preview {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: .4rem;
  min-height: 3rem;
}

.product-selection-token {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 1.75rem;
  padding: .25rem .55rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--slate-800);
  font-family: var(--font-sans);
  font-size: .78rem;
  overflow-wrap: anywhere;
}

.product-selection-token-muted {
  color: var(--slate-500);
  font-family: inherit;
}

.product-picker-table td {
  vertical-align: middle;
}

/* ----- Modal (bulk vehicle picker) ----- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.modal[hidden] {
  display: none;
}

/* The hidden attribute must win over .btn/.empty-state display rules. */
.btn[hidden],
.empty-state[hidden] {
  display: none;
}

html.modal-open {
  overflow: hidden;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgb(27 25 23 / 52%);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--slate-200);
}

.modal-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
}

.modal-filter-search {
  grid-column: 1 / -1;
}

.modal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 var(--space-lg) var(--space-sm);
}

.modal-body {
  flex: 1;
  min-height: 8rem;
  overflow: auto;
  margin: 0 var(--space-lg);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
}

.picker-table {
  min-width: 40rem;
  user-select: none;
}

.picker-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--white);
}

.picker-table .picker-check {
  width: 2.75rem;
  padding-right: .35rem;
}

.picker-table tbody tr {
  cursor: pointer;
}

.picker-table tbody tr.is-selected {
  background: var(--slate-50);
}

.picker-table input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--slate-700);
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--slate-200);
}

.modal-pager {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

@media (max-width: 640px) {
  .modal-filters {
    grid-template-columns: 1fr;
  }

  .modal-header,
  .modal-filters,
  .modal-toolbar,
  .modal-footer {
    padding-inline: var(--space-md);
  }

  .modal-body {
    margin-inline: var(--space-md);
  }

  .backup-grid,
  .backup-conflict-row li {
    grid-template-columns: 1fr;
  }

  .backup-review-head,
  .backup-review-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .backup-review-actions .field,
  .backup-review-actions .btn {
    width: 100%;
  }

  .modal-footer,
  .modal-pager,
  .modal-footer .actions {
    width: 100%;
  }

  .modal-pager {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .modal-pager [data-picker-page] {
    order: -1;
    flex: 1 1 100%;
    text-align: center;
  }

  .modal-footer .actions .btn {
    flex: 1 1 8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 1180px) {
  .bulk-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bulk-toolbar-actions {
    grid-column: 1 / 3;
  }

  .bulk-selection-status {
    grid-column: 3 / 4;
    justify-self: end;
  }

  .vehicle-catalog-browser,
  .vehicle-browser-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .vehicle-catalog-browser {
    height: auto;
    min-height: 0;
  }

  .vehicle-browser-list,
  .vehicle-browser-list--models {
    max-height: 18rem;
  }

  .vehicle-browser-panel--makers .vehicle-browser-list,
  .vehicle-browser-panel--models .vehicle-browser-list {
    flex: 0 1 auto;
    max-height: 18rem;
  }

  .vehicle-version-table-wrap {
    max-height: 28rem;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  html.sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    position: sticky;
    top: 0;
    z-index: 40;
    padding: var(--space-sm) var(--space-md);
    background: var(--surface);
    border-bottom: 1px solid var(--slate-200);
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.75rem;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--slate-700);
    cursor: pointer;
  }

  .brand-mobile {
    gap: .55rem;
    min-width: 0;
  }

  .brand-mobile img {
    width: 9rem;
    height: auto;
    flex: 0 1 9rem;
  }

  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgb(27 25 23 / 45%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 210ms var(--ease-out);
  }

  html.nav-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar,
  html.sidebar-collapsed .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    height: 100dvh;
    width: min(18rem, 84vw);
    padding: var(--space-md);
    padding-inline: var(--space-md);
    transform: translateX(-100%);
    box-shadow: none;
    transition: transform 240ms var(--ease-out);
  }

  html.nav-open .sidebar {
    transform: translateX(0);
  }

  html.nav-open {
    overflow: hidden;
  }

  .sidebar-toggle {
    display: none;
  }

  .vehicle-section-header {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
    align-items: start;
  }

  .vehicle-tabs {
    margin-inline: calc(var(--space-xs) * -1);
    padding-inline: var(--space-xs);
  }

  .vehicle-tab {
    min-width: max-content;
  }

  .logo-upload-form {
    grid-template-columns: 1fr;
  }

  .logo-active-toggle {
    margin-top: 0;
  }

  .logo-upload-form .form-actions,
  .logo-upload-form .form-actions .btn {
    width: 100%;
  }

  .manual-vehicle-grid {
    grid-template-columns: 1fr;
  }

  .manual-entry-form .form-actions {
    justify-content: stretch;
  }

  .manual-entry-form .form-actions .btn {
    width: 100%;
  }

  /* Inside the mobile drawer, always show the full nav regardless of the
     desktop collapsed state persisted in localStorage. */
  html.sidebar-collapsed .sidebar-header {
    display: flex;
    justify-items: initial;
  }

  html.sidebar-collapsed .brand {
    display: flex;
    gap: .75rem;
  }

  html.sidebar-collapsed .brand-copy,
  html.sidebar-collapsed .nav-label,
  html.sidebar-collapsed .logout-label,
  html.sidebar-collapsed .sidebar-footer .muted {
    max-width: 11rem;
    opacity: 1;
    transform: none;
    visibility: visible;
  }

  html.sidebar-collapsed .nav a,
  html.sidebar-collapsed .logout-button {
    gap: .65rem;
    width: 100%;
    min-height: 2.75rem;
    justify-content: flex-start;
    padding: .65rem .8rem;
  }

  .grid-2,
  .grid-3,
  .detail-grid,
  .scope-grid,
  .readiness-body {
    grid-template-columns: 1fr;
  }

  .detail-item--wide {
    grid-column: auto;
  }

  .readiness-missing {
    justify-content: flex-start;
  }

  .connection-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-state-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .connection-detail-layout {
    grid-template-columns: 1fr;
  }

  .catalog-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-filters .field:first-child {
    grid-column: 1 / -1;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar .actions,
  .topbar > .btn,
  .form-actions {
    width: 100%;
    margin-left: 0;
  }

  .topbar .actions .btn,
  .form-actions .btn {
    flex: 1 1 12rem;
  }

  .topbar > .btn {
    width: auto;
    max-width: 100%;
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .content {
    padding: var(--space-md);
  }

  .panel {
    padding: var(--space-md);
  }

  .field-help-popover {
    left: auto;
    right: 0;
    width: min(20rem, calc(100vw - 2rem));
  }

  .field-help-popover::before {
    left: auto;
    right: .7rem;
  }

  .topbar h1 {
    font-size: 1.55rem;
  }

  .search-form {
    flex-direction: column;
  }

  .catalog-filters {
    grid-template-columns: 1fr;
  }

  .catalog-filters .field:first-child {
    grid-column: auto;
  }

  .connection-metrics {
    grid-template-columns: 1fr;
  }

  .product-state-summary {
    grid-template-columns: 1fr;
  }

  .detail-list > div {
    grid-template-columns: 1fr;
    gap: .15rem;
  }

  .catalog-filter-actions,
  .toolbar > .actions {
    align-items: stretch;
    flex-direction: column;
    margin-left: 0;
  }

  .bulk-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .bulk-toolbar-actions {
    grid-column: auto;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .catalog-filter-actions .btn,
  .toolbar > .actions .btn,
  .bulk-toolbar .btn,
  .bulk-action-field,
  .bulk-category-field {
    width: 100%;
  }

  .bulk-toolbar .bulk-action-field,
  .bulk-toolbar .bulk-category-field,
  .bulk-selection-status {
    width: 100%;
  }

  .vehicle-catalog-browser,
  .vehicle-browser-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .vehicle-catalog-browser {
    height: auto;
    min-height: 0;
  }

  .vehicle-browser-list,
  .vehicle-browser-list--models {
    max-height: 18rem;
  }

  .vehicle-browser-panel--makers .vehicle-browser-list,
  .vehicle-browser-panel--models .vehicle-browser-list {
    flex: 0 1 auto;
    max-height: 18rem;
  }

  .vehicle-version-table-wrap {
    max-height: 28rem;
  }

  .vehicle-version-table {
    min-width: 0;
  }

  .vehicle-version-table thead {
    display: none;
  }

  .vehicle-version-table tbody {
    display: grid;
    gap: var(--space-sm);
  }

  .vehicle-version-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
    padding: var(--space-sm);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-md);
    background: var(--white);
  }

  .vehicle-version-table tbody tr:hover,
  .vehicle-version-table tbody tr:nth-child(even),
  .vehicle-version-table tbody tr.is-selected {
    background: var(--white);
  }

  .vehicle-version-table td,
  .vehicle-version-table td:first-child {
    display: grid;
    gap: .2rem;
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  .vehicle-version-table td::before {
    content: attr(data-label);
    color: var(--slate-500);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .vehicle-version-action-cell {
    grid-column: 1 / -1;
  }

  .vehicle-version-action {
    width: 100%;
    justify-content: flex-start;
  }

  .vehicle-version-empty td {
    grid-column: 1 / -1;
    justify-items: center;
    text-align: center;
  }

  .vehicle-version-empty td::before {
    display: none;
  }

  .bulk-selection-status {
    grid-column: auto;
    justify-content: flex-start;
    justify-self: stretch;
    min-height: auto;
    margin-left: 0;
    padding: 0;
    text-align: left;
    white-space: normal;
  }

  .catalog-pagination {
    grid-template-columns: 1fr;
  }

  .catalog-pagination > .muted,
  .catalog-pagination > .actions,
  .catalog-pagination > .page-number-list,
  .catalog-pagination > .btn:first-child,
  .catalog-pagination > .btn:last-child,
  .catalog-pagination > .btn + .muted {
    grid-column: auto;
    grid-row: auto;
    justify-self: stretch;
  }

  .catalog-pagination > .actions,
  .page-number-list {
    justify-content: flex-start;
  }

  .table-display-control {
    width: 100%;
    flex-wrap: wrap;
  }

  .table-display-control-minimal {
    width: fit-content;
    flex-wrap: nowrap;
  }

  .table-display-control .compact-select {
    flex: 0 1 auto;
    min-width: 7.25rem;
  }

  .table-display-control-minimal .compact-select {
    min-width: 3.65rem;
  }

  .search-form .btn,
  .topbar .actions .btn,
  .form-actions .btn {
    width: 100%;
  }

  .asset-grid,
  .product-image-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr));
  }

  .asset-cell {
    align-items: flex-start;
  }

  .worker-progress {
    grid-template-columns: 1fr;
  }

  .worker-log-row {
    grid-template-columns: 4.7rem minmax(0, 1fr);
  }

  .worker-log-row p {
    grid-column: 1 / -1;
  }

  .sidebar-footer {
    display: grid;
    gap: var(--space-sm);
  }

  .login-card {
    padding: 1.35rem;
  }

  /* Larger touch targets for compact buttons on phones. */
  .btn-small {
    min-height: 2.5rem;
    padding-block: .55rem;
  }

  .responsive-table {
    min-width: 0;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tbody {
    display: grid;
    gap: var(--space-sm);
  }

  .responsive-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
    padding: var(--space-sm);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-md);
    background: var(--white);
  }

  .responsive-table tbody tr:hover {
    background: var(--white);
  }

  .responsive-table td {
    display: grid;
    gap: .2rem;
    padding: 0;
    border: 0;
    min-width: 0;
  }

  .responsive-table td::before {
    content: attr(data-label);
    color: var(--slate-500);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .responsive-table td[data-label="Azioni"] {
    grid-column: 1 / -1;
  }

  .responsive-table td[data-label="Copertura"] {
    grid-column: 1 / -1;
  }

  .responsive-table td[data-label="Selezione"] {
    align-content: start;
  }

  .responsive-table td[data-label="Azioni"] .actions {
    justify-content: flex-start;
  }

  .responsive-table td[data-label="Azioni"] .actions form,
  .responsive-table td[data-label="Azioni"] .btn-small {
    flex: 1 1 8rem;
  }

  /* Empty-state rows use colspan and have no per-cell label. */
  .responsive-table td[colspan] {
    grid-column: 1 / -1;
  }

  .responsive-table td[colspan]::before {
    display: none;
  }
}
