/* کارشیو مشتری — UI مدرن موبایل‌محور */
:root {
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --primary-deep: #0f172a;
    --primary-soft: #eff6ff;
    --primary-glow: rgba(29, 78, 216, 0.2);
    --accent: #f59e0b;
    --bg: #eef2f7;
    --bg-elevated: #ffffff;
    --text: #0f172a;
    --text-2: #475569;
    --text-3: #94a3b8;
    --border: #e2e8f0;
    --success: #059669;
    --success-soft: #d1fae5;
    --warning: #d97706;
    --warning-soft: #fef3c7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 10px;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --nav-h: 64px;
    --header-h: 56px;
    --font: 'Vazirmatn', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body, button, input, textarea, select, option,
h1, h2, h3, h4, h5, h6, p, span, a, label, div, li,
.btn, .form-control, .badge, .card, .bottom-nav {
    font-family: 'Vazirmatn', 'Vazir', Tahoma, sans-serif !important;
}

html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    direction: rtl;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    font-weight: 400;
    letter-spacing: -0.01em;
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img, video { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
}

/* ── Header ── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 60;
    height: var(--header-h);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 0 8px;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.25);
}
.app-header .brand-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.app-header .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(180deg, #fbbf24, #d97706);
    color: #111;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(217,119,6,.35);
}
.app-header h1 {
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-header .header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}
.app-header .icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    transition: background .15s;
}
.app-header .icon-btn:active {
    background: rgba(255,255,255,.15);
}

/* ── Content ── */
#page-content {
    padding: 14px 14px calc(var(--nav-h) + 24px);
    max-width: 560px;
    margin: 0 auto;
    min-height: calc(100vh - var(--header-h) - var(--nav-h));
}
#page-content.chat-mode {
    padding: 0;
    max-width: none;
    min-height: calc(100vh - var(--header-h) - var(--nav-h));
    display: flex;
    flex-direction: column;
}

/* ── Bottom nav ── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 60;
    height: var(--nav-h);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.04);
}
.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-3);
    padding: 8px 0;
    transition: color .15s;
}
.bottom-nav a i {
    font-size: 1.35rem;
    line-height: 1;
}
.bottom-nav a.active {
    color: var(--primary);
    font-weight: 700;
}
.bottom-nav a.active i {
    transform: translateY(-1px);
}

/* ── Cards ── */
.card {
    background: var(--bg-elevated);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 16px;
    margin-bottom: 12px;
}
.card-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--text);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform .12s, box-shadow .12s, background .12s;
    line-height: 1.2;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-outline {
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: #fff;
}
.btn-ghost {
    background: var(--primary-soft);
    color: var(--primary);
}
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; border-radius: var(--radius-xs); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
}
.btn-danger-solid { background: var(--danger); color: #fff; }

/* ── Forms ── */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-2);
}
.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}
textarea.form-control { resize: vertical; min-height: 88px; }

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.badge-blue { background: var(--primary-soft); color: var(--primary); }
.badge-green { background: var(--success-soft); color: #065f46; }
.badge-yellow { background: var(--warning-soft); color: #92400e; }
.badge-red { background: var(--danger-soft); color: #991b1b; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* ── Empty ── */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-3);
}
.empty-state i {
    font-size: 2.8rem;
    opacity: 0.35;
    margin-bottom: 12px;
    display: block;
    color: var(--primary);
}
.empty-state p { font-size: 0.92rem; }

/* ── Ad cards ── */
.ad-card {
    display: flex;
    gap: 0;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226, 232, 240, 0.9);
    overflow: hidden;
    margin-bottom: 12px;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s;
}
.ad-card:active {
    transform: scale(0.985);
    box-shadow: var(--shadow);
}
.ad-card .cover {
    width: 118px;
    min-height: 118px;
    flex-shrink: 0;
    background: var(--primary-soft) center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 2rem;
}
.ad-card .body {
    flex: 1;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
.ad-card .title {
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
}
.ad-card .meta {
    font-size: 0.78rem;
    color: var(--text-3);
    margin-top: 2px;
}
.ad-card .price {
    font-weight: 800;
    color: var(--primary);
    font-size: 0.95rem;
    margin-top: 6px;
    letter-spacing: -0.02em;
}

/* ── Search & tabs ── */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.search-bar input { flex: 1; }
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    background: #fff;
    color: var(--text-2);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.tabs button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* ── Gallery ── */
.gallery-wrap {
    margin: 0 0 14px;
    position: relative;
}
.gallery {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: 0 0 var(--radius) var(--radius);
    background: #0f172a;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery-slide {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    max-height: 320px;
    background: #0f172a;
}
.gallery-slide img,
.gallery-slide video {
    width: 100%;
    height: 280px;
    max-height: 55vh;
    object-fit: contain;
    display: block;
}
.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 4px;
}
.gallery-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: .2s;
}
.gallery-dots span.on {
    background: var(--primary);
    width: 18px;
    border-radius: 6px;
}
.gallery-counter {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(15,23,42,.65);
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    backdrop-filter: blur(6px);
    font-family: 'Vazirmatn', sans-serif;
}
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    z-index: 2;
}
.gallery-nav.prev { right: 10px; }
.gallery-nav.next { left: 10px; }

/* ── Auth modal ── */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
.auth-overlay.show { display: flex; }
.auth-modal {
    width: 100%;
    max-width: 440px;
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0));
    box-shadow: 0 -8px 40px rgba(15,23,42,.2);
    animation: authUp .28s ease;
    font-family: 'Vazirmatn', sans-serif;
}
@keyframes authUp {
    from { transform: translateY(48px); opacity: .6; }
    to { transform: translateY(0); opacity: 1; }
}
@media (min-width: 520px) {
    .auth-overlay { align-items: center; padding: 24px; }
    .auth-modal { border-radius: 24px; max-height: 85vh; }
}
.auth-modal .auth-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.auth-modal .auth-head h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-deep);
}
.auth-close {
    width: 36px; height: 36px; border-radius: 50%;
    background: #f1f5f9; color: var(--text-2);
    display: flex; align-items: center; justify-content: center;
}
.auth-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 14px;
    padding: 4px;
    margin: 14px 0 18px;
    gap: 4px;
}
.auth-tabs button {
    flex: 1;
    padding: 10px 8px;
    border-radius: 11px;
    font-size: .85rem;
    font-weight: 700;
    color: var(--text-3);
    font-family: 'Vazirmatn', sans-serif;
}
.auth-tabs button.on {
    background: #fff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.auth-subtabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.auth-subtabs button {
    flex: 1;
    padding: 9px;
    border-radius: 12px;
    font-size: .82rem;
    font-weight: 600;
    border: 1.5px solid var(--border);
    color: var(--text-2);
    font-family: 'Vazirmatn', sans-serif;
}
.auth-subtabs button.on {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}
.auth-panel { display: none; }
.auth-panel.on { display: block; }
.auth-hint {
    font-size: .8rem;
    color: var(--text-3);
    margin: -6px 0 12px;
    line-height: 1.5;
}
.auth-link {
    text-align: center;
    margin-top: 14px;
    font-size: .85rem;
    color: var(--text-2);
}
.auth-link button {
    color: var(--primary);
    font-weight: 700;
    font-family: 'Vazirmatn', sans-serif;
}

/* ── List rows ── */
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row .left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}
.list-row i.row-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

/* ── Chat UI ── */
.chat-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    height: calc(100vh - var(--header-h) - var(--nav-h));
    height: calc(100dvh - var(--header-h) - var(--nav-h));
    background: linear-gradient(180deg, #e8eef8 0%, #f1f5f9 40%, #eef2ff 100%);
    overflow: hidden;
}
.chat-top {
    flex-shrink: 0;
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(8px);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.chat-top .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.chat-top .info strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
}
.chat-top .info span {
    font-size: 0.75rem;
    color: var(--text-3);
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 14px 12px;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}
.chat-row {
    display: flex;
    width: 100%;
    flex-shrink: 0;
}
.chat-row.mine { justify-content: flex-start; }   /* پیام من — سمت راست در RTL */
.chat-row.theirs { justify-content: flex-end; } /* پیام طرف — سمت چپ در RTL */
.chat-bubble {
    display: block;
    max-width: min(78%, 320px);
    width: fit-content;
    padding: 11px 14px;
    border-radius: 18px;
    font-size: 0.92rem;
    line-height: 1.65;
    position: relative;
    overflow-wrap: anywhere;
    word-break: break-word;
    word-wrap: break-word;
    hyphens: auto;
    box-sizing: border-box;
}
.chat-bubble.mine {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.chat-bubble.theirs {
    background: #fff;
    color: var(--text);
    border-bottom-left-radius: 6px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(226,232,240,.8);
}
.chat-bubble .chat-text {
    display: block;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.chat-time {
    display: block;
    font-size: 0.68rem;
    opacity: 0.7;
    margin-top: 6px;
    line-height: 1.2;
}
.chat-bubble.mine .chat-time { text-align: left; }
.chat-bubble.theirs .chat-time { text-align: right; }
.chat-composer {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0));
    background: rgba(255,255,255,.95);
    border-top: 1px solid var(--border);
    align-items: flex-end;
}
.chat-composer input {
    flex: 1;
    border: 1.5px solid var(--border);
    border-radius: 22px;
    padding: 11px 16px;
    outline: none;
    background: #f8fafc;
}
.chat-composer input:focus {
    border-color: var(--primary);
    background: #fff;
}
.chat-composer .btn-send {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px var(--primary-glow);
}

/* ── Dealer picker ── */
.dealer-pick {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: border-color .15s;
}
.dealer-pick:focus, .dealer-pick.open {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}
.dealer-pick .placeholder { color: var(--text-3); }
.dealer-pick .selected-name { font-weight: 700; color: var(--text); }
.dealer-sheet {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.dealer-sheet.show { display: flex; }
.dealer-sheet-panel {
    background: #fff;
    width: 100%;
    max-width: 560px;
    max-height: 75vh;
    border-radius: 20px 20px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0));
    display: flex;
    flex-direction: column;
    animation: sheetUp .25s ease;
}
@keyframes sheetUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.dealer-sheet-panel h3 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 12px;
    text-align: center;
}
.dealer-sheet-list {
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
.dealer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    border-radius: var(--radius-xs);
}
.dealer-item:active { background: var(--primary-soft); }
.dealer-item .d-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}
.dealer-item .d-info { flex: 1; min-width: 0; }
.dealer-item .d-info strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
}
.dealer-item .d-info span {
    font-size: 0.78rem;
    color: var(--text-3);
}

/* ── Status timeline chip ── */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-dot.registered { background: var(--primary); }
.status-dot.accepted { background: var(--success); }
.status-dot.rejected { background: var(--danger); }
.status-dot.done { background: #64748b; }

/* ── Login ── */
.login-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(14, 165, 233, 0.35), transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(37, 99, 235, 0.4), transparent 50%),
        linear-gradient(160deg, #1e3a8a 0%, #2563eb 50%, #0ea5e9 100%);
}
.login-card {
    background: rgba(255,255,255,.97);
    border-radius: 24px;
    padding: 32px 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}
.login-card .logo-mark {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 14px;
    box-shadow: 0 8px 24px var(--primary-glow);
}
.login-card h2 {
    text-align: center;
    margin-bottom: 4px;
    color: var(--primary-deep);
    font-weight: 800;
    font-size: 1.35rem;
}
.login-card .sub {
    text-align: center;
    color: var(--text-3);
    font-size: 0.88rem;
    margin-bottom: 24px;
}

/* skeleton */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: sk 1.2s infinite;
    border-radius: 12px;
}
@keyframes sk {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.section-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-3);
    text-transform: none;
    margin: 18px 4px 10px;
    letter-spacing: 0.02em;
}

@media (min-width: 768px) {
    html { font-size: 15.5px; }
    #page-content { padding-top: 20px; }
}


/* ── Home hero ── */
.home-hero {
    background: linear-gradient(145deg, #0f172a 0%, #1e3a8a 55%, #1d4ed8 100%);
    color: #fff;
    border-radius: 22px;
    padding: 20px 18px 22px;
    margin: -4px 0 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
    position: relative;
    overflow: hidden;
}
.home-hero::after {
    content: "";
    position: absolute;
    left: -20px;
    bottom: -30px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(251,191,36,.35), transparent 70%);
    pointer-events: none;
}
.home-kicker {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 4px;
    letter-spacing: .02em;
}
.home-hero h2 {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.45;
    margin-bottom: 4px;
}
.home-sub { font-size: 0.82rem; color: rgba(255,255,255,.78); }

.ad-card {
    flex-direction: column;
}
.ad-card .cover {
    width: 100%;
    min-height: 168px;
    height: 168px;
    background-size: cover;
    background-position: center;
}
.ad-card .ad-top { margin-bottom: 6px; }
.chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 999px;
}
.chip-sale { background: #dbeafe; color: #1d4ed8; }
.chip-buy { background: #fef3c7; color: #92400e; }
.ad-card .showroom {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 5px;
}
.ad-card .price small {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-3);
    margin-right: 4px;
}

.search-bar {
    background: #fff;
    border-radius: 16px;
    padding: 6px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.search-bar .form-control {
    border: none;
    box-shadow: none;
    background: transparent;
}
.search-bar .btn { border-radius: 12px; min-width: 48px; padding: 10px 14px; }

.hidden { display: none !important; }

.ad-card-row {
    flex-direction: row !important;
    min-height: 108px;
}
.ad-card-row .cover {
    width: 112px !important;
    min-width: 112px;
    height: 108px !important;
    min-height: 108px !important;
}
.ad-card-row .body { padding: 8px 10px; }
.ad-card-row .title { font-size: 0.86rem; -webkit-line-clamp: 1; }
.ad-card-row .price { font-size: 0.88rem; margin-top: 4px; }
.ad-card-row .ad-foot {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.7rem;
    color: var(--text-3);
    margin-top: 4px;
}
.chip-urgent { background: #fee2e2; color: #991b1b; }

.detail-hero {
    background: #fff;
    border-radius: 18px;
    padding: 16px;
    margin: 12px 0;
    box-shadow: var(--shadow-sm);
}
.detail-title { font-size: 1.2rem; font-weight: 800; line-height: 1.5; margin: 6px 0; }
.detail-price { font-size: 1.25rem; font-weight: 800; color: var(--primary); margin: 4px 0 8px; }
.detail-meta { font-size: 0.8rem; color: var(--text-3); }
.detail-chips { display: flex; gap: 6px; }
.detail-text { font-size: 0.9rem; white-space: pre-wrap; line-height: 1.8; }
.spec-grid { display: flex; flex-direction: column; }
.spec-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}
.spec-row span { color: var(--text-3); }
.spec-row:last-child { border-bottom: none; }
.feat-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.feat-chip {
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
}
.detail-actions {
    display: flex;
    gap: 8px;
    margin: 8px 0 16px;
}
.detail-actions .btn { flex: 1; }
.report-link {
    display: block;
    width: 100%;
    text-align: center;
    color: var(--text-3);
    font-size: 0.82rem;
    padding: 8px;
    margin-bottom: 24px;
}
.report-modal { margin-bottom: 24px; }
.gallery-empty {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    color: #94a3b8;
    font-size: 3rem;
    border-radius: 0 0 16px 16px;
}

.app-header .brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fff;
    object-fit: cover;
    flex-shrink: 0;
}
.app-header .brand-name {
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    opacity: .9;
}
.app-header h1 { font-size: 0.92rem !important; font-weight: 700 !important; }

.hero-slider { margin: -4px 0 16px; overflow: hidden; border-radius: 22px; }
.hero-track { display: flex; width: 200%; transition: transform .45s ease; }
.hero-track .slide { width: 50%; flex: 0 0 50%; margin: 0; /*border-radius: 0;*/ box-shadow: none; }
.hero-dots { display: flex; justify-content: center; gap: 6px; padding: 8px 0 0; }
.hero-dots span { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; }
.hero-dots span.on { width: 18px; border-radius: 8px; background: var(--primary); }
.hero-app { cursor: pointer; background: linear-gradient(145deg, #1e3a8a 0%, #0f172a 60%, #b45309 130%) !important; }

.ad-card .title, .ad-card-row .title {
    -webkit-line-clamp: unset !important;
    display: block !important;
    overflow: visible !important;
    white-space: normal;
    word-break: break-word;
}

.public-page .public-hero { text-align: center; }
.public-page .public-logo { width: 64px; height: 64px; margin: 0 auto 12px; }
.public-page h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 8px; }
.public-page h3 { font-size: 1rem; font-weight: 800; margin: 12px 0 6px; }
.public-page p, .public-page li { font-size: .92rem; line-height: 1.9; color: var(--text-2); }
.public-list { padding-right: 2px; }
.public-list.numbered { padding-right: 18px; list-style: decimal; }
.public-list.numbered li { list-style: decimal; margin-bottom: 6px; }
.muted { font-size: .85rem; color: var(--text-3); }
