/* ================================================================
   EkorIQ - shared design system
   ================================================================ */
:root {
  --bg:        #0a0e17;
  --bg-2:      #101724;
  --surface:   #151d2e;
  --surface-2: #1b2538;
  --line:      #253046;
  --line-2:    #32405c;

  --text:      #e8edf7;
  --text-2:    #9aa8c2;
  --text-3:    #6b7a96;

  --gold:      #f0b429;
  --gold-dim:  #b3841c;
  --teal:      #2dd4bf;
  --blue:      #60a5fa;
  --violet:    #a78bfa;
  --red:       #f87171;
  --green:     #4ade80;
  --amber:     #fbbf24;

  --op-magnum:  #eab308;
  --op-toto:    #ef4444;
  --op-damacai: #3b82f6;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.28);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 60px rgba(0,0,0,.45);

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 400 15px/1.6 var(--sans);
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 600px at 82% -8%, rgba(240,180,41,.09), transparent 62%),
    radial-gradient(900px 520px at 8% 4%, rgba(45,212,191,.07), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
}
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.22; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: clamp(2rem, 5vw, 3.3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2.05rem); }
h3 { font-size: 1.13rem; }
h4 { font-size: .95rem; }
p  { margin: 0 0 1em; color: var(--text-2); }
a  { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: .82rem; }
code, .mono { font-family: var(--mono); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
.wrap-narrow { max-width: 780px; }
.muted   { color: var(--text-2); }
.dim     { color: var(--text-3); }
.center  { text-align: center; }
.nowrap  { white-space: nowrap; }
.right   { text-align: right; }
.hidden  { display: none !important; }
.mt0 { margin-top: 0; } .mt1 { margin-top: .5rem; } .mt2 { margin-top: 1rem; }
.mt3 { margin-top: 1.75rem; } .mt4 { margin-top: 2.5rem; }
.mb0 { margin-bottom: 0; } .mb2 { margin-bottom: 1rem; } .mb3 { margin-bottom: 1.75rem; }

/* ------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,14,23,.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; align-items: center; gap: 1.25rem;
  height: 62px;
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.06rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 9px;
  background: url('/img/logo-mark.svg') center / cover no-repeat;
  box-shadow: 0 2px 10px rgba(240,180,41,.3);
}
.nav {
  display: flex; align-items: center; gap: .35rem;
  margin-left: auto; min-width: 0;
}
.nav a {
  color: var(--text-2); padding: .45rem .7rem; border-radius: var(--r-sm);
  font-size: .9rem; font-weight: 500; white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav a.active { color: var(--gold); }

/* Drop the marketing links before the bar can overflow a narrow viewport. */
@media (max-width: 780px) {
  .nav a.nav-secondary { display: none; }
  .site-header .bar { gap: .6rem; }
  .brand span:last-child { font-size: 1rem; }
}
@media (max-width: 380px) {
  .brand span:last-child { display: none; }
}

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.15rem; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font: 600 .9rem/1 var(--sans); cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s, opacity .15s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--line); border-color: var(--line-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(160deg, var(--gold), #dd9a0f);
  border-color: transparent; color: #1a1200;
  box-shadow: 0 2px 14px rgba(240,180,41,.24);
}
.btn-primary:hover { background: linear-gradient(160deg, #ffc53d, #e5a417); }
.btn-teal { background: linear-gradient(160deg, var(--teal), #14b8a6); border-color: transparent; color: #04231f; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface); }
.btn-danger { background: transparent; border-color: rgba(248,113,113,.4); color: var(--red); }
.btn-danger:hover { background: rgba(248,113,113,.1); }
.btn-sm { padding: .38rem .7rem; font-size: .8rem; border-radius: var(--r-sm); }
.btn-lg { padding: .85rem 1.7rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* -------------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.4rem;
}
.card-pad-lg { padding: 1.9rem; }
.card-head {
  display: flex; align-items: center; gap: .75rem;
  margin: -.25rem 0 1.1rem;
}
.card-head h3, .card-head h2 { margin: 0; }
.card-head .spacer { margin-left: auto; }
.grid { display: grid; gap: 1.1rem; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.row-tight { gap: .4rem; }

/* -------------------------------------------------------------- stats */
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1.05rem 1.15rem;
}
.stat-label { font-size: .73rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); font-weight: 650; }
.stat-value { font: 700 1.75rem/1.15 var(--sans); margin: .35rem 0 .15rem; letter-spacing: -.03em; }
.stat-value.mono { font-family: var(--mono); font-size: 1.5rem; }
.stat-sub { font-size: .8rem; color: var(--text-3); }
.stat.gold  .stat-value { color: var(--gold); }
.stat.teal  .stat-value { color: var(--teal); }
.stat.green .stat-value { color: var(--green); }
.stat.red   .stat-value { color: var(--red); }
.stat.blue  .stat-value { color: var(--blue); }

/* -------------------------------------------------------------- pills */
.pill {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: 999px;
  font: 600 .72rem/1.5 var(--sans); letter-spacing: .02em;
  border: 1px solid var(--line-2); color: var(--text-2); background: var(--surface-2);
}
.pill-gold  { color: var(--gold);  border-color: rgba(240,180,41,.35); background: rgba(240,180,41,.1); }
.pill-teal  { color: var(--teal);  border-color: rgba(45,212,191,.32); background: rgba(45,212,191,.1); }
.pill-green { color: var(--green); border-color: rgba(74,222,128,.32); background: rgba(74,222,128,.1); }
.pill-red   { color: var(--red);   border-color: rgba(248,113,113,.32); background: rgba(248,113,113,.1); }
.pill-blue  { color: var(--blue);  border-color: rgba(96,165,250,.32); background: rgba(96,165,250,.1); }
.pill-amber { color: var(--amber); border-color: rgba(251,191,36,.32); background: rgba(251,191,36,.1); }
.pill-violet{ color: var(--violet);border-color: rgba(167,139,250,.32);background: rgba(167,139,250,.1); }

/* ------------------------------------------------------- 4D number ball */
.ball {
  display: inline-grid; place-items: center;
  min-width: 64px; padding: .5rem .6rem;
  border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line-2);
  font: 700 1.35rem/1 var(--mono); letter-spacing: .06em; color: var(--text);
}
.ball-lg { min-width: 86px; font-size: 1.75rem; padding: .7rem .75rem; }
.ball-sm { min-width: 50px; font-size: .95rem; padding: .3rem .4rem; border-radius: var(--r-sm); }
.ball-gold { border-color: rgba(240,180,41,.5); background: rgba(240,180,41,.12); color: var(--gold); }
.ball-teal { border-color: rgba(45,212,191,.45); background: rgba(45,212,191,.1); color: var(--teal); }

/* --------------------------------------------------------------- pick */
.pick {
  display: flex; align-items: flex-start; gap: .95rem;
  padding: .9rem 1rem;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-2);
  transition: border-color .15s, background .15s;
}
.pick:hover { border-color: var(--line-2); background: var(--surface); }
.pick-rank {
  flex: 0 0 26px; height: 26px; display: grid; place-items: center;
  border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line-2);
  font: 700 .78rem/1 var(--mono); color: var(--text-3);
}
.pick:nth-child(1) .pick-rank,
.pick:nth-child(2) .pick-rank,
.pick:nth-child(3) .pick-rank { background: rgba(240,180,41,.16); border-color: rgba(240,180,41,.4); color: var(--gold); }
.pick-num { font: 700 1.5rem/1 var(--mono); letter-spacing: .07em; flex: 0 0 auto; min-width: 5.2ch; }
.pick-body { flex: 1 1 auto; min-width: 0; }
.pick-reasons { margin: .3rem 0 0; padding: 0; list-style: none; font-size: .82rem; color: var(--text-3); }
.pick-reasons li { position: relative; padding-left: .85rem; }
.pick-reasons li::before { content: "·"; position: absolute; left: .15rem; color: var(--text-3); }
.pick-meta { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .4rem; }

/* -------------------------------------------------------------- forms */
label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-2); margin-bottom: .35rem; }
input, select, textarea {
  width: 100%; padding: .6rem .75rem;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font: 400 .92rem/1.4 var(--sans);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240,180,41,.13);
}
input[type="checkbox"] { width: auto; accent-color: var(--gold); }
textarea { resize: vertical; min-height: 96px; font-family: var(--mono); font-size: .84rem; }
select { appearance: none; padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.field { margin-bottom: 1rem; }
.field-inline { display: flex; align-items: center; gap: .5rem; }
.field-inline label { margin: 0; font-weight: 400; font-size: .87rem; }
.field-hint { font-size: .78rem; color: var(--text-3); margin-top: .3rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; margin: 0 0 1rem; }
legend { padding: 0 .4rem; font-size: .8rem; font-weight: 650; color: var(--text-2); }

/* ------------------------------------------------------------- tables */
.table-scroll { overflow-x: auto; margin: 0 -1.4rem -1.4rem; padding: 0 1.4rem 1.4rem; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th {
  text-align: left; padding: .55rem .7rem; font-size: .72rem; font-weight: 650;
  text-transform: uppercase; letter-spacing: .07em; color: var(--text-3);
  border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
td { padding: .62rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: var(--bg-2); }
tbody tr:last-child td { border-bottom: 0; }
td.mono, th.mono { font-family: var(--mono); }
.table-empty { padding: 2.5rem 1rem; text-align: center; color: var(--text-3); }

/* ------------------------------------------------------------ notices */
.notice {
  display: flex; gap: .8rem; align-items: flex-start;
  padding: .9rem 1.1rem; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--surface-2);
  font-size: .88rem; line-height: 1.55;
}
.notice p:last-child { margin-bottom: 0; }
.notice strong { color: var(--text); }
.notice-icon { flex: 0 0 auto; font-size: 1.05rem; line-height: 1.4; }
.notice-warn   { border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); }
.notice-danger { border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.08); }
.notice-info   { border-color: rgba(96,165,250,.32); background: rgba(96,165,250,.07); }
.notice-teal   { border-color: rgba(45,212,191,.3); background: rgba(45,212,191,.07); }

.alert { padding: .7rem .9rem; border-radius: var(--r-sm); font-size: .87rem; margin-bottom: 1rem; }
.alert-error { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.35); color: #fca5a5; }
.alert-ok    { background: rgba(74,222,128,.12); border: 1px solid rgba(74,222,128,.32); color: #86efac; }
.alert ul { margin: .3rem 0 0; padding-left: 1.1rem; }

/* --------------------------------------------------------------- tabs */
.tabs {
  display: flex; gap: .2rem; overflow-x: auto;
  border-bottom: 1px solid var(--line); margin-bottom: 1.6rem;
}
.tab {
  padding: .65rem 1rem; background: none; border: 0; cursor: pointer;
  color: var(--text-3); font: 600 .89rem/1 var(--sans);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ------------------------------------------------------- segmented op */
.segs { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); }
.seg {
  padding: .4rem .85rem; border: 0; background: none; cursor: pointer;
  color: var(--text-3); font: 600 .84rem/1 var(--sans); border-radius: 7px;
}
.seg:hover { color: var(--text-2); }
.seg.active { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.seg[data-op="magnum"].active  { color: var(--op-magnum); }
.seg[data-op="toto"].active    { color: var(--op-toto); }
.seg[data-op="damacai"].active { color: var(--op-damacai); }
.seg:disabled { opacity: .35; cursor: not-allowed; }
/* A locked segment stays readable rather than fading to nothing: it is an
   upgrade prompt, so it has to be legible enough to be one. */
.seg-locked:disabled { opacity: .55; }
.seg-locked::after { content: " 🔒"; font-size: .7em; }
.seg-count {
  display: inline-block; margin-left: .4rem; padding: .1rem .35rem;
  border-radius: 999px; background: var(--line); color: var(--text-3);
  font: 700 .66rem/1.3 var(--mono);
}
.seg.active .seg-count { background: var(--gold); color: #1a1200; }

/* ---------------------------------------------- advanced signal breakdown */
.signal-details { margin-top: .6rem; }
.signal-details > summary {
  cursor: pointer; list-style: none; display: inline-block;
  font: 600 .76rem/1 var(--sans); color: var(--teal);
  padding: .3rem .55rem; border: 1px solid var(--line); border-radius: var(--r-sm);
}
.signal-details > summary::-webkit-details-marker { display: none; }
.signal-details > summary::before { content: "+ "; }
.signal-details[open] > summary::before { content: "− "; }
.signal-details > summary:hover { background: var(--surface-2); color: var(--text); }
.signal-table { margin-top: .7rem; display: grid; gap: .22rem; }
.signal-row {
  display: grid; align-items: center; gap: .5rem;
  grid-template-columns: minmax(0, 13rem) 2.6rem minmax(3rem, 1fr) 2.4rem 3.6rem;
  font-size: .76rem;
}
.signal-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signal-weight { color: var(--text-3); text-align: right; font-family: var(--mono); font-size: .72rem; }
.signal-bar { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.signal-fill { display: block; height: 100%; background: var(--teal); border-radius: 3px; }
.signal-fill.neg { background: var(--red); }
.signal-100 { text-align: right; color: var(--text-3); font-size: .72rem; }
.signal-contrib { text-align: right; color: var(--teal); font-size: .72rem; }
.signal-contrib.neg { color: var(--red); }
@media (max-width: 620px) {
  .signal-row { grid-template-columns: minmax(0, 1fr) 2.4rem 2.2rem 3.4rem; }
  .signal-bar { display: none; }
}

/* Lift bar in the structural report: 1.00 is the fair-draw expectation. */
.lift-bar {
  display: block; height: 5px; margin-top: .3rem; border-radius: 3px;
  background: var(--bg-2); overflow: hidden; min-width: 60px;
}
.lift-fill { display: block; height: 100%; background: var(--violet); border-radius: 3px; }

/* ------------------------------------------------------------- charts */
.bars { display: grid; gap: .35rem; }
.bar-row { display: grid; grid-template-columns: 2.6rem 1fr 4.2rem; gap: .6rem; align-items: center; font-size: .82rem; }
.bar-track { height: 9px; background: var(--bg-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--blue)); }
.bar-fill.gold { background: linear-gradient(90deg, var(--gold-dim), var(--gold)); }
.bar-fill.red  { background: linear-gradient(90deg, #b91c1c, var(--red)); }
.bar-label { color: var(--text-3); font-family: var(--mono); }
.bar-value { text-align: right; color: var(--text-2); font-family: var(--mono); font-size: .78rem; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.heat { display: grid; grid-template-columns: 1.4rem repeat(10, 1fr); gap: 2px; font-size: .68rem; }
.heat-cell { aspect-ratio: 1.5; border-radius: 3px; display: grid; place-items: center; font-family: var(--mono); color: rgba(255,255,255,.75); }
.heat-axis { display: grid; place-items: center; color: var(--text-3); font-family: var(--mono); }

/* ------------------------------------------------------------ loading */
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease-in-out infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.sk-line { height: 12px; margin-bottom: .5rem; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--gold);
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { padding: 2.5rem; text-align: center; color: var(--text-3); }

/* --------------------------------------------------------------- misc */
.locked {
  position: relative; border: 1px dashed var(--line-2); border-radius: var(--r);
  padding: 1.6rem; text-align: center; background: var(--bg-2);
}
.locked h4 { color: var(--gold); margin-bottom: .35rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; font-size: .87rem; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); text-align: right; }
.truth-box {
  border-left: 3px solid var(--amber); background: rgba(251,191,36,.06);
  padding: .85rem 1.1rem; border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: .85rem;
  color: var(--text-2);
}
.truth-box strong { color: var(--amber); }
.modal-back {
  position: fixed; inset: 0; z-index: 100; background: rgba(4,7,12,.78);
  display: grid; place-items: center; padding: 1.5rem; backdrop-filter: blur(3px);
}
.modal {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); width: min(620px, 100%); max-height: 86vh; overflow-y: auto; padding: 1.6rem;
}
.toast-host { position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 200; display: grid; gap: .5rem; max-width: 380px; }
.toast {
  padding: .75rem 1rem; border-radius: var(--r); background: var(--surface-2);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: .87rem;
  animation: rise .25s ease-out;
}
.toast-ok  { border-color: rgba(74,222,128,.4); }
.toast-err { border-color: rgba(248,113,113,.45); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- footer */
.site-footer {
  margin-top: 4.5rem; border-top: 1px solid var(--line);
  background: rgba(0,0,0,.25); padding: 2.5rem 0 2rem;
  font-size: .85rem; color: var(--text-3);
}
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 2rem; }
.footer-grid h4 { color: var(--text-2); font-size: .76rem; text-transform: uppercase; letter-spacing: .09em; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.footer-grid a { color: var(--text-3); }
.footer-grid a:hover { color: var(--text-2); }
.footer-legal { border-top: 1px solid var(--line); padding-top: 1.5rem; line-height: 1.65; }

/* ------------------------------------------------------------- layout */
.portal { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 62px); align-items: start; }
.side { border-right: 1px solid var(--line); padding: 1.4rem 1rem; position: sticky; top: 62px; }
.side h4 { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin: 1.3rem 0 .5rem; }
.side h4:first-child { margin-top: 0; }
.side-nav { display: grid; gap: 2px; }
.side-nav button {
  display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left;
  padding: .55rem .7rem; border: 0; border-radius: var(--r-sm); background: none; cursor: pointer;
  color: var(--text-2); font: 500 .89rem/1.3 var(--sans);
}
.side-nav button:hover { background: var(--surface); color: var(--text); }
.side-nav button.active { background: var(--surface-2); color: var(--gold); font-weight: 600; }
.side-nav .lock { margin-left: auto; font-size: .7rem; color: var(--text-3); }
.main { padding: 1.8rem clamp(16px, 3vw, 32px) 4rem; min-width: 0; }
.page-head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h2 { margin: 0 0 .25rem; }
.page-head .spacer { margin-left: auto; }

@media (max-width: 860px) {
  .portal { grid-template-columns: 1fr; }
  .side { position: static; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-nav { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .side h4 { margin-top: 1rem; }
}

/* ----------------------------------------------------------- landing */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.4rem;
  padding: .3rem .8rem; border-radius: 999px;
  background: rgba(240,180,41,.1); border: 1px solid rgba(240,180,41,.28);
  font: 600 .78rem/1.5 var(--sans); color: var(--gold);
}
.hero h1 { max-width: 22ch; margin-bottom: 1.1rem; }
.hero .lede { font-size: clamp(1rem, 2vw, 1.18rem); max-width: 58ch; color: var(--text-2); }
.hero-cta { display: flex; gap: .7rem; flex-wrap: wrap; margin: 2rem 0 1rem; }
.hero-note { font-size: .84rem; color: var(--text-3); }
.hero-grid { display: grid; gap: 2.5rem; grid-template-columns: 1.15fr .85fr; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* A live dot beats an emoji in the hero eyebrow: it says "this updates"
   without importing a second typeface's worth of colour. */
.dot-live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 0 3px rgba(45,212,191,.18);
}

/* Four facts pulled from the database, not from the copy. */
.trust-bar {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem;
  margin-top: 1.8rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
}
.trust-item { display: flex; gap: .6rem; align-items: flex-start; color: var(--text-3); }
.trust-item svg { flex: 0 0 auto; margin-top: .15rem; color: var(--gold-dim); }
.trust-value { font: 650 .95rem/1.3 var(--sans); color: var(--text); font-variant-numeric: tabular-nums; }
.trust-label { font-size: .74rem; color: var(--text-3); line-height: 1.35; }
@media (max-width: 620px) { .trust-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
/* Alternating bands so the page reads as distinct chapters rather than one
   continuous scroll of cards. */
.section-alt { background: rgba(16,23,36,.55); border-block: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: 2.2rem; }
.section-head .eyebrow { font: 650 .76rem/1.5 var(--sans); text-transform: uppercase; letter-spacing: .11em; color: var(--teal); margin-bottom: .6rem; }

.feature { padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.feature-icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line-2);
  font: 650 .95rem/1 var(--sans); color: var(--gold); margin-bottom: .9rem;
}
.notice-icon { display: inline-flex; }

/* The Apex signal layer, visually set apart from the eight standard ones
   so the tier boundary is legible without reading a word of the copy. */
.advanced-block {
  border: 1px solid rgba(167,139,250,.32); border-radius: var(--r-lg);
  background: linear-gradient(165deg, rgba(167,139,250,.07), transparent 60%), var(--surface);
  padding: clamp(1.3rem, 3vw, 2rem);
}
.advanced-head { margin-bottom: 1.4rem; max-width: 76ch; }
.advanced-head h3 { font-size: clamp(1.05rem, 2vw, 1.3rem); margin: .7rem 0 .6rem; }
.advanced-head p { margin: 0; font-size: .92rem; }
.feature-adv { background: var(--bg-2); border-color: var(--line-2); }
.feature-icon-adv { background: rgba(167,139,250,.12); border-color: rgba(167,139,250,.35); color: var(--violet); }
.advanced-foot { font-size: .84rem; margin: 1.4rem 0 0; max-width: 84ch; }
.closing-cta { background: linear-gradient(160deg, var(--surface), var(--bg-2)); border-color: var(--line-2); }
.feature h3 { font-size: 1.02rem; }
.feature p { font-size: .88rem; margin: 0; }

/* ------------------------------------------------------------- pricing
   Five tiers on one row only works if the price row is a fixed block:
   "RM399.00" is nearly three times the width of "Free", so left to itself
   it pushed its card's feature list down and the row lost its baseline.
   Everything above .plan-features is therefore height-locked.            */
.pricing-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2.2rem;
}
.period-toggle {
  display: inline-flex; padding: 4px; gap: 4px; flex: 0 0 auto;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px;
}
.period-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem 1.05rem; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--text-2);
  font: 600 .85rem/1 var(--sans); white-space: nowrap;
  transition: background .15s, color .15s;
}
.period-btn:hover { color: var(--text); }
.period-btn.is-on { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.period-save {
  font: 700 .66rem/1 var(--sans); letter-spacing: .03em; padding: .25rem .45rem;
  border-radius: 999px; background: rgba(45,212,191,.14); color: var(--teal);
}

.plans-grid { display: grid; gap: 1rem; grid-template-columns: repeat(5, 1fr); align-items: stretch; }
@media (max-width: 1180px) { .plans-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .plans-grid { grid-template-columns: 1fr; } }

.plan {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); padding: 1.5rem 1.35rem;
}
.plan.featured { border-color: rgba(240,180,41,.45); box-shadow: 0 0 0 1px rgba(240,180,41,.2), var(--shadow); position: relative; }
.plan.featured::before {
  content: "Most popular"; position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(160deg, var(--gold), #dd9a0f); color: #1a1200; white-space: nowrap;
  font: 700 .68rem/1 var(--sans); padding: .35rem .7rem; border-radius: 999px; letter-spacing: .04em;
}
.plan-name {
  font: 650 .74rem/1 var(--sans); color: var(--text-3);
  text-transform: uppercase; letter-spacing: .12em;
}
.plan-price {
  display: flex; align-items: baseline; gap: .25rem; flex-wrap: wrap;
  min-height: 2.9rem; margin: .85rem 0 .35rem;
}
.plan-amount {
  font: 700 clamp(1.5rem, 1.35rem + .55vw, 1.95rem)/1 var(--sans);
  letter-spacing: -.035em; font-variant-numeric: tabular-nums; color: var(--text);
}
.plan-price small { font: 500 .8rem/1 var(--sans); color: var(--text-3); letter-spacing: 0; }
.plan-sub  { font-size: .78rem; color: var(--text-3); min-height: 2.7rem; }
.plan-save { font: 600 .75rem/1.5 var(--sans); color: var(--teal); min-height: 1.5em; }
.plan-save-blank { visibility: hidden; }
.plan-picks {
  display: flex; align-items: baseline; gap: .3rem; flex-wrap: wrap;
  margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line);
  font-size: .8rem; color: var(--text-2); min-height: 2.6rem;
}
.plan-picks strong { color: var(--gold); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.plan-features { list-style: none; margin: 1rem 0 1.3rem; padding: 0; display: grid; gap: .5rem; font-size: .84rem; flex: 1 1 auto; align-content: start; }
.plan-features li { display: flex; gap: .45rem; align-items: flex-start; color: var(--text-2); }
.plan-tick { flex: 0 0 auto; color: var(--teal); margin-top: .15rem; }

.faq details {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  padding: 1rem 1.2rem; margin-bottom: .7rem;
}
.faq summary { cursor: pointer; font-weight: 600; font-size: .95rem; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+ "; color: var(--gold); font-weight: 700; }
.faq details[open] summary::before { content: "− "; }
.faq details[open] summary { margin-bottom: .7rem; }
.faq p { font-size: .89rem; margin-bottom: .6rem; }
.faq p:last-child { margin-bottom: 0; }

.auth-page { display: grid; place-items: center; min-height: calc(100vh - 62px); padding: 2.5rem 1rem 4rem; }
.auth-card { width: min(440px, 100%); }
.auth-card .card { padding: 1.9rem; }
.demo-creds {
  margin-top: 1rem; padding: .8rem 1rem; border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px dashed var(--line-2); font-size: .8rem; color: var(--text-3);
}
.demo-creds code { color: var(--teal); }

@media print {
  body { background: #fff; color: #000; }
  .site-header, .side, .site-footer, .btn { display: none !important; }
}

/* A weight slider whose specified category covers more than one signal:
   marked so the split is visible rather than looking like a stray value. */
.weight-grouped { border-left: 2px solid rgba(167,139,250,.35); padding-left: .6rem; margin-left: -.6rem; }
