/* Setup charts: the mini chart on a card / record row, and the expanded explorable chart
   (static/v2/setup_chart.js, templates/_setup_chart_modal.html; 2026-11-03). */
.scx { position: relative; display: block; width: 100%; height: 104px; padding: 0; margin: 0; border: 1px solid var(--line-soft);
       border-radius: 10px; background: linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0)), var(--nav);
       cursor: zoom-in; overflow: hidden; color: inherit; font: inherit; transition: border-color .15s, box-shadow .15s; }
.scx:hover, .scx:focus-visible { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(59,130,246,.10); outline: none; }
.scx svg { display: block; }
.scx::after { content: ""; position: absolute; right: 7px; top: 7px; width: 18px; height: 18px; border-radius: 6px; opacity: 0;
              background: rgba(10,13,19,.75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ECEEF3' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E") center / 11px no-repeat;
              transition: opacity .15s; }
.scx:hover::after, .scx:focus-visible::after { opacity: 1; }
.scx.scx-empty { background: var(--nav); }
.scx.scx-none { display: none; }   /* a coin the bar store does not hold: no chart, the card as before */
.scx.scx-empty::before { content: "Chart loading"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 11.5px; }
.scx[data-size="spark"] { width: 112px; height: 30px; border-radius: 7px; display: inline-block; vertical-align: middle; }
.scx[data-size="spark"]::after { display: none; }
.scx[data-size="spark"].scx-empty::before { content: ""; }
.scx.scx-failed::before { content: "Chart unavailable right now"; }
.scx[data-size="spark"].scx-failed::before { content: ""; }
.scx-halo { animation: scx-pulse 2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes scx-pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .scx-halo { animation: none; } }
.scx-lock { position: absolute; right: 0; top: 0; bottom: 0; width: 34%; display: flex; align-items: center; justify-content: center; gap: 5px;
            backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); background: linear-gradient(90deg, rgba(12,16,23,0), rgba(12,16,23,.7) 30%);
            color: #8AB4FF; font-size: 11px; font-weight: 650; letter-spacing: .02em; }

/* expanded */
html.scx-open { overflow: hidden; }
.scx-dialog { padding: 0; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); color: var(--text);
              width: min(1120px, 94vw); height: min(720px, 90vh); max-width: none; max-height: none; margin: auto; inset: 0; position: fixed; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); }
.scx-dialog::backdrop { background: rgba(5, 7, 11, .72); backdrop-filter: blur(4px); }
.scx-dialog[open] { display: flex; animation: scx-in .18s ease-out; }
@keyframes scx-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.scx-panel { display: flex; flex-direction: column; width: 100%; min-height: 0; padding: 16px 18px 10px; gap: 10px; }
.scx-head { position: static; background: none; border: 0; padding: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.scx-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.scx-title { font-size: 18px; font-weight: 750; letter-spacing: -.02em; color: #fff; margin: 0; }
.scx-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.scx-tool, .scx-close { border: 1px solid var(--line); background: var(--raised); color: var(--text); font: inherit; font-size: 15px; font-weight: 650;
                        min-width: 34px; height: 34px; padding: 0 10px; border-radius: 9px; cursor: pointer; }
.scx-fit { font-size: 12.5px; }
.scx-tool:hover, .scx-close:hover { border-color: var(--line-strong); color: #fff; }
.scx-close { font-size: 20px; line-height: 1; }
.scx-levels { display: flex; gap: 8px; margin: 0; flex-wrap: wrap; }
.scx-levels[hidden] { display: none; }
.scx-levels > div { display: flex; align-items: baseline; gap: 8px; background: var(--nav); border: 1px solid var(--line-soft); border-radius: 9px; padding: 6px 11px; }
.scx-levels dt { color: var(--muted); font-size: 10.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.scx-levels dd { margin: 0; font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.scx-levels small { color: var(--muted); font-weight: 600; font-size: 11.5px; }
.scx-locked { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--dim); font-size: 13px; }
.scx-locked[hidden] { display: none; }
.scx-locked svg { color: #8AB4FF; }
.scx-plot { position: relative; flex: 1; min-height: 0; border-radius: 12px; background: var(--nav); border: 1px solid var(--line-soft); overflow: hidden; }
.scx-canvas { position: absolute; inset: 0; display: block; touch-action: none; cursor: crosshair; }
.scx-readout { position: absolute; left: 10px; top: 6px; display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--dim);
               font-variant-numeric: tabular-nums; pointer-events: none; padding-right: 90px; }
.scx-readout b { color: #fff; font-weight: 650; }
.scx-state { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); font-size: 13px; pointer-events: none; }
.scx-state[hidden] { display: none; }
.scx-src { margin: 0; color: var(--muted); font-size: 11px; text-align: right; }

/* card + row placement */
.sg-chart { margin: -2px 0 0; }
.sg-table .scx-cell { padding-top: 4px; padding-bottom: 4px; }

@media (max-width: 640px) {
    .scx-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; margin: 0; }
    .scx-panel { padding: 12px 12px calc(8px + env(safe-area-inset-bottom)); }
    .scx-title { font-size: 16px; }
    .scx-tools { width: 100%; justify-content: flex-end; margin-left: 0; }
    .scx-head { gap: 8px; }
    .scx-readout { font-size: 10px; gap: 5px; padding-right: 6px; flex-wrap: nowrap; white-space: nowrap; overflow: hidden; right: 0; }
}
/* the home page's signals strip rows carry a spark (templates/landing.html) */
.hm-sig-row { grid-template-columns: 90px 1fr auto auto auto; }
@media (max-width: 480px) {
    .hm-sig-row { grid-template-columns: 64px 1fr auto auto; }
    .hm-sig-row .scx[data-size="spark"] { width: 56px; }
}
@media (max-width: 480px) { .sg-table .scx[data-size="spark"] { width: 84px; } }
