/* ==========================================================================
   Maryami Home (خانه مریمی) — Marketplace Design System  ·  v3.0
   RTL (Persian · Vazirmatn) & LTR (English · Plus Jakarta Sans + Cormorant)

   Contents
     01 Fonts            06 Tables & folds        11 Storefront
     02 Colour tokens    07 Tabs, stats, paging   12 Checkout & orders
     03 Base & a11y      08 Site header           13 Workspace (panels)
     04 Layout           09 Mobile drawer         14 Journal (magazine)
     05 Components       10 Footer                15 Profile, KYC, misc.

   The palette is built on the brand green #647055. Every text/background pair
   below is checked by tests/contrast.py (WCAG 2.1 AA) for both themes.
   ========================================================================== */

/* ---------- 01 Fonts ---------- */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Variable.woff2') format('woff2-variations'),
         url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('../fonts/PlusJakartaSans-Variable.woff2') format('woff2-variations');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('../fonts/CormorantGaramond-Variable.woff2') format('woff2-variations');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

/* ---------- 02 Colour tokens ----------
   Light theme: soft paper-like neutrals with a trace of the brand hue (no pure white page, no pure
   black text) to keep glare and eye strain low; body text ≈ 14:1, secondary text ≥ 6:1.
   Dark theme: the same hue family at low luminance; the brand green is lifted to a readable sage. */
:root {
    color-scheme: light;
    --brand: #647055;

    --bg: #f4f5ef;
    --bg-alt: #ebede4;
    --surface: #fdfdfb;
    --surface-2: #f3f4ed;
    --surface-3: #e8ebe0;
    --border: #dadfd0;
    --border-strong: #bfc7b1;
    --field-border: #838c74;

    --text: #1f241b;
    --text-soft: #3a4133;
    --text-muted: #5a6152;

    --primary: #647055;
    --primary-hover: #525d45;
    --primary-strong: #47513b;
    --primary-soft: #e7ebdd;
    --primary-border: #c3ccb5;
    --on-primary: #ffffff;

    --accent: #96582f;
    --accent-hover: #7f4a27;
    --accent-soft: #f5e9de;
    --accent-border: #e3c9b3;
    --on-accent: #ffffff;

    --success: #2a6645;
    --success-soft: #e2f0e6;
    --success-border: #b3d5bf;
    --warn: #7a5200;
    --warn-soft: #fbf2da;
    --warn-border: #e7d299;
    --danger: #a8281f;
    --danger-soft: #fbe9e6;
    --danger-border: #edbdb6;
    --info: #265b77;
    --info-soft: #e5f0f5;
    --info-border: #b4cfdd;
    --violet: #65467f;
    --violet-soft: #f2ecf7;
    --violet-border: #d7c6e5;

    /* Dark chrome (utility bar, footer, hero) keeps its own on-colour set in both themes. */
    --chrome: #3a4231;
    --chrome-deep: #262b20;
    --on-chrome: #f1f3e9;
    --on-chrome-soft: #cdd3bf;
    --on-chrome-accent: #ecd7b4;
    --hero-gradient: linear-gradient(135deg, #3d4533 0%, #647055 58%, #47513a 100%);

    --focus-ring: 0 0 0 3px rgba(100, 112, 85, 0.32);
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(31, 36, 27, 0.05), 0 2px 8px rgba(31, 36, 27, 0.04);
    --shadow-md: 0 10px 30px rgba(31, 36, 27, 0.10);
    --shadow-lg: 0 22px 48px rgba(31, 36, 27, 0.16);
    --container: 1220px;
    --header-h: 64px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #141711;
    --bg-alt: #191d15;
    --surface: #1d2119;
    --surface-2: #242921;
    --surface-3: #2d3328;
    --border: #363d2f;
    --border-strong: #4c5542;
    --field-border: #6f7a61;

    --text: #e8ebdf;
    --text-soft: #d0d5c5;
    --text-muted: #a9b19c;

    --primary: #b3c09f;
    --primary-hover: #c5cfb3;
    --primary-strong: #cdd7bd;
    --primary-soft: #2b3125;
    --primary-border: #48523c;
    --on-primary: #1a1f15;

    --accent: #dda67b;
    --accent-hover: #e8b890;
    --accent-soft: #382b1f;
    --accent-border: #5d4733;
    --on-accent: #23170e;

    /* A card is a near-black box on a near-black page in dark mode: #1d2119 on #141711 is 1.16:1,
       which is invisible in daylight. The frame has to be carried by a visibly lighter edge instead
       of by the fill, so borders get a step up and cards keep the lightest shadow. */
    --card-edge: #414939;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .38), 0 2px 10px rgba(0, 0, 0, .3);

    --success: #82c79d;
    --success-soft: #1c3125;
    --success-border: #2f5340;
    --warn: #e3bd66;
    --warn-soft: #332a13;
    --warn-border: #5b4b22;
    --danger: #f19a90;
    --danger-soft: #3a1f1c;
    --danger-border: #6b3631;
    --info: #90c3de;
    --info-soft: #182f3b;
    --info-border: #2d5368;
    --violet: #c5a9de;
    --violet-soft: #2b2236;
    --violet-border: #4d3d61;

    --chrome: #1b2016;
    --chrome-deep: #10130d;
    --hero-gradient: linear-gradient(135deg, #20261a 0%, #3b4431 58%, #262c1f 100%);

    --focus-ring: 0 0 0 3px rgba(179, 192, 159, 0.36);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30), 0 2px 8px rgba(0, 0, 0, 0.22);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.42);
    --shadow-lg: 0 22px 48px rgba(0, 0, 0, 0.55);
}

/* ---------- 03 Base & accessibility ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    overflow-x: clip;
    max-width: 100%;
    -webkit-text-size-adjust: 100%;
    /* Every in-page "#anchor" (the academy hero's "دوره‌ها و ورکشاپ‌ها", the table-of-contents
       links in journal articles, "جستجوی دوره‌ها" style jump links) has to land *below* the sticky
       header. Without this the target scrolls to y=0 and its first line is covered by the header. */
    scroll-padding-top: calc(var(--header-h) + 14px);
}
/* Belt and braces for anything that is a jump target by id rather than a heading. */
[id] { scroll-margin-top: calc(var(--header-h) + 14px); }

html[lang="fa"],
html[lang="fa"],
html[lang="fa"] body,
html[lang="fa"] button,
html[lang="fa"] input,
html[lang="fa"] select,
html[lang="fa"] textarea,
html[lang="fa"] option,
html[lang="fa"] optgroup,
html[lang="fa"] legend,
html[lang="fa"] summary,
html[lang="fa"] code,
html[lang="fa"] kbd,
html[lang="fa"] samp,
html[lang="fa"] pre,
html[lang="fa"] time {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}
html[lang="en"],
html[lang="en"] body,
html[lang="en"] button,
html[lang="en"] input,
html[lang="en"] select,
html[lang="en"] textarea,
html[lang="en"] code,
html[lang="en"] kbd,
html[lang="en"] samp,
html[lang="en"] pre,
html[lang="en"] time {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
html[lang="en"] .display-title,
html[lang="en"] .hero-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    letter-spacing: -0.01em;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.75;
    font-size: 15px;
    overflow-x: clip;
    max-width: 100%;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Headings inherit their container's colour so titles stay readable inside
   dark hero cards (which set an inline colour the old rule used to beat). */
h1, h2, h3, h4 { line-height: 1.5; color: inherit; font-weight: 800; }
h1 { font-size: clamp(21px, 2.4vw, 26px); }
h2 { font-size: clamp(18px, 2vw, 21px); }
h3 { font-size: 16.5px; }
h4 { font-size: 15px; }
p { margin: 0 0 12px; }
small { font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
code, kbd, samp { font-family: inherit; font-variant-numeric: tabular-nums; font-size: .93em; font-weight: 700; direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere; }

a { color: inherit; text-decoration: none; transition: color .16s ease, background-color .16s ease, border-color .16s ease; }
img { max-width: 100%; height: auto; display: block; }
svg.icon { flex: 0 0 auto; display: inline-block; vertical-align: -0.18em; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--primary-soft); color: var(--text); }

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.skip-link {
    position: absolute; inset-inline-start: 12px; top: -60px; z-index: 2000;
    padding: 10px 16px; border-radius: 10px;
    background: var(--primary); color: var(--on-primary); font-weight: 700;
    transition: top .15s ease;
}
.skip-link:focus { top: 10px; }
.muted, .text-muted { color: var(--text-muted); }
.is-busy { opacity: .68; pointer-events: none; transition: opacity .15s ease; }

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

/* ---------- 04 Layout ---------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    /* One gutter value, so full-bleed strips can cancel it exactly. */
    --container-pad: 20px;
    padding-inline: var(--container-pad);
}
.section { padding: 36px 0; }

.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 20px; }
.grid-4 > .span-2 { grid-column: span 2; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.page-head { margin-bottom: 16px; }
.section-title { margin: 6px 0 4px; font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
/* Asymmetric two-column splits. Kept out of inline styles so phones can
   collapse them — inline grid-template-columns would beat the media query. */
.grid-2.split-main { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.grid-2.split-course { grid-template-columns: minmax(0, 1.4fr) minmax(0, .9fr); align-items: start; }
.grid-2.split-support { grid-template-columns: minmax(250px, .8fr) minmax(0, 1.6fr); align-items: start; }

.section-head,
.page-heading,
.admin-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px 18px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.section-head h1, .section-head h2,
.page-heading h1, .admin-head h1, .admin-head h2 { margin: 4px 0 0; }
.section-head h2 { font-size: clamp(19px, 2.2vw, 24px); }
.section-head p, .page-heading p, .admin-head p { margin: 6px 0 0; color: var(--text-muted); font-size: 13.5px; max-width: 78ch; }
.display-title { font-weight: 800; line-height: 1.45; }

.btn-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-row-inline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Bulk product bar: the same controls for the admin list and the booth list. */
.bulk-bar { border-inline-start: 4px solid var(--border); transition: border-color .18s ease; }
.bulk-bar-active { border-inline-start-color: var(--primary); }
.bulk-bar .form-group > .form-label { font-size: 12px; }
.bulk-bar [data-bulk-count] { font-weight: 800; color: var(--primary); }

/* ---------- 05 Components ---------- */
/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 18px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
    text-align: center;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none !important; }
.btn-sm { min-height: 34px; padding: 5px 12px; font-size: 12.8px; border-radius: 9px; gap: 6px; }
.btn-lg { min-height: 50px; padding: 12px 24px; font-size: 15.5px; border-radius: 13px; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text-soft); }
/* Dark chrome hero cards (academy, IB, wholesale): light text and
   transparent outline buttons so nothing renders light-on-light. */
.card.chrome-card {
    background: linear-gradient(135deg, var(--chrome), var(--chrome-deep));
    color: var(--on-chrome);
}
.card.chrome-card .btn-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--on-chrome);
}
.card.chrome-card .btn-outline:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); }
.btn-danger { background: var(--danger); color: #fff; }
[data-theme="dark"] .btn-danger { color: #2a0e0b; }
.btn-danger:hover { filter: brightness(.94); }
.btn-ghost { color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--primary-strong); }
.btn-block { width: 100%; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--surface-3);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
}
/* The global `code { font-size: .93em }` compounded with the badge's own 12px and produced 11.16px
   for the course code — the smallest text on the whole card, and the one a reader checks against
   the certificate. Give it the badge's size and let the mono tracking do the work. */
.badge code, .product-meta code { font-size: inherit; }
.badge-emerald { background: var(--primary-soft); color: var(--primary-strong); border-color: var(--primary-border); }
.badge-gold { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.badge-dark { background: var(--surface-3); color: var(--text-soft); border-color: var(--border); }
.badge-success { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: var(--info-border); }
.badge-outline { background: transparent; color: var(--text-soft); border-color: var(--border-strong); }

/* Alerts */
.alert {
    display: block;
    padding: 12px 16px;
    margin: 14px 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--info-border);
    background: var(--info-soft);
    color: var(--info);
    font-weight: 600;
    font-size: 13.8px;
    line-height: 1.85;
}
.alert-info { background: var(--info-soft); border-color: var(--info-border); color: var(--info); }
.alert-success { background: var(--success-soft); border-color: var(--success-border); color: var(--success); }
.alert-error, .alert-danger { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }
.alert-warn, .alert-warning { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn); }
.alert a { text-decoration: underline; text-underline-offset: 3px; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--card-edge, var(--border));
    border-radius: var(--radius);
    padding: 20px;
    min-width: 0;
    max-width: 100%;
    box-shadow: var(--shadow-sm);
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card .card { box-shadow: none; background: var(--surface-2); }
.card-hover { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-border); }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-weight: 700; font-size: 13.2px; color: var(--text-soft); margin-bottom: 6px; }
.form-label > .form-control { margin-top: 6px; font-weight: 400; }
.form-control {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--field-border);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.form-control::placeholder { color: var(--text-muted); opacity: .85; }
.form-control:hover { border-color: var(--primary); }
.form-control:focus { border-color: var(--primary); box-shadow: var(--focus-ring); }
.form-control[readonly], .form-control[disabled] { background: var(--surface-2); color: var(--text-muted); }
:where(
    input.form-control:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="image"]),
    select.form-control:not([multiple]):not([size]),
    select.form-control[size="1"]
) {
    height: 42px;
    max-height: 42px;
    flex-grow: 0;
}
.form-control-sm { min-height: 36px; padding: 6px 10px; font-size: 13px; }
:where(
    input.form-control-sm:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
    select.form-control-sm:not([multiple]):not([size])
) {
    height: 36px;
    max-height: 36px;
    flex-grow: 0;
}
textarea.form-control { min-height: 96px; height: auto; max-height: none; resize: vertical; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 16px; height: 16px; flex: 0 0 auto; }
input[type="file"].form-control { padding: 7px 10px; }
.field-error { border-color: var(--danger) !important; box-shadow: 0 0 0 3px var(--danger-soft); }
.form-hint, .profile-help { color: var(--text-muted); font-size: 12.8px; line-height: 1.85; margin: 4px 0 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; align-items: start; }
.form-grid .span-all { grid-column: 1 / -1; }

/* Price */
.price-tag { font-size: 17px; font-weight: 800; color: var(--primary-strong); white-space: nowrap; }

/* Floating controls */
.back-to-top {
    position: fixed; z-index: 1000;
    inset-inline-end: 22px; bottom: 22px;
    display: grid; place-items: center;
    width: 46px; height: 46px;
    border: 1px solid var(--primary-border); border-radius: 50%;
    background: var(--primary); color: var(--on-primary);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0; pointer-events: none; transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, background-color .16s ease;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-hover); }
.back-to-top:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow-md); }

/* Phone bottom tab bar (pamm.ir-style): fixed, five targets, hidden ≥681px. */
.bottom-nav { display: none; }
.bottom-nav-ico { position: relative; display: inline-flex; }
.bottom-nav-badge {
    position: absolute; top: -6px; inset-inline-end: -10px;
    min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
    background: var(--accent); color: var(--on-accent);
    font-size: 10px; font-weight: 800; line-height: 17px; text-align: center;
    font-variant-numeric: tabular-nums;
}
@media (max-width: 680px) {
    .bottom-nav {
        display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
        position: fixed; inset-inline: 0; bottom: 0; z-index: 150;
        background: color-mix(in srgb, var(--surface) 96%, transparent);
        -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
        border-top: 1px solid var(--border);
        padding: 5px 2px calc(5px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -6px 20px rgba(16, 20, 12, .08);
    }
    .bottom-nav a, .bottom-nav button {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        min-height: 50px; padding: 4px 2px; border: 0; background: none;
        color: var(--text-muted); font-size: 10.6px; font-weight: 700;
        cursor: pointer; text-decoration: none; border-radius: 12px;
        -webkit-tap-highlight-color: transparent;
    }
    .bottom-nav a.active { color: var(--primary-strong); background: var(--primary-soft); }
    .bottom-nav a:hover, .bottom-nav button:hover { color: var(--primary-strong); }
    /* Clearance so floating controls sit well above the bottom bar (≈1.5 cm). */
    .back-to-top { bottom: 118px; }
    .cart-toast { bottom: 76px; }
    body { padding-bottom: 62px; }
}

.cart-toast {
    position: fixed; z-index: 1100;
    inset-inline-start: 20px; bottom: 20px;
    max-width: min(520px, calc(100vw - 40px));
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--chrome); color: var(--on-chrome);
    box-shadow: var(--shadow-lg);
    font-size: 13.5px; font-weight: 600;
}
.cart-toast[hidden] { display: none; }
.cart-toast.is-error { background: #8c2a22; color: #fff; }
.cart-toast a { color: var(--on-chrome-accent); font-weight: 800; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.cart-count-pulse { animation: cart-count-pop .45s ease; }
@keyframes cart-count-pop { 50% { transform: scale(1.28); } }

/* ---------- 06 Tables & expandable rows ---------- */
.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
.card.table-wrap { padding: 16px; border-radius: var(--radius); }
.card.table-wrap > .data-table,
.card.table-wrap > table { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.data-table, .table, .table-wrap > table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--text);
    background: var(--surface);
}
.data-table th, .data-table td,
.table th, .table td,
.table-wrap > table th, .table-wrap > table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    text-align: start;
    vertical-align: middle;
}
.data-table th, .table th, .table-wrap > table th {
    background: var(--surface-2);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 12.2px;
    white-space: nowrap;
}
.data-table thead th, .table-wrap > table thead th { position: sticky; top: 0; z-index: 1; }
.data-table tbody tr, .table tbody tr, .table-wrap > table tbody tr { transition: background-color .12s ease; }
.data-table tbody tr:nth-child(even), .table-wrap > table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.data-table tbody tr:hover, .table tbody tr:hover, .table-wrap > table tbody tr:hover { background: var(--primary-soft); }
.data-table tbody tr:last-child td, .table tbody tr:last-child td, .table-wrap > table tbody tr:last-child td { border-bottom: 0; }
/* Prevent character-by-character vertical wrapping on compact columns while allowing long descriptions to wrap cleanly */
.data-table td, .table td, .table-wrap > table td { word-break: normal; overflow-wrap: break-word; }
.data-table td code, .table td code, .table-wrap > table td code,
.data-table td .badge, .table td .badge, .table-wrap > table td .badge { white-space: nowrap; }
.data-table td[dir="ltr"], .table td[dir="ltr"], .table-wrap > table td[dir="ltr"],
.cell-nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-desc { min-width: 220px; max-width: 420px; white-space: normal; line-height: 1.65; }
.cell-title { min-width: 170px; font-weight: 700; }
.data-table td .btn-row-inline, .data-table td .btn-row,
.table-wrap > table td .btn-row-inline, .table-wrap > table td .btn-row { gap: 6px; flex-wrap: nowrap; }
.data-table td.num, .data-table th.num,
.table-wrap > table td.num, .table-wrap > table th.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table td form, .table-wrap > table td form { margin: 0; }
.table-empty { padding: 26px 16px; text-align: center; color: var(--text-muted); }

/* Financial Ledger & Transaction Status Pills */
.txn-delta {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 999px;
    font-weight: 800; font-size: 12.8px;
    font-variant-numeric: tabular-nums; white-space: nowrap; direction: ltr;
}
.txn-delta.is-credit { background: #e6f6ec; color: #0f763e; }
.txn-delta.is-debit  { background: #fdeceb; color: #b92b27; }
.txn-doc {
    display: inline-block; padding: 2px 7px; border-radius: 6px;
    background: var(--surface-2); border: 1px solid var(--border);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11.5px; white-space: normal; overflow-wrap: anywhere; max-width: 100%; direction: ltr;
}

/* Discount Strikethrough & Countdown Badges */
.price-stack { display: flex; flex-direction: column; gap: 2px; }
.price-old {
    font-size: 12.2px; color: var(--text-muted);
    text-decoration: line-through; text-decoration-color: #d94848; text-decoration-thickness: 1.5px;
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.badge-discount {
    background: #dc2626; color: #fff; font-weight: 800;
    font-variant-numeric: tabular-nums; letter-spacing: 0.2px;
}
.countdown-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 9px; border-radius: 999px;
    background: rgba(220, 38, 38, 0.1); border: 1px solid rgba(220, 38, 38, 0.28);
    color: #b91c1c; font-size: 11.8px; font-weight: 800;
    font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* Phones: labelled cards for simple tables; smooth horizontal scroll for wide financial/ledger tables ([data-table-scroll]). */
@media (max-width: 760px) {
    .table-wrap { overflow-x: auto; border: 1px solid var(--border); background: var(--surface); }
    .table-wrap:has(> .data-table:not([data-table-scroll])) { overflow: visible; border: 0; background: transparent; }
    .card.table-wrap { border: 1px solid var(--border); background: var(--surface); padding: 12px; }
    .card.table-wrap > .data-table:not([data-table-scroll]) { border: 0; }
    .data-table:not([data-table-scroll]) { display: block; background: transparent; }
    .data-table:not([data-table-scroll]) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
    .data-table:not([data-table-scroll]) tbody { display: grid; gap: 12px; }
    .data-table:not([data-table-scroll]) tr,
    .data-table:not([data-table-scroll]) tbody tr:nth-child(even) {
        display: grid; grid-template-columns: minmax(0, 1fr);
        border: 1px solid var(--border); border-radius: 12px;
        background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden;
    }
    .data-table:not([data-table-scroll]) td {
        display: grid; grid-template-columns: minmax(104px, 38%) minmax(0, 1fr);
        gap: 10px; align-items: center;
        padding: 9px 12px; border-bottom: 1px solid var(--border); min-width: 0;
    }
    .data-table:not([data-table-scroll]) td:first-child { background: var(--surface-2); font-weight: 700; }
    .data-table:not([data-table-scroll]) td:last-child { border-bottom: 0; }
    .data-table:not([data-table-scroll]) td::before { content: attr(data-label); color: var(--text-muted); font-size: 12px; font-weight: 700; }
    .data-table:not([data-table-scroll]) td[colspan], .data-table:not([data-table-scroll]) td:not([data-label]) { display: block; }
    .data-table:not([data-table-scroll]) td[colspan]::before, .data-table:not([data-table-scroll]) td:not([data-label])::before { content: none; }
    .data-table:not([data-table-scroll]) td.num { text-align: start; }
    .data-table[data-table-scroll], .table-wrap > table[data-table-scroll] { min-width: 720px; }
}

/* Expandable record rows: a table-like summary line; the full record opens underneath. */
.fold-list { display: grid; gap: 10px; }
.fold-head, .fold > summary {
    display: grid;
    grid-template-columns: var(--fold-cols, 1.3fr 1fr 1.4fr 1fr 1.2fr) 28px;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
}
.fold-head {
    padding-block: 9px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 12.2px; font-weight: 700;
}
.fold {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    scroll-margin-top: calc(var(--header-h) + 16px);
}
.fold > summary { cursor: pointer; list-style: none; user-select: none; transition: background-color .14s ease; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover { background: var(--surface-2); }
.fold > summary:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
.fold[open] > summary { background: var(--primary-soft); border-bottom: 1px solid var(--primary-border); }
.fold.is-attention { border-inline-start: 4px solid var(--accent); }
.fold.is-late { border-inline-start: 4px solid var(--danger); }
.fold.is-muted { opacity: .78; }
.fold-cell { min-width: 0; font-size: 13.4px; overflow-wrap: anywhere; }
.fold-cell > strong, .fold-cell > code { display: block; font-size: 13.6px; }
.fold-cell > small { display: block; color: var(--text-muted); font-size: 12px; }
.fold-cell .badge { margin: 1px 0; }
.fold-chevron { justify-self: end; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--text-muted); transition: transform .18s ease, background-color .14s ease; }
.fold > summary:hover .fold-chevron { background: var(--surface-3); }
.fold[open] .fold-chevron { transform: rotate(180deg); color: var(--primary-strong); }
.fold-body { padding: 16px; display: grid; gap: 12px; }
.fold-body > * { margin-block: 0; min-width: 0; }
.fold-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.fold-empty { padding: 22px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius); text-align: center; color: var(--text-muted); background: var(--surface); }
@media (max-width: 860px) {
    .fold-head { display: none; }
    .fold > summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 28px; gap: 10px 12px; padding: 12px; }
    .fold > summary > .fold-cell:first-child { grid-column: 1 / 3; }
    .fold > summary > .fold-chevron { grid-column: 3; grid-row: 1; }
    .fold-cell[data-label]::before { content: attr(data-label); display: block; color: var(--text-muted); font-size: 11.5px; font-weight: 700; }
    .fold-body { padding: 12px; }
}

/* ---------- 07 Tabs, statistics, pagination ---------- */
.tabs {
    display: flex; gap: 4px;
    padding: 5px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex: 1 0 auto;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: 40px; padding: 8px 14px;
    border: 0; border-radius: 10px;
    background: transparent; color: var(--text-muted);
    font-size: 13.2px; font-weight: 700; white-space: nowrap;
    cursor: pointer;
    transition: background-color .14s ease, color .14s ease, box-shadow .14s ease;
}
.tab:hover { color: var(--primary-strong); background: var(--surface-3); }
.tab.is-active { background: var(--surface); color: var(--primary-strong); box-shadow: var(--shadow-sm); }
.tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.tab .badge { padding: 0 7px; font-size: 11px; }
.tabs-ready [data-tab-panel]:not(.is-active) { display: none; }
[data-tab-panel] { scroll-margin-top: calc(var(--header-h) + 16px); }
[data-tab-panel] + [data-tab-panel] { margin-top: 22px; }
.tabs-ready [data-tab-panel] + [data-tab-panel] { margin-top: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card, .kpi-card {
    position: relative;
    display: grid; gap: 4px; align-content: start;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}
.stat-card::before { content: ''; position: absolute; inset-block: 14px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--primary); opacity: .75; }
.stat-label, .kpi-card span { display: block; color: var(--text-muted); font-size: 12.6px; font-weight: 600; line-height: 1.7; }
.stat-value, .kpi-card strong { display: block; color: var(--text); font-size: clamp(18px, 2vw, 22px); font-weight: 800; line-height: 1.5; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.stat-card small { color: var(--text-muted); font-size: 12.2px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }

.shop-load-more-wrap { display: grid; justify-items: center; gap: 8px; margin-top: 26px; }
.shop-load-more-wrap .btn { min-width: min(100%, 260px); }
.load-more-sentinel { width: 100%; height: 1px; }
.shop-pagination, .pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin: 20px 0 0; }
.shop-page-number {
    display: grid; place-items: center;
    min-width: 38px; height: 38px; padding: 0 10px;
    border: 1px solid var(--border-strong); border-radius: 10px;
    background: var(--surface); color: var(--text-soft);
    font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.shop-page-number:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.shop-page-number.is-current { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.pagination-gap { color: var(--text-muted); padding: 0 2px; }

/* ---------- 08 Site header ---------- */
.util-bar {
    background: var(--chrome);
    color: var(--on-chrome);
    font-size: 12.6px;
    padding: 7px 0;
}
.util-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.util-links { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; }
.util-links a, .util-btn {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--on-chrome-soft);
    background: none; border: 0; padding: 2px 0;
    font-size: inherit; font-weight: 600; cursor: pointer;
}
.util-links a:hover, .util-btn:hover { color: #fff; }
.util-links a.util-strong { color: var(--on-chrome); font-weight: 800; }
.util-links a.util-lang b { font-size: 12.6px; letter-spacing: .6px; }
.util-btn-icon { padding: 3px 6px; border-radius: 8px; line-height: 0; }
.util-btn-icon:hover { background: rgba(255,255,255,.12); }
.live-clock-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    color: var(--on-chrome);
    font-weight: 600; font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .theme-icon-moon, :root:not([data-theme="dark"]) .theme-icon-sun { display: none; }

.site-header {
    position: sticky; top: 0; z-index: 90;
    background: color-mix(in srgb, var(--surface) 93%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px;
    min-height: var(--header-h);
    flex-wrap: wrap;
    padding: 10px 0;
}
.header-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.brand-logo img { width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto; }
.brand-text { min-width: 0; }
.brand-text strong { display: block; font-size: 18px; font-weight: 800; color: var(--primary-strong); line-height: 1.3; }
.brand-text span { display: block; font-size: 11.8px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.cart-pill { position: relative; }
.cart-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 999px;
    background: var(--accent); color: var(--on-accent);
    font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums;
}

/* Mega menu */
.nav-mega-wrap { display: flex; align-items: center; gap: 2px; }
.mega-item { position: relative; }
.mega-trigger {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px;
    border: 0; border-radius: 10px;
    background: transparent; color: var(--text-soft);
    font-weight: 700; font-size: 14px; cursor: pointer;
}
.mega-trigger:hover, .mega-item.is-open > .mega-trigger, html:not(.mega-js) .mega-item:hover > .mega-trigger, html:not(.mega-js) .mega-item:focus-within > .mega-trigger, .mega-trigger.active { background: var(--primary-soft); color: var(--primary-strong); }
.mega-caret { display: inline-grid; opacity: .7; transition: transform .18s ease; }
.mega-item.is-open .mega-caret, html:not(.mega-js) .mega-item:hover .mega-caret, html:not(.mega-js) .mega-item:focus-within .mega-caret { transform: rotate(180deg); }
.mega-panel {
    position: absolute; top: calc(100% + 8px); inset-inline-start: 0;
    width: min(760px, 88vw);
    padding: 20px;
    border: 1px solid var(--border); border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(8px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
    z-index: 150;
}
.mega-panel.mega-panel-sm { width: min(440px, 88vw); }
.mega-panel.mega-panel-md { width: min(580px, 88vw); }
.mega-item.is-open > .mega-panel,
html:not(.mega-js) .mega-item:hover > .mega-panel,
html:not(.mega-js) .mega-item:focus-within > .mega-panel {
    opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
}
html:not(.mega-js) .mega-item:hover > .mega-panel { transition-delay: .16s; }
.mega-item::after { content: ''; position: absolute; inset-inline: 0; top: 100%; height: 12px; pointer-events: none; }
.mega-item.is-open::after, html:not(.mega-js) .mega-item:hover::after { pointer-events: auto; }
.mega-cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.mega-cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.mega-col-title {
    margin: 0 0 8px; padding-bottom: 7px;
    border-bottom: 1px solid var(--border);
    color: var(--accent); font-size: 12.2px; font-weight: 800;
}
.mega-links { display: flex; flex-direction: column; gap: 2px; }
.mega-links a { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 2px 9px; align-items: start; padding: 8px 9px; border-radius: 10px; }
.mega-links a:hover { background: var(--surface-2); }
.mega-links a > .icon { grid-row: 1 / span 2; margin-top: 3px; color: var(--primary); }
.mega-links a strong { grid-column: 2; font-size: 13.6px; font-weight: 700; color: var(--text); }
.mega-links a strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mega-links a span {
    grid-column: 2; font-size: 12px; color: var(--text-muted); line-height: 1.55;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

/* Live search */
.header-search { position: relative; flex: 0 1 300px; min-width: 160px; max-width: 300px; }
/* Desktop: search collapses to a magnifier; the panel opens under the header. */
.header-search-toggle {
    display: none;
    width: 42px; height: 42px;
    border-radius: 11px; border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text);
    align-items: center; justify-content: center; cursor: pointer;
}
.header-search-toggle:hover { background: var(--primary-soft); color: var(--primary-strong); }
.header-search-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }
@media (min-width: 681px) {
    .header-inner { position: relative; }
    .header-search-toggle { display: inline-flex; }
    .site-header:not(.search-open) .header-search { display: none; }
    .site-header.search-open .header-search {
        display: block;
        position: absolute; top: calc(100% + 8px); inset-inline: 0;
        z-index: 70; max-width: none; min-width: 0; flex: none;
        padding: 14px;
        background: var(--surface);
        border: 1px solid var(--border); border-radius: 16px;
        box-shadow: var(--shadow-lg);
    }
    .site-header.search-open .header-search-input { min-height: 46px; font-size: 14px; background: var(--surface); }
    .site-header.search-open .header-search-results {
        position: static; margin-top: 10px; padding: 6px;
        border-radius: 12px; box-shadow: none;
    }
}
.header-search form { margin: 0; position: relative; }
.header-search-submit { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); cursor: pointer; }
.header-search-submit:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.header-search .header-search-input { padding-inline-end: 48px; }

.header-search form > .icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.header-search-input {
    width: 100%; min-height: 40px;
    padding: 8px 12px; padding-inline-start: 38px;
    border-radius: 11px; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text);
    font: inherit; font-size: 13.6px;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.header-search-input::placeholder { color: var(--text-muted); }
.header-search-input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: var(--focus-ring); }
.header-search-results {
    position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 160;
    max-height: 70vh; overflow: auto;
    padding: 8px;
    border: 1px solid var(--border); border-radius: 13px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.hs-group + .hs-group { margin-top: 6px; border-top: 1px solid var(--border); padding-top: 6px; }
.hs-title { font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 4px 6px; }
.hs-item { display: flex; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 9px; color: inherit; }
.hs-item:hover, .hs-item:focus { background: var(--surface-2); outline: none; }
.hs-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: var(--surface-3); }
.hs-item-slim { gap: 8px; }
.hs-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: 0 0 auto; }
.hs-body { display: flex; flex-direction: column; min-width: 0; }
.hs-name { font-size: 13.2px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-meta { font-size: 12px; color: var(--text-muted); }
.hs-empty { padding: 14px 8px; font-size: 13px; color: var(--text-muted); }
.hs-more { display: block; text-align: center; font-size: 12.8px; font-weight: 700; padding: 8px; color: var(--primary-strong); }

/* ---------- 09 Mobile drawer ---------- */
.mobile-menu-btn {
    display: none; align-items: center; justify-content: center;
    width: 42px; height: 42px;
    border-radius: 11px; border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text);
    cursor: pointer;
}
.mobile-drawer-backdrop {
    display: none; position: fixed; inset: 0; z-index: 200;
    background: rgba(16, 20, 12, 0.55);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.mobile-drawer {
    display: none; position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 210;
    width: min(340px, 88vw);
    padding: 18px 16px 30px;
    background: var(--surface);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
body.drawer-open { overflow: hidden; }
body.drawer-open .mobile-drawer-backdrop, body.drawer-open .mobile-drawer { display: block; }
.mobile-drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.mobile-drawer-head strong { color: var(--primary-strong); font-size: 16px; }
.mobile-acc { border-bottom: 1px solid var(--border); padding: 6px 0; }
.mobile-acc summary {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    min-height: 44px; padding: 6px 4px;
    list-style: none; cursor: pointer;
    font-weight: 800; font-size: 14.5px;
}
.mobile-acc summary::-webkit-details-marker { display: none; }
.mobile-acc summary > span:first-child { display: inline-flex; align-items: center; gap: 9px; }
.mobile-acc summary .icon:last-child { transition: transform .18s ease; color: var(--text-muted); }
.mobile-acc[open] summary .icon:last-child { transform: rotate(180deg); }
.mobile-acc[open] summary { color: var(--primary-strong); }
.mobile-acc-links { display: grid; gap: 4px; padding: 4px 4px 10px; }
.mobile-acc-links a { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.6px; font-weight: 600; }
.mobile-acc-links a:hover { background: var(--primary-soft); color: var(--primary-strong); }
.mobile-drawer-actions { display: grid; gap: 8px; margin-top: 16px; }

/* ---------- 10 Footer ---------- */
.site-footer { background: var(--chrome-deep); color: var(--on-chrome-soft); padding: 46px 0 26px; margin-top: 56px; }
.footer-about { min-width: 0; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 28px; padding-bottom: 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.footer-contact-panel { justify-self: end; max-width: 320px; }
.footer-nav-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 34px; margin-top: 22px; }
.footer-nav-col { min-width: 0; }
.footer-nav-col h4 { font-size: 14px; letter-spacing: .01em; }
.site-footer h4 { color: #fff; margin: 0 0 12px; font-size: 15.5px; }
.site-footer p { font-size: 13.5px; line-height: 1.9; }
.footer-contact { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13.2px; color: var(--on-chrome-accent); }
.footer-contact li { display: flex; gap: 8px; align-items: flex-start; }
.footer-contact a { color: inherit; }
.footer-contact a:hover { color: #fff; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; font-size: 13.5px; }
.footer-links a { color: var(--on-chrome-soft); }
.footer-links a:hover { color: #fff; }
.footer-bottom {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    margin-top: 30px; padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 12.6px; color: var(--on-chrome-soft);
}
@media (max-width: 992px) {
    .footer-grid { grid-template-columns: minmax(0, 1fr); }
    .footer-contact-panel { justify-self: start; max-width: none; }
    .footer-nav-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .footer-nav-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}

/* ---------- 11 Storefront ---------- */
.hero-section { padding: 40px 0 32px; }
.hero-card {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: 1.25fr 0.95fr; gap: 36px; align-items: center;
    padding: 44px;
    border-radius: var(--radius-lg);
    background: var(--hero-gradient);
    color: var(--on-chrome);
    box-shadow: var(--shadow-md);
}
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    margin-bottom: 16px; padding: 5px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    color: var(--on-chrome-accent);
    font-size: 13px; font-weight: 700;
}
.hero-title { margin: 0 0 16px; color: #fff; font-size: clamp(27px, 3.5vw, 42px); line-height: 1.38; font-weight: 800; }
.hero-sub { margin: 0 0 26px; max-width: 620px; color: var(--on-chrome-soft); font-size: 16px; line-height: 1.95; }
.hero-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-card .btn-primary { background: #fdfdfb; color: #333b2a; }
.hero-card .btn-primary:hover { background: #fff; color: #1f241b; }
.hero-card .btn-outline { background: transparent; border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.hero-card .btn-outline:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; color: #fff; }
.hero-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.hero-metrics strong { display: block; font-size: 21px; color: var(--on-chrome-accent); }
.hero-metrics span { font-size: 12.6px; color: var(--on-chrome-soft); }
.hero-showcase img { width: 100%; border-radius: 20px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32); border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.08); }

.eco-card { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.eco-card h3 { margin: 4px 0; font-size: 16.5px; }
.eco-card p { margin: 0; color: var(--text-muted); font-size: 13.5px; }
.eco-link { font-weight: 700; font-size: 13.5px; color: var(--primary-strong); }

.product-card {
    display: flex; flex-direction: column;
    overflow: hidden; min-width: 0;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-border); }
.product-thumb { position: relative; display: block; width: 100%; flex: 0 0 auto; aspect-ratio: 640 / 520; background: var(--surface-3); overflow: hidden; }
.product-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.product-thumb img[src$=".svg"] { object-fit: contain; }
.product-card:hover .product-thumb img { transform: scale(1.03); }
.product-badges { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.product-badges .badge { background: color-mix(in srgb, var(--surface) 92%, transparent); border-color: var(--border); color: var(--text-soft); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.product-body { display: flex; flex-direction: column; flex: 1; gap: 8px; padding: 15px 16px 16px; min-width: 0; }
.product-title { margin: 0; font-size: 15.2px; font-weight: 700; line-height: 1.65; }
.product-title a:hover { color: var(--primary-strong); }
.product-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.4px; color: var(--text-muted); }
.product-meta code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--text-soft); font-size: 11.5px; }
.product-meta .icon { color: var(--primary); }
.product-excerpt { margin: 0; font-size: 13px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.product-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.product-fact { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 12.8px; color: var(--text-soft); }
.product-fact .icon { color: var(--primary); }
.product-fact b { color: var(--text); font-weight: 700; }
.product-fact a:hover { color: var(--primary-strong); text-decoration: underline; text-underline-offset: 3px; }

.finder-box { background: var(--surface); border: 1px solid var(--accent-border); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-md); }
.finder-controls { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; align-items: end; margin-top: 16px; }
.finder-controls > * { min-width: 0; }
@media (max-width: 1180px) { .finder-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .finder-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .finder-controls { grid-template-columns: 1fr; } }

.swatch-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 10px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; font-weight: 600; font-size: 13px; }
.swatch-chip:hover { border-color: var(--primary); }
.swatch-chip.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.swatch-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border-strong); }

.qty-stepper { display: inline-flex; align-items: center; gap: 4px; }
.qty-stepper .btn { min-height: 32px; padding: 4px 10px; line-height: 1; }
.qty-stepper input[type="number"] { -moz-appearance: textfield; appearance: textfield; text-align: center; }
.qty-stepper input[type="number"]::-webkit-outer-spin-button,
.qty-stepper input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.order-stepper { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 18px 0; }
.order-step { padding: 11px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); text-align: center; font-size: 12.8px; }
.order-step.done { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-strong); font-weight: 700; }
.order-step.current { background: var(--accent-soft); border-color: var(--accent); color: var(--text); font-weight: 800; }

/* Seller comparison for one catalogue item */
.product-offers { margin: 0 0 18px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.product-offers-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.product-offers-heading h2 { margin: 0; font-size: 16px; }
.product-offers-heading p { margin: 4px 0 0; color: var(--text-muted); font-size: 12.5px; line-height: 1.8; max-width: 760px; }
.product-offer-canonical-name { margin-top: 3px; font-size: 13px; font-weight: 700; color: var(--primary-strong); }
.product-offer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 10px; }
.product-offer-card { min-width: 0; display: flex; flex-direction: column; gap: 7px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.product-offer-card.is-selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.product-offer-card.is-unavailable { opacity: .7; }
.product-offer-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.product-offer-top > strong { flex: 1 1 100%; font-size: 14px; }
.product-offer-price { color: var(--primary-strong); font-size: 18px; font-weight: 800; }
.product-offer-meta { color: var(--text-muted); font-size: 12px; line-height: 1.7; }
.product-offer-methods { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-size: 12px; }
.product-offer-methods > span { padding: 3px 7px; border-radius: 6px; background: var(--surface-2); }
.product-offer-action { display: flex; justify-content: flex-end; margin-top: auto; padding-top: 3px; }
.product-offers-footnote { display: block; margin-top: 10px; color: var(--text-muted); font-size: 12px; }

/* Shoppable card embedded in a journal article */
.mag-anchor-card { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 16px; align-items: center; margin: 26px 0; padding: 14px; border: 1px solid var(--accent-border); border-inline-start: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface-2); }
.mag-anchor-card > a { display: block; width: 100%; min-width: 0; border-radius: 11px; overflow: hidden; background: var(--surface-3); }
.mag-anchor-card.mag-anchor-course { border-color: var(--primary-border); border-inline-start-color: var(--primary); }
/* Unresolved [[product:]] / [[course:]] anchor: readers keep a quiet one-line notice, staff see the cause */
.mag-anchor-missing { color: var(--text-muted); font-size: .92em; }
.mag-anchor-card.mag-anchor-broken { display: block; grid-template-columns: 1fr; border-style: dashed; border-inline-start-color: var(--danger); background: var(--surface); }
.mag-anchor-card.mag-anchor-broken h4 { margin: 6px 0 4px; font-size: 15px; color: var(--text-muted); font-weight: 600; }
.mag-anchor-card.mag-anchor-broken p { margin: 0 0 6px; color: var(--text-muted); font-size: .88rem; }
.mag-anchor-card.mag-anchor-broken .mag-anchor-hint { margin: 8px 0 0; font-size: .85rem; }
/* Academy covers: intrinsic 16:9. Height must stay auto, or the height="" attribute wins over
   aspect-ratio and the image stretches into a strip. Vector SVG covers scale with object-fit:contain
   so 100% of the illustration stays visible across every desktop, tablet and smartphone width. */
.academy-cover { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-3); }
.academy-cover[src$=".svg"] { object-fit: contain; }
.academy-cover-card { border-radius: 13px; margin: 0; }
.academy-cover-hero { border-radius: 14px; margin: 0; }
.academy-cover-event { border-radius: 10px; margin-bottom: 10px; }
.academy-hero-media {
    width: 100%; max-width: 780px; margin: 12px auto 14px;
    border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-3);
}
.academy-hero-media .academy-cover { border-radius: 0; margin: 0; }
.academy-course-aside {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    width: min(100%, 300px); flex: 0 0 auto;
}
.academy-course-aside-media {
    width: 100%; border-radius: 14px; overflow: hidden;
    border: 1px solid var(--border); background: var(--surface-3);
}
.academy-course-qr {
    width: 100%; text-align: center; background: var(--surface-2);
    padding: 12px; border-radius: 14px; border: 1px solid var(--border);
}
@media (max-width: 760px) {
    .academy-course-aside { width: 100%; max-width: none; }
}

/* ---------- Academy catalogue (tabs, 3-up grid, paging) ---------- */
.academy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 20px;
    align-items: stretch;
    margin-bottom: 12px;
}
@media (min-width: 1000px) {
    .academy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
}
@media (max-width: 640px) {
    .academy-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
.academy-card {
    position: relative;
    isolation: isolate;
    display: flex; flex-direction: column;
    height: 100%; min-width: 0; margin: 0; padding: 0 !important; overflow: hidden;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
@media (hover: hover) {
    .academy-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-border); }
    .academy-card:hover .academy-card-media img { transform: scale(1.025); }
}
@media (hover: none) {
    .academy-card.card-hover:hover { transform: none; }
}
.academy-card-media {
    position: relative; display: block; width: 100%; flex: 0 0 auto;
    aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-3);
    border-bottom: 1px solid var(--border);
}
.academy-card-media img {
    display: block; width: 100%; height: 100%; max-width: 100%;
    object-fit: cover; border-radius: 0; margin: 0;
    transition: transform .3s ease;
}
.academy-card-media img[src$=".svg"] { object-fit: contain; }
.academy-card .academy-cover-card { border-radius: 0; }
.academy-card-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1 1 auto; padding: 14px 16px 12px; }
.academy-card-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.academy-card-title {
    margin: 2px 0 0; font-size: 15.5px; line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: calc(2 * 1.6em);
}
.academy-card-title a { color: inherit; text-decoration: none; }
.academy-card-title a:hover { color: var(--accent); }
.academy-card-summary {
    margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.85;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.academy-card-meta-group {
    margin-top: auto; padding-top: 6px;
    display: grid; gap: 5px;
}
.academy-card-meta {
    margin: 0; display: flex; flex-wrap: wrap; gap: 5px 12px;
    font-size: 12.4px; color: var(--text-muted); align-items: center;
}
.academy-card-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.academy-card-meta .icon { color: var(--primary); }
.academy-card-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 10px 12px;
    margin-top: 0; padding: 12px 16px 14px; border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface-2) 50%, var(--surface));
    flex-wrap: wrap;
}
.academy-card-foot .price-tag { font-size: 13.6px; }
.academy-card-foot .btn { flex: 0 0 auto; white-space: nowrap; }
/* Across all smartphones (<= 560px), stack the price and full-width CTA button cleanly inside the
   footer so buttons and borders never collide, wrap awkwardly, or touch adjacent cards. */
@media (max-width: 560px) {
    .academy-card-body { padding: 14px 15px 12px; }
    .academy-card-title { min-height: 0; }
    .academy-card-foot { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 15px 15px; text-align: center; }
    .academy-card-foot .btn { width: 100%; min-height: 42px; justify-content: center; }
}
.academy-card-no-cover .academy-card-body { padding-top: 16px; }

/* Tabs: two real destinations, so they are links (they survive being opened in a new tab and
   they are crawlable), styled as a segmented control. */
.academy-tabs {
    display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px;
    padding: 5px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border);
}
.academy-tab {
    display: inline-flex; align-items: center; gap: 8px; flex: 1 1 auto; justify-content: center;
    padding: 10px 14px; border-radius: 10px; text-decoration: none; font-weight: 800; font-size: 13.6px;
    color: var(--text-muted); border: 1px solid transparent; transition: background .15s, color .15s;
    /* Two tabs share one row at every width. `flex: 1 1 auto` with the default `min-width: auto`
       made each tab refuse to shrink below its content, so on a phone they couldn't share the track
       and stacked into two full-width bars — the segmented control fell apart. Taking the basis to 0
       and letting them shrink is what keeps them a single control from 320px up, in both locales. */
    white-space: nowrap;
    flex: 1 1 0%;
    min-width: 0;
}
.academy-tab-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.academy-tab-count { flex: 0 0 auto; }
/* Two tabs must stay one control on a phone. At the desktop padding they measured 166 + 172 + 6px
   of gap against 343px of track — one pixel too wide, so they wrapped and the segmented control
   fell apart into two full-width bars. */
@media (max-width: 480px) {
    .academy-tab { padding: 10px 9px; gap: 6px; font-size: 13px; }
}
/* A 320px phone (iPhone SE, older Android): 298px of track for 164 + 172px of tabs. Drop the icon
   — the label and the count are what the reader is choosing between. */
@media (max-width: 360px) {
    .academy-tab .icon { display: none; }
    .academy-tab { padding: 10px 8px; }
}
.academy-tab:hover { color: var(--text); background: var(--surface-3); }
.academy-tab.is-active { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.academy-tab-count {
    font-variant-numeric: tabular-nums; font-size: 12.4px; padding: 1px 7px; border-radius: 999px;
    background: var(--surface-3); color: var(--text-muted);
}
.academy-tab.is-active .academy-tab-count { background: var(--accent); color: #fff; }

/* One row, one height. The field used to be `flex: 1 1 220px` inside a 308px form, so the button
   could not fit beside it and wrapped to a second line: the search box sat above its own button,
   the header block grew to twice the height of the heading beside it, and the control looked broken
   on every breakpoint including a desktop. `flex-wrap: nowrap` keeps the field and the button on one
   baseline; the field shrinks, the buttons keep their intrinsic width. */
.academy-search { display: flex; gap: 8px; flex-wrap: nowrap; align-items: center; margin: 0; }
.academy-search .form-control { flex: 1 1 0%; min-width: 0; width: auto; }
.academy-search .btn { flex: 0 0 auto; white-space: nowrap; }
.academy-result-line { margin: 0 0 16px; font-size: 13px; color: var(--text-muted); }
.academy-empty { text-align: center; padding: 28px 18px; color: var(--text-muted); }
/* The level filter is a control, not a paragraph: it sits above the grid with the same small
   spacing the tabs use, so the catalogue reads as tabs → filter → cards. */
.academy-levels { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; }
.academy-verify-hint {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: 22px 0 0; padding: 12px 14px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--border); font-size: 13.2px; color: var(--text-muted);
}
.academy-verify-hint a { font-weight: 800; }

.mag-anchor-img { display: block; width: 100%; height: auto; aspect-ratio: 640 / 520; object-fit: cover; border-radius: 11px; background: var(--surface-3); margin: 0 !important; }
.mag-anchor-card.mag-anchor-course .mag-anchor-img { aspect-ratio: 16 / 9; }
.mag-anchor-img[src$=".svg"] { object-fit: contain; }
.mag-anchor-body h4 { margin: 6px 0; font-size: 16px; }
.mag-anchor-body h4 a { text-decoration: none !important; color: var(--text) !important; }
.mag-anchor-body p { margin: 0 0 12px; font-size: 13.4px; color: var(--text-muted); }
.mag-anchor-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mag-anchor-actions form { margin: 0; }

/* ---------- 12 Checkout & order records ---------- */
.parcel-card { min-width: 0; margin: 0 0 14px; padding: 12px 14px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.parcel-options { display: grid; gap: 8px; }
.parcel-option, .pickup-point { cursor: pointer; background: var(--surface); transition: border-color .14s ease, background-color .14s ease; }
.parcel-option:hover, .pickup-point:hover { background: var(--surface-2); }
.parcel-option.is-selected, .pickup-point.is-selected { background: var(--primary-soft); }
.parcel-pickup { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-strong); }
.pickup-map { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-3); }
.parcel-fees { display: grid; gap: 6px; font-size: 13px; }
.tariff-cards { display: grid; gap: 12px; }

.order-highlight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 10px; }
.order-info-box, .order-address-box, .order-note-box, .order-payment-box, .order-gift-box, .order-cod-note {
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-inline-start-width: 4px;
    border-radius: 11px;
    background: var(--surface-2);
    color: var(--text);
    line-height: 1.85; font-size: 13.4px;
    overflow-wrap: anywhere;
}
.order-info-box small { display: block; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.order-info-box strong { display: block; font-size: 13.6px; }
.order-info-box { border-inline-start-color: var(--border-strong); }
.order-date-box { border-color: var(--success-border); border-inline-start-color: var(--success); background: var(--success-soft); }
.order-address-box { border-color: var(--info-border); border-inline-start-color: var(--info); background: var(--info-soft); }
.order-note-box, .order-cod-note { border-color: var(--warn-border); border-inline-start-color: var(--warn); background: var(--warn-soft); }
.order-payment-box { border-color: var(--primary-border); border-inline-start-color: var(--primary); background: var(--primary-soft); }
.order-gift-box { border-color: var(--violet-border); border-inline-start-color: var(--violet); background: var(--violet-soft); }
.order-address-box > strong, .order-note-box > strong, .order-payment-box > strong, .order-gift-box > strong { display: block; font-size: 12.6px; color: var(--text-soft); }
.order-gift-box ul { margin: 4px 0; padding-inline-start: 20px; }
.order-money-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 0; }
.order-money-grid > div { padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-money-grid small { display: block; color: var(--text-muted); font-weight: 600; font-size: 11.8px; }
.order-money-grid > .order-money-total { border-color: var(--success-border); background: var(--success-soft); color: var(--success); font-weight: 800; }
.order-item-note { display: inline-block; margin-top: 3px; padding: 3px 8px; border-radius: 7px; background: var(--warn-soft); color: var(--warn); font-size: 12.4px; }
.order-section { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.order-section > h4, .order-section > strong:first-child { display: block; margin: 0 0 8px; font-size: 13.8px; }
.order-parcel-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 10px 12px;
    align-items: start;
    margin-top: 10px;
    padding: 12px;
    border-radius: 10px;
    background: var(--surface-2);
}
.order-parcel-form .form-control { width: 100%; max-width: none; flex: 0 0 auto; }
.order-parcel-info { grid-column: 1 / -1; min-width: 0; font-size: 13px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.order-parcel-info small { display: block; color: var(--text-muted); line-height: 1.8; }
.order-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.order-actions form { margin: 0; }
.order-actions .order-actions-wide { flex: 1 1 100%; }
.text-success { color: var(--success); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }

.vendor-order-details-grid { display: grid; gap: 10px; }
.vendor-order-detail-box { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); overflow-wrap: anywhere; font-size: 13.2px; }
.vendor-order-detail-box > small { display: block; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.vendor-order-detail-box > strong, .vendor-order-detail-box > span { display: block; }
.vendor-receipt-box { border-color: var(--warn-border); background: var(--warn-soft); }
.vendor-order-money-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.vendor-order-money-grid > div { padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.vendor-order-money-grid small { display: block; color: var(--text-muted); font-size: 11.8px; font-weight: 600; }
.vendor-order-money-grid strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.vendor-order-money-grid > .vendor-order-grand-total { border-color: var(--success-border); background: var(--success-soft); color: var(--success); }
.vendor-gift-details { display: grid; gap: 5px; padding: 11px 13px; border: 1px solid var(--violet-border); border-inline-start: 4px solid var(--violet); border-radius: 10px; background: var(--violet-soft); line-height: 1.85; font-size: 13.2px; }
.vendor-gift-details ul { margin: 0; padding-inline-start: 20px; }

/* ---------- 13 Workspace (customer, seller and admin panels) ---------- */
.panel-shell {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
    padding-block: 26px 54px;
}
.panel-main { min-width: 0; }
.panel-main > div > h1:first-child, .panel-main > h1:first-child { margin-top: 0; }

.panel-nav {
    position: sticky;
    top: calc(var(--header-h) + 14px);
    display: flex; flex-direction: column;
    max-height: calc(100vh - var(--header-h) - 28px);
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.panel-nav-head {
    display: flex; align-items: center; gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.panel-nav-avatar {
    display: grid; place-items: center; flex: 0 0 auto;
    width: 44px; height: 44px;
    border-radius: 13px;
    background: var(--primary); color: var(--on-primary);
    font-size: 19px; font-weight: 800;
}
.panel-nav-id { display: grid; gap: 1px; min-width: 0; flex: 1; }
.panel-nav-id > span { color: var(--primary-strong); font-size: 11.8px; font-weight: 700; }
.panel-nav-id > strong { overflow: hidden; color: var(--text); font-size: 14.2px; text-overflow: ellipsis; white-space: nowrap; }
.panel-nav-id > small { overflow: hidden; color: var(--text-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.panel-nav-toggle {
    display: none; align-items: center; gap: 6px; flex: 0 0 auto;
    min-height: 40px; padding: 6px 12px;
    border: 1px solid var(--border-strong); border-radius: 10px;
    background: var(--surface); color: var(--text-soft);
    font-size: 13px; font-weight: 700; cursor: pointer;
}
.panel-nav-toggle .icon:last-child { transition: transform .18s ease; }
.panel-nav.is-open .panel-nav-toggle .icon:last-child { transform: rotate(180deg); }
.panel-nav-body { display: grid; gap: 3px; align-content: start; padding: 10px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.panel-nav-link, .panel-nav-group > summary {
    display: flex; align-items: center; gap: 10px;
    min-height: 44px; padding: 7px 9px;
    border-radius: 11px;
    color: var(--text-soft);
    font-size: 13.8px; font-weight: 700; line-height: 1.5;
    cursor: pointer; user-select: none; list-style: none;
    transition: background-color .14s ease, color .14s ease;
}
.panel-nav-group > summary::-webkit-details-marker { display: none; }
.panel-nav-ico {
    display: grid; place-items: center; flex: 0 0 auto;
    width: 30px; height: 30px;
    border-radius: 9px;
    background: var(--surface-2); color: var(--primary);
    transition: background-color .14s ease, color .14s ease;
}
.panel-nav-link:hover, .panel-nav-group > summary:hover { background: var(--surface-2); color: var(--primary-strong); }
.panel-nav-link:hover .panel-nav-ico, .panel-nav-group > summary:hover .panel-nav-ico { background: var(--surface-3); }
.panel-nav-link.active { background: var(--primary); color: var(--on-primary); }
.panel-nav-link.active .panel-nav-ico { background: rgba(255, 255, 255, 0.2); color: inherit; }
[data-theme="dark"] .panel-nav-link.active .panel-nav-ico { background: rgba(0, 0, 0, 0.16); }
.panel-nav-group[open] > summary { background: var(--primary-soft); color: var(--primary-strong); }
.panel-nav-group[open] > summary .panel-nav-ico { background: var(--surface); color: var(--primary-strong); }
.panel-nav-group.has-active:not([open]) > summary { color: var(--primary-strong); }
.panel-nav-group.has-active:not([open]) > summary .panel-nav-ico { background: var(--primary-soft); }
.panel-nav-chevron { margin-inline-start: auto; color: var(--text-muted); transition: transform .18s ease; }
.panel-nav-group[open] .panel-nav-chevron { transform: rotate(180deg); color: inherit; }
.panel-nav-sub {
    display: grid; gap: 2px;
    margin: 4px 0 6px; margin-inline-start: 24px;
    padding-inline-start: 12px;
    border-inline-start: 2px solid var(--border);
}
.panel-nav-sub a {
    position: relative;
    display: flex; align-items: center; gap: 8px;
    min-height: 38px; padding: 6px 10px;
    border-radius: 9px;
    color: var(--text-soft);
    font-size: 13.2px; font-weight: 600; line-height: 1.55;
}
.panel-nav-sub a:hover { background: var(--surface-2); color: var(--primary-strong); }
.panel-nav-sub a.active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 800; }
.panel-nav-sub a.active::before { content: ''; position: absolute; inset-inline-start: -14px; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--primary); }
.panel-nav-count {
    margin-inline-start: auto; flex: 0 0 auto;
    min-width: 22px; padding: 0 7px;
    border-radius: 999px;
    background: var(--accent); color: var(--on-accent);
    font-size: 11.5px; font-weight: 800; line-height: 1.8; text-align: center; font-variant-numeric: tabular-nums;
}
.panel-nav-summary-count { margin-inline-start: auto; }
.panel-nav-summary-count + .panel-nav-chevron { margin-inline-start: 0; }
.panel-nav-foot { display: grid; gap: 2px; padding: 8px 10px 10px; border-top: 1px solid var(--border); background: var(--surface); }
.panel-nav-foot a {
    display: flex; align-items: center; gap: 10px;
    min-height: 40px; padding: 6px 9px;
    border-radius: 10px;
    color: var(--text-muted); font-size: 13.2px; font-weight: 700;
}
.panel-nav-foot a:hover { background: var(--surface-2); color: var(--primary-strong); }
.panel-nav-foot a.is-danger { color: var(--danger); }
.panel-nav-foot a.is-danger:hover { background: var(--danger-soft); color: var(--danger); }
.panel-nav-foot a.is-accent { color: var(--accent); }
.panel-nav-foot a.is-accent:hover { background: var(--accent-soft); }
.panel-nav a:focus-visible, .panel-nav summary:focus-visible, .panel-nav-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Legacy wrappers kept for older partner templates. */
.workspace-shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 26px; align-items: start; padding-block: 26px 54px; }
.workspace-main { min-width: 0; }

.page-title { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin: 0 0 18px; }
.page-title h1 { margin: 0; }
.page-title p { flex: 1 1 100%; margin: 0; color: var(--text-muted); font-size: 13.5px; }
.empty-state { padding: 30px 18px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text-muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 15px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 14px; padding: 0; list-style: none; color: var(--text-muted); font-size: 12.8px; }
.breadcrumbs a:hover { color: var(--primary-strong); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumbs li + li::before { content: '/'; color: var(--border-strong); }

/* ---------- 14 Journal (magazine) ---------- */
.mag-page { padding: 24px 0 44px; }
.mag-masthead {
    display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.85fr); gap: 28px; align-items: center;
    padding: clamp(22px, 4vw, 44px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-soft) 0%, var(--surface) 52%, var(--surface-2) 100%);
    box-shadow: var(--shadow-sm);
}
.mag-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--primary-strong); font-size: 13px; font-weight: 800; }
.mag-masthead h1 { margin: 10px 0; font-size: clamp(25px, 3.5vw, 38px); line-height: 1.5; }
.mag-lead { max-width: 62ch; margin: 0; color: var(--text-soft); font-size: 15.5px; line-height: 2.05; }
.mag-search { display: flex; gap: 8px; max-width: 520px; margin-top: 20px; }
.mag-search .form-control { min-width: 0; flex: 1; }
.mag-facts { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.mag-fact { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.mag-fact-ico { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-strong); line-height: 0; }
.mag-fact-ico svg { display: block; vertical-align: 0; }
.mag-fact > div { min-width: 0; }
.mag-fact strong { display: block; font-size: 15.5px; line-height: 1.5; }
.mag-fact > div > span { display: block; color: var(--text-muted); font-size: 12.4px; line-height: 1.55; }

.mag-topics { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 28px; }
.mag-topic { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text-soft); font-size: 13.2px; font-weight: 700; }
.mag-topic > span { min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-muted); font-size: 11.5px; line-height: 1.8; text-align: center; font-variant-numeric: tabular-nums; }
.mag-topic:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.mag-topic.is-active { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.mag-topic.is-active > span { background: rgba(255, 255, 255, 0.22); color: inherit; }
.mag-filter-note { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: -10px 0 22px; color: var(--text-muted); font-size: 13.2px; }

.mag-lead-story { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); margin-bottom: 32px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.mag-lead-cover { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; max-width: 100%; min-height: 0; background: #f2ece0; overflow: hidden; }
[data-theme="dark"] .mag-lead-cover { background: var(--surface-3); }
.mag-lead-cover img { position: static; display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.mag-lead-cover img[src$=".svg"] { object-fit: contain; }
.mag-flag { position: absolute; z-index: 2; top: 14px; inset-inline-start: 14px; padding: 4px 12px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 800; }
.mag-lead-copy { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 12px; padding: clamp(20px, 3vw, 36px); min-width: 0; }
.mag-lead-copy h2 { margin: 0; font-size: clamp(20px, 2.6vw, 28px); line-height: 1.65; }
.mag-lead-copy h2 a:hover, .mag-card h3 a:hover { color: var(--primary-strong); }
.mag-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; color: var(--text-muted); font-size: 12.6px; }
.mag-meta > * { display: inline-flex; align-items: center; gap: 5px; }
.mag-meta a { color: var(--primary-strong); font-weight: 800; }
.mag-meta a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mag-excerpt { margin: 0; color: var(--text-soft); line-height: 2; }
.mag-more { display: inline-flex; align-items: center; gap: 6px; color: var(--primary-strong); font-weight: 700; font-size: 13.8px; }
.mag-more:hover { text-decoration: underline; text-underline-offset: 4px; }
[dir="ltr"] .mag-more .icon, [dir="ltr"] .dir-flip { transform: scaleX(-1); }

.mag-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.mag-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid var(--border); }
.mag-section-head h2 { position: relative; margin: 0; font-size: 19.5px; }
.mag-section-head h2::after { content: ''; position: absolute; inset-inline-start: 0; bottom: -12px; width: 56px; height: 2px; background: var(--primary); }
.mag-section-head > span { color: var(--text-muted); font-size: 12.8px; }
.mag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.mag-grid.mag-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mag-card { display: flex; flex-direction: column; height: 100%; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
@media (hover: hover) {
    .mag-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary-border); }
    .mag-card:hover .mag-card-cover img { transform: scale(1.025); }
}
.mag-card-cover { position: relative; display: block; width: 100%; max-width: 100%; flex: 0 0 auto; aspect-ratio: 16 / 10; background: var(--surface-3); overflow: hidden; border-bottom: 1px solid var(--border); }
.mag-card-cover img { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .3s ease; }
.mag-card-cover img[src$=".svg"] { object-fit: contain; }
.mag-card-body { display: flex; flex-direction: column; flex: 1; gap: 9px; padding: 16px; min-width: 0; }
.mag-card h3 { margin: 0; font-size: 15.8px; line-height: 1.8; }
.mag-card-body > p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; color: var(--text-muted); font-size: 13.2px; line-height: 1.95; }
.mag-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: auto; padding-top: 11px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12.2px; }
.mag-card-foot > span { display: inline-flex; align-items: center; gap: 5px; }

.mag-aside { position: sticky; top: calc(var(--header-h) + 14px); display: grid; gap: 16px; min-width: 0; }
.mag-widget { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); min-width: 0; }
.mag-widget > h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14.5px; }
.mag-widget > h3 .icon { color: var(--primary); }
.mag-rank { display: grid; margin: 0; padding: 0; list-style: none; counter-reset: mag-rank; }
.mag-rank li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px dashed var(--border); counter-increment: mag-rank; }
.mag-rank li:last-child { border-bottom: 0; padding-bottom: 0; }
.mag-rank li::before { content: counter(mag-rank); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-strong); font-size: 12.5px; font-weight: 800; }
html[lang="fa"] .mag-rank li::before { content: counter(mag-rank, persian); }
.mag-rank a { display: block; font-size: 13.4px; font-weight: 700; line-height: 1.8; }
.mag-rank a:hover { color: var(--primary-strong); }
.mag-rank small { color: var(--text-muted); font-size: 12px; }
.mag-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.mag-tag { display: inline-flex; align-items: center; padding: 3px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text-soft); font-size: 12.5px; font-weight: 600; }
.mag-tag:hover, .mag-tag.is-active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.mag-widget.mag-cta { border-color: var(--primary-border); background: var(--primary-soft); }
.mag-widget.mag-cta p { margin: 0 0 12px; color: var(--text-soft); font-size: 13.2px; line-height: 1.95; }
.mag-note { max-width: 860px; margin: 30px auto 0; color: var(--text-muted); font-size: 12.8px; line-height: 1.95; text-align: center; }
.mag-note a { color: var(--primary-strong); font-weight: 700; }

/* Article */
.mag-reading-progress { position: fixed; z-index: 1100; inset-inline: 0; top: 0; height: 3px; pointer-events: none; }
.mag-reading-progress > span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .08s linear; }
.mag-article-head { max-width: 860px; margin: 0 0 22px; }
.mag-article-head h1 { margin: 12px 0 10px; font-size: clamp(24px, 3.3vw, 36px); line-height: 1.6; }
.mag-article-sub { margin: 0 0 16px; color: var(--text-soft); font-size: 16.5px; line-height: 2.05; }
.mag-byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 12px 0; border-block: 1px solid var(--border); }
.mag-author { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mag-author-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong); border: 1px solid var(--primary-border); font-size: 17px; font-weight: 800; }
.mag-author strong { display: block; font-size: 13.6px; }
.mag-author small { display: block; color: var(--text-muted); font-size: 12.2px; }
/* height:auto is required: the <img> carries an intrinsic height hint, and without it the hint
   pins the box at every viewport — aspect-ratio only applies when a side is auto. The covers are
   drawn as 1280x800 art, so let that native 16:10 ratio flow instead of cropping the illustration. */
.mag-article-cover { width: 100%; height: auto; max-width: 100%; aspect-ratio: auto; object-fit: initial; margin: 0 0 28px; border-radius: var(--radius-lg); background: var(--surface-3); }
/* Journal covers are drawn on a light paper palette; in the dark theme they are dimmed a
   little so they read as illustrations rather than glowing panels. */
[data-theme="dark"] .mag-article-cover,
[data-theme="dark"] .mag-card-cover img,
[data-theme="dark"] .mag-lead-cover img,
[data-theme="dark"] .mag-anchor-img,
[data-theme="dark"] .academy-cover[src$=".svg"],
[data-theme="dark"] .course-row img[src$=".svg"] { filter: brightness(0.84) saturate(0.95); }
.mag-article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 38px; align-items: start; }
.mag-article-main { min-width: 0; }
.mag-article-aside { position: sticky; top: calc(var(--header-h) + 14px); display: grid; gap: 14px; min-width: 0; max-height: calc(100vh - var(--header-h) - 28px); overflow-y: auto; scrollbar-width: thin; }
.mag-toc ol { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; }
.mag-toc a { display: block; padding: 6px 10px; border-inline-start: 2px solid var(--border); color: var(--text-soft); font-size: 13px; line-height: 1.75; }
.mag-toc a:hover, .mag-toc a.is-current { border-inline-start-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.mag-toc .lvl-3 a { padding-inline-start: 22px; font-size: 12.6px; }
.mag-share { display: flex; flex-wrap: wrap; gap: 8px; }
.share-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text-soft);
    transition: border-color .15s, color .15s, background .15s;
}
.share-ico:hover { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); }
.share-status { font-size: 12.5px; color: var(--success, #2f9e6e); }
.social-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.social-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-soft);
    transition: border-color .15s, color .15s, background .15s;
}
.social-ico:hover { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); }
.site-footer .social-row { margin-top: 12px; }
.site-footer .social-ico { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.25); color: var(--on-chrome-accent); }
.site-footer .social-ico:hover { background: rgba(255, 255, 255, 0.16); color: #fff; border-color: rgba(255, 255, 255, 0.5); }
/* Instant-upload chips (files staged at selection, persisted across refresh) */
.up-chip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.7;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-soft);
}
.up-chip-ok { border-color: rgba(47, 158, 110, 0.45); background: rgba(47, 158, 110, 0.08); color: var(--text); }
.up-chip-busy { border-color: var(--border-strong); background: var(--surface-2); }
.up-chip-err { border-color: rgba(196, 66, 66, 0.45); background: rgba(196, 66, 66, 0.07); }
.up-chip b { color: var(--success, #2f9e6e); }
.up-chip .up-fallback { display: inline-block; margin-inline-start: 6px; font-size: 11.5px; color: var(--text-muted); }
.up-chip-err b { color: var(--danger, #c44242); }
.up-chip button {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-soft);
    border-radius: 8px;
    font-size: 12.5px;
    padding: 3px 10px;
    cursor: pointer;
    font-family: inherit;
}
.up-chip button:hover { border-color: var(--primary); color: var(--primary-strong); }
.up-chip .up-x { font-size: 15px; line-height: 1; padding: 2px 8px; }
.up-chip .up-retry { font-weight: 700; }
.up-spin {
    width: 13px;
    height: 13px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    animation: up-spin 0.8s linear infinite;
}
@keyframes up-spin { to { transform: rotate(360deg); } }
.up-wait {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--primary-strong);
    font-weight: 700;
}
/* Unified location pin rows & branded navigation-app chips (Neshan / Balad / Google Maps / Waze / Apple Maps / OSM) */
.location-card-head {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.location-card-head > .icon { color: var(--primary); flex: 0 0 auto; }
.location-pin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    border: 1px solid var(--primary-border);
    flex: 0 0 auto;
    line-height: 0;
}
.location-pin-badge .icon { vertical-align: 0; }
.location-address-row {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    line-height: 1.8;
}
.location-address-row > .icon {
    color: var(--primary);
    flex: 0 0 auto;
    margin-top: 4px;
}
.nav-apps {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4.5px;
    margin-top: 7px;
    font-size: 12px;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-block: 2px;
}
.nav-apps::-webkit-scrollbar { display: none; }
.nav-apps-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-inline-end: 1px;
    white-space: nowrap;
    flex: 0 0 auto;
}
.nav-apps-label-text { display: none; }
.nav-apps-label .icon { color: var(--primary); flex: 0 0 auto; }
.nav-apps a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 7px;
    background: var(--surface);
    color: var(--text);
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(16, 20, 12, 0.04);
    transition: transform .15s ease, border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease;
}
.nav-apps a:hover {
    border-color: var(--primary);
    color: var(--primary-strong);
    background: var(--primary-soft);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(16, 20, 12, 0.1);
}
.nav-apps a.nav-app-neshan:hover     { border-color: #1565c0; background: rgba(21, 101, 192, 0.10); color: #0d47a1; }
.nav-apps a.nav-app-balad:hover      { border-color: #00897b; background: rgba(0, 137, 123, 0.10); color: #00695c; }
.nav-apps a.nav-app-snapp:hover      { border-color: #00c569; background: rgba(0, 197, 105, 0.12); color: #008a49; }
.nav-apps a.nav-app-snapp_box:hover  { border-color: #1868ff; background: rgba(24, 104, 255, 0.11); color: #0d47c4; }
.nav-apps a.nav-app-snapp_bike:hover { border-color: #008f53; background: rgba(0, 143, 83, 0.12); color: #006b3e; }
.nav-apps a.nav-app-tapsi:hover      { border-color: #ff5722; background: rgba(255, 87, 34, 0.12); color: #c93b0e; }
.nav-apps a.nav-app-google:hover     { border-color: #4285f4; background: rgba(66, 133, 244, 0.10); color: #1a56db; }
.nav-apps a.nav-app-waze:hover       { border-color: #05a8d4; background: rgba(5, 200, 247, 0.13); color: #096985; }
.nav-apps a.nav-app-apple:hover      { border-color: #007aff; background: rgba(0, 122, 255, 0.10); color: #005bb5; }
.nav-apps a.nav-app-osm:hover        { border-color: #5a9a47; background: rgba(90, 154, 71, 0.12); color: #3d702e; }
[data-theme="dark"] .nav-apps a:hover { color: var(--text); }
.nav-app-ico { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; line-height: 0; }
.nav-app-svg { display: block; flex: 0 0 auto; }
.nav-app-name { display: none; }
.nav-apps-float {
    position: absolute;
    z-index: 600;
    inset-block-end: 10px;
    inset-inline-start: 10px;
    max-width: calc(100% - 20px);
    margin: 0;
    padding: 5px 7px;
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    border-radius: 11px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}
.nav-apps-float a { width: 25px; height: 25px; padding: 0; border-radius: 7px; }
@media (max-width: 560px) {
    .nav-apps { gap: 3px; }
    .nav-apps a { width: 24px; height: 24px; border-radius: 6px; }
    .nav-apps .nav-app-svg { width: 17px; height: 17px; }
}
html[lang="fa"] .leaflet-container { font-family: 'Vazirmatn', Tahoma, sans-serif; }
.leaflet-container .leaflet-popup-pane { z-index: 850; }
.leaflet-popup-content .nav-apps a.nav-app-chip {
    color: #1f261b;
    background: #ffffff;
    border-color: #cbd2c4;
}
.leaflet-container .nav-apps-float a.nav-app-chip {
    color: var(--text);
}
[data-location-picker] { position: relative; }
.branch-list { display: grid; gap: 10px; }
.branch-card {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    display: grid;
    gap: 4px;
}
.mag-share a, .mag-share button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 38px; padding: 6px 12px;
    border: 1px solid var(--border-strong); border-radius: 10px;
    background: var(--surface); color: var(--text-soft);
    font-size: 12.8px; font-weight: 700; cursor: pointer;
}
.mag-share a:hover, .mag-share button:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.mag-share-status { flex: 1 1 100%; color: var(--success); font-size: 12.4px; min-height: 1em; }

.mag-prose, .mag-article-body, .article-body { color: var(--text); font-size: 16.4px; line-height: 2.15; overflow-wrap: break-word; }
.mag-prose > p:first-child { color: var(--text-soft); font-size: 17.4px; font-weight: 500; }
.mag-prose p { margin: 0 0 18px; }
.mag-prose h2 { margin: 38px 0 12px; padding-inline-start: 12px; border-inline-start: 4px solid var(--primary); font-size: 21.5px; line-height: 1.7; scroll-margin-top: calc(var(--header-h) + 18px); }
.mag-prose h3 { margin: 28px 0 10px; font-size: 18px; line-height: 1.75; scroll-margin-top: calc(var(--header-h) + 18px); }
.mag-prose h4 { margin: 22px 0 8px; font-size: 16.4px; }
.mag-prose a { color: var(--primary-strong); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.mag-prose a:hover { text-decoration-thickness: 2px; }
.mag-prose ul, .mag-prose ol { margin: 0 0 18px; padding-inline-start: 26px; }
.mag-prose li { margin-bottom: 8px; }
.mag-prose li::marker { color: var(--primary); font-weight: 700; }
.mag-prose blockquote { margin: 24px 0; padding: 14px 18px; border-inline-start: 4px solid var(--accent); border-radius: 12px; background: var(--accent-soft); color: var(--text-soft); }
.mag-prose blockquote p:last-child { margin-bottom: 0; }
.mag-prose img { height: auto; margin: 24px auto; border-radius: 14px; }
.mag-prose figure { margin: 24px 0; }
.mag-prose figcaption { margin-top: 8px; color: var(--text-muted); font-size: 13px; text-align: center; }
.mag-prose table { width: 100%; margin: 24px 0; border-collapse: collapse; font-size: 14.4px; line-height: 1.9; }
.mag-prose th, .mag-prose td { padding: 10px 12px; border: 1px solid var(--border); text-align: start; vertical-align: top; }
.mag-prose th { background: var(--surface-2); font-weight: 700; }
.mag-prose hr { margin: 30px 0; }
.mag-prose .btn { text-decoration: none; }
.mag-article-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border); }
.mag-authorbox { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: start; margin-top: 24px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.mag-authorbox .mag-author-avatar { width: 56px; height: 56px; font-size: 22px; }
.mag-authorbox strong { display: block; font-size: 14.6px; }
.mag-authorbox small { display: block; color: var(--text-muted); }
.mag-authorbox p { margin: 6px 0 0; color: var(--text-soft); font-size: 13.4px; line-height: 1.95; }
.mag-block { margin-top: 40px; }
.mag-comments { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 22px; align-items: start; }
.mag-comment { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.mag-comment:last-child { border-bottom: 0; }
.mag-comment .mag-author-avatar { width: 40px; height: 40px; font-size: 15px; }
.mag-comment header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.mag-comment header small { color: var(--text-muted); font-size: 12px; }
.mag-comment p { margin: 4px 0 0; color: var(--text-soft); font-size: 13.8px; line-height: 1.95; overflow-wrap: anywhere; }
.hp-field { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- 15 Profile, KYC recorder and small helpers ---------- */
.profile-page { display: grid; gap: 18px; }
.profile-form h2, .profile-email-card h2 { margin: 0 0 4px; font-size: 17px; }
.profile-email-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.profile-current-email { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 10px 0 14px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.profile-current-email span { color: var(--text-muted); font-size: 12.6px; font-weight: 600; }
.profile-current-email strong { font-size: 14.4px; overflow-wrap: anywhere; }
.profile-code-form, .profile-email-change-form { display: grid; gap: 10px; max-width: 540px; }
.profile-code-form small { color: var(--text-muted); }
.profile-code-row { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-code-row .form-control { flex: 1 1 180px; direction: ltr; text-align: center; letter-spacing: .4em; font-weight: 800; font-size: 17px; }

.kyc-recorder { display: grid; gap: 10px; }
.kyc-upload-fallback { padding: 12px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface); }
.kyc-recorder-panel { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.kyc-recorder-panel video { width: 100%; max-height: 220px; border-radius: 10px; background: #12140f; }
.kyc-recorder-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.kyc-recorder-controls [data-kyc-countdown] { min-width: 32px; font-size: 18px; font-weight: 800; color: var(--primary-strong); font-variant-numeric: tabular-nums; }
.kyc-recorder-note { grid-column: 2; margin: 0; color: var(--text-muted); font-size: 12.6px; line-height: 1.85; }
.ws-qty-input { text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .mag-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; }
    .mag-article-layout { grid-template-columns: minmax(0, 1fr) 240px; gap: 26px; }
    .mag-grid.mag-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* Keep the desktop header on a single row between 993–1100px. */
    .header-inner { gap: 9px; }
    .mega-trigger { font-size: 13.2px; padding: 8px 7px; }
    .brand-text strong { font-size: 15.5px; }
    .brand-text span { font-size: 11.5px; }
}
@media (max-width: 992px) {
    /* The header on a phone is two rows — brand + menu, then the search field — and measures
       ~109px. It used to be declared as 64px here, so everything that offsets itself by the header
       height (sticky sidebars, and above all the in-page anchor offset) was 45px short. That is
       why "#academy-catalog" jumped to a position tucked under the header, cutting the first line
       of the section it was supposed to reveal. */
    :root { --header-h: 109px; }
    .nav-mega-wrap, .util-hide-mobile { display: none !important; }
    .mobile-menu-btn { display: inline-flex; }
    .hero-card, .grid-2, .grid-2.split-main, .grid-2.split-course, .grid-2.split-support, .footer-grid, .panel-shell, .workspace-shell, .mag-masthead, .mag-layout, .mag-article-layout, .mag-comments { grid-template-columns: minmax(0, 1fr); }
    .header-search { order: 5; flex-basis: 100%; max-width: none; }

    .panel-shell { gap: 14px; padding-block: 14px 44px; }
    .panel-nav { position: static; max-height: none; border-radius: 16px; }
    .panel-nav-head { padding: 10px 12px; }
    .panel-nav-avatar { width: 40px; height: 40px; font-size: 17px; }
    .panel-nav-toggle { display: inline-flex; }
    .panel-nav.is-collapsible { box-shadow: var(--shadow-sm); }
    .panel-nav.is-collapsible .panel-nav-head { border-bottom-color: transparent; }
    .panel-nav.is-collapsible.is-open .panel-nav-head { border-bottom-color: var(--border); }
    .panel-nav.is-collapsible:not(.is-open) .panel-nav-body,
    .panel-nav.is-collapsible:not(.is-open) .panel-nav-foot { display: none; }
    .panel-nav-body { max-height: 62vh; }

    .mag-aside, .mag-article-aside { position: static; max-height: none; overflow: visible; }
    .mag-article-aside { order: -1; }
    .mag-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mag-fact { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; }
    /* Stack the lead story as soon as the page layout stacks: side-by-side columns under
       ~992px get narrow enough that the copy height stretches the cover into a portrait box
       (measured 363×392 at 768px) and object-fit crops the 16/10 art into a vertical slice. */
    .mag-lead-story { grid-template-columns: 1fr; }
    .mag-lead-cover { min-height: 0; aspect-ratio: 16 / 10; }
    .mag-anchor-card { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .grid-4 > .span-2 { grid-column: auto; }
    body { font-size: 14.6px; }
    .container { --container-pad: 14px; }
    .section { padding: 26px 0; }
    /* Phone header: two compact rows (chrome + search), no util-bar strip —
       language and theme live in the drawer, clock is decorative. */
    .util-bar { display: none; }
    .header-inner { gap: 8px; padding: 8px 0; }
    .header-search { margin-top: 2px; }
    .header-search-input { height: 42px; font-size: 14px; }
    .brand-text span { font-size: 10.6px; }
    .brand-text strong { font-size: 15.5px; }
    .brand-logo img { width: 36px; height: 36px; }
    .mobile-menu-btn { width: 40px; height: 40px; }
    /* Cart and sign-in live in the drawer and the bottom bar on phones. */
    .header-actions { display: none; }
    .card { padding: 15px; }
    .hero-section { padding: 18px 0 22px; }
    .hero-card { padding: 24px 18px; gap: 22px; text-align: center; }
    .hero-eyebrow, .hero-sub { margin-inline: auto; }
    .hero-sub { font-size: 14.6px; }
    .hero-metrics { grid-template-columns: 1fr; gap: 10px; text-align: center; }

    /* Adjacent buttons stack centred with even spacing on phones. */
    .btn-row, .hero-cta-row {
        flex-direction: column; align-items: stretch; justify-content: center;
        width: 100%; max-width: 360px; margin-inline: auto; gap: 10px;
    }
    .btn-row > .btn, .btn-row > form, .btn-row > form > .btn, .hero-cta-row > .btn { width: 100%; justify-content: center; text-align: center; }
    .btn-row > .form-control { max-width: none !important; width: 100%; }
    /* .filter-grow's flex-basis (240px) is a WIDTH on desktop rows, but this stack turns
       .btn-row into a COLUMN — there flex-basis becomes a HEIGHT, which rendered the admin
       orders search box ~240px tall ("multi-line field"). Content height, single line. */
    .btn-row > .filter-grow, .btn-row > form > .filter-grow { flex: 1 1 auto; min-height: 42px; }
    /* Carrier desk rows stack at 680px/992px — the rules live at the END of this file,
       after the base .carrier-* definitions (equal specificity = document order wins). */
    .section-head, .page-heading, .admin-head { flex-direction: column; align-items: stretch; text-align: start; }
    .section-head > .btn-row-inline, .page-heading > .btn, .admin-head > .btn { align-self: flex-start; }
    /* ---------- Phone toolbar inside a page header ----------
       A search/filter form that sits beside a heading on a desktop drops under it on a phone and
       must then take the full column width. It usually doesn't, because it is a flex container
       whose fields size to their content, so it collapses to a narrow box that is still
       end-aligned by the desktop rule — which is what put the "جستجو" button off the right edge
       (or under the field) on a phone. Making the form itself a stretched grid row, with the
       field and its button on one line, is the only version that holds from 320px up. */
    .section-head > form, .page-heading > form, .admin-head > form { width: 100%; align-self: stretch; }
    .academy-search, .list-toolbar { flex-wrap: wrap; width: 100%; }
    /* A page header's own CTA row is not a stack of two choices: on a phone it becomes one
       full-width button, not two half-height ones squeezed to 360px. */
    .section-head .btn-row, .page-heading .btn-row { max-width: none; }
    /* 34px-tall small buttons are under the 40px tap target on a phone. */
    .btn-sm { min-height: 40px; padding: 7px 14px; }
    .product-footer { flex-direction: column; align-items: stretch; gap: 10px; text-align: center; }
    .product-footer .btn-row-inline { justify-content: center; }
    .back-to-top { inset-inline-end: 14px; bottom: 118px; width: 44px; height: 44px; }
    .cart-toast { inset-inline: 12px; bottom: 76px; max-width: none; justify-content: space-between; }
    .order-highlight-grid { grid-template-columns: 1fr 1fr; }
    .order-parcel-form { grid-template-columns: minmax(0, 1fr); }
    .order-parcel-form .form-control { max-width: none; }
    .product-offers-heading { flex-direction: column; }
    .product-offer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; }
    .tabs { margin-inline: -4px; }
    .tab { flex: 0 0 auto; }

    .mag-page { padding-top: 14px; }
    .mag-masthead { padding: 20px 16px; border-radius: 18px; gap: 18px; }
    .mag-lead { font-size: 14.4px; }
    .mag-search { flex-wrap: wrap; }
    .mag-search .btn { flex: 1 1 100%; }
    .mag-facts { grid-template-columns: 1fr; }
    .mag-fact { flex-direction: row; align-items: center; }
    /* The topic strip is a deliberate horizontal scroller: full-bleed so it reads as a strip that
       continues off-screen. It used to be pulled out by -14px on each side while the page gutter is
       only 11px on a small phone, which put the scroller's own box 3px outside the viewport. Track
       the real gutter instead. */
    .mag-topics {
        flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none;
        margin-inline: calc(-1 * var(--container-pad)); padding-inline: var(--container-pad);
        scroll-snap-type: x proximity;
    }
    .mag-topics > * { scroll-snap-align: start; }
    .mag-topics::-webkit-scrollbar { display: none; }
    .mag-topic { flex: 0 0 auto; }
    .mag-lead-story { grid-template-columns: 1fr; border-radius: 18px; }
    .mag-lead-cover { min-height: 0; aspect-ratio: 16 / 10; }
    .mag-grid, .mag-grid.mag-grid-3 { grid-template-columns: 1fr; gap: 18px; }
    /* Phones keep the stacked flex-column card: a full-width 16/10 cover on top of the copy. */
    .mag-card { display: flex; flex-direction: column; }
    .mag-card-cover { aspect-ratio: 16 / 10; min-height: 0; }
    .mag-card-body { padding: 14px; gap: 7px; }
    .mag-card h3 { font-size: 14.8px; line-height: 1.75; }
    .mag-card-body > p { -webkit-line-clamp: 2; font-size: 12.8px; }
    .mag-prose, .mag-article-body, .article-body { font-size: 15.6px; line-height: 2.1; }
    .mag-prose > p:first-child { font-size: 16.2px; }
    .mag-prose h2 { font-size: 19.5px; margin-top: 30px; }
    .mag-article-cover { aspect-ratio: auto; border-radius: 16px; margin-bottom: 20px; }
    .mag-prose table { display: block; overflow-x: auto; white-space: nowrap; }
    .kyc-recorder-panel { grid-template-columns: 1fr; }
    .kyc-recorder-note { grid-column: 1; }
    .kyc-recorder-panel video { max-height: 240px; }
}
/* Phone gutters. A 320px screen with a 14px gutter each side left a 292px column, and a card's own
   15px padding on top of that is too tight for a two-word button beside a label. Narrow phones get
   a slimmer gutter and a slimmer card padding instead of less content. */
@media (max-width: 380px) {
    .container { --container-pad: 11px; }
    .card { padding: 12px; }
    .academy-card, .product-card { padding: 0; }
}
@media (max-width: 400px) {
    .mag-card { display: flex; flex-direction: column; }
    .mag-card-cover { aspect-ratio: 16 / 10; min-height: 0; }
    .order-highlight-grid { grid-template-columns: 1fr; }
    .panel-nav-toggle > span { display: none; }
}
@media print {
    .util-bar, .site-header, .site-footer, .panel-nav, .back-to-top, .cart-toast, .mobile-drawer, .mobile-drawer-backdrop, .bottom-nav { display: none !important; }
    .panel-shell { display: block; padding: 0; }
    body { background: #fff; color: #000; }
    /* Printed Persian content always renders in Vazir. */
    html[lang="fa"] * { font-family: 'Vazirmatn', Tahoma, sans-serif !important; }
    .fold > .fold-body { display: grid !important; }
}

/* ---------- 16 Additions: filters, toolbars, side navigation ---------- */
.page-h1 { margin: 6px 0 0; font-size: clamp(22px, 2.6vw, 28px); }
.filter-bar { margin-bottom: 20px; padding: 16px 18px; }
.filter-bar .form-group { margin: 0; }
.filter-bar-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.2fr) auto; gap: 12px; align-items: end; }
.filter-more { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.filter-more > summary { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 4px 8px; border-radius: 9px; list-style: none; cursor: pointer; color: var(--primary-strong); font-size: 13.2px; font-weight: 700; }
.filter-more > summary::-webkit-details-marker { display: none; }
.filter-more > summary:hover { background: var(--primary-soft); }
.filter-more > summary .icon:last-child { transition: transform .18s ease; }
.filter-more[open] > summary .icon:last-child { transform: rotate(180deg); }
.filter-more-body { margin-top: 10px; gap: 12px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.list-toolbar p { margin: 0; font-size: 13.2px; }
.list-toolbar .form-control { width: auto; min-width: min(100%, 260px); }
.flash-stack { padding-top: 14px; }
.flash-stack .alert { display: flex; align-items: flex-start; gap: 9px; }
.flash-stack .alert .icon { margin-top: 4px; }
.variation-row { gap: 8px; margin-bottom: 8px; align-items: center; }
.cart-count-pulse { animation: cart-pulse .5s ease; }
@keyframes cart-pulse { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }

.side-nav { position: sticky; top: calc(var(--header-h) + 14px); display: grid; gap: 3px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.side-nav-head { padding: 4px 8px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.side-nav-head strong { display: block; margin-top: 6px; font-size: 14.6px; }
.side-nav > a { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 10px; border-radius: 10px; color: var(--text-soft); font-size: 13.4px; font-weight: 600; }
.side-nav > a:hover { background: var(--surface-2); color: var(--primary-strong); }
.side-nav > a.active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 800; }

@media (max-width: 992px) {
    .filter-bar-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .filter-bar-main > .form-group:first-child { grid-column: 1 / -1; }
    .filter-bar-main > .btn { grid-column: 1 / -1; }
    .side-nav { position: static; }
}
@media (max-width: 520px) {
    .filter-bar-main { grid-template-columns: minmax(0, 1fr); }
}

/* Home page */
.hero-points { display: grid; gap: 9px; margin: 26px 0 0; padding: 20px 0 0; list-style: none; border-top: 1px solid rgba(255, 255, 255, 0.16); color: var(--on-chrome-soft); font-size: 13.8px; }
.hero-points li { display: flex; align-items: center; gap: 9px; }
.hero-points .icon { color: var(--on-chrome-accent); flex: 0 0 auto; }
.hero-showcase { position: relative; display: block; border-radius: 20px; overflow: hidden; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32); border: 1px solid rgba(255, 255, 255, 0.16); }
.hero-showcase img { width: 100%; height: auto; aspect-ratio: 640 / 520; object-fit: cover; border: 0; border-radius: 0; box-shadow: none; transition: transform .35s ease; }
.hero-showcase img[src$=".svg"] { object-fit: contain; }
.hero-showcase:hover img { transform: scale(1.02); }
.hero-showcase-caption { position: absolute; inset-inline: 12px; bottom: 12px; display: grid; gap: 1px; padding: 10px 14px; border-radius: 13px; background: rgba(24, 29, 19, 0.74); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hero-showcase-caption small { color: var(--on-chrome-accent); font-size: 11.8px; font-weight: 700; }
.hero-showcase-caption strong { font-size: 14.4px; line-height: 1.6; }
.section-alt { background: var(--bg-alt); }
.category-card { display: grid; gap: 6px; align-content: start; }
.category-card-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--primary-soft); color: var(--primary-strong); }
.category-card h3 { margin: 4px 0 0; font-size: 16px; }
.category-card p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.85; }
.eco-link { display: inline-flex; align-items: center; gap: 6px; }
.eco-card .badge { display: inline-flex; align-items: center; gap: 5px; }
.course-row { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 16px; align-items: center; height: 100%; }
.course-row-media { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); }
.course-row img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 0; background: var(--surface-3); }
.course-row img[src$=".svg"] { object-fit: contain; }
.course-row-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.course-row h3 { margin: 2px 0; font-size: 15.4px; line-height: 1.65; }
.finder-box .display-title { margin: 8px 0 4px; }
.finder-box > p { margin: 0; font-size: 13.8px; }
@media (max-width: 680px) {
    .hero-points { justify-items: center; }
    .course-row { grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: stretch; padding: 0 !important; overflow: hidden; }
    .course-row-media { border-radius: 0; border: 0; border-bottom: 1px solid var(--border); }
    .course-row-body { padding: 4px 15px 15px; }
}

/* =====================================================================
   17. Order board details: sub-folds, timeline, parcel rows
   ===================================================================== */
.filter-grow { flex: 1 1 240px; min-width: 0; }
/* Carrier desk (admin/tracking): endpoint/token/status-path rows and the five-field
   custom-carrier rows. Fixed side columns can't shrink on a phone card — they force
   a horizontal scroll and crush the endpoint field — so rows stack at 680px. */
.carrier-fields { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr) 220px 140px; align-items: start; }
.carrier-row5 { display: grid; gap: 6px; grid-template-columns: 160px minmax(0, 1fr) 220px 120px 150px; align-items: start; }
/* Auth-mode row of a provider card and the connection-test row: the same flex row on
   desktop, a clean stack on phones (classes instead of repeated inline styles). */
.carrier-auth-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.carrier-test-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* Desktop compactness: the auth/test selects size to their content (their mobile
   full-width override lives in section 18). */
.carrier-auth-row select.form-control, .carrier-test-form select.form-control { width: auto; }
/* Inline fixed widths for the tipax panel/webhook fields; phones stretch them. */
.carrier-inline-field { width: 220px; max-width: 100%; margin-top: 2px; }
.carrier-inline-field-wide { width: 320px; max-width: 100%; margin-top: 2px; }
.carrier-inline-field-narrow { width: 90px; max-width: 100%; }
/* Long LTR URLs inside RTL cards must break instead of pushing the card wide. */
.carrier-url-hint { overflow-wrap: anywhere; }
.carrier-pre { overflow-wrap: anywhere; }
.filter-bar > .btn-row + .chip-row { margin-top: 12px; }
.sub-fold { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.sub-fold > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px; cursor: pointer; list-style: none; user-select: none;
  font-weight: 700; font-size: 13.6px; color: var(--text-soft);
}
.sub-fold > summary::-webkit-details-marker { display: none; }
.sub-fold > summary:hover { background: var(--surface-2); color: var(--primary-strong); }
.sub-fold > summary:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
.sub-fold > summary > svg { flex: none; color: var(--text-muted); transition: transform .16s ease; }
.sub-fold[open] > summary { border-bottom: 1px solid var(--border); color: var(--text); }
.sub-fold[open] > summary > svg { transform: rotate(180deg); }
.sub-fold-body { padding: 14px; display: grid; gap: 12px; }
.sub-fold-body > * { margin-block: 0; min-width: 0; }
.timeline { list-style: none; margin: 0; padding: 0; padding-inline-start: 16px; border-inline-start: 2px solid var(--border); display: grid; gap: 12px; }
.timeline > li { position: relative; font-size: 13px; line-height: 1.9; }
.timeline > li::before {
  content: ''; position: absolute; inset-inline-start: -24px; top: 7px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary);
}
.timeline > li > strong { display: block; font-size: 13.2px; }
.timeline > li > small { display: block; color: var(--text-muted); font-size: 12px; }
.order-money-grid > div { font-weight: 700; font-size: 13.4px; }
.order-parcel-form > .form-label { display: flex; flex-direction: column; align-self: stretch; min-width: 0; max-width: none; margin: 0; }
.order-parcel-form > .form-label > .form-control { width: 100%; max-width: none; margin-top: auto; }
.order-parcel-form > .btn-row-inline { grid-column: span 2; align-self: end; justify-content: flex-start; align-items: center; gap: 8px; min-height: 42px; }
.order-parcel-form > .btn-row-inline > .btn { min-height: 42px; height: 42px; padding: 8px 15px; font-size: 13.4px; width: auto; flex: 0 0 auto; }
@media (max-width: 680px) {
  .order-parcel-form > .btn-row-inline { grid-column: 1 / -1; }
}
.order-actions > .form-label { margin: 0; }
.order-actions > .order-parcel-info { flex: 1 1 260px; }
.order-section > .form-grid + .btn, .order-section > .form-hint + .form-grid + .btn { margin-top: 10px; }

/* =====================================================================
   18. Chips, check rows, icon buttons, document side navigation
   ===================================================================== */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface);
  color: var(--text-soft); font-size: 12.8px; font-weight: 600; line-height: 1.6; white-space: nowrap;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-soft); font-size: 11.4px; font-weight: 700;
}
.chip-count.is-hot { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-border); }
.chip.is-active .chip-count { background: color-mix(in srgb, var(--on-primary) 24%, transparent); color: var(--on-primary); box-shadow: none; }
.check-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.9; color: var(--text-soft); cursor: pointer; }
.check-row > input { flex: none; width: 18px; height: 18px; margin-top: 4px; accent-color: var(--primary); }
.btn-icon { flex: none; width: 38px; min-width: 38px; min-height: 38px; padding: 0; border-radius: 10px; }
.btn-icon.btn-sm { width: 34px; min-width: 34px; min-height: 34px; }
/* A 34px square is a mouse target, not a thumb target. On a touch screen every icon-only control
   (the share row, the product quick-actions, the order-row icons) gets a real 44px box. */
@media (max-width: 992px) {
    .btn-icon, .btn-icon.btn-sm { width: 44px; min-width: 44px; min-height: 44px; }
}
.page-crumb {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 13px; color: var(--text-muted); margin-bottom: 18px;
}
/* Rich-text body of CMS pages (legal, about, atelier…). */
.page-body { color: var(--text); }
.page-body p { margin: 0 0 14px; }
.page-body h2, .page-body h3 { margin: 24px 0 10px; line-height: 1.5; }
.page-body h2 { font-size: 19px; }
.page-body h3 { font-size: 16.5px; }
.page-body ul, .page-body ol { margin: 0 0 14px; padding-inline-start: 22px; }
.page-body li { margin-bottom: 7px; }
.page-body a { color: var(--primary-strong); text-decoration: underline; text-underline-offset: 3px; }
.page-body strong { font-weight: 800; }
.page-body hr { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }
.page-body table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 14px; }
.page-body th, .page-body td { border: 1px solid var(--border); padding: 9px 11px; text-align: start; }
.page-body th { background: var(--surface-2); font-weight: 800; }
.page-crumb a { color: var(--text-muted); }
.page-crumb a:hover { color: var(--primary); }
.page-crumb strong { color: var(--text); font-weight: 700; }

.workspace-nav {
  display: grid; gap: 4px; align-content: start; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.workspace-nav a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; color: var(--text-soft); font-size: 13.6px; }
.workspace-nav a:hover, .workspace-nav a.active, .workspace-nav a[aria-current] { background: var(--primary-soft); color: var(--primary-strong); }
.workspace-nav strong, .workspace-nav h3 { margin: 8px 12px 2px; font-size: 12px; color: var(--text-muted); }

/* =====================================================================
   19. Review fixes: card footer, compact header for staff
   ===================================================================== */
/* Product card: price on its own line, actions below it, so every card ends with the same footer. */
.product-footer { flex-direction: column; align-items: stretch; gap: 10px; }
.product-footer .btn-row-inline { flex-wrap: nowrap; }
.product-footer .btn-row-inline > :not(.btn-icon) { flex: 1 1 auto; min-width: 0; }
.product-footer .btn-row-inline > form { display: flex; margin: 0; }
.product-footer .btn-row-inline > form > .btn { flex: 1 1 auto; }
/* A signed-in manager has three header buttons: keep the header on one row on 1366-1440px screens. */
@media (max-width: 1440px) {
  .header-actions .cart-pill .util-hide-mobile,
  .header-actions .header-label { display: none; }
  .header-search { min-width: 140px; }
}

/* Phones: fold rows become a two-column summary; the chevron leaves the grid so no cell lands in its 28px track. */
@media (max-width: 860px) {
  .fold-head { display: none; }
  .fold > summary { position: relative; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; padding: 12px 14px; padding-inline-end: 50px; }
  .fold > summary > .fold-cell { grid-column: auto; grid-row: auto; }
  .fold > summary > .fold-cell:first-child { grid-column: 1 / -1; }
  .fold > summary > .fold-chevron { position: absolute; inset-inline-end: 12px; top: 12px; grid-column: auto; grid-row: auto; }
  .fold-cell[data-label]::before { content: attr(data-label); display: block; color: var(--text-muted); font-size: 11.4px; font-weight: 600; line-height: 1.6; }
}

/* ===== Media library & in-form gallery editor ===== */
.media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(215px,1fr));gap:14px}
.media-card{display:flex;flex-direction:column;overflow:hidden;padding:0!important}
.media-thumb{aspect-ratio:4/3;background:var(--surface-2);display:flex;align-items:center;justify-content:center;overflow:hidden}
.media-thumb img{width:100%;height:100%;object-fit:cover}
.media-ext{font-weight:800;letter-spacing:.5px;color:var(--text-muted);font-size:15px}
.media-meta{padding:10px 12px;display:flex;flex-direction:column;gap:7px;flex:1;min-width:0}
.media-name{font-size:11.5px;word-break:break-all;line-height:1.5;color:var(--text)}
.media-sub{display:flex;gap:6px;flex-wrap:wrap;align-items:center;font-size:11.5px}
.media-usage{margin:0;padding-left:17px;font-size:11.5px;color:var(--text-muted);line-height:1.7}
.media-unused{font-size:11.5px;color:#107c41;font-weight:800}
.media-actions{display:flex;gap:8px;padding:10px 12px;border-top:1px solid var(--border);align-items:center;justify-content:space-between;flex-wrap:wrap}
.media-inuse{font-size:11.5px;font-weight:800;color:var(--text-muted)}
.media-del{color:#c0392b}
.gallery-strip{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;margin-top:8px}
.media-pick{margin:0;border:1px solid var(--border);border-radius:12px;overflow:hidden;background:var(--surface-2)}
.media-pick img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block}
.media-pick figcaption{display:flex;flex-direction:column;gap:6px;padding:8px;font-size:11.5px}
.media-pick .pick-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.media-pick .pick-row label{display:flex;gap:5px;align-items:center;cursor:pointer}
.media-pick button{padding:1px 8px;line-height:1.6}

/* ===== Tag pair editor (one row = one FA tag + its EN twin) ===== */
.tag-pair-heads{display:grid;grid-template-columns:1fr 1fr 40px;gap:8px;font-size:11.5px;font-weight:800;color:var(--text-muted);margin-bottom:6px;padding:0 2px}
.tag-pair-rows{display:flex;flex-direction:column;gap:8px}
.tag-pair-row{display:grid;grid-template-columns:1fr 1fr 40px;gap:8px;align-items:center}
.tag-pair-row input.is-bad{border-color:#c0392b;box-shadow:0 0 0 2px rgba(192,57,43,.14)}
.tag-pair-row input.is-duplicate{border-color:#e67e22;box-shadow:0 0 0 2px rgba(230,126,34,.22);background:rgba(230,126,34,.06)}
.tag-pair-suggestions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px;padding:8px;border:1px solid var(--border);border-radius:8px}
.tag-pair-suggestions[hidden]{display:none}
.tag-pair-suggestions small{width:100%;color:var(--text-muted)}
.tag-pair-suggestion{background:transparent;border:1px solid var(--border);border-radius:6px;padding:5px 9px;color:inherit;cursor:pointer}
.tag-pair-suggestion:hover,.tag-pair-suggestion:focus-visible{border-color:var(--primary);outline:2px solid currentColor}
.tag-pair-del{padding:2px 0;width:40px;text-align:center;line-height:1.5;color:#c0392b}
.tag-pair-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:10px}
.tag-pair-actions [data-tag-hint]{font-size:12px;font-weight:700}
@media (max-width:640px){
  .tag-pair-heads{display:none}
  .tag-pair-row{grid-template-columns:1fr;gap:6px;padding-bottom:10px;border-bottom:1px dashed var(--border)}
  .tag-pair-del{width:auto;justify-self:start;padding:2px 14px}
}

/* ===== Phase F additions ===== */
.btn-success { background: var(--success, #107c41); color: #fff; border-color: var(--success, #107c41); }
.btn-success:hover { filter: brightness(1.06); transform: translateY(-1px); }
.ev-detail-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .ev-detail-grid { grid-template-columns: minmax(0,1fr); } }
.program-row { display: grid; align-items: center; }

/* ===== Phase G: Unified Badges, Countdown Pill & Shamsi Calendar Popover ===== */
.badge-error { background: var(--danger-soft, #fdecea); color: var(--danger, #a61b1b); border: 1px solid rgba(185, 28, 28, .22); }
.is-done { opacity: .86; }
.mh-countdown-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-weight: 800;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: var(--primary-strong, var(--primary));
}
.mh-jalali-popover {
    position: absolute;
    z-index: 9500;
    width: 286px;
    background: var(--surface, #fff);
    color: var(--text, #1c1917);
    border: 1.5px solid var(--border, #e5e0d8);
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .16);
    padding: 12px;
    direction: rtl;
    user-select: none;
}
.mh-jalali-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 8px;
}
.mh-jalali-head button {
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 8px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-weight: 800;
}
.mh-jalali-title { font-weight: 800; font-size: 13.5px; }
.mh-jalali-weekdays, .mh-jalali-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    text-align: center;
}
.mh-jalali-weekdays span {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 3px 0;
}
.mh-jalali-day {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    height: 32px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.mh-jalali-day:hover { background: var(--surface-2); border-color: var(--border); }
.mh-jalali-day.is-selected { background: var(--primary); color: #fff; font-weight: 800; }
.mh-jalali-day.is-today { border-color: var(--primary); }
.mh-jalali-time {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 12px;
}
.mh-jalali-time input {
    width: 56px;
    text-align: center;
    direction: ltr;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    font-weight: 700;
}
.mh-jalali-foot {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
.mh-jalali-foot button {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
}
.mh-jalali-foot button.is-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Product image viewer */
.product-gallery-dialog { width:min(94vw, 1100px); max-width:none; max-height:94vh; padding:14px; border:1px solid var(--border); border-radius:16px; background:var(--surface); color:var(--text); }
.product-gallery-dialog::backdrop { background:rgba(0,0,0,.8); }
.product-gallery-controls { display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.gallery-icon-btn { min-width:38px; min-height:38px; padding:6px 10px; display:inline-flex; align-items:center; justify-content:center; border-radius:10px; }
.gallery-icon-btn[hidden], .gallery-icon-btn [hidden] { display:none; }
.product-gallery-stage { position:relative; height:min(72vh, 760px); overflow:auto; display:flex; align-items:center; justify-content:center; overscroll-behavior:contain; touch-action:pan-x pan-y; }
.product-gallery-stage img, .product-gallery-stage video { max-width:100%; max-height:100%; object-fit:contain; }
.product-gallery-stage [hidden] { display:none; }
/* Zoomed: the script sets an explicit pixel width and this class only has to allow the overflow,
   show the grab cursor and stop the browser from scrolling the page instead of the image. */
.product-gallery-stage img.is-zoomed { max-width:none; max-height:none; width:160%; height:auto; flex:0 0 auto; align-self:center; cursor:grab; touch-action:none; user-select:none; }
.product-gallery-stage.is-panning img.is-zoomed { cursor:grabbing; }
.gallery-zoom-hint { position:absolute; inset-block-end:8px; inset-inline-end:8px; padding:4px 10px; border-radius:999px; background:rgba(0,0,0,.55); color:#fff; font-size:11.5px; pointer-events:none; }
.gallery-zoom-hint[hidden] { display:none; }
.similar-title-results{grid-column:1/-1;border:1px solid var(--border);border-radius:8px;padding:10px 12px;background:var(--surface-2)}
.similar-title-results[hidden]{display:none}
.similar-title-results ul{margin:8px 0 0;padding-inline-start:22px}
.similar-title-results li{margin:5px 0;overflow-wrap:anywhere}
.similar-title-results li .btn{margin-inline-start:8px;vertical-align:middle}
.similar-title-results [data-pick-reference-button].is-active{background:var(--primary-strong);border-color:var(--primary-strong);color:var(--on-primary);box-shadow:0 0 0 2px var(--primary-soft)}
.wholesale-search{display:grid;gap:6px;margin:12px 0}.wholesale-search[hidden]{display:none}
[data-ws-pagination]{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:12px 0}[data-ws-pagination][hidden]{display:none}
.wholesale-selected-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;border-bottom:1px solid var(--border);padding:8px 0}.wholesale-selected-row span{flex:1;min-width:180px}

/* Authenticated wholesale request: compact, aligned delivery and address controls. */
.wholesale-request form[data-wholesale-catalog]{display:grid;gap:16px}
.wholesale-request .form-group{min-width:0;margin-bottom:0}
.wholesale-request .grid-2,.wholesale-request .grid-3{gap:14px}
.wholesale-request .ws-address-book{background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:14px;display:grid;gap:8px}
.wholesale-request .ws-address-heading{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.wholesale-request .ws-coordinates{align-items:center}
.wholesale-request .ws-save-address{display:grid;gap:10px}
.wholesale-request .ws-save-address [hidden]{display:none}
.wholesale-request button[type=submit]{justify-self:start}

/* Prevent mobile browsers from zooming into form controls on focus. */
@media (max-width: 767px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea, select.form-control, textarea.form-control { font-size: max(16px, 1em); }
    :where(
        input.form-control:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="image"]),
        select.form-control:not([multiple]):not([size]),
        select.form-control[size="1"]
    ) {
        height: 44px;
        max-height: 44px;
    }
}

/* Non-modal, session-backed product comparison */
.compare-widget { position: fixed; z-index: 90; inset-inline-start: clamp(12px, 2vw, 28px); bottom: 24px; width: min(370px, calc(100vw - 24px)); pointer-events: none; }
.compare-widget > * { pointer-events: auto; }
.compare-launcher { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--accent-border); border-radius: 999px; padding: 10px 14px; background: var(--chrome); color: var(--on-chrome); box-shadow: var(--shadow-lg); cursor: pointer; font: inherit; font-weight: 800; }
.compare-launcher b { display: inline-flex; align-items: center; justify-content: center; padding: 3px 9px; border-radius: 999px; background: var(--on-chrome-accent); color: var(--chrome); font-size: 12px; white-space: nowrap; }
.compare-panel { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 16px; max-height: min(70vh, 560px); max-height: min(70dvh, 560px); overflow-y: auto; }
.compare-panel-head { display: flex; gap: 11px; align-items: center; }
.compare-panel-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 13px; color: var(--primary-strong); background: var(--primary-soft); }
.compare-heading { display: grid; gap: 1px; flex: 1; min-width: 0; }
.compare-heading span { font-size: 11px; color: var(--text-muted); }
.compare-heading strong { font-size: 15px; }
.compare-close, .compare-remove { display: grid; place-items: center; flex: none; border: 1px solid var(--border); color: var(--text-muted); background: var(--surface-2); border-radius: 10px; width: 36px; height: 36px; font-size: 23px; line-height: 1; cursor: pointer; }
.compare-close:hover, .compare-remove:hover { color: var(--primary-strong); border-color: var(--primary); }
.compare-progress { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 7px; color: var(--text-muted); font-size: 12px; }
.compare-progress strong { color: var(--primary-strong); direction: ltr; }
.compare-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; direction: ltr; }
.compare-slots i { height: 4px; border-radius: 9px; background: var(--border); }
.compare-slots i.is-filled { background: var(--primary); }
.compare-items { display: grid; gap: 6px; margin-top: 12px; }
.compare-item { display: flex; align-items: center; gap: 10px; padding: 7px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.compare-item img { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; background: var(--surface); }
.compare-item-title { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; overflow-wrap: anywhere; }
.compare-remove { width: 30px; height: 30px; font-size: 20px; background: var(--surface); }
.compare-empty, .compare-footnote { margin: 0; font-size: 12px; color: var(--text-muted); }
.compare-status { margin: 9px 0; font-size: 12px; color: var(--primary-strong); min-height: 1em; }
.compare-status.is-error { color: var(--danger, #b42318); }
.compare-view { width: 100%; justify-content: center; gap: 8px; }
.compare-view.is-empty { opacity: .7; }
.compare-footnote { text-align: center; margin-top: 8px; }
[data-compare-add].is-compare-selected { color: var(--primary-strong); background: var(--primary-soft); border-color: var(--primary); }
.compare-widget button:focus-visible, .compare-widget a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
@media (max-width: 680px) { .compare-widget { bottom: 76px; } .compare-panel { max-height: min(65vh, 500px); max-height: min(65dvh, 500px); } }
@media print { .compare-widget { display: none !important; } }

/* ---------------------------------------------------------------------------
   Compact status chips (order cards, warranty cases, return cases)
   ---------------------------------------------------------------------------
   These pages used to stack bold text, a payment badge and a paragraph per row,
   which made every card tall and hard to scan at a glance. A chip is the single
   place a status is allowed to appear: one glyph plus the shortest honest label. */
.status-chip { white-space: nowrap; font-size: 11.5px; padding: 2px 9px 2px 7px; gap: 4px; text-decoration: none; }
.status-chip svg, .status-chip .icon { width: 13px; height: 13px; flex: none; opacity: .9; }
a.status-chip:hover { filter: brightness(.96); }

/* Status column inside the order table: chips stack tightly instead of pushing rows apart. */
.order-status-stack { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.order-status-stack > * { flex: none; }

/* The action column owns the buttons; keeping them on one line stops the row from growing. */
.order-action-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.order-action-row .btn { white-space: nowrap; }

/* Collapsible detail block: long history/evidence stays behind a summary so it cannot
   stretch the card. Native <details> keeps this working without JavaScript. */
/* Icon-only affordances. Ops columns used to hold five sentences per row; the same
   information now reads as five tinted icons with tooltips. */
.icon-action {
    display: inline-flex; align-items: center; justify-content: center; gap: 2px;
    width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text-soft); text-decoration: none;
    cursor: pointer; padding: 0; position: relative; flex: 0 0 auto;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease, transform .12s ease;
}
.icon-action:hover { transform: translateY(-1px); }
.icon-action.is-disabled, .icon-action.is-static { cursor: default; opacity: .55; transform: none; }
.icon-action-emerald { color: var(--primary-strong); background: var(--primary-soft); border-color: var(--primary-border); }
.icon-action-info    { color: var(--info); background: var(--info-soft); border-color: var(--info-border); }
.icon-action-warn    { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-border); }
.icon-action-danger  { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-border); }
.icon-action-gold    { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-border); }
.icon-action-muted   { color: var(--text-soft); background: var(--surface-3); }
.icon-action-count { font-size: 10.5px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.icon-action-form { display: inline; margin: 0; }
.icon-actions { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }

/* Fixed rhythm for order-ish rows so a long list stays aligned whatever the content. */
.order-row { display: grid; grid-template-columns: minmax(150px,1.4fr) 96px minmax(110px,1fr) minmax(120px,1.1fr) auto; gap: 12px; align-items: center; }
.order-row-head { font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.order-cards { display: grid; gap: 8px; }
@media (max-width: 860px) { .order-row { grid-template-columns: 1fr auto; row-gap: 6px; } .order-row-head { display: none; } }

/* Deadline lines: one row per live window, no paragraph. */
.order-deadlines { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; font-size: 12.5px; }
.deadline-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 5px 9px; border-radius: 8px; font-size: 12px; line-height: 1.6; }
.deadline-line strong { font-weight: 700; }
.deadline-line-warn { background: var(--warn-soft); border: 1px solid var(--warn-border); }
.deadline-line-info { background: var(--info-soft); border: 1px solid var(--info-border); }
.deadline-sep { opacity: .45; }
.deadline-total { font-variant-numeric: tabular-nums; }
.deadline-line .icon-action { width: 24px; height: 24px; border-radius: 7px; margin-inline-start: 2px; }

/* Legend: the key to the icons, shown once above the list instead of repeated per row. */
.icon-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); font-size: 12.5px; }
.icon-legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--text-soft); }

.card-disclosure { border: 1px solid var(--border); border-radius: 10px; padding: 0; background: var(--surface); }
.card-disclosure > summary {
    cursor: pointer; padding: 9px 12px; font-size: 12.5px; font-weight: 700;
    color: var(--text-muted); list-style: none; display: flex; align-items: center; gap: 7px;
}
.card-disclosure > summary::-webkit-details-marker { display: none; }
.card-disclosure > summary::after { content: '▾'; margin-inline-start: auto; font-size: 11px; opacity: .7; }
.card-disclosure[open] > summary::after { content: '▴'; }
.card-disclosure > summary:hover { color: var(--text); }
.card-disclosure > .card-disclosure-body { padding: 0 12px 12px; font-size: 12.8px; }

@media (max-width: 720px) {
    .status-chip span { display: none; }        /* icon-only on narrow screens */
    .status-chip { padding: 3px 7px; }
}

/* Labels that collapse to icon-only on small screens, so action cells stay one line. */
@media (max-width: 900px) { .hide-narrow { display: none !important; } }

tr[data-fd-row].is-selected {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}

/* ---------- 16 Fast Delivery (4h Storefront, Cart, Admin/Vendor SLA) ---------- */
.badge-fast {
    background: var(--warn-soft);
    color: var(--warn);
    border: 1px solid var(--warn-border);
    font-weight: 800;
}

.fast-hero-card {
    background: var(--surface);
    border: 1.5px solid var(--primary-border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}
.fast-hero-card.is-closing-soon {
    border-color: var(--warn-border);
}
.fast-hero-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}
.fast-hero-eyebrow {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.fast-hero-timer {
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius);
    padding: 10px 16px;
    min-width: 210px;
    text-align: center;
}
.fast-hero-timer.is-urgent {
    background: var(--warn-soft);
    border-color: var(--warn-border);
    color: var(--warn);
}
.fast-hero-timer small {
    display: block;
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 4px;
}
.fast-hero-timer strong {
    font-size: 18px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.fast-hero-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-soft);
}

.fast-city-bar {
    padding: 14px 16px;
    margin-bottom: 18px;
    display: grid;
    gap: 12px;
}
.fast-city-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.fast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
    gap: 18px;
}
.fast-grid.is-compact_grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.fast-grid.is-showcase_wide {
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
}
.fast-grid.is-showcase_wide .fast-card {
    flex-direction: row;
    align-items: stretch;
}
.fast-grid.is-showcase_wide .fast-card-media {
    width: 42%;
    flex-shrink: 0;
}

.fast-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1.5px solid var(--border);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.fast-card:hover {
    border-color: var(--primary-border);
    box-shadow: var(--shadow-md);
}
.fast-card-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    background: var(--surface-2);
    overflow: hidden;
}
.fast-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.fast-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    color: var(--text-muted);
}
.fast-card-badges {
    position: absolute;
    inset-inline-start: 10px;
    inset-block-start: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.fast-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex: 1;
}
.fast-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
}
.fast-card-booth {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.fast-card-title {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.45;
}
.fast-card-title a {
    color: var(--text);
    text-decoration: none;
}
.fast-card-title a:hover {
    color: var(--primary-strong);
}
.fast-card-excerpt {
    margin: 0;
    font-size: 12.8px;
    color: var(--text-muted);
    line-height: 1.6;
}
.fast-card-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
}
.fast-courier-tag {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-strong);
}
.fast-card-form {
    margin-top: auto;
    display: grid;
    gap: 9px;
}
.fast-card-var {
    display: block;
}
.fast-card-actions {
    display: grid;
    gap: 8px;
}
.fast-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.fast-qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.fast-qty-stepper input[type="number"] {
    width: 54px;
    padding: 5px;
    text-align: center;
}
.fast-inspect-btn {
    white-space: nowrap;
}
.fast-dual-cta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.fast-cart-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 13px 16px;
    margin-bottom: 18px;
    border-radius: var(--radius);
    background: var(--warn-soft);
    border: 1.5px solid var(--warn-border);
    color: var(--text);
}
.fast-cart-banner.is-closed {
    background: var(--danger-soft);
    border-color: var(--danger-border);
}
.fast-cart-banner-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 240px;
}

.parcel-card.is-fast-parcel {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.fold.is-fast-order {
    border-color: var(--warn-border);
    border-inline-start: 4px solid var(--warn);
}
.fold.is-fast-order.is-fast-urgent {
    border-color: var(--warn);
    background: var(--warn-soft);
}
.fold.is-fast-order.is-fast-overdue {
    border-color: var(--danger);
    border-inline-start-color: var(--danger);
    background: var(--danger-soft);
}
.order-parcel-form.is-fast-parcel {
    border-color: var(--warn-border);
    background: var(--warn-soft);
}

.fast-sla-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: var(--radius-sm);
    background: var(--warn-soft);
    border: 1.5px solid var(--warn-border);
    color: var(--text);
}
.fast-sla-banner.is-overdue {
    background: var(--danger-soft);
    border-color: var(--danger-border);
}
.fast-sla-main {
    display: grid;
    gap: 3px;
}
.fast-sla-main small {
    color: var(--text-soft);
    font-size: 12.5px;
}
.fast-countdown-pill {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}
.fast-countdown-pill.is-urgent {
    border-color: var(--warn-border);
    color: var(--warn);
}
.fast-countdown-pill.is-overdue {
    border-color: var(--danger-border);
    color: var(--danger);
}
.fast-countdown-pill small {
    font-size: 11px;
    color: var(--text-muted);
}
.fast-countdown-pill strong {
    font-size: 15px;
    font-weight: 800;
}
.fast-countdown-inline {
    font-weight: 700;
    color: var(--primary-strong);
    font-variant-numeric: tabular-nums;
}
.fast-countdown-inline.is-urgent {
    color: var(--warn);
}
.fast-countdown-inline.is-overdue {
    color: var(--danger);
}

@media (max-width: 720px) {
    .fast-grid.is-showcase_wide {
        grid-template-columns: 1fr;
    }
    .fast-grid.is-showcase_wide .fast-card {
        flex-direction: column;
    }
    .fast-grid.is-showcase_wide .fast-card-media {
        width: 100%;
    }
    .fast-dual-cta {
        grid-template-columns: 1fr;
    }
}

.recaptcha-box {
    margin: 10px 0;
    display: flex;
    justify-content: flex-start;
}
.g-recaptcha {
    max-width: 100%;
    overflow: hidden;
}

/* ---------- 17 Streamlined Order Flow (Stepper, Next Action, Collapsed Help) ---------- */
.flow-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
    padding: 8px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.flow-step {
    flex: 1 1 92px;
    min-width: 82px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 11.5px;
    line-height: 1.45;
    text-align: center;
    color: var(--text-muted);
    background: var(--surface);
}
.flow-step.is-done {
    background: var(--primary-soft);
    border-color: var(--primary-border);
    color: var(--primary-strong);
    font-weight: 700;
}
.flow-step.is-current {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--text);
    font-weight: 800;
}
.flow-step.is-cancelled {
    background: var(--danger-soft);
    border-color: var(--danger-border);
    color: var(--danger);
    font-weight: 700;
}
.flow-step-num {
    display: inline-block;
    font-size: 10.5px;
    opacity: .8;
    margin-inline-end: 2px;
}

.next-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin: 10px 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--primary-border);
    background: var(--primary-soft);
}
.next-action-bar.is-warn {
    border-color: var(--warn-border);
    background: var(--warn-soft);
}
.next-action-bar.is-muted {
    border-color: var(--border);
    background: var(--surface-2);
}
.next-action-copy {
    display: grid;
    gap: 2px;
    min-width: 210px;
    flex: 1 1 240px;
}
.next-action-copy strong {
    font-size: 13.5px;
}
.next-action-copy small {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.55;
}

.help-disclosure {
    margin: 8px 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
}
.help-disclosure > summary {
    cursor: pointer;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.help-disclosure > summary::-webkit-details-marker {
    display: none;
}
.help-disclosure > summary::after {
    content: '▾';
    margin-inline-start: auto;
    font-size: 11px;
    opacity: .7;
}
.help-disclosure[open] > summary::after {
    content: '▴';
}
.help-disclosure > summary:hover {
    color: var(--text);
}
.checkout-ship-tab > summary {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text);
}
.checkout-ship-tab > summary::after {
    margin-inline-start: 6px;
}
.checkout-ship-tab-badge {
    margin-inline-start: auto;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--bg-alt, #eef2eb);
    border: 1px solid var(--border);
    color: var(--primary);
    white-space: nowrap;
}
.mh-order-placed-banner {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 20px;
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    border: 1.5px solid #b8dfca;
    background: #fff9f0;
    box-shadow: 0 10px 26px rgba(24, 48, 32, 0.08);
    animation: mhBannerFadeIn .24s ease-out;
}
.mh-order-placed-banner__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
    background: linear-gradient(90deg, #e7f7ed 0%, #f1fbf4 100%);
    border-bottom: 1px solid #cce9d7;
}
.mh-order-placed-banner__title {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 15.5px;
    font-weight: 900;
    color: #14532d;
    line-height: 1.5;
}
.mh-order-placed-banner__badge {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #16a34a;
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 900;
    flex: 0 0 auto;
}
.mh-order-placed-banner__close {
    appearance: none;
    border: 1.5px solid #b5dec6;
    background: rgba(255, 255, 255, 0.88);
    color: #14532d;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.mh-order-placed-banner__close:hover {
    background: #ffffff;
    border-color: #16a34a;
}
.mh-order-placed-banner__close:active {
    transform: scale(.95);
}
.mh-order-placed-banner__body {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 18px;
    background: linear-gradient(90deg, #fff3e2 0%, #fff8ee 100%);
    color: #7c380b;
}
.mh-order-placed-banner__warn-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: #fed7aa;
    color: #9a3412;
    font-size: 13px;
    font-weight: 800;
    flex: 0 0 auto;
    margin-top: 2px;
}
.mh-order-placed-banner__sub {
    margin: 0;
    font-size: 13.4px;
    font-weight: 600;
    line-height: 1.95;
    color: #7c380b;
}
[data-theme="dark"] .mh-order-placed-banner {
    border-color: rgba(74, 222, 128, 0.35);
    background: #221a11;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36);
}
[data-theme="dark"] .mh-order-placed-banner__head {
    background: linear-gradient(90deg, rgba(22, 101, 52, 0.42) 0%, rgba(20, 83, 45, 0.28) 100%);
    border-bottom-color: rgba(74, 222, 128, 0.28);
}
[data-theme="dark"] .mh-order-placed-banner__title { color: #bbf7d0; }
[data-theme="dark"] .mh-order-placed-banner__close {
    background: rgba(15, 28, 20, 0.72);
    border-color: rgba(74, 222, 128, 0.38);
    color: #dcfce7;
}
[data-theme="dark"] .mh-order-placed-banner__body {
    background: linear-gradient(90deg, rgba(154, 52, 18, 0.32) 0%, rgba(120, 53, 15, 0.22) 100%);
    color: #fed7aa;
}
[data-theme="dark"] .mh-order-placed-banner__warn-icon {
    background: rgba(251, 146, 60, 0.24);
    color: #fdba74;
}
[data-theme="dark"] .mh-order-placed-banner__sub { color: #ffedd5; }
@keyframes mhBannerFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.help-disclosure-body {
    padding: 4px 12px 12px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    line-height: 1.75;
    color: var(--text-muted);
    display: grid;
    gap: 6px;
}
.help-disclosure-body p,
.help-disclosure-body li {
    margin: 0;
    font-size: 12px;
}
.compact-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 8px;
    margin: 10px 0;
    font-size: 12.5px;
}
.compact-meta-cell {
    background: var(--surface-2);
    border-radius: 10px;
    padding: 8px 10px;
}
.compact-meta-cell small {
    display: block;
    font-size: 11.5px;
    color: var(--text-muted);
}


/* ---------- Career desk (/job and /admin/jobs) ---------- */
.job-page { scroll-behavior: smooth; }
.job-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; overflow: hidden; }
.job-hero-copy { max-width: 720px; }
.job-hero-text { color: var(--text-muted); line-height: 1.9; margin: 0 0 18px; white-space: normal; }
.job-hero-art { flex: 0 0 110px; width: 110px; height: 110px; border-radius: 26px; display: grid; place-items: center; color: var(--primary-strong); background: var(--primary-soft); }
.job-steps, .job-role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.job-step { display: grid; gap: 6px; align-content: start; }
.job-step-no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-strong); font-weight: 800; }
.job-step > span:last-child { font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.job-role-card { display: grid; gap: 10px; align-content: start; }
.job-role-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.job-role-head h3 { margin: 0; font-size: 17px; }
.job-role-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; color: var(--text-muted); font-size: 12.6px; }
.job-role-meta li, .job-role-meta span { display: inline-flex; align-items: center; gap: 5px; }
.job-role-summary, .job-role-details p { margin: 0; font-size: 13.4px; line-height: 1.8; color: var(--text-muted); white-space: normal; }
.job-role-details { border-top: 1px solid var(--border); padding-top: 8px; }
.job-role-details strong { font-size: 13px; }
.job-empty { margin-top: 16px; color: var(--text-muted); }
.job-apply { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; margin-top: 30px; scroll-margin-top: 90px; }
.job-apply-intro p { color: var(--text-muted); line-height: 1.8; font-size: 13.8px; }
.job-apply-hint { display: flex; gap: 8px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.job-apply-form { display: grid; gap: 12px; align-content: start; }
.job-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.job-filter .btn.active { background: var(--primary); color: var(--on-primary, #fff); border-color: var(--primary); }
@media (max-width: 992px) {
    .job-steps, .job-role-grid, .job-apply { grid-template-columns: minmax(0, 1fr); }
    .job-hero-art { display: none; }
}

/* ---------- Journal anchor picker (admin) ----------
   Search-as-you-type instead of two rows of catalogue buttons: the form never carries the
   catalogue, so it behaves the same with twenty products or twenty thousand. */
.mag-anchor-picker { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.mag-anchor-tabs { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-3); }
.mag-anchor-tab { border: 0; background: transparent; color: var(--text-soft); font: inherit; font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 8px; cursor: pointer; }
.mag-anchor-tab.is-active { background: var(--surface); color: var(--primary-strong); box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.08)); }
.mag-anchor-search .form-control { width: 100%; }
.mag-anchor-hint { margin: 0; font-size: 12px; line-height: 1.7; color: var(--text-muted); }
.mag-anchor-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 232px; overflow-y: auto; }
.mag-anchor-option { display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: start; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.mag-anchor-option:hover, .mag-anchor-option:focus-visible { border-color: var(--primary-border); background: var(--primary-soft); }
.mag-anchor-option code { flex: 0 0 auto; font-size: 11.5px; color: var(--primary-strong); }
.mag-anchor-option span { font-size: 12.6px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mag-anchor-inserted { margin: 0; font-size: 12px; color: var(--primary-strong); font-weight: 700; }
.mag-anchor-manual { border-top: 1px dashed var(--border); padding-top: 6px; }
.mag-anchor-manual > summary { cursor: pointer; font-size: 12px; color: var(--text-muted); }
.mag-anchor-manual-help { margin: 6px 0; font-size: 11.8px; color: var(--text-muted); line-height: 1.8; }
.mag-anchor-manual-row { display: flex; gap: 8px; align-items: center; }
.mag-anchor-manual-row .form-control { max-width: 190px; }


/* ---------- Checkout: one payment panel beside the amount and the submit button ---------- */
.pay-method {
    display: block; padding: 12px 14px; margin: 0 0 8px; border-radius: 12px;
    border: 1.5px solid var(--border); background: var(--surface-2); cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.pay-method:hover { border-color: var(--primary-border); }
.pay-method:focus-within, .pay-method:has(input:checked) {
    border: 2px solid var(--primary); background: var(--primary-soft);
    box-shadow: 0 4px 12px rgba(34, 72, 48, .10);
}
.checkout-pay-panels { display: grid; gap: 12px; margin: 14px 0; }
.checkout-pay-panels[hidden] { display: none !important; }
.pay-panel {
    display: grid; gap: 12px; padding: 16px; border: 2px solid var(--primary);
    border-radius: 14px; background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
    box-shadow: 0 10px 26px rgba(20, 34, 24, .09); min-width: 0;
}
.pay-panel[hidden] { display: none !important; }
.pay-panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
    padding-bottom: 9px; border-bottom: 1px dashed var(--border-strong); font-size: 13.8px; font-weight: 800; color: var(--primary-strong);
}
.pay-destination {
    display: grid; gap: 10px; padding: 13px; border-radius: 12px;
    background: var(--surface); border: 1.5px solid var(--border-strong); min-width: 0;
}
.pay-dest-item { display: grid; gap: 5px; min-width: 0; }
.pay-destination small, .pay-ref-box small, .mh-pay-status small { display: block; color: var(--text-muted); font-size: 12.2px; line-height: 1.7; }
/* Base .mh-pay-number stays centre-aligned for deposit references; .mh-pay-number--ltr left-aligns card, IBAN & crypto addresses. */
.mh-pay-number {
    display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
    width: 100%; min-width: 0; text-align: center; direction: ltr; position: relative;
}
.mh-pay-number--ltr,
.pay-destination .mh-pay-number,
.mh-pay-grid .mh-pay-number {
    justify-content: space-between; text-align: left; direction: ltr; flex-wrap: nowrap;
    padding: 8px 11px; border-radius: 10px; background: var(--surface-2);
    border: 1.5px solid var(--border-strong); cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.mh-pay-number--ltr:hover,
.pay-destination .mh-pay-number:hover,
.mh-pay-grid .mh-pay-number:hover { border-color: var(--primary); }
.mh-pay-number--ltr code,
.pay-destination .mh-pay-number code,
.mh-pay-grid .mh-pay-number code {
    flex: 1 1 auto; text-align: left; direction: ltr; font-size: 14.8px; font-weight: 800;
    letter-spacing: .55px; color: var(--text);
}
.mh-pay-number code, .mh-pay-number strong {
    display: inline-block; max-width: 100%; font-size: 15px; font-weight: 800;
    letter-spacing: .4px; word-break: break-all; overflow-wrap: anywhere; line-height: 1.6;
}
.mh-pay-copy-end {
    display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; direction: ltr;
}
.btn-icon-copy {
    display: inline-grid; place-items: center; flex: 0 0 auto;
    width: 36px; height: 36px; padding: 0; border-radius: 9px;
    border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--primary);
    cursor: pointer; transition: border-color .15s, background .15s, color .15s, transform .1s;
}
.btn-icon-copy:hover { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); }
.btn-icon-copy:active { transform: scale(.95); }
.btn-icon-copy:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-icon-copy .icon { margin: 0; }
.btn-icon-copy.is-copied { background: #e7f6ec; border-color: #107c41; color: #107c41; }
.mh-copied-badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
    background: #107c41; color: #fff; font-size: 11.8px; font-weight: 800; line-height: 1.3;
    direction: rtl; white-space: nowrap; flex: 0 0 auto;
    box-shadow: 0 3px 10px rgba(16, 124, 65, .28); animation: mh-copy-pop .16s ease-out;
}
@keyframes mh-copy-pop {
    from { opacity: 0; transform: translateY(3px) scale(.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.pay-ref-box, .mh-pay-ref {
    display: grid; gap: 8px; padding: 14px 15px; border-radius: 13px; text-align: center;
    border: 2px solid #d32f2f;
    background: linear-gradient(180deg, #fff5f5 0%, #ffe6e6 100%);
    color: #9a1414;
    box-shadow: 0 6px 18px rgba(211, 47, 47, .15);
}
[data-theme="dark"] .pay-ref-box, [data-theme="dark"] .mh-pay-ref {
    border-color: #ef5350;
    background: linear-gradient(180deg, #361416 0%, #260d0f 100%);
    color: #ffcdd2;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .36);
}
.pay-ref-box small, .mh-pay-ref small {
    color: inherit; font-weight: 700; font-size: 12.6px;
}
.pay-ref-box .mh-pay-number, .mh-pay-ref .mh-pay-number {
    justify-content: center; text-align: center; direction: ltr;
    display: inline-flex; width: auto; max-width: 100%; margin: 2px auto 0;
    padding: 8px 16px; border-radius: 11px;
    background: rgba(255, 255, 255, .92); border: 1.5px dashed #d32f2f;
    cursor: pointer; gap: 10px;
}
[data-theme="dark"] .pay-ref-box .mh-pay-number, [data-theme="dark"] .mh-pay-ref .mh-pay-number {
    background: rgba(20, 8, 9, .75); border-color: #ef5350;
}
.pay-ref-box .mh-pay-number strong, .mh-pay-ref .mh-pay-number strong {
    font-size: 23px; font-weight: 900; letter-spacing: 3px; color: #b71c1c;
}
[data-theme="dark"] .pay-ref-box .mh-pay-number strong, [data-theme="dark"] .mh-pay-ref .mh-pay-number strong {
    color: #ff8a80;
}
.pay-ref-box .btn-icon-copy, .mh-pay-ref .btn-icon-copy {
    background: #fff; border-color: #d32f2f; color: #c62828;
}
[data-theme="dark"] .pay-ref-box .btn-icon-copy, [data-theme="dark"] .mh-pay-ref .btn-icon-copy {
    background: #2b1113; border-color: #ef5350; color: #ff8a80;
}
.pay-declaration {
    display: grid; gap: 11px; padding: 15px; border-radius: 12px;
    background: var(--surface); border: 1.5px solid var(--border-strong);
}
.pay-declaration .form-group { margin: 0; }
.pay-declaration [hidden] { display: none !important; }
.pay-warning-note { display: block; color: var(--warn); font-size: 12.4px; line-height: 1.7; }
.pay-ack {
    display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border-radius: 10px;
    background: var(--surface); border: 1.5px solid var(--border-strong);
    font-size: 12.8px; font-weight: 700; line-height: 1.7; cursor: pointer; color: var(--text);
}
.pay-ack input { margin-top: 4px; width: 17px; height: 17px; flex: 0 0 auto; }
.mh-pay-status { display: grid; gap: 10px; }
.mh-pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.mh-pay-grid > div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); min-width: 0; overflow-wrap: anywhere; }
.mh-pay-note { margin: 0; font-size: 12.6px; line-height: 1.8; color: var(--text-muted); }

/* ---------- Central Invoice & User Financial Statement Framing (.inv-*) ---------- */
.inv-container { max-width: 860px; }
.inv-hero-card { margin-bottom: 16px; border: 1.5px solid var(--border-strong); }
.inv-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(235px, 0.85fr);
    gap: 18px;
    align-items: stretch;
}
.inv-hero-main { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.inv-badge-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.inv-title { margin: 0 0 4px; font-size: clamp(20px, 2.4vw, 24px); }
.inv-subtitle { margin: 0; font-size: 13.4px; color: var(--text-muted); line-height: 1.8; }
.inv-meta-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.inv-meta-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px; border-radius: 8px;
    background: var(--surface-2); border: 1px solid var(--border);
    font-size: 12px; color: var(--text-muted);
}
.inv-meta-pill strong { color: var(--text); }
.inv-amount-box {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    padding: 14px 16px; border-radius: 13px;
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
    border: 1.5px solid var(--primary-border);
    text-align: start;
}
.inv-amount-box__label { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.inv-amount-box__value {
    font-size: clamp(20px, 2.5vw, 24px); font-weight: 900;
    color: var(--primary-strong); font-variant-numeric: tabular-nums; line-height: 1.35;
}
.inv-amount-box__sub { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.inv-children-box {
    margin-top: 14px; padding: 12px 14px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--border); font-size: 12.8px;
}
.inv-children-box__head { display: block; margin-bottom: 8px; font-size: 13px; }
.inv-children-box__list { display: grid; gap: 6px; }
.inv-children-box__row {
    display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}
.inv-cancel-bar {
    margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border-strong);
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.inv-status-card { display: grid; gap: 10px; margin-bottom: 16px; }
.inv-status-card--review { border: 1.5px solid var(--primary); }
.inv-status-card--rejected { border: 1.5px solid var(--danger, #c62828); }
.inv-status-card__head {
    display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
    padding-bottom: 8px; border-bottom: 1px dashed var(--border);
}
.inv-summary-box {
    display: grid; gap: 7px; padding: 12px 14px; border-radius: 11px;
    background: var(--surface-2); border: 1px solid var(--border); font-size: 13px;
}
.inv-methods-card { margin-bottom: 16px; }
.inv-method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 10px;
    align-items: stretch;
}
.inv-method-tile {
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
    height: 100%; margin: 0 !important; padding: 12px 14px;
    border-radius: 12px;
}
.inv-method-tile__top { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 13.6px; }
.inv-method-tile__top input { width: 17px; height: 17px; flex: 0 0 auto; margin: 0; }
.inv-method-tile__note {
    display: block; padding-inline-start: 26px;
    font-size: 11.8px; color: var(--text-muted); line-height: 1.65;
}
.inv-dest-meta {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px;
}
.inv-dest-meta__cell {
    padding: 10px 13px; border-radius: 11px;
    background: var(--surface); border: 1.5px solid var(--border);
    min-width: 0;
}
.inv-dest-meta__cell small { display: block; font-size: 11.8px; color: var(--text-muted); margin-bottom: 2px; }
.inv-dest-meta__cell strong { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.inv-exact-amount-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 13px; border-radius: 11px;
    background: var(--surface-2); border: 1.5px solid var(--primary-border);
}
.inv-exact-amount-row strong {
    font-size: 16px; font-weight: 900; color: var(--primary-strong); font-variant-numeric: tabular-nums;
}
.inv-history-card { margin-top: 16px; }
.inv-history-list { display: grid; gap: 8px; font-size: 13px; }
.inv-history-row {
    display: grid; gap: 5px; padding: 10px 13px; border-radius: 11px;
    background: var(--surface-2); border: 1px solid var(--border);
}
.inv-history-row__top {
    display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
}
@media (max-width: 680px) {
    .inv-hero-grid { grid-template-columns: 1fr; gap: 12px; }
    .inv-method-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .pay-method { padding: 10px 12px; }
    .pay-panel { padding: 13px; }
    .mh-pay-number--ltr, .pay-destination .mh-pay-number { flex-wrap: wrap; }
    .pay-ref-box .mh-pay-number strong, .mh-pay-ref .mh-pay-number strong { font-size: 19px; letter-spacing: 2px; }
}

/* ---------- Academy shortcut in the mobile drawer (the full menu stays under its accordion) ---------- */
/* ---------- Graphical Road / Sidewalk Stepper (مسیر جاده / پیاده‌رو مراحل مرسوله) ---------- */
.mh-road-stepper {
    margin: 16px 0 6px; padding: 14px 14px 12px; border-radius: 14px;
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
    border: 1px solid var(--border);
}
.mh-road-caption {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 12.4px; color: var(--text-muted); margin-bottom: 12px;
}
.mh-road-caption strong { color: var(--text); font-weight: 800; }
.mh-road-caption small { color: var(--text-muted); font-size: 11.8px; }
.mh-road-caption-dot {
    width: 9px; height: 9px; border-radius: 50%; background: var(--accent, #c78b3b);
    box-shadow: 0 0 0 3px var(--accent-soft, rgba(199, 139, 59, .2)); flex: 0 0 auto;
}
.mh-road-track {
    display: grid; grid-template-columns: repeat(var(--road-steps, 4), minmax(0, 1fr));
    gap: 0; align-items: start;
}
.mh-road-stop { display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }
.mh-road-lane {
    position: relative; width: 100%; height: 46px;
    display: flex; align-items: center; justify-content: center;
}
/* Road / sidewalk segments: paved double-curb path with center lane markings ahead and travelled emerald trail behind */
.mh-road-seg {
    position: absolute; top: 50%; height: 14px; transform: translateY(-50%);
    background-color: #dfd9ce;
    border-top: 2px solid #bfb6a6; border-bottom: 2px solid #bfb6a6;
    background-image: repeating-linear-gradient(90deg, transparent 0 8px, rgba(255, 255, 255, .88) 8px 16px);
    background-size: 16px 2px; background-repeat: repeat-x; background-position: center;
}
[data-theme="dark"] .mh-road-seg {
    background-color: #2c312b; border-top-color: #464e44; border-bottom-color: #464e44;
    background-image: repeating-linear-gradient(90deg, transparent 0 8px, rgba(255, 255, 255, .28) 8px 16px);
}
.mh-road-seg-in { inset-inline-start: 0; inset-inline-end: 50%; }
.mh-road-seg-out { inset-inline-start: 50%; inset-inline-end: 0; }
.mh-road-stop.is-first .mh-road-seg-in {
    inset-inline-start: 18%; border-start-start-radius: 999px; border-end-start-radius: 999px;
}
.mh-road-stop.is-last .mh-road-seg-out {
    inset-inline-end: 18%; border-start-end-radius: 999px; border-end-end-radius: 999px;
}
.mh-road-stop.is-done .mh-road-seg,
.mh-road-stop.is-current .mh-road-seg-in,
.mh-road-stop.is-delivered .mh-road-seg-out {
    background-color: var(--primary); border-top-color: var(--primary-strong); border-bottom-color: var(--primary-strong);
    background-image: repeating-linear-gradient(90deg, transparent 0 9px, rgba(255, 255, 255, .45) 9px 15px);
}
.mh-road-node {
    position: relative; z-index: 2; display: inline-grid; place-items: center;
    transition: transform .2s ease;
}
.mh-road-node--done {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary); color: #fff; border: 2.5px solid var(--surface);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .14);
}
.mh-road-node--upcoming {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--surface); border: 2px solid #b5ab99;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.mh-road-pin { width: 8px; height: 8px; border-radius: 50%; background: #b5ab99; }
.mh-road-node--parcel {
    width: 42px; height: 42px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fffaf0 0%, #f7e6c4 100%);
    border: 2.5px solid #b8742a;
    box-shadow: 0 5px 14px rgba(138, 84, 22, .25), 0 0 0 5px rgba(217, 155, 82, .2);
    transform: translateY(-3px);
}
.mh-road-stop.is-delivered .mh-road-node--parcel {
    border-color: var(--success, #107c41);
    box-shadow: 0 5px 14px rgba(16, 124, 65, .24), 0 0 0 5px rgba(16, 124, 65, .16);
}
.mh-road-stop.is-returned .mh-road-node--parcel {
    border-color: var(--danger, #a61b1b);
    box-shadow: 0 5px 14px rgba(166, 27, 27, .24), 0 0 0 5px rgba(166, 27, 27, .16);
}
.mh-road-label { padding: 6px 6px 0; display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 175px; }
.mh-road-title { font-size: 12.4px; line-height: 1.55; color: var(--text-muted); font-weight: 600; }
.mh-road-stop.is-done .mh-road-title { color: var(--primary-strong); font-weight: 700; }
.mh-road-stop.is-current .mh-road-title { color: var(--text); font-weight: 800; font-size: 13px; }
.mh-road-here {
    display: inline-block; font-size: 10.8px; font-weight: 800; padding: 2px 8px; border-radius: 999px;
    background: #fff3d6; color: #7a480d; border: 1px solid #e4be7e;
}
.mh-road-stop.is-delivered .mh-road-here { background: #e7f6ec; color: #107c41; border-color: #9dd8b3; }
.mh-road-stop.is-returned .mh-road-here { background: #fdeceb; color: #a61b1b; border-color: #f0b3af; }
@media (max-width: 640px) {
    .mh-road-track { grid-template-columns: 1fr; gap: 0; }
    .mh-road-stop { flex-direction: row; align-items: stretch; text-align: start; gap: 12px; }
    .mh-road-lane { width: 46px; height: auto; min-height: 56px; flex: 0 0 46px; }
    .mh-road-seg {
        top: auto; left: 50%; width: 14px; height: auto; transform: translateX(-50%);
        border-top: 0; border-bottom: 0; border-left: 2px solid #bfb6a6; border-right: 2px solid #bfb6a6;
        background-image: repeating-linear-gradient(180deg, transparent 0 7px, rgba(255, 255, 255, .88) 7px 14px);
        background-size: 2px 14px; background-repeat: repeat-y; background-position: center;
    }
    .mh-road-seg-in { inset-inline: auto; top: 0; bottom: 50%; }
    .mh-road-seg-out { inset-inline: auto; top: 50%; bottom: 0; }
    .mh-road-stop.is-first .mh-road-seg-in { top: 18%; border-radius: 999px 999px 0 0; }
    .mh-road-stop.is-last .mh-road-seg-out { bottom: 18%; border-radius: 0 0 999px 999px; }
    .mh-road-stop.is-done .mh-road-seg,
    .mh-road-stop.is-current .mh-road-seg-in,
    .mh-road-stop.is-delivered .mh-road-seg-out {
        border-left-color: var(--primary-strong); border-right-color: var(--primary-strong);
        background-image: repeating-linear-gradient(180deg, transparent 0 8px, rgba(255, 255, 255, .45) 8px 14px);
    }
    .mh-road-node--parcel { transform: none; }
    .mh-road-label { padding: 10px 0; align-items: flex-start; max-width: none; justify-content: center; }
}
.mobile-academy-shortcut {
    display: flex; align-items: center; gap: 9px; margin: 2px 0 8px; padding: 10px 12px;
    border: 1px solid var(--primary-border); border-radius: 11px; background: var(--primary-soft);
    color: var(--primary-strong); font-weight: 800; font-size: 13.6px; text-decoration: none;
}
.mobile-academy-shortcut:hover { border-color: var(--primary); background: var(--surface-2); }

/* =====================================================================
   18. Carrier desk + parcel fields on phones.
   Lives at the END of the file on purpose: the .carrier-* base classes are
   defined in section 17, and at equal specificity the later declaration
   wins — an earlier media block would silently lose to them.
   ===================================================================== */
@media (max-width: 992px) {
    /* The five-field custom-carrier row needs ~850px on one line; tablet panels
       don't have it, so it stacks here. The three-field row still fits. */
    .carrier-row5 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
    .carrier-fields, .carrier-row5 { grid-template-columns: minmax(0, 1fr); }
    .carrier-auth-row, .carrier-test-form { flex-direction: column; align-items: stretch; }
    .carrier-fields .form-control, .carrier-row5 .form-control,
    .carrier-auth-row .form-control, .carrier-test-form .form-control,
    .carrier-inline-field, .carrier-inline-field-wide, .carrier-inline-field-narrow { width: 100% !important; }
    /* The tracking-code / courier / return-reason labels are flex items capped at
       250px for the desktop row — on the phone stack every field takes the column. */
    .order-parcel-form > .form-label { max-width: none; flex-basis: 100%; }
}

/* ---------- 17 Shop facets: sidebar, chips, toggles, mobile drawer ---------- */
.shop-layout { display: grid; grid-template-columns: minmax(240px, 268px) minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 6px; }
.shop-sidebar {
    position: sticky; top: 84px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); max-height: calc(100vh - 104px);
    display: flex; flex-direction: column; overflow: hidden;
}
.shop-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.shop-sidebar-head strong { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.shop-sidebar-close { display: none; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 8px; }
.shop-sidebar-close:hover { background: var(--bg-alt); color: var(--text); }
.filter-scroll { overflow-y: auto; padding: 4px 16px 16px; }
.filter-group { padding: 14px 0; border-bottom: 1px solid var(--border); }
.filter-group:last-of-type { border-bottom: 0; }
.filter-group-title { display: block; font-weight: 800; font-size: 13.2px; color: var(--text-soft); margin-bottom: 10px; }
.price-range { display: flex; align-items: center; gap: 8px; }
.price-range .form-control { width: 100%; min-width: 0; }
.price-range-sep { color: var(--text-muted); flex: 0 0 auto; }

/* Pill chips (radio/checkbox group) */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip > span { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 12.8px; font-weight: 700; color: var(--text-soft); background: var(--surface); transition: .15s ease; }
.chip:hover > span { border-color: var(--primary); color: var(--primary-strong); }
.chip input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Toggle switches (special sale / fast delivery) */
.switch-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); flex: 0 0 auto; transition: .18s ease; }
.switch-track::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: .18s ease; }
.switch-row input:checked + .switch-track { background: var(--primary); border-color: var(--primary); }
.switch-row input:checked + .switch-track::after { inset-inline-start: 20px; }
.switch-row input:focus-visible + .switch-track { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch-label { font-size: 13.5px; font-weight: 600; color: var(--text-soft); }

.filter-more { margin: 6px 0 0; }
.filter-more-body { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 10px; }
.filter-actions { display: grid; gap: 8px; padding-top: 14px; }

/* Toolbar sort + active filter chips */
.toolbar-sort { display: inline-flex; align-items: center; gap: 8px; }
.toolbar-sort .form-label { margin: 0; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 12px; border-radius: 999px; background: var(--primary-soft); border: 1px solid var(--primary-border); color: var(--primary-strong); font-size: 12.6px; font-weight: 700; text-decoration: none; transition: .15s ease; }
.filter-chip:hover { background: var(--primary); color: var(--on-primary); }
.filter-chip-x { font-size: 15px; line-height: 1; }
.filter-chip-clear { background: transparent; border-color: var(--border-strong); color: var(--text-soft); }
.filter-chip-clear:hover { background: var(--bg-alt); color: var(--text); }

/* Mobile filter trigger + drawer */
.shop-filter-toggle { display: none; margin-bottom: 14px; }
.shop-filter-toggle-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); display: inline-block; margin-inline-start: 2px; }
.shop-filter-overlay { position: fixed; inset: 0; background: rgba(15, 18, 12, .5); z-index: 1100; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }

@media (max-width: 992px) {
    .shop-layout { grid-template-columns: minmax(0, 1fr); }
    .shop-filters-enhanced .shop-filter-toggle { display: inline-flex; }
    .shop-sidebar { position: static; max-height: none; }
    .shop-filters-enhanced .shop-sidebar {
        position: fixed; top: 0; bottom: 0; inset-inline-start: 0;
        width: min(340px, 86vw); max-height: none; z-index: 1200;
        border-radius: 0; box-shadow: var(--shadow-lg);
        transform: translateX(100%); transition: transform .25s ease;
    }
    [dir="ltr"].shop-filters-enhanced .shop-sidebar { transform: translateX(-100%); }
    .shop-sidebar.is-open { transform: none !important; }
    .shop-filters-enhanced .shop-sidebar-close { display: inline-flex; }
}
@media (max-width: 560px) {
    .list-toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-sort { justify-content: space-between; }
}

/* ---------- 18 Homepage smart-filter bar + block notes ---------- */
.section-sm { padding: 14px 0; }
.smart-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.smart-filter { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--text-soft); text-decoration: none; background: var(--surface); transition: .15s ease; white-space: nowrap; }
.smart-filter:hover { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); transform: translateY(-1px); }
.smart-filter-sale { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.smart-filter-sale:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.smart-filter-fast { color: var(--primary-strong); border-color: var(--primary-border); background: var(--primary-soft); }
.smart-filter-fast:hover { color: var(--on-primary); background: var(--primary); border-color: var(--primary); }
.block-note { margin: -6px 0 16px; font-size: 13px; }

@media (max-width: 680px) {
    .smart-filter-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .smart-filter-bar::-webkit-scrollbar { display: none; }
    .smart-filter { flex: 0 0 auto; }
}

/* Three readable desktop columns beside the facets; native mobile form without JS. */
@media (min-width: 993px) {
    .shop-main .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.shop-main { min-width: 0; }
.shop-filter-overlay[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
    .smart-filter, .shop-sidebar { transition: none; }
    .smart-filter:hover { transform: none; }
}

/* Destination preference and actionable, verified empty-result suggestions. */
.empty-filter-suggestions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 16px 0; }

/* Fast delivery is its own catalogue; city selection never occupies home/shop. */
.product-fast-links { display:flex; flex-wrap:wrap; gap:5px; margin-block-end:9px; }
.product-fast-link { text-decoration:none; line-height:1.7; border:1px solid transparent; white-space:normal; }
.product-fast-link:hover, .product-fast-link:focus-visible { border-color:currentColor; text-decoration:underline; }
