/* Terminal: header status; daftar instrumen di kiri + grafik, sinyal & fundamental di kanan; tabel sinyal, kalender & berita. */
:root {
  --bg: #0b1118; --panel: #111a24; --panel2: #16212d; --ink: #e6edf3; --muted: #8b9bab; --line: #213041; --grid: #1a2633;
  --accent: #5b9dff; --accent2: #b98cff; --up: #2fc98a; --down: #ff6470; --warn: #f0b44c;
  --upbg: rgba(47, 201, 138, .14); --downbg: rgba(255, 100, 112, .14); --neubg: rgba(139, 155, 171, .14);
  --font-ui: "Inter", "Segoe UI", system-ui, sans-serif; --font-num: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef1f5; --panel: #ffffff; --panel2: #f5f7fa; --ink: #0f1a24; --muted: #5a6878; --line: #d8dee6; --grid: #edf0f4;
  --accent: #2457c5; --accent2: #7a3fd1; --up: #0e8a5d; --down: #c9363f; --warn: #a76a0f;
  --upbg: #e2f4ec; --downbg: #fbe6e7; --neubg: #eceff3;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font-ui); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 18px 16px 40px; display: flex; flex-direction: column; gap: 18px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: clamp(20px, 2.6vw, 26px); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 650; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.note { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--muted); }
[hidden] { display: none !important; }

/* header */
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; }
.brand { min-width: 0; max-width: 60rem; display: flex; flex-direction: column; gap: 4px; }
.sub { margin: 0; color: var(--muted); }
.sub b { color: var(--ink); }
.top-r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 12px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.pill.on .dot { background: var(--up); }
.pill.err .dot { background: var(--down); }
.pill.warn .dot { background: var(--warn); }
@media (prefers-reduced-motion: no-preference) { .pill.on .dot { animation: pulse 2s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: .35; } }
.iconbtn { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; width: 32px; height: 32px; cursor: pointer; }
.nextev { display: block; text-decoration: none; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 10px; padding: 9px 14px; font-size: 13px; }
.nextev b { font-weight: 650; }
.nextev .cd { color: var(--warn); font-family: var(--font-num); }

/* tata letak: daftar instrumen | detail */
.layout { display: grid; grid-template-columns: minmax(0, 310px) minmax(0, 1fr); gap: 18px; align-items: start; }
.side { position: sticky; top: 12px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.list { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; scrollbar-width: thin; }
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; }
  .list { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; }
  .list .group { flex: none; }
  .list .group .icards { flex-direction: row; }
  .list .icard { width: 230px; }
}

/* segmen */
.segbar { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 12px; cursor: pointer; white-space: nowrap; font-size: 12.5px; }
.seg[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg-sm { display: inline-flex; gap: 4px; }
.seg-sm.wrapflex { flex-wrap: wrap; margin-bottom: 8px; }
.seg-sm button { border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.seg-sm button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* kartu instrumen */
.group h3 { display: flex; gap: 8px; align-items: baseline; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 0 0 6px; }
.group h3 span { text-transform: none; letter-spacing: 0; font-weight: 400; }
.icards { display: flex; flex-direction: column; gap: 6px; }
.icard { all: unset; box-sizing: border-box; cursor: pointer; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; min-width: 0; }
.icard:hover { border-color: var(--muted); }
.icard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icard[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); background: var(--panel2); }
.icard .price { font-size: 15px; text-align: right; }
.icard .chg { text-align: right; }
.icard .spark { height: 24px; margin-top: 2px; }
.icard .badge { align-self: end; justify-self: end; }
.trow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tname { font-weight: 650; }
.tsub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.mkt::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.mkt.live { color: var(--up); } .mkt.live::before { background: var(--up); }
.price { font-size: 21px; font-weight: 600; border-radius: 4px; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) { .flash-up { animation: fu 1s ease-out; } .flash-down { animation: fd 1s ease-out; } }
@keyframes fu { from { background: var(--upbg); color: var(--up); } }
@keyframes fd { from { background: var(--downbg); color: var(--down); } }
.chg { font-size: 12px; font-weight: 600; }
.spark { width: 100%; height: 34px; display: block; margin-top: 4px; }
.badge { display: inline-block; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge.buy { background: var(--upbg); color: var(--up); }
.badge.sell { background: var(--downbg); color: var(--down); }
.badge.neutral { background: var(--neubg); color: var(--muted); }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge.na { color: var(--muted); border: 1px dashed var(--line); }
.skel { color: transparent !important; background: var(--neubg); border-radius: 4px; display: inline-block; min-width: 5em; }

/* kartu */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; }
.card-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 12px; }

/* detail */
.dhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.dinfo { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dtitle { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.dtitle h2 { font-size: 20px; }
.dprice { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.big { font-size: 30px; font-weight: 600; border-radius: 4px; }
.dprice .badge { align-self: center; }
.dgrid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
@media (max-width: 1200px) { .dgrid { grid-template-columns: minmax(0, 1fr); } }
.fundcol { min-width: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.sw { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 5px; }
.sw.dash { border-top: 2px dashed var(--muted); height: 0; }
.sw.dot2 { border-top: 2px dotted var(--accent2); height: 0; }
.chartwrap { position: relative; }
.chart { height: 420px; }
.rsi { height: 110px; margin-top: 4px; }
.chartmsg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; color: var(--muted); font-size: 13px; background: var(--panel); border: 1px dashed var(--line); border-radius: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px 16px; margin: 14px 0 0; }
.stats div { min-width: 0; }
.stats dt { font-size: 11px; color: var(--muted); }
.stats dd { margin: 0; font-family: var(--font-num); font-size: 13px; }
.anacol { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ana { display: flex; flex-direction: column; gap: 14px; }
.verdict { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel2); display: flex; flex-direction: column; gap: 8px; }
.verdict .vtop { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.verdict .vlabel { font-size: 20px; font-weight: 700; }
.verdict .vlabel.buy { color: var(--up); } .verdict .vlabel.sell { color: var(--down); } .verdict .vlabel.neutral { color: var(--muted); }
.gauge { display: grid; grid-template-columns: repeat(21, 1fr); gap: 3px; }
.gauge i { height: 8px; border-radius: 2px; background: var(--line); }
.gauge i.mid { background: var(--muted); opacity: .5; }
.gauge i.on-up { background: var(--up); } .gauge i.on-down { background: var(--down); }
.gscale { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
.label-sm { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.rules { width: 100%; border-collapse: collapse; font-size: 12px; }
.rules td, .rules th { padding: 5px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.rules th { color: var(--muted); font-weight: 500; }
.rules td:last-child, .rules th:last-child { text-align: right; white-space: nowrap; }
.rules td.v { color: var(--muted); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--font-num); }
.kv2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.anacol .rules { min-width: 460px; }
.rules tr.off td { opacity: .5; }
.rules td.cat { text-align: left !important; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 10px; border-bottom-color: transparent; }
.rules .acc { display: block; font-size: 11px; color: var(--muted); }
.wbar { display: inline-block; width: 36px; height: 5px; border-radius: 3px; background: var(--line); vertical-align: middle; margin-left: 6px; overflow: hidden; }
.wbar i { display: block; height: 100%; background: var(--accent); }
.parts { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 5px 10px; align-items: center; font-size: 12px; }
.parts .pb { position: relative; height: 6px; background: var(--line); border-radius: 3px; }
.parts .pb::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--muted); }
.parts .pb i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.parts .pb i.up { background: var(--up); } .parts .pb i.down { background: var(--down); }
.parts .num { text-align: right; }
.warnbox { border: 1px solid color-mix(in srgb, var(--warn) 50%, var(--line)); background: color-mix(in srgb, var(--warn) 8%, transparent); border-radius: 10px; padding: 8px 12px; font-size: 12px; }
.warnbox b { color: var(--warn); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.evl { display: flex; flex-direction: column; }
.evr > .num { white-space: nowrap; }
.evr { display: grid; grid-template-columns: 96px 34px minmax(0, 1fr) auto; gap: 2px 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; align-items: baseline; }
.evr .vals { grid-column: 3 / -1; font-size: 11px; color: var(--muted); }
.evr .vals b { color: var(--ink); font-weight: 600; }
.evr.risk { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.eff { font-size: 11px; font-weight: 650; white-space: nowrap; }
.eff.up { color: var(--up); } .eff.down { color: var(--down); } .eff.flat { color: var(--muted); }
.plan { border-radius: 10px; padding: 10px 12px; border: 1px solid var(--line); }
.plan.buy { border-color: color-mix(in srgb, var(--up) 45%, var(--line)); }
.plan.sell { border-color: color-mix(in srgb, var(--down) 45%, var(--line)); }

/* tabel sinyal */
.tablewrap { overflow-x: auto; }
table.sig { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.sig th, table.sig td { padding: 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.sig th:first-child, table.sig td:first-child, table.sig th:nth-child(4), table.sig td:nth-child(4) { text-align: left; }
table.sig th { color: var(--muted); font-weight: 500; }
table.sig tbody tr { cursor: pointer; }
table.sig tbody tr:hover td { background: var(--panel2); }
table.sig tr.segrow td { background: transparent !important; cursor: default; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 14px; }
table.sig td.k { font-weight: 650; }
table.sig td.k span { font-weight: 400; color: var(--muted); margin-left: 6px; }

/* kalender & berita */
.two { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .two { grid-template-columns: minmax(0, 1fr); } }
.toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; cursor: pointer; }
.cal, .news { max-height: 760px; overflow-y: auto; }
.cal-day h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); position: sticky; top: 0; background: var(--panel); padding: 8px 0 4px; }
.ev { display: grid; grid-template-columns: 46px 40px minmax(0, 1fr) auto; gap: 3px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: baseline; font-size: 12.5px; }
.ev .nm { font-weight: 550; overflow-wrap: anywhere; }
.ev.key .nm::after { content: " ★"; color: var(--warn); }
.ev .vals { grid-column: 3 / -1; font-size: 11.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 3px 12px; }
.ev .vals b { color: var(--ink); font-weight: 600; }
.ev.past { opacity: .6; }
.ev.soon { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.cty { font-size: 11px; font-weight: 700; color: var(--muted); }
.imp { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; letter-spacing: .03em; }
.imp-High { background: var(--downbg); color: var(--down); }
.imp-Medium { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.imp-Low, .imp-Holiday { background: var(--neubg); color: var(--muted); }
.nw { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.nw .tone { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--muted); opacity: .5; }
.nw .tone.pos { background: var(--up); opacity: 1; } .nw .tone.neg { background: var(--down); opacity: 1; }
.nw a { font-weight: 600; text-decoration: none; color: var(--ink); }
.nw a:hover { text-decoration: underline; color: var(--accent); }
.nw .meta { font-size: 11px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.sent { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.empty, .errline { font-size: 12px; color: var(--muted); padding: 10px 0; }
.errline::before { content: "● "; color: var(--down); }

.foot { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; max-width: 72rem; }
.foot p { margin: 0; }

/* tautan menu */
.navlink { text-decoration: none; color: var(--ink); }
.navlink:hover { border-color: var(--accent); color: var(--accent); }

/* kesehatan ekonomi global */
.hgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 8px; }
.hitem { all: unset; box-sizing: border-box; cursor: pointer; border: 1px solid var(--line); border-left-width: 3px; border-radius: 10px; padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; background: var(--panel2); min-width: 0; }
.hitem:hover { border-color: var(--muted); }
.hitem:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hitem.good { border-left-color: var(--up); } .hitem.bad { border-left-color: var(--down); } .hitem.mid { border-left-color: var(--muted); }
.hname { font-size: 11.5px; color: var(--muted); }
.hval { font-size: 16px; font-weight: 600; }
.hstate { font-size: 12px; font-weight: 600; }
.hitem.good .hstate { color: var(--up); } .hitem.bad .hstate { color: var(--down); } .hitem.mid .hstate { color: var(--muted); }
.big-badge { font-size: 13px; padding: 4px 12px; }
#dRead { color: var(--muted); margin-top: 4px; max-width: 70ch; }

/* cara membaca */
details.help { font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 8px; }
details.help summary { cursor: pointer; color: var(--accent); width: fit-content; }
details.help summary::before { content: "ⓘ "; }
details.help dl { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 4px 12px; margin: 8px 0 2px; }
details.help dt { color: var(--ink); font-weight: 600; }
details.help dd { margin: 0; }
@media (max-width: 600px) { details.help dl { grid-template-columns: minmax(0, 1fr); } details.help dd { margin-bottom: 6px; } }

/* seberapa bisa dipercaya */
.trust { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.trust.buy { border-color: color-mix(in srgb, var(--up) 45%, var(--line)); }
.trust.warn { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.trust.sell { border-color: color-mix(in srgb, var(--down) 45%, var(--line)); }
.trust .tlabel { font-weight: 650; }
.trust.buy .tlabel { color: var(--up); } .trust.warn .tlabel { color: var(--warn); } .trust.sell .tlabel { color: var(--down); }
.tbar { display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.tbar i { display: block; height: 100%; background: currentColor; }
.trust.buy .tbar { color: var(--up); } .trust.warn .tbar { color: var(--warn); } .trust.sell .tbar { color: var(--down); }
.trust ul { margin: 0; padding-left: 18px; font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; }

/* indikator terpilih */
.rules tr.pick td:first-child { font-weight: 650; }
.badge.mini { font-size: 9.5px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
table.sig td.picks { text-align: left; white-space: normal; font-size: 11.5px; color: var(--muted); min-width: 14rem; }

/* kinerja historis */
.histperf { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.histperf .kv { max-width: 34rem; }
table.heat { border-collapse: collapse; font-size: 11px; width: 100%; min-width: 640px; }
table.heat th, table.heat td { padding: 4px 5px; text-align: right; border-bottom: 1px solid var(--line); }
table.heat thead th { color: var(--muted); font-weight: 500; }
table.heat tbody th { text-align: left; color: var(--muted); font-weight: 600; }
table.heat td.yr { font-weight: 650; border-left: 1px solid var(--line); }
.trust .vtop { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
