/* ==========================================================================
   EndPoint.Site — public website, login and admin panel
   (tokens and shared components come from melkvareh.css)
   ========================================================================== */

/* ---------- Public site ---------- */
.site-floating-action {
    position: fixed;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    z-index: 1020;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-width: 48px;
    min-height: 48px;
    padding: .75rem;
    border: 1px solid var(--mv-border);
    border-radius: 999px;
    background: var(--mv-primary-700, #0f766e);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 16px #0003;
    cursor: pointer;
}

.site-floating-call {
    right: calc(1rem + env(safe-area-inset-right, 0px));
}

.site-floating-top {
    left: calc(1rem + env(safe-area-inset-left, 0px));
}

.site-floating-action:hover {
    color: #fff;
    filter: brightness(1.1);
}

.site-floating-action:focus-visible {
    outline: 3px solid var(--mv-primary-700, #0f766e);
    outline-offset: 4px;
}

.site .site-footer {
    padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
}

.site-navbar {
    min-height: 72px;
    background: color-mix(in srgb, var(--mv-bg) 85%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--mv-border);
}

.site-navbar .nav-link {
    font-weight: 700;
    color: var(--mv-muted);
    padding-inline: .9rem !important;
    border-radius: 10px;
}

.site-navbar .nav-link:hover,
.site-navbar .nav-link.active {
    color: var(--mv-primary-700);
}

.site-navbar .navbar-collapse {
    order: 1;
    padding-block: .5rem;
}

.site-navbar-header {
    display: contents;
}

.site-navbar-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
    order: 2;
}

.site-app-link {
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .site-navbar > .container {
        display: block;
    }

    .site-navbar-header {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: .5rem;
        /* Keep this row's height independent of the expanding menu below it. */
        min-height: 56px;
    }

    .site-navbar-header > .mv-brand {
        flex-shrink: 0;
    }

    .site-navbar-actions {
        order: 0;
        margin-inline-start: auto;
        gap: .35rem;
    }

    .site-navbar .navbar-toggler {
        flex-shrink: 0;
        padding: .25rem;
        min-width: 40px;
        min-height: 44px;
    }

    .site-navbar .navbar-collapse {
        min-width: 0;
        max-height: 70vh;
        max-height: 70dvh;
        overflow-y: auto;
    }

    .site-app-link {
        padding: .6rem .65rem;
        font-size: .8rem;
    }

    .site-app-link .bi {
        display: none;
    }
}

@media (max-width: 359.98px) {
    .site-navbar .mv-brand > span {
        display: none;
    }
}

.site-hero {
    position: relative;
    overflow: hidden;
    padding: 4rem 0 3rem;
    background:
        radial-gradient(60% 60% at 90% 10%, rgba(20, 184, 166, .16) 0%, transparent 70%),
        radial-gradient(40% 40% at 10% 90%, rgba(245, 158, 11, .12) 0%, transparent 70%);
}

.site-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: .35rem .85rem;
    border-radius: 999px;
    background: var(--mv-accent-soft);
    color: #92400E;
    font-weight: 700;
    font-size: .85rem;
    margin-bottom: 1rem;
}

[data-bs-theme=dark] .site-eyebrow {
    color: var(--mv-accent);
}

.site-hero-title {
    font-size: clamp(2rem, 4.5vw, 3.1rem);
    line-height: 1.45;
    margin-bottom: 1rem;
}

.text-gradient {
    background: linear-gradient(135deg, #14B8A6, #0F766E 60%, #F59E0B);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.site-hero-text {
    font-size: 1.05rem;
    line-height: 2;
    color: var(--mv-muted);
    margin-bottom: 1.75rem;
    max-width: 560px;
}

@media (max-width: 991.98px) {
    .site-hero-text {
        margin-inline: auto;
    }
}

.site-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 1.75rem;
    color: var(--mv-muted);
    font-size: .9rem;
    font-weight: 500;
}

@media (max-width: 991.98px) {
    .site-platforms {
        justify-content: center;
    }
}

.site-platforms .bi {
    color: var(--mv-primary-700);
    margin-inline-end: .25rem;
}

.site-phone {
    position: relative;
    width: min(300px, 78vw);
    margin: 0 auto;
    padding: 12px;
    border-radius: 46px;
    background: #0F1F1D;
    box-shadow: 0 40px 80px -30px rgba(15, 94, 89, .55), 0 0 0 1px rgba(255, 255, 255, .06) inset;
    transform: rotate(-3deg);
}

.site-phone::before {
    content: "";
    position: absolute;
    top: 22px;
    left: 50%;
    width: 90px;
    height: 24px;
    border-radius: 20px;
    background: #0F1F1D;
    transform: translateX(-50%);
    z-index: 2;
}

.site-phone-screen {
    overflow: hidden;
    border-radius: 36px;
    aspect-ratio: 390 / 844;
    background: var(--mv-bg);
}

.site-phone-screen img {
    width: 100%;
    display: block;
}

.site-section {
    padding: 4rem 0;
}

.site-section-alt {
    background: var(--mv-surface);
    border-block: 1px solid var(--mv-border);
}

.site-section-head {
    text-align: center;
    margin-bottom: 2.5rem;
}

.site-section-head h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: .5rem;
}

.site-section-head p {
    color: var(--mv-muted);
    margin: 0;
}

.site-service,
.site-feature,
.site-contact {
    height: 100%;
    padding: 1.5rem;
    border-radius: var(--mv-radius-lg);
    background: var(--mv-surface);
    border: 1px solid var(--mv-border);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.site-service:hover,
.site-contact:hover {
    transform: translateY(-4px);
    box-shadow: var(--mv-shadow);
    border-color: color-mix(in srgb, var(--mv-cat, var(--mv-primary)) 35%, var(--mv-border));
}

.site-service h3,
.site-feature h3,
.site-contact h3 {
    font-size: 1.05rem;
    margin: 1rem 0 .4rem;
}

.site-service p,
.site-feature p,
.site-contact p {
    color: var(--mv-muted);
    font-size: .9rem;
    line-height: 1.9;
    margin: 0;
}

.site-feature {
    background: var(--mv-bg);
}

.site-feature > .bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--mv-hero);
    color: #fff;
    font-size: 1.4rem;
    box-shadow: var(--mv-shadow-lg);
}

.site-contact {
    display: block;
    text-align: center;
    color: var(--mv-text);
}

.site-contact .mv-category-icon {
    margin: 0 auto;
}

.site-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2.5rem;
    border-radius: 28px;
    background: var(--mv-hero);
    color: #fff;
    box-shadow: var(--mv-shadow-lg);
}

.site-cta h2 {
    color: #fff;
    margin-bottom: .35rem;
}

.site-cta p {
    margin: 0;
    color: rgba(255, 255, 255, .85);
}

.site-page-head {
    padding: 3.5rem 0 2.5rem;
    text-align: center;
    background: radial-gradient(50% 80% at 50% 0%, rgba(20, 184, 166, .14) 0%, transparent 70%);
}

.site-page-head h1 {
    font-size: clamp(1.7rem, 3.5vw, 2.4rem);
}

.site-page-head p {
    color: var(--mv-muted);
    margin: 0;
}

.site-prose {
    max-width: 820px;
}

.site-prose h2 {
    font-size: 1.2rem;
    margin: 1.75rem 0 .75rem;
}

.site-prose h2:first-child {
    margin-top: 0;
}

.site-prose p {
    line-height: 2.1;
    color: var(--mv-muted);
}

.site-footer {
    padding: 3rem 0 2rem;
    background: var(--mv-surface);
    border-top: 1px solid var(--mv-border);
}

.site-footer-title {
    font-size: .95rem;
    margin-bottom: 1rem;
}

.site-footer-links li + li {
    margin-top: .6rem;
}

.site-footer-links a {
    color: var(--mv-muted);
    font-size: .9rem;
}

.site-footer-links a:hover {
    color: var(--mv-primary-700);
}

/* ---------- Login / account pages ---------- */
.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(60% 50% at 100% 0%, rgba(20, 184, 166, .22) 0%, transparent 70%),
        radial-gradient(50% 50% at 0% 100%, rgba(245, 158, 11, .14) 0%, transparent 70%),
        var(--mv-bg);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2rem 1.75rem;
    border-radius: 28px;
    background: var(--mv-surface);
    border: 1px solid var(--mv-border);
    box-shadow: var(--mv-shadow-lg);
}

/* ---------- Admin panel ---------- */
.admin {
    --admin-sidebar-width: 260px;
}

/* On phones the menu slides in from the right (offcanvas-start in RTL), narrower than the screen */
@media (max-width: 991.98px) {
    .admin-sidebar {
        --bs-offcanvas-width: min(320px, 85vw);
    }

    .admin-sidebar-brand {
        flex-shrink: 0;
    }

    .admin-sidebar .admin-nav {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }

    .admin-sidebar .admin-nav > * {
        flex-shrink: 0;
    }
}

/* Its inner edge is the left */
.admin-sidebar {
    background: var(--mv-surface);
    border-inline-end: 1px solid var(--mv-border);
}

@media (min-width: 992px) {
    .admin-sidebar {
        position: fixed;
        inset-block: 0;
        inset-inline-start: 0;
        width: var(--admin-sidebar-width);
        display: flex;
        flex-direction: column;
        border-inline-start: 0;
        border-inline-end: 1px solid var(--mv-border);
        overflow-y: auto;
    }

    .admin-main {
        margin-inline-start: var(--admin-sidebar-width);
    }
}

.admin-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem .75rem;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .5rem .85rem 1.5rem;
}

.admin-nav-title {
    margin: 1rem .6rem .4rem;
    font-size: .72rem;
    font-weight: 700;
    color: var(--mv-muted);
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem .8rem;
    border-radius: 12px;
    color: var(--mv-text);
    font-weight: 500;
    font-size: .92rem;
}

.admin-nav a .bi {
    font-size: 1.1rem;
    color: var(--mv-muted);
}

.admin-nav a .badge {
    margin-inline-start: auto;
    font-size: .65rem;
}

.admin-nav a:hover {
    background: var(--mv-surface-2);
}

.admin-nav a.active {
    background: var(--mv-primary-soft);
    color: var(--mv-primary-700);
    font-weight: 800;
}

.admin-nav a.active .bi {
    color: var(--mv-primary-700);
}

/* Sign out, last in the menu */
.admin-nav-logout {
    margin-top: .5rem;
    padding-top: .5rem;
    border-top: 1px solid var(--mv-border);
}

.admin-nav-logout button {
    display: flex;
    align-items: center;
    gap: .7rem;
    width: 100%;
    padding: .65rem .8rem;
    border: 0;
    border-radius: 12px;
    background: none;
    color: var(--bs-danger);
    font-weight: 600;
    font-size: .92rem;
    text-align: start;
}

.admin-nav-logout button .bi {
    font-size: 1.1rem;
}

.admin-nav-logout button:hover {
    background: rgba(220, 53, 69, .08);
}

/* Top-level links match the group headers */
.admin-nav > a {
    font-weight: 600;
}

/* Collapsible groups */
.admin-nav-group summary {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem .8rem;
    border-radius: 12px;
    color: var(--mv-text);
    font-weight: 600;
    font-size: .92rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.admin-nav-group summary::-webkit-details-marker {
    display: none;
}

.admin-nav-group summary:hover {
    background: var(--mv-surface-2);
}

.admin-nav-group summary > .bi:first-child {
    font-size: 1.1rem;
    color: var(--mv-muted);
}

.admin-nav-label {
    flex: 1;
}

.admin-nav-group summary .badge {
    font-size: .65rem;
}

.admin-nav-caret {
    font-size: .75rem;
    color: var(--mv-muted);
    transition: transform .15s;
}

.admin-nav-group[open] .admin-nav-caret {
    transform: rotate(180deg);
}

.admin-nav-group[open] summary {
    color: var(--mv-primary-700);
}

.admin-nav-group[open] summary .badge {
    display: none;
}

.admin-nav-items {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    margin: .1rem 1.1rem .35rem 0;
    padding-inline-start: .6rem;
    border-inline-start: 2px solid var(--mv-border);
}

.admin-nav-items a {
    padding: .5rem .7rem;
    font-size: .88rem;
}

.admin-nav-items a .bi {
    font-size: 1rem;
}

.admin-nav a.disabled {
    opacity: .55;
    pointer-events: none;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 68px;
    padding: .75rem 1.25rem;
    background: color-mix(in srgb, var(--mv-bg) 85%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--mv-border);
}

.admin-title {
    flex: 1;
    margin: 0;
    font-size: 1.15rem;
}

.admin-content {
    padding: 1.5rem 1.25rem 3rem;
    max-width: 1280px;
}

.admin-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.75rem;
    border-radius: var(--mv-radius-lg);
    background: var(--mv-hero);
    color: #fff;
    box-shadow: var(--mv-shadow-lg);
}

.admin-welcome h2 {
    color: #fff;
    font-size: 1.25rem;
    margin-bottom: .25rem;
}

.admin-welcome p {
    margin: 0;
    color: rgba(255, 255, 255, .85);
}

.admin-welcome img {
    width: 72px;
    height: 72px;
    opacity: .95;
}

.admin-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-radius: var(--mv-radius);
    background: var(--mv-surface);
    border: 1px solid var(--mv-border);
    box-shadow: var(--mv-shadow-sm);
}

.admin-stat .mv-category-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 1.35rem;
}

.admin-stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
}

.admin-stat-label {
    color: var(--mv-muted);
    font-size: .85rem;
}

/* ---------- Admin: categories ---------- */
.admin-cat-head {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--mv-border);
}

.admin-cat-head .mv-category-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 1.2rem;
}

.admin-cat-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1.1rem;
    border-bottom: 1px solid var(--mv-border);
}

.admin-cat-row .mv-list-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mv-cat, var(--mv-primary));
}

.admin-cat-row.is-group {
    font-weight: 800;
    background: var(--mv-surface-2);
}

.admin-cat-children .admin-cat-row {
    padding-inline-start: 2.4rem;
}

.admin-cat-rows:last-child > .admin-cat-row:last-child {
    border-bottom: 0;
}

.admin-table {
    --bs-table-bg: transparent;
    font-size: .9rem;
}

.admin-table th {
    color: var(--mv-muted);
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}

.admin-inline-form .form-control {
    max-width: 240px;
}

/* ---------- Theme toggle ---------- */
.mv-theme-toggle .mv-when-dark,
[data-bs-theme=dark] .mv-theme-toggle .mv-when-light {
    display: none;
}

[data-bs-theme=dark] .mv-theme-toggle .mv-when-dark {
    display: inline-block;
}

.auth-toolbar {
    position: fixed;
    top: 1rem;
    inset-inline-end: 1rem;
    z-index: 10;
}

/* ---------- Admin: ads ---------- */
/* Tabs and filters are links (mv-segmented only styles buttons): each one a separate pill */
.admin-tabs {
    flex-wrap: wrap;
    width: fit-content;
    max-width: 100%;
}

.admin-tabs a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .9rem;
    border-radius: 10px;
    color: var(--mv-muted);
    font-weight: 700;
    font-size: .85rem;
    white-space: nowrap;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.admin-tabs a:hover {
    color: var(--mv-text);
    background: var(--mv-surface);
}

.admin-tabs a.active {
    background: var(--mv-surface);
    color: var(--mv-primary-700);
    box-shadow: var(--mv-shadow-sm);
}

.admin-tabs a.active .admin-tab-count {
    background: var(--mv-primary-soft);
}

.admin-tab-count {
    font-size: .72rem;
    background: var(--mv-surface-2);
    border-radius: 999px;
    padding: 0 .45rem;
}

.admin-search {
    position: relative;
    min-width: 260px;
}

.admin-search .bi {
    position: absolute;
    inset-inline-start: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mv-muted);
}

.admin-search .form-control {
    padding-inline-start: 2.4rem;
}

.admin-ad-row {
    gap: .9rem;
}

.admin-ad-thumb {
    flex: 0 0 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--mv-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mv-muted);
    font-size: 1.3rem;
}

.admin-ad-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (min-width: 992px) {
    .admin-sticky {
        position: sticky;
        top: 5.5rem;
    }
}

.admin-word {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .35rem .2rem .7rem;
    border-radius: 999px;
    background: var(--mv-surface-2);
    border: 1px solid var(--mv-border);
    font-size: .85rem;
}

.admin-word .btn {
    color: var(--mv-muted);
    line-height: 1;
}

.admin-word .btn:hover {
    color: #E11D48;
}

.admin-review-banner {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .9rem 1.1rem;
    border-radius: var(--mv-radius);
    background: rgba(245, 158, 11, .12);
    border: 1px solid rgba(245, 158, 11, .35);
    color: inherit;
    text-decoration: none;
    --mv-cat: #F59E0B;
}

/* ---------- Admin: businesses ---------- */
.admin-business-cover {
    height: 140px;
    background: linear-gradient(135deg, var(--mv-primary-600), var(--mv-primary-800)) center / cover;
}

.admin-business-logo {
    width: 72px;
    height: 72px;
    margin-top: -48px;
    border-radius: 50%;
    border: 4px solid var(--mv-surface);
    background: var(--mv-surface-2);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--mv-muted);
    flex: none;
}

.admin-business-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-docs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .6rem;
}

.admin-doc {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--mv-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--mv-surface-2);
    color: inherit;
    text-decoration: none;
    font-size: .8rem;
    position: relative;
}

.admin-doc img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-doc span {
    position: relative;
    background: rgba(15, 23, 22, .65);
    color: #fff;
    border-radius: 999px;
    padding: .1rem .6rem;
    margin-top: auto;
    margin-bottom: .4rem;
}

.admin-doc .bi {
    font-size: 2rem;
    color: #DC2626;
    margin-top: auto;
}

/* ---------- Admin: posts ---------- */
.admin-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.admin-post-media {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 2px;
    background: #000;
}

.admin-post-media a {
    position: relative;
    aspect-ratio: 1;
}

.admin-post-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-post-media .bi {
    position: absolute;
    inset: 0;
    margin: auto;
    width: fit-content;
    height: fit-content;
    color: #fff;
    font-size: 1.8rem;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}

.admin-post-caption {
    white-space: pre-line;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Identity inquiry of the business manager */
.admin-identity { border-radius: var(--mv-radius-sm); padding: .75rem; background: var(--mv-accent-soft); }
.admin-identity-verified { background: var(--mv-primary-soft); }
.admin-identity-mismatch { background: rgba(220, 38, 38, .1); }
.admin-identity-mismatch .bi { color: #DC2626; }
.admin-identity .bi { font-size: 1.2rem; }

/* Support tickets and chats in the panel */
.admin-thread { display: flex; flex-direction: column; gap: .6rem; }
.admin-thread-message { background: var(--mv-surface); border-radius: var(--mv-radius-sm); padding: .75rem .9rem; border-inline-start: 3px solid var(--mv-border); box-shadow: var(--mv-shadow-sm); }
.admin-thread-message.staff { border-inline-start-color: var(--mv-primary); background: var(--mv-primary-soft); }
.admin-thread-message.internal { border-inline-start-color: var(--mv-accent); background: var(--mv-accent-soft); }
.admin-thread-message.removed { opacity: .6; text-decoration: line-through; }

/* ---------- Public pages (ads, businesses, legal) ---------- */
.pub-page { padding-top: 1.5rem; padding-bottom: 2.5rem; }
.pub-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; }
.pub-breadcrumb { font-size: .85rem; color: var(--mv-muted); margin-bottom: .75rem; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.pub-breadcrumb a { color: inherit; text-decoration: none; }
.pub-search { position: relative; margin-bottom: 1rem; max-width: 560px; }
.pub-search .bi { position: absolute; inset-inline-start: .9rem; top: 50%; transform: translateY(-50%); color: var(--mv-muted); }
.pub-search input { padding-inline-start: 2.5rem; border-radius: 999px; }
.pub-ads { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75rem; }
.pub-ad { display: flex; gap: .75rem; background: var(--mv-surface); border-radius: var(--mv-radius); padding: .6rem; text-decoration: none; color: inherit; box-shadow: var(--mv-shadow-sm); }
.pub-ad:hover { box-shadow: var(--mv-shadow); }
.pub-ad-thumb { width: 110px; height: 110px; border-radius: var(--mv-radius-sm); overflow: hidden; flex-shrink: 0; background: var(--mv-bg); display: grid; place-items: center; color: var(--mv-muted); font-size: 1.6rem; }
.pub-ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pub-ad-body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.pub-ad-body strong { line-height: 1.6; }
.pub-ad-price { color: var(--mv-primary); font-weight: 700; }
.pub-ad-meta { color: var(--mv-muted); font-size: .8rem; }
.pub-cta { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; background: var(--mv-primary-soft); border-radius: var(--mv-radius); padding: 1rem 1.25rem; }
.pub-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.pub-gallery img { width: 100%; height: auto; border-radius: var(--mv-radius-sm); object-fit: cover; aspect-ratio: 4 / 3; }
.pub-gallery img:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
.pub-description { white-space: pre-wrap; line-height: 2; }
.pub-sticky { position: sticky; top: 90px; }
.pub-business-chip { display: inline-flex; gap: .35rem; align-items: center; background: var(--mv-primary-soft); color: var(--mv-primary); border-radius: 999px; padding: .2rem .7rem; text-decoration: none; font-size: .85rem; }
.pub-profile { display: flex; gap: 1rem; align-items: flex-start; }
.pub-logo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: grid; place-items: center; background: var(--mv-primary-soft); color: var(--mv-primary); font-size: 2rem; }
.pub-logo.small { width: 52px; height: 52px; font-size: 1.3rem; }
.pub-business { display: flex; gap: .75rem; align-items: center; text-decoration: none; color: inherit; }
.pub-business img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.pub-legal { max-width: 820px; line-height: 2.1; }
.pub-legal h2 { font-size: 1.1rem; font-weight: 800; margin-top: 1.5rem; }

/* Logs */
.admin-pre { white-space: pre-wrap; word-break: break-word; font-size: .75rem; max-height: 480px; overflow: auto; background: var(--mv-surface-2, #f5f5f7); border-radius: 12px; padding: 12px; margin: 0; text-align: left; }
.admin-table { width: 100%; font-size: .85rem; }
.admin-table th { font-weight: 600; color: var(--mv-muted, #6b7280); white-space: nowrap; }
.admin-table td, .admin-table th { padding: 8px 6px; border-bottom: 1px solid var(--mv-border, #eee); vertical-align: top; }
.admin-table-wrap { overflow-x: auto; }

/* Article editor */
.admin-editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.admin-editor { min-height: 360px; max-height: 70vh; overflow: auto; line-height: 2; }
.admin-editor h2 { font-size: 1.25rem; margin-top: 1rem; }
.admin-editor h3 { font-size: 1.1rem; margin-top: .75rem; }
.admin-editor blockquote { border-right: 3px solid var(--mv-primary, #2563eb); padding-right: 12px; color: var(--mv-muted, #6b7280); }

/* Blog */
.pub-article { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-decoration: none; color: inherit; }
.pub-article:hover { box-shadow: var(--mv-shadow); }
.pub-article-cover { position: relative; width: 100%; flex-shrink: 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--mv-primary-soft); display: grid; place-items: center; color: var(--mv-primary); font-size: 2rem; }
.pub-article-cover img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.pub-article-body { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: .35rem; padding: .9rem 1rem 1.1rem; background: var(--mv-surface); }
.pub-article-body strong { line-height: 1.8; color: var(--mv-text); }
.pub-article-card-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    direction: rtl;
    gap: .5rem;
    margin-bottom: .25rem;
    font-size: .8rem;
    color: var(--mv-text);
}
.pub-article-category {
    justify-self: start;
    max-width: 100%;
    padding: .2rem .5rem;
    border-radius: .5rem;
    background: var(--mv-primary-soft);
    color: var(--mv-primary-700);
    font-weight: 700;
    overflow-wrap: anywhere;
    text-align: right;
}
.pub-article-date {
    direction: rtl;
    unicode-bidi: isolate;
    text-align: left;
    white-space: nowrap;
}
.pub-article-summary { color: var(--mv-muted); font-size: .9rem; line-height: 1.9; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pub-article-meta { color: var(--mv-muted); font-size: .8rem; }
.pub-article-page { max-width: 820px; }
.pub-article-hero { width: 100%; border-radius: var(--mv-radius); margin-bottom: 1rem; aspect-ratio: 16 / 9; object-fit: cover; }
.pub-article-lead { font-size: 1.05rem; font-weight: 600; line-height: 2; }
.pub-article-content { line-height: 2.2; font-size: 1rem; }
.pub-article-content h2 { font-size: 1.3rem; font-weight: 800; margin-top: 1.75rem; }
.pub-article-content h3 { font-size: 1.1rem; font-weight: 700; margin-top: 1.25rem; }
.pub-article-content img { max-width: 100%; height: auto; border-radius: var(--mv-radius-sm); }
.pub-article-content blockquote { border-inline-start: 4px solid var(--mv-primary); padding-inline-start: 1rem; color: var(--mv-muted); }
.pub-article-content table { width: 100%; border-collapse: collapse; }
.pub-article-content td, .pub-article-content th { border: 1px solid var(--mv-border); padding: .4rem .6rem; }
/* Home: live content */
.site-banners { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; gap: .75rem; border-radius: var(--mv-radius); scrollbar-width: none; }
.site-banners a { scroll-snap-align: start; display: block; border-radius: var(--mv-radius); overflow: hidden; aspect-ratio: 3 / 1; background: var(--mv-bg); }
.site-banners img { width: 100%; height: 100%; object-fit: cover; }
.site-section-link { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1rem; }
.site-section-link h2 { font-size: 1.35rem; font-weight: 800; margin: 0; }
.admin-rows summary > .bi, .admin-content h3 > .bi, .admin-content h2 > .bi { margin-inline-end: .4rem; }
.pub-article-meta .bi { margin-inline-end: .3rem; margin-inline-start: 0 !important; }

/* Sent SMS: the text as the user got it, line breaks included */
.admin-sms-cell {
    min-width: 260px;
    line-height: 1.9;
}

.admin-sms-text {
    white-space: pre-line;
}

/* ---------- Public pages: maps, posts, story ring ---------- */
.pub-map-canvas {
    /* Leaflet's panes and controls use z-index up to 1000: keep them under the sticky site header */
    position: relative;
    z-index: 0;
    isolation: isolate;
    width: 100%;
    background: var(--mv-surface-2);
}

.pub-map-failed::after {
    content: "نقشه بارگذاری نشد";
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--mv-muted);
    font-size: .9rem;
}

.pub-map .leaflet-container {
    font-family: inherit;
}

.pub-posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .35rem;
}

@media (min-width: 768px) {
    .pub-posts {
        grid-template-columns: repeat(4, 1fr);
        gap: .5rem;
    }
}

.pub-post {
    position: relative;
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 10px;
    background: var(--mv-surface-2);
}

.pub-post img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s;
}

.pub-post:hover img {
    transform: scale(1.04);
}

.pub-post-badge {
    position: absolute;
    top: .4rem;
    left: .4rem;
    color: #fff;
    font-size: 1.1rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}

.pub-logo-wrap {
    flex: none;
    display: inline-flex;
    border-radius: 50%;
}

.pub-logo-wrap.has-stories {
    padding: 3px;
    background: linear-gradient(135deg, #F59E0B, #EC4899, #0D9488);
}

.pub-logo-wrap.has-stories .pub-logo {
    border: 3px solid var(--mv-surface);
}

/* ---------- Admin dashboard ---------- */
/* Series colors: a validated categorical order (blue, orange, aqua, yellow), stepped separately for dark */
.admin-dash {
    --series-1: #2a78d6;
    --series-2: #eb6834;
    --series-3: #1baf7a;
    --series-4: #eda100;
    --chart-grid: #e1e0d9;
    --chart-axis: #c3c2b7;
    --chart-ink-muted: #898781;
    --delta-up: #006300;
    --delta-down: #b42318;
}

[data-bs-theme="dark"] .admin-dash {
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --chart-grid: #2c2c2a;
    --chart-axis: #383835;
    --delta-up: #0ca30c;
    --delta-down: #f27a6e;
}

.dash-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.4rem;
    border-radius: 20px;
    /* Fixed dark teal in both themes so the white text always reads */
    background: linear-gradient(135deg, #0F766E, #134E4A);
    color: #fff;
}

.dash-hero h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 0 .25rem;
    /* Headings have a theme color elsewhere; here always on the dark teal */
    color: #fff;
}

.dash-hero h2 .dash-wave {
    display: inline-block;
    transform-origin: 70% 70%;
    animation: dash-wave 2.4s ease-in-out 1;
}

@keyframes dash-wave {
    0%, 60%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
}

.dash-hero p {
    margin: 0;
    color: #fff;
    opacity: .85;
    font-size: .9rem;
}

.dash-quick {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.dash-quick a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .8rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}

.dash-quick a:hover {
    background: rgba(255, 255, 255, .26);
}

.dash-tasks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .75rem;
}

.dash-task {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "icon count go" "icon title go";
    column-gap: .75rem;
    align-items: center;
    padding: .85rem 1rem;
    border-radius: 16px;
    background: var(--mv-surface);
    border: 1px solid var(--mv-border);
    color: var(--mv-text);
    text-decoration: none;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}

.dash-task:hover {
    transform: translateY(-2px);
    box-shadow: var(--mv-shadow);
    border-color: var(--mv-primary);
}

.dash-task-icon {
    grid-area: icon;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--mv-primary-soft);
    color: var(--mv-primary-700);
    font-size: 1.2rem;
}

.dash-task-count {
    grid-area: count;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
}

.dash-task-title {
    grid-area: title;
    font-size: .82rem;
    color: var(--mv-muted);
}

.dash-task-go {
    grid-area: go;
    color: var(--mv-muted);
}

.dash-task.is-urgent .dash-task-icon {
    background: rgba(220, 53, 69, .12);
    color: #dc3545;
}

.dash-task.is-done {
    opacity: .7;
}

.dash-task.is-done .dash-task-icon {
    background: rgba(12, 163, 12, .12);
    color: var(--delta-up);
}

.dash-kpi {
    position: relative;
    display: block;
    height: 100%;
    padding: 1rem 1.1rem .75rem;
    border-radius: 18px;
    background: var(--mv-surface);
    border: 1px solid var(--mv-border);
    color: var(--mv-text);
    text-decoration: none;
    overflow: hidden;
    transition: box-shadow .15s, border-color .15s;
}

a.dash-kpi[href]:hover {
    box-shadow: var(--mv-shadow);
    border-color: var(--mv-primary);
}

.dash-kpi-head {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .85rem;
    color: var(--mv-muted);
    font-weight: 600;
}

.dash-kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    margin: .35rem 0 .15rem;
}

.dash-kpi-foot {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
    font-size: .78rem;
}

.dash-delta {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
}

.dash-delta.up { color: var(--delta-up); }
.dash-delta.down { color: var(--delta-down); }

.dash-spark {
    margin-top: .5rem;
    height: 36px;
}

.spark-line { stroke: var(--chart-axis); }
.spark-dot { fill: var(--series-1); stroke: var(--mv-surface); stroke-width: 2; }

.dash-card {
    padding: 1.1rem 1.2rem;
    border-radius: 18px;
    background: var(--mv-surface);
    border: 1px solid var(--mv-border);
}

.dash-card header {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: .75rem;
}

.dash-card h3 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
}

.dash-card header p {
    margin: .15rem 0 0;
    font-size: .8rem;
    color: var(--mv-muted);
}

.dash-subtitle {
    margin-top: 1.25rem !important;
    margin-bottom: .6rem !important;
    font-size: .9rem !important;
}

.dash-more {
    font-size: .82rem;
    text-decoration: none;
}

.dash-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .9rem;
    font-size: .8rem;
    color: var(--mv-muted);
}

.dash-legend span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.dash-key {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex: none;
}

.dash-chart {
    position: relative;
    direction: ltr;
    min-height: 200px;
}

.dash-chart-alt {
    min-height: 170px;
    --series-1: var(--series-2);
}

.dash-chart svg {
    display: block;
    overflow: visible;
    font-family: inherit;
}

.chart-gridline { stroke: var(--chart-grid); stroke-width: 1; }
.chart-baseline { stroke: var(--chart-axis); stroke-width: 1; }
.chart-tick { fill: var(--chart-ink-muted); font-size: 11px; }
.chart-dot { stroke: var(--mv-surface); stroke-width: 2; }
.chart-hover-dot, .chart-crosshair { display: none; }
.chart-hover-dot.show, .chart-crosshair.show { display: block; }
.chart-crosshair { stroke: var(--chart-axis); stroke-width: 1; }
.chart-bar { transition: opacity .15s; }
.chart-bar.active { opacity: .75; }
.chart-hit { outline: none; cursor: crosshair; }
.chart-hit:focus-visible { stroke: var(--mv-primary); stroke-width: 2; }

.chart-tip {
    position: absolute;
    z-index: 5;
    min-width: 150px;
    padding: .5rem .7rem;
    border-radius: 12px;
    background: var(--mv-surface);
    border: 1px solid var(--mv-border);
    box-shadow: var(--mv-shadow);
    direction: rtl;
    font-size: .8rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity .1s;
}

.chart-tip.show { opacity: 1; }
.chart-tip-day { color: var(--mv-muted); margin-bottom: .25rem; }
.chart-tip-row { display: flex; align-items: center; gap: .45rem; }
.chart-tip-row strong { font-size: .9rem; }
.chart-tip-name { color: var(--mv-muted); }
.chart-tip-key { width: 12px; height: 2px; border-radius: 2px; flex: none; }

.dash-table {
    margin-top: .5rem;
    font-size: .82rem;
}

.dash-table summary {
    color: var(--mv-muted);
    cursor: pointer;
    width: fit-content;
}

.dash-table .table-responsive {
    max-height: 260px;
    overflow: auto;
    margin-top: .5rem;
}

/* Part-to-whole bar: segments separated by a 2px surface gap */
.dash-stack {
    display: flex;
    gap: 2px;
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    background: var(--mv-surface-2);
}

.dash-stack a {
    display: block;
    min-width: 4px;
    transition: opacity .15s;
}

.dash-stack a:hover { opacity: .75; }

.dash-states,
.dash-bars {
    list-style: none;
    padding: 0;
    margin: .75rem 0 0;
}

.dash-states a,
.dash-bars a {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .35rem .4rem;
    border-radius: 8px;
    color: var(--mv-text);
    text-decoration: none;
    font-size: .85rem;
}

.dash-states a:hover,
.dash-bars a:hover {
    background: var(--mv-surface-2);
}

.dash-bar-label {
    flex: 0 0 38%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dash-bar-track {
    flex: 1;
    height: 12px;
}

/* Bars grow from the right (RTL baseline); the data end is rounded */
.dash-bar {
    display: block;
    height: 100%;
    background: var(--series-1);
    border-start-end-radius: 4px;
    border-end-end-radius: 4px;
}

.dash-bar-value {
    flex: 0 0 2.5rem;
    text-align: left;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Top bar: mobile number with the person's name under it */
.admin-user {
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.admin-user small {
    font-size: .72rem;
    color: var(--mv-muted);
    font-weight: 500;
}

/* Raw JSON viewer */
.admin-json {
    margin: 0;
    padding: 1rem 1.1rem;
    min-height: 100%;
    background: var(--mv-surface-2);
    font-size: .8rem;
    line-height: 1.7;
    white-space: pre;
    overflow: auto;
    text-align: left;
    tab-size: 2;
}

.json-key { color: #0550ae; }
.json-string { color: #116329; }
.json-number { color: #953800; }
.json-literal { color: #8250df; font-weight: 600; }

[data-bs-theme="dark"] .json-key { color: #79c0ff; }
[data-bs-theme="dark"] .json-string { color: #7ee787; }
[data-bs-theme="dark"] .json-number { color: #ffa657; }
[data-bs-theme="dark"] .json-literal { color: #d2a8ff; }

/* Phones: two task tiles and two figures per row */
@media (max-width: 575.98px) {
    .dash-tasks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem;
    }

    .dash-task {
        grid-template-columns: auto 1fr;
        grid-template-areas: "icon count" "title title";
        padding: .7rem .75rem;
        row-gap: .35rem;
    }

    .dash-task-icon {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .dash-task-go {
        display: none;
    }

    .dash-kpi {
        padding: .8rem .85rem .6rem;
    }

    .dash-kpi-value {
        font-size: 1.35rem;
    }

    .dash-hero {
        padding: 1rem;
    }
}

/* ---------- A business's own page (melkvareh.ir/{handle}) ---------- */
/* --biz is the business's accent color (set on the page) */
.biz-page {
    --biz: #0D9488;
}

.biz-page .btn-primary {
    --bs-btn-bg: var(--biz);
    --bs-btn-border-color: var(--biz);
    --bs-btn-hover-bg: color-mix(in srgb, var(--biz) 85%, #000);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--biz) 85%, #000);
    --bs-btn-active-bg: color-mix(in srgb, var(--biz) 75%, #000);
    --bs-btn-active-border-color: color-mix(in srgb, var(--biz) 75%, #000);
    --bs-btn-disabled-bg: var(--biz);
    --bs-btn-disabled-border-color: var(--biz);
}

.biz-accent { color: var(--biz) !important; }

.biz-page .pub-logo {
    background: color-mix(in srgb, var(--biz) 12%, transparent);
    color: var(--biz);
}

.biz-cover {
    height: 220px;
    border-radius: 20px;
    background: center / cover no-repeat;
    margin-bottom: -48px;
}

.biz-has-cover {
    position: relative;
    margin-inline: 1rem;
}

.biz-contact {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .5rem;
}

.biz-whatsapp .bi { color: #25D366; }
.biz-telegram .bi { color: #229ED9; }
.biz-instagram .bi { color: #E1306C; }

.biz-sections {
    position: sticky;
    /* Right under the site's sticky header (72px on phones, 78px on wider screens) */
    top: 80px;
    z-index: 5;
    display: flex;
    gap: .35rem;
    margin: 1rem 0 .5rem;
    padding: .4rem;
    overflow-x: auto;
    scrollbar-width: none;
    border-radius: 14px;
    background: color-mix(in srgb, var(--mv-surface) 92%, transparent);
    backdrop-filter: blur(8px);
    border: 1px solid var(--mv-border);
}

.biz-sections a {
    flex: none;
    padding: .4rem .8rem;
    border-radius: 10px;
    color: var(--mv-muted);
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.biz-sections a:hover {
    color: var(--biz);
    background: color-mix(in srgb, var(--biz) 10%, transparent);
}

.biz-section {
    margin-top: 2rem;
    scroll-margin-top: 130px;
}

.biz-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: .75rem;
}

.biz-title::before {
    content: "";
    width: 5px;
    height: 1.1em;
    border-radius: 3px;
    background: var(--biz);
}

.biz-about {
    white-space: pre-line;
    line-height: 2.1;
}

.biz-services {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.25rem;
    margin-top: .75rem;
    font-size: .92rem;
}

.biz-projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 1rem;
}

/* A grid item grows to its content by default: the sideways photo strip would widen the whole page */
.biz-project {
    min-width: 0;
    overflow: hidden;
}

/* Photos of a project: swipe sideways */
.biz-project-photos {
    display: flex;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    aspect-ratio: 4 / 3;
    background: var(--mv-surface-2);
}

.biz-project-photos a {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

.biz-project-photos img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.biz-project-body {
    padding: .9rem 1rem 1rem;
}

.biz-project-body h3 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: .25rem;
}

.biz-project-text {
    white-space: pre-line;
    font-size: .9rem;
    line-height: 1.9;
}

.biz-faq {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.biz-faq details {
    padding: .85rem 1rem;
}

.biz-faq summary {
    font-weight: 700;
    cursor: pointer;
}

.biz-faq summary::marker {
    color: var(--biz);
}

.biz-faq p {
    margin: .6rem 0 0;
    white-space: pre-line;
    line-height: 2;
    color: var(--mv-muted);
}

.biz-form {
    padding: 1.25rem;
}

/* Hidden from people, still in the form for bots. No far offset: in a right-to-left page an element pushed
   far to the left makes the whole page scroll sideways. */
.biz-hp {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    opacity: 0;
}

.biz-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
}

/* ---------- Printable card of the page ---------- */
.biz-card-page {
    background: var(--mv-bg);
    padding: 1.5rem 1rem 3rem;
}

.biz-card-tools {
    max-width: 105mm;
    margin: 0 auto 1rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.biz-card {
    width: 105mm;
    min-height: 148mm;
    margin: 0 auto;
    padding: 9mm 8mm 6mm;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    color: #0F1716;
    border-radius: 6mm;
    border-top: 3mm solid var(--biz);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .12);
}

.biz-card header {
    display: flex;
    align-items: center;
    gap: 4mm;
    width: 100%;
    text-align: start;
}

.biz-card-logo {
    flex: none;
    width: 18mm;
    height: 18mm;
    border-radius: 50%;
    object-fit: cover;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--biz) 12%, #fff);
    color: var(--biz);
    font-size: 8mm;
}

.biz-card h1 {
    font-size: 5.5mm;
    font-weight: 800;
    margin: 0;
}

.biz-card h1 .bi {
    color: var(--biz);
    font-size: .8em;
}

.biz-card header p {
    margin: 1mm 0 0;
    color: #5B6664;
    font-size: 3.4mm;
}

.biz-card-lead {
    margin: 6mm 0 3mm;
    font-weight: 700;
    font-size: 3.8mm;
}

.biz-card-qr svg {
    width: 52mm;
    height: 52mm;
    display: block;
}

.biz-card-scan {
    margin: 2mm 0 1mm;
    color: #5B6664;
    font-size: 3.2mm;
}

/* Addresses keep Latin digits (the site font shows Persian digits) so they can be typed as printed */
.biz-card-url,
.biz-url {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.biz-card-url {
    font-size: 4.6mm;
    font-weight: 800;
    color: var(--biz);
    letter-spacing: .02em;
}

.biz-card-phone {
    margin-top: 3mm;
    font-size: 4.2mm;
    font-weight: 700;
}

.biz-card footer {
    margin-top: auto;
    padding-top: 5mm;
    display: flex;
    align-items: center;
    gap: 2mm;
    color: #5B6664;
    font-size: 3mm;
}

.biz-card footer img {
    width: 5mm;
    height: 5mm;
}

@media print {
    @page { size: A6; margin: 0; }
    .no-print { display: none !important; }
    .biz-card-page { background: #fff; padding: 0; }
    .biz-card { box-shadow: none; border-radius: 0; width: 105mm; height: 148mm; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 575.98px) {
    .biz-sections {
        top: 74px;
    }

    /* Phones: logo above the name, contact buttons two by two */
    .biz-page .pub-profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .biz-page .pub-profile .min-w-0 {
        width: 100%;
    }

    .biz-contact {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .biz-contact .btn-primary,
    .biz-contact > :last-child:nth-child(even) {
        grid-column: 1 / -1;
    }

    .biz-contact .btn {
        white-space: nowrap;
    }

    .biz-has-cover {
        margin-inline: .5rem;
    }
}

/* ---------- Admin: visit statistics ---------- */
.an-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: space-between;
}

.an-filters .mv-segmented {
    max-width: 100%;
    overflow-x: auto;
}

.an-bars {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .7rem;
}

.an-bars li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .15rem .75rem;
}

.an-bar-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.an-bar-label,
.an-bar-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.an-bar-label {
    color: var(--mv-text, inherit);
    text-decoration: none;
}

a.an-bar-label:hover {
    color: var(--mv-primary, #0d9488);
}

.an-bar-sub {
    font-size: .75rem;
    color: var(--mv-muted, #6b7280);
    direction: ltr;
    text-align: right;
}

.an-bar-value {
    align-self: center;
    font-variant-numeric: tabular-nums;
}

.an-bar-track {
    grid-column: 1 / -1;
    height: 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--series-1) 12%, transparent);
    overflow: hidden;
}

.an-bar-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--series-1);
}

.an-hours {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 120px;
    direction: ltr;
}

.an-hours > span {
    flex: 1;
    min-width: 0;
    border-radius: 3px 3px 0 0;
    background: var(--series-1);
    opacity: .85;
}

.an-hours > span:hover {
    opacity: 1;
}

.an-hours-axis {
    display: flex;
    justify-content: space-between;
    direction: ltr;
    font-size: .75rem;
    color: var(--mv-muted, #6b7280);
    margin-top: .25rem;
}

.an-funnel {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .75rem;
}

.an-funnel li {
    position: relative;
}

.an-funnel-bar {
    height: 8px;
    border-radius: 999px;
    background: var(--series-3);
    margin-bottom: .3rem;
}

.an-funnel-text {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .75rem;
    justify-content: space-between;
}

.an-path {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: .78rem;
    color: var(--mv-muted, #6b7280);
    word-break: break-all;
}

.an-page-cell {
    min-width: 200px;
    max-width: 420px;
}

.an-journey {
    list-style: none;
    margin: 0;
    padding: 0 1rem 0 0;
    border-inline-start: 2px solid color-mix(in srgb, var(--series-1) 35%, transparent);
    display: grid;
    gap: .45rem;
}

.an-journey li {
    display: flex;
    gap: .75rem;
    align-items: baseline;
    position: relative;
}

.an-journey li::before {
    content: "";
    position: absolute;
    inset-inline-start: calc(-1rem - 6px);
    top: .45rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--series-1);
}

.an-journey li.is-click::before {
    background: var(--series-2);
    width: 8px;
    height: 8px;
    inset-inline-start: calc(-1rem - 5px);
}

.an-journey li.is-click {
    color: var(--mv-muted, #6b7280);
    font-size: .9rem;
}

.an-journey-time {
    font-variant-numeric: tabular-nums;
    color: var(--mv-muted, #6b7280);
    font-size: .8rem;
    flex: none;
    min-width: 4.5rem;
}

.an-sections {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.an-sections a {
    white-space: nowrap;
}

.an-cohorts td,
.an-cohorts th {
    text-align: center;
}

.an-cohort-cell {
    background: color-mix(in srgb, var(--series-1) calc(var(--p) * 1%), transparent);
    font-variant-numeric: tabular-nums;
}

.an-alerts {
    display: grid;
    gap: .75rem;
}

.an-alert {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    padding: .9rem 1rem;
}

.an-alert.is-new {
    border-inline-start: 4px solid var(--series-4);
}

.an-alert-icon {
    flex: none;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.an-alert.is-bad .an-alert-icon {
    background: color-mix(in srgb, #dc2626 14%, transparent);
    color: #dc2626;
}

.an-alert.is-good .an-alert-icon {
    background: color-mix(in srgb, var(--series-3) 16%, transparent);
    color: var(--series-3);
}
