* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
select,
summary {
  cursor: pointer;
}
button {
  border: 0;
  background: none;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 3px;
}
a {
  color: inherit;
  text-underline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
p {
  color: var(--color-ink-muted);
}
[hidden] {
  display: none !important;
}
.topbar {
  height: 64px;
  border-bottom: 1px solid var(--color-hairline);
  padding: 0 var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand,
.top-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.brand {
  color: var(--color-ink-muted);
}
.brand strong {
  color: var(--color-ink);
}
.brand-symbol {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--rounded-sm);
  background: var(--color-ink);
  color: var(--color-surface);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.15em;
  padding-right: 0.15em;
}
.brand-divider {
  width: 1px;
  height: 16px;
  background: var(--color-hairline);
}
.readonly {
  font-size: 12px;
  color: var(--color-ink-muted);
}
.icon-button {
  font-size: 20px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-pill);
}
main {
  max-width: 1464px;
  margin: auto;
  padding: var(--space-xl);
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: var(--space-md) 0 var(--space-xl);
  gap: var(--space-lg);
}
.heading h1 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}
.version {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-ink-muted);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-xs);
  padding: var(--space-xs);
  letter-spacing: 0;
}
.refresh-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-sm);
}
.refresh-block > span {
  color: var(--color-ink-muted);
}
.secondary {
  border: 1px solid var(--color-hairline);
  background: var(--color-surface-raised);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--rounded-pill);
  font-weight: 500;
  white-space: nowrap;
}
.secondary:hover {
  border-color: var(--color-ink-muted);
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.segments {
  display: flex;
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-pill);
  padding: var(--space-xs);
  background: var(--color-surface-sunken);
}
.segments button {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--rounded-pill);
  color: var(--color-ink-muted);
  white-space: nowrap;
}
.segments button[aria-pressed="true"] {
  background: var(--color-ink);
  color: var(--color-surface-raised);
}
.filters {
  display: flex;
  gap: var(--space-md);
}
.filters label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 12px;
  color: var(--color-ink-muted);
}
select {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-sm);
  padding: var(--space-sm);
  font-size: 14px;
}
.notice {
  border: 1px solid var(--color-state-view);
  border-radius: var(--rounded-sm);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
  color: var(--color-ink-muted);
  font-size: 12px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-lg);
  overflow: hidden;
}
.panel-heading {
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}
.panel-heading p {
  margin-top: var(--space-xs);
  letter-spacing: 0;
}
.text-button {
  font-size: 12px;
  color: var(--color-ink-muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  white-space: nowrap;
}
#chart-wrap {
  position: relative;
  height: 480px;
  margin: 0 var(--space-md);
}
#chart {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
  overflow: visible;
}
#chart text {
  font-family: inherit;
  font-size: 11px;
  fill: var(--color-ink-muted);
}
#chart .end-label {
  font-weight: 500;
  font-size: 11px;
}
#chart .series {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: opacity 0.15s;
  cursor: pointer;
}
.chart-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  font-size: 11px;
  color: var(--color-ink-muted);
}
.chart-footer > span:first-child {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.benchmark-line {
  width: 24px;
  border-top: 2px dashed var(--color-ink);
}
.ranking-panel {
  border-left: 1px solid var(--color-hairline);
}
.ranking-panel .panel-heading {
  padding: var(--space-lg) var(--space-md);
}
.ranking-columns,
.sector-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 58px;
  gap: var(--space-xs);
  align-items: center;
}
.ranking-columns {
  padding: 0 var(--space-md) var(--space-sm);
  color: var(--color-ink-muted);
  font-size: 11px;
  letter-spacing: 0;
}
.ranking-columns span:not(:first-child) {
  text-align: right;
}
.rankings {
  padding: 0 var(--space-sm) var(--space-md);
}
.sector-row {
  min-height: 33px;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--rounded-sm);
  position: relative;
}
.sector-row.selected {
  background: var(--color-surface-sunken);
}
.sector-row:hover {
  background: var(--color-surface);
}
.sector-pick {
  padding: 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-align: left;
  min-width: 0;
  white-space: nowrap;
  font-size: 12px;
}
.sector-pick span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.sector-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: var(--rounded-pill);
  background: var(--series-color);
}
.sector-toggle {
  padding: var(--space-xs);
  line-height: 0;
  margin-left: calc(-1 * var(--space-xs));
  border-radius: var(--rounded-xs);
}
.sector-toggle[aria-pressed="false"] .sector-dot {
  background: transparent;
  border: 1px solid var(--color-ink-faint);
}
.sector-name-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
}
.sector-return {
  text-align: right;
  font-size: 12px;
}
.breadth-value {
  font-size: 11px;
  text-align: right;
  color: var(--color-ink-muted);
}
.breadth-meter {
  display: block;
  height: 3px;
  width: 40px;
  border-radius: var(--rounded-pill);
  background: var(--color-hairline);
  margin-top: 3px;
  margin-left: auto;
  overflow: hidden;
}
.breadth-meter > i {
  display: block;
  height: 100%;
  background: var(--color-ink-muted);
}
.positive {
  color: var(--color-pnl-up);
}
.negative {
  color: var(--color-pnl-down);
}
.muted {
  color: var(--color-ink-muted);
}
.subtle-tag {
  font-size: 11px;
  color: var(--color-ink-muted);
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-pill);
  white-space: nowrap;
}
.loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: var(--space-md);
  padding: var(--space-xl);
  background: var(--color-surface-raised);
}
.loading h3 {
  font-size: 16px;
  font-weight: 500;
}
.loading p,
.loading > span {
  max-width: 420px;
  color: var(--color-ink-muted);
}
.loading-mark {
  width: 32px;
  height: 32px;
  border: 2px solid var(--color-hairline);
  border-top-color: var(--color-ink);
  border-radius: var(--rounded-pill);
  animation: spin 1.3s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-sm);
  background: var(--color-surface-raised);
  font-size: 12px;
  min-width: 180px;
}
.chart-tooltip > div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-lg);
  margin-top: var(--space-xs);
}
.chart-tooltip .time {
  color: var(--color-ink-muted);
  margin-bottom: var(--space-sm);
  font-size: 11px;
}
.detail-panel {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-lg);
  margin-top: var(--space-lg);
  overflow: hidden;
}
.detail-heading {
  padding: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.selected-title {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.selected-title .sector-dot {
  width: 12px;
  height: 12px;
}
.detail-actions {
  display: flex;
  gap: var(--space-sm);
}
input[type="search"] {
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-pill);
  background: var(--color-surface);
  padding: var(--space-sm) var(--space-md);
  width: 176px;
}
.detail-insight {
  padding: 0 var(--space-lg) var(--space-md);
  font-size: 12px;
  color: var(--color-ink-muted);
}
.table-scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
th {
  text-align: right;
  font-weight: 500;
  color: var(--color-ink-muted);
  font-size: 11px;
  background: var(--color-surface);
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--color-hairline);
  border-bottom: 1px solid var(--color-hairline);
}
th:first-child,
td:first-child {
  text-align: left;
  padding-left: var(--space-lg);
}
th:last-child,
td:last-child {
  padding-right: var(--space-lg);
}
th button {
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
}
th small {
  font-weight: 400;
  color: var(--color-ink-faint);
}
td {
  text-align: right;
  font-size: 12px;
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-hairline);
}
tr:last-child td {
  border-bottom: 0;
}
td:first-child strong {
  font-size: 14px;
  font-weight: 500;
  display: block;
}
td:first-child span {
  font-size: 11px;
  color: var(--color-ink-muted);
  display: block;
  margin-top: var(--space-xs);
}
td a {
  font-size: 11px;
  color: var(--color-ink-muted);
  margin-left: var(--space-sm);
}
.contribution-bar {
  display: inline-block;
  vertical-align: middle;
  width: 40px;
  height: 3px;
  background: var(--color-hairline);
  margin-right: var(--space-sm);
  border-radius: var(--rounded-pill);
  overflow: hidden;
}
.contribution-bar i {
  display: block;
  height: 100%;
  background: var(--series-color);
}
.detail-footer {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-hairline);
  font-size: 11px;
  color: var(--color-ink-muted);
  flex-wrap: wrap;
}
.empty-search {
  text-align: center;
  padding: var(--space-xl);
  color: var(--color-ink-muted);
}
.methodology {
  margin-top: var(--space-lg);
  border-top: 1px solid var(--color-hairline);
  padding: var(--space-lg) 0;
}
.methodology summary {
  font-weight: 500;
}
.methodology summary span {
  font-weight: 400;
  font-size: 12px;
  color: var(--color-ink-muted);
  margin-left: var(--space-md);
}
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  padding: var(--space-lg) 0;
}
.method-grid p {
  font-size: 12px;
  margin-top: var(--space-sm);
  line-height: 1.7;
}
.sources {
  font-size: 12px;
  margin-top: var(--space-md);
}
.coverage-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.coverage-list span {
  font-size: 11px;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-hairline);
  border-radius: var(--rounded-xs);
  color: var(--color-ink-muted);
}
.page-footer {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  font-size: 11px;
  color: var(--color-ink-muted);
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-hairline);
}
@media (min-width: 1600px) {
  #chart-wrap {
    height: 500px;
  }
  .sector-row {
    min-height: 35px;
  }
}
@media (max-width: 1100px) {
  main {
    padding: var(--space-lg);
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
  .filters {
    gap: var(--space-sm);
  }
  .filters label {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }
  .panel-heading {
    padding: var(--space-md);
  }
  #chart-wrap {
    height: 470px;
  }
  .chart-footer {
    padding: var(--space-md);
  }
  .subtle-tag {
    font-size: 10px;
  }
}
@media (max-width: 760px) {
  .topbar {
    padding: 0 var(--space-md);
  }
  main {
    padding: var(--space-md);
  }
  .heading {
    align-items: flex-start;
    margin-top: var(--space-sm);
  }
  .heading h1 {
    font-size: 28px;
  }
  .heading p {
    font-size: 12px;
  }
  .refresh-block .secondary {
    padding: var(--space-sm);
  }
  .refresh-block .secondary span {
    display: none;
  }
  .refresh-block > span {
    max-width: 104px;
    text-align: right;
    font-size: 10px;
  }
  .readonly {
    display: none;
  }
  .toolbar {
    gap: var(--space-md);
    align-items: stretch;
  }
  .segments {
    width: 100%;
    justify-content: space-between;
  }
  .segments button {
    padding: var(--space-sm);
    font-size: 12px;
  }
  .filters {
    width: 100%;
    justify-content: space-between;
  }
  .filters label {
    flex-direction: row;
    align-items: center;
    font-size: 11px;
  }
  select {
    font-size: 12px;
    max-width: 152px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  #chart-wrap {
    height: 360px;
    margin: 0 var(--space-sm);
  }
  .ranking-panel {
    border-left: 0;
    border-top: 1px solid var(--color-hairline);
  }
  .ranking-panel .panel-heading {
    padding: var(--space-md);
  }
  .rankings {
    max-height: 270px;
    overflow: auto;
  }
  .sector-row {
    min-height: 36px;
    grid-template-columns: minmax(0, 1fr) 80px 72px;
  }
  .ranking-columns {
    grid-template-columns: minmax(0, 1fr) 80px 72px;
  }
  .sector-pick,
  .sector-return {
    font-size: 13px;
  }
  .chart-footer {
    font-size: 10px;
    align-items: flex-start;
  }
  .chart-footer > span:last-child {
    text-align: right;
    max-width: 200px;
  }
  .detail-heading {
    padding: var(--space-md);
  }
  .selected-title {
    gap: var(--space-sm);
  }
  .selected-title h2,
  .selected-title > span.type-h2 {
    font-size: 18px;
  }
  .detail-actions {
    width: 100%;
    justify-content: space-between;
  }
  input[type="search"] {
    flex: 1;
    min-width: 0;
  }
  .detail-insight {
    padding: 0 var(--space-md) var(--space-md);
  }
  .detail-footer {
    padding: var(--space-md);
  }
  .methodology summary span {
    display: block;
    margin: var(--space-sm) 0 0;
  }
  .method-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  .page-footer > span:last-child {
    text-align: right;
    max-width: 200px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
