/* ===========================================
   Deepal Phuket — Site Styles
   =========================================== */

:root {
  /* Deepened palette — near-black base so floating surfaces, the ambient
     aurora, and photography get real contrast to lift off from. */
  --color-bg: #04060c;
  --color-surface: #0a0f1c;
  --color-surface-2: #111a2c;
  --color-text: #eceef4;
  --color-text-dim: #98a1b3;
  --color-border: #1b2436;
  /* Accent toned to complement the slate-gray Deepal logo. The original
     bright cyan #00d4ff felt too "neon"; this softer steel-blue keeps a
     premium-tech feel while pairing nicely with the brand mark. */
  --color-accent: #6ea8c4;
  --color-accent-dark: #4d7d96;
  --color-accent-glow: rgba(110, 168, 196, 0.18);
  /* Logo-specific tints */
  --color-logo: #c5cdd4;
  /* light slate for logo on dark backgrounds */
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --max-width: 1200px;
  --transition: 200ms ease;
  --font-display: 'Space Grotesk', 'Noto Sans Thai', 'Noto Sans SC', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', 'Noto Sans Thai', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
}

h3 {
  font-size: 1.4rem;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-text);
  text-decoration: none;
  /* Don't let the flex container compress the brand to zero on tight
     mobile viewports where logo + toggle + lang-switcher race for space. */
  flex-shrink: 0;
  min-width: 0;
  /* still allow overflow handling rather than blowing out the nav */
}

.brand:hover {
  color: var(--color-text);
}

/* Logo. The SVG is injected inline by main.js and uses currentColor,
   so we tint it via the wrapper's color property — light slate on the
   dark header, brand gray in print/light contexts. */
.brand-logo {
  display: inline-flex;
  align-items: center;
  height: 38px;
  color: var(--color-logo);
  line-height: 0;
  flex-shrink: 0;
}

.brand-logo svg,
.brand-logo img {
  height: 100%;
  width: auto;
  display: block;
  /* Force the logo to render white regardless of source color.
     brightness(0) collapses every pixel to black, invert(1) flips to white.
     This trick works on any single-color logo image (PNG, SVG, JPG). */
  filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.brand-logo.brand-logo-img {
  color: inherit;
}

/* Mark-only variant (just the triangle icon — square aspect ratio) */
.brand-logo[data-variant="mark"] {
  height: 36px;
  width: 36px;
}

/* Footer logo can be slightly bigger so the wordmark reads well */
.site-footer .brand-logo {
  height: 42px;
}

/* Legacy classes kept in case any subpage still uses the old D-mark text */
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: #0a0e1a;
  font-weight: 800;
  font-size: 1.1rem;
}

.brand-suffix {
  color: var(--color-accent);
  font-weight: 500;
  font-size: 0.95rem;
  margin-left: 0.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--color-text-dim);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-text);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
    gap: 1rem;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  /* Tighten the mobile nav so brand-logo + hamburger + language
     switcher all fit on the same line without squashing the logo.
     The logo was getting compressed to 0 width on small screens. */
  .nav {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .brand-logo {
    height: 30px;
  }

  .nav-toggle {
    font-size: 1.25rem;
    padding: 0;
  }
}

/* Extra-narrow phones (≤ 380 px) — drop logo height another touch and
   reduce padding so the language switcher still has room to breathe. */
@media (max-width: 380px) {
  .nav {
    padding: 0.6rem 0.75rem;
  }

  .brand-logo {
    height: 26px;
  }
}

/* ===== Buttons ===== */
/* The [hidden] attribute must beat .btn's display, or a hidden button
   (e.g. "Cancel appointment" on a case with no appointment) still shows. */
.btn[hidden] { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: #0a0e1a;
  box-shadow: 0 4px 20px var(--color-accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.3);
  color: #0a0e1a;
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-ghost {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-ghost:hover {
  background: var(--color-surface-2);
  border-color: var(--color-accent);
}

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

.btn-block {
  width: 100%;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 6rem 1.5rem 5rem;
  text-align: center;
  background:
    radial-gradient(ellipse at top, rgba(0, 212, 255, 0.12) 0%, transparent 60%),
    linear-gradient(180deg, var(--color-bg) 0%, var(--color-surface) 100%);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><path d='M0 39.5h40M39.5 0v40' stroke='%231f2937' stroke-width='0.5' fill='none'/></svg>");
  opacity: 0.4;
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: var(--color-accent-glow);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: var(--color-accent);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero h1 {
  margin-bottom: 1.25rem;
  background: linear-gradient(180deg, #ffffff 30%, #9ca3af 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.15rem;
  color: var(--color-text-dim);
  max-width: 640px;
  margin: 0 auto 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Sections ===== */
.section {
  padding: 5rem 1.5rem;
}

.section-alt {
  background: var(--color-surface);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.section-header p {
  color: var(--color-text-dim);
  margin-top: 0.75rem;
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

/* ===== Feature grid ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.feature {
  padding: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.feature:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-accent-glow);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}

.feature h3 {
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.feature p {
  color: var(--color-text-dim);
  font-size: 0.95rem;
}

/* ===== Vehicle cards ===== */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.vehicle-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.vehicle-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.vehicle-photo {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--color-surface-2), var(--color-surface));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-dim);
  font-size: 0.85rem;
  position: relative;
  overflow: hidden;
}

.vehicle-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vehicle-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--color-accent);
  color: #0a0e1a;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vehicle-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.vehicle-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.vehicle-tagline {
  color: var(--color-text-dim);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.vehicle-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.vehicle-spec {
  font-size: 0.8rem;
  color: var(--color-text-dim);
  background: var(--color-bg);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
}

.vehicle-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 1rem;
  margin-top: auto;
}

.vehicle-actions {
  display: flex;
  gap: 0.5rem;
}

.vehicle-actions .btn {
  flex: 1;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
}

/* ===== Forms ===== */
.form-page {
  padding: 4rem 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}

.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.form-card h1 {
  margin-bottom: 0.5rem;
}

.form-card>p {
  color: var(--color-text-dim);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

label .required {
  color: var(--color-danger);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.form-help {
  font-size: 0.8rem;
  color: var(--color-text-dim);
  margin-top: 0.4rem;
}

/* Walk-in contact details: rows of [type selector | value | remove].
   The section always keeps at least one row — the remove button hides
   when only one is left (see wireContactRows in admin-crm.js). */
.contact-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-bottom: 0.5rem;
}

.contact-row .contact-type {
  flex: 0 0 auto;
  width: auto;
  min-width: 6.8rem;
}

.contact-row .contact-value {
  flex: 1 1 auto;
  min-width: 0;
}

.contact-row .contact-remove {
  flex: 0 0 auto;
  min-width: 2.75rem;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition);
}

.contact-row .contact-remove:hover {
  color: var(--color-danger);
  border-color: var(--color-danger);
}

.btn-contact-add {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

/* Existing contacts listed in the Log Interaction modal — read-only for
   staff (append-only), with a superadmin-only remove button. */
.case-contact-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.15rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--color-border);
}

.case-contact-line:last-child {
  border-bottom: none;
}

.case-contact-line .contact-del {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-dim);
  min-width: 1.8rem;
  min-height: 1.8rem;
  cursor: pointer;
  transition: all var(--transition);
}

.case-contact-line .contact-del:hover {
  color: var(--color-danger);
  border-color: var(--color-danger);
}

/* Confirmed trade-in desire, shown read-only to staff in the case's
   expanded view (only admin+ keep the selector). */
.trade-locked {
  margin: 0;
  padding: 0.6rem 0.9rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 0.9rem;
}

/* Country-code box on phone/WhatsApp rows: flag confirms the country as
   the customer types their code (🌐 when it matches nothing). */
.contact-row .contact-cc {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0 0.45rem;
}

.contact-row .cc-flag {
  font-size: 1.05rem;
  line-height: 1;
}

.contact-row .cc-plus {
  color: var(--color-text-dim);
  font-size: 0.9rem;
}

.contact-row .contact-cc .cc-input,
.contact-row .contact-cc .cc-input:focus {
  width: 2.1rem;
  border: none;
  background: transparent;
  padding: 0.85rem 0;
  box-shadow: none;
  outline: none;
}

.contact-row .contact-cc:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

/* Narrow screens: the row wraps — [type | country code | remove] on the
   first line, the number input full-width on the second — so the number
   field never gets squeezed into unusability. */
@media (max-width: 640px) {
  .contact-row {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .contact-row .contact-type {
    flex: 1 1 auto;
    min-width: 0;
  }

  .contact-row .contact-value {
    order: 2;
    flex: 1 1 60%;
  }

  .contact-row .contact-remove {
    order: 3;
  }
}

.form-message {
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  display: none;
}

.form-message.success {
  display: block;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.form-message.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 3rem 1.5rem 2rem;
  margin-top: 4rem;
}

.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.footer-col h4 {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: var(--color-text-dim);
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--color-accent);
}

.footer-col p {
  color: var(--color-text-dim);
  font-size: 0.9rem;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
  color: var(--color-text-dim);
  font-size: 0.85rem;
}

/* ===== Admin ===== */
.admin-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.admin-tab {
  padding: 0.85rem 1.25rem;
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.admin-tab:hover {
  color: var(--color-text);
}

.admin-tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.admin-table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

th {
  background: var(--color-surface-2);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-dim);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

td .pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.pill-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.pill-confirmed {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

/* Walk-in case lifecycle */
.pill-active {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

/* Read-only assignee label staff see instead of the admin dropdown */
.rep-assign-readonly {
  color: var(--color-text-dim);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Completed = the case ended in a vehicle booking (a win) */
.pill-completed {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

/* Closed = finished without a vehicle booking */
.pill-closed {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.pill-cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* LINE job applicant (Join our team) -- admin-only chats, no case */
.pill-applicant {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
}

/* ===== Buy-propensity rating (1–10) ===== */
/* Tap chips inside the walk-in / log-interaction modals */
.prop-scale {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.35rem;
}

.prop-chip {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  min-height: 44px;
  padding: 0.5rem 0.2rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.prop-chip-selected {
  background: linear-gradient(135deg, #00d4ff 0%, #0098cc 100%);
  color: #0a0e1a;
  border-color: transparent;
}

/* Rating chip shown next to logged interactions and on case cards */
.prop-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--color-text-dim);
}

/* ===== Filters bar ===== */
.filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.filters select,
.filters input {
  flex: 1;
  min-width: 180px;
}

/* ===== Page header (interior pages) ===== */
.page-header {
  padding: 4rem 1.5rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--color-text-dim);
  max-width: 640px;
  margin: 0 auto;
}

/* ===== CTA banner ===== */
.cta-banner {
  margin: 4rem auto;
  max-width: var(--max-width);
  padding: 3rem 2rem;
  background:
    radial-gradient(ellipse at center, rgba(0, 212, 255, 0.15) 0%, transparent 70%),
    var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.cta-banner h2 {
  margin-bottom: 0.75rem;
}

.cta-banner p {
  color: var(--color-text-dim);
  max-width: 600px;
  margin: 0 auto 1.75rem;
}

.cta-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Loading spinner ===== */
.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem;
  color: var(--color-text-dim);
}

/* ===========================================
   Scroll-reveal animations (Apple/Tesla style)
   =========================================== */
.is-revealable {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 1100ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 1100ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

[data-reveal="left"].is-revealable {
  transform: translateX(-32px);
}

[data-reveal="right"].is-revealable {
  transform: translateX(32px);
}

[data-reveal="zoom"].is-revealable {
  transform: scale(0.96);
}

[data-reveal="fade"].is-revealable {
  transform: none;
}

.is-revealed {
  opacity: 1 !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .is-revealable {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ===========================================
   Language switcher (in header)
   =========================================== */
.lang-switcher {
  position: relative;
  margin-left: 1rem;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.lang-toggle:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.lang-globe {
  font-size: 1rem;
  line-height: 1;
}

.lang-caret {
  font-size: 0.7rem;
  opacity: 0.7;
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  list-style: none;
  padding: 0.4rem;
  min-width: 160px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 200;
}

.lang-switcher.open .lang-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.lang-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.85rem;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background var(--transition);
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.04);
}

.lang-option.active {
  background: var(--color-accent-glow);
  color: var(--color-accent);
}

@media (max-width: 768px) {
  .lang-switcher {
    margin-left: auto;
    margin-right: 0.75rem;
  }
}

/* ===========================================
   Background video (hero + model pages)
   =========================================== */
.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0;
  animation: bg-fade-in 1.4s ease 0.3s forwards;
}

.bg-video.video-failed {
  display: none;
}

@keyframes bg-fade-in {
  to {
    opacity: 0.55;
  }
}

/* Animated gradient that always sits behind the video as a fallback */
.video-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(0, 212, 255, 0.20) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 60%, rgba(99, 102, 241, 0.18) 0%, transparent 55%),
    linear-gradient(135deg, #0a0e1a 0%, #111a2b 50%, #0a0e1a 100%);
  background-size: 200% 200%;
  animation: gradient-pan 18s ease-in-out infinite;
}

@keyframes gradient-pan {
  0% {
    background-position: 0% 0%, 100% 100%, 0% 0%;
  }

  50% {
    background-position: 100% 50%, 0% 50%, 100% 100%;
  }

  100% {
    background-position: 0% 0%, 100% 100%, 0% 0%;
  }
}

/* ===========================================
   Cinematic Hero (homepage)
   =========================================== */
.hero-cinematic {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 0 1.5rem;
}

.hero-cinematic .video-stage,
.hero-cinematic .bg-video {
  z-index: 0;
}

.hero-cinematic::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 14, 26, 0.20) 0%, rgba(10, 14, 26, 0.45) 60%, var(--color-bg) 100%);
  z-index: 1;
  pointer-events: none;
}

.hero-cinematic .hero-content {
  position: relative;
  z-index: 2;
  max-width: 960px;
}

.hero-cinematic h1 {
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  letter-spacing: -0.03em;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: linear-gradient(180deg, #ffffff 0%, #d1d5db 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.05;
}

.hero-cinematic .hero-subtitle {
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  color: rgba(232, 234, 240, 0.85);
  max-width: 720px;
  margin: 0 auto 2.5rem;
  line-height: 1.55;
}

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(232, 234, 240, 0.6);
  animation: float 2.6s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translate(-50%, 0);
    opacity: 0.6;
  }

  50% {
    transform: translate(-50%, 8px);
    opacity: 1;
  }
}

/* ===========================================
   Showcase (interactive model selector)
   =========================================== */
.showcase {
  max-width: var(--max-width);
  margin: 0 auto;
}

.showcase-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2.5rem;
  padding: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.showcase-tab {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.6rem 1.4rem;
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 999px;
  transition: all 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.showcase-tab-name {
  font-size: 0.95rem;
}

.showcase-tab-type {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
}

.showcase-tab:hover {
  color: var(--color-text);
}

.showcase-tab.active {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: #0a0e1a;
  box-shadow: 0 4px 24px rgba(0, 212, 255, 0.25);
}

.showcase-tab.active .showcase-tab-type {
  opacity: 0.8;
}

.showcase-panels {
  position: relative;
  min-height: 520px;
}

.showcase-panel {
  display: none;
  grid-template-columns: 1.15fr 1fr;
  gap: 2.5rem;
  align-items: stretch;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: panel-in 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.showcase-panel.active {
  display: grid;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.showcase-visual {
  position: relative;
  min-height: 320px;
  background: var(--color-surface-2);
  overflow: hidden;
}

.showcase-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: bg-fade-in 1.2s ease forwards;
  z-index: 1;
}

.showcase-video.video-failed {
  display: none;
}

.showcase-visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.10), rgba(99, 102, 241, 0.10));
  pointer-events: none;
  z-index: 2;
}

.showcase-visual-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at center, rgba(0, 212, 255, 0.25) 0%, transparent 60%),
    linear-gradient(135deg, #0d1424, #1a2238);
  z-index: 0;
}

/* Static model image — sits behind the video so it's visible while video
   loads, and stays visible if the video file is missing/blocked. */
.showcase-visual-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.85;
}

.showcase-visual-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.08);
  text-transform: uppercase;
}

.showcase-info {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.showcase-badge {
  position: static;
  align-self: flex-start;
}

.showcase-name {
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  margin-top: 0.25rem;
}

.showcase-brand {
  display: inline-block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  font-weight: 600;
  margin-top: -0.25rem;
}

.model-hero-brand {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  color: var(--color-accent);
  font-weight: 600;
  margin-top: 0.75rem;
}

.showcase-tagline {
  color: var(--color-text-dim);
  font-size: 1rem;
  margin-top: -0.5rem;
}

.showcase-quickspecs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

@media (max-width: 600px) {
  .showcase-quickspecs {
    grid-template-columns: repeat(2, 1fr);
  }
}

.qspec {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: center;
}

.qspec-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.qspec-unit {
  font-size: 0.85rem;
  color: var(--color-text-dim);
  margin-left: 0.15rem;
}

.qspec-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-dim);
}

.showcase-trims h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.trim-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.trim-pill {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

.trim-pill:hover {
  border-color: var(--color-accent);
}

.trim-pill.active {
  background: var(--color-accent-glow);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.trim-detail {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.trim-detail.trim-fade {
  animation: panel-in 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.trim-line {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--color-border);
}

.trim-line:last-of-type {
  border-bottom: none;
}

.trim-line-label {
  color: var(--color-text-dim);
}

.trim-line-value {
  font-weight: 600;
}

.trim-price {
  color: var(--color-accent);
}

.trim-highlights {
  list-style: none;
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.trim-highlights li {
  font-size: 0.78rem;
  background: var(--color-surface-2);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  color: var(--color-text-dim);
}

.showcase-price {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.5rem 0;
  margin-top: auto;
}

.showcase-price-label {
  font-size: 0.85rem;
  color: var(--color-text-dim);
}

.showcase-price-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-accent);
  font-family: var(--font-display);
}

.showcase-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.showcase-actions .btn {
  flex: 1;
  min-width: 140px;
}

/* ===========================================
   Model detail page (model.html)
   =========================================== */
.model-hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 6rem 1.5rem 3rem;
  overflow: hidden;
}

.model-hero .bg-video {
  z-index: 0;
}

.model-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(10, 14, 26, 0.20) 0%, rgba(10, 14, 26, 0.7) 80%, var(--color-bg) 100%),
    linear-gradient(180deg, rgba(10, 14, 26, 0.0) 0%, var(--color-bg) 100%);
  z-index: 1;
}

.model-hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.model-hero-content h1 {
  font-size: clamp(2.6rem, 7vw, 5rem);
  margin: 1rem 0;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.model-hero-tagline {
  color: rgba(232, 234, 240, 0.8);
  font-size: 1.15rem;
  margin-bottom: 2rem;
}

.model-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

@media (max-width: 700px) {
  .model-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.model-stat {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.model-stat-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.03em;
}

.model-stat-num .unit {
  font-size: 1rem;
  color: var(--color-text-dim);
  margin-left: 0.25rem;
  font-weight: 500;
}

.model-stat-label {
  margin-top: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.75rem;
  color: var(--color-text-dim);
}

.model-trims-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.trim-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all var(--transition);
}

.trim-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px);
}

.trim-card h3 {
  font-size: 1.25rem;
}

.trim-card-specs>div {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}

.trim-card-label {
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

.trim-card-price {
  color: var(--color-accent);
  font-weight: 700;
}

.trim-card-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.5rem 0 1rem;
}

.trim-card-highlights li {
  position: relative;
  padding-left: 1.2rem;
  color: var(--color-text-dim);
  font-size: 0.9rem;
}

.trim-card-highlights li::before {
  content: "›";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-accent);
  font-weight: 700;
}

/* Reduce hero CTA contrast against bright video */
.hero-cinematic .btn-secondary,
.model-hero .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ===========================================
   Photo gallery + lightbox
   =========================================== */
.gallery {
  max-width: var(--max-width);
  margin: 0 auto;
}

.gallery-main {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
  padding: 0;
  transition: border-color var(--transition);
}

.gallery-main:hover {
  border-color: var(--color-accent);
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-main:hover img {
  transform: scale(1.02);
}

.gallery-zoom-hint {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 26, 0.8);
  border-radius: 8px;
  color: white;
  font-size: 1.1rem;
  backdrop-filter: blur(8px);
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.gallery-thumb {
  flex: 0 0 96px;
  height: 64px;
  background: var(--color-surface-2);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition: border-color var(--transition), transform var(--transition);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumb:hover {
  transform: translateY(-2px);
}

.gallery-thumb.active {
  border-color: var(--color-accent);
}

.gallery-thumb-more {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-dim);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--color-surface-2);
}

/* ===========================================
   Categorized gallery — tabs + grid
   =========================================== */
.cat-gallery-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
  padding: 0.4rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
}

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 999px;
  transition: all 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cat-tab:hover {
  color: var(--color-text);
}

.cat-tab.active {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: #0a0e1a;
  box-shadow: 0 4px 18px rgba(0, 212, 255, 0.25);
}

.cat-count {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}

.cat-tab.active .cat-count {
  background: rgba(10, 14, 26, 0.2);
  color: #0a0e1a;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  max-width: var(--max-width);
  margin: 0 auto;
  animation: cat-fade 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cat-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cat-tile {
  aspect-ratio: 4 / 3;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: zoom-in;
  padding: 0;
  position: relative;
  transition: all var(--transition);
}

.cat-tile:hover {
  border-color: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.cat-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cat-tile:hover img {
  transform: scale(1.04);
}

@media (max-width: 600px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .cat-tab {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
  }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 250ms ease;
  padding: 2rem;
}

.lightbox.open {
  display: flex;
  opacity: 1;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  transition: all var(--transition);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--color-accent);
  color: #0a0e1a;
  border-color: var(--color-accent);
}

.lightbox-close {
  top: 1.5rem;
  right: 1.5rem;
  font-size: 1.8rem;
}

.lightbox-prev {
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
}

.lightbox-next {
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
}

.lightbox-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
}

@media (max-width: 600px) {
  .lightbox-close {
    top: 1rem;
    right: 1rem;
  }

  .lightbox-prev {
    left: 0.75rem;
  }

  .lightbox-next {
    right: 0.75rem;
  }
}

/* ===========================================
   Inventory editor (admin)
   =========================================== */
.inv-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.inv-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.inv-card-photo {
  aspect-ratio: 16 / 10;
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-dim);
  font-size: 0.85rem;
}

.inv-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inv-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.inv-card-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.inv-card-meta {
  font-size: 0.85rem;
  color: var(--color-text-dim);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.inv-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.inv-card-actions .btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

/* ===========================================
   Calendar tab (admin)
   =========================================== */
.cal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 800px;
}

.cal-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.cal-card h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--color-accent);
}

.cal-url-box {
  margin-top: 2rem;
  padding: 1.25rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.cal-url-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.4rem;
}

.cal-url-row code {
  flex: 1;
  font-size: 0.8rem;
  background: var(--color-surface-2);
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  overflow-x: auto;
  white-space: nowrap;
  user-select: all;
}

.cal-instructions {
  margin-top: 1.5rem;
}

.cal-instructions ol {
  padding-left: 1.5rem;
  color: var(--color-text-dim);
  line-height: 1.8;
}

.cal-instructions ol li {
  margin-bottom: 0.25rem;
}

.cal-instructions code {
  font-size: 0.85rem;
  background: var(--color-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

/* ===========================================
   Customers panel (admin)
   =========================================== */
.cust-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.cust-toolbar input[type="text"] {
  flex: 1;
  min-width: 220px;
}

.cust-toolbar #cust-count {
  margin-left: auto;
  margin-right: 0.5rem;
}

/* All Cases + Performance toolbars (2026-09-15): heading row on top, the
   filter / sort / period controls on a full-width row of their own so
   they don't fight the heading for space. */
.cust-toolbar .ac-reset {
  margin-left: auto;
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
}
.ac-controls {
  flex: 1 1 100%;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.ac-controls select,
.ac-controls input[type="date"] {
  width: auto;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
}
.ac-dates {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.ac-more {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 1rem;
  color: var(--color-text-dim);
  font-size: 0.9rem;
}
.ac-capped {
  color: var(--color-text-dim);
  font-size: 0.85rem;
  margin: -0.75rem 0 1rem;
}

/* Case-status definitions under the status dropdown (2026-09-18) */
.status-defs { margin-top: 0.5rem; line-height: 1.45; }
.status-defs div + div { margin-top: 0.3rem; }

.cust-table {
  width: 100%;
}

.cust-table tr.cust-row {
  cursor: pointer;
  transition: background var(--transition);
}

.cust-table tr.cust-row:hover {
  background: rgba(0, 212, 255, 0.04);
}

.cust-table tr.cust-row-open {
  background: rgba(0, 212, 255, 0.07);
}

.cust-table tr.cust-row-open td {
  border-bottom: none;
}

.cust-detail td {
  padding: 0;
  background: var(--color-bg);
}

.cust-history {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.cust-history h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.cust-history ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cust-history li {
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.cust-tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cust-tag-td {
  background: rgba(0, 212, 255, 0.15);
  color: var(--color-accent);
}

.cust-tag-sv {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.cust-tag-ci {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.cust-tag-nt {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

/* Full note text under a customer-history line */
.cust-note {
  margin: 0.35rem 0 0.25rem 0;
  padding: 0.5rem 0.75rem;
  border-left: 2px solid rgba(255, 255, 255, 0.15);
  color: var(--color-text);
  font-size: 0.9rem;
  white-space: pre-wrap;
}

/* Channel chip: how the customer reached us (website / booth / call-in …) */
.channel-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
  white-space: nowrap;
}

/* Superadmin-only × delete on a logged interaction */
.btn-int-del {
  appearance: none;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.25rem;
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.30);
  border-radius: 50%;
  color: #fca5a5;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.btn-int-del:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.55);
  transform: scale(1.08);
}
.btn-int-del:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Staff notes nested under one case in the expanded customer row */
.cust-case-logs {
  margin: 0.5rem 0 0.75rem 1rem;
  padding: 0.5rem 0.75rem;
  border-left: 2px solid rgba(16, 185, 129, 0.35);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 6px 6px 0;
}
.cust-case-logs-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-dim);
  margin-bottom: 0.4rem;
}
.cust-log {
  padding: 0.35rem 0;
}
.cust-log + .cust-log {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.cust-log-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.cust-log .cust-note {
  border-left: none;
  padding: 0.25rem 0 0 0;
}

/* ===========================================
   Appointment picker (walk-in + log modals)
   Tap-only, sized for touchscreens.
   =========================================== */
.appt-rail {
  display: flex;
  align-items: stretch;
  gap: 6px;
  overflow-x: auto;
  padding: 0.2rem 0 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.appt-rail-month {
  flex: 0 0 auto;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  align-self: center;
  padding: 0.2rem 0.05rem;
}
.appt-day {
  flex: 0 0 auto;
  appearance: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 52px;
  min-height: 52px;
  justify-content: center;
  padding: 0.45rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
}
.appt-day-dow {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}
.appt-day-num {
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.appt-day-selected {
  background: linear-gradient(135deg, #00d4ff 0%, #0098cc 100%);
  border-color: transparent;
}
.appt-day-selected .appt-day-dow,
.appt-day-selected .appt-day-num {
  color: #0a0e1a;
}
.appt-slots-scroll {
  max-height: 190px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}
.appt-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
}
.appt-slot {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  min-height: 44px;
  padding: 0.5rem 0.4rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.appt-slot-selected {
  background: linear-gradient(135deg, #00d4ff 0%, #0098cc 100%);
  color: #0a0e1a;
  border-color: transparent;
}
.appt-summary {
  margin: 0.5rem 0 0.75rem;
  padding: 0.6rem 0.9rem;
  background: rgba(0, 212, 255, 0.10);
  border: 1px solid rgba(0, 212, 255, 0.30);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

/* ===========================================
   Per-employee analytics cards (Performance)
   =========================================== */
.perf-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.perf-card {
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}
.perf-card-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}
.perf-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem 0.5rem;
  margin-bottom: 0.75rem;
}
.perf-card-stats > div {
  display: flex;
  flex-direction: column;
}
.perf-card-stats label {
  font-size: 0.68rem;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.perf-card-section {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-dim);
  margin: 0.6rem 0 0.35rem;
}
.perf-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  font-size: 0.82rem;
}
.perf-bar-label {
  flex: 0 0 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.perf-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}
.perf-bar-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
}
.perf-bar-n {
  flex: 0 0 auto;
  color: var(--color-text-dim);
  font-variant-numeric: tabular-nums;
}
.perf-card-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* "Previous notes" block inside the Log Interaction modal */
.interaction-history {
  margin-bottom: 1.5rem;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.interaction-history-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-dim);
  margin-bottom: 0.5rem;
}

/* ===========================================
   CRM additions: rep dropdown + interactions
   =========================================== */
select.rep-assign {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  max-width: 160px;
}

select.rep-assign:hover {
  border-color: var(--color-accent);
}

.outcome-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.interaction-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.interaction-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.interaction-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
}

.interaction-when {
  color: var(--color-text);
  font-weight: 600;
}

.interaction-rep {
  color: var(--color-accent);
}

.interaction-source {
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  background: var(--color-bg);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}

.interaction-notes {
  color: var(--color-text);
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* ===========================================
   My Cases + Performance tabs
   =========================================== */
.cases-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.cases-section h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-dim);
  margin-bottom: 0.75rem;
}

.case-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
}

.case-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent);
}

.case-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.case-accept-btn {
  margin-left: auto;
  background: var(--color-accent);
  color: #0a0e1a;
  border: none;
  border-radius: 5px;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.case-accept-btn:hover {
  filter: brightness(1.1);
}

.case-accept-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cases-grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}

.history-row {
  padding: 0.65rem 0.85rem;
  border-left: 3px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.history-row-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.case-tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.case-tag-test {
  background: rgba(0, 212, 255, 0.15);
  color: var(--color-accent);
}

.case-tag-service {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.case-tag-contact {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.case-tag-walkin {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.case-card-when {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--color-text-dim);
}

.case-card-name {
  font-weight: 600;
  font-size: 1rem;
}

.case-card-summary {
  font-size: 0.9rem;
  color: var(--color-text-dim);
  margin: 0.2rem 0;
}

.case-card-contact {
  font-size: 0.82rem;
  color: var(--color-text-dim);
}

.perf-table th,
.perf-table td {
  text-align: left;
  padding: 0.85rem 1rem;
}

.perf-num {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
}

/* ===========================================
   Media Manager (admin tab)
   =========================================== */
.media-vehicle-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1rem;
}

.media-vehicle-card {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
}

.media-vehicle-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.media-vehicle-thumb {
  width: 120px;
  height: 80px;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-dim);
  font-size: 0.75rem;
}

.media-vehicle-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-vehicle-info h3 {
  font-size: 1.1rem;
  margin: 0;
}

.media-vehicle-info .muted {
  color: var(--color-text-dim);
  font-size: 0.85rem;
  margin: 0.15rem 0 0.4rem;
}

.media-vehicle-stats {
  display: flex;
  gap: 0.85rem;
  font-size: 0.8rem;
  color: var(--color-text-dim);
  flex-wrap: wrap;
}

.media-vehicle-cta {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Per-vehicle editor */
.media-slots {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Overview header at top of media editor */
.media-status-overview {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.media-status-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.media-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.media-pill.ok {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}

.media-pill.empty {
  background: rgba(245, 158, 11, 0.10);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.3);
}

.media-preview-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.media-preview-links .btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* Per-slot status badge */
.media-slot-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: space-between;
}

.media-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.media-status-badge.ok {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.media-status-badge.empty {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Slot border accent based on fill state */
.media-slot.filled {
  border-left: 3px solid #10b981;
}

.media-slot.empty {
  border-left: 3px solid #f59e0b;
}

/* "Currently live" label above the preview */
.media-preview-label {
  background: var(--color-surface);
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

/* Gallery index number — easier to track which photo is which */
.media-gallery-index {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  background: rgba(10, 14, 26, 0.85);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  z-index: 2;
}

.media-slot {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.media-slot-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

.media-slot-header h3 {
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.media-slot-tag {
  display: inline-block;
  background: var(--color-accent-glow);
  color: var(--color-accent);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.media-slot-header p {
  margin: 0.25rem 0;
  color: var(--color-text-dim);
  font-size: 0.9rem;
}

.media-slot-shows-up {
  color: var(--color-accent) !important;
  font-size: 0.78rem !important;
  font-weight: 500;
  margin-top: 0.5rem !important;
}

.media-slot-body {
  padding: 1.25rem 1.5rem;
}

.media-preview-single {
  position: relative;
  max-width: 600px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.media-preview-single img,
.media-preview-single video {
  width: 100%;
  display: block;
  max-height: 320px;
  object-fit: cover;
}

.media-preview-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

/* Gallery grid */
.media-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.media-gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.media-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-gallery-actions {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: space-between;
  padding: 0.4rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  opacity: 0;
  transition: opacity var(--transition);
}

.media-gallery-item:hover .media-gallery-actions {
  opacity: 1;
}

.btn-tiny {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.2rem 0.45rem;
  font-size: 0.7rem;
  cursor: pointer;
  font-family: inherit;
}

.btn-tiny:hover {
  background: var(--color-accent);
  color: #0a0e1a;
}

.btn-tiny.btn-danger:hover {
  background: var(--color-danger);
  color: white;
}

/* Upload tiles */
.media-uploader {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  color: var(--color-text-dim);
  cursor: pointer;
  transition: all var(--transition);
}

.media-uploader p {
  margin: 0.25rem 0;
}

.media-uploader .muted {
  font-size: 0.8rem;
}

.media-uploader:hover,
.media-uploader.drag-over {
  border-color: var(--color-accent);
  background: var(--color-accent-glow);
  color: var(--color-accent);
}

.media-uploader-tile {
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  padding: 0;
}

.media-uploader-tile p {
  font-size: 0.95rem;
}

.media-file-input {
  display: none;
}

.media-uploading {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 26, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: white;
  font-size: 0.95rem;
  z-index: 5;
  border-radius: var(--radius-lg);
}

/* Calendar grid */
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 0.85rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.cal-grid {
  display: grid;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  /* NOT overflow:hidden — hover-expanded blocks must be able to spill
     past the grid edge without being clipped. */
  overflow: visible;
}

.cal-corner {
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  border-top-left-radius: var(--radius-lg);
}

.cal-day-header {
  padding: 0.75rem 0.5rem;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.cal-day-header:last-of-type {
  border-top-right-radius: var(--radius-lg);
}

/* Time gutter — hour labels positioned to line up with the grid lines */
.cal-timecol {
  position: relative;
  background: var(--color-surface-2);
  border-right: 1px solid var(--color-border);
  border-bottom-left-radius: var(--radius-lg);
}

.cal-time-label {
  position: absolute;
  right: 0.4rem;
  transform: translateY(-50%);
  font-size: 0.72rem;
  color: var(--color-text-dim);
}

/* Day column — a continuous 09:00–18:00 canvas; blocks are absolutely
   positioned inside it at their exact requested time. */
.cal-daycol {
  position: relative;
  border-right: 1px solid var(--color-border);
}

.cal-daycol:last-child {
  border-right: none;
  border-bottom-right-radius: var(--radius-lg);
}

.cal-hourline {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--color-border);
  opacity: 0.6;
  pointer-events: none;
}

/* Red "now" line on today's column */
.cal-nowline {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px solid #ef4444;
  z-index: 5;
  pointer-events: none;
}

.cal-nowline::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
}

.cal-block {
  position: absolute;
  box-sizing: border-box;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  font-size: 0.72rem;
  cursor: pointer;
  overflow: hidden;
  z-index: 2;
}

/* Hover or focus expands the 15-min sliver to reveal full details.
   Focus covers keyboard + first-tap on touch devices. The expanded card
   also gets a minimum width so narrow week-view columns (or half-width
   double bookings) stay readable — it pops over its neighbours. */
.cal-block:hover,
.cal-block:focus-within,
.cal-block:focus {
  height: auto !important;
  width: auto !important;
  min-width: 200px;
  max-width: 280px;
  min-height: 24px;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.cal-block-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  min-height: 18px;
}

.cal-block-more {
  display: none;
  padding: 0.2rem 0 0.15rem;
}

.cal-block:hover .cal-block-more,
.cal-block:focus-within .cal-block-more,
.cal-block:focus .cal-block-more {
  display: block;
}

/* Unassigned (open) cases get a dashed amber outline so they pop */
.cal-block-open {
  border-style: dashed;
  border-color: rgba(245, 158, 11, 0.6);
  border-left-style: solid;
}

/* Color coding — test drive blue, service yellow/amber, inquiry green */
.cal-block-td {
  border-left-color: #3b82f6;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.10) 0%, var(--color-bg) 40%);
}

.cal-block-sv {
  border-left-color: #f59e0b;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.10) 0%, var(--color-bg) 40%);
}

.cal-block-ci {
  border-left-color: #22c55e;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.10) 0%, var(--color-bg) 40%);
}

/* Staff-booked appointments (meetings, deliveries, …) — purple */
.cal-block-ap {
  border-left-color: #a855f7;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.10) 0%, var(--color-bg) 40%);
}

/* Tiny pulse animation when a brand-new booking arrives via realtime */
@keyframes cal-new-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.55);
  }

  100% {
    box-shadow: 0 0 0 12px rgba(0, 212, 255, 0);
  }
}

.cal-block.cal-block-new {
  animation: cal-new-pulse 1.2s ease-out 2;
}

/* Legend strip above the calendar */
.cal-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--color-text-dim);
  margin: 0 0 0.75rem;
}

.cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.cal-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.cal-legend-dot.dot-td {
  background: #3b82f6;
}

.cal-legend-dot.dot-sv {
  background: #f59e0b;
}

.cal-legend-dot.dot-ci {
  background: #22c55e;
}

.cal-legend-dot.dot-ap {
  background: #a855f7;
}

/* Inquiries panel — sits beside or below the time grid since inquiries
   have no preferred_date and can't anchor to a time block */
.cal-inquiries {
  margin-top: 1.25rem;
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: rgba(34, 197, 94, 0.04);
}

.cal-inquiries-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.55rem;
}

.cal-inquiries-head::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}

.cal-inquiries-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.cal-inquiry-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  background: var(--color-bg);
  border-left: 3px solid #22c55e;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform var(--transition);
}

.cal-inquiry-item:hover {
  transform: translateX(2px);
}

.cal-inquiry-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.cal-inquiry-name {
  font-weight: 600;
  color: var(--color-text);
}

.cal-inquiry-subject {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-inquiry-when {
  font-size: 0.72rem;
  color: var(--color-text-dim);
  white-space: nowrap;
}

/* 15-min slot picker on guest booking forms */
.slot-picker {
  margin-top: 0.25rem;
}

.slot-picker-help {
  color: var(--color-text-dim);
  font-size: 0.85rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 6px;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.5rem;
  margin-top: 0.25rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.slot-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 0.55rem 0.4rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.slot-btn:hover {
  background: rgba(0, 212, 255, 0.12);
  border-color: var(--color-accent);
}

.slot-btn.selected {
  background: var(--color-accent);
  color: #0a0e1a;
  border-color: var(--color-accent);
  transform: scale(1.02);
}

.cal-block-name {
  font-weight: 600;
  color: var(--color-text);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-block-time {
  color: var(--color-accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.cal-block-summary {
  color: var(--color-text-dim);
  font-size: 0.72rem;
}

.cal-block-tag {
  color: var(--color-text-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

.cal-block-assignee {
  color: var(--color-text-dim);
  font-size: 0.7rem;
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.cal-block-unassigned {
  color: #f59e0b;
}

.cal-accept-btn {
  background: var(--color-accent);
  color: #0a0e1a;
  border: none;
  border-radius: 4px;
  padding: 0.05rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
}

.cal-accept-btn:hover {
  filter: brightness(1.1);
}

.cal-accept-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cust-table a {
  color: var(--color-text);
}

.cust-table a:hover {
  color: var(--color-accent);
}

/* Inventory editor modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 900;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1.5rem;
  overflow-y: auto;
}

.modal-overlay.open {
  display: flex;
}

/* Sub-modals opened from inside the Log Interaction modal (Move / Cancel
   appointment, Connect on LINE) must stack above it — same layer
   otherwise, and whichever overlay was created first hid the other. */
.modal-overlay.modal-top { z-index: 950; }

.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  padding: 2rem;
  position: relative;
  animation: panel-in 350ms cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--color-text);
}

.photo-uploader {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  color: var(--color-text-dim);
  cursor: pointer;
  transition: all var(--transition);
}

.photo-uploader.drag-over,
.photo-uploader:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-glow);
  color: var(--color-accent);
}

.photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface-2);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-item-actions {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.4rem;
}

.photo-item:hover .photo-item-actions {
  opacity: 1;
}

.photo-item-actions button {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  font-size: 0.7rem;
  cursor: pointer;
}

.photo-item-actions button:hover {
  background: var(--color-accent);
  color: #0a0e1a;
}

.photo-item-row {
  display: flex;
  gap: 0.25rem;
  justify-content: space-between;
}

.count-pill {
  display: inline-block;
  margin-left: 0.4rem;
  background: var(--color-accent-glow);
  color: var(--color-accent);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  vertical-align: middle;
}

/* ===========================================
   Branch cards (contact page)
   =========================================== */
.branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.branch-card {
  padding: 1.5rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition);
}

.branch-card:hover {
  border-color: var(--color-accent);
}

.branch-card h4 {
  font-size: 1.05rem;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.branch-card p {
  color: var(--color-text-dim);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 1rem;
}

/* ===========================================
   Toast notifications (admin friendly errors)
   =========================================== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  max-width: 90vw;
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ===========================================
   Trim editor (inside the Inventory modal)
   — name + price + free-form spec rows + highlights
   =========================================== */
.trim-empty {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  color: var(--color-text-dim);
}

.trim-empty p {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.trim-editor-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.trim-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.trim-editor-title {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}

.trim-editor-head-actions {
  display: flex;
  gap: 0.4rem;
}

.trim-editor-head-actions button {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
}

.trim-editor-head-actions button:hover {
  background: var(--color-surface);
  border-color: var(--color-accent);
}

.trim-remove {
  color: #fca5a5 !important;
}

.trim-section-label {
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin: 0.25rem 0 0.25rem;
}

.trim-section-hint {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  color: var(--color-text-dim);
}

.trim-spec-row,
.trim-highlight-row {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.trim-spec-row {
  grid-template-columns: 1fr 1fr auto;
}

.trim-highlight-row {
  grid-template-columns: 1fr auto;
}

.trim-spec-row input,
.trim-highlight-row input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  font-size: 0.88rem;
}

.trim-spec-row input:focus,
.trim-highlight-row input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.trim-spec-remove,
.trim-highlight-remove {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-dim);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.trim-spec-remove:hover,
.trim-highlight-remove:hover {
  border-color: #fca5a5;
  color: #fca5a5;
}

.trim-spec-add,
.trim-highlight-add {
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  margin-top: 0.25rem;
}

/* ===========================================
   Trash tab — "days until purge" urgency pills
   =========================================== */
.trash-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.trash-pill.trash-ok {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}

.trash-pill.trash-warn {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}

.trash-pill.trash-urgent {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

/* ===========================================
   Role picker — used in Add staff modal so the
   admin can SEE what each role can do before
   choosing instead of staring at a dropdown.
   =========================================== */
.role-picker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.role-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.role-card:hover {
  border-color: var(--color-accent);
}

.role-card.selected {
  border-color: var(--color-accent);
  background: rgba(110, 168, 196, 0.10);
  box-shadow: 0 0 0 1px var(--color-accent) inset;
}

.role-card input[type="radio"] {
  margin-top: 0.25rem;
  flex-shrink: 0;
  accent-color: var(--color-accent);
}

.role-card-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.role-card-body {
  flex: 1;
  min-width: 0;
}

.role-card-title {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}

.role-card-desc {
  font-size: 0.85rem;
  color: var(--color-text-dim);
  line-height: 1.4;
}

/* ===========================================
   Admin EN/TH language switcher
   =========================================== */
.admin-lang-switcher {
  display: inline-flex;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.2rem;
  gap: 0.15rem;
}

.admin-lang-switcher-prelogin {
  margin: 0 auto 1.5rem;
  display: flex;
  width: fit-content;
}

.admin-lang-btn {
  background: transparent;
  border: none;
  color: var(--color-text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition);
}

.admin-lang-btn:hover {
  color: var(--color-text);
}

.admin-lang-btn.active {
  background: var(--color-accent);
  color: var(--color-bg);
}

/* ===========================================
   Honeypot — invisible to humans, traps bots
   =========================================== */
.honeypot {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  /* Also exclude from tab order so screen readers / keyboard users skip it */
  opacity: 0;
  pointer-events: none;
}

/* ============================================================================
   Pop-up calendar — futuristic + Apple-inspired
   Used on book-test-drive.html and book-service.html.
   Becomes an iOS-style bottom sheet on viewports ≤ 540px.
   ============================================================================ */

/* ---------- TRIGGER ---------- */
/* ============================================================================
   INLINE DATE + TIME SCHEDULER (booking forms)
   Desktop: calendar pane + slots pane side by side.
   Mobile:  swipable date rail + slots below — minimal scrolling.
   ============================================================================ */

/* Booking pages get a wider column so the two-pane scheduler breathes. */
.form-page-wide {
  max-width: 880px;
}

/* The scheduler replaces the old date+time pair, whose .form-row split the
   width into two columns — collapse it so the widget gets the full row. */
.form-row.dp-host-row {
  grid-template-columns: 1fr;
}

.dp-inline {
  display: grid;
  grid-template-columns: 292px 1fr;
  gap: 1.1rem;
  padding: 1.1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.015) 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
}

/* ---------- CALENDAR PANE (desktop) ---------- */
.dp-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding: 0 0.1rem;
}

.dp-cal-navs {
  display: flex;
  gap: 0.4rem;
}

.dp-month-label {
  font-weight: 600;
  color: var(--color-text);
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.dp-nav {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1),
    background 160ms ease,
    border-color 160ms ease;
}

.dp-nav:hover:not(:disabled) {
  background: rgba(0, 212, 255, 0.14);
  border-color: rgba(0, 212, 255, 0.36);
  transform: scale(1.06);
}

.dp-nav:active:not(:disabled) {
  transform: scale(0.92);
}

.dp-nav:disabled {
  opacity: 0.22;
  cursor: not-allowed;
}

.dp-nav:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.30);
}

.dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 0.68rem;
  color: var(--color-text-dim);
  text-align: center;
  padding: 0.4rem 0 0.3rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.dp-grid.dp-slide-left {
  animation: dp-slide-left 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dp-grid.dp-slide-right {
  animation: dp-slide-right 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes dp-slide-left {
  from {
    opacity: 0;
    transform: translateX(18px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes dp-slide-right {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.dp-day {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text);
  padding: 0;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1),
    background 160ms ease, color 160ms ease;
}

.dp-day:hover:not(:disabled) {
  background: rgba(0, 212, 255, 0.10);
  transform: scale(1.08);
}

.dp-day:active:not(:disabled) {
  transform: scale(0.92);
}

.dp-day:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.45);
}

.dp-day-outside {
  color: rgba(255, 255, 255, 0.14);
}

.dp-day-disabled {
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.16);
}

.dp-day-disabled:hover {
  transform: none;
  background: transparent;
}

.dp-day-today:not(.dp-day-selected) {
  border-color: rgba(0, 212, 255, 0.45);
}

.dp-day-full {
  color: rgba(248, 113, 113, 0.55);
}

.dp-day-full::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: rgba(248, 113, 113, 0.85);
  border-radius: 50%;
}

.dp-day-selected {
  background: linear-gradient(135deg, #00d4ff 0%, #0098cc 100%);
  color: #0a0e1a;
  font-weight: 700;
  box-shadow:
    0 6px 18px rgba(0, 212, 255, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
}

.dp-day-selected:hover {
  transform: scale(1.08);
}

/* ---------- DATE RAIL (mobile) ---------- */
.dp-rail-wrap {
  display: none;
  margin: -0.2rem -0.35rem 0;
  /* A grid item's min-width defaults to its content's width — without this
     the rail's months of day chips stretch the page sideways instead of
     scrolling inside the rail. */
  min-width: 0;
  max-width: 100%;
}

.dp-rail {
  display: flex;
  align-items: stretch;
  gap: 6px;
  overflow-x: auto;
  padding: 0.2rem 0.35rem 0.55rem;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.dp-rail::-webkit-scrollbar {
  display: none;
}

.dp-rail-month {
  flex: 0 0 auto;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  padding: 0.3rem 0.1rem;
  align-self: center;
}

.dp-rail-day {
  flex: 0 0 auto;
  scroll-snap-align: center;
  appearance: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 56px;
  padding: 0.55rem 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
  transition: transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1),
    background 160ms ease, border-color 160ms ease;
}

.dp-rail-day:active {
  transform: scale(0.94);
}

.dp-rail-dow {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-dim);
}

.dp-rail-num {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dp-rail-day-selected {
  background: linear-gradient(135deg, #00d4ff 0%, #0098cc 100%);
  border-color: transparent;
  box-shadow:
    0 6px 18px rgba(0, 212, 255, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.dp-rail-day-selected .dp-rail-dow,
.dp-rail-day-selected .dp-rail-num {
  color: #0a0e1a;
}

.dp-rail-day-full {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---------- SLOTS PANE ---------- */
.dp-slots-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dp-slots-pane.dp-anim-in {
  animation: dp-fade-up 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes dp-fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dp-slots-day {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
  padding-bottom: 0.65rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dp-slots-scroll {
  overflow-y: auto;
  max-height: 322px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.20) transparent;
}

.dp-slots-scroll::-webkit-scrollbar {
  width: 6px;
}

.dp-slots-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
}

.dp-group+.dp-group {
  margin-top: 0.9rem;
}

.dp-group-label {
  font-size: 0.7rem;
  color: var(--color-text-dim);
  margin-bottom: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dp-group-label::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-accent);
}

.dp-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  gap: 6px;
}

.dp-slot {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  padding: 0.6rem 0.5rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform 160ms cubic-bezier(0.34, 1.56, 0.64, 1),
    background 140ms ease, border-color 140ms ease;
}

.dp-slot:hover {
  background: rgba(0, 212, 255, 0.10);
  border-color: rgba(0, 212, 255, 0.34);
  transform: scale(1.05);
}

.dp-slot:active {
  transform: scale(0.94);
}

.dp-slot:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.45);
}

.dp-slot-selected {
  background: linear-gradient(135deg, #00d4ff 0%, #0098cc 100%);
  color: #0a0e1a;
  border-color: transparent;
  box-shadow:
    0 6px 18px rgba(0, 212, 255, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.dp-slot-selected:hover {
  transform: scale(1.05);
}

.dp-slots-note {
  font-size: 0.85rem;
  color: var(--color-text-dim);
  padding: 1rem 0.25rem;
}

/* ---------- SUMMARY BAR (appears once a slot is picked) ---------- */
/* display:flex overrides the UA [hidden] rule — restore it or the bar
   shows as an empty pill before any time is picked. */
.dp-summary[hidden] {
  display: none;
}

.dp-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.7rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.12) 0%, rgba(0, 212, 255, 0.04) 100%);
  border: 1px solid rgba(0, 212, 255, 0.30);
  border-radius: 13px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text);
}

.dp-summary-check {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #00d4ff 0%, #0098cc 100%);
  color: #0a0e1a;
  border-radius: 50%;
}

.dp-summary-pop {
  animation: dp-summary-pop 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dp-summary-pop {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }

  60% {
    opacity: 1;
    transform: translateY(-1px) scale(1.01);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
  .dp-inline {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    padding: 0.85rem;
  }

  /* Mobile: swipable rail instead of the month grid — one compact row. */
  .dp-cal {
    display: none;
  }

  .dp-rail-wrap {
    display: block;
  }

  .dp-slots-scroll {
    max-height: 248px;
  }

  .dp-slot {
    padding: 0.75rem 0.5rem;
    font-size: 0.88rem;
  }
}

@media (min-width: 641px) {
  .dp-rail-wrap {
    display: none;
  }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {

  .dp-grid,
  .dp-slots-pane,
  .dp-summary {
    animation: none !important;
  }

  .dp-day,
  .dp-slot,
  .dp-rail-day,
  .dp-nav {
    transition: none !important;
  }
}


/* ============================================================================
   ✦ POLISH LAYER ✦
   Apple-inspired refinements applied across all pages.
   Lives at the END so it overrides earlier rules where intentional.
   ============================================================================ */

/* ---------- TYPOGRAPHY: tighter, smarter scale ---------- */
:root {
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- STICKY HEADER WITH BACKDROP BLUR ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 14, 26, 0.55);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 400ms var(--ease-out-quart),
    border-color 400ms var(--ease-out-quart),
    box-shadow 400ms var(--ease-out-quart);
}

.site-header.is-scrolled {
  background: rgba(10, 14, 26, 0.88);
  border-bottom-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

/* Nav link underline grow */
.nav-links a {
  position: relative;
  padding: 0.25rem 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 320ms var(--ease-out-quart);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}


/* ---------- HERO: parallax-ready + smoother gradient ---------- */
.hero-cinematic {
  will-change: transform;
}

.bg-video,
.video-stage {
  transition: transform 80ms linear;
  /* parallax (JS sets transform) */
}

.hero-cinematic .hero-content {
  /* Slight upward drift counter-balances parallax for a hero-anchored feel */
  will-change: transform, opacity;
}

/* Headline char-reveal — wraps each character into its own span (JS does this) */
.char-reveal {
  display: inline-block;
}

.char-reveal .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em);
  transition: opacity 720ms var(--ease-out-quart),
    transform 720ms var(--ease-out-quart);
}

.char-reveal .char.in {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll hint subtle bounce + opacity-on-scroll (JS toggles) */
.scroll-hint {
  transition: opacity 320ms var(--ease-out-quart);
}

.scroll-hint.dim {
  opacity: 0;
}


/* ---------- BUTTONS: subtle gradient + glow ---------- */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform 280ms var(--ease-spring),
    box-shadow 320ms var(--ease-out-quart),
    background 280ms var(--ease-out-quart),
    border-color 280ms var(--ease-out-quart);
}

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

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn.btn-primary {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: #0a0e1a;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(0, 212, 255, 0.28);
}

.btn.btn-primary:hover {
  box-shadow: 0 12px 32px rgba(0, 212, 255, 0.42), 0 0 0 1px rgba(0, 212, 255, 0.50);
}

/* Sheen sweep across primary button on hover */
.btn.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -120%;
  width: 60%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: skewX(-18deg);
  transition: left 700ms var(--ease-out-quart);
  pointer-events: none;
}

.btn.btn-primary:hover::before {
  left: 120%;
}


/* ---------- CARDS: tactile lift + accent edge ---------- */
.feature {
  transition: transform 360ms var(--ease-out-quart),
    border-color 360ms var(--ease-out-quart),
    box-shadow 360ms var(--ease-out-quart),
    background 360ms var(--ease-out-quart);
  position: relative;
}

.feature::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 360ms var(--ease-out-quart);
  pointer-events: none;
}

.feature:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 212, 255, 0.35);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 212, 255, 0.15);
}

.feature:hover::before {
  opacity: 1;
}

.feature-icon {
  transition: transform 360ms var(--ease-spring);
}

.feature:hover .feature-icon {
  transform: scale(1.08) rotate(-3deg);
}

/* Vehicle / inventory cards — same treatment */
.vehicle-card {
  transition: transform 360ms var(--ease-out-quart),
    box-shadow 360ms var(--ease-out-quart),
    border-color 360ms var(--ease-out-quart);
}

.vehicle-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.40);
  border-color: rgba(0, 212, 255, 0.35);
}

.vehicle-card img,
.vehicle-card picture img {
  transition: transform 700ms var(--ease-out-quart);
}

.vehicle-card:hover img,
.vehicle-card:hover picture img {
  transform: scale(1.05);
}


/* ---------- SECTIONS: smoother breathing room ---------- */
.section {
  padding: 6rem 1.5rem;
}

.section-header {
  margin: 0 auto 3.5rem;
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.section-header p {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.6;
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}


/* ---------- MOBILE: spacing tighter, touch targets larger ---------- */
@media (max-width: 768px) {
  .section {
    padding: 4rem 1.25rem;
  }

  .section-header {
    margin-bottom: 2.5rem;
  }

  .hero-cinematic {
    min-height: 88vh;
    padding: 0 1.25rem;
  }

  .hero-cinematic h1 {
    font-size: clamp(2.2rem, 9vw, 3.2rem);
    margin-bottom: 1.25rem;
  }

  .hero-cinematic .hero-subtitle {
    font-size: 1.02rem;
    margin: 0 auto 2rem;
  }

  .hero-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }

  .hero-actions .btn {
    width: 100%;
  }

  /* Buttons get larger touch targets on phones */
  .btn {
    padding: 0.95rem 1.5rem;
    font-size: 1rem;
  }

  /* Feature cards: comfortable single column with rhythm */
  .feature-grid {
    gap: 1rem;
  }

  .feature {
    padding: 1.5rem;
  }

  /* Vehicle grid: single column on small phones */
  .vehicle-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Footer: less cramped */
  .site-footer {
    padding: 2.5rem 1.25rem 1.5rem;
  }

  .footer-grid {
    gap: 1.5rem;
    margin-bottom: 1.5rem;
  }

  /* Sections with eyebrow + h2 + p — let them breathe */
  .eyebrow {
    font-size: 0.72rem;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 3.25rem 1rem;
  }

  .hero-cinematic h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .hero-cinematic .hero-subtitle {
    font-size: 0.98rem;
    line-height: 1.5;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .feature {
    padding: 1.35rem;
  }

  .scroll-hint {
    bottom: 1.5rem;
    font-size: 0.7rem;
  }
}


/* ---------- LOGO: fluid scaling + max-width clamp ---------- */
.brand-logo {
  max-width: 200px;
}

.brand-logo img,
.brand-logo svg {
  max-width: 100%;
}

@media (max-width: 540px) {
  .brand-logo {
    max-width: 150px;
    height: 32px;
  }
}

@media (max-width: 380px) {
  .brand-logo {
    max-width: 130px;
    height: 28px;
  }
}


/* ---------- IMAGE LOADING ---------- */
img {
  /* Avoid layout jank as images load; let intrinsic dims drive aspect ratio */
  height: auto;
  max-width: 100%;
}

/* Lazy-loaded images get a subtle blur-up effect */
img[loading="lazy"] {
  transition: opacity 360ms var(--ease-out-quart);
}


/* ---------- GLOW PULSE on CTA banner ---------- */
.cta-banner {
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(0, 212, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 50%, rgba(99, 102, 241, 0.10) 0%, transparent 50%);
  animation: cta-glow 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes cta-glow {

  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }

  50% {
    transform: rotate(180deg) scale(1.08);
  }
}

.cta-banner>* {
  position: relative;
  z-index: 1;
}


/* ---------- REVEAL refinement — smoother curve, smarter stagger ---------- */
.is-revealable {
  transition: opacity 900ms var(--ease-out-quart),
    transform 900ms var(--ease-out-quart) !important;
}


/* ---------- SCROLLBAR (webkit) ---------- */
@media (hover: hover) {
  ::-webkit-scrollbar {
    width: 10px;
  }

  ::-webkit-scrollbar-track {
    background: var(--color-bg);
  }

  ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.10);
    border-radius: 5px;
    border: 2px solid var(--color-bg);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.30);
  }
}


/* ---------- SECTION HEADER eyebrow underline glow ---------- */
.section-header .eyebrow {
  position: relative;
  padding-bottom: 0.35rem;
}

.section-header .eyebrow::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
}


/* Reduce-motion: cut animations across the polish layer */
@media (prefers-reduced-motion: reduce) {

  .site-header,
  .feature,
  .feature-icon,
  .vehicle-card,
  .vehicle-card img,
  .nav-links a::after,
  .btn,
  .btn.btn-primary::before,
  .char-reveal .char,
  .cta-banner::before,
  .bg-video,
  .video-stage {
    transition: none !important;
    animation: none !important;
  }
}

/* Calendar tab banner (admin internal calendar) */
.cal-banner {
  background: rgba(0, 212, 255, 0.10);
  border: 1px solid rgba(0, 212, 255, 0.30);
  color: var(--color-text-dim);
  padding: 0.65rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 0.9rem;
  line-height: 1.5;
}

.cal-banner strong {
  color: var(--color-text);
}

/* ============================================================================
   ✦ FLOATING SHOWROOM ✦  (Vehicles page rework — scroll-linked shading)
   Driven by CSS vars from scrollfx.js:
     --fx-scroll (page 0→1) · --fx-p (card -1→1) · --fx-shade (card 0→1)
   ============================================================================ */

/* ---------- AMBIENT AURORA (fixed backdrop, drifts + re-hues on scroll) --- */
.fx-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.fx-blob {
  position: absolute;
  width: 65vmax;
  height: 65vmax;
  border-radius: 50%;
  filter: blur(90px) saturate(130%);
  opacity: 0.7;
  will-change: transform;
}

.fx-blob-a {
  top: -25vmax;
  left: -18vmax;
  background: radial-gradient(circle at 35% 35%,
      rgba(0, 212, 255, 0.32) 0%,
      rgba(0, 120, 200, 0.10) 45%,
      transparent 70%);
  transform:
    translate3d(calc(var(--fx-scroll, 0) * 26vw), calc(var(--fx-scroll, 0) * 42vh), 0)
    rotate(calc(var(--fx-scroll, 0) * 40deg));
}

.fx-blob-b {
  bottom: -30vmax;
  right: -20vmax;
  background: radial-gradient(circle at 60% 60%,
      rgba(139, 92, 246, 0.26) 0%,
      rgba(59, 130, 246, 0.10) 45%,
      transparent 70%);
  transform:
    translate3d(calc(var(--fx-scroll, 0) * -22vw), calc(var(--fx-scroll, 0) * -38vh), 0)
    rotate(calc(var(--fx-scroll, 0) * -30deg));
}

/* Whole-page hue shift as you travel down — subtle but alive. The gradient
   is STATIC and only its opacity is scroll-driven: opacity composites on
   the GPU, so this never repaints the viewport per frame. */
.fx-ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      transparent 0%,
      rgba(0, 212, 255, 0.06) 50%,
      rgba(139, 92, 246, 0.09) 100%);
  opacity: calc(0.25 + var(--fx-scroll, 0) * 0.75);
  will-change: opacity;
}

/* ---------- HERO ---------- */
.vh-hero {
  padding: 7.5rem 1.5rem 2.5rem;
  text-align: center;
  position: relative;
}

.vh-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.vh-eyebrow::before,
.vh-eyebrow::after {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.7));
}

.vh-eyebrow::after {
  transform: scaleX(-1);
}

.vh-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.04;
  margin: 0 0 1rem;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.82) 55%, rgba(0, 212, 255, 0.75) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Hero drifts up slightly slower than the page = floaty parallax. */
  transform: translateY(calc(var(--fx-scroll, 0) * 6vh));
}

.vh-hero p {
  color: var(--color-text-dim);
  max-width: 560px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.65;
  transform: translateY(calc(var(--fx-scroll, 0) * 9vh));
}

/* ---------- FILTER BAR (floating glass pill) ---------- */
.filters-float {
  position: sticky;
  top: 76px;
  z-index: 30;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.65rem;
  margin-bottom: 2.2rem;
  background: rgba(16, 20, 32, 0.72);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.filters-float select,
.filters-float input {
  flex: 1 1 150px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--color-text);
  padding: 0.68rem 1.1rem;
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.filters-float select:hover,
.filters-float input:hover {
  background: rgba(255, 255, 255, 0.08);
}

.filters-float select:focus,
.filters-float input:focus {
  outline: none;
  border-color: rgba(0, 212, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

/* ---------- FLOATING VEHICLE CARDS ---------- */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 2rem;
  perspective: 1200px;
}

/* GENERIC float treatment — put .fx-card on any panel and it lives on the
   page: elevation breathes with viewport position (strongest at centre
   stage), a quiet light sweep crosses it as it travels, and on desktop it
   leans gently toward the cursor. Layout/background stay per-component. */
.fx-card {
  --fx-p: 0;
  --fx-shade: 0;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  position: relative;
  box-shadow:
    0 calc(10px + var(--fx-shade) * 26px) calc(28px + var(--fx-shade) * 44px) rgba(0, 0, 0, calc(0.38 + var(--fx-shade) * 0.24)),
    0 2px 8px rgba(0, 0, 0, 0.35),
    0 0 calc(var(--fx-shade) * 54px) rgba(0, 212, 255, calc(var(--fx-shade) * 0.08));
  transform:
    perspective(1200px)
    rotateX(var(--tilt-x)) rotateY(var(--tilt-y))
    translateY(calc(var(--fx-shade) * -7px))
    scale(calc(1 + var(--fx-shade) * 0.012));
  transition: border-color 200ms ease;
  /* transform only — box-shadow isn't compositable, promoting it just
     wastes a layer while the shadow repaints anyway. */
  will-change: transform;
}

/* Legacy hover lifts (translateY) would REPLACE the fx transform and make
   cards jump. Re-express hover as extra lift ON TOP of the fx formula. */
.fx-card.feature:hover,
.fx-card.trim-card:hover {
  transform:
    perspective(1200px)
    rotateX(var(--tilt-x)) rotateY(var(--tilt-y))
    translateY(calc(var(--fx-shade) * -7px - 4px))
    scale(calc(1 + var(--fx-shade) * 0.012));
}

/* Light sweep — a soft diagonal sheen that travels across the card as it
   moves through the viewport. Quiet on purpose. */
.fx-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg,
      transparent 32%,
      rgba(255, 255, 255, 0.035) 46%,
      rgba(0, 212, 255, 0.05) 50%,
      rgba(255, 255, 255, 0.035) 54%,
      transparent 68%);
  background-size: 260% 260%;
  background-position: calc(50% + var(--fx-p) * 120%) 50%;
  mix-blend-mode: screen;
}

.fx-card.vehicle-card {
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.02) 60%),
    rgba(10, 14, 24, 0.80);
  border: 1px solid rgba(255, 255, 255, calc(0.07 + var(--fx-shade) * 0.06));
}

.vehicle-card .vehicle-photo {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(139, 92, 246, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-dim);
  font-size: 0.85rem;
}

/* Inner parallax: the photo glides vertically inside its frame while the
   card scrolls — oversized + translated by the card's viewport position. */
.vehicle-card .vehicle-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.14) translateY(calc(var(--fx-p) * -5%));
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.vehicle-card:hover .vehicle-photo img {
  transform: scale(1.20) translateY(calc(var(--fx-p) * -5%));
}

.vehicle-card .vehicle-badge {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  z-index: 2;
  padding: 0.32rem 0.8rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0a0e1a;
  background: linear-gradient(135deg, #00d4ff, #0098cc);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 212, 255, 0.4);
}

.vehicle-card .vehicle-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.35rem 1.4rem 1.5rem;
  flex: 1;
}

.vehicle-card .vehicle-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.vehicle-card .vehicle-tagline {
  color: var(--color-text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  min-height: 2.7em;
}

.vehicle-card .vehicle-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.vehicle-card .vehicle-spec {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--color-text-dim);
  padding: 0.3rem 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
}

.vehicle-card .vehicle-price {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: -0.01em;
  margin-top: auto;
  padding-top: 0.35rem;
}

.vehicle-card .vehicle-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.65rem;
}

.vehicle-card .vehicle-actions .btn {
  flex: 1;
  text-align: center;
  border-radius: 12px;
}

/* Entrance: cards rise into place, staggered by the reveal engine. */
.fx-card.is-revealable {
  opacity: 0;
  transform: translateY(34px) scale(0.96);
  transition: opacity 640ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 640ms cubic-bezier(0.22, 1, 0.36, 1);
}

.fx-card.is-revealed {
  opacity: 1;
  transform: none;
  /* Hand transform control back to the FX vars after entering. */
  transition: opacity 640ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 640ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {

  .fx-blob,
  .fx-ambient::after {
    transform: none !important;
  }

  .vh-hero h1,
  .vh-hero p {
    transform: none !important;
  }

  .fx-card {
    transform: none !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  }

  .vehicle-card .vehicle-photo img {
    position: static;
    transform: none !important;
  }

  .fx-card::after {
    display: none;
  }
}

/* ---------- SMALL SCREENS ---------- */
@media (max-width: 640px) {

  /* Phones: viewport-scale 90px blur is expensive — soften the aurora
     instead of making the GPU sweat. */
  .fx-blob {
    filter: blur(52px) saturate(120%);
    opacity: 0.5;
  }

  .vh-hero {
    padding-top: 6rem;
  }

  .filters-float {
    border-radius: 20px;
    top: 66px;
  }

  .vehicle-grid {
    gap: 1.4rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   ADMIN DASHBOARD — MOBILE PASS (2026-08-24)
   Staff increasingly use the dashboard from phones (showroom floor,
   mall booths). Everything below only tunes small screens; desktop
   is untouched.
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 720px) {
  /* Tab bar: one swipeable row pinned to the top instead of wrapping
     into a jumble. The tapped tab is scrolled into view by admin.js. */
  #dashboard-view .admin-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-bg);
    margin: 0.75rem -1.5rem 1rem;   /* bleed to the screen edges */
    padding: 0 1rem;
  }
  #dashboard-view .admin-tabs::-webkit-scrollbar { display: none; }
  #dashboard-view .admin-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 48px;
    padding: 0.8rem 0.9rem;
  }

  /* iOS zooms the page when focusing a control whose text is <16px —
     keep dashboard + modal controls at 16px so focus stays put. */
  #dashboard-view input,
  #dashboard-view select,
  #dashboard-view textarea,
  .modal input,
  .modal select,
  .modal textarea {
    font-size: 16px;
  }

  /* Thumb-sized controls everywhere in the dashboard + modals */
  #dashboard-view .btn,
  .modal .btn,
  #dashboard-view select {
    min-height: 44px;
  }

  /* The × delete button on interactions / walk-in case roots is a
     22px circle on desktop — untappable on a phone, and a missed tap
     opens the row behind it instead. Thumb-size it on small screens. */
  .btn-int-del {
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }

  /* Toolbars (All Cases / Customers): search takes a full row, the
     filter selects share rows in halves instead of overflowing. */
  .cust-toolbar input[type="text"] { flex: 1 1 100%; min-width: 0; }
  .cust-toolbar select { flex: 1 1 40%; min-width: 0; }
  /* Custom date pair: its own full row, the two pickers sharing it */
  .cust-toolbar .ac-dates { flex: 1 1 100%; }
  .cust-toolbar input[type="date"] { flex: 1 1 0; min-width: 0; min-height: 44px; }

  /* Booking-tab filter bar: same treatment */
  .filters select, .filters input { flex: 1 1 40%; min-width: 0; }
  .filters input[type="text"], .filters input[type="search"] { flex: 1 1 100%; }

  /* Modals: use the whole screen comfortably */
  .modal-overlay { padding: 0.75rem 0.5rem; }
  .modal { padding: 1.25rem 1rem; }
  .modal-close { font-size: 1.75rem; padding: 0.25rem 0.6rem; }

  /* Calendar: the time grid scrolls sideways inside its own box so
     week view stays readable; day view fits as-is. */
  #cal-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #cal-body .cal-grid { min-width: 560px; }

  /* Header: keep brand + sign-out on one line; the email shrinks
     with an ellipsis instead of pushing the button off-screen. */
  #admin-user-email {
    max-width: 32vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Card-ified tables on phones. Any table with class rt-cards (booking
   tabs, All Cases) turns each row into a stacked card: the column
   label sits left (from data-label), the value right. Tables WITHOUT
   the class keep their horizontal-scroll fallback. */
@media (max-width: 640px) {
  table.rt-cards { display: block; width: 100%; font-size: 0.95rem; }
  table.rt-cards thead { display: none; }
  table.rt-cards tbody { display: block; width: 100%; }
  table.rt-cards tr {
    display: block;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid var(--color-border);
  }
  table.rt-cards tr:last-child { border-bottom: none; }
  table.rt-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.9rem;
    padding: 0.45rem 0.6rem;
    border-bottom: none;
    white-space: normal;
    text-align: right;
    overflow-wrap: anywhere;
  }
  table.rt-cards td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-dim);
    text-align: left;
  }
  table.rt-cards td:empty { display: none; }
  /* Controls inside a card row shouldn't stretch the whole width */
  table.rt-cards td select { max-width: 62%; }
}

/* ═══════════════════════════════════════════════════════════════════
   ADMIN LINE INBOX (2026-09-02)
   Two panes on desktop (list | thread); one pane at a time on phones,
   toggled by .line-inbox.thread-open. Colours reuse the case palette.
   ═══════════════════════════════════════════════════════════════════ */
.line-inbox {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 1rem;
  min-height: 60vh;
  height: calc(100vh - 220px);
}
.line-list-pane,
.line-thread-pane {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.line-list-tools {
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.line-filters { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.line-filter {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text-dim);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.line-filter.active {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-glow);
}
.line-search {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-size: 16px;   /* iOS: no zoom on focus */
}
.line-list { overflow-y: auto; flex: 1; min-height: 0; }
.line-empty { margin: 1rem; }
.line-item {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--color-border);
  padding: 0.7rem 0.75rem;
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
  min-height: 44px;
}
.line-item:hover { background: var(--color-surface-2); }
.line-item.active { background: var(--color-surface-2); box-shadow: inset 3px 0 0 var(--color-accent); }
.line-item.unread .line-item-name { font-weight: 700; }
.line-item.unread .line-item-preview { color: var(--color-text); }
.line-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.line-item-top { display: flex; align-items: baseline; gap: 0.5rem; }
.line-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.line-item-time { font-size: 0.72rem; color: var(--color-text-dim); white-space: nowrap; }
.line-item-preview { font-size: 0.82rem; color: var(--color-text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-item-meta { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; font-size: 0.72rem; margin-top: 0.15rem; }
.line-item-rep { color: var(--color-text-dim); }
.line-unread {
  background: var(--color-accent);
  color: #0a0e1a;
  border-radius: 999px;
  min-width: 1.35rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  align-self: center;
}
.line-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--color-surface-2);
}
.line-avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--color-accent);
  font-weight: 700;
  border: 1px solid var(--color-border);
}
.line-avatar-lg { width: 46px; height: 46px; }
.line-blocked-dot { font-size: 0.8em; }

/* thread */
.line-thread-empty { margin: auto; color: var(--color-text-dim); padding: 2rem; text-align: center; }
.line-thread-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}
.line-back { display: none; }
.line-thread-title { min-width: 0; }
.line-thread-name { font-weight: 600; font-size: 1.02rem; }
.line-thread-sub { font-size: 0.78rem; color: var(--color-text-dim); }
.line-thread-blocked { color: var(--color-danger); }
.line-thread-case {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--color-text-dim);
}
.line-case-line { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.line-case-line strong { color: var(--color-text); }
.line-hint { font-size: 0.75rem; }
.line-thread-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.line-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(110, 168, 196, 0.06), transparent 70%);
}
.line-msg { max-width: 78%; display: flex; flex-direction: column; gap: 0.2rem; }
.line-msg-in  { align-self: flex-start; align-items: flex-start; }
.line-msg-out { align-self: flex-end;   align-items: flex-end; }
.line-bubble {
  padding: 0.55rem 0.8rem;
  border-radius: 14px;
  font-size: 0.93rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
}
.line-msg-out .line-bubble {
  background: rgba(110, 168, 196, 0.18);
  border-color: rgba(110, 168, 196, 0.35);
  border-bottom-right-radius: 4px;
}
.line-msg-in .line-bubble { border-bottom-left-radius: 4px; }
.line-msg-meta { font-size: 0.7rem; color: var(--color-text-dim); padding: 0 0.3rem; }
.line-msg-failed { font-size: 0.72rem; color: var(--color-danger); padding: 0 0.3rem; }
.line-msg-system {
  align-self: center;
  max-width: 90%;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-dim);
  padding: 0.25rem 0.75rem;
  border: 1px dashed var(--color-border);
  border-radius: 999px;
}
.line-msg-time { opacity: 0.8; }
.line-msg-muted { color: var(--color-text-dim); }
.line-media-img { max-width: min(320px, 100%); max-height: 320px; border-radius: 10px; display: block; cursor: zoom-in; }
.line-media-video { max-width: min(360px, 100%); border-radius: 10px; display: block; }
.line-media-sticker { width: 120px; height: 120px; object-fit: contain; display: block; }
.line-media-file { color: var(--color-accent); text-decoration: underline; }

/* composer */
.line-composer {
  border-top: 1px solid var(--color-border);
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--color-surface);
}
.line-composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 44px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 16px;
}
.line-composer-row { display: flex; align-items: center; gap: 0.75rem; }
.line-sign { font-size: 0.8rem; color: var(--color-text-dim); display: flex; align-items: center; gap: 0.35rem; flex: 1; }
.line-composer-disabled { color: var(--color-text-dim); font-size: 0.85rem; text-align: center; }

/* link picker */
.line-pick {
  display: flex; flex-direction: column; gap: 0.2rem;
  width: 100%; text-align: left;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
}
.line-pick:hover { border-color: var(--color-accent); }
.line-pick-top { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.line-pick-sub { font-size: 0.78rem; color: var(--color-text-dim); }

@media (max-width: 720px) {
  .line-inbox {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 0;
  }
  .line-list-pane { max-height: calc(100vh - 170px); }
  .line-thread-pane { display: none; height: calc(100vh - 150px); }
  .line-inbox.thread-open .line-list-pane { display: none; }
  .line-inbox.thread-open .line-thread-pane { display: flex; }
  .line-back { display: inline-flex; }
  .line-thread-case { margin-left: 0; align-items: flex-start; width: 100%; }
  .line-case-line, .line-thread-actions { justify-content: flex-start; }
  /* The mobile pass makes buttons full-width 44px targets; the header
     actions are secondary, keep them compact so the thread gets the room. */
  #dashboard-view .line-thread-actions .btn,
  #dashboard-view .line-back {
    width: auto;
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
  }
  .line-thread-head { padding: 0.6rem 0.75rem; gap: 0.5rem; }
  .line-avatar-lg { width: 38px; height: 38px; }
  .line-msg { max-width: 88%; }
}

/* ── LINE pairing, photos, posters (2026-09-02) ─────────────────────── */
.line-chip {
  display: inline-flex; align-items: center;
  background: rgba(6, 199, 85, 0.16);
  color: #4ade80;
  border: 1px solid rgba(6, 199, 85, 0.35);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.line-chip:hover { filter: brightness(1.15); }
.line-tools-row { display: flex; gap: 0.5rem; align-items: center; }
.line-tools-row .line-search { flex: 1; }
.line-attach { white-space: nowrap; }
.line-connect { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; }
.line-qr {
  width: 220px; height: 220px;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  display: flex; align-items: center; justify-content: center;
}
.line-qr svg { width: 100%; height: 100%; }
.line-qr-missing { color: #333; font-size: 0.8rem; line-height: 1.4; }
.line-code {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--color-text);
}
.line-connect-hint { color: var(--color-text-dim); font-size: 0.85rem; margin: 0; }
.line-connect-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.line-connect-status { margin: 0; font-size: 0.95rem; }
.line-connect-status.ok { color: #10b981; font-weight: 600; }
.line-connect-status.expired { color: #f59e0b; }
.line-poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.line-poster { position: relative; display: flex; flex-direction: column; gap: 0.3rem; }
.line-poster-pick {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0; overflow: hidden; cursor: pointer;
  aspect-ratio: 1 / 1;
}
.line-poster-pick:hover { border-color: var(--color-accent); }
.line-poster-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.line-poster-name { font-size: 0.72rem; color: var(--color-text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-poster-del {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  border: none; background: rgba(0, 0, 0, 0.65); color: #fff;
  cursor: pointer; font-size: 0.9rem; line-height: 1;
}
@media (max-width: 720px) {
  #dashboard-view .line-attach { width: auto; flex: 0 0 auto; min-height: 36px; padding: 0.35rem 0.6rem; font-size: 0.8rem; }
  .line-composer-row { flex-wrap: wrap; }
  .line-sign { flex-basis: 100%; }
}

/* ── "Connect with LINE" row on the public forms (2026-09-02) ──────────── */
.contact-row .contact-line-box {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.contact-row .contact-line-btn {
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  background: #06c755;
  color: #fff;
  border-color: #06c755;
  white-space: nowrap;
}
.contact-row .contact-line-btn:hover { filter: brightness(1.08); background: #06c755; color: #fff; }
.contact-line-status { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; font-size: 0.92rem; }
/* the [hidden] attribute must beat the display rules above */
.contact-row .contact-line-btn[hidden],
.contact-line-status[hidden] { display: none; }
.contact-line-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.contact-line-tick { color: #4ade80; font-weight: 700; }
.contact-line-label { color: var(--color-text-dim); }
.contact-line-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── LINE setup card (Security tab, superadmin) ───────────────────────── */
.line-setup-card {
  margin-top: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.line-setup-title { margin: 0 0 0.35rem; font-size: 1.05rem; }
.line-setup-help { color: var(--color-text-dim); font-size: 0.85rem; margin: 0 0 0.9rem; }
.line-setup-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.line-setup-result { color: var(--color-text-dim); font-size: 0.85rem; }
.line-danger { color: var(--color-danger); }
.line-danger:hover { border-color: var(--color-danger); }

/* ── Performance tab (case-based rebuild 2026-09-04) ─────────────────── */
.perf-summary { color: var(--color-text-dim); font-size: 0.9rem; margin: -0.5rem 0 1rem; }
.perf-hot { color: #f59e0b; }
.perf-card-role { font-size: 0.72rem; font-weight: 500; color: var(--color-text-dim); margin-left: 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Floating LINE / call buttons (public pages) ─────────────────────── */
.fab-stack { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: 0.6rem; z-index: 800; }
.fab {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 52px; border-radius: 999px; text-decoration: none; font-weight: 700;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); transition: transform var(--transition), filter var(--transition);
}
.fab:hover { transform: translateY(-2px); filter: brightness(1.08); }
.fab-line { background: #06c755; color: #fff; padding: 0 1.1rem 0 0.9rem; font-size: 0.95rem; letter-spacing: 0.02em; }
.fab-call { background: var(--color-surface-2); color: var(--color-text); width: 52px; border: 1px solid var(--color-border); }
@media (min-width: 900px) { .fab-call { display: none; } }

/* ── Booking success screen ───────────────────────────────────────────── */
.booking-success { text-align: center; padding: 1rem 0 0; }
.booking-success-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%;
  background: rgba(16, 185, 129, 0.15); color: #34d399; font-size: 2rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.booking-success h2 { margin: 0 0 0.5rem; }
.booking-success-lead { color: var(--color-text-dim); margin: 0 0 1.25rem; }
.booking-success-rows {
  display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; text-align: left;
  max-width: 420px; margin: 0 auto 1.25rem; padding: 1rem 1.25rem;
  background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-md);
}
.booking-success-rows dt { color: var(--color-text-dim); font-size: 0.85rem; }
.booking-success-rows dd { margin: 0; font-weight: 600; }
.booking-success-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.booking-success-line { border-top: 1px solid var(--color-border); padding-top: 1.25rem; }
.booking-success-line h3 { margin: 0 0 0.35rem; }
.booking-success-line p { color: var(--color-text-dim); font-size: 0.9rem; max-width: 460px; margin: 0 auto 1rem; }
.booking-success-qr { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.booking-success-qr .line-qr { width: 200px; height: 200px; }
.booking-success-code { font-family: var(--font-display); font-size: 2rem; font-weight: 700; letter-spacing: 0.25em; }
.booking-success-linked { color: #34d399; font-weight: 600; }
.booking-success-again { margin-top: 1.5rem; font-size: 0.9rem; }

/* ── Follow-ups, returning customers, LINE waiting time (admin) ────────── */
.case-card-followup { font-size: 0.8rem; margin: 0.15rem 0 0.35rem; color: var(--color-text-dim); }
.fu-overdue { color: #f87171; font-weight: 600; }
.fu-today { color: #fbbf24; font-weight: 600; }
.fu-soon { color: var(--color-text); }
.fu-later { color: var(--color-text-dim); }
.fu-cell { font-size: 0.85rem; }
/* Case priority block on My Cases (owner's rule 2026-09-22) */
.cases-priority { border-left: 3px solid #fbbf24; padding-left: 0.9rem; }
.cases-priority.has-overdue { border-left-color: #f87171; }
.prio-group { margin: 1rem 0 0.45rem; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.02em; }
.prio-overdue { color: #f87171; }
.prio-due { color: #fbbf24; }
.prio-upcoming { color: var(--color-text-dim); }
.case-card-followup.fu-overdue { background: rgba(248, 113, 113, 0.12); border-radius: 6px; padding: 0.2rem 0.45rem; }
.count-pill.count-alert { background: rgba(248, 113, 113, 0.2); color: #f87171; }
.count-pill.count-warn { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
#count-my-cases[hidden] { display: none; }
.prop-deadline.prop-deadline-set { color: var(--color-text); font-weight: 600; }
.returning-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: rgba(167, 139, 250, 0.16); color: #c4b5fd; border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 999px; padding: 0.1rem 0.5rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em;
}
.returning-note {
  background: rgba(167, 139, 250, 0.12); border: 1px solid rgba(167, 139, 250, 0.35); color: #ddd6fe;
  border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; font-size: 0.85rem; margin: -0.5rem 0 1rem;
}
.line-wait { color: var(--color-text-dim); font-size: 0.72rem; white-space: nowrap; }
.line-wait.warn { color: #fbbf24; font-weight: 600; }
.line-wait.late { color: #f87171; font-weight: 700; }

/* ============================================================================
   ADMIN VEHICLES TAB (2026-09-18)
   The service-side car database: due strip, car table, the car window
   (details / owners / service history / insurance & tax / reminders) and
   the reminder-rules panel. Colours reuse the case palette; the table gets
   the rt-cards phone layout like every other admin table.
   ============================================================================ */
.vh-toolbar h2 { font-size: 1.15rem; }
.vh-due-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.vh-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  text-align: left;
  color: var(--color-text);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: all var(--transition);
}
.vh-stat:hover, .vh-stat.active { border-color: var(--color-accent); }
.vh-stat.active { background: var(--color-accent-glow); }
.vh-stat.warn { border-left-color: var(--color-warning); }
.vh-stat.danger { border-left-color: var(--color-danger); }
.vh-stat-num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.vh-stat-label { font-size: 0.85rem; font-weight: 600; }
.vh-stat-sub { font-size: 0.75rem; color: var(--color-text-dim); min-height: 1em; }

.vh-table td { vertical-align: top; }
.vh-vin { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; letter-spacing: 0.04em; color: var(--color-text-dim); }
.vh-sub { display: block; font-size: 0.75rem; color: var(--color-text-dim); white-space: normal; }
.vh-tax { margin-top: 0.3rem; font-size: 0.75rem; color: var(--color-text-dim); }
.vh-owner-chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  margin: 0 0.2rem 0.2rem 0;
  white-space: nowrap;
}
.vh-owner-chip.primary { background: var(--color-accent-glow); color: var(--color-accent); }
.vh-owners-cell { display: flex; flex-wrap: wrap; gap: 0.2rem; min-width: 0; }
.vh-line-ok { color: #06c755; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.vh-line-no { color: var(--color-text-dim); font-size: 0.75rem; white-space: nowrap; }
.vh-due { display: inline-flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.vh-due small { font-size: 0.72rem; font-weight: 600; }
.vh-due-red { color: #fca5a5; }
.vh-due-red small { color: var(--color-danger); }
.vh-due-amber { color: #fcd34d; }
.vh-due-amber small { color: var(--color-warning); }
.vh-due-green { color: var(--color-text); }
.vh-due-green small { color: var(--color-text-dim); font-weight: 400; }
.vh-due-none { color: var(--color-text-dim); }

/* the car window */
.vh-modal { max-width: 860px; }
.vh-modal-sub { margin-top: 0.25rem; font-size: 0.85rem; color: var(--color-text-dim); }
.vh-notice {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  margin: -0.5rem 0 1rem;
}
.vh-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.25rem;
}
.vh-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-dim);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
}
.vh-tab.active { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.vh-tab .count-pill { margin-left: 0.25rem; }
.vh-h3 { font-size: 1rem; margin: 1.25rem 0 0.6rem; }
.vh-h3:first-child { margin-top: 0; }
.vh-muted { color: var(--color-text-dim); font-size: 0.88rem; margin: 0.35rem 0; }
.vh-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 1rem;
}
.vh-grid .form-group { margin-bottom: 0.85rem; }
.vh-grid .form-help { margin-top: 0.3rem; }
.vh-span2 { grid-column: 1 / -1; }
.vh-grid-inner { margin-top: 0.5rem; }
.vh-next-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
}
.vh-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-top: 0.5rem; }
.vh-actions .btn-danger { margin-left: auto; }

.vh-owner {
  border: 1px solid var(--color-border);
  border-left: 3px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.6rem;
  background: rgba(255, 255, 255, 0.02);
}
.vh-owner.primary { border-left-color: var(--color-accent); }
.vh-owner-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.vh-owner-contacts { font-size: 0.85rem; color: var(--color-text-dim); margin-top: 0.3rem; word-break: break-word; }
.vh-owner-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.55rem; }
.vh-past { margin: 0.5rem 0 0; }
.vh-past summary, .vh-add-owner details summary, .vh-rules summary { cursor: pointer; color: var(--color-text-dim); font-size: 0.9rem; }
.vh-add-owner { border: 1px dashed var(--color-border); border-radius: var(--radius-md); padding: 0.9rem; }
.vh-add-owner > input[type="text"] { width: 100%; margin-bottom: 0.5rem; }
.vh-add-owner details { margin: 0.5rem 0 0.75rem; }
.vh-add-owner details > .vh-grid { margin-top: 0.75rem; }
.vh-cust-results { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.5rem; }
.vh-cust-hit {
  text-align: left;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}
.vh-cust-hit:hover { border-color: var(--color-accent); }
.vh-cust-hit span { color: var(--color-text-dim); font-size: 0.82rem; }
.vh-cust-edit { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px dashed var(--color-border); }

.vh-record, .vh-policy { background: rgba(255, 255, 255, 0.02); }

.vh-rules { margin-top: 1.5rem; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 0.85rem 1rem; background: var(--color-surface); }
.vh-rules summary { font-weight: 600; color: var(--color-text); }
.vh-rules-intro { font-size: 0.88rem; color: var(--color-text-dim); margin: 0.75rem 0; }
.vh-rules-table { width: auto; margin-bottom: 0.75rem; }
.vh-rules-table th, .vh-rules-table td { padding: 0.45rem 0.75rem; white-space: nowrap; }
.vh-rules-table input[type="text"] { width: 7rem; padding: 0.3rem 0.5rem; }
.vh-rem-table td { white-space: normal; }

@media (max-width: 720px) {
  /* the filter select's longest option must not widen the toolbar row */
  .vh-toolbar .ac-controls { min-width: 0; max-width: 100%; }
  .vh-toolbar .ac-controls input[type="text"],
  .vh-toolbar .ac-controls select { flex: 1 1 100%; width: 100%; min-width: 0; max-width: 100%; }
  .vh-owner-chip { white-space: normal; }
  .vh-rules-table th, .vh-rules-table td { white-space: normal; padding: 0.4rem 0.35rem; }
  .vh-due-strip { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .vh-stat { padding: 0.6rem 0.7rem; }
  .vh-stat-num { font-size: 1.35rem; }
  .vh-grid { grid-template-columns: 1fr; }
  .vh-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .vh-tabs::-webkit-scrollbar { display: none; }
  .vh-tab { flex: 0 0 auto; min-height: 44px; }
  .vh-actions .btn { flex: 1 1 auto; }
  .vh-actions .btn-danger { margin-left: 0; }
  .vh-owner-actions .btn { min-height: 40px; }
  .vh-rules-table { width: 100%; }
  .vh-rules-table th:first-child, .vh-rules-table td:first-child { white-space: normal; }
  .vh-rules-table input[type="text"] { width: 5.5rem; }
  .vh-due { white-space: normal; }
}
