:root {
  --bg: #050505;
  --surface: #0e0e0d;
  --surface-2: #131312;
  --sunken: #080807;
  --text: #ecebe6;
  --text-2: #b4b2aa;
  --muted: #7d7b74;
  --bg-rgb: 5, 5, 5;
  /* Warna bisa diganti dari dashboard (Tampilan > Warna); turunan dihitung di app.js */
  --gold: #d6a84e;      /* aksen: bintang, radar, label */
  --gold-rgb: 214, 168, 78;
  --gold-soft: rgba(var(--gold-rgb), .12);
  --green: #2bb673;     /* utama: highlight, skor, CTA, status positif */
  --green-rgb: 43, 182, 115;
  --green-hi: #6ee7b7;
  --green-hi2: #a7f3d0;
  --green-deep: #15803d;
  --green-mid: #1b9150;
  --green-text: #6fd6a2;
  --green-dot: #34d399;
  --on-green: #ffffff;
  --red: #e5544b;
  --amber: #e0a030;
  --radius: 18px;
  /* Bevel tipis 5% */
  --bevel: inset 0 1px 0 rgba(255, 255, 255, .05), inset 0 -1px 0 rgba(0, 0, 0, .6);
  --bevel-lift: var(--bevel), 0 10px 28px rgba(0, 0, 0, .55);
  --bevel-in: inset 0 1px 0 rgba(0, 0, 0, .7), inset 0 -1px 0 rgba(255, 255, 255, .05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--gold); }
button { font: inherit; color: inherit; }

.app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(16px, calc((100% - 528px) / 2));
  background: rgba(var(--bg-rgb), .85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .05);
}
.brand { color: var(--text); text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.brand .brand-accent {
  background: linear-gradient(90deg, var(--green) 0%, var(--green-hi) 55%, var(--green-hi2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.top-link { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; }

/* Ticker harga realtime */
/* Lebar mengikuti kolom konten (ukuran HP), widget diperkecil 80% */
.ticker {
  position: relative; max-width: 528px; height: 42px; margin: 6px auto 0; overflow: hidden; contain: paint;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
@media (max-width: 560px) { .ticker { margin-left: 16px; margin-right: 16px; } }
/* !important karena CSS bawaan TradingView memaksa width 100% */
.ticker .tradingview-widget-container { width: 111.12% !important; max-width: none !important; transform: scale(.9); transform-origin: 0 0; }
.ticker iframe { display: block; }

/* Hero */
.hero { position: relative; padding: 76px 0 8px; }
/* Chart punya area sendiri di bawah teks, tidak menimpa tulisan */
.hero-bg { position: relative; height: 96px; margin: 18px -16px 0; pointer-events: none; }
.hero-chart { display: block; width: 100%; height: 100%; overflow: visible; }
.hc-dot { position: absolute; left: 0; top: 0; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--green-dot); box-shadow: 0 0 10px rgba(var(--green-rgb), .7); will-change: transform; }
.hc-dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid var(--green-dot); opacity: 0; animation: hc-ping 2s ease-out infinite; }
@keyframes hc-ping { 0% { transform: scale(.4); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }

/* Filter chips */
.chips { display: flex; gap: 8px; margin: 6px -16px 0; padding: 2px 16px 4px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-f {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: var(--bevel);
  transition: background .15s, color .15s;
}
.chip-f b { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip-f[aria-pressed="true"] { background: var(--text); color: #0b0b0a; }
.chip-f[aria-pressed="true"] b { color: #55534d; }
.hero-kicker { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--gold); }
.hero h1 { font-size: 40px; line-height: 1.08; letter-spacing: -.035em; margin: 0 0 12px; font-weight: 600; max-width: 10em; }
.hl {
  background: linear-gradient(90deg, var(--green) 0%, var(--green-hi) 55%, var(--green-hi2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.hero-lead { color: var(--text-2); font-size: 16px; line-height: 1.55; margin: 0; max-width: 30em; }
.hero .hero-meta { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.hero-meta:empty { display: none; }


/* Search */
.search { position: relative; margin: 20px 0 16px; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input {
  width: 100%; padding: 13px 16px 13px 42px; border-radius: 12px; border: 0; background: var(--sunken);
  color: var(--text); font: inherit; font-size: 16px; outline: none; box-shadow: var(--bevel-in);
}
.search input::placeholder { color: var(--muted); }
.search input:focus { box-shadow: var(--bevel-in), 0 0 0 2px rgba(var(--gold-rgb), .45); }

/* Broker cards (expandable) */
.broker-list { display: grid; gap: 10px; }
.empty { margin: 0; padding: 28px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); box-shadow: var(--bevel); }

.card {
  scroll-margin-top: 68px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-radius: var(--radius);
  box-shadow: var(--bevel-lift);
  overflow: hidden;
}

.c-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 14px 10px; border: 0; background: none; cursor: pointer; text-align: left;
}
.c-logo { flex: none; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 12px; overflow: hidden; box-shadow: var(--bevel); }
/* Logo sudah dinormalisasi (framing & ukuran seragam), jadi gambar mengisi penuh kotaknya */
.c-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.c-title { flex: 1; min-width: 0; }
.c-name { display: block; font-weight: 700; font-size: 17px; line-height: 1.3; }
.c-sub { display: block; margin-top: 1px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.c-sub .nw { white-space: nowrap; }
.c-score { flex: none; text-align: right; line-height: 1.15; }
.c-score b { display: block; font-size: 20px; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; }
.c-score span { font-size: 11px; color: var(--muted); }
.chev { flex: none; width: 20px; display: grid; place-items: center; color: var(--muted); transition: transform .25s; }
.chev svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card.open .chev { transform: rotate(180deg); color: var(--text); }

/* Expand animation */
.c-detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.card.open .c-detail { grid-template-rows: 1fr; }
.c-inner { overflow: hidden; min-height: 0; }
.c-body { padding: 0 14px 16px; opacity: 0; transition: opacity .25s; }
.card.open .c-body { opacity: 1; }

/* Radar panel */
.panel { background: var(--sunken); border-radius: 14px; padding: 12px; box-shadow: var(--bevel-in); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
.src { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.panel svg { display: block; width: 100%; max-width: 340px; height: auto; margin: 4px auto 0; }
.radar-empty { padding: 28px 8px; text-align: center; color: var(--muted); font-size: 13px; }

/* Ikon bintang di skor */
.c-score b { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.star { width: 15px; height: 15px; fill: var(--gold); }

/* Jenis akun & instrumen */
.spec { margin-top: 12px; padding: 14px; border-radius: 14px; background: var(--sunken); box-shadow: var(--bevel-in); }
.spec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 10px; }
.spec-head + * { margin-top: 0; }
.spec > * + .spec-head { margin-top: 18px; }
.spec-head h4 { margin: 0; font-size: 13px; font-weight: 700; }
.spec-head span { font-size: 12px; color: var(--muted); }
.spec-empty { margin: 0; font-size: 13px; color: var(--muted); }

.acc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.acc {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px;
  background: var(--surface-2); box-shadow: var(--bevel); font-size: 14px; font-weight: 600; color: var(--text);
}
.acc i { font-style: normal; font-size: 11px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }

.islamic { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(var(--green-rgb), .08); font-size: 13px; color: var(--text-2); }
.islamic b { color: var(--green-text); font-weight: 700; }
.islamic svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--green-text); stroke-width: 2; stroke-linejoin: round; }

.ins-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ins {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 68px; padding: 8px 4px;
  border-radius: 10px; background: var(--surface-2); box-shadow: var(--bevel); font-size: 12.5px; font-weight: 600; color: var(--text-2); text-align: center;
}
.ins svg { width: 22px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.checked { margin-top: 8px; font-size: 12px; color: var(--muted); }
.checked a { color: var(--text-2); text-decoration: none; font-weight: 600; }
.checked.stale { color: var(--amber); }

/* Status badges */
.badges { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 12px; }
.badge { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; box-shadow: var(--bevel); }
.badge.ok { color: var(--green-text); background: rgba(var(--green-rgb), .1); }
.badge.warn { color: #f0b85a; background: rgba(224, 160, 48, .1); }
.badge.muted { color: var(--muted); background: rgba(255, 255, 255, .04); }
.badge.bad { color: #f08a83; background: rgba(229, 84, 75, .1); }

/* Buttons */
.btn { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 14px; border: 0; border-radius: 12px; font-weight: 700; font-size: 14.5px; text-decoration: none; cursor: pointer; transition: filter .15s; }
.btn-primary { background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 50%, var(--green) 100%); color: var(--on-green); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), inset 0 -1px 0 rgba(0,0,0,.25); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface-2); color: var(--text); box-shadow: var(--bevel); }
.btn-ghost:hover { filter: brightness(1.2); }
.btn[disabled] { color: var(--muted); cursor: default; filter: none; }
.c-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 14px 14px; }

.when-open { display: none; }
.card.open .when-open { display: inline; }
.card.open .when-closed { display: none; }

/* Review inline */
.c-body { padding-top: 4px; }
.verdict { padding: 14px; border-radius: 14px; background: var(--sunken); box-shadow: var(--bevel-in); }
.verdict h3 { margin: 0 0 4px; font-size: 12px; font-weight: 700; color: var(--gold); }
.verdict p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text); }
.pane { padding-top: 6px; }
.pane .panel { margin-top: 6px; }

/* Segmented tabs */
.seg { display: flex; gap: 4px; margin: 14px 0 4px; padding: 4px; border-radius: 12px; background: var(--sunken); box-shadow: var(--bevel-in); }
.seg button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.seg button[aria-selected="true"] { background: var(--surface-2); color: var(--text); box-shadow: var(--bevel); }
.seg-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; font-size: 11px; background: rgba(255, 255, 255, .07); }

.points { list-style: none; padding: 0; margin: 0; }
.points li { display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding: 14px 2px; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.points li + li { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.ico { width: 20px; height: 20px; display: grid; place-items: center; margin-top: 2px; }
.ico svg { width: 16px; height: 16px; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ico.ok svg { stroke: var(--green); }
.ico.no svg { stroke: var(--red); }
.profile { margin: 0; padding: 12px 2px 0; font-size: 15px; line-height: 1.7; color: var(--text-2); }

/* Disclaimer & footer */
.disclaimer { margin-top: 32px; padding: 16px; border-radius: var(--radius); background: var(--surface); font-size: 13px; color: var(--muted); box-shadow: var(--bevel); }
.disclaimer h2 { margin: 0 0 6px; font-size: 15px; color: var(--text); }
.disclaimer p { margin: 8px 0 0; }
.disclaimer b { color: var(--text-2); }
.disclaimer a { color: var(--gold); }
.footer { text-align: center; font-size: 12px; color: var(--muted); padding: 24px 0 0; }

/* Floating WhatsApp */
.wa {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; align-items: center; gap: 8px; padding: 10px 16px 10px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); text-decoration: none; font-weight: 700; font-size: 14px;
  box-shadow: var(--bevel), 0 8px 24px rgba(0, 0, 0, .6);
}
.wa[hidden] { display: none; }
.wa svg { width: 22px; height: 22px; fill: #25d366; }

/* Smooth scroll (Lenis) */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* Animasi muncul (hero, kartu, konten). Konten di dalam review tidak dianimasikan. */
.js .reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
  transition-delay: var(--d, 0ms);
}
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .c-detail, .c-body, .chev { transition: none; }
}
@media (min-width: 600px) {
  .c-toggle { padding: 16px 18px 10px; }
  .c-body, .badges, .c-actions { padding-left: 18px; padding-right: 18px; }
  .hero { padding-top: 96px; }
  .hero h1 { font-size: 52px; }
}
