/* The mobile tools share a quiet surface and one measured, ad-free stage. */
@media (max-width: 1023px) {
    body { --ff-tool-top-clearance: max(16px, var(--ff-mobile-tools-safe-top, env(safe-area-inset-top, 0px))); --ff-tool-bottom-clearance: max(var(--ff-mobile-footer-ad-clearance, 0px), calc(env(safe-area-inset-bottom, 0px) + 12px)); --ff-tool-available-height: calc(100dvh - var(--ff-tool-top-clearance) - var(--ff-tool-bottom-clearance)); --ff-tool-surface: #fff; --ff-tool-text: #111827; --ff-tool-muted: #6b7280; --ff-tool-line: #e5e7eb; --ff-tool-hover: #f3f4f6; --ff-tool-selected: #f0fdfa; --ff-tool-accent: #0f766e; }
    .dark body { --ff-tool-surface: #111827; --ff-tool-text: #f3f4f6; --ff-tool-muted: #9ca3af; --ff-tool-line: #374151; --ff-tool-hover: #1f2937; --ff-tool-selected: #123b38; --ff-tool-accent: #5eead4; }
    .ff-tool-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; border: 1px solid var(--ff-tool-line); border-radius: 16px; background: var(--ff-tool-surface); color: var(--ff-tool-text); box-shadow: 0 8px 24px rgb(0 0 0 / 16%); font-size: 13px; line-height: 1.5; }
    .ff-tool-panel__header { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--ff-tool-line); }
    .ff-tool-panel__header h2 { flex: 1; min-width: 0; margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; }
    .ff-tool-panel__close, .ff-tool-panel__text-action { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--ff-tool-muted); transition: background-color .12s ease, transform .12s ease; }
    .ff-tool-panel__close svg { width: 18px; height: 18px; }
    .ff-tool-panel__text-action { color: var(--ff-tool-accent); font-size: 12px; font-weight: 600; }
    .ff-tool-panel__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 0 16px 16px; }
    .ff-tool-panel__footer { flex: 0 0 auto; padding: 10px 12px; border-top: 1px solid var(--ff-tool-line); }
    .ff-tool-panel__primary { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 10px 12px; border: 0; border-radius: 12px; background: #0f766e; color: #fff; font-size: 14px; font-weight: 600; }
    .ff-tool-panel button:focus-visible, .ff-tool-panel summary:focus-visible, .ff-tool-panel input:focus-visible, .ff-tool-panel select:focus-visible { outline: 2px solid var(--ff-tool-accent); outline-offset: -2px; }
    .ff-tool-panel__close:active, .ff-tool-panel__text-action:active, .ff-tool-panel__primary:active { transform: scale(.96); }
    .ff-filter-overlay { position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
    .ff-mobile-map-options { top: var(--ff-tool-top-clearance); bottom: var(--ff-tool-bottom-clearance); z-index: 4000; --ff-map-options-body-padding-bottom: 12px; }
    .ff-mobile-map-options #map-options-panel { border: 1px solid var(--ff-tool-line); border-radius: 16px 0 0 16px; background: var(--ff-tool-surface); backdrop-filter: none; box-shadow: 0 8px 24px rgb(0 0 0 / 16%); }
    .ff-mobile-map-options #map-options-panel > div:first-child { flex-shrink: 0; padding: 8px 12px; }
    .ff-mobile-map-options #map-options-panel > div:first-child > div > p { display: none; }
    .ff-mobile-map-options #map-options-panel > div:first-child h2 { margin: 0; font-size: 14px; line-height: 20px; letter-spacing: 0; }
    .ff-mobile-map-options #map-options-panel > div:first-child button { min-width: 44px; min-height: 44px; margin: 0; border-radius: 8px; }
    .ff-mobile-map-options #map-options-panel > div:nth-child(2) { padding: 12px; overscroll-behavior: contain; }
    .ff-filter-backdrop { position: absolute; inset: 0 0 var(--ff-tool-bottom-clearance); pointer-events: auto; border: 0; background: rgb(0 0 0 / 8%); opacity: 0; transition: opacity .15s ease; }
    .ff-filter-backdrop.is-open { opacity: 1; }
    .ff-mobile-filter-sheet { position: absolute; bottom: var(--ff-tool-bottom-clearance); left: 12px; right: 12px; width: auto; max-width: 480px; max-height: min(85dvh, var(--ff-tool-available-height)); margin: 0 auto; padding-bottom: 0; pointer-events: none; opacity: 0; transform: translateY(8px); transition: opacity .15s ease, transform .15s cubic-bezier(.2, 0, 0, 1); }
    .ff-mobile-filter-sheet.is-open { pointer-events: auto; opacity: 1; transform: translateY(0); }
    .ff-filter-section { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--ff-tool-line); }
    .ff-filter-section:last-child { border-bottom: 0; padding-bottom: 0; }
    .ff-filter-section h3 { margin: 0 0 8px; font-size: 13px; line-height: 20px; font-weight: 600; }
    .ff-filter-section__heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; margin-bottom: 4px; }
    .ff-filter-section__heading h3 { margin-bottom: 0; }
    .ff-filter-section__heading output { flex-shrink: 0; color: var(--ff-tool-accent); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
    .ff-filter-section input[type="range"] { width: 100%; min-height: 44px; margin: 0; accent-color: #0f766e; }
    .ff-filter-range-scale { display: flex; justify-content: space-between; color: var(--ff-tool-muted); font-size: 12px; }
    .ff-filter-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .ff-filter-choices button, .ff-filter-brands button { min-height: 44px; padding: 8px 10px; border: 1px solid var(--ff-tool-line); border-radius: 8px; background: transparent; color: inherit; font-size: 12px; line-height: 18px; font-weight: 500; transition: background-color .12s ease; }
    .ff-filter-choices button[aria-pressed="true"], .ff-filter-brands button[aria-pressed="true"], .ff-filter-vehicle button[aria-pressed="true"] { background: var(--ff-tool-selected); border-color: var(--ff-tool-accent); color: var(--ff-tool-accent); }
    .ff-filter-brands { display: flex; flex-wrap: wrap; gap: 6px; }
    .ff-filter-hint { margin: 8px 0 0; color: var(--ff-tool-muted); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
    .ff-filter-checks { display: grid; }
    .ff-filter-check { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; width: 100%; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: inherit; text-align: left; font-size: 13px; transition: background-color .12s ease; }
    .ff-filter-check__mark { display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; border: 1px solid var(--ff-tool-line); border-radius: 5px; color: var(--ff-tool-accent); }
    .ff-filter-check__mark svg { width: 16px; height: 16px; visibility: hidden; }
    .ff-filter-check[aria-pressed="true"] { background: var(--ff-tool-selected); }
    .ff-filter-check[aria-pressed="true"] .ff-filter-check__mark { border-color: var(--ff-tool-accent); }
    .ff-filter-check[aria-pressed="true"] .ff-filter-check__mark svg { visibility: visible; }
    .ff-filter-vehicle summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; list-style: none; cursor: pointer; font-size: 13px; font-weight: 600; }
    .ff-filter-vehicle summary::-webkit-details-marker { display: none; }
    .ff-filter-vehicle summary svg { width: 18px; height: 18px; transition: transform .15s ease; }
    .ff-filter-vehicle[open] summary svg { transform: rotate(180deg); }
    .ff-filter-vehicle button { min-width: 44px; min-height: 44px; }
    .ff-filter-vehicle [class*="text-[10px]"], .ff-filter-vehicle [class*="text-[11px]"], .ff-filter-vehicle label { font-size: 12px; line-height: 18px; }
    .ff-filter-vehicle > div { padding-top: 8px; }
    .ff-filter-vehicle [class*="rounded-xl"] { border-radius: 8px; }
    .ff-filter-vehicle .transition-all { transition-property: color, background-color, border-color, transform; }
    .ff-filter-vehicle button:active { transform: scale(.96); }
    @media (hover: hover) { .ff-tool-panel__close:hover, .ff-tool-panel__text-action:hover, .ff-filter-check:not([aria-pressed="true"]):hover, .ff-filter-choices button:not([aria-pressed="true"]):hover, .ff-filter-brands button:not([aria-pressed="true"]):hover { background: var(--ff-tool-hover); } }
}
@media (prefers-reduced-motion: reduce) { .ff-filter-backdrop, .ff-mobile-filter-sheet, .ff-tool-panel button, .ff-filter-vehicle summary svg { transition: none !important; } }
