:root {
  --black: #000000 !important;
  --black_hover: #2e2e2e !important;
  --white: #ffffff !important;
  --grey: #515151 !important;
  --panel-body: #414042 !important;
  --panel-body-alt: #8a8a8a !important;
  --panel-body-deep: #000000 !important;
  --panel-border: rgba(255, 255, 255, 0.12) !important;
  --panel-shadow: rgba(0, 0, 0, 0.18) !important;
  --calcite-color-foreground-1: #000000 !important;
  --calcite-action-text-color-pressed: #fff !important;
  --calcite-action-background-color-hover: #2e2e2e !important;
  --calcite-color-foreground-2: #2e2e2e !important;
  --calcite-scrim-background: rgba(0, 0, 0, 0.15) !important;
  --calcite-color-transparent-scrim: rgba(0, 0, 0, 0.15) !important;
}

calcite-sheet {
    /* --calcite-sheet-scrim-background: #A2A2A2 !important; */
}

/* calcite-action-menu{
    --calcite-action-background-color: var(--black_hover)!important;;
}

calcite-action #close,
calcite-action {
  --calcite-action-background-color-hover: var(--black_hover)!important;
  --calcite-action-background-color-press: var(--black_hover)!important;
  --calcite-action-background-color: var(--black) !important;
  --calcite-action-indicator-color: var(--white);
  --calcite-action-text-color-press: var(--white);
  --calcite-action-text-color: var(--white);
} */


/* arcgis-features::part(header) {
  background-color: blue;
  border-bottom: 2px solid black;
} */

/* 
calcite-action-bar {
  --calcite-action-bar-background-color: var(--black) !important;
  --calcite-action-text-color: var(--white);
  --calcite-icon-color: #fff;
}

calcite-action-group {
  --calcite-action-background-color: var(--black);
  --calcite-action-group-border-color: var(--white);
}*/

calcite-button {
  --calcite-button-background-color: var(--white);
  --calcite-button-border-color: var(--white);
  --calcite-button-corner-radius: 0px;
  --calcite-button-icon-color: var(--black);
  --calcite-button-loader-color: var(--black);
  --calcite-button-shadow-color: var(--white);
  --calcite-button-text-color: var(--black);
}

calcite-icon {
  --calcite-icon-color: var(--white);
} 


/* Prevent calcite-sheet from using fixed positioning - keep it within map shell */
#map_shell calcite-sheet,
calcite-sheet#legend-sheet {
  position: absolute !important;
  inset: 0 !important;
  transform: none !important;
}

/* Override calcite-sheet's default fixed positioning */
calcite-sheet#legend-sheet[open],
calcite-sheet#legend-sheet {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

/* Ensure sheet content doesn't overflow */
#legend-sheet::part(content-wrapper) {
  max-width: 320px;
  height: 100%;
  overflow: hidden;
  background: var(--panel-body) !important;
  box-shadow: 0 12px 28px var(--panel-shadow);
}



calcite-shell-panel {
  --calcite-shell-panel-background-color: var(--panel-body) !important;
  --calcite-shell-panel-border-color: var(--panel-border);
  --calcite-shell-panel-resize-icon-color: var(--white);
  --calcite-shell-panel-text-color: var(--white);
  box-shadow: 0 8px 20px var(--panel-shadow);
}

#side-panel {
  --calcite-shell-panel-width: 280px;
  --calcite-shell-panel-min-width: 280px;
  --calcite-shell-panel-max-width: 280px;
  background: var(--panel-body) !important;
}

.panel-content{

}


calcite-panel {
  --calcite-panel-header-background-color: var(--black)!important;
  --calcite-panel-header-action-background-color-press: var(--black)!important;
  --calcite-panel-header-action-background-color: var(--black)!important;

}



arcgis-features {
  height: 100%;
  background: var(--panel-body) !important;
  --calcite-color-foreground-1: var(--panel-body) !important;
  --calcite-color-foreground-2: var(--panel-body-alt);
  --calcite-color-foreground-3: var(--panel-body-deep);
  --calcite-color-text-1: var(--white);
  --calcite-color-text-2: rgba(255, 255, 255, 0.9);
  --calcite-color-border-1: var(--panel-border);
  --calcite-color-border-2: rgba(255, 255, 255, 0.08);
  --calcite-color-brand: var(--white);
  --calcite-color-brand-hover: #2e2e2e !important;
  --calcite-color-brand-press: #2e2e2e !important;
  --calcite-action-background-color: var(--panel-body-deep);
  --calcite-action-background-color-hover: #5d5757;
  --calcite-action-background-color-press: #464141;
  --calcite-action-text-color: var(--white);
  --calcite-action-text-color-press: var(--white);
  --calcite-action-bar-background-color: var(--panel-body-deep);
  --calcite-panel-header-action-background-color: var(--white) !important;
  --calcite-panel-header-action-background-color-hover: rgba(
    255,
    255,
    255,
    0.12
  );
  --calcite-panel-header-action-background-color-press: rgba(
    255,
    255,
    255,
    0.18
  );
  --calcite-panel-header-action-text-color: var(--white);
  --calcite-panel-header-action-text-color-press: var(--white);
  --calcite-icon-color: var(--white);
}

arcgis-features::part(content),
arcgis-features::part(content-container),
arcgis-features::part(container),
arcgis-features::part(panel) {
  background: var(--panel-body);
  color: var(--white);
}

arcgis-features::part(close-button)
arcgis-features::part(header),
arcgis-features::part(header-content),
arcgis-features::part(toolbar) {
  background: var(--black) !important;
  color: var(--white);
}

arcgis-features::part(close-button)
arcgis-features::part(toolbar),
arcgis-features::part(action-bar),
arcgis-features::part(footer),
arcgis-features::part(pagination) {
  background: var(--black) !important;
  color: var(--white);
}

/* arcgis-feature::part */

arcgis-features calcite-action {
  --calcite-action-background-color: var(--black) !important;
  --calcite-action-background-color-hover: #1F1F1F !important;
  --calcite-action-background-color-press: #1F1F1F !important;
  --calcite-action-text-color: var(--white);
  --calcite-action-text-color-press: var(--white);
}

arcgis-features calcite-action-bar {
  --calcite-action-bar-background-color: var(--black);
  --calcite-action-text-color: var(--white);
  --calcite-icon-color: var(--white);
}

arcgis-features calcite-action-group {
  --calcite-action-background-color: var(--black);
  --calcite-action-group-border-color: rgba(255, 255, 255, 0.08);
}

arcgis-map {
  height: 100%;
}

html arcgis-search,
html arcgis-zoom,
arcgis-search {
  --calcite-color-foreground-1: #ffffff !important;
  --calcite-color-foreground-2: #f4f4f4 !important;
  --calcite-color-foreground-3: #e8e8e8 !important;
  --calcite-color-text-1: #1f1f1f !important;
  --calcite-color-text-2: #4a4a4a !important;
  --calcite-color-border-1: rgba(0, 0, 0, 0.12) !important;
  --calcite-color-border-2: rgba(0, 0, 0, 0.08) !important;
  --calcite-color-brand: #1f1f1f !important;
  --calcite-color-brand-hover: #000000 !important;
  --calcite-color-brand-press: #000000 !important;
  --calcite-color-inverse: #ffffff !important;
  --calcite-action-background-color: #ffffff !important;
  --calcite-action-background-color-hover: #f4f4f4 !important;
  --calcite-action-background-color-press: #e8e8e8 !important;
  --calcite-action-text-color: #1f1f1f !important;
  --calcite-action-text-color-press: #1f1f1f !important;
  --calcite-icon-color: #1f1f1f !important;
}

/* Override global calcite-action dark styles for zoom buttons */
arcgis-zoom calcite-action {
  --calcite-action-background-color: #ffffff !important;
  --calcite-action-background-color-hover: #f4f4f4 !important;
  --calcite-action-background-color-press: #e8e8e8 !important;
  --calcite-action-text-color: #1f1f1f !important;
  --calcite-action-text-color-press: #1f1f1f !important;
  --calcite-icon-color: #1f1f1f !important;
}

/* #close calcite-action {
  --calcite-action-background-color: var(--black) !important;
  --calcite-action-background-color-hover: var(--black_hover)!important;
  --calcite-action-background-color-press: var(--black_hover)!important;
  --calcite-action-text-color: var(--white)!important;
  --calcite-action-text-color-press: var(--white)!important;
} */

/* .esri-popup__header-button--close {
  color: #ff0000 !important;
} */

calcite-flow-item{
  --calcite-flow-border-color: var(--black) !important;
  --calcite-flow-header-background-color: var(--black) !important;
  --calcite-action-background-color: var(--black) !important;
}

/* Legend Button - Top Left */
#legend-button {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Legend Sheet Styling - Confined within map shell */
#legend-sheet {
  --calcite-sheet-width: 320px;
  --calcite-sheet-scrim-background-color: rgba(0, 0, 0, 0.05);
  --calcite-scrim-background-color: rgba(0, 0, 0, 0.03);
  --calcite-scrim-background: rgba(0, 0, 0, 0.03);
  --calcite-color-transparent-scrim: rgba(0, 0, 0, 0.03);
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 1100 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

/* Override any fixed positioning from calcite-sheet */
#map_shell calcite-sheet {
  position: absolute !important;
  inset: 0 !important;
}

/* Ensure the sheet's internal container is also contained */
#legend-sheet::part(scrim),
#legend-sheet::part(container) {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 100%;
  max-height: 100%;
}

#legend-sheet::part(scrim) {
  background: rgba(0, 0, 0, 0.05) !important;
}

/* Override any fixed positioning in shadow DOM */
#legend-sheet::part(content) {
  position: relative;
  max-width: 320px;
  height: 100%;
}

#legend-panel {
  --calcite-panel-background-color: var(--panel-body);
  --calcite-panel-header-background-color: var(--black)!important;
  --calcite-panel-heading-text-color: #ffffff;
  --calcite-panel-description-text-color: #f3f3f3;
  --calcite-panel-header-action-background-color: var(--black) !important;;
  --calcite-panel-header-action-background-color-hover: var(--black_hover) !important;
  --calcite-panel-header-action-text-color: #ffffff;
  --calcite-panel-header-border-block-end: var(--black) !important;
  height: 100%;
  box-shadow: 0 8px 20px var(--panel-shadow);
}

/* Legend Section Headers */
.legend-section {
  padding: 16px;
  border-bottom: 1px solid #ffffff;
}

.legend-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-section-title calcite-icon {
  --calcite-icon-color: #ffffff;
}

/* Legend Items */
.legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  color: #e0e0e0;
  font-size: 14px;
}

.legend-item:hover {
  color: #ffffff;
}

.legend-toggle-inline {
  justify-content: space-between;
}

.legend-item-main {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

#greenways-toggle,
#bike-boulevards-toggle,
#citibike-toggle,
#bike-parking-toggle,
#bike-shops-toggle {
  flex-shrink: 0;
  margin-top: 2px;
  --calcite-switch-track-background-color: rgba(255, 255, 255, 0.2);
  --calcite-switch-track-background-color-hover: rgba(255, 255, 255, 0.28);
  --calcite-switch-track-background-color-pressed: rgba(255, 255, 255, 0.32);
  --calcite-switch-track-background-color-on: #000000;
  --calcite-switch-track-background-color-on-hover: #4fd0f2;
  --calcite-switch-track-background-color-on-pressed: #000000;
  --calcite-switch-handle-background-color: #ffffff;
}

.legend-toggle-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin: 4px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.03)
  );
}

.legend-toggle-copy {
  flex: 1;
  min-width: 0;
}

.legend-toggle-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.legend-toggle-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.legend-toggle-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: #bdbdbd;
}

.legend-toggle-status.active {
  background: rgba(39, 192, 238, 0.18);
  color: #9fe9ff;
}

.legend-toggle-description {
  margin: 0;
  color: #cfcfcf;
  font-size: 12px;
  line-height: 1.45;
}

#greenways-toggle,
#bike-boulevards-toggle {
  flex-shrink: 0;
  margin-top: 2px;
  --calcite-switch-track-background-color: rgba(255, 255, 255, 0.2);
  --calcite-switch-track-background-color-hover: rgba(255, 255, 255, 0.28);
  --calcite-switch-track-background-color-pressed: rgba(255, 255, 255, 0.32);
  --calcite-switch-track-background-color-on: #27c0ee;
  --calcite-switch-track-background-color-on-hover: #4fd0f2;
  --calcite-switch-track-background-color-on-pressed: #1faed8;
  --calcite-switch-handle-background-color: #ffffff;
}

/* Color Swatches */
.legend-swatch {
  width: 24px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-swatch.point {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* SVG Icons in Legend */
.legend-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-block;
}

.legend-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Bike Boulevard Background Highlight Emphasis */
.legend-boulevard-item {
  position: relative;
  padding-left: 12px;
  align-items: flex-start;
}

.legend-boulevard-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: #4169e1;
  border-radius: 2px;
}

.legend-boulevard-item > div {
  flex: 1;
}

.legend-boulevard-note {
  font-size: 11px;
  color: #888888;
  font-style: italic;
  margin-top: 4px;
  line-height: 1.3;
}

/* Subsection styling */
.legend-subsection {
  padding-left: 16px;
  margin-top: 8px;
  border-left: 2px solid #333333;
}

.legend-subsection-title {
  font-size: 12px;
  font-weight: 600;
  color: #aaaaaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  margin-top: 12px;
}

/* Global scrim override - Calcite teleports calcite-scrim to body */
calcite-scrim {
  --calcite-scrim-background: rgba(0, 0, 0, 0.03) !important;
  --calcite-color-transparent-scrim: rgba(0, 0, 0, 0.03) !important;
}

calcite-scrim::part(scrim) {
  background: rgba(0, 0, 0, 0.03) !important;
}

#map_shell {
  position: relative;
  display: grid;
  grid-template: "content" 100% / auto;
  height: 33.25rem;
  margin-bottom: 1rem;
  border: 1px solid #cdcdcd;
  transition: height 0.3s ease-in-out;
  isolation: isolate;
  overflow: hidden;
  contain: layout style paint;
}

.arcgis-search__form {
  margin: 0 0 0;
}

.esri-widget__heading {
  color: #fff !important;
}

.hide {
  display: none !important;
  visibility: hidden !important;
}

/* .info-item {
  padding: 16px !important;
  background-color: transparent !important; 
  border-bottom: 2px solid #ffffff !important; 
} */

/* .info-label {
  font-weight: 600 !important;
  color: #ffffff !important; 
  margin-bottom: 8px !important;
  font-size: 13px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
} */

.info-value {
  color: #ffffff !important; 
  font-size: 15px !important;
  line-height: 1.4 !important; 
}

.info-value a {
  color: #7dd3fc !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

.info-value a:hover {
  color: #ffffff !important;
}

.header {
  border-block-end: 0px !important;
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.25),
    0 10px 10px rgba(0, 0, 0, 0.22);
}

.classes-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}



/* .esri-popup__main-container {
    border-radius: 12px 12px 0 0 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.esri-popup__header {
    background: #1976d2;
    color: white;
}

.esri-popup__content {
    padding: 8px 8px 0 0;
    
}


.esri-features__container {
    background-color: var(--panel-body);
}

.esri-popup__footer {
    display: none;
}

.esri-popup__header-buttons .esri-popup__button:hover {
  background-color: var(--black) !important;
}

.esri-popup::part(close-button) {
  color: red;
}

.esri-popup::part(collapse-button) {
  color: blue;
} */