/*
 * B CARS 2.0 design system (approved by the owner on 21 November 2026; docs/DESIGN.md).
 * One stylesheet for every area. Mobile first; desktop from 960 px.
 * Logical properties only, so Arabic (rtl) and English (ltr) share every rule.
 * Fonts: Tajawal and Barlow Semi Condensed, self-hosted (SIL Open Font License, public/fonts/OFL-*.txt).
 */

/* ---------- Fonts ---------- */
/* Tajawal 500 is not shipped: body text at 500 renders with the 400 face. */
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-semi-condensed-700-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-semi-condensed-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/tajawal-400-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/tajawal-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/tajawal-700-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/tajawal-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/tajawal-800-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/tajawal-800-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tokens ---------- */
:root {
    /* Brand */
    --red: #C8102E;
    --red-700: #A30D25;
    --red-100: #FAD9DF;
    --red-50: #FDF0F2;
    --navy: #0A1730;
    --navy-800: #14223E;
    --navy-600: #33425F;
    /* Neutrals */
    --muted: #56637A;        /* secondary text: 6.0:1 on white */
    --subtle: #7C889E;       /* icons, inactive navigation */
    --line: #E3E8F1;
    --line-strong: #CBD3E1;
    --surface: #FFFFFF;
    --canvas: #F4F6FA;
    --tint: #EEF2F8;
    /* Semantic */
    --green: #13824A;        /* WhatsApp action, success */
    --green-50: #E6F5EC;
    --amber: #8F5B00;
    --amber-50: #FFF3D9;
    /* Type */
    --font: "Tajawal", "Segoe UI", system-ui, sans-serif;
    --font-num: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
    --t-xs: 0.75rem;   /* 12 */
    --t-sm: 0.8125rem; /* 13 */
    --t-md: 0.9375rem; /* 15: body */
    --t-lg: 1.0625rem; /* 17 */
    --t-xl: 1.25rem;   /* 20 */
    --t-2xl: 1.5rem;   /* 24 */
    --t-3xl: 1.875rem; /* 30 */
    --t-4xl: 2.5rem;   /* 40 */
    /* Space (4 pt) */
    --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s14: 56px; --s18: 72px;
    /* Shape */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 22px;
    --leaf-big: 18px;   /* the B CARS "leaf": two opposite corners rounded */
    --leaf-small: 3px;
    /* Elevation */
    --shadow-card: 0 1px 2px rgba(10, 23, 48, 0.05), 0 6px 18px rgba(10, 23, 48, 0.06);
    --shadow-pop: 0 14px 36px rgba(10, 23, 48, 0.16);
    --shadow-fab: 0 10px 22px rgba(200, 16, 46, 0.34);
    --focus: 0 0 0 3px rgba(200, 16, 46, 0.28);
    --container: 1240px;
    /* Roles that differ between light and dark (owner's request of 21 November 2026) */
    --red-ink: #C8102E;          /* red text */
    --green-ink: #13824A;        /* green text */
    --red-fill-hover: #A30D25;   /* red buttons on hover, both themes */
    --fill-strong: #0A1730;      /* navy blocks with white text */
    --header-bg: rgba(255, 255, 255, 0.96);
    --logo-chip: transparent;    /* behind make logos: white in dark */
    color-scheme: light;
}

/*
 * Dark appearance: chosen on the account page (data-theme="dark"), or the
 * phone's own setting when nothing is chosen (no data-theme). The two blocks
 * hold the same values; keep them in step.
 */
:root[data-theme="dark"] {
    --red-ink: #FF6B7D; --red-700: #FF8A98; --red-100: #4D1622; --red-50: #2B1119;
    --navy: #E7ECF5; --navy-800: #CFD7E6; --navy-600: #A9B4C9;
    --muted: #9EA9BE; --subtle: #7C889E; --line: #243049; --line-strong: #33415E;
    --surface: #121B2E; --canvas: #0A1120; --tint: #18233A;
    --green-ink: #5BD08F; --green-50: #0E2A1D; --amber: #F0B95A; --amber-50: #2E2411;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
    --shadow-pop: 0 14px 36px rgba(0, 0, 0, 0.5);
    --fill-strong: #26385C; --header-bg: rgba(18, 27, 46, 0.96); --logo-chip: #FFFFFF;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --red-ink: #FF6B7D; --red-700: #FF8A98; --red-100: #4D1622; --red-50: #2B1119;
        --navy: #E7ECF5; --navy-800: #CFD7E6; --navy-600: #A9B4C9;
        --muted: #9EA9BE; --subtle: #7C889E; --line: #243049; --line-strong: #33415E;
        --surface: #121B2E; --canvas: #0A1120; --tint: #18233A;
        --green-ink: #5BD08F; --green-50: #0E2A1D; --amber: #F0B95A; --amber-50: #2E2411;
        --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
        --shadow-pop: 0 14px 36px rgba(0, 0, 0, 0.5);
        --fill-strong: #26385C; --header-bg: rgba(18, 27, 46, 0.96); --logo-chip: #FFFFFF;
        color-scheme: dark;
    }
}

/* Things that stay as they are in either appearance: number plates and the white buttons over photos. */
.plate, .save, .gallery .arrow { --navy: #0A1730; --navy-600: #33425F; --muted: #56637A; --red-ink: #C8102E; --line: #E3E8F1; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: var(--t-md); line-height: 1.55; color: var(--navy); background: var(--canvas); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.num, .price, .plate-number, [data-num] { font-variant-numeric: tabular-nums; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s4); }

/* The brand "leaf" corner (from the live site's 11px 0 10px corners), mirrored in RTL. */
.leaf { border-start-start-radius: var(--leaf-big); border-end-end-radius: var(--leaf-big); border-start-end-radius: var(--leaf-small); border-end-start-radius: var(--leaf-small); }

/* ---------- Icons ---------- */
.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 16px; height: 16px; }
.i.lg { width: 24px; height: 24px; }
[dir="rtl"] .i.flip { transform: scaleX(-1); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s5); border: 1px solid transparent; font-weight: 700; font-size: var(--t-md); white-space: nowrap; cursor: pointer; }
.btn.leaf { /* shape set by .leaf */ }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-fill-hover); }
.btn-whatsapp { background: var(--green); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--navy); }
.btn-navy { background: var(--fill-strong); color: #fff; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--navy); }

/* ---------- Header ---------- */
.app-header { position: sticky; top: 0; z-index: 20; background: var(--header-bg); border-bottom: 1px solid var(--line); }
.app-header .bar { display: flex; align-items: center; gap: var(--s3); min-height: 60px; }
.logo { display: block; height: 44px; width: auto; } /* the approved lockup includes the master B's own white margin */
.app-header .nav { display: none; }
.app-header .search { display: none; }
.app-header .tools { margin-inline-start: auto; display: flex; align-items: center; gap: var(--s2); }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); font-size: var(--t-sm); font-weight: 700; }
.lang a { padding: 4px 10px; border-radius: 999px; color: var(--muted); }
.lang a.on { background: var(--fill-strong); color: #fff; }
.header-post { display: none; }

/* ---------- Mobile bottom navigation and posting action ---------- */
.bottom-nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(10, 23, 48, 0.06); }
.bottom-nav a { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 0 2px; font-size: var(--t-xs); font-weight: 700; color: var(--subtle); }
.bottom-nav a.on { color: var(--red-ink); }
.bottom-nav a.on::before { content: ""; position: absolute; top: -7px; width: 24px; height: 3px; border-radius: 0 0 3px 3px; background: var(--red); }
.fab { position: fixed; z-index: 31; inset-inline-end: var(--s4); bottom: 84px; display: inline-flex; align-items: center; gap: var(--s2); padding: 0 var(--s5); min-height: 48px; background: var(--red); color: #fff; font-weight: 800; box-shadow: var(--shadow-fab); }
.has-bottom-nav main { padding-bottom: 120px; }

/* ---------- Sections ---------- */
.section { padding-block: var(--s6); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); }
.section-head h2 { font-size: var(--t-xl); font-weight: 800; letter-spacing: -0.01em; }
.section-head a { color: var(--red-ink); font-weight: 700; font-size: var(--t-sm); display: inline-flex; align-items: center; gap: 4px; }
.eyebrow { font-size: var(--t-xs); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--red-ink); }
.muted { color: var(--muted); }
.scroller { display: flex; gap: var(--s3); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-inline: calc(-1 * var(--s4)); padding-inline: var(--s4); }
.scroller::-webkit-scrollbar { display: none; }

/* ---------- Home: greeting, search, hero ---------- */
.greeting { padding-top: var(--s4); }
.greeting h1 { font-size: var(--t-2xl); font-weight: 800; }
.greeting p { color: var(--muted); font-size: var(--t-sm); }
.search-field { display: flex; align-items: center; gap: var(--s2); min-height: 48px; padding-inline: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--muted); font-size: var(--t-md); box-shadow: var(--shadow-card); }
.search-field .i { color: var(--subtle); }
.hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #E2223F 0%, var(--red) 38%, #8E0B21 100%); padding: var(--s6) var(--s5); margin-top: var(--s4); }
[dir="rtl"] .hero { background: radial-gradient(120% 140% at 0% 0%, #E2223F 0%, var(--red) 38%, #8E0B21 100%); }
.hero h2 { font-size: var(--t-2xl); font-weight: 800; line-height: 1.25; max-width: 18ch; }
.hero p { margin-top: var(--s2); opacity: 0.9; font-size: var(--t-sm); max-width: 34ch; }
.hero .checker { position: absolute; inset-block-end: 0; inset-inline-end: 0; width: 92px; height: 92px; opacity: 0.16; background: conic-gradient(#fff 25%, transparent 0 50%, #fff 0 75%, transparent 0) 0 0 / 23px 23px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.hero-actions .btn { min-height: 40px; padding-inline: var(--s4); }
.btn-on-red { background: #fff; color: var(--red-ink); }
.btn-on-red-ghost { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.hero-visual { display: none; }
.quick-search { display: none; }
.trust-inline { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s4); font-size: var(--t-xs); font-weight: 700; opacity: 0.95; }
.trust-inline span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Brand tiles ---------- */
.brand-tile { flex: none; width: 86px; display: grid; justify-items: center; gap: 6px; padding: var(--s3) var(--s2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); text-align: center; }
.brand-mono { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--tint); color: var(--navy); font-weight: 800; font-size: var(--t-sm); letter-spacing: 0.02em; }
.brand-tile b { font-size: var(--t-sm); line-height: 1.2; }
.brand-tile small { font-size: var(--t-xs); color: var(--muted); }

/* ---------- Car card ---------- */
.cards { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
.car-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.car-media { position: relative; aspect-ratio: 4 / 3; background: var(--tint); }
.car-media img { width: 100%; height: 100%; object-fit: cover; }
.save { position: absolute; inset-block-start: var(--s3); inset-inline-end: var(--s3); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, 0.94); color: var(--navy); box-shadow: 0 2px 8px rgba(10, 23, 48, 0.15); }
.save.on { color: var(--red-ink); }
.save.on .i { fill: var(--red); }
.media-badge { position: absolute; inset-block-start: var(--s3); inset-inline-start: var(--s3); display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; background: rgba(10, 23, 48, 0.82); color: #fff; font-size: var(--t-xs); font-weight: 700; }
.media-count { position: absolute; inset-block-end: var(--s3); inset-inline-start: var(--s3); display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(10, 23, 48, 0.7); color: #fff; font-size: var(--t-xs); font-weight: 700; }
.car-body { display: grid; gap: 6px; padding: var(--s3) var(--s4) var(--s4); }
.car-title { font-size: var(--t-lg); font-weight: 800; line-height: 1.3; }
.car-title small { font-weight: 700; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 4px var(--s3); color: var(--muted); font-size: var(--t-sm); }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .i { width: 15px; height: 15px; color: var(--subtle); }
.price-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: 2px; }
.price { color: var(--red-ink); font-weight: 800; font-size: var(--t-xl); letter-spacing: -0.01em; }
.price small { font-size: var(--t-sm); font-weight: 800; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: var(--t-xs); font-weight: 700; background: var(--tint); color: var(--navy-600); white-space: nowrap; }
.tag.red { background: var(--red-50); color: var(--red-700); }
.tag.green { background: var(--green-50); color: var(--green-ink); }
.tag.amber { background: var(--amber-50); color: var(--amber); }
.seller-line { display: flex; align-items: center; gap: 6px; padding-top: var(--s2); margin-top: 2px; border-top: 1px dashed var(--line); font-size: var(--t-xs); font-weight: 700; color: var(--muted); }
.verified { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--green); color: #fff; }
.verified .i { width: 11px; height: 11px; stroke-width: 3; }

/* Phones: car rows (home, similar cars) scroll sideways; the home page shows four plates. */
.cards.rail { display: flex; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--s4)); padding-inline: var(--s4); }
.cards.rail .car-card { flex: none; width: 272px; }
.home .plate-grid .plate-card:nth-child(n + 5) { display: none; }

/* ---------- Bahrain plate (always left to right, fixed 3.6 : 1) ---------- */
.plate { container-type: inline-size; direction: ltr; width: 100%; }
.plate-in { aspect-ratio: 3.6 / 1; display: grid; grid-template-columns: 21% 1fr 20%; align-items: center; background: #fff; border: 1.4cqw solid var(--navy); border-radius: 3.4cqw; box-shadow: inset 0 0 0 1cqw #fff, inset 0 0 0 1.35cqw rgba(10, 23, 48, 0.14); color: var(--navy); overflow: hidden; }
.plate .flag { justify-self: center; width: 66%; height: auto; }
.plate .plate-number { justify-self: center; font-family: var(--font-num); font-weight: 700; font-size: 16cqw; line-height: 1; letter-spacing: 0.03em; }
.plate .d5 .plate-number { font-size: 13.5cqw; }
.plate .d6 .plate-number { font-size: 11.5cqw; letter-spacing: 0.01em; }
.plate .plate-label { justify-self: center; display: grid; justify-items: center; line-height: 1.05; }
.plate .plate-label b { font-family: var(--font); font-size: 5.4cqw; font-weight: 800; }
.plate .plate-label i { font-style: normal; font-family: var(--font-num); font-size: 3.6cqw; font-weight: 700; letter-spacing: 0.06em; }
.plate.transport .plate-in { background: #FFF4CC; }

/* ---------- Plate card ---------- */
.plate-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plate-card { position: relative; display: grid; gap: var(--s2); padding: var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.plate-card .plate-frame { padding: var(--s3) var(--s2); background: var(--tint); border-radius: var(--r-md); }
.plate-card .save { position: static; width: 32px; height: 32px; box-shadow: none; border: 1px solid var(--line); }
.plate-card .top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.plate-card h3 { font-size: var(--t-md); font-weight: 800; }
.plate-card .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.plate-card .price { font-size: var(--t-lg); }
.plate-card .offers { color: var(--navy); font-weight: 800; font-size: var(--t-md); }

/* ---------- Showroom card ---------- */
.showroom-card { flex: none; width: 260px; display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.showroom-card .cover { height: 74px; background: linear-gradient(120deg, #0A1730 0%, #33425F 100%); position: relative; }
.showroom-card .cover::after { content: ""; position: absolute; inset: 0; opacity: 0.22; background: conic-gradient(#fff 25%, transparent 0 50%, #fff 0 75%, transparent 0) 0 0 / 14px 14px; mask-image: linear-gradient(to left, #000, transparent 60%); }
[dir="rtl"] .showroom-card .cover::after { mask-image: linear-gradient(to right, #000, transparent 60%); }
.showroom-card .body { padding: 0 var(--s4) var(--s4); display: grid; gap: 4px; }
.showroom-logo { position: relative; z-index: 1; width: 56px; height: 56px; margin-top: -28px; border-radius: var(--r-md); border: 3px solid var(--surface); background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: var(--t-lg); color: var(--red-ink); box-shadow: 0 2px 8px rgba(10, 23, 48, 0.12); }
.showroom-card h3 { font-size: var(--t-md); font-weight: 800; display: flex; align-items: center; gap: 6px; }

/* ---------- Trust band and footer ---------- */
.trust-band { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
.trust-item { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.trust-item .badge { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--red-50); color: var(--red-ink); flex: none; }
.trust-item b { display: block; font-size: var(--t-md); }
.trust-item p { color: var(--muted); font-size: var(--t-sm); }
.site-footer { display: none; }

/* ---------- Detail page ---------- */
.app-bar { display: flex; align-items: center; gap: var(--s3); min-height: 56px; }
.app-bar h1 { flex: 1; font-size: var(--t-lg); font-weight: 800; text-align: center; }
.crumbs { display: none; }
.detail { display: grid; gap: var(--s4); }
.gallery { position: relative; margin-inline: calc(-1 * var(--s4)); }
.gallery .main { position: relative; aspect-ratio: 4 / 3; background: var(--tint); overflow: hidden; }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.gallery .arrow { position: absolute; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: var(--navy); box-shadow: 0 2px 10px rgba(10, 23, 48, 0.2); }
.gallery .arrow.prev { inset-inline-start: var(--s3); }
.gallery .arrow.next { inset-inline-end: var(--s3); }
.gallery .dots { position: absolute; inset-block-end: var(--s3); inset-inline: 0; display: flex; justify-content: center; gap: 6px; }
.gallery .dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.6); }
.gallery .dots i.on { width: 20px; border-radius: 4px; background: #fff; }
.thumbs { display: none; }
.summary { display: grid; gap: var(--s3); }
.summary h1 { font-size: var(--t-2xl); font-weight: 800; line-height: 1.25; }
.summary .price { font-size: var(--t-3xl); }
.summary .actions { display: none; }
.facts-quick { display: flex; flex-wrap: wrap; gap: var(--s2); }
.spec-tiles { display: grid; gap: var(--s2); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.spec { display: grid; gap: 2px; justify-items: center; text-align: center; padding: var(--s3) var(--s2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.spec .i { color: var(--red-ink); }
.spec small { color: var(--muted); font-size: var(--t-xs); font-weight: 700; }
.spec b { font-size: var(--t-sm); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); }
.panel h2 { font-size: var(--t-lg); font-weight: 800; margin-bottom: var(--s3); }
.equipment { display: grid; gap: var(--s4); }
.equipment h3 { font-size: var(--t-sm); font-weight: 800; color: var(--muted); margin-bottom: var(--s2); }
.equipment ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px var(--s3); font-size: var(--t-sm); }
.equipment li { display: flex; gap: 6px; align-items: flex-start; }
.equipment li .i { color: var(--green-ink); width: 16px; height: 16px; margin-top: 3px; }
.more-link { margin-top: var(--s3); color: var(--red-ink); font-weight: 700; font-size: var(--t-sm); display: inline-flex; align-items: center; gap: 4px; }
.description { white-space: pre-line; color: var(--navy-600); }
.seller { display: flex; align-items: center; gap: var(--s3); }
.seller .avatar { width: 52px; height: 52px; border-radius: var(--r-md); background: var(--red-50); color: var(--red-ink); display: grid; place-items: center; font-weight: 800; font-size: var(--t-lg); flex: none; }
.seller b { display: flex; align-items: center; gap: 6px; }
.seller small { color: var(--muted); font-size: var(--t-xs); }
.safety { display: flex; gap: var(--s2); padding: var(--s3); background: var(--amber-50); color: var(--amber); border-radius: var(--r-md); font-size: var(--t-xs); font-weight: 700; }
.contact-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--s2); padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(10, 23, 48, 0.08); }
.has-contact-bar main { padding-bottom: 96px; }
aside.summary { display: none; }
.has-app-bar .app-header { display: none; }

/* ---------- Plates page ---------- */
.page-head { display: grid; gap: var(--s3); padding-top: var(--s4); }
.page-head h1 { font-size: var(--t-2xl); font-weight: 800; }
.page-head .desktop-title { display: none; }
.chips-wrap { position: relative; }
.chips-wrap::after { content: ""; position: absolute; inset-block: 0; inset-inline-end: calc(-1 * var(--s4)); width: 40px; background: linear-gradient(to left, var(--canvas), rgba(244, 246, 250, 0)); pointer-events: none; }
[dir="rtl"] .chips-wrap::after { background: linear-gradient(to right, var(--canvas), rgba(244, 246, 250, 0)); }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s3); border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; font-weight: 700; font-size: var(--t-sm); color: var(--navy-600); white-space: nowrap; }
.chip.on { background: var(--fill-strong); border-color: var(--fill-strong); color: #fff; }
.chip small { font-weight: 700; opacity: 0.7; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-block: var(--s4) var(--s3); }
.toolbar b { font-size: var(--t-sm); }
.select { display: inline-flex; align-items: center; gap: var(--s2); min-height: 38px; padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); font-weight: 700; font-size: var(--t-sm); }
.filters-side { display: none; }
.filter-btn { display: inline-flex; align-items: center; gap: 6px; }
.plate-feature { display: grid; gap: var(--s3); padding: var(--s4); background: var(--fill-strong); color: #fff; overflow: hidden; position: relative; }
.plate-feature .plate { max-width: 420px; justify-self: center; }
.plate-feature .eyebrow { color: #FF8FA1; }
.plate-feature h2 { font-size: var(--t-xl); font-weight: 800; }
.plate-feature .price { color: #fff; }
.plate-feature .checker { position: absolute; inset-block-start: 0; inset-inline-end: 0; width: 120px; height: 100%; opacity: 0.08; background: conic-gradient(#fff 25%, transparent 0 50%, #fff 0 75%, transparent 0) 0 0 / 20px 20px; }

/* ---------- Page frame (header additions, area navigation, skip link) ---------- */
.skip-link { position: absolute; inset-inline-start: var(--s4); top: -100px; z-index: 50; padding: var(--s2) var(--s4); background: var(--fill-strong); color: #fff; border-radius: var(--r-sm); font-weight: 700; }
.skip-link:focus { top: var(--s2); }
:focus-visible { outline: none; box-shadow: var(--focus); }
.brand-link { display: inline-flex; align-items: center; flex: none; border-radius: var(--r-sm); }
.brand-link picture { display: contents; }
.area-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--fill-strong); color: #fff; font-size: var(--t-xs); font-weight: 800; }
.icon-btn[aria-current] { color: var(--red-ink); border-color: var(--red-100); background: var(--red-50); }
.bottom-nav a .i { width: 22px; height: 22px; }
.fab .i, .header-post .i { width: 18px; height: 18px; stroke-width: 2.4; }
.area-nav-wrap { border-top: 1px solid var(--line); background: var(--surface); }
.area-nav { display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; padding-block: var(--s2); }
.area-nav::-webkit-scrollbar { display: none; }
.area-nav a { flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--s3); border-radius: 999px; font-weight: 700; font-size: var(--t-sm); color: var(--navy-600); white-space: nowrap; }
.area-nav a:hover { background: var(--tint); }
.area-nav a[aria-current] { background: var(--fill-strong); color: #fff; }
.area-nav form { display: inline-flex; margin: 0; }
main.page { display: block; padding-block: var(--s5) var(--s10); }
.site-footer .tagline { margin-top: var(--s3); font-size: var(--t-sm); max-width: 32ch; }
.site-footer a:hover { color: #fff; }
.area-footer { padding-block: var(--s6); color: var(--muted); font-size: var(--t-xs); border-top: 1px solid var(--line); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (min-width: 960px) {
    .area-nav { padding-block: var(--s3); }
    main.page { padding-block: var(--s8) var(--s14); }
}

/* ---------- Desktop ---------- */
@media (min-width: 960px) {
    .container { padding-inline: var(--s8); }
    .has-bottom-nav main, .has-contact-bar main { padding-bottom: 0; }
    .bottom-nav, .fab, .contact-bar { display: none; }
    .app-header .bar { min-height: 76px; gap: var(--s6); }
    .logo { height: 54px; }
    .app-header .nav { display: flex; gap: var(--s1); }
    .app-header .nav a { position: relative; padding: var(--s2) var(--s3); font-weight: 700; color: var(--navy-600); border-radius: var(--r-sm); }
    .app-header .nav a.on { color: var(--red-ink); }
    .app-header .nav a.on::after { content: ""; position: absolute; inset-inline: var(--s3); bottom: -18px; height: 3px; border-radius: 3px 3px 0 0; background: var(--red); }
    .app-header .search { display: flex; flex: 1; max-width: 360px; min-height: 42px; box-shadow: none; background: var(--canvas); }
    .app-header .tools { margin-inline-start: 0; }
    .header-post { display: inline-flex; }
    .mobile-only { display: none !important; }

    .greeting { display: none; }
    .home-search { display: none; }
    .hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: var(--s8); padding: var(--s10) var(--s10) 0; margin-top: var(--s6); min-height: 420px; }
    .hero h2 { font-size: var(--t-4xl); line-height: 1.15; }
    .hero p { font-size: var(--t-lg); margin-top: var(--s3); }
    .hero .text { padding-bottom: var(--s10); align-self: center; }
    .hero-visual { display: block; align-self: end; position: relative; }
    .hero-visual .car { width: 100%; filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.28)); }
    .hero-visual .plate { position: absolute; filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.28)); width: 46%; inset-block-start: 6%; inset-inline-end: 4%; transform: rotate(-4deg); }
    [dir="rtl"] .hero-visual .plate { transform: rotate(4deg); }
    .quick-search { display: grid; grid-template-columns: 1.1fr 1.1fr 0.9fr auto; gap: var(--s2); margin-top: var(--s6); padding: var(--s2); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); color: var(--navy); }
    .quick-search .field { display: grid; padding: 6px var(--s3); border-inline-end: 1px solid var(--line); }
    .quick-search .field:nth-last-child(2) { border-inline-end: 0; }
    .quick-search label { font-size: var(--t-xs); font-weight: 700; color: var(--muted); }
    .quick-search span { font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
    .quick-search .btn { min-height: 52px; padding-inline: var(--s6); }
    .hero-actions { display: none; }
    .trust-inline { font-size: var(--t-sm); margin-top: var(--s5); }

    .section { padding-block: var(--s10) 0; }
    .section-head h2 { font-size: var(--t-2xl); }
    .scroller.brands { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); overflow: visible; margin-inline: 0; padding-inline: 0; }
    .brand-tile { width: auto; }
    .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); }
    .plate-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); }
    .home .plate-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .cards.rail { display: grid; overflow: visible; margin-inline: 0; padding-inline: 0; }
    .cards.rail .car-card { width: auto; }
    .home .plate-grid .plate-card:nth-child(n + 5) { display: grid; }
    .scroller.showrooms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; margin-inline: 0; padding-inline: 0; }
    .showroom-card { width: auto; }
    .trust-band { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
    .site-footer { display: block; margin-top: var(--s14); background: var(--fill-strong); color: #C9D2E3; padding-block: var(--s10) var(--s6); }
    .site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--s8); }
    .site-footer .logo { height: 64px; }
    .site-footer h2 { margin: 0 0 var(--s3); color: #fff; font-size: var(--t-md); }
    .site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); font-size: var(--t-sm); }
    .site-footer .legal { margin-top: var(--s8); padding-top: var(--s4); border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: var(--t-xs); display: flex; justify-content: space-between; }

    /* Car detail: gallery and a sticky summary side by side. */
    .app-bar { display: none; }
    .crumbs { display: flex; gap: var(--s2); align-items: center; padding-block: var(--s5) var(--s4); font-size: var(--t-sm); color: var(--muted); }
    .crumbs b { color: var(--navy); }
    .detail { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: var(--s6); align-items: start; }
    .detail .main-col { display: grid; gap: var(--s5); }
    .gallery { margin-inline: 0; }
    .gallery .main { border-radius: var(--r-lg); }
    .thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s2); margin-top: var(--s2); }
    .thumbs img { border-radius: var(--r-sm); aspect-ratio: 4 / 3; object-fit: cover; border: 2px solid transparent; }
    .thumbs img.on { border-color: var(--red); }
    aside.summary { display: grid; }
    .has-app-bar .app-header { display: block; }
    .summary { position: sticky; top: 100px; padding: var(--s6); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
    .summary .actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
    .summary .actions .share { grid-column: 1 / -1; }
    .spec-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .equipment { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .equipment ul { grid-template-columns: 1fr; }

    /* Plates: filter column and results. */
    .plates-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--s6); align-items: start; margin-top: var(--s5); }
    .filters-side { display: grid; gap: var(--s5); position: sticky; top: 100px; padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
    .filters-side h3 { font-size: var(--t-sm); font-weight: 800; margin-bottom: var(--s2); }
    .filters-side .chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
    .filters-side .range { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
    .filters-side .input { min-height: 40px; display: flex; align-items: center; padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-sm); color: var(--muted); font-size: var(--t-sm); }
    .mobile-filters { display: none; }
    .page-head { grid-template-columns: 1fr auto; align-items: end; padding-top: var(--s8); }
    .page-head .desktop-title { display: block; }
    .page-head .search-field { grid-column: 1 / -1; max-width: 720px; }
    .plate-feature { grid-template-columns: 1fr 1fr; align-items: center; padding: var(--s8); margin-top: var(--s5); }
}

/* ======================================================================
 * Page content: forms, buttons, lists, tables, notices, account and admin
 * pages (the markup every area already uses).
 * ====================================================================== */
/*
 * B CARS 2.0: page content. Forms, buttons, panels, lists, tables, notices and
 * the owner, showroom, account and admin page parts, in the design system's look.
 * Appended after bcars.css: it uses that file's tokens and defines no tokens,
 * no header or footer and no listing components (car card, plate, gallery...).
 * Mobile first; desktop from 960 px. Logical properties only, so Arabic (rtl)
 * and English (ltr) share every rule. Generic rules sit inside :where() so the
 * bcars.css components keep the last word inside their own markup.
 */

/* ---------- Page frame and text ---------- */
:where(main.page) { padding-block: var(--s5) var(--s10); }
:where(.page) img { block-size: auto; } /* width/height attributes keep the ratio once max-width narrows the image */
/* Sign-in pages: one narrow centred card (.auth-card; .shell > .card in the older layout). */
.shell { inline-size: 100%; max-inline-size: 480px; margin-inline: auto; padding-block: var(--s4) var(--s8); }
:where(.auth-card, .shell > .card) { max-inline-size: 480px; margin-inline: auto; padding: var(--s6) var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-card); }
:is(.auth-card, .shell .card) > .button { display: flex; inline-size: 100%; }
.aside { max-inline-size: 480px; margin-inline: auto; padding-block-start: var(--s5); text-align: center; font-size: var(--t-sm); color: var(--muted); }
.aside > * + * { margin-block-start: var(--s2); }

:where(.page, .auth-card, .card, .head-row, .listing-head, .showroom-title) > h1 { margin-block: 0 var(--s2); font-size: var(--t-2xl); font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; }
:where(.page, .card, .panel, .contact, .listing > section, .showroom > section) > h2 { margin-block: 0 var(--s3); font-size: var(--t-xl); font-weight: 800; line-height: 1.3; }
:is(.head-row, .listing-head, .showroom-title) > h1 { margin: 0; }
.lead { margin-block: 0 var(--s5); max-inline-size: 72ch; color: var(--muted); }
.page > p:not([class]) { margin-block-end: var(--s4); }

.head-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-block-end: var(--s4); }
.head-row > :is(.button, a) { margin-inline-start: auto; }
.breadcrumb { margin-block-end: var(--s2); font-size: var(--t-sm); font-weight: 700; }
.breadcrumb a { display: inline-flex; align-items: center; gap: var(--s1); min-block-size: 44px; color: var(--muted); text-decoration: none; }
.breadcrumb a::before { content: "\2039"; content: "\2039" / ""; font-size: var(--t-xl); line-height: 1; } /* a mirrored glyph: points back in both directions */
.breadcrumb a:hover { color: var(--red-700); }
.count { margin-block-end: var(--s3); color: var(--muted); font-size: var(--t-sm); font-weight: 700; }
.empty { color: var(--muted); }
:is(.page, .showroom > section) > .empty { margin-block-end: var(--s4); padding: var(--s8) var(--s4); text-align: center; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }

/* Text links inside content (bcars.css resets links to plain text). */
:where(.page) :where(p, dd, td, .row-body, .head-row, .filter-actions, .form-actions) > a:where(:not([class])) { color: var(--red-ink); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
:where(.page) :where(p, dd, td, .row-body, .head-row, .filter-actions, .form-actions) > a:where(:not([class])):hover { color: var(--red-700); }
:is(.filter-actions, .form-actions) > a:not([class]) { display: inline-flex; align-items: center; min-block-size: 44px; padding-inline: var(--s2); }

:where(.page) code { padding: 1px 6px; border-radius: 4px; background: var(--tint); color: var(--navy-600); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.85em; overflow-wrap: anywhere; }
.visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Visible focus for everything interactive in the page. */
:where(.page) :is(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--focus); }

/* ---------- Notices ---------- */
.notice, .alert, .warning, .dev-banner { display: block; margin-block: 0 var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r-md); font-size: var(--t-sm); font-weight: 700; line-height: 1.5; }
.notice { background: var(--green-50); color: var(--green-ink); }
.alert { background: var(--red-50); color: var(--red-700); }
.alert > * + * { margin-block-start: var(--s1); }
.warning { background: var(--amber-50); color: var(--amber); } /* as the design's .safety note */
.dev-banner { background: var(--fill-strong); color: #fff; font-variant-numeric: tabular-nums; }
.disclaimer { font-size: var(--t-xs); }
.page > .error { margin-block-end: var(--s4); padding: var(--s3) var(--s4); background: var(--red-50); border-radius: var(--r-md); }
:is(.notice, .alert, .warning, .dev-banner, .feedback) a { color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 0.2em; }

/* Reviewer notes: plain pre-formatted text inline, an amber note as a block. */
.note { white-space: pre-line; overflow-wrap: break-word; }
p.note { padding: var(--s3) var(--s4); background: var(--amber-50); border-inline-start: 3px solid var(--amber); border-radius: var(--r-md); color: var(--navy-600); font-size: var(--t-sm); }

/* Review feedback (changes requested, rejection, suspension). */
.feedback { display: block; padding: var(--s3) var(--s4); background: var(--red-50); border-inline-start: 3px solid var(--red); border-radius: var(--r-md); }
.feedback > * + * { margin-block-start: var(--s1); }
.panel.feedback { padding: var(--s4); border-color: var(--red-100); border-inline-start: 3px solid var(--red); border-radius: var(--r-lg); }
.panel.feedback h2 { color: var(--red-700); }
.row-body > .feedback { font-size: var(--t-sm); }

/* ---------- Buttons (existing .button markup, drawn as the design's .btn) ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-block-size: 44px; padding: var(--s2) var(--s5); border: 1px solid var(--line-strong); background: var(--surface); color: var(--navy); font: inherit; font-size: var(--t-md); font-weight: 700; line-height: 1.25; text-align: center; text-decoration: none; cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
/* The leaf: two opposite corners rounded, mirrored in Arabic (as .leaf in bcars.css). */
.button, .pager a { border-start-start-radius: var(--leaf-big); border-end-end-radius: var(--leaf-big); border-start-end-radius: var(--leaf-small); border-end-start-radius: var(--leaf-small); }
.button:hover { border-color: var(--subtle); background: var(--canvas); } /* .button and .button.secondary: the ghost button */
.button.primary { border-color: var(--red); background: var(--red); color: #fff; }
.button.primary:hover { border-color: var(--red-fill-hover); background: var(--red-fill-hover); }
.button.danger { border-color: var(--red-100); color: var(--red-700); }
.button.danger:hover { border-color: var(--red-700); background: var(--red-50); }
.button.whatsapp { border-color: var(--green); background: var(--green); color: #fff; }
.button.whatsapp:hover { filter: brightness(0.92); }
.button.small { padding-inline: var(--s4); font-size: var(--t-sm); } /* compact, but still a 44 px target */
.button.wide { inline-size: 100%; }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.button .i { flex: none; }
.link, .button.link { display: inline-flex; align-items: center; min-block-size: 44px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--red-ink); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.link:hover, .button.link:hover { background: none; color: var(--red-700); }
.danger-text { color: var(--red-700); }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--s4); max-inline-size: 480px; }
.form + .form { margin-block-start: var(--s5); }
.form + .secondary-form { margin-block-start: var(--s2); }
.form.wide { max-inline-size: 600px; }
.form.upload { gap: var(--s3); max-inline-size: none; }
.form.upload > .button { justify-self: start; }

:where(.page) fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
/* A floated legend becomes an ordinary heading inside the fieldset instead of sitting on its border. */
:where(.page) legend { float: inline-start; inline-size: 100%; margin-block-end: var(--s3); padding: 0; font-size: var(--t-sm); font-weight: 700; }
:where(.page) legend + * { clear: both; }
.page fieldset > * + * { margin-block-start: var(--s4); } /* above the notices' own margins */
.page fieldset > .choice + .choice { margin-block-start: var(--s2); }
.form.wide > fieldset { padding: var(--s5) var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.form.wide > fieldset > legend { font-size: var(--t-lg); font-weight: 800; }

.field { display: grid; gap: 6px; align-content: start; min-inline-size: 0; }
:where(.page) label { color: var(--navy); font-size: var(--t-sm); font-weight: 700; }
.hint { margin: 0; color: var(--muted); font-size: var(--t-sm); }
.error { margin: 0; color: var(--red-700); font-size: var(--t-sm); font-weight: 700; }

/* Controls: 44 px, white, 1 px strong border, 16 px text (no zoom on focus in mobile Safari). */
:where(.page :is(input:not([type="checkbox"], [type="radio"], [type="file"], [type="hidden"]), select, textarea)) { inline-size: 100%; min-block-size: 44px; padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--navy); font: inherit; font-size: 1rem; line-height: 1.4; transition: border-color 0.15s, box-shadow 0.15s; }
:where(.page textarea) { min-block-size: 7rem; padding-block: var(--s3); line-height: 1.55; resize: vertical; }
:where(.page :is(input, select, textarea):hover) { border-color: var(--subtle); }
:where(.page [aria-invalid="true"], .page .field:has(> .error) :is(input, select, textarea)) { border-color: var(--red-700); }
:where(.page :is(input, select, textarea):focus-visible) { border-color: var(--red); }
:where(.page :is(input, select, textarea):disabled) { background: var(--canvas); color: var(--muted); cursor: not-allowed; }
:where(.page) ::placeholder { color: var(--subtle); opacity: 1; }
:where([dir="rtl"] .page input[dir="ltr"]) { text-align: end; } /* left-to-right values line up with the Arabic labels */
:where(.page) input[type="file"] { inline-size: 100%; padding: var(--s3); border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--canvas); color: var(--muted); font: inherit; font-size: var(--t-sm); }
:where(.page) input[type="file"]::file-selector-button { min-block-size: 40px; margin-inline-end: var(--s3); padding: 0 var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--navy); font: inherit; font-weight: 700; cursor: pointer; }
:where(.page) :is(input[type="checkbox"], input[type="radio"]) { flex: none; inline-size: 20px; block-size: 20px; margin: 0; accent-color: var(--red); }

.checkbox { display: flex; align-items: center; gap: var(--s2); min-block-size: 44px; }
.checkbox label { cursor: pointer; }
.choice { display: flex; align-items: center; gap: var(--s3); min-block-size: 44px; padding-inline: var(--s3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-size: var(--t-md); cursor: pointer; }
.choice:has(:checked) { border-color: var(--navy); background: var(--tint); }

/* +973 prefix joined to the number; the row is always left to right. */
.phone-input { display: flex; }
.phone-prefix { display: flex; align-items: center; padding-inline: var(--s3); border: 1px solid var(--line-strong); border-inline-end: 0; border-start-start-radius: var(--r-md); border-end-start-radius: var(--r-md); background: var(--canvas); color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.phone-input input { flex: 1; min-inline-size: 0; border-start-start-radius: 0; border-end-start-radius: 0; text-align: start; }
.phone-input:focus-within .phone-prefix { border-color: var(--red); }
.code-input { min-block-size: 56px; padding-inline-start: 0.4em; font-family: var(--font-num); font-size: var(--t-2xl); font-weight: 700; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }

.form-actions, .filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.form-actions > .button, .filter-actions > .button { flex: 1 1 auto; }
.inline-link { margin-block-start: calc(-1 * var(--s2)); font-size: var(--t-sm); text-align: end; }
.divider { display: flex; align-items: center; gap: var(--s3); margin-block: var(--s5); color: var(--muted); font-size: var(--t-sm); font-weight: 700; }
.divider::before, .divider::after { content: ""; flex: 1; border-block-start: 1px solid var(--line); }

/* ---------- Search filters, pager and tabs ---------- */
.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-block-end: var(--s4); padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
/* Selects, the first (search) field, the checkbox and the actions take a full row; from/to pairs share one. */
.filters > :where(.field:first-child, .field:has(> select), .checkbox, .filter-actions) { grid-column: span 2; }
.filters > :is(.checkbox, .filter-actions) { align-self: end; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s3); margin-block: var(--s6); color: var(--muted); font-size: var(--t-sm); font-weight: 700; }
.pager a { display: inline-flex; align-items: center; min-block-size: 44px; padding-inline: var(--s5); border: 1px solid var(--line-strong); background: var(--surface); color: var(--navy); font-size: var(--t-md); }
.pager a:hover { border-color: var(--subtle); background: var(--canvas); }

.tabs { display: flex; flex-wrap: wrap; gap: var(--s2); margin-block-end: var(--s4); }
.tabs a { display: inline-flex; align-items: center; min-block-size: 40px; padding-inline: var(--s4); border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--navy-600); font-size: var(--t-sm); font-weight: 700; white-space: nowrap; }
.tabs a:hover { border-color: var(--navy-600); }
.tabs a[aria-current="page"] { border-color: var(--fill-strong); background: var(--fill-strong); color: #fff; } /* selected chips are navy */

/* ---------- Panels, facts and lists ---------- */
:is(.page, .auth-card, .shell .card) > .panel { margin-block-end: var(--s4); }
:is(.panel, .contact, .image-slot) > * + * { margin-block-start: var(--s3); }
:is(.panel, .contact, .image-slot, .feedback) > :last-child { margin-block-end: 0; }
/* Account sections inside the sign-in card read as sections, not cards within a card. */
:is(.auth-card, .shell .card) > .panel { margin: 0; padding: var(--s4) 0; background: none; border: 0; border-block-start: 1px solid var(--line); border-radius: 0; }
:is(.auth-card, .shell .card) > .panel:first-of-type { padding-block-start: var(--s2); border-block-start: 0; }

.facts { display: grid; gap: 0 var(--s8); margin: 0 0 var(--s4); }
.facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); padding-block: var(--s2); border-block-end: 1px solid var(--line); }
.facts dt { flex: 0 1 auto; max-inline-size: 45%; color: var(--muted); font-size: var(--t-sm); font-weight: 700; }
.facts dd { flex: 1 1 0; min-inline-size: 0; margin: 0; font-weight: 700; text-align: end; overflow-wrap: anywhere; }
.facts.hours { grid-template-columns: 1fr; max-inline-size: 480px; }

.rows { display: grid; gap: var(--s3); margin: 0 0 var(--s5); padding: 0; list-style: none; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); padding: var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.no-photo { display: grid; place-items: center; inline-size: 100%; aspect-ratio: 4 / 3; padding: var(--s2); background: var(--tint); color: var(--muted); font-size: var(--t-xs); font-weight: 700; text-align: center; }
.row > img, .no-photo.small { flex: none; inline-size: 104px; aspect-ratio: 4 / 3; border-radius: var(--r-md); object-fit: cover; background: var(--tint); }
.row > .plate { flex: none; inline-size: 120px; }
.row-body { flex: 1 1 10rem; display: grid; gap: 2px; min-inline-size: 0; }
.row-body > .tag { justify-self: start; margin-block-start: var(--s1); }
.row-title { font-size: var(--t-md); font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
a.row-title:hover { color: var(--red-ink); text-decoration: underline; }
.row-meta { color: var(--muted); font-size: var(--t-sm); font-weight: 700; }
.row > :is(form, .button, .action-row) { margin-inline-start: auto; }
.row-body.checkbox { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--s3); align-items: center; cursor: pointer; }
.row-body.checkbox > input { grid-row: span 2; }
.row:has(.checkbox :checked) { border-color: var(--navy); }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
/* Deleting an ad: the button opens a confirmation (owner's request of 26 November 2026). */
.delete-ad { margin-block-start: var(--s3); }
.delete-ad > summary { display: inline-flex; list-style: none; cursor: pointer; }
.delete-ad > summary::-webkit-details-marker { display: none; }
.delete-ad[open] > summary { opacity: 0.7; }
.delete-ad > .warning, .delete-ad > form { margin-block-start: var(--s2); }

/* Showroom checklist: a compact list inside its panel. */
.checklist { gap: 0; }
.checklist .row { padding: var(--s2) 0; background: none; border: 0; border-block-end: 1px solid var(--line); border-radius: 0; }
.checklist .row-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }
.checklist .row-body > .tag { margin: 0; }
.offers .row { border-inline-start: 4px solid var(--red); }

.link-list { display: grid; margin: 0; padding: 0; list-style: none; }
.link-list:not(.inline) a { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-block-size: 48px; border-block-end: 1px solid var(--line); color: var(--navy); font-weight: 700; }
.link-list:not(.inline) li:last-child a { border-block-end: 0; }
.link-list:not(.inline) a::after { content: "\203A"; content: "\203A" / ""; color: var(--subtle); font-size: var(--t-xl); line-height: 1; }
.link-list.inline { display: flex; flex-wrap: wrap; gap: var(--s2); }
.link-list.inline a { display: inline-flex; align-items: center; min-block-size: 40px; padding-inline: var(--s4); border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--navy-600); font-size: var(--t-sm); font-weight: 700; }
.link-list a:hover { color: var(--red-ink); }

.history-row { padding-block: var(--s2); border-block-end: 1px dashed var(--line); color: var(--navy-600); font-size: var(--t-sm); }
.history-row:last-child { border-block-end: 0; }
.panel > .history-row + .history-row { margin-block-start: 0; }

/* ---------- Account ---------- */
.phone-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-weight: 700; font-variant-numeric: tabular-nums; }
.phone-row .tag { background: var(--green-50); color: var(--green-ink); }
.sessions { display: grid; gap: var(--s2); margin: 0 0 var(--s4); padding: 0; list-style: none; }
.sessions li { display: grid; gap: var(--s1); padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r-md); }
.sessions li.current { border-color: var(--navy-600); background: var(--tint); }
.device { font-size: var(--t-sm); font-weight: 700; overflow-wrap: anywhere; }
.sessions .meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); color: var(--muted); font-size: var(--t-xs); }
.logout { margin-block-start: var(--s4); padding-block-start: var(--s4); border-block-start: 1px solid var(--line); }

/* ---------- Status tags (variants of the bcars.css .tag) ---------- */
.tag.status-approved { background: var(--green-50); color: var(--green-ink); }
.tag.status-pending, .tag.status-changes_requested { background: var(--amber-50); color: var(--amber); }
.tag.status-rejected, .tag.status-suspended { background: var(--red-50); color: var(--red-700); }
.tag.status-sold, .tag.sold { background: var(--fill-strong); color: #fff; }
/* "Verified showroom" as a text tag (bcars.css .verified alone is the 16 px tick). */
.tag.verified { display: inline-flex; inline-size: auto; block-size: auto; border-radius: 999px; background: var(--green-50); color: var(--green-ink); }
.tag.verified::before { content: "\2713"; content: "\2713" / ""; font-weight: 800; }

/* ---------- Listing pages (car and plate detail, owner pages) ---------- */
.listing-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-block-end: var(--s4); }
.listing-head > :is(h1, .plate-frame) { flex-basis: 100%; }
.listing-head > .price { flex: 1 1 auto; margin: 0; }
:is(.listing-head, .page) > .price { font-size: var(--t-2xl); }
.page > .price { margin-block-end: var(--s4); }
:is(.listing, .showroom) > section { margin-block-end: var(--s6); }
.contact { padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.contact > h2 { font-size: var(--t-lg); }
.contact > .seller { flex-wrap: wrap; gap: var(--s1) var(--s2); }
.contact-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--s2); max-inline-size: 480px; }
.description { white-space: pre-line; overflow-wrap: break-word; color: var(--navy-600); }
.row-body > .description { font-size: var(--t-sm); }
/* Plate on its tinted frame outside a plate card; :where() leaves the final say to bcars.css. */
:where(.page, .listing-head) > :where(.plate-frame) { display: flex; justify-content: center; padding: var(--s6) var(--s4); background: var(--tint); border-radius: var(--r-lg); }
:where(.page, .listing-head) > :where(.plate-frame) > .plate { inline-size: min(100%, 360px); }
.page > .plate-frame { margin-block-end: var(--s4); }

.photo-grid, .preview-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin: 0; padding: 0; list-style: none; }
.photo-grid li { position: relative; display: grid; gap: var(--s1); align-content: start; }
:is(.photo-grid, .preview-photos) img { inline-size: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-md); background: var(--tint); }
.photo-grid .tag { position: absolute; inset-block-start: var(--s2); inset-inline-start: var(--s2); background: var(--fill-strong); color: #fff; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 0 var(--s3); font-size: var(--t-sm); }

/* ---------- Showrooms ---------- */
.showroom-cover { display: block; inline-size: 100%; aspect-ratio: 12 / 5; object-fit: cover; border-radius: var(--r-lg); background: var(--fill-strong); }
.showroom-cover.small { max-inline-size: 30rem; }
.showroom-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s3) var(--s4); margin-block: var(--s4) var(--s5); }
.showroom-title { flex: 1 1 14rem; display: grid; gap: var(--s1); min-inline-size: 0; }
.showroom-title > .lead { margin: 0; }
.showroom-title > p:not(.lead) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
/* Logo images (the bcars.css .showroom-logo is the card's letter tile). */
:is(.showroom-head, .row, .image-slot) > .showroom-logo { display: block; flex: none; inline-size: 96px; block-size: 96px; margin: 0; object-fit: contain; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: none; }
.row > .showroom-logo, .showroom-list .no-photo.small { inline-size: 64px; block-size: 64px; aspect-ratio: 1; border-radius: var(--r-md); }
.showroom-head > .showroom-logo { position: relative; border: 3px solid var(--surface); box-shadow: var(--shadow-card); }
.showroom-cover + .showroom-head > .showroom-logo { margin-block-start: calc(-1 * var(--s10)); } /* overlaps the cover */

.image-slots { display: grid; gap: var(--s4); }
.image-slot { padding: var(--s4); background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-md); }
.image-slot > h3 { font-size: var(--t-md); font-weight: 800; }
.hours-grid { display: grid; gap: var(--s2); }
.hours-day { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.hours-label { flex: 0 0 6.5rem; font-size: var(--t-sm); font-weight: 700; }
.hours-day input { flex: 1 1 6rem; inline-size: auto; max-inline-size: 9.5rem; }
.hours-day .error { flex-basis: 100%; }

/* ---------- Admin: tables and the content under review ---------- */
.table-wrap { margin-block-end: var(--s5); overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.table-wrap table { inline-size: 100%; min-inline-size: 36rem; border-collapse: collapse; font-size: var(--t-sm); }
.table-wrap :is(th, td) { padding: var(--s3) var(--s4); border-block-end: 1px solid var(--line); text-align: start; vertical-align: middle; }
.table-wrap th { background: var(--tint); color: var(--navy-600); font-size: var(--t-xs); font-weight: 800; white-space: nowrap; }
.table-wrap tbody tr:last-child td { border-block-end: 0; }
.table-wrap tbody tr:hover { background: var(--canvas); }
.preview-price { color: var(--red-ink); font-size: var(--t-xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.preview-plate { display: inline-block; padding: var(--s1) var(--s5); border: 3px solid var(--navy); border-radius: var(--r-sm); background: var(--surface); font-family: var(--font-num); font-size: var(--t-3xl); font-weight: 700; line-height: 1.15; letter-spacing: 0.04em; }
.preview .showroom-cover { max-inline-size: 40rem; }

/* ---------- Desktop ---------- */
@media (min-width: 960px) {
    :where(main.page) { padding-block-start: var(--s8); }
    :where(.page, .auth-card, .card, .head-row, .listing-head, .showroom-title) > h1 { font-size: var(--t-3xl); }
    .shell { padding-block: var(--s6) var(--s14); }
    :where(.auth-card, .shell > .card) { padding: var(--s8); }

    .form > .button { justify-self: start; min-inline-size: 12rem; }
    :is(.auth-card, .shell) .form > .button { justify-self: stretch; }
    .form-actions > .button, .filter-actions > .button { flex: none; min-inline-size: 10rem; }
    .form.wide > fieldset { padding: var(--s6); }
    /* Field row with the button on the inputs' line (label line + field gap above it). */
    .inline-form { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s3) var(--s4); max-inline-size: none; }
    .inline-form > .field { flex: 1 1 12rem; }
    .inline-form > .button { margin-block-start: calc(var(--t-sm) * 1.55 + 6px); }

    .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); padding: var(--s5); }
    .showroom-filters { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
    .showroom-filters > * { grid-column: auto; }

    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .row { gap: var(--s4); padding: var(--s4); }
    .row > img, .no-photo.small { inline-size: 144px; }
    .showroom-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .photo-grid, .preview-photos { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .image-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .contact { padding: var(--s5); }

    /* Detail pages: gallery and content at the start, title and contact beside them (sticky). */
    .listing { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: var(--s6); align-items: start; }
    .listing > * { grid-column: 1; }
    .listing > .listing-head { grid-column: 2; grid-row: 1; padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
    .listing > .listing-head > h1 { font-size: var(--t-2xl); }
    .listing > .contact { grid-column: 2; grid-row: 2; position: sticky; inset-block-start: 100px; }
    .listing > .gallery { grid-row: 1 / span 2; }
    .plate-listing > .listing-head { grid-column: 1; }
    .plate-listing > .contact { grid-row: 1 / span 2; }

    .showroom-cover { aspect-ratio: 16 / 5; }
    :is(.showroom-head, .image-slot) > .showroom-logo { inline-size: 120px; block-size: 120px; }
}

/* ======================================================================
 * Number plates: results, cards, plate page.
 * ====================================================================== */
/* ---------- Plates: public pages (results, plate page, saved plates) ---------- */

/* The plate component is a span (safe inside links and phrasing content); it must be a block to size its container. */
.plate { display: block; }
.plate.large { max-width: 440px; margin-inline: auto; }

/* Page head: main.page already gives the top space. */
.plates-head.page-head { padding-top: 0; margin-block-end: var(--s4); }
.plates-head .lead { margin-block: var(--s1) 0; max-width: 62ch; }
.plates-head .count { margin: 0; color: var(--navy-600); }
.plates-head > .btn { justify-self: start; }

/* Filters: one form. Phones: a "Filters" disclosure; desktop: the sticky side panel (.filters-side). */
.plates-layout { margin-top: 0; }
.plates-layout .plate-filters { display: block; }
.plate-filters .mobile-filters > summary { list-style: none; cursor: pointer; }
.plate-filters .mobile-filters > summary::-webkit-details-marker { display: none; }
.plate-filters .mobile-filters[open] > summary { background: var(--fill-strong); border-color: var(--fill-strong); color: #fff; }
.plate-filter-form { display: grid; gap: var(--s3); }
.plate-filters .mobile-filters > .plate-filter-form { margin-top: var(--s3); padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.plate-filters .range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); align-items: end; }
.plate-filters .filter-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2); }
.plate-results { margin-top: var(--s4); }
.plate-results > .empty { padding: var(--s8) var(--s4); text-align: center; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }

/* Plate card: the title link covers the whole card; the saved heart stays clickable above it. */
ul.plate-grid { list-style: none; margin: 0; padding: 0; }
.plate-card { align-content: start; }
.plate-card:hover { border-color: var(--line-strong); }
.plate-card:has(.plate-card-link:focus-visible) { box-shadow: var(--focus); }
.plate-card h2 { min-width: 0; font-size: var(--t-md); font-weight: 800; line-height: 1.3; }
.plate-card-link::after { content: ""; position: absolute; inset: 0; }
.plate-card-link:focus-visible { box-shadow: none; }
.plate-card form { position: relative; z-index: 1; flex: none; margin: 0; }
.plate-card .save { position: relative; padding: 0; cursor: pointer; }
.plate-card .save::before { content: ""; position: absolute; inset: -6px; } /* 44 px touch target */
.plate-card.sold .plate-frame { opacity: 0.55; }

/* Plate page: the plate on a navy feature block, then the summary (title, price, save) and the contact panel. */
.plate-detail { display: grid; gap: var(--s4); }
.plate-showcase { grid-template-columns: 1fr; place-items: center; padding: var(--s8) var(--s5); }
.plate-showcase .plate { position: relative; max-width: 480px; filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.28)); }
.plate-summary { display: grid; gap: var(--s4); align-content: start; }
.plate-head { display: grid; justify-items: start; }
.plate-head h1 { font-size: var(--t-2xl); font-weight: 800; line-height: 1.25; }
.plate-head .price { font-size: var(--t-3xl); }
.plate-head .offers { font-size: var(--t-xl); font-weight: 800; color: var(--navy); }
.plate-head .tags { display: flex; flex-wrap: wrap; gap: var(--s1); }
.plate-save .saved { color: var(--red-ink); border-color: var(--red-100); background: var(--red-50); }
.plate-save .saved .i { fill: var(--red); }
.plate-contact .contact-buttons { display: none; } /* phones use the contact bar */
.plate-contact .safety .i { width: 18px; height: 18px; }
.plate-sold-note { padding: var(--s3); border-radius: var(--r-md); background: var(--tint); font-weight: 700; }
.plate-facts .facts { margin: 0; }

/* Phones: a fixed Call / WhatsApp bar replaces the bottom navigation on an open plate page. */
.plate-contact-bar { z-index: 32; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
body:has(.plate-contact-bar) .bottom-nav, body:has(.plate-contact-bar) .fab { display: none; }
.plate-page.with-contact-bar { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

@media (min-width: 960px) {
    .plates-head.page-head { margin-block-end: var(--s5); }
    .plates-head h1 { font-size: var(--t-3xl); }
    .plates-layout .plate-filters.filters-side { max-height: calc(100vh - 116px); overflow-y: auto; }
    .plate-filters .mobile-filters { display: block; }
    .plate-filters .mobile-filters > .plate-filter-form { margin-top: 0; padding: 0; background: none; border: 0; border-radius: 0; }
    .plate-results { margin-top: 0; }

    .plate-page.with-contact-bar { padding-bottom: 0; }
    .plate-detail { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); grid-template-areas: "plate summary" "details summary"; gap: var(--s6); align-items: start; }
    .plate-showcase { grid-area: plate; margin-top: 0; padding: var(--s14) var(--s10); }
    .plate-summary { grid-area: summary; position: sticky; top: 100px; }
    .plate-facts { grid-area: details; }
    .plate-head { padding: var(--s6); box-shadow: var(--shadow-card); }
    .plate-contact .contact-buttons { display: grid; grid-template-columns: 1fr; }
}

/* Desktop: the filter form stays open where CSS can show a closed <details>; elsewhere the "Filters" summary still opens it. */
@supports selector(::details-content) {
    @media (min-width: 960px) {
        .plate-filters .mobile-filters > summary { display: none; }
        .plate-filters .mobile-filters::details-content { display: block; content-visibility: visible; }
    }
}

/* ======================================================================
 * Showrooms: directory and profile.
 * ====================================================================== */
/* ---------- Showrooms: public directory and showroom page ----------
   Appended to bcars.css. Builds on .page-head, .search-field, .chips-wrap, .chip, .toolbar,
   .showroom-card, .showroom-logo, .verified, .cards, .car-card, .panel, .safety and .btn.
   Every rule is scoped to the showroom pages (or a showroom-* class), logical properties only. */

/* Directory: head, name search and governorate chips */
/* minmax(0, 1fr): the scrolling chip row must not widen the column past the phone screen. */
.showroom-directory .page-head { grid-template-columns: minmax(0, 1fr); }
.showroom-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2); }
.showroom-directory .showroom-search .search-field { grid-column: auto; max-inline-size: none; }
.showroom-search input { flex: 1; min-inline-size: 0; min-block-size: 46px; padding: 0; border: 0; background: transparent; font: inherit; color: var(--navy); }
.showroom-search input::placeholder { color: var(--muted); opacity: 1; }
.showroom-search input:focus-visible { box-shadow: none; }
.showroom-search .search-field:focus-within { border-color: var(--red); box-shadow: var(--focus); }
.showroom-search .btn { min-block-size: 48px; }
.showroom-directory .count { margin: 0; font-size: var(--t-sm); font-weight: 700; }
.showroom-reset { display: inline-flex; align-items: center; min-block-size: 44px; color: var(--red-ink); font-size: var(--t-sm); font-weight: 700; }
.showroom-reset:hover { color: var(--red-700); }

/* Directory: grid of showroom cards (the name link covers the whole card) */
.showroom-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr); }
.showroom-grid .showroom-card { position: relative; inline-size: auto; grid-template-rows: auto 1fr; } /* equal-height cards keep the cover at 74 px */
.showroom-grid .showroom-card:hover { border-color: var(--line-strong); }
.showroom-grid .showroom-card:focus-within { box-shadow: var(--shadow-card), var(--focus); }
.showroom-grid .showroom-card .body { align-content: start; }
.showroom-name { display: flex; align-items: center; gap: 6px; min-inline-size: 0; }
.showroom-name .verified { flex: none; }
.showroom-grid .showroom-name h2 { min-inline-size: 0; font-size: var(--t-md); font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.showroom-grid .showroom-name a::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.showroom-grid .showroom-name a:focus-visible { box-shadow: none; }
.showroom-grid .showroom-card:hover .showroom-name a { color: var(--red-ink); }
/* justify-self: a name in the other script (dir="auto") stays at the start of the card instead of jumping to the far side. */
.showroom-other { justify-self: start; color: var(--muted); font-size: var(--t-sm); font-weight: 700; overflow-wrap: anywhere; }
.showroom-directory .showroom-logo, .showroom-profile .showroom-logo { overflow: hidden; }
.showroom-directory .showroom-logo img, .showroom-profile .showroom-logo img { inline-size: 100%; block-size: 100%; object-fit: cover; }

/* Empty states (no showrooms found, no cars) */
.showroom-empty { display: grid; justify-items: center; gap: var(--s3); padding: var(--s8) var(--s4); text-align: center; color: var(--muted); }
.showroom-empty .i { inline-size: 32px; block-size: 32px; color: var(--subtle); }
.showroom-empty .empty { margin: 0; padding: 0; border: 0; background: none; font-weight: 700; }

/* Showroom page: cover banner with the overlapping logo tile (the back link is the shared .breadcrumb) */
.showroom-hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.showroom-banner { position: relative; aspect-ratio: 16 / 5; background: var(--tint); }
.showroom-banner img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.showroom-banner.plain { aspect-ratio: auto; block-size: 112px; background: linear-gradient(120deg, #0A1730 0%, #33425F 100%); }
.showroom-banner.plain::after { content: ""; position: absolute; inset: 0; opacity: 0.22; background: conic-gradient(#fff 25%, transparent 0 50%, #fff 0 75%, transparent 0) 0 0 / 16px 16px; mask-image: linear-gradient(to left, #000, transparent 55%); }
[dir="rtl"] .showroom-banner.plain::after { mask-image: linear-gradient(to right, #000, transparent 55%); }
.showroom-hero-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); padding: 0 var(--s4) var(--s4); }
.showroom-hero .showroom-logo { inline-size: 84px; block-size: 84px; margin-block-start: -42px; border-width: 4px; border-radius: var(--r-lg); font-size: var(--t-2xl); }
.showroom-hero .showroom-logo .i { inline-size: 36px; block-size: 36px; }
.showroom-intro { display: grid; gap: 6px; min-inline-size: 0; }
.showroom-intro h1 { min-inline-size: 0; font-size: var(--t-2xl); font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.showroom-intro .verified { inline-size: 22px; block-size: 22px; }
.showroom-intro .verified .i { inline-size: 14px; block-size: 14px; }
.showroom-intro .meta { align-items: center; gap: var(--s2) var(--s3); }
.showroom-intro .meta .tag .i { inline-size: 14px; block-size: 14px; color: inherit; }

/* Showroom page: contact (Call red, WhatsApp green) and the safety note */
.showroom-contact { display: grid; gap: var(--s3); align-content: start; }
.showroom-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.showroom-actions .btn { flex: 1 1 auto; }
.showroom-actions .btn-whatsapp:hover { background: #0F6B3C; }
.showroom-contact .safety { align-items: flex-start; }
.showroom-contact .safety .i { inline-size: 18px; block-size: 18px; }

/* Showroom page: cars and offers beside the details column (desktop) */
.showroom-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s8); margin-block-start: var(--s6); }
.showroom-main { display: grid; gap: var(--s8); align-content: start; min-inline-size: 0; }
.showroom-main .section-head { margin-block-end: var(--s3); }
.showroom-main .section-head .count { margin: 0; color: var(--muted); font-size: var(--t-sm); font-weight: 700; white-space: nowrap; }
.showroom-offers { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.showroom-offer { display: grid; gap: var(--s2); align-content: start; border-inline-start: 4px solid var(--red); }
.showroom-offers .showroom-offer > * { margin: 0; } /* the grid gap spaces the offer, not the panel's own margins */
.showroom-offer h3 { font-size: var(--t-lg); font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.showroom-offer .tag .i { inline-size: 14px; block-size: 14px; }
.showroom-offer .more-link { margin-block-start: 0; }
.showroom-offer .more-link:hover { color: var(--red-700); }
.showroom-side { display: grid; gap: var(--s4); align-content: start; min-inline-size: 0; }
.showroom-side .panel h2 { display: flex; align-items: center; gap: var(--s2); }
.showroom-side .panel h2 .i { color: var(--red-ink); }
.showroom-side .panel > p + p { margin-block-start: var(--s2); }
.showroom-address { color: var(--navy-600); }
.showroom-map { margin-block-start: var(--s3); }
.showroom-hours { margin: 0; display: grid; }
.showroom-hours div { display: flex; justify-content: space-between; gap: var(--s3); padding-block: var(--s2); border-block-start: 1px solid var(--line); font-size: var(--t-sm); }
.showroom-hours div:first-child { padding-block-start: 0; border-block-start: 0; }
.showroom-hours dt { font-weight: 700; }
.showroom-hours dd { margin: 0; font-weight: 700; color: var(--navy-600); }
.showroom-hours dd.closed { font-weight: 500; color: var(--muted); }
.showroom-social { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.showroom-social .chip { min-block-size: 44px; }
.showroom-social .chip:hover { border-color: var(--navy-600); color: var(--navy); }

/* Showroom page: car cards (same .car-card as the cars pages; the title link covers the card) */
.showroom-cars { list-style: none; margin: 0; padding: 0; }
.showroom-cars .car-card { position: relative; }
.showroom-cars .car-card:hover { border-color: var(--line-strong); }
.showroom-cars .car-card:hover .showroom-car-link { color: var(--red-ink); }
.showroom-cars .car-card:focus-within { box-shadow: var(--shadow-card), var(--focus); }
.showroom-car-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.showroom-car-link:focus-visible { box-shadow: none; }
.showroom-cars .price { font-size: var(--t-lg); } /* the contract's price string also carries the price type */
.showroom-cars .car-title { overflow-wrap: anywhere; }
.showroom-no-photo { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--s2); color: var(--subtle); font-size: var(--t-sm); font-weight: 700; }
.showroom-no-photo .i { inline-size: 32px; block-size: 32px; }

@media (min-width: 960px) {
    .showroom-directory .page-head { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); align-items: end; }
    .showroom-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }

    .showroom-banner.plain { block-size: 180px; }
    .showroom-hero-body { grid-template-columns: auto minmax(0, 1fr) minmax(0, 380px); align-items: start; column-gap: var(--s6); padding: 0 var(--s6) var(--s6); }
    .showroom-hero .showroom-logo { inline-size: 120px; block-size: 120px; margin-block-start: -60px; }
    .showroom-hero .showroom-logo .i { inline-size: 48px; block-size: 48px; }
    .showroom-intro, .showroom-contact { padding-block-start: var(--s4); }
    .showroom-intro h1 { font-size: var(--t-3xl); }
    .showroom-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: var(--s8); margin-block-start: var(--s8); }
    .showroom-main { gap: var(--s10); }
    .showroom-main .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .showroom-offers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    .showroom-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ======================================================================
 * Cars: results, car card, car page.
 * ====================================================================== */
/* ---------- Cars: public pages (results, car page, saved cars) ---------- */

/* Page head: main.page already gives the top space. */
.cars-head.page-head { padding-top: 0; }
.cars-head .lead { margin: var(--s1) 0 0; max-width: 62ch; color: var(--muted); }
.cars-head .count { margin: 0; font-size: var(--t-sm); font-weight: 700; color: var(--navy-600); }
.cars-head > .btn { justify-self: start; }
.cars-head .btn-ghost:hover { border-color: var(--subtle); background: var(--canvas); }

/* Filters: one form. Phones: a "Filters" disclosure; desktop: the sticky side panel (.filters-side). */
.cars-layout { margin-top: var(--s4); }
.cars-layout .car-filters { display: block; }
.car-filters .mobile-filters > summary { list-style: none; cursor: pointer; }
.car-filters .mobile-filters > summary::-webkit-details-marker { display: none; }
.car-filters .mobile-filters[open] > summary { background: var(--fill-strong); border-color: var(--fill-strong); color: #fff; }
.car-filters form { display: grid; gap: var(--s3); }
.car-filters .mobile-filters > form { margin-top: var(--s3); padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.car-filters .range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); align-items: end; }
.car-filters .filter-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.car-filters .filter-actions > .btn { flex: 1 1 auto; padding-inline: var(--s4); }
.car-filters .btn-ghost:hover { border-color: var(--subtle); background: var(--canvas); }
.car-results { margin-top: var(--s4); }
.car-results .pager a { gap: var(--s2); }

/* Car card: the title link covers the whole card; the saved heart stays clickable above it. */
ul.car-list { list-style: none; margin: 0; padding: 0; }
.car-list .car-card { position: relative; }
.car-list .car-card:hover { border-color: var(--line-strong); }
.car-list .car-card:hover .car-link { color: var(--red-ink); }
.car-list .car-card:has(.car-link:focus-visible) { box-shadow: var(--shadow-card), var(--focus); }
.car-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.car-link:focus-visible { box-shadow: none; }
.car-list .car-title { min-width: 0; overflow-wrap: anywhere; }
.car-list .car-media .no-photo { position: absolute; inset: 0; aspect-ratio: auto; align-content: center; gap: var(--s2); color: var(--subtle); font-size: var(--t-sm); }
.car-list .car-media .no-photo .i { width: 32px; height: 32px; }
.car-list .price-row { flex-wrap: wrap; justify-content: flex-start; }
.car-list .price-row .price { margin-inline-end: auto; }
.car-list .save { z-index: 2; padding: 0; border: 0; cursor: pointer; }
.car-list .save::before { content: ""; position: absolute; inset: -4px; } /* 44 px touch target */
.car-list .car-card form { margin: 0; }
.car-list .car-card.sold .car-media img { opacity: 0.6; }

/* Car page */
.car-detail .crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); padding-block: 0; margin-bottom: var(--s3); font-size: var(--t-sm); color: var(--muted); } /* also on phones: the page has no app bar */
.car-detail .crumbs a { font-weight: 700; color: var(--navy-600); }
.car-detail .crumbs a:hover { color: var(--red-ink); }
.car-detail .crumbs b { min-width: 0; overflow-wrap: anywhere; }
.car-detail .main-col { display: grid; gap: var(--s4); align-content: start; }

/* Gallery: a scroll-snap strip (swipe on phones); the desktop thumbnails jump to #photo-N. */
.car-photos { display: flex; height: 100%; margin: 0; padding: 0; list-style: none; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
.car-photos::-webkit-scrollbar { display: none; }
.car-photos li { flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; scroll-margin-block: 160px var(--s6); }
.car-photos a { display: block; height: 100%; }
.car-detail .thumbs { margin-inline: 0; margin-block-end: 0; padding: 0; list-style: none; }
.car-detail .thumbs a { display: block; border-radius: var(--r-sm); }
.car-detail .thumbs img { width: 100%; height: auto; }
.car-detail .thumbs a:hover img { border-color: var(--line-strong); }
.car-detail .thumbs a:focus-visible img { border-color: var(--red); }
@media (prefers-reduced-motion: no-preference) {
    .car-photos { scroll-behavior: smooth; }
}

/* Summary: on phones a plain block under the gallery (Call and WhatsApp move to the contact bar). */
.car-detail aside.summary { display: grid; gap: var(--s3); align-content: start; }
.car-detail .summary h1 { overflow-wrap: anywhere; }
.car-detail .summary .price-row { flex-wrap: wrap; justify-content: flex-start; }
.car-detail .summary .price { font-size: var(--t-2xl); line-height: 1.25; }
.car-detail .summary .actions { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
.car-detail .btn-whatsapp:hover { filter: brightness(0.92); }
.car-save { margin: 0; }
.car-save .btn { width: 100%; }
.car-save .btn-ghost:hover { border-color: var(--subtle); background: var(--canvas); }
.car-save .saved { color: var(--red-ink); border-color: var(--red-100); background: var(--red-50); }
.car-save .saved .i { fill: var(--red); }
.car-detail aside .car-seller, .car-detail aside .safety { display: none; } /* phones: the seller panel after the description */
.car-seller .seller b { flex-wrap: wrap; }
.car-seller .seller a { text-decoration: underline; text-underline-offset: 3px; }
.car-seller .seller a:hover { color: var(--red-ink); }
.car-sold-note { padding: var(--s3); border-radius: var(--r-md); background: var(--tint); font-weight: 700; }
.car-detail .safety .i { flex: none; width: 18px; height: 18px; }

/* Facts: the first six as tiles, the rest in the Details panel. */
.car-detail .spec-tiles { margin: 0; }
.car-detail .spec { align-content: start; }
.car-detail .spec dt { color: var(--muted); font-size: var(--t-xs); font-weight: 700; }
.car-detail .spec dd { margin: 0; font-size: var(--t-sm); font-weight: 800; overflow-wrap: anywhere; }
.car-detail .facts { margin-block-end: 0; }
.car-detail .facts > div:last-child { border-block-end: 0; }

/* Phones: a fixed Call / WhatsApp bar replaces the bottom navigation on an open car page. */
.car-contact-bar { z-index: 32; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
body:has(.car-contact-bar) .bottom-nav, body:has(.car-contact-bar) .fab { display: none; }
.car-detail.with-contact-bar { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

@media (min-width: 600px) {
    .car-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
    .cars-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--s6); align-items: start; margin-top: var(--s5); }
    .cars-layout .car-filters.filters-side { max-height: calc(100vh - 116px); overflow-y: auto; }
    .car-filters .mobile-filters { display: block; }
    .car-filters .mobile-filters > form { margin-top: 0; padding: 0; background: none; border: 0; border-radius: 0; }
    .car-results { margin-top: 0; }
    .car-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .car-results .car-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .car-detail.with-contact-bar { padding-bottom: 0; }
    .car-detail .crumbs { margin-bottom: var(--s5); }
    .car-detail .detail { grid-template-rows: auto 1fr; row-gap: var(--s5); }
    .car-detail .detail > .gallery { grid-column: 1; grid-row: 1; }
    .car-detail .detail > aside.summary { grid-column: 2; grid-row: 1 / span 2; }
    .car-detail .detail > .main-col { grid-column: 1; grid-row: 2; gap: var(--s5); }
    .car-detail .detail:not(:has(> .gallery)) > .main-col { grid-row: 1 / span 2; }
    .car-detail .summary .price { font-size: var(--t-3xl); }
    .car-detail aside .car-seller { display: block; padding: var(--s4); }
    .car-detail aside .safety { display: flex; }
}

/* Desktop: the filter form is always open where the browser lets CSS show a closed <details>; elsewhere the "Filters" summary still opens it. */
@supports selector(::details-content) {
    @media (min-width: 960px) {
        .car-filters .mobile-filters > summary { display: none; }
        .car-filters .mobile-filters::details-content { display: block; content-visibility: visible; }
    }
}

/* ---------- Frame fixes after merging the areas ---------- */
/* The phone bottom navigation covers the end of the page: keep room for it. */
.has-bottom-nav main.page { padding-bottom: 120px; }
/* Very narrow phones: keep the header tools on one line. */
@media (max-width: 359px) {
    .app-header .bar { gap: var(--s2); }
    .app-header .tools { gap: 4px; }
    .app-header .icon-btn { width: 36px; height: 36px; }
    .logo { height: 38px; }
}
@media (min-width: 960px) {
    .has-bottom-nav main.page { padding-bottom: var(--s14); }
}

/* ---------- Cars: brand directory (as on the original B CARS) ---------- */
.brand-directory { display: grid; gap: var(--s3); margin-block-end: var(--s6); }
.all-cars { display: flex; align-items: center; justify-content: center; gap: var(--s3); min-height: 64px; padding: var(--s3) var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); font-size: var(--t-lg); font-weight: 800; color: var(--navy); }
.all-cars .i { color: var(--red-ink); }
.all-cars small { color: var(--muted); font-size: var(--t-sm); font-weight: 700; }
.all-cars:hover, .all-cars.on { border-color: var(--red); }
.all-cars.on { background: var(--red-50); }
.brand-directory-title { font-size: var(--t-md); font-weight: 800; color: var(--muted); margin-block-start: var(--s2); }
.brand-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.brand-grid .brand-tile { width: auto; height: 100%; min-height: 112px; align-content: center; gap: 4px; padding: var(--s3) var(--s2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); transition: border-color 0.15s; }
.brand-grid .brand-tile:hover { border-color: var(--line-strong); }
.brand-grid .brand-tile.on { border-color: var(--red); background: var(--red-50); }
.brand-logo { width: 76px; height: 52px; object-fit: contain; padding: 3px; border-radius: var(--r-sm); background: var(--logo-chip); }
.brand-grid .brand-mono { width: 52px; height: 52px; }
.brand-grid .brand-tile b { color: var(--red-ink); font-size: var(--t-sm); font-weight: 800; }
.brand-grid .brand-tile small { color: var(--muted); font-size: var(--t-xs); font-weight: 700; }
@media (min-width: 600px) { .brand-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 960px) {
    .brand-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--s3); }
    .all-cars { min-height: 72px; font-size: var(--t-xl); }
}

/* ==========================================================================
   Terms of use and privacy policy (resources/ui/views/legal), their links in
   the footers, and the consent line of the sign-up forms.
   ========================================================================== */
.legal-doc { max-width: 72ch; display: grid; gap: var(--s6); }
.legal-doc header { display: grid; gap: var(--s1); }
.legal-doc h1 { font-size: var(--t-2xl); font-weight: 800; }
.legal-doc h2 { margin: 0 0 var(--s2); font-size: var(--t-lg); font-weight: 800; }
.legal-doc p, .legal-doc li { line-height: 1.8; }
.legal-doc p { margin: 0; }
.legal-doc p + p, .legal-doc ul + p, .legal-doc p + ul { margin-block-start: var(--s2); }
.legal-doc ul { margin: 0; padding-inline-start: var(--s5); display: grid; gap: var(--s2); }
.legal-doc a, .consent a, .fine a, .legal-links a { text-decoration: underline; }
.legal-doc .see-also { padding-top: var(--s4); border-top: 1px solid var(--line); }
.legal-links { display: inline-flex; flex-wrap: wrap; gap: var(--s4); }
.area-footer .container { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); justify-content: space-between; }
.consent { display: flex; align-items: flex-start; gap: var(--s2); font-size: var(--t-sm); line-height: 1.6; }
.consent input { margin-block-start: 2px; }
.fine { margin: 0; color: var(--muted); font-size: var(--t-xs); line-height: 1.6; }
/* Phones: the footer shows only its legal row, above the bottom navigation. */
@media (max-width: 959px) {
    .site-footer { display: block; padding-block: var(--s4); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--t-xs); }
    .site-footer .cols { display: none; }
    .site-footer .legal { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); justify-content: space-between; }
    .has-bottom-nav main, .has-contact-bar main { padding-bottom: var(--s6); }
    .has-bottom-nav .site-footer, .has-contact-bar .site-footer { padding-bottom: 136px; }
}
/* The operator's details card at the top of both documents. */
.legal-facts { margin: 0; padding: var(--s4); display: grid; gap: var(--s2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.legal-facts div { display: grid; grid-template-columns: minmax(0, 10rem) minmax(0, 1fr); gap: var(--s3); align-items: baseline; }
.legal-facts dt { color: var(--muted); font-size: var(--t-sm); }
.legal-facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
[dir="rtl"] .legal-facts dd { text-align: right; }

/* ==========================================================================
   Home page (modules/SiteContent): the banners staff manage, swiped
   sideways on phones (the next one peeks in), then the featured and newest
   cars as rails and the newest plates.
   ========================================================================== */
.home-banners { margin-block-end: var(--s2); }
.banner-track { list-style: none; margin: 0 calc(-1 * var(--s4)); padding: 0 var(--s4); display: flex; gap: var(--s3); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.banner-track::-webkit-scrollbar { display: none; }
.banner { flex: none; inline-size: 90%; scroll-snap-align: center; }
.banner:only-child { inline-size: 100%; }
.banner a, .banner img { display: block; }
.banner img { inline-size: 100%; block-size: auto; aspect-ratio: 8 / 3; object-fit: cover; border-radius: var(--r-lg); background: var(--tint); }
.media-badge.featured-badge { background: var(--red); color: #fff; }
.home-empty { display: grid; justify-items: start; gap: var(--s3); }
@media (min-width: 960px) {
    .banner-track { margin-inline: 0; padding-inline: 0; }
    .banner { inline-size: 80%; }
}
/* Administration: the home page's banners and featured cars. */
.banner-row, .featured-row { display: grid; gap: var(--s2); padding-block: var(--s4); border-top: 1px solid var(--line); }
.banner-row:first-of-type, .featured-row:first-of-type { border-top: 0; }
.banner-thumb { inline-size: 240px; max-inline-size: 100%; block-size: auto; aspect-ratio: 8 / 3; object-fit: cover; border-radius: var(--r-md); background: var(--tint); }
.link.danger { color: var(--red-700); }

/* ==========================================================================
   Post an ad (CarListings owner form): the original B CARS form (owner's
   request of 21 November 2026). Top bar, Car / Plate cards, the fields in
   one column, a dashed photo box, a character counter, and the optional
   features in collapsible groups.
   ========================================================================== */
.post-ad { max-width: 640px; margin-inline: auto; display: grid; gap: var(--s4); }
.post-bar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; }
.post-bar h1 { grid-column: 2; text-align: center; font-size: var(--t-lg); font-weight: 800; }
.post-bar .back { grid-column: 1; grid-row: 1; display: inline-grid; place-items: center; inline-size: 44px; block-size: 44px; color: var(--red-ink); }
.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.type-card { display: grid; justify-items: center; gap: var(--s1); padding: var(--s4) var(--s3); text-align: center; border: 1.5px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--navy); }
.type-card b { font-size: var(--t-md); }
.type-card span { color: var(--muted); font-size: var(--t-xs); }
.type-card.on { border: 2px solid var(--red); background: var(--red-50); color: var(--red-700); }
.type-card.on span { color: var(--red-700); }
.post-form { display: grid; gap: var(--s4); }
.post-form hr { margin: var(--s2) 0 0; border: 0; border-top: 1px solid var(--line); }
.post-form .form-section { font-size: var(--t-md); font-weight: 800; }
.post-form .form-section span { font-weight: 700; color: var(--muted); }
.post-form .checkbox { min-block-size: 40px; }
.dropzone { display: grid; justify-items: center; gap: var(--s1); padding: var(--s6) var(--s4); text-align: center; border: 2px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--tint); cursor: pointer; }
.dropzone b { font-size: var(--t-md); }
.dropzone span { color: var(--muted); font-size: var(--t-sm); }
.dropzone .dropzone-count { color: var(--green-ink); font-weight: 800; }
.dropzone:has(+ input:focus-visible) { outline: 3px solid var(--red); outline-offset: 2px; }
.visually-hidden-file { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; overflow: hidden; }
.counter { margin: 0; color: var(--muted); font-size: var(--t-sm); }
.feature-group { border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); }
.feature-group summary { display: flex; align-items: center; gap: var(--s2); min-block-size: 52px; padding: 0 var(--s4); font-weight: 800; cursor: pointer; list-style: none; }
.feature-group summary::-webkit-details-marker { display: none; }
.feature-group summary > span:first-child { flex: 1; }
.feature-group .feature-count { color: var(--muted); font-size: var(--t-sm); font-weight: 700; }
.feature-group[open] summary .i { transform: rotate(180deg); }
.feature-list { display: grid; gap: 0 var(--s4); padding: 0 var(--s4) var(--s3); }
@media (min-width: 600px) { .feature-list { grid-template-columns: 1fr 1fr; } }
.fine.center { text-align: center; }
.post-submit { inline-size: 100%; min-block-size: 52px; justify-content: center; font-size: var(--t-md); }
.car-features h3 { margin: var(--s3) 0 var(--s2); font-size: var(--t-sm); color: var(--muted); }
.feature-tags { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.feature-tags li { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--tint); font-size: var(--t-sm); font-weight: 700; }

/* ---------- Account page (owner's request of 21 November 2026, as on the original B CARS) ---------- */
.account-hub { display: grid; gap: var(--s4); max-inline-size: 640px; margin-inline: auto; padding-block: var(--s4) var(--s8); }
.hub-card { display: flex; align-items: center; gap: var(--s4); padding: var(--s5) var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.hub-card h1 { font-size: var(--t-xl); font-weight: 800; line-height: 1.3; }
.hub-card .muted { color: var(--muted); font-size: var(--t-sm); }
.avatar { flex: none; display: grid; place-items: center; inline-size: 60px; block-size: 60px; border-radius: 50%; background: var(--red); color: #fff; font-size: var(--t-2xl); font-weight: 800; }
.hub-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.hub-stats li { display: grid; justify-items: center; gap: 2px; padding: var(--s3) var(--s1); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); text-align: center; }
.hub-stats b { font-family: var(--font-num); font-size: var(--t-2xl); line-height: 1.1; color: var(--red-ink); }
.hub-stats span { color: var(--muted); font-size: var(--t-xs); font-weight: 700; }
.hub-rows, .hub-choices { display: grid; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.hub-row { display: flex; align-items: center; gap: var(--s3); inline-size: 100%; min-block-size: 56px; padding: 0 var(--s4); border: 0; border-block-end: 1px solid var(--line); background: none; color: var(--navy); font-weight: 700; text-align: start; cursor: pointer; }
.hub-rows > :last-child, .hub-rows > :last-child .hub-row, .hub-choices > .hub-row:last-of-type { border-block-end: 0; }
.hub-row > span { flex: 1; }
.hub-row em { color: var(--muted); font-style: normal; font-size: var(--t-sm); font-weight: 400; max-inline-size: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-row .i { color: var(--subtle); }
.hub-row:hover { background: var(--tint); }
.hub-row:focus-visible { outline: none; box-shadow: inset var(--focus); }
.hub-row input[type="radio"], .hub-row input[type="checkbox"] { flex: none; inline-size: 20px; block-size: 20px; accent-color: var(--red); }
.hub-row.danger, .hub-row.danger .i { color: var(--red-ink); }
.hub-row-form { margin: 0; }

/* ---------- Contact us and the staff inbox (owner's decision of 21 November 2026) ---------- */
.area-nav .nav-count { display: inline-grid; place-items: center; min-inline-size: 20px; block-size: 20px; margin-inline-start: 6px; padding-inline: 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: var(--t-xs); font-weight: 800; }
.tag.status-message-new { background: var(--red-50); color: var(--red-700); }
.tag.status-message-read { background: var(--tint); color: var(--navy-600); }
.tag.status-message-closed { background: var(--green-50); color: var(--green-ink); }
.contact-page textarea { resize: vertical; }
.contact-page .lead { margin-block-start: var(--s2); color: var(--muted); }

/* ---------- Deleting the account (owner's request of 21 November 2026) ---------- */
.btn-danger { background: var(--red-fill-hover); color: #fff; }
.btn-danger:hover { background: #7E0A1D; }
.danger-zone { border-color: var(--red-100); background: var(--red-50); }
.danger-zone ul { margin: var(--s2) 0; padding-inline-start: var(--s5); }
.danger-zone li { margin-block: 4px; }

/* ---------- Administration home (22 November 2026) ---------- */
.admin-cards { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin: var(--s4) 0 0; padding: 0; list-style: none; }
.admin-card { display: grid; gap: var(--s1); block-size: 100%; padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); color: var(--navy); }
.admin-card:hover { border-color: var(--line-strong); }
.admin-card b { font-size: var(--t-lg); font-weight: 800; }
.admin-card span { color: var(--muted); font-size: var(--t-sm); }
.admin-card em { justify-self: start; margin-block-start: var(--s2); padding: 2px 10px; border-radius: 999px; background: var(--tint); color: var(--navy-600); font-size: var(--t-xs); font-style: normal; font-weight: 800; }
.admin-card em.waiting { background: var(--red-50); color: var(--red-ink); }

/* ---------- Administration frame and home (owner's design of 25 November 2026) ----------
   Desktop: a navy side menu grouped by kind of work. Phones: a tab bar at the bottom
   and the full menu after the page (#admin-menu). Red marks only what needs a decision. */
.admin-shell { display: flex; flex-direction: column; gap: var(--s6); }
.admin-main { flex: 1 1 auto; min-inline-size: 0; }
.admin-main > h1 { margin-block-start: 0; }
.admin-side { order: 2; display: grid; gap: var(--s4); padding: var(--s4); border-radius: var(--r-lg); background: var(--fill-strong); color: #fff; }
.admin-side-group { display: grid; gap: 2px; }
.admin-side-title { padding: 0 var(--s3) var(--s1); color: #9EA9BE; font-size: var(--t-xs); font-weight: 800; }
.admin-side a, .admin-side button.link { display: flex; align-items: center; gap: var(--s2); inline-size: 100%; min-block-size: 42px; padding: 0 var(--s3); border: 0; border-radius: var(--r-md); background: transparent; color: #C9D2E3; font: inherit; font-size: var(--t-sm); font-weight: 700; text-align: start; text-decoration: none; cursor: pointer; }
.admin-side a > span:first-of-type, .admin-side button.link > span { flex: 1 1 auto; }
.admin-side a:hover, .admin-side button.link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.admin-side a[aria-current="page"] { background: var(--red); color: #fff; }
.admin-side form { margin: 0; }
.admin-side-me { padding-block-start: var(--s3); border-block-start: 1px solid rgba(255, 255, 255, 0.12); }
.admin-side .nav-count, .admin-tabbar .nav-count { display: inline-grid; place-items: center; min-inline-size: 22px; block-size: 22px; padding-inline: 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: var(--t-xs); font-weight: 800; }
.admin-side a[aria-current="page"] .nav-count { background: #fff; color: var(--red); }
.admin-tabbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 6px 6px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); border-block-start: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(10, 23, 48, 0.06); }
.admin-tabbar a { position: relative; display: grid; justify-items: center; gap: 2px; min-block-size: 48px; padding-block: 4px; color: var(--subtle); font-size: 11px; font-weight: 700; text-decoration: none; }
.admin-tabbar a[aria-current="page"] { color: var(--red-ink); }
.admin-tabbar .nav-count { position: absolute; inset-block-start: 0; inset-inline-start: calc(50% + 6px); min-inline-size: 18px; block-size: 18px; padding-inline: 5px; font-size: 10px; }
body.admin-area { padding-block-end: calc(72px + env(safe-area-inset-bottom)); }

.admin-waiting { margin-block-end: var(--s6); }
.admin-waiting-total { margin: 0 0 var(--s3); color: var(--muted); font-weight: 700; }
.admin-tiles { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0; padding: 0; list-style: none; }
.admin-tile { display: grid; gap: var(--s1); block-size: 100%; padding: var(--s4) var(--s5); border: 1px solid var(--line); background: var(--surface); color: var(--navy); text-decoration: none; }
.admin-tile:hover { border-color: var(--line-strong); }
.admin-tile-label { color: var(--muted); font-size: var(--t-sm); font-weight: 700; }
.admin-tile-count { font-family: var(--font-num); font-size: var(--t-4xl); line-height: 1; }
.admin-tile-hint { color: var(--muted); font-size: var(--t-xs); }
.admin-tile.urgent { border-color: var(--red); background: var(--red); color: #fff; box-shadow: var(--shadow-fab); }
.admin-tile.urgent :is(.admin-tile-label, .admin-tile-hint) { color: #fff; opacity: 0.9; }
.admin-tile.urgent:hover { background: var(--red-fill-hover); }

.admin-columns { display: grid; gap: var(--s5); margin-block-end: var(--s6); }
.admin-aside { display: grid; gap: var(--s5); align-content: start; }
.admin-panel { padding: var(--s4) var(--s5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.admin-panel h2 { margin: 0 0 var(--s3); font-size: var(--t-lg); }
.admin-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2); margin-block-end: var(--s3); }
.admin-panel-head h2 { margin: 0; }
.admin-panel-head a { font-size: var(--t-sm); font-weight: 700; }
.admin-queue-list, .admin-activity ul, .admin-actions ul, .admin-history { margin: 0; padding: 0; list-style: none; }
.admin-queue-list li + li { border-block-start: 1px solid var(--line); }
.admin-queue-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--s3); align-items: center; padding-block: var(--s3); color: var(--navy); text-decoration: none; }
.admin-queue-list a:hover b { color: var(--red-ink); }
.admin-queue-kind { grid-column: 1; color: var(--muted); font-size: var(--t-xs); font-weight: 700; }
.admin-queue-list b { grid-column: 1; }
.admin-queue-meta { grid-column: 1; color: var(--muted); font-size: var(--t-xs); }
.admin-queue-list .button { grid-column: 2; grid-row: 1 / span 3; }
.admin-actions { border: 0; background: var(--fill-strong); color: #fff; }
.admin-actions h2 { color: #fff; }
.admin-actions ul { display: grid; gap: var(--s2); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-actions a { display: grid; gap: var(--s1); padding: var(--s3); border-radius: var(--r-md); background: rgba(255, 255, 255, 0.07); color: #fff; font-size: var(--t-sm); font-weight: 700; text-decoration: none; }
.admin-actions a:hover { background: rgba(255, 255, 255, 0.14); }
.admin-actions .i { color: #FF6B7D; }
.admin-activity li, .admin-history li { padding-block: var(--s2); font-size: var(--t-sm); }
.admin-activity li + li, .admin-history li + li { border-block-start: 1px solid var(--line); }
.admin-activity-time { display: block; color: var(--muted); font-size: var(--t-xs); }
.admin-sections h2 { margin-block-end: 0; font-size: var(--t-lg); }

.admin-search { display: flex; gap: var(--s2); margin-block-end: var(--s4); max-inline-size: 36rem; }
.admin-search input[type="search"] { flex: 1 1 auto; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--tint); color: var(--navy-600); font-size: var(--t-xs); font-weight: 800; white-space: nowrap; }
.pill.ok { background: var(--green-50); color: var(--green-ink); }
.pill.bad { background: var(--red-50); color: var(--red-ink); }
.admin-row-actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: flex-start; }
.admin-row-actions form, .admin-details form { margin: 0; }
.admin-details summary { cursor: pointer; color: var(--red-ink); font-size: var(--t-sm); font-weight: 700; min-block-size: 32px; display: flex; align-items: center; }
.admin-details[open] form { display: flex; flex-wrap: wrap; gap: var(--s2); margin-block-start: var(--s2); }
.admin-details input[type="password"] { max-inline-size: 14rem; }
/* A table that scrolls sideways must also clip its absolutely positioned labels
   (.visually-hidden), or they widen the whole page (seen in Arabic at 1440 px). */
.admin-main .table-wrap { position: relative; }
/* Form controls are full width by default; in a table cell that squeezes the role menu. */
.admin-main td select { inline-size: auto; }
/* Three short columns: no 36rem minimum, and the headings wrap. */
.table-wrap .admin-matrix { min-inline-size: 0; }
.table-wrap .admin-matrix th { white-space: normal; }
.table-wrap .admin-matrix :is(th, td) { padding-inline: var(--s3); }
.admin-matrix th[scope="row"] { font-weight: 700; text-align: start; }
.admin-matrix td { text-align: center; }
.admin-matrix td.yes { color: var(--green-ink); }
.admin-matrix td.no { color: var(--line-strong); }

@media (min-width: 960px) {
    .admin-shell { flex-direction: row; align-items: flex-start; }
    .admin-side { order: 0; flex: 0 0 248px; position: sticky; top: var(--s4); }
    .admin-tabbar { display: none; }
    body.admin-area { padding-block-end: 0; }
    .admin-columns { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
}

/* ==========================================================================
   Mobile: the B CARS 1.0 mobile interface (owner's decision of 22 November
   2026; docs/design/MOBILE-V1-SPEC.md holds the measurements).
   - Everything here applies below 960 px only; desktop never sees it.
   - A page that has a 1.0 mobile screen renders it in a .m-view block (the
     last child of main), hidden from 960 px. Below 960 px the page's
     desktop content, header and footer give way to it.
   - Corner shapes are physical on purpose: the 1.0 "leaf" corners
     (11px 0 10px) are the same in Arabic and English.
   ========================================================================== */
:root {
    --m-sub: #46536B; --m-ph: #A9B3C4; --m-s2: #F2F4F7; --m-s3: #F5F7FA; --m-canvas: #ECEFF4;
    --m-line-strong: #D4DCE8; --m-red-soft: #FDECEE; --m-plate: #151181; --m-wa: #25D366;
    --m-danger: #C1332F; --m-danger-soft: #FDECEB; --m-ctrl: rgba(0, 0, 0, 0.55); --m-ctrl-soft: rgba(0, 0, 0, 0.38);
    --m-leaf: 11px 0 10px; --m-leaf-sm: 10px 0; --m-tab: 0 10px; --m-verified: #1D4ED8;
}
:root[data-theme="dark"] { --m-sub: #A9B4C9; --m-ph: #5D6A83; --m-s2: #18233A; --m-s3: #141E33; --m-canvas: #0A1120; --m-line-strong: #33415E; --m-red-soft: #2B1119; --m-danger: #FF8A80; --m-danger-soft: #2E1414; --m-verified: #7FA6FF; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) { --m-sub: #A9B4C9; --m-ph: #5D6A83; --m-s2: #18233A; --m-s3: #141E33; --m-canvas: #0A1120; --m-line-strong: #33415E; --m-red-soft: #2B1119; --m-danger: #FF8A80; --m-danger-soft: #2E1414; --m-verified: #7FA6FF; }
}
@media (min-width: 960px) {
    .m-view, .m-only { display: none !important; }
}
@media (max-width: 959.98px) {
    /* ---------- Shell ---------- */
    body:has(.m-view) { background: var(--surface); }
    body:has(.m-view) :is(.app-header, .site-footer, .area-footer) { display: none; }
    .m-view a { text-decoration: none; }
    main.page:has(> .m-view) { padding: 0 0 150px; max-width: none; }
    main.page:has(> .m-view) > :not(.m-view, .notice, .alert) { display: none; }
    main.page:has(> .m-view) > :is(.notice, .alert) { margin: 14px 20px 0; padding: 12px 14px; border: 0; border-radius: var(--m-leaf); font-size: 13px; font-weight: 700; }
    .m-view { display: block; overflow-x: clip; font-size: 15px; line-height: 1.6; color: var(--navy); }
    .m-view :is(ul, dl, dd) { margin: 0; padding: 0; list-style: none; }
    .m-view .i.m-ico, .m-ico { width: 1em; height: 1em; flex: none; display: block; stroke-width: 2; }
    .m-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
    .m-ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
    .m-pad { padding-inline: 20px; }
    .m-gap30 { height: 30px; }
    form.m-inline { display: contents; }
    .m-view button { padding: 0; border: 0; background: none; cursor: pointer; }

    /* Bottom navigation (66 px, five tabs) and the floating "add a listing" button. */
    .bottom-nav { z-index: 8; grid-template-columns: repeat(5, 1fr); grid-auto-flow: row; align-items: center; height: calc(66px + env(safe-area-inset-bottom)); padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); border: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -3px 14px rgba(20, 28, 80, 0.09); }
    .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; color: var(--subtle); font-size: 10px; font-weight: 700; line-height: 1.2; }
    .bottom-nav a .i { width: 22px; height: 22px; stroke-width: 2; }
    .bottom-nav a.on { color: var(--red-ink); }
    .bottom-nav a.on::before { top: -8px; inset-inline-start: calc(50% - 10px); width: 20px; height: 3px; border-radius: 999px; }
    .fab { z-index: 9; inset-block-end: calc(86px + env(safe-area-inset-bottom)); inset-inline-end: 16px; gap: 7px; min-height: 0; height: 41px; padding: 12px 18px; border-radius: 999px; box-shadow: 0 6px 18px rgba(200, 16, 46, 0.34); font-size: 13.5px; font-weight: 800; line-height: 1; }
    .fab .i { width: 17px; height: 17px; }
    /* 1.0 keeps the navigation on detail pages too (V2 hid it behind its contact bar). */
    html body:has(.m-view) .bottom-nav { display: grid; }
    html body:has(.m-view) .fab { display: inline-flex; }
    html body:has(.m-view.m-no-nav) :is(.bottom-nav, .fab), html body:has(.m-sheet:target) :is(.bottom-nav, .fab) { display: none; }

    /* ---------- App bar (home) ---------- */
    .m-appbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; padding: 20px 20px 2px; }
    .m-wordmark { display: block; width: 140px; }
    .m-wordmark :is(img, .logo) { width: 140px; height: auto; }
    .m-wordmark picture { display: contents; }
    .m-appbar__acts { display: flex; gap: 9px; }
    .m-round { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--m-s2); color: var(--m-sub); font-size: 19px; }
    .m-round__n { position: absolute; inset-block-start: -2px; inset-inline-end: -2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font: 800 10px/17px var(--font); text-align: center; }
    .m-greeting { padding: 16px 20px 0; }
    .m-greeting p { margin: 3px 0 14px; font-size: 24px; font-weight: 800; line-height: 1.6; color: var(--subtle); }

    /* ---------- Search fields ---------- */
    .m-searchbar, .m-search { display: flex; align-items: center; color: var(--m-sub); border-radius: var(--m-leaf); background: var(--m-s2); }
    .m-searchbar { gap: 10px; height: 52px; margin: 0 20px; padding: 0 15px; font-size: 19px; }
    .m-search { gap: 9px; height: 46px; margin: 14px 20px 4px; padding: 0 14px; font-size: 17px; }
    .m-view :is(.m-searchbar, .m-search) input { flex: 1; min-width: 0; min-height: 0; height: auto; padding: 1px 2px; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--navy); font: 600 16px var(--font); outline: none; }
    .m-view :is(.m-searchbar, .m-search) input::placeholder { color: var(--m-ph); }

    /* ---------- Banner ---------- */
    .m-banner { padding: 18px 20px 0; }
    .m-banner__track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
    .m-banner__track::-webkit-scrollbar { display: none; }
    .m-banner__slide { flex: 0 0 100%; scroll-snap-align: start; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 7; background: var(--m-s2); }
    .m-banner__slide :is(a, img) { display: block; width: 100%; height: 100%; object-fit: cover; }
    .m-banner__dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
    .m-banner__dots i { width: 6px; height: 6px; border-radius: 999px; background: var(--m-line-strong); }
    .m-banner__dots i.on { width: 16px; background: var(--red); }

    /* ---------- Section heading ---------- */
    .m-sechead { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 10px; }
    .m-sechead h2 { font-size: 17px; font-weight: 800; line-height: 1.6; }
    .m-sechead a { padding: 1px 6px; color: var(--red-ink); font-size: 12px; font-weight: 700; }

    /* ---------- Make strip (home) ---------- */
    .m-strip { display: flex; gap: 14px; padding: 0 20px 6px; overflow-x: auto; scrollbar-width: none; }
    .m-strip::-webkit-scrollbar { display: none; }
    .m-make { flex: 0 0 62px; display: flex; flex-direction: column; align-items: center; height: 98px; text-align: center; }
    .m-make__logo { display: grid; place-items: center; width: 62px; height: 62px; margin-top: 6px; border-radius: 12px 0 10px; background: var(--m-s2); overflow: hidden; }
    .m-make__logo img { width: 45px; height: 45px; object-fit: contain; }
    .m-mono { color: var(--m-sub); font-size: 13px; font-weight: 800; letter-spacing: 0.3px; }
    .m-make__more { color: var(--red-ink); font-size: 15px; font-weight: 800; line-height: 1; letter-spacing: 0.5px; }
    .m-make__name { width: 62px; margin-top: 6px; overflow: hidden; color: var(--red-ink); font-size: 10.5px; font-weight: 700; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }

    /* ---------- Rails and grids ---------- */
    .m-rail { display: flex; gap: 12px; padding: 0 20px 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
    .m-rail::-webkit-scrollbar { display: none; }
    .m-rail > * { flex: 0 0 168px; scroll-snap-align: start; }
    .m-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 10px; padding: 0 18px; }
    .m-related { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }

    /* ---------- Small car card ---------- */
    .m-ccard { position: relative; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
    .m-ccard__pic { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; background: var(--m-s2); overflow: hidden; }
    .m-ccard__pic img { width: 100%; height: 100%; object-fit: cover; }
    .m-ccard__link, .m-lcard__link, .m-pcard__link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
    .m-view .m-save-dark { position: absolute; z-index: 2; inset-block-start: 6px; inset-inline-end: 6px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; background: var(--m-ctrl); color: #fff; font-size: 18px; }
    .m-ccard__body { display: grid; gap: 3px; padding: 0 2px; }
    .m-row { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
    .m-ccard__name { overflow: hidden; font-size: 14.5px; font-weight: 700; line-height: 1.6; white-space: nowrap; text-overflow: ellipsis; }
    .m-ccard__date { flex: none; color: var(--m-sub); font-size: 11px; line-height: 1.6; }
    .m-ccard__km { display: flex; align-items: center; gap: 5px; color: var(--m-sub); font-size: 11.5px; line-height: 1.6; }
    .m-ccard__km .m-ico { font-size: 12px; }
    .m-ccard__price { text-align: start; color: var(--red-ink); font-size: 15px; font-weight: 700; line-height: 1.6; }
    .m-nophoto { display: grid; place-items: center; width: 100%; height: 100%; color: var(--subtle); font-size: 28px; }

    /* ---------- Bahrain plate (the shared plate component at the 1.0 proportions) ---------- */
    /* Owner, 25 November 2026: smaller digits with room around them. The flag, gaps, digits and
       البحرين / BAHRAIN scale with the plate's own width (container units, capped at the 1.0 sizes),
       and the label column fits its words, so six digits never touch the flag or the label. */
    :is(.m-view, .m-plate-preview) .plate { container-type: inline-size; }
    :is(.m-view, .m-plate-preview) .plate-in { aspect-ratio: auto; height: 50px; grid-template-columns: min(16cqw, 28px) minmax(0, 1fr) auto; gap: min(3cqw, 6px); padding: 0 min(4cqw, 8px) 0 min(3.5cqw, 7px); border: 2px solid var(--m-plate); border-radius: 7px; box-shadow: none; background: #fff; color: var(--m-plate); }
    :is(.m-view, .m-plate-preview) .plate .flag { width: 100%; height: auto; }
    :is(.m-view, .m-plate-preview) .plate .plate-number { overflow: hidden; font-size: min(18cqw, 28px); letter-spacing: 0.03em; white-space: nowrap; }
    :is(.m-view, .m-plate-preview) .plate .d4 .plate-number { font-size: min(16cqw, 26px); }
    :is(.m-view, .m-plate-preview) .plate .d5 .plate-number { font-size: min(14cqw, 23px); }
    :is(.m-view, .m-plate-preview) .plate .d6 .plate-number { font-size: min(12cqw, 21px); }
    :is(.m-view, .m-plate-preview) .plate .plate-label b { font-size: min(6cqw, 10px); line-height: 1.15; }
    :is(.m-view, .m-plate-preview) .plate .plate-label i { font: 700 min(4.4cqw, 7px)/1.2 Arial, sans-serif; letter-spacing: 0.1px; transform: scaleX(0.85); }
    :is(.m-view, .m-plate-preview) .plate.large .plate-in { height: 120px; grid-template-columns: min(19cqw, 66px) minmax(0, 1fr) auto; gap: min(3.5cqw, 12px); padding: 0 min(4.5cqw, 14px) 0 min(4cqw, 14px); border-width: 4px; border-radius: 14px; }
    :is(.m-view, .m-plate-preview) .plate.large .plate-number { font-size: min(20cqw, 70px); letter-spacing: 0.03em; }
    :is(.m-view, .m-plate-preview) .plate.large .d4 .plate-number { font-size: min(17cqw, 62px); }
    :is(.m-view, .m-plate-preview) .plate.large .d5 .plate-number { font-size: min(14cqw, 52px); }
    :is(.m-view, .m-plate-preview) .plate.large .d6 .plate-number { font-size: min(11.5cqw, 46px); }
    :is(.m-view, .m-plate-preview) .plate.large .plate-label b { font-size: min(6cqw, 22px); }
    :is(.m-view, .m-plate-preview) .plate.large .plate-label i { font-size: min(4cqw, 15px); }

    /* ---------- Plate card ---------- */
    .m-pcard { position: relative; display: flex; flex-direction: column; justify-content: space-between; height: 205px; padding: 15px 10px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
    .m-pcard__save { display: flex; justify-content: flex-end; min-height: 21px; }
    .m-view .m-save-plain { position: relative; z-index: 2; display: grid; place-items: center; width: 20px; height: 21px; color: var(--subtle); font-size: 20px; }
    .m-pcard__num { color: var(--m-sub); font-size: 14px; font-weight: 700; line-height: 1.6; }
    .m-pcard__digits { color: var(--m-sub); font-size: 8px; line-height: 1.6; }
    .m-pcard__price { color: var(--red-ink); font-size: 14px; font-weight: 700; line-height: 1.6; }

    /* ---------- Trust row ---------- */
    .m-trust { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 24px 20px 0; }
    .m-trust__item { padding: 14px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: center; }
    .m-trust__item .m-ico { margin: 0 auto 18px; color: var(--red-ink); font-size: 22px; }
    .m-trust__item b { display: block; font-size: 12.5px; font-weight: 800; line-height: 1.2; }
    .m-trust__item small { display: block; margin-top: 4px; color: var(--subtle); font-size: 11px; font-weight: 700; line-height: 1.5; }

    /* ---------- Back header (inner pages) ---------- */
    .m-head { display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 25px 20px 0; }
    .m-head h1 { font-size: 16px; font-weight: 700; line-height: 1.6; text-align: center; }
    .m-back { display: grid; place-items: center; width: 25px; height: 27px; color: var(--red-ink); font-size: 20px; }
    .m-view .m-head__act { display: grid; place-items: center; width: 25px; height: 25px; color: var(--subtle); font-size: 22px; }

    /* ---------- Filters and sort ---------- */
    .m-filterbar { display: flex; align-items: center; gap: 9px; padding: 14px 20px 0; }
    .m-fbtn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--m-tab); background: var(--surface); font-size: 12.5px; font-weight: 700; }
    .m-fbtn .m-ico { color: var(--red-ink); font-size: 16px; }
    .m-fbtn__n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10.5px; line-height: 18px; text-align: center; }
    .m-sortbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px 10px; color: var(--m-sub); font-size: 12px; font-weight: 700; line-height: 1.6; }
    .m-sort { position: relative; }
    .m-sort summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 159px; height: 32px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 0 9px; background: var(--surface); color: var(--red-ink); font-size: 16px; font-weight: 700; list-style: none; cursor: pointer; white-space: nowrap; overflow: hidden; }
    .m-sort summary::-webkit-details-marker { display: none; }
    .m-sort summary .m-ico { font-size: 14px; }
    .m-sort__menu { position: absolute; z-index: 20; inset-block-start: 36px; inset-inline-end: 0; min-width: 159px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 24px rgba(20, 28, 80, 0.12); }
    .m-sort__menu a { display: block; padding: 9px 10px; border-radius: 8px; color: var(--navy); font-size: 14px; font-weight: 700; }
    .m-sort__menu a[aria-current="true"] { background: var(--m-red-soft); color: var(--red-ink); }

    /* ---------- Large listing card ---------- */
    .m-list { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 0 16px; }
    .m-lcard { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
    .m-gallery { position: relative; z-index: 2; aspect-ratio: 4 / 3; background: var(--m-s2); }
    .m-gallery__track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
    .m-gallery__track::-webkit-scrollbar { display: none; }
    .m-gallery__slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; }
    .m-gallery__slide > a:first-child { display: block; height: 100%; }
    .m-gallery__slide img { width: 100%; height: 100%; object-fit: cover; }
    .m-dots { position: absolute; inset-inline: 0; inset-block-end: 8px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
    .m-dots i { width: 6px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.55); box-shadow: 0 0 2px rgba(0, 0, 0, 0.35); }
    .m-dots i.on { width: 16px; background: #fff; }
    .m-view .m-save-light { position: absolute; z-index: 3; inset-block-start: 6px; inset-inline-end: 6px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #7C889E; font-size: 21px; }
    .m-view :is(.m-save-light, .m-save-plain, .m-head__act)[aria-pressed="true"] { color: var(--red); }
    .m-view :is(.m-save-light, .m-save-plain, .m-head__act, .m-save-dark)[aria-pressed="true"] .m-ico { fill: currentColor; }
    .m-lcard__body { display: grid; gap: 5px; padding: 10px 13px 13px; }
    .m-lcard__title { display: flex; align-items: center; gap: 6px; font-size: 15.5px; font-weight: 700; line-height: 1.35; }
    .m-lcard__title span { color: var(--m-sub); font-weight: 700; }
    .m-lcard__price { color: var(--red-ink); font-size: 17px; font-weight: 700; line-height: 1.6; }
    .m-lcard__meta { display: flex; align-items: center; gap: 12px; color: var(--m-sub); font-size: 12px; line-height: 1.6; }
    .m-lcard__meta span { display: flex; align-items: center; gap: 4px; }
    .m-lcard__meta .m-ico { font-size: 13px; }
    .m-badge-sold { position: absolute; z-index: 3; inset-block-start: 10px; inset-inline-start: 10px; padding: 2px 10px; border-radius: 999px; background: #0A1730; color: #fff; font-size: 11px; font-weight: 800; }
    .m-more { display: block; margin: 18px 16px 0; padding: 13px; border: 1px solid var(--line); border-radius: var(--m-leaf); background: var(--surface); color: var(--red-ink); font-size: 14px; font-weight: 700; text-align: center; }

    /* ---------- Detail page ---------- */
    .m-hero { position: relative; height: 230px; background: var(--m-s2); }
    .m-hero .m-gallery__track { height: 230px; }
    .m-hero__count { position: absolute; inset-block-start: 9px; inset-inline-end: 9px; padding: 2px 8px; border-radius: 999px; background: var(--m-ctrl-soft); color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px; }
    .m-hero__nav { position: absolute; inset-block-start: calc(50% - 14px); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--m-ctrl-soft); color: #fff; font-size: 14px; }
    .m-hero__nav--prev { inset-inline-start: 9px; }
    .m-hero__nav--next { inset-inline-end: 9px; }
    .m-hero .m-dots { inset-block-end: 9px; gap: 6px; }
    .m-hero .m-dots i { width: 5px; height: 5px; background: rgba(255, 255, 255, 0.6); box-shadow: none; }
    .m-hero .m-dots i.on { width: 14px; background: #fff; }
    .m-hero--plate { display: grid; align-items: center; padding: 26px; }
    .m-dpad { padding: 20px; }
    .m-dtitle { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
    .m-dtitle h1 { font-size: 20px; font-weight: 700; line-height: 1.6; }
    .m-dtitle__price { flex: none; color: var(--red-ink); font-size: 20px; font-weight: 700; line-height: 1.6; }
    .m-dmeta { margin: 6px 0 18px; color: var(--m-sub); font-size: 11px; line-height: 1.6; }
    .m-specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
    .m-spec { padding: 12px 6px; border-radius: var(--m-leaf-sm); background: var(--m-s2); text-align: center; }
    .m-spec small { display: block; color: var(--m-sub); font-size: 10px; line-height: 1.6; }
    .m-spec b { display: block; margin-top: 3px; font-size: 13px; font-weight: 700; line-height: 1.6; }
    .m-sec { margin: 0 0 8px; font-size: 15px; font-weight: 700; line-height: 1.6; }
    .m-sec--gap { margin-top: 26px; }
    .m-rows { margin-bottom: 6px; }
    .m-rows > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
    .m-rows dt { color: var(--m-sub); font-size: 12.5px; line-height: 1.6; }
    .m-rows dd { font-size: 13.5px; font-weight: 700; line-height: 1.6; }
    .m-source { margin: 0 0 20px; color: var(--m-sub); font-size: 11.5px; line-height: 1.6; }
    .m-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-bottom: 6px; }
    .m-feats li { display: flex; align-items: flex-start; gap: 7px; font-size: 13px; line-height: 1.5; }
    .m-feats li::before { content: "\2713"; flex: none; color: var(--red-ink); font-weight: 800; }
    .m-desc { margin: 0 0 22px; color: var(--m-sub); font-size: 13px; line-height: 1.95; white-space: pre-line; overflow-wrap: anywhere; }
    .m-seller { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; padding: 12px; border-radius: var(--m-leaf); background: var(--m-s2); color: var(--navy); }
    .m-avatar { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--surface); color: var(--red-ink); font-size: 15px; font-weight: 800; overflow: hidden; }
    .m-avatar img { width: 100%; height: 100%; object-fit: cover; }
    .m-seller strong { display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 700; line-height: 1.6; }
    .m-seller strong .m-ico, .m-verified { color: var(--m-verified); font-size: 15px; }
    .m-seller__meta > span { display: block; color: var(--m-sub); font-size: 11px; line-height: 1.6; }
    .m-contact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .m-view .m-act { display: flex; align-items: center; justify-content: center; gap: 7px; height: 48px; padding: 12px 8px; border: 0; border-radius: 12px; font: 700 13px/1 var(--font); cursor: pointer; }
    .m-act .m-ico { font-size: 18px; }
    .m-view .m-act--call { background: var(--red); color: #fff; }
    .m-view .m-act--wa { background: var(--m-wa); color: #fff; }
    .m-view .m-act--share { border: 1px solid var(--line); background: var(--surface); color: var(--navy); }
    .m-sold-note { margin-bottom: 14px; padding: 12px 14px; border-radius: var(--m-leaf); background: var(--m-s2); color: var(--m-sub); font-size: 13px; font-weight: 700; }

    /* ---------- Catalogue (all makes) and make page ---------- */
    .m-pad10 { padding: 10px; }
    .m-wide { display: flex; align-items: center; justify-content: center; gap: 20px; width: 85%; height: 80px; margin: 20px auto 0; border-radius: var(--m-leaf); background: var(--m-s2); font-size: 16px; font-weight: 700; }
    .m-wide .m-ico { color: var(--red-ink); font-size: 30px; }
    .m-seg { display: flex; gap: 8px; margin: 12px 20px 0; }
    .m-seg a { flex: 1; height: 37px; padding: 10px 6px; border: 1px solid var(--line); border-radius: var(--m-tab); background: var(--surface); color: var(--m-sub); font-size: 12.5px; font-weight: 700; line-height: 1.2; text-align: center; }
    .m-seg a[aria-current="true"] { border-color: var(--red); background: var(--red); color: #fff; }
    .m-brandbody { display: flex; align-items: flex-start; gap: 4px; }
    .m-brandbody__main { flex: 1; min-width: 0; }
    .m-azrail { position: sticky; inset-block-start: 70px; display: flex; flex-direction: column; align-items: center; gap: 1px; width: 21px; padding: 6px 4px; }
    .m-azrail :is(a, span) { color: var(--m-line-strong); font-size: 9.5px; font-weight: 700; line-height: 1.5; }
    .m-azrail a { color: var(--red-ink); }
    .m-grouphead { padding: 20px 20px 4px; color: var(--subtle); font-size: 13px; font-weight: 800; }
    .m-catgrid { display: grid; grid-template-columns: 1fr 1fr; padding: 8px 2px; }
    .m-catbox { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 140px; height: 140px; margin: 8px auto; padding: 24px 10px; border-radius: var(--m-leaf-sm); background: var(--m-s2); text-align: center; }
    .m-catbox img { width: 54px; height: 54px; object-fit: contain; }
    .m-catbox b { margin-top: 18px; color: var(--red-ink); font-size: 12px; font-weight: 700; line-height: 1.3; }
    .m-catbox small { margin-top: 3px; color: var(--subtle); font-size: 10px; font-weight: 700; line-height: 1.3; }
    .m-azhead { position: sticky; inset-block-start: 0; z-index: 2; padding: 14px 20px 5px; background: var(--m-canvas); color: var(--red-ink); font-size: 12px; font-weight: 800; }
    .m-brandrow { display: flex; align-items: center; gap: 12px; height: 55px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
    .m-brandrow img { width: 30px; height: 30px; object-fit: contain; }
    .m-brandrow > .m-mono { display: grid; place-items: center; width: 30px; height: 30px; font-size: 9px; }
    .m-brandrow b { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; }
    .m-brandrow small, .m-mrow small.n { color: var(--subtle); font-size: 12.5px; font-weight: 700; }
    :is(.m-brandrow, .m-mrow, .m-showrow) > .m-ico { color: var(--m-line-strong); font-size: 13px; }
    .m-modelwrap { padding: 10px 0 20px; }
    .m-bhead { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 10px 14px; margin: 0 16px 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface); }
    .m-bhead img { width: 52px; height: 52px; object-fit: contain; }
    .m-bhead > .m-mono { display: grid; place-items: center; width: 52px; height: 52px; }
    .m-bhead b { display: block; font-size: 18px; font-weight: 700; line-height: 1.2; }
    .m-bhead small { display: block; margin-top: 2px; color: var(--subtle); font-size: 12.5px; font-weight: 700; }
    .m-bhead .m-btn-grey { grid-column: 1 / -1; }
    .m-btn-grey { display: block; padding: 16px; border-radius: var(--m-leaf); background: var(--m-s2); color: var(--navy); font-size: 15px; font-weight: 700; text-align: center; }
    .m-mlist { background: var(--surface); }
    .m-mrow { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
    .m-mrow > span { flex: 1; min-width: 0; }
    .m-mrow b { display: block; font-size: 15px; font-weight: 700; line-height: 1.2; }
    .m-mrow > span small { display: block; margin-top: 2px; color: var(--subtle); font-size: 11.5px; font-weight: 700; }
    .m-mrow small.n { font-size: 13px; }

    /* ---------- Chips ---------- */
    .m-chips { display: flex; gap: 8px; padding: 0 20px 4px; overflow-x: auto; scrollbar-width: none; }
    .m-chips::-webkit-scrollbar { display: none; }
    .m-chip { flex: none; height: 32px; padding: 8px 15px; border: 1px solid var(--line); border-radius: 0 9px; background: var(--surface); color: var(--red-ink); font-size: 12px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
    .m-chip[aria-current="true"] { border-color: var(--red); background: var(--red); color: #fff; }

    /* ---------- Showrooms ---------- */
    .m-showlist { display: grid; gap: 12px; padding: 10px 20px; }
    .m-showrow { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 3px 12px rgba(0, 0, 0, 0.035); }
    .m-showrow .m-avatar { width: 68px; height: 68px; font-size: 22px; background: var(--m-s2); }
    .m-showrow__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
    .m-showrow__meta b { display: flex; align-items: center; gap: 5px; font-size: 15px; font-weight: 700; }
    .m-showrow__meta b .m-ico { color: var(--m-verified); font-size: 16px; }
    .m-showrow__meta small { color: var(--m-sub); font-size: 12px; }
    .m-showhead { padding: 20px 20px 6px; text-align: center; }
    .m-showhead .m-avatar { width: 108px; height: 108px; margin: 0 auto 12px; font-size: 34px; background: var(--m-s2); }
    .m-showhead h1 { display: inline-flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 800; }
    .m-showhead h1 .m-ico { color: var(--m-verified); font-size: 20px; }
    .m-showhead p { margin-top: 4px; color: var(--m-sub); font-size: 13px; }
    /* The showroom's own profile on phones (owner's report of 25 November 2026). */
    .m-showcover { height: 140px; background: var(--m-s2); overflow: hidden; }
    .m-showcover img { display: block; width: 100%; height: 100%; object-fit: cover; }
    .m-showhead--cover { padding-top: 0; }
    .m-showhead--cover .m-avatar { margin-top: -54px; border: 4px solid var(--surface); }
    .m-showinfo { display: grid; gap: 8px; margin-bottom: 6px; font-size: 13.5px; line-height: 1.7; }
    .m-showinfo p { display: flex; align-items: center; gap: 6px; margin: 0; }
    .m-showaddress { color: var(--m-sub); white-space: pre-line; overflow-wrap: anywhere; }
    .m-showsocial { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
    .m-showlink { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--m-leaf-sm); background: var(--surface); color: var(--red-ink); font-size: 13px; font-weight: 700; }
    .m-showinfo .m-showlink { justify-self: start; }
    .m-rows dd.m-closed { color: var(--m-sub); font-weight: 400; }

    /* ---------- Empty state ---------- */
    .m-empty { padding: 34px 18px; color: var(--subtle); font-size: 13px; line-height: 1.9; text-align: center; }

    /* ---------- Account ---------- */
    .m-profcard { display: flex; align-items: center; gap: 13px; margin: 0 20px; padding: 16px; border-radius: var(--m-leaf); background: var(--m-s2); }
    .m-profcard .m-avatar { width: 52px; height: 52px; font-size: 20px; }
    .m-profcard strong { display: block; font-size: 16px; font-weight: 700; line-height: 1.6; }
    .m-profcard span { color: var(--m-sub); font-size: 12px; line-height: 1.6; }
    .m-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 20px 0; }
    .m-stat { padding: 12px 4px; border: 1px solid var(--line); border-radius: var(--m-leaf); background: var(--surface); text-align: center; }
    .m-stat b { display: block; color: var(--red-ink); font-size: 17px; font-weight: 800; line-height: 1.6; }
    .m-stat small { display: block; color: var(--m-sub); font-size: 9.5px; line-height: 1.6; }
    .m-menu { padding: 12px 20px 0; }
    .m-view .m-li { display: flex; align-items: center; gap: 10px; width: 100%; height: 50px; margin-top: 11px; padding: 14px 18px; border: 0; border-radius: 0 11px 10px 0; background: var(--m-s2); color: var(--navy); font: inherit; text-align: start; cursor: pointer; }
    .m-li > .m-ico:first-child { font-size: 20px; }
    .m-li__label { font-size: 15px; font-weight: 700; }
    .m-li__val { margin-inline-start: auto; color: var(--m-sub); font-size: 12.5px; font-weight: 700; }
    .m-li__chev { color: var(--red-ink); font-size: 20px; }
    .m-li__val + .m-li__chev { margin-inline-start: 18px; }
    .m-li__label + .m-li__chev { margin-inline-start: auto; }
    .m-view .m-li--danger { background: var(--m-danger-soft); color: var(--m-danger); }
    .m-switch { position: relative; width: 44px; height: 25px; margin-inline-start: auto; border-radius: 999px; background: var(--m-line-strong); }
    .m-switch::after { content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
    .m-switch[aria-checked="true"] { background: var(--red); }
    .m-switch[aria-checked="true"]::after { inset-inline-start: auto; inset-inline-end: 3px; }

    /* ---------- Forms ---------- */
    .m-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
    .m-pick a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 13px 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--m-sub); text-align: center; }
    .m-pick a .m-ico { margin-block: 3px 12px; font-size: 26px; }
    .m-pick a b { color: var(--navy); font-size: 13.5px; font-weight: 800; line-height: 1.25; }
    .m-pick a small { margin-top: 2px; font-size: 10.5px; line-height: 1.25; }
    .m-pick a[aria-current="true"] { border-color: var(--red); background: var(--m-red-soft); color: var(--red-ink); box-shadow: inset 0 0 0 1px var(--red); }
    .m-pick a[aria-current="true"] b { color: var(--red-ink); }
    .m-field { margin-bottom: 12px; }
    .m-field > label, .m-label { display: block; margin-bottom: 4px; font-size: 12.5px; font-weight: 700; line-height: 1.6; }
    .m-view :is(.m-input, .m-select, .m-textarea) { display: block; width: 100%; min-height: 0; height: 44px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--m-leaf); background-color: var(--surface); box-shadow: none; color: var(--navy); font: 600 16px var(--font); }
    .m-view :is(.m-input, .m-textarea)::placeholder { color: var(--m-ph); }
    .m-view .m-select { appearance: none; padding-inline-end: 36px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C889E' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center / 14px; }
    [dir="rtl"] .m-view .m-select { background-position: left 13px center; }
    .m-view .m-textarea { height: 104px; resize: vertical; line-height: 1.6; }
    .m-view :is(.m-input, .m-select, .m-textarea):focus { outline: none; border-color: var(--red); box-shadow: none; }
    .m-count { display: block; margin-top: 4px; color: var(--navy); font-size: 12.5px; text-align: end; }
    .m-hint { margin-top: 5px; color: var(--subtle); font-size: 11px; line-height: 1.6; }
    .m-error { margin-top: 5px; color: var(--m-danger); font-size: 11.5px; font-weight: 700; }
    .m-field--invalid :is(.m-input, .m-select, .m-textarea) { border-color: var(--m-danger) !important; }
    .m-legal { margin: 14px 0 12px; padding: 0 4px; color: var(--subtle); font-size: 11.5px; line-height: 1.9; text-align: center; }
    .m-legal a, .m-tiny a { color: var(--red-ink); font-weight: 700; }
    .m-tiny { margin-top: 14px; color: var(--subtle); font-size: 11.5px; text-align: center; }
    .m-tiny.m-forgot { margin: -6px 0 16px; text-align: end; }
    .m-view .m-btn { display: block; width: 100%; padding: 16px; border: 0; border-radius: var(--m-leaf); background: var(--red); color: #fff; font: 700 15px var(--font); text-align: center; cursor: pointer; }
    .m-view .m-btn:active { background: var(--red-700); }
    .m-view .m-btn--ghost { background: var(--m-s2); color: var(--navy); }

    .m-phone { display: flex; gap: 8px; direction: ltr; }
    .m-phone .m-cc { flex: none; display: grid; place-items: center; width: 70px; height: 44px; border-radius: var(--m-leaf); background: var(--m-s2); font-weight: 800; }
    .m-view .m-phone .m-input { flex: 1; }
    .m-uploader { position: relative; display: block; padding: 20px; border: 1px dashed var(--m-line-strong); border-radius: var(--m-leaf); background: var(--m-s3); color: var(--subtle); font-size: 12.5px; font-weight: 400; line-height: 1.6; text-align: center; cursor: pointer; }
    .m-uploader b { display: block; margin-bottom: 3px; color: var(--navy); font-size: 13.5px; font-weight: 700; }
    .m-uploader input { position: absolute; width: 1px; height: 1px; opacity: 0; }
    .m-shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
    .m-shots img { aspect-ratio: 1; width: 100%; object-fit: cover; border-radius: 10px; }
    .m-fieldgroup { margin: 22px 0 4px; padding-top: 16px; border-top: 1px solid var(--line); }
    .m-fieldgroup h3 { margin: 18px 0 8px; font-size: 13px; font-weight: 700; line-height: 1.6; }
    .m-fieldgroup > .m-hint:first-of-type { margin: -6px 0 10px; color: var(--m-sub); font-size: 13px; }
    .m-featcats { display: flex; flex-direction: column; gap: 8px; }
    .m-featcat { border: 1px solid var(--line); border-radius: 12px 0 11px; background: var(--surface); }
    .m-featcat summary { display: flex; align-items: center; gap: 10px; height: 48px; padding: 10px 14px; font-size: 13.5px; font-weight: 700; list-style: none; cursor: pointer; }
    .m-featcat summary::-webkit-details-marker { display: none; }
    .m-featcat summary b { flex: 1; }
    .m-featcat summary small { color: var(--subtle); font-size: 11.5px; font-weight: 700; }
    .m-featcat summary .m-ico { font-size: 13px; }
    .m-featcat[open] summary .m-ico { transform: rotate(180deg); }
    .m-featcat__items { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 4px 14px 14px; }
    .m-check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
    .m-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--red); }
    .m-auth details.m-featcat { margin-top: 14px; }

    /* ---------- Sign in ---------- */
    .m-auth-brand { display: flex; justify-content: center; padding: 24px 20px 16px; direction: ltr; }
    .m-auth-brand :is(img, .logo) { width: 120px; height: auto; }
    .m-auth-brand picture { display: contents; }
    .m-auth h1 { font-size: 24px; font-weight: 800; line-height: 1.5; }
    .m-auth > p:not([class]) { margin: 6px 0 22px; color: var(--m-sub); font-size: 13px; line-height: 1.7; }
    .m-notice, .m-alert { margin: 0 20px 14px; padding: 12px 14px; border-radius: var(--m-leaf); background: var(--m-s2); font-size: 13px; font-weight: 700; }
    .m-alert { background: var(--m-danger-soft); color: var(--m-danger); }
    .m-notice--warn { background: var(--m-red-soft); }
    :is(.m-notice, .m-alert) a { color: var(--red-ink); font-weight: 800; text-decoration: underline; text-underline-offset: 0.2em; }


    /* ---------- Sell (post an ad, car and plate): the shared form, restyled as the 1.0 screen ---------- */
    body:has(.post-ad) { background: var(--surface); }
    body:has(.post-ad) :is(.app-header, .site-footer, .bottom-nav, .fab) { display: none; }
    main.page:has(> .post-ad) { padding: 0 20px 40px; overflow-x: clip; }
    .post-ad .field { position: relative; }
    .post-ad .visually-hidden-file { inset-block-start: 0; inset-inline-start: 0; max-inline-size: 1px; }
    .post-ad { gap: 0; max-width: none; }
    .post-ad .post-bar { grid-template-columns: 25px 1fr 25px; height: 52px; margin: 0 0 30px; padding-top: 25px; }
    .post-ad .post-bar h1 { font-size: 16px; font-weight: 700; line-height: 1.6; }
    .post-ad .post-bar .back { inline-size: 25px; block-size: 27px; }
    .post-ad .post-bar .back .i { width: 20px; height: 20px; }
    .post-ad .type-cards { gap: 10px; margin-bottom: 18px; }
    .post-ad .type-card { gap: 6px; padding: 13px 10px; border: 1px solid var(--line); border-radius: 13px; color: var(--m-sub); }
    .post-ad .type-card .i { width: 26px; height: 26px; margin-block: 3px 12px; stroke-width: 2; }
    .post-ad .type-card b { color: var(--navy); font-size: 13.5px; font-weight: 800; line-height: 1.25; }
    .post-ad .type-card span { margin-top: 2px; color: var(--m-sub); font-size: 10.5px; line-height: 1.25; }
    .post-ad .type-card.on { border-color: var(--red); background: var(--m-red-soft); color: var(--red-ink); box-shadow: inset 0 0 0 1px var(--red); }
    .post-ad .type-card.on :is(b, span) { color: var(--red-ink); }
    .post-ad :is(.post-form, .form) { gap: 0; }
    .post-ad .field { gap: 0; margin-bottom: 12px; }
    .post-ad .field > :is(label, .label) { margin-bottom: 4px; font-size: 12.5px; font-weight: 700; line-height: 1.6; }
    .post-ad :is(input:not([type="checkbox"], [type="radio"], [type="file"], [type="hidden"]), select, textarea) { min-block-size: 0; block-size: 44px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px 0 10px; box-shadow: none; font: 600 16px var(--font); }
    .post-ad :is(input, select, textarea):focus-visible { border-color: var(--red); box-shadow: none; }
    .post-ad select { appearance: none; padding-inline-end: 36px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C889E' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center / 14px; }
    [dir="rtl"] .post-ad select { background-position: left 13px center; }
    .post-ad .field textarea { block-size: 104px; resize: vertical; line-height: 1.6; }
    .post-ad :is(input, textarea)::placeholder { color: var(--m-ph); }
    .post-ad .counter { margin-top: 4px; color: var(--navy); font-size: 12.5px; text-align: start; }
    .post-ad .m-plate-preview { margin-bottom: 18px; }
    .m-plate-preview .plate-in { height: 50px; }
    .post-ad .hint { margin-top: 5px; color: var(--subtle); font-size: 11px; line-height: 1.6; }
    .post-ad .error { margin-top: 5px; color: var(--m-danger); font-size: 11.5px; font-weight: 700; }
    .post-ad .dropzone { gap: 0; padding: 20px; border: 1px dashed var(--m-line-strong); border-radius: 11px 0 10px; background: var(--m-s3); color: var(--subtle); font-size: 12.5px; line-height: 1.6; }
    .post-ad .dropzone b { margin-bottom: 3px; color: var(--navy); font-size: 13.5px; font-weight: 700; }
    .post-ad .dropzone span { color: var(--subtle); font-size: 12.5px; }
    .post-ad .post-form hr { margin: 22px 0 0; }
    .post-ad .post-form .form-section { margin: 18px 0 8px; font-size: 13px; font-weight: 700; line-height: 1.6; }
    .post-ad .post-form .form-section + .hint { margin: -6px 0 10px; color: var(--m-sub); font-size: 13px; }
    .post-ad .feature-group { margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px 0 11px; }
    .post-ad .feature-group summary { gap: 10px; min-block-size: 48px; padding: 10px 14px; font-size: 13.5px; font-weight: 700; }
    .post-ad .feature-group .feature-count { color: var(--subtle); font-size: 11.5px; }
    .post-ad .feature-list { grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 4px 14px 14px; }
    .post-ad .feature-list .checkbox { min-block-size: 0; gap: 8px; font-size: 13px; }
    .post-ad .feature-list .checkbox input { inline-size: 18px; block-size: 18px; }
    .post-ad .fine.center { margin: 14px 0 12px; padding: 0 4px; color: var(--subtle); font-size: 11.5px; line-height: 1.9; }
    .post-ad .post-submit { min-block-size: 0; padding: 16px; border-radius: 11px 0 10px; font: 700 15px var(--font); }
    .post-ad .warning { margin-bottom: 14px; padding: 12px 14px; border-radius: 11px 0 10px; font-size: 13px; font-weight: 700; }
    .post-ad .plate-preview, .post-ad .preview-plate { margin-bottom: 18px; }

    /* ---------- Bottom sheet (filters) ---------- */
    .m-sheet { position: fixed; inset: 0; z-index: 40; display: none; align-items: flex-end; background: rgba(10, 18, 64, 0.45); }
    .m-sheet:target { display: flex; }
    .m-sheet__panel { position: relative; width: 100%; max-height: 88vh; overflow-y: auto; padding: 26px 20px 32px; border-radius: 22px 22px 0 0; background: var(--surface); }
    .m-sheet__close { position: absolute; inset-block-start: 14px; inset-inline-end: 14px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--m-s2); color: var(--navy); font-size: 14px; }
    .m-sheet__panel h2 { margin-bottom: 16px; font-size: 18px; font-weight: 800; }
    .m-sheet__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .m-sheet__acts { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-top: 8px; }
    body:has(.m-sheet:target) :is(.bottom-nav, .fab) { display: none; }
}
@media (min-width: 600px) and (max-width: 959.98px) {
    .m-list { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
/* Dark appearance on phones: make logos (often black) get the same white backing as on desktop (--logo-chip). */
@media (max-width: 959.98px) {
    :root[data-theme="dark"] .m-view :is(.m-make__logo, .m-catbox, .m-brandrow, .m-bhead) img { padding: 3px; border-radius: 8px; background: var(--logo-chip); }
}
@media (max-width: 959.98px) and (prefers-color-scheme: dark) {
    :root:not([data-theme]) .m-view :is(.m-make__logo, .m-catbox, .m-brandrow, .m-bhead) img { padding: 3px; border-radius: 8px; background: var(--logo-chip); }
}

/* Ads and the catalog in the administration area (owner's request of 25 November 2026).
   New classes only: no existing page changes. */
.admin-page-actions { margin: 0 0 var(--s4); }
.admin-filters { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: end; margin-block-end: var(--s4); }
.admin-filters .field { flex: 1 1 12rem; margin: 0; }
.admin-filter-note { margin: 0 0 var(--s3); color: var(--muted); font-size: var(--t-sm); }
.admin-ad { display: flex; gap: var(--s3); align-items: center; }
.admin-ad img, .admin-ad-nophoto { flex: none; inline-size: 72px; block-size: 54px; border-radius: var(--r-sm); object-fit: cover; }
.admin-ad-nophoto { display: grid; place-items: center; background: var(--tint); color: var(--muted); }
.admin-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); align-content: start; min-inline-size: 0; }
.admin-form-grid { display: grid; gap: var(--s3) var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.admin-form-grid .field { margin: 0; }
.admin-form-grid .wide { grid-column: 1 / -1; }
.admin-listing-form { max-inline-size: none; }
.admin-listing-form > .button { justify-self: start; margin-block-start: var(--s4); }
.admin-features { margin: var(--s4) 0 0; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); }
.admin-features legend { padding-inline: var(--s1); font-weight: 700; }
.admin-feature-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); column-gap: var(--s3); }
.admin-feature-group h3 { grid-column: 1 / -1; margin: var(--s3) 0 var(--s1); font-size: var(--t-sm); }
.admin-photos { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 0 0 var(--s4); padding: 0; list-style: none; }
.admin-photos li { display: grid; gap: var(--s2); align-content: start; }
.admin-photos img { inline-size: 100%; block-size: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-sm); }
.admin-upload { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.admin-upload input[type="file"] { flex: 1 1 14rem; min-inline-size: 0; }
.admin-danger { border-color: var(--red); }
.admin-pick-list { margin: var(--s3) 0 0; padding: 0; list-style: none; }
.admin-pick-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding-block: var(--s2); }
.admin-pick-list li + li { border-block-start: 1px solid var(--line); }
.admin-pick-list li > span { display: grid; min-inline-size: 0; }
.admin-listing-rows { margin: 0; padding: 0; list-style: none; }
.admin-listing-rows li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); padding-block: var(--s2); }
.admin-listing-rows li + li { border-block-start: 1px solid var(--line); }
.admin-listing-rows li > a { min-inline-size: 0; font-weight: 700; }
.admin-logo { inline-size: 64px; block-size: 64px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }

/* The language a visitor chooses first (owner's request of 26 November 2026). */
.lang-choice { display: grid; justify-items: center; gap: var(--s5, 24px); max-inline-size: 420px; margin: 12vh auto; padding: var(--s4, 16px); text-align: center; }
.lang-choice h1 { display: grid; gap: var(--s1, 4px); font-size: var(--t-xl, 1.5rem); }
.lang-choice__options { display: grid; gap: var(--s3, 12px); inline-size: 100%; }
.lang-choice__options .button { justify-content: center; min-block-size: 52px; font-size: 1.15rem; }

/* Error pages in both languages (launch readiness, 27 November 2026). */
.error-page { min-block-size: 100vh; display: grid; place-items: center; margin: 0; background: var(--bg, #fff); color: var(--ink, #111); }
.error-box { display: grid; justify-items: center; gap: var(--s3, 12px); max-inline-size: 480px; padding: var(--s5, 24px); text-align: center; }
.error-logo .logo { inline-size: 160px; block-size: auto; }
.error-code { margin: 0; font-size: 3rem; font-weight: 800; color: var(--red, #c8102e); letter-spacing: 0.05em; }
.error-box h1, .error-box h2 { margin: 0; font-size: 1.25rem; }
.error-box section + section { padding-block-start: var(--s3, 12px); border-block-start: 1px solid var(--line, #e5e7eb); }
.error-actions { margin-block-start: var(--s3, 12px); }

/* Staff two-step sign-in: the authenticator app's QR code and key (launch readiness, 27 November 2026). */
.two-factor-steps { display: grid; gap: var(--s4); padding-inline-start: 1.4em; margin-block: var(--s4); }
.two-factor-qr { inline-size: 220px; max-inline-size: 100%; margin: var(--s3) 0; padding: var(--s2); background: #fff; border-radius: var(--r-md); }
.two-factor-qr svg { display: block; inline-size: 100%; block-size: auto; }
.two-factor-key { display: block; margin-block-start: var(--s2); font-family: var(--font-num); font-weight: 700; letter-spacing: 0.08em; text-align: start; word-break: break-all; }
