        /* r276 — the palette lives in theme.css and only there.
           This block used to redeclare it, and because a template's <style>
           comes AFTER the stylesheet link it won every token at equal
           specificity — for the whole page, theme.css's own toast, pagination
           and modal components included. The darks and the greys had drifted:
           theme.css picked a cooler ink deliberately and says so in its own
           comment, and every template was quietly putting the warmer one back.
           r274 did this for buyer.html; r276 finished the other nine.
           Every token dropped here is defined in its :root. */
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
        /* Sticky footer: full-height flex column so #footer sits at the bottom
           of the viewport regardless of which tab (short or tall) is open.
           The fixed header + fixed modals/toast are out of flow, so this only
           orders the in-flow hero -> content-area -> footer. */
        body { font-family: 'IRANYekanX', sans-serif; color: var(--dark-primary); background: var(--gray-50); line-height: 1.7; display: flex; flex-direction: column; min-height: 100vh; }
        a { text-decoration: none; color: inherit; } button { font-family: inherit; border: none; cursor: pointer; outline: none; }
        .header { position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-dropdown); padding: 16px; transition: padding 0.3s; }
        .header-container { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.6); box-shadow: 0 4px 20px rgba(0,0,0,0.03); border-radius: var(--r-bar); padding: 10px 16px; }
        @media (min-width: 768px) { .header-container { padding: 12px 32px; border-radius: var(--r-pill); } }
        .logo-img { height: 32px; }
        .header-actions { display: flex; gap: 8px; }
        .hbtn { padding: 10px 20px; font-size: var(--fs-small); font-weight: 700; border-radius: var(--r-pill); transition: all 0.25s; }
        .hbtn-o { color: var(--dark-secondary); background: transparent; } .hbtn-o:hover { background: var(--gold-lighter); }
        .hbtn-p { background: var(--gold-primary); color: var(--btn-ink); }
        .page-hero { padding: 120px 0 40px; background: linear-gradient(165deg, #fffef5 0%, #fef9e7 40%, var(--white) 100%); text-align: center; }

        /* ===== Header icon-only buttons (round 69) =====
           Replaces the old text "خروج" / "صفحه اصلی" buttons. All three
           header actions (notifications, home, logout) are 38px circular
           icon buttons, sharing the same hover/active state. */
        .header-actions { display: flex; gap: 8px; align-items: center; }
        .hicon {
            width: 38px; height: 38px;
            display: inline-flex; align-items: center; justify-content: center;
            background: transparent;
            border: none;
            border-radius: 50%;
            color: var(--dark-secondary);
            cursor: pointer;
            transition: background 0.2s, color 0.2s, transform 0.15s;
            position: relative;
            text-decoration: none;
        }
        .hicon:hover { background: var(--gold-lighter); color: var(--dark-primary); }
        .hicon:active { transform: scale(0.95); }
        .hicon svg { width: 19px; height: 19px; }
        /* r432: the header icons are the hand-drawn set; the Freehand line reads at 22px */
        .hicon svg.icu { width: 22px; height: 22px; }
        /* r402: theme.css gives every <button> a 44px min-height on phones, which made
           the button icons 38x44 ovals beside a 38x38 link. All round, all 44px there. */
        @media (max-width: 640px) { .hicon { width: 44px; height: 44px; } }

        /* Wrapper for the bell so the dropdown can position relative to it */
        .hicon-wrap { position: relative; }

        /* Red dot indicator for unread announcement */
        .hicon-dot {
            position: absolute;
            top: 7px;
            inset-inline-end: 8px;
            width: 9px; height: 9px;
            background: var(--red-primary);
            border: 2px solid var(--white);
            border-radius: 50%;
            pointer-events: none;
        }

        /* ===== Notification center (round 99b) =====
           One panel for everything: admin announcements + ticket replies.
           Desktop: popover under the bell. Mobile: bottom sheet. */
        .ann-dropdown {
            position: absolute;
            top: calc(100% + 10px);
            inset-inline-end: 0;
            width: 380px;
            max-width: calc(100vw - 32px);
            background: var(--white);
            border: 1px solid var(--gray-200, #e5e5e5);
            border-radius: var(--r-card);
            box-shadow: 0 10px 36px rgba(0, 0, 0, 0.10);
            z-index: 1100;
            opacity: 0;
            transform: translateY(-6px);
            pointer-events: none;
            transition: opacity 0.18s ease, transform 0.18s ease;
            overflow: hidden;
        }
        .ann-dropdown.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
        .ann-sheet-handle { display: none; }
        .ann-dropdown-head {
            display: flex; align-items: center; gap: 8px;
            padding: 14px 18px 12px;
            border-bottom: 1px solid var(--gray-100);
        }
        .ann-dropdown-title { font-weight: 800; font-size: var(--fs-body); color: var(--dark-primary); }
        .ntf-count {
            background: var(--gold-bg, #fdf6e3);
            color: var(--gold-deep);
            border: 1px solid var(--gold-light, #f5d76e);
            font-size: var(--fs-caption); font-weight: 800;
            padding: 2px 8px; border-radius: var(--r-pill);
        }
        .ann-dropdown-close {
            margin-inline-start: auto;
            width: 28px; height: 28px;
            flex-shrink: 0;
            padding: 0;
            background: transparent; border: none; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer; color: var(--dark-muted);
            transition: background 0.15s;
        }
        .ann-dropdown-close:hover { background: var(--gray-100); }
        .ann-dropdown-close svg { width: 12px; height: 12px; }
        .ann-dropdown-body { padding: 6px 0 8px; max-height: 62vh; overflow-y: auto; }
        .ann-dropdown-empty {
            text-align: center; color: var(--dark-muted);
            font-size: var(--fs-small); padding: 34px 16px;
            font-weight: 500;
        }

        /* One notification row */
        .ntf-row {
            display: flex; gap: 12px; align-items: flex-start;
            padding: 13px 18px;
            cursor: pointer;
            transition: background 0.12s;
            position: relative;
        }
        .ntf-row + .ntf-row { border-top: 1px solid var(--gray-100); }
        .ntf-row:hover { background: var(--gray-50, var(--gray-50)); }
        .ntf-icon {
            width: 36px; height: 36px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: 0.95rem; flex-shrink: 0;
            background: var(--gold-bg, #fdf6e3);
        }
        .ntf-row.lvl-warning .ntf-icon { background: var(--red-light); }
        .ntf-row.lvl-success .ntf-icon { background: var(--green-light); }
        .ntf-row.lvl-ticket  .ntf-icon { background: #eff6ff; }
        .ntf-icon .icu { width: 22px; height: 22px; vertical-align: 0; margin: 0; color: var(--dark-primary); }
        .ntf-content { flex: 1; min-width: 0; }
        .ntf-text {
            font-size: var(--fs-small); line-height: 1.85; font-weight: 500;
            color: var(--dark-primary);
            white-space: pre-wrap; word-break: break-word;
        }
        .ntf-meta {
            margin-top: 3px; font-size: var(--fs-caption); font-weight: 500;
            color: var(--dark-muted);
            display: flex; align-items: center; gap: 8px;
        }
        .ntf-action { color: var(--gold-deep); font-weight: 700; }
        /* Unread marker: small dot on the reading edge, vertically centered */
        .ntf-unread-dot {
            width: 7px; height: 7px; border-radius: 50%;
            background: var(--gold-primary, var(--gold-primary));
            flex-shrink: 0; align-self: center;
        }
        .ntf-row.is-read .ntf-text { color: var(--dark-muted); font-weight: 400; }
        .ntf-row.is-read .ntf-icon { opacity: 0.65; }

        @media (max-width: 600px) {
            /* Standard bottom sheet on phones */
            .ann-dropdown {
                position: fixed;
                top: auto; bottom: 0;
                inset-inline-start: 0; inset-inline-end: 0;
                width: auto; max-width: none;
                border: none;
                border-radius: 24px 24px 0 0;
                padding-bottom: env(safe-area-inset-bottom, 8px);
                transform: translateY(100%);
                box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.4);
                transition: transform 0.25s ease, opacity 0.2s ease;
            }
            .ann-dropdown.open { transform: translateY(0); }
            .ann-sheet-handle {
                display: block;
                width: 40px; height: 4px;
                background: var(--gray-200, #e5e5e5);
                border-radius: var(--r-pill);
                margin: 10px auto 0;
            }
            .ann-dropdown-body { max-height: 55vh; }
            .ntf-row { padding: 15px 18px; }
        }

        .page-title { font-size: clamp(1.6rem, 5vw, 2.4rem); font-weight: 900; margin-bottom: 8px; }
        .page-title span { color: var(--gold-primary); }
        .stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 700px; margin: 32px auto 0; }
        @media (min-width: 600px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
        .stat-card { background: var(--white); padding: 20px 16px; border-radius: var(--r-card, 24px); box-shadow: 0 4px 20px rgba(0,0,0,0.04); border: 1px solid var(--gray-100); text-align: center; }
        /* r381: seller icons = Streamline Freehand Color (CC BY 4.0, streamlinehq.com),
           blue re-inked in brand gold (.fa). Tabs are inline (pathLength="1" is left from
           the r381 pen-trace hover, which r607 replaced with dock-motion.css); everything
           else uses the #icSprite symbols. */
        .ic { display: inline-flex; line-height: 0; }
        .tab .ic svg { width: 20px; height: 20px; }
        /* r384: every seller icon's line matches the weight of the bold text next
           to it — the plain Freehand line is about half as heavy. Tabs: a 1px
           screen-space ink stroke. Sprite icons: the same through --ic-sw, in
           symbol units (24-unit viewBox). */
        .icu { width: 1.25em; height: 1.25em; vertical-align: -0.3em; flex-shrink: 0; margin-inline-end: 1px; }
        .stat-icon .icu { width: 34px; height: 34px; color: #2b2f3a; vertical-align: 0; }
        /* r383: the four hero stats get a coloured tile each — products violet,
           sales green, revenue gold, wallet blue. Ink = the deep shade, the Freehand
           second colour = the bright one, plus a little stroke for weight. */
        .page-hero .stat-icon {
            width: 60px; height: 60px; margin: 0 auto 10px; border-radius: var(--r-field);
            display: flex; align-items: center; justify-content: center;
            background: linear-gradient(145deg, var(--t1), var(--t2));
            box-shadow: 0 6px 14px -6px var(--tc), inset 0 0 0 1px rgba(255,255,255,.6);
            color: var(--tc); transform: rotate(-4deg);
            transition: transform .25s var(--ease-out, ease);
        }
        /* r601: hover only with a real pointer — a tap would leave it stuck on */
        @media (hover: hover) and (pointer: fine) { .page-hero .stat-card:hover .stat-icon { transform: rotate(3deg) scale(1.06); } }
        .page-hero .stat-icon .icu { width: 36px; height: 36px; color: var(--tc); --ic-acc: var(--tc); --ic-sw: .9px; vertical-align: 0; }
        /* r400: money-bag, wallet and receipt are drawn edge to edge of their 24-unit
           box, and the --ic-sw ink stroke spills ~0.7px past it. An svg (and the
           <symbol> a <use> instantiates) clips to its box by default, so the top and
           bottom of those icons were sliced off by a straight "invisible line". */
        .page-hero .stat-icon .icu, #icSprite symbol { overflow: visible; }
        .page-hero .stat-card:nth-child(1) { --t1: #f3e8ff; --t2: #ddd6fe; --tc: #6d28d9; --ta: #a78bfa; }
        .page-hero .stat-card:nth-child(2) { --t1: #dcfce7; --t2: #bbf7d0; --tc: var(--green-dark); --ta: #34d399; }
        .page-hero .stat-card:nth-child(3) { --t1: #fef9c3; --t2: #fde68a; --tc: var(--gold-deep); --ta: var(--gold-primary); }
        .page-hero .stat-card:nth-child(4) { --t1: #e0f2fe; --t2: #bfdbfe; --tc: var(--blue-dark); --ta: #60a5fa; }
        @media (prefers-reduced-motion: reduce) { .page-hero .stat-icon { transition: none; } }
        /* r601: the four stats sit in one glass strip, in the PC dock's language
           (pc-dock.css): the same glass, sheen and lit rim, over a soft glow of the
           four stat colours so the glass has something to show. A row of four from
           760px; on phones the same glass holds them two by two. */
        .page-hero { position: relative; overflow: hidden; isolation: isolate; padding: 96px 0 26px; }
        .page-hero::before {
            /* r647: no filter: blur(40px) (see buyer.html): it made Safari repaint ~1M
               pixels per frame at 3x during a tab switch. Softer, wider gradients instead. */
            content: ""; position: absolute; inset: -20% -10% 0; z-index: -1; pointer-events: none;
            background:
                radial-gradient(37% 54% at 82% 62%, rgba(167, 139, 250, .36), rgba(167, 139, 250, .15) 40%, rgba(167, 139, 250, 0) 100%),
                radial-gradient(35% 54% at 60% 78%, rgba(52, 211, 153, .28), rgba(52, 211, 153, .12) 40%, rgba(52, 211, 153, 0) 100%),
                radial-gradient(35% 54% at 40% 70%, rgba(245, 184, 0, .32), rgba(245, 184, 0, .14) 40%, rgba(245, 184, 0, 0) 100%),
                radial-gradient(37% 54% at 18% 62%, rgba(96, 165, 250, .32), rgba(96, 165, 250, .14) 40%, rgba(96, 165, 250, 0) 100%);
        }
        .page-hero .page-title { font-size: 1.7rem; margin-bottom: 0; }
        .page-hero .stats-grid {
            position: relative; isolation: isolate;
            grid-template-columns: repeat(2, 1fr); gap: 0; max-width: min(880px, calc(100% - 8px)); margin: 20px auto 0; padding: 8px; border-radius: 26px;
            background: rgba(255, 255, 255, .55);
            -webkit-backdrop-filter: blur(14px) saturate(190%) brightness(1.04); backdrop-filter: blur(14px) saturate(190%) brightness(1.04);
            border: 1px solid rgba(255, 255, 255, .6);
            box-shadow: 0 12px 32px -10px rgba(31, 41, 55, .18), 0 2px 6px rgba(31, 41, 55, .05), inset 0 1px 0 rgba(255, 255, 255, .9);
        }
        .page-hero .stats-grid::after {
            content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
            background: linear-gradient(180deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 45%);
            box-shadow: inset 1.2px 1.2px 0 -.2px rgba(255, 255, 255, .95), inset -1px -1px 0 -.2px rgba(255, 255, 255, .55);
        }
        .page-hero .stat-card {
            position: relative; min-width: 0; background: none; border: 0; box-shadow: none; border-radius: 18px; padding: 10px 10px;
            display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; text-align: start;
            transition: background-color .25s;
        }
        @media (hover: hover) and (pointer: fine) { .page-hero .stat-card:hover { background: rgba(255, 255, 255, .5); } }
        /* hairlines between the stats: beside each one that has a neighbour before it
           in its row, and above the second row */
        .page-hero .stat-card:nth-child(even)::before, .page-hero .stat-card:nth-child(n+3)::after {
            content: ""; position: absolute; background: rgba(31, 41, 55, .1);
        }
        .page-hero .stat-card:nth-child(even)::before { inset-inline-start: 0; top: 22%; bottom: 22%; width: 1px; }
        .page-hero .stat-card:nth-child(n+3)::after { top: 0; inset-inline: 12%; height: 1px; }
        .page-hero .stat-icon { grid-row: 1 / 3; width: 40px; height: 40px; margin: 0; border-radius: var(--r-sm); }
        .page-hero .stat-icon .icu { width: 24px; height: 24px; }
        .page-hero .stat-label { grid-column: 2; grid-row: 1; align-self: end; margin: 0; }
        .page-hero .stat-num { grid-column: 2; grid-row: 2; align-self: start; font-size: 1.1rem; line-height: 1.25; white-space: nowrap; }
        @media (min-width: 760px) {
            .page-hero { padding: 104px 0 36px; }
            .page-hero .page-title { font-size: 1.9rem; }
            .page-hero .stats-grid { grid-template-columns: repeat(4, 1fr); max-width: min(880px, calc(100% - 32px)); margin-top: 26px; padding: 10px; border-radius: var(--r-bar); }
            .page-hero .stat-card { border-radius: 22px; padding: 10px 16px; column-gap: 14px; }
            .page-hero .stat-card:nth-child(n+3)::after { display: none; }
            .page-hero .stat-card + .stat-card::before {
                content: ""; position: absolute; background: rgba(31, 41, 55, .1);
                inset-inline-start: 0; top: 22%; bottom: 22%; width: 1px;
            }
            .page-hero .stat-icon { width: 48px; height: 48px; border-radius: var(--r-btn); }
            .page-hero .stat-icon .icu { width: 28px; height: 28px; }
            .page-hero .stat-num { font-size: 1.35rem; line-height: 1.2; }
        }
        /* r601: less transparency or more contrast asked for: the strip goes solid */
        @media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
            .page-hero .stats-grid { background: rgba(255, 255, 255, .97); -webkit-backdrop-filter: none; backdrop-filter: none; }
        }
        @media (prefers-contrast: more) { .page-hero .stats-grid { border-color: rgba(31, 41, 55, .45); } }
        /* the smallest phones (320px): a seven-digit sum still fits beside its tile */
        @media (max-width: 380px) {
            .page-hero .stat-card { padding: 8px 6px; column-gap: 8px; }
            .page-hero .stat-icon { width: 32px; height: 32px; border-radius: 10px; }
            .page-hero .stat-icon .icu { width: 20px; height: 20px; }
            .page-hero .stat-num { font-size: var(--fs-body); }
        }
        :is(.form-card-title, .modal-title) > .icu { width: 1.2em; height: 1.2em; vertical-align: -0.25em; color: var(--dark-primary); margin-inline-end: 2px; }
        .submit-btn .icu { --ic-acc: currentColor; }
        /* r382: the product-card pills are small, and the thin Freehand line almost
           vanished there — bigger icon, plus an ink stroke (--ic-sw) that thickens
           every line. The stroke is opt-in so other buttons keep the plain line. */
        .pc-link .icu, .private-badge .icu { width: 20px; height: 20px; --ic-sw: 1.1px; vertical-align: 0; }
        .pc-link-coupon .icu { --ic-acc: currentColor; }
        .stat-icon { font-size: 1.5rem; margin-bottom: 8px; } .stat-num { font-size: 1.4rem; font-weight: 900; } .stat-label { font-size: var(--fs-caption); color: var(--dark-muted); font-weight: 600; margin-top: 4px; }
        .content-area { max-width: 1000px; margin: 0 auto; padding: 32px 16px 80px; flex: 1 0 auto; width: 100%; }
        /* r407: the footer used to sit at the bottom of the screen on a short tab
           (تشخیص, a loading تیکت‌ها) and below the fold on a tall one, so switching
           tabs moved it up and down. The content area is now always at least one
           screen tall: the footer starts below the fold on every tab and is only
           ever reached by scrolling to the end. */
        .content-area { min-height: 100vh; min-height: 100dvh; }
        /* r738: desktop - drop that minimum; a short tab left a big empty band
           above the footer (owner). Phones keep it. */
        @media (min-width: 900px) { .content-area { min-height: 0; } }
        /* Tab bar — centered pill bar with subtle background */
        .tabs-wrap {
            display: flex;
            justify-content: center;
            margin-bottom: 32px;
        }
        .tabs {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 2px;
            padding: 6px;
            background: var(--white);
            border: 1px solid var(--gray-200);
            border-radius: var(--r-field);
            scrollbar-width: none;
            max-width: 100%;
            box-shadow: var(--shadow-sm);
        }
        .tabs::-webkit-scrollbar { display: none; }
        .tab {
            white-space: nowrap;
            padding: 10px 16px;
            background: transparent;
            border: 0;
            border-radius: var(--r-sm);
            font-weight: 700;
            font-size: var(--fs-small);
            color: var(--dark-muted);
            transition: background 0.18s var(--ease-out), color 0.18s var(--ease-out);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            cursor: pointer;
            min-height: 40px;
            position: relative;
        }
        .tab svg { width: 17px; height: 17px; flex-shrink: 0; stroke: currentColor; }
        .tab:hover {
            background: var(--gold-bg);
            color: var(--gold-deep);
        }
        .tab.active {
            background: var(--gold-primary);
            color: var(--btn-ink);
            box-shadow: 0 2px 10px rgba(245, 184, 0, 0.30);
        }
        .tab.active svg { color: var(--white); }
        /* r400: eight tabs needed 1011px and the row has 968px at most (content-area
           is 1000px), so تنظیمات always sat alone on a second line. From 1000px up
           a tighter tab fits them; below that (to the phone bar at 640px) the icons
           go and the row scrolls sideways rather than wrapping. */
        @media (min-width: 640.02px) {
            .tabs { flex-wrap: nowrap; overflow-x: auto; }
            .tab { padding: 10px 12px; gap: 6px; }
        }
        @media (min-width: 640.02px) and (max-width: 999px) {
            .tabs-wrap { justify-content: flex-start; }
            .tabs { justify-content: flex-start; margin-inline: auto; }
            .tab { padding: 9px 11px; font-size: var(--fs-small); }
            .tab > .ic { display: none; }
        }
        @media (max-width: 720px) {
            .tabs-wrap { justify-content: center; }
            .tabs { border-radius: var(--r-field); padding: 5px; gap: 1px; }
            .tab { padding: 9px 12px; font-size: var(--fs-small); min-height: 38px; }
            .tab svg { width: 16px; height: 16px; }
        }
        /* r400: the last 80px before the phone bar — the rule above puts the padding
           back up, and eight labels then overflowed by up to 73px */
        @media (min-width: 640.02px) and (max-width: 720px) {
            .tab { padding: 8px 8px; font-size: var(--fs-meta); }
        }
        /* r401: on the phone bar a slot is 55-69px and «محصول جدید» is 68px (and «تشخیص خریدار» longer) — it was cut
           to «محصول ج…» and the active bubble's rim sat on the text. The bar says «جدید»
           beside the + icon; the tab row, the sheet and the tour keep the full name. */
        /* r599: the SMS tab (r593) made nine tabs, about 1030px, and the row has 966px
           at most. Centred, the row spilled past both ends: محصولات was cut on the
           right and could not be scrolled to at all. On PC it now starts at the right,
           scrolls sideways (the mouse wheel too), and fades the edge where more tabs
           wait; when they all fit, .tabs-wrap still centres the row. The phone bar
           (≤640px) is untouched. */
        @media (min-width: 640.02px) {
            .tabs { justify-content: flex-start; overscroll-behavior-x: contain; }
            .tabs::before, .tabs::after {
                content: ""; position: sticky; z-index: 2; flex: 0 0 40px; align-self: stretch;
                pointer-events: none; opacity: 0; transition: opacity 0.2s var(--ease-out);
            }
            .tabs::before { inset-inline-start: 0; margin-inline-end: -42px; border-radius: var(--r-sm);
                background: linear-gradient(to left, var(--white) 25%, rgba(255, 255, 255, 0)); }
            .tabs::after { inset-inline-end: 0; margin-inline-start: -42px; border-radius: var(--r-sm);
                background: linear-gradient(to right, var(--white) 25%, rgba(255, 255, 255, 0)); }
            .tabs.more-start::before, .tabs.more-end::after { opacity: 1; }
        }
        .tab .lbl-bar { display: none; }
        @media (max-width: 640px) and (min-height: 421px) {
            .has-bnav .bnav > .tab > .lbl-full { display: none !important; }
            .has-bnav .bnav > .tab > .lbl-bar { display: block; }
        }
        @media (max-width: 480px) {
            .tab span:not(.ic):not(.tab-badge) { display: none; } /* r385: r381 wrapped the icon in span.ic — a bare `.tab span` hid it on phones. r393: and the count badge is a span too */
            .tab { padding: 9px 10px; min-width: 38px; }
            .tab svg { width: 18px; height: 18px; }
        }
        .tab-content { display: none; animation: fadeIn 0.3s; } .tab-content.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

        /* Notification badge on a tab (e.g. answered tickets).
           ALWAYS absolutely positioned so showing/hiding it never changes
           the tab's width — previously it was inline and pushed the tab
           bar onto a second line whenever a ticket arrived. */
        .tab { position: relative; }
        .tab-badge {
            position: absolute;
            top: 3px;
            inset-inline-end: 4px;
            background: var(--red-strong);
            color: var(--white);
            font-size: 0.62rem;
            font-weight: 800;
            min-width: 16px;
            height: 16px;
            border-radius: var(--r-pill);
            /* r393: IRANYekanX digits sit ~0.09em above the centre of a
               flex-centred line box (10 units above the baseline, 4 below,
               digit ink entirely above); 0.18em of top padding moves the
               digit down by half that and centres it. */
            padding: 0.18em 4px 0;
            box-sizing: border-box;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            box-shadow: 0 0 0 2px var(--white);
            pointer-events: none;
        }

        /* ===== Admin broadcast banner ===== */
        .ann-banner {
            position: relative;
            display: flex; gap: 14px; align-items: flex-start;
            padding: 14px 48px 14px 18px;     /* extra space on left for the X */
            margin: 0 0 18px;
            border-radius: var(--r-field);
            border: 1px solid;
            font-size: var(--fs-body); line-height: 1.85;
            animation: ann-slide-in 0.35s ease-out;
        }
        @keyframes ann-slide-in {
            from { opacity: 0; transform: translateY(-8px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        .ann-banner-icon { font-size: 1.4rem; flex-shrink: 0; line-height: 1; }
        .ann-banner-body { flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-word; }
        .ann-banner-close {
            position: absolute; left: 10px; top: 10px;
            width: 28px; height: 28px;
            border: 0; background: transparent; cursor: pointer;
            border-radius: var(--r-xs);
            display: flex; align-items: center; justify-content: center;
            opacity: 0.6; transition: all 0.15s;
            font-family: inherit;
        }
        .ann-banner-close:hover { opacity: 1; background: rgba(0,0,0,0.06); }
        .ann-banner-close svg { width: 14px; height: 14px; }
        /* Per-level color variants — pick from the existing palette */
        .ann-info    { background: var(--gold-bg);    border-color: var(--gold-light);   color: #8a6308; }
        .ann-warning { background: var(--red-light);           border-color: #fca5a5;             color: var(--red-dark); }
        .ann-success { background: var(--green-light);border-color: #6ee7b7;             color: var(--green-dark); }

        /* Ticket list rows + message thread */
        .ticket-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            padding: 14px 16px;
            background: var(--white);
            border: 1px solid var(--gray-100);
            border-radius: var(--r-field);
            margin-bottom: 8px;
            cursor: pointer;
            transition: border-color 0.15s, box-shadow 0.15s;
        }
        .ticket-row:hover { border-color: var(--gold-light); box-shadow: 0 4px 14px rgba(0,0,0,0.05); }
        .ticket-row-subject { font-weight: 800; color: var(--dark-primary); font-size: var(--fs-body); }
        .ticket-row-meta { font-size: var(--fs-caption); color: var(--dark-muted); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
        .ticket-status-pill {
            padding: 3px 10px; border-radius: var(--r-pill);
            font-size: var(--fs-caption); font-weight: 800; white-space: nowrap;
        }
        .tst-open     { background: var(--gold-lighter); color: var(--gold-deep); }
        .tst-answered { background: var(--green-light); color: var(--green-dark); }
        .tst-closed   { background: var(--gray-100); color: var(--dark-muted); }
        .tcat-pill {
            display: inline-block; padding: 2px 9px; border-radius: var(--r-pill);
            font-size: var(--fs-caption); font-weight: 800;
            background: var(--gray-100); color: var(--dark-secondary);
        }
        .ticket-thread {
            display: flex; flex-direction: column; gap: 10px;
            margin: 14px 0; max-height: 340px; overflow-y: auto; padding: 4px;
        }
        .tmsg {
            padding: 10px 14px; border-radius: var(--r-field);
            font-size: var(--fs-small); line-height: 1.8;
            white-space: pre-line; max-width: 85%;
        }
        .tmsg-seller {
            background: var(--gold-bg); border: 1px solid var(--gold-light);
            /* The "tail" is the corner closest to the speaker. align-self:
               flex-end puts the bubble at the inline-end side, so the tail
               sits at the bottom-inline-end corner. Using the logical
               border-end-end-radius keeps this correct in RTL and LTR. */
            align-self: flex-end; border-end-end-radius: 4px;
        }
        .tmsg-admin {
            background: var(--gray-50); border: 1px solid var(--gray-100);
            align-self: flex-start; border-end-start-radius: 4px;
        }
        .tmsg-meta { font-size: var(--fs-caption); color: var(--dark-muted); margin-bottom: 4px; font-weight: 700; }
        /* r337 — the tickets tab holds two lists. .tk-views borrows the wallet's
           sub-tab look (r313); the compound selector is what beats .wtx-tabs'
           own margin, which is declared further down this sheet. .tab-badge is
           positioned against .tab in the main bar, so a sub-tab has to be a
           positioned box as well, or the badge anchors to some other ancestor. */
        .wtx-tabs.tk-views { margin: 0 0 14px; }
        .tk-views .wtx-tab { position: relative; }
        .tk-context { font-size: var(--fs-meta); color: var(--dark-muted); margin-top: 4px; overflow-wrap: anywhere; }
        /* r338 — a hand-over line is nobody's voice: a line across the thread,
           not a bubble. .tk-hand is the drawer that passes a question on. */
        .tmsg-system { align-self: center; max-width: 100%; background: none; border: none; padding: 2px 8px; font-size: var(--fs-caption); color: var(--dark-muted); text-align: center; }
        .tk-hand-toggle { display: block; margin: 12px auto 0; background: none; color: var(--dark-secondary); font-family: inherit; font-weight: 700; font-size: var(--fs-meta); text-decoration: underline; cursor: pointer; padding: 6px; }
        .tk-hand { margin-top: 10px; padding: 12px; border: 1px dashed var(--gray-200); border-radius: var(--r-sm); }
        .tk-hand-hint { font-size: var(--fs-meta); color: var(--dark-muted); margin-bottom: 8px; line-height: 1.8; }

        /* ===== First-time dashboard tour ===== */
        /* The spotlight is a transparent box whose huge box-shadow darkens
           everything around it — the target shows through the "hole". */
        .tour-spotlight {
            position: fixed;
            border-radius: var(--r-field);
            box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.72);
            z-index: 9998;
            pointer-events: none;
            transition: all 0.32s cubic-bezier(0.4, 0, 0.2, 1);
        }
        /* When a step has no target (welcome / finish) — plain dark veil */
        .tour-veil {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.72);
            z-index: 9998;
        }
        /* Behind a spotlight the veil stays, clear: the spotlight's shadow only
           paints, it catches no clicks, so without this a seller could press a
           tab or button under the tour and leave it pointing at another screen. */
        .tour-veil.clear { background: transparent; }
        .tour-btn:focus-visible { outline: 2px solid var(--gold-primary); outline-offset: 2px; }
        .tour-sr {
            position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
            overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
        }
        .tour-card {
            position: fixed;
            z-index: var(--z-top);
            background: var(--white);
            border-radius: var(--r-card);
            padding: 20px 22px;
            width: min(330px, calc(100vw - 32px));
            box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
            transition: top 0.3s ease, left 0.3s ease;
        }
        .tour-card-title {
            font-size: var(--fs-lead);
            font-weight: 900;
            color: var(--dark-primary);
            margin-bottom: 8px;
        }
        .tour-card-text {
            font-size: var(--fs-small);
            line-height: 1.85;
            color: var(--dark-secondary);
            margin-bottom: 16px;
        }
        .tour-card-foot {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }
        .tour-dots { display: flex; gap: 5px; }
        .tour-dot {
            width: 7px; height: 7px; border-radius: 50%;
            background: var(--gray-200, var(--gray-200));
        }
        .tour-dot.active { background: var(--gold-primary); width: 18px; border-radius: 4px; }
        .tour-btns { display: flex; gap: 8px; }
        .tour-btn {
            border: 0;
            border-radius: var(--r-btn, 14px);
            padding: 8px 16px;
            font-family: inherit;
            font-weight: 800;
            font-size: var(--fs-small);
            cursor: pointer;
        }
        .tour-btn-next { background: var(--gold-primary); color: var(--btn-ink, var(--dark-primary)); }
        .tour-btn-skip { background: transparent; color: var(--dark-muted); padding: 8px 6px; }
        .tour-card-arrow {
            position: absolute;
            width: 14px; height: 14px;
            background: var(--white);
            transform: rotate(45deg);
        }
        .product-grid { display: grid; gap: 16px; }
        /* r686: search and order above the list (outside #productsList, which is redrawn).
           Shown from six products up. The card below it is unchanged. */
        .pc-tools { display: none; gap: 10px; align-items: center; margin-bottom: 14px; }
        .pc-tools.on { display: flex; }
        .pc-tools .bd-search-wrap { flex: 1; min-width: 0; margin: 0; }
        .pc-tools .pc-sort { flex: none; width: auto; max-width: 46%; padding: 10px 12px; font-size: 0.85rem; font-weight: 700; }
        .product-card { background: var(--white); border-radius: var(--r-card, 24px); padding: 24px; border: 1px solid var(--gray-100); box-shadow: 0 4px 20px rgba(0,0,0,0.04); transition: all 0.3s; }
        .product-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.08); }

        /* Processing banner — shown on a product card while the background
           worker prepares it (grid prep / stamping / thumbnail). */
        .pc-proc {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 14px;
            border-radius: var(--r-xs);
            font-size: 0.82rem;
            font-weight: 700;
            margin-bottom: 14px;
        }
        .pc-proc-working {
            background: var(--gold-bg, var(--gold-bg));
            color: var(--gold-deep);
            border: 1px solid var(--gold-light, var(--gold-light));
        }
        .pc-proc-failed {
            background: #fef2f2;
            color: var(--red-strong);
            border: 1px solid #fecaca;
            flex-direction: column;
            align-items: flex-start;
        }
        .pc-proc-err {
            font-size: var(--fs-caption);
            font-weight: 500;
            margin-top: 4px;
            opacity: 0.85;
        }
        .pc-proc-spinner {
            width: 14px;
            height: 14px;
            border: 2px solid rgba(184,134,11,0.3);
            border-top-color: var(--gold-deep);
            border-radius: 50%;
            animation: pcspin 0.8s linear infinite;
            flex-shrink: 0;
        }
        @keyframes pcspin { to { transform: rotate(360deg); } }
        /* Small green dot next to a ready product's name */
        .pc-ready-dot {
            display: inline-block;
            width: 8px;
            height: 8px;
            background: var(--green-primary);
            border-radius: 50%;
            margin-inline-end: 6px;
            vertical-align: middle;
        }
        .pc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 12px; }
        .pc-name { font-size: 1.1rem; font-weight: 800; } .pc-desc { font-size: 0.85rem; color: var(--dark-muted); margin-bottom: 12px; }
        .pc-price { padding: 6px 16px; background: var(--gold-lighter); color: var(--gold-deep); border-radius: var(--r-pill); font-weight: 800; font-size: 0.85rem; white-space: nowrap; }
        .pc-stats { display: flex; gap: 20px; margin-bottom: 16px; font-size: 0.85rem; color: var(--dark-muted); flex-wrap: wrap; }
        .pc-stats span { display: inline-flex; align-items: center; gap: 6px; }
        .pc-stats .icu { width: 20px; height: 20px; flex: none; }
        .pc-links {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 8px;
            margin-top: 14px;
        }
        .pc-link {
            min-height: 44px;
            padding: 8px 6px;
            border-radius: var(--r-sm);
            font-size: 0.78rem;
            font-weight: 800;
            text-align: center;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            border: 1px solid transparent;
            transition: transform 0.15s var(--ease-out), background 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .pc-link:hover:not(:disabled) { transform: translateY(-1px); }
        /* Distinct color per action — no two buttons share the same color */
        .pc-link-web    { background: #ede9fe; color: #5b21b6; }   /* purple — public site link */
        .pc-link-web:hover    { background: #ddd6fe; }
        .pc-link-bot    { background: #cffafe; color: #155e75; }   /* cyan — bot link */
        .pc-link-bot:hover    { background: #a5f3fc; }
        .pc-link-coupon { background: var(--gold-bg); color: var(--gold-darker); }
        .pc-link-coupon:hover { background: var(--gold-lighter); }
        .pc-link-edit   { background: var(--blue-light); color: #1e40af; }
        .pc-link-edit:hover   { background: #bfdbfe; }
        .pc-link-export { background: var(--green-light); color: #065f46; }
        .pc-link-export:hover { background: #a7f3d0; }
        .pc-link-del    { background: var(--red-light); color: #991b1b; }
        .pc-link-del:hover    { background: #fecaca; }

        @media (max-width: 480px) {
            .pc-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
            .pc-link { font-size: var(--fs-caption); min-height: 42px; padding: 6px 4px; }
        }
        .form-card { background: var(--white); border-radius: var(--r-card, 24px); padding: 32px; border: 1px solid var(--gray-100); box-shadow: var(--shadow-card); }
        .form-card-title { font-size: var(--fs-title); font-weight: 900; margin-bottom: 24px; }
        /* r688: every tab opens with the same title. محصولات and کیف پول have no card of
           their own, so theirs stands on the page, kept to one short line. */
        .tab-head { margin: 0 4px 16px; line-height: 1.5; }
        @media (max-width: 640px) { .tab-head { margin-bottom: 12px; } }
        /* r688: on a phone the stats strip belongs to محصولات. On every other tab the hero
           keeps only the header's room, so the tab starts right under the header.
           body[data-bd-tab] is set by switchTab(); before it is set nothing folds. Above 640px
           nothing changes: the PC dock sits under the hero and must not move. */
        @media (max-width: 640px) {
            body[data-bd-tab]:not([data-bd-tab="products"]) .page-hero { padding: 72px 0 0; }
            body[data-bd-tab]:not([data-bd-tab="products"]) .page-hero > .container { display: none; }
        }
        .fg { margin-bottom: 20px; }
        .fl { font-size: var(--fs-small); font-weight: 700; margin-bottom: 8px; display: block; }
        .fi { width: 100%; padding: 14px 16px; border: 2px solid var(--gray-200); border-radius: var(--r-field); font-family: inherit; font-size: var(--fs-body); transition: all 0.3s; background: var(--white); }
        .fi:focus { border-color: var(--gold-primary); box-shadow: 0 0 0 3px rgba(245,184,0,0.1); outline: none; }
        .fi-textarea { min-height: 100px; resize: vertical; }
        .fi-file { padding: 12px; background: var(--gray-50); border-style: dashed; cursor: pointer; }
        .fi-hint { font-size: var(--fs-caption); color: var(--dark-muted); margin-top: 4px; }
        /* r687: one chevron for every select.fi, on the inline-end side (left in RTL),
           with room so the text never runs under it. Border, radius and focus are .fi's. */
        select.fi { -webkit-appearance: none; appearance: none; cursor: pointer;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
            background-repeat: no-repeat; background-position: left 14px center; background-size: 16px 16px;
            padding-inline-end: 42px; }
        select.fi::-ms-expand { display: none; }
        .pc-tools select.fi.pc-sort { padding-inline-end: 34px; background-position: left 10px center; }
        /* r687: the Persian file picker. Built at startup next to each input.fi-file;
           the input itself stays (id, accept, listeners) and is hidden the .sr-file way.
           Same dashed box the native .fi-file had. */
        .fp { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0;
              padding: 6px; border: 2px dashed var(--gray-200); border-radius: var(--r-field);
              background: var(--gray-50); cursor: pointer; transition: border-color .3s, box-shadow .3s; }
        .fp:focus-within { border-color: var(--gold-primary); box-shadow: 0 0 0 3px rgba(245,184,0,0.1); }
        .fp .fp-pick { flex: none; white-space: nowrap; }
        .fp-pick:focus-visible, .fp-x:focus-visible { outline: 2px solid var(--gold-primary); outline-offset: 2px; }
        .fp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
                   font-size: var(--fs-small); font-weight: 700; color: var(--dark-primary); }
        .fp-name.fp-none { font-weight: 500; color: var(--dark-muted); }
        .fp-x { flex: none; width: 32px; height: 32px; margin-inline-end: 4px; padding: 0; border: 0;
                border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
                background: var(--gray-100); color: var(--dark-muted); cursor: pointer; }
        .fp-x[hidden] { display: none; }
        .fp-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
        @media (hover: hover) and (pointer: fine) { .fp-x:hover { background: var(--gray-200); color: var(--dark-primary); } }
        .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
        @media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
        .form-divider { border: none; border-top: 1px solid var(--gray-100); margin: 24px 0; }

        /* r295 — the product form's sections.
           Replaces ~25 inline style attributes and two bare <hr>s. The three
           groups answer three questions in order: what is it, what does the
           buyer get, and what else. */
        .fsec { border-top: 1px solid var(--gray-100); padding-top: 20px; margin-top: 20px; }
        .fsec:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
        .fsec-head {
            display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
            font-size: var(--fs-lead); font-weight: 800; color: var(--dark-primary);
            margin-bottom: 16px;
        }
        .fsec-num {
            flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
            display: inline-flex; align-items: center; justify-content: center;
            font-size: var(--fs-meta); font-weight: 800; color: var(--white);
            background: linear-gradient(135deg, var(--gold-primary), var(--gold-deep));
        }
        .fsec-opt { font-size: var(--fs-meta); font-weight: 600; color: var(--dark-muted); }

        /* The advanced section. <details> is native, so it needs no handler on
           a page under a strict CSP and is keyboard-operable for free. */
        .fsec-adv > summary { cursor: pointer; list-style: none; margin-bottom: 0; }
        .fsec-adv > summary::-webkit-details-marker { display: none; }
        .fsec-adv[open] > summary { margin-bottom: 16px; }
        .fsec-chev { width: 18px; height: 18px; margin-inline-start: auto;
                     color: var(--dark-muted); transition: transform .2s ease; }
        .fsec-adv[open] .fsec-chev { transform: rotate(180deg); }
        .fsub { font-size: var(--fs-body); font-weight: 800; color: var(--dark-secondary);
                margin: 18px 0 10px; }
        .fsub:first-of-type { margin-top: 4px; }

        /* A checkbox and its label, the shape this form uses five times. */
        .opt-row { display: flex; align-items: center; gap: 10px; cursor: pointer;
                   font-weight: 700; color: var(--dark-secondary);
                   justify-content: flex-start; }
        .opt-row input[type="checkbox"] { width: 22px; height: 22px;
                                          accent-color: var(--gold-primary); flex-shrink: 0; }
        .opt-row span { flex: 1; }
        .opt { border: 1px solid var(--gray-200); border-radius: var(--r-field);
               padding: 14px; margin-bottom: 12px; }
        /* The question each check answers — the half of r196's copy that tells
           the two apart, so it stays on screen. */
        .opt-q { margin: 8px 0 0; padding-inline-start: 28px; font-size: var(--fs-meta);
                 font-weight: 700; color: var(--dark-primary); }
        .opt-q::before { content: "سؤالی که جواب می‌دهد: "; font-weight: 600;
                         color: var(--dark-muted); }
        .opt-more { margin: 8px 0 0; padding-inline-start: 28px; }
        .opt-more > summary { cursor: pointer; font-size: var(--fs-meta); font-weight: 700;
                              color: var(--gold-deep); }
        .opt-help { margin-top: 8px; padding: 12px 14px; background: var(--gold-bg);
                    border-radius: var(--r-sm); font-size: var(--fs-meta); color: var(--dark-muted);
                    line-height: 1.85; }
        .opt-block { display: none; margin-top: 14px; padding: 14px;
                     background: var(--gold-bg); border-radius: var(--r-field); }
        .opt-note { font-size: var(--fs-meta); color: var(--dark-muted);
                    line-height: 1.85; margin-bottom: 10px; }
        .opt-note-plain { margin-top: 12px; margin-bottom: 0; padding: 12px 14px;
                          background: var(--gray-50); border-radius: var(--r-sm);
                          font-size: var(--fs-meta); }
        .opt-aside { font-weight: 500; color: var(--dark-muted); }
        .opt-link { display: inline-flex; align-items: center; gap: 6px;
                    font-size: var(--fs-small); color: var(--gold-deep); font-weight: 700;
                    margin-bottom: 10px; text-decoration: underline; }
        .info-banner { margin-top: 24px; padding: 14px 16px; background: var(--gold-bg);
                       border-radius: var(--r-field); border: 1px dashed var(--gold-light);
                       font-size: var(--fs-small); color: var(--dark-secondary); line-height: 1.8; }
        /* r683: one button family for the whole panel.
             .submit-btn   main action: brand gold, ink label (the r634 look)
             .btn-2        second action: white, outlined
             .btn-3        small helper: light gold
             .btn-danger   reporting / destructive: red, same size as the main one
             .btn-quiet    cancel / close: grey, same size as the main one
           One shape (--r-btn), one hover, one disabled look. The main button used
           to be green here, blue in the detect tab and gold in the wallet. */
        .submit-btn, .btn-danger, .btn-quiet, .btn-2, .btn-3 {
            display: inline-flex; align-items: center; justify-content: center; gap: 8px;
            border-radius: var(--r-btn, 14px); font-family: inherit; font-weight: var(--fw-heavy, 800);
            line-height: 1.5; text-align: center; text-decoration: none; cursor: pointer;
            transition: filter var(--dur-fast, .15s) var(--ease-out), transform var(--dur-fast, .15s) var(--ease-out),
                        background var(--dur-fast, .15s) var(--ease-out), border-color var(--dur-fast, .15s) var(--ease-out);
        }
        .submit-btn, .btn-danger, .btn-quiet { width: 100%; min-height: 50px; padding: 12px 18px; font-size: var(--fs-lead, 1rem); }
        .submit-btn { background: var(--gold-primary); color: var(--btn-ink, var(--dark-primary)); box-shadow: var(--shadow-btn, 0 6px 16px rgba(245,184,0,.22)); }
        /* classes of their own, not .submit-btn variants: bd-icon-tone.js gives every
           gold-ruled selector an ink label, which must not land on red */
        .btn-danger { background: var(--red-strong, var(--red-strong)); color: var(--white); box-shadow: var(--shadow-danger); }
        .btn-danger .icu { --ic-acc: currentColor; }
        .btn-quiet { background: var(--gray-100); color: var(--dark-secondary); }
        .btn-2 { min-height: 44px; padding: 8px 18px; font-size: var(--fs-small, .88rem);
                 background: var(--white); color: var(--dark-primary); border: 1.5px solid var(--gray-300); }
        .btn-3 { min-height: 40px; padding: 6px 14px; font-size: var(--fs-small, .88rem);
                 background: var(--gold-bg); color: var(--gold-deep); border: 1px solid var(--gold-lighter); }
        @media (hover: hover) and (pointer: fine) {
            :is(.submit-btn, .btn-danger, .btn-quiet):hover:not(:disabled) { filter: brightness(.95); }
            .btn-2:hover:not(:disabled) { border-color: var(--gold-primary); background: var(--gold-bg); }
            .btn-3:hover:not(:disabled) { background: var(--gold-lighter); }
        }
        :is(.submit-btn, .btn-danger, .btn-quiet, .btn-2, .btn-3):active:not(:disabled) { transform: scale(.98); }
        /* one "not available" look: flat grey, readable label, no faded colour */
        :is(.submit-btn, .btn-danger, .btn-quiet, .btn-2, .btn-3, .pc-link):disabled {
            background: var(--gray-100); color: var(--dark-muted); border-color: var(--gray-200);
            box-shadow: none; opacity: 1; filter: none; transform: none; cursor: not-allowed;
        }
        .modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); z-index: var(--z-modal); align-items: center; justify-content: center; padding: 20px; }
        .modal-overlay.active { display: flex; }
        .modal { background: var(--white); border-radius: var(--r-card); padding: 32px; max-width: 440px; width: 100%; box-shadow: var(--shadow-modal); animation: fadeIn 0.3s; position: relative; }
        .modal-title { font-size: var(--fs-title); font-weight: 900; margin-bottom: 20px; text-align: center; }
        .modal-close-btn { position: absolute; top: 16px; left: 16px; width: 36px; height: 36px; background: var(--gray-100); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: var(--fs-lead); color: var(--dark-muted); }
        /* Coupon row in the modal — card-like, centered, with icon action buttons */
        .coupon-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 14px;
            margin-bottom: 8px;
            background: var(--white);
            border: 1px solid var(--gray-200);
            border-radius: var(--r-sm);
            transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
        }
        .coupon-item:hover {
            border-color: var(--gold-light);
            box-shadow: var(--shadow-sm);
        }
        .coupon-code {
            font-weight: 900;
            letter-spacing: 1px;
            font-size: var(--fs-lead);
            color: var(--dark-primary);
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
            flex-shrink: 0;
        }
        .coupon-meta {
            flex: 1;
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            align-items: center;
            justify-content: center;
            min-width: 0;
        }
        .coupon-meta-tag {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 3px 10px;
            border-radius: var(--r-pill);
            font-weight: 700;
            font-size: var(--fs-meta);
            background: var(--gray-100);
            color: var(--dark-secondary);
        }
        .coupon-meta-tag.discount { background: var(--green-light); color: var(--green-dark); }
        .coupon-meta-tag.expired  { background: var(--red-light);   color: var(--red-primary); }
        .coupon-meta-tag.private  { background: var(--gold-bg);     color: var(--gold-deep); }
        .coupon-actions { display: flex; gap: 6px; flex-shrink: 0; }
        .coupon-icon-btn {
            width: 38px; height: 38px;
            border-radius: var(--r-sm);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 0;
            cursor: pointer;
            transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out), transform 0.15s var(--ease-out);
        }
        .coupon-icon-btn:hover { transform: translateY(-1px); }
        .coupon-icon-btn svg { width: 17px; height: 17px; }
        .coupon-icon-btn.edit { background: var(--blue-light); color: var(--blue-primary); }
        .coupon-icon-btn.edit:hover { background: var(--blue-primary); color: var(--white); }
        .coupon-icon-btn.del  { background: var(--red-light);  color: var(--red-primary); }
        .coupon-icon-btn.del:hover  { background: var(--red-primary);  color: var(--white); }

        /* Private badge — shown on product cards / coupon rows when is_private.
           Clickable: opens the allowlist management modal. */
        .private-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 5px 12px;
            margin-top: 8px;
            background: var(--gold-bg);
            color: var(--gold-deep);
            border: 1px dashed var(--gold-light);
            border-radius: var(--r-pill);
            font-size: var(--fs-meta);
            font-weight: 700;
            cursor: pointer;
            transition: background 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
        }
        .private-badge:hover {
            background: var(--gold-lighter);
            border-color: var(--gold-primary);
        }
        .coupon-meta-tag.private-clickable {
            cursor: pointer;
            border: 0;
            transition: filter 0.15s var(--ease-out);
        }
        .coupon-meta-tag.private-clickable:hover { filter: brightness(0.95); }

        /* Allowlist modal — phone rows */
        .allowlist-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 10px 12px;
            margin-bottom: 6px;
            background: var(--gold-bg);
            border-radius: var(--r-sm);
            transition: background 0.15s var(--ease-out);
        }
        .allowlist-row:hover { background: var(--gold-lighter); }
        .allowlist-phone {
            font-weight: 700;
            font-size: var(--fs-lead);
            letter-spacing: 1px;
            color: var(--dark-primary);
            font-variant-numeric: tabular-nums;
            flex: 1;
            min-width: 0;
        }

        /* Add-phone row — input is generously sized, button is a matching square */
        .phone-add-row {
            display: flex;
            gap: 8px;
            align-items: stretch;
        }
        .phone-add-input {
            flex: 1 1 auto;
            min-width: 0;
            text-align: center;
            letter-spacing: 1.5px;
            font-size: var(--fs-lead);
            font-weight: 700;
            font-variant-numeric: tabular-nums;
        }
        .phone-add-btn {
            flex: 0 0 auto;
            width: 48px;
            min-height: 48px;
            border-radius: var(--r-sm);
            background: var(--green-primary);
            color: var(--white);
            border: 0;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
            transition: transform 0.15s var(--ease-out), background 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
        }
        .phone-add-btn:hover {
            transform: translateY(-1px);
            background: var(--green-dark);
            box-shadow: 0 5px 14px rgba(16, 185, 129, 0.35);
        }
        .phone-add-btn:active { transform: translateY(0); }
        .phone-add-btn svg { width: 22px; height: 22px; }

        /* Search bar above the phone list */
        .bd-search-wrap {
            position: relative;
            margin-bottom: 12px;
        }
        .bd-search-icon {
            position: absolute;
            top: 50%;
            inset-inline-start: 14px;
            transform: translateY(-50%);
            width: 16px;
            height: 16px;
            color: var(--dark-muted);
            pointer-events: none;
        }
        .bd-search-input {
            width: 100%;
            padding: 11px 14px;
            padding-inline-start: 40px;       /* leave room for the search icon */
            background: var(--gray-50);
            border: 1px solid var(--gray-200);
            border-radius: var(--r-pill);
            font-family: inherit;
            font-size: var(--fs-body);
            font-weight: 600;
            color: var(--dark-primary);
            transition: border-color 0.15s var(--ease-out), background 0.15s var(--ease-out);
            text-align: start;
        }
        .bd-search-input:focus {
            outline: none;
            border-color: var(--gold-primary);
            background: var(--white);
        }
        .bd-search-input::-webkit-search-cancel-button {
            -webkit-appearance: none;
            height: 16px;
            width: 16px;
            background: var(--gray-200);
            border-radius: 50%;
            cursor: pointer;
            margin-inline-start: 6px;
        }

        /* Coupon header bar — count on the right (RTL), green + button on the left */
        .coupon-header-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--gray-100);
        }
        .coupon-count-label {
            font-size: var(--fs-small);
            color: var(--dark-muted);
            font-weight: 600;
        }
        .coupon-add-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 44px;
            height: 44px;
            border-radius: var(--r-sm);
            background: var(--green-primary);
            color: var(--white);
            box-shadow: 0 4px 14px rgba(16, 185, 129, 0.30);
            transition: transform 0.15s var(--ease-out), background 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
            cursor: pointer;
        }
        .coupon-add-btn:hover {
            transform: translateY(-2px);
            background: var(--green-dark);
            box-shadow: 0 6px 20px rgba(16, 185, 129, 0.40);
        }
        .coupon-add-btn.is-open {
            background: var(--gray-200);
            color: var(--dark-secondary);
            box-shadow: none;
            transform: rotate(45deg);  /* turns the + into × visually */
        }
        .coupon-add-btn:active { transform: translateY(0); }
        .coupon-add-form { animation: couponFormIn 0.25s var(--ease-out); }
        @keyframes couponFormIn {
            from { opacity: 0; transform: translateY(-6px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        .wallet-card { background: linear-gradient(135deg, var(--dark-primary), #2d2d2d); color: var(--white); border-radius: var(--r-card, 24px); padding: 32px; margin-bottom: 24px; }
        .wallet-label { font-size: var(--fs-small); color: rgba(255,255,255,0.6); margin-bottom: 8px; }
        .wallet-balance { font-size: var(--fs-display); font-weight: 900; } .wallet-balance span { font-size: var(--fs-lead); font-weight: 600; opacity: 0.7; }
        /* r692 (release 5): the dark card above holds the balance only. The withdraw form
           (or a KYC state) sits on a light .form-card under it, with the panel's own .fi
           fields and r683 buttons, in the order it is filled: amount, card, button. */
        .wd-form { display: flex; flex-direction: column; gap: 22px; }
        .wd-form .fg { margin-bottom: 0; }
        .wd-avail-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; }
        .wd-avail-row .btn-3 { min-height: 32px; padding: 4px 12px; font-size: var(--fs-meta); white-space: nowrap; }
        .wd-avail { font-size: var(--fs-meta); color: var(--dark-muted); }
        .wd-avail b { font-weight: 800; color: var(--dark-primary); }
        .wd-err { display: flex; align-items: center; gap: 6px; margin-top: 6px;
                  font-size: var(--fs-meta); font-weight: 700; color: var(--red-primary); }
        .wd-err[hidden] { display: none; }
        #wAmount[aria-invalid="true"] { border-color: var(--red-primary); box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }
        .wd-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
        .wd-head .fl { margin-bottom: 0; }
        .wd-head .btn-2 { min-height: 38px; padding: 6px 14px; white-space: nowrap; }
        .wd-max { font-size: var(--fs-meta); color: var(--dark-muted); }
        /* saved cards: one compact row each - a small card face in the bank's colours with
           its logo (bank-card.js's data), the bank, the last four digits, a check - so the
           button stays close on a phone. On a wide screen the rows sit side by side, as the
           drawn cards did (r515). .bank-card + data-card/data-sheba/data-action stay for
           selectBank() and _clearCardHighlight(). */
        #bankCards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 8px; }
        .wd-bank { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer;
                   background: var(--white); border: 1.5px solid var(--gray-200); border-radius: var(--r-field);
                   -webkit-tap-highlight-color: transparent; user-select: none;
                   transition: border-color .15s var(--ease-out), background .15s var(--ease-out), box-shadow .15s var(--ease-out); }
        .wd-bank:focus-visible { outline: 2px solid var(--gold-primary); outline-offset: 2px; }
        .wd-bank.selected { border-color: var(--gold-primary); background: var(--gold-bg); box-shadow: 0 0 0 3px rgba(245,184,0,0.12); }
        @media (hover: hover) and (pointer: fine) { .wd-bank:not(.selected):hover { border-color: var(--gray-300); } }
        .wd-face { flex: none; width: 48px; height: 32px; border-radius: var(--r-xs); display: grid; place-items: center;
                   background: linear-gradient(135deg, var(--c2, var(--dark-secondary)), var(--c1, var(--dark-primary)));
                   box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 3px rgba(17,24,39,0.18); }
        .wd-face i { width: 20px; height: 20px; padding: 2px; box-sizing: border-box; border-radius: 5px; background: var(--white); display: grid; place-items: center; }
        .wd-face svg, .wd-face img { width: 100%; height: 100%; display: block; object-fit: contain; }
        .wd-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
        .wd-name { font-size: var(--fs-small); font-weight: 800; color: var(--dark-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .wd-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--fs-meta); color: var(--dark-muted); }
        .wd-num { direction: ltr; unicode-bidi: isolate; letter-spacing: 0.04em; font-weight: 700; }
        .wd-nosheba { font-size: var(--fs-caption); font-weight: 800; color: #78350f; background: #fde68a; border-radius: var(--r-pill); padding: 1px 8px; }
        .wd-check { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
                    border: 1.5px solid var(--gray-300); background: var(--white); }
        .wd-check svg { width: 13px; height: 13px; fill: none; stroke: var(--btn-ink, var(--dark-primary)); stroke-width: 3.2;
                        stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
        .wd-bank.selected .wd-check { background: var(--gold-primary); border-color: var(--gold-primary); }
        .wd-bank.selected .wd-check svg { opacity: 1; }
        #bankFields { margin-top: 12px; }
        #bankFields:first-child { margin-top: 0; }
        .wd-note { font-size: var(--fs-meta); line-height: 1.8; color: var(--dark-secondary);
                   background: var(--gold-bg); border-radius: var(--r-sm); padding: 10px 12px; }
        #cardBankHint { font-size: var(--fs-meta); color: var(--dark-secondary); min-height: 18px; display: flex; align-items: center; gap: 8px; }
        #cardBankHint:empty { display: none; }

        /* KYC states (pending / rejected / not submitted). r692: on the light card under
           the balance, in the panel's ink; the button is the r683 main button. */
        .kyc-state { text-align: center; padding: 4px 0; }
        .kyc-state-icon { font-size: 2rem; margin-bottom: 8px; color: var(--dark-primary); }
        .kyc-state-title { font-size: var(--fs-lead); font-weight: 900; margin-bottom: 6px; color: var(--dark-primary); }
        .kyc-state-text { font-size: var(--fs-small); color: var(--dark-muted); line-height: 1.8; max-width: 52ch; margin-inline: auto; }
        .kyc-state-rejected .kyc-state-text { color: var(--red-primary); background: var(--red-light); border-radius: var(--r-sm); padding: 10px 14px; }
        .kyc-state-sub { font-size: var(--fs-meta); opacity: 0.8; }
        .kyc-state .submit-btn { margin-top: 16px; }
        @media (min-width: 641px) { .kyc-state .submit-btn { width: auto; min-width: 260px; padding-inline: 28px; } }

        /* KYC submission modal — the warnings block at the top */
        .kyc-warnings {
            background: var(--gold-bg);
            border: 1px solid var(--gold-light);
            border-radius: var(--r-field);
            padding: 14px 16px;
            margin-bottom: 18px;
        }
        .kyc-warning-item {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            font-size: var(--fs-meta);
            color: var(--dark-secondary);
            line-height: 1.8;
        }
        .kyc-warning-item + .kyc-warning-item {
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px dashed var(--gold-light);
        }
        .kyc-warning-item b { color: var(--gold-deep); font-weight: 800; }
        .kyc-warning-icon {
            font-size: 1rem;
            flex-shrink: 0;
            margin-top: 2px;
        }
        .kyc-preview {
            display: block;
            width: 100%;
            max-height: 240px;
            object-fit: contain;
            margin-top: 10px;
            border-radius: var(--r-sm);
            border: 1px solid var(--gray-200);
            background: var(--gray-50);
        }
        .history-item { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--gray-100); font-size: var(--fs-small); }
        /* r300 — fetching a buyer's copy from the orders list. */
        .hi-end { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
        .ord-dl { border: 1px solid var(--gray-200, var(--gray-200)); background: var(--white);
                  border-radius: var(--r-pill); padding: 6px 14px; cursor: pointer;
                  font-family: inherit; font-size: var(--fs-meta); font-weight: 800;
                  color: var(--dark-secondary); white-space: nowrap;
                  transition: border-color .15s ease, color .15s ease; }
        .ord-dl:hover { border-color: var(--gold-primary, var(--gold-primary));
                        color: var(--gold-deep); }
        .ord-files { border-bottom: 1px solid var(--gray-100);
                     background: var(--gray-50, var(--gray-50)); }
        .ord-files[hidden] { display: none; }
        .ordf-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; }
        .ordf-row + .ordf-row { border-top: 1px solid var(--gray-100); }
        .ordf-num { flex-shrink: 0; font-size: var(--fs-caption); font-weight: 800;
                    color: var(--gold-deep); min-width: 52px; }
        .ordf-name { flex: 1; min-width: 0; font-size: var(--fs-meta); font-weight: 600;
                     overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .ordf-note { padding: 10px 12px; font-size: var(--fs-meta); color: var(--dark-muted); }
        @media (max-width: 640px) {
            .history-item { flex-wrap: wrap; gap: 8px; }
            .hi-end { width: 100%; justify-content: space-between; }
        }
        .history-status { padding: 4px 12px; border-radius: var(--r-pill); font-size: var(--fs-caption); font-weight: 700; }
        /* r313 — wallet ledger. Two TABS (واریز / برداشت) over one pane, each
           keeping its own page number, so the amount carries no sign: the tab
           you are on already says which way the money went. Styled off .tabs /
           .tab so the sub-navigation reads as the same control as the panel's
           own, one level down — but a separate class, because .tab[data-tab] is
           claimed by the main tab dispatcher. */
        .wtx-tabs { display: flex; gap: 2px; padding: 5px; margin: 24px 0 4px;
                    background: var(--white); border: 1px solid var(--gray-200);
                    border-radius: var(--r-field); box-shadow: var(--shadow-sm); }
        .wtx-tab { flex: 1; white-space: nowrap; padding: 9px 12px; background: transparent;
                   border: 0; border-radius: var(--r-sm); font-family: inherit; font-weight: 700;
                   font-size: var(--fs-small); color: var(--dark-muted); cursor: pointer;
                   min-height: 38px; display: inline-flex; align-items: center;
                   justify-content: center; gap: 6px;
                   transition: background 0.18s var(--ease-out), color 0.18s var(--ease-out); }
        .wtx-tab:hover { background: var(--gold-bg); color: var(--gold-deep); }
        /* r688: the selected option is a white raised pill with dark ink, like the selected
           tab of the panel's own row (dock / phone bar), not a gold block. The ring is a
           shadow, so selecting moves nothing. */
        .wtx-tab.active { background: var(--white); color: var(--dark-primary);
                          box-shadow: 0 0 0 1px var(--gray-200), 0 1px 2px rgba(31, 41, 55, .06), 0 4px 12px -2px rgba(31, 41, 55, .16); }
        .wtx-count { display: block; font-size: var(--fs-meta); font-weight: 700;
                     color: var(--dark-muted); margin: 12px 2px 2px; }
        .wtx-row { display: flex; justify-content: space-between; align-items: flex-start;
                   gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--gray-100); }
        .wtx-main { min-width: 0; }
        .wtx-note { font-size: var(--fs-small); font-weight: 700; color: var(--dark-primary);
                    overflow-wrap: anywhere; }
        .wtx-meta { font-size: var(--fs-meta); color: var(--dark-muted); margin-top: 4px;
                    display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
        .wtx-amt { font-weight: 800; white-space: nowrap; font-size: var(--fs-body); }
        .wtx-in  { color: var(--green-dark); }
        .wtx-out { color: var(--red-primary); }
        .wtx-empty { text-align: center; color: var(--dark-muted); padding: 22px 0;
                     font-size: var(--fs-small); }
        @media (max-width: 640px) {
            .wtx-row { flex-wrap: wrap; }
            .wtx-amt { width: 100%; }
        }
        .status-pending { background: var(--gold-lighter); color: var(--gold-deep); } .status-done { background: var(--green-light); color: var(--green-dark); } .status-rejected { background: var(--red-light); color: var(--red-primary); }
        .empty-state { text-align: center; padding: 60px 20px; color: var(--dark-muted); } .empty-icon { font-size: 3rem; margin-bottom: 16px; }
        /* Referral code locked until KYC approved (bug #4) */
        .ref-locked { filter: blur(7px); user-select: none; pointer-events: none; }
        .ref-lock-wrap { position: relative; display: inline-block; }
        .ref-lock-badge {
            position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
            font-size: var(--fs-h2); color: var(--dark-muted); pointer-events: none;
        }
        .spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid var(--gray-200); border-top-color: var(--gold-primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }
        /* r292 — the product's PDF list, in the edit modal and the create form.
           Numbers come from sort_order, so what the seller drags here is
           exactly the "PDF ۱، PDF ۲، …" a buyer reads on the product page. */
        .pf-list { display: grid; gap: 10px; }
        /* r305: the create list pages (see _cpPagerHtml) — no scroll cap, or a
           page of eight rows would scroll inside a box that is already a page. */
        .pf-pager-solo { justify-content: flex-end; }
        .pf-pager { display: flex; align-items: center; justify-content: space-between;
                    gap: 10px; padding: 10px 2px 0; font-size: var(--fs-meta);
                    font-weight: 700; color: var(--dark-muted); }
        .pf-page-btn { border: 1px solid var(--gray-200, var(--gray-200)); background: var(--white);
                       border-radius: var(--r-pill); padding: 6px 16px; cursor: pointer;
                       font-family: inherit; font-size: var(--fs-meta); font-weight: 800;
                       color: var(--dark-secondary); }
        .pf-page-btn:hover:not(:disabled) { border-color: var(--gold-primary, var(--gold-primary));
                                            color: var(--gold-deep); }
        .pf-page-btn:disabled { opacity: .4; cursor: default; }
        .pf-row { display: flex; align-items: center; gap: 10px; padding: 12px;
                  border: 1px solid var(--gray-200, var(--gray-200)); border-radius: var(--r-field);
                  background: var(--white, var(--white));
                  transition: border-color .18s ease, box-shadow .18s ease; }
        .pf-row:hover { border-color: var(--gold-primary, var(--gold-primary));
                        box-shadow: 0 4px 14px rgba(212,175,55,0.10); }
        /* The number is the whole point of the row: it is what the buyer reads
           on the product page, so it leads and it is the one gold element. */
        .pf-num { flex-shrink: 0; width: 42px; height: 42px; border-radius: var(--r-xs);
                  display: flex; flex-direction: column; align-items: center;
                  justify-content: center; gap: 1px; font-weight: 800;
                  background: linear-gradient(135deg, #fdf6e3, #f7e9c3);
                  color: var(--gold-deep); border: 1px solid #f0dda8; }
        .pf-num small { font-size: 0.5rem; letter-spacing: .04em; opacity: .75; }
        .pf-num span { font-size: var(--fs-body); line-height: 1; }
        .pf-meta { flex: 1; min-width: 0; }
        .pf-name { font-weight: 700; font-size: var(--fs-small); overflow: hidden;
                   text-overflow: ellipsis; white-space: nowrap; }
        .pf-sub { font-size: var(--fs-caption); color: var(--dark-muted); margin-top: 3px;
                  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        /* The name field sits IN the row rather than behind a prompt(): naming
           four files should be four keystrokes, not four dialogs. */
        .pf-title { width: 100%; border: 1px solid transparent; background: transparent;
                    border-radius: var(--r-xs); padding: 5px 8px; font-family: inherit;
                    font-size: var(--fs-small); font-weight: 700; color: var(--dark-primary);
                    transition: border-color .15s ease, background .15s ease; }
        .pf-title::placeholder { font-weight: 600; color: var(--dark-muted); opacity: .8; }
        .pf-title:hover { background: var(--gray-100, var(--gray-100)); }
        .pf-title:focus { outline: none; background: var(--white, var(--white));
                          border-color: var(--gold-primary, var(--gold-primary)); }
        .pf-badge { font-size: var(--fs-caption); font-weight: 800; padding: 2px 8px;
                    border-radius: var(--r-pill); background: var(--gold-lighter); color: var(--gold-darker); }
        .pf-badge.err { background: var(--red-light); color: var(--red-dark); }
        .pf-acts { display: flex; gap: 4px; flex-shrink: 0; }
        .pf-acts button { border: none; background: var(--gray-100, var(--gray-100));
                          border-radius: var(--r-sm); width: 30px; height: 30px; cursor: pointer;
                          font-size: var(--fs-meta); line-height: 1; color: var(--dark-secondary);
                          transition: background .15s ease, color .15s ease; }
        .pf-acts button:hover:not(:disabled) { background: var(--gold-primary, var(--gold-primary));
                                               color: var(--btn-ink); }
        .pf-acts button:disabled { opacity: 0.3; cursor: default; }
        .pf-empty { font-size: var(--fs-small); color: var(--dark-muted); padding: 10px 0; }
        /* A file input that is present and rendered but out of sight. NOT
           display:none — Safari and iOS refuse to open the file dialog for a
           programmatic .click() on an input that is not rendered, so the
           button would do nothing on exactly the devices that cannot be
           debugged from here. */
        .sr-file { position: absolute; width: 1px; height: 1px; padding: 0;
                   margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
                   white-space: nowrap; border: 0; opacity: 0; }

        /* r296 — two columns: the name the seller types, and the file that is
           uploading. They change on different clocks, so they are laid out
           side by side and repainted independently. */
        .pf-row-2col { align-items: flex-start; }
        .pf-cols { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
        .pf-col { min-width: 0; }
        .pf-collabel { display: block; font-size: var(--fs-caption); font-weight: 700;
                       color: var(--dark-muted); margin-bottom: 4px; }
        .pf-row-2col .pf-title { border: 1px solid var(--gray-200, var(--gray-200));
                                 background: var(--white, var(--white)); }
        .pf-file { padding-top: 1px; }
        .pf-fname { font-size: var(--fs-meta); font-weight: 700; color: var(--dark-secondary);
                    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .pf-prog { height: 6px; border-radius: var(--r-pill); background: var(--gray-100, var(--gray-100));
                   overflow: hidden; margin-top: 6px; }
        .pf-prog-fill { height: 100%; border-radius: var(--r-pill);
                        background: linear-gradient(135deg, var(--gold-primary, var(--gold-primary)),
                                                    var(--gold-deep));
                        transition: width .2s ease; }
        .pf-pct { font-size: var(--fs-caption); font-weight: 700; color: var(--dark-muted); margin-top: 4px; }
        .pf-ok { font-size: var(--fs-caption); font-weight: 800; color: var(--green-dark, var(--green-dark)); margin-top: 5px; }
        .pf-err { font-size: var(--fs-caption); font-weight: 700; color: var(--red-dark); margin-top: 5px; line-height: 1.7; }
        .pf-retry { border: none; background: none; padding: 0; font-family: inherit;
                    font-size: var(--fs-caption); font-weight: 800; color: var(--gold-deep);
                    text-decoration: underline; cursor: pointer; }
        /* One column under the 640px phone breakpoint this page already uses:
           two 150px columns side by side truncate both the name and the
           filename to nothing. */
        @media (max-width: 640px) {
            .pf-cols { grid-template-columns: 1fr; gap: 8px; }
        }

        /* The add tile. Dashed, full width, and the only plus on the form —
           it reads as "there is room for more" rather than as a button. */
        .pf-add { display: flex; align-items: center; gap: 12px; width: 100%;
                  margin-top: 10px; padding: 14px 16px; cursor: pointer;
                  border: 2px dashed var(--gray-200, var(--gray-200)); border-radius: var(--r-field);
                  background: transparent; font-family: inherit; text-align: right;
                  transition: border-color .18s ease, background .18s ease; }
        .pf-add:hover:not(:disabled) { border-color: var(--gold-primary, var(--gold-primary));
                                       background: #fffdf5; }
        .pf-add:disabled { opacity: .5; cursor: default; }
        .pf-add-icon { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
                       display: flex; align-items: center; justify-content: center;
                       background: linear-gradient(135deg, var(--gold-primary, var(--gold-primary)),
                                                   var(--gold-deep));
                       color: var(--white); box-shadow: 0 4px 12px rgba(212,175,55,0.35);
                       transition: transform .18s ease; }
        .pf-add-icon svg { width: 20px; height: 20px; }
        .pf-add:hover:not(:disabled) .pf-add-icon { transform: rotate(90deg); }
        .pf-add-text { display: flex; flex-direction: column; gap: 2px; }
        .pf-add-text strong { font-size: var(--fs-small); font-weight: 800;
                              color: var(--dark-primary); }
        .pf-add-text small { font-size: var(--fs-caption); color: var(--dark-muted); }

        .toast { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(120%); background: var(--dark-primary); color: var(--white); padding: 14px 28px; border-radius: var(--r-pill); font-weight: 700; font-size: var(--fs-small); z-index: var(--z-toast); box-shadow: 0 10px 40px rgba(0,0,0,0.25); transition: transform 0.5s cubic-bezier(0.19,1,0.22,1); max-width: 90%; text-align: center; }
        .toast.visible { transform: translateX(-50%) translateY(0); }
        .upload-bar { margin-top: 12px; display: none; } .upload-bar.visible { display: block; }
        .upload-track { height: 8px; background: var(--gray-200); border-radius: var(--r-xs); overflow: hidden; }
        .upload-fill { height: 100%; background: var(--green-primary); border-radius: var(--r-xs); transition: width 0.3s; width: 0; }
        .upload-text { font-size: var(--fs-meta); color: var(--dark-muted); margin-top: 4px; text-align: center; }
        #footer { background: var(--dark-primary); color: var(--white); padding: 30px 20px; text-align: center; }
        .footer-text { font-size: var(--fs-meta); color: rgba(255,255,255,0.5); }
        /* r456: the seller-facing commitments */
        .footer-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 12px; font-size: var(--fs-meta); }
        .footer-legal a { color: rgba(255,255,255,0.72); text-decoration: none; display: inline-block; padding-block: 3px; }
        .footer-legal a:hover { color: var(--gold-light); }
        /* Force TRUE Latin digit glyphs. The site's IRANYekanX build is the
           FD (Farsi-Digits) variant: it DRAWS ASCII 0-9 with Persian glyph
           shapes, so converting characters isn't enough — the font must be
           overridden. Used in the کد معرف section (code box, share %, date). */
        .latin-digits,
        .coupon-code {
            font-family: 'Segoe UI', Tahoma, Arial, 'Courier New', sans-serif !important;
            font-feature-settings: "locl" 0 !important;
            font-variant-numeric: lining-nums !important;
            direction: ltr;
            unicode-bidi: embed;
        }

/* ---- r694: the second <head> <style> block (hand notes) follows ---- */
/* hand notes: a handwritten label and a small arrow pointing at the thing it explains */
@font-face { font-family: BdHand; src: url("/static/fonts/Leila-Regular.woff2") format("woff2"); font-display: swap; }
.hnote { position: relative; pointer-events: none; }
.hnote-tag { display: flex; align-items: flex-end; width: max-content; margin: 0 auto; transform: rotate(-1.5deg); }
.hnote-label { display: block; font-family: BdHand, serif; font-size: 23px; line-height: 1.5; padding-top: 10px; color: #4a4a4a; white-space: nowrap; }
.hnote-arrow { width: 34px; height: 26px; flex: none; overflow: visible; margin-bottom: 16px; }
.hnote-arrow path { fill: none; stroke: #4a4a4a; stroke-width: 1.3px; stroke-linecap: round; stroke-linejoin: round; }
.hnote.gold .hnote-label { color: var(--gold-deep); } .hnote.gold .hnote-arrow path { stroke: var(--gold-deep); }
.hnote.under { margin: 0 0 8px; } .hnote.under.after-p { margin-top: -14px; } .hnote.under .hnote-tag { margin-inline-start: 14%; margin-inline-end: auto; }
/* dock notes are placed by script, each arrow tip on its button */
.hnote-dock { position: absolute; inset: 0 0 auto 0; height: 0; z-index: 5; }
.hnote-dock .hnote { position: absolute; top: 0; left: 0; visibility: hidden; }
.hnote-dock .hnote.placed { visibility: visible; }
.hnote.down .hnote-tag { align-items: flex-start; transform: rotate(1deg); }
.hnote.down .hnote-arrow { transform: scaleY(-1); margin: 14px 0 0; }
.hnote.down .hnote-label { padding: 0 0 10px; }
.hnote.left .hnote-tag { flex-direction: row-reverse; align-items: center; transform: rotate(-1deg); }
.hnote.left .hnote-arrow.side { width: 36px; height: 18px; margin: 4px 2px 0; }
.hnote-dock .hnote { transition: opacity .2s; } .hnote-dock.off .hnote { opacity: 0; }
@media (min-width: 901px) { .content-area > .tab-content { padding-top: 24px; } }
@media (max-width: 900px) { .hnote-dock { display: none; } }
@media (prefers-reduced-motion: no-preference) {
  .hnote:not(.seen) .hnote-label { clip-path: inset(-.6em -.6em -.6em 100%); }
  .hnote:not(.seen) .hnote-arrow path { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .hnote.seen .hnote-label { animation: hn-write var(--hn-d, .8s) .08s cubic-bezier(.3,.28,.72,.86) both; }
  .hnote.seen .hnote-arrow path { stroke-dasharray: 1; animation: hn-draw .34s calc(var(--hn-d, .8s) + .02s) cubic-bezier(.3,.6,.3,1) both; }
}
.hnote.point-down { margin: -8px 0 2px; }
.hnote.point-down .hnote-tag { margin-inline-start: 3%; margin-inline-end: auto; }
/* r688: at 375px the Detect note (about 320px) was wider than its 277px column and stuck 2px out
   of the page (innerWidth 377). On narrow phones it may use the card's padding, and wraps if even
   that is not enough. */
@media (max-width: 400px) {
  .hnote.point-down .hnote-tag { margin-inline-start: -24px; max-width: calc(100% + 48px); }
  .hnote.point-down .hnote-label { white-space: normal; }
}
.hnote.on-card { margin: 4px 0 6px; }
.hnote.flipd .hnote-tag { flex-direction: row-reverse; gap: 8px; }
.hnote.flipd .hnote-arrow { transform: scale(-1, -1); }
.hnote.on-card .hnote-tag { margin-inline-start: calc(16.66% - 22px); margin-inline-end: auto; }
@media (max-width: 760px) { .hnote.on-card .hnote-tag { margin-inline-start: calc(25% - 22px); } .hnote-label { font-size: 21px; } }
.hnote.on-edit { margin: 8px 0 0; }
.hnote.on-edit .hnote-tag { margin-inline-start: calc(16.66% - 14px); margin-inline-end: auto; flex-direction: row-reverse; gap: 8px; }
.hnote.on-edit .hnote-arrow { transform: scaleX(-1); }
@media (max-width: 760px) { .hnote.on-edit { display: none; } }
.hnote { transition: opacity .8s ease; }
.hnote.gone, .hnote-dock .hnote.gone { opacity: 0; }
/* in-page notes then fold away so they leave no gap */
.hnote:not(.hnote-dock .hnote) { max-height: 90px; overflow: visible; }
.hnote.gone:not(.hnote-dock .hnote) { max-height: 0; margin-top: 0; margin-bottom: 0; overflow: hidden;
  transition: opacity .8s ease, max-height .5s .8s ease, margin .5s .8s ease; }
/* phone: one note at a time, floating over the page; each scroll swaps to the next */
.hnote-mob { position: fixed; inset: 0 0 auto 0; height: 0; z-index: 1001; pointer-events: none; }
.hnote-mob .hnote { position: fixed; left: 0; top: 0; visibility: hidden; }
.hnote-mob .hnote.placed { visibility: visible; }
.hnote.float .hnote-tag { position: relative; isolation: isolate; }
/* frosted blur behind the words, its edges faded out so no box shows (on the tag:
   the label's write-in clip-path would stop a backdrop blur from seeing the page) */
.hnote.float .hnote-tag::before { content: ""; position: absolute; inset: -14px -44px; z-index: -1;
  -webkit-backdrop-filter: blur(9px) saturate(1.2); backdrop-filter: blur(9px) saturate(1.2);
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
  opacity: 0; transition: opacity .4s; }
.hnote.float.seen .hnote-tag::before { opacity: 1; }
.hnote.float.gone { opacity: 1 !important; max-height: none !important; overflow: visible !important; }
.hnote.float .hnote-label, .hnote.float .hnote-arrow { transition: opacity .8s ease; }
.hnote.float.gone .hnote-label, .hnote.float.gone .hnote-arrow, .hnote.float.gone .hnote-tag::before { opacity: 0; }
.hnote.float .hnote-tag::before { transition: opacity .8s ease; }
.hnote.float .hnote-arrow path { stroke-width: 1.6px; }
@media (min-width: 901px) { .hnote-mob { display: none; } }
@keyframes hn-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes hn-write { from { clip-path: inset(-.6em -.6em -.6em 100%); } to { clip-path: inset(-.6em -.6em -.6em -.6em); } }
