/* صفحه‌ی «تحلیل سهم پایه» — فقط چیدمان؛ رنگ و دکمه و ورودی از theme.css می‌آید */
.ua-main { display: flex; flex-direction: column; gap: 12px; }
.ua-main[hidden] { display: none; }
.ua-msg { border: 1px solid var(--c-amber); color: var(--c-amber); border-radius: var(--radius); padding: 6px 10px; font-size: 14px; }
.ua-msg[hidden] { display: none; }

/* ---------- قفل: مهمان و کاربر بدون اشتراک ---------- */
.ua-denied { padding: 28px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ua-denied[hidden] { display: none; }
.ua-denied .ui-icon { width: 30px; height: 30px; color: var(--text-muted); }
.ua-denied p { margin: 0; font-size: 16px; color: var(--text-light); }

/* ---------- نوار نماد و عددهای کوچک ---------- */
.ua-bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 8px 12px; }
.ua-bar select { width: 190px; max-width: 100%; }
.ua-kpis { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; }
.ua-kpis span { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.ua-kpis i { font-style: normal; font-size: 13px; color: var(--text-muted); }
.ua-kpis b { font-size: 15px; font-weight: 500; color: var(--text-strong); }
.ua-jumps { display: flex; gap: 6px; flex-wrap: wrap; margin-right: auto; }
.ua-jumps .ui-btn { text-decoration: none; }

/* ---------- نوار ابزار نمودار ---------- */
.ua-tools { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; padding: 8px 12px; }
.ua-tools .ui-seg button { height: 30px; padding: 0 12px; font-size: 15px; }
.ua-tools select { width: 170px; height: 30px; font-size: 15px; }
#uaAdjustWrap[hidden] { display: none; }
.ua-toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.ua-toggles .ui-btn[hidden] { display: none; }

/* منوی اندیکاتور */
.ua-menu-wrap { position: relative; }
.ua-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; width: 190px; padding: 8px 10px;
    display: flex; flex-direction: column; gap: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.ua-menu[hidden] { display: none; }
.ua-menu b { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-top: 2px; }
.ua-menu .ui-check { font-size: 15px; }

/* ---------- نمودار ---------- */
.ua-chart { position: relative; padding: 0; overflow: hidden; }
.ua-chart-host { width: 100%; height: 540px; }
.ua-drawbar { display: flex; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--border-color); }
.ua-drawbar[hidden] { display: none; }
.ua-chart-empty { padding: 40px 16px; text-align: center; color: var(--text-muted); font-size: 15px; }
.ua-chart-empty[hidden] { display: none; }
.ua-chart.empty .ua-chart-host { display: none; }
.ua-chart.empty { min-height: 120px; }

/* ---------- جعبه‌های عددی زیر نمودار ---------- */
.ua-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.ua-card { padding: 10px 12px; min-width: 0; }
.ua-card[hidden] { display: none; }
.ua-card h3 { font-size: 14px; font-weight: 500; color: var(--text-muted); margin: 0 0 6px 0; }
.ua-card-body { display: flex; flex-direction: column; gap: 4px; font-size: 15px; color: var(--text-light); min-width: 0; }
.ua-card-body .row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ua-card-body .row i { font-style: normal; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.ua-card-body .row b { font-size: 15px; font-weight: 500; color: var(--text-strong); white-space: nowrap; }
.ua-card-body .muted { color: var(--text-muted); font-size: 14px; }
.ua-up { color: var(--c-green) !important; }
.ua-down { color: var(--c-red) !important; }

@media (max-width: 800px) {
    .ua-bar { padding: 8px 10px; gap: 8px; }
    .ua-bar select { width: 100%; }
    .ua-jumps { margin-right: 0; width: 100%; }
    .ua-jumps .ui-btn { flex: 1; padding: 0 6px; }
    .ua-tools { padding: 8px 10px; }
    .ua-tools select { width: 100%; }
    .ua-drawbar { display: none; }
    .ua-chart-host { height: 360px; }
    .ua-menu { width: 160px; }
}

/* ---------- دو نما: رادار بازار / تحلیل نماد ---------- */
.ua-main.ua-off, .ua-radar.ua-off { display: none !important; }
.ua-views { flex: none; }
.ua-views button { height: 32px; padding: 0 12px; font-size: 15px; }

/* ---------- رادار بازار (فاز ۳B) ---------- */
.ua-radar { display: flex; flex-direction: column; gap: 12px; }
.ua-radar[hidden] { display: none; }
.ua-radar-bar { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; padding: 8px 12px; }
.ua-radar-bar input { width: 190px; height: 30px; font-size: 15px; }
.ua-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.ua-radar-stamp { margin-right: auto; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.ua-radar-wrap { padding: 0; overflow: auto; max-height: calc(100vh - 210px); }
.ua-radar-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.ua-radar-table thead th { position: sticky; top: 0; z-index: 3; background: var(--bg-raised); color: var(--text-muted);
    font-size: 14px; font-weight: 500; text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--border-color);
    white-space: nowrap; cursor: pointer; user-select: none; }
.ua-radar-table thead th[data-sort]::after { content: "↕"; font-size: 11px; margin-inline-start: 4px; opacity: 0; }
.ua-radar-table thead th[data-sort]:hover::after { opacity: .45; }
.ua-radar-table thead th.active { color: var(--text-strong); }
.ua-radar-table thead th.active::after { content: "↑"; opacity: 1; }
.ua-radar-table thead th.active.desc::after { content: "↓"; }
.ua-radar-table tbody td { padding: 7px 10px; border-bottom: 1px solid var(--border-color); text-align: right; white-space: nowrap; }
.ua-radar-row { cursor: pointer; }
.ua-radar-row:hover td { background: var(--bg-raised); }
.ua-radar-row .ua-sticky { position: sticky; inset-inline-start: 0; z-index: 2; background: var(--bg-card); }
.ua-radar-row:hover .ua-sticky { background: var(--bg-raised); }
.ua-radar-table thead th.ua-sticky { z-index: 4; inset-inline-start: 0; }
.ua-sticky b { font-weight: 600; color: var(--text-strong); font-size: 16px; }
.ua-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; background: transparent; }
.ua-dot.up { background: var(--c-green); }
.ua-dot.down { background: var(--c-red); }
.ua-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 13px; line-height: 1.7;
    border: 1px solid var(--border-strong); color: var(--text-muted); white-space: nowrap; }
.ua-pill.up { color: var(--c-green); border-color: var(--c-green); }
.ua-pill.down { color: var(--c-red); border-color: var(--c-red); }
.ua-pill.blue { color: var(--accent-blue); border-color: var(--accent-blue); }
.ua-pill.amber { color: var(--c-amber); border-color: var(--c-amber); }
/* داخل خانه‌های جدول هرگز flex نگذارید: خانه از چیدمان جدول بیرون می‌زند و خط‌ها می‌شکنند */
.ua-iv, .ua-sr { white-space: nowrap; }
.ua-iv > span { margin-inline-end: 6px; }
.ua-rank { display: inline-block; font-style: normal; font-size: 12px; color: var(--text-muted); border: 1px solid var(--border-strong);
    border-radius: 999px; padding: 0 6px; -webkit-text-fill-color: var(--text-muted); }
.ua-hit { color: var(--c-amber) !important; font-weight: 600; }
.ua-sr span { font-size: 14px; }
.ua-radar-empty { text-align: center; padding: 26px 12px; color: var(--text-muted); }

/* ---------- پنل تابلوخوانی ---------- */
.ua-flow .ua-card-body .row .ua-pill { font-size: 14px; }

@media (max-width: 800px) {
    .ua-views { order: 4; width: 100%; }
    .ua-views button { flex: 1 1 0; }
    .ua-radar-bar { padding: 8px 10px; }
    .ua-radar-bar input { width: 100%; }
    .ua-filters { flex-wrap: wrap; width: 100%; }
    .ua-filters .ui-btn { flex: none; padding: 0 8px; }
    .ua-radar-stamp { margin-right: 0; }
    .ua-radar-wrap { max-height: calc(100dvh - 260px); -webkit-overflow-scrolling: touch; }
    .ua-radar-table thead th { padding: 8px 10px; }
    .ua-radar-table tbody td { padding: 6px 10px; }
    .ua-sticky b { font-size: 15px; }
}

/* ---------- پنجره‌ی «نمودار پایه» (فاز ۲): از آزمایشگاه و جدول استراتژی باز می‌شود ---------- */
.ucm-backdrop { position: fixed; inset: 0; z-index: 1200; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px 20px; overflow-y: auto; }
.ucm-backdrop[hidden] { display: none; }
.ucm-box { width: 100%; max-width: 980px; background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .45); display: flex; flex-direction: column; min-width: 0; }
.ucm-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border-color); flex-wrap: wrap; }
.ucm-head h3 { margin: 0; font-size: 17px; font-weight: 600; color: var(--text-strong); display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ucm-badge { font-size: 13px; font-weight: 400; color: var(--text-muted); border: 1px solid var(--border-strong); border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.ucm-head .ucm-full { margin-right: auto; text-decoration: none; }
.ucm-tools { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--border-color); }
.ucm-tools .ui-seg button { height: 30px; padding: 0 12px; font-size: 15px; }
.ucm-tools select { width: 165px; height: 30px; font-size: 15px; }
#ucmAdjustWrap[hidden] { display: none; }
.ucm-toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.ucm-toggles .ui-btn[hidden] { display: none; }
.ucm-chart { position: relative; }
.ucm-chart-host { width: 100%; height: 440px; }
.ucm-chart.empty .ucm-chart-host { display: none; }
.ucm-empty { padding: 40px 16px; text-align: center; color: var(--text-muted); font-size: 15px; }
.ucm-empty[hidden] { display: none; }
.ucm-strip { display: flex; align-items: baseline; gap: 6px 18px; flex-wrap: wrap; padding: 7px 12px; border-top: 1px solid var(--border-color); min-width: 0; }
.ucm-strip[hidden] { display: none; }
.ucm-strip span { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; min-width: 0; }
.ucm-strip i { font-style: normal; font-size: 13px; color: var(--text-muted); }
.ucm-strip b { font-size: 15px; font-weight: 500; color: var(--text-strong); }
.ucm-msg { padding: 8px 12px; border-top: 1px solid var(--border-color); color: var(--c-amber); font-size: 14px; }
.ucm-msg[hidden] { display: none; }
@media (max-width: 800px) {
    .ucm-backdrop { padding: 0; }
    .ucm-box { max-width: none; border-radius: 0 0 10px 10px; border-width: 0 0 1px 0; }
    .ucm-head { padding: 8px 10px; }
    .ucm-head h3 { font-size: 16px; }
    .ucm-tools { padding: 8px 10px; gap: 8px; }
    .ucm-tools select { width: 100%; }
    .ucm-chart-host { height: 320px; }
    .ucm-strip { padding: 6px 10px; gap: 4px 12px; }
    .ucm-strip i { font-size: 12px; }
    .ucm-strip b { font-size: 14px; }
}

/* ---------- تحلیل بنیادی و رویدادها (فاز ۴) ---------- */
.ua-fund { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ua-fund[hidden] { display: none; }
.ua-fund-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ua-fund-head h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-strong); }
.ua-fund-demo { font-size: 12px; color: var(--c-amber); border: 1px solid var(--c-amber); border-radius: 999px; padding: 0 8px; line-height: 1.8; white-space: nowrap; }
.ua-fund-stamp { margin-right: auto; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.ua-fund-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 14px; }
.ua-fund-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ua-fund-cell i { font-style: normal; font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ua-fund-cell b { font-size: 15px; font-weight: 500; color: var(--text-strong); overflow-wrap: anywhere; }
.ua-fund-cell b.num { direction: ltr; text-align: right; }
.ua-fund-events { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--border-color); padding-top: 8px; }
.ua-fund-events[hidden] { display: none; }
.ua-fund-events b { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.ua-fund-events ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ua-fund-events li { display: flex; align-items: baseline; gap: 8px; font-size: 14px; color: var(--text-light); flex-wrap: wrap; }
.ua-fund-events li .ua-pill { font-size: 12px; }
.ua-fund-events li time { font-size: 13px; color: var(--text-muted); }
.ua-fund-events li span { color: var(--text-muted); font-size: 13px; }
.ua-fund-note { margin: 0; font-size: 14px; color: var(--text-muted); line-height: 1.7; border-top: 1px solid var(--border-color); padding-top: 8px; }
.ua-fund-note[hidden] { display: none; }
/* نشان رویداد پیش‌رو کنار نام نماد در رادار (ستون تازه‌ای اضافه نمی‌شود) */
.ua-ev { display: inline-block; width: 6px; height: 6px; border-radius: 2px; margin-inline-start: 6px; vertical-align: middle; background: var(--accent-blue); opacity: .9; cursor: help; }
