/* SMART SALES - visual theme v5 ("Liquid glass")
   Palette: VCBF mark (deep green #003A1C, blue #005C95), Vietcombank green #006B3F and lime #8DC63F,
   with a warm gold accent (#C9A24A) for highlights, in the spirit of premium asset-manager sites.
   Font (vendored, offline): Roboto, the typeface of most Vietnamese finance and business news sites
   (full Vietnamese diacritics, tabular numerals for tables and figures).
   Loaded after app.css: overrides tokens and components. Print and "lite" mode switch the effects off. */

:root {
  --green: #006B3F; --green-700: #005A35; --green-800: #003A1C; --green-900: #022615;
  --blue: #005C95; --blue-600: #0B6FB0; --teal: #0E9AA7; --lime: #8DC63F; --gold: #C9A24A;
  --grad-brand: linear-gradient(135deg, #00804A 0%, #006B3F 38%, #005C95 100%);
  --grad-brand-soft: linear-gradient(135deg, rgba(0,128,74,.12), rgba(0,92,149,.12));
  --grad-lime: linear-gradient(135deg, #A6D45A 0%, #8DC63F 50%, #5DB37E 100%);
  --grad-text: linear-gradient(100deg, #003A1C 0%, #006B3F 45%, #005C95 100%);

  --bg: #EDF3F0; --bg-2: #E6EEF2;
  --card: rgba(255,255,255,.72); --card-solid: #FFFFFF; --card-2: rgba(247,251,249,.75);
  --glass-border: rgba(255,255,255,.75); --glass-edge: rgba(0,92,149,.10);
  --text: #0F2219; --muted: #5B6F66; --faint: #8FA29A;
  --line: rgba(15,52,36,.10); --line-2: rgba(15,52,36,.06);
  --tint: rgba(0,107,63,.08); --tint-2: rgba(0,107,63,.04);
  --pos: #0A7F45; --neg: #D03535; --warn: #D98E04; --info: #0B6FB0;
  --input: rgba(255,253,244,.9); --input-line: #E2C76E;
  --shadow: 0 1px 0 rgba(255,255,255,.85) inset, 0 1px 2px rgba(6,40,24,.05), 0 12px 32px -16px rgba(6,40,24,.20);
  --shadow-lg: 0 24px 60px -20px rgba(4,30,18,.35), 0 4px 14px rgba(4,30,18,.08);
  --blur: blur(18px) saturate(170%);
  --radius: 18px; --radius-sm: 11px;

  --font: "Roboto", "Segoe UI", Arial, sans-serif;
  --display: "Roboto", "Segoe UI", Arial, sans-serif;
  --num: "Roboto", "Segoe UI", Arial, sans-serif;

  /* type scale */
  --fs-xs: 11.5px; --fs-sm: 12.5px; --fs-base: 14px; --fs-tbl: 13.5px; --fs-card: 16px; --fs-title: 26px;
}
:root[data-theme="dark"] {
  --bg: #06110D; --bg-2: #071420;
  --card: rgba(16,32,26,.62); --card-solid: #0F1F19; --card-2: rgba(22,42,34,.55);
  --glass-border: rgba(255,255,255,.08); --glass-edge: rgba(141,198,63,.14);
  --text: #E6F0EA; --muted: #9DB3A8; --faint: #6C8478;
  --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.05);
  --tint: rgba(141,198,63,.10); --tint-2: rgba(141,198,63,.05);
  --pos: #52CC86; --neg: #FF7070; --input: rgba(30,46,38,.8); --input-line: #8A7A3A;
  --grad-text: linear-gradient(100deg, #C8EFA0 0%, #8DC63F 40%, #5CB8F0 100%);
  --shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 12px 32px -16px rgba(0,0,0,.6);
}

/* ---------------------------------------------------------------- base */
body { font-family: var(--font); font-size: var(--fs-base); line-height: 1.5; letter-spacing: -.005em;
  background: radial-gradient(1100px 620px at 8% -8%, rgba(141,198,63,.22), transparent 62%),
              radial-gradient(900px 640px at 102% -4%, rgba(0,92,149,.18), transparent 60%),
              radial-gradient(900px 700px at 60% 112%, rgba(0,107,63,.14), transparent 60%),
              linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed; }
:root[data-theme="dark"] body {
  background: radial-gradient(1000px 600px at 6% -10%, rgba(141,198,63,.13), transparent 60%),
              radial-gradient(900px 640px at 100% 0%, rgba(0,92,149,.22), transparent 60%),
              radial-gradient(900px 700px at 55% 115%, rgba(0,107,63,.18), transparent 60%),
              linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); background-attachment: fixed; }
/* slow-moving liquid blobs behind the glass */
body::before, body::after { content: ""; position: fixed; z-index: -1; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(90px); opacity: .32; pointer-events: none; }
body::before { left: 18vw; top: -18vmax; background: radial-gradient(circle at 30% 30%, #8DC63F, transparent 65%); animation: drift1 28s ease-in-out infinite alternate; }
body::after { right: -12vmax; bottom: -20vmax; background: radial-gradient(circle at 60% 40%, #0B6FB0, transparent 65%); animation: drift2 34s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(14vw, 12vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-16vw, -10vh) scale(1.1); } }
.num, .tbl td, .navv, .kpi .v { font-family: var(--num); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "cv11" 1; }
h1, h2, h3, .card-h h3, .profile-name, .brand-text b { font-family: var(--display); }
::selection { background: rgba(141,198,63,.35); }
* { scrollbar-width: thin; scrollbar-color: rgba(0,92,149,.25) transparent; }

/* ---------------------------------------------------------------- sidebar */
.sidebar { background: linear-gradient(170deg, #04241A 0%, #073626 42%, #062B45 100%); box-shadow: 8px 0 40px -18px rgba(0,30,20,.6); overflow: hidden; }
.sidebar::before { content: ""; position: absolute; width: 340px; height: 340px; left: -120px; top: -140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(141,198,63,.35), transparent 65%); pointer-events: none; }
.sidebar::after { content: ""; position: absolute; width: 380px; height: 380px; right: -200px; bottom: -120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(11,111,176,.45), transparent 65%); pointer-events: none; }
.sidebar > * { position: relative; z-index: 1; }
.brand { padding: 22px 20px 20px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark { width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(145deg, #FFFFFF, #E9F2EE);
  box-shadow: 0 8px 22px -6px rgba(0,0,0,.45), inset 0 1px 0 #fff; }
.brand-text b { font-size: 20px; font-weight: 800; letter-spacing: .6px; }
.brand-text span { font-family: var(--display); font-size: 11px; font-weight: 700; letter-spacing: 3px;
  background: linear-gradient(90deg, #B9E27C, #8DC63F 50%, #E2C86E); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav .group { font-family: var(--display); font-size: 10.5px; font-weight: 700; letter-spacing: 1.6px; color: rgba(214,236,224,.42); padding: 16px 12px 6px; }
.nav a { font-size: 14px; color: rgba(222,240,230,.82); padding: 10px 12px; border-radius: 12px; border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s, transform .2s; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; transform: translateX(2px); }
.nav a.active { color: #fff; background: linear-gradient(100deg, rgba(141,198,63,.28) 0%, rgba(141,198,63,.07) 70%, rgba(11,111,176,.10) 100%);
  border-color: rgba(255,255,255,.10); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 18px -10px rgba(0,0,0,.5); backdrop-filter: blur(6px); }
.nav a.active::before { background: linear-gradient(180deg, #B9E27C, #8DC63F); box-shadow: 0 0 12px rgba(141,198,63,.8); }
.nav a .badge { background: var(--grad-lime); color: #05301B; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.07); }
.collapse-btn { border-radius: 10px; }

/* ---------------------------------------------------------------- top bar */
.topbar { background: color-mix(in srgb, var(--card-solid) 55%, transparent); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-border); box-shadow: 0 8px 30px -22px rgba(4,30,18,.35); padding: 16px 30px; }
.topbar h1 { font-size: var(--fs-title); font-weight: 800; letter-spacing: -.6px; line-height: 1.15;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.subtitle { font-size: 13px; margin-top: 3px; }
.stamp { font-size: 12px; }
.stamp b { font-family: var(--num); }
.view { padding: 24px 30px 56px; }

/* ---------------------------------------------------------------- controls */
.btn { border-radius: 12px; padding: 10px 16px; font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-primary { background: var(--grad-brand); background-size: 160% 160%; background-position: 0% 50%; color: #fff; border: 0;
  box-shadow: 0 10px 24px -10px rgba(0,92,149,.65), 0 2px 6px rgba(0,60,35,.18), inset 0 1px 0 rgba(255,255,255,.25);
  transition: background-position .5s ease, box-shadow .25s, transform .12s; }
.btn-primary:hover { background: var(--grad-brand); background-size: 160% 160%; background-position: 100% 50%; box-shadow: 0 14px 30px -10px rgba(0,92,149,.75), inset 0 1px 0 rgba(255,255,255,.3); }
/* light sweep on primary buttons */
.btn-primary::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transition: left .6s ease; pointer-events: none; }
.btn-primary:hover::after { left: 130%; }
.btn-lime { background: var(--grad-lime); color: #04301A; border: 0; box-shadow: 0 8px 20px -10px rgba(93,179,126,.8); }
.btn-ghost { background: var(--card); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 4px 14px -8px rgba(4,30,18,.25); }
.btn-ghost:hover { border-color: rgba(0,107,63,.35); color: var(--green); }
:root[data-theme="dark"] .btn-ghost:hover { color: var(--lime); border-color: rgba(141,198,63,.4); }
.icon-btn { border-radius: 12px; background: var(--card); border: 1px solid var(--glass-border); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 4px 14px -8px rgba(4,30,18,.25); }
.menu { background: color-mix(in srgb, var(--card-solid) 82%, transparent); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-radius: 16px; padding: 8px; min-width: 300px; }
.menu button { font-size: 14px; border-radius: 10px; padding: 10px 12px; }
.menu button:hover { background: var(--grad-brand-soft); }
.menu b { font-family: var(--display); }
.menu .menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.field label { font-size: var(--fs-xs); letter-spacing: .6px; }
.input, select.input, textarea.input { height: 40px; border-radius: 11px; font-size: 14px; background: color-mix(in srgb, var(--card-solid) 80%, transparent); }
.input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 4px rgba(11,111,176,.14); }
.seg { background: color-mix(in srgb, var(--card-solid) 45%, transparent); border: 1px solid var(--glass-border); border-radius: 12px; padding: 4px;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.seg button { font-size: 13px; padding: 6px 13px; border-radius: 9px; }
.seg button.on { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 14px -8px rgba(0,92,149,.8); }
.chip { background: var(--card); border: 1px solid var(--glass-border); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); font-size: 13.5px; padding: 8px 15px 8px 10px;
  box-shadow: 0 4px 12px -8px rgba(4,30,18,.25); }
.chip.on { background: var(--grad-brand); border-color: transparent; box-shadow: 0 10px 22px -10px rgba(0,92,149,.7); }
.chip .logo { box-shadow: none; }

/* ---------------------------------------------------------------- glass cards */
.grid { gap: 20px; }
.mt { margin-top: 20px; }
.card { position: relative; background: var(--card); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow); }
/* gradient hairline edge = the "liquid glass" rim */
.card::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(145deg, rgba(255,255,255,.95), rgba(255,255,255,.1) 38%, var(--glass-edge) 70%, rgba(141,198,63,.28));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
:root[data-theme="dark"] .card::after { background: linear-gradient(145deg, rgba(255,255,255,.18), rgba(255,255,255,.02) 40%, rgba(11,111,176,.25) 75%, rgba(141,198,63,.25)); }
.card-h { padding: 18px 22px 0; }
.card-h h3 { font-size: var(--fs-card); font-weight: 700; letter-spacing: -.2px; }
.card-h h3 .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--grad-lime); box-shadow: 0 0 0 3px rgba(141,198,63,.18); }
.card-h .hint { font-size: var(--fs-sm); }
.card-b { padding: 16px 22px 20px; }
.note { font-size: var(--fs-sm); line-height: 1.55; }
.callout { border-radius: 14px; border-left-width: 4px; background: var(--grad-brand-soft); backdrop-filter: var(--blur); font-size: 14px; display: flex; gap: 12px; align-items: flex-start; }
.callout svg { flex: none; margin-top: 1px; }
.callout.warn { background: linear-gradient(135deg, rgba(217,142,4,.14), rgba(217,142,4,.05)); }
.tag { font-size: 12px; padding: 3px 10px; font-weight: 600; }
.tag.g { background: rgba(10,127,69,.12); }

/* ---------------------------------------------------------------- fund cards */
.fund-card { padding: 18px 20px 14px; }
.fund-card::before { height: 4px; background: linear-gradient(90deg, var(--fc), color-mix(in srgb, var(--fc) 30%, #ffffff)); }
.fund-card:hover { transform: translateY(-5px); box-shadow: 0 26px 50px -24px color-mix(in srgb, var(--fc) 80%, transparent), var(--shadow); }
/* glow that follows the card colour */
.fund-card .glow { position: absolute; width: 180px; height: 180px; right: -60px; top: -70px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--fc) 30%, transparent), transparent 70%); opacity: .7; }
.fund-card .code { font-family: var(--display); font-size: 16px; font-weight: 800; }
.fund-card .fname { font-size: 12.5px; }
.fund-card .navv { font-size: 30px; font-weight: 700; letter-spacing: -1px; margin: 12px 0 2px; }
.fund-card .meta { font-size: 12.5px; }
.fund-card .foot div { font-size: 11.5px; letter-spacing: .3px; }
.fund-card .foot b { font-family: var(--num); font-size: 14px; font-variant-numeric: tabular-nums; }

.kpis { gap: 14px; }
.kpi { background: var(--card); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--glass-border); border-radius: 16px; padding: 14px 16px;
  box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi:hover { border-color: rgba(141,198,63,.6); }
.kpi .k { font-size: var(--fs-xs); letter-spacing: .7px; }
.kpi .v { font-size: 22px; font-weight: 700; letter-spacing: -.4px; margin-top: 4px; }
.kpi .s { font-size: 12.5px; }
.kpi.hero { background: var(--grad-brand); border: 0; box-shadow: 0 22px 44px -22px rgba(0,92,149,.8), inset 0 1px 0 rgba(255,255,255,.2); }
.kpi.hero::before { content: ""; position: absolute; width: 220px; height: 220px; right: -60px; top: -110px; border-radius: 50%; background: radial-gradient(circle, rgba(141,198,63,.55), transparent 70%); }
.kpi.hero::after { content: ""; position: absolute; width: 160px; height: 160px; right: 60px; bottom: -110px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.25), transparent 70%); }
.kpi.hero .v { font-size: 30px; }
.kpi.hero > * { position: relative; z-index: 1; }

.signal { background: var(--card-2); border: 1px solid var(--glass-border); border-radius: 14px; }
.signal p { font-size: 14px; }
.range { height: 10px; background: linear-gradient(90deg, #F2A7A7, #F6E3A6 50%, #9FDCAF); box-shadow: inset 0 1px 2px rgba(0,0,0,.08); }
.range i { width: 18px; height: 18px; margin-left: -9px; top: -4px; border: 3px solid transparent;
  background: linear-gradient(#fff, #fff) padding-box, var(--grad-brand) border-box; box-shadow: 0 4px 10px -2px rgba(0,60,40,.45); }
.range-l { font-size: 12px; }

/* ---------------------------------------------------------------- tables */
table.tbl { font-size: var(--fs-tbl); }
.tbl th { font-family: var(--display); font-size: 11.5px; font-weight: 700; letter-spacing: .6px; padding: 11px 14px;
  background: color-mix(in srgb, var(--card-solid) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 14px; }
.tbl tbody tr:hover { background: linear-gradient(90deg, rgba(141,198,63,.10), rgba(11,111,176,.05)); }
.tbl tbody tr.hl td { background: linear-gradient(90deg, rgba(141,198,63,.16), rgba(141,198,63,.06)); }
.tbl tfoot td { border-top: 2px solid transparent; border-image: var(--grad-brand) 1; }
.tbl td .fund, .tbl td .fcode { font-family: var(--font); }

/* ---------------------------------------------------------------- logos */
.logo { border-radius: 7px; box-shadow: 0 2px 6px -2px rgba(0,40,25,.25); border-color: rgba(0,0,0,.06); }
.logo.lg { border-radius: 10px; }
.logo.mono { background-image: linear-gradient(135deg, rgba(255,255,255,.25), transparent) !important; }

/* ---------------------------------------------------------------- misc components */
.breadcrumb button { border-radius: 10px; background: var(--card); border: 1px solid var(--glass-border); }
.breadcrumb button.cur { background: var(--grad-brand); color: #fff; border-color: transparent; }
.q { background: var(--card-2); border: 1px solid var(--glass-border); border-radius: 14px; }
.q .qt { font-size: 14px; }
.opts button { font-size: 13px; border-radius: 10px; background: var(--card); }
.opts button.on { background: var(--grad-brand); border-color: transparent; }
.profile-name { font-size: 24px; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.steps5 i.cur { background: var(--grad-brand); }
.progress i { background: linear-gradient(90deg, #8DC63F, #006B3F, #0B6FB0); background-size: 200% 100%; animation: flow 2s linear infinite; }
@keyframes flow { to { background-position: -200% 0; } }
.modal { background: rgba(2,20,12,.40); backdrop-filter: blur(8px); }
.modal-card { background: color-mix(in srgb, var(--card-solid) 88%, transparent); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-radius: 22px; }
.modal-h h3 { font-family: var(--display); font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.toast { background: linear-gradient(135deg, rgba(4,36,26,.92), rgba(6,43,69,.92)); backdrop-filter: blur(14px); border-radius: 14px; font-size: 14px; border-left: 0;
  box-shadow: 0 20px 40px -18px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.12); position: relative; overflow: hidden; }
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad-lime); }
.toast.warn::before { background: linear-gradient(#F6C14B, #D98E04); } .toast.err::before { background: linear-gradient(#FF8A8A, #D03535); }
.toast a { color: #B9E27C; }
.src-card { background: var(--card-2); border: 1px solid var(--glass-border); border-radius: 14px; }
.src-card.warn { border-color: rgba(217,142,4,.6); } .src-card.bad { border-color: rgba(208,53,53,.6); box-shadow: 0 0 0 3px rgba(208,53,53,.08); }

/* news */
.news-list { display: flex; flex-direction: column; }
.news-item { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 14px; padding: 12px 22px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--text); transition: background .15s; }
.news-item:last-child { border-bottom: 0; }
.news-item:hover { background: linear-gradient(90deg, rgba(141,198,63,.10), transparent); }
.news-date { text-align: center; border-radius: 12px; padding: 7px 4px; background: var(--grad-brand-soft); border: 1px solid var(--glass-border); align-self: start; }
.news-date b { display: block; font-family: var(--display); font-size: 20px; font-weight: 800; line-height: 1; color: var(--green); }
:root[data-theme="dark"] .news-date b { color: var(--lime); }
.news-date small { font-size: 11px; color: var(--muted); }
.news-title { font-weight: 600; font-size: 14px; line-height: 1.45; }
.news-meta { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.tag.new { background: var(--grad-lime); color: #04301A; }
.fb-frame { width: 100%; border: 0; border-radius: 14px; min-height: 640px; background: var(--card-2); }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 22px; }
.fact { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.fact span { color: var(--muted); } .fact b { text-align: right; font-weight: 600; }
.placeholder { border: 1.5px dashed color-mix(in srgb, var(--blue) 35%, transparent); border-radius: 14px; background: repeating-linear-gradient(135deg, transparent 0 12px, rgba(11,111,176,.04) 12px 24px);
  display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; min-height: 200px; font-size: 13.5px; }
.placeholder b { display: block; color: var(--text); font-family: var(--display); font-size: 15px; margin-bottom: 4px; }

/* export dialog */
.exp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.exp-opt { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 13px; border: 1px solid var(--line); background: var(--card-2); cursor: pointer; transition: border-color .15s, background .15s; font-size: 13.5px; }
.exp-opt:hover { border-color: rgba(0,107,63,.35); }
.exp-opt input { margin-top: 3px; accent-color: var(--green); width: 16px; height: 16px; flex: none; }
.exp-opt b { display: block; font-weight: 600; }
.exp-opt small { color: var(--muted); font-size: 12px; line-height: 1.4; display: block; }
.exp-opt.rec b::after { content: "Khuyên dùng"; margin-left: 6px; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--grad-lime); color: #04301A; vertical-align: 1px; }
.exp-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.exp-h { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }

/* ---------------------------------------------------------------- lite mode (older PCs) and reduced motion */
.lite body::before, .lite body::after { display: none; }
.lite .card, .lite .kpi, .lite .chip, .lite .btn-ghost, .lite .icon-btn, .lite .seg, .lite .topbar, .lite .menu, .lite .modal-card, .lite .tbl th { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.lite { --card: var(--card-solid); }
@media (prefers-reduced-motion: reduce) { body::before, body::after { animation: none; } .view > * { animation: none; } }

@media (max-width: 960px) { .topbar h1 { font-size: 21px; } .exp-grid { grid-template-columns: 1fr; } .news-item { padding: 12px 16px; } }

/* ---------------------------------------------------------------- print: clean, no effects */
@media print {
  body { background: #fff !important; font-size: 11px; }
  body::before, body::after, .card::after, .kpi.hero::before, .kpi.hero::after, .fund-card .glow { display: none !important; }
  .card, .kpi, .signal, .src-card, .q { background: #fff !important; backdrop-filter: none !important; box-shadow: none !important; border: 1px solid #D5DED9 !important; }
  .topbar h1, .profile-name { color: var(--green) !important; background: none !important; }
  .tbl th { background: #F1F5F3 !important; backdrop-filter: none !important; }
  .kpi.hero { background: var(--grad-brand) !important; }
}
.fund-card > *:not(.glow) { position: relative; z-index: 1; }
.fund-card .glow { z-index: 0; }
a.btn { text-decoration: none; }
.kpi .k { white-space: normal; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kpi .s { white-space: normal; line-height: 1.35; }

/* ================================================================ v6: SMART SALES identity
   Pastel golden-brown accents (soft gradients, no saturated fills) next to the emerald/blue base. */
:root {
  --gold-50: #FBF6EC; --gold-100: #F5EAD3; --gold-200: #ECD9B2; --gold-300: #DFC290; --gold-400: #CDA86E; --gold-500: #B98F57;
  --brown-500: #9A774C; --brown-600: #7E5F3B; --brown-700: #624A2F;
  --grad-gold: linear-gradient(135deg, #F7EBCF 0%, #E9D2A3 45%, #D2B07A 100%);
  --grad-gold-soft: linear-gradient(135deg, rgba(247,235,207,.85) 0%, rgba(236,217,178,.55) 100%);
  --grad-gold-text: linear-gradient(100deg, #B98F57 0%, #D9B97F 50%, #9A774C 100%);
  --th-bg: rgba(245,234,211,.55);
}
:root[data-theme="dark"] {
  --grad-gold-soft: linear-gradient(135deg, rgba(205,168,110,.16) 0%, rgba(154,119,76,.10) 100%);
  --grad-gold-text: linear-gradient(100deg, #F1DDB4 0%, #DFC290 50%, #CDA86E 100%);
  --th-bg: rgba(205,168,110,.08);
}
/* warm pastel light in the background, next to the green/blue ones */
body { background: radial-gradient(1100px 620px at 8% -8%, rgba(141,198,63,.18), transparent 62%),
              radial-gradient(900px 640px at 102% -4%, rgba(0,92,149,.16), transparent 60%),
              radial-gradient(1000px 700px at 62% 114%, rgba(223,194,144,.38), transparent 62%),
              linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); background-attachment: fixed; }
:root[data-theme="dark"] body {
  background: radial-gradient(1000px 600px at 6% -10%, rgba(141,198,63,.11), transparent 60%),
              radial-gradient(900px 640px at 100% 0%, rgba(0,92,149,.20), transparent 60%),
              radial-gradient(900px 700px at 55% 115%, rgba(205,168,110,.16), transparent 60%),
              linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); background-attachment: fixed; }

/* brand */
.brand-mark, .brand-mark img { width: 44px; height: 44px; }
.brand-mark { background: none; box-shadow: 0 10px 24px -8px rgba(0,0,0,.55); border-radius: 13px; }
.brand-text b { font-size: 19px; letter-spacing: 1.2px; color: #fff; }
.brand-text b i { font-style: normal; background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-text span { font-size: 10px; letter-spacing: 1.6px; background: linear-gradient(90deg, #EAD6AE, #CDA86E); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav .group { color: rgba(233,210,163,.55); }
.nav a.active::before { background: linear-gradient(180deg, #F3E2BC, #CDA86E); box-shadow: 0 0 12px rgba(223,194,144,.7); }
.nav a .badge { background: var(--grad-gold); color: #4A361F; }

/* accents */
.card-h h3 .dot { background: var(--grad-gold); box-shadow: 0 0 0 3px rgba(205,168,110,.2); }
.stamp b { background: var(--grad-gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.tbl th { background: var(--th-bg); }
.tag.gold, .tag.new { background: var(--grad-gold); color: #5A4128; }
.kpi.hero { box-shadow: 0 22px 44px -22px rgba(0,92,149,.8), inset 0 1px 0 rgba(255,255,255,.2), inset 0 0 0 1px rgba(236,217,178,.35); }
.kpi.hero::before { background: radial-gradient(circle, rgba(236,217,178,.55), transparent 70%); }
.chip.on .logo.mono.vcbf { box-shadow: 0 0 0 1px rgba(255,255,255,.5); }
.btn-gold { background: var(--grad-gold); color: #4A361F; border: 0; box-shadow: 0 8px 20px -10px rgba(154,119,76,.7), inset 0 1px 0 rgba(255,255,255,.5); }
.btn-ghost:hover { border-color: rgba(185,143,87,.45); }
.btn.danger, button.danger { color: var(--neg); }
.sub-h { font-family: var(--display); font-size: 14px; font-weight: 700; margin: 0 0 8px; }
.logo.mono.vcbf { background-image: linear-gradient(135deg, #0E6B4C 0%, #0C3A57 100%) !important; color: #F3E2BC; font-size: 8.5px; letter-spacing: .2px; }
.logo.lg.mono.vcbf { font-size: 11px; }
.kit-brand { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: 1px; color: var(--green-800); }
.kit-brand i { font-style: normal; color: var(--gold-500); }
:root[data-theme="dark"] .kit-brand { color: #E6F0EA; }

/* user menu */
.user-btn { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; border-radius: 999px; cursor: pointer; color: var(--text);
  background: var(--card); border: 1px solid var(--glass-border); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: 0 4px 14px -8px rgba(4,30,18,.25); font: 600 13.5px var(--font); }
.user-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; opacity: .6; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-gold); color: #4A361F; font: 800 12px var(--display); box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu { min-width: 250px; }
.user-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; flex-direction: column; }
.user-head b { font-family: var(--display); } .user-head span { font-size: 12px; color: var(--muted); }
.user-menu .danger { color: var(--neg); }
.user-add { display: grid; grid-template-columns: 1.3fr 1fr 1fr .9fr auto; gap: 12px; align-items: end; }
@media (max-width: 1100px) { .user-add { grid-template-columns: 1fr 1fr; } .user-name { display: none; } }

/* legal notice bar: always visible at the bottom of the screen */
.main { display: flex; flex-direction: column; min-height: 100vh; }
.view { flex: 1; }
.legal-bar { position: sticky; bottom: 0; z-index: 20; display: flex; gap: 8px; align-items: baseline; padding: 9px 30px; font-size: 12px; line-height: 1.45;
  color: var(--brown-700); background: linear-gradient(90deg, rgba(251,246,236,.92), rgba(245,234,211,.92)); border-top: 1px solid rgba(205,168,110,.45);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.legal-bar b { white-space: nowrap; font-family: var(--display); }
.legal-bar span { flex: 1; }
.legal-bar a { white-space: nowrap; color: var(--brown-600); font-weight: 600; }
:root[data-theme="dark"] .legal-bar { color: #EAD6AE; background: linear-gradient(90deg, rgba(40,32,20,.9), rgba(52,40,24,.9)); border-top-color: rgba(205,168,110,.3); }
:root[data-theme="dark"] .legal-bar a { color: #F3E2BC; }
@media (max-width: 960px) { .legal-bar { padding: 8px 16px; font-size: 11.5px; flex-wrap: wrap; } }

/* legal text (modal and page) */
.legal-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 13.5px; line-height: 1.6; }
.legal-list b { font-family: var(--display); }
.legal-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--grad-gold); color: #5A4128; }
.legal-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.legal-lead { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--grad-gold-soft); margin-bottom: 18px; }
.legal-lead p { margin: 0; font-weight: 600; color: var(--brown-700); }
:root[data-theme="dark"] .legal-lead p { color: #F1DDB4; }
.legal-page { max-width: 980px; }
.legal-modal { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 20px; background: rgba(4,24,16,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.legal-card { width: min(760px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: 20px; overflow: hidden;
  background: var(--card-solid); box-shadow: var(--shadow-lg); border: 1px solid rgba(205,168,110,.4); }
.legal-h { display: flex; gap: 14px; align-items: center; padding: 20px 24px; background: var(--grad-gold-soft); border-bottom: 1px solid rgba(205,168,110,.35); }
.legal-h h3 { margin: 0; font-size: 18px; }
.legal-b { padding: 18px 24px; overflow: auto; }
.legal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); }

/* sign-in screen */
html.gated, html.gated body { overflow: hidden; }
html.gated #app { visibility: hidden; }
#gate { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; overflow: auto; }
.gate-card { width: min(980px, 100%); display: grid; grid-template-columns: 1.05fr 1fr; border-radius: 26px; overflow: hidden; box-shadow: 0 40px 90px -30px rgba(4,30,18,.55);
  border: 1px solid rgba(255,255,255,.6); background: var(--card); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); animation: gateIn .5s ease both; }
@keyframes gateIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.gate-brand { position: relative; padding: 40px 38px; color: #EAF3EE; background: linear-gradient(160deg, #0E5A41 0%, #0A3F3D 50%, #0C3352 100%); overflow: hidden; }
.gate-brand::before { content: ""; position: absolute; width: 360px; height: 360px; right: -140px; top: -150px; border-radius: 50%; background: radial-gradient(circle, rgba(236,217,178,.45), transparent 65%); }
.gate-brand::after { content: ""; position: absolute; width: 300px; height: 300px; left: -120px; bottom: -150px; border-radius: 50%; background: radial-gradient(circle, rgba(141,198,63,.28), transparent 65%); }
.gate-brand > * { position: relative; z-index: 1; }
.gate-logo { display: flex; gap: 14px; align-items: center; }
.gate-logo img { width: 58px; height: 58px; border-radius: 16px; box-shadow: 0 14px 30px -10px rgba(0,0,0,.55); }
.gate-logo b { display: block; font: 800 24px var(--display); letter-spacing: 1.4px; color: #fff; }
.gate-logo b i { font-style: normal; background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate-logo span { font: 700 10.5px var(--display); letter-spacing: 2px; text-transform: uppercase; color: #DFC290; }
.gate-brand h2 { font: 800 28px/1.2 var(--display); letter-spacing: -.5px; margin: 46px 0 12px; color: #fff; }
.gate-brand p { margin: 0; font-size: 14.5px; line-height: 1.6; color: rgba(234,243,238,.82); }
.gate-brand ul { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 10px; font-size: 13.5px; }
.gate-brand li { display: flex; gap: 10px; align-items: center; }
.gate-brand li::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--grad-gold); box-shadow: 0 0 0 3px rgba(223,194,144,.2); }
.gate-form { padding: 40px 38px 28px; display: flex; flex-direction: column; background: color-mix(in srgb, var(--card-solid) 70%, transparent); }
.gate-form h1 { font: 800 26px var(--display); margin: 0 0 4px; letter-spacing: -.4px; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate-sub { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }
.gate-form form { display: grid; gap: 14px; }
.gate-form .field > span { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.gate-form .input { height: 44px; font-size: 15px; }
.gate-check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; }
.gate-check input { accent-color: var(--gold-500); width: 16px; height: 16px; }
.gate-msg { min-height: 18px; font-size: 13px; color: var(--neg); font-weight: 600; }
.gate-msg:empty { display: none; }
.gate-note { padding: 12px 14px; border-radius: 12px; background: var(--grad-gold-soft); color: var(--brown-700); font-size: 13.5px; margin-bottom: 14px; }
:root[data-theme="dark"] .gate-note { color: #F1DDB4; }
.btn-block { width: 100%; justify-content: center; height: 46px; font-size: 15px; }
.btn.busy { opacity: .7; pointer-events: none; }
.gate-hint { margin: 0; text-align: center; font-size: 12.5px; color: var(--faint); }
.gate-legal { margin-top: auto; padding-top: 22px; font-size: 11.5px; line-height: 1.55; color: var(--muted); border-top: 1px solid var(--line); margin-top: 24px; }
.gate-legal b { color: var(--brown-600); }
:root[data-theme="dark"] .gate-legal b { color: #DFC290; }
.gate-legal a { color: var(--brown-600); font-weight: 600; }
@media (max-width: 820px) { .gate-card { grid-template-columns: 1fr; } .gate-brand { padding: 28px 24px; } .gate-brand h2 { margin-top: 24px; font-size: 22px; } .gate-brand ul { display: none; } .gate-form { padding: 28px 24px 22px; } }

@media print { .legal-bar, #gate, .legal-modal, .user-btn { display: none !important; } .tbl th { background: #F5EEDF !important; white-space: normal; line-height: 1.25; } .tbl td, .tbl th { padding: 5px 5px !important; } .tbl td { font-size: 10.5px; } }

/* ================================================================ v7: clearer charts, explanations, greeting */
/* tap-to-reveal explanations */
.tip-i { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 4px; padding: 0; border-radius: 50%; border: 1px solid rgba(185,143,87,.55);
  background: var(--grad-gold-soft); color: var(--brown-600); font: 700 10.5px/1 Georgia, serif; font-style: italic; cursor: pointer; vertical-align: 1px; flex: none; }
.tip-i:hover { background: var(--grad-gold); color: #4A361F; }
:root[data-theme="dark"] .tip-i { color: #EAD6AE; }
.tip-pop { position: fixed; z-index: 120; display: none; padding: 12px 14px; border-radius: 14px; font-size: 13px; line-height: 1.55; color: var(--text);
  background: color-mix(in srgb, var(--card-solid) 94%, transparent); border: 1px solid rgba(205,168,110,.45); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.tip-pop.on { display: block; animation: tipIn .16s ease both; }
@keyframes tipIn { from { opacity: 0; transform: translateY(4px); } }
.tip-pop p { margin: 6px 0 0; } .tip-pop p:first-child { margin-top: 0; }
.tip-pop .tip-warn { font-size: 11.5px; color: var(--brown-600); border-top: 1px dashed rgba(185,143,87,.4); padding-top: 6px; }
:root[data-theme="dark"] .tip-pop .tip-warn { color: #DFC290; }
.zone-t { font: 800 15px var(--display); }
.zone-t.g { color: var(--pos); } .zone-t.a { color: #B7791F; } .zone-t.r { color: var(--neg); }
.kpi .k .tip-i, .score-row .tip-i, th .tip-i { width: 15px; height: 15px; font-size: 9.5px; }

/* greeting */
.greet { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; padding: 16px 22px; border-radius: var(--radius);
  background: linear-gradient(110deg, rgba(247,235,207,.75) 0%, rgba(236,217,178,.35) 45%, rgba(255,255,255,.2) 100%); border: 1px solid rgba(205,168,110,.35); }
.greet h2 { margin: 0; font: 800 22px var(--display); letter-spacing: -.3px; color: var(--green-800); }
.greet h2 span:not(.g-hi) { background: var(--grad-gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.greet p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
:root[data-theme="dark"] .greet { background: linear-gradient(110deg, rgba(205,168,110,.16), rgba(205,168,110,.04)); }
:root[data-theme="dark"] .greet h2 { color: #E6F0EA; }

/* "if you invested 100 million" chart */
.chart-lead { margin: 0; font-size: 13.5px; color: var(--muted); }
.chart-lead b { color: var(--text); }
.end-vals { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ev { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 11px; border-radius: 11px; background: var(--card-2); border: 1px solid var(--line); font-size: 13px; }
.ev i { width: 9px; height: 9px; border-radius: 3px; align-self: center; }
.ev em { font-style: normal; font-family: var(--num); font-weight: 700; font-size: 14.5px; }
.ev small { font-family: var(--num); font-weight: 600; }
.ev.off { opacity: .4; }

/* 52-week range: low = opportunity (green), high = caution (warm) */
.range { background: linear-gradient(90deg, #9FDCAF 0%, #CFEBB8 30%, #F6E3A6 55%, #F5C59A 80%, #F2A7A7 100%) !important; }
.range .range-dot { position: absolute; top: -5px; width: 20px; height: 20px; margin-left: -10px; padding: 0; border-radius: 50%; cursor: pointer;
  background: var(--card-solid); border: 4px solid var(--green); box-shadow: 0 2px 8px rgba(0,0,0,.28); transition: left .8s cubic-bezier(.2,.7,.2,1), transform .15s; }
.range .range-dot:hover, .range .range-dot:focus-visible { transform: scale(1.18); outline: none; }
.range .range-dot::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; }
.range .range-dot.z-buy, .range .range-dot.z-buy2 { border-color: #1E9E57; }
.range .range-dot.z-hold { border-color: #D19A1F; }
.range .range-dot.z-sell2, .range .range-dot.z-sell { border-color: #D9534F; }
.range-key { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.range-key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 3px solid; background: var(--card-solid); }
.range-key i.z-buy { border-color: #1E9E57; } .range-key i.z-hold { border-color: #D19A1F; } .range-key i.z-sell { border-color: #D9534F; }
.range-key i.k-neg { border: 0; border-radius: 3px; background: #EF9A9A; } .range-key i.k-pos { border: 0; border-radius: 3px; background: #8FD4A4; }
.range-key i.k-med { border: 3px solid #445; background: #fff; }

/* yearly table: current year note */
.yr-sub { font-size: 11px; color: var(--muted); font-weight: 500; white-space: nowrap; }

/* holding-period range bars */
.hold { display: grid; gap: 14px; }
.hold-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 14px; align-items: center; }
.hold-name { display: flex; flex-direction: column; gap: 2px; }
.hold-name small { font-size: 11.5px; color: var(--muted); }
.hold-track { position: relative; height: 14px; border-radius: 7px; background: var(--line-2); }
.hold-neg, .hold-pos { position: absolute; top: 0; bottom: 0; }
.hold-neg { background: linear-gradient(90deg, #E57373, #F4B4B4); border-radius: 7px 0 0 7px; }
.hold-pos { background: linear-gradient(90deg, #A8DDB5, #43A86A); border-radius: 0 7px 7px 0; }
.hold-zero { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--text); opacity: .55; z-index: 1; }
.hold-med { position: absolute; top: -3px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: #fff; border: 3px solid #3A4A42; box-shadow: 0 1px 4px rgba(0,0,0,.3); z-index: 2; }
.hold-vals { grid-column: 2; display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-family: var(--num); }
.hold-axis { position: relative; margin-left: 164px; height: 16px; font-size: 11px; color: var(--muted); font-family: var(--num); }
.hold-axis span { position: absolute; } .hold-axis span:first-child { left: 0; } .hold-axis span:last-child { right: 0; } .hold-axis span:nth-child(2) { transform: translateX(-50%); }
@media (max-width: 700px) { .hold-row { grid-template-columns: 1fr; } .hold-vals { grid-column: 1; } .hold-axis { margin-left: 0; } }
/* correlation */
.tbl.corr td.heat { cursor: pointer; font-weight: 600; }
.corr-help { font-size: 13px; line-height: 1.55; }
.corr-help p { margin: 0 0 8px; }
.corr-help .ex { padding: 8px 12px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); }
.corr-scale { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 4px; }
.corr-scale i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 8px; vertical-align: -2px; }

/* allocation: advisor/client custom split */
.custom-box { border-top: 1px solid var(--line-2); background: var(--grad-gold-soft, var(--card-2)); }
.custom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cw { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.cw:hover { border-color: var(--fc, var(--green)); }
.cw.on { border-color: var(--fc, var(--green)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fc, var(--green)) 18%, transparent); }
.cw > input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--fc, var(--green)); flex: none; }
.cw .cw-in { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--muted); }
.cw .cw-in input { width: 68px; text-align: right; }
.cw .cw-in input:disabled { opacity: .45; }
.custom-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.custom-foot > span { margin-right: auto; font-size: 14px; }
.fv-sum { margin-left: auto; padding: 10px 14px; border-radius: 12px; background: var(--grad-gold-soft, var(--tint-2)); border: 1px solid var(--gold-200, var(--line)); font-size: 14px; }
.fv-sum b { font-size: 17px; color: var(--brown-700, var(--text)); }
.fv-sum small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
:root[data-theme="dark"] .fv-sum b { color: var(--gold-300); }

/* price board: latest-price tiles + fund-coloured column groups */
.board-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.bt { position: relative; display: block; padding: 14px 16px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: inherit; text-decoration: none; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.bt::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--fc); }
.bt::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: color-mix(in srgb, var(--fc) 10%, transparent); pointer-events: none; }
.bt:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.bt-h { display: flex; align-items: center; gap: 7px; }
.bt-h b { font-size: 16px; letter-spacing: .2px; color: var(--fc); }
.bt-src { margin-left: auto; font-size: 10.5px; padding: 2px 7px; border-radius: 999px; background: var(--line-2); color: var(--muted); font-weight: 600; }
.bt-src.s-V { background: var(--grad-gold-soft); color: var(--brown-600); }
.bt-n { font-size: 11.5px; color: var(--muted); margin: 3px 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-v { font: 800 26px/1.1 var(--num); letter-spacing: -.3px; }
.bt-v small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.bt-d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bt-d b { color: var(--text); }
.bt-c { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); font: 700 12.5px var(--num); }
.bt-c em { display: block; font: 500 10.5px var(--font); font-style: normal; color: var(--muted); }
.tbl.board th.bf { border-top: 4px solid var(--fc); background: color-mix(in srgb, var(--fc) 14%, var(--card)); color: var(--fc); font-size: 14px; text-align: center; white-space: nowrap; }
.tbl.board th.bf b { margin-left: 4px; }
.tbl.board th.bnav, .tbl.board th.bchg { background: color-mix(in srgb, var(--fc) 7%, var(--card)); font-size: 11px; }
.tbl.board td.bnav { background: color-mix(in srgb, var(--fc) 5%, transparent); font-weight: 700; font-size: 14px; border-left: 1px solid color-mix(in srgb, var(--fc) 25%, transparent); position: relative; }
.tbl.board td.bchg { font-size: 12px; }
.tbl.board td.bnav.best { background: color-mix(in srgb, var(--pos) 14%, transparent); color: var(--pos); }
.tbl.board td.bnav.worst { background: color-mix(in srgb, var(--neg) 12%, transparent); color: var(--neg); }
.tbl.board td.bnav.second { background: color-mix(in srgb, var(--warn) 15%, transparent); color: #A86B00; }
.tbl.board tr.bsep td { background: var(--grad-gold-soft); color: var(--brown-700); font-weight: 700; font-size: 12px; letter-spacing: .3px; padding-top: 6px; padding-bottom: 6px; }
:root[data-theme="dark"] .tbl.board tr.bsep td { color: var(--gold-300); }
.tbl.board tr.latest td { box-shadow: inset 0 2px 0 var(--gold-300), inset 0 -2px 0 var(--gold-300); }
.tbl.board tr.latest td.bnav { font-size: 15px; }
.tbl.board td.bdate { white-space: nowrap; }
.vmark, .tmark { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 5px; vertical-align: 2px; background: var(--gold-400); }
.tmark { background: var(--info); }
.board-key { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-2); }
.board-key i.k { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.board-key i.k.best { background: color-mix(in srgb, var(--pos) 35%, transparent); } .board-key i.k.worst { background: color-mix(in srgb, var(--neg) 30%, transparent); } .board-key i.k.second { background: color-mix(in srgb, var(--warn) 35%, transparent); }
.board-key .vmark, .board-key .tmark { margin: 0 5px 0 0; }

/* fund facts: holdings bars, fees, FIF projection, smoney tracker */
.hb { display: grid; gap: 7px; }
.hb-r { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 58px; gap: 10px; align-items: center; font-size: 13px; }
.hb-n { display: flex; flex-direction: column; min-width: 0; }
.hb-n b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-n small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-t { height: 10px; border-radius: 5px; background: var(--line-2); overflow: hidden; }
.hb-t i { display: block; height: 100%; border-radius: 5px; opacity: .85; }
.hb-v { text-align: right; font: 600 12.5px var(--num); }
.hold-grid .hb { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: 28px; }
.hold-grid .hb-r { grid-template-columns: 56px 1fr 54px; }
.tbl.kv th { width: 44%; font-weight: 600; color: var(--muted); text-align: left; background: transparent; white-space: normal; }
.tbl.kv td { white-space: normal; }
.input.sm { width: 84px; padding: 5px 8px; height: auto; text-align: right; }
.fp-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fp { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.fp .k { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.fp .v { font: 800 26px/1.2 var(--num); margin: 4px 0 2px; }
.fp .s { font-size: 11.5px; color: var(--muted); }
.fp.act { background: var(--tint-2); }
.fp.base { background: var(--grad-gold-soft); border-color: var(--gold-300); }
.fp.base .v { color: var(--brown-700); }
:root[data-theme="dark"] .fp.base .v { color: var(--gold-300); }
.fp.low .v { color: #B26A00; } .fp.high .v { color: var(--pos); }
@media (max-width: 800px) { .fp-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tbl-wrap.tall-s { max-height: 420px; }
@media print { .tbl-wrap.tall-s { max-height: none; overflow: visible; } }
.fi-g > div { min-width: 0; }
.tbl.tbl-wrapcells th, .tbl.tbl-wrapcells td { white-space: normal; }
.bt-h b { white-space: nowrap; }
.board-tiles { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid.g-12 > *, .grid.g2 > *, .grid.g-32 > * { min-width: 0; }
@media print { .grid > * { min-width: auto; } }
.seg[hidden] { display: none !important; }
.bt-src { white-space: nowrap; }
.bt-h b { font-size: 15px; }

/* language switch */
.lang-sw { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.lang-sw button { border: 0; background: transparent; font: 700 12px var(--font); letter-spacing: .4px; color: var(--muted); padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.lang-sw button.on { background: var(--grad-gold); color: var(--brown-700); }
.gate-lang { position: absolute; top: 18px; right: 18px; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); box-shadow: none; }
.gate-lang button { color: rgba(255,255,255,.8); }
.gate-brand { position: relative; }
@media print { .lang-sw { display: none !important; } }
/* client kit: fund fact sheet */
.fs .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.fs .kpi { min-width: 0; padding: 10px 12px; }
.fs .kpi .k { white-space: normal; line-height: 1.25; }
.fs .kpi .v { font-size: 18px; white-space: nowrap; }
.fs .grid.g-21 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.fs .grid.g-21 > * { min-width: 0; }
.fs canvas { max-width: 100% !important; }
@media print { .fs .kpi .v { font-size: 14px; } .fs .kpi { padding: 6px 8px; } .fs .fact { font-size: 10.5px; padding: 4px 0; } .fs .chart-box.sm { height: 190px; } }
/* v8: fund still waiting for its first NAV (e.g. VCBF-CFO) */
.bt.bt-wait { border-style: dashed; background: repeating-linear-gradient(135deg, var(--card), var(--card) 10px, var(--line-2) 10px, var(--line-2) 11px); }
.bt.bt-wait .bt-v { color: var(--muted); }
/* v8: all-time high (light purple) / all-time low (sky blue) tiles */
.kpi.kpi-ath { background: linear-gradient(135deg, #F3ECFF 0%, #E2D4FB 55%, #CDB8F5 100%); border-color: #CDB8F5; }
.kpi.kpi-ath .k, .kpi.kpi-ath .s { color: #5B3F95; } .kpi.kpi-ath .v { color: #4A2D86; }
.kpi.kpi-atl { background: linear-gradient(135deg, #EAF6FF 0%, #CDE9FC 55%, #A9D8F7 100%); border-color: #A9D8F7; }
.kpi.kpi-atl .k, .kpi.kpi-atl .s { color: #1F5E8C; } .kpi.kpi-atl .v { color: #134D78; }
:root[data-theme="dark"] .kpi.kpi-ath { background: linear-gradient(135deg, rgba(167,139,250,.30), rgba(124,92,214,.14)); border-color: rgba(167,139,250,.45); }
:root[data-theme="dark"] .kpi.kpi-ath .k, :root[data-theme="dark"] .kpi.kpi-ath .s, :root[data-theme="dark"] .kpi.kpi-ath .v { color: #E4D9FF; }
:root[data-theme="dark"] .kpi.kpi-atl { background: linear-gradient(135deg, rgba(56,170,240,.30), rgba(30,120,190,.14)); border-color: rgba(56,170,240,.45); }
:root[data-theme="dark"] .kpi.kpi-atl .k, :root[data-theme="dark"] .kpi.kpi-atl .s, :root[data-theme="dark"] .kpi.kpi-atl .v { color: #D4EEFF; }
/* v8: portfolio change month on month */
.pc { border-radius: 16px; padding: 16px 18px; background: linear-gradient(160deg, rgba(0,107,63,.06), rgba(0,92,149,.05)); border: 1px solid var(--line); }
.pc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pc-h { display: flex; gap: 12px; align-items: center; }
.pc-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-brand); flex: none; }
.pc-ic svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pc-h h4 { margin: 0; font-size: 16px; font-weight: 700; color: var(--green-800); }
.pc-h p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.pc-sel { width: auto; min-width: 200px; }
.pc-story { margin: 10px 0 0; font-size: 14px; }
.pc-sum { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.pcs { border-radius: 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--line); }
.pcs b { display: block; font-size: 22px; font-family: var(--num); line-height: 1.1; }
.pcs span { font-size: 12px; color: var(--muted); }
.pcs.n { border-top-color: #0A7F45; } .pcs.n b { color: #0A7F45; }
.pcs.u { border-top-color: #4CAF7A; } .pcs.u b { color: #2E9A60; }
.pcs.d { border-top-color: #E58A5A; } .pcs.d b { color: #C8622D; }
.pcs.o { border-top-color: #D03535; } .pcs.o b { color: #D03535; }
.pcs.h { border-top-color: #9AA5A0; } .pcs.h b { color: var(--muted); }
.pc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.pc-col { border-radius: 14px; background: var(--card); border: 1px solid var(--line); padding: 0 12px 8px; min-width: 0; }
.pc-ch { margin: 0 -12px 6px; padding: 9px 12px; border-radius: 14px 14px 0 0; font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.pc-ch span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; }
.pc-ch em { margin-left: auto; font-style: normal; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.7); }
.pc-col.b .pc-ch { background: linear-gradient(90deg, rgba(10,127,69,.16), rgba(10,127,69,.04)); color: #0A6A3A; } .pc-col.b .pc-ch span { background: #0A7F45; }
.pc-col.s .pc-ch { background: linear-gradient(90deg, rgba(208,53,53,.14), rgba(208,53,53,.03)); color: #A82828; } .pc-col.s .pc-ch span { background: #D03535; }
.pr { display: grid; grid-template-columns: 112px 1fr 128px; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.pr:last-child { border-bottom: 0; }
.pr-c b { display: block; font-size: 14px; }
.pr-c em { font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.k-new { background: #0A7F45; color: #fff; } .k-buy, .k-up { background: rgba(10,127,69,.12); color: #0A6A3A; }
.k-out { background: #D03535; color: #fff; } .k-sell, .k-down { background: rgba(208,53,53,.12); color: #A82828; }
/* v8.9: calm two-layer bar: last period = soft tint with a thin end marker, this period = solid rounded bar on top */
.pr-bar { position: relative; height: 14px; border-radius: 7px; background: color-mix(in srgb, var(--line-2) 70%, transparent); overflow: hidden; }
.pr-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; }
.pr-bar .pv { z-index: 1; border-radius: 7px 3px 3px 7px; }
.pr.b .pr-bar .pv { background: rgba(46,154,96,.16); box-shadow: inset -2px 0 0 rgba(46,154,96,.55); }
.pr.s .pr-bar .pv { background: rgba(214,104,84,.15); box-shadow: inset -2px 0 0 rgba(214,104,84,.55); }
.pr-bar .cv { top: 3px; bottom: 3px; z-index: 2; border-radius: 5px; }
.pr.b .cv, .pc-key .cv.b { background: linear-gradient(90deg, #6CC596, #2E9A60); }
.pr.s .cv, .pc-key .cv.s { background: linear-gradient(90deg, #F2A68E, #D66854); }
.pc-key .pv { background: rgba(120,135,128,.2); box-shadow: inset -2px 0 0 rgba(120,135,128,.6); }
:root[data-theme="dark"] .pr-bar { background: rgba(255,255,255,.06); }
.pr-v { text-align: right; font-family: var(--num); font-size: 13px; white-space: nowrap; }
.pr-v small { display: block; font-size: 11.5px; font-weight: 600; }
.pc-hold { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.pc-chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.pc-key { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.pc-key i { display: inline-block; width: 18px; height: 8px; border-radius: 4px; margin-right: 4px; vertical-align: middle; }
.pc-key .cv.s { margin-left: -2px; }
:root[data-theme="dark"] .pc-h h4 { color: #E6F0EA; }
:root[data-theme="dark"] .pc-col.b .pc-ch { color: #7EE0A8; } :root[data-theme="dark"] .pc-col.s .pc-ch { color: #FF9C9C; }
:root[data-theme="dark"] .pc-ch em { background: rgba(0,0,0,.25); }
@media (max-width: 900px) { .pc-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pc-cols { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .pr { grid-template-columns: 90px 1fr; } .pr-v { grid-column: 1 / -1; text-align: left; } }
/* v8: notification bell */
.bell-wrap { position: relative; }
.icon-btn.bell { position: relative; }
.icon-btn.bell.has svg { animation: bellRing 2.4s ease-in-out 1; transform-origin: 50% 10%; }
@keyframes bellRing { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-14deg); } }
#bellN { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #D03535; color: #fff; font: 700 10.5px/18px var(--font); font-style: normal; text-align: center; box-shadow: 0 0 0 2px var(--bg, #fff); }
.bell-pop { display: none; position: absolute; right: 0; top: calc(100% + 10px); width: min(400px, calc(100vw - 24px)); max-height: 70vh; z-index: 60; background: var(--card-solid, #fff); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 48px -16px rgba(0,30,20,.35); overflow: hidden; flex-direction: column; }
.bell-pop.open { display: flex; }
.bell-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.bell-h b { font-size: 15px; } .bell-h .mut { font-size: 12px; } .bell-h .btn { margin-left: auto; }
.bell-h .btn svg { width: 14px; height: 14px; }
.bell-tabs { display: flex; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.bell-tabs button { border: 0; background: transparent; padding: 5px 10px; border-radius: 999px; font: 600 12.5px var(--font); color: var(--muted); cursor: pointer; }
.bell-tabs button.on { background: var(--green); color: #fff; }
.bell-tabs em { font-style: normal; font-size: 10.5px; background: #D03535; color: #fff; border-radius: 8px; padding: 0 5px; margin-left: 2px; }
.bell-list { overflow-y: auto; }
.bell-i { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); color: inherit; text-decoration: none; position: relative; }
.bell-i:hover { background: var(--line-2); }
.bell-i.unread { background: rgba(0,107,63,.05); }
.bell-i.unread::after { content: ""; position: absolute; right: 12px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: #0B6FB0; }
.bell-ic { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--line-2); }
.bell-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.k-nav .bell-ic { background: rgba(0,107,63,.12); color: var(--green); } .k-news .bell-ic { background: rgba(11,111,176,.12); color: #0B6FB0; } .k-pf .bell-ic { background: rgba(201,164,106,.2); color: #8A6A2E; }
.bell-t { min-width: 0; padding-right: 14px; } .bell-t b { display: block; font-size: 13px; font-weight: 600; line-height: 1.35; }
.bell-i:not(.unread) .bell-t b { font-weight: 500; color: var(--muted); }
.bell-t small { display: block; font-size: 12px; margin-top: 2px; } .bell-t i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
:root[data-theme="dark"] .bell-pop { background: #14231B; }
/* v8: market headlines */
.mn-list { display: flex; flex-direction: column; }
.mn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.mn-i { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); color: var(--text); text-decoration: none; }
.mn-i:hover { background: linear-gradient(90deg, rgba(11,111,176,.07), transparent); }
.mn-t { text-align: center; padding-top: 2px; } .mn-t b { display: block; font-family: var(--num); font-size: 15px; color: var(--info); } .mn-t small { font-size: 11px; color: var(--muted); }
.mn-b { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.mn-src { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--sc); background: var(--card); border: 1px solid color-mix(in srgb, var(--sc) 30%, transparent); padding: 2px 9px 2px 3px; border-radius: 999px; letter-spacing: .1px; }
:root[data-theme="dark"] .mn-src { color: #fff; border-color: rgba(255,255,255,.18); }
/* official icon of a news outlet */
.src-ico { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; overflow: hidden; background: #fff; flex: none; font-style: normal; box-shadow: 0 0 0 1px rgba(0,0,0,.06); vertical-align: middle; }
.src-ico img { width: 100%; height: 100%; object-fit: contain; display: block; }
.src-ico.src-fb { background: var(--sc); color: #fff; font-size: 11px; font-weight: 700; }
.src-ico.sm { width: 15px; height: 15px; border-radius: 3px; font-size: 9.5px; margin-right: 5px; }
.btn .src-ico { width: 16px; height: 16px; margin-right: 2px; }
.mn-cat { font-size: 11.5px; color: var(--muted); }
.mn-title { flex-basis: 100%; font-weight: 600; font-size: 14px; line-height: 1.45; }
.mn-sum { flex-basis: 100%; font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mn-bar { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding-top: 4px; padding-bottom: 10px; font-size: 12.5px; border-bottom: 1px solid var(--line-2); }
.mn-bar .btn { margin-left: auto; } .mn-bar .btn svg { width: 14px; height: 14px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #E53935; box-shadow: 0 0 0 0 rgba(229,57,53,.6); animation: livePulse 1.8s infinite; }
@keyframes livePulse { 70% { box-shadow: 0 0 0 8px rgba(229,57,53,0); } 100% { box-shadow: 0 0 0 0 rgba(229,57,53,0); } }
/* v8: VCBF news + Facebook, balanced */
.fmc-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 16px; align-items: stretch; }
.fmc-top > .card { display: flex; flex-direction: column; min-width: 0; }
.fb-card { overflow: hidden; padding: 0; }
.fb-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: linear-gradient(120deg, #1877F2, #0B5FCC 60%, #0A4DA8); color: #fff; }
.fb-av { width: 42px; height: 42px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.35); overflow: hidden; }
.fb-av img, .fb-av svg { width: 30px; height: 30px; object-fit: contain; }
.fb-id { min-width: 0; } .fb-id b { display: block; font-size: 15px; } .fb-id small { display: block; font-size: 11.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; background: #fff; color: #1877F2; font-weight: 700; font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.fb-btn svg { width: 14px; height: 14px; fill: currentColor; }
.fb-body { position: relative; flex: 1; min-height: 640px; background: #F0F2F5; padding: 12px; display: flex; justify-content: center; }
.fb-fallback { position: absolute; inset: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: #65676B; font-size: 13px; padding: 24px; border-radius: 12px; background: #fff; }
.fb-fallback svg { width: 40px; height: 40px; fill: #1877F2; } .fb-fallback b { color: #1C1E21; }
.fb-body .fb-frame { position: relative; z-index: 1; width: 100%; max-width: 500px; height: 640px; min-height: 0; border: 0; border-radius: 12px; background: transparent; }
.fb-foot { padding: 8px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-2); }
:root[data-theme="dark"] .fb-body { background: #0E1A14; } :root[data-theme="dark"] .fb-fallback { background: #18241E; color: #9FB3A8; } :root[data-theme="dark"] .fb-fallback b { color: #E6F0EA; }
@media (max-width: 1100px) { .fmc-top { grid-template-columns: 1fr; } }
.tipc { border-bottom: 1px dashed currentColor; cursor: help; }
.fp-ev { margin: 4px 0 0; padding-left: 18px; } .fp-ev li { margin: 2px 0; }
/* v8: top bar holds the bell too: actions never shrink, long page subtitles clip instead */
.top-actions { flex-shrink: 0; }
.top-actions .btn { white-space: nowrap; }
.topbar .subtitle { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 1360px) { .top-actions .stamp { display: none; } }
@media (max-width: 1280px) { .top-actions #btnExport span { display: none; } }
.board-tiles { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.bt-v { font-size: clamp(20px, 1.7vw, 26px); }
/* v8: buy-and-hold education */
.grid.g-hold { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.grid.g-hold > * { min-width: 0; }
@media (max-width: 1280px) { .grid.g-hold { grid-template-columns: 1fr; } }
.hs-chips { margin-bottom: 8px; }
.hs-lead { margin: 4px 0 12px; font-size: 14px; }
.hs-row { display: flex; align-items: flex-end; gap: 6px; }
.hs { flex: 1; min-width: 0; text-align: center; padding: 12px 8px 10px; border-radius: 16px; background: linear-gradient(180deg, rgba(0,107,63,.07), rgba(0,92,149,.03)); border: 1px solid var(--line); margin-top: calc(30px - var(--lift)); }
.hs:last-child { background: linear-gradient(180deg, rgba(0,107,63,.16), rgba(0,92,149,.06)); border-color: rgba(0,107,63,.35); }
.hs-y { font-size: 12.5px; color: var(--muted); } .hs-y b { font-size: 16px; color: var(--text); }
.hs-ring { width: 86px; height: 86px; border-radius: 50%; margin: 8px auto; display: grid; place-items: center; }
.hs-ring span { width: 68px; height: 68px; border-radius: 50%; background: var(--card-solid); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hs-ring b { font: 800 18px/1 var(--num); } .hs-ring small { font-size: 9.5px; color: var(--muted); margin-top: 2px; }
.hs-med { font-size: 12.5px; } .hs-med b { font-family: var(--num); font-size: 14px; }
.hs-money { font-size: 12.5px; margin-top: 3px; } .hs-money b { color: var(--green); font-family: var(--num); }
.hs-rng { display: flex; flex-direction: column; font-size: 11px; margin-top: 6px; gap: 1px; }
.hs-arrow { align-self: center; color: var(--muted); font-size: 18px; }
.hs-now { display: flex; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(110deg, rgba(201,164,106,.18), rgba(201,164,106,.05)); border: 1px solid rgba(201,164,106,.4); font-size: 13.5px; line-height: 1.5; }
.hs-now svg { width: 22px; height: 22px; flex: none; stroke: #8A6A2E; fill: none; stroke-width: 2; }
.hs-notes { margin: 10px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); } .hs-notes li { margin: 3px 0; } .hs-notes b { color: var(--text); }
:root[data-theme="dark"] .hs-ring span { background: #14231B; }
@media (max-width: 640px) { .hs-row { flex-wrap: wrap; } .hs { flex-basis: 45%; margin-top: 0; } .hs-arrow { display: none; } }
/* v8: allocation loss column, scenario table, disbursement steps */
.td-loss small { display: block; font-size: 11px; color: var(--muted); }
.th-loss, .td-loss { background: rgba(208,53,53,.05); }
.sc-tbl td, .sc-tbl th { padding: 7px 10px; }
.sc-tbl tr.sc-sel td { background: rgba(208,53,53,.07); font-weight: 600; }
.sc-tbl tr.sc-over td:first-child { color: var(--neg); }
.plan-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.ps { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card); border-top: 3px solid var(--green); }
.ps-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; } .ps-h span { font-size: 12px; color: var(--muted); }
.ps-r { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; } .ps-r b { font-family: var(--num); }
.ps-t { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; font-size: 12.5px; display: flex; justify-content: space-between; } .ps-t b { font-family: var(--num); }
.grid.g-ef { grid-template-columns: 1fr; }
@media (min-width: 1700px) { .grid.g-ef { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }

/* v8.2: most traded codes, with funds and companies */
.hot-tbl td { vertical-align: top; font-size: 12.5px; }
.hot-tbl .hc { display: block; margin-top: 3px; color: var(--muted); line-height: 1.4; }
.hot-tbl .hc b { color: var(--text); font-weight: 600; margin-right: 4px; }
.hot-funds { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 12.5px; }
.hot-funds > div > span { display: block; font-weight: 600; margin-bottom: 4px; }
.hot-funds .hf { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line-2); }
.hot-funds .hf em { grid-column: 1 / -1; font-style: normal; color: var(--muted); font-size: 12px; }
.sm-grid { grid-template-columns: minmax(560px, 1fr) minmax(0, 1.15fr); align-items: start; }
.sm-grid .tbl .tag { white-space: nowrap; }
@media (max-width: 1360px) { .sm-grid { grid-template-columns: minmax(0, 1fr); } }
.hot-funds { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* v8.5: figures published on vcbf.com */
.vcbf-off { border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(120deg, rgba(0,107,63,.07), rgba(141,198,63,.05)); padding: 12px 16px; }
.vo-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; } .vo-h .logo { width: 28px; height: 28px; }
.vo-h b { display: block; font-size: 14px; } .vo-h small { color: var(--muted); font-size: 12px; }
.vo-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.vo-i { background: var(--card); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 12px; }
.vo-i span { display: block; font-size: 12px; color: var(--muted); } .vo-i b { font-family: var(--num); font-size: 17px; } .vo-i small { display: block; font-size: 11.5px; color: var(--muted); }
/* v8.6: phone and tablet (online use) */
@media (max-width: 700px) {
  .topbar { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
  .topbar .crumbs { min-width: 0; }
  .topbar h1 { font-size: 20px; }
  .topbar .subtitle { -webkit-line-clamp: 1; }
  .top-actions { justify-content: space-between; gap: 6px; flex-wrap: nowrap; width: 100%; }
  .top-actions .btn { padding: 0 10px; min-width: 40px; }
  .top-actions .btn span { display: none; }
  .top-actions .stamp { display: none; }
  .legal-bar { font-size: 11px; padding: 6px 12px; gap: 4px 8px; }
  .legal-bar span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .view { padding: 14px 12px 90px; }
  .greet h2 { font-size: 22px; }
}
/* v8.9: iPhone / phone polish. The bell panel lives in <body> (the top bar's backdrop-filter would trap a fixed panel)
   and is placed under the bell on desktop by notify.js; on phones it becomes a full-width sheet with a dimmed backdrop. */
.bell-pop { position: fixed; top: 64px; right: 16px; z-index: 80; }
.bell-x { display: none; }
@media (max-width: 960px) {
  .app::after { content: ""; position: fixed; inset: 0; z-index: 25; background: rgba(4,20,14,.45); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
  .app.menu-open::after { opacity: 1; pointer-events: auto; }
  .sidebar { width: min(280px, 82vw); box-shadow: none; } .app.menu-open .sidebar { box-shadow: 12px 0 40px -10px rgba(0,0,0,.5); }
  .sidebar .collapse-btn { display: none; }
  .app.collapsed .main { margin-left: 0; } .app.collapsed { --sidebar: 248px; }
  .app.collapsed .brand-text { display: flex; } .app.collapsed .nav .group { display: block; } .app.collapsed .nav a span, .app.collapsed .nav .badge, .app.collapsed .conn span { display: inline; }
  .app.collapsed .nav a { justify-content: flex-start; } .app.collapsed .sidebar-foot { flex-direction: row; }
}
@media (max-width: 700px) {
  /* top bar: row 1 = menu, title, bell, account; row 2 = refresh (labelled), export, language, theme */
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px 6px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
  .topbar .crumbs { grid-row: 1; grid-column: 1 / 3; min-width: 0; gap: 10px; }
  .topbar .crumbs > div { min-width: 0; }
  .topbar h1 { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .subtitle { font-size: 12px; -webkit-line-clamp: 1; }
  .top-actions { display: contents; }
  .top-actions .stamp { display: none; }
  .bell-wrap { grid-row: 1; grid-column: 3; justify-self: end; }
  #userBox { grid-row: 1; grid-column: 4; justify-self: end; }
  #btnRefresh { grid-row: 2; grid-column: 1; justify-content: center; }
  #btnRefresh span { display: inline; }
  .top-actions .dropdown:not(#userBox) { grid-row: 2; grid-column: 2; }
  .top-actions .lang-sw { grid-row: 2; grid-column: 3; justify-self: end; }
  #btnTheme { grid-row: 2; grid-column: 4; justify-self: end; }
  .top-actions .btn, .top-actions .icon-btn, .user-btn { height: 40px; min-width: 40px; padding: 0 12px; }
  .top-actions .icon-btn { width: 40px; padding: 0; }
  .top-actions #btnExport { padding: 0; width: 40px; justify-content: center; }
  .top-actions .btn svg { flex: none; }
  .top-actions .lang-sw { height: 40px; align-items: center; }
  .user-btn { padding: 0 6px 0 4px; gap: 2px; }
  .top-actions .menu { max-width: calc(100vw - 24px); }
  .top-actions .dropdown:not(#userBox) .menu { right: auto; left: 0; }

  /* notification sheet */
  .bell-pop { top: max(8px, env(safe-area-inset-top)) !important; left: 8px !important; right: 8px !important; width: auto; max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(4,20,14,.45), 0 24px 48px -16px rgba(0,0,0,.5); }
  .bell-h { padding: 12px 10px 12px 16px; }
  .bell-h b { font-size: 17px; }
  .bell-h .btn { padding: 0 10px; height: 34px; }
  .bell-x { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 0; border-radius: 10px; background: var(--line-2); color: var(--text); cursor: pointer; }
  .bell-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
  .bell-tabs { overflow-x: auto; scrollbar-width: none; flex: none; } .bell-tabs::-webkit-scrollbar { display: none; }
  .bell-tabs button { flex: none; padding: 7px 12px; font-size: 13.5px; }
  .bell-list { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .bell-i { padding: 12px 16px; }
  .bell-t b { font-size: 14px; } .bell-t small { font-size: 13px; } .bell-t i { font-size: 12px; }

  /* content: nothing wider than the screen, iOS does not zoom into inputs (font >= 16px) */
  .view { overflow-x: hidden; overflow-x: clip; }
  .input, select.input, textarea.input, .view input, .view select, .view textarea { font-size: 16px; }
  .view .btn { white-space: normal; max-width: 100%; text-align: left; }
  .card-b > .mt:has(> table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .user-add { grid-template-columns: 1fr; }
  .board-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bt-h { flex-wrap: wrap; row-gap: 4px; }
  .grid > * { min-width: 0; }
  .card-h { flex-wrap: wrap; gap: 8px; }
  .toasts { left: 12px; right: 12px; bottom: calc(64px + env(safe-area-inset-bottom)); }
  .legal-bar { padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); }
  .legal-bar span { -webkit-line-clamp: 1; }
}
@media (max-width: 700px) { html.bell-lock, html.bell-lock body { overflow: hidden; } }
@media print { .bell-pop { display: none !important; } }
@media (max-width: 700px) { .view .grid[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; } .range { margin: 0 6px; } }
@media (max-width: 700px) { .legal-modal { padding: 12px; } .legal-f { flex-wrap: wrap; padding: 12px 16px; } .legal-f .btn { flex: 1 1 auto; justify-content: center; white-space: normal; text-align: center; } }
@media (max-width: 400px) {
  #btnRefresh span { display: none; }
  .bell-h .mut { display: none; }
  .bell-h #bellAll { font-size: 0; gap: 0; width: 36px; padding: 0; justify-content: center; }
  .bell-h #bellAll svg { width: 18px; height: 18px; }
}
/* v8.9: iPad (mini 744/1133, 11" 834/1194, 13" 1032/1376) */
@media (min-width: 701px) and (max-width: 1366px) {
  .legal-bar span { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .legal-bar { padding-top: 7px; padding-bottom: 7px; }
}
@media (min-width: 961px) and (max-width: 1200px) {
  .app:not(.collapsed) { --sidebar: 236px; }
  .view { padding: 18px 20px 40px; }
  .topbar { padding-left: 20px; padding-right: 20px; }
}
@media (min-width: 961px) and (max-width: 1100px) { .g5, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 701px) and (max-width: 960px) {
  .view { padding: 18px 20px 40px; }
  .topbar { padding: 12px 20px; gap: 12px; }
  .top-actions { gap: 8px; }
  .top-actions #btnRefresh span { display: inline; }
  .topbar .subtitle { -webkit-line-clamp: 1; }
  .sidebar { width: 280px; }
  .app::after { background: rgba(4,20,14,.4); }
  .board-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* touch screens (iPad, phones): comfortable tap targets, no sticky hover */
@media (pointer: coarse) {
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  .icon-btn { width: 42px; height: 42px; }
  .seg button { padding: 9px 14px; font-size: 13.5px; }
  .chip { padding-top: 9px; padding-bottom: 9px; }
  .nav a { padding-top: 12px; padding-bottom: 12px; }
  .bell-tabs button { padding: 7px 12px; }
  .lang-sw button { padding: 8px 12px; }
}
