/* ui/charts.css — the charts page only */
.ch-layout { display: grid; grid-template-columns: 330px 1fr; gap: 16px; align-items: start; }
.ch-layout > * { min-width: 0; }
@media (max-width: 1000px) {
  .ch-layout { grid-template-columns: minmax(0, 1fr); }
  .ch-layout .ch-side { position: static; }
  .ch-list { max-height: 340px; min-height: 0; }
  .ch-main { order: -1; }                      /* chart first on small screens */
}

.ch-side { position: sticky; top: 12px; }
.ch-search { width: 100%; padding: 11px 14px; margin-bottom: 10px; font-size: 14px; }

.seg { display: inline-flex; background: var(--panel); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: 999px; font-size: 12.5px;
              font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--ink); color: #fff; }
.seg.multi button.on { background: var(--accent-soft); color: var(--accent); }
.ch-side .seg { width: 100%; justify-content: space-between; margin-bottom: 10px; }

.ch-list { background: var(--panel); border-radius: 18px; max-height: calc(100vh - 290px); min-height: 300px; overflow: auto; }
.ch-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 11px 14px; cursor: pointer;
          border-bottom: 1px solid var(--line); }
.ch-row:last-child { border-bottom: 0; }
.ch-row:hover { background: var(--panel2); }
.ch-row.on { background: var(--accent-soft); }
.ch-row .s { font-weight: 700; font-size: 13.5px; }
.ch-row .s small { font-weight: 500; color: var(--dim); font-size: 11px; margin-left: 4px; }
.ch-row .p { text-align: right; font-weight: 600; font-size: 13.5px; }
.ch-row .m { color: var(--dim); font-size: 11.5px; }
.ch-row .c { text-align: right; font-size: 12px; font-weight: 600; }

.ch-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.ch-sym { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.ch-sym small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.ch-px { margin-top: 4px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
#ltp { font-size: 32px; font-weight: 600; letter-spacing: -.03em; border-radius: 8px; padding: 0 4px; margin-left: -4px; }
#chg { font-size: 15px; font-weight: 600; }
.ch-live { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.ch-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.ch-live i.on { background: var(--buy); box-shadow: 0 0 0 3px var(--buy-dim); }
.ch-ohlc { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; }
.ch-ohlc div { display: flex; flex-direction: column; gap: 2px; }
.ch-ohlc span { color: var(--dim); font-size: 11px; }
.ch-ohlc b { font-weight: 600; }

.ch-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ch-tools .seg { background: var(--panel2); }
.ch-chart { height: 520px; width: 100%; border-radius: 16px; overflow: hidden; }
@media (max-width: 720px) { .ch-chart { height: 380px; } }
.ch-foot { margin-top: 10px; color: var(--dim); font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; }

.ch-grid-box { margin-top: 16px; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mini { background: var(--panel); border-radius: 18px; padding: 12px 14px; cursor: pointer; }
.mini:hover { box-shadow: 0 0 0 2px var(--accent-soft); }
.mini-h { display: flex; justify-content: space-between; align-items: baseline; }
.mini-h b { font-size: 14px; }
.mini-h span { font-size: 12.5px; font-weight: 600; }
.mini-c { height: 110px; margin-top: 6px; }

/* buy / sell / details under the price */
.ch-trade { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ch-trade button { border: 0; border-radius: 999px; padding: 8px 18px; font-weight: 800; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.ch-buy { background: var(--buy); color: #fff; }
.ch-sell { background: var(--sell); color: #fff; }
.ch-det { background: var(--panel2); color: var(--text); }
.ch-trade button:hover { filter: brightness(1.08); }
