.photo-markup-controls{position:static!important;display:block!important;background:#fff!important;color:#172033!important;padding:10px!important;max-width:100%;box-sizing:border-box;border-radius:12px;backdrop-filter:none!important}
.photo-markup-controls [hidden]{display:none!important}
.photo-markup-controls button,.photo-markup-controls input,.photo-markup-controls select{min-height:44px;min-width:44px;font:inherit;border:1px solid #cbd5e1;border-radius:8px;padding:8px;background:#fff;color:#172033;box-sizing:border-box}
.photo-markup-tools,.photo-markup-options,.photo-markup-actions,.photo-markup-controls [data-entry]{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:6px 0}
.photo-markup-tools button{flex:1 0 90px}
.photo-markup-tools button[aria-pressed=true]{background:#173fa5;color:white;border-color:#173fa5}
.photo-markup-controls label{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.photo-markup-controls input[data-value]{width:180px;max-width:100%}
.photo-markup-controls [data-action=save],.photo-markup-controls [data-action=edit]{background:#173fa5;color:#fff}
.photo-markup-controls button:disabled{opacity:.45}
.photo-markup-controls p{font-size:13px;line-height:1.4;margin:6px 0}
.photo-markup-controls [data-view-label]{margin-left:12px}
#markupLayer,#annotationLayer{overflow:hidden}
#markupLayer[data-editing=false],#annotationLayer[data-editing=false]{touch-action:pan-y pinch-zoom}
#photoComposer .photo-markup-controls{margin-top:8px}
.annotation-editor:has(.photo-markup-controls){display:flex;flex-direction:column}
.annotation-editor .photo-markup-controls{order:2;width:100%}
.annotation-editor .annotation-canvas-wrap{order:1}
.annotation-stage img{object-fit:contain}
@media(max-width:600px){.photo-markup-controls{padding:6px!important}.photo-markup-tools button{flex-basis:78px;padding:6px;font-size:13px}.annotation-dialog{padding:10px;max-width:100vw;box-sizing:border-box}.photo-markup-options{gap:4px}}

#captureView[data-photo-markup-editing=true] .capture-footer{opacity:.45;pointer-events:none}
#doneBtn:disabled,#captureBackBtn:disabled{opacity:.45}
.photo-markup-inline-text{position:absolute!important;z-index:4;box-sizing:border-box;margin:0!important;padding:4px!important;min-height:0!important;min-width:0!important;border:1px dashed #2563eb!important;border-radius:2px!important;outline:none!important;background:rgba(255,255,255,.16)!important;font-family:Arial,sans-serif!important;font-weight:400!important;line-height:1.3!important;letter-spacing:normal!important;text-align:left!important;caret-color:currentColor;resize:none!important;overflow:auto;white-space:pre-wrap;overflow-wrap:break-word;box-shadow:0 0 0 1px #ffffff80}
.photo-markup-inline-text[hidden]{display:none!important}
.photo-markup-controls [data-text-actions]{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.photo-markup-controls [data-action=text-done]{background:#173fa5;color:#fff}
.photo-markup-controls [data-entry] small{flex-basis:100%;color:#58657a}
.photo-markup-controls [data-ruler-guide]{border:1px solid #b8ccef;background:#f0f5ff;border-radius:10px;padding:10px;margin:8px 0;font-size:14px}
.photo-markup-controls [data-ruler-guide] strong{display:block;color:#173fa5}
.photo-markup-controls [data-ruler-guide] small{display:block;font-size:12px;color:#58657a;line-height:1.4}
.photo-ruler-options{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0}

/* Labelled tools remain readable and usable without an icon font or network. */
.photo-markup-controls{container-type:inline-size;border:1px solid #e2e8f0;border-radius:16px;padding:12px!important;box-shadow:0 4px 16px #17203306}
.photo-markup-controls button{display:inline-flex;align-items:center;justify-content:center;gap:7px;cursor:pointer;transition:background .15s,border-color .15s,box-shadow .15s}
.photo-markup-controls button:focus-visible,.photo-markup-controls select:focus-visible,.photo-markup-controls input:focus-visible{outline:3px solid #93b4ff;outline-offset:2px}
.photo-markup-controls .photo-markup-icon{position:static!important;inset:auto!important;display:block;width:20px!important;height:20px!important;flex:0 0 20px;overflow:visible;pointer-events:none}
.photo-markup-controls .photo-markup-tools{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin:0 0 12px;padding:4px;border:1px solid #e5eaf2;background:#f7f9fc;border-radius:13px}
.photo-markup-controls .photo-markup-tools button{flex-direction:column;gap:6px;min-width:0;min-height:72px;padding:8px 3px;border:1px solid transparent;background:transparent;border-radius:9px;font-size:12px;line-height:1.2;font-weight:550;color:#526079}
.photo-markup-controls .photo-markup-tools button span{max-width:100%;overflow-wrap:normal}
.photo-markup-controls .photo-markup-tools button[aria-pressed=true]{background:#fff;color:#1747b4;border-color:#a9c1f6;box-shadow:0 2px 5px #1c3c8214}
@media(hover:hover){.photo-markup-controls button:not(:disabled):hover{background:#eef3fd;border-color:#a9c1f6}.photo-markup-controls .photo-markup-tools button:not(:disabled):hover{background:#fff}}
.photo-markup-controls .photo-markup-options{gap:8px;padding:4px 0 12px;border-bottom:1px solid #e5eaf2;margin-bottom:12px}
.photo-markup-controls .photo-markup-options label{color:#526079;font-size:13px}
.photo-markup-controls input[type=color]{width:44px;height:44px;padding:6px;border-radius:10px}
.photo-markup-controls .photo-markup-actions{justify-content:flex-end;gap:8px;margin-top:12px}
.photo-markup-controls [data-action=save],.photo-markup-controls [data-action=edit]{background:#1747b4;border-color:#1747b4;color:#fff;padding:10px 18px;font-weight:650;box-shadow:0 2px 4px #1747b41a}
.photo-markup-controls [data-action=save]:hover,.photo-markup-controls [data-action=edit]:hover{background:#12398f!important;color:#fff!important}
.photo-markup-controls [data-action=delete]{color:#a63838}
.photo-markup-controls [data-view-label]{font-size:13px;color:#64748b}
.photo-markup-controls [data-ruler-guide]{background:#f4f7ff;border-color:#d6e2fa;border-radius:12px;padding:12px}
.photo-markup-controls [data-ruler-guide]>label{margin-bottom:10px;font-size:13px;color:#526079}
.photo-markup-controls [data-ruler-guide] select{max-width:100%}
@container (min-width:800px){.photo-markup-controls .photo-markup-tools{grid-template-columns:repeat(10,minmax(0,1fr))}}
@media(max-width:600px){.photo-markup-controls{padding:8px!important}.photo-markup-controls .photo-markup-tools button{font-size:11px;min-height:72px}.photo-markup-controls .photo-markup-options{gap:6px}.photo-markup-controls .photo-markup-options button{padding:8px;font-size:12px}.photo-markup-controls .photo-markup-actions button{flex:1}.photo-markup-controls .photo-markup-tools button[data-markup-tool=number] span{max-width:58px}}
@container (max-width:300px){.photo-markup-controls .photo-markup-tools{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* A dedicated viewport: capture, navigation and snag fields stay underneath. */
.photo-markup-workspace{position:fixed;inset:0;margin:0;width:100%;max-width:none;max-height:none;padding:0;border:0;background:#111827;color:#fff;overflow:hidden;box-sizing:border-box}
.photo-markup-workspace[open]{display:flex;flex-direction:column}
.photo-markup-workspace::backdrop{background:#111827}
.photo-markup-workspace-header{display:flex;flex:none;align-items:center;justify-content:space-between;gap:8px;min-height:56px;padding:max(6px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 6px max(12px,env(safe-area-inset-left));background:#fff;color:#172033;border-bottom:1px solid #e2e8f0}
.photo-markup-workspace-header strong{font:650 15px/1.2 system-ui,sans-serif}
.photo-markup-workspace-header button{min-height:44px;min-width:44px;border:0;background:transparent;color:#1747b4;padding:8px;font:600 14px/1.2 system-ui,sans-serif;cursor:pointer}
.photo-markup-workspace-header [data-workspace-done]{background:#1747b4;color:white;border-radius:9px;padding:10px 12px}
.photo-markup-workspace-header button:focus-visible{outline:3px solid #93b4ff;outline-offset:2px}
.photo-markup-workspace-header button:disabled{opacity:.5}
.photo-markup-workspace .photo-markup-workspace-stage{position:relative!important;display:block!important;flex:1 1 auto;min-height:100px;width:100%!important;height:0!important;max-height:none!important;max-width:none!important;overflow:hidden!important;border-radius:0!important;margin:0!important;background:#111827}
.photo-markup-workspace .photo-markup-workspace-stage>img{position:static!important;display:block!important;object-fit:contain!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;margin:0!important;border-radius:0!important;transform:none!important}
.photo-markup-workspace-stage>button{display:none!important}
.photo-markup-workspace .photo-markup-workspace-tools{flex:0 1 auto;max-height:46%;min-height:0;overflow-y:auto;overscroll-behavior:contain;width:100%!important;margin:0!important;border-radius:16px 16px 0 0!important;padding-bottom:max(10px,env(safe-area-inset-bottom))!important;scroll-padding:12px}
@media(max-height:500px){.photo-markup-workspace .photo-markup-workspace-tools{max-height:42%}}

/* Put the active task before the palette, including above a phone keyboard. */
.photo-markup-controls [data-dimension-context]{margin-bottom:8px}
.photo-markup-controls [data-dimension-context][hidden]{display:none!important}
.photo-markup-controls [data-text-actions]{margin-top:0}
.photo-markup-controls[data-markup-context=entry] .photo-markup-tools,
.photo-markup-controls[data-markup-context=entry] .photo-markup-options{display:none!important}
.photo-markup-controls [data-entry]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:end;gap:8px;margin:0}
.photo-markup-controls [data-entry]>label{display:flex;flex-direction:column;align-items:stretch;min-width:0;gap:4px;font-size:13px}
.photo-markup-controls [data-entry] input,.photo-markup-controls [data-entry] select{width:100%;min-width:0}
.photo-markup-controls [data-entry] button{min-height:44px;font-size:13px;line-height:1.25}
.photo-markup-controls [data-entry] small{grid-column:1/-1}
.photo-markup-controls [data-action=add]{background:#1747b4;color:#fff;border-color:#1747b4;font-weight:650}

#spatialPinDialog [data-drawing-markup-toolbar]{margin-top:8px}
#spatialPinDialog.drawing-markup-editing{position:fixed;inset:0;margin:0!important;width:100%!important;max-width:none!important;height:var(--drawing-viewport-height,100dvh)!important;top:var(--drawing-viewport-top,0px)!important;max-height:none!important;display:flex;flex-direction:column;overflow:hidden;padding:8px!important}
#spatialPinDialog.drawing-markup-editing .dialog-heading{flex:none;min-height:40px}
#spatialPinDialog.drawing-markup-editing #editPinDrawing,#spatialPinDialog.drawing-markup-editing #spatialPinHint,#spatialPinDialog.drawing-markup-editing>.inline-actions{display:none!important}
#spatialPinDialog.drawing-markup-editing .drawing-zoom-tools{flex:none;margin:2px 0 6px}
#spatialPinDialog.drawing-markup-editing .spatial-pin-stage{flex:1 1 auto;height:0!important;min-height:110px;max-height:none!important}
#spatialPinDialog.drawing-markup-editing [data-drawing-markup-toolbar]{flex:0 1 auto;max-height:45%;min-height:0;overflow-y:auto;overscroll-behavior:contain;margin-top:6px}
.spatial-pin-canvas>[data-drawing-markup]{overflow:hidden;z-index:2}
.drawing-markup-return[hidden]{display:none!important}
.drawing-markup-return{display:flex;gap:6px;flex:none}
.drawing-markup-return button{min-height:44px;padding:8px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#1747b4;font:600 13px/1.2 system-ui}
.drawing-markup-return [data-save-drawing-markup]{background:#1747b4;color:#fff;border-color:#1747b4}
#spatialPinDialog.drawing-markup-editing .dialog-heading>.dialog-close{display:none!important}
#spatialPinDialog.drawing-markup-editing #spatialPinTitle{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
#spatialPinDialog:not(.drawing-markup-editing) [data-drawing-markup-toolbar]{width:140px!important;flex:0 0 140px;padding:0!important;border:0;box-shadow:none;margin:0!important;background:transparent!important}
#spatialPinDialog:not(.drawing-markup-editing) [data-drawing-markup-toolbar] [data-action=edit]{width:100%;min-height:44px;padding:8px;font-size:12px;background:#eef3ff;color:#1747b4;border-color:#c6d6fa;box-shadow:none}
#spatialPinDialog:not(.drawing-markup-editing) [data-drawing-markup-toolbar] [data-view-label],#spatialPinDialog:not(.drawing-markup-editing) [data-drawing-markup-toolbar] [data-status]{display:none!important}
#spatialPinDialog .dialog-heading>#spatialPinTitle{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
