/* =========================
   wyc storage calculator
   ========================= */

.wyc-calc {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.wyc-calc__panel h4 {
  margin: 0 !important;
  font-size: 22px;
  font-weight: 600;
  color: #666;
  line-height: 1.45;
  padding-bottom: 14px !important;
}

.wyc-calc__hint {
  margin: 4px 0 16px;
  font-size: 13px;
  color: #666;
}

.wyc-section__title {
  font-size: 16px;
  color: #666;
}

/* =========================
   Layout
   ========================= */

.wyc-calc__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.wyc-panel--map {
  display: flex;
  flex-direction: column;
}

#dem-map {
  width: 100%;
  border-radius: 10px;
  height: 650px;
  border: 2px solid #ffffff;
  position: relative;
}

.map-is-active {
  border: 2px solid #f28c28 !important;
}

.leaflet-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.table-1 {
  flex: auto;
  flex-direction: row;
  margin-top: 10px;
}

.dem-title {
  font-size: 14px;
  color: #666;
  font-weight: 500;
  margin-bottom: 10px;
}

.stats_title {
  font-size: 15px;
  font-weight: 500;
  color: #666;
  margin-top: 10px;
}

.wyc-calc__panel {
  background: #fafafa;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0;
}

.dem-visual-info {
  font-size: 15px;
  font-weight: 500;
  color: #666;
  margin-bottom: 10px;
}

.dem-column {
  display: flex;
  flex-direction: column;
  margin-left: 6px;
}

.dem-row {
  display: flex;
  flex-direction: row;
  gap: 15px;
}

.dem-search {
  display: flex;
  flex-direction: row;
  align-items: stretch !important;
  height: 100% !important;
}

.wyc-line-small {
  border: 0;
  height: 1px;
  margin: 2px 0;
  background: linear-gradient(to bottom, #d9d9d9, #ffffff);
  box-shadow: 0 1px 0 #cfcfcf inset;
  opacity: 0.9;
}

/* Info / breakdown panel */
.wyc-breakdown {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  padding: 0 14px;
  margin: 20px 0 20px;
}

/* Summary row */
.wyc-breakdown > summary {
  cursor: pointer;
  list-style: none; /* remove default marker in some browsers */
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 13px;
  user-select: none;
  padding: 0 4px;
}

/* Hide default disclosure triangle */
.wyc-breakdown > summary::-webkit-details-marker {
  display: none;
}

/* Custom chevron */
.wyc-breakdown > summary::after {
  content: "▾";
  font-size: 24px;
  opacity: 0.8;
  transform: rotate(0deg);
  transition: transform 140ms ease, opacity 140ms ease;
}

.wyc-breakdown[open] > summary::after {
  transform: rotate(180deg);
  opacity: 0.9;
}

/* Hover / focus */
.wyc-breakdown > summary:hover {
  opacity: 0.95;
  color: #f28c28;
}

.wyc-breakdown > summary:focus {
  outline: none;
}

.wyc-breakdown > summary:focus-visible {
  outline-offset: 2px;
  border-radius: 6px;
  color: #f28c28;
}

/* Body text */
.wyc-breakdown .wyc-calc__hint {
  margin: 2px 0 2px;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.9;
  padding: 2px 2px 15px 10px;
}

.adj_left {
  flex: auto;
  text-align: left !important;
}

.stat-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Thin grooved divider */
.wyc-hr {
  border: 0;
  height: 1px;
  margin: 7px 0;
  background: linear-gradient(to bottom, #d9d9d9, #ffffff);
  box-shadow: 0 1px 0 #cfcfcf inset;
  opacity: 0.9;
}

.dem-button--icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dem-button__icon {
  display: block;
}

/* =========================
   Layout mobile
   ========================= */

@media (max-width: 1100px) {
  .wyc-calc__grid {
    grid-template-columns: 1fr;
  }

  #dem-map {
    height: 650px;
  }
}

@media (max-width: 600px) {
  .wyc-calc__grid {
    grid-template-columns: 1fr;
  }

  #dem-map {
    height: 350px;
  }
}

/* =========================
   DEM loader
   ========================= */

.dem-map-wrap {
  position: relative; /* anchor for loader */
}

.map-loader {
  position: absolute;
  inset: 0;
  background: rgba(250, 250, 250, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  pointer-events: none;
  border-radius: 10px;
  backdrop-filter: blur(4px);
  border: 1px solid #ededed;
}

.map-loader.is-hidden {
  display: none;
}

#dem-map-loader {
  position: absolute;
  inset: 0;
  z-index: 500;
}

.is-hidden {
  display: none;
}

.map-loader__label {
  background: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.map-loader__panel {
  background: none;
  padding: 10px 14px;
  border-radius: 10px;
  min-width: 260px;
}

.map-loader__bar {
  height: 4px;
  background: #eee;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

#dem-map-bar {
  height: 100%;
  width: 0%;
  background: #f28c28;
  transition: width 0.12s linear;
}

/* =========================
   Radio & toggles
   ========================= */

.dem-radio {
  display: flex;
  gap: 20px;
  font-size: 13px;
}

.wyc-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.wyc-actions {
  display: flex !important;
}

.wyc-result__sub {
  font-size: 13px;
  color: #666;
}

/* =========================
   Inputs & helpers
   ========================= */

input::placeholder {
  color: #b8b8b8;
}

.wyc-field {
  margin-bottom: 14px;
}

.wyc-label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: #333;
}

.wyc-muted {
  font-size: 12px;
  color: #777;
}

.dem-help {
  font-size: 12px;
  color: #666;
  margin-left: 10px;
  margin-top: 4px;
}

.lot-stats {
  font-size: 14px;
  color: #666;
}

.wyc-row {
  display: flex;
  gap: 8px;
}

.wyc-row--tight {
  margin-top: 6px;
}

.wyc-col {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.wyc-col--unit {
  flex: 0 0 60px;
}

/* =========================
   Input fields
   ========================= */

.wyc-calc input[type="text"],
.wyc-calc input[type="number"],
.wyc-calc input[type="date"],
.wyc-calc select {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  background: #fff;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#lot-search {
  margin-right: 10px;
}

.wyc-calc input::placeholder {
  font-weight: 400;
}

.wyc-calc input:focus,
.wyc-calc select:focus {
  border-color: #f28c28;
  box-shadow: 0 0 0 2px rgba(242, 140, 40, 0.15);
}

.wyc-calc input:disabled {
  background: #f3f3f3;
  color: #999;
  cursor: not-allowed;
  opacity: 0.7;
}

.wyc-calc input[type="number"] {
  max-width: 120px;
}

.wyc-calc input[type="range"] {
  width: 100%;
  accent-color: #f28c28;
  cursor: pointer;
}

/* calendar icon (webkit) */
.wyc-calc input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.6;
  cursor: pointer;
}

.wyc-calc input[type="date"]:disabled::-webkit-calendar-picker-indicator {
  opacity: 0.3;
  cursor: not-allowed;
}

/* =========================
   Button   
   ========================= */

button {
  border-radius: 5px !important;
}

.dem-button {
  font-size: 12px !important;
  border-radius: 6px;
  border: 1px solid #f48424 !important;
  background: #f48424 !important;
  color: #fff !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  padding: 4px 12px;
  cursor: pointer;
  align-items: centre;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dem-button:hover {
  background: #fff !important;
  color: #f48424 !important;
}
.map-btn {
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #d0d0d0;
  background: #fff;
  cursor: pointer;
  color: #555;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.map-btn.is-active {
  background: #f28d2827;
  border-color: #f28c28;
  color: #f28c28 !important;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.map-btn.is-active:hover {
  background: #ffffff;
  border-color: #f28c28;
  color: #f28c28;
}

.map-btn:hover {
  border-color: #f28c28;
  color: #f28c28;
}

.map-btn {
  padding: 4px 10px;
  font-size: 12px !important;
  font-weight: 600 !important;
  border: 1px solid #d0d0d0;
  background: #fff !important;
  cursor: pointer;
  color: #555 !important;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.map-btn:hover {
  border-color: #f28c28 !important;
  color: #f28c28 !important;
}

.map-dtm-btn {
  padding: 4px 10px;
  font-size: 12px !important;
  font-weight: 600 !important;
  border: 1px solid #d0d0d0 !important;
  background: #fafafa !important;
  cursor: pointer;
  color: #555 !important;
  margin-left: 20px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.map-dtm-btn:hover {
  border: 1px solid #f28c28 !important;
  background: #f4f4f4 !important;
}

.map-dtm-btn.is-active {
  background: #f28c28 !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
}

.wyc-map.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #fff;
}

.wyc-map.is-fullscreen #map {
  height: 100vh;
  width: 100vw;
}

/* =========================
   checkbox
   ========================= */

/* Wrapper */
.dam-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  margin-top: 20px;
}

/* Hide native checkbox */
.dam-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;

  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;

  border: 2px solid var(--border-ui, #cfcfcf);
  background: #fff;

  display: grid;
  place-items: center;
  box-sizing: border-box;

  cursor: pointer;
  transition: background-colour 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

/* Checkmark */
.dam-toggle input[type="checkbox"]::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}

/* Checked state */
.dam-toggle input[type="checkbox"]:checked {
  background: var(--accent, #f28c28);
  border-color: var(--accent, #f28c28);
}

.dam-toggle input[type="checkbox"]:checked::after {
  transform: rotate(45deg) scale(1);
}

/* Hover */
.dam-toggle input[type="checkbox"]:hover {
  border-color: var(--accent, #f28c28);
}

/* Focus (keyboard accessibility) */
.dam-toggle input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(242, 140, 40, 0.25);
}

/* =========================
   Panel spacing
   ========================= */

/* space between top grid and bottom summary */
.wyc-calc__grid {
  margin-bottom: 16px;
}

/* optional: extra breathing room for summary */
.wyc-panel--summary {
  margin-top: 8px;
}

/* =========================
   Custom radio buttons
   ========================= */

.dem-radio label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}

/* hide native radio */
.dem-radio input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid #cfcfcf;
  border-radius: 50%;
  background: #fff;
  display: inline-grid;
  place-content: center;
  margin: 0;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

/* inner dot */
.dem-radio input[type="radio"]::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.15s ease;
  background: #f28c28;
}

/* checked */
.dem-radio input[type="radio"]:checked {
  border-color: #f28c28;
}

.dem-radio input[type="radio"]:checked::before {
  transform: scale(1);
}

/* focus */
.dem-radio input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(242, 140, 40, 0.25);
}

/* disabled */
.dem-radio input[type="radio"]:disabled {
  border-color: #ddd;
  background: #f3f3f3;
  cursor: not-allowed;
}

.dem-radio input[type="radio"]:disabled::before {
  background: #bbb;
}

/* =========================
   Map display controls
   ========================= */

/* Map Logo */
.map-logo {
  position: absolute;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  right: 0px;
  bottom: -5px;
  z-index: 999 !important;
  background: transparent;
}

.leaflet-bottom.leaflet-right {
  z-index: 2000;
}

.leaflet-control {
  z-index: 2000;
}

#lotCopyBtn {
  margin-left: 10px;
}

.dem-save-btn {
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 2px 8px;
  border: 1px solid #f48424 !important;
  background: #f48424 !important;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dem-save-btn:hover {
  color: #f48424 !important;
  border: 1px solid #f28c28 !important;
  background: #ffffff !important;
}

.overlay {
  position: absolute;
  pointer-events: none;
}

.wyc-map-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wyc-map-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.wyc-map-buttons {
  display: flex;
  gap: 8px;
}

.wyc-map-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.wyc-dem-buttons {
  display: flex;
  gap: 6px;
  flex-direction: row;
}

.dem-stats {
  display: flex;
  gap: 30px;
  flex-direction: row;
  justify-content: space-between;
}

.dem-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  opacity: 0.7;
  cursor: default;
}

.dem-copyright {
  color: #9a9a9a;
  text-align: right;
}

.dem-version {
  color: #9a9a9a;
  text-align: left;
  cursor: default;
}

.dem-btn {
  padding: 4px 10px;
  height: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #d0d0d0;
  border: 1px solid #d0d0d0;
  cursor: pointer;
  color: #555;
}

.leaflet-bar,
.leaflet-control {
  background: none;
  border: none;
  height: 0; /* hide leaflet logo  */
}

.leaflet-control-zoom-out,
.leaflet-control-zoom-in {
  background: #f28c28 !important;
  color: #ffffff !important;
  border-radius: 5px !important;
  border: 1px solid #d0d0d0;
  margin: 2px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.leaflet-control-zoom-out:hover,
.leaflet-control-zoom-in:hover {
  color: #f28c28 !important;
  background: #ffffff !important;
  border: 1px solid #f28c28;
}

.leaflet-control-zoom,
.leaflet-bar leaflet-control {
  border: none !important;
  background: none !important;
}

.dem-vertex {
  width: 22px;
  height: 22px;
  background: #fff;
  border: 3px solid#ff9800;
  border-radius: 50%;
  box-sizing: border-box;
  pointer-events: auto;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dem-vertex:hover {
  background: #ff9800;
  border: 2px solid #ff9800;
}

.leaflet-marker-icon {
  pointer-events: auto;
}

.dem-map-save-ui {
  position: absolute;
  bottom: 16px;
  left: 16px;
  transform: none;
  display: inline-flex;
  flex-direction: row;
  gap: 10px;
  width: max-content;
  height: max-content;
  z-index: 9999;
  pointer-events: none;
}

.dem-map-save-ui .dem-save-btn {
  pointer-events: auto;
}

.dem-vertex,
.leaflet-marker-icon {
  pointer-events: auto !important;
}

.leaflet-image-layer {
  pointer-events: none !important;
}

.gps-copy {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  transform: translateY(1px);
  cursor: pointer;
  opacity: 0.7;
}

.gps-copy:hover {
  opacity: 1;
  color: #f28c28; /* accent colour */
}

/* =========================
   Tooltips
   ========================= */
.has-tooltip {
  position: relative;
}

.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(128, 128, 128, 0.85);
  color: #fff;
  font-size: 12px;
  text-transform: none;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
  box-shadow: 0 1px 0 #cfcfcf inset;
}

.has-tooltip::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(143, 143, 143, 0.85);
  opacity: 0;
  transition: opacity 120ms ease;
}

.has-tooltip:hover::after,
.has-tooltip:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}
