\
.lpe-wrap {
  max-width: 980px;
  margin: 24px auto;
  padding: 18px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #fff;
}

.lpe-title { margin: 0 0 6px; font-size: 22px; }
.lpe-subtitle { margin: 0 0 18px; color: #444; }

.lpe-hint{
  margin-top: 6px;
  font-size: 12px;
  color: #666;
}

.lpe-form { margin-bottom: 18px; }

.lpe-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.lpe-field label { display: block; font-weight: 900; margin-bottom: 4px; }
.lpe-field input, .lpe-field select {
  width: 100%;
  padding: 10px 10px;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
}

/* Tabs */
.lpe-tabs{
  display:flex;
  gap:10px;
  margin: 14px 0 18px;
  flex-wrap: wrap;
}

.lpe-tab{
  cursor:pointer;
  border: 1px solid #ddd;
  background: #f7f7f7;
  padding: 10px 12px;
  border-radius: 999px;
  font-weight: 1000;
  color:#222;
}

.lpe-tab.is-active{
  border-color:#111;
  background:#111;
  color:#fff;
}

.lpe-panel{ display:none; }
.lpe-panel.is-active{ display:block; }

.lpe-fieldset {
  margin-top: 14px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 12px;
}

.lpe-fieldset legend { font-weight: 1000; padding: 0 6px; }

.lpe-radio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lpe-radio-group {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 10px;
  background: #fafafa;
}

.lpe-radio-title {
  font-weight: 1000;
  margin-bottom: 8px;
  color: #222;
}

.lpe-radio-group label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  color: #222;
}

/* Cards */
.lpe-card-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:12px;
  margin-top:12px;
}

.lpe-card-grid-2{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lpe-card{
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 10px;
  background: #fafafa;
}

.lpe-card-title{
  font-weight: 1000;
  margin-bottom: 8px;
  color:#222;
}

.lpe-card-text{
  font-size: 13px;
  color:#444;
  line-height: 1.35;
}

.lpe-options label{
  display:flex;
  gap:8px;
  align-items:center;
  padding: 6px 0;
  color:#222;
}

.lpe-card-risk{
  border-color: #f1c7c7;
  background: #fff7f7;
}

.lpe-card-note{
  background: #f7fbff;
  border-color: #d8e9ff;
}

/* Actions */
.lpe-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.lpe-btn {
  cursor: pointer;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 1000;
}

.lpe-btn-secondary {
  background: #fff;
  color: #111;
  border-color: #ddd;
}

/* Result */
.lpe-result {
  border-top: 1px solid #eee;
  padding-top: 14px;
}

.lpe-result-main {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 16px;
  align-items: start;
}

.lpe-result-label { font-size: 12px; color: #555; margin-bottom: 4px; }
.lpe-result-price { font-size: 32px; font-weight: 1000; }
.lpe-result-range { margin-top: 8px; color: #333; font-weight: 900; }

.lpe-scale {
  position: relative;
  margin-top: 10px;
  opacity: 0.25;
  transition: opacity .2s ease;
}
.lpe-scale.is-visible { opacity: 1; }

.lpe-scale-bar {
  height: 22px;
  border-radius: 999px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  background: linear-gradient(90deg, #d9534f 0%, #f0ad4e 30%, #f0ad4e 44%, #5cb85c 48%, #5cb85c 52%, #f0ad4e 56%, #f0ad4e 70%, #d9534f 100%);
}

.lpe-scale-marker {
  position: absolute;
  top: -10px;
  width: 4px;
  height: 44px;
  background: #111;
  left: 50%;
  transform: translateX(-2px);
  border-radius: 2px;
}

.lpe-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 1000;
  color: #333;
  margin-top: 8px;
}

.lpe-disclaimer {
  margin-top: 12px;
  font-size: 12px;
  color: #555;
}

/* Responsive */
@media (max-width: 640px) {
  .lpe-grid { grid-template-columns: 1fr; }
  .lpe-radio-grid { grid-template-columns: 1fr; }
  .lpe-card-grid { grid-template-columns: 1fr; }
  .lpe-card-grid-2 { grid-template-columns: 1fr; }
  .lpe-result-main { grid-template-columns: 1fr; }
}


/* Improved container separation */
.lpe-wrap {
  background: #f7f7f7;
}

.lpe-tabs{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lpe-tab{
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  border: 1px solid #dcdcdc;
  background: #ffffff;
  font-weight: 1000;
}

.lpe-tab.is-active{
  background: #111;
  color: #fff;
  border-color: #111;
}

/* Panel as an inner card */
.lpe-panel{
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 16px;
  margin-top: 10px;
}

/* Keep hidden panels hidden */
.lpe-panel{ display:none; }
.lpe-panel.is-active{ display:block; }

@media (max-width: 640px){
  .lpe-tabs{ grid-template-columns: 1fr; }
}

\
/* Tabs equal width & height */
.lpe-tabs{ width: 100%; }
.lpe-tab{ width: 100%; min-height: 46px; }


/* Tab typography & centering */
.lpe-tab{
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
  line-height: 1.1;
}
@media (max-width: 480px){
  .lpe-tab{ font-size: 15px; }
}


/* Hard override for tabs layout (prevents theme styles from breaking grid on iPad) */
.lpe-wrap * { box-sizing: border-box; }

.lpe-tabs{
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  width: 100% !important;
  gap: 10px !important;
  align-items: stretch !important;
}

.lpe-tab{
  width: 100% !important;
  margin: 0 !important;
  padding: 14px 10px !important;
  min-height: 54px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  font-size: 17px !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;

  appearance: none !important;
  -webkit-appearance: none !important;
}

/* Mobile: stack */
@media (max-width: 640px){
  .lpe-tabs{ grid-template-columns: 1fr !important; }
  .lpe-tab{ white-space: normal !important; }
}

/* Scale label center block */
.lpe-scale-mid{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap: 2px;
}
.lpe-scale-mid-title{ font-size: 12px; opacity: .9; }
.lpe-scale-mid-value{ font-size: 13px; font-weight: 1000; }


/* Inline field style for build year inputs inside radio cards */
.lpe-inline-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.lpe-inline-field input[type="number"]{
  width: 100%;
  padding: 10px 10px;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
}
.lpe-inline-hint{
  font-size: 12px;
  color:#666;
}


/* === FINAL OVERRIDES (theme-proof) === */

/* Tabs: 3 equal columns without weird gaps */
.lpe-wrap .lpe-tabs{
  display: flex !important;
  width: 100% !important;
  gap: 10px !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
}

.lpe-wrap .lpe-tab{
  flex: 1 1 0 !important;
  min-width: 0 !important;

  height: 56px !important;
  padding: 0 10px !important;
  margin: 0 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  text-align: center !important;
  font-size: 17px !important;
  line-height: 1.1 !important;
}

@media (max-width: 640px){
  .lpe-wrap .lpe-tabs{ flex-wrap: wrap !important; }
  .lpe-wrap .lpe-tab{ flex: 1 1 100% !important; height: 52px !important; }
}

/* Required marker */
.lpe-req{
  color: #d9534f;
  font-weight: 1000;
}
.lpe-required-note{
  margin: 10px 0 0;
  font-size: 12px;
  color: #555;
}

/* Scale mid spacing tighter */
.lpe-scale-mid{ gap: 0 !important; }
.lpe-scale-mid-value{ margin-top: 0 !important; }


/* Tabs equal width fix (Safari/iPad/theme-proof) */
.lpe-wrap .lpe-tabs{
  display:flex !important;
  width:100% !important;
  gap:10px !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
}
.lpe-wrap .lpe-tabs > button.lpe-tab{
  flex: 1 1 0% !important;
  width: 0 !important;          /* forces equal share in flex */
  min-width: 0 !important;
  max-width: none !important;

  height: 56px !important;
  padding: 0 10px !important;

  display:flex !important;
  align-items:center !important;
  justify-content:center !important;

  text-align:center !important;
  font-size: 17px !important;
  line-height: 1.1 !important;
}
@media (max-width: 640px){
  .lpe-wrap .lpe-tabs{
    flex-wrap: wrap !important;
  }
  .lpe-wrap .lpe-tabs > button.lpe-tab{
    flex: 1 1 100% !important;
    width: 100% !important;
  }
}


/* Tabs: enforce equal width even if theme overrides flex */
.lpe-wrap .lpe-tabs > .lpe-tab{
  flex: 1 1 0% !important;
  width: 0 !important;
  min-width: 0 !important;
}

/* Desktop: keep in one row */
.lpe-wrap .lpe-tabs{ flex-wrap: nowrap !important; }

/* Mobile: wrap */
@media (max-width: 640px){
  .lpe-wrap .lpe-tabs{ flex-wrap: wrap !important; }
  .lpe-wrap .lpe-tabs > .lpe-tab{ width: 100% !important; flex: 1 1 100% !important; }
}


/* Darker dropdown text */
.lpe-wrap select{
  color:#222 !important;
}
.lpe-wrap select option{ color:#222; }


/* Unit conversion groups */
.lpe-unit-group{
  display:grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.lpe-unit-row{
  display:flex;
  align-items:center;
  gap: 10px;
}
.lpe-unit-row .lpe-unit-label{
  width: 140px;
  font-size: 12px;
  color:#444;
}
.lpe-unit-row input{
  flex:1;
}
@media (min-width: 720px){
  .lpe-unit-group.is-3{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .lpe-unit-group.is-3 .lpe-unit-row{
    flex-direction: column;
    align-items: stretch;
    gap:6px;
  }
  .lpe-unit-group.is-3 .lpe-unit-row .lpe-unit-label{
    width:auto;
  }
  .lpe-unit-group.is-2{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lpe-unit-group.is-2 .lpe-unit-row{
    flex-direction: column;
    align-items: stretch;
    gap:6px;
  }
  .lpe-unit-group.is-2 .lpe-unit-row .lpe-unit-label{
    width:auto;
  }
}
/* Hints for distance measurement */
.lpe-hint.small{ font-size: 12px; color:#666; margin-top:6px; }


/* Theme-proof panel visibility (avoid multiple panels visible) */
.lpe-wrap .lpe-panel{ display:none !important; }
.lpe-wrap .lpe-panel.is-active{ display:block !important; }


/* Grid span helper */
.lpe-wrap .lpe-grid .lpe-span-2{ grid-column: 1 / -1; }

/* Prevent m² / v² awkward wraps */
.lpe-wrap .lpe-unit-label{ white-space: nowrap; }


@media (max-width: 480px){
  .lpe-unit-row{ flex-direction: column; align-items: stretch; gap:6px; }
  .lpe-unit-row .lpe-unit-label{ width:auto; }
}


/* Better top grouping: 2-col grid on desktop */
.lpe-wrap .lpe-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 640px){
  .lpe-wrap .lpe-grid{ grid-template-columns: 1fr; }
}


/* Tabs: enforce 3 equal widths even if theme uses !important */
.lpe-wrap .lpe-tabs > .lpe-tab{
  flex: 1 1 0% !important;
  width: 0 !important;
  min-width: 0 !important;
}
@media (max-width: 640px){
  .lpe-wrap .lpe-tabs{ flex-wrap: wrap !important; }
  .lpe-wrap .lpe-tabs > .lpe-tab{ flex: 1 1 100% !important; width: 100% !important; }
}


/* Tabs equal widths via wrapper (theme-proof) */
.lpe-wrap .lpe-tabs{
  display:flex !important;
  width:100% !important;
  gap:10px !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
}
.lpe-wrap .lpe-tab-wrap{
  flex: 1 1 0% !important;
  min-width: 0 !important;
  width: 0 !important;
  display:flex !important;
}
.lpe-wrap .lpe-tab-wrap > .lpe-tab{
  width: 100% !important;
  flex: 0 0 auto !important;
}
@media (max-width: 640px){
  .lpe-wrap .lpe-tabs{ flex-wrap: wrap !important; }
  .lpe-wrap .lpe-tab-wrap{ flex: 1 1 100% !important; width: 100% !important; }
}


/* Scale: top labels & notes + movable marker */
.lpe-scale-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:12px;
  color:#444;
  margin-bottom:8px;
}
.lpe-scale-top-left, .lpe-scale-top-right{ white-space:nowrap; }

.lpe-scale{
  position:relative;
  height:16px;
  margin: 4px 0 6px;
}
.lpe-scale-bar{
  position:absolute;
  inset:0;
  border-radius:999px;
  background: linear-gradient(90deg, #d9534f 0%, #f0ad4e 30%, #f0ad4e 44%, #5cb85c 48%, #5cb85c 52%, #f0ad4e 56%, #f0ad4e 70%, #d9534f 100%);
  opacity: 0.95;
}
.lpe-scale-marker{
  position:absolute;
  top:-22px; /* room for bubble */
  transform: translateX(-50%);
  pointer-events:none;
}
.lpe-scale-marker-line{
  position:absolute;
  left:50%;
  top:22px;
  width:2px;
  height:22px;
  background:#111;
  transform: translateX(-50%);
  border-radius:2px;
}
.lpe-scale-marker-bubble{
  position:relative;
  left:50%;
  transform: translateX(-50%);
  background:#111;
  color:#fff;
  font-size:12px;
  font-weight:800;
  padding:4px 8px;
  border-radius:999px;
  white-space:nowrap;
}
.lpe-scale-marker-bubble:after{
  content:"";
  position:absolute;
  left:50%;
  bottom:-6px;
  transform: translateX(-50%);
  border-width:6px 6px 0 6px;
  border-style:solid;
  border-color:#111 transparent transparent transparent;
}
.lpe-scale-notes{
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:11px;
  color:#666;
  margin-top:6px;
}
.lpe-scale-note-left, .lpe-scale-note-right{
  flex: 1 1 0%;
}
.lpe-scale-note-right{ text-align:right; }


/* Scale: allow marker/bubble overflow */
.lpe-scale{ overflow: visible !important; }

/* Bigger draggable hit area for touch */
.lpe-scale-marker-hit{
  position:absolute;
  left:50%;
  top:12px;
  transform: translateX(-50%);
  width:44px;
  height:44px;
  border-radius: 999px;
  background: transparent;
  pointer-events: auto;
  cursor: grab;
}
.lpe-scale-marker{ pointer-events: auto; }

/* Make bubble readable on iPad */
.lpe-scale-marker-bubble{
  font-size: 13px;
  padding: 6px 10px;
}

/* Center tab text vertically (theme-proof) */
.lpe-wrap .lpe-tab{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:0 !important;
  line-height: 1 !important;
}


.lpe-scale-top-center{
  font-size:12px;
  color:#444;
  opacity:0.9;
  text-align:center;
  white-space:nowrap;
}
.lpe-scale-notes{
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  align-items:start;
}
.lpe-scale-note-center{
  text-align:center;
  white-space:nowrap;
  font-size:11px;
  color:#666;
}


/* Scale bottom 3-column layout */
.lpe-scale-notes{
  display:grid !important;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  align-items:start;
  margin-top: 12px;
}
.lpe-scale-col{ text-align:left; }
.lpe-scale-col-center{ text-align:center; }
.lpe-scale-col-right{ text-align:right; }

.lpe-scale-price{
  font-size: 12px;
  font-weight: 900;
  color:#111;
  white-space:nowrap;
}
.lpe-scale-text{
  font-size: 11px;
  color:#666;
  margin-top: 4px;
  line-height: 1.2;
}

/* Bubble: bigger & readable on iPad */
.lpe-scale-marker-bubble{
  font-size: 12px !important;
  padding: 8px 12px !important;
  min-width: 110px;
  text-align:center;
}

/* Ensure bubble is not clipped */
.lpe-scale{ overflow: visible !important; margin-top: 8px; }

/* Tabs: force vertical centering (override any theme line-height/padding) */
.lpe-wrap .lpe-tab-wrap{ align-items: stretch !important; }
.lpe-wrap .lpe-tab-wrap > .lpe-tab{
  height: 56px !important;
  min-height: 56px !important;
  padding: 0 !important;
  margin: 0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  line-height: 1 !important;
}


/* Tabs: bulletproof vertical centering */
.lpe-wrap .lpe-tab-wrap > .lpe-tab{
  position: relative !important;
}
.lpe-wrap .lpe-tab-text{
  position:absolute !important;
  inset:0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  height:100% !important;
  line-height: 1 !important;
  margin:0 !important;
  padding:0 !important;
}


/* Scale marker alignment + better touch dragging */
.lpe-wrap .lpe-scale-marker{
  position:absolute !important;
  top:-40px !important;
  transform: translateX(-50%) !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  pointer-events:auto !important;
  z-index: 10 !important;
}
.lpe-wrap .lpe-scale-marker-bubble{
  position:relative !important;
  left:auto !important;
  transform:none !important;
}
.lpe-wrap .lpe-scale-marker-line{
  position:relative !important;
  left:auto !important;
  transform:none !important;
  top:auto !important;
  margin-top: 6px !important;
  height: 26px !important;
}
.lpe-wrap .lpe-scale-marker-hit{
  position:absolute !important;
  top: 12px !important; /* centered around the line */
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 56px !important;
  height: 56px !important;
  border-radius:999px !important;
  background: transparent !important;
  pointer-events:auto !important;
  z-index: 20 !important;
  cursor: grab;
}
.lpe-wrap .lpe-scale-marker-bubble:after{
  left:50% !important;
  transform: translateX(-50%) !important;
}


/* FINAL OVERRIDES: ensure marker is a container (not a thin line) + enable dragging on touch */
.lpe-wrap [data-lpe-scale]{
  touch-action: none !important;
}
.lpe-wrap [data-lpe-marker]{
  width: auto !important;
  height: auto !important;
  background: transparent !important;
  touch-action: none !important;
}
.lpe-wrap .lpe-scale-marker-hit{
  touch-action: none !important;
}


/* Final bubble centering */
.lpe-wrap .lpe-scale-marker-bubble{
  left: auto !important;
  transform: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.lpe-wrap .lpe-scale-marker-bubble:after{
  left: 50% !important;
  transform: translateX(-50%) !important;
}


/* FINAL Gradient override: green centered at 50% */
.lpe-wrap .lpe-scale-bar{
  background: linear-gradient(90deg, #d9534f 0%, #f0ad4e 30%, #f0ad4e 44%, #5cb85c 48%, #5cb85c 52%, #f0ad4e 56%, #f0ad4e 70%, #d9534f 100%) !important;
}


/* Marker layout tweak: bubble a bit higher, line is the extension below the bubble */
.lpe-wrap [data-lpe-marker]{
  top: -66px !important; /* lift bubble above the bar */
}
.lpe-wrap .lpe-scale-marker-bubble{
  margin-bottom: 2px !important;
}
.lpe-wrap .lpe-scale-marker-line{
  margin-top: 0 !important;
  height: 34px !important; /* extend down to the bar */
}
/* Hit area centered around the line for easier dragging */
.lpe-wrap .lpe-scale-marker-hit{
  top: 18px !important;
}


/* Layout helpers */
.lpe-radio-group--spacer{
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
}
.lpe-card--span-2{
  grid-column: 1 / -1;
}


/* Apartment 2x2 grids spacing */
.lpe-card-grid + .lpe-card-grid{ margin-top:12px; }
