/*
 * MAUTO Home Universal Responsive v371
 * Terminal responsive and interaction layer for the approved v365 home.
 * Keeps the accepted visual composition while removing the fixed 390px phone canvas.
 */

/* The phone surface must follow the real viewport, including 320/360/375/430px. */
.mauto-home-runtime .device-shell[data-device="mobile"] .device-surface,
.mauto-home-runtime .device-shell[data-device="mobile"] .site {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-grid {
  width: calc(100% - 18px) !important;
  min-width: 0 !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-grid > .mobile-dashboard-tile,
.mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-grid > .mobile-dashboard-tile > span {
  min-width: 0 !important;
}

/* Large and compact artwork scales with its card instead of clipping the second column. */
.mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-tile-auto > img,
.mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-tile-parts > img {
  width: min(172px, calc(100% - 4px)) !important;
  height: auto !important;
  max-height: 148px !important;
  object-fit: contain !important;
}

.mauto-home-runtime .device-shell[data-device="mobile"] :is(
  .mobile-dashboard-tile-service,
  .mobile-dashboard-tile-tuning,
  .mobile-dashboard-tile-disassembly,
  .mobile-dashboard-tile-school,
  .mobile-dashboard-tile-dealers,
  .mobile-dashboard-tile-commercial
) > img {
  width: min(96px, 68%) !important;
  height: auto !important;
  max-height: 78px !important;
  object-fit: contain !important;
}

.mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-tile-roadside > img {
  width: min(156px, 46%) !important;
  height: auto !important;
  max-height: 100px !important;
  object-fit: contain !important;
}

/* Compact but permanently available primary navigation on desktop. */
.mauto-home-runtime .mauto-primary-nav-v371 {
  display: none;
}

.mauto-home-runtime .device-shell[data-device="desktop"] .mobile-dashboard-topbar {
  grid-template-columns: auto minmax(0, 1fr) auto auto !important;
  gap: 14px !important;
}

.mauto-home-runtime .device-shell[data-device="desktop"] .mauto-primary-nav-v371 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}

.mauto-home-runtime .device-shell[data-device="desktop"] .mauto-primary-nav-v371 > a,
.mauto-home-runtime .device-shell[data-device="desktop"] .mauto-primary-nav-v371 summary {
  display: inline-flex;
  min-height: 36px;
  padding: 0 8px;
  align-items: center;
  border-radius: 10px;
  color: #34506f;
  font-size: 11px;
  font-weight: 720;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.mauto-home-runtime .device-shell[data-device="desktop"] .mauto-primary-nav-v371 > a:hover,
.mauto-home-runtime .device-shell[data-device="desktop"] .mauto-primary-nav-v371 > a:focus-visible,
.mauto-home-runtime .device-shell[data-device="desktop"] .mauto-primary-nav-v371 summary:hover,
.mauto-home-runtime .device-shell[data-device="desktop"] .mauto-primary-nav-v371 summary:focus-visible {
  outline: 0;
  background: rgba(218, 235, 253, .7);
  color:var(--mauto-ds-color-primary-hover,#3c78da);
}

.mauto-home-runtime .mauto-primary-more-v371 {
  position: relative;
}

.mauto-home-runtime .mauto-primary-more-v371 summary {
  list-style: none;
}

.mauto-home-runtime .mauto-primary-more-v371 summary::-webkit-details-marker {
  display: none;
}

.mauto-home-runtime .mauto-primary-more-v371 summary::after {
  margin-left: 5px;
  content: "⌄";
}

.mauto-home-runtime .mauto-primary-more-menu-v371 {
  position: absolute;
  z-index: 80;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  width: 218px;
  gap: 2px;
  padding: 7px;
  border: 1px solid rgba(82, 140, 204, .25);
  border-radius: 14px;
  background: rgba(252, 254, 255, .98);
  box-shadow:var(--mauto-ds-action-depth);
}

.mauto-home-runtime .mauto-primary-more-menu-v371 a {
  padding: 10px 11px;
  border-radius: 9px;
  color: #294764;
  font-size: 12px;
  font-weight: 680;
  text-decoration: none;
}

.mauto-home-runtime .mauto-primary-more-menu-v371 a:hover,
.mauto-home-runtime .mauto-primary-more-menu-v371 a:focus-visible {
  outline: 0;
  background: #edf6ff;
  color:var(--mauto-ds-color-primary-hover,#3c78da);
}

/* Location and notification controls expose real, keyboard-accessible popovers. */
.mauto-home-runtime .mobile-dashboard-topbar {
  isolation: isolate;
}

.mauto-home-runtime .device-shell .mobile-dashboard-topbar > .mauto-header-popover-v371 {
  position: absolute !important;
  z-index: 90;
  top: calc(100% - 2px);
  display: grid;
  width: min(276px, calc(100% - 8px));
  max-height: min(420px, calc(100dvh - 76px));
  overflow-y: auto;
  overscroll-behavior: contain;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(76, 137, 205, .27);
  border-radius: 16px;
  background: rgba(252, 254, 255, .985);
  box-shadow: 0 22px 48px -28px rgba(16, 50, 89, .65);
  color: #173553;
}

.mauto-home-runtime .device-shell .mobile-dashboard-topbar > .mauto-header-popover-v371[hidden] {
  display: none !important;
}

.mauto-home-runtime .mauto-header-popover-v371 strong {
  font-size: 13px;
  line-height: 1.25;
}

.mauto-home-runtime .mauto-header-popover-v371 p,
.mauto-home-runtime .mauto-header-popover-v371 small {
  margin: 0;
  color: #607a96;
  font-size: 11px;
  line-height: 1.35;
}

.mauto-home-runtime .mauto-city-list-v371,
.mauto-home-runtime .mauto-notice-list-v371 {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mauto-home-runtime .mauto-city-list-v371 button {
  display: flex;
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 10px;
  background: #f2f7fd;
  color: #294764;
  font: inherit;
  font-size: 12px;
  font-weight: 680;
  cursor: pointer;
}

.mauto-home-runtime .mauto-city-list-v371 button[aria-pressed="true"] {
  background: #e2f0ff;
  color:var(--mauto-ds-color-primary,#3c78da);
}

.mauto-home-runtime .mauto-notice-list-v371 li {
  position: relative;
  padding: 8px 8px 8px 22px;
  border-radius: 10px;
  background: #f4f8fd;
  color: #405d7b;
  font-size: 11px;
  line-height: 1.35;
}

.mauto-home-runtime .mauto-notice-list-v371 li::before {
  position: absolute;
  top: 12px;
  left: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1b72dc;
  content: "";
}

/* Terminal touch-target layer: later imported styles cannot shrink these controls. */
.mauto-home-runtime .device-shell[data-device="mobile"] :is(
  .mobile-dashboard-location,
  .mobile-dashboard-actions button,
  .mobile-dashboard-submit,
  .mobile-dashboard-camera,
  .advanced-search-vehicle select,
  .advanced-search-mode button,
  .advanced-search-input,
  .advanced-search-camera,
  .advanced-search-submit,
  #preview-finance-calculator .finance-tabs button,
  #preview-finance-calculator .finance-category button,
  #preview-finance-calculator .finance-input-shell,
  #preview-finance-calculator .finance-range,
  #preview-finance-calculator .finance-action
) {
  min-height: 44px !important;
}

/* Tablet hero fit lock.
 * The source CGI is 2041x770. `cover` cropped its right edge inside the
 * 768px tablet canvas, so the Porsche disappeared behind the viewport and
 * the capability deck. Keep every animated bitmap and mask on one contained
 * registration, then reserve the left safe zone for a smaller deck. */
.mauto-home-runtime .device-shell[data-device="tablet"] .hero-visual > img.scene-layer,
.mauto-home-runtime .device-shell[data-device="tablet"] .hero-visual > .scene-layer > img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
}

.mauto-home-runtime .device-shell[data-device="tablet"] .hero-visual > .scene-layer.internals img {
  transform: none !important;
}

.mauto-home-runtime .device-shell[data-device="tablet"] .hero-visual > :is(
  .scene-layer.matrix,
  .scene-layer.internals,
  .scene-layer.lights,
  .matrix-pixels,
  .protected-car
) {
  -webkit-mask-position: center !important;
  mask-position: center !important;
  -webkit-mask-size: contain !important;
  mask-size: contain !important;
  -webkit-mask-repeat: no-repeat !important;
  mask-repeat: no-repeat !important;
}

/* The protected headlight/wheel paint samples use the same hero bitmap.
 * Their background must follow the contained tablet registration too;
 * otherwise the cover-sized sample appears as detached white ovals. */
.mauto-home-runtime .device-shell[data-device="tablet"] .hero-visual > .protected-car {
  background-position: center center !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
}

.mauto-home-runtime .device-shell[data-device="tablet"] .hero-capability-deck {
  top: 132px !important;
  left: 28px !important;
  width: 282px !important;
  max-width: calc(45% - 28px) !important;
  height: 132px !important;
  border-radius: 18px !important;
}

.mauto-home-runtime .device-shell[data-device="tablet"] .hero-capability-card {
  grid-template-columns: minmax(0, 1fr) 84px !important;
}

.mauto-home-runtime .device-shell[data-device="tablet"] .hero-capability-card > div {
  padding: 12px 2px 10px 14px !important;
}

.mauto-home-runtime .device-shell[data-device="tablet"] .hero-capability-card > div > span {
  font-size: 10px !important;
  line-height: 1.15 !important;
  letter-spacing: .11em !important;
}

.mauto-home-runtime .device-shell[data-device="tablet"] .hero-capability-card > div > p {
  max-width: 184px !important;
  max-height: 3.9em !important;
  margin-top: 6px !important;
  font-size: 10.5px !important;
  line-height: 1.3 !important;
  -webkit-line-clamp: 3 !important;
}

.mauto-home-runtime .device-shell[data-device="tablet"] .hero-card-features {
  max-width: 184px !important;
  max-height: 2.5em !important;
  margin-top: 5px !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
}

.mauto-home-runtime .device-shell[data-device="tablet"] .hero-capability-card > figure img {
  width: 82px !important;
  height: 82px !important;
  max-width: 82px !important;
  max-height: 82px !important;
  object-fit: contain !important;
}

.mauto-home-runtime .device-shell[data-device="mobile"] :is(
  .mobile-dashboard-actions button,
  .mobile-dashboard-camera,
  .advanced-search-camera
) {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
}

.mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-submit {
  width: 44px !important;
  min-width: 44px !important;
}

.mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-search {
  grid-template-columns: 24px minmax(0, 1fr) 44px !important;
  min-height: 56px !important;
  height: auto !important;
}

/* Focus uses an icy fill and caret; browser/OS blue rings stay off form fields. */
.mauto-home-runtime :is(input, select, textarea):focus,
.mauto-home-runtime :is(input, select, textarea):focus-visible {
  outline: 0 !important;
  background-color: #eaf5ff !important;
  box-shadow: none !important;
}

.mauto-home-runtime :is(
  .mobile-dashboard-search,
  .advanced-search-input,
  .finance-input-shell
):focus-within {
  border-color: transparent !important;
  background: #eaf5ff !important;
  box-shadow: none !important;
}

.mauto-home-runtime input:focus::placeholder,
.mauto-home-runtime textarea:focus::placeholder {
  color: transparent !important;
  opacity: 0 !important;
}

@media (max-width: 350px) {
  .mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-topbar {
    grid-template-columns: minmax(0, 1fr) 44px auto !important;
    gap: 4px !important;
    padding-right: 6px !important;
    padding-left: 6px !important;
  }

  .mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-brand {
    gap: 4px !important;
  }

  .mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-brand-name {
    width: 66px !important;
  }

  .mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-location {
    width: 44px !important;
    min-width: 44px !important;
    padding: 0 !important;
    justify-content: center;
  }

  .mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-location > span,
  .mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-location .mobile-dashboard-chevron {
    display: none !important;
  }

  .mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-actions {
    gap: 3px !important;
  }

  .mauto-home-runtime .device-shell[data-device="mobile"] .reference-copy h1 {
    max-width: 150px !important;
    font-size: 19px !important;
  }

  .mauto-home-runtime .device-shell[data-device="mobile"] .hero-title-lockup {
    grid-template-columns: minmax(0, max-content) 28px !important;
  }

  .mauto-home-runtime .device-shell[data-device="mobile"] .hero-title-mark {
    width: 28px !important;
    height: 28px !important;
  }

  .mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-tile small {
    font-size: 10px !important;
  }

  .mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-tile-roadside > span {
    max-width: 58% !important;
  }
}

@media (min-width: 351px) and (max-width: 390px) {
  .mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-topbar {
    gap: 5px !important;
    padding-right: 7px !important;
    padding-left: 7px !important;
  }

  .mauto-home-runtime .device-shell[data-device="mobile"] .mobile-dashboard-brand-name {
    width: 70px !important;
  }
}

@media (max-width: 1320px) and (min-width: 1025px) {
  .mauto-home-runtime .device-shell[data-device="desktop"] .mobile-dashboard {
    padding-right: 24px !important;
    padding-left: 24px !important;
  }

  .mauto-home-runtime .device-shell[data-device="desktop"] .mobile-dashboard-topbar {
    gap: 9px !important;
  }

  .mauto-home-runtime .device-shell[data-device="desktop"] .mauto-primary-nav-v371 > a,
  .mauto-home-runtime .device-shell[data-device="desktop"] .mauto-primary-nav-v371 summary {
    padding-right: 6px;
    padding-left: 6px;
    font-size: 10px;
  }
}

/* Mobile vertical-density pass: keep the tablet proportions while using the
   narrow canvas. This intentionally overrides the old blanket 44px lock that
   made the search and calculator roughly one third taller than designed. */
.mauto-home-runtime #device-shell[data-device="mobile"] .tools-workspace {
  gap: 8px !important;
  padding: 8px 7px 20px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .advanced-search-form {
  padding: 8px !important;
  border-radius: 15px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .advanced-search-form > .advanced-search-heading {
  margin-bottom: 5px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .advanced-search-form > .advanced-search-heading h2 {
  font-size: 19px !important;
  line-height: 1 !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .advanced-search-vehicle {
  gap: 5px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .advanced-search-vehicle label > span {
  margin-bottom: 3px !important;
  font-size: 9px !important;
  line-height: 1.1 !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .advanced-search-vehicle select,
.mauto-home-runtime #device-shell[data-device="mobile"] .advanced-search-vehicle .mauto-premium-select__trigger {
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 9px !important;
  border-radius: 11px !important;
  font-size: 10px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .advanced-search-mode {
  gap: 6px !important;
  margin-top: 5px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .advanced-search-mode button {
  height: 33px !important;
  min-height: 33px !important;
  padding: 0 10px !important;
  border-radius: 11px !important;
  font-size: 10px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .advanced-search-query-row {
  grid-template-columns: minmax(0, 1fr) 82px !important;
  gap: 6px !important;
  margin-top: 5px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .advanced-search-input {
  height: 36px !important;
  min-height: 36px !important;
  padding-left: 9px !important;
  border-radius: 11px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .advanced-search-input input {
  height: 100% !important;
  min-height: 0 !important;
  font-size: 10px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .advanced-search-camera {
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  flex-basis: 32px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .advanced-search-submit {
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 8px !important;
  border-radius: 11px !important;
  font-size: 10px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .tools-secondary-row {
  gap: 9px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .tools-secondary-row .finance-preview {
  margin-top: 10px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .tools-secondary-row .finance-preview-heading {
  margin-bottom: 5px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] .tools-secondary-row .finance-preview-heading h2 {
  font-size: 20px !important;
  line-height: 1 !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator.finance-calculator {
  gap: 5px !important;
  padding: 7px !important;
  border-radius: 15px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-tabs,
.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-category {
  height: 34px !important;
  gap: 6px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-tabs button,
.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-category button {
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 8px !important;
  border-radius: 11px !important;
  font-size: 10px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  margin-top: 5px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-field {
  gap: 3px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator :is(
  .finance-field > span:first-child,
  .finance-term > div > span,
  .finance-term strong
) {
  font-size: 9px !important;
  line-height: 1.15 !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-input-shell {
  height: 35px !important;
  min-height: 35px !important;
  padding: 0 9px !important;
  border-radius: 11px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-input-shell input {
  height: 100% !important;
  min-height: 0 !important;
  font-size: 13px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-term {
  grid-column: 1 / -1 !important;
  gap: 4px !important;
  padding: 5px 8px 4px !important;
  border-radius: 11px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-range {
  height: 24px !important;
  min-height: 24px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-result {
  display: grid !important;
  grid-template-columns: minmax(102px, .78fr) minmax(0, 2fr) !important;
  gap: 6px !important;
  margin-top: 2px !important;
  padding: 8px !important;
  border-radius: 13px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-result-main > span {
  font-size: 8px !important;
  line-height: 1.15 !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-result-main strong {
  font-size: 22px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-result dl {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  margin: 0 !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-result dl > div {
  display: flex !important;
  min-height: 46px !important;
  padding: 2px 5px !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-end !important;
  gap: 2px !important;
  border-top: 0 !important;
  border-left: 1px solid rgba(99, 150, 206, .18) !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-result dl > div:first-child {
  border-left: 0 !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-result :is(dt, dd) {
  min-height: 0 !important;
  margin: 0 !important;
  white-space: normal !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-result dt {
  font-size: 7px !important;
  line-height: 1.08 !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-result dd {
  font-size: 8.5px !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-action {
  min-height: 36px !important;
  margin-top: 1px !important;
  border-radius: 11px !important;
  font-size: 10px !important;
}

.mauto-home-runtime #device-shell[data-device="mobile"] #preview-finance-calculator .finance-disclaimer {
  min-height: 0 !important;
  margin-top: 2px !important;
  font-size: 7.5px !important;
  line-height: 1.2 !important;
}

@media (prefers-reduced-motion: reduce) {
  .mauto-home-runtime .mauto-primary-nav-v371 *,
  .mauto-home-runtime .mauto-header-popover-v371 * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
