/**
 * ============================================
 * MOBILE CSS — Seikin Invest Mobile App
 * Version: 1.0 · 2026-05-15
 * Design source: seikin-mobile.html (approved)
 * ============================================
 * Design tokens, layout, và tất cả screen styles
 * dành riêng cho mobile app (standalone mobile.html).
 * KHÔNG import vào index.html — token set khác desktop.
 */

/* ═══════════════════════════════════════
   ROOT TOKENS
═══════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg-base:     #0D1117;
  --bg-surface:  #161B22;
  --bg-elevated: #1C2128;
  --border:      #21262D;
  --border-med:  #30363D;

  /* Text */
  --text-1: #E6EDF3;
  --text-2: #8B949E;
  --text-3: #6E7681;

  /* Semantic colors */
  --green:      #3FB950;
  --green-dim:  #238636;
  --green-bg:   rgba(63,185,80,0.12);
  --green-bg2:  rgba(35,134,54,0.25);
  --red:        #F85149;
  --red-bg:     rgba(248,81,73,0.12);
  --blue:       #388BFD;
  --blue-bg:    rgba(56,139,253,0.12);
  --amber:      #E3B341;
  --amber-bg:   rgba(227,179,65,0.12);
  --purple:     #A371F7;
  --purple-bg:  rgba(163,113,247,0.12);
  --orange:     #E36209;

  /* Border radius */
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 20px;
}

/* ═══════════════════════════════════════
   BASE RESET
═══════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
}

body {
  background: #0D1117;
  font-family: 'SF Pro Display', -apple-system, 'Segoe UI', sans-serif;
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════
   PHONE SHELL (desktop preview mode)
═══════════════════════════════════════ */
body.preview-mode {
  background: #111318;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.phone-shell {
  width: 375px;
  height: 812px;
  background: var(--bg-base);
  border-radius: 44px;
  border: 2px solid #2D333B;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 0 0 6px #0a0b0e,
    0 40px 80px rgba(0,0,0,0.6),
    0 0 60px rgba(63,185,80,0.04);
  flex-shrink: 0;
}

/* Notch */
.notch {
  background: var(--bg-base);
  height: 44px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  flex-shrink: 0;
}
.notch-pill {
  width: 120px;
  height: 36px;
  background: #000;
  border-radius: 20px;
}

/* Status bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 24px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  flex-shrink: 0;
}
.status-right { display: flex; align-items: center; gap: 5px; }
.status-right .ti { font-size: 14px; }

/* Screen container */
.screen-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ═══════════════════════════════════════
   SCREENS
═══════════════════════════════════════ */
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  flex-direction: column;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 80px;  /* bottom nav clearance */
}
.screen::-webkit-scrollbar { display: none; }
.screen.active { display: flex; }

/* Slide-up animation khi chuyển screen */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.screen.active > * {
  animation: slideUp 0.22s ease both;
}
.screen.active > *:nth-child(2) { animation-delay: 0.03s; }
.screen.active > *:nth-child(3) { animation-delay: 0.06s; }
.screen.active > *:nth-child(4) { animation-delay: 0.09s; }
.screen.active > *:nth-child(5) { animation-delay: 0.12s; }

/* ═══════════════════════════════════════
   BOTTOM NAVIGATION
═══════════════════════════════════════ */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  height: 68px;
  background: var(--bg-base);
  border-top: 0.5px solid var(--border);
  display: flex;
  align-items: flex-start;
  padding-top: 8px;
  z-index: 100;
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 4px 0;
  transition: opacity 0.15s;
  position: relative;
}
.nav-item:active { opacity: 0.7; }
.nav-item .ti { font-size: 22px; color: var(--text-2); transition: color 0.2s; }
.nav-item span {
  font-size: 9.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.2s;
  letter-spacing: 0.01em;
}
.nav-item.active .ti { color: var(--green); }
.nav-item.active span { color: var(--green); }

/* ═══════════════════════════════════════
   SHARED COMPONENTS
═══════════════════════════════════════ */
.page-header {
  padding: 14px 20px 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.page-title { font-size: 22px; font-weight: 700; color: var(--text-1); letter-spacing: -0.4px; }
.page-sub   { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.card {
  background: var(--bg-surface);
  border-radius: var(--r-lg);
  border: 0.5px solid var(--border);
  padding: 14px 16px;
}
.card-section { margin: 0 16px 10px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.badge-green  { background: var(--green-bg2); color: var(--green);  border: 0.5px solid var(--green-dim); }
.badge-red    { background: var(--red-bg);    color: var(--red);    border: 0.5px solid rgba(248,81,73,0.4); }
.badge-amber  { background: var(--amber-bg);  color: var(--amber);  border: 0.5px solid rgba(227,179,65,0.4); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue);   border: 0.5px solid rgba(56,139,253,0.4); }
.badge-purple { background: var(--purple-bg); color: var(--purple); border: 0.5px solid rgba(163,113,247,0.4); }

.divider { height: 0.5px; background: var(--border); margin: 0 16px; }

.section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 20px 6px;
}

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-med);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn .ti { font-size: 17px; color: var(--text-2); }

/* Toggle switch */
.toggle {
  width: 40px; height: 24px;
  background: var(--border-med);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle.on { background: var(--green-dim); }
.toggle::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 10px;
  background: var(--text-1);
  top: 2px; left: 2px;
  transition: transform 0.2s;
}
.toggle.on::after { transform: translateX(16px); }

/* ═══════════════════════════════════════
   S1 — TỔNG QUAN (DASHBOARD)
═══════════════════════════════════════ */
.logo-bar {
  padding: 10px 20px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo { font-size: 18px; font-weight: 700; color: var(--text-1); letter-spacing: -0.5px; }
.logo em { color: var(--green); font-style: normal; }

/* Market Mode Card */
.mode-card {
  margin: 4px 16px 12px;
  border-radius: var(--r-xl);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.15s;
}
.mode-card:active { opacity: 0.9; }
.mode-card.offensive {
  background: linear-gradient(145deg, #0A2015 0%, #0D2A1A 60%, #0F3320 100%);
  border: 1px solid var(--green-dim);
}
.mode-card.cautious {
  background: linear-gradient(145deg, #1A1508 0%, #231C09 100%);
  border: 1px solid rgba(227,179,65,0.5);
}
.mode-card.defensive {
  background: linear-gradient(145deg, #1C0A0A 0%, #250D0D 100%);
  border: 1px solid rgba(248,81,73,0.5);
}
.mode-card.euphoria {
  background: linear-gradient(145deg, #1A1008 0%, #231508 100%);
  border: 1px solid rgba(227,100,9,0.5);
}
.mode-bg-chart {
  position: absolute;
  right: 14px; top: 14px;
  opacity: 0.2;
}
.mode-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
.mode-card.defensive .pulse-dot { background: var(--red); }
.mode-card.cautious  .pulse-dot { background: var(--amber); }
.mode-card.euphoria  .pulse-dot { background: var(--orange); }

.mode-label {
  font-size: 11px; font-weight: 700;
  color: var(--green);
  letter-spacing: 0.08em;
}
.mode-card.defensive .mode-label { color: var(--red); }
.mode-card.cautious  .mode-label { color: var(--amber); }
.mode-card.euphoria  .mode-label { color: var(--orange); }

.mode-score {
  font-size: 42px; font-weight: 800;
  color: var(--text-1);
  line-height: 1;
  letter-spacing: -1px;
}
.mode-score-sub { display: flex; align-items: baseline; gap: 8px; margin-top: 3px; }
.mode-index     { font-size: 13px; color: var(--text-2); }
.mode-index-val { font-size: 13px; font-weight: 600; color: var(--text-1); }
.mode-stance {
  display: inline-block;
  margin-top: 10px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  border: 0.5px solid rgba(63,185,80,0.3);
}
.mode-card.defensive .mode-stance { background: var(--red-bg);   color: var(--red);   border-color: rgba(248,81,73,0.3); }
.mode-card.cautious  .mode-stance { background: var(--amber-bg); color: var(--amber); border-color: rgba(227,179,65,0.3); }
.mode-card.euphoria  .mode-stance { background: rgba(227,100,9,0.12); color: var(--orange); border-color: rgba(227,100,9,0.3); }

/* ADV/DEC bar */
.adv-dec-wrap { margin: 0 16px 12px; }
.adv-dec-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 5px;
}
.adv-val          { font-weight: 600; }
.adv-val.up       { color: var(--green); }
.adv-val.dn       { color: var(--red); }
.adv-dec-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  display: flex;
  overflow: hidden;
  gap: 1px;
}
.adv-fill { height: 100%; background: var(--green); border-radius: 4px 0 0 4px; }
.dec-fill { height: 100%; background: var(--red);   border-radius: 0 4px 4px 0; }

/* Stats chips */
.stats-row { display: flex; gap: 8px; padding: 0 16px 14px; }
.stat-chip {
  flex: 1;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r);
  padding: 10px 8px;
  text-align: center;
}
.stat-chip-val     { font-size: 17px; font-weight: 700; color: var(--text-1); line-height: 1; }
.stat-chip-val.up  { color: var(--green); }
.stat-chip-val.dn  { color: var(--red); }
.stat-chip-val.warn { color: var(--amber); }
.stat-chip-lbl     { font-size: 10px; color: var(--text-2); margin-top: 3px; }

/* Picks list */
.picks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px 8px;
}
.picks-title { font-size: 14px; font-weight: 600; color: var(--text-1); }
.picks-link  { font-size: 12px; color: var(--blue); cursor: pointer; }

.pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.pick-row:last-child { border-bottom: none; }
.pick-row:active { background: var(--bg-surface); }

.grade-badge {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0;
}
.grade-a { background: var(--green-bg);  color: var(--green); }
.grade-b { background: var(--blue-bg);   color: var(--blue); }
.grade-c { background: var(--amber-bg);  color: var(--amber); }
.grade-f { background: var(--red-bg);    color: var(--red); }

.pick-info { flex: 1; }
.pick-sym  { font-size: 14px; font-weight: 700; color: var(--text-1); }
.pick-meta { font-size: 11px; color: var(--text-2); margin-top: 1px; }
.pick-tp   { font-size: 14px; font-weight: 700; color: var(--green); }

/* AI Strategy text block */
.ai-strategy-block {
  margin: 0 16px 12px;
  background: linear-gradient(145deg, #0A2015, #0D2A1A);
  border-radius: var(--r-lg);
  border: 1px solid var(--green-dim);
  padding: 13px 15px;
}
.ai-block-header { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.ai-block-dot    { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.ai-block-lbl    { font-size: 10.5px; font-weight: 700; color: var(--green); letter-spacing: 0.06em; text-transform: uppercase; }
.ai-block-text   { font-size: 12px; color: var(--text-2); line-height: 1.55; }
.ai-block-text strong { color: var(--text-1); font-weight: 600; }

/* ═══════════════════════════════════════
   S2 — TÌM CỔ PHIẾU
═══════════════════════════════════════ */
.filter-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;   /* 2 cột đều nhau — 4 tabs = 2×2, không scroll */
  gap: 6px;
  padding: 4px 16px 10px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-base);
}
.ftab {
  padding: 7px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.ftab.act   { background: var(--green-dim); color: var(--text-1); }
.ftab.inact { background: var(--bg-surface); color: var(--text-2); border: 0.5px solid var(--border-med); }

/* ── Starred section ──────────────────────── */
#s2-starred-section {
  margin: 0 16px 10px;
  background: var(--bg-surface);
  border-radius: var(--r-lg);
  border: 0.5px solid var(--amber);
  padding: 10px 12px;
}
.star-section-hd {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 8px;
}
.star-clear-btn {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text-3);
  cursor: pointer;
  text-decoration: underline;
}
.star-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.star-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-base);
  border: 0.5px solid var(--border-med);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  cursor: pointer;
}

.stock-card {
  margin: 0 16px 9px;
  background: var(--bg-surface);
  border-radius: var(--r-lg);
  border: 0.5px solid var(--border);
  padding: 13px 15px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.stock-card.mua-ngay  { border-color: var(--green-dim); border-width: 1px; }
.stock-card.canh-bao  { border-color: rgba(248,81,73,0.5); border-width: 1px; }
.stock-card.chuan-bi  { border-color: rgba(56,139,253,0.4); }
.stock-card:active    { opacity: 0.85; }

.sc-top  { display: flex; justify-content: space-between; align-items: flex-start; }
.sc-sym  { font-size: 17px; font-weight: 700; color: var(--text-1); letter-spacing: -0.3px; }
.sc-name { font-size: 10.5px; color: var(--text-2); margin-top: 2px; }

.sc-metrics { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; }
.sc-metric {
  background: var(--bg-base);
  border-radius: 8px;
  padding: 5px 9px;
}
.sc-m-lbl { font-size: 9px; color: var(--text-3); font-weight: 500; }
.sc-m-val { font-size: 13px; font-weight: 700; color: var(--text-1); margin-top: 1px; }
.sc-m-val.g { color: var(--green); }
.sc-m-val.b { color: var(--blue); }
.sc-m-val.a { color: var(--amber); }
.sc-m-val.p { color: var(--purple); }

.sc-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.tag { font-size: 9.5px; font-weight: 600; padding: 2px 8px; border-radius: 5px; }
.tag-vcp    { background: var(--purple-bg); color: var(--purple); }
.tag-break  { background: var(--blue-bg);   color: var(--blue); }
.tag-rs     { background: var(--amber-bg);  color: var(--amber); }
.tag-bc     { background: var(--green-bg);  color: var(--green); }
.tag-danger { background: var(--red-bg);    color: var(--red); }
.tag-sniper { background: rgba(163,113,247,0.2); color: var(--purple); }

.sc-entry {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 10px;
  border-top: 0.5px solid var(--border);
}
.sc-price-lbl { font-size: 9.5px; color: var(--text-2); }
.sc-price-val { font-size: 13px; font-weight: 700; color: var(--text-1); margin-top: 1px; }
.sc-rr {
  background: var(--green-bg);
  color: var(--green);
  font-size: 11.5px; font-weight: 700;
  padding: 5px 10px;
  border-radius: 9px;
  white-space: nowrap;
}

/* Empty state */
.empty-state-mobile {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-2);
}
.empty-state-mobile .ti { font-size: 36px; color: var(--border-med); display: block; margin-bottom: 12px; }
.empty-state-mobile p   { font-size: 13px; }

/* ═══════════════════════════════════════
   S3 — PHÂN TÍCH CỔ PHIẾU
═══════════════════════════════════════ */
.detail-header {
  padding: 10px 16px 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.back-btn {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-med);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.back-btn .ti { font-size: 17px; color: var(--text-2); }
.detail-sym   { font-size: 20px; font-weight: 800; color: var(--text-1); letter-spacing: -0.4px; }
.detail-price { font-size: 13px; color: var(--green); font-weight: 600; margin-top: 1px; }
.detail-price.dn { color: var(--red); }

.badge-row { display: flex; gap: 6px; padding: 2px 16px 10px; flex-wrap: wrap; }

/* Mini chart */
.chart-area {
  margin: 0 16px 12px;
  height: 100px;
  background: var(--bg-surface);
  border-radius: var(--r-lg);
  border: 0.5px solid var(--border);
  position: relative;
  overflow: hidden;
}
.chart-svg { width: 100%; height: 100%; }

/* Score rings row */
.scores-row { display: flex; gap: 8px; padding: 0 16px 12px; }
.score-card {
  flex: 1;
  background: var(--bg-surface);
  border-radius: var(--r);
  padding: 12px 8px;
  border: 0.5px solid var(--border);
  text-align: center;
}
.score-ring { width: 56px; height: 56px; margin: 0 auto 6px; position: relative; }
.score-ring svg { transform: rotate(-90deg); }
.score-num {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 15px; font-weight: 800;
  color: var(--text-1);
}
.score-lbl { font-size: 10px; color: var(--text-2); font-weight: 500; }

/* Entry zone */
.entry-zone {
  margin: 0 16px 10px;
  background: var(--bg-surface);
  border-radius: var(--r-lg);
  border: 0.5px solid var(--border);
  padding: 14px 16px;
}
.ez-title {
  font-size: 10.5px; font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.ez-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.ez-lbl   { font-size: 12px; color: var(--text-2); }
.ez-val   { font-size: 12px; font-weight: 700; }
.ez-blue  { color: var(--blue); }
.ez-red   { color: var(--red); }
.ez-green { color: var(--green); }

.rr-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  margin-top: 10px;
  overflow: hidden;
  position: relative;
}
.rr-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--red) 0%, var(--red) 24%, var(--green) 24%, var(--green) 100%);
}
.rr-labels { display: flex; justify-content: space-between; margin-top: 4px; }
.rr-labels span { font-size: 9.5px; font-weight: 500; }

/* AI insight box */
.ai-box {
  margin: 0 16px 10px;
  background: linear-gradient(145deg, #0A2015, #0D2A1A);
  border-radius: var(--r-lg);
  border: 1px solid var(--green-dim);
  padding: 13px 15px;
}
.ai-header     { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.ai-header-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.ai-header-lbl { font-size: 10.5px; font-weight: 700; color: var(--green); letter-spacing: 0.06em; text-transform: uppercase; }
.ai-text       { font-size: 12px; color: var(--text-2); line-height: 1.55; }
.ai-text strong { color: var(--text-1); font-weight: 600; }

/* Scenario tabs */
.scen-tabs { display: flex; gap: 5px; padding: 0 16px 8px; }
.stab {
  flex: 1; text-align: center;
  padding: 7px 4px;
  border-radius: 9px;
  font-size: 10.5px; font-weight: 700;
  cursor: pointer;
}
.stab-bull { background: var(--green-bg); color: var(--green); }
.stab-base { background: var(--blue-bg);  color: var(--blue); }
.stab-bear { background: var(--red-bg);   color: var(--red); }

/* CTA buttons */
.cta-row { display: flex; gap: 9px; padding: 0 16px 10px; }
.cta-watch {
  flex: 1;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-med);
  border-radius: var(--r);
  padding: 13px;
  text-align: center;
  font-size: 13px; font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.cta-buy {
  flex: 2;
  background: var(--green-dim);
  border-radius: var(--r);
  padding: 13px;
  text-align: center;
  font-size: 13px; font-weight: 700;
  color: var(--text-1);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.cta-buy:active { opacity: 0.85; }

/* Select stock prompt */
.select-stock-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
}
.select-stock-prompt .ti { font-size: 48px; color: var(--border-med); margin-bottom: 16px; }
.select-stock-prompt h3  { font-size: 16px; font-weight: 600; color: var(--text-1); margin-bottom: 8px; }
.select-stock-prompt p   { font-size: 12px; color: var(--text-2); line-height: 1.5; }

/* ═══════════════════════════════════════
   S4 — DANH MỤC
═══════════════════════════════════════ */
.pf-tabs {
  display: flex;
  margin: 0 16px 12px;
  background: var(--bg-surface);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.pf-tab {
  flex: 1; text-align: center;
  padding: 7px;
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.pf-tab.act { background: var(--green-dim); color: var(--text-1); }

.nav-card {
  margin: 0 16px 12px;
  background: var(--bg-surface);
  border-radius: var(--r-xl);
  border: 0.5px solid var(--border);
  padding: 16px;
}
.nav-label { font-size: 11px; color: var(--text-2); margin-bottom: 4px; font-weight: 500; }
.nav-value { font-size: 30px; font-weight: 800; color: var(--text-1); letter-spacing: -1px; line-height: 1; }
.nav-pnl   { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.alloc-bar-wrap   { margin-top: 12px; }
.alloc-bar-labels { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 5px; }
.alloc-bar {
  height: 8px; border-radius: 4px;
  background: var(--border);
  display: flex; overflow: hidden;
}
.alloc-cp   { height: 100%; background: var(--blue);      border-radius: 4px 0 0 4px; transition: width 0.6s ease; }
.alloc-cash { height: 100%; background: var(--border-med); border-radius: 0 4px 4px 0; }

.summary-row { display: flex; gap: 8px; padding: 0 16px 12px; }
.sum-chip {
  flex: 1;
  background: var(--bg-surface);
  border-radius: var(--r);
  border: 0.5px solid var(--border);
  padding: 9px;
  text-align: center;
}
.sum-chip-lbl { font-size: 9.5px; color: var(--text-2); }
.sum-chip-val { font-size: 14px; font-weight: 700; margin-top: 2px; }

.pos-card {
  margin: 0 16px 8px;
  background: var(--bg-surface);
  border-radius: var(--r-lg);
  border: 0.5px solid var(--border);
  padding: 13px 15px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.pos-card.warning { border-color: rgba(227,179,65,0.5); border-width: 1px; }
.pos-card.danger  { border-color: rgba(248,81,73,0.5);  border-width: 1px; }

.pos-top  { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.pos-sym  { font-size: 16px; font-weight: 700; color: var(--text-1); }
.pos-name { font-size: 10.5px; color: var(--text-2); margin-top: 2px; }

.signal-badge { padding: 3px 9px; border-radius: 6px; font-size: 10.5px; font-weight: 700; }
.sig-hold     { background: var(--green-bg);  color: var(--green); }
.sig-watch    { background: var(--amber-bg);  color: var(--amber); }
.sig-exit     { background: var(--red-bg);    color: var(--red); }

.pos-metrics { display: flex; gap: 6px; margin-bottom: 10px; }
.pos-m {
  flex: 1;
  background: var(--bg-base);
  border-radius: 8px;
  padding: 7px 8px;
  text-align: center;
}
.pos-m-lbl { font-size: 9px; color: var(--text-3); }
.pos-m-val { font-size: 13px; font-weight: 700; margin-top: 2px; }

.prox-bar-wrap   { }
.prox-bar-labels { display: flex; justify-content: space-between; font-size: 10px; margin-bottom: 3px; }
.prox-bar { height: 5px; border-radius: 3px; background: var(--border); position: relative; overflow: hidden; }
.prox-fill {
  height: 100%; border-radius: 3px;
  position: absolute; left: 0;
  transition: width 0.6s ease;
}

/* Portfolio empty state */
.portfolio-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-2);
}
.portfolio-empty .ti { font-size: 48px; color: var(--border-med); display: block; margin-bottom: 16px; }
.portfolio-empty h3  { font-size: 16px; font-weight: 600; color: var(--text-1); margin-bottom: 8px; }
.portfolio-empty p   { font-size: 12px; line-height: 1.5; }

/* ═══════════════════════════════════════
   S5 — CẢNH BÁO CẮT LỖ
═══════════════════════════════════════ */
.alert-header {
  padding: 14px 20px 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.urgent-banner {
  margin: 0 16px 12px;
  background: linear-gradient(145deg, #1C0A0A, #250D0D);
  border: 1px solid rgba(248,81,73,0.6);
  border-radius: var(--r-xl);
  padding: 14px 16px;
}
.ub-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ub-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--red-bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ub-icon .ti { font-size: 17px; color: var(--red); }
.ub-title    { font-size: 13px; font-weight: 700; color: var(--red); }
.ub-sub      { font-size: 10.5px; color: var(--text-2); margin-top: 1px; }
.ub-body     { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; }
.ub-sym      { font-size: 18px; font-weight: 800; color: var(--text-1); letter-spacing: -0.4px; }
.ub-sector   { font-size: 10.5px; color: var(--text-2); margin-top: 2px; }
.ub-loss-wrap { text-align: right; }
.ub-loss-lbl  { font-size: 9.5px; color: var(--text-2); }
.ub-loss-val  { font-size: 22px; font-weight: 800; color: var(--red); letter-spacing: -0.5px; }
.ub-prices {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px;
  border-top: 0.5px solid rgba(248,81,73,0.2);
}
.ub-p-lbl    { font-size: 9.5px; color: var(--text-2); }
.ub-p-val    { font-size: 13px; font-weight: 700; margin-top: 2px; }
.ub-action-btn {
  background: var(--red);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 12px; font-weight: 700;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.prox-section { margin: 0 16px 12px; }
.prox-card {
  background: var(--bg-surface);
  border-radius: var(--r);
  border: 0.5px solid var(--border);
  padding: 10px 12px;
  margin-bottom: 6px;
}
.prox-top    { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.prox-sym    { font-size: 14px; font-weight: 700; color: var(--text-1); }
.prox-detail { font-size: 10px; color: var(--text-2); }
.prox-dist   { font-size: 12px; font-weight: 700; }

.qa-row { display: flex; gap: 7px; margin: 0 16px 12px; }
.qa-btn {
  flex: 1;
  border-radius: var(--r);
  padding: 12px 6px;
  text-align: center;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
}
.qa-cut   { background: var(--red);   color: #fff; }
.qa-watch { background: var(--bg-surface); border: 0.5px solid var(--amber); color: var(--amber); }
.qa-hold  { background: var(--bg-surface); border: 0.5px solid var(--green); color: var(--green); }

/* ═══════════════════════════════════════
   S6 — NGÀNH & BỐI CẢNH
═══════════════════════════════════════ */
.ctx-tabs {
  display: flex;
  margin: 0 16px 12px;
  background: var(--bg-surface);
  border-radius: 10px;
  padding: 3px;
}
.ctx-tab {
  flex: 1; text-align: center;
  padding: 7px;
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.ctx-tab.act { background: var(--blue); color: var(--text-1); }

.macro-card {
  margin: 0 16px 12px;
  background: linear-gradient(145deg, #0A1628, #0D1E3A);
  border-radius: var(--r-xl);
  border: 1px solid rgba(56,139,253,0.4);
  padding: 16px;
}
.macro-top        { display: flex; justify-content: space-between; }
.macro-score-num  { font-size: 42px; font-weight: 800; color: var(--text-1); letter-spacing: -1px; line-height: 1; }
.macro-score-lbl  { font-size: 11px; color: var(--text-2); margin-bottom: 4px; }
.macro-status {
  display: inline-block;
  background: var(--green-bg);
  color: var(--green);
  font-size: 10.5px; font-weight: 600;
  padding: 3px 9px;
  border-radius: 7px;
  margin-top: 8px;
}
.macro-factors { display: flex; flex-direction: column; gap: 5px; min-width: 120px; }
.macro-factor  { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mf-name       { font-size: 10.5px; color: var(--text-2); }
.mf-val        { font-size: 10.5px; font-weight: 600; }
.mf-pos        { color: var(--green); }
.mf-neg        { color: var(--red); }
.mf-neu        { color: var(--amber); }

.sector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 0 16px 10px;
}
.sec-cell { border-radius: var(--r); padding: 9px 7px; text-align: center; cursor: pointer; }
.sec-name  { font-size: 9px; font-weight: 700; margin-bottom: 4px; }
.sec-score { font-size: 17px; font-weight: 800; }
.sec-trend { font-size: 9px; margin-top: 2px; }
.sec-green { background: rgba(63,185,80,0.12);  border: 0.5px solid rgba(63,185,80,0.3); }
.sec-green .sec-name  { color: #2a7a39; }
.sec-green .sec-score { color: var(--green); }
.sec-green .sec-trend { color: var(--green); }
.sec-amber { background: var(--amber-bg); border: 0.5px solid rgba(227,179,65,0.3); }
.sec-amber .sec-name  { color: #9e6a03; }
.sec-amber .sec-score { color: var(--amber); }
.sec-amber .sec-trend { color: var(--amber); }
.sec-red   { background: var(--red-bg);   border: 0.5px solid rgba(248,81,73,0.3); }
.sec-red .sec-name  { color: #b91c1c; }
.sec-red .sec-score { color: var(--red); }
.sec-red .sec-trend { color: var(--red); }

.flow-chips { display: flex; gap: 8px; padding: 0 16px 12px; }
.flow-chip {
  flex: 1;
  background: var(--bg-surface);
  border-radius: var(--r);
  border: 0.5px solid var(--border);
  padding: 10px;
  text-align: center;
}
.fc-lbl { font-size: 9.5px; color: var(--text-2); }
.fc-val { font-size: 14px; font-weight: 700; margin-top: 3px; }
.fc-sub { font-size: 9.5px; margin-top: 2px; }

.vin-warning {
  margin: 0 16px 12px;
  background: linear-gradient(145deg, #1A1208, #231C09);
  border: 0.5px solid rgba(227,179,65,0.5);
  border-radius: var(--r-lg);
  padding: 11px 14px;
  display: flex; align-items: flex-start; gap: 10px;
}
.vin-warning .ti { font-size: 16px; color: var(--amber); flex-shrink: 0; margin-top: 1px; }
.vin-title { font-size: 11.5px; font-weight: 600; color: var(--amber); }
.vin-text  { font-size: 10.5px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }

/* ═══════════════════════════════════════
   S7 — CÀI ĐẶT
═══════════════════════════════════════ */
.profile-card {
  margin: 4px 16px 14px;
  background: var(--bg-surface);
  border-radius: var(--r-xl);
  border: 0.5px solid var(--border);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
.avatar {
  width: 48px; height: 48px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--green-dim), #0f4a22);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800;
  color: var(--text-1);
  flex-shrink: 0;
}
.pro-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 5px;
  margin-top: 4px;
}
.set-group {
  margin: 0 16px 10px;
  background: var(--bg-surface);
  border-radius: var(--r-lg);
  border: 0.5px solid var(--border);
  overflow: hidden;
}
.set-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
}
.set-row:last-child  { border-bottom: none; }
.set-row:active      { background: var(--bg-elevated); }
.set-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.set-icon .ti { font-size: 16px; }
.set-info  { flex: 1; }
.set-lbl   { font-size: 13.5px; font-weight: 500; color: var(--text-1); }
.set-sub   { font-size: 10.5px; color: var(--text-2); margin-top: 1px; }
.set-right { display: flex; align-items: center; gap: 7px; }
.set-val   { font-size: 12px; color: var(--text-2); }
.set-arrow .ti { font-size: 14px; color: var(--text-3); }

.pipeline-card {
  margin: 0 16px 12px;
  background: var(--bg-surface);
  border-radius: var(--r-lg);
  border: 0.5px solid var(--border);
  padding: 14px 16px;
}
.pipe-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pipe-title  { font-size: 13px; font-weight: 600; color: var(--text-1); }
.pipe-done   { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--green); }
.pipe-dot-g  { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.pipe-step   { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pipe-step:last-child { margin-bottom: 0; }
.pipe-step-icon {
  width: 22px; height: 22px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ps-done-ic           { background: var(--green-bg); }
.ps-run-ic            { background: var(--amber-bg); }
.ps-run-ic .ti        { font-size: 12px; color: var(--amber); animation: spin 1s linear infinite; }
.ps-done-ic .ti       { font-size: 13px; color: var(--green); }
.ps-pending-ic        { background: var(--border); }
.ps-pending-ic .ti    { font-size: 13px; color: var(--text-3); }
.pipe-step-name       { flex: 1; font-size: 11.5px; color: var(--text-2); }
.pipe-step-name.done  { color: var(--text-1); }
.pipe-step-time       { font-size: 10px; color: var(--green); font-weight: 600; }

/* ═══════════════════════════════════════
   S8 — THÔNG BÁO & CHECKLIST
═══════════════════════════════════════ */
.checklist-card {
  margin: 0 16px 14px;
  background: linear-gradient(145deg, #0A2015, #0D2A1A);
  border: 1px solid var(--green-dim);
  border-radius: var(--r-xl);
  padding: 14px 16px;
}
.cl-header   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cl-title    { font-size: 13px; font-weight: 700; color: var(--green); }
.cl-progress { font-size: 11px; color: var(--text-2); }
.cl-bar      { height: 4px; background: rgba(63,185,80,0.2); border-radius: 2px; margin-bottom: 12px; overflow: hidden; }
.cl-bar-fill { height: 100%; background: var(--green); border-radius: 2px; }
.cl-item     { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 9px; }
.cl-item:last-child { margin-bottom: 0; }
.cl-check {
  width: 20px; height: 20px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.cl-done-ic      { background: var(--green-dim); }
.cl-done-ic .ti  { font-size: 12px; color: var(--text-1); }
.cl-todo-ic      { background: var(--bg-elevated); border: 0.5px solid var(--border-med); }
.cl-text         { font-size: 12px; line-height: 1.45; }
.cl-text.done    { color: var(--text-2); text-decoration: line-through; }
.cl-text.todo    { color: var(--text-1); }

.notif-group-lbl {
  font-size: 10.5px; font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 20px;
}
.notif-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 20px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
}
.notif-item:active { background: var(--bg-surface); }
.notif-item:last-child { border-bottom: none; }
.notif-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.notif-body { flex: 1; }
.notif-text { font-size: 12.5px; color: var(--text-1); line-height: 1.45; }
.notif-text strong { font-weight: 700; }
.notif-time { font-size: 10.5px; color: var(--text-2); margin-top: 3px; }
.notif-tag  {
  display: inline-block;
  font-size: 9.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 5px;
  margin-top: 5px;
}

/* ═══════════════════════════════════════
   S9 — ONBOARDING
═══════════════════════════════════════ */
.ob-screen    { display: flex; flex-direction: column; height: 100%; padding-bottom: 0; overflow-y: auto; scrollbar-width: none; }
.ob-screen::-webkit-scrollbar { display: none; }
.ob-skip      { padding: 10px 20px 4px; text-align: right; font-size: 12px; color: var(--text-2); cursor: pointer; }
.ob-progress  { display: flex; gap: 5px; padding: 4px 20px 16px; }
.ob-prog      { flex: 1; height: 3px; border-radius: 2px; background: var(--border); }
.ob-prog.act  { background: var(--green); }

.ob-visual {
  margin: 0 20px 20px;
  height: 160px;
  background: var(--bg-surface);
  border-radius: 24px;
  border: 0.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.ob-glow { position: absolute; width: 140px; height: 140px; border-radius: 50%; background: rgba(63,185,80,0.07); }
.ob-icon { font-size: 64px; color: var(--green); opacity: 0.9; z-index: 1; }

.ob-title    { font-size: 24px; font-weight: 800; color: var(--text-1); letter-spacing: -0.6px; line-height: 1.2; padding: 0 22px; }
.ob-title em { color: var(--green); font-style: normal; }
.ob-body     { font-size: 13px; color: var(--text-2); padding: 10px 22px 0; line-height: 1.6; }

.ob-points      { padding: 14px 22px 0; }
.ob-point       { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 12px; }
.ob-point-icon  {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ob-point-icon .ti       { font-size: 15px; }
.ob-point-text           { font-size: 12.5px; color: var(--text-2); line-height: 1.5; padding-top: 5px; }
.ob-point-text strong    { color: var(--text-1); font-weight: 600; }

.ob-dots     { display: flex; justify-content: center; gap: 7px; padding: 16px 0 10px; margin-top: auto; }
.ob-dot      { width: 7px; height: 7px; border-radius: 3px; background: var(--border-med); }
.ob-dot.act  { width: 20px; background: var(--green); }

.ob-cta       { padding: 4px 20px 16px; }
.ob-btn-main  {
  width: 100%; background: var(--green-dim);
  border-radius: var(--r-lg); padding: 16px;
  text-align: center; font-size: 15px; font-weight: 700;
  color: var(--text-1); cursor: pointer; margin-bottom: 9px;
  letter-spacing: -0.2px;
}
.ob-btn-main:active { opacity: 0.85; }
.ob-btn-sub {
  width: 100%; background: var(--bg-surface);
  border-radius: var(--r-lg); padding: 14px;
  text-align: center; font-size: 13px; font-weight: 600;
  color: var(--text-2); cursor: pointer;
  border: 0.5px solid var(--border-med);
}

/* ═══════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════ */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════
   FULL-SCREEN MODE (real mobile device)
═══════════════════════════════════════ */
@media (max-width: 430px) {
  body {
    background: var(--bg-base);
  }

  .phone-shell {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    /* Tránh bị che bởi status bar hệ thống (notch / Dynamic Island) */
    padding-top: env(safe-area-inset-top);
    box-sizing: border-box;
  }

  .notch { display: none; }
  .status-bar { display: none; }

  /* Bottom nav: tránh home indicator trên iPhone X+ */
  .bottom-nav {
    height: calc(68px + env(safe-area-inset-bottom));
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
}
