/* Proposal contents panel. All styles stay within this document's sidebar. */
.sidebar {
  max-height: none;
  overflow: visible;
  padding: 0;
  background: #fff;
  border: 1px solid #d8e2f1;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(27, 57, 104, .06);
}

.sidebar details {
  border: 0;
  background: transparent;
}

.sidebar summary {
  min-height: 64px;
  padding: 16px;
  gap: 12px;
  border-bottom: 1px solid #eaf0f8;
  border-radius: 16px 16px 0 0;
}

.sidebar summary .toc-heading {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #193356;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.toc-heading svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: #3766ae;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.sidebar summary .toc-count {
  padding: 3px 9px;
  border: 1px solid #e2e9f4;
  border-radius: 7px;
  background: #f6f8fc;
  color: #637795;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}

.sidebar summary span::after {
  content: none;
}

.sidebar nav {
  gap: 4px;
  max-height: calc(100dvh - 270px);
  overflow-y: auto;
  padding: 10px 8px;
  scrollbar-width: thin;
  scrollbar-color: #c5d3e7 transparent;
  scroll-padding-block: 10px;
}

.sidebar nav::-webkit-scrollbar {
  width: 5px;
}

.sidebar nav::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: #c5d3e7;
}

.sidebar nav a {
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #4a5f7b;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.sidebar nav a .toc-number {
  display: inline-flex;
  flex: 0 0 27px;
  align-items: center;
  justify-content: center;
  height: 27px;
  padding: 0;
  border-radius: 7px;
  background: #f0f4f9;
  color: #6b7e9b;
  font-size: 11px;
  font-weight: 700;
  opacity: 1;
}

.sidebar nav a .toc-label {
  min-width: 0;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: -.025em;
  opacity: 1;
}

.sidebar nav a:hover {
  background: #f0f5fd;
  border-color: #dde7f7;
  color: #224e94;
}

.sidebar nav a[aria-current="location"] {
  background: #2456c4;
  border-color: #2456c4;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(36, 86, 196, .16);
}

.sidebar nav a[aria-current="location"] .toc-number {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.sidebar nav a:focus-visible,
.sidebar summary:focus-visible {
  outline: 2px solid #2456c4;
  outline-offset: -2px;
}

.sidebar nav a[aria-current="location"]:focus-visible {
  outline-color: #fff;
  outline-offset: -4px;
}

.sidebar .side-note {
  margin: 0 16px;
  padding: 13px 0 15px;
  border-top: 1px solid #eaf0f8;
  color: #718099;
  font-size: 11px;
  line-height: 1.8;
}

.sidebar .side-note strong {
  color: #405877;
  font-weight: 600;
}

@media (min-width: 781px) and (max-width: 1100px) {
  .sidebar nav {
    padding-inline: 6px;
  }

  .sidebar nav a {
    gap: 7px;
    padding-inline: 6px;
  }

  .sidebar nav a .toc-number {
    flex-basis: 24px;
    height: 25px;
  }

  .sidebar summary {
    padding-inline: 13px;
  }

  .sidebar .side-note {
    margin-inline: 13px;
    font-size: 10px;
  }
}

@media (max-width: 780px) {
  .sidebar {
    border-radius: 12px;
    margin-bottom: 18px;
  }

  .sidebar summary {
    min-height: 54px;
    padding: 12px 16px;
    border-bottom-color: transparent;
    border-radius: 12px;
  }

  .sidebar details[open] summary {
    border-bottom-color: #eaf0f8;
    border-radius: 12px 12px 0 0;
  }

  .sidebar summary .toc-count {
    margin-left: auto;
  }

  .sidebar summary::after {
    content: "";
    width: 7px;
    height: 7px;
    margin: -4px 2px 0 0;
    border-right: 1.5px solid #657b9c;
    border-bottom: 1.5px solid #657b9c;
    transform: rotate(45deg);
  }

  .sidebar details[open] summary::after {
    margin-top: 4px;
    transform: rotate(225deg);
  }

  .sidebar nav {
    max-height: min(52dvh, 420px);
    padding: 10px;
    gap: 5px;
  }

  .sidebar nav a {
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  .sidebar nav {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar nav a {
    transition: none;
  }
}

@media print {
  .sidebar {
    display: none;
  }
}
