/* 2026-11-16: Scope the compact redesign to the trade card; the installed
   dashboard and trading calculations stay unchanged. The first revision used
   9–10px labels and low-contrast rules, which the user found difficult to scan.
   Increase text by role, use labelled tinted panels (not colour alone), and
   preserve full INR amounts and the 380px width. Narrow cards reflow instead
   of shrinking meaningful text. Evidence: docs/analysis/2026-11-16-gauge-redesign.md,
   "Readability revision"; .codex/gauge-readability-20261116/.
   2026-11-16 terminal revision: user rejected the pastel mint/pink palette.
   Saturated gain/loss ink, neutral flat surfaces and sharper borders preserve
   the larger type while making the terminal hierarchy less washed out.
   See the "Terminal palette revision" in the same audit. */
/* 2026-11-16: The summary's global theme disagreed with the card palette,
   and #ff3b45 was too bright. Shared gain/loss tokens use TradingView's
   documented teal/coral pair, with neutral charcoal surfaces and no glow.
   Root-level custom properties also reach FX tooltip portals; only explicit
   gauge consumers use these names. No universal institutional palette is
   claimed. Contrast, source and deployment evidence are in the audit's
   "Unified summary/card palette" section. */
:root {
  --tg-green: #26a69a;
  --tg-red: #ef5350;
  --tg-text: #d8dce5;
  --tg-muted: #a3aab8;
  --tg-line: #2a2e39;
  --tg-bg: #10141c;
  --tg-panel: #131722;
  --tg-panel-raised: #171c27;
  --tg-yellow: #d4ad64;
  --tg-blue: #7b9fcf;
}
.tg-card {
  box-sizing: border-box;
  container-type: inline-size;
  width: 380px;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--tg-line);
  border-radius: 6px;
  background: var(--tg-panel);
  color: var(--tg-text);
  font-family: "Space Grotesk","Work Sans",sans-serif;
  padding: 16px;
  line-height: 1.3;
  box-shadow: none;
}
.tg-card *, .tg-card *::before, .tg-card *::after { box-sizing: border-box; }
.tg-card strong, .tg-card b, .tg-card time, .tg-net-value { font-variant-numeric: tabular-nums; }
.tg-card button, .tg-card summary { -webkit-tap-highlight-color: transparent; }
.tg-header { display:flex;align-items:flex-start;justify-content:space-between;gap:8px; }
.tg-header > div { min-width:0; }
.tg-header h3 { margin:0 0 4px;font-size:16px;font-weight:700;letter-spacing:0;overflow-wrap:anywhere; }
.tg-clock, .tg-context { font-size:12px;color:var(--tg-muted); }
.tg-status { flex-shrink:0;font-size:11px;font-weight:700;letter-spacing:.04em;border:1px solid var(--tg-line);border-radius:4px;padding:6px 9px;display:flex;align-items:center;gap:5px;color:var(--tg-muted); }
.tg-status i, .tg-dot { width:6px;height:6px;border-radius:50%;background:currentColor;display:inline-block;flex-shrink:0; }
.tg-status-live { color:var(--tg-green);background:#26a69a10;border-color:#26a69a55; }
.tg-status-open, .tg-status-waiting { color:var(--tg-yellow);background:#d4ad640d;border-color:#d4ad6455; }
.tg-status-closed { background:var(--tg-panel-raised); }

/* 2026-11-16: Net is the primary result, so give it a high-contrast surface.
   Gross return stays on the smaller labelled meter to avoid mixing bases. */
.tg-hero { display:grid;grid-template-columns:minmax(0,1fr) 78px;gap:8px;align-items:center;margin:12px 0 8px;padding:12px 10px;border:1px solid var(--tg-line);border-left:3px solid #596273;border-radius:3px;background:var(--tg-bg); }
.tg-hero:has(.tg-net > .tg-positive) { border-left-color:var(--tg-green);background:var(--tg-bg); }
.tg-hero:has(.tg-net > .tg-negative) { border-left-color:var(--tg-red);background:var(--tg-bg); }
.tg-net { display:flex;flex-direction:column;gap:6px;min-width:0; }
.tg-label, .tg-section-label { font-size:12px;letter-spacing:.045em;color:var(--tg-text);font-weight:650; }
.tg-net-value { font-size:clamp(24px,8cqw,28px);letter-spacing:-.045em;line-height:1.15;font-weight:750;overflow-wrap:anywhere; }
.tg-subtle { font-size:11px;color:var(--tg-muted); }
.tg-meter { width:78px;height:76px;overflow:visible; }
.tg-meter-track, .tg-meter-loss, .tg-meter-gain { fill:none;stroke-width:5;stroke-linecap:round; }
.tg-meter-track { stroke:var(--tg-line); }
.tg-meter-loss { stroke:#ef535080; }
.tg-meter-gain { stroke:#26a69a80; }
.tg-meter-needle { stroke:currentColor;stroke-width:1.8;stroke-linecap:round; }
.tg-meter-value { fill:currentColor;font-size:17px;font-weight:700; }
.tg-meter-end { fill:var(--tg-muted);font-size:9px; }
.tg-positive { color:var(--tg-green); }
.tg-negative { color:var(--tg-red); }
.tg-neutral { color:var(--tg-muted); }
.tg-bg-positive { background:var(--tg-green); }
.tg-bg-negative { background:var(--tg-red); }
.tg-accounting { display:flex;justify-content:space-between;gap:6px 12px;flex-wrap:wrap;font-size:12px;color:var(--tg-muted);padding-bottom:10px;border-bottom:1px solid var(--tg-line); }
.tg-accounting > span { display:flex;flex-wrap:wrap;gap:3px 5px; }
.tg-accounting b { font-size:13px;font-weight:600;color:var(--tg-text);overflow-wrap:anywhere; }
.tg-accounting b.tg-positive { color:var(--tg-green); }
.tg-accounting b.tg-negative { color:var(--tg-red); }

.tg-prices { display:grid;grid-template-columns:minmax(0,1fr) 20px minmax(0,1fr);align-items:center;margin-top:10px;gap:8px; }
.tg-prices > div { display:flex;flex-direction:column;gap:4px;min-width:0;padding:8px; }
.tg-prices > div:last-child { text-align:right;background:var(--tg-bg);border:1px solid var(--tg-line);border-radius:3px; }
.tg-prices > div:last-child .tg-label { color:var(--tg-blue); }
.tg-prices strong { font-size:25px;font-weight:700;overflow-wrap:anywhere; }
.tg-prices time { font-size:12px;color:var(--tg-muted);white-space:nowrap; }
.tg-price-arrow { color:var(--tg-muted);font-size:18px; }
.tg-meta { display:flex;flex-wrap:wrap;gap:5px 10px;justify-content:space-between;font-size:12px;margin:10px 0 14px;color:var(--tg-muted); }
.tg-meta b { color:var(--tg-text);font-size:13px;font-weight:650;margin-left:3px; }
.tg-section-label { display:flex;justify-content:space-between;align-items:baseline;gap:6px;flex-wrap:wrap;margin-bottom:7px; }
.tg-section-label > span:last-child { font-weight:400;text-transform:none;letter-spacing:0;font-size:11px;color:var(--tg-muted); }

/* 2026-11-16: BEST/WORST need visible landmarks, not tiny dots alone. The
   labels, signs, exact INR and percentage remain explicit for colour-blind
   users. Full-width rows allow a larger 18px value without widening cards. */
.tg-extreme { display:grid;grid-template-columns:56px minmax(0,1fr) auto;gap:6px;align-items:center;padding:9px 8px;margin-top:6px;border:1px solid var(--tg-line);border-left-width:3px;border-radius:3px; }
.tg-extreme[data-gauge-extreme="best"] { background:var(--tg-bg);border-color:var(--tg-line);border-left-color:var(--tg-green); }
.tg-extreme[data-gauge-extreme="worst"] { background:var(--tg-bg);border-color:var(--tg-line);border-left-color:var(--tg-red); }
.tg-extreme-label { font-size:11px;font-weight:750;color:var(--tg-text);display:flex;align-items:center;gap:5px; }
.tg-extreme-value { min-width:0;display:flex;flex-direction:column;gap:3px; }
.tg-extreme-value strong { font-size:18px;letter-spacing:-.035em;overflow-wrap:anywhere;font-weight:700; }
.tg-extreme-value > span { font-size:12px;color:var(--tg-muted); }
.tg-extreme-pct { font-size:14px;font-weight:650;white-space:nowrap;font-variant-numeric:tabular-nums; }
.tg-spark { display:block;width:100%;height:26px;margin:10px 0 6px; }
.tg-nifty { display:flex;justify-content:space-between;gap:6px;padding:5px 0;flex-wrap:wrap; }
.tg-nifty b { font-weight:650; }

.tg-details { border-top:1px solid var(--tg-line);font-size:12px;color:var(--tg-text);margin-top:4px; }
.tg-details summary { cursor:pointer;list-style:none;padding:10px 0;display:flex;gap:7px;align-items:center;font-weight:550; }
.tg-details summary::before { content:'›';font-size:18px;line-height:12px;transition:transform .15s; }
.tg-details[open] summary::before { transform:rotate(90deg); }
.tg-details summary::-webkit-details-marker { display:none; }
.tg-details summary > span { margin-left:auto;font-size:11px;color:var(--tg-muted); }
.tg-details summary:focus-visible, .tg-actions button:focus-visible { outline:2px solid var(--tg-green);outline-offset:3px;border-radius:3px; }
.tg-detail-body { padding:0 0 12px; }
.tg-fx-row { display:flex;justify-content:space-between;gap:10px;padding:6px 0; }
.tg-fx-row > span { font-size:12px;flex:0 0 80px; }
.tg-fx-row > div { display:flex;gap:5px 10px;flex-wrap:wrap;justify-content:flex-end;min-width:0; }
.tg-fx-row > div > span { overflow-wrap:anywhere;color:var(--tg-text); }
.tg-detail-body small { display:block;font-size:11px;line-height:1.5;margin-top:6px;color:var(--tg-muted); }
.tg-reason { margin:0 0 12px;overflow-wrap:anywhere;line-height:1.6; }
.tg-actions { border-top:1px solid var(--tg-line);display:flex;align-items:center;gap:4px;padding-top:10px; }
.tg-actions button { font:inherit;font-size:12px;font-weight:600;border:1px solid transparent;border-radius:4px;background:transparent;color:var(--tg-text);padding:8px 10px;min-height:36px;cursor:pointer; }
.tg-actions button:first-child { margin-right:auto;color:var(--tg-green);background:#26a69a0d;border-color:#26a69a44; }
.tg-actions button:first-child span { margin-left:6px; }
.tg-actions button:hover { background:#26a69a1a;color:var(--tg-text); }
.tg-actions button:disabled { opacity:.4;cursor:default; }
.tg-notice { font-size:12px;line-height:1.45;color:var(--tg-red);margin-top:10px; }

/* Narrow screens retain readable type: move the label and percentage into
   their own header rather than shrinking the full financial amount again. */
@container (max-width:310px) {
  .tg-header { flex-wrap:wrap; }
  .tg-header h3 { font-size:16px; }
  .tg-hero { grid-template-columns:minmax(0,1fr) 64px;gap:4px;padding:10px 8px; }
  .tg-meter { width:64px; }
  .tg-net-value { font-size:24px; }
  .tg-prices { gap:5px; }
  .tg-prices > div { padding:6px 4px; }
  .tg-prices strong { font-size:24px; }
  .tg-prices time { font-size:12px; }
  .tg-extreme { grid-template-columns:minmax(0,1fr) auto; }
  .tg-extreme-label { grid-column:1;grid-row:1; }
  .tg-extreme-pct { grid-column:2;grid-row:1; }
  .tg-extreme-value { grid-column:1 / -1;grid-row:2;flex-direction:row;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 10px; }
  .tg-extreme-value strong { font-size:18px; }
  .tg-extreme-value > span { font-size:12px; }
}
@media (prefers-reduced-motion:reduce) { .tg-details summary::before { transition:none; } }
