/* ============================================================================
   ETF Shop 4.0 — colour and small graphics. Every colour is a theme token, so
   light, dark and paper modes all follow.
   ============================================================================ */

/* ── signal tiles ───────────────────────────────────────────────────────── */
.es-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.es-tile {
  --c: var(--a-emerald); --cs: var(--a-emerald-s);
  position: relative; overflow: hidden; border-radius: 14px; padding: 14px 16px 12px;
  background: linear-gradient(135deg, var(--cs), var(--surface) 78%);
  border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line));
  box-shadow: inset 4px 0 0 var(--c);
}
.es-tile.dip { --c: var(--a-sky); --cs: var(--a-sky-s); }
.es-tile.sell { --c: var(--a-amber); --cs: var(--a-amber-s); }
.es-tile.sip { --c: var(--a-violet); --cs: var(--a-violet-s); }
.es-tile.off { filter: saturate(.35); opacity: .85; }
.es-tile .l { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--c); }
.es-tile .v { font-size: 30px; font-weight: 800; line-height: 1.1; margin: 4px 0 6px; color: var(--ink); }
.es-tile .ic { position: absolute; right: 12px; top: 10px; font-size: 26px; opacity: .55; }
.es-sym { display: inline-block; margin: 2px 4px 0 0; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: var(--c); }

/* ── cards with an accent stripe ────────────────────────────────────────── */
.es-card { --c: var(--a-emerald); border-top: 3px solid var(--c); }
.es-card.dip { --c: var(--a-sky); }
.es-card.sell { --c: var(--a-amber); }
.es-card.sip { --c: var(--a-violet); }
.es-card.auto { --c: var(--a-indigo); }
.es-card .card-head h3 { color: var(--ink); }
.es-card thead th { color: var(--c); }
.es-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 16px; }
.es-grid > .wide { grid-column: 1 / -1; }

/* The action button column never scrolls out of reach. */
/* Solid background and a soft edge, so text scrolling underneath is hidden
   rather than showing through. */
.es-act { position: sticky; right: 0; z-index: 2; white-space: nowrap; text-align: right; background: var(--surface);
  box-shadow: -10px 0 12px -10px rgba(0,0,0,.35); }
tr:hover .es-act { background: var(--surface-2); }
thead .es-act { background: inherit; box-shadow: none; }

/* ── capital-used gauge with the target ladder ──────────────────────────── */
.es-gauge { margin: 4px 0 2px; }
.es-gauge .track { position: relative; height: 16px; border-radius: 999px; overflow: hidden; display: flex; background: var(--surface-2); border: 1px solid var(--line); }
.es-gauge .seg { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: var(--ink-2); }
.es-gauge .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--a-emerald), var(--a-sky) 60%, var(--a-amber) 80%, var(--a-rose)); opacity: .85; }
.es-gauge .mark { position: absolute; top: -3px; bottom: -3px; width: 3px; border-radius: 2px; background: var(--ink); }
.es-gauge .legend { display: flex; justify-content: space-between; flex-direction: row; font-size: 11px; color: var(--ink-3); margin-top: 5px; }

/* ── 52-week range bar ──────────────────────────────────────────────────── */
.es-range { min-width: 150px; }
.es-range .bar { position: relative; height: 7px; border-radius: 999px; margin: 5px 0 3px;
  background: linear-gradient(90deg, var(--up), var(--warn) 55%, var(--down)); opacity: .75; }
.es-range .dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.es-range .nums { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ── gain bar inside a cell ─────────────────────────────────────────────── */
.es-gain { position: relative; display: inline-flex; justify-content: flex-end; min-width: 92px; padding: 2px 7px; border-radius: 6px; overflow: hidden; font-weight: 700; }
.es-gain i { position: absolute; top: 0; bottom: 0; right: 0; border-radius: 6px; opacity: .22; }
.es-gain.pos { color: var(--up); } .es-gain.pos i { background: var(--up); }
.es-gain.neg { color: var(--down); } .es-gain.neg i { background: var(--down); }
.es-gain span { position: relative; }

/* ── today's change pill ────────────────────────────────────────────────── */
.es-chg { display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.es-chg.up { background: var(--up-bg); color: var(--up); }
.es-chg.down { background: var(--down-bg); color: var(--down); }
.es-chg.flat { background: var(--surface-2); color: var(--ink-3); }

/* ── rank badge ─────────────────────────────────────────────────────────── */
.es-rank { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-weight: 800; font-size: 12px;
  background: color-mix(in srgb, var(--c, var(--a-emerald)) 16%, var(--surface)); color: var(--c, var(--a-emerald)); }

/* ── sell-state chips ───────────────────────────────────────────────────── */
.es-state { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.es-state.sell { background: var(--up-bg); color: var(--up); }
.es-state.trailing { background: var(--info-bg); color: var(--info); }
.es-state.small { background: var(--warn-bg); color: var(--warn); }
.es-state.hold { background: var(--surface-2); color: var(--ink-2); }

/* ── not-an-order notice ────────────────────────────────────────────────── */
.es-note { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; font-size: 12.5px;
  background: var(--warn-bg); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }

.es-status { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.es-dotlive { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--up); box-shadow: 0 0 0 3px var(--up-bg); }
.es-dotlive.off { background: var(--ink-3); box-shadow: none; }
.es-dotlive.bad { background: var(--down); box-shadow: 0 0 0 3px var(--down-bg); }
.es-act:empty { box-shadow: none; background: transparent; }

/* vs NIFTY 50 — the better of the two figures in each comparison row */
.es-win { font-weight: 700; background: color-mix(in srgb, var(--up) 10%, transparent); }
