:root {
  --navy: #1b365d;
  --navy-2: #142848;
  --ink: #1a1f2b;
  --muted: #5b6575;
  --line: #d7dee8;
  --card: #ffffff;
  --page: #eef2f6;
  --accent: #1b365d;
  --btn: #243b5a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.br-top {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 1.15rem 1.25rem 1.05rem;
}

.br-top__inner {
  max-width: 1120px;
  margin: 0 auto;
}

.br-top h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.br-top p {
  margin: 0;
  opacity: 0.88;
  font-size: 0.95rem;
}

.br-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.15rem 1rem 2.5rem;
}

.br-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.15rem 0.85rem;
  box-shadow: 0 8px 28px rgba(20, 40, 72, 0.06);
}

.br-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) minmax(200px, 0.7fr);
  gap: 1rem 1.25rem;
  align-items: start;
}

.br-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.92rem;
  font-weight: 650;
}

.br-field small {
  font-weight: 500;
  color: var(--muted);
}

.br-field input {
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  border: 1px solid #c5ceda;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: #fff;
}

.br-field--list input[type="search"] {
  font-weight: 500;
}

.br-entity-list {
  max-height: 280px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #c5ceda;
  border-radius: 8px;
  background: #fff;
}

.br-entity {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.55rem 0.7rem;
  font-weight: 500;
  border-bottom: 1px solid #eef2f6;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(27, 54, 93, 0.12);
}

.br-entity:last-child { border-bottom: 0; }

.br-entity:has(input:checked) {
  background: #eef4fb;
}

.br-entity input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--navy);
}

.br-picked {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0;
  line-height: 1.55;
}

.br-picked__count {
  margin-right: 0.15rem;
}

.br-picked__item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--ink);
  font-weight: 650;
  white-space: nowrap;
}

.br-line {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  flex: 0 0 auto;
  background: currentColor;
}

.br-line[hidden] {
  display: none;
}

.br-table td:first-child {
  white-space: nowrap;
}

.br-table td:first-child .br-line {
  margin-right: 0.45rem;
  vertical-align: middle;
}

.br-side {
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

.br-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.br-presets button {
  border: 1px solid #c5ceda;
  background: #f7f9fc;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.br-presets button:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.br-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.br-update,
.br-clear {
  justify-self: start;
  border-radius: 10px;
  padding: 0.72rem 1.15rem;
  min-height: 44px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.br-update {
  background: var(--btn);
  color: #fff;
  border: 0;
}

.br-update:hover { filter: brightness(1.08); }

.br-clear {
  background: #fff;
  color: var(--navy);
  border: 1px solid #c5ceda;
}

.br-clear:hover {
  border-color: var(--navy);
  background: #f7f9fc;
}

.br-entity--pin {
  background: #f4f7fb;
  font-weight: 650;
}

.br-status {
  margin: 0.85rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.br-chart {
  width: 100%;
  min-height: 520px;
}

.br-table-wrap {
  overflow-x: auto;
  margin-top: 0.35rem;
}

.br-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.br-table th,
.br-table td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--line);
}

.br-table th { color: var(--muted); font-weight: 650; }

.br-down { color: #b42318; }
.br-up { color: #087443; }

.br-foot {
  margin: 0.9rem 4px 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.br-foot a { color: var(--navy); }

.br-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  max-width: 1120px;
  margin: 0 auto 0.55rem;
  padding: 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.72);
}

.br-brand a {
  color: #fff;
  text-decoration: none;
  font-weight: 650;
}

.br-brand a:hover { text-decoration: underline; }

.br-intro {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 72ch;
}

.br-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.br-faq {
  margin: 1.25rem 0 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.15rem 0.85rem;
}

.br-faq h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}

.br-faq details {
  border-top: 1px solid var(--line);
  padding: 0.55rem 0;
}

.br-faq summary {
  cursor: pointer;
  font-weight: 650;
}

.br-faq details p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

@media (max-width: 800px) {
  .br-controls { grid-template-columns: 1fr; }
  .br-entity-list { max-height: 220px; }
  .br-entity { padding: 0.7rem 0.75rem; }
  .br-update, .br-clear { width: 100%; }
  .br-chart { min-height: 360px; }
}
