/* LS Tech Diamond Index - dashboard components. Everything is scoped to .lstdi
   so the site theme is not affected. Override the --lstdi-* variables to rebrand. */
.lstdi {
  --lstdi-line: #2a78d6;
  --lstdi-ink: inherit;
  --lstdi-soft: #52514e;
  --lstdi-muted: #6f6e69;
  --lstdi-grid: #e1e0d9;
  --lstdi-axis: #c3c2b7;
  --lstdi-border: rgba(11, 11, 11, 0.12);
  --lstdi-surface: #ffffff;
  --lstdi-wash: rgba(11, 11, 11, 0.05);
  --lstdi-strong: #0b0b0b;
  --lstdi-badge-bg: #fff4d6;
  --lstdi-badge-ink: #5c4100;
  --lstdi-flag-bg: #fdecea;
  --lstdi-flag-ink: #8a1f1f;
  display: block;
  color: var(--lstdi-ink);
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
}
.lstdi *, .lstdi *::before, .lstdi *::after { box-sizing: border-box; }
.lstdi + .lstdi { margin-top: 16px; }

/* ---- resets against theme styles ---- */
.lstdi table { width: 100%; border-collapse: collapse; border: 0; margin: 0; background: none; font-size: 14px; }
.lstdi th, .lstdi td { border: 0; border-bottom: 1px solid var(--lstdi-grid); background: none; padding: 10px 12px; text-align: left; vertical-align: top; line-height: 1.4; }
.lstdi th { font-size: 12px; font-weight: 600; color: var(--lstdi-muted); vertical-align: bottom; white-space: normal; }
.lstdi tbody tr:last-child td { border-bottom: 0; }
.lstdi dl, .lstdi dt, .lstdi dd, .lstdi p, .lstdi h3, .lstdi h4, .lstdi ul { margin: 0; padding: 0; }
.lstdi ul { list-style: none; }
.lstdi button {
  all: unset; box-sizing: border-box; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--lstdi-soft); padding: 5px 14px; border-radius: 6px; line-height: 1.4; text-align: center;
}
.lstdi button:hover { background: var(--lstdi-wash); }
.lstdi button[aria-pressed="true"] { background: var(--lstdi-strong); color: var(--lstdi-surface); }
.lstdi button:focus-visible { outline: 2px solid var(--lstdi-line); outline-offset: 1px; }
.lstdi a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---- shared ---- */
.lstdi .lstdi-num { font-variant-numeric: tabular-nums; }
.lstdi .lstdi-muted { color: var(--lstdi-muted); }
.lstdi .lstdi-card { background: var(--lstdi-surface); border: 1px solid var(--lstdi-border); border-radius: 12px; }
.lstdi .lstdi-badge {
  display: inline-block; font-size: 12px; font-weight: 600; line-height: 1.4; padding: 2px 8px; border-radius: 999px;
  background: var(--lstdi-badge-bg); color: var(--lstdi-badge-ink); vertical-align: middle;
}
.lstdi .lstdi-flag { background: var(--lstdi-flag-bg); color: var(--lstdi-flag-ink); }
.lstdi .lstdi-status { padding: 16px; border: 1px dashed var(--lstdi-border); border-radius: 12px; color: var(--lstdi-muted); font-size: 14px; }
.lstdi .lstdi-lock { padding: 24px; border: 1px solid var(--lstdi-border); border-radius: 12px; background: var(--lstdi-surface); }
.lstdi .lstdi-lock b { display: block; font-size: 16px; margin-bottom: 4px; }
.lstdi .lstdi-lock p { margin: 0 0 14px; color: var(--lstdi-soft); }
.lstdi a.lstdi-btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px; background: var(--lstdi-strong); color: var(--lstdi-surface);
  font-weight: 600; font-size: 14px; text-decoration: none; line-height: 1.2;
}
.lstdi a.lstdi-btn:hover { opacity: 0.9; }
.lstdi .lstdi-part-title { font-size: 18px; font-weight: 650; line-height: 1.3; margin: 28px 0 12px; color: var(--lstdi-strong); }
.lstdi .lstdi-part + .lstdi-part { margin-top: 16px; }
.lstdi .lstdi-sample { margin: 0 0 12px; }

/* ---- headline ---- */
.lstdi .lstdi-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 32px; }
.lstdi .lstdi-kicker { font-size: 13px; color: var(--lstdi-muted); }
.lstdi .lstdi-level { font-size: 44px; font-weight: 700; line-height: 1.1; margin: 2px 0; }
.lstdi .lstdi-asof { font-size: 13px; color: var(--lstdi-muted); }
.lstdi .lstdi-chips { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-bottom: 6px; }
.lstdi .lstdi-chips dt { font-size: 12px; color: var(--lstdi-muted); }
.lstdi .lstdi-chips dd { font-size: 17px; font-weight: 650; }

/* ---- chart ---- */
.lstdi .lstdi-chartcard { padding: 16px 16px 8px; }
.lstdi .lstdi-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 8px; }
.lstdi .lstdi-ranges { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--lstdi-border); border-radius: 8px; background: var(--lstdi-surface); }
.lstdi .lstdi-change { font-size: 14px; color: var(--lstdi-soft); }
.lstdi .lstdi-change b { color: var(--lstdi-strong); font-weight: 650; }
.lstdi .lstdi-plot { position: relative; }
.lstdi .lstdi-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.lstdi .lstdi-plot svg:focus { outline: none; }
.lstdi .lstdi-plot svg:focus-visible { outline: 2px solid var(--lstdi-line); outline-offset: 4px; border-radius: 4px; }
.lstdi .lstdi-tick { font-size: 12px; fill: var(--lstdi-muted); font-variant-numeric: tabular-nums; }
.lstdi .lstdi-endlabel { font-size: 13px; font-weight: 700; fill: var(--lstdi-strong); }
.lstdi .lstdi-reflabel { font-size: 11px; fill: var(--lstdi-muted); }
.lstdi .lstdi-tip {
  position: absolute; top: 0; left: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity 80ms linear;
  background: var(--lstdi-surface); border: 1px solid var(--lstdi-border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); padding: 8px 10px; font-size: 13px; min-width: 150px;
}
.lstdi .lstdi-tip.show { opacity: 1; }
.lstdi .lstdi-tip-date { color: var(--lstdi-muted); margin-bottom: 2px; }
.lstdi .lstdi-tip-val { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--lstdi-strong); }
.lstdi details { margin: 8px 0 4px; }
.lstdi summary { cursor: pointer; font-size: 14px; color: var(--lstdi-soft); padding: 6px 0; }
.lstdi details .lstdi-scroll { max-height: 320px; overflow-y: auto; margin-top: 6px; }
.lstdi details th { position: sticky; top: 0; background: var(--lstdi-surface); }

/* ---- tiers ---- */
.lstdi .lstdi-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.lstdi .lstdi-tier { padding: 16px; }
.lstdi .lstdi-tier-id { font-size: 12px; font-weight: 600; color: var(--lstdi-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.lstdi .lstdi-tier-name { font-size: 15px; font-weight: 650; margin: 2px 0 10px; line-height: 1.3; }
.lstdi .lstdi-tier-ytd { font-size: 26px; font-weight: 700; line-height: 1.1; }
.lstdi .lstdi-tier-meta { font-size: 13px; color: var(--lstdi-soft); margin-top: 6px; }
.lstdi .lstdi-bar { position: relative; height: 6px; border-radius: 3px; background: var(--lstdi-wash); margin-top: 10px; }
.lstdi .lstdi-bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--lstdi-line); }
.lstdi .lstdi-bar i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--lstdi-strong); }

/* ---- rebalance strip ---- */
.lstdi .lstdi-rebal { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 14px 16px; font-size: 14px; }
.lstdi .lstdi-rebal dt { font-size: 12px; color: var(--lstdi-muted); }
.lstdi .lstdi-rebal dd { font-weight: 600; }
.lstdi .lstdi-warn { margin-top: 10px; font-size: 14px; }
.lstdi .lstdi-warn li { padding: 6px 0 6px 18px; position: relative; color: var(--lstdi-soft); }
.lstdi .lstdi-warn li::before { content: "!"; position: absolute; left: 4px; font-weight: 700; color: var(--lstdi-flag-ink); }

/* ---- tables ---- */
.lstdi .lstdi-tablewrap { overflow-x: auto; }
.lstdi .lstdi-tablewrap table { min-width: 860px; }
.lstdi td.lstdi-r, .lstdi th.lstdi-r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lstdi .lstdi-co { font-weight: 650; }
.lstdi .lstdi-sub { display: block; font-size: 12px; color: var(--lstdi-muted); font-weight: 400; }
.lstdi tr.lstdi-group td { background: var(--lstdi-wash); font-size: 13px; padding-top: 8px; padding-bottom: 8px; }
.lstdi tr.lstdi-group b { font-weight: 650; }
.lstdi .lstdi-why { max-width: 420px; font-size: 13px; color: var(--lstdi-soft); white-space: normal; }
.lstdi .lstdi-profile table { min-width: 720px; }

/* ---- watchlist ---- */
/* facts: company, tier and country counts */
.lstdi .lstdi-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px 24px; margin: 0; padding: 0; }
.lstdi .lstdi-fact { display: flex; flex-direction: column; min-width: 0; }
.lstdi .lstdi-fact dd { margin: 0; font-size: 36px; font-weight: 650; line-height: 1.1; color: var(--lstdi-strong); }
.lstdi .lstdi-fact dt { margin: 4px 0 0; font-size: 14px; font-weight: 400; color: var(--lstdi-soft); }

/* method: one card per tier */
.lstdi .lstdi-method { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.lstdi .lstdi-mcard { padding: 24px; display: flex; flex-direction: column; }
.lstdi .lstdi-mweight { font-size: 36px; font-weight: 650; line-height: 1.1; color: var(--lstdi-line); margin: 8px 0 10px; }
.lstdi .lstdi-mcard .lstdi-tier-name { font-size: 17px; margin: 0 0 8px; }
.lstdi .lstdi-mdesc { flex: 1; margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: var(--lstdi-soft); }
.lstdi .lstdi-mcard .lstdi-tier-meta { margin-top: 0; color: var(--lstdi-muted); }

.lstdi .lstdi-watch { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.lstdi .lstdi-watchcard { padding: 16px; }
.lstdi .lstdi-watchcard h4 { font-size: 16px; font-weight: 650; }
.lstdi .lstdi-watchcard .lstdi-sub { margin: 2px 0 8px; }
.lstdi .lstdi-watchcard p { font-size: 14px; color: var(--lstdi-soft); margin-top: 6px; }
.lstdi .lstdi-watchcard p b { color: var(--lstdi-strong); font-weight: 600; }

/* constituents: keep the company column visible while scrolling sideways */
.lstdi .lstdi-cons tbody tr:not(.lstdi-group) td:first-child,
.lstdi .lstdi-cons thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--lstdi-surface); }

@media (max-width: 600px) {
  /* weighting profile becomes stacked rows on phones */
  .lstdi .lstdi-profile table { min-width: 0; }
  .lstdi .lstdi-profile thead { display: none; }
  .lstdi .lstdi-profile tr { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 2px; padding: 12px; border-bottom: 1px solid var(--lstdi-grid); }
  .lstdi .lstdi-profile tr.lstdi-group { display: block; padding: 8px 12px; background: var(--lstdi-wash); }
  .lstdi .lstdi-profile td { display: block; padding: 0; border: 0; background: none; }
  .lstdi .lstdi-profile .lstdi-c-name { grid-column: 1; grid-row: 1; }
  .lstdi .lstdi-profile .lstdi-c-weight { grid-column: 2; grid-row: 1; font-weight: 650; }
  .lstdi .lstdi-profile .lstdi-c-ticker { grid-column: 1; grid-row: 2; font-size: 12px; color: var(--lstdi-muted); }
  .lstdi .lstdi-profile .lstdi-c-country { grid-column: 2; grid-row: 2; font-size: 12px; color: var(--lstdi-muted); text-align: right; }
  .lstdi .lstdi-profile .lstdi-c-why { grid-column: 1 / -1; grid-row: 3; margin-top: 4px; max-width: none; }
  .lstdi .lstdi-profile tr.lstdi-total { border-bottom: 0; }
  .lstdi .lstdi-level { font-size: 36px; }
  .lstdi .lstdi-chartcard { padding: 12px 8px 4px; }
  .lstdi th, .lstdi td { padding: 9px 10px; }
}

/* headline before launch */
.lstdi .lstdi-soon-title { font-size: 28px; }
