/* ============================================================
   VDI Check Trade — Native CSS Design System
   No frameworks. No dependencies.
   ============================================================ */

/* ============================================================
   1. FONTS
   ============================================================ */
@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/Satoshi-Light.woff2') format('woff2'), url('../fonts/Satoshi-Light.woff') format('woff');
  font-weight: 300;
  font-style: normal;
}
@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/Satoshi-Regular.woff2') format('woff2'), url('../fonts/Satoshi-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/Satoshi-Medium.woff2') format('woff2'), url('../fonts/Satoshi-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/Satoshi-Bold.woff2') format('woff2'), url('../fonts/Satoshi-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/Satoshi-Black.woff2') format('woff2'), url('../fonts/Satoshi-Black.woff') format('woff');
  font-weight: 900;
  font-style: normal;
}
@font-face {
  font-family: 'UKNumberPlate';
  src: url('../fonts/UKNumberPlate.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'CharlesWright';
  src: url('../fonts/CharlesWright-Bold.woff') format('woff');
  font-weight: bold;
  font-style: normal;
}
@font-face {
  font-family: 'FeatherIcons';
  src: url('../fonts/Feather-Icons.woff') format('woff'),
       url('../fonts/Feather-Icons.ttf') format('truetype');
}
@font-face {
  font-family: 'LineAwesome';
  src: url('../fonts/Line-Awesome.woff') format('woff'),
       url('../fonts/Line-Awesome.ttf') format('truetype');
}

/* ============================================================
   2. DESIGN TOKENS (non-colour)
   Colour variables are defined in themes/light.css and themes/dark.css.
   ============================================================ */
:root {
  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Typography — change --font-primary to swap site-wide font */
  --font-primary: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-sans:  var(--font-primary);
  --font-heading: 'Satoshi', 'Montserrat', var(--font-primary);
  --font-nav: 'Satoshi', var(--font-primary);
  --font-nav-mobile: 'Satoshi', var(--font-primary);
  --font-mono:  'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --font-plate: 'UKNumberPlate', 'CharlesWright', monospace;

  /* Branding overrides — used ONLY on the full report page (.report-content).
     Defaults match the VDI Check brand. When AccountBranding.BrandingEnabled
     is true, production sets these on the .report-content element via inline
     style or a CSS class, using the values from AccountBranding:
       --brand-header-bg    ← PrimaryColor   (default #2F3E52)
       --brand-header-text  ← HeaderTextColor (default #FFFFFF)
       --brand-accent-color ← SecondaryColor  (default #45BC4A)
     The accent bar height is 0 by default and becomes 3px when branding is
     enabled — controlled via --brand-accent-height. */
  --brand-header-bg:      var(--color-panel-header);
  --brand-header-text:    #ffffff;
  --brand-accent-color:   var(--color-accent);
  --brand-accent-height:  3px;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;

  --font-normal: 400;
  --font-medium: 500;
  --font-semi:   600;
  --font-bold:   700;

  /* Layout */
  --sidebar-width: 240px;
  --header-height: 60px;
  --radius-sm:     4px;
  --radius:        6px;
  --radius-lg:     10px;
  --radius-xl:     16px;
  --radius-full:   9999px;
  --cta-pill-radius: 10px;

  /* Transitions */
  --transition:      150ms ease;
  --transition-slow: 300ms ease;
}

/* ============================================================
   3. THEME TOGGLE
   ============================================================ */
.theme-toggle {
  background: none;
  border: none;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  vertical-align: middle;
}
.theme-toggle img {
  width: 20px;
  height: 20px;
  filter: var(--theme-toggle-filter);
  transition: opacity 0.2s;
}
.theme-toggle:hover img {
  opacity: 0.7;
}
.theme-toggle--mobile { display: none; }

/* Smooth colour transitions when switching theme */
body,
.site-header,
.dark-panel,
.site-footer,
.site-footer__bottom,
.feature-grid__item,
.review-grid__card {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ============================================================
   4. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-link-hover); }
a:hover { color: var(--color-accent-hover); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

h1, h2, h3, h4, h5, h6 { font-weight: var(--font-semi); line-height: 1.3; color: var(--color-text); }
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
p  { line-height: 1.6; font-weight: 500; }
small { font-size: var(--text-sm); color: var(--color-text-muted); }
sup { font-size: 0.6em; vertical-align: super; line-height: 0; padding: 0; margin: 0; }

/* ============================================================
   4. AUTHENTICATED LAYOUT
   ============================================================ */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  min-height: 100vh;
  grid-template-areas: "header header" "sidebar main";
}

/* ============================================================
   5. HEADER
   ============================================================ */
.app-header {
  grid-area: header;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-md);
}

.sidebar-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.25rem;
  padding: var(--space-2);
  border-radius: var(--radius);
  display: none;
  transition: color var(--transition), background var(--transition);
  line-height: 1;
}
.sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,0.1); }

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}
.header-brand img { height: 32px; width: auto; }
.header-brand-text {
  color: #fff;
  font-size: var(--text-lg);
  font-weight: var(--font-semi);
  letter-spacing: -0.01em;
}

.header-spacer { flex: 1; }

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

.token-balance {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-4);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: background var(--transition);
  text-decoration: none;
}
.token-balance:hover { background: rgba(255,255,255,0.15); color: #fff; }
.token-balance.low { background: rgba(229,62,62,0.25); border-color: rgba(229,62,62,0.5); color: #fca5a5; }

.user-menu { position: relative; }
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3) var(--space-1) var(--space-1);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: background var(--transition);
}
.user-menu-btn:hover { background: rgba(255,255,255,0.15); }

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  overflow: hidden;
  z-index: 300;
}
.user-dropdown-header { padding: var(--space-4); border-bottom: 1px solid var(--color-border); }
.user-dropdown-name { font-weight: var(--font-semi); font-size: var(--text-sm); }
.user-dropdown-email { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text);
  transition: background var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.user-dropdown-item:hover { background: var(--color-bg); color: var(--color-text); }
.user-dropdown-item.danger { color: var(--color-danger); }
.user-dropdown-item.danger:hover { background: var(--color-danger-bg); }

/* ============================================================
   6. SIDEBAR
   ============================================================ */
.app-sidebar {
  grid-area: sidebar;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
}

.sidebar-section { padding: var(--space-4) var(--space-3); }
.sidebar-section + .sidebar-section { border-top: 1px solid var(--color-border); }

.sidebar-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semi);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 var(--space-3);
  margin-bottom: var(--space-2);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
}
.nav-link:hover { color: var(--color-text); background: var(--color-bg); }
.nav-link.active { color: var(--color-link); background: var(--color-accent-light); font-weight: var(--font-semi); }

.nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--color-accent);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  margin-top: auto;
  padding: var(--space-4) var(--space-3);
  border-top: 1px solid var(--color-border);
}
.sidebar-company { font-size: var(--text-xs); font-weight: var(--font-semi); color: var(--color-text); padding: var(--space-1) var(--space-3); }
.sidebar-tier { font-size: var(--text-xs); color: var(--color-text-muted); padding: 0 var(--space-3) var(--space-2); }

/* ============================================================
   7. MAIN CONTENT
   ============================================================ */
.app-main {
  grid-area: main;
  padding: var(--space-8);
  overflow-y: auto;
  min-width: 0;
}

.page-header { margin-bottom: var(--space-8); }
.page-title { font-size: var(--text-2xl); font-weight: var(--font-bold); }
.page-subtitle { font-size: var(--text-base); color: var(--color-text-muted); margin-top: var(--space-1); }
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }

/* Subtle "Go back" affordance sitting at the top-right of a page header
   next to its title. Renders as a small text link with a leading arrow —
   used on flows the user might want to cancel (e.g. /purchase). */
.page-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.page-back-link:hover {
  border-color: var(--color-link);
  color: var(--color-link);
  background: var(--color-input-bg);
}
.page-back-link i { font-size: 0.9rem; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-link-hover); }
.breadcrumb-sep { color: var(--color-border-dark); }
.breadcrumb-current { color: var(--color-text); }

/* ============================================================
   8. CARDS
   ============================================================ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
}
.card-title { font-size: var(--text-base); font-weight: var(--font-semi); }
.card-subtitle { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: 2px; }
.card-body { padding: var(--space-6); }
.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* VDI section box */
.vdi-box { background: var(--color-surface); border: 1px solid var(--color-panel-border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--space-5); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.report-content .vdi-box { background: var(--vdi-box-bg); }
.vdi-box-title {
  background: var(--color-panel-header);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--vdi-box-title-weight, 500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}
.vdi-box-accent { height: 0; }
.vdi-box-content { padding: var(--space-5); overflow: hidden; }
/* Short descriptive strap-line placed at the top of a report section
   (currently used by the VS & TD cards to explain the rename from MIAFTR). */
.report-section-strap {
    margin: 0 0 var(--space-4) 0;
    font-size: 0.875rem;
    color: var(--color-text-muted, #6b6b6b);
    line-height: 1.4;
}

/* ============================================================
   9. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.5;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary   { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.btn-primary:hover   { background: var(--color-accent-hover); border-color: var(--color-accent-hover); color: #fff; }
.btn-secondary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-secondary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); color: #fff; }
.btn-outline   { background: transparent; color: var(--color-text); border-color: var(--color-border-dark); }
.btn-outline:hover   { background: var(--color-bg); border-color: var(--color-text); color: var(--color-text); }
.btn-outline-accent  { background: transparent; color: var(--color-accent); border-color: var(--color-accent); }
.btn-outline-accent:hover { background: var(--color-accent-light); }
.btn-danger    { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-danger:hover    { background: #c53030; border-color: #c53030; color: #fff; }
.btn-ghost     { background: transparent; color: var(--color-text-muted); border-color: transparent; }
.btn-ghost:hover     { background: var(--color-bg); color: var(--color-text); }

.btn-sm  { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
.btn-lg  { padding: var(--space-3) var(--space-8); font-size: var(--text-base); border-radius: var(--radius-lg); }
.btn-xl  { padding: var(--space-4) var(--space-10); font-size: var(--text-lg); font-weight: var(--font-semi); border-radius: var(--radius-lg); }
.btn-block { width: 100%; }
.btn-icon { padding: var(--space-2); width: 36px; height: 36px; }

/* ============================================================
   10. FORMS
   ============================================================ */
.form-group { margin-bottom: var(--space-5); }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-5); }

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.form-label .required { color: var(--color-danger); margin-left: 2px; }

.form-control {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-input-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.5;
  appearance: none;
}
.form-control:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(69,188,74,0.15); }
.form-control:disabled { background: var(--color-bg); color: var(--color-text-muted); cursor: not-allowed; }
.form-control.is-invalid { border-color: var(--color-danger); }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-text  { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-1); }
.form-error { font-size: var(--text-xs); color: var(--color-danger); margin-top: var(--space-1); }

.form-hint {
  display: block;
  padding-top: 0;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 400;
}

.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: var(--radius) 0 0 var(--radius); flex: 1; }
.input-group .btn { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; flex-shrink: 0; }

.form-section { margin-bottom: var(--space-8); }
.form-section-title {
  font-size: var(--text-base);
  font-weight: var(--font-semi);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-5);
}

.form-check { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-1) 0; }
.form-check-input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--color-accent); cursor: pointer; flex-shrink: 0; }
.form-check-label { font-size: var(--text-sm); cursor: pointer; }
.form-check-description { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

/* Custom checkbox (reusable component) */
.vdi-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  user-select: none;
}
.vdi-checkbox__input {
  appearance: none;
  -webkit-appearance: none;
  width: 1.375rem;
  height: 1.375rem;
  border: 2px solid var(--color-border);
  border-radius: 0.3rem;
  background: var(--color-input-bg);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background-color 0.2s, border-color 0.2s;
}
.vdi-checkbox__input:checked {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}
.vdi-checkbox__input:checked::after {
  content: '';
  position: absolute;
  left: 0.3rem;
  top: 0.1rem;
  width: 0.4rem;
  height: 0.7rem;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.vdi-checkbox__input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(69,188,74,0.25);
}
.vdi-checkbox__input:hover {
  border-color: var(--color-accent);
}
.vdi-checkbox__text {
  line-height: 1.4;
}
.vdi-checkbox__text a {
  color: var(--color-link);
}

.permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.permission-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}

/* ============================================================
   11. TOGGLE SWITCH
   ============================================================ */
.toggle-switch { display: flex; align-items: center; gap: var(--space-3); }
.toggle-input { display: none; }
.toggle-label {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  background: var(--color-border-dark);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle-label::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}
.toggle-input:checked + .toggle-label { background: var(--color-accent); }
.toggle-input:checked + .toggle-label::after { transform: translateX(22px); }
.toggle-text { font-size: var(--text-sm); font-weight: var(--font-medium); }

/* ============================================================
   12. BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-semi);
  border-radius: var(--radius-full);
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-success { background: var(--color-success-bg); color: var(--color-success); border-color: var(--color-success-border); }
.badge-danger  { background: var(--color-danger-bg);  color: var(--color-danger);  border-color: var(--color-danger-border); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); border-color: var(--color-warning-border); }
.badge-info    { background: var(--color-info-bg);    color: var(--color-info);    border-color: var(--color-info-border); }
.badge-neutral { background: var(--color-bg); color: var(--color-text-muted); border-color: var(--color-border); }
.badge-primary { background: var(--color-primary); color: #fff; }
.badge-accent  { background: var(--color-accent); color: #fff; }

/* ============================================================
   13. ALERTS
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  border: 1px solid;
  line-height: 1.5;
  margin-bottom: var(--space-4);
}
.alert-icon { font-size: 1.1rem; flex-shrink: 0; }
.alert-title { font-weight: var(--font-semi); margin-bottom: 2px; }
.alert-success { background: var(--color-success-bg); color: #276749; border-color: var(--color-success-border); }
.alert-danger  { background: var(--color-danger-bg);  color: #c53030; border-color: var(--color-danger-border); }
.alert-warning { background: var(--color-warning-bg); color: #975a16; border-color: var(--color-warning-border); }
.alert-info    { background: var(--color-info-bg);    color: #2c5282; border-color: var(--color-info-border); }

/* ============================================================
   14. MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal-backdrop.is-open { display: flex; }
.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-lg { max-width: 640px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
}
.modal-title { font-size: var(--text-lg); font-weight: var(--font-semi); }
.modal-close { background: none; border: none; color: var(--color-text-muted); font-size: 1.25rem; cursor: pointer; padding: var(--space-1); border-radius: var(--radius); line-height: 1; }
.modal-close:hover { color: var(--color-text); background: var(--color-bg); }
.modal-body { padding: var(--space-6); }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.modal-footer--center { justify-content: center; }

/* Modal size variants */
.modal--md { max-width: 680px; }
.modal--lg { max-width: 780px; }

/* Modal card — bordered section inside modal body */
.modal-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px 18px;
  background: var(--color-bg);
  margin-bottom: 18px;
}
.modal-card__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-text);
  margin-bottom: 4px;
}
.modal-card__desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

/* Modal info banner */
.modal-info-banner {
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--color-text);
  margin-bottom: 18px;
  line-height: 1.5;
}

/* Modal subtitle heading */
.modal-subtitle {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-link);
  margin: 0 0 4px;
}
.modal-subtitle-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0 0 16px;
}

/* Modal VIN warning - raised to a bordered info panel so the
   trade-only VIN rule reads at a glance and is not easily missed
   by someone about to email / download / print the report. */
.modal-vin-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  margin: 16px 0 8px;
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-left: 4px solid var(--color-warning);
  border-radius: 6px;
  color: #975a16;
  text-align: left;
}
.modal-vin-warning__icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px 22px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23975a16' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/><path d='M9 12l2 2 4-4'/></svg>");
}
.modal-vin-warning__body {
  flex: 1 1 auto;
  min-width: 0;
}
.modal-vin-warning__title {
  font-weight: 700;
  font-size: 0.92rem;
  margin: 0 0 2px;
  color: #7a4a12;
}
.modal-vin-warning__detail {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

/* Dark mode: amber panel keeps its warn-bg background (already dark
   in the dark palette), but the text drops to muted brown over
   dark; flip both the title and detail to white, and recolour the
   SVG icon to match. */
[data-theme="dark"] .modal-vin-warning {
  color: #ffffff;
}
[data-theme="dark"] .modal-vin-warning__title {
  color: #ffffff;
}
[data-theme="dark"] .modal-vin-warning__icon {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/><path d='M9 12l2 2 4-4'/></svg>");
}

/* Modal print graphic container */
.modal-print-graphic {
  text-align: center;
  margin: 0 auto 28px;
  max-width: 520px;
}
.modal-print-graphic img {
  width: 100%;
  height: auto;
}

/* CTA button large variant */
.cta-button--lg {
  padding: 12px 48px;
  font-size: 0.9rem;
  font-weight: 600;
  max-width: 400px;
  width: 100%;
}

/* Recent Lookup Modal — vehicle card */
.recent-lookup__vehicle {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg);
  margin-bottom: 16px;
}
.recent-lookup__logo {
  max-height: 100%;
  width: auto;
  max-width: 60px;
  object-fit: contain;
  flex-shrink: 0;
  align-self: stretch;
}
.recent-lookup__info {
  flex: 1;
  min-width: 0;
}
.recent-lookup__make-model {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 6px;
}
.recent-lookup__image {
  max-width: 120px;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.recent-lookup__actions {
  margin-top: 16px;
  text-align: center;
}
.recent-lookup__action-label {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}
.recent-lookup__buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.recent-lookup__btn {
  flex: 1;
  text-align: center;
  font-size: 0.82rem;
  padding: 10px 16px;
  max-width: 320px;
  white-space: nowrap;
}
.recent-lookup__btn--premium {
  background: var(--color-link);
}
.recent-lookup__btn--premium:hover {
  background: var(--color-link-hover);
}
.recent-lookup__override {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.recent-lookup__override-check {
  justify-content: center;
}
.recent-lookup__btn--override {
  background: var(--color-warning);
  color: #fff;
}
.recent-lookup__btn--override:hover:not(:disabled) {
  background: var(--color-warning-hover, var(--color-warning));
  filter: brightness(0.92);
}
.recent-lookup__btn--override:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
@media (max-width: 480px) {
  .recent-lookup__vehicle { flex-wrap: wrap; justify-content: center; text-align: center; }
  .recent-lookup__image { max-width: 100px; }
  .recent-lookup__buttons { flex-direction: column; align-items: center; }
  .recent-lookup__btn { max-width: 100%; width: 100%; }
}

/* Plate on Retention modal */
.plate-retention__searched {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.plate-retention__searched-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  flex: 1;
}
.plate-retention__detail {
  font-size: 0.85rem;
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 16px;
}
.plate-retention__detail p {
  margin: 0 0 8px;
}
.plate-retention__vehicle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg);
  margin-bottom: 20px;
}
.plate-retention__logo {
  max-width: 60px;
  max-height: 60px;
  object-fit: contain;
}
.plate-retention__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.plate-retention__btn {
  flex: 1;
  text-align: center;
  font-size: 0.85rem;
  padding: 10px 16px;
  max-width: 220px;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .plate-retention__searched { flex-direction: column; text-align: center; }
  .plate-retention__actions { flex-direction: column; align-items: center; }
  .plate-retention__btn { max-width: 100%; width: 100%; }
}

/* Icon utilities */
.icon-mr { margin-right: 6px; }
.icon-danger { color: var(--color-danger); }
.icon-info { color: var(--color-info); }

/* Settings row spacing in modals */
.settings-row + .settings-row { margin-top: 8px; }

/* Data table utilities */
.data-table--fixed { table-layout: fixed; width: 100%; }
.td-center { text-align: center; }
.td-right { text-align: right; }
.td-bold { font-weight: 600; }
.td-break { word-break: break-all; font-size: 0.8rem; }
.text-muted-sm { color: var(--color-text-muted); }
.input--readonly { color: var(--color-link); }
.modal-body .drawer__field { margin-bottom: 14px; }
.modal-body .drawer__field:last-of-type { margin-bottom: 18px; }


/* ============================================================
   15. TABLES
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-wrap: wrap;
}
.table-search { position: relative; flex: 1; max-width: 320px; }
.table-search .form-control { padding-left: var(--space-8); }
.table-search-icon { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--color-text-muted); pointer-events: none; }

.data-table { width: 100%; border-collapse: collapse; background: var(--color-surface); font-size: var(--text-sm); }
.data-table th {
  background: var(--color-bg);
  padding: var(--space-3) var(--space-5);
  text-align: left;
  font-weight: var(--font-semi);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  position: relative;
}
.data-table th::after {
  content: '⇅';
  margin-left: 6px;
  font-size: 0.7rem;
  opacity: 0.4;
}
.data-table th.sort-asc::after { content: '▲'; opacity: 0.8; color: var(--color-link); }
.data-table th.sort-desc::after { content: '▼'; opacity: 0.8; color: var(--color-link); }
.data-table th.no-sort { cursor: default; }
.data-table th.no-sort::after { display: none; }
.data-table td { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.data-table tbody tr:nth-child(even) { background: var(--color-row-alt); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--color-bg); }
.td-actions { display: flex; align-items: center; gap: var(--space-2); }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.pagination { display: flex; align-items: center; gap: var(--space-1); }
.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover { background: var(--color-bg); color: var(--color-text); }
.page-btn.active { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.empty-state { text-align: center; padding: var(--space-16) var(--space-8); }
.empty-state-icon { font-size: 3rem; margin-bottom: var(--space-4); color: var(--color-text-light); }
.empty-state-title { font-size: var(--text-lg); font-weight: var(--font-semi); margin-bottom: var(--space-2); }
.empty-state-text { color: var(--color-text-muted); margin-bottom: var(--space-6); }

/* ============================================================
   16. STAT CARDS (Dashboard)
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); margin-bottom: var(--space-8); }
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.stat-icon-accent  { background: var(--color-accent-light); color: var(--color-accent); }
.stat-icon-primary { background: rgba(47,62,82,0.1); color: var(--color-primary); }
.stat-icon-danger  { background: var(--color-danger-bg); color: var(--color-danger); }
.stat-icon-info    { background: var(--color-info-bg); color: var(--color-info); }
.stat-value { font-size: var(--text-2xl); font-weight: var(--font-bold); line-height: 1.2; }
.stat-label { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: var(--font-medium); margin-top: 2px; }
.stat-change { font-size: var(--text-xs); margin-top: var(--space-1); }
.stat-change.up { color: var(--color-success); }
.stat-change.down { color: var(--color-danger); }

.token-card {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-6);
}
.token-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.token-card-balance { font-size: var(--text-4xl); font-weight: var(--font-bold); line-height: 1; margin: var(--space-3) 0; }
.token-card-label { font-size: var(--text-sm); opacity: 0.7; }
.token-card-actions { margin-top: var(--space-5); display: flex; gap: var(--space-3); }
.token-card-warning {
  background: rgba(229,62,62,0.2);
  border: 1px solid rgba(229,62,62,0.4);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ============================================================
   17. UK NUMBER PLATE
   ============================================================ */
.uk-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffe250;
  color: #393939;
  font-family: 'CharlesWright', var(--font-plate);
  font-size: 1.4rem;
  font-weight: normal;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid #a39386;
  letter-spacing: 0;
  line-height: 1;
  min-width: 160px;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
}
.uk-plate-sm  { font-size: 1.3rem; padding: var(--space-2) var(--space-4); min-width: 140px; }
@media (max-width: 1024px) {
  .uk-plate-sm { font-size: 1.15rem; padding: var(--space-2) var(--space-3); min-width: 120px; }
}
@media (max-width: 768px) {
  .uk-plate-sm { font-size: 0.95rem; padding: 6px var(--space-3); min-width: 100px; }
}
.uk-plate-lg  { font-size: 2rem;  padding: var(--space-3) var(--space-6); min-width: 200px; }
.uk-plate-xl  { font-size: 2.5rem; padding: var(--space-4) var(--space-8); min-width: 240px; }

/* ============================================================
   18. VDI STATUS FLAGS
   ============================================================ */
.status-flags { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-bottom: var(--space-6); }
.status-flag {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-5) var(--space-4);
  border-radius: var(--radius-lg);
  border: 2px solid;
  gap: var(--space-2);
}
.status-flag-icon { width: 44px; height: 44px; }
.status-flag-label { font-size: var(--text-xs); font-weight: var(--font-semi); text-transform: uppercase; letter-spacing: 0.05em; }
.status-flag-value { font-size: var(--text-sm); font-weight: var(--font-bold); }

.flag-clear    { background: var(--color-clear-bg);    color: var(--color-clear);    border-color: var(--color-success-border); }
.flag-danger   { background: var(--color-stolen-bg);   color: var(--color-stolen);   border-color: var(--color-danger-border); }
.flag-finance  { background: var(--color-finance-bg);  color: var(--color-finance);  border-color: var(--color-info-border); }
.flag-writeoff { background: var(--color-writeoff-bg); color: var(--color-writeoff); border-color: #fbd38d; }
.flag-mileage  { background: var(--color-mileage-bg);  color: var(--color-mileage);  border-color: #d6bcfa; }

.flag-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(127, 127, 127, 0.15);
  margin-bottom: var(--space-4);
}
.flag-banner-icon { font-size: 1.5rem; flex-shrink: 0; }
.flag-banner-title { font-weight: var(--font-semi); font-size: var(--text-sm); }
.flag-banner-detail { font-size: var(--text-sm); margin-top: 2px; opacity: 0.85; }
.flag-banner-stolen      { background: var(--color-stolen-bg);   border-color: var(--color-stolen);   color: var(--color-stolen); }
.flag-banner-destruction { background: var(--color-danger-bg);   border-color: var(--color-danger);   color: var(--color-danger); }
.flag-banner-scrapped    { background: var(--color-danger-bg);   border-color: var(--color-danger);   color: var(--color-danger); }
.flag-banner-writeoff { background: var(--color-writeoff-bg); border-color: var(--color-writeoff); color: var(--color-writeoff); }
.flag-banner-finance  { background: var(--color-finance-bg);  border-color: var(--color-finance);  color: var(--color-finance); }
.flag-banner-mileage  { background: var(--color-mileage-bg);  border-color: var(--color-mileage);  color: var(--color-mileage); }

/* ============================================================
   19. LOOKUP COMPONENTS
   ============================================================ */
.lookup-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-12);
  text-align: center;
  color: #fff;
  margin-bottom: var(--space-8);
}
.lookup-hero h2 { color: #fff; font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.lookup-hero p  { opacity: 0.8; margin-bottom: var(--space-6); }
.lookup-form {
  display: flex;
  gap: var(--space-3);
  max-width: 480px;
  margin: 0 auto;
  align-items: stretch;
}
.vrm-input {
  font-family: 'CharlesWright', var(--font-plate);
  font-size: 1.5rem;
  font-weight: normal;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0;
  background: #ffe250;
  color: #393939;
  border: 2px solid #a39386;
  border-radius: 14px;
  padding: var(--space-3) var(--space-4);
  flex: 1;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.vrm-input:hover { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(69,188,74,0.25); }
.vrm-input:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 4px rgba(69,188,74,0.35); }
.vrm-input::placeholder { color: rgba(57,57,57,0.5); font-family: 'CharlesWright', var(--font-plate); letter-spacing: 0; }

/* Vehicle search error banner */
.search-error-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  border-left: 4px solid var(--color-danger);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  color: var(--color-danger);
}
.search-error-banner__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 1px;
}
/* text-align: left explicitly overrides the inherited center from
   .vehicle-lookup-search-content (the panel wrapper on
   /vehicle-lookup centres its logo + search input group). */
.search-error-banner__content { flex: 1; text-align: left; }
.search-error-banner__title {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.search-error-banner__message {
  font-size: 0.85rem;
  color: var(--color-text);
  line-height: 1.5;
  margin: 0;
}
.search-error-banner__close {
  background: none;
  border: none;
  color: var(--color-danger);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.search-error-banner__close:hover { opacity: 1; }

/* ============================================================
   Daily free-lookup limit notice — Vehicle Lookup page
   Shown when the BasicLookup API returns "Daily Limit Reached".
   The search panel below is dimmed and disabled while shown.
   ============================================================ */
/* Daily limit banner - reuses .ved-status-banner--warn palette;
   these rules format the "what you can still do" bullet list
   inside the detail body. */
.daily-limit-banner__detail {
  font-weight: 500;
  color: var(--color-text);
}
/* Bullet list sits flush-left with the title / detail above it.
   Bullets are explicitly re-enabled (list-style: disc) because
   the global ul reset at the top of app.css strips them. Text
   colour switches to the standard body colour so it reads on
   both light and dark themes; links keep their accent treatment. */
.daily-limit-banner__actions {
  list-style: disc inside;
  margin: 8px 0 0;
  padding-left: 0;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--color-text);
}
.daily-limit-banner__actions li + li { margin-top: 4px; }
/* Nav-style triggers inside the bullet list. Applies to both the
   real <a> ("recent reports") and the <button> wearing the same
   class ("Contact support") so both read identically - no
   underline, slightly bolder than the surrounding body copy. */
.daily-limit-banner__actions a,
.daily-limit-banner__link {
  color: var(--color-link);
  font-weight: 600;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}
.daily-limit-banner__actions a:hover,
.daily-limit-banner__link:hover {
  color: var(--color-link-hover, var(--color-link));
  text-decoration: underline;
}

/* Contact Support modal - simple info card, no form. */
.contact-support-modal__logo {
  display: block;
  margin: 0 auto 18px;
  max-height: 72px;
  max-width: 240px;
}
.contact-support-modal__logo--light { display: block; }
.contact-support-modal__logo--dark  { display: none; }
:root[data-theme="dark"] .contact-support-modal__logo--light,
:root:not([data-theme="light"]) .contact-support-modal__logo--light {
  display: none;
}
:root[data-theme="dark"] .contact-support-modal__logo--dark,
:root:not([data-theme="light"]) .contact-support-modal__logo--dark {
  display: block;
}
.contact-support-modal__lead {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0 0 16px;
}
.contact-support-modal__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
}
.contact-support-modal__row:first-of-type { border-top: 0; }
.contact-support-modal__icon {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}
.contact-support-modal__label {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.contact-support-modal__value {
  color: var(--color-text);
  font-weight: 600;
}
.contact-support-modal__value a { color: var(--color-link); }
.contact-support-modal__hours {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.contact-support-modal__hours td {
  padding: 3px 0;
  color: var(--color-text);
}
.contact-support-modal__hours td:first-child {
  color: var(--color-text-muted);
  padding-right: 18px;
  width: 40%;
}
.contact-support-modal__urgent {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--color-text);
  line-height: 1.5;
}
.contact-support-modal__urgent strong a { color: var(--color-link); }

/* "Issue" pill under the intro - gives support a one-line headline
   before the dealer speaks. Tinted red to match the flag-banner at
   the top of the report so the call-to-action and the modal share
   one severity signal. */
.contact-support-modal__context {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0 14px 0;
  padding: 10px 12px;
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--color-danger);
}
.contact-support-modal__context-icon {
  color: var(--color-danger);
  font-size: 1.1rem;
  flex: 0 0 auto;
  margin-top: 1px;
}

/* Vehicle summary card borrowed from ReportIdModal — image + plate +
   make/model + mini-spec list. Lives inside the support modal only when
   a Lookup is passed to it. */
.contact-support-modal__vehicle {
  display: flex;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  margin-top: 6px;
  margin-bottom: 14px;
  background: var(--color-surface);
}
.contact-support-modal__image {
  flex: 0 0 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-muted, rgba(0,0,0,0.03));
  border-radius: 8px;
  padding: 6px;
  min-height: 110px;
}
.contact-support-modal__image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 130px;
  object-fit: contain;
}
.contact-support-modal__vehicle-info { flex: 1; min-width: 0; }
.contact-support-modal__plate-row { margin-bottom: 6px; }
.contact-support-modal__vehicle-title {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 2px 0 8px 0;
  font-size: 1rem;
  color: var(--color-text);
}
.contact-support-modal__vehicle-title strong { font-weight: 700; }
.contact-support-modal__vehicle-specs {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 10px;
  margin: 0;
  font-size: 0.85rem;
}
.contact-support-modal__vehicle-specs dt {
  color: var(--color-text-muted);
}
.contact-support-modal__vehicle-specs dd { margin: 0; color: var(--color-text); }

/* Report ID copy row, same shape as ReportIdModal's. */
.contact-support-modal__id-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: var(--color-surface-muted, rgba(0,0,0,0.03));
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.9rem;
}
.contact-support-modal__id-label {
  color: var(--color-text-muted);
  font-weight: 600;
}
.contact-support-modal__id-value {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text);
  word-break: break-all;
}
.contact-support-modal__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.8rem;
}
.contact-support-modal__copy:hover { background: var(--color-surface-muted, rgba(0,0,0,0.05)); }

@media (max-width: 480px) {
  .contact-support-modal__vehicle { flex-direction: column; }
  .contact-support-modal__image { flex: 0 0 auto; }
}

/* MOT identity mismatch banner — ved-status-banner--alert plus a
   Contact Support action row below the detail line. Lives inside
   MotHistorySection and MotMileageRecordsSection when the MOT payload
   belongs to a different vehicle. */
.mot-identity-mismatch__body { flex: 1; min-width: 0; }
.mot-identity-mismatch__action {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
}
.mot-identity-mismatch__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
}
/* Chain the outer banner class so the selector outranks the base
   .cta-button:hover rule later in the file - at equal specificity
   the later rule wins, and that one swaps the background to the
   accent-green on hover. Two classes beats one. */
.mot-identity-mismatch .mot-identity-mismatch__btn {
  background-color: var(--color-danger);
  color: #fff;
  border: 1px solid var(--color-danger);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.mot-identity-mismatch .mot-identity-mismatch__btn:hover:not(:disabled) {
  background-color: #8a0f1a;
  border-color: #8a0f1a;
  color: #fff;
}
.mot-identity-mismatch__action-hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
/* Admin-only inspection chip shown next to Contact Support. Dashed
   outline + info-blue tint so it reads as a diagnostic affordance,
   not a user-facing CTA. Only rendered when ImpersonationService
   reports an active Lobby impersonation session. */
.mot-identity-mismatch__admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--color-info, #2563eb);
  border: 1px dashed var(--color-info, #2563eb);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.mot-identity-mismatch__admin-btn:hover {
  background: var(--color-info, #2563eb);
  color: #fff;
}

/* Top-of-report flag banner for the MOT identity mismatch. Uses the
   same red alert styling as the scrapped / destruction flag banners
   so a dealer scanning the top of the report treats the mismatch
   with the same weight as those states - the records in play are
   unverifiable until support resolves the backend data. */
.flag-banner-mot-identity {
  background: var(--color-danger-bg);
  border-color: var(--color-danger);
  color: var(--color-danger);
}
.flag-banner-mot-identity .flag-banner-icon { color: var(--color-danger); }
.flag-banner-action {
  margin-top: 12px;
}
.flag-banner__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
}
.flag-banner-mot-identity .flag-banner__cta {
  background-color: var(--color-danger);
  color: #fff;
  border: 1px solid var(--color-danger);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.flag-banner-mot-identity .flag-banner__cta:hover:not(:disabled) {
  /* Stay red on hover rather than swap to the default accent-green
     from .cta-button:hover; drop two shades so the state change is
     unmistakable while keeping the severity colour family. */
  background-color: #8a0f1a;
  border-color: #8a0f1a;
  color: #fff;
}

/* Dim + disable the search panel when the daily limit is reached */
.search-panel.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.3);
  transition: opacity 0.2s ease, filter 0.2s ease;
}

/* Search panel input groups — VRM/VIN wrappers and lookup-page sizing for the
   shared .vrm-input / .vin-input / .search-btn elements. */
.search-panel__input-group {
  max-width: 420px;
  margin: 0 auto;
}
.search-panel .vrm-input,
.search-panel .vin-input {
  width: 100%;
  font-size: 2rem;
  padding: 16px 20px;
  line-height: 1.2;
}
.search-panel .search-btn {
  width: 100%;
  margin-top: 16px;
}

/* ============================================================
   Low Balance Banner — clickable, navigates to /purchase
   3 severity levels driven by configurable thresholds:
     --info  → balance <= Warn1 (default 10)  blue
     --warn  → balance <= Warn2 (default  5)  amber
     --alert → balance <= Warn3 (default  3)  red
   Only the highest matching level renders at runtime.
   ============================================================ */
.low-balance-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  border-left: 4px solid var(--color-info);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  color: var(--color-info);
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.low-balance-banner:hover,
.low-balance-banner:focus-visible {
  text-decoration: none;
  filter: brightness(1.05);
  box-shadow: var(--shadow-sm);
  outline: none;
}
.low-balance-banner:focus-visible {
  box-shadow: 0 0 0 2px var(--color-link);
}
.low-balance-banner__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.low-balance-banner__content { flex: 1; }
.low-balance-banner__title {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.low-balance-banner__message {
  font-size: 0.85rem;
  color: var(--color-text);
  line-height: 1.5;
  margin: 0;
}
.low-balance-banner__cta {
  flex-shrink: 0;
  align-self: center;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding-left: 8px;
}
.low-balance-banner__cta::after {
  content: " \2192"; /* → */
}

/* Severity modifiers */
.low-balance-banner--info {
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
  border-left-color: var(--color-info);
  color: var(--color-info);
}
.low-balance-banner--warn {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  border-left-color: var(--color-warning);
  color: var(--color-warning);
}
.low-balance-banner--alert {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  border-left-color: var(--color-danger);
  color: var(--color-danger);
}

/* Title takes the severity colour so it reads as the section header.
   Inheritance from the modifier's `color:` was unreliable in practice
   (some browsers' UA stylesheet pins <strong>) — set it explicitly. */
.low-balance-banner--info  .low-balance-banner__title { color: var(--color-info); }
.low-balance-banner--warn  .low-balance-banner__title { color: var(--color-warning); }
.low-balance-banner--alert .low-balance-banner__title { color: var(--color-danger); }

/* ============================================================
   Premium-failure alert panel on /lookup-result. Persistent (not a
   toast) so the user cannot miss a failed full-report attempt, and
   hosts the "Contact support" CTA that opens ContactSupportModal.
   ============================================================ */
.premium-failure-alert {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  border-left: 4px solid var(--color-danger);
  border-radius: var(--radius);
  padding: 16px 48px 16px 20px; /* right padding reserves room for the close X */
  margin-bottom: 20px;
}
.premium-failure-alert__icon {
  font-size: 1.5rem;
  color: var(--color-danger);
  flex-shrink: 0;
  margin-top: 2px;
}
.premium-failure-alert__body { flex: 1; }
.premium-failure-alert__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-danger);
  margin-bottom: 6px;
}
.premium-failure-alert__text {
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.5;
  margin-bottom: 14px;
}
.premium-failure-alert__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.premium-failure-alert__close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  padding: 0;
  width: 28px;
  height: 28px;
  line-height: 1;
  font-size: 1.5rem;
  color: var(--color-text);
  opacity: 0.6;
  cursor: pointer;
  border-radius: 4px;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}
.premium-failure-alert__close:hover,
.premium-failure-alert__close:focus-visible {
  opacity: 1;
  background-color: rgba(127, 127, 127, 0.12);
  outline: none;
}

@media (max-width: 564px) {
  .premium-failure-alert { flex-direction: column; }
  .premium-failure-alert__icon { margin-top: 0; }
  .premium-failure-alert__actions { width: 100%; justify-content: space-between; }
}

@media (max-width: 564px) {
  .low-balance-banner {
    flex-wrap: wrap;
  }
  .low-balance-banner__cta {
    padding-left: 0;
    padding-top: 4px;
    width: 100%;
    text-align: right;
  }
}

/* Sticky mobile purchase bar */
.purchase-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
}
.purchase-sticky-bar__price {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-text);
}
.purchase-sticky-bar__price strong {
  font-size: 1.2rem;
  color: var(--color-link);
}
.purchase-sticky-bar__btn {
  flex-shrink: 0;
  padding: 10px 20px;
}

/* Purchase page mobile sticky bar — stacked variant used by /purchase.
   Overrides the default flex-row layout: button on top, secure-payment
   note underneath, generous breathing room between the two so the note
   never crashes into the button on small screens. */
.purchase-sticky-bar--stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 18px 20px 22px;
}
.purchase-sticky-bar__cta {
  width: 100%;
  padding: 18px 20px;
  margin: 0 0 24px;
}
.purchase-sticky-bar__note {
  text-align: center;
  margin: 0;
  padding: 0 4px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
/* Trust marker used on /purchase (desktop OrderSummary card + mobile
   sticky bar) and /pricing next to the sign-up CTA. Tune the max-width
   here to resize globally without editing every consumer. */
/* Pricing page — token packages table: bump the headline figures
   (tokens count, package price, per-check price) so they read as
   the primary content rather than sitting at the shared data-table
   small size. Small-text units (inc. VAT / per check) stay muted
   below. */
.pricing-package-table td strong {
  font-size: 1.35rem;
  font-weight: 700;
}
.pricing-package-table td small {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.secure-payments-badge {
  display: block;
  margin: 12px auto 0;
  max-width: 350px;
  width: 100%;
  height: auto;
}
.secure-payments-badge--sticky {
  max-width: 274px;
  margin-top: 0;
  padding-bottom: 9px;
}
.purchase-sticky-bar__note i {
  margin-right: 4px;
}
/* Secondary trust marker under the primary "Payments secured…" line.
   Card-on-file retention disclosure — smaller than the parent note. */
.purchase-sticky-bar__note--sub {
  font-size: 0.7rem;
  margin-top: 4px;
}

/* Trust-marker panel inside OrderSummary — Stripe secure-payments line
   + the card-on-file retention disclosure. Muted small-text with lock
   icons; sits between the Complete Purchase CTA and the payment-brand
   badge image. */
.secure-info-card {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.secure-info-card p {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--color-text-muted);
  text-align: left;
}
.secure-info-card p + p { margin-top: 8px; }
.secure-info-card i {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-text-muted);
}

/* REQ-021 saved-card confirmation panel on /purchase/pay when the user
   picked an existing card on /purchase. One-click confirm — no Stripe
   Payment Element mounted at all. */
.saved-card-confirm {
  padding: 12px 0;
}
.saved-card-confirm__row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  margin-bottom: 18px;
}
.saved-card-confirm__icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--color-input-bg);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.saved-card-confirm__body { flex: 1; }
.saved-card-confirm__brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  letter-spacing: 0.5px;
}
.saved-card-confirm__meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.saved-card-confirm__cvc-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}
.saved-card-confirm__cvc {
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-input-bg);
  margin-bottom: 6px;
}
.saved-card-confirm__cvc-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin: 0 0 16px;
}
.saved-card-confirm__cta {
  width: 100%;
  justify-content: center;
}
.saved-card-confirm__hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.saved-card-confirm__hint a {
  color: var(--color-link);
  text-decoration: none;
}
.saved-card-confirm__hint a:hover { text-decoration: underline; }

/* ============================================================
   TABLE FILTERS, PAGINATION (reusable component)
   ============================================================ */
.table-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-end;
}
.table-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.table-filter-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.table-filter-input {
  padding: 8px 12px;
  height: 36px;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-input-bg);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  appearance: none;
  -webkit-appearance: none;
}
select.table-filter-input {
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.table-filter-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(69,188,74,0.15);
}
input[type="date"].table-filter-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
}
input[type="date"].table-filter-input {
  color-scheme: var(--input-color-scheme);
}
.table-filter-input--sm { width: 70px; padding: 6px 10px; }

.table-page-size {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.8rem;
}

/* Pagination */
.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.table-pagination__info {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.table-pagination__controls {
  display: flex;
  gap: 4px;
}
/* Default / inactive page button. Surface bg + subtle border. */
.table-pagination__btn {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s;
  font-family: var(--font-sans);
}

/* Inactive hover — soft blue tint (info-bg) + blue border + blue text.
   Reads as "this is interactive" without competing with the active state. */
.table-pagination__btn:hover:not(:disabled):not(.table-pagination__btn--active) {
  background: var(--color-info-bg);
  border-color: var(--color-link);
  color: var(--color-link);
}

/* Keyboard focus ring (a11y). */
.table-pagination__btn:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
}

/* Active page (current). Solid blue with white text. */
.table-pagination__btn--active {
  background: var(--color-link);
  border-color: var(--color-link);
  color: #fff;
}

/* Active hover — darken the fill, keep text white. brightness() is
   theme-independent and gives a clear "pressing" affordance without
   collapsing text into the background (the prior bug). Specificity
   raised with :not(:disabled) so it wins over the inactive hover above
   regardless of source order. */
.table-pagination__btn--active:hover:not(:disabled) {
  background: var(--color-link);
  color: #fff;
  filter: brightness(0.92);
}

.table-pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Table action buttons (view/download with keyline) */
.table-actions {
  display: flex;
  gap: 6px;
}
.table-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-muted);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  font-size: 0.85rem;
}
.table-action-btn:hover {
  border-color: var(--color-link);
  color: var(--color-link);
  background: var(--color-bg);
}

/* ============================================================
   SLIDE-OUT DRAWER (advanced search)
   ============================================================ */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1100;
}
.drawer-overlay.open { display: block; }
.drawer {
  position: fixed;
  top: 0;
  left: -360px;
  width: 340px;
  height: 100vh;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  box-shadow: var(--shadow-drawer);
  z-index: 1101;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer.open { left: 0; }
.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.drawer__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}
.drawer__close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--color-drawer-close);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}
.drawer__close:hover { color: var(--color-danger); }
.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.drawer__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.drawer__section-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-link);
  margin-bottom: 8px;
  margin-top: 16px;
}
.drawer__section-title:first-child { margin-top: 0; }
.drawer__field {
  margin-bottom: 14px;
}
/* More generous vertical rhythm for security-drawer password rows —
   matches the Account Details card spacing on /user-settings. */
.drawer__field--spacious { margin-bottom: 22px; }
.drawer__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-drawer-label);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.drawer__input {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-drawer-input-bg);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  color-scheme: var(--input-color-scheme);
}
.drawer__input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(69,188,74,0.15);
}
select.drawer__input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* Warning toggle switches */
.drawer__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
}
.drawer__toggle-switch {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--color-border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  border: none;
}
.drawer__toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
}
.drawer__toggle-switch.active { background: var(--color-accent); }
.drawer__toggle-switch.active::after { left: 18px; }
.drawer__toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}

@media (max-width: 480px) {
  .drawer { width: 100%; left: -100%; }
}

/* Wider drawer variant — used for Manage Users edit drawers */
.drawer--wide {
  width: 480px;
  left: -500px;
}
.drawer--wide.open { left: 0; }
@media (max-width: 540px) {
  .drawer--wide { width: 100%; left: -100%; }
}

/* ============================================================
   MANAGE USERS — table cells, owner badge, permission marker
   ============================================================ */
.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.users-toolbar__group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.users-toolbar__label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.user-row-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  white-space: nowrap;
  position: relative;
}
.user-row-name:hover {
  color: var(--color-text);
}
.user-row-name__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-info-bg);
  color: var(--color-link);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
/* Owner-specific avatar treatment — themed via --color-accent variants so it
   adapts to dark mode automatically */
.user-row-name--owner .user-row-name__avatar {
  background: var(--color-accent-light);
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}
/* Hover tooltip — used to identify the Owner row */
.user-row-name__tip {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  z-index: 50;
  background: var(--color-primary-dark);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
  width: 240px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  border: 1px solid var(--color-border);
  text-transform: none;
  letter-spacing: normal;
  pointer-events: none;
}
.user-row-name__tip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 14px;
  border: 6px solid transparent;
  border-bottom-color: var(--color-primary-dark);
}
.user-row-name:hover .user-row-name__tip,
.user-row-name:focus-visible .user-row-name__tip { display: block; }

/* Permission marker — small rounded square showing whether a permission is enabled.
   .data-table td.perm-cell keeps text-align: center winning against any later
   .data-table td rules that don't set text-align but sit at (0,1,1) specificity. */
.data-table td.perm-cell {
  text-align: center;
}
.perm-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  color: var(--color-border-dark);
  font-size: 1.35rem;
  line-height: 1;
}
.perm-check--on {
  color: var(--color-accent);
}

/* Locked state for table-action-btn (Owner row in Manage Users) */
.table-action-btn--locked { color: var(--color-text-muted); }
.table-action-btn--locked:hover {
  border-color: var(--color-warning-border);
  color: var(--color-warning);
  background: var(--color-warning-bg);
}

/* Drawer permissions card */
.drawer__perm-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 18px;
  background: var(--color-bg);
}
.drawer__perm-card-title {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}
.drawer__perm-card-title strong {
  color: var(--color-text);
  font-weight: 700;
  margin-left: 4px;
}
.drawer__perm-card-note {
  font-style: italic;
  color: var(--color-text-muted);
  margin-left: 4px;
}
/* Constraint hint rendered below the perm grid whenever no permission
   is ticked. Mirrors .alert-banner's tone without stealing full-banner
   visual weight - this is a "why can't I save" nudge, not an error. */
.drawer__perm-card-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: 8px;
  color: var(--color-warning);
  font-size: 0.85rem;
}
.drawer__perm-card-hint i { font-size: 1rem; flex-shrink: 0; }
.drawer__perm-card .settings-row { background: var(--color-surface); }
.drawer__perm-card .settings-row + .settings-row { margin-top: 10px; }

/* Nested notifications sub-panel sitting directly under the Add Credits
   row inside .drawer__perm-card. Animates open/closed on max-height so
   the causal link between "Add Credits toggled on" and "email prefs
   appear" is visually smooth. Left-indented + faint side-rule so it
   reads as a child of the row above.

   The panel is a `.settings-row` sibling in DOM order, so it also gets
   the `.settings-row + .settings-row` 10px gap above/below via the
   sibling selectors below, keeping the collapsed row spacing in step
   with the rest of the permission grid. */
.perm-card__sub-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease-out,
              margin-top 0.28s ease-out,
              margin-bottom 0.28s ease-out,
              opacity 0.2s ease-out;
  opacity: 0;
  /* Closed: panel contributes zero margin, so the sibling rule below
     alone gives Email Reports the standard 10px gap - matching the
     other adjacent-row spacing in the permission grid. */
  margin-top: 0;
  margin-bottom: 0;
}
.perm-card__sub-panel--open {
  max-height: 340px;
  /* Open: 10px above (Add Credits gap) + 14px below (breathing room
     from the panel contents). The sibling rule's 10px on Email Reports
     stacks with the 14px, yielding 24px between the panel's last row
     and the Email Reports row. */
  margin-top: 10px;
  margin-bottom: 14px;
  opacity: 1;
}
/* Any settings-row immediately after the sub-panel keeps the standard
   10px gap regardless of open/closed state - the panel breaks sibling
   adjacency, so the `.settings-row + .settings-row` rule wouldn't
   otherwise fire. */
.drawer__perm-card .perm-card__sub-panel + .settings-row { margin-top: 10px; }

.perm-card__sub-panel-inner {
  margin-left: 18px;
  padding: 12px 14px 4px 14px;
  border-left: 3px solid var(--color-accent);
  background: var(--color-bg);
  border-radius: 0 8px 8px 0;
}
.perm-card__sub-panel-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.perm-card__sub-panel-title i {
  font-size: 0.9rem;
  color: var(--color-accent);
}

/* Reusable settings row — label/description on the left, control on the right.
   Used by the Edit User drawer (Account Access + each permission) and any
   future "settings list" item that mirrors the account.html pattern. */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
}
.settings-row__info { flex: 1; min-width: 0; }
.settings-row__label {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}
/* Pencil edit affordance placed directly after a row/section title (e.g.
   "Receive Low Token Warning [pencil]"). Sized and coloured to read as a
   clear "edit this setting" CTA — NOT a muted glyph buried in copy. */
/* Wrap the label itself in a flex row so title text and the pencil button
   share a baseline / centreline cleanly — relying on inline vertical-align
   with a feather icon was giving a visible drop on the Profile page. */
.settings-row__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.title-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--color-accent);
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s, transform 0.15s;
}
.title-edit-btn:hover {
  color: var(--color-accent-hover);
  transform: scale(1.1);
}
.title-edit-btn i {
  font-size: 1.1rem;
  line-height: 1;
  display: block;
}
.settings-row__desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 2px;
  line-height: 1.4;
}
.settings-row__control { flex-shrink: 0; }

/* ============================================================
   REPORT NAVIGATION — sidebar (desktop) + hamburger overlay (mobile/tablet)
   Production component: ReportNavigation.razor
   ============================================================ */

/* 2-column layout: nav sidebar + report content */
.report-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}

/* Sidebar nav — sticky on desktop. Top offset is set live from JS
   (window.vdi.updateStickyOffsets) based on measured auth-header + report-bar
   heights; the 145px static value is a safe fallback for the split-second
   before the JS runs. */
.report-nav {
  position: sticky;
  top: var(--vdi-report-nav-top, 145px);
  max-height: calc(100vh - var(--vdi-report-nav-top, 145px) - 10px);
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--report-chrome-bg);
  border: 1px solid var(--color-panel-border);
  border-radius: var(--radius-lg);
  padding: 0 0 12px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.report-nav__header {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text);
  padding: 12px 16px 8px;
}
/* ============================================================
   REPORT BAR — sticky sub-header below auth header
   Contains: VRM, vehicle info, export/settings buttons, hamburger
   ============================================================ */
.report-bar {
  position: sticky;
  top: var(--vdi-report-bar-top, 83px); /* JS override via window.vdi.updateStickyOffsets */
  z-index: 999;
  background: var(--report-chrome-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: visible;
}
.report-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 16px 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.report-bar__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.report-bar__left .uk-plate {
  order: 1;
  flex-shrink: 0;
  white-space: nowrap;
}
.report-bar__title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
}
.report-bar__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-basis: 100%;
  order: 3;
  font-size: 1.05rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
}
.report-bar__id-label {
  font-weight: 400;
}
.report-bar__id {
  font-family: var(--font-mono, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace);
  font-size: larger;
  font-weight: 600;
  letter-spacing: 0.02em;
  /* Interactive - opens the support-info modal. Reset button chrome so
     the ID reads as a tappable label rather than a chunky button. */
  background: transparent;
  border: 0;
  border-bottom: 1px dashed transparent;
  padding: 0 2px;
  color: inherit;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.report-bar__id:hover,
.report-bar__id:focus-visible {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  outline: none;
}
.report-bar__separator {
  display: none;
}
.report-bar__vehicle {
  display: inline-flex;
  align-items: center;
}
.report-bar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.report-bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border-dark);
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: all 0.15s ease;
}
.report-bar__btn:hover {
  color: var(--color-link);
  border-color: var(--color-link);
  background: var(--color-info-bg);
}
.report-bar__btn--active {
  color: var(--color-link);
  border-color: var(--color-link);
  background: var(--color-info-bg);
}
/* Tooltip */
.report-bar__btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 6px;
  background: var(--color-primary-dark);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
}
.report-bar__btn:hover::after {
  opacity: 1;
}
/* Hamburger + divider — hidden on desktop. On mobile the hamburger
   leads the action row and the divider gives it visual air from the
   rest of the icons so users don't misread it as another action. */
.report-bar__hamburger,
.report-bar__divider {
  display: none;
}
.report-bar__divider {
  align-self: stretch;
  width: 1px;
  background: var(--color-border);
  margin: 4px 6px;
}
@media (max-width: 1024px) {
  .report-bar__hamburger { display: inline-flex; }
  .report-bar__hamburger::after { display: none; }
  .report-bar__divider { display: block; }
  .report-bar__title { font-size: 1.05rem; }
  .report-bar__meta { font-size: 0.78rem; padding-top: 2px; }
  .report-bar__report-info { display: inline; }
}
@media (max-width: 600px) {
  .report-bar__inner { flex-direction: column; align-items: center; padding: 10px 16px; gap: 6px; }
  .report-bar__left { justify-content: center; }
  .report-bar__title { font-size: 0.95rem; white-space: normal; }
  .report-bar__meta { flex-direction: column; flex-basis: auto; order: 0; font-size: 0.72rem; white-space: normal; text-align: center; padding-top: 0; align-items: center; }
  .report-bar__report-info { padding-top: 4px; }
  .report-bar__year { display: none; }
  .report-bar__actions { justify-content: center; order: 4; }

  /* Export History variant on mobile: back button pins to the top-right
     of the VRM row rather than dropping to a stacked row of its own.
     Positioning parent is the sticky report-bar's inner (relative
     already), so this does not disturb the outer .report-bar's
     position: sticky - the sub-header still sticks on scroll. */
  .report-bar--export-history .report-bar__inner { position: relative; }
  .report-bar--export-history .report-bar__actions {
    position: absolute;
    top: 6px;
    right: 4px;
    order: unset;
    margin: 0;
  }
}
@media (max-width: 480px) {
  .report-bar__vehicle { display: none; }
  .report-bar__title { font-size: 0.82rem; }
  .report-bar__inner { padding: 12px 16px; }
}

@media (max-width: 368px) {
  .report-bar__left .uk-plate { padding-left: 6px; padding-right: 6px; min-width: auto; }
}
@media (max-width: 310px) {
  .report-bar__date-sep { display: none; }
  .report-bar__date { display: block; }
}

/* Report Settings Drawer — slides in from right */
.report-settings__overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1100;
}
.report-settings__overlay.is-open {
  display: block;
}
.report-settings {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: var(--shadow-drawer);
  z-index: 1101;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}
.report-settings--open {
  right: 0;
}
.report-settings__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}
.report-settings__title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text);
}
.report-settings__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.15s ease;
}
.report-settings__close:hover {
  color: var(--color-text);
}
.report-settings__body {
  padding: 16px 20px;
}
.report-settings__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
.report-settings__text {
  flex: 1;
  min-width: 0;
}
.report-settings__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
}
.report-settings__desc {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-top: 2px;
}
.report-settings__divider {
  height: 1px;
  background: var(--color-border);
  margin: 4px 0;
}
.report-settings__toggle {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--color-border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  border: none;
}
.report-settings__toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
}
.report-settings__toggle.active {
  background: var(--color-accent);
}
.report-settings__toggle.active::after {
  left: 18px;
}

.report-nav__divider {
  height: 1px;
  background: var(--color-border);
  margin: 6px 0;
}
.report-nav__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--report-nav-item-color);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  cursor: pointer;
  border-left: 2px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.report-nav__item:hover {
  background: var(--color-bg);
  color: var(--color-link);
  font-weight: 600;
  border-left: 2px solid var(--color-link);
}
.report-nav__item--active {
  background: var(--color-info-bg);
  color: var(--color-link);
  font-weight: 600;
  border-left: 2px solid var(--color-link);
}

/* Status icon — green tick or red warning */
.report-nav__status {
  flex-shrink: 0;
  font-size: 0.85rem;
  width: 16px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.report-nav__item--clear .report-nav__status { color: var(--color-accent); font-size: 0.7rem; opacity: 0.6; }
.report-nav__item--warn .report-nav__status { color: var(--color-danger); }
.report-nav__item--neutral .report-nav__status { color: var(--color-text-muted); }
/* "Not yet actioned" — amber info icon on entries that expect user input
   (currently only the V5C Logbook Check row before the user submits). */
.report-nav__item--info .report-nav__status { color: var(--color-warning); }

/* Label */
.report-nav__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Count pill */
.report-nav__pill {
  flex-shrink: 0;
  background: var(--report-nav-pill-bg);
  border: 1px solid var(--report-nav-pill-border);
  color: var(--report-nav-pill-text);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.4;
}
.report-nav__item--warn .report-nav__pill {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: var(--color-danger);
}

/* Legacy hamburger — replaced by report-bar__hamburger */
.report-nav__hamburger {
  display: none;
  position: fixed;
  top: 80px;
  left: 12px;
  z-index: 1050;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  color: var(--color-text);
  font-size: 1.1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease;
}
.report-nav__hamburger:hover { background: var(--color-bg); }

/* Mobile overlay backdrop */
.report-nav__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1099;
}
.report-nav__overlay.is-open { display: block; }

/* Tablet + Mobile: collapse sidebar to overlay */
@media (max-width: 1024px) {
  .report-layout {
    grid-template-columns: 1fr;
  }
  .report-nav {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border-right: 1px solid var(--color-border);
    z-index: 1100;
    transition: left 0.3s ease;
    padding-top: 0;
    box-shadow: var(--shadow-drawer);
  }
  .report-nav.is-open { left: 0; }
  .report-nav__hamburger { display: flex; }
}
@media (max-width: 480px) {
  .report-nav { width: 100%; left: -100%; padding-top: 44px; }
  .report-nav__hamburger { top: 72px; left: 8px; width: 36px; height: 36px; font-size: 1rem; }
}

/* Mobile close button inside nav */
.report-nav__close {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
@media (max-width: 480px) {
  .report-nav__close { display: flex; }
}

/* Scrollbar styling for the nav (thin, subtle) */
.report-nav::-webkit-scrollbar { width: 4px; }
.report-nav::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }
.report-nav::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   FULL REPORT — paid premium VDI report page
   mock/Authenticated/full-report.html
   ============================================================ */

/* ============================================================
   SECTION 1: AT A GLANCE
   Production component: AtAGlanceSection.razor
   ============================================================ */
/* Print modal — step points (2×2 desktop, 1×4 mobile) */
.print-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  margin-top: 10px;
}
.print-steps__item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.print-steps__arrow {
  color: var(--color-link);
  font-size: 0.85rem;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .print-steps { grid-template-columns: 1fr; }
}

/* Print modal — theme-driven printer image swap */
.print-step-printer--light { display: var(--print-step-light-display, block); }
.print-step-printer--dark  { display: var(--print-step-dark-display, none); }

/* Body wrapper — constrains all children to panel width */
.at-a-glance__body {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* Hero area — 2-column grid: info left, vehicle image right */
.at-a-glance__hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  /* Stretch so the LEFT column fills the row height (= vehicle image
     height), which lets justify-content:space-between on the LEFT
     push MAKE to the bottom of the hero - close to MODEL below -
     while giving VRM proper breathing room above MAKE. */
  align-items: stretch;
  margin-bottom: 4px;
}
.at-a-glance__left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.at-a-glance__model-row {
  margin-bottom: 16px;
}
.at-a-glance__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
/* Manufacturer badge slot on the At a Glance card. Sized generously in
   both dimensions so tall marks (Tesla, Ferrari) hit ~110px in height
   and wide marks (Land Rover, Rolls-Royce wordmarks) hit ~140px in width
   — both feel like proper brand marks rather than thumbnails. Aspect is
   preserved by the img element itself + object-fit: contain. */
.at-a-glance__logo {
  max-width: 140px;
  max-height: 110px;
  height: auto;
  object-fit: contain;
  margin-bottom: 20px;
}
.at-a-glance__info {
  /* Positioned by the LEFT column's space-between; keep a small
     margin as a minimum guard so VRM and MAKE never collapse into
     each other on vehicles with a short-stock image. */
  margin-top: 12px;
}
.at-a-glance__field {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 6px;
}
.at-a-glance__field-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  font-weight: 600;
}
.at-a-glance__field-value {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  color: var(--color-text);
  text-transform: uppercase;
}
.at-a-glance__image {
  width: 100%;
  height: auto;
  object-fit: contain;
  justify-self: end;
}

/* Mobile label:value pair display for Make/Model */
.at-a-glance__meta { display: none; }
.at-a-glance__meta-row {
  display: flex;
  gap: 8px;
  font-size: 0.8rem;
  margin-bottom: 2px;
}
.at-a-glance__meta-label {
  color: var(--color-text-muted);
  font-weight: 600;
  min-width: 48px;
}
.at-a-glance__meta-value {
  color: var(--color-text);
  font-weight: 700;
  text-transform: uppercase;
}

/* Pill grid — 4 columns, full width below the hero */
.at-a-glance__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

/* Each pill: two-tone split — dark label left + coloured value right */
.at-a-glance__cell {
  display: flex;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  font-family: var(--font-heading);
  color: #fff;
  cursor: pointer;
  border: 2px solid var(--color-border);
  box-shadow: 0 0 8px 0 rgba(0,0,0,0.1);
  text-decoration: none;
  min-width: 0;
}
.at-a-glance__cell:hover {
  color: #fff;
  text-decoration: none;
}
/* Dark label section — fixed 55% width, text centred vertically + horizontally */
.at-a-glance__cell-label {
  background: var(--glance-label-bg);
  width: 55%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px 6px;
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.3;
}
/* Coloured value section — fills remaining 45%, text centred */
.at-a-glance__cell-value {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  gap: 4px;
}

/* Large number variant (e.g. MOT days remaining) */
.at-a-glance__cell-value-lg {
  font-size: 1rem;
  font-weight: 700;
}

/* State colours — value (right) side.
   Light mode: solid bright fill + white text.
   Dark mode: muted bg + coloured text (matching flag-banner style). */
.at-a-glance__cell--clear .at-a-glance__cell-value { background: var(--glance-clear-bg); color: var(--glance-clear-text); }
.at-a-glance__cell--warn .at-a-glance__cell-value  { background: var(--glance-warn-bg);  color: var(--glance-warn-text); }
.at-a-glance__cell--alert .at-a-glance__cell-value { background: var(--glance-alert-bg); color: var(--glance-alert-text); }
/* Not-yet-evaluated placeholder — later sub-project data not wired in D2 (same
   muted treatment as .badge-neutral). */
.at-a-glance__cell--neutral .at-a-glance__cell-value { background: var(--color-bg); color: var(--color-text-muted); }

/* Footer — report date */
.at-a-glance__footer {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 16px;
  padding-top: 10px;
}

/* Tablet — same layout as desktop, smaller logo, 3-col pills */
@media (max-width: 768px) {
  .at-a-glance__logo  { max-width: 110px; max-height: 85px; }
  .at-a-glance__info  { padding-top: 12px; }
  .at-a-glance__body  { margin-bottom: 0; }
  .at-a-glance__hero  { margin-bottom: 12px; }
  .at-a-glance__grid { grid-template-columns: repeat(3, 1fr); }
}
/* Mobile — everything stacked vertically */
@media (max-width: 620px) {
  .at-a-glance__hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 4px;
  }
  .at-a-glance__left { display: contents; }
  .at-a-glance__header { align-items: center; order: 1; }
  .at-a-glance__image { max-width: 200px; order: 2; justify-self: center; margin-bottom: -6px; }
  .at-a-glance__header .uk-plate-lg { padding: 6px var(--space-4); font-size: 1.5rem; min-width: auto; margin: 6px 0; }
  .at-a-glance__info { text-align: center; order: 3; padding-top: 0; display: none; }
  .at-a-glance__field { display: none; }
  .report--compact .at-a-glance__field--combined { display: none; }
  .at-a-glance__meta { display: none; }
  .at-a-glance__model-row { text-align: center; }
  .at-a-glance__model-row .at-a-glance__field--combined { display: block; }
  .at-a-glance__model-row .at-a-glance__field--combined .at-a-glance__field-value { font-size: 1rem; }
  .at-a-glance__model-row .at-a-glance__field--model { display: none; }
  .at-a-glance__grid {
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    overflow: hidden;
  }
  .at-a-glance__cell {
    height: auto;
    min-height: 48px;
    border-radius: 8px;
    min-width: 0;
  }
  .at-a-glance__cell-label {
    font-size: 0.68rem;
    padding: 4px 5px;
    min-width: 0;
    flex-shrink: 1;
    overflow: hidden;
    word-break: break-word;
  }
  .at-a-glance__cell-value {
    font-size: 0.67rem;
    padding: 4px 5px;
    min-width: 0;
    overflow: hidden;
  }
}

/* ============================================================
   REPORT FIELD — reusable data field component
   Production component: ReportField.razor
   Parameters: Title, Value, Prefix?, Suffix?
   ============================================================ */
.report-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
}
.report-field__label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 400;
  line-height: 1.3;
}
.report-field__value {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}
/* Opt-in no-wrap modifier for values that must stay on a single line,
   e.g. the MOT Recorded Mileage cell when km->mi conversion appends
   "(from 91,473 km)" and would otherwise break across two lines in a
   narrow grid cell. */
.report-field__value--nowrap {
  white-space: nowrap;
}
.report-field__prefix {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-right: 3px;
}
.report-field__suffix {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
/* Compound selector bumps specificity to (0,2,0) so this wins
   against .report--compact .report-field__value at (0,2,0) via
   source order, and against .report-field--hero at (0,2,0) the
   same way. Keeps the "give this value the mono spec treatment"
   promise on every surface. */
.report-field__value.report-field__value--mono {
  font-family: var(--font-mono);
  font-size: larger;
  letter-spacing: 0.03em;
}

/* Report sub-section heading (e.g. "Dimensions", "Engine Data") */
.report-subsection-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-link);
  padding: 10px 0 6px;
  margin-top: 8px;
  border-top: 1px solid var(--color-border);
}
.report-subsection-title:first-child,
.report-subsection-title--first {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

/* Inline field pair — label: value on one line (e.g. "Tesla Supercharger Compatible: Yes") */
.report-field-inline {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  padding: 8px 0;
  text-align: center;
}
.report-field-inline:first-child {
  padding-top: 0;
}
.report-field-inline strong {
  color: var(--color-text);
  font-weight: 700;
}
.report-field-inline--left { text-align: left; }

/* Report footnote */
.report-footnote {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin: 14px 0 0;
}

/* Conditional section note — muted italic for "not compatible" etc. */
.report-field-note {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-style: italic;
  padding: 6px 0;
}

/* Repeating item divider — for list items (motors, batteries, charge ports) */
.report-item-divider {
  border-top: 1px solid var(--color-border);
  margin-top: 12px;
  padding-top: 12px;
}

/* Report field card — bordered panel pairing two fields (e.g. kW + charge time) */
.report-field-card {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.report-field-card .report-field {
  padding: 0;
}
.report-field-card .report-field + .report-field {
  border-top: 1px solid var(--color-border);
  padding-top: 6px;
}

/* Report field — span modifier for fields that take multiple grid columns */
.report-field--span-3 { grid-column: span 3; }
@media (max-width: 768px) {
  .report-field--span-3 { grid-column: span 2; }
}
@media (max-width: 480px) {
  .report-field--span-3 { grid-column: 1 / -1; }
}

/* Report field grids — responsive column layouts */
.report-field-grid {
  display: grid;
  gap: 4px 20px;
}
.report-field-grid--4 { grid-template-columns: repeat(4, 1fr); }
.report-field-grid--3 { grid-template-columns: repeat(3, 1fr); }
.report-field-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 480px) {
  .report-field-grid--2 { grid-template-columns: 1fr; }
}
.report-field-grid--1 { grid-template-columns: 1fr; }

/* Make/Model — full-width, larger value text */
.report-field--hero .report-field__value {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0;
}

/* DVLA Make+Model separator */
.dvla-make-model {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

/* Combined Make+Model — hidden by default, shown in compact */
.at-a-glance__field--combined { display: none; }
.at-a-glance__meta--combined { display: none; }
.dvla-make-model__combined { display: none; }

/* Muted inline text — for Make in concatenated Make+Model */
.text-muted-inline {
  font-weight: 400;
  color: var(--color-text-muted);
}

/* Responsive: field grids collapse */
@media (max-width: 768px) {
  .report-field-grid--4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .report-field-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .report-field-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   SECTION 6: CO2 Emissions — Banding Chart
   Ported from VDICheck.Consumer css-report.css
   Production component: Co2BandingSection.razor (wraps Co2Banding.razor)
   ============================================================ */

/* CO2 chart variables */
:root {
  --co2-bar-height-desktop: 52px;
  --co2-bar-height-tablet: 44px;
  --co2-bar-height-mobile: 38px;
  --co2-band-0: #00d466;
  --co2-band-1: #4CAF50;
  --co2-band-2: #8BC34A;
  --co2-band-3: #CDDC39;
  --co2-band-4: #FFC107;
  --co2-band-5: #FF9800;
  --co2-band-6: #F44336;
  --co2-info-bg: #444;
  --co2-band-font: 0.85rem;
  --co2-info-font: 0.9rem;
}

.co2-chart {
  max-width: 100%;
  margin: 0 auto;
}
.co2-chart__band {
  display: flex;
  margin-bottom: 6px;
  height: var(--co2-bar-height-desktop);
  position: relative;
}
.co2-chart__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-weight: 700;
  font-size: var(--co2-band-font);
  position: relative;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%);
  border-radius: 10px;
  line-height: inherit;
}
.co2-chart__bar-range { flex: 1; }
.co2-chart__bar-grade { text-align: right; }
.co2-chart__bar {
  transition: filter 0.15s ease;
  cursor: pointer;
}
.co2-chart__bar:hover {
  filter: var(--co2-bar-hover);
}

.co2-chart__info-wrap {
  position: relative;
  display: inline-block;
}
.co2-chart__info {
  background-color: var(--co2-info-bg);
  color: var(--co2-info-text);
  display: none;
  align-items: center;
  font-weight: 700;
  font-size: var(--co2-info-font);
  flex: 1;
  margin-left: 8px;
  clip-path: polygon(24px 0, 100% 0, 100% 100%, 24px 100%, 0 50%);
  padding-left: 30px;
  padding-right: 14px;
  height: var(--co2-bar-height-desktop);
  border-radius: 10px;
}
.co2-chart__badge {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

/* Active band — show info bar + badge */
.co2-chart__band--active .co2-chart__info { display: flex; }
.co2-chart__band--active .co2-chart__badge { display: flex; }

/* Band colours — bg + text controlled by theme, --bar-color set per band for border pseudo */
.co2-chart__bar--0 { background-color: var(--co2-band-0-bg); color: var(--co2-bar-text-0); }
.co2-chart__bar--1 { background-color: var(--co2-band-1-bg); color: var(--co2-bar-text-1); }
.co2-chart__bar--2 { background-color: var(--co2-band-2-bg); color: var(--co2-bar-text-2); }
.co2-chart__bar--3 { background-color: var(--co2-band-3-bg); color: var(--co2-bar-text-3); }
.co2-chart__bar--4 { background-color: var(--co2-band-4-bg); color: var(--co2-bar-text-4); }
.co2-chart__bar--5 { background-color: var(--co2-band-5-bg); color: var(--co2-bar-text-5); }
.co2-chart__bar--6 { background-color: var(--co2-band-6-bg); color: var(--co2-bar-text-6); }


/* CO2 info cards below the chart */
.co2-info-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.co2-info-card {
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-link);
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--color-bg);
}
.co2-info-card__label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.co2-info-card__value {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
}
.co2-info-card__value .report-field__suffix {
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .co2-chart__band { height: var(--co2-bar-height-tablet); }
  .co2-chart__info { height: var(--co2-bar-height-tablet); }
}
@media (max-width: 480px) {
  .co2-chart__band { height: var(--co2-bar-height-mobile); }
  .co2-chart__info { height: var(--co2-bar-height-mobile); font-size: 0.78rem; }
  .co2-chart__bar { font-size: 0.72rem; padding: 0 10px; }
  .co2-info-cards { grid-template-columns: 1fr; }
}

/* ============================================================
   SECTION 10: MIAFTR Accident Damage — vehicle damage visualization
   Ported from VDICheck.Consumer css-report.css
   ============================================================ */

/* Damage container — relative positioning for overlaid grid */
.damage-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 3/2;
  margin: 0 auto 16px;
  background: var(--damage-diagram-bg);
  border-radius: 12px;
  padding: 32px;
}
.damage-container__base {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.damage-container__base img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Theme swap for the base vehicle image. Same pattern as
   .vehicle-lookup-search-logo — both <img>s render, CSS hides the
   inactive variant so [data-theme] flips are instant. Selectors
   include the .damage-container__base parent to lift specificity
   over the earlier `.damage-container__base img { … }` rule. */
.damage-container__base img.damage-base-img--dark { display: none; }
[data-theme="dark"] .damage-container__base img.damage-base-img--light { display: none; }
[data-theme="dark"] .damage-container__base img.damage-base-img--dark  { display: block; }

/* Full-vehicle overlays (underside / whole vehicle) */
.damage-overlay--full {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.damage-overlay--full img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 3×3 grid overlay for localized damage */
.damage-grid {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  pointer-events: none;
}
.damage-cell {
  position: relative;
  display: flex;
}
.damage-cell[data-index="0"] { grid-area: 1/1; }
.damage-cell[data-index="1"] { grid-area: 1/2; }
.damage-cell[data-index="2"] { grid-area: 1/3; }
.damage-cell[data-index="3"] { grid-area: 2/1; }
.damage-cell[data-index="4"] { grid-area: 2/2; }
.damage-cell[data-index="5"] { grid-area: 2/3; }
.damage-cell[data-index="6"] { grid-area: 3/1; }
.damage-cell[data-index="7"] { grid-area: 3/2; }
.damage-cell[data-index="8"] { grid-area: 3/3; }

.damage-indicator {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: damage-pulse 1.5s ease-in-out infinite;
  filter: var(--damage-indicator-filter);
}
@keyframes damage-pulse {
  0%   { opacity: 0.7; transform: scale(1); }
  50%  { opacity: 1;   transform: scale(1.08); }
  100% { opacity: 0.7; transform: scale(1); }
}

/* Corner labels on the damage diagram */
.damage-labels {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  font-size: 0.68rem;
  color: var(--color-text-muted);
  font-style: italic;
}
.damage-labels span {
  position: absolute;
}
.damage-labels__tl { top: 2px; left: 4px; }
.damage-labels__tr { top: 2px; right: 4px; }
.damage-labels__bl { bottom: 2px; left: 4px; }
.damage-labels__br { bottom: 2px; right: 4px; }

/* Damage row items (listed below the diagram) */
.damage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  margin-bottom: 6px;
}
.damage-row__badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--damage-badge-bg);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.damage-row__text {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}
.damage-row__text strong {
  color: var(--color-text);
}

/* Damage rows grid — 2 cols desktop, 1 col mobile */
.damage-rows {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
@media (max-width: 480px) {
  .damage-rows { grid-template-columns: 1fr; }
  .damage-container { aspect-ratio: 4/3; }
}

/* MIAFTR report info card */
.miaftr-info-card {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px 18px;
  background: var(--color-bg);
  margin-top: 12px;
}
.miaftr-info-card__title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 12px;
}
/* Damage status / cause — larger highlighted fields */
.miaftr-highlight {
  border: 1px solid var(--color-danger-border);
  border-left: 4px solid var(--color-danger);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--color-danger-bg);
  margin-bottom: 10px;
}
.miaftr-highlight__label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.miaftr-highlight__value {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-text);
  text-transform: uppercase;
  margin-top: 2px;
}

/* ============================================================
   SECTION 26: MOT Mileage Records — chart + table
   ============================================================ */
.mileage-chart-wrap,
.payments-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 300px;
}
.mileage-chart-wrap canvas,
.payments-chart-wrap canvas {
  height: 100% !important;
}

/* /payments spend chart - inline View label + wide select + trim toggle,
   always on a single row. */
.spend-chart-controls {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.spend-chart-controls__label {
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}
.spend-chart-controls__select {
    min-width: 140px;
    width: auto;
}
/* On narrow viewports the trim toggle needs the horizontal space the
   selector was reserving - let the select shrink to its content width so
   all three controls stay on one line. */
@media (max-width: 560px) {
    .spend-chart-controls__select { min-width: 0; width: auto; flex: 0 1 auto; }
}
/* Site-standard .toggle-switch, aligned beside the View selector. Text
   can't wrap and the toggle never shrinks - the selector takes the
   elastic hit on mobile instead. */
.spend-chart-controls__trim {
    margin-left: auto;
    flex: 0 0 auto;
    gap: 8px;
}
.spend-chart-controls__trim .toggle-text { white-space: nowrap; }
.spend-chart-totals {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.spend-chart-totals__tile {
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid var(--color-success-border);
    background: var(--color-success-bg);
}
.spend-chart-totals__tile--refund {
    background: var(--color-danger-bg, #fef2f2);
    border-color: var(--color-danger-border, #fecaca);
}
/* Dim only the big figure when a refund tile has nothing to report, so the
   label underneath stays fully readable in both themes. */
.spend-chart-totals__tile--empty .spend-chart-totals__value {
    opacity: 0.55;
}
.spend-chart-totals__value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-success);
    line-height: 1.1;
}
.spend-chart-totals__tile--refund .spend-chart-totals__value {
    color: var(--color-danger, #dc2626);
}
.spend-chart-totals__label {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--color-text);
    font-weight: 500;
}
@media (max-width: 560px) {
    .spend-chart-totals { grid-template-columns: 1fr; }
}

/* Anomaly row highlight — mileage lower than previous (red) */
.mileage-row--warn {
  background: var(--mileage-warn-bg) !important;
  outline: var(--mileage-warn-border);
}
.mileage-row--warn td {
  color: var(--mileage-warn-text) !important;
}
.mileage-row--warn:hover td {
  background: var(--mileage-warn-hover) !important;
}

/* Duplicate mileage row highlight (amber) */
.mileage-row--duplicate {
  background: var(--mileage-dup-bg) !important;
  outline: var(--mileage-dup-border);
}
.mileage-row--duplicate td {
  color: var(--mileage-dup-text) !important;
}
.mileage-row--duplicate:hover td {
  background: var(--mileage-dup-hover) !important;
}

/* Retest mileage row - a duplicate that is explained by a DVSA-flagged
   MOT retest (fail + same-day retest, identical odometer). Keeps the
   grouping treatment of a duplicate row (coloured bg + outline) but on
   the info-blue palette so it reads as metadata, not a warning. Row
   data is NOT greyed - the dealer still reads the figures at full
   contrast; the chip + border carry the "this is rework" meaning. */
.mileage-row--retest {
  background: var(--mileage-retest-bg) !important;
  outline: var(--mileage-retest-border);
}
.mileage-row--retest:hover td {
  background: var(--mileage-retest-hover) !important;
}
.mileage-row__chip {
  display: inline-block;
  margin-left: 16px;
  padding: 1px 7px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-radius: 10px;
  vertical-align: middle;
  white-space: nowrap;
}
.mileage-row__chip--retest {
  background: var(--mot-retest-chip-bg);
  color: var(--mot-retest-chip-text);
  border: var(--mot-retest-chip-border);
}

/* Mileage table — centre # column */
#section-mot-mileage .data-table th:first-child,
#section-mot-mileage .data-table td:first-child {
  text-align: center;
}
/* Mileage column - tabular monospace so the digits column-align at
   the right edge and long/short numbers read at a glance. Size lives
   in --mot-mileage-cell-size so it can be tuned without touching the
   selector; weight kept at 500 so the value reads clean rather than
   competing with the row's other bold cells. Header inherits the
   font/tabular treatment so the label lines up with its values. */
:root {
  --mot-mileage-cell-size: 1rem;
  --mot-mileage-cell-weight: 500;
}
#section-mot-mileage .data-table th:nth-child(3),
#section-mot-mileage .data-table td:nth-child(3) {
  font-family: var(--font-mono, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
#section-mot-mileage .data-table td:nth-child(3),
#section-mot-mileage .data-table td:nth-child(3).td-bold {
  font-size: var(--mot-mileage-cell-size);
  font-weight: var(--mot-mileage-cell-weight);
}
.report--compact #section-mot-mileage .data-table td:first-child {
  font-size: 0.7rem;
  font-weight: 400;
}

/* Mileage row inline alert icon */
.mileage-row__icon {
  margin-left: 8px;
}

/* Mileage stats cards */
.mileage-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
/* 3-up variant for the top-level stats row: Avg Annual | Vehicle Mileage | Avg For Age. */
.mileage-stats--3up { grid-template-columns: 1fr 1fr 1fr; }
/* Solo variant: single Vehicle Mileage card when there are no MOT records
   to populate the Avg Annual / For Age pair. */
.mileage-stats--solo { grid-template-columns: 1fr; max-width: 420px; margin-left: auto; margin-right: auto; }
.mileage-stat--highlight {
  background: var(--color-tint, var(--color-bg));
  border-color: var(--valuation-highlight, var(--color-brand, var(--color-border)));
  border-width: 2px;
}
@media (max-width: 768px) {
  .mileage-stats--3up { grid-template-columns: 1fr; }
}
.mileage-stat {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--color-bg);
  text-align: center;
}
.mileage-stat__label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.mileage-stat__value {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-text);
}

/* Stat card variant with a Bootstrap Icon glyph on top. The icon scales
   with the card so it reads as the visual anchor without competing with
   the value. */
.mileage-stat--icon {
  padding: 16px;
}
.mileage-stat__icon {
  display: block;
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 8px;
  color: var(--valuation-highlight);
}

/* Small subtext under the value — used for "in <year>" on Highest/Lowest
   mileage cards. Muted so it doesn't compete with the mileage number. */
.mileage-stat__meta {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* The Highest/Lowest MOT-interval panel stacks earlier than the
   generic .mileage-stats because each card carries an extra meta line
   ("Between 2015 → 2016") on top of a longer label. Two-up at that
   width crowds the value; one-per-row reads clean. */
@media (max-width: 768px) {
  .mileage-stats--intervals { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .mileage-chart-wrap { min-height: 220px; }
  .mileage-stats { grid-template-columns: 1fr; }
}

/* ============================================================
   SECTION 27: MOT History — accordion + annotation badges
   ============================================================ */

/* MOT Status cards — 3-column row */
.mot-status-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}
.mot-status-card {
  border: 1px solid var(--mot-status-card-border);
  border-radius: 10px;
  padding: 16px;
  background: var(--mot-status-card-bg);
  text-align: center;
}
.mot-status-card--danger {
  border-color: var(--color-danger-border);
  background: var(--color-danger-bg);
  color: var(--color-danger);
}
.mot-status-card--danger .mot-status-card__label {
  color: var(--color-danger);
}
.mot-status-card--clear {
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
  color: var(--color-success);
}
.mot-status-card--clear .mot-status-card__label {
  color: var(--color-success);
}
.mot-status-card--warn {
  border-color: var(--color-warning-border);
  background: var(--color-warning-bg);
  color: var(--color-warning);
}
.mot-status-card--warn .mot-status-card__label {
  color: var(--color-warning);
}
.mot-status-card__label {
  font-size: 0.78rem;
  color: var(--color-text);
  margin-bottom: 6px;
}
.mot-status-card__value {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
}
.mot-status-card__value--danger {
  color: var(--color-danger);
}
.mot-status-card__value--clear {
  color: var(--color-success);
}
.mot-status-card__value--warn {
  color: var(--color-warning);
}
@media (max-width: 600px) {
  .mot-status-cards { grid-template-columns: 1fr; }
}

/* MOT toolbar — hint text + expand/collapse toggle */
.mot-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.mot-toolbar__left,
.mot-toolbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mot-toolbar__hint {
  font-size: 0.75rem;
  color: var(--color-text);
}

/* Segmented List / Tree view switcher. Sits in the left slot of
   .mot-toolbar and governs which layout MotHistorySection renders.
   Shares button metrics with .mot-toolbar__toggle so the row sits
   visually balanced. */
.mot-view-toggle {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  /* overflow:visible so each button's ::after tooltip (positioned
     above via bottom:100%) isn't clipped by the toggle's border box.
     Rounded corners on the first/last buttons keep active-fill
     backgrounds from leaking past the toggle's rounded shell. */
}
.mot-view-toggle__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  padding: 0;
  background: transparent;
  color: var(--color-text-muted);
  border: 0;
  border-right: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}
.mot-view-toggle__btn:first-child {
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
}
.mot-view-toggle__btn:last-child {
  border-right: 0;
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}
.mot-view-toggle__btn:hover { color: var(--color-link); background: var(--color-info-bg); }
.mot-view-toggle__btn.active {
  background: var(--color-link);
  color: var(--color-text-inverse);
}
.mot-view-toggle__btn i { font-size: 0.95rem; line-height: 1; }
/* Tooltip above the button on hover - mirrors .mot-toolbar__toggle::after. */
.mot-view-toggle__btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  padding: 4px 8px;
  background: var(--color-text);
  color: var(--color-text-inverse);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  border-radius: var(--radius);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 2;
}
.mot-view-toggle__btn[data-tooltip]:hover::after { opacity: 1; }

/* ---- MOT History Tree view -------------------------------------
   Alternating-sides timeline. Central dotted spine, coloured dot per
   test, horizontal stem to the card. Cards are <details> elements and
   grow in place when expanded; the stem anchors to the card's top edge
   so expansion never shifts the dot off-centre.
   Mobile/tablet (<= 1024px): collapses to spine-left / cards-right in
   a single column via media query; the alternation disappears but the
   collapsible pattern stays identical.
   ----------------------------------------------------------------- */
.mot-tree {
  position: relative;
  padding: 8px 0 16px;
}
.mot-tree__spine {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dotted var(--mot-tree-spine, var(--color-border));
  transform: translateX(-50%);
  pointer-events: none;
}

/* One row per year group. Two-column grid with a 40px gutter straddling
   the spine so there's room for stems and dots on both sides without
   the year block or cards touching the spine itself. Year block sits
   in column 1 (--left) or column 2 (--right); the node (spine dot) is
   absolutely positioned on the spine, independent of the grid. */
.mot-tree__item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 40px;
  align-items: start;
  margin-bottom: 28px;
}
.mot-tree__item:last-child { margin-bottom: 0; }
.mot-tree__item--left  > .mot-tree__year-block { grid-column: 1; }
.mot-tree__item--right > .mot-tree__year-block { grid-column: 2; }

/* Year block: badge + stacked cards. Side alignment keeps the badge
   and cards flush with the spine-facing edge of the column. */
.mot-tree__year-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.mot-tree__item--left  > .mot-tree__year-block { align-items: flex-end; text-align: right; }
.mot-tree__item--right > .mot-tree__year-block { align-items: flex-start; text-align: left; }

/* Year badge: calendar icon + bold year number in a pill. Draws the
   eye to the chapter break. Height is deliberate (34px) so the spine
   node can line up with its vertical centre via absolute positioning. */
.mot-tree__year-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  background: var(--mot-tree-year-badge-bg, var(--color-surface));
  color: var(--mot-tree-year-label, var(--color-text));
  border: 1px solid var(--mot-tree-year-badge-border, var(--color-border));
  border-radius: 999px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.mot-tree__year-badge__icon {
  font-size: 1.05rem;
  opacity: 0.75;
  line-height: 1;
}

/* Stem from the year badge to the spine node. SOLID line, 2px, in
   the --mot-tree-stem token so it reads clearly in both themes. */
.mot-tree__item--left  > .mot-tree__year-block > .mot-tree__year-badge::after,
.mot-tree__item--right > .mot-tree__year-block > .mot-tree__year-badge::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px;
  height: 0;
  border-top: 2px solid var(--mot-tree-stem, var(--color-border));
  transform: translateY(-50%);
}
.mot-tree__item--left  > .mot-tree__year-block > .mot-tree__year-badge::after { right: -18px; }
.mot-tree__item--right > .mot-tree__year-block > .mot-tree__year-badge::after { left: -18px; }

/* Cards container: full column width so cards don't shrink to badge
   width. The parent align-items handles side alignment. */
.mot-tree__year-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

/* Wrapper around each card. Carries the sub-dot + stem pseudos.
   Needed because <details> under certain Chromium conditions clips
   or ignores ::before/::after - a wrapper div is reliable. The
   wrapper is width:100% so it fills the year-cards column, and
   position:relative so the pseudos anchor to it. */
.mot-tree__card-wrap {
  position: relative;
  width: 100%;
}

.mot-tree__card {
  position: relative;
  background: var(--mot-tree-card-bg, var(--color-surface));
  border: 1px solid var(--mot-tree-card-border, var(--color-border));
  border-radius: 10px;
  margin-bottom: 0;
  text-align: left;
}

/* Per-card sub-dot + stem on the spine, drawn on the wrapper div so
   they aren't affected by anything the <details> element or its
   accordion styling do. Sub-dot (8px) is deliberately smaller than
   the year node (20px) so the year reads as primary waypoint and
   MOTs as secondary. Dot colour tracks data-result on the wrapper. */
.mot-tree__card-wrap::after,
.mot-tree__card-wrap::before {
  content: "";
  position: absolute;
  pointer-events: none;
}
/* Stem renders UNDER the dot (z-index 1 vs 2) so it visually tucks
   behind the circle rather than sitting on top of it. */
.mot-tree__card-wrap::after {
  top: 19px;
  width: 20px;
  height: 0;
  border-top: 2px solid var(--mot-tree-stem, var(--color-border));
  z-index: 1;
}
.mot-tree__card-wrap::before {
  top: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--mot-tree-dot-pass, var(--color-success));
  border: 3px solid var(--mot-tree-card-bg, var(--color-surface));
  box-shadow: 0 0 0 1px var(--mot-tree-spine, var(--color-border));
  z-index: 2;
}
.mot-tree__card-wrap[data-result="fail"]::before { background: var(--mot-tree-dot-fail, var(--color-danger)); }
.mot-tree__card-wrap[data-result="prs"]::before  { background: var(--mot-tree-dot-prs,  var(--color-warning)); }

/* Place the sub-dot + stem on the spine side. Column ends 20px short
   of the 50% centre (grid-template-columns: 1fr 1fr; column-gap: 40px);
   stem spans the full 20px gap and the 20px dot centres on the spine. */
.mot-tree__item--left  > .mot-tree__year-block .mot-tree__card-wrap::after { right: -20px; }
.mot-tree__item--right > .mot-tree__year-block .mot-tree__card-wrap::after { left: -20px; }
.mot-tree__item--left  > .mot-tree__year-block .mot-tree__card-wrap::before { right: -30px; }
.mot-tree__item--right > .mot-tree__year-block .mot-tree__card-wrap::before { left: -30px; }

/* Spine year-node: absolutely positioned at the spine, aligned with
   the year badge's vertical centre (badge is 40px tall, centre at
   top:20px, so a 30px dot sits at top:5px). Deliberately larger than
   the per-card sub-dots so the year reads as the primary waypoint.
   Carries a flex layout so the pass/fail glyph centres inside. */
.mot-tree__node {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--mot-tree-dot-pass, var(--color-success));
  border: 3px solid var(--mot-tree-card-bg, var(--color-surface));
  box-shadow: 0 0 0 1px var(--mot-tree-spine, var(--color-border));
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 15px;
  line-height: 1;
}
.mot-tree__node > i {
  font-size: inherit;
  line-height: 1;
}
.mot-tree__node--pass { background: var(--mot-tree-dot-pass, var(--color-success)); }
.mot-tree__node--fail { background: var(--mot-tree-dot-fail, var(--color-danger)); }
.mot-tree__node--prs  { background: var(--mot-tree-dot-prs,  var(--color-warning)); }

/* <= 1024px: collapse to spine-left single column. Year blocks all
   land on the right of the spine; alternation disappears.
   Spine stays at 10px from the mot-tree edge. Items carry their own
   left padding so their inner content starts past the spine without
   mot-tree padding offsetting the absolute-positioned dot. */
@media (max-width: 1024px) {
  .mot-tree { padding-left: 0; }
  .mot-tree__spine { left: 10px; transform: none; }
  .mot-tree__item {
    padding-left: 32px;
    grid-template-columns: 1fr;
    column-gap: 0;
  }
  .mot-tree__item--left  > .mot-tree__year-block,
  .mot-tree__item--right > .mot-tree__year-block {
    grid-column: 1;
    align-items: flex-start;
    text-align: left;
  }
  .mot-tree__node { left: 10px; }
  .mot-tree__item--left  > .mot-tree__year-block > .mot-tree__year-badge::after,
  .mot-tree__item--right > .mot-tree__year-block > .mot-tree__year-badge::after {
    left: -18px; right: auto; width: 18px;
  }
  .mot-tree__item--left  > .mot-tree__year-block .mot-tree__card-wrap::after,
  .mot-tree__item--right > .mot-tree__year-block .mot-tree__card-wrap::after {
    left: -20px; right: auto;
  }
  .mot-tree__item--left  > .mot-tree__year-block .mot-tree__card-wrap::before,
  .mot-tree__item--right > .mot-tree__year-block .mot-tree__card-wrap::before {
    left: -30px; right: auto;
  }
}

/* ---- Tightened pill / text scale inside the Tree view ----------
   Scoped overrides for the accordion + annotation styling so the
   tree reads as a denser, more scannable layout than the List view.
   Nothing outside .mot-tree is affected.
   ----------------------------------------------------------------- */
.mot-tree .mot-accordion__header {
  padding: 8px 12px;
  gap: 8px;
}
.mot-tree .mot-accordion__date {
  font-size: 0.8rem;
  min-width: 80px;
}
.mot-tree .mot-accordion__badge {
  font-size: 0.65rem;
  padding: 2px 0;
  width: 50px;
  margin-left: 6px;
}
.mot-tree .mot-accordion__chip {
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 0.6rem;
  letter-spacing: 0.3px;
}
.mot-tree .mot-accordion__summary {
  font-size: 0.7rem;
}
.mot-tree .mot-accordion__chevron {
  font-size: 0.8rem;
}
.mot-tree .mot-accordion[open] .mot-accordion__body {
  padding: 12px;
}
.mot-tree .mot-annotation-group {
  margin-top: 10px;
}
.mot-tree .mot-annotation-group__title {
  font-size: 0.78rem;
  margin-bottom: 4px;
}
.mot-tree .mot-annotation-group__subtitle {
  font-size: 0.7rem;
}
.mot-tree .mot-annotation {
  gap: 6px;
  padding: 4px 0;
  font-size: 0.78rem;
}
.mot-tree .mot-annotation__badge {
  padding: 2px 6px;
  font-size: 0.6rem;
  min-width: 54px;
}
.mot-tree .mot-annotation__text {
  font-size: 0.78rem;
}
.mot-tree .report-field__label {
  font-size: 0.65rem;
}
.mot-tree .report-field__value {
  font-size: 0.82rem;
}
.mot-tree .mot-accordion__retest-note {
  padding: 6px 10px;
  margin-bottom: 10px;
  font-size: 0.78rem;
}
.mot-tree .ved-status-banner {
  padding: 8px 10px;
  font-size: 0.78rem;
}
.mot-tree .ved-status-banner__title {
  font-size: 0.82rem;
}
.mot-tree .ved-status-banner__detail {
  font-size: 0.75rem;
}
.mot-tree .mot-extension__header {
  font-size: 0.78rem;
  padding: 6px 10px;
}

/* Legacy per-card direct-child selectors from the first tree iteration
   (before year-grouping restructure). Current card lives at
   .mot-tree__item > .mot-tree__year-block > .mot-tree__year-cards >
   .mot-tree__card-wrap, so these rules no longer match - kept
   deliberately empty-of-effect but noted here so future greps turn up
   nothing surprising. Removed. */
.mot-toolbar__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  position: relative;
}
.mot-toolbar__toggle:hover {
  color: var(--color-link);
  border-color: var(--color-link);
  background: var(--color-info-bg);
}
.mot-toolbar__toggle::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: var(--color-text);
  color: var(--color-text-inverse);
  font-size: 0.7rem;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  margin-bottom: 4px;
}
.mot-toolbar__toggle:hover::after {
  opacity: 1;
}

/* Factory Equipment toolbar — same visual language as the MOT toolbar,
   applied to the Expand/Collapse All control that governs both the
   Standard and Optional accordions in Factory Equipment. */
.equip-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 8px;
}
.equip-toolbar__hint {
  font-size: 0.75rem;
  color: var(--color-text);
}
.equip-toolbar__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  position: relative;
}
.equip-toolbar__toggle:hover {
  color: var(--color-link);
  border-color: var(--color-link);
  background: var(--color-info-bg);
}
.equip-toolbar__toggle::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: var(--color-text);
  color: var(--color-text-inverse);
  font-size: 0.7rem;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  margin-bottom: 4px;
}
.equip-toolbar__toggle:hover::after {
  opacity: 1;
}

/* MOT Accordion */
.mot-accordion {
  border: 1px solid var(--mot-accordion-border);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}
.mot-accordion__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--mot-accordion-bg);
  color: var(--mot-accordion-text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.15s ease;
}
.mot-accordion__header:hover {
  background: var(--mot-accordion-hover);
}

/* Pass/fail tinted headers - .mot-accordion--pass / --fail modifier
   on the <details> element flips the summary bg to a soft green or
   red so a dealer scanning a long MOT list can read outcomes at a
   glance. Light-mode tints are saturated enough that header text
   (date, summary, chevron) + the retest chip need to flip to white
   for contrast; dark-mode tints are alpha so they blend softly
   against the panel and keep their default text colour. Summary
   opacity bumped to 1 so the softened "All Clear" / "Failures (N)"
   stays legible on the tint. */
.mot-accordion--pass > .mot-accordion__header {
  background: var(--mot-accordion-pass-bg);
  color: var(--mot-accordion-pass-text);
}
.mot-accordion--pass > .mot-accordion__header:hover {
  background: var(--mot-accordion-pass-bg-hover);
}
.mot-accordion--fail > .mot-accordion__header {
  background: var(--mot-accordion-fail-bg);
  color: var(--mot-accordion-fail-text);
}
.mot-accordion--fail > .mot-accordion__header:hover {
  background: var(--mot-accordion-fail-bg-hover);
}
.mot-accordion--pass > .mot-accordion__header .mot-accordion__date,
.mot-accordion--pass > .mot-accordion__header .mot-accordion__summary,
.mot-accordion--pass > .mot-accordion__header .mot-accordion__chevron,
.mot-accordion--fail > .mot-accordion__header .mot-accordion__date,
.mot-accordion--fail > .mot-accordion__header .mot-accordion__summary,
.mot-accordion--fail > .mot-accordion__header .mot-accordion__chevron {
  color: inherit;
  opacity: 1;
}

.mot-accordion__header::-webkit-details-marker {
  display: none;
}
.mot-accordion__header::marker {
  display: none;
  content: '';
}
.mot-accordion__date {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  min-width: 90px;
}
.mot-accordion__badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 0;
  border-radius: 4px;
  white-space: nowrap;
  margin-left: 10px;
  width: 60px;
  text-align: center;
}
.mot-accordion__badge--pass {
  background: var(--mot-badge-pass-bg);
  color: var(--mot-badge-pass-text);
  border: 1px solid var(--mot-badge-pass-border);
}
.mot-accordion__badge--fail {
  background: var(--mot-badge-fail-bg);
  color: var(--mot-badge-fail-text);
  border: 1px solid var(--mot-badge-fail-border);
}
.mot-accordion__summary {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mot-accordion-text);
  opacity: 0.7;
  margin-left: auto;
  white-space: nowrap;
}
/* Retest chip - sits next to the Pass/Fail badge to flag a follow-up
   test after a previous failure (DVSA MotTest.IsRetest). Neutral
   indigo so it reads as metadata, not a severity. */
.mot-accordion__chip {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-radius: 10px;
  white-space: nowrap;
}
.mot-accordion__chip--retest {
  background: var(--mot-retest-chip-bg);
  color: var(--mot-retest-chip-text);
  border: var(--mot-retest-chip-border);
}
/* Retest body note - one-liner at the top of the accordion body that
   anchors the retest row to the failed test it followed. Info-blue
   palette with light/dark theme tokens so it inverts cleanly. */
.mot-accordion__retest-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--mot-retest-note-bg);
  border: var(--mot-retest-note-border);
  border-radius: 6px;
  color: var(--mot-retest-note-text);
  font-size: 0.85rem;
}
.mot-accordion__retest-note__icon {
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1.4;
}
.mot-accordion__chevron {
  font-size: 0.9rem;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.mot-accordion[open] .mot-accordion__chevron {
  transform: rotate(180deg);
}

/* Accordion body — animated expand/collapse */
.mot-accordion__body {
  padding: 0 16px;
  border-top: 1px solid var(--color-border);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease 0.05s, padding 0.3s ease;
}
.mot-accordion[open] .mot-accordion__body {
  padding: 16px;
  max-height: 2000px;
  opacity: 1;
}

/* MOT Extension card */
.mot-extension {
  border: 1px solid var(--mot-extension-header-bg, #475569);
  border-radius: 8px;
  margin-top: 12px;
  overflow: hidden;
}
.mot-extension__header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--mot-extension-header-bg, #475569);
  color: var(--mot-extension-header-text, #ffffff);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  padding: 10px 16px;
  letter-spacing: 0.02em;
}
/* Virus icon on the MOT Extension header - pulls the dealer's eye to
   the fact that this particular test's validity was extended (most
   commonly a DVSA COVID-era 6-month extension). Gentle pulse so it's
   noticeable without being distracting. */
.mot-extension__icon {
  font-size: 1.3rem;
  line-height: 1;
  animation: mot-extension-pulse 2.6s ease-in-out infinite;
  transform-origin: center;
}
@keyframes mot-extension-pulse {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .mot-extension__icon { animation: none; }
}
.mot-extension .report-field-grid {
  padding: 14px 16px;
}

/* Annotation groups */
.mot-annotation-group {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 12px;
  background: var(--color-bg);
}
.mot-annotation-group__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mot-annotation-group__icon {
  font-size: 0.95rem;
}
.mot-annotation-group__icon--danger {
  color: var(--color-danger);
}
.mot-annotation-group__subtitle {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-left: 4px;
}
.mot-annotation {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
}
.mot-annotation:not(:last-child) {
  border-bottom: 1px solid var(--color-border);
}

/* Annotation badges */
.mot-annotation__badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.mot-annotation__badge--dangerous {
  background: var(--mot-badge-dangerous-bg);
  color: var(--mot-badge-dangerous-text);
  border: 1px solid var(--mot-badge-dangerous-border);
}
.mot-annotation__badge--major {
  background: var(--mot-badge-major-bg);
  color: var(--mot-badge-major-text);
  border: 1px solid var(--mot-badge-major-border);
}
.mot-annotation__badge--fail {
  background: var(--mot-badge-fail-bg);
  color: var(--mot-badge-fail-text);
  border: 1px solid var(--mot-badge-fail-border);
}
.mot-annotation__badge--advisory {
  background: var(--mot-badge-advisory-bg);
  color: var(--mot-badge-advisory-text);
  border: 1px solid var(--mot-badge-advisory-border);
}
.mot-annotation__badge--prs {
  background: var(--mot-badge-prs-bg);
  color: var(--mot-badge-prs-text);
  border: 1px solid var(--mot-badge-prs-border);
}
.mot-annotation__badge--user {
  background: var(--mot-badge-user-bg);
  color: var(--mot-badge-user-text);
  border: 1px solid var(--mot-badge-user-border);
}
.mot-annotation__text {
  font-size: 0.85rem;
  color: var(--color-text);
  line-height: 1.5;
  padding-top: 2px;
}

/* ============================================================
   SECTION 9: Your Notes
   ============================================================ */
.notes-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.notes-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.notes-field__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notes-field__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
}
.notes-field__counter {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}
.notes-field__input {
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: var(--font-primary);
  color: var(--color-text);
  background: var(--color-input-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s ease;
  color-scheme: var(--input-color-scheme);
}
.notes-field__input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(69,188,74,0.15);
}
.notes-field__input--textarea {
  resize: vertical;
  min-height: 80px;
}
.notes-submit {
  padding: 10px 32px;
  font-size: 0.85rem;
  font-weight: 600;
  align-self: center;
  width: 100%;
  max-width: 320px;
  box-shadow: none;
}

/* ============================================================
   SECTION 10: VDI Valuations
   ============================================================ */

/* Top summary panels (Mileage + OTR) */
.valuation-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.valuation-panel {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  background: var(--color-bg);
}
.valuation-panel__label {
  font-size: 0.78rem;
  color: var(--color-text);
  margin-bottom: 6px;
}
.valuation-panel__icon {
  display: block;
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 8px;
  color: var(--valuation-highlight);
}
.valuation-panel__value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--valuation-highlight);
}

/* Valuation figures grid — 4 cols desktop, 3 cols tablet + mobile */
.valuation-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px 20px;
}
.valuation-grid .report-field {
  text-align: center;
}
.valuation-grid .report-field__value {
  font-size: 1.25rem;
  font-weight: 800;
}
@media (max-width: 768px) {
  .valuation-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .valuation-grid { grid-template-columns: repeat(3, 1fr); }
  .valuation-grid .report-field__value { font-size: 1.1rem; }
}

/* ============================================================
   SECTION 8: Factory Equipment (Standard & Optional)
   Production component: FactoryEquipmentSection.razor
   ============================================================ */

/* Accordion — category expander using native <details> */
.equip-accordion {
  border: 1px solid var(--equip-accordion-border);
  border-radius: 8px;
  margin-bottom: 6px;
  overflow: hidden;
}
.equip-accordion__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--equip-accordion-bg);
  color: var(--equip-accordion-text);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: var(--equip-accordion-weight);
  cursor: pointer;
  list-style: none;
  transition: background 0.15s ease;
}
.equip-accordion__summary:hover {
  background: var(--equip-accordion-hover);
}
.equip-accordion__summary::-webkit-details-marker { display: none; }
.equip-accordion__summary::marker { display: none; content: ''; }
.equip-accordion__chevron {
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-left: 12px;
  transition: transform 0.2s ease;
}
.equip-accordion[open] .equip-accordion__chevron {
  transform: rotate(180deg);
}
.equip-accordion__body {
  padding: 12px 16px;
  background: var(--color-surface);
}

/* Equipment items — 2-column grid on desktop, 1 on mobile */
.equip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (max-width: 480px) {
  .equip-grid { grid-template-columns: 1fr; }
}

/* Single equipment item */
.equip-item {
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}
.equip-item__name {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.equip-item__name i { color: var(--color-text-muted); font-size: 0.85rem; }
.equip-item__desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
  padding-left: 22px;
}

/* Package — full-width highlighted card with nested children */
.equip-package {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  grid-column: 1 / -1;
  margin-bottom: 4px;
}
.equip-package__name {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.equip-package__name i { color: var(--color-link); font-size: 0.85rem; }
.equip-package__desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
  padding-left: 22px;
}
.equip-package__child {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding: 2px 0 2px 22px;
}
.equip-package__child i { font-size: 0.7rem; color: var(--color-text-light); }

/* ============================================================
   SECTION 7: VED Rates & Running Costs
   ============================================================ */

/* Tax status banner — full-width success/danger banner (no left accent) */
.ved-status-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid;
  margin-bottom: 16px;
}
.ved-status-banner--clear {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success);
}
.ved-status-banner:last-child { margin-bottom: 0; }
.ved-status-banner--warn {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning);
}
.ved-status-banner--alert {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: var(--color-danger);
}
.ved-status-banner--info {
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
  color: var(--color-info);
}
.ved-status-banner__icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}
/* Plate variant of the banner icon slot — the yellow VRM pill sits
   in the same left-column role, kept from shrinking and nudged up
   a hair so it sits with the title baseline. */
.plate-mismatch-banner__plate {
  flex-shrink: 0;
  align-self: center;
}
/* Clickable alert banners (used in Vehicle Alerts Summary) */
a.ved-status-banner {
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
a.ved-status-banner:hover {
  opacity: 0.85;
  color: inherit;
}
.ved-status-banner__title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}
.ved-status-banner__detail {
  font-size: 0.82rem;
  color: var(--color-text);
  opacity: 0.85;
  margin-top: 2px;
}

/* Early-history gap banner: prominent year-range chips between the
   banner title and the detail body so the missing window reads at a
   glance. Chips use the banner's own warn colour tokens so they feel
   part of the warning, not an isolated accent. */
.mot-gap-banner__body { width: 100%; }
.mot-gap-years {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
}
.mot-gap-years__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--color-surface);
  color: var(--color-warning, var(--color-text));
  border: 2px solid var(--color-warning, var(--color-border));
  border-radius: 999px;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
}
.mot-gap-years__icon {
  font-size: 1.15rem;
  opacity: 0.85;
  line-height: 1;
}
.mot-gap-years__sep {
  font-size: 1.3rem;
  color: var(--color-warning, var(--color-text-muted));
  line-height: 1;
}
.ved-status-banner__highlight {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 4px;
}

/* VED rate card — bordered sub-section for 1st Year / Standard / Premium */
.ved-rate-card {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 12px;
  background: var(--color-bg);
}
.ved-rate-card__title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}
.ved-rate-card__info-banner {
  font-size: 0.82rem;
  color: var(--color-text);
  line-height: 1.5;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  border-radius: 8px;
}
.ved-rate-card__info-banner i {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-info);
}
/* ============================================================
   SECTION 19: Euro NCAP Safety Rating
   ============================================================ */
.ncap-rating {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.ncap-rating__stars-block {
  flex: 1;
  text-align: center;
}
.ncap-rating__title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}
.ncap-rating__stars {
  font-size: 2rem;
  letter-spacing: 4px;
  line-height: 1;
  margin-bottom: 6px;
}
.ncap-star--filled { color: var(--ncap-star-filled); }
.ncap-star--empty  { color: var(--color-border-dark); }
.ncap-rating__label {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}
.ncap-rating__desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  flex: 1;
  min-width: 200px;
}
.ncap-rating__desc strong {
  color: var(--color-text);
}

/* NCAP percentage cards */
.ncap-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.ncap-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--color-bg);
  text-align: center;
}
.ncap-card__value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: 4px;
}
.ncap-card__label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}
@media (max-width: 768px) {
  .ncap-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .ncap-rating__stars { font-size: 1.5rem; letter-spacing: 2px; }
  .ncap-rating__label { font-size: 0.75rem; }
}
@media (max-width: 480px) {
  .ncap-rating { flex-direction: column; align-items: center; text-align: center; }
  .ncap-rating__desc { min-width: 0; }
  .ncap-cards { grid-template-columns: repeat(2, 1fr); }
}

/* Finance record cards — tablet + mobile: company full-width above, details 2×2 */
@media (max-width: 768px) {
  .finance-detail-row { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Finance type pill — draws the eye to PCP / Leasing / HP etc. Matches the
   Vehicle Year pill in the full-report sub-header (neutral theme palette,
   shallow corner radius) but at a larger font size so the finance type
   reads as a section anchor. The alert-info icon sits inside the pill and
   scales up slightly for visual balance. */
.finance-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 4px;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.finance-type-pill__icon {
  font-size: 1.15rem;
  line-height: 1;
}

/* Larger value text for VED rate amounts only */
.ved-rate-card--lg .report-field__value {
  font-size: 1.4rem;
  font-weight: 800;
}

.ved-rate-card__footnote {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin: 10px 0 0;
}

/* ============================================================
   SECTION 5: V5C Logbook Check
   ============================================================ */
.v5c-error {
  background: var(--color-danger);
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}
.v5c-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}
.v5c-layout > * {
  min-width: 0;
}
.v5c-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}
.v5c-inputs {
  display: flex;
  gap: 8px;
}
.v5c-input {
  padding: 10px 14px;
  font-size: 1rem;
  font-family: var(--font-mono);
  color: var(--color-text);
  background: var(--color-input-bg);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  letter-spacing: 0.05em;
}
.v5c-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(69,188,74,0.15);
}
.v5c-input--prefix {
  width: 70px;
  text-align: center;
  text-transform: uppercase;
  flex-shrink: 0;
}
.v5c-input--serial {
  flex: 1;
}
.v5c-form .v5c-submit {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  width: 100%;
  max-width: 100%;
  white-space: normal;
  box-sizing: border-box;
  display: block;
  box-shadow: none;
}
.report--compact .v5c-form .v5c-submit {
  padding: 6px 12px;
  font-size: 0.78rem;
  line-height: 1.3;
}
@media (max-width: 480px) {
  .v5c-form .v5c-submit { font-size: 0.75rem; padding: 6px 12px; }
  .v5c-inputs { flex-wrap: wrap; }
  .v5c-input--prefix { width: 60px; }
}
.v5c-reference {
  display: flex;
  align-items: center;
  justify-content: center;
}
.v5c-reference__img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .v5c-layout { grid-template-columns: 1fr; }
  .v5c-reference { order: -1; }
  .v5c-reference__img { max-width: 280px; }
}
@media (max-width: 480px) {
  .v5c-reference__img { max-width: 220px; }
}

/* Branded panel headers — scoped to the full report ONLY.
   Other pages (account, users, branding settings, etc.) use the
   default --color-panel-header + #fff and are NOT affected.
   When branding is enabled, production sets the --brand-* variables
   on .report-content via inline style:
     style="--brand-header-bg:#NN; --brand-header-text:#NN;
            --brand-accent-color:#NN; --brand-accent-height:3px;"  */
.report-content {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
/* Auth-header + report-bar sit sticky; anchor jumps have to clear both.
   window.vdi.updateStickyOffsets writes --vdi-section-scroll-margin from
   the measured heights (auth + bar + 8px navGap + 16px breathing gap) so
   the section title lands just below the report bar. 180px static
   fallback covers pre-JS renders. Applied via id-prefix so every section
   anchor gets it. */
.report-content [id^="section-"] {
  scroll-margin-top: var(--vdi-section-scroll-margin, 180px);
}
.report-content .vdi-box-title {
  background: var(--brand-header-bg);
  color: var(--brand-header-text);
}
.report-content .vdi-box-accent {
  height: var(--brand-accent-height);
  background: var(--brand-accent-color);
}
/* Status-driven accent overrides — --alert and --warn are genuine warning
   signals that still override branding (a stolen vehicle needs red no
   matter what the account's brand colours are). --clear is informational
   ("this section is fine"), so we route it through --brand-accent-color
   too — defaults to var(--color-accent) (green) at :root, so branding-off
   accounts still see green; branding-on accounts see their SecondaryColor. */
.report-content .vdi-box-accent--alert   { background: #88121d !important; }
.report-content .vdi-box-accent--warn    { background: var(--color-warning) !important; }
.report-content .vdi-box-accent--clear   { background: var(--brand-accent-color) !important; }
.report-content .vdi-box-accent--neutral { background: var(--brand-accent-color) !important; }

/* Alert panel headers — red background for adverse sections */
.report-content .vdi-box-title--alert {
  background: var(--alert-header-bg) !important;
  color: #fff !important;
}

/* Branded header block at the top of a report. Column stack, centred:
   uploaded logo on top, company name below, then the address flattened
   to a single comma-separated line by FormattedCompanyAddress in the
   code-behind. Renders only when the account has BrandingEnabled and
   (a logo is uploaded + IncludeLogo is on) OR the company has recorded
   a name / address. */
/* Brand header - default layout is side-by-side (logo left, details
   right). JS toggles data-aspect="wide" once the logo image loads,
   which swaps to the stacked centred layout for landscape logos. */
.brand-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  padding: 24px 20px;
  margin-bottom: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  text-align: left;
}
.brand-header__logo {
  flex: 0 0 auto;
  max-height: 160px;
  max-width: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.brand-header__info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.brand-header__name {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-heading);
}
.brand-header__address {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 640px;
}

/* Wide (landscape) logos: stack centred, logo owns ~80% of the row. */
.brand-header[data-aspect="wide"] {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.brand-header[data-aspect="wide"] .brand-header__logo {
  max-height: 140px;
  max-width: 80%;
}
.brand-header[data-aspect="wide"] .brand-header__info {
  align-items: center;
  text-align: center;
  flex: 0 0 auto;
}

/* Narrow viewport: fall back to stacked layout regardless of aspect
   so the info block never gets squeezed to a tiny column. */
@media (max-width: 640px) {
  .brand-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
  .brand-header__logo { max-width: 80%; max-height: 140px; }
  .brand-header__info { align-items: center; text-align: center; }
}

/* Branded footer at the very bottom of the report content. Only renders
   when BrandingEnabled + IncludeFooter + non-empty FooterText. */
.brand-footer {
  margin-top: 24px;
  padding: 16px 20px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.6;
  border-top: 1px solid var(--color-border);
  white-space: pre-wrap;
}

.full-report__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.full-report__details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
}
.full-report__detail {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
}
.full-report__detail:last-child { border-bottom: none; }
.full-report__detail span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  font-weight: 600;
  flex-shrink: 0;
}
.full-report__detail strong {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
}
.full-report__detail strong.font-mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

/* MOT history record */
.full-report__mot {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--color-bg);
}
.full-report__mot:last-child { margin-bottom: 0; }
.full-report__mot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.full-report__mot-date {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}
.full-report__mot-mileage {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.full-report__mot-line {
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 6px;
  line-height: 1.5;
}
.full-report__mot-line--advisory {
  background: var(--color-warning-bg);
  color: var(--color-text);
  border: 1px solid var(--color-warning-border);
}
.full-report__mot-line--advisory strong { color: var(--color-warning); }
.full-report__mot-line--fail {
  background: var(--color-danger-bg);
  color: var(--color-text);
  border: 1px solid var(--color-danger-border);
}
.full-report__mot-line--fail strong { color: var(--color-danger); }

/* CO2 panel layout */
.full-report__co2 {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}
.full-report__co2-banding {
  flex-shrink: 0;
  text-align: center;
}
.full-report__co2-banding img {
  width: 100px;
  height: auto;
}
.full-report__co2-banding-label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 6px;
}

@media (max-width: 768px) {
  .full-report__details-grid { grid-template-columns: 1fr; }
  .full-report__co2 { flex-direction: column; align-items: center; }
}

/* ============================================================
   QUICK REPORT — basic (free) lookup result page
   mock/Authenticated/lookup-result.html
   ============================================================ */

/* Two-column body — details on the left, plate + vehicle image on the right.
   align-items: stretch lets the visual column match the height of the details
   column so the vehicle image can be vertically centred inside it. */
.quick-report__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}
.quick-report__details { min-width: 0; }
/* Manufacturer badge slot on the Basic report card. Same reasoning as
   .at-a-glance__logo — bigger box in both axes so wide marks (Land
   Rover) and tall marks (Tesla) both feel like proper badges. Aspect
   is preserved by the img + object-fit: contain. */
.quick-report__logo {
  display: block;
  width: auto;
  max-width: 180px;
  max-height: 120px;
  height: auto;
  object-fit: contain;
  margin-bottom: 28px;
}

/* 2-column field grid: Make/Model, Year/Colour, Engine/Gearbox, VIN/Body */
.quick-report__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 18px;
  row-gap: 10px;
}
.quick-report__field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
/* Full-width field — spans the entire grid row (used for Make + Model) */
.quick-report__field--full { grid-column: 1 / -1; }
.quick-report__field-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  font-weight: 600;
}
.quick-report__field-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  word-break: break-word;
}
/* Larger value variant — used for the prominent Make + Model rows */
.quick-report__field-value--lg {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
}
.quick-report__field-value.font-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.quick-report__visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.quick-report__plate {
  align-self: center;
}
/* The "stacked" logo is the duplicate that lives in the visual column.
   Hidden by default — only revealed at tablet width (see media query below). */
.quick-report__logo--stacked { display: none; }
.quick-report__image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1;
}
.quick-report__image img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

/* Get full report CTA bar — uses the standard green accent palette */
.quick-report__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 24px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin: 4px 0 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.quick-report__cta:hover { background-color: #068925; transform: translateY(-1px); }

/* Outlined variant — used when the user has 0 tokens.
   Transparent background, green border, green text + icon. */
.quick-report__cta--outline {
  background: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
  box-shadow: none;
}
.quick-report__cta--outline:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
  transform: translateY(-1px);
}
.quick-report__cta:active { transform: translateY(0); }
.quick-report__cta i { font-size: 1.1rem; }
.quick-report__cta-text { white-space: nowrap; }
.quick-report__cta-cost {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.quick-report__cta-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

/* Bottom row — 2 panels side by side */
.quick-report__bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.quick-report__panel { margin-bottom: 0; }
.quick-report__panel-body { text-align: center; }

.quick-report__price-row,
.quick-report__date-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 16px;
  padding: 8px 0 12px;
}
.quick-report__price,
.quick-report__date { flex: 1; }
.quick-report__price-divider {
  width: 1px;
  align-self: stretch;
  background: var(--color-border);
}
.quick-report__price-label,
.quick-report__date-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.quick-report__price-value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-accent);
}
.quick-report__date-value {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-link);
}
.quick-report__panel-note {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
  margin-top: 4px;
  line-height: 1.5;
}

.quick-report__footnote {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
  margin: 14px 0 0;
  font-style: italic;
}

/* Tablet — single column, visual column on top.
   The inline (left-column) logo is hidden; the stacked logo inside the visual
   column is revealed and renders above the vehicle image. */
@media (max-width: 768px) {
  .quick-report__body { grid-template-columns: 1fr; }
  .quick-report__visual { order: -1; }
  .quick-report__image { flex: none; }
  .quick-report__image img { max-width: 280px; }
  .quick-report__bottom { grid-template-columns: 1fr; }
  .quick-report__logo--inline { display: none; }
  .quick-report__logo--stacked {
    display: block;
    margin: 0 auto;
    order: -1;       /* sit above the plate + vehicle image */
  }
}
/* Mobile — hide the make logo entirely; field grid stays as 2 columns. */
@media (max-width: 480px) {
  .quick-report__logo--stacked { display: none; }
  .quick-report__price-value { font-size: 1.4rem; }
  .quick-report__date-value { font-size: 1.1rem; }
}

/* ============================================================
   MILEAGE CONFIRMATION MODAL — opened from the quick-report CTA
   ============================================================ */
/* Mileage modal heading + lead */
.mileage-modal__heading {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 6px;
}
.mileage-modal__lead {
  font-size: 0.85rem;
  color: var(--color-text);
  line-height: 1.5;
  margin: 0 0 14px;
}

/* Numeric input with no spinner controls — used for the mileage entry box */
.mileage-input--no-spinner { -moz-appearance: textfield; appearance: textfield; }
.mileage-input--no-spinner::-webkit-outer-spin-button,
.mileage-input--no-spinner::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.mileage-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.mileage-option {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: var(--color-bg);
}
/* Hover uses the blue --color-link palette; selected uses the green
   --color-accent palette so a user can tell at a glance which card is
   the active choice vs. which they're just pointing at. */
.mileage-option:hover {
  border-color: var(--color-link);
  background: var(--color-info-bg);
}
.mileage-option input[type="radio"] {
  margin-top: 4px;
  flex-shrink: 0;
  accent-color: var(--color-accent);
  width: 16px;
  height: 16px;
}
.mileage-option:has(input:checked) {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}
/* Selected + hovered — keep the green (active) treatment rather than
   flipping back to blue on hover of the already-active card. */
.mileage-option:has(input:checked):hover {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}
.mileage-option__body { flex: 1; min-width: 0; }
.mileage-option__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}
.mileage-option__desc {
  font-size: 0.8rem;
  color: var(--color-text);
  margin-top: 2px;
  line-height: 1.45;
}
.mileage-option__input { margin-top: 10px; }

.mileage-cost-summary {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--color-bg);
}
.mileage-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  padding: 4px 0;
  color: var(--color-text);
}
.mileage-cost-row strong { color: var(--color-text); font-weight: 700; }
.mileage-cost-row--total {
  border-top: 1px solid var(--color-border);
  margin-top: 6px;
  padding-top: 10px;
  color: var(--color-text);
  font-weight: 600;
}
.mileage-cost-row--total strong { color: var(--color-accent); font-size: 0.95rem; }

/* ============================================================
   2FA Enrol Modal — reusable component
   ============================================================ */
.tfa-enrol__intro {
  font-size: 0.85rem;
  color: var(--color-text);
  line-height: 1.5;
  margin: 0 0 18px;
}
.tfa-enrol__step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.tfa-enrol__step-number {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
}
.tfa-enrol__step-body { flex: 1; }
.tfa-enrol__step-title {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.95rem;
  margin: 2px 0 4px;
}
.tfa-enrol__step-text {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0 0 10px;
}
.tfa-enrol__qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  margin-top: 6px;
}
.tfa-enrol__qr {
  width: 180px;
  height: 180px;
  display: block;
}
.tfa-enrol__key-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
}
.tfa-enrol__key-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tfa-enrol__key {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 4px 10px;
  letter-spacing: 0.05em;
}
.tfa-enrol__copy {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
.tfa-enrol__copy:hover {
  color: var(--color-link);
  border-color: var(--color-link);
}
.tfa-enrol__code-input {
  width: 100%;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  letter-spacing: 0.5em;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-input-bg, var(--color-bg));
  color: var(--color-text);
}
.tfa-enrol__code-input:focus {
  outline: none;
  border-color: var(--color-link);
}
.tfa-enrol__error {
  font-size: 0.8rem;
  color: var(--color-danger);
  margin-top: 6px;
  display: none;
}
.tfa-enrol__error.is-shown { display: block; }

/* Post-verify completion screen inside the 2FA modal. Users see this
   for a few seconds so they know they're about to be signed out and
   asked to sign in again with the new authenticator. */
.tfa-enrol__success        { padding: 12px 0 4px; }
.tfa-enrol__success-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-success-bg, rgba(40, 167, 69, 0.12));
  color: var(--color-success, #28a745);
  font-size: 2rem;
}
.tfa-enrol__success-title {
  margin: 0 0 10px;
  font-weight: 600;
  color: var(--color-text);
}
.tfa-enrol__success-text {
  margin: 0 auto 16px;
  max-width: 480px;
  color: var(--color-text);
  line-height: 1.5;
}
.tfa-enrol__success-countdown {
  margin: 0 0 18px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Two-column drawer layout — collapses to single column on narrow viewports */
.drawer__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 540px) {
  .drawer__row { grid-template-columns: 1fr; }
}

/* ============================================================
   TOAST NOTIFICATIONS (reusable component)
   ============================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: toastIn 0.25s ease;
  min-width: 260px;
  pointer-events: auto;
}
.toast--success { background: var(--color-accent); }
.toast--warning { background: var(--color-warning); }
.toast--error { background: var(--color-danger); }
.toast--info { background: var(--color-link); }
.toast__icon { font-size: 1.15rem; flex-shrink: 0; }
.toast__message { flex: 1; }
.toast__close {
  background: transparent;
  border: 0;
  color: inherit;
  opacity: 0.75;
  padding: 4px;
  margin-left: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  transition: opacity 0.15s ease;
}
.toast__close:hover,
.toast__close:focus {
  opacity: 1;
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
  .toast-container { top: auto; bottom: 20px; right: 10px; left: 10px; }
  .toast { min-width: 0; width: 100%; }
}

/* Branding disabled overlay */
.branding-sections {
  position: relative;
}
.branding-disabled-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 60px;
}
.branding-disabled-overlay.hidden { display: none; }
.branding-disabled-message {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 20px 30px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.branding-disabled-message p { margin: 0; }

/* Report accent bar (used under report/section headers) */
.report-accent-bar {
  height: 4px;
  background: var(--color-accent);
}

/* Logo upload area */
.logo-upload {
  border: 2px dashed var(--color-border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--color-input-bg);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-upload:hover {
  border-color: var(--color-link);
  background: var(--color-bg);
}

/* Logo review screen - shows the source file preview + Save / Cancel
   after the picker validates. No crop step; the image the user
   picked is exactly what lands on the report. */
.logo-preview {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.logo-preview__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--color-input-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  min-height: 180px;
}
.logo-preview__img {
  max-width: 100%;
  max-height: 240px;
  height: auto;
  width: auto;
  object-fit: contain;
}
.logo-preview__hint {
  margin-top: 12px;
  padding: 8px 12px;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-align: center;
}
.logo-preview__actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* Interactive logo crop editor (shown on /branding when a file is picked). */
.logo-editor {
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
}
.logo-editor__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-bottom: 14px;
}
.logo-editor__control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.logo-editor__control-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}
.logo-editor__pill-group {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--color-input-bg);
}
.logo-editor__pill {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s;
}
.logo-editor__pill:hover { background: var(--color-bg); }
.logo-editor__pill.is-active {
  background: var(--color-accent);
  color: #fff;
}
.logo-editor__pill.is-active:hover { background: var(--color-accent); }

.logo-editor__hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

/* Workspace: fixed-size stage that shows the whole image at fit-to-container.
   Checker background makes any transparent letterbox area (or padding outside
   the image bounds) obviously not-image. The <img> inside is absolutely
   positioned; JS controls its CSS transform. */
.logo-editor__workspace {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  background-color: var(--color-input-bg);
  background-image:
    linear-gradient(45deg, var(--color-border) 25%, transparent 25%),
    linear-gradient(-45deg, var(--color-border) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--color-border) 75%),
    linear-gradient(-45deg, transparent 75%, var(--color-border) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.logo-editor__workspace:active { cursor: grabbing; }
.logo-editor__workspace-img {
  position: absolute;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
  transform-origin: 0 0;
}

/* Crop rectangle overlaid on the workspace. box-shadow gives the classic
   darkened-outside effect for free (no extra mask divs needed). */
.logo-editor__crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  cursor: move;
  z-index: 2;
}
.logo-editor__handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--color-accent);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  z-index: 3;
}
.logo-editor__handle--nw { top: -8px;    left: -8px;   cursor: nwse-resize; }
.logo-editor__handle--ne { top: -8px;    right: -8px;  cursor: nesw-resize; }
.logo-editor__handle--sw { bottom: -8px; left: -8px;   cursor: nesw-resize; }
.logo-editor__handle--se { bottom: -8px; right: -8px;  cursor: nwse-resize; }

/* Zoom slider row (reset button · out · slider · in) */
.logo-editor__zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 500px;
  margin: 14px auto 0;
}
.logo-editor__zoom-btn {
  border: 1px solid var(--color-border);
  background: var(--color-input-bg);
  color: var(--color-text);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s;
}
.logo-editor__zoom-btn:hover { background: var(--color-bg); }
.logo-editor__zoom-icon {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
}
.logo-editor__zoom-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--color-border);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.logo-editor__zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--color-accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.logo-editor__zoom-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--color-accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.logo-editor__actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* Alert banner (standalone info bar) */
.alert-banner {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--color-text);
}
.alert-banner i { color: var(--color-warning); flex-shrink: 0; }

/* Settings grid + toggle */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}
.settings-item:last-child { border-bottom: none; }
.settings-item__label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}
.settings-item__desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.settings-item__control { flex-shrink: 0; margin-left: 16px; }

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle__slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle__slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
}
.toggle input:checked + .toggle__slider { background: var(--color-accent); }
.toggle input:checked + .toggle__slider::before { left: 22px; }

/* Terms version bar */
.terms-version {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  margin-top: 16px;
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--color-info);
}

/* Year pill - shared across the report header, ExportHistoryPanel
   and History rows so a single size bump touches every surface. */
.year-pill {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: middle;
  margin-right: 4px;
}

/* Warning flags (lookup history) */
.warning-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--color-warning-inactive-text);
  margin: 0 2px;
  background: var(--color-warning-inactive);
  border: 1px solid var(--color-warning-inactive-border);
}
.warning-flag--finance.active  { background: var(--color-warning-active-bg-finance); color: var(--color-warning-text-finance); border-color: var(--color-finance); }
.warning-flag--stolen.active   { background: var(--color-warning-active-bg-stolen); color: var(--color-warning-text-stolen); border-color: var(--color-stolen); }
.warning-flag--writeoff.active { background: var(--color-warning-active-bg-writeoff); color: var(--color-warning-text-writeoff); border-color: var(--color-writeoff); }
.warning-flag--mileage.active  { background: var(--color-warning-active-bg-mileage); color: var(--color-warning-text-mileage); border-color: var(--color-mileage); }
.data-table td .warning-flag { white-space: nowrap; }
.data-table td:has(.warning-flag) { white-space: nowrap; }

/* Warning key */
.warning-key {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}
.warning-key__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--color-text);
}
.warning-key__card {
  flex: 1;
  min-width: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 14px;
  justify-content: center;
}

/* Stat grid 4-col variant */
.stat-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 768px) {
  .stat-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .stat-grid--4 .stat-card { text-align: center; justify-content: center; }
  .warning-key { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
}
@media (max-width: 480px) {
  .stat-grid--4 { grid-template-columns: 1fr 1fr; }
}

/* Stat grid 3-col variant */
.stat-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 768px) {
  .table-filters { flex-direction: column; }
  .table-filter-group { width: 100%; }
  .table-filter-input { width: 100%; }
  .table-pagination { flex-direction: column; align-items: center; }
  .stat-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .stat-grid--3 .stat-card { text-align: center; justify-content: center; }

  /* Lookup History filters - keep Display + Check Type on one row
     so they save vertical space; Quick Search and Advanced Search
     still stack full-width below. */
  .history-filters { flex-direction: row; flex-wrap: wrap; }
  .history-filters .history-filter-group--display,
  .history-filters .history-filter-group--type {
    flex: 1 1 45%;
    width: auto;
    min-width: 0;
  }
  .history-filters .history-quick-search-group,
  .history-filters .history-advanced-btn-group {
    flex: 1 1 100%;
  }
}
@media (max-width: 480px) {
  .stat-grid--3 { grid-template-columns: 1fr; }
}

/* Saved payment cards */
.saved-cards {
  display: flex;
  flex-direction: column;
}
.saved-cards__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 255px;
  overflow-y: auto;
  padding-right: 4px;
}
/* Inline separator between saved cards and the "new card / PayPal"
   alternatives in the same scrollable list. Small caps label with lines
   either side — matches the payment-method break patterns on Stripe /
   Braintree checkouts. */
.saved-cards__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}
.saved-cards__divider::before,
.saved-cards__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}
.saved-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--color-input-bg);
}
.saved-card:hover { border-color: var(--color-link); }
.saved-card.selected { border-color: var(--color-accent); background: var(--color-accent-light); }
.saved-card input[type="radio"] { display: none; }
.saved-card div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* Alternatives (new card / PayPal) — dashed border + transparent background
   so they read as "different animal" from the solid saved-card tiles above. */
.saved-card--alt {
  border-style: dashed;
  background: transparent;
}
.saved-card--alt:hover { background: var(--color-bg); }
.saved-card--alt.selected {
  border-style: solid;
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}
.qty-row__label {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-text);
}

/* Quantity selector */
.qty-selector {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 50px;
  overflow: hidden;
  background: var(--color-input-bg);
}
.qty-selector__btn {
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  color: var(--color-text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.qty-selector__btn:hover {
  background: var(--color-accent);
  color: #fff;
}
.qty-selector__input {
  width: 50px;
  height: 40px;
  border: none;
  background: none;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  -moz-appearance: textfield;
}
.qty-selector__input::-webkit-outer-spin-button,
.qty-selector__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Vehicle search button */
.search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: var(--color-accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  padding: 12px 20px;
  border: none;
  border-radius: var(--cta-pill-radius);
  cursor: pointer;
  transition: background-color 0.2s;
  text-decoration: none;
  text-align: center;
}
.search-btn:hover { background-color: #068925; color: #fff; }
.search-btn__arrow {
  display: inline-block;
  margin-left: 4px;
  transition: margin-left 0.2s;
  font-style: normal;
}
.search-btn:hover .search-btn__arrow { margin-left: 10px; }

/* Vehicle search tabs */
.search-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 20px;
}
.search-tab {
  padding: 10px 24px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.search-tab:hover { color: var(--color-link); }
.search-tab.active {
  color: var(--color-link);
  border-bottom-color: var(--color-link);
}

/* VIN input variant */
.vin-input {
  font-family: 'CharlesWright', var(--font-plate);
  font-size: 1.5rem;
  font-weight: normal;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0;
  background: #808080;
  color: #fff;
  border: 2px solid #4e4e4e;
  border-radius: 14px;
  padding: var(--space-3) var(--space-4);
  flex: 1;
  width: 100%;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.vin-input:hover { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(69,188,74,0.25); }
.vin-input:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 4px rgba(69,188,74,0.35); }
.vin-input::placeholder { color: rgba(255,255,255,0.5); font-family: 'CharlesWright', var(--font-plate); letter-spacing: 0; }

/* Disabled VRM */
.uk-plate--disabled {
  background: var(--color-plate-disabled-bg);
  border-color: var(--color-plate-disabled-border);
  color: var(--color-plate-disabled-text);
}

/* Muted VRM (refunds, inactive) */
.uk-plate--muted {
  background: var(--color-plate-muted-bg);
  border-color: var(--color-plate-muted-border);
  color: var(--color-plate-muted-text);
  opacity: 0.8;
}

/* Error VRM */
.uk-plate--error {
  background: var(--color-plate-error-bg);
  border-color: var(--color-plate-error-border);
  color: var(--color-plate-error-text);
}

/* Last lookups plate grid */
.plate-grid {
  display: grid;
  /* minmax(0, 1fr) overrides the default `minmax(auto, 1fr)` so columns
     ignore the intrinsic minimum width of unbreakable tooltip text. Without
     this, a single long Make/Model would push one column wider than the
     others (see docs/dev-screenshots/last-6-fix-01.png). */
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.plate-grid-item {
  text-align: center;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.plate-grid-card {
  background: var(--color-plate-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 10px 6px;
  width: 100%;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.plate-grid-vrm {
  font-family: 'CharlesWright', var(--font-plate);
  font-size: 1.3rem;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--color-plate-text);
  display: block;
}
.plate-grid-item:hover .plate-grid-card {
  background: #ffe250;
}
.plate-grid-item:hover .plate-grid-vrm {
  color: #393939;
}
.plate-grid-badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 50px;
  font-family: var(--font-sans);
  white-space: nowrap;
  border: 1px solid var(--color-badge-border);
}
.plate-grid-badge--free { background: var(--color-badge-free); color: var(--color-badge-free-text); }
.plate-grid-badge--vdi { background: var(--color-badge-vdi); color: var(--color-badge-vdi-text); }
.plate-grid-badge--error { background: var(--color-badge-error); color: var(--color-badge-error-text); }
/* Archived — premium lookup migrated from the previous system (IsLegacy).
   Neutral so it reads as a status, not a check type. On /history it sits
   next to the VDI Check badge; on the dashboard tiles it replaces it. */
.plate-grid-badge--legacy { background: var(--color-badge-legacy); color: var(--color-badge-legacy-text); border-color: var(--color-badge-legacy-border); }
.plate-grid-badge + .plate-grid-badge--legacy { margin-left: 4px; }
.plate-grid-badge--legacy i { margin-right: 4px; font-size: 0.9em; vertical-align: -1px; }

/* Archive icon used on /history in place of a second pill. Wrapped
   together with the VDI Check pill in .history-badge-group so the two
   never wrap onto separate lines and the mobile card's space-between
   flex sees them as a single unit. Themed to the same green token as
   the archived pill on /vehicle-lookup. */
.history-badge-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
/* The plate-grid-badge carries margin-top: 8px for the /vehicle-lookup
   plate stack; neutralise it here so the icon and pill align on their
   shared centre line. */
.history-badge-group .plate-grid-badge { margin-top: 0; }
.history-legacy-icon {
    color: var(--color-badge-legacy-text);
    font-size: 1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

/* Error plate card */
.plate-grid-card--error {
  background: var(--color-plate-error-bg);
  border-color: var(--color-plate-error-border);
  position: relative;
}
.plate-grid-card--error .plate-grid-vrm { color: var(--color-plate-error-text); }
.plate-grid-error-icon {
  position: absolute;
  top: 6px;
  right: 8px;
  color: var(--color-plate-error-icon);
  font-size: 0.85rem;
  opacity: 0.9;
}
.plate-grid-item--error .plate-grid-badge { background: var(--color-badge-error); color: var(--color-badge-error-text); border-color: var(--color-badge-error-border); }
.plate-grid-item--error:hover .plate-grid-card--error { background: var(--color-plate-error-hover); }
.plate-grid-item--error:hover .plate-grid-vrm { color: var(--color-plate-error-hover-text); }
.plate-grid-item--error .plate-grid-tooltip { background: var(--color-plate-error-tooltip); }
.plate-grid-item--error .plate-grid-tooltip::after { border-bottom-color: var(--color-plate-error-tooltip); }

/* Hover tooltip */
.plate-grid-tooltip {
  display: block;
  position: static;
  transform: none;
  background: var(--color-plate-info-bg);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px 6px 0 0;
  font-family: var(--font-heading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  line-height: 1.5;
  width: 100%;
  border: 1px solid var(--color-border);
  border-bottom: none;
}
.plate-grid-tooltip::after {
  display: none;
}
.plate-grid-card {
  border-radius: 0 0 8px 8px;
}

@media (max-width: 1024px) {
  .plate-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plate-grid-vrm { font-size: 1.1rem; }
}
@media (max-width: 768px) {
  .plate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plate-grid-vrm { font-size: 0.95rem; }
  .search-tab { font-family: var(--font-sans); }
  .plate-grid-tooltip { font-size: 0.6rem; }
}

/* Two-line tooltip: make line + model line. Each truncates independently
   with text-overflow:ellipsis. The parent .plate-grid-tooltip already has
   overflow:hidden, so the inner divs only need the per-line truncation
   primitives. Replaces the prior <br />-separated approach which prevented
   ellipsis from applying to the long line. */
.plate-grid-tooltip__make,
.plate-grid-tooltip__model {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Account nav panel */
.account-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.account-nav-list li {
  display: flex;
}
.account-nav-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--account-nav-card-bg);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}
.account-nav-item:hover {
  border-color: var(--color-link);
  background: var(--color-info-bg);
}
.account-nav-icon {
  font-size: 1.1rem;
  color: var(--color-link);
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  margin-top: 2px;
}
.account-nav-title {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-link);
}
.account-nav-desc {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 2px;
  line-height: 1.4;
}
@media (max-width: 768px) {
  .account-nav-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .account-nav-list { grid-template-columns: 1fr; }
}

.basic-result {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-md);
}
.basic-result-header {
  background: var(--color-primary);
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.basic-result-body {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-6);
  padding: var(--space-6);
  align-items: center;
}
.basic-result-img { width: 160px; height: 104px; object-fit: cover; border-radius: var(--radius); background: var(--color-bg); }
.basic-result-vehicle { font-size: var(--text-xl); font-weight: var(--font-bold); margin-bottom: var(--space-3); }
.basic-result-meta { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); }
.meta-item { }
.meta-label { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.meta-value { font-size: var(--text-sm); font-weight: var(--font-medium); margin-top: 1px; }
.vin-masked { font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: 0.1em; }
.vin-masked .masked { color: var(--color-text-light); }

/* Search overlay — shown during an in-flight vehicle lookup */
.search-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-text);
  z-index: 9000;
}
[data-theme="dark"] .search-overlay {
  background: rgba(26, 26, 26, 0.85);
}
.search-overlay__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
[data-theme="dark"] .search-overlay__spinner {
  border-color: rgba(255, 255, 255, 0.12);
}
.search-overlay__text {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.4px;
  opacity: 0.75;
}

/* Vehicle-lookup page layout — centralises MOCK inline styles.
   IMPORTANT: many foundational utilities (.container, .img-responsive,
   .section-logo) are defined LATER in this file and at the same
   specificity would win the cascade. Rules below that need to override
   one of those utilities use compound selectors (.container.vehicle-lookup-welcome)
   instead of single-class. */
.container.vehicle-lookup-welcome {
  text-align: left;
  padding-top: 24px;
}
.vehicle-lookup-welcome__heading {
  font-weight: 300;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-text);
}
.vehicle-lookup-welcome__heading strong {
  font-weight: 700;
}
.vehicle-lookup-col {
  margin-bottom: 0;
  display: flex;
}
.vehicle-lookup-vdi-box {
  width: 100%;
  flex: 1;
}
.vehicle-lookup-search-content {
  text-align: center;
}

/* Search logo below the search panel — theme-reactive variants.
   MOCK rendered at 40% width via inline style. We do NOT include
   .img-responsive or .section-logo on the <img>s — they're defined later
   in this file with display:block and width:60%, which would override
   the theme-swap and inflate the size. This block supplies the entire
   width / margin / display behaviour so the light/dark swap actually works.
   Theme-swap pattern mirrors .wasm-splash__logo. */
.vehicle-lookup-search-logo {
  width: 40%;
  margin: 24px auto 0;
  display: block;
}
.vehicle-lookup-search-logo--dark { display: none; }
[data-theme="dark"] .vehicle-lookup-search-logo--light { display: none; }
[data-theme="dark"] .vehicle-lookup-search-logo--dark { display: block; }

/* Last-6 empty state — overrides the global .empty-state vertical padding
   so the "No recent lookups yet" panel doesn't add the giant gap when the
   card is otherwise empty. .empty-state utility remains intact for other
   contexts. */
.vehicle-lookup-empty-state {
  padding: 0;
}

/* Legacy VDI Check information block (sits below LastSixLookups) */
.vehicle-lookup-legacy {
  margin-top: 20px;
}
.vehicle-lookup-legacy__copy {
  font-size: 0.85rem;
}
.vehicle-lookup-legacy__copy--first {
  padding-top: 0;
}

/* Mobile-only account-nav fallback */
.vehicle-lookup-mobile-nav {
  margin-top: 20px;
}

/* Premium benefits panel (T18b) — sibling of ValuationPanel; rendered in the
   same slot when WasmAppSettings.ShowBasicValuationPanel is false. Visually
   matches .quick-report__panel height/width via the existing classes; only
   needs internal layout tweaks for the intro, list spacing, and the centred
   footer. */
.premium-benefits-panel__intro {
  font-size: 0.9rem;
  margin: 0 0 12px;
}
.premium-benefits-panel__list {
  margin-bottom: 16px;
}
.premium-benefits-panel__footer {
  text-align: center;
}

/* MotTaxDuePanel (T19) — expired/untaxed state colouring and sub-note styling.
   Extends the pre-existing .quick-report__date-value with two modifier classes:
     --expired  red, for "MOT EXPIRED"
     --alert    amber, for "Not taxed" (less severe than expired)
   The sub-note appears below the main value with reduced size + colour.        */
.quick-report__date-value--expired {
  color: var(--color-danger);
}
.quick-report__date-value--alert {
  color: var(--color-warning, var(--color-danger));
}
.quick-report__date-subnote {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* MileageConfirmationModal (T21) — centralises MOCK inline styles for the
   modal's pre-confirm copy line and footer button/icon spacing. */
.mileage-modal__pre-confirm-line {
  margin-bottom: 14px;
}
.mileage-modal__action {
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 0.85rem;
}
.mileage-modal__action-icon {
  margin-right: 4px;
}

/* Modal opt-in: on mobile, keep the modal footer in a fixed slot at the
   bottom of the dialog so the action buttons never get pushed below the
   viewport or hidden behind the mobile browser's URL / tab-bar chrome.
   The body scrolls; the footer stays. Applied via class on the modal
   element so only opted-in modals change behaviour. */
@media (max-width: 768px) {
  .modal--mobile-sticky-footer {
    display: flex;
    flex-direction: column;
    max-height: 100dvh;
    overflow: hidden;
  }
  .modal--mobile-sticky-footer .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal--mobile-sticky-footer .modal-footer {
    flex: 0 0 auto;
    padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  }
}

/* LookupResult mobile sticky CTA bar — same pattern as .purchase-sticky-bar
   so the "Get a full VDI Check" button is always reachable on phones.
   .lookup-result__page adds bottom padding so the final page content isn't
   hidden behind the fixed bar on mobile. */
.quick-report__sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 20px 16px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
}
.quick-report__sticky-bar .quick-report__cta {
  margin: 0 0 10px;
}
.quick-report__sticky-bar .quick-report__cta-note {
  margin-bottom: 0;
  font-size: 0.72rem;
  line-height: 1.3;
}
@media (max-width: 768px) {
  .lookup-result__page {
    padding-bottom: 190px;
  }
}

/* LookupResult page (T22) heading + state areas — centralises MOCK inline
   styles and provides loading/empty layout. */
.lookup-result__heading-wrap {
  margin-bottom: 24px;
}
.lookup-result__title {
  font-weight: 300;
}
.lookup-result__title strong {
  font-weight: 700;
}
.lookup-result__loading {
  padding: 64px 24px;
}
.lookup-result__empty {
  padding: 64px 24px;
}
.lookup-result__empty h3 {
  margin-bottom: 12px;
}
.lookup-result__empty p {
  margin-bottom: 20px;
}

/* Full/premium report loading panel — parity with the Basic report's
   .lookup-result__loading. Shown from click-through until the whole
   Report.razor tree paints, so the user gets a clear "we're working"
   signal instead of a stalled page. */
.full-report__loading {
  padding: 64px 24px;
}
.full-report__loading-title {
  margin-top: 16px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}
.full-report__loading-sub {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* /history page — minor layout glue not covered by .table-filters / .table-pagination */
.history-page-heading-wrap {
  margin-bottom: 24px;
}
/* Page header row: title on the left, 'My Lookups Only' toggle on the right.
   Wraps on narrow viewports so the toggle drops below the title rather than
   overflowing. */
.history-page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.history-page-title {
  font-weight: 300;
  margin: 0;
}
.history-page-title strong {
  font-weight: 700;
}
/* Inline label + switch for the 'My Lookups Only' toggle in the page header. */
.history-my-lookups-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}
.history-my-lookups-toggle__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  cursor: default;
}
.history-quick-search-group {
  flex: 1;
}
.history-quick-search-input {
  width: 100%;
}
.history-advanced-btn-group {
  align-self: flex-end;
}
.cta-button.history-advanced-btn {
  border-radius: 8px;
  padding: 7px 20px;
  font-size: 0.85rem;
  line-height: 1.4;
  height: 36px;
}
.history-advanced-btn-icon {
  margin-right: 4px;
}
.history-table-scroll {
  overflow-x: auto;
}
/* The mobile-only card cell is hidden on desktop - the regular six
   td columns carry the row. */
.history-mobile-cell { display: none; }

/* ============================================================
   Lookup History - mobile card layout.
   Below 768px each <tr class="history-row"> becomes a stacked
   card and the mobile-only <td class="history-mobile-cell">
   carries the entire card body inside a single <a> so the whole
   surface acts as the tap-target to the report.
   ============================================================ */
@media (max-width: 767px) {
  .history-table-scroll .data-table,
  .history-table-scroll .data-table tbody { display: block; }
  .history-table-scroll .data-table thead { display: none; }

  .history-table-scroll .data-table tr.history-row,
  .history-table-scroll .data-table tr.history-row:nth-child(even) {
    display: block;
    margin-bottom: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
  }
  .history-table-scroll .data-table tr.history-row:hover {
    background: var(--color-surface-alt, rgba(0, 0, 0, 0.04));
    border-color: var(--color-accent);
  }
  /* Hide the desktop columns; show the mobile card cell. */
  .history-table-scroll .data-table tr.history-row > td { display: none; }
  .history-table-scroll .data-table tr.history-row > td.history-mobile-cell {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
  }
  /* Loading + empty states span a single row - keep those visible. */
  .history-table-scroll .data-table tr:not(.history-row) > td { display: block; }
}

.history-mobile-card {
  display: block;
  padding: 14px 14px 12px;
  color: var(--color-text);
  text-decoration: none;
}
.history-mobile-card:hover,
.history-mobile-card:focus-visible { text-decoration: none; color: var(--color-text); outline: none; }

/* ------------------------------------------------------------
   Lookup History - desktop whole-row click + hover preview.
   Mobile stays untouched (card layout, own <a> wrap).
   ------------------------------------------------------------ */
@media (min-width: 768px) {
  .history-table-scroll .data-table tr.history-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
  }
  .history-table-scroll .data-table tr.history-row:hover {
    background: var(--color-surface-alt, rgba(0, 0, 0, 0.04));
  }
  .history-row__plate-cell { position: relative; }

  /* Hover preview panel.
     - Absolutely positioned inside the plate cell, sitting to the
       right so it does not sit under the mouse cursor and cause
       hover flicker.
     - pointer-events: none - mouse never lands on it, so the
       underlying row stays hovered while the preview is visible.
     - z-index above surrounding rows.
     - Fade in / out on hover via opacity + visibility. */
  .history-row-preview {
    position: absolute;
    top: 50%;
    left: calc(100% + 14px);
    transform: translateY(-50%) translateX(-6px);
    z-index: 40;
    width: 320px;
    padding: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    display: flex;
    gap: 14px;
    align-items: flex-start;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
  }
  .history-row:hover .history-row-preview {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
  }
  .history-row-preview__badge {
    width: 56px;
    height: 56px;
    object-fit: contain;
    flex-shrink: 0;
  }
  .history-row-preview__body { flex: 1; min-width: 0; }
  .history-row-preview__title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    font-size: 0.95rem;
    margin-bottom: 8px;
  }
  .history-row-preview__title strong { font-weight: 700; }
  .history-row-preview__title span { color: var(--color-text-muted); }
  .history-row-preview__plate { margin-bottom: 10px; }
  .history-row-preview__specs {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 10px;
    row-gap: 4px;
    margin: 0;
    font-size: 0.82rem;
  }
  .history-row-preview__specs dt { color: var(--color-text-muted); font-weight: 500; }
  .history-row-preview__specs dd { margin: 0; color: var(--color-text); font-weight: 600; }
  .history-row-preview__flags {
    margin-top: 10px;
    display: flex;
    gap: 4px;
  }

  /* The last few rows would overflow the viewport - flip the panel
     ABOVE the row when it would otherwise clip the bottom. Cheap
     safeguard using a data attribute would need JS; instead let the
     browser handle it via the panel sitting to the right (already
     done) - the right side has room even for the bottom row, since
     the table has generous right-side padding on the parent. */
}

.history-mobile-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.history-mobile-card__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.95rem;
}
.history-mobile-card__title strong { font-weight: 700; }
.history-mobile-card__title span { color: var(--color-text-muted); }
.history-mobile-card__details {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  margin-bottom: 10px;
}
.history-mobile-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.history-mobile-card__when {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.history-mobile-card__when i { font-size: 0.85rem; }
.history-mobile-card__flags {
  display: inline-flex;
  gap: 6px;
}
.history-pagination-wrap {
  margin-top: 16px;
}
.history-page-size-wrap {
  margin: 0;
}
.history-warning-key {
  margin-top: 16px;
}
.cta-button.history-drawer-apply {
  flex: 1;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.85rem;
}
.cta-button.history-drawer-reset {
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.85rem;
}

/* ============================================================
   20. TOKEN PACKAGE CARDS
   ============================================================ */
.package-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
/* Count-driven variants - set in Purchase.razor based on _packages.Count so
   1 or 2 packages don't leave empty columns in the desktop 3-col grid.
   The existing mobile overrides below (@media max-width:768px / 564px /
   480px) all collapse .package-grid to 1fr regardless of variant - no
   change needed there. */
.package-grid--2up { grid-template-columns: repeat(2, 1fr); max-width: 720px; margin-left: auto; margin-right: auto; }
.package-grid--1up { grid-template-columns: minmax(240px, 340px); justify-content: center; }
.package-card {
  background: var(--package-card-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-4);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden !important;
}
.package-card:hover { border-color: var(--color-accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.package-card.selected { border-color: var(--color-accent); background: var(--package-selected-bg); box-shadow: 0 0 0 3px var(--package-selected-shadow); }
.package-card.selected .package-tokens,
.package-card.selected .package-tokens-label,
.package-card.selected .package-price,
.package-card.selected .package-price-sub { color: var(--package-selected-text); }
.package-card.selected .package-per-check { color: var(--package-selected-pill-text); background: var(--package-selected-pill-bg); border-color: var(--package-selected-pill-border); }
.package-popular-banner {
  background: var(--color-link);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 0;
  margin: calc(-1 * var(--space-5)) calc(-1 * var(--space-4)) var(--space-4);
  text-align: center;
}
.package-card.selected .package-popular-banner { background: var(--color-accent); }
.package-card-divider { display: none; }
.package-tokens { font-size: var(--text-4xl); font-weight: var(--font-bold); color: var(--color-link); line-height: 1; }
.package-tokens-label { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin: var(--space-1) 0 var(--space-3); }
.package-price { font-size: var(--text-3xl); font-weight: var(--font-bold); }
.package-price-sub { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-3); }
.package-per-check {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-package-price);
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.package-per-check span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  line-height: 1;
}

/* Pricing page layout */
.pricing-table-col { }
.pricing-info-col { padding-left: 1.5rem; }
@media (max-width: 768px) {
  .pricing-table-col { border-bottom: 1px solid var(--color-border); padding-bottom: 1rem; margin-bottom: 1rem; }
  .pricing-info-col { padding-left: 0; }
}

/* Stripe payment area */
.payment-area {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-top: var(--space-6);
}
.payment-area-title { font-weight: var(--font-semi); margin-bottom: var(--space-5); display: flex; align-items: center; gap: var(--space-2); }
.stripe-placeholder {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.order-summary { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5); }
.order-row { display: flex; justify-content: space-between; padding: var(--space-2) 0; font-size: var(--text-sm); }
.order-row.total { font-weight: var(--font-bold); border-top: 1px solid var(--color-border); margin-top: var(--space-2); padding-top: var(--space-4); font-size: var(--text-base); }
.order-row__hint { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 2px; }
.order-row__excl-vat { font-size: 0.75rem; color: var(--color-text-muted); margin-left: 4px; }
.order-row__tokens-total { text-align: right; font-size: 0.8rem; color: var(--color-text-muted); margin-top: 2px; }
.promo-row { display: flex; gap: var(--space-3); margin-bottom: var(--space-4); }
.promo-applied { color: var(--color-success); font-size: var(--text-sm); font-weight: var(--font-medium); display: flex; align-items: center; gap: var(--space-2); }

/* ============================================================
   21. BRANDING PAGE
   ============================================================ */
.branding-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  border: 2px solid;
}
.branding-status.enabled  { background: var(--color-success-bg); border-color: var(--color-success-border); color: #276749; }
.branding-status.disabled { background: var(--color-danger-bg);  border-color: var(--color-danger-border);  color: #c53030; }
.branding-status-text h3 { font-size: var(--text-lg); font-weight: var(--font-bold); }
.branding-status-text p  { font-size: var(--text-sm); opacity: 0.8; margin-top: 2px; }

.logo-upload-area {
  border: 2px dashed var(--color-border-dark);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--color-bg);
}
.logo-upload-area:hover { border-color: var(--color-accent); background: var(--color-accent-light); }
.logo-upload-icon { font-size: 2.5rem; margin-bottom: var(--space-3); }
.logo-upload-text { font-size: var(--text-sm); color: var(--color-text-muted); }
.logo-upload-hint { font-size: var(--text-xs); color: var(--color-text-light); margin-top: var(--space-2); }
.logo-preview-box { text-align: center; margin-bottom: var(--space-4); }
.logo-preview-img { max-height: 80px; max-width: 240px; margin: 0 auto; }

.colour-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); margin-bottom: var(--space-5); }
.colour-item .form-label { margin-bottom: var(--space-2); }
.colour-swatch {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.colour-swatch input[type="color"] { width: 48px; height: 40px; border: none; cursor: pointer; padding: 2px; background: none; }
.colour-swatch-value { font-size: var(--text-sm); font-family: var(--font-mono); color: var(--color-text-muted); flex: 1; padding: 0 var(--space-3); }

.report-section-preview {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.report-section-preview-header {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--font-semi);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.report-section-preview-accent { height: 3px; }
.report-section-preview-body { padding: var(--space-4) var(--space-5); background: var(--color-bg); }
.preview-label { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-2); text-transform: uppercase; letter-spacing: 0.05em; }

/* ============================================================
   22. PUBLIC LAYOUT
   ============================================================ */
.public-layout { display: flex; flex-direction: column; min-height: 100vh; }

.public-header { background: var(--color-primary); position: sticky; top: 0; z-index: 200; box-shadow: var(--shadow-md); }
.public-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 64px;
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.public-nav-brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; flex-shrink: 0; }
.public-nav-brand img { height: 34px; }
.public-nav-links { display: flex; align-items: center; gap: var(--space-6); flex: 1; }
.public-nav-link { font-size: var(--text-sm); font-weight: var(--font-medium); color: rgba(255,255,255,0.8); text-decoration: none; transition: color var(--transition); white-space: nowrap; }
.public-nav-link:hover { color: #fff; }
.public-nav-link.active { color: var(--color-link); }
.public-nav-actions { display: flex; align-items: center; gap: var(--space-3); margin-left: auto; }

.public-main { flex: 1; }

.public-footer { background: var(--color-primary-dark); color: rgba(255,255,255,0.6); padding: var(--space-12) var(--space-6) var(--space-8); }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-8); padding-bottom: var(--space-8); border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: var(--space-8); }
.footer-brand img { height: 30px; margin-bottom: var(--space-4); }
.footer-brand p { font-size: var(--text-sm); line-height: 1.6; }
.footer-heading { font-size: var(--text-sm); font-weight: var(--font-semi); color: #fff; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--space-4); }
.footer-links { display: flex; flex-direction: column; gap: var(--space-2); }
.footer-link { font-size: var(--text-sm); color: rgba(255,255,255,0.6); text-decoration: none; transition: color var(--transition); }
.footer-link:hover { color: #fff; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; font-size: var(--text-xs); flex-wrap: wrap; gap: var(--space-4); }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #1a2d40 100%);
  padding: var(--space-16) var(--space-6);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/vdi-home-background-01.jpg') center/cover no-repeat;
  opacity: 0.08;
}
.hero-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-12); align-items: center; position: relative; }
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(69,188,74,0.2);
  border: 1px solid rgba(69,188,74,0.4);
  color: var(--color-accent);
  font-size: var(--text-xs);
  font-weight: var(--font-semi);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hero h1 { font-size: var(--text-4xl); color: #fff; line-height: 1.15; margin-bottom: var(--space-5); }
.hero h1 span { color: var(--color-accent); }
.hero p { font-size: var(--text-lg); opacity: 0.8; line-height: 1.6; margin-bottom: var(--space-8); }
.hero-actions { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.hero-image img { border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); }

/* Sections */
.section { padding: var(--space-16) var(--space-6); }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: var(--space-12); }
.section-tag {
  display: inline-block;
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-size: var(--text-xs);
  font-weight: var(--font-semi);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.section-title { font-size: var(--text-3xl); margin-bottom: var(--space-3); }
.section-subtitle { font-size: var(--text-lg); color: var(--color-text-muted); max-width: 600px; margin: 0 auto; }
.section-alt { background: var(--color-bg); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
.feature-card {
  text-align: center;
  padding: var(--space-8);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-slow);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-icon { width: 64px; height: 64px; margin: 0 auto var(--space-5); }
.feature-card h3 { margin-bottom: var(--space-3); }
.feature-card p { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.6; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); max-width: 960px; margin: 0 auto; }
.pricing-card { background: var(--color-surface); border: 2px solid var(--color-border); border-radius: var(--radius-xl); padding: var(--space-8); text-align: center; position: relative; overflow: hidden; }
.pricing-card.featured { border-color: var(--color-accent); box-shadow: var(--shadow-lg); transform: scale(1.03); }
.pricing-tier { font-size: var(--text-xs); font-weight: var(--font-bold); text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-muted); margin-bottom: var(--space-3); }
.pricing-card.featured .pricing-tier { color: var(--color-accent); }
.pricing-package-item { display: flex; align-items: center; justify-content: space-between; padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); font-size: var(--text-sm); }
.pricing-package-item:last-child { border-bottom: none; }

/* ============================================================
   23. LOGIN
   ============================================================ */
.login-layout { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--space-12); background: var(--color-surface); }
.login-brand { margin-bottom: var(--space-10); }
.login-brand img { height: 40px; }
.login-card { width: 100%; max-width: 400px; }
.login-title { font-size: var(--text-2xl); font-weight: var(--font-bold); margin-bottom: var(--space-2); }
.login-subtitle { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-8); }
.login-visual {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.login-visual::before { content: ''; position: absolute; inset: 0; background: url('../images/vdi-home-background-01.jpg') center/cover; opacity: 0.1; }
.login-visual-inner { position: relative; text-align: center; max-width: 400px; }
.login-visual h2 { color: #fff; font-size: var(--text-3xl); margin-bottom: var(--space-4); }
.login-visual p { opacity: 0.8; font-size: var(--text-lg); line-height: 1.6; }
.login-visual-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); margin-top: var(--space-8); }
.login-visual-stat { background: rgba(255,255,255,0.1); border-radius: var(--radius-lg); padding: var(--space-4); }
.login-visual-stat-value { font-size: var(--text-2xl); font-weight: var(--font-bold); color: var(--color-accent); }
.login-visual-stat-label { font-size: var(--text-xs); opacity: 0.7; margin-top: 2px; }
.login-divider { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-5) 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--color-border); }

/* ============================================================
   24. LOADING
   ============================================================ */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   26. UTILITY
   ============================================================ */
.flex            { display: flex; }
.flex-col        { display: flex; flex-direction: column; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.flex-1          { flex: 1; }
.flex-wrap       { flex-wrap: wrap; }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-6); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.text-sm    { font-size: var(--text-sm); }
.text-xs    { font-size: var(--text-xs); }
.text-muted { color: var(--color-text-muted); }
.text-center{ text-align: center; }
.text-right { text-align: right; }
.font-semi  { font-weight: var(--font-semi); }
.font-bold  { font-weight: var(--font-bold); }
.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }
.text-accent  { color: var(--color-accent); }
.w-full     { width: 100%; }
.d-none     { display: none !important; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider    { border: none; border-top: 1px solid var(--color-border); margin: var(--space-6) 0; }
.readonly-notice {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: #975a16;
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ============================================================
   26b. AUTHENTICATED HEADER NAV
   ============================================================ */
.auth-header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--color-site-header-bg);
  box-shadow: 0 0 18px 0 var(--color-site-header-shadow);
  border-bottom: 1px solid var(--color-site-header-border);
}
.auth-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 82px;
}
.auth-header__logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  border-right: 1px solid var(--color-site-header-border);
  padding-right: 35px;
  margin-right: 20px;
  align-self: center;
}
.auth-header__logo img { height: 38px; }
.auth-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.auth-header__balance {
  text-align: right;
  flex-shrink: 0;
  display: inline-block;
  text-decoration: none;
  color: inherit;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}
.auth-header__balance:hover,
.auth-header__balance:focus-visible {
  background-color: var(--color-bg);
  border-color: var(--color-border);
  text-decoration: none;
  outline: none;
}
.auth-header__balance:focus-visible {
  box-shadow: 0 0 0 2px var(--color-link);
}
.auth-header__balance-label {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: block;
}
.auth-header__balance-amount {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-link);
  display: block;
}
.auth-header__nav {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin-right: auto;
}
.auth-header__nav-link {
  display: block;
  padding: 8px 18px;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-site-header-text);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}
.auth-header__nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-link);
  transition: width 0.3s ease, left 0.3s ease;
}
.auth-header__nav-link:hover::after,
.auth-header__nav-link--active::after {
  width: 80%;
  left: 10%;
}
.auth-header__nav-link:hover,
.auth-header__nav-link--active { color: var(--color-link); }
.auth-header__accent {
  height: 3px;
  background: var(--color-link);
}

/* Account dropdown */
.auth-header__dropdown {
  position: relative;
  display: inline-block;
}
.auth-header__dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-site-header-text);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s;
  position: relative;
}
.auth-header__dropdown-toggle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-link);
  transition: width 0.3s ease, left 0.3s ease;
}
.auth-header__dropdown-toggle:hover::after,
.auth-header__dropdown.open .auth-header__dropdown-toggle::after {
  width: 80%;
  left: 10%;
}
.auth-header__dropdown-toggle:hover,
.auth-header__dropdown.open .auth-header__dropdown-toggle { color: var(--color-link); }
.auth-header__dropdown-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--color-border-dark);
  border-radius: 4px;
  font-size: 0;
  transition: transform 0.2s, border-color 0.2s;
}
.auth-header__dropdown-arrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--color-site-header-text);
  border-bottom: 2px solid var(--color-site-header-text);
  transform: rotate(45deg);
  margin-top: -2px;
  transition: border-color 0.2s;
}
.auth-header__dropdown-toggle:hover .auth-header__dropdown-arrow,
.auth-header__dropdown.open .auth-header__dropdown-arrow { border-color: var(--color-link); }
.auth-header__dropdown-toggle:hover .auth-header__dropdown-arrow::before,
.auth-header__dropdown.open .auth-header__dropdown-arrow::before { border-color: var(--color-link); }
.auth-header__dropdown.open .auth-header__dropdown-arrow { transform: rotate(180deg); }
.auth-header__dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 6px 0;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 1001;
}
.auth-header__dropdown.open .auth-header__dropdown-menu { display: block; }
.auth-header__dropdown:hover .auth-header__dropdown-menu { display: block; }
.auth-header__dropdown:hover .auth-header__dropdown-toggle { color: var(--color-link); }
.auth-header__dropdown:hover .auth-header__dropdown-arrow { border-color: var(--color-link); transform: rotate(180deg); }
.auth-header__dropdown:hover .auth-header__dropdown-arrow::before { border-color: var(--color-link); }
.auth-header__dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.15s;
}
.auth-header__dropdown-menu a {
  white-space: nowrap;
}
.auth-header__dropdown-menu a i {
  font-size: 0.9rem;
  width: 18px;
  text-align: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.auth-header__dropdown-menu a:hover i { color: var(--color-link); }
.auth-header__dropdown-menu a:hover { background: var(--color-bg); color: var(--color-link); }
.auth-header__dropdown-divider { height: 1px; background: var(--color-border); margin: 4px 0; }

/* Auth header: mobile nav row */
.auth-header__mobile-nav {
  display: none;
  justify-content: center;
  padding: 0 20px 10px;
  width: 100%;
}
.auth-header__mobile-nav a {
  font-family: var(--font-nav-mobile);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-site-header-text);
  padding: 6px 12px;
  text-decoration: none;
  position: relative;
}
.auth-header__mobile-nav a:hover { color: var(--color-link); }

/* Auth header: mobile overrides */
@media (max-width: 768px) {
  .auth-header__top { flex-wrap: nowrap; padding: 12px 20px; height: auto; }
  .auth-header__logo { border-right: none; padding-right: 0; margin-right: 0; }
  .auth-header__balance-label { font-size: 0.65rem; }
  .auth-header__balance-amount { font-size: 0.9rem; }
  .auth-header__mobile-nav { display: flex !important; align-items: center; flex-wrap: wrap; }
  .auth-header__mobile-nav .auth-header__dropdown-toggle {
    font-family: var(--font-nav-mobile);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
  }
  .auth-header__dropdown-menu a {
    font-size: 1rem;
    padding: 12px 20px;
  }
}

/* ============================================================
   27. PUBLIC SITE HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 0 18px 0 var(--color-site-header-shadow);
  border-bottom: 1px solid var(--color-site-header-border);
  height: 82px;
  background-color: var(--color-site-header-bg);
  display: flex;
  align-items: center;
}
.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  width: 100%;
}
.site-header__logo {
  display: inline-flex;
  align-items: center;
  border-right: 1px solid var(--color-site-header-border);
  padding-right: 35px;
  margin-right: 20px;
  flex-shrink: 0;
  height: 100%;
}
.site-header__logo img { height: 38px; }
.site-header__nav {
  display: inline-flex;
  align-items: center;
  list-style: none;
  gap: 0;
}
.site-header__nav-link {
  display: block;
  padding: 10px 18px;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-site-header-text);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}
.site-header__nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-link);
  transition: width 0.3s ease, left 0.3s ease;
}
.site-header__nav-link:hover::after,
.site-header__nav-link--active::after {
  width: 80%;
  left: 10%;
}
.site-header__nav-link:hover,
.site-header__nav-link--active { color: var(--color-link); }
.site-header__actions {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 100%;
}
.site-header__mobile-nav {
  display: none;
  justify-content: center;
  margin-top: -11px;
  padding-bottom: 8px;
  width: 100%;
}
.site-header__mobile-nav a {
  font-family: var(--font-nav-mobile);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-site-header-text);
  padding: 6px 12px;
  text-decoration: none;
}
.site-header__mobile-nav a:hover { color: var(--color-link); }

/* ============================================================
   28. CTA BUTTON (pill style, used across public pages)
   ============================================================ */
.cta-button {
  background-color: var(--color-accent);
  padding: 10px 20px;
  line-height: 24px;
  color: #fff;
  position: relative;
  font-size: 1rem;
  font-weight: 500;
  display: inline-block;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  overflow: hidden;
  border: none;
  border-radius: var(--cta-pill-radius);
  box-shadow: 0 4px 12px rgba(102,103,107,0.15);
  text-decoration: none;
  text-align: center;
  font-family: var(--font-heading);
}
.cta-button:hover:not(:disabled) { background-color: #068925; color: #fff; }

/* Disabled-but-visible state. Lets gated-submit patterns (e.g. "tick
   the box to enable Accept") work via the disabled HTML attribute
   alone — no JS class toggle. Outlined green so the affordance reads
   as "this is a button you can't use yet" rather than "this looks broken". */
.cta-button:disabled {
  background-color: transparent;
  color: var(--color-accent);
  /* 2px border replaces the enabled state's 0 border, so trim 2px
     from vertical padding to keep both states at the same height. */
  border: 2px solid var(--color-accent);
  padding: 8px 18px;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.7;
}
.cta-button:disabled:hover { background-color: transparent; color: var(--color-accent); }
.cta-button--pill {
  border-radius: var(--cta-pill-radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  width: 90%;
  font-size: 0.9375rem;
  padding: 10px 20px;
}
.cta-button--pill i { margin-left: 6px; transition: margin 0.2s; font-style: normal; }
.cta-button--pill:hover i { margin-left: 12px; }
/* Blue variant — used by the SSR site header's "Welcome <name>" pill
   when a user is signed in. Overrides the base green background/hover
   so it reads distinct from the marketing Login CTA. */
.cta-button--blue { background-color: var(--color-link); }
.cta-button--blue:hover:not(:disabled) { background-color: var(--color-link-hover); color: #fff; }
.cta-button sup { vertical-align: baseline; font-size: 0.6em; position: relative; top: -0.4em; line-height: 0; }

/* ============================================================
   29. HERO BANNER
   ============================================================ */
.hero-banner {
  padding: 45px 0;
  position: relative;
  background-size: cover;
  background-position: center;
}
.hero-banner--muted::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-hero-overlay);
  opacity: 0.85;
  z-index: 5;
}
.hero-banner--light-muted::before { opacity: 0.6; }
/* Hero background — set once via --hero-banner-bg-vdi in each theme file.
   Swap the theme variable to `none` (or comment the declaration) to disable
   the hero image across every public/auth page in one place. */
.hero-banner--bg-vdi { background-image: var(--hero-banner-bg-vdi); }
/* Extra bottom padding used by the form-style heroes (auth pages that host
   a login/register/reset form inside the hero band). */
.hero-banner--form-hero { padding-bottom: 40px; }
.hero-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.hero-banner__image { width: 50%; padding: 0 15px; }
.hero-banner__image img { width: 100%; height: auto; display: block; }
.hero-banner__content { width: 50%; padding: 0 15px 0 15px; text-align: center; }

.hero-banner__title {
  font-family: var(--font-heading);
  font-size: 2.625rem;
  font-weight: 700;
  color: var(--color-hero-text);
  line-height: 1.1;
}
.hero-banner__subtitle {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 300;
  color: var(--color-hero-text);
  margin-top: 8px;
  margin-bottom: 20px;
}
.hero-banner__subtitle strong { font-weight: 700; }

.hero-banner__price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 10px;
}
.hero-banner__price-label-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-banner__price-label {
  font-weight: 300;
  color: var(--color-hero-price-muted);
  font-size: 0.875rem;
}
.hero-banner__price-symbol {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-hero-text);
  font-size: 2.25rem;
  line-height: 1;
}
.hero-banner__price-amount {
  font-family: var(--font-heading);
  font-size: 5.25rem;
  font-weight: 900;
  color: var(--color-hero-text);
  line-height: 42px;
  padding-left: 5px;
}
.hero-banner__price-vat {
  padding-left: 5px;
  font-family: var(--font-heading);
  font-weight: 300;
  color: var(--color-hero-vat);
  font-size: 0.75rem;
  line-height: 1.3;
}
.hero-banner__price-asterisk {
  font-size: 0.3em;
  font-weight: 700;
  vertical-align: 1.7em;
  margin-left: 1px;
  line-height: 1;
  color: var(--color-hero-vat);
}
.hero-banner__price-note {
  text-align: center;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--color-hero-vat);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.hero-banner__price-note a { color: inherit; text-decoration: underline; }
.hero-banner__cta { text-align: center; margin-top: 30px; margin-bottom: 20px; }
.hero-banner__note {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  text-align: center;
  color: var(--color-hero-text);
}

/* ============================================================
   30. DARK PANEL SECTIONS
   ============================================================ */
.dark-panel {
  background-color: var(--color-dark-panel-bg);
  border-top: 8px solid var(--color-dark-panel-border);
  border-bottom: 8px solid var(--color-dark-panel-border);
  padding: 25px;
  display: block;
  position: relative;
}
.dark-panel--no-border-bottom { border-bottom: 0; }

.dark-panel__heading h1 { font-family: var(--font-heading); font-size: 3.75rem; font-weight: 900; }
.dark-panel__heading h2 { font-family: var(--font-heading); font-size: 3rem; font-weight: 700; line-height: 1.1; }
.dark-panel__heading h3 { font-family: var(--font-heading); font-size: 1.75rem; font-weight: 300; }
.dark-panel__heading h4 { font-family: var(--font-heading); font-size: 1.125rem; font-weight: 600; }
.dark-panel__heading--light h1,
.dark-panel__heading--light h2,
.dark-panel__heading--light h3,
.dark-panel__heading--light h4 { color: #fff; }
.dark-panel__heading--dark h1,
.dark-panel__heading--dark h2,
.dark-panel__heading--dark h3,
.dark-panel__heading--dark h4 { color: var(--color-text); }

.dark-panel__text--light {
  font-family: var(--font-sans);
  color: #fff;
  font-weight: 500;
  font-size: 1rem;
  line-height: 24px;
  padding-top: 15px;
}
.dark-panel__text--dark {
  font-family: var(--font-sans);
  color: var(--color-text);
  font-weight: 500;
  font-size: 1rem;
  line-height: 24px;
  padding-top: 15px;
}

.dark-panel__text--lettered {
  padding-left: 2rem;
}
.dark-panel__text--lettered strong:first-child {
  font-weight: 700;
}

.dark-panel__image-col { display: flex; align-items: center; justify-content: center; }
.dark-panel__report-graphic { width: 75%; }

/* Data source items (vdi-data page) */
.data-source { margin-bottom: 1.25rem; }
.data-source__title {
  font-size: 1.0625rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-link);
  text-align: left;
  margin-bottom: 0.25rem;
}
.data-source__desc {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1rem;
  line-height: 24px;
  color: var(--color-text);
  text-align: left;
}
.data-source-col { text-align: left; }

/* ============================================================
   31. FEATURE GRID
   ============================================================ */
.section-heading {
  display: block;
  margin-bottom: 20px;
  margin-top: 30px;
}
.section-heading__title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  line-height: 36px;
  font-weight: 600;
  color: var(--color-text);
}
.section-heading__title strong { font-weight: 700; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}
.feature-grid__item {
  border-radius: 12px;
  display: block;
  background: var(--color-feature-box-bg);
  box-shadow: 0 0 15px var(--color-feature-box-shadow);
  transition: 0.4s;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}
.feature-grid__item:hover {
  box-shadow: 0 6px 18px var(--color-feature-box-shadow-hover);
  transform: translateY(-15px);
  color: inherit;
}
.feature-grid__item-inner {
  padding: 15px 5px;
  text-align: center;
}
.feature-grid__letter {
  width: 58px;
  margin: 0 auto;
  border: solid 4px;
  padding: 0;
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 50px;
}
.feature-grid__name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-feature-text);
  margin-top: 8px;
  margin-bottom: 4px;
}
.feature-grid__desc {
  color: var(--color-feature-desc);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.8125rem;
  text-align: center;
  line-height: 18px;
  margin-top: 4px;
  display: inline-block;
}

.feature-grid__summary {
  text-align: center;
  padding: 10px 0 0;
}
.feature-grid__summary h2 {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 300;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}
.feature-grid__summary h2 strong { color: var(--color-text); font-weight: 800; }

/* ============================================================
   32. REVIEW GRID
   ============================================================ */
.review-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 20px 0;
}
.review-grid__card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 14px;
  box-shadow: 0 0 22px var(--color-review-shadow);
  background-color: var(--color-review-bg);
  transition: 0.3s;
  cursor: default;
}
.review-grid__card:hover {
  box-shadow: 0 0 26px var(--color-review-shadow-hover);
  transform: translateY(-4px);
}
.review-grid__card-inner {
  text-align: center;
  padding: 38px 20px;
  flex-grow: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.review-grid__card-inner > div { width: 100%; }
.review-grid__name {
  font-size: 1.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-review-name);
  margin-bottom: 2px;
}
.review-grid__role {
  font-size: 0.8125rem;
  color: var(--color-review-role);
  display: block;
  margin-bottom: 12px;
}
.review-grid__quote {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-review-quote);
  line-height: 22px;
}
.review-grid__rating { margin-top: 12px; }
.star-rating {
  display: inline-block;
  color: var(--color-star);
  font-size: 1rem;
  letter-spacing: 2px;
}
.star-rating::before {
  content: attr(data-rating);
  float: left;
  border-radius: 4px;
  background-color: var(--color-star);
  color: #fff;
  font-size: 0.875rem;
  line-height: 15px;
  font-weight: 700;
  padding: 5px 7px;
  position: relative;
  top: 1px;
  margin-right: 10px;
}

/* ============================================================
   33. BRANDING LIST / EV LIST
   ============================================================ */
.brand-list { padding: 0; margin: 0; list-style: none; }
.brand-list li { margin-bottom: 16px; padding-left: 1.5rem; }
.brand-list__tick {
  color: var(--color-link);
  margin-right: 0.5rem;
  margin-left: -1.5rem;
}
.brand-list__title,
.dark-panel__heading .brand-list__title {
  font-size: 1.0625rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-link);
  text-align: left;
}
.brand-list__desc {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1rem;
  line-height: 24px;
  color: var(--color-text);
  text-align: left;
}

/* Section logos (used in content sections) */
.section-logo {
  width: 60%;
  margin-bottom: 10px;
}
.section-logo--light {
  margin: 0 auto;
}
.section-logo--sm {
  width: 25%;
  margin: 0 auto 10px;
}
.section-logo--mobile-brand {
  width: 60%;
  margin: 0 auto 10px;
}
.brand-section__heading-mobile {
  display: none;
}

/* Key points boxes (pricing page "Why use VDI Check" panels) */
.key-points-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}
.key-points-grid__item {
  background: var(--color-surface);
  border-radius: 12px;
  box-shadow: 0 0 15px var(--color-feature-box-shadow);
  padding: 16px 16px;
  text-align: center;
  transition: 0.4s;
}
.key-points-grid__item:hover {
  box-shadow: 0 6px 18px var(--color-feature-box-shadow-hover);
  transform: translateY(-8px);
}
.key-points-grid__image {
  max-width: 100px;
  margin: 0 auto 12px;
  display: block;
}
.key-points-grid__title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}
.key-points-grid__desc {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  line-height: 20px;
}

.ev-list { padding: 0; margin: 8px 0 0; list-style: none; }
.ev-list li { font-size: 0.875rem; font-weight: 600; color: #fff; padding: 4px 0; }
.ev-list li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #efca33;
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
}

/* ============================================================
   34. SITE FOOTER
   ============================================================ */
.site-footer {
  background-color: var(--color-footer-bg);
  color: var(--color-footer-text);
  border-top: 8px solid var(--color-dark-panel-border);
}
.site-footer__middle {
  padding: 37px 0 20px;
  position: relative;
  z-index: 10;
}
.site-footer__middle .container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.site-footer__col h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-footer-heading);
  margin-bottom: 16px;
}
.site-footer__col ul { list-style: none; }
.site-footer__col ul li a,
.site-footer__col a {
  color: var(--color-footer-text);
  display: block;
  line-height: 25px;
  padding: 5px 0;
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s;
}
.site-footer__col ul li a:hover,
.site-footer__col a:hover { color: var(--color-link); }
.site-footer__product-name { color: var(--color-footer-heading); font-weight: 500; transition: color 0.2s; }
.site-footer__col a:hover .site-footer__product-name { color: var(--color-link); }
.site-footer__email-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.site-footer__email-icon { font-size: 1.125rem; color: var(--color-footer-heading); flex-shrink: 0; line-height: 1; }
.site-footer__email-text { font-size: 0.875rem; color: var(--color-footer-text); }

.site-footer__support-banner {
  background-color: var(--color-footer-support-bg);
  padding: 16px 0;
  border-top: 1px solid var(--color-footer-border);
  text-align: center;
}
.site-footer__support-banner p {
  font-size: 0.9375rem;
  color: var(--color-footer-text);
  line-height: 1.5;
  margin: 0;
}
.site-footer__support-banner strong { color: #fff; }
.site-footer__support-banner a { color: var(--color-footer-phone); text-decoration: none; transition: color 0.2s; }
.site-footer__support-banner a:hover { color: var(--color-link); }
.site-footer__support-banner .container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.site-footer__bottom {
  background-color: var(--color-footer-bottom-bg);
  padding: 25px 0;
  border-top: 1px solid var(--color-footer-border);
  text-align: center;
  font-size: 0.8125rem;
  line-height: 20px;
  color: var(--color-footer-text);
}
.site-footer__bottom .container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.site-footer__bottom, .site-footer__bottom small, .site-footer__bottom p { color: var(--color-footer-text); }
.site-footer__bottom a { color: var(--color-footer-text); text-decoration: none; }
.site-footer__bottom a:hover { color: var(--color-link); }
.site-footer__version { margin-top: 10px; opacity: 0.55; }
.site-footer__version small { font-size: 0.72rem; letter-spacing: 0.04em; }

/* ============================================================
   35. LOGIN PAGE
   ============================================================ */

/* Input with icon (left-aligned icon inside input) */
.input-icon {
  position: relative;
}
.input-icon__icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a0a0a0;
  font-size: 1.125rem;
  pointer-events: none;
  z-index: 1;
}
.input-icon__field {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 20px 0 55px;
  font-size: 1rem;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-input-bg);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}
textarea.input-icon__field { height: auto; min-height: 48px; padding: 12px 16px; }
.input-icon__field:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(69,188,74,0.15);
}
.input-icon__field::placeholder {
  color: var(--color-text-light);
}
.input-icon--error .input-icon__field {
  border: 2px dashed var(--color-danger);
}
.input-icon--error .input-icon__icon {
  color: var(--color-danger);
}

/* Password field with mono font + eye reveal + generate buttons —
   used by EditUserDrawer's Add-mode initial-password entry. */
.pwd-field__input {
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  padding-right: 48px;   /* clear the reveal button on the right */
}
.pwd-field__reveal {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--color-text-muted);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  transition: background 0.15s ease, color 0.15s ease;
}
.pwd-field__reveal:hover,
.pwd-field__reveal:focus {
  background: var(--color-info-bg);
  color: var(--color-link);
  outline: none;
}
.pwd-generate {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.pwd-generate__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.pwd-generate__btn:hover,
.pwd-generate__btn:focus {
  border-color: var(--color-link);
  color: var(--color-link);
  background: var(--color-info-bg);
  outline: none;
}
.pwd-generate__btn i {
  font-size: 0.95rem;
}

/* Benefit list (login "With an Account" panel) */
.benefit-list { list-style: none; padding: 0; margin: 0; }
.benefit-list__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
}
.benefit-list__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.login-panel-col { display: flex; }
.login-panel-box { display: flex; flex-direction: column; width: 100%; }
.login-panel-box .vdi-box-content { flex: 1; }

/* Login buttons row */
.login-buttons {
  display: flex;
  gap: 16px;
  margin-top: 20px;
}
.login-buttons .cta-button {
  flex: 1;
  border-radius: var(--cta-pill-radius);
  text-align: center;
  font-size: 0.875rem;
  padding: 8px 16px;
}
.cta-button--gray {
  background-color: var(--color-btn-secondary);
  color: var(--color-btn-secondary-text);
  border: 1px solid var(--color-border-dark);
  box-shadow: 0 4px 12px rgba(102,103,107,0.15);
}
/* :not(:disabled) raises specificity to match the base .cta-button hover
   above so this rule wins (it's defined later in the cascade). Without
   it the gray Close button would hover to the primary green. */
.cta-button--gray:hover:not(:disabled) {
  background-color: var(--color-btn-secondary-hover);
  color: var(--color-btn-secondary-text);
  border-color: var(--color-text-muted);
}

/* Error banner */
.error-banner {
  background: #de5d4d;
  color: #fff;
  text-align: center;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  margin-bottom: 20px;
}

/* /account-create client helpers — password eye toggle + live-validation
   hints. Also used by the disabled-until-valid submit button state. */
.input-icon--with-eye .input-icon__field { padding-right: 44px; }
.input-icon--with-eye .password-eye {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  line-height: 1;
}
.input-icon--with-eye .password-eye:hover,
.input-icon--with-eye .password-eye:focus-visible {
  color: var(--color-text);
  outline: none;
}

/* Inline edit affordance — pencil at the right edge of a locked input.
   Opens a modal that owns the actual edit flow (e.g. the ChangeEmailModal).
   Same layout treatment as .password-eye so the two look at home in the
   same input-icon wrapper. */
.input-icon--with-edit .input-icon__field { padding-right: 44px; }
.input-icon--with-edit .input-edit {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  line-height: 1;
}
.input-icon--with-edit .input-edit:hover,
.input-icon--with-edit .input-edit:focus-visible {
  color: var(--color-link);
  outline: none;
}

/* Read-only lock indicator - matches .input-icon--with-edit's layout
   so the lock icon sits in the same right-hand slot the pencil would
   occupy. Non-interactive; the field is purely informational. */
.input-icon--with-lock .input-icon__field { padding-right: 40px; }
.input-icon--with-lock .input-lock {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 12px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  line-height: 1;
  pointer-events: none;
  font-size: 0.9rem;
}
.field-hint--live {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  min-height: 1.15em;
  text-align: left;
  color: var(--color-text-muted);
}
.field-hint--live.is-error { color: var(--color-danger); }
.field-hint--live.is-ok { color: var(--color-accent); }

/* Disabled CTA — the disabled attribute still blocks submission
   (screen readers announce "disabled"; browser refuses to fire
   submit), but visually the button stays fully coloured. Wayne
   found the 50% opacity dim hard to read on light mode. Cursor
   still switches to not-allowed on hover so the user gets a
   pointer hint that the button isn't yet actionable — the live
   hints under invalid fields tell them what's still missing. */
.cta-button:disabled,
.cta-button[disabled] {
  cursor: not-allowed;
}

/* Sibling of .error-banner — informational (not an error). Used for
   contextual heads-up lines like the email-verification notice on
   /account-create. Blue-tinted, left-aligned, icon-friendly. */
.info-banner {
  background: var(--color-info-bg);
  color: var(--color-text);
  border: 1px solid var(--color-info-border);
  border-left: 4px solid var(--color-info);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  text-align: left;
  line-height: 1.5;
}
.info-banner i {
  color: var(--color-info);
  vertical-align: middle;
}

/* Login info/help section */
.login-help {
  padding: 0 20px;
}
.login-help__title {
  font-size: 1.0625rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: #297dc5;
  margin-bottom: 4px;
}
.login-help__text {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-text);
  line-height: 22px;
}

/* 2FA panel */
.twofa-panel {
  text-align: center;
  padding: 20px;
}
.twofa-panel__icon {
  font-size: 3rem;
  color: var(--color-accent);
  margin-bottom: 16px;
}
.twofa-panel__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}
.twofa-panel__desc {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}
.twofa-panel__input {
  display: block;
  width: 200px;
  margin: 0 auto 20px;
  height: 52px;
  padding: 0 16px;
  font-size: 1.5rem;
  font-family: var(--font-mono);
  letter-spacing: 0.3em;
  text-align: center;
  color: var(--color-text);
  background: var(--color-input-bg);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  appearance: none;
}
.twofa-panel__input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(69,188,74,0.15);
}

/* ============================================================
   36. GRID HELPERS (public pages)
   ============================================================ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.row { display: flex; flex-wrap: wrap; margin: 0 -15px; }
.row > [class*="col-"] { padding: 0 15px; }
.row--flush { margin: 0; }
.row--flush > [class*="col-"] { padding: 0; }
.col-6  { width: 50%; }
.col-10 { width: 83.333%; }
.col-12 { width: 100%; }
.col-md-3 { width: 25%; }
.col-md-4 { width: 33.333%; }
.col-md-5 { width: 41.666%; }
.col-md-6 { width: 50%; }
.col-md-7 { width: 58.333%; }
.col-md-8 { width: 66.666%; }
.col-lg-4 { width: 33.333%; }
.col-lg-5 { width: 41.666%; }
.col-lg-6 { width: 50%; }
.col-lg-7 { width: 58.333%; }
.col-lg-8 { width: 66.666%; }
.col-lg-12 { width: 100%; }
.col-xl-4 { width: 33.333%; }
.col-xl-12 { width: 100%; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }
.d-flex { display: flex; }
.order-first { order: -1; }
.order-md-2 { order: 2; }
.margin-top-10  { margin-top: 10px; }
.margin-top-20  { margin-top: 20px; }
/* ============================================================
   PAYMENTS / RECEIPTS (REQ-020)
   ============================================================ */

/* Payment history — mobile card view. Table is hidden below the mobile
   breakpoint (via .hide-mobile) and this card list takes over so users
   never horizontal-scroll six-column rows on a narrow viewport. */
/* .hide-above-mobile forces display:block !important on mobile, which
   overrides display:flex here and silently kills the gap. Use per-card
   margin-bottom instead so spacing works in both display models. */
.payment-cards {
  display: flex;
  flex-direction: column;
}
.payment-card {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-input-bg);
  overflow: hidden;
  margin-bottom: 12px;
}
.payment-card:last-child { margin-bottom: 0; }
.payment-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.payment-card__date { display: flex; flex-direction: column; }
.payment-card__date small { color: var(--color-text-muted); font-size: 0.75rem; }
.payment-card__total { font-size: 1.05rem; font-weight: 700; }
.payment-card__body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.payment-card__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
}
.payment-card__row .payment-card__value { text-align: right; }
/* Shared sub-note style for the "n tokens" line under the Package column
   and the refund date under the Status column. Explicit size so both
   surfaces read identically regardless of their parent cell's base
   font-size. */
.payment-sub-note {
    display: inline-block;
    margin-top: 2px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}
.payment-card__label { color: var(--color-text-muted); font-weight: 500; flex-shrink: 0; }
.payment-card__foot {
  padding: 10px 14px;
  border-top: 1px solid var(--color-border);
  text-align: center;
  background: var(--color-bg);
}

/* Small View link used in the desktop table's Receipt column and the
   mobile card footer. Base state has no underline; hover / active
   paint a subtle border and a slight background so the pill feels
   interactive without the green underline flash. */
.receipt-view-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-link);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.receipt-view-link:hover,
.receipt-view-link:focus-visible {
  text-decoration: none;
  border-color: var(--color-border);
  background: var(--color-surface-alt, var(--color-bg));
}
.receipt-view-link:active {
  background: var(--color-surface-alt, var(--color-bg));
  border-color: var(--color-border);
  filter: brightness(0.95);
}
.receipt-view-link i { font-size: 0.95rem; }

/* Whole-row click affordance for the desktop payments table. Mobile
   uses cards, so this only fires above the table's viewport. */
.payment-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.payment-row:hover {
  background: var(--color-surface-alt, var(--color-bg));
}

/* -----------------------------------------------------------
   RECEIPT SHEET (/receipt/{id}) — designed for on-screen viewing
   and A4-paper printing. Screen chrome (@page action row) has
   .receipt-print-hide so window.print() only prints the sheet.
   ----------------------------------------------------------- */
.receipt-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.receipt-sheet {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px;
  background: #fff;
  color: #222;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.receipt-sheet__masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid #222;
  margin-bottom: 24px;
}
.receipt-sheet__logo { max-height: 60px; max-width: 220px; }
.receipt-sheet__title { text-align: right; }
.receipt-sheet__title h1 {
  font-size: 1.6rem;
  margin: 0 0 4px;
  color: #222;
  font-weight: 700;
}
.receipt-sheet__title p { margin: 0; font-size: 0.85rem; color: #666; }

/* Two-party block: Supplier (VDG) on the left, Bill To (account) on the
   right. HMRC VAT-invoice essentials — legal name, address, VAT number. */
.receipt-sheet__parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
.receipt-sheet__party {
  padding: 24px 22px;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.7;
}
.receipt-sheet__party-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666;
  font-weight: 700;
  margin-bottom: 14px;
}
.receipt-sheet__party-name {
  font-weight: 700;
  color: #222;
  font-size: 1.05rem;
  margin-bottom: 12px;
}
.receipt-sheet__party-line { color: #333; }
.receipt-sheet__party-line strong { color: #444; }

/* Identifier lines (VAT / Company Reg) sit apart from the address block
   above — first identifier gets a top margin + subtle divider so the
   two logical sections read as distinct rather than one wall of text. */
.receipt-sheet__party-ids {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e6e6e6;
}
.receipt-sheet__party-ids .receipt-sheet__party-line + .receipt-sheet__party-line {
  margin-top: 2px;
}

.receipt-sheet__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 20px 22px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 32px;
}
.receipt-sheet__meta-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  font-weight: 600;
  margin-bottom: 4px;
}
.receipt-sheet__meta-value {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  word-break: break-all;
  color: #222;
}

.receipt-sheet__section { margin-bottom: 24px; }
.receipt-sheet__section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  font-weight: 700;
  margin-bottom: 10px;
}

.receipt-sheet__lines { width: 100%; border-collapse: collapse; }
.receipt-sheet__lines td, .receipt-sheet__lines th { padding: 10px 12px; }
.receipt-sheet__lines tbody tr { border-bottom: 1px solid #e0e0e0; }
.receipt-sheet__lines tfoot tr th { text-align: left; font-weight: 500; color: #666; padding-top: 8px; padding-bottom: 4px; }
.receipt-sheet__lines-amt { text-align: right; white-space: nowrap; font-family: var(--font-mono, monospace); }
.receipt-sheet__lines-total { border-top: 2px solid #222; }
.receipt-sheet__lines-total th { font-weight: 700; font-size: 1rem; color: #222; padding-top: 12px; }
.receipt-sheet__lines-total .receipt-sheet__lines-amt { font-weight: 700; font-size: 1.1rem; }

.receipt-sheet__item { display: flex; flex-direction: column; gap: 2px; }
.receipt-sheet__item-sub { font-size: 0.8rem; color: #666; }

.receipt-sheet__payment {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 0.9rem;
}
.receipt-sheet__payment i { color: #666; }

/* Two-column split for the Payment method / Payment reference row at
   the bottom of the receipt sheet. Reference anchors to the right. */
.receipt-sheet__section--split {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.receipt-sheet__section-block { min-width: 0; }
.receipt-sheet__section-block--end { text-align: right; }
.receipt-sheet__reference {
  display: inline-block;
  padding: 10px 14px;
  background: #f8f9fa;
  border-radius: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  color: #222;
  word-break: break-all;
  max-width: 100%;
}

.receipt-sheet__footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  font-size: 0.75rem;
  color: #666;
  text-align: center;
}
.receipt-sheet__footer p { margin: 0 0 4px; }

@media (max-width: 600px) {
  .receipt-sheet { padding: 20px; }
  .receipt-sheet__masthead { flex-direction: column; align-items: flex-start; gap: 12px; }
  .receipt-sheet__title { text-align: left; }
  .receipt-sheet__parties { grid-template-columns: 1fr; }
  .receipt-sheet__meta { grid-template-columns: 1fr; }
  .receipt-sheet__section--split { flex-direction: column; gap: 16px; }
  .receipt-sheet__section-block--end { text-align: left; }
}

/* Print rules: strip site chrome (header, sidebar, action row) and let
   the receipt sheet take the whole page cleanly. */
@media print {
  body { background: #fff !important; }
  .site-header,
  .site-footer,
  .auth-header,
  .receipt-print-hide { display: none !important; }
  .container { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
  .receipt-sheet {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
}

.margin-top-30  { margin-top: 30px; }
.margin-bottom-10 { margin-bottom: 10px; }
.margin-bottom-20 { margin-bottom: 20px; }
.margin-bottom-30 { margin-bottom: 30px; }
.margin-bottom-40 { margin-bottom: 40px; }
.hide-mobile { }
.hide-below-lg { }
.full-below-lg { }
.hide-above-mobile { display: none !important; }
.show-below-lg { display: none; }
.hide-desktop { display: none; }
.img-responsive { max-width: 100%; height: auto; display: block; }

/* ============================================================
   36. RESPONSIVE — PUBLIC PAGES
   ============================================================ */
@media (max-width: 768px) {
  /* Header: taller on mobile, space below logo */
  .site-header { height: auto; flex-wrap: wrap; padding: 12px 0 0; }
  .site-header__inner { flex-wrap: wrap; justify-content: center; }
  .site-header__logo { border-right: none; padding-right: 0; margin-right: 0; margin-bottom: 16px; }
  .site-header__nav { display: none !important; }
  .site-header__actions { display: none !important; }
  .site-header__mobile-nav { display: flex; align-items: center; padding-bottom: 10px; }
  .theme-toggle--mobile { display: inline-flex !important; }

  .hide-mobile { display: none !important; }
  .hide-below-lg { display: none !important; }
  .hide-above-mobile { display: block !important; }
  .show-below-lg { display: block !important; }
  .full-below-lg { width: 100% !important; }
  .order-first { order: -1; }
  .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8 { width: 100%; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .review-grid { grid-template-columns: 1fr; }

  /* Package cards: single column, full width rows on mobile */
  .package-grid { grid-template-columns: 1fr; gap: var(--space-3); }
  .package-card {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 2px 0;
  }
  .package-popular-banner {
    grid-column: 1 / -1;
    grid-row: 1;
    margin: calc(-1 * var(--space-3)) calc(-1 * var(--space-4)) var(--space-2);
    width: calc(100% + 2 * var(--space-4));
    border-radius: 0;
  }
  .package-card:has(.package-popular-banner) .package-tokens { grid-row: 2; }
  .package-card:has(.package-popular-banner) .package-tokens-label { grid-row: 3; }
  .package-card:has(.package-popular-banner) .package-card-divider { grid-row: 2 / 4; }
  .package-card:has(.package-popular-banner) .package-price { grid-row: 2; }
  .package-card:has(.package-popular-banner) .package-price-sub { grid-row: 3; }
  .package-card:has(.package-popular-banner) .package-per-check { grid-row: 2 / 4; }
  .package-card .package-tokens { font-size: var(--text-2xl); grid-row: 1; grid-column: 1; text-align: center; }
  .package-card .package-tokens-label { grid-row: 2; grid-column: 1; margin: 0; font-size: 0.65rem; text-align: center; }
  .package-card .package-card-divider { display: block; grid-row: 1 / 3; grid-column: 2; width: 1px; height: 70%; background: var(--color-border); margin: 0 var(--space-3); align-self: center; }
  .package-card .package-price { font-size: var(--text-xl); grid-row: 1; grid-column: 3; }
  .package-card .package-price-sub { grid-row: 2; grid-column: 3; margin: 0; }
  .package-card .package-per-check { grid-row: 1 / 3; grid-column: 4; align-self: center; font-size: 0.85rem; margin-left: var(--space-3); }

  /* Sticky purchase bar padding */
  .site-footer { padding-bottom: 70px; }

  /* Dark panel headings */
  .dark-panel__heading h2 { font-size: 2rem; }
  .dark-panel__heading h3 { font-size: 1.375rem; }

  /* Hero banner: centre everything on mobile */
  .hero-banner__content { width: 100%; text-align: center; }
  .hero-banner__title { font-size: 1.75rem; }
  .hero-banner__subtitle { font-size: 1.125rem; }
  .hero-banner__price { padding-left: 0; justify-content: center; }
  .hero-banner__price-amount { font-size: 3.5rem; }
  .hero-banner__price-symbol { font-size: 1.5rem; }
  .hero-banner__inner { flex-direction: column; }
  .hero-banner__content { order: 1; }
  .hero-banner__image { order: 2; width: 100%; text-align: center; margin-top: 20px; }
  .hero-banner__image img { max-width: 70%; margin: 0 auto; }

  /* Light sections: centre text on mobile */
  .dark-panel__heading--dark { text-align: center; }
  .dark-panel__text--dark { text-align: center; }
  .brand-list { text-align: left; }
  .brand-list__title { text-align: left; }
  .brand-list__desc { text-align: left; }

  /* Brand section: combined heading on mobile */
  .brand-section__heading-mobile { display: block !important; }

  /* CTA buttons: full width, smaller text to avoid wrap */
  .cta-button--pill { width: 100%; font-size: 0.75rem; padding: 10px 16px; }

  /* Section logos: centre on mobile */
  .section-logo { margin: 0 auto 10px; }

  /* Dark panel content areas: centre text and elements */
  .dark-panel [class*="col-"] { text-align: center; }
  .dark-panel .cta-button--pill { margin-left: auto; margin-right: auto; }

  /* All lg columns: full width on mobile */
  .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8 { width: 100%; }

  /* Key points: 2 cols on tablet, 1 on small mobile */
  .key-points-grid { grid-template-columns: repeat(2, 1fr); }

  /* Login buttons: stack vertically, login first */
  .login-buttons { flex-direction: column-reverse; }
  .login-buttons .cta-button { width: 100%; }

  /* Section logos: larger on mobile */
  .section-logo { width: 80%; }
  .section-logo--light { width: 70%; }

  .vdi-box-content { padding: var(--space-3); }

  .site-footer__middle .row > [class*="col-"] { margin-bottom: 24px; }
  .site-footer__col { text-align: center; padding-bottom: 20px; position: relative; }
  .site-footer__col::after { content: ''; display: block; width: 60%; height: 1px; background: var(--color-footer-border); margin: 20px auto 0; }
  .site-footer__col--connect { padding-bottom: 20px; position: relative; }
  .site-footer__col--connect::after { content: ''; display: block; width: 60%; height: 1px; background: var(--color-footer-border); margin: 20px auto 0; }
  .site-footer__col--support::after { display: none; }
  .site-footer__col:last-child::after { display: none; }
  .site-footer__col ul { text-align: center; }
  .site-footer__col ul li a { display: inline-block; }
  .site-footer__col--connect .site-footer__email-link { justify-content: center; }
  .site-footer__col--support table { margin: 0 auto; }
}
@media (max-width: 480px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .feature-grid__item { min-height: 183px; }
  .feature-grid__letter { font-size: 1.75rem; }
  .feature-grid__name { font-size: 0.875rem; }
  .feature-grid__desc { font-size: 0.6875rem; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .hide-below-lg { display: none !important; }
  .show-below-lg { display: block !important; }
  .full-below-lg { width: 100% !important; }
  .feature-grid { grid-template-columns: repeat(4, 1fr); }
  .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8 { width: 50%; }
  .site-header__nav-link { font-size: 0.75rem; padding: 10px 12px; }
  .site-header__actions .cta-button { font-size: 0.75rem; padding: 8px 18px; }
  .auth-header__nav-link { font-size: 0.75rem; padding: 8px 12px; }
  .auth-header__dropdown-toggle { font-size: 0.75rem; padding: 8px 12px; }
  .cta-button--pill { font-size: 0.78125rem; padding: 10px 16px; }

  /* Footer: outer wrapper full width, inner columns 50/50 on tablet */
  .site-footer__col .site-footer__connect-row { margin-top: 20px; }
  .site-footer .col-md-12.col-lg-4 { width: 100% !important; }
  .site-footer__connect-row > [class*="col-"] { width: 50%; }
  .site-footer__connect-row .site-footer__col--support { padding-left: 15px; }

  /* Login: stack buttons on tablet */
  .login-buttons { flex-direction: column-reverse; }
  .login-buttons .cta-button { width: 100%; }
}

/* Desktop: ≥ 1025px */
@media (min-width: 1025px) {
  .site-footer__connect-row > [class*="col-"] { width: 100%; }
  .site-footer__col--support { margin-top: 20px; }
}

/* ============================================================
   DEV NAV — remove for production
   ============================================================ */
.dev-nav {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
}
.dev-nav__toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e74c3c;
  color: #fff;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}
.dev-nav__toggle:hover { background: #c0392b; transform: scale(1.1); }
.dev-nav__menu {
  display: none;
  position: absolute;
  bottom: 54px;
  left: 0;
  background: rgba(26,28,31,0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid #3a3d42;
  border-radius: 8px;
  padding: 8px 0;
  min-width: 260px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.dev-nav__menu.open { display: block; }
.dev-nav__heading {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #e74c3c;
  padding: 8px 16px 4px;
}
.dev-nav__menu a {
  display: block;
  padding: 6px 16px;
  font-size: 0.8125rem;
  color: #e0e1e3;
  text-decoration: none;
  transition: background 0.15s;
}
.dev-nav__menu a:hover { background: #2a2c2f; color: #fff; }
.dev-nav__divider { height: 1px; background: #3a3d42; margin: 6px 0; }

/* Mobile S: ≤ 480px */
@media (max-width: 480px) {
  :root { --header-height: 56px; }
  .app-main { padding: var(--space-4); }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: var(--space-3); }
  .status-flags { grid-template-columns: 1fr 1fr; }
  .package-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: var(--text-2xl); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-image { display: none; }
  .login-layout { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .colour-grid { grid-template-columns: 1fr; }
  .permission-grid { grid-template-columns: 1fr; }
  .basic-result-body { grid-template-columns: 1fr; }
  .basic-result-img { width: 100%; height: 160px; }
  .lookup-form { flex-direction: column; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-card.featured { transform: none; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .table-search { max-width: 100%; }
  .uk-plate-xl { font-size: 1.8rem; padding: var(--space-3) var(--space-5); }
}

/* Mobile L: 481px – 564px */
@media (min-width: 481px) and (max-width: 564px) {
  .app-main { padding: var(--space-5); }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: var(--space-4); }
  .status-flags { grid-template-columns: 1fr 1fr; }
  .package-grid { grid-template-columns: 1fr; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-image { display: none; }
  .login-layout { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
  .colour-grid { grid-template-columns: 1fr 1fr; }
}

/* Tablet: ≤ 768px */
@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; grid-template-areas: "header" "main"; }
  .app-sidebar {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    z-index: 150;
    box-shadow: var(--shadow-xl);
  }
  .app-sidebar.open { display: flex; }
  .sidebar-toggle { display: flex; }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 149; }
  .sidebar-backdrop.open { display: block; }
  .app-main { padding: var(--space-5); }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-card.featured { transform: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-image { display: none; }
  .login-layout { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
  .package-grid { grid-template-columns: 1fr; }
  .public-nav-links { display: none; }
  .colour-grid { grid-template-columns: 1fr 1fr; }
}

/* Large Desktop: ≥ 1280px */
@media (min-width: 1280px) {
  :root { --sidebar-width: 260px; }
  .app-main { padding: var(--space-10); }
  .hero h1 { font-size: 3rem; }
  .section-inner { max-width: 1280px; }
}

/* ============================================================
   COMPACT VIEW — .report--compact overrides
   Applied when user toggles "Compacted View" in Report Settings.
   Production: cascading parameter ReportSettings.CompactView
   ============================================================ */

/* Section boxes — tighter spacing, smaller gap between sections */
.report--compact .vdi-box {
  margin-bottom: 8px;
  border-radius: 8px;
  box-shadow: none;
}
.report--compact .vdi-box-title {
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 700;
}
.report--compact .vdi-box-content {
  padding: 12px;
}
/* Single-banner sections - tighter top but keep the bottom padding.
   The banner's own margin-bottom collapses via the :last-child rule
   below, so the container has to carry the bottom breathing room or
   the banner crashes into the outer card frame. */
.report--compact .vdi-box-content:has(> .ved-status-banner:only-child) {
  padding: 8px 12px;
}

/* Report fields — reduced padding and font */
.report--compact .report-field {
  gap: 3px;
  padding: 4px 0;
}
.report--compact .report-field__label {
  font-size: 0.68rem;
}
.report--compact .report-field__value {
  font-size: 0.82rem;
}
.report--compact .report-field__prefix,
.report--compact .report-field__suffix {
  font-size: 0.72rem;
}

/* Field grids — tighter gaps */
.report--compact .report-field-grid {
  gap: 2px 12px;
}

/* Subsection titles */
.report--compact .report-subsection-title {
  font-size: 0.8rem;
  padding: 6px 0 4px;
  margin-top: 4px;
}
.report--compact .report-subsection-title--first {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}
.report--compact .report-item-divider {
  margin-top: 8px;
  padding-top: 8px;
}

/* Status banners — tighter */
.report--compact .ved-status-banner {
  padding: 8px 12px;
  gap: 8px;
  margin-bottom: 8px;
  border-radius: 6px;
}
.report--compact .ved-status-banner:last-child {
  margin-bottom: 0;
}
.report--compact .ved-status-banner__title {
  font-size: 0.82rem;
}
.report--compact .ved-status-banner__detail {
  font-size: 0.75rem;
}
.report--compact .ved-rate-card__info-banner {
  padding: 8px 12px;
  gap: 6px;
  font-size: 0.75rem;
  margin-bottom: 4px;
}

/* Flag banners */
.report--compact .flag-banner {
  padding: 8px 12px;
  gap: 8px;
  margin-bottom: 6px;
}

/* At a Glance — tighter pills grid */
.report--compact .at-a-glance__grid {
  gap: 6px;
}

/* Data tables */
.report--compact .data-table th {
  padding: 6px 8px;
  font-size: 0.72rem;
}
.report--compact .data-table td {
  padding: 6px 8px;
  font-size: 0.8rem;
}

/* MOT status cards */
.report--compact .mot-status-cards {
  gap: 8px;
  margin: 8px 0;
}
.report--compact .mot-status-card {
  padding: 10px 12px;
}
.report--compact .mot-status-card__label {
  font-size: 0.7rem;
}
.report--compact .mot-status-card__value {
  font-size: 1rem;
}

/* MOT accordions */
.report--compact .mot-accordion {
  margin-bottom: 4px;
}
.report--compact .mot-accordion__header {
  padding: 8px 12px;
  gap: 8px;
}
.report--compact .mot-accordion__date {
  font-size: 0.8rem;
}
.report--compact .mot-accordion__badge {
  font-size: 0.68rem;
  width: 52px;
  padding: 2px 0;
}
.report--compact .mot-accordion__summary {
  font-size: 0.72rem;
}
.report--compact .mot-accordion[open] .mot-accordion__body {
  padding: 10px 12px;
}
.report--compact .mot-annotation-group {
  padding: 8px 12px;
  margin-top: 8px;
}
.report--compact .mot-annotation-group__title {
  font-size: 0.78rem;
  margin-bottom: 6px;
}
.report--compact .mot-annotation__badge {
  font-size: 0.62rem;
  padding: 2px 6px;
}
.report--compact .mot-annotation__text {
  font-size: 0.78rem;
}

/* MOT extension */
.report--compact .mot-extension__header {
  font-size: 0.78rem;
  padding: 6px 12px;
}
.report--compact .mot-extension .report-field-grid {
  padding: 10px 12px;
}

/* MOT toolbar */
.report--compact .mot-toolbar {
  margin-bottom: 4px;
}
.report--compact .mot-toolbar__hint {
  font-size: 0.68rem;
}

/* Mileage stats cards */
.report--compact .mileage-stats {
  gap: 8px;
  margin-bottom: 10px;
}
.report--compact .mileage-stat {
  padding: 10px 12px;
}
.report--compact .mileage-stat__label {
  font-size: 0.7rem;
}
.report--compact .mileage-stat__value {
  font-size: 1rem;
}

/* Mileage chart */
.report--compact .mileage-chart-wrap {
  min-height: 200px;
}

/* Equipment accordions */
.report--compact .equip-accordion {
  margin-bottom: 4px;
}
.report--compact .equip-accordion__summary {
  padding: 7px 12px;
  font-size: 0.75rem;
}
.report--compact .equip-accordion__body {
  padding: 8px 12px;
}
.report--compact .equip-grid {
  gap: 4px;
}
.report--compact .equip-item {
  font-size: 0.78rem;
  padding: 4px 8px;
}

/* Your Notes */
.report--compact .notes-form { gap: 10px; }
.report--compact .notes-field__label { font-size: 0.75rem; }
.report--compact .notes-field__counter { font-size: 0.65rem; }
.report--compact .notes-field__input { padding: 8px 10px; font-size: 0.8rem; }
.report--compact .notes-field__input--textarea { min-height: 60px; }
.report--compact .notes-submit { padding: 6px 16px; font-size: 0.78rem; max-width: 260px; }

/* Finance cards */
.report--compact .finance-card {
  padding: 12px;
}

/* NCAP ratings */
.report--compact .ncap-rating {
  padding: 10px 12px;
}

/* Damage diagram + rows */
.report--compact .damage-container {
  max-width: 480px;
  padding: 16px;
}
.report--compact .damage-row {
  padding: 8px 12px;
}

/* Hide/show damage diagram via settings toggle */
.report-content:not(.report--damage-view) .damage-container {
  display: none;
}

/* Report field cards (e.g. charge ports) */
.report--compact .report-field-card {
  padding: 6px 10px;
}

/* VDI Valuations */
.report--compact .valuation-panel {
  padding: 8px 10px;
}
.report--compact .valuation-panel__label {
  font-size: 0.7rem;
  margin-bottom: 3px;
}
.report--compact .valuation-panel__value {
  font-size: 1.1rem;
}
.report--compact .valuation-grid .report-field__value {
  font-size: 1rem;
}

/* VED rate cards / inner cards (Tesla, Taxi, etc.) */
.report--compact .ved-rate-card {
  padding: 10px;
  margin-top: 6px;
}
.report--compact .ved-rate-card .report-subsection-title {
  padding: 0 0 4px;
  margin-top: 0;
  border-top: none;
}

/* Inline fields (e.g. "Tesla Supercharger Compatible") */
.report--compact .report-field-inline {
  padding: 2px 0;
}

/* CO2 chart + bars — reduced height */
.report--compact .co2-chart {
  padding: 10px;
  --co2-bar-height-desktop: 34px;
  --co2-bar-height-tablet: 30px;
  --co2-bar-height-mobile: 26px;
}

/* VRM plates — pill-sized in compact (matches MOT badge scale) */
.report--compact .plate-grid-vrm {
  font-size: 0.7rem;
  min-width: auto;
  padding: 3px 8px;
}
.report--compact .plate-grid-card {
  padding: 2px 4px;
}
.report--compact .plate-grid-item {
  padding: 2px 0;
}
/* Table VRM plates in compact (Plate Transfer History) */
.report--compact .data-table .uk-plate-sm {
  font-size: 0.8rem;
  padding: 6px 8px;
  min-width: 76px;
}

/* V5C Logbook — smaller reference image */
.report--compact .v5c-reference__img {
  max-width: 180px;
}

/* At a Glance — reduced sizes */
.report--compact .at-a-glance__hero {
  min-height: 120px;
  margin-bottom: 6px;
}
.report--compact .at-a-glance__image {
  max-width: 240px;
}
.report--compact .at-a-glance__logo {
  max-width: 90px;
  max-height: 70px;
}
.report--compact .at-a-glance__info {
  top: 100px;
}
.report--compact .at-a-glance__field {
  margin-bottom: 4px;
}
.report--compact .at-a-glance__field-label {
  font-size: 0.58rem;
}
.report--compact .at-a-glance__field-value {
  font-size: 0.82rem;
}
/* VRM plate smaller */
.report--compact .at-a-glance__header .uk-plate {
  font-size: 1.1rem;
  padding: 4px 14px;
  min-width: 120px;
}
/* Glance pills — compact */
.report--compact .at-a-glance__cell {
  height: 36px;
  border-radius: 6px;
}
.report--compact .at-a-glance__cell-label {
  font-size: 0.58rem;
  padding: 3px 6px;
}
.report--compact .at-a-glance__cell-value {
  font-size: 0.62rem;
  padding: 3px 6px;
}
.report--compact .at-a-glance__cell-value-lg {
  font-size: 0.78rem;
}
.report--compact .at-a-glance__footer {
  padding-top: 0;
  margin-top: 8px;
}
.report--compact .at-a-glance__header .plate-grid-vrm {
  font-size: 1rem;
}
/* Compact: swap separate Make/Model for combined */
.report--compact .at-a-glance__field--make,
.report--compact .at-a-glance__field--model {
  display: none;
}
@media (min-width: 621px) {
  .report--compact .at-a-glance__field--combined {
    display: flex;
  }
}
.report--compact .at-a-glance__meta--separate {
  display: none;
}
.report--compact .at-a-glance__meta--combined {
  display: flex;
}
.report--compact .dvla-make-model__separate {
  display: none;
}
.report--compact .dvla-make-model__combined {
  display: flex;
}

/* Flag banners — smaller sub text */
.report--compact .flag-banner-icon {
  font-size: 1.1rem;
}
.report--compact .flag-banner-title {
  font-size: 0.78rem;
}
.report--compact .flag-banner-detail {
  font-size: 0.72rem;
}

/* NCAP percentage values */
.report--compact .ncap-card__value {
  font-size: 1.1rem;
}
.report--compact .ncap-card__label {
  font-size: 0.68rem;
}

/* Extra Large: ≥ 1536px */
@media (min-width: 1536px) {
  :root { --sidebar-width: 280px; }
  .app-main { padding: var(--space-12); }
  .section-inner, .footer-inner, .public-nav, .hero-inner { max-width: 1440px; }
}

/* ============================================================
   Permission Denied Panel — slots into the quick-report grid
   in place of PremiumUpgradeCta when the user lacks permission.
   ============================================================ */
.permission-denied-panel__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 24px 16px;
}

.permission-denied-panel__icon {
    font-size: 2.5rem;
    color: var(--color-warning);
    line-height: 1;
}

.permission-denied-panel__message {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.permission-denied-panel__hint {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.85;
}


/* ============================================================
   Terms Banner — sticky soft warning shown across all auth
   pages when a logged-in user has not accepted the current
   Terms & Conditions version (see TermsService.NeedsReAcceptance).
   ============================================================ */
/* Matches the .low-balance-banner pattern: soft tinted background,
   1px subtle border on three sides, 4px strong accent on the left,
   icon top-aligned with the title text (via align-items: flex-start
   + a tiny margin-top on the icon). All status banners across the
   project should follow this shape so they read consistently. */
.terms-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
    padding: 14px 18px;
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning-border);
    border-left: 4px solid var(--color-warning);
    border-radius: 8px;
    color: var(--color-text);
}

/* Spacing wrapper between AuthHeader and the page body when the banner shows. */
.terms-banner-wrap {
    padding-top: 0;
}

.terms-banner__icon {
    font-size: 1.25rem;
    color: var(--color-warning);
    flex-shrink: 0;
    margin-top: 1px;
}

.terms-banner__content {
    flex: 1;
    min-width: 0;
}

.terms-banner__title {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.terms-banner__message {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text);
    line-height: 1.5;
}

.terms-banner__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    align-self: center;
}

.terms-banner__btn {
    font-size: 0.875rem;
    line-height: 1.2;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
}

/* Review Terms uses the banner's amber accent in both themes so it
   reads as "part of the banner" rather than competing with the page
   chrome. The amber tokens are theme-tuned (mustard in light, bright
   amber in dark) so contrast remains correct. */
.terms-banner__btn--outline {
    background: transparent;
    color: var(--color-warning);
    border-color: var(--color-warning);
}

.terms-banner__btn--outline:hover {
    background: var(--color-warning);
    color: var(--color-bg);
}

@media (max-width: 640px) {
    .terms-banner {
        flex-wrap: wrap;
    }
    .terms-banner__actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ============================================================
   Impersonation Banner — full-width strip above the auth header
   while a Lobby staff member is signed in as a customer. Danger
   palette so it cannot be mistaken for an ordinary notice; the
   inner row reuses the terms-banner layout.
   ============================================================ */
.impersonation-banner {
    background: var(--color-danger-bg);
    border-bottom: 3px solid var(--color-danger);
    color: var(--color-text);
}

.impersonation-banner__inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 18px;
}

.impersonation-banner__icon {
    font-size: 1.25rem;
    color: var(--color-danger);
    flex-shrink: 0;
    margin-top: 1px;
}

.impersonation-banner__content {
    flex: 1;
    min-width: 0;
}

.impersonation-banner__title {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-danger);
    margin-bottom: 4px;
}

.impersonation-banner__message {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.impersonation-banner__actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    align-self: center;
}

.impersonation-banner__btn {
    font-size: 0.875rem;
    line-height: 1.2;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--color-danger);
    background: transparent;
    color: var(--color-danger);
    cursor: pointer;
    font-weight: 600;
}

.impersonation-banner__btn:hover:not(:disabled) {
    background: var(--color-danger);
    color: var(--color-bg);
}

.impersonation-banner__btn:disabled {
    opacity: 0.6;
    cursor: default;
}

@media (max-width: 640px) {
    .impersonation-banner__inner {
        flex-wrap: wrap;
    }
    .impersonation-banner__actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media print {
    .impersonation-banner { display: none !important; }
}

/* ----------------------------------------------------------------
   Impersonation mode chrome - the red auth-header border and the
   corner eye-icon only appear once the top Support-session banner
   has scrolled off screen. A JS IntersectionObserver (vdi.watch
   ImpersonationBanner) toggles .impersonation-banner-off on body;
   while the banner is visible, both the border and the indicator
   stay hidden so the chrome isn't duplicated.
   ---------------------------------------------------------------- */
.auth-header--impersonating {
    border-bottom: 4px solid transparent;
    transition: border-bottom-color 0.2s ease;
}
body.impersonation-banner-off .auth-header--impersonating {
    border-bottom-color: var(--color-impersonation-chrome);
}

.impersonation-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 2;
    display: none;
}
body.impersonation-banner-off .impersonation-indicator {
    display: block;
}
.impersonation-indicator__btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-impersonation-chrome);
    color: #ffffff;
    border: none;
    border-top-right-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    box-shadow: var(--shadow-sm);
    transition: background 0.15s ease;
}
.impersonation-indicator__btn:hover,
.impersonation-indicator--open .impersonation-indicator__btn {
    background: #b91c1c;
}
.impersonation-indicator__popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 280px;
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-danger);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    padding: 12px 14px;
    font-size: 0.85rem;
    line-height: 1.4;
}
.impersonation-indicator__popover-title {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-danger);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.impersonation-indicator__popover-body > div { margin-bottom: 2px; }
.impersonation-indicator__popover-sub {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}
.impersonation-indicator__popover-actions {
    margin-top: 10px;
    text-align: right;
}
.impersonation-indicator__popover-btn {
    font-size: 0.85rem;
    line-height: 1.2;
    padding: 7px 14px;
    border-radius: 6px;
    border: 1px solid var(--color-danger);
    background: transparent;
    color: var(--color-danger);
    cursor: pointer;
    font-weight: 600;
}
.impersonation-indicator__popover-btn:hover:not(:disabled) {
    background: var(--color-danger);
    color: #ffffff;
}
.impersonation-indicator__popover-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

@media print {
    .impersonation-indicator { display: none !important; }
    .auth-header--impersonating { border-bottom-color: transparent !important; }
}

/* ============================================================
   Terms Modal — iframes /terms-embed inside a modal so the
   user can read the latest Terms & Conditions without leaving
   the WASM SPA.
   ============================================================ */
.terms-modal__body {
    padding: 0;
}

.terms-modal__iframe {
    display: block;
    width: 100%;
    height: 70vh;
    border: none;
    background: var(--color-bg, #fff);
}

/* Dark header so the modal-title is visually grounded against the
   iframe content. Token resolves to dark slate in light mode and
   near-black in dark mode — both pair correctly with white text. */
.terms-modal .modal-header {
    background: var(--color-primary);
    color: #fff;
    border-bottom: none;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.terms-modal .modal-title {
    color: #fff;
}

.terms-modal .modal-close {
    color: #fff;
}

.terms-modal .modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

/* Footer: checkbox on the left, button group on the right. The bg
   visually separates the footer from the modal body so the user
   reads "this is the end of the document, here are the actions".
   Light: light grey (--color-border #e2e8f0 vs body's white surface).
   Dark:  matches the header (--color-primary) to bookend the modal. */
.terms-modal__footer {
    background: var(--color-border);
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
}

[data-theme="dark"] .terms-modal__footer {
    background: var(--color-primary);
}

/* Light mode: the default Close (.cta-button--gray) is #eaeaea, almost
   the same shade as the new light-grey footer. Lift it to surface
   (white) so it reads cleanly against the footer. Dark mode keeps the
   default Close bg — already contrasts with the near-black footer. */
[data-theme="light"] .terms-modal__footer .cta-button--gray {
    background-color: var(--color-surface);
}

/* TermsModal checkbox uses the shared .vdi-checkbox primitive defined
   in section "Form Primitives" below. Nothing terms-specific here. */

.terms-modal__footer-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-left: auto;
}

/* ============================================================
   FORM PRIMITIVES — reusable across the project. New form
   patterns should pick these up rather than reinventing.

   .vdi-checkbox — styled, accessible, keyboard-focusable checkbox.
   Pattern:
     <label class="vdi-checkbox">
         <input type="checkbox" class="vdi-checkbox__input" />
         <span class="vdi-checkbox__box"></span>
         <span>Label text</span>
     </label>
   The native input stays in the DOM (focusable, screen-reader
   accessible) but is visually hidden; the .__box is the visible
   target. Sibling combinators sync the visual to input state.
   ============================================================ */
.vdi-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 0.9375rem;
    color: var(--color-text);
    line-height: 1.4;
}

/* Native input — visually hidden but focusable + accessible. */
.vdi-checkbox__input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Visible box. position:relative anchors the ::after tick so
   it doesn't push flex-line metrics around on tick-in/tick-out,
   which was causing a ~1-2px Y jitter on the label when the
   user toggled the checkbox. */
.vdi-checkbox__box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border: 2px solid var(--color-border-dark);
    border-radius: 4px;
    background: var(--color-surface);
    transition: background-color 0.15s, border-color 0.15s;
    position: relative;
}

/* Checked — blue fill + white tick drawn via a rotated rectangle
   (no SVG so the primitive stays single-file). Blue (info) reads
   as "selected state", reserving green (success) for go/submit
   buttons — keeps the visual language for actions vs selections
   distinct across the project. */
.vdi-checkbox__input:checked + .vdi-checkbox__box {
    background: var(--color-info);
    border-color: var(--color-info);
}

.vdi-checkbox__input:checked + .vdi-checkbox__box::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

/* Keyboard focus ring. */
.vdi-checkbox__input:focus-visible + .vdi-checkbox__box {
    outline: 2px solid var(--color-info);
    outline-offset: 2px;
}

/* Hover hint on the box (only when interactive). */
.vdi-checkbox:hover .vdi-checkbox__input:not(:disabled):not(:checked) + .vdi-checkbox__box {
    border-color: var(--color-text-muted);
}

/* Disabled — dim the box and label, switch to not-allowed cursor. */
.vdi-checkbox:has(.vdi-checkbox__input:disabled) {
    cursor: not-allowed;
}

.vdi-checkbox__input:disabled + .vdi-checkbox__box,
.vdi-checkbox__input:disabled + .vdi-checkbox__box + * {
    opacity: 0.5;
}

/* ============================================================
   ACTIVE FILTERS strip + filter chips — shown above any filtered
   table when one or more filters are applied. Each chip is a
   single-filter clear button; the strip also has a "Clear all"
   shortcut. Reusable for any other filterable table.
   ============================================================ */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 12px 0 16px;
    padding: 10px 12px;
    background: var(--color-info-bg);
    border: 1px solid var(--color-info-border);
    border-left: 4px solid var(--color-info);
    border-radius: 6px;
}

.active-filters__label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-info);
    margin-right: 4px;
}

.active-filters__clear-all {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--color-info);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.active-filters__clear-all:hover {
    color: var(--color-link-hover);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 10px;
    background: var(--color-surface);
    border: 1px solid var(--color-info-border);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.filter-chip:hover {
    background: var(--color-info-bg);
    border-color: var(--color-info);
}

.filter-chip__value {
    font-weight: 500;
}

.filter-chip__x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: var(--color-bg);
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1;
}

.filter-chip:hover .filter-chip__x {
    background: var(--color-info);
    color: #fff;
}

/* ============================================================
   QUICK SEARCH wrapper — relative-positioned so the inline
   clear (×) button can sit at the right edge of the input.
   Picks up on any "search box with clear" pattern.
   ============================================================ */
.quick-search {
    position: relative;
    display: flex;
}

.quick-search__input {
    width: 100%;
    padding-right: 32px;
}

.quick-search__clear {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.quick-search__clear:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

/* History page empty-state — gives the messaging more vertical room
   so the "Clear filters" CTA reads as a meaningful action. */
.history-empty-state { padding: 32px 16px; }
.history-empty-state p { margin: 0 0 8px; }
.history-empty-state__hint {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-bottom: 16px !important;
}

/* ============================================================
   Account Settings page (/account). Layout-only — relies on
   existing primitives (vdi-box, input-icon, alert-banner,
   terms-version). Error styling + interactive states are
   appended in later tasks.
   ============================================================ */
.account-page__heading-wrap        { margin-bottom: 24px; }
.account-page__title               { font-weight: 300; }
.account-page__title strong        { font-weight: 700; }
.account-page__company-hint        { margin-bottom: 20px; }
.account-page__company-hint-icon   { margin-right: 8px; font-size: 1rem; }
.account-page__card                { margin-bottom: 24px; }
.account-form__row                 { margin-bottom: 16px; }
.account-form__field               { margin-bottom: 18px; }
.account-form__label               { font-weight: 500; padding-top: 0; margin-bottom: 6px; display: block; text-align: left; color: var(--color-text); }
.account-form__required            { color: var(--color-danger); }
.account-form__readonly            { opacity: 0.7; cursor: not-allowed; }
.account-page__terms-link-wrap     { margin-top: 20px; display: flex; justify-content: center; }
.account-page__terms-icon         { margin-right: 6px; color: var(--color-accent); }
.account-page__save-wrap           { text-align: center; }
.account-page__save-btn            { min-width: 300px; padding: 14px 30px; }

/* Inline field error — rendered below an input when ValidateForm sets
   the corresponding error string. Reads as soft warning text. */
.account-form__error {
    color: var(--color-danger);
    font-size: 0.8rem;
    margin-top: 4px;
}
/* Accept-form terms row - the .vdi-checkbox label is inline-flex, so
   a sibling <span> error would render on the same line as the terms
   link. Force the error to break to its own line beneath the label. */
.accept-form__terms .vdi-checkbox { display: flex; }
.accept-form__terms-error {
    display: block;
    margin-top: 6px;
}

/* The terms-version link is rendered as a <button> so it can fire an
   @onclick handler that opens the modal. Strip the default button
   chrome so it visually reads as the existing .terms-version pill. */
.account-page__terms-link {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    font: inherit;
    color: inherit;
}

.account-page__terms-link-icon {
    margin-left: 6px;
    font-size: 0.75rem;
}

/* ============================================================
   Manage Users page — permission marker cell.
   Lifted directly from mock/css/app.css to match the mock's
   visual: just an icon (green check / muted minus), no
   circular background tint.
   ============================================================ */
/* Duplicate .perm-cell / .perm-check block removed — the primary
   definition higher up now uses .data-table td.perm-cell for
   specificity, and there's no reason to keep two copies. */

/* ============================================================
   Manage Users — user row name cell + edit button.
   Mirrors mock/css/app.css. The <button> element gets a small
   chrome reset (background/border/padding) so it visually
   matches the mock's <a> styling without changing semantics.
   ============================================================ */
.user-row-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    /* Button-element reset so the <button> matches the mock's <a>. */
    background: transparent;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
    cursor: pointer;
}

.user-row-name:hover {
    color: var(--color-text);
}

.user-row-name__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-info-bg);
    color: var(--color-link);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.user-row-name--owner .user-row-name__avatar {
    background: var(--color-accent-light);
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
}

/* Hover tooltip — dark popover with white text and a small arrow,
   per the mock. Toggled via display: none → block on hover/focus. */
.user-row-name__tip {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    z-index: 50;
    background: var(--color-primary-dark);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    line-height: 1.4;
    white-space: normal;
    min-width: 240px;
    max-width: 320px;
}

.user-row-name__tip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 14px;
    border: 6px solid transparent;
    border-bottom-color: var(--color-primary-dark);
}

.user-row-name:hover .user-row-name__tip,
.user-row-name:focus-visible .user-row-name__tip {
    display: block;
}

.user-row-edit-cell {
    text-align: center;
}

/* Edit button — pencil / lock variants. Lifted from the mock. */
.table-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.table-action-btn:hover:not(:disabled),
.table-action-btn:focus-visible:not(:disabled) {
    border-color: var(--color-link);
    color: var(--color-link);
    background: var(--color-bg);
    outline: none;
}

/* Lock variant — warning palette on hover per mock. */
.table-action-btn--locked {
    color: var(--color-text-muted);
}

.table-action-btn--locked:hover:not(:disabled) {
    border-color: var(--color-warning-border);
    color: var(--color-warning);
    background: var(--color-warning-bg);
}

.table-action-btn--locked:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   Manage Users — let the Owner-row tooltip escape the table
   without being clipped. Scoped to .users-page__card so other
   .vdi-box cards across the app keep their overflow:hidden
   rounded-corner masks intact. The card chrome itself (title +
   rounded edges) is unaffected because the table is the only
   content needing to overflow.
   ============================================================ */
.users-page__card,
.users-page__card .vdi-box-content,
.users-table-scroll {
    overflow: visible;
}

/* Disabled user - the account cannot sign in. Name + permission
   surfaces (desktop tick cells, mobile pill strip) read at reduced
   emphasis; a small neutral-grey "Disabled" chip trails the label.
   Applied inside the button so it works on desktop AND under the
   mobile card layout without any per-surface duplication. */
.user-row-name__label { display: inline-block; }
.user-row--disabled .user-row-name__label,
.user-row--disabled .user-row-name__avatar,
.user-row--disabled .perm-cell,
.user-row--disabled .user-row-mobile__pill { opacity: 0.55; }
.user-row-name__badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    margin-left: 4px;
    border-radius: 999px;
    background: var(--color-danger, #dc2626);
    color: #ffffff;
    border: 1px solid var(--color-danger, #dc2626);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.2;
    white-space: nowrap;
}
/* Avatar tint for a disabled user - subtle red wash so the icon
   reads consistently with the DISABLED chip. */
.user-row--disabled .user-row-name__avatar {
    background: rgba(220, 38, 38, 0.12);
    color: var(--color-danger, #dc2626);
}
/* "You" marker — green avatar tint + success-coloured pill so the
   logged-in user's own row jumps out in a crowded list. Wins over the
   Owner accent tint when the viewer is also the Owner. */
.user-row-name--self .user-row-name__avatar {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
}
.user-row-name__badge--self {
    background: var(--color-success-bg);
    color: var(--color-success);
    border-color: var(--color-success-border);
}

/* ============================================================
   Manage Users page — toolbar + table layout.
   ============================================================ */
.users-page__heading-wrap {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap; /* Invite CTA stays end-aligned even on narrow viewports */
}
.users-page__heading-text {
    min-width: 0;
    flex: 1 1 auto;
}
.users-page__heading-text .page-title,
.users-page__heading-text .page-subtitle { margin: 0; }
.users-page__heading-text .page-subtitle { margin-top: 4px; }
.users-page__title          { font-weight: 300; }
.users-page__title strong   { font-weight: 700; }
.users-page__card           { margin-bottom: 24px; }
.users-page__invite-btn {
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: center;
}
.users-page__invite-btn i { margin-right: 6px; }

/* On very narrow phones let the CTA collapse to icon-only so the text
   heading never gets crushed. */
@media (max-width: 420px) {
    .users-page__invite-btn { padding: 8px 12px; font-size: 0.85rem; }
    .users-page__invite-btn__label { display: none; }
    .users-page__invite-btn i { margin-right: 0; }
}

/* Full-row / full-card hover so the whole tr darkens, not just the
   name button. Applies to both the Users table and the Pending
   Invites table; the button retains its own subtle emphasis but no
   longer paints alone. */
.users-table-scroll .data-table tbody tr:hover,
.pending-invites__table tbody tr:hover {
    background: var(--color-surface-alt, rgba(0, 0, 0, 0.03));
}

.users-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

/* Toolbar hosts a single control group. Keep the three parts
   (label + select + label) huddled together with a tight gap so it
   reads as one "Display N Users per Page" phrase, not three columns.
   The select gets a fixed width so it never stretches the row. */
.users-toolbar__group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.users-toolbar__group .table-filter-input {
    width: auto;
    min-width: 64px;
    flex: 0 0 auto;
}

.users-toolbar__label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.users-toolbar__add-btn {
    border-radius: 8px;
    padding: 7px 20px;
    font-size: 0.85rem;
    line-height: 1.4;
    height: 36px;
}

.users-toolbar__add-btn i {
    margin-right: 4px;
}

/* Specificity lifted to (0,2,1) so it beats the base .data-table th
   rule at (0,1,1) which otherwise pins the header to left. */
.data-table th.users-th--centered { text-align: center; }

/* .users-table-scroll no longer sets overflow-x — the earlier scoped
   override (search for "Manage Users — let the Owner-row tooltip escape")
   needs overflow: visible to win, and a later overflow-x: auto here
   would re-clip the tooltip vertically (browsers force overflow-y to
   auto when overflow-x is auto). The wrapper element is kept for
   structural parity with the History page in case we later add a
   different horizontal-scroll strategy on narrow viewports. */

.users-page__pagination { margin-top: 16px; }

/* ============================================================
   Edit User drawer — footer + save button.
   .drawer-overlay / .drawer / .drawer--wide / .drawer__row /
   .drawer__perm-card / .settings-row primitives already live in
   the SLIDE-OUT DRAWER block above (introduced with History's
   Advanced Search and the Manage Users foundation). This block
   only adds what's unique to the Edit User drawer footer.
   ============================================================ */
.drawer__footer--centered {
    justify-content: center;
}

.edit-user-drawer__save {
    background: var(--color-accent);
    padding: 12px 48px;
    font-size: 0.9rem;
    font-weight: 600;
    max-width: 340px;
    width: 100%;
}

/* ============================================================
   Owner Security drawer — info banner + 2FA card + reenrol button.
   ============================================================ */
.owner-security__info {
    background: var(--color-info-bg);
    border: 1px solid var(--color-info-border);
    color: var(--color-info);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.owner-security__info-icon {
    margin-top: 2px;
    flex-shrink: 0;
}

.owner-security__card {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 18px;
    background: var(--color-bg);
}

.owner-security__2fa-row {
    margin-bottom: 12px;
}

.owner-security__reenrol-btn {
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 0.8rem;
}
/* Full-width variant used on the Owner Security drawer — button sits
   inside the 2FA card under the toggle row, stretched edge-to-edge. */
.owner-security__reenrol-btn--full {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 12px 18px;
    font-size: 0.85rem;
    margin-top: 12px;
}

.owner-security__reenrol-icon {
    margin-right: 4px;
}


/* ============================================================
   Account Settings — Security card. Reuses .owner-security__*
   primitives from T7 plus a couple of card-specific tweaks.
   ============================================================ */
.account-security__save-wrap {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.account-security__save-btn {
    padding: 10px 24px;
    font-size: 0.9rem;
}

/* Change Password section row - heading text on the left owns the
   remaining width, CTA sits end-aligned inline. Only wraps on very
   narrow phones where a full-width button reads better than a
   crushed heading. */
.account-security__section-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    margin-bottom: 8px;
    flex-wrap: nowrap;
}
.account-security__section-text {
    flex: 1 1 auto;
    min-width: 0;
}
.account-security__section-btn {
    flex: 0 0 auto;
    padding: 10px 22px;
    font-size: 0.9rem;
    border-radius: 8px;
    white-space: nowrap;
}
@media (max-width: 480px) {
    .account-security__section-row { flex-wrap: wrap; }
    .account-security__section-btn { width: 100%; }
}

/* 2FA description above the row, followed by the toggle + enrol/re-enrol
   button on one line. Toggle group hugs left; button justified to the end. */
.account-security__2fa-desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0 0 14px;
}
.account-security__2fa-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.account-security__2fa-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.account-security__2fa-toggle .settings-row__label {
    margin: 0;
}

/* Step E3: when the master Branding toggle is off, grey out the four
   editable cards below and block interaction. The .branding-disabled-overlay
   div on top renders the lock-icon message centred above them. */
.branding-sections--disabled .vdi-box {
    opacity: 0.45;
    pointer-events: none;
}

/* Step D2: disabled nav entries for unshipped sections */
.report-nav__item--disabled {
    cursor: not-allowed;
    opacity: 0.55;
    pointer-events: none;
}
.report-nav__pill {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 2px 8px;
    background: var(--color-bg);
    color: var(--color-text-muted);
    border-radius: 50px;
}
/* ---------- Trading Information - Manage page ---------- */

.tw-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tw-page-header__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* The base .cta-button--pill sets width: 90% for its usual full-width CTA
   use. Inside the page-header actions row it needs to size to content and
   never let its label wrap onto two lines. */
.tw-page-header__actions .cta-button--pill {
    width: auto;
    white-space: nowrap;
}

/* Intro panel above the field list — explains what Trading Information is
   for and hints at the core actions (Add, drag-reorder, Pin). */
.tw-intro {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-accent);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.tw-intro__icon {
    color: var(--color-accent);
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.tw-intro__body { flex: 1; }
.tw-intro__title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 8px;
}
.tw-intro__body p {
    margin: 0 0 8px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}
.tw-intro__body p:last-child { margin-bottom: 0; }

.tw-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Small hint below the field list telling the user the drag handle on each
   row is interactive. Sits between the list and the Report Preview panel. */
.tw-list-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 6px 12px;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-style: italic;
}
.tw-list-hint i { font-size: 0.95rem; }

.tw-list__loading {
    padding: 32px;
    text-align: center;
    color: var(--color-text-muted);
}

.tw-list-row {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.tw-list-row:hover {
    background: var(--color-surface);
    border-color: var(--color-border-dark);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.tw-list-row__handle {
    background: transparent;
    border: none;
    cursor: grab;
    color: var(--color-text-muted);
    padding: 4px;
    font-size: 1.1rem;
}

.tw-list-row__handle:disabled { cursor: not-allowed; opacity: 0.4; }

.tw-list-row__label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--color-text);
    font-weight: 500;
}

.tw-list-row__actions { display: flex; gap: 4px; }

.tw-list-row__action {
    background: transparent;
    border: none;
    padding: 6px 8px;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 4px;
}

.tw-list-row__action:hover:not(:disabled) { background: var(--color-bg-hover, var(--color-bg)); color: var(--color-text); }
.tw-list-row__action:disabled { cursor: not-allowed; opacity: 0.4; }
.tw-list-row__action--danger:hover:not(:disabled) { color: var(--color-danger); }

.tw-datatype-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--color-bg-muted, rgba(0,0,0,0.05));
    color: var(--color-text-muted);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tw-datatype-pill--pinned {
    background: var(--color-accent-light, rgba(255,180,0,0.15));
    color: var(--color-accent);
}

/* Char count sits inline inside the type pill (e.g. "URL · 45 / 512") —
   subtle separator + slightly lighter tone so the type label still leads. */
.tw-datatype-pill__count {
    position: relative;
    padding-left: 6px;
    margin-left: 2px;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
    opacity: 0.85;
}
.tw-datatype-pill__count::before {
    content: "·";
    position: absolute;
    left: 0;
    opacity: 0.6;
}

.tw-drop-target-above { border-top: 2px solid var(--color-accent) !important; }
.tw-drop-target-below { border-bottom: 2px solid var(--color-accent) !important; }

.tw-edit-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    margin-top: -8px;
    margin-bottom: 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tw-edit-form__field { display: flex; flex-direction: column; gap: 4px; }
.tw-edit-form__label { font-weight: 500; font-size: 0.85rem; color: var(--color-text); }
.tw-edit-form__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.tw-list-row--editing { border-radius: 8px 8px 0 0; }

/* Label + Data Type share a row on desktop, stack on mobile. */
.tw-edit-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 640px) {
    .tw-edit-form__row { grid-template-columns: 1fr; }
}

/* ---------- Trading Information — Report preview panel ---------- */

.tw-preview {
    margin-top: 24px;
}

.tw-preview__intro {
    margin: 0 0 16px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.tw-preview__empty {
    padding: 24px 8px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    background: var(--color-bg);
    border: 1px dashed var(--color-border);
    border-radius: 6px;
}

.tw-preview__band + .tw-preview__band {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--color-border);
}

.tw-preview__band-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--color-bg-muted, rgba(0, 0, 0, 0.04));
    color: var(--color-text-muted);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 12px;
}

.tw-preview__strip-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
@media (max-width: 1023px) { .tw-preview__strip-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 767px)  { .tw-preview__strip-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 479px)  { .tw-preview__strip-grid { grid-template-columns: 1fr; } }

.tw-preview__section-rows {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (max-width: 767px) { .tw-preview__section-rows { grid-template-columns: 1fr; } }

.tw-preview__cell,
.tw-preview__row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: var(--color-bg);
    border: 1px dashed var(--color-border);
    border-radius: 6px;
}
.tw-preview__cell--full,
.tw-preview__row--full { grid-column: 1 / -1; }

.tw-preview__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.tw-preview__value {
    color: var(--color-text-light);
    font-style: italic;
    word-break: break-word;
}

.tw-preview__cell--valuation .tw-preview__value,
.tw-preview__row--valuation .tw-preview__value {
    font-size: 1.25rem;
    font-weight: 800;
    font-style: normal;
    color: var(--color-text);
}

/* .input-icon__field reserves 55px of left padding for an icon we don't
   render inside the trading edit form — cancel that reservation so text
   isn't stranded in white space. */
.tw-edit-form .input-icon__field { padding: 0 16px; }
.tw-edit-form textarea.input-icon__field { padding: 12px 16px; }

/* ---------- Trading Information — Report strip ---------- */

/* Title-bar action button: the trading strip and Section 9 both put an
   Edit button INSIDE the dark .vdi-box-title bar, anchored to the right,
   without breaking the title's centred layout. The modifier turns the
   title into a positioned flex container; the ghost action button uses
   white outline styling to sit legibly on the dark bar. */
.vdi-box-title--with-action {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: var(--space-8);
    padding-right: var(--space-8);
}

.vdi-box-title__action {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 120ms ease;
}
.vdi-box-title__action:hover {
    background: rgba(255, 255, 255, 0.15);
}
.vdi-box-title__action i { font-size: 0.85rem; }

.trading-strip__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1023px) { .trading-strip__grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 767px)  { .trading-strip__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 479px)  { .trading-strip__grid { grid-template-columns: 1fr; } }

.trading-strip__cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Notes / URL / EmailAddress span the full grid row and get a wrapper card
   (subtle bg + border) so long-form content sits inside a visible frame,
   matching the Report Preview panel's aesthetic on /trading-information. */
.trading-strip__cell--full {
    grid-column: 1 / -1;
    padding: 12px 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.trading-strip__cell--valuation .trading-strip__value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-text);
}

.trading-strip__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.trading-strip__value {
    color: var(--color-text);
    word-break: break-word;
}

.trading-strip__value a { color: var(--color-link); text-decoration: underline; }

.trading-strip__add {
    background: transparent;
    border: 1px dashed var(--color-border-dark);
    border-radius: 6px;
    padding: 4px 10px;
    color: var(--color-link);
    cursor: pointer;
    font-size: 0.85rem;
    align-self: flex-start;
}

.trading-strip__add:hover {
    background: var(--color-bg-hover, var(--color-bg));
    border-color: var(--color-link);
}

/* ---------- Trading Information — Section 9 rework ---------- */

.trading-section__rows {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 767px) { .trading-section__rows { grid-template-columns: 1fr; } }

.trading-section__row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Notes / URL / EmailAddress span the full row and get a wrapper card, same
   shape as the pinned strip's full-width cell so the report reads consistently
   top-to-bottom. */
.trading-section__row--full {
    grid-column: 1 / -1;
    padding: 12px 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.trading-section__row--valuation .trading-strip__value {
    font-size: 1.25rem;
    font-weight: 800;
}

.trading-section__empty {
    padding: 24px 8px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ---------- Trading Information — Edit drawer (right-slide, blurred backdrop) ---------- */

/* Modelled on .report-settings: fixed to the right edge, translates in on open,
   backdrop uses backdrop-filter blur so the report is dimmed and softened
   underneath. Wider than the Settings drawer so multi-field editing has
   breathing room. */
.trading-drawer__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1200;
}
.trading-drawer__overlay.is-open { display: block; }

.trading-drawer {
    position: fixed;
    top: 0;
    right: -520px;
    width: 480px;
    max-width: 100vw;
    height: 100vh;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    box-shadow: var(--shadow-drawer);
    z-index: 1201;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.trading-drawer--open { right: 0; }

.trading-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}
.trading-drawer__title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}
.trading-drawer__close {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 120ms ease, background 120ms ease;
}
.trading-drawer__close:hover { color: var(--color-danger); }

.trading-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.trading-drawer__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}
.trading-drawer__field:last-child { border-bottom: none; padding-bottom: 0; }

.trading-drawer__label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.trading-drawer__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
}
.trading-drawer__pin {
    color: var(--color-accent);
    font-size: 0.85rem;
}

.trading-drawer__input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-input-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
textarea.trading-drawer__input { resize: vertical; line-height: 1.45; }
.trading-drawer__input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(69, 188, 74, 0.15);
}
.trading-drawer__input::placeholder { color: var(--color-text-light); }

/* Date + DateTime inputs open the browser's native calendar / time picker
   when clicked anywhere in the input (see onclick handler in the drawer).
   cursor: pointer signals the entire field is tappable, and the picker
   indicator icon on the right is bumped in opacity so it reads as a live
   control against both light and dark themes. */
.trading-drawer__input--picker { cursor: pointer; }
.trading-drawer__input--picker::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 4px;
    opacity: 0.75;
    font-size: 1.1rem;
    transition: opacity 120ms ease;
}
.trading-drawer__input--picker::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}
:root[data-theme="dark"] .trading-drawer__input--picker::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

.trading-drawer__yesno {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}
.trading-drawer__yesno-label {
    font-size: 0.9rem;
    color: var(--color-text);
}

.trading-drawer__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

/* Keep the Save button solid-green even in the disabled "no changes yet"
   state. The default outlined-green :disabled treatment reads as too weak
   against the drawer's white background - a dimmed solid pill is louder
   and still communicates the not-yet-clickable state via opacity. */
.trading-drawer__footer .cta-button--pill:disabled {
    background-color: var(--color-accent);
    color: #fff;
    border: none;
    padding: 10px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.55;
}
.trading-drawer__footer .cta-button--pill:disabled:hover {
    background-color: var(--color-accent);
    color: #fff;
}

/* Print - respect the "Include Trading Information on exports" setting.
   When the toggle is off, .report-content carries .report-exclude-trading
   (added by ReportSettingsService.ReportContentClasses) and the pinned
   strip + Section 9 are hidden from the printed page. */
@media print {
    .report-exclude-trading .trading-strip,
    .report-exclude-trading #section-trading-information {
        display: none !important;
    }
}

/* ============================================================
   Company Details form grid (/company-details).
   DOM order is the mobile stacking order; on desktop (>=768px)
   explicit grid-column/grid-row values arrange the 12 fields
   into a 2-column, 6-row layout without reordering the DOM.
   ============================================================ */
.company-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px 20px;
    margin-bottom: 12px;
}

.company-form-grid__field { min-width: 0; }

.company-form-grid__label {
    font-weight: 500;
    padding-top: 0;
    margin-bottom: 6px;
    display: block;
    text-align: left;
    color: var(--color-text);
}

@media (min-width: 768px) {
    .company-form-grid {
        grid-template-columns: 1fr 1fr;
        /* Roomier desktop rhythm - the 16px/20px mobile gap read as
           cramped once the layout switched to two columns. Row-gap
           carries the main weight because paired columns still stack
           six rows deep. */
        gap: 26px 28px;
    }

    /* Left column (top → bottom): Company Name, Addr1, Addr2, Addr3, Postcode, Company Reg */
    .company-form-grid__field--companyname    { grid-column: 1; grid-row: 1; }
    .company-form-grid__field--addr1          { grid-column: 1; grid-row: 2; }
    .company-form-grid__field--addr2          { grid-column: 1; grid-row: 3; }
    .company-form-grid__field--addr3          { grid-column: 1; grid-row: 4; }
    .company-form-grid__field--postcode       { grid-column: 1; grid-row: 5; }
    .company-form-grid__field--companyreg     { grid-column: 1; grid-row: 6; }

    /* Right column (top → bottom): Telephone, Fax, Web, Company Email, Billing Email, VAT */
    .company-form-grid__field--phone          { grid-column: 2; grid-row: 1; }
    .company-form-grid__field--fax            { grid-column: 2; grid-row: 2; }
    .company-form-grid__field--web            { grid-column: 2; grid-row: 3; }
    .company-form-grid__field--companyemail   { grid-column: 2; grid-row: 4; }
    .company-form-grid__field--billingemail   { grid-column: 2; grid-row: 5; }
    .company-form-grid__field--vat            { grid-column: 2; grid-row: 6; }
}

/* ============================================================
   Report ID modal - support-info dialog launched by the ReportBar
   pill. Prominent monospace ID with a copy button, then a
   picture (when available) alongside the vehicle specs.
   ============================================================ */
.report-id-modal__intro {
  margin: 0 0 14px;
  color: var(--color-text-muted);
  font-size: 0.88rem;
}
.report-id-modal__id-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 12px 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 16px;
}
.report-id-modal__id-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.report-id-modal__id-value {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text);
  overflow-wrap: anywhere;
}
.report-id-modal__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.report-id-modal__copy:hover,
.report-id-modal__copy:focus-visible {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
  outline: none;
}
.report-id-modal__copy i { font-size: 0.9rem; }

.report-id-modal__vehicle {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
}
/* Vehicle image sits centred, no card frame - the CDN images are
   PNGs on transparent background, so a border and bg tint just
   creates a floating box the eye reads as a container. */
.report-id-modal__image {
  align-self: center;
  max-width: 320px;
  width: 100%;
  text-align: center;
}
.report-id-modal__image img {
  max-width: 100%;
  height: auto;
  display: inline-block;
  background: transparent;
  border: 0;
}
.report-id-modal__info {
  min-width: 0;
  text-align: center;
}
.report-id-modal__plate-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  justify-content: center;
}
.report-id-modal__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 1.05rem;
  margin-bottom: 22px;
  justify-content: center;
}
.report-id-modal__title strong { font-weight: 700; }
.report-id-modal__title span { color: var(--color-text-muted); }
/* Specs.
   Mobile: both dl blocks collapse via display: contents so all six
   dt/dd pairs become direct children of one 2-column grid. Labels
   stack tight-left, values line up on a single vertical axis - no
   step change between the "top three" and "bottom three".
   Desktop (>=640px): each dl becomes its own mini-grid again and
   the pair sits centred in a flex row with a modest gap between
   them rather than being spread edge-to-edge. */
.report-id-modal__specs {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 16px;
  row-gap: 6px;
  align-items: baseline;
  margin: 0 auto;
  max-width: 340px;
  font-size: 0.9rem;
  text-align: left;
}
.report-id-modal__specs-col {
  display: contents;
  margin: 0;
}
.report-id-modal__specs-col dt {
  color: var(--color-text-muted);
  font-weight: 500;
}
.report-id-modal__specs-col dd {
  margin: 0;
  color: var(--color-text);
  font-weight: 600;
}
@media (min-width: 640px) {
  .report-id-modal__specs {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    max-width: 100%;
  }
  .report-id-modal__specs-col {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 16px;
    row-gap: 6px;
    align-items: baseline;
  }
}

/* ============================================================
   Export History (REQ-004).
   Shared ExportHistoryTable + ExportHistoryPanel — the body of
   /full-report/{id}/export-history and of the archived view a
   legacy lookup gets on /full-report. The table scrolls
   horizontally at phone width rather than breaking the layout.
   ============================================================ */
.export-history__scroll {
    overflow-x: visible;
    margin: 0 -4px 12px;
}
.export-history__table {
    width: 100%;
    font-size: 0.85rem;
}
/* Mobile-only card cell - hidden on desktop; the four data columns
   above carry the row. Flips visible under the 767px media rule. */
.export-history__mobile-cell { display: none; }

/* ============================================================
   Export History - mobile card layout.
   Below 768px each <tr class="export-history-row"> reflows to a
   stacked card and the mobile-only <td class="export-history__mobile-cell">
   carries the entire card body. Matches the Lookup History
   pattern - same breakpoint, same card frame + hover treatment.
   ============================================================ */
@media (max-width: 767px) {
    .export-history__table,
    .export-history__table tbody { display: block; }
    .export-history__table thead { display: none; }

    .export-history__table tr.export-history-row,
    .export-history__table tr.export-history-row:nth-child(even) {
        display: block;
        margin-bottom: 12px;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: 10px;
        transition: background-color 0.15s ease, border-color 0.15s ease;
    }
    .export-history__table tr.export-history-row:hover td {
        background: transparent;
    }
    .export-history__table tr.export-history-row:hover {
        background: var(--color-surface-alt, rgba(0, 0, 0, 0.04));
        border-color: var(--color-accent);
    }
    .export-history__table tr.export-history-row > td { display: none; }
    .export-history__table tr.export-history-row > td.export-history__mobile-cell {
        display: block;
        padding: 0;
        border: 0;
        background: transparent;
    }
    /* Loading + empty states aren't rows in this component (they render
     * as their own block above the table) so they need no override. */
}

.export-history-card {
    display: block;
    padding: 14px 14px 12px;
    color: var(--color-text);
}
.export-history-card__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.export-history-card__download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--color-accent);
    color: #ffffff;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
}
.export-history-card__download:hover,
.export-history-card__download:focus-visible {
    background: var(--color-accent-hover, var(--color-accent));
    color: #ffffff;
    text-decoration: none;
    outline: none;
}
.export-history-card__download i { font-size: 0.9rem; }
.export-history-card__detail {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}
.export-history-card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}
.export-history-card__foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--color-border);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}
.export-history-card__when {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}
.export-history-card__when i { font-size: 0.85rem; }
.export-history__table th,
.export-history__table td {
    vertical-align: middle;
}
.export-history__chip {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px 4px 2px 0;
    border-radius: 10px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.72rem;
    line-height: 1.4;
    white-space: nowrap;
}
/* "to … · by …" line under the action badge. Emails can be long, so let
   them break anywhere rather than widen the fixed-layout column. */
.export-history__detail {
    display: block;
    margin-top: 4px;
    color: var(--color-text-muted);
    font-size: 0.78rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.export-history__expired {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-style: italic;
}
.export-history__empty {
    color: var(--color-text-muted);
}

/* ExportHistoryPanel — intro line, vehicle strip and subtitle above the table. */
.export-history__intro {
    margin: 0 0 8px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}
.export-history__vehicle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}
.export-history__vehicle-identity {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 260px;
    min-width: 0;
}
.export-history__vehicle-info {
    flex: 1 1 200px;
    min-width: 0;
}

/* Mobile: the report bar already carries plate + make/model, so the
   identity block collapses. Flags jump to the top of the panel, centred
   and enlarged, so they read as the headline signal at a glance. */
@media (max-width: 767px) {
    .export-history__vehicle {
        justify-content: center;
        padding-top: 4px;
        padding-bottom: 14px;
        margin-bottom: 14px;
    }
    .export-history__vehicle-identity { display: none; }
    .export-history__flags {
        justify-content: center;
        gap: 10px;
    }
    .export-history__flags .warning-flag {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        border-radius: 8px;
    }
}
.export-history__vehicle-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 1.05rem;
}
.export-history__vehicle-details {
    margin-top: 4px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}
.export-history__flags {
    display: inline-flex;
    gap: 4px;
}
.export-history__subtitle {
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 600;
}

/* ============================================================
   Pending Invitations card on /users (REQ-033).
   Table scrolls horizontally on narrow viewports; chips + inline
   confirm-revoke button share the .table-action-btn language.
   ============================================================ */
.pending-invites__scroll {
    overflow-x: auto;
    margin: 0 -4px 12px;
}
.pending-invites__table {
    width: 100%;
    font-size: 0.85rem;
}
.pending-invites__table th,
.pending-invites__table td {
    vertical-align: middle;
}
/* Name label - matches the Users table's .user-row-name (500) on
   desktop so both rows read at the same emphasis. The mobile card
   rule bumps this to 700 alongside the Users card name. */
.pending-invites__name { font-weight: 500; }

/* Chips container - lays permission pills in a centred wrapped row so a
   long list breaks tidily instead of stretching the cell width. */
.pending-invites__chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}
.pending-invites__chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 14px;
    border-radius: 999px;
    /* Same one-step-darker treatment as the Users mobile pills - reads
       as a chip in both themes without needing to guess at surface-alt. */
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.pending-invites__chip i {
    font-size: 0.78rem;
    color: var(--color-accent);
}
/* Sent / Expires cell - date sits above the time so the day lands
   first; time reads muted underneath in tabular numerals. */
.pending-invites__datetime {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.25;
}
.pending-invites__time {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}
/* Action-cell wrapper - forces breathing room between the Resend and
   Revoke icons so they no longer stack onto each other. */
.pending-invites__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.table-action-btn--danger {
    color: var(--color-danger);
    font-size: 0.75rem;
    padding: 4px 8px;
}

/* ============================================================
   Mobile card layout for the two tables on /users.
   Above 640px both render as normal data tables. Below, each
   <tr> becomes a stacked card so admins can still read every
   row on a phone. Header row is hidden; per-cell labels come
   from data-label attributes (Pending Invites) or from a
   purpose-built mobile block (Users, via UserRow).
   ============================================================ */

/* Users page - mobile pill strip inside UserRow. Hidden on desktop; the
   table columns are the source of truth there. */
.user-row-mobile { display: none; }
.user-row-mobile__email {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    margin-top: 2px;
}
/* 3x2 grid on mobile - each pill fills its cell so the row reads as
   an even matrix instead of ragged wraps. We currently ship five
   permissions; the sixth grid slot stays blank until a new one lands. */
.user-row-mobile__pills {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
}
.user-row-mobile__pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 999px;
    /* Sit one step darker than the surrounding card in both themes.
       --color-bg is the page bg (light grey in light mode; deeper
       black in dark mode) - always contrasts against the card's
       --color-surface. */
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
    min-height: 30px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-row-mobile__pill i {
    font-size: 0.78rem;
    color: var(--color-accent);
}
/* Disabled permissions still render on mobile so the card shows the
   full spread. Same chip bg as the enabled pills; dashed border +
   lower opacity dial the row back so the enabled pills read forward
   and the off ones recede without needing extra glyphs. */
.user-row-mobile__pill--off {
    background: var(--color-bg);
    border-style: dashed;
    color: var(--color-text-muted);
    opacity: 0.55;
}
.user-row-mobile__pill--off i { color: var(--color-text-muted); }

/* Card cutover aligns with the standard Bootstrap md breakpoint
   (min-width: 768px = desktop) - anything narrower reflows to cards.
   Chosen for two reasons: it's the closest project-standard breakpoint
   to Wayne's requested ~750px cutover, and it keeps the users table
   from squeezing on portrait tablets where seven columns still fought
   the width. */
@media (max-width: 767px) {
    /* --- Manage Users table ----------------------------------- */
    .users-table-scroll .data-table,
    .users-table-scroll .data-table tbody { display: block; }
    .users-table-scroll .data-table thead { display: none; }

    .users-table-scroll .data-table tr.user-row,
    .users-table-scroll .data-table tr.user-row:nth-child(even) {
        position: relative;
        display: block;
        padding: 14px 14px 12px;
        margin-bottom: 12px;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: 10px;
        transition: background-color 0.15s ease, border-color 0.15s ease;
    }
    /* Full-card hover for the mobile layout - the per-cell rule at
       .data-table tbody tr:hover td (line ~1082) targets td, which on
       mobile only paints the inner blocks. Reset td to transparent so
       the tr's own hover background wins across the whole card. */
    .users-table-scroll .data-table tr.user-row:hover td,
    .pending-invites__table tr.pending-invites__row:hover td {
        background: transparent;
    }
    .users-table-scroll .data-table tr.user-row:hover,
    .pending-invites__table tr.pending-invites__row:hover {
        background: var(--color-surface-alt, rgba(0, 0, 0, 0.06));
        border-color: var(--color-accent);
    }
    .users-table-scroll .data-table tr.user-row td {
        display: block;
        border: 0;
        padding: 0;
    }
    /* Hide the desktop-only perm columns; the pill strip carries them. */
    .users-table-scroll .data-table tr.user-row .perm-cell { display: none; }
    /* Reveal the mobile summary block. */
    .user-row-mobile { display: block; }
    /* Anchor the edit button in the card's top-right corner. */
    .users-table-scroll .data-table tr.user-row .user-row-edit-cell {
        position: absolute;
        top: 10px;
        right: 10px;
    }
    /* Name button breaks its default table alignment so long names wrap
       naturally inside the card, and reads heavier than the desktop
       500 weight so it holds the top of the card. */
    .users-table-scroll .data-table tr.user-row .user-row-name {
        max-width: calc(100% - 42px);
        font-weight: 700;
    }
    /* Pending Invites - matching semibold-plus so the name owns the
       top of its card. */
    .pending-invites__row .pending-invites__name {
        font-weight: 700;
    }

    /* --- Pending Invitations table ---------------------------- */
    .pending-invites__table,
    .pending-invites__table tbody { display: block; }
    .pending-invites__table thead { display: none; }

    .pending-invites__row,
    .pending-invites__row:nth-child(even) {
        display: block;
        position: relative;
        padding: 14px 14px 12px;
        margin-bottom: 12px;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: 10px;
        transition: background-color 0.15s ease, border-color 0.15s ease;
    }
    .pending-invites__row td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        padding: 6px 0;
        border: 0;
        text-align: left;
    }
    /* Data-label pseudo prefix reveals the header text now that thead
       is hidden. Name/email row and the actions row don't need a label
       (name reads for itself; actions sit in the top-right). */
    .pending-invites__row td::before {
        content: attr(data-label);
        color: var(--color-text-muted);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        flex-shrink: 0;
        min-width: 92px;
    }
    .pending-invites__row td[data-label="Name"] {
        display: block;
        padding-top: 0;
        padding-right: 88px; /* clear space for the action buttons top-right */
    }
    .pending-invites__row td[data-label="Name"]::before { content: none; }
    .pending-invites__email {
        color: var(--color-text-muted);
        font-size: 0.8rem;
        margin-top: 2px;
    }
    /* Actions float to the top-right of the card, matching the Users
       card treatment. */
    .pending-invites__row .pending-invites__actions-cell {
        position: absolute;
        top: 10px;
        right: 10px;
        display: block;
        padding: 0;
    }
    .pending-invites__row .pending-invites__actions-cell::before { content: none; }

    /* Chips row breaks to full width under its label. */
    .pending-invites__row td[data-label="Permissions"] {
        flex-direction: column;
        align-items: flex-start;
    }
    .pending-invites__row td[data-label="Permissions"] .pending-invites__chips {
        justify-content: flex-start;
    }
    /* Datetime cells - keep the label to the left, value stacked date/time
       to the right; overrides the desktop inline-flex column direction. */
    .pending-invites__row td[data-label="Sent"] .pending-invites__datetime,
    .pending-invites__row td[data-label="Expires"] .pending-invites__datetime {
        align-items: flex-end;
    }
}

/* Off-screen honeypot for register + resend-verification forms (REQ-008
   bot protection). Bots that autofill by field name populate this and
   the server silently rejects the submission. Renders as a real input
   in the DOM (not type=hidden, which bots skip) but is invisible to
   sighted users and skipped by keyboard navigation via tabindex=-1. */
.honeypot-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---- Sections of Concern Only ---------------------------------
   Report Settings toggle. When .report--concerns-only is active on
   .report-content, hide any .vdi-box whose accent bar is --clear
   (i.e. a section with no warnings or alerts) and dim the matching
   anchors in the left nav so the user still sees what was skipped
   without being able to scroll to a hidden target.
   Uses :has() - supported in all target browsers (Chrome 105+,
   Firefox 121+, Safari 15.4+).
   ----------------------------------------------------------------- */
.report--concerns-only .vdi-box:has(> .vdi-box-accent--clear) {
  display: none;
}
.report--concerns-only .report-nav__item--clear {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

/* ---- MOT Statistics inline panel + toolbar button --------------
   The Stats button lives alongside the List/Tree view-toggle in the
   MOT toolbar; clicking it slides a stats dashboard into the natural
   reading flow between the toolbar and the List/Tree area (not a
   drawer). Charts and drill-in list land in later commits.
   ----------------------------------------------------------------- */
.mot-stats-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  padding: 0;
  margin-left: 8px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  position: relative;
}
.mot-stats-btn:hover {
  color: var(--color-link);
  border-color: var(--color-link);
  background: var(--color-info-bg);
}
.mot-stats-btn.active {
  background: var(--color-link);
  color: var(--color-text-inverse);
  border-color: var(--color-link);
}
.mot-stats-btn i { font-size: 0.95rem; line-height: 1; }
.mot-stats-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  padding: 4px 8px;
  background: var(--color-text);
  color: var(--color-text-inverse);
  font-size: 0.7rem;
  border-radius: var(--radius);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 2;
}
.mot-stats-btn[data-tooltip]:hover::after { opacity: 1; }

/* Collapsible wrap - starts collapsed (max-height:0) and transitions
   to a generous bound on open. Padding/margin only apply when open so
   the closed state collapses cleanly. */
.mot-stats-wrap {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease 0.05s, margin 0.25s ease;
  margin: 0;
}
.mot-stats-wrap--open {
  /* Generous bound - a long Advisory drill-in on a 20-year vehicle can
     easily exceed 1200px once the four stat cards, two chart cards and
     chip row are also inside the panel. 6000px covers the pathological
     cases and still lets the max-height transition animate smoothly. */
  max-height: 6000px;
  opacity: 1;
  margin: 8px 0 16px;
}

/* Toolbar separator between the Stats button and the List/Tree segmented
   control. A thin vertical rule plus small horizontal margins so the
   stats button no longer looks "floaty" next to the view toggle. */
.mot-toolbar__sep {
  width: 1px;
  height: 20px;
  background: var(--color-border);
  margin: 0 6px;
}

.mot-stats {
  background: var(--mot-accordion-bg, var(--color-surface));
  border: 1px solid var(--mot-accordion-border, var(--color-border));
  border-radius: 10px;
  padding: 14px 16px;
}
.mot-stats__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}
.mot-stats__title {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text);
}
.mot-stats__title-icon {
  color: var(--color-link);
  font-size: 0.95rem;
}
.mot-stats__count {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.mot-stats__body { min-height: 60px; }
.mot-stats__placeholder {
  padding: 24px 12px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* Headline stat cards - responsive grid, 4 up on wide, 2 up on narrow. */
.mot-stats__cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 720px) {
  .mot-stats__cards { grid-template-columns: repeat(2, 1fr); }
}
.mot-stats__card {
  background: var(--mot-stats-card-bg, var(--color-surface));
  border: 1px solid var(--mot-stats-card-border, var(--color-border));
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}
.mot-stats__card-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.mot-stats__card-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
}
.mot-stats__card-value--pass { color: var(--color-success); }
.mot-stats__card-value--fail { color: var(--color-danger); }
.mot-stats__card-value--warn { color: var(--color-warning); }

/* Charts - side by side on wide, stacked on narrow. Fixed-height canvas
   container so Chart.js has stable dimensions to render into. */
.mot-stats__charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  .mot-stats__charts { grid-template-columns: 1fr; }
}
.mot-stats__chart {
  background: var(--mot-stats-card-bg, var(--color-surface));
  border: 1px solid var(--mot-stats-card-border, var(--color-border));
  border-radius: 8px;
  padding: 10px 12px;
}
.mot-stats__chart-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: 6px;
}
.mot-stats__chart-canvas {
  position: relative;
  height: 220px;
}
/* All-clear empty state for the severity chart - big outline tick +
   label when no MOT carries any annotation. Height matches the chart
   canvas so the two chart cards stay the same size. Icon colour tracks
   --color-accent which is the vibrant MOT [Pass] green in both themes
   (dark mode previously showed the muted --color-success which looked
   washed out next to the pill badges). */
.mot-stats__chart-clear {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 220px;
  color: var(--color-text);
}
.mot-stats__chart-clear-icon {
  font-size: 4.5rem;
  color: var(--color-accent);
  line-height: 1;
}
.mot-stats__chart-clear-label {
  margin-top: 8px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.mot-stats__chart-clear-sub {
  /* Deliberate gap between "All Clear" and the sub-line so the two
     read as a headline + strap pairing rather than a run-on text. */
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* Drill-in: category chips + expandable list of every annotation of
   the selected type. Chip colours track the Categories[] tuple from
   MotHistoryStats via a --chip-colour CSS custom property set inline
   on each chip, so swatches stay in lockstep with the doughnut
   colours without duplicating the palette in CSS. */
.mot-stats__drill {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}
.mot-stats__drill-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text);
  margin-bottom: 6px;
}
/* Short disclaimer under the prompt - sets the dealer's expectation
   that these are historical annotations, not a current-state picture
   of the vehicle. Smaller, muted colour so it reads as supporting
   context rather than competing with the prompt. */
.mot-stats__drill-caveat {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--color-text-muted);
  margin-bottom: 10px;
  font-weight: 700;
}
.mot-stats__drill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mot-stats__drill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--color-text);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.mot-stats__drill-chip:hover {
  border-color: var(--chip-colour, var(--color-link));
  background: var(--color-info-bg);
}
.mot-stats__drill-chip.active {
  border-color: var(--chip-colour, var(--color-link));
  background: var(--color-info-bg);
}
.mot-stats__drill-chip-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--chip-colour, var(--color-link));
}
.mot-stats__drill-chip-label { font-weight: 600; }
/* Count badge - neutral pill in the stats card's own background colour,
   deliberately NOT the chip's category colour. The chip already carries
   its category identity via the border, bg tint and swatch dot; the
   count value just needs to read as a quantity, not re-state the hue. */
.mot-stats__drill-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  margin-left: 2px;
  background: var(--mot-stats-card-bg, var(--color-surface));
  color: var(--color-text);
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.72rem;
  line-height: 1;
}

.mot-stats__drill-list {
  margin-top: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--chip-colour, var(--color-link));
  border-radius: 8px;
  overflow: hidden;
}
/* Default header - fallback when no modifier is present. Modifier-
   specific rules below override background/colour/border with the
   matching --mot-badge-*-bg/text/border tokens so the header reads
   with the same hue as the pill badges (and auto-adjusts in dark
   mode via the token). */
.mot-stats__drill-list-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 12px;
  background: var(--mot-badge-user-bg);
  color: var(--mot-badge-user-text);
  font-size: 0.85rem;
  font-weight: 700;
}
.mot-stats__drill-list-header strong { color: inherit; }
.mot-stats__drill-list-header span {
  color: inherit;
  opacity: 0.85;
  font-size: 0.72rem;
  font-weight: 500;
}

/* Per-category header colours. Each pulls bg/text from the shared
   --mot-badge-*-bg / --mot-badge-*-text tokens that already drive the
   .mot-annotation__badge pills, so the drill-in header always matches
   its pill colour and inverts cleanly in dark mode. */
.mot-stats__drill-list--dangerous .mot-stats__drill-list-header {
  background: var(--mot-badge-dangerous-bg);
  color: var(--mot-badge-dangerous-text);
}
.mot-stats__drill-list--major .mot-stats__drill-list-header {
  background: var(--mot-badge-major-bg);
  color: var(--mot-badge-major-text);
}
.mot-stats__drill-list--fail .mot-stats__drill-list-header {
  background: var(--mot-badge-fail-bg);
  color: var(--mot-badge-fail-text);
}
.mot-stats__drill-list--prs .mot-stats__drill-list-header {
  background: var(--mot-badge-prs-bg);
  color: var(--mot-badge-prs-text);
}
.mot-stats__drill-list--advisory .mot-stats__drill-list-header {
  background: var(--mot-badge-advisory-bg);
  color: var(--mot-badge-advisory-text);
}
.mot-stats__drill-list--user .mot-stats__drill-list-header {
  background: var(--mot-badge-user-bg);
  color: var(--mot-badge-user-text);
}
.mot-stats__drill-item {
  display: grid;
  /* Badge column is `auto` so .mot-annotation__badge pills (DANGEROUS,
     USER ENTERED etc) size to their content instead of being clipped
     against a fixed width. The `auto` column before the arrow holds
     the "Resolved" indicator when present, or an empty spacer so row
     alignment stays consistent whether a row is marked resolved or
     not. */
  grid-template-columns: 80px auto 1fr auto 16px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--color-border);
  text-align: left;
  cursor: pointer;
  color: var(--color-text);
  font-size: 0.8rem;
  transition: background 0.12s ease;
}
.mot-stats__drill-item:hover {
  background: var(--color-info-bg);
}
.mot-stats__drill-item-date {
  font-weight: 600;
  white-space: nowrap;
  color: var(--color-text);
}
/* Row badge uses the shared .mot-annotation__badge styling from the
   MOT cards (same fill, border, radius, padding, uppercase bold text)
   so pill treatment is consistent across the whole MOT History
   feature. The .mot-annotation__badge--* modifier class on each pill
   carries the per-category colour tokens. */
.mot-stats__drill-item .mot-annotation__badge {
  align-self: center;
}
.mot-stats__drill-item-text { line-height: 1.4; }
/* Resolved indicator - sits between the annotation text and the row
   arrow when the same (type, text) pair is absent from the following
   MOT. Uses --color-accent so it matches the MOT [Pass] green used
   on the pill badges and the all-clear tick above. The spacer sibling
   occupies the same grid column on rows WITHOUT a resolved tag so
   the arrow stays aligned across the list. */
.mot-stats__drill-item-resolved {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--color-accent-light, color-mix(in srgb, var(--color-accent) 15%, transparent));
  color: var(--color-accent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 35%, transparent);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  justify-self: end;
}
.mot-stats__drill-item-resolved i {
  font-size: 0.8rem;
  line-height: 1;
}
.mot-stats__drill-item-resolved-spacer {
  width: 0;
  height: 0;
}
.mot-stats__drill-item-arrow {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  justify-self: end;
}
.mot-stats__drill-caveat-resolved {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
  background: var(--color-accent-light, color-mix(in srgb, var(--color-accent) 15%, transparent));
  color: var(--color-accent);
  border-radius: 4px;
  font-weight: 800;
  white-space: nowrap;
}
.mot-stats__drill-caveat-resolved i { font-size: 0.85rem; line-height: 1; }

/* Resolved-pill explainer at the bottom-right of the drill-in list.
   Sits contextually next to the data it describes so a dealer only
   sees it when a category is open and the pills are actually in view. */
.mot-stats__drill-list-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--color-border);
  font-size: 0.72rem;
  color: var(--color-text-muted);
}
@media (max-width: 560px) {
  .mot-stats__drill-item {
    grid-template-columns: 80px 1fr 16px;
    grid-template-rows: auto auto;
  }
  .mot-stats__drill-item .mot-annotation__badge { grid-row: 1; grid-column: 2; justify-self: start; }
  .mot-stats__drill-item-text  { grid-row: 2; grid-column: 1 / span 2; }
  /* Resolved stays on row 1 (same row as Date + Category), aligned
     to the far right of the row before the arrow. [Date] [Category]
     ..... [Resolved]  [>] */
  .mot-stats__drill-item-resolved { grid-row: 1; grid-column: 2; justify-self: end; }
  .mot-stats__drill-item-resolved-spacer { display: none; }
  .mot-stats__drill-item-arrow { grid-row: 1 / span 2; }
}
/* Welcome V3 splash modal */
.welcome-modal__body {
  padding: 36px 36px 24px;
  text-align: center;
}
.welcome-modal__eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 10px;
}
.welcome-modal__title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 12px;
}
.welcome-modal__lead {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: 0 auto 24px;
  max-width: 480px;
}
.welcome-modal__list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  display: grid;
  gap: 14px;
}
.welcome-modal__list li {
  padding: 14px 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.welcome-modal__list-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}
.welcome-modal__list-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}
@media (max-width: 600px) {
  .welcome-modal__body { padding: 24px 20px 16px; }
  .welcome-modal__title { font-size: 1.35rem; }
}
