:root {
  --sidebar-width: 280px;
  --sidebar-hidden-threshold: 50px;
  --sidebar-min-width: 155px;
  --sidebar-max-width: 520px;
  --sidebar-transition-duration: 240ms;
  --sidebar-background: #171717;
  --sidebar-border: rgba(255, 255, 255, 0.12);
  --sidebar-text: rgba(255, 255, 255, 0.92);
  --sidebar-muted-text: rgba(255, 255, 255, 0.68);
}

button {
  font: inherit;
}

#appShell.app-shell {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: var(--sidebar-width);
  min-width: min(var(--sidebar-min-width), 75vw);
  max-width: min(var(--sidebar-max-width), 75vw);
  height: 100vh;
  pointer-events: none;
  transform: translateX(0);
  transition:
    width var(--sidebar-transition-duration) ease,
    transform var(--sidebar-transition-duration) ease;
}

#appSidebar.app-sidebar {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  min-width: min(var(--sidebar-min-width), 75vw);
  max-width: min(var(--sidebar-max-width), 75vw);
  height: 100vh;
  color: var(--sidebar-text);
  background: var(--sidebar-background);
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  pointer-events: auto;
  transform: translateX(0);
  transition:
    width var(--sidebar-transition-duration) ease,
    transform var(--sidebar-transition-duration) ease,
    border-color var(--sidebar-transition-duration) ease;
}

#appShell.app-shell.is-sidebar-hidden {
  width: 0;
  min-width: 0;
  max-width: 0;
}

#appShell.app-shell.is-sidebar-hidden #appSidebar.app-sidebar {
  min-width: 0;
  border-right-color: transparent;
  pointer-events: none;
  transform: translateX(-100%);
}

#appShell.app-shell.is-sidebar-resizing,
#appShell.app-shell.is-sidebar-resizing #appSidebar.app-sidebar {
  transition: none;
  user-select: none;
}

#sidebarTitleButton.app-sidebar__title {
  width: 100%;
  padding: 1.1rem 1.25rem;
  color: var(--sidebar-text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--sidebar-border);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
}

#sidebarTitleButton.app-sidebar__title:hover,
#sidebarTitleButton.app-sidebar__title:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.app-sidebar__nav {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 0.75rem;
}

.app-sidebar__nav-item {
  display: block;
  width: 100%;
  padding: 0.8rem 0.9rem;
  color: var(--sidebar-muted-text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.65rem;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.app-sidebar__nav-item:hover,
.app-sidebar__nav-item:focus-visible {
  color: var(--sidebar-text);
  background: rgba(255, 255, 255, 0.09);
  outline: none;
}

#sidebarResizeHandle.app-sidebar__resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

#sidebarResizeHandle.app-sidebar__resize-handle::after {
  position: absolute;
  top: 0;
  right: 3px;
  width: 1px;
  height: 100%;
  content: "";
  background: rgba(255, 255, 255, 0.14);
}

#sidebarResizeHandle.app-sidebar__resize-handle:hover::after,
#sidebarResizeHandle.app-sidebar__resize-handle:focus-visible::after,
#appShell.app-shell.is-sidebar-resizing #sidebarResizeHandle.app-sidebar__resize-handle::after {
  width: 2px;
  background: rgba(255, 255, 255, 0.42);
}

#sidebarOpenButton.sidebar-open-button {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1200;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(23, 23, 23, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.7rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
  transition:
    opacity var(--sidebar-transition-duration) ease,
    transform var(--sidebar-transition-duration) ease,
    background 160ms ease;
}

#sidebarOpenButton.sidebar-open-button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

#sidebarOpenButton.sidebar-open-button:hover,
#sidebarOpenButton.sidebar-open-button:focus-visible {
  background: rgba(38, 38, 38, 0.96);
  outline: none;
}

.app-sidebar__school-stats {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: auto;
  padding: 1rem 1.5rem 3.55rem;
}

.app-sidebar__school-stat-grid {
  display: flex;
  justify-content: space-evenly;
  gap: 1.25rem;
}

.app-sidebar__school-stat {
  min-width: 0;
  text-align: center;
}

.app-sidebar__school-stat-label {
  color: rgba(255, 255, 255, 0.86);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.05;
  text-transform: uppercase;
}

.app-sidebar__school-stat-value {
  margin-top: 0.45rem;
  color: rgba(255, 255, 255, 0.96);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.app-sidebar__school-percent-bar {
  position: relative;
  height: 2.35rem;
  overflow: hidden;
  border: 2px solid #7aa7ed;
  border-radius: 999px;
  background: transparent;
}

.app-sidebar__school-percent-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: #6e9ce0;
  transition: width 260ms ease;
}

.app-sidebar__school-percent-bar-label {
  position: relative;
  z-index: 1;
  display: grid;
  height: 100%;
  place-items: center;
  color: rgba(255, 255, 255, 0.96);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}
#appSidebar.app-sidebar {
  container-name: app-sidebar;
  container-type: inline-size;
}

  #titleTop {
    font-size: 4rem;
  }

  #titleBottom {
    font-size: 2rem;
  }

@container app-sidebar (max-width: 230px) {

  #titleTop {
    font-size: 3rem;
  }

  #titleBottom {
    font-size: 1.25rem;
  }

  .app-sidebar__school-stat-grid {
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
  }
}

@media (max-width: 700px) {
  :root {
    --sidebar-width: min(280px, 82vw);
  }

  #appShell.app-shell,
  #appSidebar.app-sidebar {
    min-width: min(var(--sidebar-min-width), 82vw);
    max-width: 82vw;
  }

  #appShell.app-shell.is-sidebar-hidden {
    min-width: 0;
  }
}

.app-sidebar__school-search {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.9rem 0.75rem 0.35rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.app-sidebar__search-label {
  color: var(--sidebar-muted-text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-sidebar__search-input-wrap {
  position: relative;
}

.app-sidebar__search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.72rem 2.35rem 0.72rem 0.85rem;
  color: var(--sidebar-text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.72rem;
  outline: none;
}

.app-sidebar__search-input::placeholder {
  color: rgba(255, 255, 255, 0.46);
}

.app-sidebar__search-input:focus-visible {
  border-color: rgba(167, 194, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(167, 194, 255, 0.18);
}

.app-sidebar__search-clear {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  place-items: center;
  color: rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-50%);
}

.app-sidebar__search-clear:hover,
.app-sidebar__search-clear:focus-visible {
  color: #111827;
  background: rgba(255, 255, 255, 0.86);
  outline: none;
}

.app-sidebar__school-set-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  min-height: 0.4rem;
  padding: 0 1rem;
}

.app-sidebar__school-set-capsule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 100%;
  min-height: 2.55rem;
  padding: 0.12rem 0.22rem 0.12rem 0.62rem;
  color: #111827;
  background: var(--school-set-color, #a7c2ff);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.app-sidebar__school-set-capsule:hover{
  cursor: pointer;
  filter: brightness(1.2);
}

.app-sidebar__school-set-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1b1b1b;
}

.app-sidebar__school-set-remove {
  display: grid;
  justify-self: flex-end;
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  margin-left: 0.32rem;
  margin-right: 0.32rem;
  padding: 0;
  place-items: center;
  background: #ffffff00;
  color: currentColor;
  border: 1px solid #000;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
}

.app-sidebar__school-set-remove:hover,
.app-sidebar__school-set-remove:focus-visible {
  background: rgb(255, 255, 255);
  color:#111827;
  border: 1px solid #fff;
  outline: none;
}

.app-sidebar__search-results {
  display: grid;
  gap: 0.28rem;
  max-height: min(42vh, 360px);
  overflow: hidden auto;
}

.app-sidebar__search-result {
  display: grid;
  grid-template-columns: 1.8rem minmax(0, 1fr);
  gap: 0.35rem;
  align-items: center;
}

.app-sidebar__search-add,
.app-sidebar__search-name {
  min-height: 1.95rem;
  color: var(--sidebar-text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.app-sidebar__search-add {
  width: 1.8rem;
  padding: 0;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
}

.app-sidebar__search-name {
  overflow: hidden;
  padding: 0.45rem 0.55rem;
  border-radius: 0.55rem;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar__search-add:hover,
.app-sidebar__search-add:focus-visible,
.app-sidebar__search-name:hover,
.app-sidebar__search-name:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.app-sidebar__school-set-list {
  display: grid;
  gap: 0.45rem;
  min-height: 0.4rem;
}

.app-sidebar__school-set-capsules {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.app-sidebar__school-set-clear {
  width: 100%;
  padding: 0.45rem 0.7rem;
  margin: 1rem 0;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.app-sidebar__school-set-clear:hover,
.app-sidebar__school-set-clear:focus-visible {
  color: #111827;
  background: rgba(255, 255, 255, 0.9);
  outline: none;
}
.app-sidebar__map-controls {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.app-sidebar__point-scale {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.app-sidebar__control-label {
  color: var(--sidebar-muted-text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-sidebar__point-scale-select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.72rem 2.1rem 0.72rem 0.85rem;
  color: var(--sidebar-text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.72rem;
  outline: none;
  cursor: pointer;
}

.app-sidebar__point-scale-select:focus-visible {
  border-color: rgba(167, 194, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(167, 194, 255, 0.18);
}

.app-sidebar__point-scale-select option {
  color: #111827;
  background: #ffffff;
}


.app-sidebar__toggle-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.62rem;
  align-items: center;
  color: var(--sidebar-text);
  cursor: pointer;
  user-select: none;
}

.app-sidebar__toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.app-sidebar__toggle-track {
  position: relative;
  width: 2.55rem;
  height: 1.45rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

.app-sidebar__toggle-thumb {
  position: absolute;
  top: 50%;
  left: 0.16rem;
  width: 1.02rem;
  height: 1.02rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  transform: translateY(-50%);
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.app-sidebar__toggle-text {
  overflow: hidden;
  color: var(--sidebar-muted-text);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar__toggle-input:checked + .app-sidebar__toggle-track {
  background: rgba(167, 194, 255, 0.32);
  border-color: rgba(167, 194, 255, 0.72);
}

.app-sidebar__toggle-input:checked + .app-sidebar__toggle-track .app-sidebar__toggle-thumb {
  background: rgba(255, 255, 255, 0.96);
  transform: translate(1.08rem, -50%);
}

.app-sidebar__toggle-input:focus-visible + .app-sidebar__toggle-track {
  box-shadow: 0 0 0 3px rgba(167, 194, 255, 0.18);
}

.app-sidebar__toggle-control:hover .app-sidebar__toggle-text,
.app-sidebar__toggle-control:focus-within .app-sidebar__toggle-text {
  color: var(--sidebar-text);
}


.app-sidebar__population-filter {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
}

.app-sidebar__population-filter-select {
  width:35%;
  box-sizing: border-box;
  padding: 0.62rem 0.65rem;
  color: var(--sidebar-text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.62rem;
  outline: none;
}

.app-sidebar__population-filter-input {
  width:60%;
  box-sizing: border-box;
  padding: 0.62rem 0.65rem;
  color: var(--sidebar-text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.62rem;
  outline: none;
}

.app-sidebar__population-filter-select {
  cursor: pointer;
}

.app-sidebar__population-filter-select option {
  color: #111827;
  background: #ffffff;
}

.app-sidebar__population-filter-input:focus-visible,
.app-sidebar__population-filter-select:focus-visible {
  border-color: rgba(167, 194, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(167, 194, 255, 0.18);
}
