/* =========================================================
   صفحه‌ی خانه‌ی موبایل و اپلیکیشن (templates/main-page/_app-home.html، statics/js/home_app.js)
   تا ۷۶۸ پیکسل این طرح نمایش داده می‌شود و طرح دسکتاپ (.home-desktop) پنهان است.
   ========================================================= */
@font-face {
    font-family: 'Barlow Condensed';
    src: url("../fonts/BarlowCondensed-400.c8e400bbebae.woff2") format('woff2');
    font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF;
}
@font-face {
    font-family: 'Barlow Condensed';
    src: url("../fonts/BarlowCondensed-600.16cc9e59e14c.woff2") format('woff2');
    font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0000-00FF;
}

.app-home { display: none; }

@media (max-width: 768px) {
    .sk-page-home { background: var(--sk-ground); }
    .sk-page-home .sk-footer { display: none !important; }
    .home-desktop { display: none; }
    .app-home { display: block; padding: 12px 0 28px; color: var(--sk-ink); }
}

/* ---------- اجزای مشترک ---------- */
.ah-card { background: var(--sk-surface); border: 1px solid var(--sk-line); border-radius: 20px; }
.ah-sec { margin: 24px 16px 0; }
.ah-sec__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ah-sec__head h2 { margin: 0; font-size: 16px; font-weight: 800; color: var(--sk-ink); }
.ah-sec__head small { display: block; margin-top: 1px; font-size: 12px; color: var(--sk-muted); }
.ah-more {
    min-height: 36px; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap;
    font-size: 13px; font-weight: 700; color: var(--sk-primary); text-decoration: none;
}
.ah-more .sk-ico { font-size: 16px; }
.ah-empty { margin: 0; padding: 18px 14px; font-size: 13px; color: var(--sk-muted); text-align: center; }

/* ---------- ۱) بنر / اسلایدر ---------- */
.ah-banner {
    position: relative; isolation: isolate; overflow: hidden; margin: 0 16px; aspect-ratio: 2160 / 1170;
    border-radius: 20px; background: #1B3A52; box-shadow: 0 12px 26px -16px rgba(6, 43, 58, 0.6);
}
.ah-banner__track { display: flex; height: 100%; transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1); will-change: transform; }
.ah-banner__slide { flex: 0 0 100%; height: 100%; display: block; }
.ah-banner__slide picture, .ah-banner__slide img { display: block; width: 100%; height: 100%; }
.ah-banner__slide img { object-fit: cover; }
.ah-banner__dots { position: absolute; left: 8px; bottom: 6px; display: flex; }
.ah-dot { width: 24px; height: 28px; padding: 0; border: 0; background: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ah-dot i { position: relative; overflow: hidden; display: block; width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.55); transition: width 0.3s ease; }
.ah-dot.is-on i { width: 20px; background: rgba(255, 255, 255, 0.35); }
.ah-dot.is-on i::after {
    content: ''; position: absolute; inset: 0; background: #FFFFFF; transform-origin: right;
    animation: ahDotFill var(--ah-slide-ms, 5000ms) linear forwards;
}
.ah-banner.is-paused .ah-dot.is-on i::after { animation-play-state: paused; }
@keyframes ahDotFill { from { transform: scaleX(0); } }

/* ---------- ۲) بخش‌های سامانه ---------- */
.ah-services {
    margin: 16px 16px 0; padding: 10px 4px 6px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; row-gap: 2px;
    background: var(--sk-surface); border: 1px solid var(--sk-line); border-radius: 20px;
}
.ah-services a {
    min-height: 82px; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 9px 2px 6px;
    border-radius: 14px; color: var(--sk-primary); text-align: center; text-decoration: none;
    -webkit-tap-highlight-color: transparent; transition: background-color 0.15s ease;
}
.ah-services a:active { background: var(--sk-primary-soft); }
.ah-services .sk-ico { font-size: 30px; }
.ah-services span { font-size: 12px; font-weight: 600; line-height: 1.55; color: #2A3F4A; }

/* ---------- ۳) کارتابل شما / خوش‌آمد مهمان ---------- */
.ah-me { margin: 16px 16px 0; padding: 14px 14px 10px; }
.ah-me__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ah-me__top h2 { margin: 0; font-size: 15px; font-weight: 800; color: var(--sk-ink); }
.ah-me__top small { font-size: 12px; color: var(--sk-muted); }
.ah-me__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; padding-top: 10px; border-top: 1px solid #EDF2F5; }
.ah-me__stats a { display: flex; flex-direction: column; gap: 1px; padding: 2px 12px; border-left: 1px solid #EDF2F5; color: var(--sk-ink); text-decoration: none; }
.ah-me__stats a:first-child { padding-right: 2px; }
.ah-me__stats a:last-child { border-left: 0; }
.ah-me__stats b { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 800; }
.ah-me__stats span { font-size: 11.5px; color: var(--sk-muted); }
.ah-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--sk-accent); box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.22); }
.ah-welcome { margin: 16px 16px 0; padding: 14px; }
.ah-welcome__text { display: flex; align-items: flex-start; gap: 12px; color: var(--sk-primary); }
.ah-welcome__text > .sk-ico { font-size: 28px; margin-top: 2px; }
.ah-welcome h2 { margin: 0; font-size: 15px; font-weight: 800; color: var(--sk-ink); }
.ah-welcome p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.8; color: var(--sk-muted); }
.ah-welcome__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.ah-btn {
    min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 12px;
    font-size: 13.5px; font-weight: 700; background: var(--sk-primary-soft); color: var(--sk-primary); text-decoration: none;
}
.ah-btn--primary { background: var(--sk-primary); color: #FFFFFF; }

/* ---------- ۴) نرخ ارز ---------- */
.ah-rates { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.ah-rates::-webkit-scrollbar { display: none; }
.ah-rate {
    flex: 0 0 150px; scroll-snap-align: start; padding: 12px; display: flex; flex-direction: column; gap: 5px;
    font: inherit; color: var(--sk-ink); text-align: right; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ah-rate:active { background: #F8FBFC; }
.ah-rate__top { display: flex; align-items: center; justify-content: space-between; }
.ah-code {
    height: 22px; padding: 0 7px; border-radius: 7px; background: #EEF3F6; color: var(--sk-primary); direction: ltr;
    display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; font-family: ui-monospace, Consolas, monospace;
}
.ah-chg { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 700; }
.ah-chg svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ah-chg--up { color: #1E7A46; }
.ah-chg--down { color: #B42D2D; }
.ah-chg--flat { color: var(--sk-muted); }
.ah-rate__name { font-size: 12.5px; font-weight: 600; color: #2A3F4A; }
.ah-rate__price { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ah-rate__price small { font-size: 11px; font-weight: 500; color: var(--sk-muted); }
.ah-spark { display: block; width: 100%; height: 26px; }
.ah-spark polyline { fill: none; stroke: var(--sk-primary-light); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

/* ---------- ۵) سُکانه چطور کار می‌کند؟ (طرح «How It Works v2»: گوشه‌های + ، بدون گردی و سایه) ---------- */
.hiw { margin: 24px 0 0; padding: 28px 20px; display: flex; flex-direction: column; gap: 22px; background: #F2F2F3; color: #1D1F20; }
.hiw-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.hiw-titles { display: flex; flex-direction: column; gap: 6px; }
.hiw-kicker { text-align: right; font-family: 'Barlow Condensed', sans-serif; font-size: 12px; letter-spacing: 0.22em; color: #416180; }
.hiw-title { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.4; color: #1D1F20; }
.hiw-sub { font-size: 14px; color: #5D5D60; }
.hiw-count { white-space: nowrap; font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: 0.08em; color: #7A7A7D; }
.hiw-count span { color: #2C455D; }
.hiw-tabsblock { display: flex; flex-direction: column; gap: 10px; }
.hiw-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hiw-tab {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 12px;
    border: 1px solid rgba(29, 31, 32, 0.16); border-radius: 0; background: transparent; color: #7A7A7D;
    font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.hiw-tab .sk-ico { font-size: 26px; }
.hiw-tab span { font-size: 13px; font-weight: 600; }
.hiw-tab.is-done { color: #416180; border-color: #94BCE3; }
.hiw-tab.is-active { background: #2C455D; border-color: #2C455D; color: #F2F2F3; }
.hiw-tab:focus-visible, .hiw-panel:focus-visible, .hbtn:focus-visible { outline: 2px solid #5980A6; outline-offset: 2px; }
.hiw-corner { position: absolute; width: 11px; height: 11px; color: rgba(29, 31, 32, 0.4); pointer-events: none; }
.hiw-corner::before, .hiw-corner::after { content: ''; position: absolute; background: currentColor; }
.hiw-corner::before { left: 5px; top: 0; width: 1px; height: 11px; }
.hiw-corner::after { top: 5px; left: 0; width: 11px; height: 1px; }
.hiw-corner--tl { top: -6px; left: -6px; }
.hiw-corner--tr { top: -6px; right: -6px; }
.hiw-corner--bl { bottom: -6px; left: -6px; }
.hiw-corner--br { bottom: -6px; right: -6px; }
.hiw-tab.is-active .hiw-corner { color: #2C455D; }
.hiw-panel > .hiw-corner { color: rgba(29, 31, 32, 0.55); }
.hiw-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hiw-track { height: 3px; background: #D4D4D7; }
.hiw-fill { width: 0; height: 100%; background: #5980A6; transition: width 0.3s ease; }
.hiw-fill.is-full { width: 100%; }
.hiw-panel { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px 18px 18px; border: 1px solid rgba(29, 31, 32, 0.16); }
.hiw-content { display: flex; flex-direction: column; gap: 8px; }
.hiw-content.is-entering { animation: hiwIn 0.28s ease-out; }
@keyframes hiwIn { from { opacity: 0; transform: translateY(6px); } }
.hiw-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hiw-step-title { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.5; color: #1D1F20; }
.hiw-num { font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 40px; line-height: 1; color: #B5D9FD; }
.hiw-desc { margin: 0; min-height: 52px; font-size: 14px; line-height: 1.85; color: #5D5D60; text-wrap: pretty; }
.hiw-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid rgba(29, 31, 32, 0.16); }
.hbtn {
    min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px solid transparent; border-radius: 0;
    font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color 0.15s ease;
}
.hbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.hbtn[hidden] { display: none; }
.hbtn--ghost { background: transparent; color: #5980A6; }
.hbtn--ghost:hover { background: rgba(89, 128, 166, 0.1); color: #5980A6; }
.hbtn--ghost:disabled { opacity: 0.45; cursor: default; background: transparent; }
.hbtn--primary { background: #5980A6; color: #F2F2F3; }
.hbtn--primary:hover { background: #597EA3; color: #F2F2F3; }
.hbtn--primary:active { background: #416180; }

/* ---------- ۶ و ۷) فهرست‌ها: تازه‌های بازار، بخشنامه‌ها ---------- */
.ah-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 4px; margin-bottom: 10px; border-radius: 14px; background: #E6EDF1; }
.ah-seg button { height: 36px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--sk-muted); cursor: pointer; }
.ah-seg button.is-on { background: var(--sk-surface); color: var(--sk-primary); box-shadow: 0 1px 3px rgba(15, 37, 48, 0.12); }
.ah-list { overflow: hidden; }
.ah-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #EDF2F5; color: var(--sk-ink); text-decoration: none; }
.ah-list > .ah-row:last-child, .ah-list [role="tabpanel"] > .ah-row:last-child { border-bottom: 0; }
.ah-row__icon { font-size: 26px; color: var(--sk-primary); flex-shrink: 0; }
.ah-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ah-row__title { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ah-row__title--wrap { white-space: normal; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ah-row__meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sk-muted); }
.ah-row__time { flex-shrink: 0; font-size: 11.5px; color: var(--sk-muted); }
.ah-kind { padding: 1px 7px; border-radius: 6px; background: var(--sk-primary-soft); color: var(--sk-primary); font-size: 11px; font-weight: 800; }
.ah-kind--demand { background: var(--sk-accent-soft); color: var(--sk-accent-text); }
.ah-row__icon--demand { color: var(--sk-accent-text); }
.ah-hs { padding: 1px 6px; border-radius: 6px; background: #EEF3F6; color: var(--sk-primary); font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; font-weight: 700; }
.ah-foot-link {
    min-height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
    border-top: 1px solid #EDF2F5; background: #F8FBFC; font-size: 13px; font-weight: 700; color: var(--sk-primary); text-decoration: none;
}
.ah-foot-link .sk-ico { font-size: 18px; }

/* ---------- ۸) مقالات ---------- */
.ah-arts { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.ah-arts::-webkit-scrollbar { display: none; }
.ah-art { flex: 0 0 236px; scroll-snap-align: start; overflow: hidden; display: flex; flex-direction: column; color: var(--sk-ink); text-decoration: none; }
.ah-art__thumb { position: relative; height: 118px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #E7EEF2; }
.ah-art__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ah-art__thumb--fallback { background: linear-gradient(135deg, var(--sk-primary) 0%, var(--sk-primary-light) 100%); color: #FFFFFF; }
.ah-art__thumb--fallback .sk-ico { font-size: 44px; opacity: 0.9; }
.ah-art__body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.ah-art__body strong { font-size: 13.5px; font-weight: 700; line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ah-art__body small { font-size: 11.5px; color: var(--sk-muted); }

/* ---------- ۹) اشتراک ویژه ---------- */
.ah-vip {
    position: relative; overflow: hidden; isolation: isolate; margin: 24px 16px 0; padding: 18px; border-radius: 22px; color: #FFFFFF;
    background: linear-gradient(135deg, var(--sk-primary-deep) 0%, var(--sk-primary) 62%, #1B6A87 100%);
}
.ah-vip__glow { position: absolute; z-index: -1; left: -70px; top: -80px; width: 200px; height: 200px; border-radius: 50%; background: rgba(245, 166, 35, 0.3); filter: blur(34px); }
.ah-vip__icon { font-size: 30px; color: var(--sk-accent); }
.ah-vip h2 { margin: 10px 0 4px; font-size: 17px; font-weight: 800; color: #FFFFFF; }
.ah-vip p { margin: 0 0 14px; font-size: 12.5px; line-height: 1.8; color: rgba(255, 255, 255, 0.84); }
.ah-vip__btn {
    min-height: 42px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 12px; color: #FFFFFF; text-decoration: none;
    font-size: 13px; font-weight: 700; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.36);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.ah-vip__btn .sk-ico { font-size: 16px; }

@media (prefers-reduced-motion: reduce) {
    .ah-banner__track, .hiw-fill, .hiw-tab { transition: none; }
    .hiw-content.is-entering { animation: none; }
    .ah-dot.is-on i::after { animation: none; transform: none; }
}
