/* AMBANG
   Arah visual: meja sinyal di ruang kontrol pasar.
   Palet: tinta hampir hitam, kertas tulang, kuning kuningan sebagai aksen tunggal,
   hijau/merah hanya untuk arah harga. Alasan lengkap ada di DESIGN.md. */

:root {
  --ink: #080a0a;
  --panel: #0f1213;
  --panel-2: #141819;
  --line: #232a2c;
  --line-soft: #1a2021;
  --text: #e9ebe6;
  --muted: #9aa6a3;
  --brass: #e3b25a;
  --brass-dim: #8a6a2c;
  --up: #4cd6a3;
  --down: #ff6f62;
  --mono: "Space Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sans: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --radius: 3px;
  --pad: clamp(16px, 2.6vw, 30px);
}

* { box-sizing: border-box; }

html { scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, dt, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }

[hidden] { display: none !important; }

button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
  border-radius: 2px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 30;
  padding: 10px 14px;
  background: var(--brass);
  color: #131008;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.mono, .num, .price, .score-num, .tag, .kicker, .seg-btn, .chip, .stat-foot {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 10px var(--pad);
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(to right, var(--brass) 0 64px, transparent 64px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 15px;
}
.brand-mark i {
  display: block;
  width: 3px;
  background: var(--brass);
}
.brand-mark i:nth-child(1) { height: 6px; }
.brand-mark i:nth-child(2) { height: 15px; }
.brand-mark i:nth-child(3) { height: 10px; background: var(--text); }

.brand-word {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: .1em;
}
.brand-sub {
  color: var(--muted);
  font-size: 12px;
}

.ticker {
  display: flex;
  gap: 18px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.ticker li {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}
.ticker b { font-weight: 400; color: var(--muted); }
.ticker .t-px { color: var(--text); }
.ticker .t-chg.up { color: var(--up); }
.ticker .t-chg.down { color: var(--down); }

.topright { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.conn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.conn-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
}
.conn.live .conn-dot { background: var(--up); }
.conn.dead .conn-dot { background: var(--down); }

/* ---------- main ---------- */

main {
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- brief ---------- */

.brief {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
  gap: clamp(20px, 4vw, 56px);
  padding: clamp(30px, 5vw, 58px) 0 clamp(24px, 3.4vw, 40px);
  align-items: end;
}

.kicker {
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.kicker span { color: var(--brass); text-transform: none; letter-spacing: 0; }

h1 {
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: -.035em;
  font-weight: 800;
  margin: 12px 0 0;
  max-width: 24ch;
  text-wrap: balance;
}

.verdict-line {
  margin-top: 18px;
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.45;
  max-width: 62ch;
  color: var(--text);
  border-left: 2px solid var(--brass);
  padding-left: 14px;
}

.brief-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  max-width: 60ch;
}

.brief-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}
.brief-stats > div {
  padding: 14px 14px 0 0;
  border-right: 1px solid var(--line-soft);
}
.brief-stats > div:last-child { border-right: 0; padding-left: 14px; }
.brief-stats > div:nth-child(2) { padding-left: 14px; }
.brief-stats dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.brief-stats dd {
  margin: 6px 0 2px;
  font-family: var(--mono);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  letter-spacing: -.02em;
}
.brief-stats dd.up { color: var(--up); }
.brief-stats dd.down { color: var(--down); }
.stat-foot { font-size: 10px; color: var(--muted); display: block; }

/* ---------- banner ---------- */

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border: 1px solid #5a302c;
  background: #1a100f;
  color: #ffc9c3;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 14px;
}

.btn {
  border: 1px solid var(--line);
  background: transparent;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  min-height: 38px;
}
.btn-ghost:hover { border-color: var(--brass); color: var(--brass); }

/* ---------- desk ---------- */

.desk {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(340px, .92fr);
  gap: 18px;
  align-items: start;
}

.screener, .sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.screener { min-width: 0; }

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.panel-head h2, .method h2, .usage h2 {
  font-size: 19px;
  letter-spacing: -.015em;
  font-weight: 700;
}

.panel-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  padding: 7px 11px;
  min-height: 34px;
  border-right: 1px solid var(--line);
}
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { color: var(--text); background: var(--panel-2); }
.seg-btn[aria-pressed="true"] {
  background: var(--brass);
  color: #14100a;
  font-weight: 700;
}
.seg-btn[aria-pressed="true"]:hover { color: #14100a; }

.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  padding: 6px 11px;
  min-height: 32px;
  border-radius: var(--radius);
}
.chip:hover { color: var(--text); border-color: #3a4446; }
.chip[aria-pressed="true"] {
  border-color: var(--brass-dim);
  color: var(--brass);
  background: rgba(227, 178, 90, .07);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  max-height: 620px;
  scrollbar-color: #35403f var(--panel);
}

.board {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.board thead th {
  position: sticky;
  top: 0;
  background: var(--panel);
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--muted);
  padding: 0;
  border-bottom: 1px solid var(--line);
  z-index: 1;
}
.board thead th.num { text-align: right; }
.board thead th.col-score { width: 122px; }
.board thead th.col-rank { width: 34px; }

.sort {
  border: 0;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  padding: 9px 12px;
  width: 100%;
  min-height: 34px;
  text-align: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
th.num .sort { justify-content: flex-end; }
.sort:hover { color: var(--text); }
.sort[data-state="asc"]::after { content: "▲"; font-size: 7px; color: var(--brass); }
.sort[data-state="desc"]::after { content: "▼"; font-size: 7px; color: var(--brass); }

.board tbody tr {
  border-bottom: 1px solid var(--line-soft);
}
.board tbody tr:last-child { border-bottom: 0; }
.board tbody tr:hover { background: #121718; }
.board tbody tr.is-active { background: rgba(227, 178, 90, .06); }
.board tbody tr.is-active .sym-name { color: var(--brass); }

.board td {
  padding: 8px 12px;
  vertical-align: middle;
}
.board td.num { text-align: right; font-family: var(--mono); font-size: 12.5px; }
.board td.col-rank {
  font-family: var(--mono);
  font-size: 11px;
  color: #83908e;
  text-align: right;
  padding-right: 0;
}

.sym {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 3px 0;
  text-align: left;
  min-height: 34px;
}
.sym-name { font-weight: 600; letter-spacing: .01em; }
.sym-quote { font-family: var(--mono); font-size: 9.5px; color: #83908e; letter-spacing: .06em; }

.chg.up { color: var(--up); }
.chg.down { color: var(--down); }
.chg.flat { color: var(--muted); }

.score-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: flex-end;
}
.score-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  min-width: 22px;
  text-align: right;
}
.score-track {
  width: 52px;
  height: 3px;
  background: #262d2e;
  overflow: hidden;
}
.score-track i {
  display: block;
  height: 100%;
  background: var(--brass);
}
.score-track i.tone-down { background: var(--down); }
.score-track i.tone-up { background: var(--up); }
.score-track i.tone-muted { background: #6b7877; }

.tag {
  display: inline-block;
  font-size: 9.5px;
  letter-spacing: .04em;
  padding: 3px 6px;
  border: 1px solid currentColor;
  border-radius: 2px;
  white-space: nowrap;
  text-transform: uppercase;
}
.tag.tone-up { color: var(--up); }
.tag.tone-down { color: var(--down); }
.tag.tone-brass { color: var(--brass); }
.tag.tone-muted { color: var(--muted); }

.table-foot {
  padding: 10px 16px;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  border-top: 1px solid var(--line-soft);
}

.board tr.empty-row td {
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.board tr.empty-row button {
  margin-top: 10px;
  display: inline-block;
}

/* skeleton */
.skel {
  display: block;
  height: 26px;
  background: linear-gradient(90deg, #151a1b 25%, #1c2324 37%, #151a1b 63%);
  background-size: 400% 100%;
  animation: sweep 1.4s linear infinite;
}
@keyframes sweep {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

/* ---------- sheet ---------- */

.sheet {
  position: sticky;
  top: 62px;
  padding: 16px;
  min-width: 0;
}

.sheet-empty {
  padding: 30px 8px 40px;
  color: var(--muted);
  font-size: 14px;
  max-width: 34ch;
}
.sheet-empty p + p { margin-top: 10px; }

.back-link {
  display: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .05em;
  color: var(--brass);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  width: fit-content;
  padding: 2px 0 4px;
}
.back-link:hover { border-bottom-color: var(--brass); }

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.sheet-head h2 {
  font-size: 22px;
  letter-spacing: -.02em;
  margin-top: 3px;
  font-family: var(--mono);
  font-weight: 700;
}
.sheet-price { text-align: right; }
.price { display: block; font-size: 19px; font-weight: 700; }
.chg { font-family: var(--mono); font-size: 11px; }

.chart-box { margin: 12px 0 4px; position: relative; }
.chart-box canvas { display: block; width: 100%; height: 260px; }
#chart { display: block; width: 100%; height: 230px; }
.chart-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
  padding-top: 6px;
}
.lg { width: 12px; height: 2px; display: inline-block; }
.lg-ema20 { background: var(--brass); }
.lg-ema50 { background: #8797a3; margin-left: 8px; }
.lg-vol { background: #3d4a4b; height: 7px; margin-left: 8px; }

.score-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  margin-top: 8px;
  flex-wrap: wrap;
}
.score-num {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
}
.score-num small { font-size: 11px; color: var(--muted); font-weight: 400; }
.score-bar {
  flex: 1;
  min-width: 60px;
  height: 5px;
  background: #232a2b;
  overflow: hidden;
}
.score-bar i { display: block; height: 100%; background: var(--brass); transition: width .35s ease; }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  margin: 12px 0 4px;
}
.metrics > div {
  background: var(--panel-2);
  padding: 8px 9px;
}
.metrics dt {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.metrics dd {
  font-family: var(--mono);
  font-size: 12.5px;
  margin-top: 3px;
  font-weight: 700;
}
.metrics dd small { font-weight: 400; color: var(--muted); font-size: 10px; }

.sub-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 8px;
  font-weight: 400;
}

.reasons { display: flex; flex-direction: column; gap: 5px; }
.reasons li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  align-items: baseline;
}
.reasons .pts {
  font-family: var(--mono);
  font-size: 11px;
  text-align: right;
  color: var(--up);
}
.reasons .pts.neg { color: var(--down); }
.reasons .why { color: #c9d1cd; }

.plan { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.plan > div { background: var(--panel-2); padding: 8px 9px; }
.plan dt {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.plan dd { font-family: var(--mono); font-size: 12px; margin-top: 2px; }
.plan .full { grid-column: 1 / -1; }
.plan-note {
  grid-column: 1 / -1;
  background: #191612;
  color: #d9c7a3;
  font-size: 11px;
  line-height: 1.45;
  padding: 8px 10px;
}

.calc { margin-top: 4px; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calc label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.calc input {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 7px 9px;
  font-family: var(--mono);
  font-size: 13px;
  min-height: 38px;
  width: 100%;
}
.calc input:hover { border-color: #3a4446; }
.calc input:focus { border-color: var(--brass); outline: none; box-shadow: 0 0 0 1px var(--brass); }
.calc-out {
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
  line-height: 1.5;
  border-left: 2px solid var(--line);
  padding-left: 9px;
}
.calc-out b { color: var(--brass); }

/* ---------- method ---------- */

.method, .usage {
  margin-top: clamp(34px, 5vw, 64px);
  border-top: 1px solid var(--line);
  padding-top: clamp(22px, 3vw, 34px);
}

.method-head { max-width: 62ch; }
.method-intro { color: var(--muted); font-size: 14px; margin-top: 8px; max-width: 68ch; }

.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.wblock {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 14px 15px;
}
.wblock h3 {
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.wblock h3 span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--brass);
  font-weight: 400;
}
.wblock ul { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.wblock li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
  border-bottom: 1px dotted #242b2c;
  padding-bottom: 6px;
}
.wblock li:last-child { border-bottom: 0; padding-bottom: 0; }
.wblock li b { font-family: var(--mono); font-weight: 400; color: var(--text); white-space: nowrap; }
.wblock li b.neg { color: var(--down); }

.method-rules { margin-top: 24px; }
.method-rules ul { display: flex; flex-direction: column; gap: 8px; max-width: 80ch; }
.method-rules li {
  font-size: 13.5px;
  color: var(--muted);
  padding-left: 15px;
  position: relative;
}
.method-rules li::before {
  content: "";
  position: absolute;
  left: 0; top: .55em;
  width: 6px; height: 1px;
  background: var(--brass);
}
.method-rules b { color: var(--text); }

/* ---------- usage ---------- */

.usage ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 18px;
  counter-reset: step;
}
.usage li {
  counter-increment: step;
  font-size: 13.5px;
  color: var(--muted);
  padding-top: 12px;
  border-top: 1px solid var(--line);
  line-height: 1.5;
}
.usage li::before {
  content: "0" counter(step);
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--brass);
  margin-bottom: 6px;
}

/* ---------- foot ---------- */

.foot {
  max-width: 1460px;
  margin: clamp(40px, 6vw, 80px) auto 0;
  padding: 20px var(--pad) 40px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}
.foot p { flex: 1; min-width: 260px; max-width: 72ch; }
.foot b { color: var(--text); letter-spacing: .08em; }
.foot .mono { color: #b9c3c0; }
.foot .credit { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.foot .credit b { font-family: var(--mono); font-weight: 400; color: var(--brass); letter-spacing: .12em; }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .desk { grid-template-columns: 1fr; }
  .sheet { position: static; }
  .back-link { display: block; }
  .brief { grid-template-columns: 1fr; align-items: start; }
  .brief-stats { max-width: 560px; }
}

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 8px 16px; padding-top: 8px; padding-bottom: 8px; }
  .ticker { order: 3; width: 100%; flex: 1 0 100%; gap: 14px; }
  .topright { margin-left: auto; }
  .brief { padding-top: 24px; }
  .brief-stats > div { padding-right: 10px; }
  .brief-stats > div:nth-child(2) { padding-left: 10px; }
  .brief-stats > div:last-child { padding-left: 10px; }
  .col-verdict { display: none; }
  .board td.col-rank, .board th.col-rank { display: none; }
  .board thead th.col-score { width: 96px; }
  .score-track { width: 38px; }
}

@media (max-width: 620px) {
  body { font-size: 14px; }
  .brand-sub { display: none; }
  .ticker li:nth-child(n+3) { display: none; }
  .brief-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brief-stats dt { font-size: 9px; }
  .filters { gap: 5px; }
  .chip { padding: 5px 8px; font-size: 10.5px; }
  .table-wrap { max-height: 420px; }
  .panel-head { padding: 12px; }
  .filters { padding: 8px 12px; }
  .board td { padding: 7px 9px; }
  .board thead th.col-score { width: 74px; }
  .score-track { display: none; }
  .col-change { display: none; }
  .sheet { padding: 12px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan { grid-template-columns: 1fr 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
  .table-foot { padding: 9px 12px; }
  .usage ol { gap: 14px; }
}

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