body.bigdata-page .content-panel {
  background: #e7eef2;
}

.side-btn[aria-current="page"] {
  opacity: 1;
  background: rgba(255, 255, 255, 0.55);
}

.bigdata-stage {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.bigdata-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 18px;
  padding: 12px 16px 10px;
  background: #fff;
}

.bigdata-title {
  margin: 0;
  color: var(--header, #189ea0);
  font-size: clamp(1.15rem, 1.6vw, 1.55rem);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.bigdata-user {
  color: #44555c;
  font-size: 0.95rem;
}

.bigdata-user a {
  color: var(--header, #189ea0);
}

.bigdata-stub {
  margin: 24px 16px;
  color: #44555c;
  text-align: center;
}

.bigdata-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 16px 0;
}

.bigdata-data-toolbar {
  justify-content: flex-start;
  flex-wrap: wrap;
  align-items: flex-end;
}

.bd-source-pick {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #44555c;
  font-size: 0.9rem;
  min-width: min(420px, 100%);
}

.bd-source-pick .form-select {
  min-width: min(420px, 100%);
}

.bd-data-title {
  margin: 14px 16px 0;
  color: #2f4046;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}

.bigdata-section {
  margin: 8px 0 18px;
}

.bigdata-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 12px 16px 8px;
}

.bigdata-section-title {
  margin: 0;
  color: var(--header, #189ea0);
  font-size: 1.05rem;
  font-weight: 600;
}

.bigdata-section-toolbar {
  display: flex;
  gap: 8px;
}

.bd-icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bigdata-groups-table {
  min-width: 640px;
}

.bd-group-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  color: #44555c;
  white-space: nowrap;
}

.bd-groups {
  max-width: 220px;
  white-space: normal;
  line-height: 1.35;
}

.bd-groups-field {
  border: 0;
  margin: 0 0 12px;
  padding: 0;
}

.bd-groups-field legend {
  margin-bottom: 6px;
  color: #44555c;
  font-size: 0.9rem;
}

.bd-linked-groups {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bd-linked-groups[hidden],
.bd-linked-empty[hidden] {
  display: none;
}

.bd-linked-empty {
  margin: 0 0 10px;
  color: #7b8a90;
  font-size: 0.9rem;
}

.bd-linked-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid #d5e0e5;
  border-radius: 6px;
  background: #f7fafb;
}

.bd-linked-item-name {
  color: #1c2428;
  font-size: 0.92rem;
  line-height: 1.3;
}

.bd-linked-item .bd-icon-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.bd-link-add {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bd-link-add .form-select {
  flex: 1 1 auto;
  min-width: 0;
}

.bd-data-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin: 12px 16px 0;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #d5e0e5;
  border-radius: 8px;
}

.bd-data-filters[hidden] {
  display: none;
}

.bd-data-filters-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  flex: 1 1 auto;
}

.bd-filter-pick {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #44555c;
  font-size: 0.9rem;
  min-width: min(220px, 100%);
}

.bd-filter-pick .form-select {
  min-width: min(220px, 100%);
  max-width: 360px;
}

.bd-filter-years {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.bd-filter-year {
  min-width: 110px;
  flex: 0 0 auto;
}

.bd-filter-year .form-control {
  width: 110px;
  max-width: 140px;
}

@media (max-width: 767.98px) {
  .bd-data-filters-fields > .bd-filter-pick {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }

  .bd-data-filters-fields > .bd-filter-pick .form-select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .bd-filter-years {
    flex: 1 1 100%;
    width: 100%;
  }

  .bd-filter-year {
    flex: 1 1 0;
    min-width: 0;
  }

  .bd-filter-year .form-control {
    width: 100%;
    max-width: none;
  }
}

.bd-data-filters-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bd-data-error {
  margin: 8px 16px 0;
  color: #b42318;
  font-size: 0.95rem;
}

.bd-data-empty {
  margin: 28px 0;
  color: #44555c;
  text-align: center;
}

.bd-table-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 18px;
  padding: 10px 16px 0;
}

.bd-table-controls .bd-pager {
  padding: 0;
  margin-left: auto;
}

.bd-page-size {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: #44555c;
  font-size: 0.9rem;
  white-space: nowrap;
}

.bd-page-size .form-select {
  width: 5.5rem;
  display: inline-block;
}

.bd-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 16px 24px;
}

.bd-table-controls + .bigdata-table-wrap {
  padding-top: 10px;
}

.bd-page-btn {
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.55rem;
  border: 1px solid #c5d3d8;
  border-radius: 6px;
  background: #fff;
  color: #2f4046;
  font-size: 0.92rem;
  line-height: 1;
  cursor: pointer;
}

.bd-page-btn:hover:not(:disabled) {
  border-color: var(--header, #189ea0);
  color: var(--header, #189ea0);
}

.bd-page-btn.is-current,
.bd-page-btn:disabled.is-current {
  background: var(--header, #189ea0);
  border-color: var(--header, #189ea0);
  color: #fff;
  cursor: default;
}

.bd-page-btn:disabled:not(.is-current) {
  opacity: 0.45;
  cursor: default;
}

.bd-page-dots {
  color: #6a7c84;
  padding: 0 2px;
}

#bd-data-table {
  min-width: 960px;
}

.bd-points-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.bd-points-cell .bd-icon-btn {
  width: 28px;
  height: 28px;
}

.bd-modal-card.bd-modal-card--wide {
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  max-height: calc((100vh - var(--header-min, 72px)) * 0.9);
  max-height: calc((100dvh - var(--header-min, 72px)) * 0.9);
}

.bd-points-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#bd-points-modal .bd-modal-card {
  overflow: hidden;
}

#bd-points-modal .bd-modal-head,
#bd-points-modal .bd-modal-source,
#bd-points-modal .bd-modal-error {
  flex: 0 0 auto;
}

.bigdata-table.bd-points-table {
  min-width: 0;
}

.bd-points-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.bd-filter {
  width: min(360px, 100%);
}

.bd-filter-count {
  color: #44555c;
  font-size: 0.9rem;
  white-space: nowrap;
}

.bigdata-table tr.is-filtered-out {
  display: none;
}

.bigdata-toolbar + .bigdata-table-wrap {
  padding-top: 10px;
}

.bigdata-table-wrap {
  flex: 1 1 auto;
  padding: 14px 16px 28px;
  overflow: auto;
}

.bigdata-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  box-shadow: 0 2px 10px rgba(20, 40, 48, 0.08);
  font-size: 0.9rem;
  line-height: 1.3;
}

.bigdata-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 8px;
  background: var(--header, #189ea0);
  color: #fff;
  font-weight: 600;
  text-align: left;
  vertical-align: bottom;
}

.bigdata-table td {
  padding: 7px 8px;
  border-top: 1px solid #e1eaee;
  color: #1c2428;
  vertical-align: top;
  transition: background-color 0.12s ease;
}

.bigdata-table tbody tr:nth-child(even) td {
  background: #f6fafb;
}

.bigdata-table tbody tr:hover td {
  background: #cfecee;
}

.bigdata-table tr.is-missing td {
  color: #7b8a90;
}

.bigdata-table tr.is-hidden-source td {
  opacity: 0.72;
}

.bigdata-table .bd-num {
  white-space: nowrap;
  text-align: right;
}

.bigdata-table .bd-source {
  min-width: 200px;
  font-weight: 600;
}

.bigdata-table .bd-short,
.bigdata-table .bd-full {
  min-width: 160px;
}

.bigdata-table .bd-actions {
  min-width: 108px;
  white-space: nowrap;
}

.bd-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 2px 0 0;
  padding: 0;
  border: 1px solid #c7d5db;
  border-radius: 6px;
  background: #fff;
  color: var(--header, #189ea0);
  cursor: pointer;
}

.bd-icon-btn:hover,
.bd-icon-btn:focus-visible {
  background: #e8f6f6;
  outline: none;
}

.bd-icon-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.bigdata-table .bd-updated {
  margin-top: 4px;
  color: #7b8a90;
  font-size: 0.78rem;
  white-space: normal;
}

.bigdata-table .bd-updated.is-error {
  color: #b3261e;
}

.bd-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.bd-modal[hidden] {
  display: none;
}

.bd-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 32, 40, 0.45);
}

.bd-modal-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px 18px 16px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(16, 32, 40, 0.22);
}

.bd-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.bd-modal-head h2 {
  margin: 0;
  color: var(--header, #189ea0);
  font-size: 1.25rem;
  font-weight: 700;
}

.bd-modal-x {
  border: 0;
  background: transparent;
  color: #66757c;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.bd-modal-source,
.bd-modal-text {
  margin: 0 0 14px;
  color: #1c2428;
  line-height: 1.4;
}

.bd-field {
  display: block;
  margin-bottom: 12px;
  color: #44555c;
  font-size: 0.92rem;
  font-weight: 600;
}

.bd-field .form-control {
  margin-top: 4px;
  font-weight: 400;
}

.bd-modal-error {
  margin: 0 0 10px;
  color: #b3261e;
  font-size: 0.9rem;
}

.bd-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.bd-modal-actions .btn-outline-secondary {
  border-color: #c7d5db;
  color: #44555c;
  background: #fff;
}

.bd-modal-actions .btn-outline-secondary:hover {
  background: #f2f6f8;
}

.bd-tree-meta,
.bd-tree-metrics {
  margin: 10px 16px 0;
  color: #44555c;
  font-size: 0.95rem;
  line-height: 1.4;
  max-width: 1100px;
}

.bd-tree-legend {
  margin: 0;
  padding: 14px 16px;
  background: #fff;
  border-left: 4px solid var(--header, #189ea0);
  max-width: 1100px;
}

.bd-tree-legend-title {
  margin: 0 0 8px;
  color: #2f4046;
  font-size: 1.05rem;
  font-weight: 700;
}

.bd-tree-legend-list {
  margin: 0;
  padding-left: 1.15rem;
  color: #44555c;
  font-size: 0.95rem;
  line-height: 1.45;
}

.bd-tree-legend-list li + li {
  margin-top: 6px;
}

.bd-tree-legend-list strong {
  color: #2f4046;
  font-weight: 600;
}

.bd-tree-error {
  margin: 12px 16px 0;
  color: #b3261e;
  font-size: 0.95rem;
}

.bd-tree-results {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 12px 16px 28px;
}

.bd-tree-figure {
  margin: 0;
  background: #fff;
  padding: 12px;
}

.bd-tree-figure figcaption {
  margin: 0 0 8px;
  color: #2f4046;
  font-weight: 600;
  font-size: 1rem;
}

.bd-tree-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: #f7fafb;
}

.bd-action {
  align-self: flex-end;
  background: var(--header, #189ea0);
  color: #fff;
  border: 0;
  padding: 8px 18px;
  min-height: 38px;
}

.bd-action:hover {
  filter: brightness(0.95);
}

.bd-action:disabled {
  opacity: 0.6;
  cursor: wait;
}
