/* One fence workspace for record creation, editing and viewing. */
.geo-fence{ border:1px solid var(--data-card-border); border-radius:12px; overflow:hidden; background:var(--data-card-surface); }
.geo-fence-toolbar{ display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:12px; border-bottom:1px solid var(--data-card-line); background:var(--data-card-surface); }
.geo-fence-heading{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; width:100%; min-width:0; }
.geo-fence-heading > strong{ color:var(--text); font-size:13px; font-weight:600; }
.geo-fence-summary{ font-size:11px; color:var(--text-3); line-height:1.5; }
.geo-fence[data-fence-changed="true"] .geo-fence-summary{ color:var(--accent); }
.geo-fence-map-shell{ position:relative; isolation:isolate; }
.geo-fence-map{ width:100%; height:260px; background:#e8edf1; }
.geo-fence{ position:relative; }
.geo-fence-message, .geo-fence-help{ box-sizing:border-box; padding:6px 10px; font-size:12px; line-height:1.6; color:var(--text-2); }
.geo-fence-message{ position:absolute; z-index:3; bottom:42px; left:10px; right:10px; max-height:88px; overflow:auto; border:1px solid var(--data-card-border); border-radius:8px; background:var(--data-card-surface); box-shadow:0 2px 8px rgba(28,42,61,.12); }
.geo-fence-message:empty{ display:none; }
.geo-fence-message[data-error="true"]{ color:var(--danger,#b9473e); }
.geo-fence-help{ height:40px; overflow:auto; border-top:1px solid var(--data-card-line); color:var(--text-3); }
/* A live state message replaces the generic operation hint so the map has one prompt. */
html body .geo-fence:has(.geo-fence-message:not(:empty)) .geo-fence-help{ display:none; }
html body .geo-fence:has(.geo-fence-message:not(:empty)) .geo-fence-message{ bottom:10px; }
.geo-fence-actions:empty{ display:none; }
.geo-fence-actions{ box-sizing:border-box; position:absolute; z-index:2; top:0; right:0; display:flex; flex-wrap:wrap; justify-content:flex-end; gap:3px; max-width:100%; max-height:82px; overflow:auto; padding:4px; border:1px solid color-mix(in srgb,var(--data-card-border) 80%,transparent); border-radius:0 0 0 8px; background:color-mix(in srgb,var(--data-card-surface) 94%,transparent); box-shadow:0 1px 4px rgba(28,42,61,.1); }
.geo-fence [hidden]{ display:none !important; }
@media(max-width:720px) { .geo-fence-map{ height:240px; } }
/* Compact tools keep shared button typography and keyboard focus. */
html body .geo-fence-actions .btn{ box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; min-width:0; height:26px; min-height:26px; padding:0 7px; border-radius:4px; font-size:11px; line-height:1.2; white-space:nowrap; }
html body .geo-fence-actions .btn:not(.primary){ background:transparent; border-color:var(--data-card-border); box-shadow:none; color:var(--text-2); }
html body .geo-fence-actions .btn:not(.primary):hover:not(:disabled){ background:var(--data-card-heading); border-color:var(--action-border); color:var(--action-ink); }
html body .geo-fence-actions .btn[data-fence-action="clear"]{ border-color:transparent; color:var(--text-3); }
html body .geo-fence-actions .btn[data-fence-action="clear"]:is(:hover,:focus-visible):not(:disabled){ color:var(--danger,#b9473e); background:color-mix(in srgb,var(--danger,#b9473e) 7%,var(--data-card-surface)); border-color:transparent; }
html body .geo-fence-actions .btn:disabled{ color:var(--text-3); opacity:.55; cursor:not-allowed; box-shadow:none; }

html body .record-layout-stable [data-record-field][aria-invalid="true"]{ border-color:var(--danger,#b9473e); box-shadow:0 0 0 1px var(--danger,#b9473e); }
.geo-fence.location-invalid{ border-color:var(--danger,#b9473e); }
