* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  background-color: #090b10;
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.chart-page-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 16px 28px;
  overflow-x: clip;
}
.chart-main {
  margin-top: 12px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background-color: #11141d;
  border: 1px solid var(--border, #232838);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 8px;
}
.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.brand-tag {
  font-weight: 700;
  font-size: 13px;
  color: #f8fafc;
  padding-right: 8px;
  border-right: 1px solid #334155;
  letter-spacing: 0.5px;
}
.tf-quick-group,
.ind-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #0b0e16;
  border: 1px solid #1e293b;
  border-radius: 7px;
  padding: 2px;
}
.chart-main select,
.chart-main button,
.chart-main input[type="color"] {
  background-color: #171b26;
  color: #f8fafc;
  border: 1px solid #2b3448;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}
.tf-quick-group .tf-btn,
.ind-group button {
  background: transparent;
  border-color: transparent;
  padding: 4px 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}
.tf-quick-group .tf-btn:hover,
.ind-group button:hover {
  color: #f8fafc;
  background: #1e293b;
}
.tf-quick-group .tf-btn.active {
  background: #2563eb;
  color: #ffffff;
}
.ind-group button.active {
  background: rgba(243, 128, 32, 0.2);
  border-color: rgba(243, 128, 32, 0.5);
  color: #fb923c;
}
input[type="color"] {
  padding: 2px 4px;
  width: 28px;
  height: 26px;
}
.chart-main select:hover,
.chart-main button:hover {
  border-color: #475569;
  background-color: #222a3c;
}
.chart-main button.active {
  background-color: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}
.chart-main button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ohlc-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  margin-bottom: 8px;
  padding: 7px 12px;
  background-color: #11141d;
  border: 1px solid var(--border, #232838);
  border-radius: 8px;
}
.ohlc-main-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.pair-label {
  font-weight: 700;
  color: #f8fafc;
}
.symbol-subname {
  font-size: 11.5px;
  color: #94a3b8;
}
.state-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #2b3448;
  background: #171b26;
  color: #94a3b8;
}
.state-pill.open {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(34, 197, 94, 0.12);
}
.ohlc-vals {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ohlc-vals span {
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.ohlc-vals b {
  color: #e2e8f0;
  font-weight: 600;
}
.chg-badge {
  font-weight: 700;
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 5px;
}
.chg-badge.up {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.14);
}
.chg-badge.down {
  color: #f87171;
  background: rgba(239, 68, 68, 0.14);
}
.status-text {
  margin-left: auto;
  font-size: 11.5px;
  color: #94a3b8;
}
.tv-grid-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 10px;
  align-items: stretch;
}
.tv-grid-shell.panel-hidden {
  grid-template-columns: minmax(0, 1fr);
}
.tv-grid-shell.panel-hidden .right-sidebar {
  display: none;
}
.workspace {
  display: flex;
  height: 600px;
  border: 1px solid var(--border, #232838);
  border-radius: 10px;
  overflow: hidden;
  background-color: #0b1120;
  min-width: 0;
}
.left-tools {
  width: 46px;
  background-color: #11141d;
  border-right: 1px solid var(--border, #232838);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  gap: 4px;
  user-select: none;
  overflow-y: auto;
  flex-shrink: 0;
}
.left-tools::-webkit-scrollbar {
  width: 3px;
}
.left-tools::-webkit-scrollbar-thumb {
  background: #334155;
}
.tool-divider {
  width: 24px;
  height: 1px;
  background-color: #232838;
  margin: 2px 0;
  flex-shrink: 0;
}
.chart-main .tool-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background-color: transparent;
  border-color: transparent;
}
.chart-main .tool-btn:hover {
  background-color: #1e293b;
  border-color: #334155;
}
.chart-main .tool-btn.active {
  background-color: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}
.tool-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-stage {
  position: relative;
  flex: 1;
  height: 100%;
  overflow: hidden;
  min-width: 0;
}
.quick-order-box {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid #334155;
  border-radius: 7px;
  padding: 3px;
  backdrop-filter: blur(6px);
}
.qo-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}
.qo-sell {
  background: rgba(239, 68, 68, 0.14) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
}
.qo-sell:hover,
.qo-sell.active {
  background: #ef4444 !important;
  color: #ffffff !important;
}
.qo-buy {
  background: rgba(34, 197, 94, 0.14) !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
  color: #86efac !important;
}
.qo-buy:hover,
.qo-buy.active {
  background: #22c55e !important;
  color: #090b10 !important;
}
.qo-price {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.15;
}
.qo-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  opacity: 0.92;
}
.qo-spread {
  padding: 0 5px;
  font-size: 10.5px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
#chart-container {
  width: 100%;
  height: 100%;
}
#draw-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}
#draw-canvas.interactive {
  pointer-events: auto;
}
.right-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 600px;
  min-width: 0;
}
.sidebar-card {
  background: #11141d;
  border: 1px solid var(--border, #232838);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-card:first-child {
  flex: 1 1 auto;
  overflow: hidden;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sidebar-head h2 {
  font-size: 12.5px;
  font-weight: 700;
  color: #f8fafc;
}
.sidebar-badge {
  font-size: 10px;
  font-weight: 700;
  color: #fb923c;
  background: rgba(243, 128, 32, 0.14);
  border: 1px solid rgba(243, 128, 32, 0.35);
  padding: 1px 6px;
  border-radius: 999px;
}
.watchlist-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  padding-right: 2px;
}
.watchlist-list::-webkit-scrollbar {
  width: 4px;
}
.watchlist-list::-webkit-scrollbar-thumb {
  background: #2b3448;
  border-radius: 99px;
}
.wl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: #151a26 !important;
  border: 1px solid transparent !important;
  border-radius: 7px !important;
  padding: 6px 8px !important;
}
.wl-item:hover {
  border-color: #334155 !important;
  background: #1b2232 !important;
}
.wl-item.active {
  border-color: #2563eb !important;
  background: rgba(37, 99, 235, 0.18) !important;
}
.wl-sym {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  display: block;
}
.wl-name {
  font-size: 10px;
  color: #8b94a8;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 125px;
}
.wl-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.wl-price {
  font-size: 11.5px;
  font-weight: 700;
  color: #e2e8f0;
  display: block;
}
.wl-pct {
  font-size: 10.5px;
  font-weight: 600;
  display: block;
}
.wl-pct.up {
  color: #4ade80;
}
.wl-pct.down {
  color: #f87171;
}
.detail-card {
  flex-shrink: 0;
  gap: 8px;
}
.detail-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}
.detail-symbol {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
}
.detail-sub {
  font-size: 10.5px;
  color: #8b94a8;
}
.detail-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #232838;
}
.detail-last {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #f8fafc;
}
.detail-chg {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.dm-item {
  background: #0d1017;
  border: 1px solid #1e2636;
  border-radius: 6px;
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dm-item span {
  font-size: 10px;
  color: #8b94a8;
}
.dm-item strong {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: #e2e8f0;
}
.perf-title {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 5px;
}
.perf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.perf-chip {
  background: #0d1017;
  border: 1px solid #1e2636;
  border-radius: 6px;
  padding: 5px 4px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.perf-chip span {
  display: block;
  font-size: 10px;
  color: #8b94a8;
}
.perf-chip strong {
  display: block;
  font-size: 11px;
  margin-top: 2px;
}
.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 2px;
}
.detail-cta-primary,
.detail-cta-ghost {
  text-align: center;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
}
.detail-cta-primary {
  background: #f38020;
  color: #090b10;
}
.detail-cta-ghost {
  background: #171b26;
  color: #e2e8f0;
  border: 1px solid #2b3448;
}
.bottom-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding: 7px 12px;
  background: #11141d;
  border: 1px solid var(--border, #232838);
  border-radius: 8px;
  font-size: 11.5px;
  color: #94a3b8;
}
.range-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.range-group .range-btn {
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 600;
  background: #0d1017;
  border-color: #232838;
  color: #94a3b8;
}
.range-group .range-btn.active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}
.tool-hint-text {
  flex: 1 1 240px;
  min-width: 0;
}
.shortcut-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.shortcut-badges span {
  background-color: #171b26;
  border: 1px solid #2b3448;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1024px) {
  .tv-grid-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .right-sidebar {
    height: auto;
  }
  .sidebar-card:first-child {
    max-height: 220px;
  }
}
@media (max-width: 768px) {
  .workspace {
    height: 460px;
  }
}
@media (max-width: 520px) {
  .chart-page-shell {
    padding: 10px 10px 24px;
  }
  .workspace {
    height: 410px;
  }
  .left-tools {
    width: 40px;
    padding: 5px 2px;
  }
  .chart-main .tool-btn {
    width: 30px;
    height: 30px;
  }
  .quick-order-box {
    top: 8px;
    left: 8px;
  }
  .qo-btn {
    padding: 3px 7px;
  }
}

.tv-grid-shell {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 290px !important;
  gap: 10px !important;
  align-items: start !important;
  width: 100% !important;
  min-width: 0 !important;
}
.tv-grid-shell.panel-hidden {
  grid-template-columns: minmax(0, 1fr) !important;
}
.tv-grid-shell > .workspace {
  width: 100% !important;
  min-width: 0 !important;
  height: 580px !important;
}
.tv-grid-shell > .right-sidebar {
  width: 100% !important;
  min-width: 0 !important;
  height: 580px !important;
  overflow: hidden !important;
}
@media (max-width: 1024px) {
  .tv-grid-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .tv-grid-shell > .right-sidebar {
    height: auto !important;
  }
}

.chart-page-shell,
.chart-page-shell .app-shell {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 8px 12px 20px !important;
}
.tv-grid-shell {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 295px !important;
  gap: 10px !important;
  align-items: stretch !important;
  width: 100% !important;
}
.tv-grid-shell.panel-hidden {
  grid-template-columns: minmax(0, 1fr) !important;
}
.tv-grid-shell > .workspace,
.tv-grid-shell > .right-sidebar {
  height: calc(100vh - 235px) !important;
  min-height: 540px !important;
}
@media (max-width: 1024px) {
  .tv-grid-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .tv-grid-shell > .workspace {
    height: 480px !important;
    min-height: 420px !important;
  }
  .tv-grid-shell > .right-sidebar {
    height: auto !important;
    min-height: 0 !important;
  }
}

.state-pill.closed { color: #fbbf24; border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.12); }


/* === GRAHAFX FULL VIEWPORT TERMINAL LOCK === */
@media (min-width: 1025px) {
  html, body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden !important;
  }
  .chart-page-shell {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: 6px 10px !important;
    margin: 0 !important;
    overflow: hidden !important;
  }
  /* Sembunyikan footer & alert bar di halaman chart agar 100% fokus ke ruang grafik */
  #site-footer,
  .gf-core-header-wrap .market-alert-bar {
    display: none !important;
  }
  .gf-core-header-wrap {
    margin-bottom: 4px !important;
    flex: 0 0 auto !important;
  }
  .gf-core-header-wrap .topbar {
    padding: 6px 12px !important;
    margin-bottom: 4px !important;
    border-radius: 9px !important;
  }
  .gf-core-header-wrap .brand-logo {
    width: 26px !important;
    height: 26px !important;
  }
  .gf-core-header-wrap .brand-text h1 {
    font-size: 0.96rem !important;
  }
  .gf-core-header-wrap .brand-sub {
    display: none !important;
  }
  .gf-core-nav-strip {
    padding: 4px 10px !important;
    margin-bottom: 0 !important;
    border-radius: 8px !important;
  }
  .gf-core-nav-link {
    padding: 3px 9px !important;
    font-size: 0.76rem !important;
  }
  /* Mode Fullscreen Browser: sembunyikan site-header otomatis agar chart 100% layar */
  body.chart-fullscreen #site-header,
  :fullscreen #site-header {
    display: none !important;
  }
  .chart-main {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    margin-top: 2px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .toolbar {
    flex: 0 0 auto !important;
    padding: 5px 10px !important;
    margin-bottom: 5px !important;
    gap: 6px !important;
  }
  .ohlc-bar {
    flex: 0 0 auto !important;
    padding: 5px 10px !important;
    margin-bottom: 5px !important;
  }
  .tv-grid-shell {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: auto !important;
    grid-template-columns: minmax(0, 1fr) 288px !important;
    gap: 8px !important;
    align-items: stretch !important;
  }
  .tv-grid-shell.panel-hidden {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .tv-grid-shell > .workspace,
  .tv-grid-shell > .right-sidebar {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
  }
  .right-sidebar {
    gap: 8px !important;
  }
  .sidebar-card {
    padding: 8px 10px !important;
  }
  .sidebar-card:first-child {
    flex: 1 1 120px !important;
    min-height: 90px !important;
  }
  .detail-card {
    flex: 0 1 auto !important;
    overflow-y: auto !important;
    gap: 6px !important;
  }
  .detail-last {
    font-size: 17px !important;
  }
  .bottom-bar {
    flex: 0 0 auto !important;
    margin-top: 5px !important;
    padding: 5px 10px !important;
  }
}