/* ================================================================
   mobile-overrides.css — Sub-Agent R — regio.immo — 2026-05-07
   BFSG / WCAG 2.1 AA + Google Mobile-First Index compliance
   Strategy: Central CSS overrides — zero template edits
   18 Templates covered: 00-foundery → 17-list-property
   Breakpoints: 768px (tablet/mobile), 480px (phone)
   ================================================================ */

/* ================================================================
   SECTION 0 — BASE MOBILE RESET (all templates)
   ================================================================ */

@media (max-width: 768px) {

  /* ── 0.1: Box-model sanity ────────────────────────────────── */
  *, *::before, *::after {
    box-sizing: border-box;
  }

  /* No horizontal overflow on body */
  body, #root, .im-app {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* ── 0.2: Tap targets BFSG >= 44px (all interactive) ──────── */
  button,
  a,
  [role="button"],
  .im-btn,
  .im-side-link,
  .im-iconnav button,
  .im-navlink-btn,
  .adm-side-link,
  .adm-tab,
  .adm-topnav-link,
  .im-segment button,
  .im-listing-fav,
  input[type="checkbox"],
  input[type="radio"],
  select {
    min-height: 44px;
    min-width: 44px;
  }

  /* Segment buttons can be smaller in compact controls */
  .im-segment button {
    min-height: 36px;
    min-width: 36px;
  }

  /* ── 0.3: Global form full-width ──────────────────────────── */
  form {
    width: 100% !important;
    max-width: 100% !important;
  }

  .im-input,
  .im-select,
  .im-textarea,
  .im-input-group,
  .adm-field input,
  .adm-field select,
  .adm-field textarea {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 16px; /* Prevent iOS zoom on input focus */
  }

  /* ── 0.4: Tables → horizontal scroll ─────────────────────── */
  .im-table,
  .adm-table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    max-width: 100vw;
    white-space: nowrap;
  }

  .im-table thead,
  .im-table tbody,
  .im-table tr,
  .adm-table thead,
  .adm-table tbody,
  .adm-table tr {
    min-width: max-content;
  }

  /* ── 0.5: Generic grid → 1 col ───────────────────────────── */
  .im-grid.c2,
  .im-grid.c3,
  .im-grid.c4,
  .im-grid.c5 {
    grid-template-columns: 1fr !important;
    gap: var(--s-3) !important;
  }

  /* ── 0.6: Inline style grid overrides (attribute selectors) ─ */
  /* 272px sidebar + content → single column */
  [style*="272px"] {
    grid-template-columns: 1fr !important;
  }

  /* 1fr 370px detail sidebar → stack */
  [style*="370px"] {
    grid-template-columns: 1fr !important;
  }

  /* 1fr 200px detail sidebar → stack */
  [style*="200px"][style*="gridTemplateColumns"] {
    grid-template-columns: 1fr !important;
  }

  /* 2-col grids (1fr 1fr) → single */
  [style*="gridTemplateColumns: '1fr 1fr'"],
  [style*="gridTemplateColumns:'1fr 1fr'"],
  [style*="gridTemplateColumns: \"1fr 1fr\""] {
    grid-template-columns: 1fr !important;
  }

  /* 3-col grids */
  [style*="gridTemplateColumns: '1fr 1fr 1fr'"],
  [style*="gridTemplateColumns:'1fr 1fr 1fr'"],
  [style*="gridTemplateColumns: 'repeat(3"] {
    grid-template-columns: 1fr !important;
  }

  /* repeat(4,1fr) → 2-col on tablet */
  [style*="repeat(4,1fr)"],
  [style*="repeat(4, 1fr)"],
  [style*="repeat(3,1fr)"],
  [style*="repeat(3, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* ── 0.7: Topbar compact ─────────────────────────────────── */
  .im-topbar {
    padding: 0 var(--s-3);
    gap: var(--s-2);
    flex-wrap: nowrap;
  }

  .im-ticker {
    display: none; /* hide market tickers on mobile */
  }

  .im-coords {
    display: none; /* hide coordinates strip on mobile */
  }

  /* Status bar simplified */
  .im-statusbar {
    padding: 0 var(--s-3);
    font-size: var(--fs-3xs);
  }

  .im-statusbar .nav-jump {
    display: none; /* hide keyboard shortcuts hint */
  }

}

/* ================================================================
   SECTION 1 — 00-foundery (Landing Page)
   ================================================================ */

@media (max-width: 768px) {

  /* Hero section — fluid typography */
  .im-h1,
  [class*="foundery"] h1,
  .hero h1 {
    font-size: clamp(1.6rem, 6vw, 2.4rem) !important;
    line-height: 1.25 !important;
  }

  .im-h2 {
    font-size: clamp(1.2rem, 4.5vw, 1.8rem) !important;
  }

  .im-lede {
    font-size: clamp(0.875rem, 3vw, 1rem) !important;
    max-width: 100% !important;
  }

  /* Hero CTA button group → vertical stack */
  .im-main-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: var(--s-3) !important;
  }

  /* Featured properties grid → 1 col */
  .im-grid.c3,
  .im-grid.c2 {
    grid-template-columns: 1fr !important;
  }

  /* Foundery-specific hero buttons */
  .foundery-hero-ctas,
  [class*="hero-cta"] {
    flex-direction: column !important;
    width: 100% !important;
  }

  .foundery-hero-ctas .im-btn,
  [class*="hero-cta"] .im-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Icon nav on topbar → smaller */
  .im-iconnav {
    gap: 0;
  }

  .im-iconnav button {
    width: 40px;
    height: 40px;
    min-height: 40px;
    min-width: 40px;
  }

}

/* ================================================================
   SECTION 2 — 01-discovery (Search/Browse)
   ================================================================ */

@media (max-width: 768px) {

  /* Discovery shell → single column */
  .im-shell {
    grid-template-columns: 1fr !important;
  }

  /* Sidebar → hidden by default, toggleable */
  .im-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -100% !important;
    width: 280px !important;
    height: 100vh !important;
    z-index: 200 !important;
    transition: left 0.3s ease !important;
    overflow-y: auto !important;
    padding-top: var(--s-7) !important;
  }

  .im-sidebar.is-open {
    left: 0 !important;
  }

  /* Filter bar full-width */
  .im-filter-dd {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Property cards 1-col */
  [class*="properties-grid"],
  .discovery-grid {
    grid-template-columns: 1fr !important;
  }

  /* Map area → full width, reduced height */
  .im-map {
    min-height: 240px !important;
    border-radius: var(--r-md) !important;
  }

}

/* ================================================================
   SECTION 3 — 02-properties (Property Listing with Sidebar Filter)
   ================================================================ */

@media (max-width: 768px) {

  /* ScoreRing → smaller */
  .im-auction-ring {
    width: 60px !important;
    height: 60px !important;
  }

  /* Filter sidebar → drawer overlay */
  /* (im-shell already collapsed above) */

  /* Property score filter cards → 1 col */
  .im-widget {
    width: 100% !important;
  }

}

/* ================================================================
   SECTION 4 — 03-detail (Property Detail Page)
   ================================================================ */

@media (max-width: 768px) {

  /* Main/sidebar split → single column, sidebar goes below */
  .im-page[style*="1fr 370px"],
  .im-page[style*="1fr, 370px"] {
    grid-template-columns: 1fr !important;
  }

  /* Gallery full width */
  .im-listing-img {
    border-radius: 0 !important;
    aspect-ratio: 4/3 !important;
  }

  /* Gallery sub-images → 2-col */
  [style*="gridTemplateRows"][style*="280px"] {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
  }

  /* Specs grid → 2-col then 1-col */
  [style*="repeat(3, 1fr)"][style*="gap"],
  [style*="repeat(3,1fr)"][style*="gap"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Detail aside sticky → static, full-width, margin top */
  aside[style*="sticky"] {
    position: static !important;
    width: 100% !important;
    margin-top: var(--s-5) !important;
  }

  /* Contact form → full width */
  .im-page form,
  aside form {
    width: 100% !important;
  }

}

/* ================================================================
   SECTION 5 — 04-auctions (Auction Listings)
   ================================================================ */

@media (max-width: 768px) {

  /* Auction cards → 1 col */
  [class*="auction"] .im-grid,
  [class*="auction-grid"] {
    grid-template-columns: 1fr !important;
  }

  /* Auction ring / countdown → smaller */
  .im-auction-ring {
    width: 64px !important;
    height: 64px !important;
  }

  /* Bid form → full width */
  [class*="bid-form"],
  [class*="auction"] form {
    width: 100% !important;
  }

}

/* ================================================================
   SECTION 6 — 05-tools (Calculator Tools)
   ================================================================ */

@media (max-width: 768px) {

  /* Tool layout side-by-side → stacked */
  [style*="gridTemplateColumns: '1fr 1fr'"],
  [style*="gridTemplateColumns:'1fr 1fr'"] {
    grid-template-columns: 1fr !important;
  }

  /* Calculator panels full-width */
  .im-card,
  [class*="calc"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Tool tabs → scrollable */
  .im-segment {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
    flex-wrap: nowrap !important;
  }

  /* Result grids → 2 col */
  [class*="result"] .im-grid.c3,
  [class*="results"] [style*="repeat(3"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

}

/* ================================================================
   SECTION 7 — 06-insights (Analytics / Charts)
   ================================================================ */

@media (max-width: 768px) {

  /* Charts container full-width */
  [class*="chart"],
  [class*="insight"],
  .im-heat {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
  }

  /* Heat map → scrollable, min width preserved */
  .im-heat {
    min-width: 320px !important;
  }

  /* KPI grid 4-col → 2-col */
  .im-kpi {
    min-width: 0 !important;
  }

  /* Spark bars → smaller */
  .im-spark {
    height: 28px !important;
  }

}

/* ================================================================
   SECTION 8 — 07-land-projekt (Land Project / Wizard)
   ================================================================ */

@media (max-width: 768px) {

  /* Wizard steps → full width */
  .im-wizard {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .im-wizard-step {
    min-width: 80px !important;
    text-align: center !important;
  }

  /* Land page main content */
  .im-land {
    flex-direction: column !important;
    width: 100% !important;
  }

  .im-land-body {
    width: 100% !important;
    padding: var(--s-4) !important;
  }

  .im-land-sat {
    width: 100% !important;
    min-height: 200px !important;
  }

  /* Map overlay → full width */
  .im-map-overlay {
    position: static !important;
    width: 100% !important;
    border-radius: var(--r-md) var(--r-md) 0 0 !important;
    margin-bottom: 0 !important;
  }

}

/* ================================================================
   SECTION 9 — 08-customer-portal (Customer Dashboard)
   ================================================================ */

@media (max-width: 768px) {

  /* Portal grid → 1 col */
  .im-shell {
    grid-template-columns: 1fr !important;
  }

  /* Tab bar → horizontal scroll */
  .im-segment,
  [class*="tab-bar"],
  [class*="portal-tabs"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
  }

  /* Customer KPIs → 2 col */
  .im-grid.c4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

}

/* ================================================================
   SECTION 10 — 09-admin (Admin Backend)
   ================================================================ */

@media (max-width: 768px) {

  /* Admin shell → sidebar becomes drawer */
  .adm-shell {
    grid-template-columns: 1fr !important;
    position: relative !important;
  }

  /* Sidebar hidden by default */
  .adm-side {
    position: fixed !important;
    left: -260px !important;
    top: 0 !important;
    width: 260px !important;
    height: 100vh !important;
    z-index: 300 !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow-y: auto !important;
  }

  /* Sidebar open state (JS sets .is-open) */
  .adm-side.is-open {
    left: 0 !important;
  }

  /* Overlay backdrop when sidebar open */
  .adm-shell.sidebar-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 299;
  }

  /* Top nav when sidebar=top → scrollable */
  .adm-topnav {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    padding: 0 var(--s-3) !important;
    gap: 2px !important;
  }

  /* Admin head actions → wrap */
  .adm-head-row {
    flex-wrap: wrap !important;
    gap: var(--s-2) !important;
  }

  .adm-head-actions {
    flex-wrap: wrap !important;
    gap: var(--s-2) !important;
    width: 100% !important;
  }

  /* KPI grids: 4-col → 2-col */
  .adm-kpis {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Kanban board → horizontal scroll */
  .adm-kan {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: var(--s-3) !important;
  }

  .adm-kan-col {
    min-width: 240px !important;
    flex-shrink: 0 !important;
  }

  /* Admin table → horizontal scroll wrapper */
  .adm-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
  }

  .adm-table {
    min-width: 600px !important;
  }

  /* Table toolbar → wrap */
  .adm-table-toolbar {
    flex-wrap: wrap !important;
    gap: var(--s-2) !important;
  }

  .adm-table-search {
    width: 100% !important;
  }

  /* Tabs → scrollable */
  .adm-tabs {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    padding: 0 var(--s-3) !important;
  }

  /* Bulk actions → full width */
  .adm-bulk,
  .adm-bulk-actions {
    flex-wrap: wrap !important;
    gap: var(--s-2) !important;
  }

}

/* ================================================================
   SECTION 11 — 10-auth (Login / Register)
   ================================================================ */

@media (max-width: 768px) {

  /* Auth page center → full width */
  .im-page[style*="textAlign:'center'"],
  .im-page[style*="textAlign: 'center'"] {
    padding: var(--s-5) var(--s-4) !important;
  }

  /* Auth card → full width, no max-width constraint */
  .im-page[style*="maxWidth:560"],
  .im-page[style*="maxWidth: 560"] {
    max-width: 100% !important;
    padding: var(--s-4) !important;
  }

  /* Auth form card */
  .im-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  /* Split auth (form | brand panel) → single column */
  .im-page[style*="1fr 1fr"] {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }

  /* Hide decorative brand panel on mobile auth */
  .im-page[style*="1fr 1fr"] > *:last-child[style*="background"] {
    display: none !important;
  }

}

/* ================================================================
   SECTION 12 — 11-compare (Property Comparison)
   ================================================================ */

@media (max-width: 768px) {

  /* Compare tray → compact */
  .cmp-tray-inner {
    flex-wrap: wrap !important;
    gap: var(--s-2) !important;
    padding: var(--s-3) var(--s-4) !important;
  }

  .cmp-tray-slots {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    gap: var(--s-2) !important;
  }

  .cmp-slot {
    min-width: 140px !important;
    flex-shrink: 0 !important;
  }

  /* Compare page: side-by-side → horizontal scroll */
  .cmp-page {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .cmp-grid {
    min-width: max-content !important;
  }

  .cmp-row {
    min-width: max-content !important;
  }

  /* Each compare column min-width */
  .cmp-cell {
    min-width: 160px !important;
    padding: var(--s-2) var(--s-3) !important;
  }

  /* Compare header img → fixed height */
  .cmp-card-img {
    min-height: 120px !important;
  }

  /* Compare actions → stack */
  .cmp-page .im-btn {
    padding: 10px 14px !important;
  }

}

/* ================================================================
   SECTION 13 — 12-saved (Saved Listings)
   ================================================================ */

@media (max-width: 768px) {

  /* Saved grid → 1 col */
  [class*="saved"] .im-grid,
  [class*="saved"] .im-listing {
    width: 100% !important;
  }

  /* Saved tabs → scrollable */
  [class*="saved"] .im-segment {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
  }

}

/* ================================================================
   SECTION 14 — 13-backend / 14-agent / 15-owner / 16-partner
   (All backend portals share adm-* classes — covered by Section 10)
   Additional overrides for portal-specific patterns:
   ================================================================ */

@media (max-width: 768px) {

  /* Split inbox (adm-split) → already has @media 900px in admin.css
     Add a tighter breakpoint for phones: */

  /* Agent/Owner pipeline → horizontal scroll */
  .adm-kan[style*="STAGES"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Partner dual-bank/insurance toggle → stack */
  [class*="partner"] .adm-twk-row {
    flex-direction: column !important;
    gap: var(--s-2) !important;
  }

  [class*="partner"] .adm-twk-row button {
    width: 100% !important;
  }

  /* Backend tool calculator panels → 1 col */
  [class*="backend"] [style*="gridTemplateColumns: '1fr 1fr'"],
  [class*="backend"] [style*="gridTemplateColumns:'1fr 1fr'"] {
    grid-template-columns: 1fr !important;
  }

  /* Audit trail rows → scroll */
  .audit-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: var(--s-2) !important;
  }

  /* Inline KPIs in drawers */
  .adm-drawer .adm-kpis {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Drawer full-height on mobile */
  .adm-drawer {
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    border-radius: var(--r-lg) var(--r-lg) 0 0 !important;
    bottom: 0 !important;
    top: auto !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
  }

  .adm-drawer-bg {
    background: rgba(0, 0, 0, 0.7) !important;
  }

}

/* ================================================================
   SECTION 15 — 17-list-property (List New Property Wizard)
   ================================================================ */

@media (max-width: 768px) {

  /* Wizard progress bar → scrollable */
  .im-wizard {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: var(--s-2) !important;
  }

  .im-wizard-step {
    flex-shrink: 0 !important;
    min-width: 72px !important;
  }

  /* Wizard step content → full width, centered */
  [class*="wizard-content"],
  [class*="step-content"] {
    max-width: 100% !important;
    padding: var(--s-4) !important;
  }

  /* Photo upload grid → 2 col */
  [style*="repeat(auto-fill, minmax(160"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  [style*="repeat(auto-fill, minmax(220"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Form field pairs → single column */
  [style*="repeat(3, 1fr)"][style*="gap"],
  [style*="repeat(4, 1fr)"][style*="gap"] {
    grid-template-columns: 1fr !important;
  }

  /* Navigation buttons (Prev/Next) → full width */
  [class*="wizard-nav"],
  [class*="step-nav"] {
    flex-direction: column !important;
    gap: var(--s-3) !important;
  }

  [class*="wizard-nav"] .im-btn,
  [class*="step-nav"] .im-btn {
    width: 100% !important;
    justify-content: center !important;
  }

}

/* ================================================================
   SECTION 16 — adm-split (Inbox/Split panels — tighter breakpoint)
   ================================================================ */

@media (max-width: 768px) {

  /* adm-split collapses at 900px via admin.css
     Extra phone-only: detail as full-screen sheet */
  .adm-split {
    grid-template-columns: 1fr !important;
    height: auto !important;
    overflow: visible !important;
  }

  .adm-split-list {
    min-height: 40vh !important;
  }

  .adm-split-detail {
    display: none !important;
  }

  .adm-split-detail.is-open {
    display: flex !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 80 !important;
    background: var(--bg-base) !important;
    overflow-y: auto !important;
  }

}

/* ================================================================
   SECTION 17 — Modal / Dialog overlays
   ================================================================ */

@media (max-width: 768px) {

  /* Modals → full-screen bottom sheet */
  .adm-modal {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    border-radius: var(--r-lg) var(--r-lg) 0 0 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
    margin: 0 !important;
  }

  .adm-modal-bg,
  [style*="position:'fixed'"][style*="background:'rgba"],
  [style*="position: 'fixed'"][style*="rgba(0,0,0"] {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  /* Cmd palette → full width */
  .adm-cmd {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
    top: 0 !important;
    left: 0 !important;
    max-height: 70vh !important;
  }

}

/* ================================================================
   SECTION 18 — im-page layout overrides
   ================================================================ */

@media (max-width: 768px) {

  /* Generic im-page padding reduction */
  .im-page {
    padding: var(--s-4) !important;
  }

  /* Page with large padding */
  .im-page[style*="padding:'var(--s-9)"],
  .im-page[style*="padding: 'var(--s-9)"] {
    padding: var(--s-5) var(--s-4) !important;
  }

  /* Main content area padding */
  .im-main {
    padding: var(--s-4) !important;
  }

  .adm-content {
    padding: var(--s-3) !important;
  }

  /* Card padding reduction */
  .im-card {
    padding: var(--s-4) !important;
  }

}

/* ================================================================
   SECTION 19 — 480px Phone (single-column everything)
   ================================================================ */

@media (max-width: 480px) {

  /* All 2-col grids → 1 col */
  .im-grid.c2,
  [style*="repeat(2, 1fr)"],
  [style*="repeat(2,1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* All 3-col and 4-col → 1 col */
  .im-grid.c3,
  .im-grid.c4,
  .im-grid.c5,
  [style*="repeat(3, 1fr)"],
  [style*="repeat(3,1fr)"],
  [style*="repeat(4, 1fr)"],
  [style*="repeat(4,1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Admin KPIs → 1 col on phone */
  .adm-kpis {
    grid-template-columns: 1fr !important;
  }

  /* Buttons → full width in most contexts */
  .adm-head-actions .im-btn,
  .adm-card-body .im-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Topbar brand → simplified */
  .im-brand-version {
    display: none !important;
  }

  /* Hero h1 → small phone */
  .im-h1 {
    font-size: clamp(1.4rem, 8vw, 2rem) !important;
  }

  /* Forms full padding reduction */
  .im-page {
    padding: var(--s-3) !important;
  }

  .im-main {
    padding: var(--s-3) !important;
  }

  /* Listing card meta → wrap */
  .im-listing-meta {
    flex-wrap: wrap !important;
    gap: var(--s-2) !important;
  }

  /* Auth → remove side padding */
  .im-page[style*="560"] {
    padding: var(--s-3) !important;
  }

  /* Compare slots → smaller */
  .cmp-slot {
    min-width: 120px !important;
    height: 44px !important;
  }

  .cmp-slot-img {
    width: 32px !important;
    height: 32px !important;
  }

  /* Wizard step labels → hide, show only icon */
  .im-wizard-step span:last-child {
    display: none !important;
  }

  /* Photo upload → 2 col but smaller */
  [style*="repeat(auto-fill, minmax(160"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Drawer → tighter */
  .adm-drawer-head,
  .adm-drawer-body,
  .adm-drawer-foot {
    padding: var(--s-3) !important;
  }

}

/* ================================================================
   SECTION 20 — Accessibility enhancements (BFSG)
   ================================================================ */

@media (max-width: 768px) {

  /* Focus rings — visible on touch (no :hover) */
  :focus-visible {
    outline: 2px solid var(--accent) !important;
    outline-offset: 2px !important;
  }

  /* Skip link visible on focus */
  .skip-link:focus {
    position: fixed !important;
    top: var(--s-3) !important;
    left: var(--s-3) !important;
    z-index: 9999 !important;
    padding: var(--s-2) var(--s-4) !important;
    background: var(--accent) !important;
    color: var(--text-on-accent) !important;
    border-radius: var(--r-md) !important;
  }

  /* Minimum font-size for readability */
  body {
    font-size: max(14px, 1rem) !important;
  }

  /* Line height for readability */
  p, li, .im-lede, .adm-split-item-preview {
    line-height: 1.6 !important;
  }

  /* Scrollable containers — show scroll indicator */
  .adm-tabs,
  .adm-topnav,
  .im-wizard,
  .cmp-tray-slots,
  .adm-kan {
    scrollbar-width: thin !important;
    scrollbar-color: var(--accent-line) transparent !important;
  }

}

/* ================================================================
   SECTION 21 — Hamburger menu trigger (CSS-only visual hint)
   Mobile sidebar toggle button — shown only on mobile
   ================================================================ */

@media (max-width: 768px) {

  /* Show mobile menu trigger if it has class .mobile-menu-btn */
  .mobile-menu-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    background: var(--bg-raised) !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--r-md) !important;
    cursor: pointer !important;
    color: var(--text-mid) !important;
  }

  /* Hide desktop-only elements */
  .desktop-only {
    display: none !important;
  }

  /* Show mobile-only elements */
  .mobile-only {
    display: block !important;
  }

}

@media (min-width: 769px) {

  /* Ensure mobile-only elements are hidden on desktop */
  .mobile-only {
    display: none !important;
  }

}
