/* Clean chart/detail layer. Kept separate so a damaged legacy rule cannot break the viewer. */
.spark {
  height:86px;
  margin:4px 0 18px;
}
.spark polyline {
  stroke-width:2.25;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.chart-drawer {
  box-sizing:border-box;
  width:min(780px,100%);
  padding:26px 30px 40px;
  overflow-x:hidden;
  overflow-y:auto;
  display:block;
  color:#fff7ff;
  overscroll-behavior:contain;
  scrollbar-color:rgba(255,111,159,.46) transparent;
}
.chart-drawer.fullscreen { width:100%; }
.chart-actionbar {
  position:absolute;
  z-index:4;
  top:20px;
  right:22px;
  display:flex;
  gap:7px;
}
.chart-actionbar button {
  width:36px;
  height:36px;
  padding:0;
  display:grid;
  place-items:center;
  border:1px solid rgba(185,156,255,.24);
  border-radius:11px;
  color:#fff5ff;
  background:rgba(185,156,255,.09);
  box-shadow:inset 0 1px rgba(255,255,255,.04);
  font:700 18px/1 var(--font);
  cursor:pointer;
}
.chart-actionbar button:hover,
.chart-actionbar button:focus-visible {
  border-color:rgba(255,155,187,.65);
  background:rgba(255,111,159,.14);
  outline:none;
}
.chart-head {
  display:grid;
  grid-template-columns:52px minmax(0,1fr);
  align-items:center;
  gap:14px;
  padding:4px 176px 18px 0;
  border-bottom:1px solid rgba(185,156,255,.17);
}
.chart-identity { min-width:0; }
.chart-identity h2 {
  margin:0;
  color:#fff9ff;
  font-size:27px;
  line-height:1.08;
  letter-spacing:-.025em;
}
.chart-identity small {
  display:block;
  overflow:hidden;
  margin-top:5px;
  color:#968aa4;
  font-size:10px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.market-hero {
  display:grid;
  grid-template-columns:minmax(190px,.72fr) minmax(330px,1fr);
  align-items:end;
  gap:18px;
  padding:18px 0 16px;
}
.market-hero>div:first-child {
  display:flex;
  align-items:baseline;
  gap:9px;
  min-width:0;
  flex-wrap:wrap;
}
#chartPrice {
  color:#fffaff;
  font-size:29px;
  line-height:1;
  letter-spacing:-.035em;
}
#chartChange {
  color:var(--green);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.market-hero dl {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  margin:0;
  overflow:hidden;
  border:1px solid rgba(185,156,255,.15);
  border-radius:15px;
  background:rgba(185,156,255,.035);
}
.market-hero dl div {
  min-width:0;
  padding:11px 12px;
  border-left:1px solid rgba(185,156,255,.12);
}
.market-hero dl div:first-child { border-left:0; }
.market-hero dt {
  color:#8f839e;
  font-size:7px;
  letter-spacing:.12em;
}
.market-hero dd {
  overflow:hidden;
  margin:6px 0 0;
  color:#f9efff;
  font-size:12px;
  font-weight:800;
  text-overflow:ellipsis;
}
.coin-tabs {
  display:flex;
  gap:5px;
  padding:4px;
  border:1px solid rgba(185,156,255,.16);
  border-radius:13px;
  background:rgba(10,7,15,.5);
}
.coin-tabs button {
  flex:1 1 0;
  min-height:38px;
  border:0;
  border-radius:9px;
  color:#978ba4;
  background:transparent;
  font:800 11px/1 var(--font);
  cursor:pointer;
}
.coin-tabs button.active {
  color:#fff;
  background:linear-gradient(135deg,rgba(255,113,159,.94),rgba(169,118,241,.94));
  box-shadow:0 7px 18px rgba(255,111,159,.18);
}
.chart-tab-pane { display:none; }
.chart-tab-pane.active { display:block; }
.timeframe-tabs {
  overflow-x:auto;
  padding:14px 0 10px;
  scrollbar-width:none;
}
.timeframe-tabs::-webkit-scrollbar { display:none; }
.timeframe-tabs button { flex:1 0 48px; }
.indicator-menu {
  display:flex;
  align-items:center;
  gap:5px;
  overflow-x:auto;
  padding:0 0 10px;
  scrollbar-width:none;
}
.indicator-menu::-webkit-scrollbar { display:none; }
.indicator-menu button {
  flex:0 0 auto;
  min-width:43px;
  min-height:32px;
  padding:7px 10px;
  border:1px solid rgba(185,156,255,.16);
  border-radius:9px;
  color:#8f839d;
  background:rgba(185,156,255,.04);
  font:800 10px/1 var(--font);
  cursor:pointer;
}
.indicator-menu button.active {
  border-color:rgba(255,155,187,.38);
  color:#fff1f8;
  background:rgba(255,111,159,.11);
}
.indicator-menu .settings-button {
  min-width:34px;
  margin-left:auto;
  font-size:14px;
}
.indicator-settings {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  margin-bottom:11px;
  padding:11px;
  border:1px solid rgba(185,156,255,.15);
  border-radius:12px;
  background:rgba(185,156,255,.04);
}
.indicator-settings label { color:#988ca5; font-size:8px; }
.indicator-settings input {
  width:100%;
  box-sizing:border-box;
  margin-top:5px;
  padding:7px;
  border:1px solid rgba(185,156,255,.2);
  border-radius:7px;
  color:#fff;
  background:#120d1a;
}
.chart-tools { margin:0 0 8px; }
.chart-loading {
  min-height:20px;
  padding:3px 0;
  color:#a89bb5;
}
.chart-canvas {
  min-height:250px;
  margin:0;
  padding:9px 0 4px;
  border:1px solid rgba(185,156,255,.12);
  border-radius:14px;
  background:linear-gradient(180deg,rgba(185,156,255,.035),rgba(10,7,15,.22));
}
.chart-canvas canvas {
  display:block;
  width:100%;
  height:240px;
  touch-action:none;
  cursor:grab;
}
.chart-canvas canvas:active { cursor:grabbing; }
.chart-canvas canvas:focus-visible {
  outline:1px solid rgba(255,155,187,.72);
  outline-offset:-1px;
}
.chart-axis-label { paint-order:stroke; stroke:#100b18; stroke-width:2px; }
.chart-selected {
  margin-top:8px;
  padding:8px 10px;
  border-radius:9px;
  background:rgba(185,156,255,.035);
}
.chart-ohlc { padding:9px 0 3px; }
.indicator-panel {
  margin-top:15px;
  padding:12px 12px 8px;
  border:1px solid rgba(185,156,255,.12);
  border-radius:13px;
  background:rgba(185,156,255,.025);
}
.panel-label {
  margin-bottom:7px;
  color:#d6c9e2;
  font-size:9px;
  font-weight:800;
  letter-spacing:.1em;
}
.panel-label span { float:right; color:#ff9bbb; }
.indicator-panel svg { display:block; width:100%; height:82px; }
#rsiPanel svg { height:92px; }
.volume-bar { opacity:.72; }
.volume-bar.up { fill:var(--green); }
.volume-bar.down { fill:var(--red-2); }
.rsi-guide {
  stroke:rgba(185,156,255,.18);
  stroke-width:1;
  stroke-dasharray:4 4;
  vector-effect:non-scaling-stroke;
}
.rsi-line {
  fill:none;
  stroke:#cf8cff;
  stroke-width:1.6;
  stroke-linecap:round;
  stroke-linejoin:round;
  vector-effect:non-scaling-stroke;
}
.chart-note {
  margin-top:15px;
  padding-top:12px;
  border-top:1px solid rgba(185,156,255,.1);
}
.coin-data-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
  padding-top:15px;
}
.coin-data-grid>div,
.orderbook-view>div {
  padding:12px;
  border:1px solid rgba(185,156,255,.14);
  border-radius:11px;
  background:rgba(185,156,255,.04);
}
.price-alert-panel {
  position:sticky;
  z-index:5;
  bottom:0;
  margin-top:16px;
  padding:14px;
  border:1px solid rgba(255,155,187,.28);
  border-radius:14px;
  background:rgba(23,16,32,.97);
  box-shadow:0 -15px 40px rgba(3,1,8,.45);
}
.price-alert-panel>div,
.price-alert-panel form { display:flex; align-items:center; gap:8px; }
.price-alert-panel>div { justify-content:space-between; margin-bottom:10px; }
.price-alert-panel input,
.price-alert-panel select,
.price-alert-panel button {
  min-height:36px;
  border:1px solid rgba(185,156,255,.2);
  border-radius:9px;
  color:#fff;
  background:#120d1a;
}

@media(max-width:700px) {
  .spark { height:78px; margin:2px 0 16px; }
  .chart-drawer { padding:18px 14px 34px; }
  .chart-actionbar { top:14px; right:13px; gap:5px; }
  .chart-actionbar button { width:33px; height:33px; border-radius:9px; font-size:16px; }
  .chart-head {
    grid-template-columns:48px minmax(0,1fr);
    gap:11px;
    padding:2px 142px 14px 0;
  }
  .chart-logo { width:46px; height:46px; }
  .chart-identity h2 { font-size:23px; }
  .chart-identity small { font-size:8px; }
  .market-hero {
    grid-template-columns:1fr;
    gap:12px;
    padding:14px 0;
  }
  #chartPrice { font-size:26px; }
  .market-hero dl div { padding:10px 8px; }
  .market-hero dd { font-size:10px; }
  .coin-tabs button { min-height:36px; }
  .timeframe-tabs { gap:6px; padding-top:12px; }
  .timeframe-tabs button { min-width:45px; padding:8px 7px; }
  .indicator-menu button { min-width:40px; padding-inline:9px; }
  .chart-tools>span { max-width:58%; line-height:1.35; }
  .chart-tools button { min-height:30px; padding:4px 8px; }
  .chart-canvas { min-height:224px; border-radius:12px; }
  .chart-canvas canvas { height:250px; }
  .chart-ohlc { grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
  .chart-ohlc div { padding:8px 6px; }
  .chart-ohlc strong { font-size:8px; }
  .indicator-panel { margin-top:12px; padding:10px 9px 7px; }
  .indicator-settings { grid-template-columns:repeat(2,1fr); }
}

@media(max-width:390px) {
  .chart-head { padding-right:128px; }
  .chart-actionbar button { width:30px; height:30px; }
  .market-hero dl { grid-template-columns:1fr 1fr; }
  .market-hero dl div:last-child { grid-column:1/-1; border-top:1px solid rgba(185,156,255,.12); }
}
