/* ==========================================================================
   PHAISINH.ONLINE — LỚP THƯƠNG HIỆU DÙNG CHUNG CHO bantin.phaisinh.online
   Quy chuẩn gốc: docs/PHAISINH_DESIGN_SYSTEM.md (mục 2, 6, 11).
   Nạp file này SAU khối <style> của trang. Nó:
     1. Khai báo token chuẩn của hệ phaisinh.online (không đổi giá trị).
     2. Ánh xạ biến cũ của bantin (--primary, --bg, --success…) sang token chuẩn,
        để toàn bộ CSS cũ tự đổi sang màu thương hiệu mà không phải sửa từng chỗ.
     3. Ghi đè các thành phần dùng chung (thanh hệ sinh thái, header, nav, nút,
        tiêu đề khối, footer) theo mẫu oi.phaisinh.online.
   Đổi file này → tăng ?v= ở thẻ <link> (thư mục /assets cache immutable 1 năm).
   ========================================================================== */

/* ---------- 1. Token chuẩn (sao nguyên từ mục 2 của quy chuẩn) ---------- */
:root {
  --red-600: #d23922; --red-700: #b02c18; --red-800: #8e1f12;
  --red-50: #fff4f1;  --red-25: #fffaf8;
  --brand-primary: #d23922; --brand-hover: #b02c18; --brand-strong: #8e1f12; --brand-soft: #fff4f1;
  --brand-gradient: linear-gradient(135deg, #d23922 0%, #8e1f12 100%);
  --pos: #0b7d44; --pos-hover: #086637; --pos-bg: #e8f6ee; --pos-border: rgba(11,125,68,.24);
  --neg: #d23922; --neg-hover: #b02c18; --neg-bg: #fdeeea; --neg-border: rgba(210,57,34,.24);
  --neutral: #6c6d6d; --neutral-bg: rgba(108,109,109,.08); --neutral-border: rgba(108,109,109,.2);
  --warn: #946300; --warn-bg: #fdf6e6; --warn-border: rgba(148,99,0,.28);
  --s-nn: #1e4d8c; --s-td: #6a4aa0; --s-nk: #8b8580;
  --metric-oi: #0e7490; --chart-price: #1b1b1b; --chart-vol: #d9d6d4;
  --bg-page: #ffffff; --bg-surface: #ffffff; --bg-surface-2: #f6f4f3; --bg-surface-3: #eeeae8; --bg-soft: #fffaf8;
  --ink-primary: #111111; --ink-secondary: #444444; --ink-muted: #6c6d6d; --ink-faint: #9d9fa3; --ink-inverse: #ffffff;
  --line-subtle: #f6f4f3; --line-normal: #eeeae8; --line-strong: #d9d6d4;
  --shadow-xs: 0 1px 2px #1111110d; --shadow-md: 0 4px 14px #8e1f120f;
  --shadow-lg: 0 8px 28px #8e1f1214; --shadow-xl: 0 16px 40px #8e1f121a;
  --radius-xs: 6px; --radius-md: 16px; --radius-lg: 24px; --radius-full: 9999px;
  --font-sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --max-content-width: 1200px; --header-height: 68px; --touch-target-min: 44px;
  color-scheme: light;

  /* ---------- 2. Ánh xạ biến cũ của bantin → token chuẩn ---------- */
  --bg: var(--bg-page);
  --bg-body: var(--bg-page);
  --bg-card: var(--bg-surface);
  --bg-card-rgb: 255, 255, 255;
  --bg-card-sub: var(--bg-surface-2);
  --bg-card-hover: var(--bg-soft);
  --hover-bg: var(--bg-surface-2);
  --border: var(--line-normal);
  --border-sub: var(--line-subtle);
  --border-focus: var(--line-strong);
  --text: var(--ink-primary);
  --text-muted: var(--ink-muted);
  --text-light: var(--ink-faint);
  --primary: var(--brand-primary);
  --primary-rgb: 210, 57, 34;
  --primary-hover: var(--brand-hover);
  --primary-light: var(--brand-soft);
  --primary-bg: var(--brand-soft);
  --primary-border: rgba(210, 57, 34, .28);
  --primary-fg: #ffffff;
  --success: var(--pos);
  --success-bg: var(--pos-bg);
  --success-border: var(--pos-border);
  --danger: var(--neg);
  --danger-bg: var(--neg-bg);
  --danger-border: var(--neg-border);
  --warning: var(--warn);
  --warning-bg: var(--warn-bg);
  --warning-border: var(--warn-border);
  --gold: #b7791f;
  --radius: 14px;
  --radius-card: 14px;
  --radius-sm: 10px;
  --radius-pill: var(--radius-full);
  --shadow-sm: 0 1px 2px #1111110d;
  --shadow-card: 0 1px 2px #1111110a;
  --shadow-hover: var(--shadow-md);
  --header-bg: color-mix(in srgb, var(--bg-surface) 92%, transparent);
  --nav-bg: var(--bg-surface);
  --chart-bg: var(--bg-surface);
  --chart-grid: rgba(17, 17, 17, .06);
}

:root[data-theme="dark"] {
  --red-600: #f0634a; --red-700: #ff7a63; --red-800: #ffb3a5; --red-50: #2a1612; --red-25: #1d1311;
  --brand-primary: #f0634a; --brand-hover: #ff7a63; --brand-strong: #c2412b; --brand-soft: #2a1612;
  --bg-page: #141110; --bg-surface: #1b1716; --bg-surface-2: #221e1c; --bg-surface-3: #2f2a28; --bg-soft: #1d1311;
  --ink-primary: #f3efed; --ink-secondary: #cfc9c6; --ink-muted: #9a9491; --ink-faint: #7a7471; --ink-inverse: #141110;
  --line-subtle: #221e1c; --line-normal: #2f2a28; --line-strong: #4a4442;
  --pos: #2fbf6f; --pos-hover: #4fd389; --pos-bg: #10261a; --pos-border: rgba(63,191,122,.3);
  --neg: #ff6b52; --neg-hover: #ff8a75; --neg-bg: #2c1511; --neg-border: rgba(255,122,99,.3);
  --neutral: #9a9491; --neutral-bg: rgba(154,148,145,.12); --neutral-border: rgba(154,148,145,.24);
  --warn: #e0b04a; --warn-bg: #2a2210; --warn-border: rgba(224,176,74,.3);
  --s-nn: #6fa3ea; --s-td: #ad92e6; --s-nk: #a39d98; --metric-oi: #22b8cf; --chart-price: #f3efed; --chart-vol: #4a4442;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.4); --shadow-md: 0 4px 10px rgba(0,0,0,.45);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.5); --shadow-xl: 0 16px 40px rgba(0,0,0,.55);
  color-scheme: dark;

  --bg-card-rgb: 27, 23, 22;
  --primary-rgb: 240, 99, 74;
  --primary-border: rgba(240, 99, 74, .34);
  --primary-fg: #141110;
  --gold: #e0b04a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-card: 0 1px 2px rgba(0,0,0,.35);
  --chart-grid: rgba(255, 255, 255, .06);
}

/* ---------- 3. Nền tảng ---------- */
body {
  font-family: var(--font-sans);
  font-size: 15px;
  background: var(--bg-page);
  color: var(--ink-primary);
}
/* Nút, ô nhập, ô chọn không tự kế thừa font → trước đây rơi về Arial */
button, input, select, textarea, optgroup { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--brand-primary) 22%, transparent); }
table, .num, [class*="pnl"], [class*="price"], [class*="-val"] { font-variant-numeric: tabular-nums; }

/* Giá trị dương: xanh (quy chuẩn mục 2 — không dùng màu thương hiệu cho lãi) */
.table-pnl-positive { color: var(--pos) !important; background: var(--pos-bg) !important; }
.top-pill-metric.text-positive,
.mobile-metric-pnl.positive { color: var(--pos) !important; }

/* ---------- 4. Thanh hệ sinh thái (tầng trên cùng) ---------- */
.top-news-bar {
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--line-normal);
  color: var(--ink-muted);
}
.top-news-inner { max-width: 1280px; padding-top: 5px; padding-bottom: 5px; }
.news-wire-left { gap: 14px; }
.eco-links { display: inline-flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; }
.eco-links a {
  color: var(--ink-muted); text-decoration: none; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.eco-links a:hover { color: var(--brand-primary); }
.eco-links a.on { color: var(--brand-primary); font-weight: 700; }
.eco-links a.eco-home { color: var(--ink-primary); font-weight: 800; }
.eco-links a.eco-home b { color: var(--brand-primary); font-weight: 800; }
.eco-sep { width: 1px; height: 12px; background: var(--line-strong); }
.ticker-badge {
  background: var(--bg-surface); border-color: var(--line-normal); box-shadow: none;
  font-variant-numeric: tabular-nums;
}
.ticker-price { color: var(--ink-primary); }
.theme-toggle-btn { background: var(--bg-surface); border-color: var(--line-normal); box-shadow: none; }
.theme-toggle-btn:hover { border-color: var(--line-strong); background: var(--bg-surface); }
.pulse-dot { background: var(--pos); }
@media (max-width: 1080px) { .eco-links, .eco-sep { display: none; } }

/* ---------- 5. Header + điều hướng (mẫu .site-header của oi) ---------- */
.header {
  background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line-normal);
  box-shadow: none;
}
.header.is-scrolled { box-shadow: var(--shadow-md); border-bottom-color: var(--line-normal); }
.header-inner { max-width: 1280px; height: var(--header-height); gap: 20px; }
/* Logo Bản tin phaisinh.online: bản đơn sắc cho nền sáng, bản âm bản cho nền tối (Img/logo-bantin*.png) */
.brand.ps-lockup { display: flex; align-items: center; flex: none; text-decoration: none; }
.brand.ps-lockup .brand-logo { height: 40px !important; width: auto !important; max-width: none; padding: 0 !important; background: none !important; border-radius: 0 !important; box-shadow: none !important; transform: none !important; }
.brand.ps-lockup .ps-logo-on-dark { display: none; }
:root[data-theme="dark"] .brand.ps-lockup .ps-logo-on-light { display: none; }
:root[data-theme="dark"] .brand.ps-lockup .ps-logo-on-dark { display: block; }
@media (max-width: 560px) { .brand.ps-lockup .brand-logo { height: 34px !important; } }

.top-nav-menu {
  align-self: stretch;
  background: transparent;
  border: 0;
  padding: 0;
  gap: 2px;
  border-radius: 0;
  box-shadow: none;
}
.top-nav-item,
[data-theme="dark"] .top-nav-item {
  position: relative;
  height: 100%;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink-secondary);
  font-size: 14.5px;
  font-weight: 600;
  gap: 6px;
}
.top-nav-item svg, .top-nav-item i { display: none; }
.top-nav-item:hover { color: var(--brand-primary); background: transparent; }
.top-nav-item.active,
[data-theme="dark"] .top-nav-item.active {
  color: var(--brand-primary) !important;
  background: transparent !important;
  box-shadow: none !important;
}
.top-nav-item.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: var(--brand-primary); border-radius: 2px 2px 0 0;
}

/* Nút "Tải ảnh" = .share-btn của oi */
.btn-header-download, .btn-share-main,
[data-theme="dark"] .btn-header-download, [data-theme="dark"] .btn-share-main {
  height: 40px; padding: 0 16px; gap: 7px;
  border: 1px solid var(--brand-primary);
  background: var(--brand-soft);
  color: var(--brand-primary) !important;
  border-radius: var(--radius-full);
  font-size: 14px; font-weight: 700;
  box-shadow: none;
}
.btn-header-download:hover, .btn-share-main:hover { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff !important; transform: none; box-shadow: none; }
:root[data-theme="dark"] .btn-header-download:hover, :root[data-theme="dark"] .btn-share-main:hover { color: var(--ink-inverse) !important; }

/* Nút icon tròn 40×40 = .icon-btn của oi */
.header-theme-btn, .mobile-menu-btn {
  width: 40px; height: 40px; padding: 0;
  align-items: center; justify-content: center;
  border: 1px solid var(--line-normal);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  border-radius: var(--radius-full);
  box-shadow: none;
  cursor: pointer;
}
.header-theme-btn:hover, .mobile-menu-btn:hover { color: var(--ink-primary); border-color: var(--line-strong); background: var(--bg-surface); }
.header-theme-btn { display: inline-flex; }
/* Điện thoại: 3 nút header cùng một kiểu tròn 40px (mẫu .icon-btn của oi); nút Tải ảnh chỉ còn biểu tượng, nền đỏ nhạt */
@media (max-width: 860px) {
  .header-right-actions { display: flex !important; align-items: center !important; gap: 8px !important; flex: none; }
  .header-right-actions .btn-header-download, .header-right-actions .btn-share-main,
  .header-right-actions .header-theme-btn, .header-right-actions .mobile-menu-btn {
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    width: 40px !important; height: 40px !important; min-width: 40px; padding: 0 !important; border-radius: var(--radius-full) !important;
  }
  .header-right-actions .btn-header-download, .header-right-actions .btn-share-main {
    background: var(--brand-soft) !important; border: 1px solid var(--brand-primary) !important; color: var(--brand-primary) !important;
  }
  .header-right-actions .btn-header-download span, .header-right-actions .btn-share-main span { display: none !important; }
  .header-right-actions .header-theme-btn, .header-right-actions .mobile-menu-btn {
    background: var(--bg-surface) !important; border: 1px solid var(--line-normal) !important; color: var(--ink-secondary) !important;
  }
}
@media (max-width: 380px) { .header-right-actions { gap: 6px !important; } .header-right-actions > * { width: 36px !important; height: 36px !important; min-width: 36px; } }

.mobile-nav-drawer { background: var(--bg-surface); border-bottom: 1px solid var(--line-normal); box-shadow: var(--shadow-lg); }
.mobile-nav-item { background: transparent; border: 0; border-bottom: 1px solid var(--line-normal); border-radius: 0; color: var(--ink-primary); font-weight: 600; min-height: var(--touch-target-min); }
.mobile-nav-item.active { background: var(--brand-soft); color: var(--brand-primary); border-radius: var(--radius-sm); border-bottom-color: transparent; }
.mobile-nav-action-btn { border-radius: var(--radius-full) !important; min-height: var(--touch-target-min); }

/* Chuyên trang con (analytics, ctck) dùng cùng header */
@media (max-width: 860px) { .header-inner { height: 60px; } }

/* ---------- 6. Thẻ, tiêu đề, pill, segmented ---------- */
/* Dark-mode nút đang chọn: chữ tối ấm trên nền đỏ san hô (thay navy cũ) */
[data-theme="dark"] .editorial-part-tag { color: var(--ink-inverse) !important; }

/* Segmented controls (.seg của oi): nút đang chọn nền trắng chữ đỏ */
.seg-btn.active, .chart-type-btn.active, .res-btn.active {
  background: var(--bg-surface) !important;
  color: var(--brand-primary) !important;
  border-color: transparent !important;
  box-shadow: 0 1px 3px #11111121 !important;
}
:root[data-theme="dark"] .seg-btn.active,
:root[data-theme="dark"] .chart-type-btn.active,
:root[data-theme="dark"] .res-btn.active { background: var(--bg-surface-3) !important; color: var(--brand-primary) !important; box-shadow: none !important; }

/* Pill lọc (.chips của oi): chọn = viền + chữ đỏ, nền đỏ nhạt */
.pill-btn.active, .edition-chip.active, .broker-chip.active, .filter-pill.active {
  background: var(--brand-soft) !important;
  color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  box-shadow: none !important;
}

/* Tiêu đề trang: chữ đậm, giãn chữ âm như oi */
h1, .today-headline, .ranking-h1-title, .analytics-title, .page-title {
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.today-headline { font-weight: 800; }

/* Tiêu đề khối (.block-head h2 của oi): thanh đỏ 4px bên trái thay icon */
.editorial-section-title, .hist-notable-title, .podium-section-title, .ranking-table-title-group h2 {
  font-weight: 800 !important;
  letter-spacing: -0.015em;
  display: flex; align-items: center; gap: 0;
}
.editorial-section-title > svg:first-child, .editorial-section-title > i:first-child,
.hist-notable-title > svg:first-child, .hist-notable-title > i:first-child,
.podium-section-title > svg:first-child, .podium-section-title > i:first-child,
.editorial-section-title > span:first-child > svg:first-child,
.hist-notable-title > span:first-child > svg:first-child,
.podium-section-title > span:first-child > svg:first-child { display: none; }
.editorial-section-title::before, .hist-notable-title::before, .podium-section-title::before, .ranking-table-title-group h2::before {
  content: ""; flex: none; width: 4px; height: 0.95em; margin-right: 10px;
  background: var(--brand-primary); border-radius: 2px;
}

/* Cùng quy tắc cho tiêu đề khối ở Phân tích, Hồ sơ, Xếp hạng, Nhịp đập (trước đây mỗi trang một kiểu biểu tượng màu) */
.section-title, .today-signal-title, .equity-sim-title, .calendar-header-title h2, .ranking-mobile-summary-header, .pulse-dch-title {
  display: flex !important; align-items: center !important; gap: 0 !important; font-weight: 800 !important;
  letter-spacing: -0.015em; color: var(--ink-primary) !important; text-transform: none !important;
}
.section-title > i:first-child, .section-title > svg:first-child,
.today-signal-title > i:first-child, .today-signal-title > svg:first-child,
.equity-sim-title > i:first-child, .equity-sim-title > svg:first-child,
.calendar-header-title h2 > i:first-child, .calendar-header-title h2 > svg:first-child,
.ranking-mobile-summary-header > i:first-child, .ranking-mobile-summary-header > svg:first-child { display: none !important; }
.section-title::before, .today-signal-title::before, .equity-sim-title::before, .calendar-header-title h2::before, .ranking-mobile-summary-header::before, .pulse-dch-title::before {
  content: ""; flex: none; width: 4px; height: 0.95em; margin-right: 10px; background: var(--brand-primary); border-radius: 2px;
}

/* Eyebrow / tag nhỏ: chữ in hoa đỏ thương hiệu */
.eyebrow-market-tag {
  background: transparent !important;
  color: var(--brand-primary) !important;
  border: 0 !important;
  padding: 0 !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  letter-spacing: .07em !important;
  text-transform: uppercase;
}

/* Thẻ: viền mảnh, bóng rất nhẹ (quy chuẩn ưu tiên đường kẻ hơn bóng) */
.today-chart-card, .card, .rec-card, .summary-card, .ranking-card, .chart-card {
  box-shadow: var(--shadow-card);
}

/* Điện thoại: tiêu đề "Nhịp đập phái sinh" không bị bẻ từng chữ khi cỡ chữ lớn hơn */
.market-pulse-title { white-space: nowrap; }
@media (max-width: 480px) { .market-pulse-title-wrap { flex-wrap: wrap; row-gap: 6px; } }

/* Không viền đỏ lớn cạnh số liệu (dễ đọc nhầm là lỗ) — dùng viền trung tính + vạch nhấn trên */
.pulse-split-col.col-tomorrow {
  border-color: var(--line-strong) !important;
  box-shadow: inset 0 3px 0 var(--brand-primary) !important;
}

/* Hộp tóm tắt: vạch đỏ dọc như .block-head */
.today-summary-box {
  background: var(--bg-soft) !important;
  border: 0 !important;
  border-left: 4px solid var(--brand-primary) !important;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
}
.today-summary-text { color: var(--ink-secondary); }

/* Nút chính dạng CTA */
.btn-primary, .cta, .btn-hist-cta-main {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
}
.btn-primary:hover, .cta:hover, .btn-hist-cta-main:hover { background: var(--red-700); border-color: var(--red-700); }

/* ---------- 7. Footer ---------- */
.footer {
  background: var(--bg-surface-2);
  border-top: 1px solid var(--line-normal);
  color: var(--ink-muted);
}
.footer a:hover, .footer-nav-link:hover { color: var(--brand-primary); }
.footer-col-heading { color: var(--ink-primary); letter-spacing: .05em; }
.footer-disclaimer-box { background: var(--warn-bg); border-color: var(--warn-border); color: var(--ink-secondary); }

/* Footer gọn (mẫu .site-footer của oi): logo · liên kết một hàng · mạng xã hội; một dòng miễn trừ; dòng bản quyền */
.footer.ps-footer { padding: 28px 16px 22px !important; margin-top: 40px; font-size: 13.5px; background: var(--bg-surface-2); }
.ps-footer-wrap { max-width: 1280px; margin: 0 auto; display: grid; gap: 14px; }
.ps-footer-top { display: flex; align-items: center; gap: 20px 28px; flex-wrap: wrap; }
.ps-footer-brand { display: inline-flex; flex: none; }
.ps-footer-brand img { height: 34px; width: auto; display: block; }
.ps-footer .ps-logo-on-dark { display: none; }
:root[data-theme="dark"] .ps-footer .ps-logo-on-light { display: none; }
:root[data-theme="dark"] .ps-footer .ps-logo-on-dark { display: block; }
.ps-footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; flex: 1 1 auto; }
.ps-footer-links a, .ps-footer-bottom a { color: var(--ink-secondary); font-weight: 600; text-decoration: none; }
.ps-footer-links a:hover, .ps-footer-bottom a:hover { color: var(--brand-primary); }
.ps-footer-social { display: flex; gap: 8px; flex: none; }
/* Logo mạng xã hội đúng màu nhận diện của từng hãng, cùng kích thước 32px, không viền */
.ps-footer-social a { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; transition: transform .15s ease; }
.ps-footer-social a:hover { transform: translateY(-1px); }
.ps-footer-social svg { width: 32px; height: 32px; display: block; }
.ps-footer-social a[aria-label="YouTube"] svg { width: 34px; height: 24px; }
.ps-footer-note { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-muted); }
.ps-footer-bottom {
  display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  padding-top: 12px; border-top: 1px solid var(--line-normal); font-size: 12.5px; color: var(--ink-muted);
}
@media (max-width: 720px) {
  .ps-footer-top { gap: 14px; }
  .ps-footer-links { order: 3; flex-basis: 100%; gap: 8px 16px; }
  .ps-footer-social { margin-left: auto; }
}

/* Menu điện thoại: chỉ còn các mục điều hướng (nút Tải ảnh, đổi giao diện đã có trên header); biểu tượng cùng một màu */
.mobile-nav-actions-row, .mobile-nav-divider { display: none !important; }
.mobile-nav-item svg, .mobile-nav-item i { color: currentColor !important; }

/* ---------- 8. Hộp thoại Tải ảnh chia sẻ (share-poster.js, mẫu .share-dialog của oi, bản 11/2026) ----------
   Gọn: không chữ phụ, không khung quanh ảnh; nền ảnh là công tắc biểu tượng trên hàng tiêu đề.
   Mobile: chip nội dung một hàng, ảnh cân trái + cột nút biểu tượng cân phải ngay màn đầu. */
.ps-dialog {
  width: min(900px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 16px;
  background: var(--bg-surface); color: var(--ink-primary); box-shadow: var(--shadow-xl); font-family: var(--font-sans);
  margin: auto; /* trang đặt * { margin: 0 } nên phải trả lại căn giữa cho <dialog> */
}
.ps-dialog [hidden] { display: none !important; }
.ps-dialog::backdrop { background: rgba(17, 17, 17, .55); }
.ps-top { display: flex; align-items: center; gap: 10px; padding: 16px 22px 0; }
.ps-top h2 { margin: 0 auto 0 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.015em; }
.ps-close {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; cursor: pointer; padding: 0;
  border: 1px solid var(--line-normal); border-radius: var(--radius-full); background: var(--bg-surface); color: var(--ink-secondary);
}
.ps-close:hover { color: var(--ink-primary); border-color: var(--line-strong); }
.ps-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/* Công tắc nền ảnh Tối/Sáng: hai biểu tượng, nút trượt nằm sau lựa chọn đang bật */
.ps-switch {
  position: relative; display: inline-flex; align-items: center; height: 40px; padding: 3px; cursor: pointer; flex: none;
  border: 1px solid var(--line-normal); border-radius: var(--radius-full); background: var(--bg-surface-2); color: var(--ink-muted);
}
.ps-switch::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 32px; height: 32px; border-radius: 50%;
  background: #1b1616; box-shadow: var(--shadow-sm); transition: transform .18s ease, background .18s ease;
}
.ps-switch[aria-checked="true"]::before { transform: translateX(32px); background: #fff; }
.ps-switch svg { position: relative; width: 32px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ps-switch .i-moon { fill: currentColor; stroke: none; }
.ps-switch[aria-checked="false"] .i-moon { color: #fff; }
.ps-switch[aria-checked="true"] .i-sun { color: #d23922; }
.ps-switch:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.ps-body {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 24px; row-gap: 14px; padding: 14px 22px 22px;
  grid-template-areas: "prev modes" "prev acts" "prev msg" "prev text"; grid-template-rows: auto auto auto 1fr; align-items: start;
}
.ps-modes { grid-area: modes; }
.ps-preview { grid-area: prev; display: grid; place-items: start; }
.ps-preview canvas, .ps-preview img { display: block; width: 300px; height: auto; border-radius: 6px; box-shadow: 0 0 0 1px var(--line-normal); }
.ps-preview canvas { aspect-ratio: 1080 / 1920; }
.ps-dialog.ps-is-image .ps-preview img { width: 340px; max-height: 70dvh; object-fit: contain; }
.ps-actions { grid-area: acts; display: flex; flex-wrap: wrap; gap: 8px; }
.ps-msg { grid-area: msg; font-size: 13.5px; font-weight: 600; }
.ps-field { grid-area: text; display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-secondary); }
.ps-dialog fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.ps-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ps-chips legend { font-size: 13px; font-weight: 600; color: var(--ink-secondary); margin-bottom: 8px; width: 100%; padding: 0; }
.ps-chips label { position: relative; }
.ps-chips input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ps-chips span {
  display: inline-block; padding: 6px 13px; border-radius: var(--radius-full); border: 1px solid var(--line-strong);
  font-size: 13px; font-weight: 600; color: var(--ink-secondary); cursor: pointer;
}
.ps-chips input:checked + span { border-color: var(--brand-primary); color: var(--brand-primary); background: var(--brand-soft); }
.ps-chips input:focus-visible + span { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.ps-field textarea {
  width: 100%; min-height: 190px; resize: vertical; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--bg-surface); color: var(--ink-primary);
  font: 400 13.5px/1.5 var(--font-sans);
}
.ps-act {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 15px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--brand-primary); border-radius: var(--radius-full); background: transparent;
  color: var(--brand-primary); font: 600 14px var(--font-sans);
}
.ps-act:hover { background: var(--brand-soft); }
.ps-act.primary { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.ps-act.primary:hover { background: var(--red-700); }
.ps-act svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ps-act .l-short { display: none; }
.ps-act:disabled { opacity: .55; cursor: wait; }
.ps-msg:empty { display: none; }
.ps-msg.ok { color: var(--pos); }
.ps-msg.err { color: var(--neg); }
@media (max-width: 720px) {
  .ps-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); border-radius: 14px; }
  .ps-top { padding: 8px 8px 0 12px; }
  .ps-top h2 { font-size: 1.1rem; }
  .ps-body {
    grid-template-columns: minmax(0, 1fr) 56px; column-gap: 8px; row-gap: 8px; padding: 8px 8px 12px;
    grid-template-areas: "modes modes" "prev acts" "msg msg" "text text"; grid-template-rows: auto;
  }
  /* Chip nội dung: một hàng; ít mẫu thì chia đều, nhiều mẫu thì cuộn ngang (không cắt chữ) */
  .ps-modes { flex-wrap: nowrap; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .ps-modes::-webkit-scrollbar { display: none; }
  .ps-modes legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ps-modes label { flex: 1 0 auto; }
  .ps-modes span { display: block; text-align: center; padding: 6px 10px; font-size: 12px; white-space: nowrap; }
  .ps-preview { justify-self: start; }
  .ps-preview canvas { width: min(100%, calc((100dvh - 150px) * 0.5625)); }
  .ps-dialog.ps-is-image .ps-preview img { width: 100%; max-height: calc(100dvh - 120px); }
  /* Cột nút biểu tượng cân lề phải, cạnh ảnh */
  .ps-actions { flex-direction: column; flex-wrap: nowrap; align-items: center; justify-self: end; gap: 12px; }
  .ps-act {
    flex-direction: column; gap: 3px; width: 56px; height: auto; padding: 0; border: 0; background: none;
    color: var(--ink-secondary); font-size: 11px; font-weight: 600; white-space: normal; text-align: center; line-height: 1.2;
  }
  .ps-act svg {
    width: 44px; height: 44px; padding: 11px; box-sizing: border-box; border-radius: 50%;
    border: 0; background: var(--brand-soft); color: var(--brand-primary);
  }
  .ps-act:hover, .ps-act.primary, .ps-act.primary:hover { background: none; }
  .ps-act.primary { color: var(--ink-primary); }
  .ps-act.primary svg { background: var(--brand-strong); color: #fff; }
  .ps-act .l-long { display: none; }
  .ps-act .l-short { display: inline; }
  .ps-msg { font-size: 13px; }
}

/* ---------- 10. Đầu trang thống nhất (Xếp hạng · Lịch sử · Nhịp đập) ----------
   Tiêu đề h1 cùng cỡ, không biểu tượng trang trí; mô tả luôn hiện; nút "Tải ảnh" cùng hàng tiêu đề. */
.ranking-h1-title, .hist-h1-title, .pulse-h1-title {
  font-size: clamp(21px, 2.6vw, 28px) !important; font-weight: 800 !important; line-height: 1.25 !important;
  letter-spacing: -0.02em !important; color: var(--ink-primary) !important; gap: 0 !important; margin: 0 0 4px !important;
}
.ranking-award-icon, .hist-title-icon { display: none !important; }
.ranking-header-subtitle, .hist-subtitle, .pulse-page-subtitle {
  display: block !important; font-size: 14px !important; line-height: 1.5 !important; color: var(--ink-muted) !important; margin: 0 !important;
}
.ranking-header-top-row, .pulse-page-title-row {
  display: flex !important; flex-wrap: nowrap !important; align-items: flex-start !important; justify-content: space-between !important; gap: 12px !important;
}
.ranking-header-top-row > :first-child, .pulse-page-title-row > :first-child { min-width: 0; flex: 1 1 auto; }
.ranking-header-actions, .pulse-page-actions { flex: none !important; margin: 0 !important; }
.ps-page-dl {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; flex: none; cursor: pointer; white-space: nowrap;
  border: 0; border-radius: var(--radius-full); background: var(--brand-strong); color: #fff; font: 600 14px var(--font-sans);
}
.ps-page-dl:hover { background: var(--red-700); }
.ps-page-dl svg, .ps-page-dl i { width: 16px; height: 16px; }
@media (max-width: 560px) {
  .ps-page-dl { height: 36px; padding: 0 13px; font-size: 13px; }
  .ranking-header-subtitle, .hist-subtitle, .pulse-page-subtitle { font-size: 13px !important; }
}

/* ---------- 11. Sửa vỡ bố cục trên điện thoại ---------- */
/* Lịch xếp hạng: 5 cột luôn vừa màn hình, ô không bị nội dung đẩy rộng */
.calendar-days-grid, .calendar-weekdays-row { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
.cal-day-cell { min-width: 0 !important; overflow: hidden; }
.cal-top-broker-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .cal-broker-count-pill { font-size: 0 !important; }
  .cal-broker-count-pill strong { font-size: 12px !important; }
  .cal-top-broker-logo { display: none !important; }
}
/* Khối mời dự báo Nhịp đập luôn ở cuối trang Xếp hạng/Lịch sử (trước đây chen lên trên tiêu đề trang ở mobile) */
.ranking-page-wrap > .market-pulse-bottom-widget, .history-view-container > .market-pulse-bottom-widget { order: 99 !important; }
/* Hồ sơ CTCK — nhật ký lệnh: điện thoại hiển thị mỗi lệnh thành thẻ 3 hàng, không kéo ngang 10 cột */
.journal-table code { font-family: var(--font-sans); background: none; padding: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 720px) {
  .journal-table-wrap { overflow: visible !important; }
  .journal-table, .journal-table tbody { display: block !important; width: 100% !important; min-width: 0 !important; }
  .journal-table thead { display: none !important; }
  .journal-table tr {
    display: grid !important; grid-template-columns: 1fr 1fr auto; gap: 6px 10px; align-items: center;
    padding: 12px 4px !important; border-bottom: 1px solid var(--line-normal); background: none !important;
  }
  .journal-table td { display: block !important; padding: 0 !important; border: 0 !important; white-space: nowrap; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .journal-table td:nth-child(1) { order: 1; } .journal-table td:nth-child(2) { order: 2; }
  .journal-table td:nth-child(8) { order: 3; justify-self: end; }
  .journal-table td:nth-child(3) { order: 4; } .journal-table td:nth-child(4) { order: 5; } .journal-table td:nth-child(5) { order: 6; justify-self: end; }
  .journal-table td:nth-child(6) { order: 7; } .journal-table td:nth-child(7) { order: 8; } .journal-table td:nth-child(9) { order: 9; justify-self: end; }
  .journal-table td:nth-child(10) { order: 10; grid-column: 1 / -1; white-space: normal !important; max-width: none !important; font-size: 12.5px !important; }
  .journal-table td:nth-child(3)::before { content: "Vào "; } .journal-table td:nth-child(4)::before { content: "TP "; }
  .journal-table td:nth-child(5)::before { content: "SL "; } .journal-table td:nth-child(6)::before { content: "Khớp "; }
  .journal-table td:nth-child(7)::before { content: "Đóng "; }
  .journal-table td::before { color: var(--ink-muted); font-weight: 500; font-size: 12px; }
}
/* Trang chủ — thanh giá VN30F1M thu gọn: H/L xuống hàng dưới khi không đủ chỗ thay vì tràn khỏi màn hình */
@media (max-width: 480px) {
  .chart-mobile-left { flex-wrap: wrap !important; row-gap: 2px !important; }
  .chart-mob-left-sub { margin-left: 0 !important; flex-basis: 100%; }
}
.pulse-cross-tag { font-size: 11px !important; }
/* Nhịp đập một trang: bỏ hàng tab, các phần nối tiếp với tiêu đề khối + nút Tải ảnh nhỏ */
.pulse-subnav-pills { display: none !important; }
#view-pulse .pulse-header-share-btn { display: none !important; } /* trùng nút Tải ảnh đầu trang */
.pulse-dch-icon { display: none !important; }
.ps-pulse-section { margin-top: 28px; }
.ps-pulse-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ps-pulse-sec-head .section-title { margin: 0; font-size: 19px; }
@media (max-width: 560px) { .ps-pulse-sec-head .section-title { font-size: 17px; } }
.ps-sec-dl {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; flex: none; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--brand-primary); border-radius: var(--radius-full); background: var(--brand-soft);
  color: var(--brand-primary); font: 600 13px var(--font-sans);
}
.ps-sec-dl:hover { background: var(--brand-primary); color: #fff; }
.ps-sec-dl svg, .ps-sec-dl i { width: 15px; height: 15px; }
/* Phân tích / Hồ sơ: đầu khối một hàng (tiêu đề trái, nút tải ảnh phải), thẻ gọn, biểu đồ không chừa chiều cao thừa */
.section-head { flex-wrap: nowrap !important; align-items: center !important; margin-bottom: 10px !important; padding-bottom: 8px !important; }
.section-title-wrap { min-width: 0; flex: 1 1 auto; }
.section-actions { flex: none; margin: 0 !important; }
#chartTrendLine, #chartCumulativePnL, #chartRaceBar, #chartRadar { min-height: 0 !important; }
.broker-chips-wrap { margin-bottom: 6px !important; }
@media (max-width: 720px) {
  .section-block { padding: 12px 10px !important; margin-bottom: 12px !important; }
}
/* Một nút "Tải ảnh" duy nhất trên header mỗi trang (mở hộp thoại có đủ mẫu ảnh của trang).
   Ẩn các nút tải rải rác trong trang; giữ nút trong cửa sổ chi tiết (CTCK, bảng người chơi) vì gắn với nội dung đang mở. */
#pulseHeaderShareBtn, #pulseShareActionBtn, #btnDownloadAdvChart, #btnDownloadDedicatedChart,
#btnDownloadHistMonth, #btnDownloadCalRankingMonth, #btnShareRanking, #pulseDedicatedShareBtn,
#btnDownloadPulseHistoryStats, #btnDownloadPulseLeaderboard, .ps-sec-dl,
#btnDownloadProfileCard, #btnDownloadEquityChart, #btnDownloadJournal,
#sectionTrend .section-actions .btn-chart-icon-action, #sectionPnL .section-actions .btn-chart-icon-action,
#sectionRace .section-actions .btn-chart-icon-action, #sectionTable .section-actions .btn-chart-icon-action,
#sectionRadar .section-actions .btn-chart-icon-action, #sectionHeatmap .section-actions .btn-chart-icon-action,
.btn-chart-icon-action[onclick^="downloadBrandedChartImage"] { display: none !important; }
/* ---------- Bản tin: đầu trang theo mẫu .report-head + .kpis của oi ----------
   Nhãn đỏ IN HOA · tiêu đề lớn · đoạn dẫn không khung · dải chỉ số con số lớn chia bằng vạch mảnh. */
.today-hero-eyebrow .eyebrow-market-tag { font-size: 12.5px !important; letter-spacing: .07em !important; background: none !important; border: 0 !important; padding: 0 !important; color: var(--brand-primary) !important; text-transform: uppercase; font-weight: 700 !important; }
.today-hero-eyebrow .today-date-badge { background: none !important; border: 0 !important; padding: 0 !important; border-radius: 0 !important; color: var(--brand-primary) !important; font-size: 12.5px !important; font-weight: 700 !important; letter-spacing: .07em !important; text-transform: uppercase !important; }
.today-title-row { display: block !important; margin-bottom: 6px !important; }
.today-headline { font-size: clamp(1.55rem, 1.05rem + 2vw, 2.35rem) !important; line-height: 1.15 !important; letter-spacing: -0.025em !important; margin: 0 0 4px !important; }
.today-summary-box { background: none !important; border: 0 !important; border-radius: 0 !important; padding: 0 !important; margin: 8px 0 0 !important; box-shadow: none !important; }
.today-summary-box::before { display: none !important; }
.today-summary-text { font-size: 1.02rem !important; line-height: 1.6 !important; color: var(--ink-secondary) !important; max-width: 75ch; }
.bt-kpis {
  display: grid !important; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 0 !important;
  margin: 14px 0 4px !important; padding: 0 !important; width: 100%;
  border-top: 1px solid var(--line-normal); border-bottom: 1px solid var(--line-normal); background: none !important;
}
.bt-kpis .sentiment-counts-strip { display: contents !important; }
.bt-kpi {
  display: flex !important; flex-direction: column !important; align-items: flex-start !important; gap: 3px !important;
  padding: 14px 18px !important; margin: 0 !important; min-width: 0; position: relative;
  background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; white-space: nowrap;
}
.bt-kpis > .bt-kpi:first-child { padding-left: 0 !important; }
.bt-kpis .sentiment-counts-strip .bt-kpi { border-left: 1px solid var(--line-normal) !important; }
.bt-kpi-lbl { font-size: 12px; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .05em; }
.bt-kpi-val { font-size: clamp(1.4rem, 1.05rem + 1.1vw, 2rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; color: var(--ink-primary); font-variant-numeric: tabular-nums; }
.bt-kpi-sub { font-size: 12.5px; color: var(--ink-muted); }
.sentiment-long .bt-kpi-val, .stat-long .bt-kpi-val { color: var(--pos) !important; }
.sentiment-short .bt-kpi-val, .stat-short .bt-kpi-val { color: var(--neg) !important; }
.sentiment-neutral .bt-kpi-val, .stat-neutral .bt-kpi-val { color: var(--ink-secondary) !important; }
@media (max-width: 720px) {
  .bt-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bt-kpis .today-sentiment-pill { grid-column: 1 / -1; flex-direction: row !important; align-items: baseline !important; justify-content: space-between !important; padding: 10px 0 !important; border-bottom: 1px solid var(--line-normal) !important; }
  .bt-kpis .sentiment-counts-strip .bt-kpi { padding: 10px 12px !important; }
  .bt-kpis .sentiment-counts-strip .bt-kpi:first-child { border-left: 0 !important; padding-left: 0 !important; }
  .bt-kpi-sub { display: none; }
  .bt-kpi-val { font-size: 1.45rem; }
  .today-summary-text { font-size: .96rem !important; }
}
/* ---------- Nhịp đập ở trang chủ: ô nổi góc màn hình trên máy tính (không trải hết bề rộng) ----------
   1100–2079 px: nổi góc phải dưới, mặc định thu gọn thành thanh nhỏ, bấm để mở.
   ≥ 2080 px: nằm trong lề phải, mở sẵn, không che nội dung. Điện thoại: giữ thẻ trong luồng trang. */
@media (min-width: 1100px) {
  #pulseHomeSlot > .market-pulse-card.ps-dock {
    position: fixed !important; right: 24px; bottom: 24px; width: 372px; max-width: calc(100vw - 48px);
    margin: 0 !important; z-index: 950; border-radius: 18px !important; overflow: auto;
    max-height: calc(100vh - 120px); background: var(--bg-surface) !important;
    border: 1px solid var(--line-normal) !important; border-top: 3px solid var(--brand-primary) !important;
    box-shadow: 0 22px 50px -14px rgba(17, 17, 17, .38), 0 2px 8px rgba(17, 17, 17, .08) !important;
    animation: psDockIn .28s ease-out;
  }
  .ps-dock .market-pulse-header { flex-wrap: wrap !important; gap: 8px !important; padding: 14px 16px 10px !important; }
  .ps-dock .market-pulse-header-right { gap: 6px !important; flex-wrap: wrap; }
  .ps-dock #pulseHeaderProof, .ps-dock .market-pulse-contract { display: none !important; }
  .ps-dock .pulse-body-collapse { padding: 0 16px 14px !important; }
  .ps-dock .market-pulse-options-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .ps-dock .market-pulse-actions-row { flex-wrap: wrap !important; gap: 6px !important; justify-content: flex-start !important; }
  /* Ô nổi chỉ có MỘT mục tiêu: mời bấm bình chọn. Ẩn cột "Kết quả hôm nay", bỏ khung/tiêu đề/chân lặp lại
     (tiêu đề ô nổi đã có ngày + "Đang mở"); chỉ giữ câu hỏi, 2 nút XANH/ĐỎ lớn, số người & giờ khóa, tỷ lệ/khóa tỷ lệ. */
  .ps-dock { overflow-x: hidden !important; }
  .ps-dock .pulse-split-grid { display: block !important; margin: 4px 0 0 !important; }
  .ps-dock .pulse-split-col.col-today,
  .ps-dock .col-tomorrow .pulse-split-header,
  .ps-dock .col-tomorrow .pulse-split-footer,
  .ps-dock .col-tomorrow .market-pulse-proof,
  .ps-dock .col-tomorrow .pulse-split-body > div[style*="dashed"],
  .ps-dock .col-tomorrow .pulse-split-body > div:has(> .pulse-profile-edit-btn) { display: none !important; }
  .ps-dock .pulse-split-col.col-tomorrow { min-width: 0; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: none !important; }
  .ps-dock .col-tomorrow .market-pulse-meta-row { order: 2; justify-content: center !important; margin: 0 0 10px !important; }
  .ps-dock .col-tomorrow .pulse-split-body { display: flex; flex-direction: column; }
  .ps-dock .col-tomorrow .pulse-split-question { font-size: 16px !important; margin-bottom: 12px !important; }
  .ps-dock .pulse-split-vote-btns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: 8px !important; margin-bottom: 10px !important; }
  .ps-dock .pulse-split-btn {
    min-width: 0; min-height: 56px !important; border: 0 !important; border-radius: 14px !important; color: #fff !important;
    font-size: 15px !important; white-space: nowrap; padding: 0 8px !important; gap: 7px !important;
  }
  .ps-dock .pulse-split-btn.btn-up { background: linear-gradient(135deg, #087040 0%, #12a05a 100%) !important; box-shadow: 0 10px 22px -10px rgba(11, 125, 68, .75) !important; }
  .ps-dock .pulse-split-btn.btn-down { background: linear-gradient(135deg, #c22f1a 0%, #f0634a 100%) !important; box-shadow: 0 10px 22px -10px rgba(210, 57, 34, .75) !important; }
  .ps-dock .pulse-split-btn:hover:not(:disabled) { color: #fff !important; transform: translateY(-2px); filter: brightness(1.05); }
  .ps-dock .pulse-split-btn .btn-sym {
    flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px;
    background: rgba(255, 255, 255, .22); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35);
  }
  .ps-dock .col-tomorrow .pulse-split-body > div[style*="text-align:center"] { order: 3; margin-bottom: 4px !important; }
  .ps-dock .col-tomorrow .pulse-split-body > div[style*="margin-top:auto"] { order: 4; margin-top: 4px !important; }
  .ps-dock.is-collapsed { width: 340px; cursor: pointer; }
  .ps-dock.is-collapsed .market-pulse-header { padding: 12px 14px !important; }
}
@media (min-width: 2080px) {
  #pulseHomeSlot > .market-pulse-card.ps-dock { right: calc((100vw - 1280px) / 2 - 372px - 28px); bottom: auto; top: 150px; }
}
@keyframes psDockIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Nút dự báo XANH / ĐỎ: nút đặc, gradient, mũi tên trong ô tròn, dòng phụ, ánh sáng lướt ---------- */
.market-pulse-btn {
  position: relative !important; overflow: hidden !important; isolation: isolate;
  display: grid !important; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; justify-items: start;
  min-height: 64px !important; padding: 10px 16px !important; border: 0 !important; border-radius: 16px !important;
  color: #fff !important; text-align: left !important; cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease !important;
}
.market-pulse-btn.opt-up { background: linear-gradient(135deg, #087040 0%, #12a05a 100%) !important; box-shadow: 0 10px 22px -10px rgba(11, 125, 68, .75) !important; }
.market-pulse-btn.opt-down { background: linear-gradient(135deg, #c22f1a 0%, #f0634a 100%) !important; box-shadow: 0 10px 22px -10px rgba(210, 57, 34, .75) !important; }
.market-pulse-btn .opt-symbol {
  grid-row: 1 / span 2; width: 38px; height: 38px; border-radius: 50%; display: grid !important; place-items: center;
  background: rgba(255, 255, 255, .22); color: #fff !important; font-size: 15px !important; line-height: 1;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35);
}
.market-pulse-btn .opt-label { color: #fff !important; font-size: 20px !important; font-weight: 800 !important; letter-spacing: .06em; line-height: 1.1; }
.market-pulse-btn.opt-up .opt-label::after, .market-pulse-btn.opt-down .opt-label::after {
  display: block; margin-top: 3px; font-size: 12px; font-weight: 600; letter-spacing: 0; opacity: .88; text-transform: none; white-space: nowrap;
}
.market-pulse-btn.opt-up .opt-label::after { content: "Đóng trên TC"; }
.market-pulse-btn.opt-down .opt-label::after { content: "Đóng dưới TC"; }
.market-pulse-btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 48%, transparent 66%);
  transform: translateX(-120%); animation: psVoteShine 3.6s ease-in-out infinite;
}
.market-pulse-btn.opt-down::before { animation-delay: 1.8s; }
.market-pulse-btn:hover:not(:disabled) { transform: translateY(-2px); filter: saturate(1.08) brightness(1.04); }
.market-pulse-btn.opt-up:hover:not(:disabled) { box-shadow: 0 14px 28px -10px rgba(11, 125, 68, .85) !important; }
.market-pulse-btn.opt-down:hover:not(:disabled) { box-shadow: 0 14px 28px -10px rgba(210, 57, 34, .85) !important; }
.market-pulse-btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.market-pulse-btn:focus-visible { outline: 3px solid var(--brand-primary) !important; outline-offset: 3px; }
.market-pulse-btn:disabled { cursor: default; filter: grayscale(.35); opacity: .6; box-shadow: none !important; }
.market-pulse-btn:disabled::before { display: none; }
.market-pulse-btn.is-selected { opacity: 1 !important; filter: none !important; box-shadow: 0 0 0 3px var(--bg-surface), 0 0 0 5px currentColor !important; }
.market-pulse-btn.opt-up.is-selected { color: #0b7d44 !important; } .market-pulse-btn.opt-down.is-selected { color: #d23922 !important; }
.market-pulse-btn.is-selected .opt-label, .market-pulse-btn.is-selected .opt-symbol { color: #fff !important; }
.market-pulse-btn.is-selected .opt-label::after { content: "Bạn đã chọn"; }
@media (prefers-reduced-motion: reduce) { .market-pulse-btn::before { animation: none; } .ps-dock { animation: none !important; } }

/* Khối Nhịp đập: 3 nút "Trang riêng · Lịch sử · Bảng xếp hạng" gom thành MỘT liên kết chữ
   (trang /nhip-dap đã gộp kết quả, xếp hạng, lịch sử) — không còn hàng nút vỡ 2 dòng trên điện thoại */
#pulseHistoryLinkBtn, #pulseLeaderboardBtn { display: none !important; }
.market-pulse-actions-row { justify-content: flex-end !important; flex-wrap: nowrap !important; padding-top: 10px !important; border-top: 1px solid var(--line-normal); margin-top: 12px; }
#pulseDedicatedLink {
  display: inline-flex !important; align-items: center; gap: 6px; padding: 0 !important; height: auto !important;
  background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
  color: var(--brand-primary) !important; font-weight: 700 !important; font-size: 13.5px !important; white-space: nowrap; text-decoration: none;
}
#pulseDedicatedLink:hover span { text-decoration: underline; text-underline-offset: 3px; }
#pulseDedicatedLink svg { transition: transform .15s ease; } #pulseDedicatedLink:hover svg { transform: translateX(3px); }
#view-pulse .market-pulse-actions-row { display: none !important; }
#marketPulseSection:not(.ps-dock) #pulseProofText { display: none !important; } /* "N dự báo" đã có trên hàng tiêu đề */
/* ---------- Hồ sơ CTCK ---------- */
/* Menu điện thoại: logo đã có trên header → bỏ logo to trong menu, chỉ giữ nút đóng */
.mobile-nav-header .mobile-nav-logo { display: none !important; }
.mobile-nav-header { justify-content: flex-end !important; padding: 8px 12px !important; min-height: 0 !important; }
.mobile-nav-header .mobile-nav-close { margin-left: auto !important; width: 40px; height: 40px; border-radius: var(--radius-full) !important; border: 1px solid var(--line-normal) !important; background: var(--bg-surface) !important; display: grid !important; place-items: center; }
/* Khối Nhịp đập nhúng (Hồ sơ, Phân tích): nút XANH/ĐỎ cùng kiểu nút đặc gradient của trang chủ */
.pulse-vote-btn.btn-up, .pulse-vote-btn.btn-down {
  border: 0 !important; color: #fff !important; border-radius: 14px !important; min-height: 52px; font-weight: 800 !important;
  display: flex !important; align-items: center; justify-content: center; gap: 8px; transition: transform .15s ease, box-shadow .15s ease;
}
.pulse-vote-btn.btn-up { background: linear-gradient(135deg, #087040 0%, #12a05a 100%) !important; box-shadow: 0 8px 18px -10px rgba(11, 125, 68, .75) !important; }
.pulse-vote-btn.btn-down { background: linear-gradient(135deg, #c22f1a 0%, #f0634a 100%) !important; box-shadow: 0 8px 18px -10px rgba(210, 57, 34, .75) !important; }
.pulse-vote-btn.btn-up *, .pulse-vote-btn.btn-down * { color: #fff !important; }
.pulse-vote-btn .pulse-vote-emoji { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .22); font-size: 12px; }
.pulse-vote-btn:hover:not(:disabled) { transform: translateY(-2px); }

/* Thẻ CTCK: logo nhỏ cạnh tên, huy hiệu một hàng cuộn được, nút bên dưới */
.broker-hero-card .broker-identity { display: flex !important; align-items: flex-start !important; gap: 14px !important; }
.broker-hero-card .broker-hero-logo { width: 60px !important; height: 60px !important; flex: none; padding: 6px !important; border: 1px solid var(--line-normal); border-radius: 14px !important; }
.broker-hero-card .broker-hero-info { min-width: 0; flex: 1 1 auto; }
.broker-hero-card .broker-hero-info h1 { display: flex !important; align-items: baseline; flex-wrap: wrap; gap: 4px 10px !important; margin: 0 0 8px !important; font-size: clamp(20px, 2.2vw, 28px) !important; line-height: 1.2 !important; }
.broker-hero-card .broker-hero-code { font-size: 13px !important; padding: 2px 8px !important; border-radius: 6px !important; }
.broker-hero-card .broker-badges-row { display: flex !important; flex-wrap: wrap !important; gap: 6px !important; }
.broker-hero-card .badge-hero { font-size: 12.5px !important; padding: 4px 10px !important; border-radius: var(--radius-full) !important; white-space: nowrap; }
.broker-hero-card .broker-hero-actions { margin-top: 14px !important; }
.broker-hero-card .badge-streak.is-losing { background: var(--neg-bg) !important; color: var(--neg) !important; border-color: var(--neg-border) !important; }
@media (max-width: 720px) {
  .broker-hero-card { padding: 16px !important; }
  .broker-hero-card .broker-hero-top { display: block !important; }
  .broker-hero-card .broker-hero-logo { width: 52px !important; height: 52px !important; }
}

/* Khuyến nghị phiên: mỗi kịch bản một thẻ gọn (hàng đầu + 3 số), không emoji, không "đ" sau giá */
#signalBadgeWrap:empty { display: none !important; }
.hs-scenarios { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.hs-scn { border: 1px solid var(--line-normal); border-left: 4px solid var(--line-strong); border-radius: 14px; padding: 12px 14px; background: var(--bg-surface); }
.hs-scn.hs-long { border-left-color: var(--pos); }
.hs-scn.hs-short { border-left-color: var(--neg); }
.hs-scn-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.hs-scn-idx { font-size: 12.5px; font-weight: 600; color: var(--ink-muted); }
.hs-scn-side { font-size: 13px; font-weight: 800; letter-spacing: .04em; padding: 3px 9px; border-radius: 6px; }
.hs-long .hs-scn-side { color: var(--pos); background: var(--pos-bg); }
.hs-short .hs-scn-side { color: var(--neg); background: var(--neg-bg); }
.hs-obs .hs-scn-side { color: var(--ink-secondary); background: var(--bg-surface-2); }
.hs-scn-status { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--ink-muted); white-space: nowrap; }
.hs-scn-status.status-win { color: var(--pos); } .hs-scn-status.status-loss { color: var(--neg); }
.hs-scn-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hs-scn-nums div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hs-scn-nums span { font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.hs-scn-nums strong { font-size: 20px; font-weight: 800; color: var(--ink-primary); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-scn-nums strong.pos { color: var(--pos); } .hs-scn-nums strong.neg { color: var(--neg); }
.hs-scn-note { margin: 10px 0 0; padding-top: 8px; border-top: 1px dashed var(--line-normal); font-size: 13px; line-height: 1.5; color: var(--ink-secondary); }

/* Tooltip giải thích: trên điện thoại hiện cố định cuối màn hình, không tràn ra ngoài */
@media (max-width: 720px) {
  .info-tooltip-box {
    position: fixed !important; left: 12px !important; right: 12px !important; bottom: 96px !important; top: auto !important;
    width: auto !important; max-width: none !important; transform: none !important; z-index: 2000 !important;
    font-size: 13px !important; padding: 10px 14px !important; border-radius: 10px !important;
  }
  .info-tooltip-box::after, .info-tooltip-box::before { display: none !important; }
}

/* ---------- Trang chủ điện thoại: dải KPI, khối giá, thẻ khuyến nghị ---------- */
@media (max-width: 720px) {
  /* Dải KPI: số căn giữa từng ô, không viền dưới (tránh trùng viền thẻ bên dưới) */
  .bt-kpis { border-bottom: 0 !important; }
  .bt-kpis .sentiment-counts-strip .bt-kpi { align-items: center !important; text-align: center; padding: 10px 6px 4px !important; }
  .bt-kpis .sentiment-counts-strip .bt-kpi:first-child { padding-left: 6px !important; }
}

/* Khối giá VN30F1M (điện thoại): không khung; hàng 1 giá + nút Biểu đồ; hàng 2 nến nằm ngang */
@media (max-width: 767px) {
  .chart-mobile-bar {
    background: none !important; border: 0 !important; box-shadow: none !important; padding: 4px 2px 10px !important;
    display: grid !important; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main btn" "range range"; align-items: center; gap: 10px 12px !important;
  }
  .chart-mobile-left { display: contents !important; }
  .chart-mob-left-main { grid-area: main; }
  .chart-mobile-bar #miniChartHlRow { display: none !important; }
  .chart-mobile-bar .btn-chart-collapse-toggle {
    grid-area: btn; width: auto !important; height: 34px !important; padding: 0 12px !important; margin: 0 !important;
    border: 1px solid var(--line-strong) !important; border-radius: var(--radius-full) !important; background: var(--bg-surface) !important;
    color: var(--ink-secondary) !important; font-size: 13px !important; font-weight: 700 !important; gap: 5px !important; box-shadow: none !important;
  }
  .mini-range { grid-area: range; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
  .mini-range[hidden] { display: none; }
  .mini-range-lbl { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .mini-range-lbl.lo { color: var(--neg); } .mini-range-lbl.hi { color: var(--pos); }
  .mini-range-track { position: relative; height: 18px; }
  .mini-range-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; transform: translateY(-50%); background: var(--line-strong); border-radius: 2px; }
  .mini-range-body { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; }
  .mini-range-body.up { background: var(--pos); } .mini-range-body.down { background: var(--neg); }
  .mini-range-o, .mini-range-c { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); }
  .mini-range-o { background: var(--bg-surface); border: 2px solid var(--ink-secondary); }
  .mini-range-c { border: 2px solid var(--bg-surface); box-shadow: 0 0 0 1px var(--line-strong); }
  .mini-range-c.up { background: var(--pos); } .mini-range-c.down { background: var(--neg); }
}

/* Thẻ khuyến nghị (điện thoại): chip "N kịch bản" nhạt; LONG/SHORT cùng độ rộng, thẳng lề phải; mũi tên ở hàng dưới */
.rec-multi-badge {
  background: var(--bg-surface-2) !important; color: var(--ink-muted) !important; border: 0 !important;
  font-weight: 600 !important; font-size: 12px !important; padding: 2px 8px !important; border-radius: var(--radius-full) !important;
}
.rec-mob-badge-group { justify-content: flex-end !important; }
.rec-mob-badge-group > * { min-width: 96px; justify-content: center !important; text-align: center; }
.rec-mob-result { display: flex !important; align-items: center !important; justify-content: flex-end; gap: 8px !important; }
.rec-mob-result .rec-mob-chevron { color: var(--ink-muted); flex: none; }

/* Không cho nút, nhãn ngắn xuống dòng vô lý */
.pulse-vote-btn, .btn-journal-expand, .ranking-meta-pill, .seg button, .chip { white-space: nowrap; }
.pulse-vote-btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 9. Chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- 12. Bố cục phẳng (11/2026) ----------
   Theo mẫu trang Nhịp đập: tiêu đề trang và các phần lớn nằm thẳng trên nền trang (không khung, không bóng),
   phân tách bằng tiêu đề có vạch đỏ và khoảng trắng. Chỉ giữ khung cho nội dung thật sự là thẻ
   (podium, kịch bản Long/Short, bảng, ô lịch). */
.today-chart-card,
.ranking-hero-header, .ranking-period-container, .podium-section, .ranking-table-section, .calendar-ranking-section,
.hist-hero-header, .hist-calendar-card, .hist-notable-section,
.broker-hero-card, .today-signal-card, .section-block {
  background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
}
.ranking-hero-header::before, .ranking-hero-header::after, .hist-hero-header::before, .hist-hero-header::after,
.broker-hero-card::before, .today-signal-card::before, .section-block::before, .today-chart-card::before { display: none !important; }
.ranking-hero-header, .hist-hero-header, .broker-hero-card { padding: 0 !important; margin-bottom: 20px !important; }
.podium-section, .ranking-table-section, .calendar-ranking-section, .hist-calendar-card, .hist-notable-section,
.today-signal-card, .section-block { padding-left: 0 !important; padding-right: 0 !important; }
.today-hero-section { padding-left: 0 !important; padding-right: 0 !important; padding-top: 4px !important; }
.today-chart-card .chart-container { padding-left: 0 !important; padding-right: 0 !important; }

/* Dải chọn kỳ xếp hạng: tab gạch chân thay vì 5 ô có khung */
.ranking-period-container { padding: 0 !important; border-bottom: 1px solid var(--line-normal) !important; gap: 0 !important; }
.ranking-period-tab {
  border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0 !important;
  background: transparent !important; box-shadow: none !important; margin-bottom: -1px;
}
.ranking-period-tab.active { border-bottom-color: var(--brand-primary) !important; color: var(--brand-primary) !important; }
.ranking-period-tab.active * { color: inherit; }

/* Ô số liệu: bỏ khung, chia cột bằng đường kẻ mảnh như dải KPI trang chủ */
.ranking-summary-card, .summary-mini-card {
  background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
  border-left: 1px solid var(--line-normal) !important; padding-top: 4px !important; padding-bottom: 4px !important;
}
.ranking-summary-card:first-child, .summary-mini-card:first-child { border-left: 0 !important; padding-left: 0 !important; }
.ranking-summary-card .summary-card-footer { border-top: 0 !important; }
.ranking-meta-strip, .hist-stats-strip, #signalOverviewWrap, .equity-sim-integrated { border-top: 0 !important; }

/* Khối phụ bên trong: chỉ giữ nền nhạt, bỏ viền */
.podium-stats-grid, .cal-stat-chip, .calendar-grid-wrap, .hist-stat-chip, .hist-month-controls, .calendar-month-controls,
.sim-config-panel, .sim-results-panel, .sim-metric-item, .dna-card { border-color: transparent !important; box-shadow: none !important; }
.hist-stat-chip { background: var(--bg-soft) !important; }
.hist-notable-item { border: 0 !important; border-bottom: 1px solid var(--line-normal) !important; border-radius: 0 !important; background: transparent !important; }
.hist-notable-item:last-child { border-bottom: 0 !important; }
.podium-card { box-shadow: none !important; }
@media (max-width: 720px) {
  .ranking-summary-card, .summary-mini-card { border-left: 0 !important; padding-left: 0 !important; border-top: 1px solid var(--line-normal) !important; }
}

/* Breadcrumb "Trang chủ / …" chỉ còn ở trang con (Nhịp đập › Lịch sử/Bảng xếp hạng). Trang cấp 1 đã có menu trên đánh dấu vị trí;
   SEO dùng JSON-LD BreadcrumbList (index.html › syncBreadcrumbLd) nên không cần hiển thị. */
#view-ranking .ranking-breadcrumb, #view-pulse .ranking-breadcrumb { display: none !important; }

/* Hộp thoại Tải ảnh (máy tính): bấm ảnh xem trước để phóng to */
@media (min-width: 721px) and (pointer: fine) {
  .ps-preview canvas, .ps-preview img { cursor: zoom-in; transition: box-shadow .15s ease; }
  .ps-preview:hover canvas, .ps-preview:hover img { box-shadow: 0 0 0 2px var(--brand-primary); }
}
.ps-zoom {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px;
  background: rgba(17, 17, 17, .82); cursor: zoom-out;
}
.ps-zoom[hidden] { display: none !important; }
.ps-zoom img { max-width: calc(100vw - 48px); max-height: calc(100dvh - 48px); width: auto; height: auto; border-radius: 8px; box-shadow: var(--shadow-xl); }

/* Ô nổi Nhịp đập: nút × cố định góc phải trên, kéo thả bằng thanh tiêu đề (index.html › initPulseDockChrome) */
.ps-dock-close { display: none; }
@media (min-width: 1100px) {
  #pulseHomeSlot > .market-pulse-card.ps-dock.ps-dock-hidden { display: none !important; }
  .ps-dock .ps-dock-close {
    display: grid; place-items: center; position: absolute; top: 8px; right: 8px; z-index: 2;
    width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
    background: transparent; color: var(--ink-muted);
  }
  .ps-dock .ps-dock-close:hover { background: var(--bg-soft); color: var(--ink-primary); }
  .ps-dock .ps-dock-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
  .ps-dock .market-pulse-header { padding-right: 44px !important; cursor: grab; user-select: none; touch-action: none; }
  .ps-dock.ps-dock-dragging { animation: none !important; box-shadow: 0 28px 60px -12px rgba(17, 17, 17, .45) !important; }
  .ps-dock.ps-dock-dragging .market-pulse-header { cursor: grabbing; }
  /* Đang mở: × thay cho nút "Thu gọn" và nút ẩn cũ, tránh hai nút đóng */
  .ps-dock:not(.is-collapsed) #pulseToggleBtn, .ps-dock #pulseDismissHeaderBtn { display: none !important; }
}

/* ---------- 13. Trang Phân tích: đầu trang + thanh lọc kỳ cùng mẫu các trang khác ----------
   Tiêu đề dùng .pulse-h1-title / .pulse-page-subtitle (mục 10); thanh lọc không còn dính nổi (sticky) dưới header,
   nằm ngay dưới tiêu đề như dải tab gạch chân của trang Xếp hạng, khoảng ngày + số phiên căn phải trên cùng đường kẻ. */
.analytics-hero {
  display: block !important; background: transparent !important; border: 0 !important; border-radius: 0 !important;
  padding: 0 !important; margin: 4px 0 18px !important; box-shadow: none !important;
}
.analytics-hero strong { color: var(--ink-secondary); font-weight: 700; }
.timeframe-bar {
  position: static !important; background: transparent !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  padding: 0 !important; margin: 0 0 24px !important; border-bottom: 1px solid var(--line-normal) !important;
}
.timeframe-inner { align-items: center !important; gap: 12px !important; }
.tf-preset-group { background: transparent !important; border: 0 !important; padding: 0 !important; border-radius: 0 !important; gap: 0 !important; align-self: flex-end; }
.tf-btn {
  border-radius: 0 !important; padding: 10px 16px !important; margin-bottom: -1px; border: 0 !important; border-bottom: 2px solid transparent !important;
  background: transparent !important; box-shadow: none !important; color: var(--ink-muted) !important; font-size: 14px !important; font-weight: 600 !important;
}
.tf-btn:hover { color: var(--ink-primary) !important; }
.tf-btn.active { color: var(--brand-primary) !important; border-bottom-color: var(--brand-primary) !important; font-weight: 700 !important; }
.tf-range-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line-strong); border-radius: var(--radius-full); background: var(--bg-surface);
  color: var(--ink-secondary); font: 600 13px var(--font-sans);
}
.tf-range-btn:hover { color: var(--brand-primary); border-color: var(--brand-primary); }
.tf-date-input { border-color: var(--line-strong) !important; border-radius: var(--radius-sm) !important; height: 32px; }
.tf-summary-badge { background: transparent !important; color: var(--ink-muted) !important; padding: 0 !important; font-weight: 600 !important; }
@media (max-width: 720px) {
  .analytics-hero { margin: 0 0 12px !important; }
  .timeframe-bar { margin-bottom: 16px !important; }
  .timeframe-inner { flex-direction: column-reverse !important; align-items: stretch !important; gap: 8px !important; }
  .timeframe-inner > div:last-child { justify-content: space-between; flex-wrap: wrap; }
  .tf-preset-group { width: 100%; }
  .tf-btn { flex: 1; padding: 10px 2px !important; font-size: 13px !important; }
}
