/* Shared layout rules for the website, app preview, driver app and dialogs. */
html { height: 100%; }
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
button, input, select, textarea { min-width: 0; }
button { line-height: 1.4; }
.logo { padding: 0; flex-shrink: 0; }
textarea:focus-visible { outline: 3px solid #F04C22; outline-offset: 3px; }
#app, .modal { overflow-wrap: anywhere; }
.grid > *, .form-grid > *, .search-fields > *, .row > *,
.detail-layout > *, .sell-layout > *, .checkout-layout > *,
.account-grid > *, .recovery-layout > *, .portal > * { min-width: 0; }
.field { min-width: 0; max-width: 100%; }
.field input, .field select, .field textarea {
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
}
.btn, .text-btn { white-space: normal; text-align: center; }
.btn { max-width: 100%; }
.btn.full + .btn.full { margin-top: 10px; }
.pill { max-width: 100%; line-height: 1.4; }
.price { line-height: 1.3; }
.row.between, .section-head, .portal-top { flex-wrap: wrap; }
.row.between > :first-child, .section-head > :first-child,
.portal-top > :first-child { min-width: 0; }
.section-head .text-btn { flex-shrink: 0; }
.breadcrumb { flex-wrap: wrap; }
.hero, .promo, .garage-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.catalog { grid-template-columns: 220px minmax(0, 1fr); }
.detail-layout { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.sell-layout { grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); gap: 48px; }
.checkout-layout { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.account-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.recovery-layout { grid-template-columns: minmax(320px, 390px) minmax(0, 1fr); }
.spec-grid, .slot-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.slot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.search-fields { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(140px, 170px); }
.tyre-finder .search-fields { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(140px, 160px); }
.research-coverage { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hero-chips, .hero-copy > .row, .promo .actions, .garage-hero .row { flex-wrap: wrap; }
.hero-photo-label { right: 24px; line-height: 1.6; }
.hero-bottom { gap: 16px; }
.hero-bottom > div { min-width: 0; }
.hero-bottom > button { flex-shrink: 0; }
.garage-banner { flex-wrap: wrap; }
.garage-banner > .row { flex: 1 1 250px; min-width: 0; }
.garage-banner > .btn { flex-shrink: 0; }
.garage-banner .icon-box, .booking-card .icon-box, .driver-face { flex-shrink: 0; }
.footer { flex-wrap: wrap; gap: 28px; }
.footer > .row { min-width: 0; }
.choice { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
.choice > * { min-width: 0; }
.choice-price { white-space: normal; max-width: 120px; }
.summary-lines > div, .small-list > div { align-items: flex-start; }
.summary-lines > div > *, .small-list > div > * { min-width: 0; }
.summary-lines strong, .small-list strong { text-align: right; max-width: 65%; }
.summary-lines .total { align-items: center; }
.bullet-list li { align-items: flex-start; line-height: 1.6; }
.check-row { cursor: pointer; }
.check-row input { flex: 0 0 18px; width: 18px; height: 18px; margin-right: 0; }
.compare-check { min-height: 36px; }
.compare-check input { width: 17px; height: 17px; }
.booking-card { flex-wrap: wrap; }
.booking-card > div:not(.actions) { flex: 1 1 200px; }
.booking-card .actions { flex-wrap: wrap; }
.cart-line { grid-template-columns: 64px minmax(0, 1fr) auto; }
.cart-line > * { min-width: 0; }
.cart-line .product-visual { overflow: hidden; }
.quantity { flex-wrap: wrap; gap: 10px; }
.table-wrap { width: 100%; min-width: 0; max-width: 100%; overscroll-behavior-x: contain; }
.table { min-width: 640px; white-space: normal; }
.table th, .table td { line-height: 1.6; }
.table .sub { max-width: 290px; }
.table-wrap::before {
  content: 'Scroll sideways to view every column';
  display: none;
  position: sticky;
  left: 0;
  padding: 12px 16px;
  color: var(--muted);
  background: #3A35350A;
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}

/* The toolbar and app occupy separate rows. Their heights never overlap. */
#reviewbar { flex: 0 0 auto; position: relative; top: auto; min-height: 0; }
.review-inner { padding: 8px 24px; gap: 16px; }
.review-label { min-width: 0; }
.review-roles { min-width: 0; }
.review-roles button { white-space: nowrap; min-height: 34px; }
.review-right { flex-shrink: 0; }
.review-right button { min-height: 34px; }
.review-right .device-toggle { width: 36px; justify-content: center; }
#stage { flex: 1 1 0; min-height: 0; overflow: hidden; }
#app {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  container-type: inline-size;
  container-name: app;
}
.customer-shell { display: flex; flex-direction: column; height: 100%; min-width: 0; }
.app-header { position: relative; top: auto; flex: 0 0 auto; }
.header-inner { gap: 24px; padding: 20px 32px; }
.header-actions { flex-shrink: 0; }
.icon-btn, .avatar { flex-shrink: 0; }
.app-scroll { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
.main { width: 100%; min-width: 0; }
.bottom-nav { flex: 0 0 auto; }
.phone-mode #stage { display: flex; justify-content: center; align-items: center; padding: 24px; }
.phone-mode #app {
  max-width: 426px;
  max-height: 860px;
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 32px;
}
.phone-mode .main { min-height: 0; }
.phone-mode .bottom-nav { position: relative; bottom: auto; }
.tablet-mode #stage { display: flex; justify-content: center; align-items: center; padding: 20px; background: #3A35350B; }
.tablet-mode #app { max-width: 820px; height: 100%; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.compare-dock {
  position: absolute;
  bottom: 20px;
  width: max-content;
  max-width: calc(100% - 32px);
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Each workspace has its own scroll area and a navigation row on tablets. */
.portal { grid-template-columns: 210px minmax(0, 1fr); height: 100%; min-height: 0; }
.portal-sidebar, .portal-main { min-height: 0; overflow-y: auto; }
.portal-sidebar { min-width: 0; }
.portal-nav { min-width: 0; }
.portal-nav button { min-height: 44px; }
.portal-top { gap: 20px; align-items: flex-start; }
.portal-top > .sort { max-width: 100%; min-height: 44px; }
.stat .value { line-height: 1.25; }
.chart-bars { gap: 12px; }
.chart-bar { min-width: 0; }

/* Dedicated driver app: fixed navigation, independently scrolling job content. */
.driver-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-height: 0;
  padding: 24px;
}
.driver-shell {
  display: flex;
  flex-direction: column;
  width: 430px;
  max-width: 100%;
  height: 100%;
  max-height: 860px;
  min-height: 0;
  margin: 0;
  container-type: inline-size;
  container-name: app;
}
.driver-top, .driver-bottom { flex: 0 0 auto; }
.driver-top { gap: 12px; }
.driver-scroll { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
.driver-bottom { position: relative; bottom: auto; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.driver-bottom button { min-height: 44px; min-width: 58px; }
.driver-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.driver-stats strong { line-height: 1.4; }
.driver-map { min-height: 240px; }
.driver-map .map-svg { min-height: 240px; height: 240px; }
.driver-profile { gap: 12px; }
.driver-profile > div { min-width: 0; }
.demo-controls > .btn { margin: 4px 4px 0 0; }
.toggle { flex-shrink: 0; }
.phone-mode .driver-container { padding: 0; }
.phone-mode .driver-shell { max-width: none; border: 0; border-radius: 0; box-shadow: none; }
.map { min-width: 0; container-type: inline-size; container-name: map; }
.map-badge { max-width: calc(100% - 36px); line-height: 1.5; }
.map-overlay-label { max-width: calc(100% - 34px); line-height: 1.5; }
.map-legend { max-width: calc(100% - 40px); }

/* Dialogs use the same container breakpoints as the app, including in preview. */
.modal-backdrop {
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}
.modal {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
  padding: 0;
  overflow: hidden;
  container-type: inline-size;
  container-name: app;
}
.modal-head { flex: 0 0 auto; margin: 0; padding: 24px; border-bottom: 1px solid var(--line); gap: 16px; }
.modal-head h2 { min-width: 0; line-height: 1.35; }
.modal-head .icon-btn { width: 44px; height: 44px; }
.modal-body { min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; padding: 24px; }
.modal-body > .btn.full + .btn.full, .driver-offer > .btn.full + .btn.full { margin-top: 10px; }
.phone-mode .modal:not(.wide) { max-width: 426px; }
.research-card { grid-template-columns: minmax(130px, 180px) minmax(0, 1fr); }
#toast { width: max-content; max-width: min(520px, calc(100vw - 32px)); text-align: center; line-height: 1.5; }

@media (max-width: 1180px) {
  .review-description { display: none; }
}
@media (max-width: 960px) {
  .review-inner { flex-wrap: wrap; gap: 8px; padding: 8px 16px; }
  .review-roles { order: 3; flex-basis: 100%; justify-content: center; }
  .review-roles button { flex: 1; }
}
@media (max-width: 750px) {
  .review-inner { padding: 6px 12px; gap: 5px 8px; }
  .review-label { font-size: 11px; }
  .review-right .device-toggle { display: none; }
  .review-right button { font-size: 10px; min-height: 38px; padding: 4px; }
  .review-roles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
  .review-roles button { min-height: 44px; font-size: 11px; padding: 7px 4px; white-space: normal; }
  .phone-mode #stage { padding: 0; }
  .phone-mode #app { max-width: none; max-height: none; border: 0; border-radius: 0; box-shadow: none; }
  .tablet-mode #stage { padding: 0; }
  .tablet-mode #app { max-width: none; border: 0; border-radius: 0; box-shadow: none; }
  .driver-container { padding: 0; background: #FEFEFE; }
  .driver-shell { width: 100%; max-width: none; max-height: none; border: 0; border-radius: 0; box-shadow: none; }
  .modal-backdrop { padding-left: 10px; padding-right: 10px; }
  .modal { border-radius: 18px; }
  #toast { bottom: calc(90px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .review-label { font-size: 10px; gap: 5px; }
  .review-roles button { font-size: 10px; }
}

@container app (max-width: 1180px) {
  .header-inner { gap: 16px; padding: 18px 24px; }
  .nav { gap: 17px; }
  .nav button { font-size: 12px; }
  .header-actions { gap: 10px; }
  .header-actions .location { display: none; }
  .hero { gap: 32px; }
  .hero h1 { font-size: 50px; }
}
@container app (max-width: 1100px) {
  .nav { display: none; }
  .mobile-menu { display: inline-flex; }
  .header-actions .avatar { display: none; }
  .header-actions .icon-btn { width: 44px; height: 44px; }
  .main { padding: 30px 28px 48px; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-main .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h1 { font-size: 46px; }
  .hero-image { height: 370px; }
  .sell-layout { gap: 30px; }
  .sell-story h1 { font-size: 44px; }
  .portal-main { padding: 28px 24px; }
  .portal-main .grid { gap: 16px; }
  .stat { padding: 18px; }
  .stat .value { font-size: 26px; }
}
@container app (max-width: 960px) {
  .portal { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .portal-sidebar { padding: 16px 20px 12px; gap: 14px; border-right: 0; border-bottom: 1px solid var(--line); overflow: hidden; }
  .portal-sidebar > div:first-child { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .portal-name { text-align: right; }
  .portal-sidebar .portal-name { margin-top: 0; }
  .portal-sidebar .sidebar-footer { display: none; }
  .portal-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; gap: 6px; }
  .portal-nav button { flex: 0 0 auto; white-space: nowrap; padding: 10px 12px; font-size: 12px; }
  .portal-main .grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .portal-main .map, .portal-main .map .map-svg { min-height: 350px; height: 350px; }
  .spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog { grid-template-columns: 190px minmax(0, 1fr); gap: 20px; }
  .catalog .cars-grid { grid-template-columns: minmax(0, 1fr); }
  .cars-grid.grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3.product-grid, .grid.cols-3.plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container app (max-width: 850px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 24px; }
  .hero h1 { max-width: 620px; font-size: 49px; }
  .hero-image { height: 320px; }
  .hero-copy { padding: 0; }
  .search-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-fields > .btn { width: 100%; }
  .tyre-finder .search-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tyre-finder .search-fields > .btn { grid-column: 1 / -1; }
  .category-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sell-layout, .detail-layout, .account-grid, .checkout-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .detail-card { position: static; }
  .detail-gallery > img { height: 340px; }
  .sell-story .steps-list { display: none; }
  .sell-story > .card { margin-top: 20px !important; }
  .sell-story h1 { font-size: 42px; }
  .promo, .garage-hero { grid-template-columns: minmax(0, 1fr); }
  .promo-art { min-height: 180px; }
  .garage-hero img { height: 240px; }
  .recovery-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 18px; }
  .recovery-layout > .map { grid-row: 1; min-height: 280px; height: 280px; }
  .recovery-layout > .map .map-svg { min-height: 280px; height: 280px; }
  .recovery-panel { grid-row: 2; width: 100%; }
}
@container app (max-width: 750px) {
  .header-inner { padding: 12px 18px; gap: 12px; }
  .logo { font-size: 25px; }
  .header-actions { gap: 8px; }
  .header-actions .recovery-cta { min-height: 44px; font-size: 11px; padding: 10px 12px; gap: 6px; }
  .main { padding: 26px 20px 36px; }
  .row { flex-wrap: wrap; }
  .btn, .btn.small, .chip, .slot { min-height: 44px; }
  .text-btn { min-height: 40px; }
  .check-row { min-height: 44px; padding-top: 4px; padding-bottom: 4px; }
  .field input, .field select, .field textarea { font-size: 16px; min-height: 48px; }
  .field label, .label { font-size: 12px; }
  .field .help { font-size: 11px; }
  .hero h1 { font-size: 44px; }
  .hero p { font-size: 14px; margin: 16px 0 22px; }
  .hero-image { height: 280px; border-radius: 20px; }
  .hero-chips { gap: 10px 16px; font-size: 11px; }
  .hero-photo-label { left: 18px; top: 18px; right: 18px; font-size: 10px; }
  .hero-bottom { left: 18px; right: 18px; bottom: 18px; }
  .hero-bottom h3 { font-size: 18px; }
  .search-panel { padding: 0 18px 18px; margin-top: 24px; }
  .tabs { gap: 10px; }
  .tabs button { flex: 1; justify-content: center; font-size: 12px; padding: 16px 2px 13px; gap: 6px; }
  .tabs svg { width: 16px; }
  .search-fields { gap: 14px; }
  .category-row { gap: 10px; margin-top: 22px; }
  .category-tile { padding: 18px 10px; }
  .category-tile strong { font-size: 12px; }
  .category-tile small { font-size: 10px; }
  .section { margin-top: 32px; }
  .section-head { align-items: flex-start; gap: 10px; }
  .section-head h2 { font-size: 25px; }
  .section-head p { font-size: 12px; }
  .section-head .text-btn { font-size: 12px; }
  .grid { gap: 16px; }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .car-card .photo { height: 230px; }
  .car-card .save { width: 44px; height: 44px; }
  .car-content { padding: 18px; }
  .car-foot { gap: 10px; flex-wrap: wrap; }
  .compare-check { min-height: 44px; }
  .promo h2 { font-size: 30px; }
  .dark-surface { padding: 24px; }
  .service-card { padding: 18px; min-height: 160px; }
  .service-card h3 { font-size: 14px; }
  .service-card p { font-size: 12px; }
  .footer { align-items: flex-start; margin-top: 36px; gap: 16px; }
  .footer > .row { gap: 8px 16px; }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: relative;
    bottom: auto;
    background: #FEFEFE;
    border-top: 1px solid var(--line);
    z-index: 25;
    padding: 6px 8px max(6px, env(safe-area-inset-bottom));
  }
  .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 58px; font-size: 10px; padding: 5px 0; color: var(--muted); }
  .bottom-nav button.active { color: var(--green); font-weight: 700; }
  .bottom-nav button.recover svg { background: var(--accent); border-radius: 7px; width: 32px; height: 26px; padding: 4px; color: var(--ink); }
  .compare-dock { bottom: calc(86px + env(safe-area-inset-bottom)); gap: 10px; padding: 10px 14px; font-size: 12px; }
  .page-title h1 { font-size: 34px; }
  .page-title p { font-size: 13px; }
  .catalog { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 18px; }
  .filters > .row { grid-column: 1 / -1; }
  .filters .field { margin: 0; }
  .filters .check-row { grid-column: 1 / -1; margin: 0; }
  .filters input, .filters select { font-size: 16px; }
  .catalog .cars-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wizard, .card.pad, .surface, .detail-card { padding: 22px; }
  .wizard h2 { font-size: 25px; }
  .wizard > p { font-size: 13px; }
  .detail-card h1 { font-size: 28px; }
  .detail-card .price { font-size: 32px; }
  .detail-gallery > img { height: 290px; }
  .thumbs { overflow-x: auto; padding-bottom: 4px; }
  .thumbs button { flex-shrink: 0; }
  .sell-story h1 { font-size: 40px; }
  .garage-banner { padding: 18px; gap: 14px; }
  .garage-banner .icon-box { display: none; }
  .garage-banner strong { font-size: 14px; }
  .garage-banner p { font-size: 12px; }
  .tyre-finder { padding: 20px; }
  .product-card .body { padding: 18px; }
  .product-card h3 { font-size: 16px; }
  .product-visual { height: 160px; }
  .recovery-panel { padding: 22px; }
  .map-badge { left: 14px; top: 14px; font-size: 11px; padding: 9px 12px; }
  .garage-hero { padding: 24px; }
  .garage-hero h2 { font-size: 27px; }
  .booking-card { padding: 18px; gap: 12px; }
  .booking-card .actions { width: 100%; margin-left: 0; }
  .booking-card .actions .btn { flex: 1 1 120px; }
  .portal-main { padding: 24px 20px 36px; }
  .portal-main h1 { font-size: 28px; }
  .portal-sidebar { padding: 14px 18px 10px; }
  .portal-sidebar .logo { font-size: 23px; }
  .portal-nav button { font-size: 11px; padding: 10px; gap: 7px; }
  .portal-nav svg { width: 17px; }
  .stat { padding: 18px; }
  .stat .value { font-size: 25px; }
  .table-wrap::before { display: block; }
  .table .btn { min-height: 40px; font-size: 12px; padding: 8px 12px; }
  .research-card { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .research-coverage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .driver-content, .driver-offer { padding: 22px; }
  .driver-content h1 { font-size: 27px; }
  .driver-top { padding: 18px; }
  .driver-top .row { flex-wrap: nowrap; }
}
@container app (max-width: 620px) {
  .cars-grid.grid.cols-3, .catalog .cars-grid, .grid.cols-3.plan-grid { grid-template-columns: minmax(0, 1fr); }
  .grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .garage-hero img { height: 200px; }
  .portal-main .grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
}
@container app (max-width: 480px) {
  .header-inner { padding: 10px 14px; gap: 10px; }
  .header-actions { gap: 5px; }
  .logo { font-size: 23px; }
  .main { padding: 24px 16px 32px; }
  .hero h1 { font-size: 39px; }
  .hero-image { height: 240px; }
  .hero-bottom h3 { font-size: 17px; }
  .hero-bottom p { font-size: 11px; }
  .search-fields, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .tyre-finder .search-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tyre-finder .field select { padding-left: 8px; padding-right: 8px; }
  .tyre-finder { padding: 18px 16px; }
  .filters { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .form-grid { gap: 16px; }
  .grid.cols-3, .grid.cols-3.product-grid { grid-template-columns: minmax(0, 1fr); }
  .category-tile { padding: 17px 8px; }
  .category-tile small { line-height: 1.5; }
  .service-card { padding: 16px; }
  .service-card h3 { font-size: 14px; }
  .service-card p { font-size: 11px; }
  .page-title h1 { font-size: 31px; }
  .sell-story h1 { font-size: 37px; }
  .wizard, .card.pad, .surface, .detail-card { padding: 20px; }
  .wizard h2 { font-size: 24px; }
  .result-price { padding: 18px; }
  .result-price .price { font-size: 30px; }
  .choice { gap: 10px; padding: 14px; }
  .choice-price { grid-column: 2 / -1; margin-left: 0; max-width: none; text-align: left; }
  .summary-lines { padding: 16px; gap: 14px; }
  .summary-lines > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .summary-lines strong { text-align: left; max-width: 100%; }
  .summary-lines .total { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .summary-lines .total strong { text-align: right; }
  .small-list > div { flex-wrap: wrap; gap: 7px 12px; }
  .small-list strong { max-width: 100%; }
  .garage-banner > .btn { width: 100%; }
  .cart-line { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; }
  .cart-line .product-visual { height: 52px; }
  .cart-line > strong { grid-column: 2; }
  .quantity button { min-width: 40px; min-height: 40px; }
  .quantity button[data-action='cart-remove'] { padding: 8px; font-size: 12px !important; }
  .recovery-panel { padding: 20px; }
  .recovery-options { flex-wrap: wrap; }
  .recovery-options button { min-height: 44px; flex-basis: 100px; }
  .recovery-layout > .map, .recovery-layout > .map .map-svg { min-height: 240px; height: 240px; }
  .driver-top { padding: 16px; }
  .driver-content, .driver-offer { padding: 20px; }
  .driver-offer h2 { font-size: 25px; }
  .driver-map, .driver-map .map-svg { min-height: 210px; height: 210px; }
  .driver-stats strong { font-size: 16px; }
  .driver-profile .pill { font-size: 10px; }
  .portal-main { padding: 22px 16px 32px; }
  .portal-main h1 { font-size: 26px; }
  .portal-top > .sort { width: 100%; }
  .portal-top > .sort { font-size: 16px; }
  .portal-sidebar > div:first-child { align-items: flex-start; }
  .portal-sidebar .portal-name { max-width: 110px; font-size: 9px; line-height: 1.5; }
  .portal-main .grid.cols-4 { gap: 12px; }
  .stat { padding: 15px; }
  .stat .value { font-size: 22px; }
  .chart-card { padding: 20px 16px 45px; }
  .chart-bars { gap: 8px; padding-left: 8px; padding-right: 8px; }
  .chart-bar span { font-size: 9px; }
  .modal-head, .modal-body { padding: 18px; }
  .modal-head h2 { font-size: 21px; }
  .modal-head { gap: 12px; }
}
@container app (max-width: 400px) {
  .header-actions .recovery-label { display: none; }
  .header-actions .recovery-cta { width: 44px; padding: 10px; justify-content: center; }
  .hero h1 { font-size: 36px; }
  .hero-bottom h3 { font-size: 16px; }
  .category-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs button { flex-direction: column; font-size: 11px; gap: 4px; }
  .slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-lines .total { grid-template-columns: minmax(0, 1fr); }
  .summary-lines .total strong { text-align: left; }
  .choice { padding: 12px; }
  .page-title h1 { font-size: 29px; }
  .sell-story h1 { font-size: 34px; }
}
@container app (max-width: 360px) {
  .grid.cols-4, .portal-main .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 34px; }
  .hero-copy > .row > .btn { width: 100%; }
  .hero-image { height: 225px; }
  .driver-top .logo { font-size: 21px; }
  .driver-top .row { gap: 6px; }
  .research-coverage { grid-template-columns: minmax(0, 1fr); }
}
@container map (max-width: 560px) {
  .map-legend { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
