:root {
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  color: #151f2c;
  background: #f3f5f8;
  font-size: 15px;
  font-synthesis: none;
  --line: #e1e7ef;
  --muted: #506074;
  --accent: #174bc2;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shell { width: min(1512px, calc(100% - 64px)); margin-inline: auto; }
header { background: #101b30; color: #fff; }
.masthead { min-height: 63px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; gap: 11px; align-items: center; color: #fff; text-decoration: none; font-size: 18px; font-weight: 700; }
.brand-icon { width: 30px; height: 30px; display: flex; justify-content: center; align-items: end; gap: 3px; padding: 7px 5px; border-radius: 7px; background: #3668e1; }
.brand-icon i { background: #fff; width: 3px; height: 45%; border-radius: 3px; }
.brand-icon i:nth-child(2) { height: 70%; }
.brand-icon i:nth-child(3) { height: 100%; }
.source { color: #dce6fa; text-decoration: none; font-size: .87rem; }
.source:hover { text-decoration: underline; }
.intro { margin: 36px 0 24px; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 4vw, 2.65rem); letter-spacing: -.05em; line-height: 1.1; }
h2 { font-size: 1.42rem; letter-spacing: -.025em; margin-bottom: 13px; }
h3 { font-size: 1.04rem; }
h4 { font-size: .84rem; margin-bottom: 12px; }
#snapshot { margin-top: 10px; color: var(--muted); font-size: .9rem; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.period { margin-bottom: 27px; display: flex; flex-wrap: wrap; align-items: end; padding: 13px 16px; gap: 10px 14px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: .77rem; font-weight: 650; color: var(--muted); min-width: 0; }
select, input, button.plain, #apply { min-height: 36px; border: 1px solid #d5deeb; border-radius: 7px; background: #fff; color: #243449; padding: 6px 9px; }
select, input { width: 100%; }
button.plain, #apply { padding-inline: 12px; white-space: nowrap; }
button.plain:hover:not(:disabled), #apply:hover { border-color: #989fb2; background: #f4f7fd; }
.period-note { color: var(--muted); align-self: center; font-size: .86rem; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.summary { padding: 19px; min-width: 0; }
.summary-heading { display: flex; gap: 9px; align-items: center; }
.summary-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: #eaf0ff; color: var(--accent); font-weight: 750; }
.summary:nth-child(2) .summary-mark { background: #e7f7ef; color: #0b6e4f; }
.metric-row { display: flex; gap: 11px; align-items: baseline; margin-block: 13px 14px; min-height: 40px; }
.metric-row strong { font-size: 2rem; letter-spacing: -.045em; white-space: nowrap; }
.metric-row span { color: var(--muted); font-size: .81rem; }
.ranking-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; border-top: 1px solid var(--line); padding-top: 13px; }
.ranking { padding: 0; margin: 0; list-style: none; font-size: .82rem; }
.ranking li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; padding: 5px 0; }
.ranking button { text-align: left; }
.ranking b { font-variant-numeric: tabular-nums; }
.ranking .placeholder { grid-template-columns: 1fr; color: var(--muted); }
.detail { margin-top: 27px; }
.tabs { display: flex; flex-wrap: wrap; gap: 5px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-radius: 7px; background: transparent; color: var(--muted); padding: 8px 11px; font-weight: 650; }
.tabs button[aria-pressed="true"] { background: #eaf0ff; color: #1947ac; }
.tabs button:hover { background: #eef2f8; }
.filters { display: grid; grid-template-columns: minmax(140px, 1.4fr) repeat(3, minmax(110px, 1fr)) minmax(95px, .65fr) minmax(80px, .55fr) auto; gap: 10px; padding: 14px 15px 8px; align-items: end; }
.table-toolbar { padding: 8px 15px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .86rem; color: var(--muted); }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: 10px 12px; border-bottom: 1px solid #e9edf2; vertical-align: top; }
th:first-child, td:first-child { padding-left: 15px; }
th { color: var(--muted); background: #f7f9fc; font-size: .79rem; white-space: nowrap; }
td { font-size: .88rem; }
td:first-child { min-width: 205px; }
td:last-child, th:last-child { padding-right: 15px; }
tbody tr:hover { background: #f8faff; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.date { white-space: nowrap; }
.subline { display: block; color: var(--muted); margin-top: 4px; font-size: .74rem; overflow-wrap: anywhere; }
.link, th button { color: var(--accent); font: inherit; padding: 0; border: 0; background: none; text-align: inherit; overflow-wrap: anywhere; }
.link:hover, th button:hover { text-decoration: underline; }
.product-link { font-weight: 650; }
th button { color: inherit; }
th[aria-sort] button { color: var(--accent); }
.positive { color: #08664c; }
.negative { color: #9c381c; }
.empty { color: var(--muted); padding: 24px 15px; }
.pagination { padding: 12px 15px; display: flex; justify-content: flex-end; align-items: center; gap: 11px; font-size: .8rem; }
.method { max-width: 78ch; color: var(--muted); margin: 19px 0 40px; font-size: .85rem; }
.method summary { color: #2c4060; }
.method p { margin-top: 9px; }
dialog { width: min(760px, calc(100% - 26px)); max-height: 90vh; border: 1px solid var(--line); border-radius: 14px; padding: 20px; color: inherit; }
dialog::backdrop { background: #101b3088; }
dialog h2 { margin: 0; }
.dialog-top { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
#product-meta { color: var(--muted); font-size: .88rem; margin-block: 10px 18px; line-height: 1.6; }
#chart { display: block; width: 100%; height: auto; margin-block: 10px; }
.history-scroll { max-height: 240px; overflow: auto; margin-top: 10px; }
@media (max-width: 1050px) {
  .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ranking-grid { gap: 10px; }
}
@media (max-width: 820px) {
  .summary-grid { grid-template-columns: 1fr; }
  .shell { width: calc(100% - 32px); }
}
@media (max-width: 530px) {
  .shell { width: calc(100% - 22px); }
  .summary { padding: 13px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .search { grid-column: 1 / -1; }
  .tabs button { font-size: .85rem; }
  .ranking-grid { gap: 12px; }
}
