:root {
  --bg: #0a0e14;
  --bg-2: #0f141d;
  --surface: #141a24;
  --surface-2: #1a2230;
  --border: #232c3b;
  --text: #e6eaf0;
  --text-dim: #8b95a5;
  --text-faint: #5b6472;
  --gold: #e8b44a;
  --gold-bright: #f5c75a;
  --green: #2fbf71;
  --red: #e5534b;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.view { min-height: 100vh; }

/* Atmosphere */
.aurora {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5;
  animation: float 12s ease-in-out infinite;
}
.orb.gold {
  width: 520px; height: 520px; background: rgba(232,180,74,0.14);
  top: -160px; right: -120px;
}
.orb.green {
  width: 440px; height: 440px; background: rgba(47,191,113,0.10);
  bottom: -160px; left: -120px; animation-delay: 3s;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
}
.grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(232,180,74,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,180,74,0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 75%);
}

/* ========== Login ========== */
.login-container {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.login-card {
  width: 100%; max-width: 420px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-card .logo { text-align: center; margin-bottom: 28px; }
.login-card .logo h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.logo .gold, .nav .logo .gold { color: var(--gold); }
.subtitle {
  color: var(--text-dim); font-size: 13px; margin-top: 6px; letter-spacing: 0.2px;
}
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12.5px; color: var(--text-dim);
  margin-bottom: 7px; font-weight: 500;
}
.field input {
  width: 100%; padding: 12px 14px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text);
  font-size: 14.5px; outline: none; transition: border .15s, box-shadow .15s;
}
.field input:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,180,74,0.15);
}
.field input::placeholder { color: var(--text-faint); }
.btn-login {
  width: 100%; padding: 13px; border: none; border-radius: 9px; cursor: pointer;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #14100a; font-size: 15px; font-weight: 700; letter-spacing: 0.2px;
  transition: transform .1s, filter .15s;
}
.btn-login:hover { filter: brightness(1.05); }
.btn-login:active { transform: translateY(1px); }
.auth-error {
  color: var(--red); font-size: 0.875rem; min-height: 20px;
  text-align: center; margin-bottom: 12px;
}
.auth-success {
  color: var(--green); font-size: 0.875rem; min-height: 20px;
  text-align: center; margin-bottom: 12px;
}
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px; margin-bottom: 18px;
}
.auth-tab {
  padding: 9px 10px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-dim);
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background .15s, color .15s;
}
.auth-tab.on {
  background: linear-gradient(180deg, rgba(212,168,67,.16), rgba(212,168,67,.06));
  color: var(--gold-bright);
}
.hint-inline { font-size: 0.72rem; font-weight: 500; color: var(--text-faint); }
.login-foot-hint {
  margin-top: 14px; font-size: 0.75rem; color: var(--text-faint);
  text-align: center; line-height: 1.5;
}

/* ========== App shell ========== */
.app { position: relative; z-index: 1; }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: rgba(10,14,20,0.85); backdrop-filter: blur(8px); z-index: 10;
  gap: 12px; flex-wrap: wrap;
}
.nav .logo { font-size: 19px; font-weight: 800; letter-spacing: -0.4px; }
.nav-menu { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-btn {
  padding: 8px 16px; min-height: 44px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-dim); font-size: 14px;
  font-weight: 600; cursor: pointer;
}
.nav-btn.active { background: var(--surface-2); color: var(--gold-bright); }
.nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.user { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #b9822a);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #14100a; font-size: 14px;
}
.user-name { font-size: 13px; color: var(--text-dim); }
.logout {
  padding: 7px 14px; min-height: 44px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-dim); font-size: 13px; cursor: pointer;
}
.logout:hover { border-color: var(--gold); color: var(--gold-bright); }

.wrap { margin: 0 auto; padding: 28px 24px 40px; }
.wrap-community { max-width: 960px; }
.wrap-brains { max-width: 1000px; padding-top: 32px; padding-bottom: 48px; }

.page-error {
  color: var(--red); font-size: 13px; text-align: center; margin: 12px 0;
}

/* Hero / live */
.live-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; color: var(--green); letter-spacing: 1px;
}
.live-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(47,191,113,0.6); animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47,191,113,0.55); }
  70% { box-shadow: 0 0 0 10px rgba(47,191,113,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,191,113,0); }
}

.hero { text-align: center; margin-bottom: 30px; animation: fadeInUp .7s ease; }
.hero h1 { font-size: 27px; font-weight: 800; letter-spacing: -0.5px; }
.wrap-brains .hero h1 { font-size: 30px; }
.gold-text {
  color: var(--gold);
  background: linear-gradient(90deg, var(--gold), #ffdf8a, var(--gold));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; background-size: 200% auto;
  animation: shine 3s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }
.hero p { color: var(--text-dim); font-size: 14px; margin-top: 8px; }
.wrap-brains .hero p { font-size: 14.5px; margin-top: 10px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.stat {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; text-align: center; position: relative; overflow: hidden;
  animation: fadeInUp .7s ease backwards;
}
.stat:nth-child(2) { animation-delay: .1s; }
.stat:nth-child(3) { animation-delay: .2s; }
.stat::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(232,180,74,0.08) 50%, transparent 70%);
  transform: translateX(-100%); animation: shimmer 3.5s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}
.stat .num {
  font-size: 32px; font-weight: 800; color: var(--gold-bright);
  letter-spacing: -0.5px; font-variant-numeric: tabular-nums;
}
.stat .label { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; }
.stat .sub { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* Leaderboard */
.section-title {
  font-size: 17px; font-weight: 700; margin: 30px 0 14px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.section-title .badge {
  font-size: 11px; background: rgba(232,180,74,0.12); color: var(--gold-bright);
  padding: 3px 9px; border-radius: 20px; font-weight: 600;
}
.leaderboard { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border); border-radius: 12px;
  transition: border .2s, transform .2s, box-shadow .2s;
  animation: fadeInUp .6s ease backwards;
}
.row:hover {
  border-color: var(--gold); transform: translateX(4px);
  box-shadow: 0 8px 30px rgba(232,180,74,0.08);
}
.rank {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; background: var(--surface-2);
  color: var(--text-dim); flex-shrink: 0;
}
.rank.top {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #14100a; box-shadow: 0 0 18px rgba(232,180,74,0.35);
}
.row .info { flex: 1; min-width: 0; }
.row .name { font-size: 15px; font-weight: 700; word-break: break-word; }
.row .meta {
  font-size: 12px; color: var(--text-dim); margin-top: 3px;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.verified { color: var(--green); font-size: 11px; font-weight: 600; }
/* "เคลื่อนไหว 12 นาทีที่แล้ว" — the board only lists companies that moved,
   so the recency is the proof of life (Nook 2026-09-22). */
.row .meta .moved { color: var(--gold-bright, #f0c96a); font-size: 11px; font-weight: 600; }
.board-stats {
  display: flex; gap: 14px; align-items: center; flex-shrink: 0;
  margin-left: 12px;
}
.board-stat { text-align: right; min-width: 62px; }
.board-stat .bs-k {
  display: block; font-size: 10px; color: var(--text-faint);
  font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
}
.board-stat .bs-v {
  display: block; font-size: 13.5px; font-weight: 800; margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.board-stat .bs-v.profit { color: var(--green); }
.board-stat .bs-v.loss { color: var(--red); }
.board-stat .bs-v.flat { color: var(--text-dim); }
.board-stat .bs-v.winrate { color: var(--gold-bright); }
.board-stat .bs-sub {
  display: block; font-size: 9.5px; font-weight: 600;
  color: var(--text-faint); margin-top: 1px;
}
@media (max-width: 640px) {
  .board-stats { margin-left: 0; width: 100%; justify-content: space-between; }
  .board-stat { text-align: left; }
}
.board-empty {
  text-align: center; color: var(--text-dim); font-size: 14px;
  padding: 28px 16px; border: 1px dashed var(--border); border-radius: 12px;
}

/* แถบหลักฐานของบอร์ด (2026-09-26): บอกว่าตัวเลขยืนบนดีลจริงเท่าไร ⇒ ไม่มีช่อง
   ไหนอ่านเป็นค่าตัวอย่างได้ */
.record-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  margin: 0 0 14px; padding: 11px 15px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  font-size: 12.5px; color: var(--text-dim);
}
.record-strip .rs-source {
  display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text);
}
.record-strip .rs-item { display: flex; align-items: baseline; gap: 6px; }
.record-strip .rs-item b {
  color: var(--gold-bright); font-size: 15px; font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* CTA */
.cta {
  margin-top: 32px; padding: 26px; text-align: center;
  background: linear-gradient(180deg, rgba(232,180,74,0.08), rgba(232,180,74,0.02));
  border: 1px solid rgba(232,180,74,0.25); border-radius: var(--radius);
  animation: fadeInUp .7s ease backwards; animation-delay: .6s;
}
.cta h3 { font-size: 18px; font-weight: 700; }
.cta p { color: var(--text-dim); font-size: 13.5px; margin: 8px 0 18px; }
.cta-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  padding: 12px 22px; min-height: 44px; border-radius: 9px; border: none;
  cursor: pointer; font-size: 14px; font-weight: 700; letter-spacing: 0.2px;
  transition: transform .15s, filter .15s;
}
.btn.primary {
  /* สีทึบรองพื้นไว้ชั้นล่าง gradient: ตัวตรวจ contrast อัตโนมัติอ่าน backgroundColor
     ได้จริง (ตัวอักษรเข้ม #14100a บนทอง = 9.98 เท่า) และถ้าเบราว์เซอร์ไม่วาด gradient ก็ยังอ่านออก */
  background-color: var(--gold);
  background-image: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #14100a;
}
.btn.primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn.ghost {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
}
.btn.ghost:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-bright); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Brain cards */
.brains { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.brain-card {
  padding: 22px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border); position: relative; overflow: hidden;
  transition: border .2s, transform .2s, box-shadow .2s;
  animation: fadeInUp .6s ease backwards;
}
.brain-card:hover {
  border-color: var(--gold); transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(232,180,74,0.12);
}
.brain-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(232,180,74,0.07) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform .8s;
}
.brain-card:hover::after { transform: translateX(100%); }
.b-top { display: flex; align-items: center; justify-content: space-between; }
.b-icon { font-size: 34px; }
.b-ver {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
  background: rgba(232,180,74,0.12); color: var(--gold-bright);
}
.b-ver.soon { background: rgba(139,149,165,0.15); color: var(--text-dim); }
.b-name { font-size: 17px; font-weight: 800; margin-top: 14px; }
.b-desc { font-size: 12.5px; color: var(--text-dim); margin-top: 8px; line-height: 1.55; }
.b-feats { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.b-feat {
  font-size: 10.5px; padding: 3px 9px; border-radius: 6px;
  background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border);
}
.b-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.b-users { font-size: 12px; color: var(--text-dim); }
.b-users b { color: var(--text); }
.b-status { font-size: 12px; color: var(--text-dim); }
.b-status b { color: var(--text); }
.b-link { font-size: 12.5px; color: var(--gold-bright); font-weight: 600; }
.coming { opacity: 0.55; }
button.brain-card {
  width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit;
}
button.brain-card:disabled { cursor: not-allowed; }

/* Brain detail */
.brain-detail { padding-top: 20px; padding-bottom: 56px; animation: fadeInUp .5s ease; }
.brain-back { margin-bottom: 20px; }
.brain-detail-head {
  display: flex; gap: 18px; align-items: flex-start; margin-bottom: 28px;
}
.brain-detail-icon {
  width: 48px; height: 48px; flex: 0 0 48px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
}
.brain-detail-icon svg { width: 44px; height: 44px; display: block; }
.brain-detail-name { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; margin-top: 6px; }
.brain-detail-desc { color: var(--text-dim); font-size: 14px; line-height: 1.6; margin-top: 10px; max-width: 720px; }
.brain-section-title {
  font-size: 15px; font-weight: 700; margin: 24px 0 14px; color: var(--text);
}
.brain-cycle-steps { display: grid; gap: 10px; margin-bottom: 8px; }
.brain-cycle-step {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
}
.brain-cycle-num {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(232,180,74,0.15); color: var(--gold-bright); font-weight: 800; font-size: 13px;
}
.brain-cycle-title { font-weight: 700; font-size: 13px; color: var(--gold-bright); }
.brain-cycle-body { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; line-height: 1.55; }
.brain-dept-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.brain-dept-card {
  padding: 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); min-height: 110px;
}
.brain-dept-card.ceo { border-color: rgba(232,180,74,0.35); }
.brain-dept-av {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: var(--gold-bright);
}
.brain-dept-card.ceo .brain-dept-av { background: rgba(232,180,74,0.12); }
.brain-dept-name { font-size: 13px; font-weight: 700; margin-top: 10px; }
.brain-dept-scope { font-size: 11px; color: var(--text-dim); margin-top: 6px; line-height: 1.45; }
.brain-use-row { margin-top: 32px; text-align: center; }
.brain-use-btn { min-width: 260px; padding: 14px 28px; font-size: 15px; font-weight: 700; }
.brain-use-hint { font-size: 12px; color: var(--text-faint); margin-top: 12px; }

@media (max-width: 900px) {
  .brain-dept-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .brain-dept-grid { grid-template-columns: 1fr; }
  .brain-detail-head { flex-direction: column; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 800px) {
  .brains { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .nav-btn { padding: 8px 10px; font-size: 13px; }
  .hero h1, .wrap-brains .hero h1 { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── ผลจริงในบอร์ด: ชนะ / กันหน้าทุน / แพ้ แยกสีกัน (Nook 2026-09-27) ── */
.board-stat .bs-v .profit { color: var(--green); }
.board-stat .bs-v .be { color: var(--gold-bright); }
.board-stat .bs-v .loss { color: var(--red); }
.board-stat { min-width: 78px; }
.board-stats { flex-wrap: wrap; row-gap: 8px; justify-content: flex-end; }
/* แถวความน่าเชื่อถือ: จับคู่คำสั่งได้กี่ % / ไม้ปิดมี SL จริงกี่ % — ตัวเลขต้องบอก
   ตัวเองได้ว่ายืนบนหลักฐานแค่ไหน ไม่ใช่โชว์สวยอย่างเดียว */
.row .board-rel {
  width: 100%; text-align: right; font-size: 10px; font-weight: 600;
  color: var(--text-faint); margin-top: 4px;
}

/* ── บล็อก "ผลจริงจากดีลโบรก" ในหน้า dashboard ── */
.dash2-proof { padding: 12px 14px 14px; }
.pf-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px 12px;
}
.pf-cell { display: flex; flex-direction: column; gap: 2px; }
.pf-k { font-size: 10px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .4px; }
.pf-v { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pf-v.win { color: var(--green); }
.pf-v.loss { color: var(--red); }
.pf-v.be { color: var(--gold-bright); }
.pf-v.flat { color: var(--text-dim); }
.pf-sub { font-size: 9.5px; font-weight: 600; color: var(--text-faint); }

.pf-line {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line, rgba(255,255,255,0.07));
}
.pf-line .pf-k { font-size: 10.5px; }
.pf-line .pf-v { font-size: 13.5px; }
.pf-line .pf-sub { flex: 1 1 100%; }

.pf-tl { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line, rgba(255,255,255,0.07)); }
.pf-tl-head { font-size: 10px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.pf-tl-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 5px 0; border-bottom: 1px dashed rgba(255,255,255,0.05); font-size: 11.5px;
}
.pf-tl-row .t { color: var(--text-faint); font-variant-numeric: tabular-nums; min-width: 116px; }
.pf-tl-row .what { flex: 1 1 150px; color: var(--text-dim); }
.pf-r { font-weight: 800; font-variant-numeric: tabular-nums; }
.pf-r.win { color: var(--green); }
.pf-r.loss { color: var(--red); }
.pf-r.be { color: var(--gold-bright); }
.pf-r.other { color: var(--text-faint); }
.pf-net { font-weight: 700; font-variant-numeric: tabular-nums; }
.pf-badge {
  font-size: 9.5px; font-weight: 800; padding: 2px 6px; border-radius: 6px;
  border: 1px solid currentColor; opacity: .95;
}
.pf-badge.win { color: var(--green); }
.pf-badge.loss { color: var(--red); }
.pf-badge.be { color: var(--gold-bright); }
.pf-badge.other { color: var(--text-faint); }
.pf-src { font-size: 9.5px; color: var(--text-faint); }
.pf-src.warn { color: var(--gold-bright); }

/* ── ป้าย "Cent": บัญชี cent คืนเงินเป็นเซนต์ ──
   ตัวเลขบนจอโชว์แบบเดียวกับที่ลูกค้าเห็นใน MT5 ป้ายนี้กันอ่านผิดว่าเป็นดอลลาร์
   (Nook 2026-09-27) */
.cent-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid var(--gold-bright);
  border-radius: 999px;
  background: rgba(232, 180, 74, 0.10);
  color: var(--gold-bright);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  vertical-align: middle;
  white-space: nowrap;
}

.pf-cell .cent-tag, .pf-v .cent-tag { font-size: 10px; }

/* คำเตือนความน่าเชื่อถือ (เช่น นาฬิกาโบรกยังยืนยันไม่ครบ 3 คู่) */
.pf-warn {
  color: var(--warn, #d9a441);
  font-size: 11.5px;
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════════════════
   บอร์ดกลางแบบ "TERMINAL" (Nook 2026-09-26: เลือกแบบที่ 1 จาก 2 แบบที่เสนอ)
   แนวคิด: หน้าจอเทรด — ตัวเลข/ป้ายเป็นโมโน ตัวเลขเรียงเป็นคอลัมน์ตรงกัน อ่านเร็ว
     แถบบน = ยอดรวมทุกบริษัท | หนึ่งแถว = หนึ่งบริษัท อ่านซ้าย → ขวา:
       ใคร → ผลไม้จริง → R รวม → เงินที่โบรกคืน → ค่า AI ที่จ่ายไป
   ทุกช่องเป็นตัวเลขจริงจากดีลของโบรก ของบริษัทนั้นบริษัทเดียว. ไม่มี emoji,
   ไม่มี CDN, ตัวอักษรเล็กสุด 9.5px, ไม่ล้นจอทั้งเดสก์ท็อปและมือถือ
   ══════════════════════════════════════════════════════════════════════════ */
.cx-head, .cx-h1, .cx-lede, .cx-note, #recordStrip, .cx-thead, .cx-rows {
  --cx-mono: "SF Mono", "SFMono-Regular", ui-monospace, Menlo, "Thonburi", sans-serif;
  font-family: var(--cx-mono);
  font-variant-numeric: tabular-nums;
}
.wrap-community { max-width: 1120px; }


/* ── หัวบอร์ด: แบรนด์ซ้าย · ที่มาของตัวเลข + เวลาขวา ────────────────────── */
.cx-head {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  align-items: baseline; justify-content: space-between;
  padding-bottom: 11px; border-bottom: 1px solid var(--border);
}
.cx-brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cx-mark { font-size: 13.5px; font-weight: 700; letter-spacing: 2px; color: var(--text); }
.cx-brand-sub { font-size: 11.5px; color: var(--text-dim); }
.cx-src {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-dim);
}
.cx-src b { color: var(--text); font-weight: 700; }
.cx-src .cx-sep { color: var(--text-faint); }
.cx-live { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-bright); }

.cx-h1 { margin-top: 18px; font-size: 23px; font-weight: 700; line-height: 1.35; letter-spacing: -0.2px; }
.cx-lede { margin-top: 9px; max-width: 820px; font-size: 12.5px; line-height: 1.7; color: var(--text-dim); }
.cx-note { margin-top: 12px; font-size: 11px; line-height: 1.65; color: var(--text-faint); }

/* ── แถบตัวเลขเด่น 4 ช่อง (ยอดรวมทุกบริษัท) — คั่นด้วยเส้นตั้ง บางกว่าเดิม ── */
.cx-hero {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px; border: 1px solid var(--border); border-radius: 4px;
  background: linear-gradient(180deg, var(--bg-2), rgba(10, 14, 20, 0.55));
  overflow: hidden;
}
.cx-hero-c {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px 13px; border-left: 1px solid var(--border);
}
.cx-hero-c:first-child { border-left: none; }
.cx-hero-k {
  font-size: 9.5px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-dim);
}
.cx-hero-v {
  font-size: 32px; font-weight: 700; line-height: 1.06; letter-spacing: -1px;
  color: var(--gold-bright);
}
.cx-hero-v.sm { font-size: 25px; color: var(--text); letter-spacing: -0.6px; }
.cx-hero-v.loss { color: var(--red); }
.cx-hero-v.dim { color: var(--text-dim); }
.cx-hero-s { font-size: 10px; line-height: 1.55; color: var(--text-faint); }

/* ── แถบข้อเท็จจริง: ช่องเล็กเรียงต่อกันเป็นตารางเส้นhairline ───────────── */
.cx-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(102px, 1fr));
  gap: 1px; margin: 10px 0 22px; background: var(--border);
  border: 1px solid var(--border); border-radius: 4px; overflow: hidden;
}
.cx-fact { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; background: var(--bg-2); }
.cx-fact-v { font-size: 16px; font-weight: 700; line-height: 1.25; color: var(--gold-bright); }
.cx-fact-v.win { color: var(--green); }
.cx-fact-v.be { color: var(--gold-bright); }
.cx-fact-v.loss { color: var(--red); }
.cx-fact-v.dim { color: var(--text-dim); }
.cx-fact-k { font-size: 9.5px; letter-spacing: 0.4px; color: var(--text-faint); }

/* ── ตารางบริษัท: หัวคอลัมน์เดียวกับแถว เป๊ะ (คอลัมน์เดียวกันทั้งบอร์ด) ──── */
.cx-thead {
  display: grid;
  grid-template-columns: 34px minmax(196px, 1.25fr) minmax(176px, 1.3fr) 164px 190px 156px;
  gap: 14px; padding: 0 14px 8px; border-bottom: 1px solid var(--border);
  font-size: 9.5px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-faint);
}
.cx-rows { display: block; }

.cx-row {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(196px, 1.25fr) minmax(176px, 1.3fr) 164px 190px 156px;
  gap: 14px; align-items: start;
  padding: 13px 14px; border-bottom: 1px solid var(--border);
  transition: background 0.18s ease;
  animation: fadeInUp 0.5s ease backwards;
}
.cx-row::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: transparent; transition: background 0.18s ease;
}
.cx-row:hover { background: rgba(232, 180, 74, 0.045); }
.cx-row:hover::before { background: var(--gold); }

.cx-rank { font-size: 11.5px; font-weight: 700; color: var(--text-faint); padding-top: 2px; }
.cx-rank.top { color: var(--gold-bright); }

.cx-lbl { display: none; }

.cx-co-name {
  font-size: 14px; font-weight: 700; color: var(--text);
  letter-spacing: 0.2px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.cx-co-sub { margin-top: 4px; font-size: 10.5px; color: var(--text-dim); }
.cx-co-sub2 { margin-top: 2px; font-size: 10px; color: var(--text-faint); }
.cx-flag {
  white-space: nowrap;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.6px;
  color: var(--gold-bright); border: 1px solid rgba(232, 180, 74, 0.42);
  border-radius: 3px; padding: 1px 5px;
}

/* ผลไม้จริง: แท่งสัดส่วน ชนะ/กันทุน/แพ้/คิด R ไม่ได้ */
.cx-bar {
  display: flex; height: 7px; margin-top: 8px;
  border-radius: 2px; overflow: hidden; background: var(--surface-2);
}
.cx-bar i { display: block; height: 100%; }
.cx-bar i.win { background: var(--green); }
.cx-bar i.breakeven { background: var(--gold); }
.cx-bar i.loss { background: var(--red); }
.cx-bar i.unrated { background: var(--text-faint); }
.cx-res-sub { margin-top: 7px; font-size: 10.5px; color: var(--text-dim); }
.cx-res-sub b.w { color: var(--green); font-weight: 700; }
.cx-res-sub b.b { color: var(--gold-bright); font-weight: 700; }
.cx-res-sub b.l { color: var(--red); font-weight: 700; }
.cx-res-sub .dim { color: var(--text-faint); }

/* R รวม: ตัวเลข + แถบที่มีจุดศูนย์กลาง (กำไรขวา / ขาดทุนซ้าย) */
.cx-r .cx-v { font-size: 19px; font-weight: 700; line-height: 1.15; letter-spacing: -0.3px; }
.cx-rbar {
  position: relative; height: 6px; margin-top: 8px;
  background: var(--surface-2); border-radius: 2px; overflow: hidden;
}
.cx-rbar::after {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px;
  background: var(--border); opacity: 0.9;
}
.cx-rbar i { position: absolute; top: 0; bottom: 0; }
.cx-rbar i.profit { left: 50%; background: var(--green); }
.cx-rbar i.loss { right: 50%; background: var(--red); }
.cx-rbar i.flat { left: 50%; background: var(--text-faint); }
.cx-k { margin-top: 7px; font-size: 10.5px; color: var(--text-dim); }
.cx-k b { color: var(--text); font-weight: 700; }
.cx-k2 { margin-top: 2px; font-size: 10px; color: var(--text-faint); }

/* เงินจากดีลจริง + ป้าย Cent */
.cx-v { font-size: 17px; font-weight: 700; line-height: 1.2; }
.cx-v.profit { color: var(--green); }
.cx-v.loss { color: var(--red); }
.cx-v.flat { color: var(--text-dim); }
.cx-v.dim { color: var(--text-dim); }
.cx-money .cx-unit { font-size: 10.5px; font-weight: 700; color: var(--text-dim); letter-spacing: 0.5px; }
.cx-money-sub { margin-top: 6px; font-size: 10px; color: var(--text-faint); }

.cx-cov-sub { margin-top: 5px; font-size: 10px; color: var(--text-faint); }
.cx-cov-sub b.profit { color: var(--green); }
.cx-cov-sub b.loss { color: var(--red); }
.cx-cov-sub b.flat { color: var(--text-dim); }

/* ── มือถือ / แท็บเล็ต: แถวเดิมกลายเป็นการ์ดเรียงลง พร้อมป้ายกำกับทุกช่อง ── */
@media (max-width: 980px) {
  .cx-thead { display: none; }
  .cx-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-hero-c { border-top: 1px solid var(--border); }
  .cx-hero-c:nth-child(-n + 2) { border-top: none; }
  .cx-hero-c:nth-child(odd) { border-left: none; }
  .cx-hero-v { font-size: 26px; }
  .cx-hero-v.sm { font-size: 21px; }
  .cx-facts { margin-bottom: 18px; }

  .cx-row { display: block; padding: 12px 14px; }
  .cx-rank { display: inline-block; padding-top: 0; }
  .cx-co { display: inline-block; width: calc(100% - 30px); vertical-align: top; }
  .cx-res, .cx-r, .cx-money, .cx-cov {
    margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(35, 44, 59, 0.9);
  }
  .cx-lbl {
    display: block; margin-bottom: 5px; font-size: 9.5px; font-weight: 700;
    letter-spacing: 0.9px; text-transform: uppercase; color: var(--text-faint);
  }
  .cx-r .cx-v, .cx-v { font-size: 18px; }
  .cx-rbar { max-width: 220px; }
  .cx-money-sub, .cx-cov-sub, .cx-k2 { font-size: 10px; }
}

@media (max-width: 430px) {
  .cx-h1 { font-size: 21px; }
  .cx-hero-v { font-size: 23px; }
  .cx-hero-v.sm { font-size: 19px; }
  .cx-hero-c { padding: 12px 13px; }
}

/* ── ตัวอักษรรองของบอร์ด (ต้องอยู่ท้ายไฟล์: ทับค่า --text-faint ที่จมเกินไป) ──
   ของเดิม contrast 3.1 เท่า อ่านยากบนพื้นเข้ม — ยกเป็นโทนนี้ได้ ≈6.5 เท่า
   ยังจางกว่ารองปกติ แต่ผ่านเกณฑ์อ่านง่ายทั้งเดสก์ท็อปและมือถือ */
.cx-thead, .cx-thead > div, .cx-rank, .cx-hero-s, .cx-fact-k, .cx-co-sub2,
.cx-k2, .cx-money-sub, .cx-cov-sub, .cx-note, .cx-lbl, .cx-src .cx-sep,
.cx-res-sub .dim, .cx-v.dim, .cx-fact-v.dim, .cx-hero-v.dim,
.cx-cov-sub b.dim { color: #93a0b0; }
