/* ==========================================================================
   SahamBan — public website stylesheet
   Self-contained. No Bootstrap, no jQuery, no CDN.
   RTL-native (CSS logical properties throughout).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. FONTS — Vazirmatn, self-hosted and BUNDLED (no download step required)
   Split by unicode-range so a Persian page fetches only the Arabic subset
   (~21 KB/weight) and pulls the Latin subset only when Latin glyphs appear.
   -------------------------------------------------------------------------- */

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/vazirmatn/vazirmatn-arabic-400.woff2") format("woff2");
    font-weight: 400; font-style: normal; font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1,
                   U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF,
                   U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/vazirmatn/vazirmatn-arabic-500.woff2") format("woff2");
    font-weight: 500; font-style: normal; font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1,
                   U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF,
                   U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/vazirmatn/vazirmatn-arabic-700.woff2") format("woff2");
    font-weight: 700; font-style: normal; font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1,
                   U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF,
                   U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/vazirmatn/vazirmatn-latin-400.woff2") format("woff2");
    font-weight: 400; font-style: normal; font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC,
                   U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/vazirmatn/vazirmatn-latin-500.woff2") format("woff2");
    font-weight: 500; font-style: normal; font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC,
                   U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/vazirmatn/vazirmatn-latin-700.woff2") format("woff2");
    font-weight: 700; font-style: normal; font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC,
                   U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   2. DESIGN TOKENS
   -------------------------------------------------------------------------- */

:root {
    /* ---- Brand gold, tuned for a navy ground ----
       Contrast on --ink-900 : gold 11.1:1 · gold-bright 13.0:1  (WCAG AA/AAA) */
    --gold: #E8CD8E;
    --gold-bright: #F7DE9B;
    --gold-deep: #8A6B1C;          /* 5.0:1 on white — for links/accents on light */
    --gold-metal: #C09A33;         /* decorative only: gradients, hairlines */
    --gold-dim: rgba(232, 205, 142, .13);
    --gold-line: rgba(232, 205, 142, .26);

    /* ---- Dark surfaces: سرمه‌ای / آبی درباری ---- */
    --ink-900: #0B1A3A;            /* deep navy — primary dark ground */
    --ink-800: #12244B;            /* card on navy */
    --ink-700: #1B3160;            /* raised / hover */
    --ink-600: #2A4275;            /* borders on navy */

    /* ---- Royal blue: the secondary structural colour ---- */
    --royal: #1E3F8F;              /* 9.7:1 on white — links on light surfaces */
    --royal-bright: #5B8DEF;       /* links on navy */
    --royal-dim: rgba(30, 63, 143, .08);

    /* ---- Light surfaces ---- */
    --paper: #FFFFFF;
    --paper-alt: #F6F8FC;          /* faint blue cast, not neutral grey */
    --paper-line: #DFE5F0;

    /* ---- Text ---- */
    --text-900: #101828;
    --text-700: #364152;
    --text-500: #626F86;           /* 5.1:1 on white */
    --text-100: #E9ECF2;           /* 14.5:1 on navy */
    --text-300: #AEBBD6;           /* 8.9:1 on navy — blue-tinted, not grey */

    /* ---- Semantic — must match the Telegram message colour system.
       Red/green separate by only ΔE 7.1 under deuteranopia, so every use is
       ALSO carried by a text label. Never colour alone. ---- */
    --up: #22C03C;
    --up-deep: #1F872E;            /* 4.6:1 on white */
    --up-soft: #6EE787;            /* on navy */
    --down: #E5484D;
    --down-deep: #B4292E;          /* 6.4:1 on white */
    --down-soft: #FF9B9E;          /* on navy */
    --warn: #F0A500;
    --surge: #F97316;
    --info: #1E3F8F;

    /* ---- Structure ---- */
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(11, 26, 58, .06), 0 1px 3px rgba(11, 26, 58, .10);
    --shadow: 0 4px 6px -2px rgba(11, 26, 58, .05), 0 12px 16px -4px rgba(11, 26, 58, .12);
    --shadow-gold: 0 8px 24px -6px rgba(192, 154, 51, .38);

    /* ---- Spacing — 8pt scale ---- */
    --s1: 4px;   --s2: 8px;   --s3: 12px;  --s4: 16px;
    --s5: 24px;  --s6: 32px;  --s7: 48px;  --s8: 64px;
    --s9: 96px;

    --wrap: 1160px;
    --wrap-narrow: 760px;

    --font: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
    --font-num: "Vazirmatn", ui-monospace, "SF Mono", Menlo, monospace;
}

/* --------------------------------------------------------------------------
   3. RESET
   -------------------------------------------------------------------------- */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.85;
    color: var(--text-900);
    background: var(--paper);
    font-feature-settings: "ss01", "tnum";
    -webkit-font-smoothing: antialiased;
}

img, picture, svg, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--s3);
    line-height: 1.45;
    font-weight: 700;
    letter-spacing: -.01em;
}

h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); line-height: 1.3; }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); }
h3 { font-size: clamp(1.15rem, 1rem + .7vw, 1.4rem); }
h4 { font-size: 1.08rem; }

p { margin: 0 0 var(--s4); }

a { color: var(--royal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold-deep); }

ul, ol { margin: 0 0 var(--s4); padding-inline-start: 1.5em; }
li { margin-bottom: var(--s2); }

strong, b { font-weight: 700; }

code, kbd, .num {
    font-family: var(--font-num);
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

hr { border: 0; border-top: 1px solid var(--paper-line); margin: var(--s6) 0; }

:focus-visible {
    outline: 3px solid var(--gold-deep);
    outline-offset: 2px;
    border-radius: 4px;
}

::selection { background: var(--gold); color: var(--ink-900); }

/* --------------------------------------------------------------------------
   4. LAYOUT PRIMITIVES
   -------------------------------------------------------------------------- */

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s4); }
.wrap-narrow { width: 100%; max-width: var(--wrap-narrow); margin-inline: auto; padding-inline: var(--s4); }

.section { padding-block: var(--s8); }
.section-sm { padding-block: var(--s7); }

.section-alt { background: var(--paper-alt); }

.section-dark {
    background: var(--ink-900);
    color: var(--text-100);
}
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 { color: #fff; }
.section-dark a { color: var(--royal-bright); }
.section-dark a:hover { color: var(--gold); }

.skip-link {
    position: absolute;
    inset-inline-start: -9999px;
    top: 0;
    background: var(--gold);
    color: var(--ink-900);
    padding: var(--s3) var(--s4);
    z-index: 999;
    font-weight: 700;
}
.skip-link:focus { inset-inline-start: 0; }

/* --------------------------------------------------------------------------
   5. HEADER
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 26, 58, .93);
    backdrop-filter: blur(12px);
    border-block-end: 1px solid var(--gold-line);
    box-shadow: 0 1px 0 rgba(43,92,184,.35);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: var(--s4);
    min-height: 68px;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--s2);
    text-decoration: none;
    flex-shrink: 0;
}
.brand img { width: 38px; height: 38px; }
.brand-text { font-weight: 700; font-size: 1.2rem; color: var(--gold); letter-spacing: .01em; }

.nav-toggle {
    margin-inline-start: auto;
    display: none;
    background: transparent;
    border: 1px solid var(--gold-line);
    border-radius: var(--radius-sm);
    color: var(--gold);
    padding: 9px 11px;
    cursor: pointer;
    line-height: 0;
}
.nav-toggle svg { width: 22px; height: 22px; }

.site-nav { margin-inline-start: auto; }
.site-nav ul {
    display: flex;
    align-items: center;
    gap: var(--s1);
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav li { margin: 0; }
.site-nav a {
    display: block;
    padding: 8px 13px;
    border-radius: var(--radius-sm);
    color: var(--text-300);
    text-decoration: none;
    font-size: .95rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color .15s, background .15s;
}
.site-nav a:hover { color: var(--gold); background: var(--gold-dim); }
.site-nav a[aria-current="page"] { color: var(--gold); background: var(--gold-dim); }

.header-cta { flex-shrink: 0; margin-inline-start: var(--s3); }

@media (max-width: 1000px) {
    .nav-toggle { display: block; }
    .header-cta { display: none; }
    .site-nav {
        position: fixed;
        inset-block-start: 68px;
        inset-inline: 0;
        background: var(--ink-900);
        border-block-end: 1px solid var(--gold-line);
        padding: var(--s3) var(--s4) var(--s5);
        max-height: calc(100dvh - 68px);
        overflow-y: auto;
        display: none;
    }
    .site-nav.open { display: block; }
    .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
    .site-nav a { padding: 13px var(--s3); border-block-end: 1px solid var(--ink-700); border-radius: 0; }
}

/* --------------------------------------------------------------------------
   6. BUTTONS
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    padding: 13px 24px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: transform .12s, box-shadow .15s, background .15s, color .15s;
    line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 19px; height: 19px; flex-shrink: 0; }

.btn-primary {
    background: linear-gradient(180deg, var(--gold-bright), var(--gold-metal));
    color: #241A0B;
    box-shadow: var(--shadow-gold);
}
.btn-primary:hover { color: #241A0B; box-shadow: 0 10px 28px -6px rgba(184, 145, 47, .5); }

.btn-outline {
    background: transparent;
    border-color: var(--gold);
    color: var(--gold);
}
.btn-outline:hover { background: var(--gold-dim); color: var(--gold-bright); }

.btn-solid {
    background: var(--royal);
    color: #fff;
}
.btn-solid:hover { color: #fff; background: #17337a; }

.btn-ghost {
    background: transparent;
    border-color: var(--paper-line);
    color: var(--text-700);
}
.btn-ghost:hover { border-color: var(--gold-deep); color: var(--gold-deep); }

.btn-sm { padding: 9px 16px; font-size: .92rem; }
.btn-lg { padding: 16px 32px; font-size: 1.08rem; }
.btn-block { width: 100%; }

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s3);
    margin-block: var(--s5);
}
.btn-row.center { justify-content: center; }

/* --------------------------------------------------------------------------
   7. HERO
   -------------------------------------------------------------------------- */

.hero {
    background:
        radial-gradient(ellipse 70% 55% at 78% -5%, rgba(232, 205, 142, .14), transparent 62%),
        radial-gradient(ellipse 90% 60% at 15% 0%, rgba(43, 92, 184, .22), transparent 60%),
        var(--ink-900);
    color: var(--text-100);
    padding-block: var(--s9) var(--s8);
    border-block-end: 1px solid var(--gold-line);
}

.hero h1 { color: #fff; margin-bottom: var(--s4); }
.hero h1 .accent { color: var(--gold); }

.hero-lead {
    font-size: clamp(1.05rem, 1rem + .5vw, 1.28rem);
    color: var(--text-300);
    max-width: 62ch;
    margin-bottom: var(--s5);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s7);
    align-items: center;
}
@media (min-width: 900px) {
    .hero-grid { grid-template-columns: 1.05fr .95fr; }
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    font-size: .85rem;
    font-weight: 700;
    color: var(--gold);
    background: var(--gold-dim);
    border: 1px solid var(--gold-line);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: var(--s4);
}

/* --------------------------------------------------------------------------
   8. CARDS & GRIDS
   -------------------------------------------------------------------------- */

.grid { display: grid; gap: var(--s4); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.card {
    background: var(--paper);
    border: 1px solid var(--paper-line);
    border-radius: var(--radius);
    padding: var(--s5);
    box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: var(--s2); }
.card > :last-child { margin-bottom: 0; }

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--gold-deep);
    color: inherit;
}

.section-dark .card {
    background: var(--ink-800);
    border-color: var(--ink-600);
    box-shadow: none;
    color: var(--text-100);
}
.section-dark .card-link:hover { border-color: var(--gold); }

.card-icon {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: var(--radius-sm);
    background: var(--gold-dim);
    color: var(--gold-deep);
    margin-bottom: var(--s3);
    font-size: 1.3rem;
}
.section-dark .card-icon { color: var(--gold); }

/* Feature list */
.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li {
    position: relative;
    padding-inline-start: 30px;
    margin-bottom: var(--s3);
}
.feature-list li::before {
    content: "";
    position: absolute;
    inset-inline-start: 6px;
    top: .72em;
    width: 8px; height: 8px;
    border-radius: 2px;
    background: var(--gold-deep);
}
.section-dark .feature-list li::before { background: var(--gold); }

/* --------------------------------------------------------------------------
   9. STAT / PROOF STRIP
   -------------------------------------------------------------------------- */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--s4);
    padding: var(--s5);
    background: var(--ink-800);
    border: 1px solid var(--ink-600);
    border-radius: var(--radius-lg);
}
.stat { text-align: center; }
.stat-value {
    display: block;
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
    font-weight: 700;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.stat-label { font-size: .9rem; color: var(--text-300); }

/* --------------------------------------------------------------------------
   10. MESSAGE / EVENT TAGS  (mirrors the Telegram colour system)
   Colour is NEVER the only carrier — every tag has a text label.
   -------------------------------------------------------------------------- */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .86rem;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.tag::before { content: ""; width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }

.tag-up    { background: rgba(34,192,60,.12);  color: var(--up-deep);   border-color: rgba(34,192,60,.3); }
.tag-up::before { background: var(--up); }
.tag-down  { background: rgba(229,72,77,.12);  color: var(--down-deep); border-color: rgba(229,72,77,.3); }
.tag-down::before { background: var(--down); }
.tag-warn  { background: rgba(240,165,0,.14);  color: #7A5300;          border-color: rgba(240,165,0,.32); }
.tag-warn::before { background: var(--warn); }
.tag-surge { background: rgba(249,115,22,.13); color: #8F3A08;          border-color: rgba(249,115,22,.3); }
.tag-surge::before { background: var(--surge); }
.tag-info  { background: var(--royal-dim);      color: var(--royal);     border-color: rgba(30,63,143,.22); }
.tag-info::before { background: var(--royal); }
.tag-gold  { background: rgba(138,107,28,.12); color: #6F5615;          border-color: rgba(138,107,28,.3); }
.tag-gold::before { background: var(--gold-deep); }

.section-dark .tag-up   { color: var(--up-soft); }
.section-dark .tag-down { color: var(--down-soft); }
.section-dark .tag-warn { color: #ffd06b; }
.section-dark .tag-surge{ color: #ffb27a; }
.section-dark .tag-gold { color: var(--gold); }
.section-dark .tag-info { background: rgba(255,255,255,.08); color: var(--text-100); border-color: var(--ink-600); }

.tag-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin-block: var(--s3); }

/* --------------------------------------------------------------------------
   11. FIGURES (image + mandatory data table)
   -------------------------------------------------------------------------- */

figure { margin: 0 0 var(--s5); }

.figure-card {
    background: var(--paper);
    border: 1px solid var(--paper-line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.figure-card img { width: 100%; }
.figure-card figcaption {
    padding: var(--s3) var(--s4);
    font-size: .92rem;
    color: var(--text-500);
    border-block-start: 1px solid var(--paper-line);
    background: var(--paper-alt);
}
.section-dark .figure-card { background: var(--ink-800); border-color: var(--ink-600); }
.section-dark .figure-card figcaption { background: var(--ink-700); border-color: var(--ink-600); color: var(--text-300); }

/* Data table that mirrors every image — this is what Google actually reads */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
    margin-block: var(--s4);
}
.data-table caption {
    text-align: start;
    font-weight: 700;
    padding-block-end: var(--s3);
    color: var(--text-700);
}
.data-table th, .data-table td {
    padding: 11px var(--s3);
    border-block-end: 1px solid var(--paper-line);
    text-align: start;
}
.data-table th { font-weight: 700; background: var(--paper-alt); white-space: nowrap; }
.data-table td.num, .data-table th.num {
    font-variant-numeric: tabular-nums;
    text-align: end;
    direction: ltr;
    unicode-bidi: plaintext;
}
.data-table tbody tr:hover { background: var(--paper-alt); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-block: var(--s4); }

.section-dark .data-table th { background: var(--ink-700); color: #fff; }
.section-dark .data-table th, .section-dark .data-table td { border-color: var(--ink-600); }
.section-dark .data-table tbody tr:hover { background: var(--ink-700); }

/* --------------------------------------------------------------------------
   12. TELEGRAM MESSAGE MOCK (real text, not an image — fully crawlable)
   -------------------------------------------------------------------------- */

.tg-msg {
    background: var(--paper);
    border: 1px solid var(--paper-line);
    border-inline-start: 4px solid var(--gold-deep);
    border-radius: var(--radius);
    padding: var(--s4) var(--s5);
    font-size: .95rem;
    line-height: 2;
    box-shadow: var(--shadow-sm);
    margin-block: var(--s4);
}
.tg-msg .tg-head { font-weight: 700; font-size: 1.02rem; margin-bottom: var(--s2); }
.tg-msg .tg-symbol { color: var(--royal); font-weight: 700; }
.tg-msg dl { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--s3); margin: 0; }
.tg-msg dt { color: var(--text-500); }
.tg-msg dd { margin: 0; font-weight: 500; color: var(--text-900); font-variant-numeric: tabular-nums; direction: ltr; text-align: start; unicode-bidi: plaintext; }
.tg-msg .tg-foot { margin-top: var(--s3); padding-top: var(--s2); border-top: 1px dashed var(--paper-line); color: var(--text-500); font-size: .88rem; }

.section-dark .tg-msg { background: var(--ink-800); border-color: var(--ink-600); border-inline-start-color: var(--gold); }
.section-dark .tg-msg .tg-symbol { color: var(--gold); }
.section-dark .tg-msg dt { color: var(--text-300); }
.section-dark .tg-msg dd { color: #fff; }
.section-dark .tg-msg .tg-foot { border-color: var(--ink-600); color: var(--text-300); }

/* --------------------------------------------------------------------------
   13. CALLOUTS
   -------------------------------------------------------------------------- */

.callout {
    border-inline-start: 4px solid var(--gold-deep);
    background: var(--gold-dim);
    padding: var(--s4) var(--s5);
    border-radius: var(--radius-sm);
    margin-block: var(--s5);
}
.callout > :last-child { margin-bottom: 0; }
.callout-title { font-weight: 700; display: block; margin-bottom: var(--s2); }

.callout-warn { border-inline-start-color: var(--warn); background: rgba(240,165,0,.09); }
.callout-info { border-inline-start-color: var(--royal); background: var(--royal-dim); }

.section-dark .callout { background: rgba(228,197,128,.09); }

/* --------------------------------------------------------------------------
   14. STEPS
   -------------------------------------------------------------------------- */

.steps { list-style: none; counter-reset: step; padding: 0; margin: var(--s5) 0; }
.steps li {
    counter-increment: step;
    position: relative;
    padding-inline-start: 56px;
    padding-block-end: var(--s5);
    border-inline-start: 2px solid var(--paper-line);
    margin-inline-start: 18px;
    margin-bottom: 0;
}
.steps li:last-child { border-inline-start-color: transparent; padding-block-end: 0; }
.steps li::before {
    content: counter(step);
    position: absolute;
    inset-inline-start: -19px;
    top: -4px;
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--gold-bright), var(--gold-metal));
    color: #241A0B;
    font-weight: 700;
    font-size: .95rem;
}
.steps h3 { margin-bottom: var(--s1); font-size: 1.1rem; }
.section-dark .steps li { border-inline-start-color: var(--ink-600); }

/* --------------------------------------------------------------------------
   15. FAQ (native details/summary — no JS)
   -------------------------------------------------------------------------- */

.faq-item {
    border: 1px solid var(--paper-line);
    border-radius: var(--radius);
    margin-bottom: var(--s3);
    background: var(--paper);
    overflow: hidden;
}
.faq-item summary {
    padding: var(--s4) var(--s5);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--s3);
    transition: background .15s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    margin-inline-start: auto;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--gold-deep);
    line-height: 1;
    flex-shrink: 0;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item summary:hover { background: var(--paper-alt); }
.faq-answer { padding: 0 var(--s5) var(--s4); color: var(--text-700); }
.faq-answer > :last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   16. BREADCRUMBS
   -------------------------------------------------------------------------- */

.breadcrumbs {
    font-size: .88rem;
    color: var(--text-500);
    padding-block: var(--s3);
}
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0; padding: 0; }
.breadcrumbs li { margin: 0; display: flex; align-items: center; gap: var(--s2); }
.breadcrumbs li + li::before { content: "\203A"; color: var(--text-500); }
.breadcrumbs a { color: var(--text-500); text-decoration: none; }
.breadcrumbs a:hover { color: var(--gold-deep); text-decoration: underline; }

/* --------------------------------------------------------------------------
   17. PRICING
   -------------------------------------------------------------------------- */

.price-card {
    background: var(--paper);
    border: 1px solid var(--paper-line);
    border-radius: var(--radius-lg);
    padding: var(--s5);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}
.price-card.featured { border-color: var(--gold-deep); border-width: 2px; box-shadow: var(--shadow-gold); }
.price-card h3 { display: flex; align-items: center; gap: var(--s2); }
.price-card .price {
    font-size: 1.6rem; font-weight: 700; color: var(--royal);
    font-variant-numeric: tabular-nums; margin-block: var(--s2) var(--s1);
}
.price-card .price small { font-size: .8rem; font-weight: 400; color: var(--text-500); }
.price-card .feature-list { flex-grow: 1; margin-block: var(--s4); }
.badge-free {
    background: rgba(34,192,60,.14); color: var(--up-deep);
    font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.badge-paid {
    background: rgba(138,107,28,.13); color: #6F5615;
    font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}

/* --------------------------------------------------------------------------
   18. FOOTER
   -------------------------------------------------------------------------- */

.site-footer {
    background: var(--ink-900);
    color: var(--text-300);
    padding-block: var(--s8) var(--s5);
    border-block-start: 1px solid var(--gold-line);
    font-size: .94rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--s6);
    margin-bottom: var(--s6);
}
.footer-col h4 { color: var(--gold); font-size: .98rem; margin-bottom: var(--s3); }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: var(--s2); }
.footer-col a { color: var(--text-300); text-decoration: none; }
.footer-col a:hover { color: var(--gold); text-decoration: underline; }
.footer-bottom {
    border-block-start: 1px solid var(--ink-700);
    padding-block-start: var(--s4);
    display: flex;
    flex-wrap: wrap;
    gap: var(--s3);
    justify-content: space-between;
    align-items: center;
    font-size: .88rem;
    color: var(--text-500);
}
.footer-disclaimer {
    background: var(--ink-800);
    border: 1px solid var(--ink-600);
    border-radius: var(--radius-sm);
    padding: var(--s3) var(--s4);
    margin-bottom: var(--s5);
    font-size: .88rem;
    color: var(--text-300);
    line-height: 1.7;
}

/* --------------------------------------------------------------------------
   19. UTILITIES
   -------------------------------------------------------------------------- */

.text-center { text-align: center; }
.lead { font-size: 1.1rem; color: var(--text-700); }
.section-dark .lead { color: var(--text-300); }
.muted { color: var(--text-500); }
.mb-0 { margin-bottom: 0; }
.mt-6 { margin-top: var(--s6); }
.ltr { direction: ltr; unicode-bidi: plaintext; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.prose > h2 { margin-top: var(--s7); }
.prose > h3 { margin-top: var(--s5); }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }

.toc {
    background: var(--paper-alt);
    border: 1px solid var(--paper-line);
    border-radius: var(--radius);
    padding: var(--s4) var(--s5);
    margin-bottom: var(--s6);
}
.toc h2 { font-size: 1rem; margin-bottom: var(--s2); }
.toc ol { margin-bottom: 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }


/* --------------------------------------------------------------------------
   20. MOBILE REFINEMENTS
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
    body { font-size: 16px; }

    /* The desktop hero uses generous vertical space; on a phone that is just
       an empty screen before any content appears. */
    .hero { padding-block: var(--s6) var(--s6); }

    .section { padding-block: var(--s7); }
    .section-sm { padding-block: var(--s6); }

    /* Stacked CTAs should be equal width, not ragged. */
    .btn-row { flex-direction: column; align-items: stretch; }
    .btn-row .btn { width: 100%; }

    /* Give data tables a readable minimum before horizontal scroll kicks in. */
    .data-table { min-width: 520px; font-size: .9rem; }
    .table-scroll {
        margin-inline: calc(var(--s4) * -1);
        padding-inline: var(--s4);
    }

    .stats { padding: var(--s4); gap: var(--s3); }

    .tg-msg { padding: var(--s3) var(--s4); font-size: .9rem; }
    .tg-msg dl { grid-template-columns: 1fr; gap: 0; }
    .tg-msg dt { margin-top: var(--s2); font-size: .82rem; }
    .tg-msg dd { font-weight: 700; }

    .toc { padding: var(--s3) var(--s4); }
    .steps li { padding-inline-start: 46px; }

    .faq-item summary { padding: var(--s3) var(--s4); }
    .faq-answer { padding: 0 var(--s4) var(--s3); }
}

/* Horizontal-scroll affordance for wide tables. */
.table-scroll { position: relative; }
@media (hover: none) {
    .table-scroll::after {
        content: "← برای دیدن ادامه جدول بکشید";
        display: block;
        font-size: .78rem;
        color: var(--text-500);
        padding-block-start: var(--s2);
    }
}

/* --------------------------------------------------------------------------
   21. PENDING-IMAGE PLACEHOLDER
   Renders when a catalogue entry has no file yet (SiteImages.Pending).
   Keeps the layout final so nothing shifts when the real asset lands.
   -------------------------------------------------------------------------- */

.figure-pending { box-shadow: none; border: 0; }

.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    text-align: center;
    min-height: 220px;
    padding: var(--s5);
    border: 2px dashed var(--paper-line);
    border-radius: var(--radius);
    background:
        repeating-linear-gradient(45deg,
            var(--paper-alt) 0, var(--paper-alt) 10px,
            transparent 10px, transparent 20px);
    color: var(--text-500);
}
.placeholder-icon { font-size: 1.8rem; color: var(--gold-deep); line-height: 1; }
.placeholder strong { color: var(--text-700); font-size: .96rem; }
.placeholder-desc { font-size: .88rem; max-width: 46ch; line-height: 1.7; }
.placeholder-file {
    font-size: .8rem;
    background: var(--paper);
    border: 1px solid var(--paper-line);
    border-radius: 6px;
    padding: 3px 9px;
    direction: ltr;
}

.section-dark .placeholder {
    border-color: var(--ink-600);
    background: repeating-linear-gradient(45deg,
        var(--ink-800) 0, var(--ink-800) 10px, transparent 10px, transparent 20px);
    color: var(--text-300);
}
.section-dark .placeholder strong { color: var(--text-100); }
.section-dark .placeholder-file { background: var(--ink-900); border-color: var(--ink-600); }

/* Image gallery — message screenshots side by side */
.img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--s4);
    margin-block: var(--s5);
}
.img-grid figure { margin: 0; }
.img-grid .figure-card img { width: 100%; }

.img-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--s4);
    margin-block: var(--s5);
}
.img-pair figure { margin: 0; }

/* Phone-shaped screenshots read better constrained */
.img-phone { max-width: 320px; margin-inline: auto; }

/* --------------------------------------------------------------------------
   22. TELEGRAM HANDLE LINK
   Every @handle in prose is tappable — a bare handle is a wasted CTA.
   -------------------------------------------------------------------------- */

.tg-handle {
    display: inline-block;
    direction: ltr;
    unicode-bidi: isolate;
    font-weight: 700;
    color: var(--royal);
    text-decoration: none;
    background: var(--royal-dim);
    border: 1px solid rgba(30, 63, 143, .18);
    border-radius: 6px;
    padding: 1px 7px;
    line-height: 1.6;
    transition: background .15s, border-color .15s, color .15s;
}
.tg-handle:hover {
    color: #142C66;
    background: rgba(30, 63, 143, .13);
    border-color: rgba(30, 63, 143, .38);
}
.section-dark .tg-handle,
.hero .tg-handle {
    color: var(--gold);
    background: var(--gold-dim);
    border-color: var(--gold-line);
}
.section-dark .tg-handle:hover,
.hero .tg-handle:hover { color: var(--gold-bright); background: rgba(232,205,142,.2); }

/* --------------------------------------------------------------------------
   23. TELEGRAM MESSAGE BUBBLE + ROTATOR
   Styled to read like an actual SahamBan Telegram message. Built in HTML —
   so every number is real text: crawlable, selectable, reflows on mobile.
   -------------------------------------------------------------------------- */

.tg-stage {
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,.05) 0 2px, transparent 2px),
        linear-gradient(160deg, #17305F, #101F42);
    background-size: 26px 26px, 100% 100%;
    border: 1px solid var(--ink-600);
    border-radius: var(--radius-lg);
    padding: var(--s5) var(--s4);
    position: relative;
}

.tg-bubble {
    background: #FFFFFF;
    border-radius: 14px 14px 14px 4px;
    padding: var(--s4) var(--s4) var(--s3);
    box-shadow: 0 2px 10px rgba(4, 12, 30, .35);
    font-size: .93rem;
    line-height: 1.95;
    color: #1C2333;
    max-width: 430px;
    margin-inline: auto;
}
/* Channel signature line — private-channel messages carry one, public ones don't.
   Telegram assigns each channel its own colour; these match the real screenshots. */
.tg-bubble .b-chan {
    font-weight: 700;
    font-size: .88rem;
    margin: 0 0 2px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.tg-bubble .b-chan.c-gold   { color: #8E5BD0; }   /* سهام بان | طلایی */
.tg-bubble .b-chan.c-orange { color: #1E9BC4; }   /* سهام بان | نارنجی */
.tg-bubble .b-chan.c-queue  { color: #C0392B; }   /* سهام بان | صف فروش */
.tg-bubble .b-chan.c-thresh { color: #2E7D32; }   /* سهام بان | آستانه صف خرید */

.tg-bubble .b-head {
    font-weight: 700;
    font-size: .97rem;
    margin-bottom: 2px;
    letter-spacing: -.01em;
    line-height: 1.7;
}
/* SahamBan brackets the title with a mirrored pair of markers: 🟢🟢🟡…🟡🟢🟢 */
.tg-bubble .b-dots { letter-spacing: -1px; font-size: 1.02em; vertical-align: -1px; }
/* the hashtag is a Telegram link; the ordinal before it is plain text */
.tg-bubble .b-tag { color: #1A73C7; font-weight: 700; }
.tg-bubble .b-sym { color: #1A73C7; font-weight: 700; }
.tg-bubble .b-market { color: #7C879B; font-weight: 400; font-size: .88em; }
.tg-bubble .b-row { margin: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.tg-bubble .b-row .k { color: #45506A; }
.tg-bubble .b-row .v {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    direction: ltr; unicode-bidi: plaintext;
}
.tg-bubble .b-gap { height: 10px; }
.tg-bubble .b-foot {
    margin-top: 8px;
    font-size: .85rem;
    color: #5C6880;
    display: flex; flex-wrap: wrap; gap: 4px 14px;
}
.tg-bubble .b-foot .v { direction: ltr; unicode-bidi: plaintext; font-variant-numeric: tabular-nums; }
.tg-bubble .b-foot a { color: #1A73C7; text-decoration: none; font-weight: 600; }
.tg-bubble .b-foot a:hover { text-decoration: underline; }

/* Inside a message bubble a handle should read as a Telegram link, not a chip. */
.tg-bubble .tg-handle {
    background: none;
    border: 0;
    padding: 0;
    color: #1A73C7;
    font-weight: 600;
}
.tg-bubble .tg-handle:hover { background: none; text-decoration: underline; }
.tg-bubble .b-score { font-weight: 700; color: var(--up-deep); }

/* --- rotator chrome --- */
.tg-slide[hidden] { display: none; }
.tg-slide { animation: tgFade .45s ease both; }
@keyframes tgFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tg-slide { animation: none; } }

.tg-cta {
    margin-top: var(--s4);
    text-align: center;
    max-width: 430px;
    margin-inline: auto;
}
.tg-cta .tg-cta-note {
    color: var(--text-300);
    font-size: .9rem;
    margin-bottom: var(--s3);
    min-height: 2.6em;
}
.tg-cta .btn { width: 100%; }

.tg-dots {
    display: flex;
    direction: rtl;          /* first dot sits on the right, matching reading order */
    justify-content: center;
    gap: var(--s2);
    margin-top: var(--s4);
}
.tg-dots button {
    width: 9px; height: 9px; padding: 0;
    border-radius: 50%;
    border: 1px solid var(--gold-line);
    background: transparent;
    cursor: pointer;
    transition: background .2s, transform .2s, width .2s;
}
.tg-dots button[aria-selected="true"] {
    background: var(--gold);
    border-color: var(--gold);
    width: 26px; border-radius: 5px;
}
.tg-dots button:hover { background: var(--gold-dim); }

.tgm-stage { position: relative; }
.tg-stage-label {
    position: absolute;
    inset-block-start: -11px;
    inset-inline-start: var(--s5);
    background: var(--ink-900);
    border: 1px solid var(--gold-line);
    color: var(--gold);
    font-size: .78rem;
    font-weight: 700;
    padding: 2px 12px;
    border-radius: 999px;
}

@media (max-width: 640px) {
    .tg-stage { padding: var(--s5) var(--s3) var(--s4); }
    .tg-bubble { font-size: .88rem; padding: var(--s3); }
}

/* --------------------------------------------------------------------------
   24. TELEGRAM MESSAGE COMPONENT (_TgMessage)
   Ported from Samples/telegram_messages.html supplied by SahamBan.
   Rendered as HTML rather than a screenshot: numbers stay crawlable and the
   bubble reflows on a phone.
   -------------------------------------------------------------------------- */

.tgm { width: 100%; max-width: 380px; }
.tgm-bubble {
    background: #fff;
    border: 2px solid #3390EC;
    border-radius: 16px 16px 4px 16px;
    padding: 11px 13px 7px;
    box-shadow: 0 1px 1.5px rgba(0,0,0,.1);
    line-height: 1.6;
    font-size: 14.2px;
    color: #000;
    word-wrap: break-word;
    direction: rtl;
}

/* channel signature — LTR, sits on the left, coloured per channel */
.tgm-head {
    display: flex; align-items: center; gap: 5px;
    margin-bottom: 5px; flex-wrap: wrap;
    direction: ltr; justify-content: flex-start;
}
.tgm-head .tgm-title { font-weight: 700; font-size: 14.8px; direction: ltr; unicode-bidi: embed; }
.tgm-head .tgm-emoji { font-size: 15px; }
.tgm-head.t-purple .tgm-title { color: #7B5CE6; }
.tgm-head.t-teal   .tgm-title { color: #1E9BC4; }
.tgm-head.t-red    .tgm-title { color: #C0392B; }
.tgm-head.t-green  .tgm-title { color: #2E7D32; }
.tgm-head.t-blue   .tgm-title { color: #2A63B5; }
.tgm-head.t-amber  .tgm-title { color: #B07A0C; }

/* title line — markers bracket the hashtag on both sides */
.tgm-group-title {
    display: flex; align-items: center; justify-content: flex-start;
    gap: 3px; margin: 3px 0 7px; flex-wrap: wrap;
    font-weight: 600; font-size: 14.5px; text-align: right; direction: rtl;
}
.tgm-dots { display: inline-flex; gap: 1px; letter-spacing: -1.5px; }

.tgm-hashtag { color: #3390EC; font-weight: 600; text-decoration: none; }
a.tgm-hashtag:hover { text-decoration: underline; }
.tgm-stock { display: block; margin-bottom: 5px; direction: rtl; text-align: right; }
.tgm-market { color: #000; font-weight: 400; }

.tgm-line { margin: 2px 0; text-align: right; direction: rtl; unicode-bidi: embed; }
.tgm-b { font-weight: 700; font-variant-numeric: tabular-nums; }
.tgm-spacer { height: 6px; }
.tgm-note { color: #45506A; }

.tgm-neg { color: #E53935; }
.tgm-pos { color: #43A047; }

.tgm-score {
    display: flex; align-items: center; justify-content: flex-start;
    gap: 5px; margin: 11px 0 3px;
    font-weight: 600; font-size: 14.5px; direction: rtl; text-align: right;
}
.tgm-score .tgm-rocket { font-size: 17px; }

.tgm-foot {
    margin-top: 9px; padding-top: 5px;
    display: flex; flex-direction: column; gap: 1px;
    font-size: 12.2px; color: #707579;
}
.tgm-when {
    display: flex; align-items: center; gap: 5px;
    direction: ltr; justify-content: flex-start; unicode-bidi: embed;
}
.tgm-when .tgm-icon { font-size: 12.5px; opacity: .9; }
.tgm-ids { display: flex; flex-direction: column; gap: 1px; margin-top: 3px; }
.tgm-id {
    color: #8E44AD; text-decoration: none; font-size: 12.8px;
    display: inline-flex; align-items: center; gap: 4px;
    direction: ltr; unicode-bidi: embed;
}
.tgm-id:hover { text-decoration: underline; color: #8E44AD; }
.tgm-id-badge {
    background: #8E44AD; color: #fff; font-size: 9px; font-weight: 700;
    padding: 1px 3.5px; border-radius: 3px; letter-spacing: .2px; line-height: 1.3;
}

/* stage: the chat-like ground the bubbles sit on */
.tgm-stage {
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,.05) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,.05) 1px, transparent 1px),
        linear-gradient(160deg, #17305F, #101F42);
    background-size: 40px 40px, 40px 40px, 100% 100%;
    border: 1px solid var(--ink-600);
    border-radius: var(--radius-lg);
    padding: var(--s5) var(--s4);
    display: flex; flex-direction: column; align-items: center; gap: var(--s4);
}
.tgm-stage .tgm { margin-inline: auto; }

/* a row of bubbles, e.g. the four sell-queue steps */
.tgm-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--s4);
    align-items: start;
    margin-block: var(--s5);
}
.tgm-row .tgm { max-width: none; }

@media (max-width: 640px) {
    .tgm-bubble { font-size: 13.4px; padding: 10px 11px 6px; }
    .tgm-stage { padding: var(--s4) var(--s3); }
}
.tgm-arrow { color: #2ECC71; font-size: 14px; margin: 0 2px; }

/* --------------------------------------------------------------------------
   25. QUEUE DEPLETION STEPS
   Shows the queue SHRINKING — deliberately not a price chart. In a sell queue
   the price never moves; only the resting volume changes.
   -------------------------------------------------------------------------- */

.queue-steps { display: grid; gap: var(--s3); margin-block: var(--s5); }
.qstep {
    background: var(--paper);
    border: 1px solid var(--paper-line);
    border-inline-start: 4px solid #8B5CF6;
    border-radius: var(--radius);
    padding: var(--s4) var(--s5);
}
.qstep.is-done { border-inline-start-color: var(--up-deep); }
.qstep-head { font-weight: 700; margin-bottom: var(--s2); display: flex; align-items: center; gap: var(--s2); }
.qstep-dots { letter-spacing: -1.5px; }
.qstep p { font-size: .95rem; color: var(--text-700); }

.qbar {
    block-size: 14px;
    background: repeating-linear-gradient(45deg,
        var(--paper-alt) 0, var(--paper-alt) 6px, #EDF0F7 6px, #EDF0F7 12px);
    border: 1px solid var(--paper-line);
    border-radius: 7px;
    overflow: hidden;
    margin-bottom: var(--s3);
}
.qbar span {
    display: block;
    block-size: 100%;
    background: linear-gradient(90deg, #8B5CF6, #6D3FD6);
    border-radius: 7px 0 0 7px;
    transition: inline-size .4s ease;
}
.qstep.is-done .qbar { border-color: rgba(31,135,46,.35); }

@media (min-width: 760px) {
    .queue-steps { grid-template-columns: repeat(2, 1fr); }
}
