:root {
    /* Palet menyelaraskan brand Finmorph: near-black + aksen hijau lime. */
    --bg: #0a0c0a;
    --surface: #141714;
    --surface-2: #1c201a;
    --border: #2a2f28;
    --text: #e8ece6;
    --text-dim: #97a08f;
    --text-faint: #5f6a59;
    --bull: #16c784;
    --bull-dim: #0d3a2a;
    --bear: #ea3943;
    --bear-dim: #3a161a;
    --accent: #c6f24e;          /* hijau lime khas Finmorph */
    --accent-dim: #2b3a12;
    --mono: 'SF Mono', 'Roboto Mono', 'Consolas', monospace;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.logo {
    font-weight: 800;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.logo span { color: var(--accent); }
.beta-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid var(--accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    vertical-align: middle;
}
.header-note {
    font-size: 12px;
    color: var(--text-faint);
}

/* Navigasi tingkat 1: menu utama Crypto | Stocks | Tools */
.main-nav {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.main-tab {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 22px;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.12s;
}
.main-tab:hover { color: var(--text); border-color: var(--text-faint); }
.main-tab.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

/* Navigasi tingkat 2: sub-tab per grup */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
}
.tab:hover { color: var(--text); }
.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ===== Nav dropdown (hover / tap) — dipakai premium & free ===== */
.nav-group { position: relative; }
.main-tab { display: inline-flex; align-items: center; gap: 7px; }
.main-tab::after { content: "\25BE"; font-size: 10px; opacity: .6; transition: transform .12s; }
.nav-group:hover .main-tab::after,
.nav-group.open .main-tab::after { transform: rotate(180deg); }

/* Sub-tab nav menjadi panel dropdown (override gaya .tabs/.tab horizontal). */
.nav-group > .tabs {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 60;
    display: none;
    flex-direction: column;
    gap: 2px;
    min-width: 210px;
    margin: 0;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
}
/* Hover (desktop) atau .open (tap/klik) menampilkan dropdown. */
.nav-group:hover > .tabs,
.nav-group.open > .tabs { display: flex; }
/* Dropdown menu terakhir rata kanan agar tak meluber dari layar. */
.nav-group:last-child > .tabs { left: auto; right: 0; }

.nav-group > .tabs .tab {
    border: none;
    border-radius: 7px;
    padding: 9px 14px;
    text-align: left;
    white-space: nowrap;
    font-weight: 600;
}
.nav-group > .tabs .tab:hover { background: var(--surface-2); color: var(--text); }
.nav-group > .tabs .tab.active { background: var(--accent-dim); color: var(--accent); border: none; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Form umum */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
}
.form-grid .full { grid-column: 1 / -1; }

textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--text);
    font-family: var(--sans);
    font-size: 13px;
    resize: vertical;
    min-height: 60px;
}
textarea:focus { outline: none; border-color: var(--accent); }

.btn-secondary {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-secondary:hover { border-color: var(--accent); }

/* Kartu hasil kalkulator */
.calc-result {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}
.calc-stat {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
}
.calc-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
    margin-bottom: 4px;
}
.calc-stat-value {
    font-family: var(--mono);
    font-size: 20px;
    font-weight: 600;
}
.calc-stat-value.good { color: var(--bull); }
.calc-stat-value.warn { color: var(--accent); }

/* Kartu analitik jurnal */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
@media (max-width: 700px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
}
.stat-card-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
    margin-bottom: 6px;
}
.stat-card-value {
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 700;
}

.form-msg {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 12px;
}
.form-msg.success { background: var(--bull-dim); color: var(--bull); }
.form-msg.error { background: var(--bear-dim); color: var(--bear); }

/* Layout: panel filter + hasil */
.layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
}
@media (max-width: 880px) {
    .layout { grid-template-columns: 1fr; }
}

/* Panel */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}
.panel-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 12px;
    font-weight: 600;
}

.field { margin-bottom: 16px; }
.field label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

select, input[type="text"], input[type="number"] {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--text);
    font-family: var(--sans);
    font-size: 13px;
}
select:focus, input:focus {
    outline: none;
    border-color: var(--accent);
}

.tf-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.tf-btn {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 0;
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.12s;
}
.tf-btn:hover { border-color: var(--text-faint); }
.tf-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* Kondisi indikator — baris horizontal yang lega (adaptif per indikator) */
.condition {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.condition > select,
.condition > input {
    flex: 1 1 130px;
    min-width: 110px;
    font-size: 13px;
    padding: 8px 10px;
}
/* Penanda indikator di kiri tiap baris kondisi */
.condition-num {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    border-radius: 6px;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
}
.condition-remove {
    flex: 0 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--bear);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 8px 10px;
    transition: all 0.12s;
}
.condition-remove:hover { border-color: var(--bear); }

.btn {
    width: 100%;
    border: none;
    border-radius: 6px;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
}
.btn-add {
    background: var(--surface-2);
    border: 1px dashed var(--border);
    color: var(--text-dim);
    margin-bottom: 12px;
}
.btn-add:hover { border-color: var(--accent); color: var(--accent); }
.btn-run {
    background: var(--accent);
    color: #000;
}
.btn-run:hover { opacity: 0.9; }
.btn-run:disabled { opacity: 0.5; cursor: not-allowed; }

.logic-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}
.logic-toggle button {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.logic-toggle button.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}
/* Varian toggle: inline (di header kartu) & compact (di action bar) */
.logic-toggle-inline, .logic-toggle-compact { margin-bottom: 0; width: auto; }
.logic-toggle-inline button, .logic-toggle-compact button { flex: 0 0 auto; padding: 6px 12px; }

/* ===== Builder strategi: tata letak full-width berkartu ===== */
.builder-head { margin-bottom: 16px; }
.builder-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.builder-sub {
    font-size: 12px;
    color: var(--text-faint);
    margin-top: 2px;
}

.builder-grid { display: grid; gap: 12px; }
.builder-grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.builder-grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
/* HP & tablet kecil: satu kartu per baris biar tidak ada kartu setengah kosong */
@media (max-width: 880px) {
    .builder-grid-3, .builder-grid-2 { grid-template-columns: 1fr; }
}

.builder-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}
.builder-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
}
.builder-card-head-split { justify-content: space-between; }
.builder-card-head .hint-inline { font-size: 11px; font-weight: 400; }
.step-badge {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}
.builder-hint {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 10px;
    line-height: 1.5;
}

/* Tombol "?" pembuka penjelasan indikator */
.info-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 4px;
    transition: all 0.12s;
}
.info-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Modal edukasi indikator */
.help-card { max-width: 580px; }
.help-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.help-close {
    background: none; border: none; color: var(--text-dim);
    font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.help-close:hover { color: var(--text); }
.help-body { max-height: 68vh; overflow-y: auto; margin-top: 12px; padding-right: 4px; }
.help-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    font-weight: 700;
    margin: 18px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.help-section-title:first-child { margin-top: 0; }
.help-note { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; line-height: 1.5; }
.help-item { margin-bottom: 14px; }
.help-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.help-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-faint);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 6px;
    font-weight: 600;
    vertical-align: middle;
}
.help-item p { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.help-item p b { color: var(--text); font-weight: 600; }
.help-disclaimer {
    margin-top: 16px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-faint);
    text-align: center;
}

/* Action bar: nama strategi + tombol aksi, selalu menonjol & lebar */
.action-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 14px;
}
.action-bar #strategy-name { flex: 1 1 220px; min-width: 180px; }
.action-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.action-btn { width: auto; padding: 9px 18px; }
.action-range { width: auto; }

/* ===== Builder di layar HP ===== */
@media (max-width: 600px) {
    .builder-grid { gap: 10px; }
    .builder-card { padding: 14px; }
    .builder-title { font-size: 16px; }

    /* Header kartu boleh turun baris bila sempit (mis. judul + toggle AND/OR) */
    .builder-card-head-split { flex-wrap: wrap; row-gap: 8px; }
    .logic-toggle-inline { width: 100%; }
    .logic-toggle-inline button { flex: 1; }

    /* Kondisi: tiap kontrol jadi selebar penuh = tap target besar, tak berdesakan */
    .condition-num { display: none; }
    .condition > select,
    .condition > input { flex: 1 1 100%; min-width: 0; }
    .condition-remove { margin-left: auto; }

    /* Action bar menumpuk rapi & tombol full-width */
    .action-bar { gap: 8px; }
    .action-bar #strategy-name { flex: 1 1 100%; }
    .action-bar-right { width: 100%; }
    .action-btn, .action-range { flex: 1; }
    .logic-toggle-compact { width: 100%; }
    .logic-toggle-compact button { flex: 1; }
}

/* Tabel hasil */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.results-meta {
    font-size: 12px;
    color: var(--text-dim);
}
.results-meta strong { color: var(--text); }

table {
    width: 100%;
    border-collapse: collapse;
}
th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}
th:hover { color: var(--text-dim); }
td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
tr:hover td { background: var(--surface-2); }

.sym {
    font-weight: 600;
    font-family: var(--mono);
}
.price { font-family: var(--mono); color: var(--text-dim); }

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge.bullish { background: var(--bull-dim); color: var(--bull); }
.badge.bearish { background: var(--bear-dim); color: var(--bear); }
.badge.neutral { background: var(--surface-2); color: var(--text-dim); }

.signals {
    font-size: 11px;
    color: var(--text-dim);
    font-family: var(--mono);
}
.signal-chip {
    display: inline-block;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    margin: 2px 2px 0 0;
}

/* States */
.state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-faint);
}
.state-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.5; }

.spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 12px;
}

.disclaimer {
    margin-top: 24px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-faint);
    text-align: center;
}

/* Profil */
.profile-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.profile-row span { color: var(--text-dim); }
.profile-hint { font-size: 12px; color: var(--text-dim); margin: 10px 0; line-height: 1.6; }
.nowrap { white-space: nowrap; }

/* Modal/popup */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8);
}
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--accent); margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; margin-top: 8px; }
.modal-actions .btn { width: auto; flex: 1; }

/* Template strategi siap pakai */
.builder-head-split { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.builder-head-split .btn { width: auto; flex-shrink: 0; }
.templates-card { max-width: 640px; max-height: 82vh; display: flex; flex-direction: column; }
.templates-list { overflow-y: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.template-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px;
}
.template-card:hover { border-color: var(--accent); }
.template-main { flex: 1; min-width: 0; }
.template-name { font-weight: 700; font-size: 14px; }
.template-tags {
    font-size: 11px; font-weight: 600; color: var(--accent); font-family: var(--mono);
    background: var(--accent-dim); border-radius: 4px; padding: 1px 6px; margin-left: 6px;
}
.template-desc { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; line-height: 1.45; }
.template-meta { font-size: 11px; color: var(--text-faint); margin-top: 6px; font-family: var(--mono); }
.template-use { width: auto; flex-shrink: 0; }

/* Chart candlestick crosscheck per trade */
.cs-trade { margin-top: 16px; }
.cs-caption { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; font-family: var(--mono); }
.cs-svg {
    width: 100%;
    height: auto;
    display: block;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* ===== Mobile / responsif ===== */
@media (max-width: 600px) {
    .app { padding: 12px; }

    .header { flex-wrap: wrap; gap: 8px; }
    .logo { font-size: 16px; }

    /* Menu utama & tab bisa di-scroll horizontal kalau kebanyakan */
    .main-nav,
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .main-tab { padding: 8px 16px; white-space: nowrap; flex-shrink: 0; }
    .tab { padding: 10px 12px; white-space: nowrap; }

    /* Panel boleh scroll horizontal untuk tabel lebar */
    .panel { padding: 12px; overflow-x: auto; }
    .panel table { min-width: 520px; } /* tabel tetap terbaca, geser horizontal */
    table { font-size: 12px; }
    th, td { padding: 8px 6px; }

    /* Kartu strategi menumpuk rapi */
    .strategy-card { flex-direction: column; align-items: stretch; }
    .strategy-actions { justify-content: flex-start; }

    /* Dropdown riwayat penuh selebar layar */
    .history-controls select { min-width: 0; width: 100%; }

    .calc-result, .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Sumber coin: chips manual & pratinjau top gainers */
.coin-chips { margin-top: 8px; }
.coin-chips .signal-chip { font-family: var(--mono); }

.gainers-preview {
    margin-top: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 0;
    max-height: 240px;
    overflow-y: auto;
}
.gainer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}
.gainer-row:last-child { border-bottom: none; }
.gainer-change { font-family: var(--mono); color: var(--bull); font-weight: 600; }

/* Tombol "Cari coin" pembuka modal pemilih */
.btn-browse-coins { width: 100%; margin-top: 8px; }

/* Modal pemilih coin: kartu lebih lebar + daftar bisa di-scroll */
.coin-picker-card { max-width: 460px; }
#coin-search { width: 100%; margin-bottom: 10px; }
.coin-picker-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 8px;
}
.coin-picker-meta #coin-picker-selected { color: var(--accent); font-weight: 600; }
.coin-picker-list {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 12px;
}
.coin-pick-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.coin-pick-row:last-child { border-bottom: none; }
.coin-pick-row:hover { background: var(--surface); }
.coin-pick-row.selected { background: var(--accent-dim); }
.coin-pick-row.selected .cp-sym::before { content: '\2713 '; color: var(--accent); }
.coin-pick-row.disabled { opacity: 0.4; cursor: not-allowed; }
.coin-pick-row .cp-sym { font-family: var(--mono); font-weight: 600; }
.coin-pick-right { display: flex; align-items: center; gap: 12px; }
.cp-change { font-family: var(--mono); font-weight: 600; }
.cp-change.up { color: var(--bull); }
.cp-change.down { color: var(--bear); }
.cp-vol { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

/* Kartu strategi tersimpan */
.strategy-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.strategy-name {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.strategy-meta {
    font-size: 12px;
    color: var(--text-dim);
    font-family: var(--mono);
}
.strategy-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.btn-mini {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 5px 10px;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
}
.btn-mini:hover { border-color: var(--accent); color: var(--accent); }
.btn-mini.danger:hover { border-color: var(--bear); color: var(--bear); }

/* Daftar metode entry/TP berurut prioritas */
.hint-inline { color: var(--text-faint); font-weight: 400; text-transform: none; letter-spacing: 0; }
.method-list { margin-bottom: 8px; }
.method-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
    margin-bottom: 6px;
}
.method-rank {
    flex: 0 0 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--mono);
}
.method-name { flex: 1; font-size: 12px; }
.method-actions { display: flex; gap: 4px; }
.method-actions button {
    width: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-dim);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 0;
}
.method-actions button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.method-actions button.danger:hover { border-color: var(--bear); color: var(--bear); }
.method-actions button:disabled { opacity: 0.3; cursor: not-allowed; }
.method-add { font-size: 12px; }
.method-hint { font-size: 11px; color: var(--text-faint); padding: 4px 0; }

/* Indikator mode edit strategi */
.edit-indicator {
    font-size: 12px;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 8px;
}

/* Kurva ekuitas backtest */
.bt-chart { margin: 4px 0 16px; }
.bt-chart-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 8px;
}
.bt-svg {
    width: 100%;
    height: 180px;
    display: block;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.bt-chart-axis {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-faint);
    font-family: var(--mono);
    margin-top: 6px;
}

/* Kontrol dropdown riwayat scan */
.history-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.history-controls select {
    width: auto;
    min-width: 200px;
    flex: 0 1 auto;
}

/* ===== News Timeline ===== */
.news-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.news-refresh { width: auto; flex: 0 0 auto; padding: 8px 14px; }

.news-filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.news-filter-group { display: flex; flex-wrap: wrap; gap: 6px; }
.news-chip {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 14px;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
}
.news-chip:hover { border-color: var(--text-faint); color: var(--text); }
.news-chip.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* Pemisah hari */
.news-day {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    font-weight: 600;
    margin: 18px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.news-day:first-child { margin-top: 0; }

/* Baris berita */
.news-item {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.news-time { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.news-clock { font-family: var(--mono); font-size: 13px; color: var(--text-dim); }
.news-impact {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
}
.news-impact.critical { background: var(--bear-dim); color: var(--bear); }
.news-impact.high     { background: #3a2e12; color: #f0b429; }
.news-impact.medium   { background: var(--surface-2); color: var(--text-dim); }
.news-impact.low      { background: var(--surface-2); color: var(--text-faint); }

.news-body { min-width: 0; }
.news-title { font-size: 14px; line-height: 1.4; }
.news-title a { color: var(--text); text-decoration: none; }
.news-title a:hover { color: var(--accent); text-decoration: underline; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--text-dim); }
.news-cur {
    font-family: var(--mono);
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-dim);
    border-radius: 4px;
    padding: 1px 6px;
}
.news-src { color: var(--text-faint); }
.news-fig { font-family: var(--mono); color: var(--text-dim); }

.news-assets { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.news-asset {
    font-size: 11px;
    border-radius: 4px;
    padding: 2px 7px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-dim);
}
.news-asset.lvl-high { border-color: var(--accent); color: var(--accent); }
.news-asset.lvl-medium { color: var(--text); }

/* Chip filter impact: beri jejak warna level agar mudah dibaca */
.news-chip.imp-critical.active { background: var(--bear-dim); border-color: var(--bear); color: var(--bear); }
.news-chip.imp-high.active { background: #3a2e12; border-color: #f0b429; color: #f0b429; }

@media (max-width: 600px) {
    .news-item { grid-template-columns: 64px 1fr; gap: 10px; }
    .news-head { flex-direction: column; }
    .news-refresh { align-self: flex-start; }
}

/* ===== Dashboard IHSG ===== */
.idx-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 22px;
}
.idx-hero-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    font-weight: 600;
    margin-bottom: 6px;
}
.idx-hero-price { font-family: var(--mono); font-size: 32px; font-weight: 700; }
.idx-hero-change { font-family: var(--mono); font-size: 18px; font-weight: 700; }
.idx-hero-change span { font-size: 14px; opacity: 0.85; }
.idx-hero-change.up { color: var(--bull); }
.idx-hero-change.down { color: var(--bear); }

.idx-chg.up { color: var(--bull); }
.idx-chg.down { color: var(--bear); }

/* ===== Pivot & VWAP (premium) ===== */
.lv-search { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.lv-mkt-toggle { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.lv-mkt { background: var(--surface); border: none; color: var(--text-dim); padding: 0 16px; height: 42px; font-size: 13px; font-weight: 600; cursor: pointer; }
.lv-mkt.active { background: var(--accent); color: var(--bg); }
.lv-search input { flex: 1; min-width: 160px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 11px 14px; color: var(--text); font-size: 14px; }
.lv-search input:focus { outline: none; border-color: var(--accent); }
.lv-search .btn { width: auto; flex-shrink: 0; }

.lv-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; }
.lv-sym { font-weight: 700; font-size: 16px; }
.lv-price-big { font-family: var(--mono); font-size: 30px; font-weight: 800; }
.lv-meta { color: var(--text-faint); font-size: 12px; }
.lv-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.lv-chip { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 12px; border: 1px solid var(--border); }
.lv-chip.bull { color: var(--bull); border-color: var(--bull-dim); background: var(--bull-dim); }
.lv-chip.bear { color: var(--bear); border-color: var(--bear-dim); background: var(--bear-dim); }

.lv-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }
@media (max-width: 760px) { .lv-grid { grid-template-columns: 1fr; } }
.lv-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.lv-card-title { font-size: 13px; color: var(--text-dim); font-weight: 700; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lv-methods { display: flex; gap: 6px; }
.lv-method { font-size: 11px; padding: 3px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim); cursor: pointer; }
.lv-method.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

.lv-ladder { width: 100%; border-collapse: collapse; }
.lv-ladder td { padding: 7px 8px; font-size: 13px; border-bottom: 1px solid var(--border); }
.lv-ladder tr:last-child td { border-bottom: none; }
.lv-l-label { font-weight: 700; font-family: var(--mono); }
.lv-l-val { font-family: var(--mono); text-align: right; }
.lv-l-dist { text-align: right; color: var(--text-faint); font-size: 12px; font-family: var(--mono); }
.lv-row-res .lv-l-label { color: var(--bear); }
.lv-row-sup .lv-l-label { color: var(--bull); }
.lv-row-pp .lv-l-label { color: var(--accent); }
.lv-row-vwap { background: var(--accent-dim); }
.lv-row-vwap .lv-l-label { color: var(--accent); }
.lv-row-price td { background: var(--surface-2); color: var(--text); font-weight: 700; }

.lv-vwap-rows .lv-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--border); color: var(--text-dim); }
.lv-vwap-rows .lv-row:last-child { border-bottom: none; }
.lv-vwap-rows b { font-family: var(--mono); color: var(--text); }
