.smart-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0;
}
.smart-template-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 9px 4px;
  min-height: 80px;
  white-space: normal;
  border: 1px solid #3e534e;
  background: #1b2e29;
}
.smart-template-grid button.active {
  border-color: #46ca9a;
  background: #24493d;
  color: #e4fff2;
}
.smart-template-grid svg {
  width: 52px;
  height: 38px;
}
.smart-road-controls label,
.smart-editor label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.smart-road-controls label[hidden] {
  display: none;
}
.road-controls label[hidden] {
  display: none;
}
.road-controls .smart-road-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.road-controls .smart-road-toggle input[type='checkbox'] {
  flex: 0 0 auto;
  width: auto;
  margin-left: auto;
}
.administrative-properties .admin-relation-count {
  margin-top: 9px;
  color: var(--muted, #9bb0ba);
  font-size: 12px;
}
.administrative-properties .admin-relation-warning {
  color: #efc07c;
  font-size: 12px;
  line-height: 1.6;
  padding-left: 18px;
  margin: 8px 0 0;
}
.smart-road-controls label > span {
  flex: 1;
  min-width: 90px;
}
.smart-road-controls label > select,
.smart-editor label > select {
  width: 58%;
  min-width: 0;
  flex-shrink: 0;
}
.smart-road-controls input[type='number'],
.smart-editor input[type='number'] {
  width: 82px;
}
.smart-road-controls input[type='checkbox'],
.smart-editor input[type='checkbox'] {
  width: auto;
}
/* These three pairs are the only rows shared by two controls. Keep the
   original form tree and the geometry of all other road fields intact. */
body .workspace > .inspector .smart-road-controls > label:has(> [data-smart-road]:is([data-smart-road='sideLeft'], [data-smart-road='sideRight'], [data-smart-road='sidewalkLeft'], [data-smart-road='sidewalkRight'], [data-smart-road='cycleLeft'], [data-smart-road='cycleRight'])) {
  display:inline-flex;
  vertical-align:middle;
  box-sizing:border-box;
  width:calc(50% - 6px);
  min-height:var(--ui-field-height);
  margin:0 var(--road-pair-gap,0px) 0 0;
  gap:6px;
}
body .workspace > .inspector .smart-road-controls > label:has(> :is([data-smart-road='sideLeft'],[data-smart-road='sidewalkLeft'],[data-smart-road='cycleLeft'])) { --road-pair-gap:12px; }
body .workspace > .inspector .smart-road-controls > label:has(> input[type='checkbox']) > span { min-width:0; }
.smart-editor p {
  color: #abbfb5;
  line-height: 1.8;
}
.smart-editor > button {
  width: 100%;
  margin-top: 12px;
}
.smart-road-editing {
  cursor: crosshair;
}
.property-tabs {
  display: flex;
  gap: 3px;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 6px 0;
  background: #172e2b;
  border-bottom: 1px solid #39564c;
}
.property-tabs button {
  flex: 1;
  padding: 7px 3px;
  border-radius: 3px;
}
.property-tabs button.active {
  background: #31584a;
  border-color: #57b68c;
  color: #f2fff8;
}
.property-tab-pane[hidden] {
  display: none;
}

/* Keep the browser's click target stable while preview SVG is replaced. */
body.picking-layer #map #scene,
body.picking-layer #map #scene *,
body.picking-layer #map #overlay,
body.picking-layer #map #overlay *,
#map[data-tool='line'] #scene,
#map[data-tool='line'] #scene *,
#map[data-tool='line'] #overlay,
#map[data-tool='line'] #overlay *,
#map[data-tool='polygon'] #scene,
#map[data-tool='polygon'] #scene *,
#map[data-tool='polygon'] #overlay,
#map[data-tool='polygon'] #overlay * {
  pointer-events: none !important;
}
