body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: url('/static/images/background2.webp') no-repeat center center fixed;
  background-size: cover;
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  color: #f5f7f2;
}

* {
  box-sizing: border-box;
}

a {
  color: inherit;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(229, 236, 213, 0.20), rgba(4, 12, 25, 0.58)),
    radial-gradient(circle at top left, rgba(222, 236, 211, 0.42), transparent 38%);
}

.background-credit {
  position: fixed;
  right: 18px;
  bottom: 14px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(7, 15, 25, 0.44);
  color: rgba(240, 246, 236, 0.8);
  font-size: 1.0rem;
  letter-spacing: 0.08em;
  backdrop-filter: blur(6px);
  pointer-events: none;
  z-index: 0;
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  position: relative;
  padding: 48px 24px 24px;
}

.hero--home {
  justify-content: center;
  align-items: center;
  padding: 0 24px;
}

.sidebar {
  position: absolute;
  left: 24px;
  top: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 24px;
  border: 1px solid rgba(240, 248, 234, 0.22);
  background: rgba(9, 19, 31, 0.62);
  backdrop-filter: blur(6px);
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.sidebar__menu {
  display: grid;
  grid-auto-flow: row;
  gap: 10px;
  width: 100%;
}

.sidebar__brand {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #d9e4cb;
  opacity: 0.82;
}

.sidebar a {
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.sidebar__link {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  transition: background-color 160ms ease, color 160ms ease;
}

.sidebar__link--active {
  background: rgba(223, 236, 214, 0.16);
  color: #ffffff;
}

.sidebar a:hover {
  text-decoration: underline;
}

.sidebar__language {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(240, 248, 234, 0.14);
}

.sidebar__language-label {
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #d9e4cb;
  opacity: 0.78;
}

.sidebar__language-options {
  display: inline-flex;
  align-items: center;
}

.sidebar__language-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 9px 12px;
  border-radius: 10px;
  text-align: center;
  border: 1px solid rgba(240, 248, 234, 0.12);
}

.sidebar__language-option+.sidebar__language-option {
  margin-left: 18px;
}

.sidebar__language-option--active {
  background: rgba(223, 236, 214, 0.16);
  color: #ffffff;
}

.main-content {
  position: relative;
  isolation: isolate;
  width: min(1080px, 100%);
  margin: 24px auto 0;
  padding: 32px;
  border: 1px solid rgba(240, 248, 234, 0.18);
  background: transparent;
  border-radius: 30px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.main-content--home {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.main-content::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(9, 17, 28, 0.72);
  backdrop-filter: blur(12px);
  pointer-events: none;
  z-index: -1;
}

.main-content--home::before {
  content: none;
}

.home-title {
  width: min(1080px, 100%);
  margin: 72px auto 0;
  text-align: center;
}

.main-content--home .headline {
  margin: 0;
  text-align: center;
  font-size: clamp(3rem, 8vw, 6rem);
}

.home-title h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 1.05;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.eyebrow {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #d9e4cb;
}

.headline {
  margin: 14px 0 10px;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 0.95;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.subheadline {
  margin: 0;
  color: #d3dfd4;
  max-width: 700px;
  font-size: 1rem;
}

.page-copy {
  margin: 0;
  max-width: 680px;
  color: #dce7dd;
  font-size: 1.04rem;
  line-height: 1.7;
}

.page-copy+.page-copy {
  margin-top: 16px;
}

.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 24px 0 28px;
}

.stat-chip {
  min-width: 160px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(230, 239, 225, 0.10);
  border: 1px solid rgba(230, 239, 225, 0.18);
}

.stat-chip span {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c2d7c6;
}

.stat-chip strong {
  display: block;
  margin-top: 6px;
  font-size: 1.55rem;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.chart-panel {
  margin-bottom: 24px;
  padding: 20px;
  border-radius: 26px;
  background: rgba(5, 14, 24, 0.56);
  border: 1px solid rgba(233, 241, 224, 0.14);
}

.chart-panel__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.chart-panel__body {
  overflow: hidden;
}

.interactive-chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}

.interactive-chart-control {
  flex: 1 1 260px;
  min-width: 220px;
}

.interactive-chart-control--toggle {
  flex: 0 1 auto;
}

.interactive-chart-control__label {
  display: block;
  margin-bottom: 8px;
  color: #ebdbdb;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.maple-chart-dropdown .Select-control,
.maple-chart-dropdown .Select-menu-outer,
.maple-chart-dropdown .Select-menu {
  background: rgba(8, 18, 31, 0.9);
  border-color: rgba(233, 241, 224, 0.16);
}

.maple-chart-dropdown .Select-control {
  min-height: 44px;
  border-radius: 14px;
  box-shadow: none;
}

.maple-chart-dropdown .Select-control,
.maple-chart-dropdown .Select-control * {
  color: #081624 !important;
}

.maple-chart-dropdown .Select-placeholder,
.maple-chart-dropdown .Select-value-label,
.maple-chart-dropdown .Select-input>input,
.maple-chart-dropdown .Select-arrow-zone,
.maple-chart-dropdown .Select-clear-zone,
.maple-chart-dropdown .Select-value-icon {
  color: #000000 !important;
}

.maple-chart-dropdown .Select-value,
.maple-chart-dropdown .Select--multi .Select-value {
  background: rgba(127, 208, 154, 0.18);
  border-color: rgba(127, 208, 154, 0.3);
  color: #081624 !important;
}

.maple-chart-dropdown .Select-control .Select-multi-value-wrapper,
.maple-chart-dropdown .Select-control .Select-multi-value-wrapper *,
.maple-chart-dropdown .Select-control .Select-value,
.maple-chart-dropdown .Select-control .Select-value * {
  color: #081624 !important;
}

.maple-chart-dropdown .Select--multi .Select-value-label,
.maple-chart-dropdown .Select--multi a.Select-value-label,
.maple-chart-dropdown .Select--multi .Select-value-icon,
.maple-chart-dropdown .Select--multi .Select-value-label:hover,
.maple-chart-dropdown .Select--multi a.Select-value-label:hover,
.maple-chart-dropdown .Select--multi .Select-value-label:focus,
.maple-chart-dropdown .Select--multi a.Select-value-label:focus,
.maple-chart-dropdown .Select--multi .Select-value-label:visited,
.maple-chart-dropdown .Select--multi a.Select-value-label:visited,
.maple-chart-dropdown .Select--multi .Select-value-icon:hover,
.maple-chart-dropdown .Select--multi .Select-value-icon:focus {
  color: #081624 !important;
}

.maple-chart-dropdown .Select-option,
.maple-chart-dropdown .VirtualizedSelectOption,
.maple-chart-dropdown .VirtualizedSelectFocusedOption,
.maple-chart-dropdown .Select-noresults {
  background: rgba(8, 18, 31, 0.96);
  color: #eef7eb !important;
}

.maple-chart-dropdown .is-focused:not(.is-open)>.Select-control,
.maple-chart-dropdown .is-open>.Select-control {
  border-color: rgba(143, 217, 243, 0.46);
}

.maple-chart-checklist {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(233, 241, 224, 0.16);
  background: rgba(8, 18, 31, 0.9);
  color: #eef7eb;
}

.maple-chart-checklist label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #eef7eb;
}

.maple-chart-checklist input {
  accent-color: #7fd09a;
}

.maple-chart-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(233, 241, 224, 0.16);
  background: rgba(8, 18, 31, 0.9);
  color: #eef7eb;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.maple-chart-sort-button:hover:not(:disabled) {
  border-color: rgba(143, 217, 243, 0.46);
}

.maple-chart-sort-button--active {
  background: rgba(127, 208, 154, 0.18);
  border-color: rgba(127, 208, 154, 0.34);
  color: #f4fff7;
}

.maple-chart-sort-button:disabled,
.maple-chart-sort-button--disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.maple-plotly-chart {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(233, 241, 224, 0.14);
  background: rgba(8, 18, 31, 0.9);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.24);
}

.maple-plotly-chart .js-plotly-plot .plotly .modebar {
  border-radius: 999px;
  background: rgba(8, 18, 31, 0.78);
}

.maple-plotly-chart .js-plotly-plot .plotly .modebar-btn svg {
  fill: #eef7eb !important;
}

.chart-notes {
  margin-top: 18px;
  width: 100%;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(233, 241, 224, 0.14);
  background: rgba(8, 18, 31, 0.78);
}

.chart-notes__title {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #f0f6ef;
}

.chart-notes__copy {
  margin: 0;
  color: #d4dfd8;
  line-height: 1.6;
  font-size: 0.95rem;
}

.chart-notes__copy+.chart-notes__copy {
  margin-top: 12px;
}

.chart-empty {
  margin: 0;
  padding: 20px 0;
  color: #d4dfd8;
  font-size: 0.95rem;
}

.maple-chart {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid rgba(233, 241, 224, 0.14);
  background: rgba(8, 18, 31, 0.9);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.24);
}

#culvert-stats-table .dash-cell div {
  white-space: normal;
}

.maple-status-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.maple-loading-note {
  margin: 0;
  color: #dce7dd;
  font-size: 0.95rem;
}

.maple-cache-status {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(233, 241, 224, 0.18);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.maple-cache-status--pending {
  color: #d8e3d3;
  background: rgba(230, 239, 225, 0.10);
}

.maple-cache-status--hit {
  color: #d9f4de;
  background: rgba(74, 152, 102, 0.18);
  border-color: rgba(127, 208, 154, 0.34);
}

.maple-cache-status--miss {
  color: #ffd7d1;
  background: rgba(180, 79, 61, 0.16);
  border-color: rgba(214, 123, 105, 0.34);
}

.source-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(233, 241, 224, 0.16);
  background: rgba(8, 18, 31, 0.68);
}

.source-card--ready {
  box-shadow: inset 0 0 0 1px rgba(127, 208, 154, 0.18);
}

.source-card--error {
  box-shadow: inset 0 0 0 1px rgba(214, 123, 105, 0.24);
}

.source-card__label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c7d7cf;
}

.source-card__detail {
  margin: 10px 0 0;
  line-height: 1.5;
}

.table-panel {
  padding: 20px;
  border-radius: 26px;
  background: rgba(5, 14, 24, 0.56);
  border: 1px solid rgba(233, 241, 224, 0.14);
}

.table-panel__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title {
  margin: 0;
  font-size: 1.35rem;
}

.section-meta {
  font-size: 0.9rem;
  color: #d4dfd8;
}

.certificate-panel {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.gallery-index {
  margin: 28px 0 22px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(6, 15, 26, 0.56);
  border: 1px solid rgba(233, 241, 224, 0.14);
}

.gallery-index__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.gallery-index__link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  background: rgba(223, 236, 214, 0.10);
  border: 1px solid rgba(233, 241, 224, 0.14);
}

.gallery-index__link:hover {
  background: rgba(223, 236, 214, 0.18);
}

.gallery-collection {
  margin-top: 26px;
  padding: 22px;
  border-radius: 28px;
  background: rgba(5, 14, 24, 0.56);
  border: 1px solid rgba(233, 241, 224, 0.14);
  scroll-margin-top: 110px;
}

.gallery-collection__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  margin-bottom: 18px;
}

.gallery-collection__back-link {
  color: #d4dfd8;
  text-decoration: none;
  font-size: 0.92rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.gallery-card {
  display: block;
  padding: 14px;
  text-decoration: none;
  border-radius: 20px;
  background: rgba(8, 18, 31, 0.74);
  border: 1px solid rgba(233, 241, 224, 0.12);
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.gallery-card:hover {
  background: rgba(12, 25, 40, 0.84);
  border-color: rgba(233, 241, 224, 0.24);
  transform: translateY(-2px);
}

.gallery-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 18, 31, 0.9);
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 10, 18, 0.84);
  z-index: 40;
}

.gallery-lightbox:target {
  display: flex;
}

.gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
}

.gallery-lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 1440px);
  max-height: calc(100vh - 48px);
  padding: 18px;
  border-radius: 28px;
  background: rgba(9, 18, 30, 0.94);
  border: 1px solid rgba(233, 241, 224, 0.16);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
}

.gallery-lightbox__nav,
.gallery-lightbox__close {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 1.6rem;
  line-height: 1;
  background: rgba(223, 236, 214, 0.12);
  border: 1px solid rgba(233, 241, 224, 0.14);
}

.gallery-lightbox__close {
  top: 12px;
  right: 12px;
}

.gallery-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  text-decoration: none;
}

.gallery-lightbox__nav--prev {
  left: 12px;
}

.gallery-lightbox__nav--next {
  right: 12px;
}

.gallery-lightbox__nav:hover,
.gallery-lightbox__close:hover {
  background: rgba(223, 236, 214, 0.2);
}

.gallery-lightbox__image {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 96px);
  object-fit: contain;
  border-radius: 20px;
  background: rgba(4, 10, 18, 0.96);
}

.certificate-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  text-decoration: none;
  border-radius: 22px;
  background: rgba(6, 15, 26, 0.56);
  border: 1px solid rgba(233, 241, 224, 0.14);
}

.certificate-card:hover {
  background: rgba(10, 20, 33, 0.68);
}

.certificate-label {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d8e3d3;
}

.certificate-image {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.22);
}

.form-panel {
  margin: 28px 0;
  padding: 22px;
  border-radius: 24px;
  background: rgba(6, 15, 26, 0.56);
  border: 1px solid rgba(233, 241, 224, 0.14);
}

.form-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d8e3d3;
}

.names-textarea {
  width: 100%;
  min-height: 280px;
  padding: 16px;
  border: 1px solid rgba(233, 241, 224, 0.18);
  border-radius: 18px;
  background: rgba(8, 18, 31, 0.86);
  color: #edf4eb;
  font: inherit;
  resize: vertical;
}

.form-help {
  margin: 12px 0 0;
  color: #d3dfd4;
  font-size: 0.92rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.action-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #d7ebd0, #9bc89f);
  color: #102016;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.action-button:hover {
  filter: brightness(1.04);
}

.secondary-button {
  border: 1px solid rgba(233, 241, 224, 0.2);
  border-radius: 999px;
  padding: 12px 20px;
  background: rgba(8, 18, 31, 0.82);
  color: #edf4eb;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button:hover {
  background: rgba(15, 29, 46, 0.92);
}

.form-error {
  margin: 0;
  color: #ffb7aa;
  min-height: 1.5em;
}

.form-error--result {
  min-height: 0;
}

.bookmark-status {
  min-height: 0;
}

.secretsanta-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.pair-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(8, 18, 31, 0.68);
  border: 1px solid rgba(233, 241, 224, 0.16);
}

.pair-card__giver {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c7d7cf;
}

.pair-card__recipient {
  display: block;
  margin-top: 10px;
  font-size: 1.15rem;
}

@media (max-width: 760px) {
  .hero {
    padding-top: 92px;
  }

  .hero--home {
    padding: 0 16px;
  }

  .home-title {
    margin-top: 16px;
  }

  .main-content {
    margin-top: 0;
    padding: 22px;
    border-radius: 22px;
  }

  .sidebar {
    left: 16px;
    right: 16px;
    top: 14px;
    bottom: auto;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
  }

  .sidebar__menu {
    display: grid;
    grid-auto-flow: row;
  }

  .sidebar__language {
    padding-top: 0;
    border-top: 0;
    align-items: center;
  }

  .gallery-collection {
    padding: 18px;
    scroll-margin-top: 132px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .gallery-lightbox {
    padding: 12px;
  }

  .gallery-lightbox__dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 12px;
    border-radius: 20px;
  }

  .gallery-lightbox__close {
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
  }

  .gallery-lightbox__nav {
    width: 40px;
    height: 40px;
  }

  .gallery-lightbox__nav--prev {
    left: 8px;
  }

  .gallery-lightbox__nav--next {
    right: 8px;
  }

  .gallery-lightbox__image {
    max-height: calc(100vh - 48px);
    border-radius: 14px;
  }
}