/* Control dimensions, icons, and states adapted from the Public Map. */
:root { --font-heading: var(--heading); --font-body: trade-gothic-next, Verdana, sans-serif; --header-height: 0px; --map-ui-left-offset: 0px; }
.map-view .esri-ui-top-left {
  transform: translateX(var(--map-ui-left-offset));
}

.map-view .esri-ui-top-left .esri-widget--button,
.map-view .esri-ui-top-left .esri-compass,
.map-view .esri-ui-top-left .esri-locate {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
}

.map-view .esri-ui-top-left .esri-locate .esri-widget--button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
}

.map-view .esri-ui-top-left .esri-widget--button .esri-icon-font-fallback-text,
.map-view .esri-ui-top-left .esri-widget--button::before {
  line-height: 44px;
}

.measurement-control[hidden] {
  display: none !important;
}

.measurement-control {
  position: relative;
  width: 44px;
  height: 44px;
  font-family: var(--font-body);
}

.measurement-toggle.esri-widget--button,
.drop-pin-toggle.esri-widget--button {
  appearance: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--calcite-color-text-1, #141414);
  background-color: var(--calcite-color-foreground-3, #fff);
  transition: color var(--calcite-animation-timing, 0.15s) ease-in-out,
    background-color var(--calcite-animation-timing, 0.15s) ease-in-out;
}

/* Match the neutral Calcite buttons used by Home and the other map widgets. */
.measurement-toggle.esri-widget--button:hover,
.drop-pin-toggle.esri-widget--button:hover {
  color: var(--calcite-color-text-1, #141414);
  background-color: var(--calcite-color-border-2, #dedede);
}

.measurement-toggle.esri-widget--button:active,
.drop-pin-toggle.esri-widget--button:active {
  background-color: var(--calcite-color-border-1, #d4d4d4);
}

/* Home and Locate use small Calcite icons with the neutral icon color. */
.measurement-toggle calcite-icon,
.drop-pin-toggle calcite-icon {
  --calcite-icon-color: var(--calcite-color-text-3, #6b6b6b);
  pointer-events: none;
}

.measurement-control.is-open .measurement-toggle {
  color: #fff;
  background: var(--regalia);
}

.measurement-control.is-open .measurement-toggle calcite-icon {
  --calcite-icon-color: #fff;
}

/* Use the same map-button styling, including the 44px target, as Measurement. */
.print-map-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 767px) {
  .print-map-toggle { display: none !important; }
}

.measurement-panel {
  position: absolute;
  top: 0;
  left: calc(100% + 10px);
  width: min(318px, calc(100vw - 92px));
  overflow: hidden;
  color: var(--ui-accent-text, var(--regalia-deep));
  background: var(--ui-surface, #fff);
  border: 1px solid #786f7d;
  border-radius: 2px;
  box-shadow: 0 4px 14px rgb(30 20 42 / 18%);
}

.measurement-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding-left: 0.9rem;
  color: #fff;
  background: var(--regalia);
}

.measurement-panel-heading strong {
  font-family: var(--font-heading);
  font-size: calc(0.9rem * var(--ui-text-scale, 1));
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.measurement-panel-close {
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: #fff;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.measurement-panel-close .las {
  font-size: 1.35rem;
}

.measurement-actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.measurement-action,
.measurement-clear {
  min-height: 44px;
  padding: 0.55rem 0.65rem;
  color: var(--ui-accent-text, var(--regalia-deep));
  background: var(--ui-surface, #fff);
  border: 0;
  border-right: 1px solid var(--line);
  cursor: pointer;
  font: inherit;
  font-size: calc(0.82rem * var(--ui-text-scale, 1));
  font-weight: 700;
}

.measurement-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.measurement-action .las {
  color: var(--ui-accent-text, var(--clemson-orange-dark));
  font-size: 1.1rem;
}

.measurement-action[aria-pressed="true"] {
  color: #fff;
  background: var(--regalia);
}

.measurement-action[aria-pressed="true"] .las {
  color: #fff;
}

.measurement-clear {
  border-right: 0;
}

.measurement-action:hover:not(:disabled),
.measurement-clear:hover:not(:disabled) {
  background: var(--ui-hover, #f1edf5);
}

.measurement-action[aria-pressed="true"]:hover {
  background: var(--regalia-deep);
}

.measurement-action:focus-visible,
.measurement-clear:focus-visible,
.measurement-panel-close:focus-visible,
.measurement-toggle:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.measurement-action:disabled,
.measurement-clear:disabled {
  color: #79737c;
  cursor: default;
  opacity: 0.62;
}

.measurement-status {
  margin: 0;
  padding: 0.75rem 0.9rem;
  color: #514a55;
  font-size: calc(0.78rem * var(--ui-text-scale, 1));
  line-height: 1.35;
}

.measurement-widget-host:empty {
  display: none;
}

.measurement-widget-host .esri-measurement {
  width: 100%;
  box-shadow: none;
}

.measurement-widget-host .esri-measurement__measurement {
  border-top: 1px solid var(--line);
}

.appearance-tools {
  bottom: 2rem;
  left: calc(1rem + var(--map-ui-left-offset));
  z-index: 12;
  display: grid;
  width: 230px;
  padding: 0.22rem;
  overflow: visible;
  border-radius: 0.28rem;
}

@media (min-width: 1025px) {
  /* Open palettes must remain usable when they overlap the search box. */
  .appearance-tools:has(.map-tool-panel:not([hidden])) {
    z-index: 14;
  }
}

.appearance-tools button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 46px;
  padding: 0.55rem 0.72rem;
  color: var(--ui-accent-text, var(--regalia));
  font-family: var(--font-heading);
  font-size: calc(0.84rem * var(--ui-text-scale, 1));
  font-weight: 800;
  background: transparent;
  border: 0;
  border: 1px solid transparent;
  border-radius: 0.3rem;
}

.map-style-content {
  display: contents;
}

.appearance-tools button:hover:not(:disabled) {
  background: var(--soft-purple);
  border-color: var(--regalia);
}

.appearance-tools button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.appearance-tools .las {
  flex: 0 0 auto;
  font-size: 1.06rem;
}

.map-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.2rem;
}

.color-mode-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem 0.45rem;
  padding: 0.35rem 0.25rem 0.28rem;
  margin-top: 0.2rem;
  border-top: 1px solid var(--line);
}

.color-mode-control label {
  color: var(--ui-accent-text, var(--regalia-deep));
  font-family: var(--font-heading);
  font-size: calc(0.76rem * var(--ui-text-scale, 1));
  font-weight: 800;
  line-height: 1.15;
}

.color-mode-control select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.42rem 0.3rem;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: calc(0.78rem * var(--ui-text-scale, 1));
  font-weight: 650;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 0.28rem;
  cursor: pointer;
}

.color-mode-control select:focus-visible {
  outline-offset: 2px;
}

#color-mode-description {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: calc(0.7rem * var(--ui-text-scale, 1));
  line-height: 1.4;
}

.display-options-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.65rem;
}

.display-options-columns .color-mode-control {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

.display-options-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.display-options-heading h3 {
  margin: 0;
  color: var(--ui-accent-text, var(--regalia-deep));
  font-family: var(--font-heading);
  font-size: calc(1.05rem * var(--ui-text-scale, 1));
  line-height: 1.25;
}

.color-pattern-legend {
  min-width: 0;
  margin: 0.2rem 0.25rem 0;
  border-top: 1px solid var(--line);
}

.color-pattern-legend summary {
  min-height: 44px;
  padding: 0.72rem 0.05rem;
  color: var(--ui-accent-text, var(--regalia-deep));
  font-family: var(--font-heading);
  font-size: calc(0.8rem * var(--ui-text-scale, 1));
  font-weight: 800;
  line-height: 1.3;
}

.color-pattern-legend ul {
  display: grid;
  max-height: 180px;
  gap: 0.45rem;
  padding: 0.12rem 0.15rem 0.4rem;
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}

.color-pattern-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: var(--ink);
  font-size: calc(0.74rem * var(--ui-text-scale, 1));
  line-height: 1.3;
}

.color-pattern-legend-swatch {
  display: inline-block;
  width: 30px;
  height: 26px;
  flex: 0 0 30px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.color-pattern-legend-swatch svg {
  width: 100%;
  height: 100%;
}

.map-view-button,
.map-tool-button {
  width: 100%;
  justify-content: center;
}

.map-view-button[aria-pressed="true"],
.map-tool-button[aria-expanded="true"] {
  color: #fff;
  background: var(--regalia);
  border-color: var(--regalia);
}

.map-view-button[aria-pressed="true"]::after {
  content: "\2713";
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.appearance-tools .map-view-button[aria-pressed="true"]:hover:not(:disabled),
.appearance-tools .map-tool-button[aria-expanded="true"]:hover:not(:disabled),
.appearance-tools .map-tool-button[data-active="true"]:hover:not(:disabled) {
  color: #fff;
  background: var(--regalia-deep);
  border-color: var(--clemson-orange);
}

.map-tool-button[data-active="true"]::after {
  width: 7px;
  height: 7px;
  content: "";
  background: var(--clemson-orange);
  border: 1px solid #fff;
  border-radius: 50%;
}

.map-tool-disclosure {
  min-width: 0;
}

.map-tool-panel {
  right: auto;
  bottom: calc(100% + 0.48rem);
  left: 0;
  z-index: 7;
  width: min(350px, calc(100vw - 2rem));
  max-height: min(520px, calc(100vh - var(--header-height) - 9rem));
  padding: 0.68rem;
  overflow: auto;
  border-radius: 0.3rem;
}

.map-tool-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.08rem 0.05rem 0.55rem 0.18rem;
  border-bottom: 1px solid var(--line);
}

.map-tool-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex: 0 0 auto;
}

.three-d-menu .map-tool-panel-heading {
  padding-bottom: 0;
  border-bottom: 0;
}

.appearance-tools .map-tool-reset {
  min-height: 36px;
  padding: 0.38rem 0.54rem;
  color: var(--ui-accent-text, var(--regalia));
  font-size: calc(0.74rem * var(--ui-text-scale, 1));
  font-weight: 750;
  white-space: nowrap;
  background: var(--ui-surface, #fff);
  border-color: #a996bd;
}

.appearance-tools .map-tool-reset:hover:not(:disabled) {
  color: #fff;
  background: var(--regalia);
  border-color: var(--regalia);
}

.map-tool-eyebrow {
  margin: 0;
  color: var(--ui-accent-text, var(--clemson-orange-dark));
  font-family: var(--font-heading);
  font-size: calc(0.66rem * var(--ui-text-scale, 1));
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.15;
  text-transform: uppercase;
}

.map-tool-panel-heading h3 {
  margin: 0.14rem 0 0;
  color: var(--ui-accent-text, var(--regalia-deep));
  font-family: var(--font-heading);
  font-size: calc(1rem * var(--ui-text-scale, 1));
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.appearance-tools .map-tool-close {
  display: inline-grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  place-items: center;
}


/* Keep the display palette a fixed two-column group. */
.appearance-tools { grid-template-columns: 1fr; }
.appearance-tools button { text-align: center; }
.appearance-tools .map-view-button[aria-pressed="true"],
.appearance-tools .map-tool-button[aria-expanded="true"] { color:#fff; background:var(--regalia); border-color:var(--regalia); }
.appearance-tools .map-tool-button[data-active="true"]::after { display:inline-block; }
.appearance-tools .map-tool-panel { right:auto; bottom:calc(100% + .48rem); left:0; display:block; width:min(350px, calc(100vw - 2rem)); }
.basemap-choices { display:grid;gap:.34rem;padding-top:.55rem; }
.appearance-tools .basemap-choices button { border:1px solid var(--line);background:var(--paper);justify-content:flex-start; }
.appearance-tools .basemap-choices button[aria-pressed="true"] { color:#fff;background:var(--regalia);border-color:var(--regalia-deep); }
.appearance-tools .basemap-choices button[aria-pressed="true"]::after { content:'✓';margin-left:auto; }
.map-view .esri-ui-top-left button.esri-widget--button { padding:0;border:0;border-radius:0;font-weight:normal; }
.map-view .esri-ui-top-left button.esri-widget--button:hover { background:var(--calcite-color-border-2,#dedede); }
.map-view .esri-ui-top-left .esri-compass { border-radius:50%; }
.map-view .esri-ui-top-left .esri-compass button.esri-widget--button { border-radius:50%; }
.map-view .measurement-panel-close { min-width:44px;min-height:44px;border-radius:0; }
.map-view .measurement-panel-close:hover { color:white;background:var(--regalia-deep); }
.map-view .measurement-widget-host button { font:inherit;border-radius:0; }
@media(max-width:767px) { .measurement-control, .print-map-toggle { display:none!important; } }
@media(max-width:720px) { .appearance-tools { bottom:25px;left:12px;width:230px; } .appearance-tools button { min-height:44px; } }
@media print { .appearance-tools, .map-view .esri-ui-top-left { display:none!important; } }
/* Shared palette surface from the Public Map. */
.appearance-tools,
.map-tool-panel {
  position: absolute;
  z-index: 5;
  background: var(--ui-surface, rgb(255 255 255 / 96%));
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgb(35 31 38 / 15%);
  backdrop-filter: blur(8px);
}
.appearance-tools { z-index: 12; }
:root { --clemson-orange-dark: #b94700; }

.measurement-actions button { border-radius:0; }
#search-form button { display:grid;place-items:center;width:36px;min-width:36px;height:46px;padding:0;color:#6b6b6b; }
#search-form input { padding-left:0; }
#search-form calcite-icon { pointer-events:none; }
