/* =========================================================
   کارود — قالب موبایل بخش عمومی
   فقط زیر ۷۶۸px و فقط صفحه‌هایی که از Views/Shared/_Layout.cshtml استفاده می‌کنند
   (body.km-public). پنل‌های کاربر و مدیریت لایه‌ی جدا دارند و دست‌نخورده‌اند.
   ========================================================= */

/* بیرون از موبایل: اجزای جدید کاملاً پنهان */
.km-header, .km-tabbar, .km-sheet, .km-feed, .km-cats, .km-info, .km-brandhero { display: none; }

@media (max-width: 767.98px) {
  body.km-public {
    --km-ink: #0f172a;
    --km-muted: #64748b;
    --km-line: #e2e8f0;
    --km-blue: #1d4ed8;
    --km-blue-soft: #dbeafe;
    --km-bg: #f8fafc;
    --km-tab-h: 62px;
    background: var(--km-bg);
    color: var(--km-ink);
    padding-bottom: calc(var(--km-tab-h) + env(safe-area-inset-bottom, 0px));
  }
  body.km-public.km-lock { overflow: hidden; }

  /* ---------- آیکن ---------- */
  .km-ic {
    width: 1.25rem; height: 1.25rem; flex: none;
    stroke: currentColor; fill: none;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  }

  /* ---------- هدر ---------- */
  .km-header {
    display: block;
    padding: calc(.55rem + env(safe-area-inset-top, 0px)) .75rem .65rem;
    background: #fff;
    border-bottom: 1px solid var(--km-line);
  }
  .km-brandrow { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; }
  .km-brand { display: flex; align-items: center; gap: .55rem; min-width: 0; color: var(--km-ink); text-decoration: none; }
  /* لوگوی SVG کارود برای زمینه‌ی تیره طراحی شده است */
  .km-logo { width: 62px; height: 40px; flex: 0 0 62px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: #0f172a; }
  .km-logo svg { width: 56px; height: 30px; }
  .km-brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
  .km-brand-text b { font-size: 1.05rem; font-weight: 900; }
  .km-brand-text small { font-size: .7rem; color: var(--km-muted); white-space: nowrap; }
  .km-actions { display: flex; gap: .4rem; }
  .km-iconbtn {
    width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
    border-radius: 12px; border: 1px solid var(--km-line); background: #fff;
    color: var(--km-ink); text-decoration: none; font-family: inherit;
  }
  .km-iconbtn:active { background: var(--km-blue-soft); }

  .km-search {
    display: flex; align-items: center; gap: .5rem; margin: 0;
    padding: 0 .85rem; min-height: 46px;
    background: var(--km-bg); border: 1px solid #cbd5e1; border-radius: 999px;
    color: var(--km-muted);
  }
  .km-search:focus-within { border-color: var(--km-blue); box-shadow: 0 0 0 3px rgba(29, 78, 216, .15); background: #fff; }
  .km-search input[type=search] {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
    font-family: inherit; font-size: 16px; color: var(--km-ink); padding: .5rem 0;
  }
  .km-search input::placeholder { color: var(--km-muted); opacity: 1; font-size: .85rem; }
  .km-loc {
    display: inline-flex; align-items: center; gap: .2rem; white-space: nowrap;
    padding: .5rem 0 .5rem .1rem; padding-right: .6rem; border: 0; border-right: 1px solid var(--km-line);
    background: none; font-family: inherit; cursor: pointer; min-height: 40px;
    font-size: .75rem; font-weight: 700; color: var(--km-blue);
  }
  .km-loc::after { content: "▾"; font-size: .65rem; margin-inline-start: .1rem; }
  .km-loc .km-ic { width: 1rem; height: 1rem; }

  /* ---------- نوار پایین ---------- */
  .km-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    background: #fff; border-top: 1px solid var(--km-line);
    padding: .3rem .2rem calc(.3rem + env(safe-area-inset-bottom, 0px));
    min-height: var(--km-tab-h);
  }
  .km-tab {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: .25rem 0; border: 0; background: none; font-family: inherit;
    color: var(--km-muted); font-size: .7rem; font-weight: 600; text-decoration: none; line-height: 1.3;
    -webkit-tap-highlight-color: transparent;
  }
  .km-tab .km-ic { width: 1.4rem; height: 1.4rem; }
  .km-tab span { white-space: nowrap; }
  .km-tab.is-active { color: var(--km-blue); font-weight: 800; }
  .km-tab.is-active .km-ic { stroke-width: 2.3; }
  .km-tab:active { color: var(--km-blue); }

  /* دکمه‌های شناور (دستیار هوشمند و صوتی) بالاتر از نوار پایین */
  body.km-public #switchAiWidget { bottom: calc(var(--km-tab-h) + 12px + env(safe-area-inset-bottom, 0px)) !important; }
  body.km-public #switchVoiceAssistant { bottom: calc(var(--km-tab-h) + 12px + env(safe-area-inset-bottom, 0px)) !important; }
  body.km-public #voiceAssistantPanel { bottom: calc(var(--km-tab-h) + 90px + env(safe-area-inset-bottom, 0px)) !important; }

  /* ---------- منوی کشویی ---------- */
  .km-sheet { display: flex; position: fixed; inset: 0; z-index: 1060; align-items: flex-end; }
  .km-sheet[hidden] { display: none !important; }
  .km-sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); }
  .km-sheet-panel {
    position: relative; width: 100%; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain;
    background: #fff; border-radius: 22px 22px 0 0;
    padding: .5rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  .km-sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: #cbd5e1; margin: .15rem auto .6rem; }
  .km-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; font-size: 1rem; }
  .km-sheet-list { margin-top: .75rem; }
  .km-sheet-list a, .km-sheet-list button {
    width: 100%; display: flex; align-items: center; gap: .75rem; padding: .85rem .15rem;
    border: 0; border-bottom: 1px solid #f1f5f9; background: none; text-align: right;
    color: var(--km-ink); text-decoration: none; font: inherit; font-weight: 600; font-size: .92rem;
  }
  .km-sheet-list form { margin: 0; }
  .km-sheet-list .km-ic { color: var(--km-muted); }
  .km-sheet-list a:active, .km-sheet-list button:active { background: var(--km-bg); }

  /* ---------- کاشی‌های دسته‌بندی ---------- */
  .km-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
  .km-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
    min-height: 82px; padding: .7rem .25rem; border-radius: 16px; text-align: center;
    font-size: .8rem; font-weight: 700; text-decoration: none; line-height: 1.35;
    border: 1px solid transparent;
  }
  .km-tile .km-ic { width: 1.7rem; height: 1.7rem; stroke-width: 1.7; }
  .km-tile:active { transform: scale(.97); }
  .km-t-estate { background: #dbeafe; color: #1e3a8a; }
  .km-t-villa  { background: #ffedd5; color: #9a3412; }
  .km-t-car    { background: #e0f2fe; color: #0c4a6e; }
  .km-t-store  { background: #ede9fe; color: #4c1d95; }
  .km-t-city   { background: #ccfbf1; color: #115e59; }
  .km-t-promo  { background: #fef3c7; color: #92400e; }

  /* ---------- صفحه‌ی خانه: فقط فید آگهی‌ها (سبک دیوار) ---------- */
  /* هر چیز دیگری در .switch-home و بخش‌های زیر آن در موبایل پنهان است؛ دسکتاپ بدون تغییر */
  body.km-public .switch-home > :not(.km-feed),
  body.km-public .km-hide-mobile,
  body.km-public.km-home-page #quickCartWidget { display: none !important; }

  /* روی خانه فقط جستجو (مثل دیوار)؛ لوگو و دکمه‌ها در منوی «دسته‌ها» و نوار پایین هستند */
  body.km-public.km-home-page .km-brandrow { display: none; }
  body.km-public.km-home-page .km-header { padding-top: calc(.6rem + env(safe-area-inset-top, 0px)); border-bottom: 0; }
  body.km-public.km-home-page main.container { padding: 0 !important; }

  body.km-public .switch-home { margin-top: 0; } /* home.css: margin-top:-1rem */
  .km-feed { display: block; background: #fff; }
  .km-feed-chips {
    position: sticky; top: 0; z-index: 5; display: flex; gap: .45rem;
    padding: .55rem .75rem; background: #fff; border-bottom: 1px solid var(--km-line);
    overflow-x: auto; scrollbar-width: none;
  }
  .km-feed-chips::-webkit-scrollbar { display: none; }
  .km-feed-chips button {
    flex: 0 0 auto; padding: .25rem .95rem; border-radius: 999px; min-height: 34px;
    border: 1px solid #cbd5e1; background: #fff; color: var(--km-ink);
    font: inherit; font-size: .85rem; font-weight: 500; white-space: nowrap;
  }
  .km-feed-chips button.is-active { background: var(--km-ink); border-color: var(--km-ink); color: #fff; font-weight: 700; }

  .km-ad {
    display: flex; align-items: stretch; gap: .75rem; padding: .8rem .75rem;
    border-bottom: 1px solid var(--km-line); background: #fff; color: var(--km-ink); text-decoration: none;
  }
  .km-ad:active { background: var(--km-bg); }
  .km-ad-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
  .km-ad-title {
    margin: 0 0 .2rem; font-size: .95rem; font-weight: 800; line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .km-ad-price { font-size: .85rem; font-weight: 700; color: var(--km-ink); }
  .km-ad-meta { font-size: .8rem; color: var(--km-muted); }
  .km-ad-time { margin-top: auto; padding-top: .35rem; font-size: .74rem; color: #94a3b8; }
  /* عکس آگهی بزرگ‌تر: حدود ۳۸٪ عرض صفحه (بین ۱۲۰ تا ۱۶۰ پیکسل) */
  .km-ad-thumb {
    position: relative; flex: 0 0 clamp(120px, 38vw, 160px); width: clamp(120px, 38vw, 160px);
    height: clamp(120px, 38vw, 160px); align-self: flex-start;
    display: grid; place-items: center; overflow: hidden; border-radius: 14px; background: #e2e8f0; color: #64748b;
  }
  .km-ad-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .km-ad-thumb .km-ic { width: 2.6rem; height: 2.6rem; stroke-width: 1.5; }
  .km-ad-property { background: #dbeafe; color: #1e3a8a; }
  .km-ad-car      { background: #e0f2fe; color: #0c4a6e; }
  .km-ad-villa    { background: #ffedd5; color: #9a3412; }
  .km-ad-product  { background: #ede9fe; color: #4c1d95; }
  .km-ad-count {
    position: absolute; bottom: 6px; left: 6px; min-width: 22px; padding: 0 7px; border-radius: 999px;
    background: rgba(15, 23, 42, .72); color: #fff; font-size: .68rem; line-height: 1.5; text-align: center;
  }
  .km-feed-empty { padding: 2.5rem 1rem; text-align: center; color: var(--km-muted); font-size: .9rem; }
  .km-feed-more { min-height: 1px; padding: 0; text-align: center; color: var(--km-muted); font-size: .8rem; }
  .km-feed-more.is-loading, .km-feed-more.is-error { padding: 1rem .75rem 1.25rem; min-height: 56px; }
  .km-feed-more button {
    border: 1px solid var(--km-line); background: #fff; border-radius: 999px; padding: .4rem 1rem;
    font: inherit; font-size: .8rem; color: var(--km-blue);
  }

  /* ---------- محتوای صفحه‌های داخلی ---------- */
  body.km-public main.container { padding: .85rem .75rem 1rem !important; }
  body.km-public main h1 { font-size: 1.3rem; }
  body.km-public main h2, body.km-public main .section-title { font-size: 1.15rem; }
  body.km-public main > .rounded-4.bg-dark { padding: 1rem !important; }

  body.km-public main .card {
    border: 1px solid var(--km-line) !important; border-radius: 16px !important; box-shadow: none !important;
  }
  body.km-public main .card-body.p-4, body.km-public main .card-body.p-md-4 { padding: 1rem !important; }
  body.km-public main .row.g-4 { --bs-gutter-y: .75rem; --bs-gutter-x: .75rem; }
  body.km-public main .row.g-4 > [class*="col-"] > .card > .card-img-top { height: 160px !important; }

  /* فرم‌ها: لمسی و بدون زوم خودکار iOS */
  body.km-public main .form-control, body.km-public main .form-select { min-height: 44px; font-size: 16px; border-radius: 12px; }
  body.km-public main .form-label { font-size: .78rem; margin-bottom: .25rem; }
  body.km-public main .btn:not(.btn-sm) { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  body.km-public main .btn-primary { background-color: var(--km-blue); border-color: var(--km-blue); }

  /* چیپ‌های دسته (افقی و قابل اسکرول) */
  body.km-public .km-chips {
    flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none;
    margin-inline: -.75rem; padding: 0 .75rem .25rem; margin-bottom: .85rem !important;
  }
  body.km-public .km-chips::-webkit-scrollbar { display: none; }
  body.km-public .km-chips .btn { flex: 0 0 auto; white-space: nowrap; min-height: 0 !important; padding: .35rem .9rem; font-size: .82rem; }

  /* شبکه‌ی ۲ ستونه‌ی فروشگاه */
  body.km-public .km-product-grid { --bs-gutter-x: .6rem; --bs-gutter-y: .6rem; }
  body.km-public .km-product-grid > [class*="col-"] { flex: 0 0 auto; width: 50%; }
  body.km-public .km-product-grid .card-body { padding: .6rem !important; }
  body.km-public .km-product-grid .card-img-top,
  body.km-public .km-product-grid .card > .bg-light { height: 112px !important; font-size: 42px !important; }
  body.km-public .km-product-grid h5 {
    font-size: .85rem; line-height: 1.5; margin-bottom: .4rem !important;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  body.km-public .km-product-grid .badge { font-size: .65rem; white-space: normal; text-align: right; }
  body.km-public .km-product-grid .fs-5 { font-size: .92rem !important; margin-bottom: .5rem !important; }
  body.km-public .km-product-grid .btn { min-height: 38px; font-size: .82rem; padding: .3rem .5rem; }

  /* صفحه‌بندی */
  body.km-public main .pagination { gap: .25rem; }
  body.km-public main .page-link { min-width: 38px; min-height: 38px; display: grid; place-items: center; }

  /* پاورقی در موبایل حذف شده است (نوار پایین جای آن را می‌گیرد) */
  body.km-public footer.footer { display: none !important; }
}

@media (max-width: 767.98px) {
  /* ---------- نوار کوچک تاریخ، ساعت و هوا (فقط صفحه‌ی اصلی) ---------- */
  body.km-public.km-home-page .km-info {
    display: flex; align-items: center; gap: .55rem; margin: 0 .2rem .5rem;
    font-size: .72rem; font-weight: 700; color: var(--km-muted); line-height: 1.4;
  }
  .km-info-clock { font-variant-numeric: tabular-nums; color: var(--km-ink); }
  .km-wx {
    margin-inline-start: auto; display: inline-flex; align-items: center; gap: .25rem;
    padding: .08rem .5rem; border-radius: 999px; background: #f1f5f9; color: var(--km-ink); font-size: .72rem;
  }
  .km-wx[hidden] { display: none; }
  .km-wx svg { display: block; }

  /* ---------- پنج دکمه‌ی رنگی و متحرک ---------- */
  .km-cats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; padding: .7rem .55rem .5rem; background: #fff; }
  .km-cat {
    display: flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 0;
    color: var(--km-ink); text-decoration: none; text-align: center;
    font-size: .7rem; font-weight: 800; line-height: 1.35; -webkit-tap-highlight-color: transparent;
  }
  .km-cat-ico {
    width: 100%; max-width: 64px; aspect-ratio: 1; display: grid; place-items: center;
    border-radius: 20px; box-shadow: 0 5px 12px rgba(15, 23, 42, .09); transition: transform .15s;
  }
  .km-cat-ico svg { width: 80%; height: 80%; overflow: visible; }
  .km-cat:active .km-cat-ico { transform: scale(.93); }
  .km-cat-estate .km-cat-ico { background: linear-gradient(145deg, #eff6ff, #bfdbfe); }
  .km-cat-car    .km-cat-ico { background: linear-gradient(145deg, #fef2f2, #fecaca); }
  .km-cat-villa  .km-cat-ico { background: linear-gradient(145deg, #fff7ed, #fed7aa); }
  .km-cat-city   .km-cat-ico { background: linear-gradient(145deg, #f0fdfa, #99f6e4); }
  .km-cat-store  .km-cat-ico { background: linear-gradient(145deg, #f5f3ff, #ddd6fe); }

  /* ---------- انتخاب شهر ---------- */
  .km-gps {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px;
    border: 0; border-radius: 14px; background: var(--km-blue); color: #fff; font: inherit; font-weight: 800; font-size: .92rem;
  }
  .km-gps:disabled { opacity: .6; }
  .km-gps-msg { min-height: 1.5rem; margin: .4rem .15rem .2rem; font-size: .8rem; color: var(--km-muted); line-height: 1.7; }
  .km-city-search {
    width: 100%; min-height: 44px; margin-bottom: .3rem; padding: 0 .85rem; border: 1px solid #cbd5e1;
    border-radius: 12px; font: inherit; font-size: 16px; color: var(--km-ink); background: var(--km-bg);
  }
  .km-city-list { list-style: none; margin: 0; padding: 0; }
  .km-city-list li[hidden] { display: none; }
  .km-city-list button {
    width: 100%; display: flex; align-items: center; justify-content: space-between; padding: .8rem .15rem;
    border: 0; border-bottom: 1px solid #f1f5f9; background: none; text-align: right;
    font: inherit; font-size: .92rem; font-weight: 600; color: var(--km-ink);
  }
  .km-city-list button:active { background: var(--km-bg); }
  .km-city-list button.is-selected { color: var(--km-blue); font-weight: 800; }
  .km-city-list button.is-selected::after { content: "✓"; }
}

@media (max-width: 767.98px) {
  /* ---------- بنر نام و لوگوی کارود (صفحه‌ی اصلی موبایل) ---------- */
  body.km-public.km-home-page .km-brandhero {
    position: relative; display: flex; align-items: center; gap: .85rem; overflow: hidden;
    margin: 0 0 .65rem; padding: .85rem 1rem 1.45rem; border-radius: 22px; text-decoration: none; color: #fff;
    background: linear-gradient(135deg, #0f172a 0%, #0b4f58 55%, #0f766e 100%);
    box-shadow: 0 8px 22px rgba(15, 118, 110, .28);
  }
  .km-bh-logo { flex: 0 0 auto; display: grid; place-items: center; }
  .km-bh-logo svg { width: 112px; height: auto; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .35)); }
  .km-bh-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
  .km-bh-text b {
    font-size: 2.4rem; font-weight: 900; letter-spacing: -.5px;
    background: linear-gradient(180deg, #ffffff 30%, #a5f3fc 100%); -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent; text-shadow: none;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35));
  }
  .km-bh-text small { margin-top: .3rem; font-size: .82rem; font-weight: 700; color: #e0f2fe; opacity: .95; }
  .km-bh-river { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 22px; display: block; }
  .km-bh-wave { transform-box: fill-box; }
}
@media (max-width: 767.98px) and (prefers-reduced-motion: no-preference) {
  .km-bh-wave1 { animation: kmWave 7s linear infinite; }
  .km-bh-wave2 { animation: kmWave 4.5s linear infinite reverse; }
}
@keyframes kmWave { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- انیمیشن آیکن‌ها: فقط اگر کاربر «کاهش حرکت» را روشن نکرده باشد ---------- */
@media (max-width: 767.98px) and (prefers-reduced-motion: no-preference) {
  .km-cat svg [class^="a-"] { transform-box: fill-box; transform-origin: center; }
  .a-bob       { animation: kmBob 2.8s ease-in-out infinite; }
  .a-bob-slow  { animation: kmBob 3.4s ease-in-out infinite; }
  .a-bump      { animation: kmBump .5s ease-in-out infinite; }
  .a-spin      { animation: kmSpin .9s linear infinite; }
  .a-spin-slow { animation: kmSpin 7s linear infinite; }
  .a-blink     { animation: kmBlink 2.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
  .a-sway      { animation: kmSway 3s ease-in-out infinite; transform-origin: 50% 100% !important; }
  .a-swing     { animation: kmSwing 2.2s ease-in-out infinite; transform-origin: 50% 0 !important; }
  .a-awning    { animation: kmAwning 3s ease-in-out infinite; transform-origin: 50% 0 !important; }
  .a-twinkle   { animation: kmTwinkle 1.8s ease-in-out infinite; }
  .a-dash      { animation: kmDash .7s linear infinite; }
  .a-smoke     { animation: kmSmoke 2.2s ease-out infinite; animation-delay: var(--d, 0s); opacity: 0; }
}
@keyframes kmBob     { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
@keyframes kmBump    { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.9px); } }
@keyframes kmSpin    { to { transform: rotate(360deg); } }
@keyframes kmBlink   { 0%, 100% { opacity: 1; } 45%, 60% { opacity: .25; } }
@keyframes kmSway    { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes kmSwing   { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
@keyframes kmAwning  { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.9); } }
@keyframes kmTwinkle { 0%, 100% { transform: scale(.55); opacity: .5; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes kmDash    { 0% { transform: translateX(4px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateX(-4px); opacity: 0; } }
@keyframes kmSmoke   { 0% { transform: translate(0, 0) scale(.6); opacity: .9; } 100% { transform: translate(3px, -10px) scale(1.5); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .km-tile:active { transform: none; }
  .km-ad:active { background: #fff; }
}


/* =========================================================
   V463 — ورود و ثبت‌نام موبایل (body.km-auth-page)
   شماره‌گیر ساده + پنل کشویی کد پیامک. دسکتاپ دست‌نخورده است.
   ========================================================= */
.km-auth-m, .km-a-only-m { display: none; }

@media (max-width: 767.98px) {
  /* صفحه‌ی احراز هویت: بدون هدر، نوار پایین و نوارهای شناور */
  body.km-auth-page { --km-tab-h: 0px; padding-bottom: env(safe-area-inset-bottom, 0px); background: #fff; }
  body.km-auth-page .km-header,
  body.km-auth-page .km-tabbar,
  body.km-auth-page .karood-mobile-directbar,
  body.km-auth-page .karood-mobile-header,
  body.km-auth-page .site-main-header,
  body.km-auth-page .footer,
  body.km-auth-page #aiChatbotRoot,
  body.km-auth-page [class*="ai-chat"],
  body.km-auth-page [class*="voice-assist"] { display: none !important; }
  body.km-auth-page main.container { padding: 0 !important; max-width: 100%; }

  /* ورود: فقط نسخه‌ی موبایل */
  .km-auth-desktop { display: none !important; }
  .km-auth-m { display: block; min-height: 100vh; min-height: 100dvh; padding: 0 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px)); background: #fff; position: relative; }

  /* ثبت‌نام / تأیید: همان ظاهر ساده */
  .km-a-only-m { display: block; }
  .km-a-hide-m { display: none !important; }
  .km-auth-reg { margin: 0; }
  .km-auth-reg > div { padding: 0; }
  .km-auth-reg .card { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; min-height: 100vh; min-height: 100dvh; }
  .km-auth-reg .km-a-body { padding: .5rem 1.25rem 2rem !important; }
  .km-auth-reg .km-a-top, .km-auth-reg .km-a-hero { padding-left: 1.25rem; padding-right: 1.25rem; }
  .km-auth-reg .form-control-lg { min-height: 52px; font-size: 16px; border-radius: 14px !important; }
  .km-auth-reg .input-group-text { display: none; }
  .km-auth-reg .input-group > .form-control { border-radius: 14px !important; }
  .km-auth-reg .btn-lg { min-height: 54px; font-size: 1rem; }
  .km-auth-reg .alert-info { display: none; }
  .km-auth-reg .km-a-confirm { display: none; }
  .km-a-email { display: none; }
  .km-a-email.is-open { display: block; }
  .km-a-emailtoggle { margin: -.25rem 0 1rem; }

  /* بالا */
  .km-a-top { display: flex; padding-top: calc(.75rem + env(safe-area-inset-top, 0px)); }
  .km-a-back { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--km-ink); text-decoration: none; margin-inline-start: -.5rem; }
  .km-a-back:active { background: var(--km-bg); }
  .km-a-ic { width: 1.35rem; height: 1.35rem; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

  .km-a-hero { text-align: center; padding: .5rem 0 1.5rem; }
  .km-a-logo { width: 74px; height: 56px; margin: 0 auto .9rem; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(145deg, #0f766e, #064e49); box-shadow: 0 8px 22px rgba(15,118,110,.25); overflow: hidden; }
  .km-a-logo svg { width: 64px; height: auto; }
  .km-a-title { font-size: 1.45rem; font-weight: 900; color: var(--km-ink); margin: 0 0 .4rem; }
  .km-a-sub { font-size: .9rem; color: var(--km-muted); margin: 0; line-height: 1.8; }

  /* فرم */
  .km-a-form { display: block; }
  .km-a-label { display: block; font-size: .82rem; font-weight: 700; color: #475569; margin: 0 0 .4rem; }
  .km-a-input {
    display: block; width: 100%; min-height: 56px; padding: .6rem 1rem; box-sizing: border-box;
    font-family: inherit; font-size: 1.25rem; font-weight: 700; letter-spacing: .08em; text-align: center; color: var(--km-ink);
    background: var(--km-bg); border: 1.5px solid #cbd5e1; border-radius: 16px; outline: 0; transition: border-color .15s, box-shadow .15s, background .15s;
  }
  .km-a-input::placeholder { color: #cbd5e1; font-weight: 500; letter-spacing: .08em; }
  .km-a-input:focus { border-color: var(--km-blue); background: #fff; box-shadow: 0 0 0 4px rgba(29,78,216,.12); }
  .km-a-input.is-bad { border-color: #dc2626; box-shadow: 0 0 0 4px rgba(220,38,38,.1); }
  .km-a-input-sm { font-size: 1rem; font-weight: 600; letter-spacing: 0; text-align: left; min-height: 52px; margin-bottom: .9rem; }
  .km-a-pass { position: relative; }
  .km-a-pass .km-a-input { padding-inline-end: 3rem; }
  .km-a-eye { position: absolute; top: 4px; inset-inline-end: 4px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: var(--km-muted); border-radius: 12px; }
  .km-a-err { min-height: 1.4rem; margin: .45rem 0 .6rem; font-size: .82rem; color: #dc2626; line-height: 1.7; }
  .km-a-err-c { text-align: center; }
  .km-a-err.is-info { color: var(--km-blue); }
  .km-a-regcta { display: block; margin: -.1rem 0 .8rem; padding: .7rem .9rem; border-radius: 14px; background: var(--km-blue-soft); color: #1e3a8a; font-size: .85rem; line-height: 1.8; text-decoration: none; text-align: center; }
  .km-a-regcta[hidden] { display: none; }
  .km-a-alert { margin-bottom: .8rem; padding: .6rem .8rem; border-radius: 12px; background: #fee2e2; color: #991b1b; font-size: .82rem; }
  .km-a-alert:empty, .km-a-alert.validation-summary-valid { display: none; }
  .km-a-alert ul { margin: 0; padding-inline-start: 1.1rem; }

  /* دکمه‌ها */
  .km-a-btn {
    position: relative; display: flex; align-items: center; justify-content: center; gap: .55rem; width: 100%; min-height: 54px; margin: 0 0 .7rem;
    padding: 0 1rem; border-radius: 16px; font-family: inherit; font-size: 1rem; font-weight: 800; cursor: pointer; text-decoration: none; transition: transform .1s, opacity .15s, background .15s;
  }
  .km-a-btn:active { transform: scale(.985); }
  .km-a-btn-primary { border: 0; color: #fff; background: var(--km-blue); box-shadow: 0 6px 16px rgba(29,78,216,.28); }
  .km-a-btn-primary:disabled { background: #cbd5e1; box-shadow: none; color: #fff; cursor: not-allowed; }
  .km-a-btn-ghost { border: 1.5px solid var(--km-line); background: #fff; color: var(--km-ink); }
  .km-a-btn-ghost:active { background: var(--km-bg); }
  .km-a-spin { display: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: kmASpin .7s linear infinite; }
  .km-a-btn.is-busy .km-a-spin { display: inline-block; }
  .km-a-btn.is-busy .km-a-btn-t { opacity: .85; }
  @keyframes kmASpin { to { transform: rotate(360deg); } }

  .km-a-or { display: flex; align-items: center; gap: .8rem; margin: .9rem 0 1.1rem; color: #94a3b8; font-size: .8rem; }
  .km-a-or::before, .km-a-or::after { content: ""; flex: 1; height: 1px; background: var(--km-line); }
  .km-a-pk { min-height: 1.2rem; text-align: center; font-size: .8rem; color: var(--km-muted); margin-bottom: .6rem; }
  .km-a-foot { text-align: center; font-size: .9rem; color: var(--km-muted); margin: 1rem 0 0; }
  .km-a-foot a, .km-a-link { color: var(--km-blue); font-weight: 800; text-decoration: none; }
  .km-a-link { border: 0; background: none; padding: .25rem .1rem; font-family: inherit; font-size: inherit; cursor: pointer; }
  .km-a-forgot { display: block; text-align: center; margin-top: .4rem; font-size: .85rem; color: #dc2626; font-weight: 700; text-decoration: none; }
  .km-a-check { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: #475569; margin: .2rem 0 1rem; }
  .km-a-check input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--km-blue); }
  .km-a-form .math-captcha { margin-bottom: .9rem; }

  /* پنل کشویی از پایین */
  .km-a-bd { position: fixed; inset: 0; z-index: 1990; background: rgba(15,23,42,.5); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
  .km-a-bd.is-open { opacity: 1; visibility: visible; }
  .km-a-sheet {
    position: fixed; left: 0; right: 0; bottom: var(--km-kb, 0px); z-index: 2000; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
    padding: 0 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px)); background: #fff; border-radius: 24px 24px 0 0; box-shadow: 0 -12px 40px rgba(15,23,42,.2);
    transform: translateY(105%); visibility: hidden; transition: transform .3s cubic-bezier(.2,.8,.2,1), visibility .3s;
  }
  .km-a-sheet.is-open { transform: translateY(0); visibility: visible; }
  .km-a-sheet-head { position: relative; padding: .7rem 0 .4rem; touch-action: none; }
  .km-a-handle { display: block; width: 42px; height: 5px; margin: 0 auto; border-radius: 99px; background: #cbd5e1; }
  .km-a-x { position: absolute; top: .45rem; inset-inline-start: -.4rem; width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; color: var(--km-muted); border-radius: 12px; }
  .km-a-sheet-title { font-size: 1.2rem; font-weight: 900; text-align: center; margin: .6rem 0 .4rem; color: var(--km-ink); }
  .km-a-sheet-sub { text-align: center; font-size: .88rem; color: var(--km-muted); margin: 0 0 1.2rem; line-height: 1.9; }
  .km-a-sheet-sub b { color: var(--km-ink); }
  .km-a-resend { text-align: center; font-size: .85rem; color: var(--km-muted); min-height: 1.8rem; }
  .km-a-sheet.is-ok .km-a-btn-primary { background: #16a34a; box-shadow: 0 6px 16px rgba(22,163,74,.3); }

  /* جعبه‌های کد ۶ رقمی */
  .km-otp { display: flex; justify-content: center; gap: .5rem; direction: ltr; margin: 0 0 .5rem; }
  .km-otp-box {
    width: 3rem; height: 3.6rem; max-width: 14vw; padding: 0; box-sizing: border-box; text-align: center; font-family: inherit; font-size: 1.5rem; font-weight: 800; color: var(--km-ink);
    background: var(--km-bg); border: 1.5px solid #cbd5e1; border-radius: 14px; outline: 0; caret-color: var(--km-blue); transition: border-color .15s, box-shadow .15s, background .15s;
  }
  .km-otp-box:focus { border-color: var(--km-blue); background: #fff; box-shadow: 0 0 0 4px rgba(29,78,216,.12); }
  .km-otp-box.is-filled { background: #fff; border-color: #94a3b8; }
  .km-otp.is-error .km-otp-box { border-color: #dc2626; background: #fef2f2; animation: kmAShake .35s; }
  @keyframes kmAShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
  .km-auth-reg .km-a-codewrap > label, .km-auth-reg .km-a-codewrap > input { display: none; }
  .km-auth-reg .km-a-codewrap > span { display: block; text-align: center; margin-top: .4rem; }
  .km-auth-reg .km-a-codewrap .km-otp { margin-top: .5rem; }
}

@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
  .km-a-sheet, .km-a-bd, .km-a-btn { transition: none; }
  .km-otp.is-error .km-otp-box { animation: none; }
}

/* Karood V463 approved mobile authentication skin */
@media (max-width: 767.98px) {
  body.km-auth-page { background: #f8f2e8 !important; }
  body.km-auth-page .km-auth-m,
  body.km-auth-page .km-auth-reg .card {
    background:
      radial-gradient(ellipse at 8% 3%, rgba(255,255,255,.96) 0, rgba(255,255,255,0) 35%),
      radial-gradient(ellipse at 100% 25%, rgba(224,208,255,.68) 0, rgba(224,208,255,0) 38%),
      linear-gradient(155deg, #fffaf0 0%, #f8f0e6 54%, #f0e8ff 100%) !important;
  }
  body.km-auth-page .km-auth-m { padding-left: 1.15rem; padding-right: 1.15rem; }
  body.km-auth-page .km-a-hero { padding-top: .75rem; padding-bottom: 1.35rem; }
  body.km-auth-page .km-a-logo {
    width: 104px; height: 82px; border-radius: 24px; background: rgba(255,255,255,.82);
    border: 1px solid rgba(255,255,255,.9); box-shadow: 0 12px 30px rgba(48,26,89,.12);
  }
  body.km-auth-page .km-a-logo svg { width: 92px; max-width: 100%; height: auto; overflow: visible; }
  body.km-auth-page .km-a-title { color: #25164d; }
  body.km-auth-page .km-a-sub { color: #625a73; }
  body.km-auth-page .km-a-input,
  body.km-auth-page .km-auth-reg .form-control-lg { background: rgba(255,255,255,.88); border-color: #d8d0e4; color: #25164d; }
  body.km-auth-page .km-a-input:focus,
  body.km-auth-page .km-auth-reg .form-control:focus { border-color: #6734bd; box-shadow: 0 0 0 4px rgba(103,52,189,.12); }
  body.km-auth-page .km-a-btn-primary { background: linear-gradient(105deg,#4d1fa4,#713bd0); box-shadow: 0 8px 20px rgba(77,31,164,.24); }
  body.km-auth-page .km-a-btn-ghost { background: rgba(255,255,255,.78); border-color: #ded5eb; }
  body.km-auth-page .km-a-regcta { background: #eee5ff; color: #452080; }
  body.km-auth-page .km-a-sheet { background: #fffaf3; }
  body.km-auth-page .km-auth-reg .km-a-body { background: transparent !important; }
  body.km-auth-page .km-auth-reg .card { background-color: #fbf6ed; }
}

/* Prevent management-panel thumbnails from being stretched on mobile. */
@media (max-width: 767.98px) {
  .admin-content img, .store-manager-content img, .real-estate-manager-content img,
  .car-manager-content img, .card img.product-image, img.admin-thumbnail, img.management-thumbnail {
    max-width: 100%; height: auto; object-fit: contain;
  }
  .card img, .table img { max-width: 100%; }
}
