/* PWA shell — safe areas, bottom nav, standalone mode */

:root {
    --pwa-primary: #20c4f4;
    --pwa-secondary: #03173d;
    --pwa-bottom-nav-height: 64px;
    --pwa-topbar-height: 48px;
    --pwa-safe-bottom: env(safe-area-inset-bottom, 0px);
    --pwa-safe-top: env(safe-area-inset-top, 0px);
}

html, body {
    font-family: 'Vazir', Tahoma, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
}

.pwa-layout {
    min-height: 100dvh;
}

.pwa-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 23, 61, 0.55);
    backdrop-filter: blur(2px);
    color: #fff;
}

.pwa-loading-overlay__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    padding: 24px;
}

.pwa-loading-overlay__logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.pwa-loading-overlay__text {
    margin: 0;
    font-weight: 600;
    text-align: center;
    max-width: min(90vw, 320px);
    line-height: 1.7;
    font-size: 0.95rem;
}

.pwa-loading-overlay__cancel {
    opacity: 0.85;
    font-size: 0.85rem !important;
}

body.blazor-disconnected .pwa-loading-overlay {
    display: none !important;
}

/* ——— لودینگ صفحات (PageLoading) ——— */
.page-loading {
    width: 100%;
    box-sizing: border-box;
}

.page-loading__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    padding: 24px 20px;
}

.page-loading--block {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(
        100dvh - var(--pwa-topbar-height) - var(--pwa-bottom-nav-height)
        - var(--pwa-safe-top) - var(--pwa-safe-bottom) - 16px
    );
    padding: 16px;
}

.page-loading--inline {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(
        56vh,
        calc(100dvh - var(--pwa-topbar-height) - var(--pwa-bottom-nav-height) - 140px)
    );
    padding: 32px 16px;
}

.page-loading__logo {
    width: auto;
    height: auto;
    max-width: 88px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px;
    box-shadow: 0 4px 16px rgba(3, 23, 61, 0.12);
}

body.dark-mode .page-loading__logo {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.page-loading__spinner-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.page-loading__spinner {
    margin: 0 !important;
}

.page-loading__text {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.7;
    color: var(--mud-palette-text-secondary);
    max-width: min(90vw, 320px);
}

body.dark-mode .page-loading__text {
    color: rgba(255, 255, 255, 0.75);
}

/* لودینگ داخل جدول Mud (دیده‌بان و …) — پر کردن ناحیه خالی */
.mud-table-root .page-loading--inline,
.watchman-grid-scroll .page-loading--inline {
    min-height: min(52vh, 420px);
}

.pwa-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit !important;
    text-decoration: none !important;
    min-width: 0;
}

.pwa-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    padding: 2px;
}

.pwa-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.pwa-brand-title {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-brand-subtitle {
    font-size: 0.65rem;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(42vw, 220px);
}

.pwa-topbar-brand .pwa-brand-title,
.pwa-topbar-brand .pwa-brand-subtitle {
    color: #fff;
}

.pwa-page-header {
    margin: 0 0 6px;
    padding: 6px 12px !important;
    border-radius: 0;
    background: var(--mud-palette-surface) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark-mode .pwa-page-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.pwa-page-header__inner {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
}

.pwa-page-header__text {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
    width: 100%;
}

.pwa-page-header__user-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.pwa-page-header__user {
    margin: 0 !important;
    color: var(--mud-palette-text-secondary) !important;
    font-weight: 600 !important;
}

.pwa-page-header__breadcrumb {
    margin: 0 !important;
    color: var(--mud-palette-text-secondary) !important;
}

.pwa-page-header__title {
    font-weight: 700 !important;
    margin: 0 !important;
    font-size: 1.08rem !important;
    line-height: 1.4 !important;
}

.pwa-page-header__breadcrumb::after,
.pwa-page-header__user-row::after {
    content: "";
    display: inline-block;
    width: 1px;
    height: 14px;
    margin-inline-start: 4px;
    background: rgba(100, 116, 139, 0.32);
    vertical-align: middle;
}

.pwa-page-header__icon {
    font-size: 1.2rem !important;
}

.pwa-drawer-loading {
    padding-top: 4px;
}

.pwa-drawer-header .pwa-brand-link {
    flex: 1;
    min-width: 0;
}

.pwa-drawer-header .pwa-brand-title,
.pwa-drawer-header .pwa-brand-subtitle {
    color: #fff;
}

.pwa-topbar {
    padding-top: var(--pwa-safe-top);
    background: linear-gradient(135deg, var(--pwa-secondary) 0%, #0a3d6b 100%) !important;
    color: #fff !important;
}

.pwa-topbar .mud-icon-button,
.pwa-topbar .mud-typography {
    color: #fff !important;
}

.pwa-refresh-btn--spin .mud-icon-button {
    animation: pwa-refresh-spin 0.9s linear infinite;
}

@keyframes pwa-refresh-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

.pwa-pull-refresh {
    position: fixed;
    top: calc(var(--pwa-topbar-height, 48px) + var(--pwa-safe-top, 0px));
    left: 50%;
    z-index: 1400;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(3, 23, 61, 0.92);
    color: #fff;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, calc(-100% - 8px + var(--pull-offset, 0px)));
    transition: opacity 0.15s ease, transform 0.1s ease;
}

.pwa-pull-refresh--visible {
    opacity: 1;
}

.pwa-pull-refresh__icon {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #20c4f4;
    border-radius: 50%;
}

.pwa-pull-refresh--spin .pwa-pull-refresh__icon {
    animation: pwa-refresh-spin 0.8s linear infinite;
}

.pwa-pull-refresh--ready .pwa-pull-refresh__icon {
    border-top-color: #7ee8ff;
}

.pwa-brand {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-main-content {
    padding-top: calc(var(--pwa-topbar-height) + var(--pwa-safe-top) + 4px) !important;
    padding-bottom: calc(var(--pwa-bottom-nav-height) + var(--pwa-safe-bottom) + 16px) !important;
    min-height: 100dvh;
}

/* فوتر در صفحات کوتاه به پایین viewport بچسبد */
.pwa-main-content:not(.pwa-main-content--full) {
    display: flex;
    flex-direction: column;
}

.pwa-main-content:not(.pwa-main-content--full) .site-footer {
    margin-top: auto;
    flex-shrink: 0;
}

@media (min-width: 960px) {
    .pwa-main-content {
        padding-bottom: 16px !important;
    }
}

.pwa-page-container {
    padding-left: 0;
    padding-right: 0;
    width: 100%;
    max-width: none;
}

/* صفحات تمام‌عرض (دیده‌بان، فیلتر، سیگنال، …) */
.pwa-main-content--full {
    padding-left: 0 !important;
    padding-right: 0 !important;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    overflow: hidden;
}

.pwa-main-content--full .site-footer {
    margin-top: auto;
    flex-shrink: 0;
}

.pwa-page-full {
    flex: 1 1 auto;
    min-height: min(56vh, 480px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

:root {
    --watchman-toolbar-height: 52px;
    --watchman-page-header-height: 52px;
    --watchman-scroll-track: rgba(0, 0, 0, 0.06);
    --watchman-scroll-thumb: rgba(32, 196, 244, 0.45);
    --watchman-scroll-thumb-hover: rgba(32, 196, 244, 0.75);
    --watchman-page-height: calc(
        100dvh - var(--pwa-topbar-height) - var(--pwa-safe-top)
        - var(--pwa-bottom-nav-height) - var(--pwa-safe-bottom)
        - var(--watchman-page-header-height) - 8px
    );
    --watchman-grid-height: calc(var(--watchman-page-height) - var(--watchman-toolbar-height));
}

@media (min-width: 960px) {
    :root {
        --watchman-page-height: calc(
            100dvh - var(--pwa-topbar-height) - var(--pwa-safe-top) - 16px
        );
    }
}

body.dark-mode {
    --watchman-scroll-track: rgba(255, 255, 255, 0.08);
    --watchman-scroll-thumb: rgba(32, 196, 244, 0.5);
    --watchman-scroll-thumb-hover: rgba(32, 196, 244, 0.85);
}

/* اسکرول‌بارهای نازک و لمسی (وب + موبایل) */
.pwa-scrollbar,
.pwa-scrollbar .mud-table-container {
    scrollbar-width: thin;
    scrollbar-color: var(--watchman-scroll-thumb) var(--watchman-scroll-track);
}

.pwa-scrollbar::-webkit-scrollbar,
.pwa-scrollbar .mud-table-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.pwa-scrollbar::-webkit-scrollbar-track,
.pwa-scrollbar .mud-table-container::-webkit-scrollbar-track {
    background: var(--watchman-scroll-track);
    border-radius: 10px;
    margin: 2px;
}

.pwa-scrollbar::-webkit-scrollbar-thumb,
.pwa-scrollbar .mud-table-container::-webkit-scrollbar-thumb {
    background: var(--watchman-scroll-thumb);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.pwa-scrollbar::-webkit-scrollbar-thumb:hover,
.pwa-scrollbar .mud-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--watchman-scroll-thumb-hover);
    background-clip: padding-box;
}

.pwa-scrollbar::-webkit-scrollbar-corner,
.pwa-scrollbar .mud-table-container::-webkit-scrollbar-corner {
    background: var(--watchman-scroll-track);
}

@media (max-width: 768px) {
    .pwa-scrollbar::-webkit-scrollbar,
    .pwa-scrollbar .mud-table-container::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
}

.watchman-page {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: var(--watchman-page-height);
    max-height: var(--watchman-page-height);
    min-height: 0;
    overflow: hidden;
}

.watchman-toolbar {
    flex: 0 0 auto;
    min-height: var(--watchman-toolbar-height);
}

/* ——— صفحه فیلترها ——— */
.filter-page__body {
    display: flex;
    flex-direction: row;
    flex: 1 1 auto;
    min-height: 0;
    gap: 12px;
    padding: 0 4px 4px;
}

.filter-page__nav {
    flex: 0 0 200px;
    min-width: 180px;
    max-width: 220px;
    align-self: stretch;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    background: var(--mud-palette-surface);
}

body.dark-mode .filter-page__nav {
    border-color: rgba(255, 255, 255, 0.1);
}

.filter-page__nav-group-title {
    display: block;
    font-weight: 700 !important;
    color: var(--mud-palette-text-secondary) !important;
    margin: 6px 4px 4px !important;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.filter-page__nav-btn {
    justify-content: center !important;
    width: 100%;
    font-weight: 600;
}

.filter-page__nav-btn--active.mud-button-root {
    background-color: var(--mud-palette-primary) !important;
    color: var(--mud-palette-primary-text, #fff) !important;
    border-color: var(--mud-palette-primary) !important;
}

.filter-page__main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.filter-page__active-label {
    font-weight: 700 !important;
    color: var(--mud-palette-primary) !important;
    flex: 0 0 auto;
}

.filter-page__main .watchman-grid-scroll {
    flex: 1 1 auto;
    min-height: 0;
}

@media (max-width: 900px) {
    .filter-page__body {
        flex-direction: column;
    }

    .filter-page__nav {
        flex: 0 0 auto;
        max-width: none;
        width: 100%;
        max-height: 200px;
    }

    .filter-page__nav-group {
        flex-direction: row !important;
        flex-wrap: wrap;
    }

    .filter-page__nav-btn {
        width: auto;
        min-width: 4.5rem;
    }
}

/* تب‌های بازار — دیده‌بان، سیگنال، بررسی خرید، اندیکاتور */
.market-tabs {
    display: inline-flex;
    padding: 1px;
    overflow: visible;
}

.market-tabs__group.mud-button-group-root {
    border: 1px solid rgba(15, 23, 42, 0.42);
    border-radius: 999px;
    overflow: hidden;
    background: var(--mud-palette-surface);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

body.dark-mode .market-tabs__group.mud-button-group-root {
    border-color: rgba(226, 232, 240, 0.34);
    background: var(--mud-palette-surface);
}

.market-tabs__group .market-tabs__btn.mud-button-root {
    min-width: 4.5rem;
    font-weight: 600;
    border: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.market-tabs__group .market-tabs__btn.mud-button-root + .market-tabs__btn.mud-button-root {
    border-inline-start: 1px solid rgba(15, 23, 42, 0.42) !important;
}

body.dark-mode .market-tabs__group .market-tabs__btn.mud-button-root + .market-tabs__btn.mud-button-root {
    border-inline-start-color: rgba(226, 232, 240, 0.34) !important;
}

.market-tabs__group .market-tabs__btn--active.mud-button-root {
    background-color: var(--mud-palette-primary) !important;
    color: var(--mud-palette-primary-text, #fff) !important;
    border-color: var(--mud-palette-primary) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18) !important;
    z-index: 1;
}

body.dark-mode .market-tabs__group .market-tabs__btn--active.mud-button-root {
    box-shadow: 0 2px 8px rgba(66, 165, 245, 0.4);
}

.market-tabs__group .market-tabs__btn:not(.market-tabs__btn--active).mud-button-root {
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
}

.market-tabs__group .market-tabs__btn:not(.market-tabs__btn--active).mud-button-root:hover {
    background-color: rgba(25, 118, 210, 0.08);
    border-color: rgba(25, 118, 210, 0.35);
}

.watchman-market-tabs .mud-button {
    min-width: 4.25rem;
    font-weight: 600;
}

/* یک ناحیه اسکرول: هدر و بدنه هم‌تراز، اسکرول افقی و عمودی با هم */
.watchman-grid-scroll {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    height: var(--watchman-grid-height);
    max-height: var(--watchman-grid-height);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    background: var(--mud-palette-surface);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    position: relative;
    touch-action: pan-y pinch-zoom;
    cursor: grab;
}

.watchman-grid-scroll.watchman-dragging {
    cursor: grabbing;
    user-select: none;
    touch-action: none;
}

.watchman-grid-inner {
    display: inline-block;
    width: max-content;
    min-width: 100%;
    vertical-align: top;
}

.watchman-grid-scroll::after {
    content: "";
    pointer-events: none;
    position: sticky;
    left: 0;
    bottom: 0;
    float: left;
    width: 28px;
    height: 100%;
    margin-left: -28px;
    background: linear-gradient(to left, transparent, rgba(32, 196, 244, 0.12));
    z-index: 4;
}

body.dark-mode .watchman-grid-scroll::after {
    background: linear-gradient(to left, transparent, rgba(32, 196, 244, 0.18));
}

.watchman-scroll-hint {
    flex: 0 0 auto;
}

.watchman-list-loading {
    padding: 4px 8px;
    width: 100%;
    min-width: 100%;
}

.watchman-list-sentinel {
    height: 1px;
    width: 100%;
    min-width: 100%;
    pointer-events: none;
}

body.dark-mode .watchman-grid-scroll {
    border-color: rgba(255, 255, 255, 0.1);
}

.watchman-grid-scroll .watchman-grid.mud-table-root,
.watchman-grid-scroll .watchman-grid.mud-data-grid,
.watchman-grid-scroll .watchman-grid.mud-data-grid-root,
.watchman-grid-scroll .watchman-grid-inner .mud-table-root,
.watchman-grid-scroll .watchman-grid-inner .mud-data-grid {
    width: max-content !important;
    min-width: 100%;
    max-width: none !important;
    overflow: visible !important;
}

.watchman-grid-scroll .watchman-grid .mud-table-container,
.watchman-grid-scroll .watchman-grid-inner .mud-table-container,
.watchman-grid-scroll .watchman-grid .mud-table-wrapper,
.watchman-grid-scroll .watchman-grid-inner .mud-table-wrapper {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    width: max-content !important;
    min-width: 100%;
    max-width: none !important;
}

.watchman-grid-scroll .watchman-grid table,
.watchman-grid-scroll .watchman-grid-inner table.mud-table {
    width: max-content !important;
    min-width: 2200px !important;
    table-layout: auto !important;
    border-collapse: collapse;
    display: table !important;
}

.watchman-grid-scroll .watchman-grid .mud-table-head .mud-table-cell,
.watchman-grid-scroll .watchman-grid .mud-table-body .mud-table-cell,
.watchman-grid-scroll .watchman-grid .mud-table-row .mud-table-cell,
.watchman-grid-scroll .watchman-grid-inner .mud-table-head .mud-table-cell,
.watchman-grid-scroll .watchman-grid-inner .mud-table-body .mud-table-cell {
    min-width: 5.75rem;
    box-sizing: border-box;
    vertical-align: middle;
    white-space: nowrap;
}

.watchman-grid .wm-col-sticky,
.watchman-grid .mud-table-head .wm-col-sticky,
.watchman-grid .mud-table-body .wm-col-sticky {
    position: sticky;
    right: 0;
    z-index: 5;
    background-color: var(--mud-palette-surface) !important;
    box-shadow: -3px 0 6px rgba(0, 0, 0, 0.08);
    min-width: 4.5rem;
}

.watchman-grid.mud-table-sticky-header .mud-table-head .wm-col-sticky {
    z-index: 6;
}

body.dark-mode .watchman-grid .wm-col-sticky {
    box-shadow: -3px 0 6px rgba(0, 0, 0, 0.35);
}

.watchman-grid-scroll .watchman-grid .mud-table-head .mud-table-cell {
    min-width: 5.5rem;
}

.watchman-grid.mud-table-sticky-header .mud-table-head .mud-table-cell {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: var(--mud-palette-surface) !important;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.watchman-grid-scroll .mud-table-pagination,
.watchman-grid-scroll .mud-data-grid-toolbar {
    display: none;
}

.watchman-grid .mud-table-cell {
    white-space: nowrap;
    font-size: 0.8rem;
    vertical-align: middle;
    text-align: center !important;
}

.watchman-grid .mud-table-head .mud-table-cell,
.watchman-grid .mud-table-foot .mud-table-cell {
    text-align: center !important;
}

.watchman-grid .wm-num {
    display: inline-block;
    direction: ltr;
    unicode-bidi: isolate;
    text-align: center;
    font-variant-numeric: tabular-nums;
    width: auto;
    max-width: 100%;
    line-height: 1.35;
}

.watchman-grid .wm-ticker,
.watchman-grid .wm-links,
.watchman-grid .wm-name {
    display: inline-block;
    width: 100%;
    text-align: center;
}

.watchman-grid .wm-up {
    color: #2e7d32;
    font-weight: 600;
}

.watchman-grid .wm-down {
    color: #c62828;
    font-weight: 600;
}

.watchman-grid .wm-flat {
    color: inherit;
}

.watchman-grid .wm-link {
    color: #1565c0;
    text-decoration: none;
    font-size: 0.75rem;
}

.watchman-grid .mud-table-head .mud-table-cell {
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

.watchman-grid .mud-table-head .mud-table-cell:hover {
    background: rgba(32, 196, 244, 0.08);
}

.watchman-search {
    max-width: 280px;
    min-width: 160px;
}

.watchman-grid .wm-name {
    max-width: 140px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ——— صفحه اول: قیمت‌های بازار (PricesInfo + BourseInfo) ——— */
.index-price-board__heading {
    font-weight: 700 !important;
    color: var(--mud-palette-text-secondary);
}

.index-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
}

.index-chart-header {
    width: 100%;
}

.index-chart-header .index-section-header {
    margin-bottom: 0 !important;
}

.index-section-header__title {
    font-weight: 700 !important;
    color: var(--mud-palette-text-secondary);
}

.index-section-updated {
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.index-prices-panel,
.index-bourse-panel {
    border-radius: 12px !important;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark-mode .index-prices-panel,
body.dark-mode .index-bourse-panel {
    border-color: rgba(255, 255, 255, 0.1);
}

.index-prices-scroll {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding-bottom: 4px;
}

.index-price-card {
    flex: 0 0 auto;
    min-width: 7.5rem;
    max-width: 10rem;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(32, 196, 244, 0.04) !important;
}

body.dark-mode .index-price-card {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(32, 196, 244, 0.08) !important;
}

.index-price-card__title {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.index-price-card__price {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

.index-price-card__change {
    display: block;
    font-size: 0.75rem;
    line-height: 1.35;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.index-bourse-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 4.5rem;
    padding: 10px 8px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: var(--mud-palette-surface);
    text-align: center;
}

body.dark-mode .index-bourse-cell {
    border-color: rgba(255, 255, 255, 0.08);
}

.index-bourse-cell__label {
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary);
    line-height: 1.35;
}

.index-bourse-cell__value {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
    color: var(--mud-palette-text-primary);
}

.index-bourse-cell__change {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
    unicode-bidi: plaintext;
}

.index-trend--up {
    color: var(--mareq-up, #2e7d32);
}

.index-trend--down {
    color: var(--mareq-down, #c62828);
}

.index-trend--flat {
    color: inherit;
}

/* ——— تابلو مارکی (Mareq) ——— */
:root {
    --mareq-up: #2e7d32;
    --mareq-down: #c62828;
}

.mareq-marquee {
    width: 100%;
    overflow: hidden;
    margin: 6px 0;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    /* انیمیشن translateX(-50%) فقط با جهت LTR درست حلقه می‌زند */
    direction: ltr;
}

body.dark-mode .mareq-marquee {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.mareq-track {
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    animation: mareq-scroll var(--mareq-duration, 180s) linear infinite;
    will-change: transform;
}

.mareq-track--reverse {
    animation-direction: reverse;
}

.mareq-strip {
    display: flex;
    flex-shrink: 0;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    padding: 0;
    margin: 0;
}

.mareq-card {
    direction: rtl;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex-shrink: 0;
    margin: 6px 4px;
    padding: 8px 12px;
    min-width: 118px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.mareq-card--link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.mareq-card--link:hover,
.mareq-card--link:focus-visible {
    border-color: rgba(32, 196, 244, 0.55);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
    outline: none;
}

body.dark-mode .mareq-card {
    background: var(--mud-palette-surface);
    border-color: rgba(255, 255, 255, 0.12);
}

.mareq-ticker {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--pwa-secondary);
    margin-bottom: 2px;
}

.mareq-price-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    width: 100%;
    font-size: 0.72rem;
}

.mareq-label {
    color: var(--mud-palette-text-secondary);
    font-size: 0.65rem;
    white-space: nowrap;
}

.mareq-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    unicode-bidi: isolate;
    direction: ltr;
    text-align: left;
}

.mareq-value.mareq-up { color: var(--mareq-up); }
.mareq-value.mareq-down { color: var(--mareq-down); }
.mareq-value.mareq-flat { color: inherit; }

@keyframes mareq-scroll {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(-50%, 0, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mareq-track {
        animation: none;
        flex-wrap: wrap;
        width: 100%;
    }
    .mareq-strip[aria-hidden="true"] {
        display: none;
    }
}

.pwa-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    height: calc(var(--pwa-bottom-nav-height) + var(--pwa-safe-bottom));
    padding-bottom: var(--pwa-safe-bottom);
    background: var(--mud-palette-surface);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

body.dark-mode .pwa-bottom-nav {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.pwa-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none !important;
    color: var(--mud-palette-text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 4px;
    font-family: inherit;
    transition: color 0.2s, background 0.2s;
    min-width: 0;
}

.pwa-bottom-nav__item.active {
    color: var(--pwa-primary);
}

.pwa-bottom-nav__item.active .mud-icon-root {
    color: var(--pwa-primary) !important;
}

.pwa-bottom-nav__label {
    font-size: 0.6rem;
    line-height: 1.2;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-bottom-nav__icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pwa-bottom-nav__tier {
    position: absolute;
    top: -4px;
    inset-inline-end: -7px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 999px;
    background: #f59e0b;
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
}

.pwa-bottom-nav__tier--locked {
    background: #94a3b8;
}

.pwa-bottom-nav__item--locked {
    opacity: 0.82;
}

.user-panel {
    max-width: 520px;
    margin-inline: auto;
}

/* ——— صفحه محدودیت دسترسی ——— */
.access-gate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(72vh, calc(100dvh - var(--pwa-topbar-height) - var(--pwa-bottom-nav-height) - 120px));
    padding: 24px 16px;
    box-sizing: border-box;
}

.access-gate__card {
    width: min(100%, 440px);
    padding: 28px 24px;
    border-radius: 16px;
    background: var(--mud-palette-surface);
    border: 1px solid rgba(3, 23, 61, 0.08);
    box-shadow: 0 8px 32px rgba(3, 23, 61, 0.08);
    text-align: center;
}

body.dark-mode .access-gate__card {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.access-gate__icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: rgba(32, 196, 244, 0.12);
}

.access-gate__title {
    font-weight: 700 !important;
    margin-bottom: 8px !important;
}

.access-gate__message {
    color: var(--mud-palette-text-secondary);
    line-height: 1.8;
    margin-bottom: 8px !important;
}

.access-gate__subtitle {
    display: block;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 20px !important;
    line-height: 1.7;
}

.access-gate__actions {
    margin-top: 8px;
}

/* ——— صفحه / بلوک خطا ——— */
.app-error-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(72vh, calc(100dvh - var(--pwa-topbar-height) - var(--pwa-bottom-nav-height) - 120px));
    padding: 24px 16px;
    box-sizing: border-box;
}

.app-error-state--compact {
    min-height: auto;
    padding: 12px 0;
}

.app-error-state__card {
    width: min(100%, 440px);
    padding: 28px 24px;
    border-radius: 16px;
    background: var(--mud-palette-surface);
    border: 1px solid rgba(3, 23, 61, 0.08);
    box-shadow: 0 8px 32px rgba(3, 23, 61, 0.08);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.app-error-state--compact .app-error-state__card {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
}

body.dark-mode .app-error-state__card {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.app-error-state__card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, #ef4444, #f97316);
}

.app-error-state--warning .app-error-state__card::before {
    background: linear-gradient(90deg, #f59e0b, #eab308);
}

.app-error-state--info .app-error-state__card::before {
    background: linear-gradient(90deg, #20c4f4, #6366f1);
}

.app-error-state--not-found .app-error-state__card::before {
    background: linear-gradient(90deg, #64748b, #94a3b8);
}

.app-error-state__icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
}

.app-error-state--warning .app-error-state__icon-wrap {
    background: rgba(245, 158, 11, 0.14);
}

.app-error-state--info .app-error-state__icon-wrap {
    background: rgba(32, 196, 244, 0.12);
}

.app-error-state--not-found .app-error-state__icon-wrap {
    background: rgba(100, 116, 139, 0.14);
}

.app-error-state--compact .app-error-state__icon-wrap {
    width: 52px;
    height: 52px;
    margin-bottom: 8px;
}

.app-error-state__title {
    font-weight: 700 !important;
    margin-bottom: 8px !important;
}

.app-error-state__message {
    color: var(--mud-palette-text-secondary);
    line-height: 1.8;
    margin-bottom: 8px !important;
}

.app-error-state__subtitle {
    display: block;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 16px !important;
    line-height: 1.7;
}

.app-error-state__detail {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(3, 23, 61, 0.05);
    font-size: 11px;
    line-height: 1.5;
    text-align: start;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 160px;
    overflow: auto;
}

body.dark-mode .app-error-state__detail {
    background: rgba(255, 255, 255, 0.06);
}

.app-error-state__actions {
    margin-top: 12px;
}

.pwa-nav-section-hint {
    display: block;
    color: var(--mud-palette-text-secondary);
    line-height: 1.6;
    opacity: 0.9;
}

.pwa-nav-tier {
    display: inline-flex;
    align-items: center;
    margin-inline-start: 0.45rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.3;
    vertical-align: middle;
}

.pwa-nav-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 2px 6px 8px;
    padding: 8px 10px;
    border-radius: var(--nj-radius-md);
    border: 1px solid var(--nj-glass-border-subtle);
    background: rgba(32, 196, 244, 0.06);
}

body.dark-mode .pwa-nav-user {
    background: rgba(32, 196, 244, 0.08);
}

.pwa-nav-user__name {
    margin: 0 !important;
    font-weight: 700 !important;
    color: var(--mud-palette-text-primary) !important;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pwa-nav-tier--free {
    background: rgba(32, 196, 244, 0.15);
    color: #067a9b;
}

.pwa-nav-tier--paid {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
}

.pwa-nav-tier--locked {
    background: rgba(148, 163, 184, 0.25);
    color: #64748b;
}

.pwa-nav-tier--hidden {
    display: none;
}

.pwa-nav-tier--vip {
    background: rgba(22, 163, 74, 0.16);
    color: #166534;
}

body.dark-mode .pwa-nav-tier--vip {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
}

.pwa-nav-link--tier-locked .mud-nav-link-text {
    opacity: 0.88;
}

.pwa-nav-overline {
    letter-spacing: 0.02em;
}

/* منوی موبایل باید بالاتر از نوار پایین باشد تا با لمس بیرون بسته شود */
.mud-overlay-drawer {
    z-index: 1300 !important;
}

.pwa-drawer.mud-drawer-open {
    z-index: 1400 !important;
}

.pwa-drawer-header__row {
    display: flex;
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.pwa-drawer-header,
.pwa-sidebar .mud-drawer-header {
    background: linear-gradient(135deg, var(--pwa-secondary), #0a3d6b);
    color: #fff;
    flex-direction: column;
    align-items: stretch;
}

/* ——— سایدبار دسکتاپ (جمع‌شونده) ——— */
:root {
    --pwa-sidebar-width: 328px;
    --pwa-sidebar-mini-width: 80px;
}

.pwa-sidebar.mud-drawer-mini {
    transition: width 0.22s ease, min-width 0.22s ease;
}

.pwa-sidebar--expanded.mud-drawer-mini.mud-drawer-open {
    width: var(--pwa-sidebar-width) !important;
}

.pwa-sidebar--expanded .mud-nav-link {
    min-height: 46px;
    padding-inline: 14px !important;
}

.pwa-sidebar--expanded .mud-nav-link-text {
    font-size: 0.94rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: 100%;
}

.pwa-sidebar--expanded .mud-nav-link,
.pwa-sidebar--expanded .mud-nav-link-content {
    min-width: 0;
}

.pwa-sidebar--collapsed.mud-drawer-mini:not(.mud-drawer-open),
.pwa-sidebar--collapsed.mud-drawer-mini.mud-drawer-closed {
    width: var(--pwa-sidebar-mini-width) !important;
}

.pwa-sidebar-header__inner {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.pwa-sidebar--collapsed .pwa-sidebar-header__inner {
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.pwa-sidebar-toggle {
    flex-shrink: 0;
}

.pwa-brand-link--mini {
    justify-content: center;
}

.pwa-brand-link--mini .pwa-logo {
    width: 32px;
    height: 32px;
}

.pwa-nav-menu--collapsed .pwa-nav-overline {
    display: none;
}

.pwa-nav-menu--collapsed .pwa-nav-divider--mini {
    margin-inline: 8px;
    opacity: 0.35;
}

.pwa-nav-menu--collapsed .mud-nav-link {
    justify-content: center;
    padding-inline: 8px !important;
    min-height: 44px;
}

.pwa-nav-menu--collapsed .mud-nav-link-text,
.pwa-nav-menu--collapsed .mud-nav-link .mud-nav-link-text {
    display: none !important;
}

.pwa-nav-menu--collapsed .mud-nav-link .mud-icon-root {
    margin-inline: 0 !important;
}

.pwa-nav-link--icon-only .mud-nav-link-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.pwa-drawer-header .mud-typography,
.pwa-sidebar .mud-drawer-header .mud-typography {
    color: #fff;
}

.pwa-install-banner {
    position: fixed;
    bottom: calc(var(--pwa-bottom-nav-height) + var(--pwa-safe-bottom) + 8px);
    left: 12px;
    right: 12px;
    z-index: 1300;
    border-radius: 12px !important;
    max-width: 480px;
    margin: 0 auto;
}

@media (min-width: 960px) {
    .pwa-install-banner {
        bottom: 16px;
        left: auto;
        right: 16px;
        max-width: 360px;
    }
}

@media (display-mode: standalone) {
    .pwa-topbar {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
}

.pwa-drawer .mud-nav-link.active,
.pwa-sidebar .mud-nav-link.active {
    background: rgba(32, 196, 244, 0.12);
    border-radius: 8px;
}

/* ——— عمق بازار (Order Book) ——— */
:root {
    --ob-buy: #2e7d32;
    --ob-buy-bg: rgba(46, 125, 50, 0.08);
    --ob-sell: #c62828;
    --ob-sell-bg: rgba(198, 40, 40, 0.08);
}

:root {
    --ob-list-header-height: 120px;
    --ob-list-page-height: calc(
        100dvh - var(--pwa-topbar-height) - var(--pwa-safe-top)
        - var(--pwa-bottom-nav-height) - var(--pwa-safe-bottom)
        - var(--ob-list-header-height) - 8px
    );
}

@media (min-width: 960px) {
    :root {
        --ob-list-page-height: calc(
            100dvh - var(--pwa-topbar-height) - var(--pwa-safe-top) - 24px
        );
    }
}

.ob-page {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: var(--ob-list-page-height);
    max-height: var(--ob-list-page-height);
    overflow: hidden;
}

.ob-quick-search {
    min-width: min(100%, 280px);
    max-width: 480px;
}

.ob-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
}

.ob-list-scroll .ob-list-table.mud-table-root {
    width: max-content !important;
    min-width: 100%;
    overflow: visible !important;
}

.ob-list-scroll .ob-list-table .mud-table-container {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

.ob-list-scroll .ob-list-table table {
    width: max-content !important;
    min-width: 100%;
    table-layout: auto !important;
    border-collapse: collapse;
}

.ob-list-scroll .ob-list-table .mud-table-head .mud-table-cell,
.ob-list-scroll .ob-list-table .mud-table-body .mud-table-cell {
    min-width: 5.5rem;
    box-sizing: border-box;
    white-space: nowrap;
}

.ob-list-scroll .ob-list-table .mud-table-head .mud-table-cell.ob-th-sticky {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--mud-palette-surface);
}

.ob-list-scroll .ob-list-table .mud-table-head .mud-table-cell.ob-th--buy.ob-th-sticky {
    background: var(--ob-buy-bg) !important;
}

.ob-list-scroll .ob-list-table .mud-table-head .mud-table-cell.ob-th--sell.ob-th-sticky {
    background: var(--ob-sell-bg) !important;
}

.ob-name {
    display: inline-block;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.ob-list-loading {
    padding: 4px 0;
}

.ob-list-sentinel {
    height: 1px;
    width: 100%;
    pointer-events: none;
}

.ob-page__title {
    font-weight: 700 !important;
}

.ob-summary-card {
    padding: 10px 12px !important;
    border-radius: 10px !important;
    text-align: center;
}

.ob-summary-card--buy {
    border: 1px solid rgba(46, 125, 50, 0.35);
    background: var(--ob-buy-bg) !important;
}

.ob-summary-card--sell {
    border: 1px solid rgba(198, 40, 40, 0.35);
    background: var(--ob-sell-bg) !important;
}

.ob-summary-card__label {
    color: var(--mud-palette-text-secondary);
    margin-bottom: 4px;
}

.ob-summary-card--buy .ob-summary-card__value {
    color: var(--ob-buy);
    font-weight: 700;
}

.ob-summary-card--sell .ob-summary-card__value {
    color: var(--ob-sell);
    font-weight: 700;
}

.ob-depth-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ob-depth-native-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    table-layout: auto;
}

.ob-depth-native-table th,
.ob-depth-native-table td {
    text-align: center;
    vertical-align: middle;
    padding: 8px 10px;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    white-space: nowrap;
}

body.dark-mode .ob-depth-native-table th,
body.dark-mode .ob-depth-native-table td {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.ob-depth-native-table thead th {
    font-weight: 700;
    font-size: 0.75rem;
}

.ob-summary-row__level {
    min-width: 3rem;
}

.ob-summary-group {
    padding: 6px 8px !important;
    vertical-align: middle;
}

.ob-summary-pair {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ob-summary-mini {
    flex: 1 1 7rem;
    min-width: 7rem;
    max-width: 12rem;
    padding: 6px 10px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ob-summary-mini .ob-summary-card__label {
    font-size: 0.68rem;
    margin-bottom: 0;
    line-height: 1.3;
}

.ob-summary-mini .ob-summary-card__value {
    font-size: 0.9rem;
    line-height: 1.35;
}

.ob-depth-panel {
    border-radius: 12px !important;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body.dark-mode .ob-depth-panel {
    border-color: rgba(255, 255, 255, 0.1);
}

.ob-depth-panel__title {
    font-weight: 700 !important;
}

.ob-depth-table .mud-table-head .mud-table-cell,
.ob-list-table .mud-table-head .mud-table-cell {
    text-align: center !important;
    font-weight: 700;
    font-size: 0.75rem;
}

.ob-depth-table .mud-table-row .mud-table-cell,
.ob-list-table .mud-table-row .mud-table-cell {
    text-align: center !important;
    vertical-align: middle;
    font-size: 0.82rem;
}

.ob-th--buy {
    color: var(--ob-buy) !important;
    background: var(--ob-buy-bg) !important;
}

.ob-th--sell {
    color: var(--ob-sell) !important;
    background: var(--ob-sell-bg) !important;
}

.ob-td--buy {
    background: var(--ob-buy-bg);
    color: var(--ob-buy);
    font-weight: 600;
}

.ob-td--sell {
    background: var(--ob-sell-bg);
    color: var(--ob-sell);
    font-weight: 600;
}

.ob-td--level {
    font-weight: 700;
    background: rgba(0, 0, 0, 0.03);
}

body.dark-mode .ob-td--level {
    background: rgba(255, 255, 255, 0.04);
}

.ob-num {
    display: inline-block;
    direction: ltr;
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
}

.ob-ticker-link {
    font-weight: 700;
}

.ob-history-table .mud-table-cell {
    text-align: center !important;
}

/* ——— فوتر (legacy MVC footer-1) ——— */
.site-footer {
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(180deg, rgba(3, 23, 61, 0.03) 0%, rgba(32, 196, 244, 0.06) 100%);
}

body.dark-mode .site-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(3, 23, 61, 0.35) 0%, rgba(70, 70, 81, 0.95) 100%);
}

.site-footer__main {
    padding: 28px 0 20px;
}

.site-footer__grid.mud-grid {
    width: 100%;
    margin: 0;
}

.site-footer__grid > .site-footer__col.mud-grid-item {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.site-footer__col--brand {
    padding-inline-end: 12px;
}

.site-footer__col--links {
    padding-inline: 12px;
}

.site-footer__col--contact {
    padding-inline-start: 12px;
}

@media (min-width: 960px) {
    .site-footer__col--brand {
        padding-inline-end: 20px;
    }

    .site-footer__col--links {
        padding-inline: 20px;
    }

    .site-footer__col--contact {
        padding-inline-start: 20px;
    }
}

.site-footer__brand {
    max-width: 100%;
}

.site-footer__logo-link {
    display: inline-block;
}

.site-footer__logo {
    max-width: 120px;
    height: auto;
    object-fit: contain;
}

.site-footer__about {
    line-height: 1.85 !important;
    color: var(--mud-palette-text-secondary);
    text-align: justify;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

.site-footer__inline-link {
    color: var(--mud-palette-primary) !important;
}

.site-footer__heading {
    font-weight: 700 !important;
    margin-bottom: 12px !important;
    color: var(--mud-palette-secondary);
}

body.dark-mode .site-footer__heading {
    color: var(--mud-palette-primary);
}

.site-footer__links {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.site-footer__links li + li {
    margin-top: 8px;
}

.site-footer__links a {
    text-decoration: none;
    color: var(--mud-palette-text-primary);
    font-size: 0.9rem;
}

.site-footer__links a:hover {
    color: var(--mud-palette-primary);
    text-decoration: underline;
}

.site-footer__enamad {
    display: inline-block;
    margin-top: 4px;
}

.site-footer__enamad img {
    display: block;
    border-radius: 8px;
}

.site-footer__contact-line {
    line-height: 1.9 !important;
    color: var(--mud-palette-text-secondary);
}

.site-footer__phone {
    display: inline-block;
    direction: ltr;
    font-weight: 700;
    margin-right: 6px;
    color: var(--mud-palette-primary) !important;
}

.site-footer__bottom {
    padding: 12px 0 calc(12px + var(--pwa-safe-bottom));
    background: rgba(3, 23, 61, 0.92);
    text-align: center;
}

body.dark-mode .site-footer__bottom {
    background: rgba(0, 0, 0, 0.35);
}

.site-footer__copyright {
    margin: 0 !important;
    color: rgba(255, 255, 255, 0.88) !important;
}

.site-footer__copyright-link {
    color: rgba(255, 255, 255, 0.92) !important;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
}

.site-footer__copyright-link:hover {
    background: rgba(32, 196, 244, 0.25);
}

.site-footer__social {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.site-footer__social-title {
    font-weight: 600 !important;
}

.site-footer__social-btn {
    background: rgba(32, 196, 244, 0.12) !important;
}

/* ——— صفحات پشتیبانی (درباره، تماس، نظر، قوانین) ——— */
.support-page {
    max-width: 1100px;
    margin: 0 auto;
}

.support-page__hero {
    position: relative;
    padding: 20px 20px 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(3, 23, 61, 0.92) 0%, rgba(32, 196, 244, 0.35) 100%);
    color: #fff;
    overflow: hidden;
}

.support-page__hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.08), transparent 45%);
    pointer-events: none;
}

.support-page__hero-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding-left: 72px;
}

.support-page__hero-icon-wrap {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
}

.support-page__hero-icon {
    font-size: 1.75rem !important;
    color: #fff !important;
}

.support-page__title {
    font-weight: 700 !important;
    color: #fff !important;
}

.support-page__subtitle {
    color: rgba(255, 255, 255, 0.88) !important;
    line-height: 1.7 !important;
}

.support-page__back {
    position: absolute !important;
    top: 12px;
    left: 12px;
    color: rgba(255, 255, 255, 0.92) !important;
}

.support-page__back .mud-icon-root {
    color: inherit !important;
}

.support-page__body {
    margin-bottom: 16px;
}

.support-page__section {
    border-radius: 12px;
    background: var(--mud-palette-surface);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark-mode .support-page__section {
    border-color: rgba(255, 255, 255, 0.08);
}

.support-page__section-title {
    font-weight: 700 !important;
    color: var(--mud-palette-primary);
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(32, 196, 244, 0.35);
}

.support-page__prose {
    line-height: 1.9 !important;
    text-align: justify;
}

.support-page__list {
    margin: 0;
    padding: 0 1.25rem 0 0;
    line-height: 1.9;
}

.support-page__list li + li {
    margin-top: 6px;
}

.support-page__list--compact {
    font-size: 0.9rem;
}

.support-page__card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.support-page__card-grid--contact {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.support-page__card,
.support-page__contact-card {
    padding: 16px;
    border-radius: 10px;
    background: rgba(32, 196, 244, 0.06);
    border: 1px solid rgba(32, 196, 244, 0.15);
    height: 100%;
}

body.dark-mode .support-page__card,
body.dark-mode .support-page__contact-card {
    background: rgba(32, 196, 244, 0.08);
    border-color: rgba(32, 196, 244, 0.2);
}

.support-page__card-icon {
    font-size: 1.75rem !important;
    margin-bottom: 8px;
}

.support-page__stat-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.support-page__stat {
    text-align: center;
    padding: 12px 8px;
    border-radius: 10px;
    background: rgba(3, 23, 61, 0.04);
}

body.dark-mode .support-page__stat {
    background: rgba(255, 255, 255, 0.05);
}

.support-page__stat-value {
    font-weight: 700 !important;
    color: var(--mud-palette-primary) !important;
}

.support-page__cta {
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(32, 196, 244, 0.12) 0%, rgba(3, 23, 61, 0.04) 100%);
    border: 1px solid rgba(32, 196, 244, 0.25);
}

.support-page__phone-link {
    font-size: 1.15rem;
    font-weight: 700;
    direction: ltr;
    display: inline-block;
    color: var(--mud-palette-primary) !important;
}

.support-page__related {
    border-radius: 12px;
    background: var(--mud-palette-surface);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.support-page__related-title {
    font-weight: 700 !important;
}

.support-page__related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.support-page__faq .mud-expand-panel,
.support-page__rules .mud-expand-panel {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark-mode .support-page__faq .mud-expand-panel,
body.dark-mode .support-page__rules .mud-expand-panel {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.support-page__form {
    border-radius: 12px;
    background: var(--mud-palette-surface);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.support-page__chips {
    gap: 8px;
}

@media (max-width: 599px) {
    .support-page__hero-inner {
        padding-left: 0;
        flex-direction: column;
        align-items: flex-start;
        padding-top: 36px;
    }

    .support-page__card-grid {
        grid-template-columns: 1fr;
    }
}

.page-back-btn {
    min-width: auto !important;
    padding: 4px 8px !important;
    font-weight: 600;
    color: var(--mud-palette-primary) !important;
}

.page-back-btn .mud-icon-root {
    font-size: 1.25rem;
}

.ob-page__nav {
    flex-wrap: wrap;
    gap: 4px 8px;
}

.ob-page__nav .ob-page__title {
    flex: 1 1 auto;
    min-width: 0;
}

.watchman-back {
    align-self: center;
}

.marketmap-external-link {
    white-space: nowrap;
    align-self: center;
}

.marketmap-page {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    background: var(--mud-palette-background);
}

.marketmap-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--mud-palette-surface);
    flex-shrink: 0;
}

body.dark-mode .marketmap-toolbar {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.marketmap-toolbar__title {
    font-weight: 700 !important;
    flex: 1 1 auto;
    min-width: 0;
}

.marketmap-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-right: auto;
}

.marketmap-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    flex: 1 1 auto;
}

.marketmap-chart-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.marketmap-chart {
    flex: 1 1 auto;
    min-height: 320px;
    width: 100%;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.marketmap-chart-wrap--visible .marketmap-chart,
.marketmap-chart--visible {
    visibility: visible;
    opacity: 1;
}

.pwa-main-content--full .marketmap-page {
    height: calc(
        100dvh - var(--pwa-topbar-height) - var(--pwa-safe-top)
        - var(--pwa-bottom-nav-height) - var(--pwa-safe-bottom) - 8px
    );
}

@media (min-width: 960px) {
    .pwa-main-content--full .marketmap-page {
        height: calc(100dvh - var(--pwa-topbar-height) - var(--pwa-safe-top) - 12px);
    }
}

/* ——— پرتفوی ——— */
.portfolio-page {
    --portfolio-grid-height: min(70dvh, 720px);
    min-height: calc(100dvh - var(--pwa-topbar-height) - 120px);
}

.portfolio-search {
    max-width: 420px;
}

.portfolio-page > .mud-stack:first-child {
    padding: 14px 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.08), rgba(34, 197, 94, 0.06));
}

body.dark-mode .portfolio-page > .mud-stack:first-child {
    border-color: rgba(226, 232, 240, 0.1);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(34, 197, 94, 0.08));
}

.portfolio-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.portfolio-summary__card {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: var(--mud-palette-surface);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

body.dark-mode .portfolio-summary__card {
    border-color: rgba(226, 232, 240, 0.1);
    box-shadow: none;
}

.portfolio-summary__label {
    display: block;
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.portfolio-summary__value {
    display: block;
    font-size: 1rem;
    color: var(--mud-palette-text-primary);
}

.portfolio-grid-scroll {
    overflow: auto;
    max-height: var(--portfolio-grid-height);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    background: var(--mud-palette-surface);
}

body.dark-mode .portfolio-grid-scroll {
    border-color: rgba(255, 255, 255, 0.1);
}

.portfolio-grid-scroll .portfolio-grid,
.portfolio-grid-scroll .portfolio-grid.mud-table-root,
.portfolio-grid-scroll .portfolio-grid.mud-data-grid {
    min-width: 960px;
}

.portfolio-grid-scroll .crypto-portfolio-grid {
    min-width: 840px;
}

.portfolio-grid-scroll .mud-table-pagination,
.portfolio-grid-scroll .mud-data-grid-toolbar {
    display: none;
}

/* ——— جزئیات سهم ——— */
.stock-detail-page {
    padding-bottom: 24px;
}

.stock-detail-page .wm-up {
    color: #2e7d32;
    font-weight: 600;
}

.stock-detail-page .wm-down {
    color: #c62828;
    font-weight: 600;
}

.stock-detail-page .wm-flat {
    color: var(--mud-palette-text-secondary);
}

.stock-detail-page .stock-metric__value.wm-up,
.stock-detail-page .stock-metric__value .wm-up,
.stock-detail-page .stock-metric__value .wm-num .wm-up {
    color: #2e7d32 !important;
    font-weight: 600;
}

.stock-detail-page .stock-metric__value.wm-down,
.stock-detail-page .stock-metric__value .wm-down,
.stock-detail-page .stock-metric__value .wm-num .wm-down {
    color: #c62828 !important;
    font-weight: 600;
}

.stock-detail-hero {
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.08) 0%, rgba(32, 196, 244, 0.06) 55%, rgba(255, 255, 255, 0) 100%);
    border: 1px solid rgba(25, 118, 210, 0.12);
    border-radius: 12px;
}

body.dark-mode .stock-detail-hero {
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.14) 0%, rgba(32, 196, 244, 0.08) 55%, transparent 100%);
    border-color: rgba(66, 165, 245, 0.2);
}

.stock-detail-hero__eyebrow {
    color: var(--mud-palette-primary) !important;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.stock-detail-hero__ticker {
    font-weight: 800 !important;
    letter-spacing: 0;
}

.stock-detail-hero__name {
    color: var(--mud-palette-text-secondary);
    font-weight: 500 !important;
}

.stock-detail-updated {
    color: var(--mud-palette-text-secondary);
}

.stock-detail-actions .mud-button-root {
    min-width: 88px;
}

.stock-share-btn {
    border-style: dashed;
}

.stock-share-menu .mud-menu-item {
    min-width: 160px;
}

.stock-detail-panel {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
}

body.dark-mode .stock-detail-panel {
    border-color: rgba(255, 255, 255, 0.08);
}

.stock-detail-panel--board {
    border-top: 3px solid var(--mud-palette-primary);
}

.stock-detail-panel--chart {
    border-top: 3px solid #ff8f00;
}

.stock-detail-panel--peers {
    border-top: 3px solid #5c6bc0;
}

.stock-peers-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.stock-peers-table .stock-peer-link {
    font-weight: 600;
}

.stock-peers-table .stock-peer-name {
    max-width: 12rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.dark-mode .stock-detail-panel--peers {
    border-top-color: #9fa8da;
}

.stock-chart-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
}

.stock-chart-price__value {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.stock-chart-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 8px;
    background: rgba(3, 23, 61, 0.04);
}

.stock-chart-toolbar__slot {
    display: inline-flex;
    border-radius: 6px;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.stock-chart-toolbar__slot .stock-chart-toolbar__btn {
    border-radius: 6px !important;
    transition: color 0.15s ease, background-color 0.15s ease;
}

/* غیرفعال — آیکن کم‌رنگ و بدون پس‌زمینه */
.stock-chart-toolbar__slot--off .stock-chart-toolbar__btn,
.stock-chart-toolbar__slot--off .stock-chart-toolbar__btn .mud-icon-root {
    color: rgba(3, 23, 61, 0.38) !important;
}

.stock-chart-toolbar__slot--off:hover .stock-chart-toolbar__btn {
    background: rgba(3, 23, 61, 0.06) !important;
}

.stock-chart-toolbar__slot--off:hover .stock-chart-toolbar__btn,
.stock-chart-toolbar__slot--off:hover .stock-chart-toolbar__btn .mud-icon-root {
    color: rgba(3, 23, 61, 0.62) !important;
}

/* فعال — پس‌زمینه و حاشیهٔ آبی مشخص */
.stock-chart-toolbar__slot--active {
    background: rgba(32, 196, 244, 0.22);
    box-shadow: inset 0 0 0 2px rgba(32, 196, 244, 0.75);
}

.stock-chart-toolbar__slot--active .stock-chart-toolbar__btn,
.stock-chart-toolbar__slot--active .stock-chart-toolbar__btn .mud-icon-root {
    color: #0288d1 !important;
}

.stock-chart-toolbar__slot--active .stock-chart-toolbar__btn {
    background: transparent !important;
}

/* دکمه‌های یک‌بار مصرف (پاک‌کردن، زوم) */
.stock-chart-toolbar__slot--action .stock-chart-toolbar__btn,
.stock-chart-toolbar__slot--action .stock-chart-toolbar__btn .mud-icon-root {
    color: rgba(3, 23, 61, 0.55) !important;
}

.stock-chart-toolbar__slot--action:hover .stock-chart-toolbar__btn {
    background: rgba(3, 23, 61, 0.08) !important;
}

.stock-chart-toolbar__slot--action:hover .stock-chart-toolbar__btn,
.stock-chart-toolbar__slot--action:hover .stock-chart-toolbar__btn .mud-icon-root {
    color: rgba(3, 23, 61, 0.85) !important;
}

body.dark-mode .stock-chart-toolbar {
    background: rgba(255, 255, 255, 0.06);
}

body.dark-mode .stock-chart-toolbar__slot--off .stock-chart-toolbar__btn,
body.dark-mode .stock-chart-toolbar__slot--off .stock-chart-toolbar__btn .mud-icon-root {
    color: rgba(255, 255, 255, 0.38) !important;
}

body.dark-mode .stock-chart-toolbar__slot--off:hover .stock-chart-toolbar__btn,
body.dark-mode .stock-chart-toolbar__slot--off:hover .stock-chart-toolbar__btn .mud-icon-root {
    color: rgba(255, 255, 255, 0.68) !important;
}

body.dark-mode .stock-chart-toolbar__slot--off:hover .stock-chart-toolbar__btn {
    background: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .stock-chart-toolbar__slot--active {
    background: rgba(32, 196, 244, 0.28);
    box-shadow: inset 0 0 0 2px rgba(32, 196, 244, 0.85);
}

body.dark-mode .stock-chart-toolbar__slot--active .stock-chart-toolbar__btn,
body.dark-mode .stock-chart-toolbar__slot--active .stock-chart-toolbar__btn .mud-icon-root {
    color: #4dd0e1 !important;
}

body.dark-mode .stock-chart-toolbar__slot--action .stock-chart-toolbar__btn,
body.dark-mode .stock-chart-toolbar__slot--action .stock-chart-toolbar__btn .mud-icon-root {
    color: rgba(255, 255, 255, 0.5) !important;
}

body.dark-mode .stock-chart-toolbar__slot--action:hover .stock-chart-toolbar__btn,
body.dark-mode .stock-chart-toolbar__slot--action:hover .stock-chart-toolbar__btn .mud-icon-root {
    color: rgba(255, 255, 255, 0.9) !important;
}

.stock-chart-wrap {
    position: relative;
    width: 100%;
}

.stock-detail-chart {
    width: 100%;
    height: 600px;
    min-height: 360px;
}

.stock-chart-tabs {
    direction: rtl;
}

.stock-ichimoku-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.crypto-sparkline {
    display: block;
    width: 80px;
    height: 24px;
}

@media (max-width: 599px) {
    .stock-detail-chart {
        height: 460px;
        min-height: 320px;
    }

    .stock-chart-header {
        flex-direction: column;
        align-items: stretch;
    }

    .stock-chart-toolbar {
        justify-content: center;
    }
}

.stock-detail-panel--indicators {
    border-top: 3px solid #7b1fa2;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

body.dark-mode .stock-detail-panel--indicators {
    border-top-color: #ce93d8;
}

.stock-detail-panel--depth {
    border-top: 3px solid #ef6c00;
}

/* تابلوی معاملات + اندیکاتورها: هم‌ارتفاع؛ الگوهای شمعی پایین پنل ثابت */
.stock-detail-metrics-row {
    align-items: stretch;
}

.stock-detail-metrics-row > .mud-grid-item {
    display: flex;
    flex-direction: column;
}

.stock-detail-metrics-row .stock-detail-panel {
    flex: 1;
    width: 100%;
    min-height: 0;
}

.stock-ind-panel-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    max-height: none;
}

.stock-ind-scroll {
    flex: 1 1 auto;
    min-height: 120px;
    overflow-y: visible;
    max-height: none;
}

.stock-ind-patterns-block {
    flex: 0 0 auto;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid rgba(106, 27, 154, 0.15);
}

body.dark-mode .stock-ind-patterns-block {
    border-top-color: rgba(206, 147, 216, 0.25);
}

.stock-ind-patterns-scroll {
    max-height: none;
    overflow-y: visible;
}

.stock-detail-panel__title {
    font-weight: 700 !important;
}

/* تابلوی معاملات: ۳ سطر × ۲ کادر */
.stock-metrics-board {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stock-metrics-board__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

@media (max-width: 720px) {
    .stock-metrics-board__row {
        grid-template-columns: 1fr;
    }
}

.stock-metrics-group {
    padding: 10px 12px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
    min-width: 0;
}

body.dark-mode .stock-metrics-group {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.stock-metrics-group__title {
    display: block;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    margin-bottom: 8px !important;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--mud-palette-text-secondary) !important;
}

body.dark-mode .stock-metrics-group__title {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.stock-metrics-group__grid {
    display: grid;
    gap: 8px;
    min-width: 0;
}

/* بخش‌های داخلی هر کادر — کنار هم (RTL: اولین آیتم سمت راست) */
.stock-metrics-group__grid--cols-2,
.stock-metrics-group__grid--cols-3 {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    direction: rtl;
}

.stock-metrics-group__grid--cols-2 .stock-metric-card {
    flex: 1 1 50%;
    min-width: 0;
    max-width: 50%;
}

.stock-metrics-group__grid--cols-3 .stock-metric-card {
    flex: 1 1 33.333%;
    min-width: 0;
    max-width: 33.333%;
}

.stock-metrics-group__grid--cols-3 .stock-metric-card {
    padding: 8px 6px;
}

.stock-metrics-group__grid--cols-3 .stock-metric__label {
    font-size: 0.68rem;
    line-height: 1.25;
}

.stock-metrics-group__grid--cols-3 .stock-metric__value {
    font-size: 0.82rem;
    line-height: 1.35;
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
}

.stock-metric-card--dense .stock-metric__value {
    font-size: 0.76rem;
}

@media (max-width: 700px) {
    .portfolio-summary {
        grid-template-columns: 1fr;
    }

    .stock-metrics-group__grid--cols-2,
    .stock-metrics-group__grid--cols-3 {
        flex-wrap: wrap;
    }

    .stock-metrics-group__grid--cols-2 .stock-metric-card,
    .stock-metrics-group__grid--cols-3 .stock-metric-card {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

.stock-metrics-group--price {
    border-top: 2px solid #1976d2;
}

.stock-metrics-group__grid--price-row .stock-metric-card {
    padding: 8px 6px;
}

.stock-metrics-group__grid--price-row .stock-metric__value {
    font-size: clamp(0.75rem, 1.8vw, 0.9rem);
    line-height: 1.3;
}

.stock-metrics-group--trade {
    border-top: 2px solid #00838f;
}

.stock-metrics-group--valuation {
    border-top: 2px solid #5e35b1;
}

.stock-metrics-group--legal {
    border-top: 2px solid #2e7d32;
}

.stock-metrics-group--retail {
    border-top: 2px solid #1565c0;
}

.stock-metrics-group--queue {
    border-top: 2px solid #ef6c00;
}

.stock-metric-card--net {
    background: rgba(46, 125, 50, 0.06);
    border-color: rgba(46, 125, 50, 0.18);
}

body.dark-mode .stock-metric-card--net {
    background: rgba(129, 199, 132, 0.1);
    border-color: rgba(129, 199, 132, 0.22);
}

.stock-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.stock-metric-card {
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

body.dark-mode .stock-metric-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.07);
}

.stock-metric-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stock-metric-card--highlight {
    background: linear-gradient(180deg, rgba(25, 118, 210, 0.1) 0%, rgba(25, 118, 210, 0.02) 100%);
    border-color: rgba(25, 118, 210, 0.2);
}

body.dark-mode .stock-metric-card--highlight {
    background: linear-gradient(180deg, rgba(66, 165, 245, 0.18) 0%, rgba(66, 165, 245, 0.04) 100%);
    border-color: rgba(66, 165, 245, 0.28);
}

.stock-metric-card--highlight .stock-metric__value {
    font-size: 1.05rem;
    font-weight: 700;
}

.stock-metric-card--buy {
    border-right: 3px solid #2e7d32;
}

.stock-metric-card--sell {
    border-right: 3px solid #c62828;
}

.stock-metric {
    text-align: center;
}

.stock-metric__label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.72rem;
}

.stock-metric__value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    display: block;
}

.stock-ind-patterns-title {
    font-weight: 700 !important;
    color: #6a1b9a;
}

body.dark-mode .stock-ind-patterns-title {
    color: #ce93d8;
}

.stock-ind-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.stock-ind-table tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark-mode .stock-ind-table tr {
    border-bottom-color: rgba(255, 255, 255, 0.07);
}

.stock-ind-table td {
    padding: 7px 4px;
    vertical-align: middle;
}

.stock-ind-table td:first-child {
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    width: 42%;
    font-weight: 500;
}

.stock-ind-table td:last-child {
    text-align: left;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.stock-ind-table--patterns td:last-child {
    font-weight: 700;
}

.stock-depth-scroll {
    overflow-x: auto;
}

.stock-codal-item {
    padding: 4px 0;
}

.stock-tweet {
    line-height: 1.7;
}

.stock-ai-panel {
    border-right: 4px solid var(--mud-palette-primary);
    background: linear-gradient(90deg, rgba(25, 118, 210, 0.04) 0%, transparent 12%);
}

body.dark-mode .stock-ai-panel {
    background: linear-gradient(90deg, rgba(66, 165, 245, 0.1) 0%, transparent 14%);
}

.stock-ai-disclaimer {
    font-size: 0.85rem;
    line-height: 1.65;
}

.stock-ai-disclaimer__bold {
    font-weight: 700;
}

.stock-ai-section {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.015);
}

body.dark-mode .stock-ai-section {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.stock-ai-section--trend {
    border-right: 4px solid #1976d2;
    background: rgba(25, 118, 210, 0.05);
}

.stock-ai-section--momentum {
    border-right: 4px solid #7b1fa2;
    background: rgba(123, 31, 162, 0.05);
}

.stock-ai-section--volume {
    border-right: 4px solid #00838f;
    background: rgba(0, 131, 143, 0.05);
}

.stock-ai-section--risk {
    border-right: 4px solid #ef6c00;
    background: rgba(239, 108, 0, 0.06);
}

.stock-ai-section--summary {
    border-right: 4px solid #2e7d32;
    background: rgba(46, 125, 50, 0.06);
}

.stock-ai-section-title {
    font-weight: 700 !important;
    margin-bottom: 6px !important;
}

.stock-ai-section-content {
    line-height: 1.8;
}

.stock-ai-bullets {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stock-ai-bullet-row {
    line-height: 1.75;
    padding: 4px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
}

body.dark-mode .stock-ai-bullet-row {
    border-bottom-color: rgba(255, 255, 255, 0.07);
}

.stock-ai-bullet-row:last-child {
    border-bottom: none;
}

.stock-ai-pos,
.stock-ai-summary.stock-ai-pos {
    color: #2e7d32;
    font-weight: 600;
}

.stock-ai-neg,
.stock-ai-summary.stock-ai-neg {
    color: #c62828;
    font-weight: 600;
}

.stock-ai-neutral,
.stock-ai-summary.stock-ai-neutral {
    color: inherit;
}

.stock-ai-summary {
    display: block;
    line-height: 1.85;
    font-size: 0.95rem;
}

.stock-ai-section-text {
    line-height: 1.75;
    white-space: pre-wrap;
}

/* ——— سایت‌های اقتصادی ——— */
.economic-site-panel__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(32, 196, 244, 0.06);
}

body.dark-mode .economic-site-panel__header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    background: rgba(32, 196, 244, 0.1);
}

.economic-site-panel__title {
    font-weight: 700 !important;
}

.economic-site-panel__frame {
    display: block;
    border: 0;
    width: 100%;
    background: #fff;
}
