.tdimw {
  --tdimw-blue: #1769aa;
  --tdimw-blue-dark: #124f83;
  --tdimw-ink: #182536;
  --tdimw-muted: #66758a;
  --tdimw-border: #e4eaf1;
  --tdimw-surface: #ffffff;
  --tdimw-soft: #f5f8fc;
  --tdimw-green: #13834a;
  --tdimw-red: #c23b42;
  width: 100%;
  max-width: 100%;
  margin: 24px auto;
  color: var(--tdimw-ink);
  font-family: inherit;
  line-height: 1.5;
  box-sizing: border-box;
}
.tdimw *, .tdimw *::before, .tdimw *::after { box-sizing: border-box; }
.tdimw-shell {
  overflow: hidden;
  background: var(--tdimw-surface);
  border: 1px solid var(--tdimw-border);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(21, 48, 77, .07);
}
.tdimw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 22px;
  border-bottom: 1px solid var(--tdimw-border);
  background: linear-gradient(110deg, #f8fbff 0%, #ffffff 72%);
}
.tdimw-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--tdimw-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
}
.tdimw-india-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #ed8b36; box-shadow: 0 0 0 3px rgba(237, 139, 54, .13); }
.tdimw-heading h2 { margin: 0 0 4px; color: var(--tdimw-ink); font-size: clamp(21px, 3vw, 28px); line-height: 1.2; font-weight: 750; letter-spacing: -.025em; }
.tdimw-heading p { margin: 0; color: var(--tdimw-muted); font-size: 14px; }
.tdimw-refresh {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid #c9d9e9;
  border-radius: 8px;
  background: #fff;
  color: var(--tdimw-blue-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.tdimw-refresh:hover { background: #f0f7fd; border-color: #9bbbd8; }
.tdimw-refresh:focus-visible, .tdimw button:focus-visible { outline: 3px solid rgba(23, 105, 170, .25); outline-offset: 2px; }
.tdimw-refresh svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tdimw-refresh.is-loading svg { animation: tdimw-spin .8s linear infinite; }
.tdimw-refresh:disabled { opacity: .7; cursor: wait; }
@keyframes tdimw-spin { to { transform: rotate(360deg); } }
.tdimw-tabs { display: flex; gap: 10px; padding: 16px 28px 0; background: #fff; }
.tdimw-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  padding: 10px 14px 12px;
  border: 1px solid var(--tdimw-border);
  border-bottom: 2px solid transparent;
  border-radius: 9px 9px 0 0;
  background: #f8fafc;
  color: var(--tdimw-ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.tdimw-tab:hover { background: #f1f6fb; }
.tdimw-tab.is-active { border-color: #d4e3f1; border-bottom-color: var(--tdimw-blue); background: #f1f7fd; }
.tdimw-tab-mark { display: grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; border-radius: 8px; background: #dcecf9; color: #155d96; font-size: 15px; font-weight: 800; }
.tdimw-tab-mark--sensex { background: #e7e8fb; color: #5553a4; }
.tdimw-tab strong, .tdimw-tab small { display: block; }
.tdimw-tab strong { font-size: 13px; line-height: 1.35; }
.tdimw-tab small { margin-top: 2px; color: var(--tdimw-muted); font-size: 11px; }
.tdimw-panel { padding: 18px 28px 0; }
.tdimw-quote-card { padding: 22px 24px 20px; border: 1px solid var(--tdimw-border); border-radius: 12px; background: #fff; }
.tdimw-quote-top, .tdimw-price-row, .tdimw-quote-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tdimw-index-name { color: var(--tdimw-ink); font-size: 16px; font-weight: 750; }
.tdimw-index-subtitle { margin-top: 2px; color: var(--tdimw-muted); font-size: 12px; }
.tdimw-live-indicator { display: inline-flex; align-items: center; gap: 7px; color: #557064; font-size: 11px; font-weight: 700; }
.tdimw-live-indicator i { width: 7px; height: 7px; border-radius: 50%; background: #23a36b; box-shadow: 0 0 0 3px rgba(35, 163, 107, .12); }
.tdimw-price-row { align-items: baseline; justify-content: flex-start; flex-wrap: wrap; gap: 13px; margin: 13px 0 8px; }
.tdimw-price { color: #152d45; font-size: clamp(31px, 5vw, 43px); font-weight: 800; letter-spacing: -.04em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tdimw-movement { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 6px; font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }
.tdimw-movement.is-positive { background: #eaf7f0; color: var(--tdimw-green); }
.tdimw-movement.is-negative { background: #fff0f0; color: var(--tdimw-red); }
.tdimw-movement.is-neutral { background: #f0f3f6; color: #637184; }
.tdimw-movement-arrow { font-size: 10px; }
.tdimw-quote-foot { padding-bottom: 16px; color: var(--tdimw-muted); font-size: 11px; }
.tdimw-points-note { color: #7c8999; }
.tdimw-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-top: 15px; border-top: 1px solid #edf1f5; }
.tdimw-stat { display: flex; flex-direction: column; gap: 4px; }
.tdimw-stat span { color: var(--tdimw-muted); font-size: 11px; }
.tdimw-stat strong { color: #26384b; font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; }
.tdimw-error { margin-top: 14px; padding: 10px 12px; border: 1px solid #f2d2d2; border-radius: 7px; background: #fff6f6; color: #9d3030; font-size: 12px; }
.tdimw-history-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 22px 2px 17px; }
.tdimw-history-toggle-row h3 { margin: 0 0 2px; color: var(--tdimw-ink); font-size: 16px; font-weight: 750; }
.tdimw-history-toggle-row p { margin: 0; color: var(--tdimw-muted); font-size: 12px; }
.tdimw-history-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #c9d9e9; border-radius: 8px; background: #fff; color: var(--tdimw-blue-dark); font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.tdimw-history-toggle:hover { background: #f3f8fd; }
.tdimw-history-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.tdimw-history-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.tdimw-chart-panel { margin: 0 0 18px; padding: 17px 18px 13px; border: 1px solid var(--tdimw-border); border-radius: 11px; background: #fff; }
.tdimw-chart-panel[hidden], .tdimw-chart-message[hidden], .tdimw-error[hidden] { display: none !important; }
.tdimw-chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.tdimw-range-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.tdimw-range-tabs button { padding: 6px 10px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #5b6a7d; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.tdimw-range-tabs button:hover { background: #f2f6fa; }
.tdimw-range-tabs button.is-active { border-color: #d6e6f4; background: #eaf3fb; color: var(--tdimw-blue-dark); }
.tdimw-chart-unit { color: #7b8796; font-size: 11px; }
.tdimw-chart-wrap { width: 100%; min-height: 300px; }
.tdimw-chart-wrap canvas { display: block; width: 100%; height: 300px; }
.tdimw-chart-message { padding: 38px 12px; color: var(--tdimw-muted); text-align: center; font-size: 13px; }
.tdimw-chart-caption { padding-top: 7px; color: #7a8795; font-size: 10px; }
.tdimw-footer { padding: 14px 28px 20px; border-top: 1px solid var(--tdimw-border); background: #f8fafc; }
.tdimw-source-line { margin-bottom: 8px; color: #68778a; font-size: 10px; }
.tdimw-source-line a { color: var(--tdimw-blue); text-decoration: underline; text-underline-offset: 2px; }
.tdimw-source-line span { padding: 0 4px; color: #9aa5b2; }
.tdimw-disclaimer { color: #718094; font-size: 10px; line-height: 1.65; }
.tdimw-disclaimer strong { color: #536275; }

@media (max-width: 640px) {
  .tdimw { margin: 18px auto; }
  .tdimw-shell { border-radius: 12px; }
  .tdimw-header { align-items: flex-start; padding: 19px 16px; }
  .tdimw-heading p { max-width: 240px; font-size: 12px; }
  .tdimw-refresh { min-height: 36px; padding: 8px 10px; font-size: 12px; }
  .tdimw-refresh svg { width: 14px; height: 14px; }
  .tdimw-tabs { gap: 7px; padding: 13px 14px 0; }
  .tdimw-tab { flex: 1 1 0; min-width: 0; gap: 7px; padding: 9px 8px 10px; }
  .tdimw-tab-mark { flex-basis: 28px; width: 28px; height: 28px; }
  .tdimw-tab strong { font-size: 11px; }
  .tdimw-tab small { font-size: 10px; }
  .tdimw-panel { padding: 14px 14px 0; }
  .tdimw-quote-card { padding: 17px 15px; }
  .tdimw-price { font-size: 32px; }
  .tdimw-movement { font-size: 11px; }
  .tdimw-stat-grid { gap: 7px; }
  .tdimw-stat strong { font-size: 12px; }
  .tdimw-history-toggle-row { align-items: flex-start; flex-direction: column; padding: 19px 1px 14px; }
  .tdimw-history-toggle { align-self: flex-start; }
  .tdimw-chart-panel { padding: 13px 10px 11px; }
  .tdimw-range-tabs { gap: 2px; }
  .tdimw-range-tabs button { padding: 6px 7px; font-size: 10px; }
  .tdimw-chart-wrap, .tdimw-chart-wrap canvas { min-height: 260px; height: 260px; }
  .tdimw-footer { padding: 13px 15px 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .tdimw *, .tdimw *::before, .tdimw *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
