/* Fixed touch forms use compact rows. User content and errors can still scroll. */
html:root:is([data-app-layout=phone],[data-app-layout=tablet]) {
  body dialog.app-capture-dialog [hidden] {display:none!important;}
  body dialog.app-capture-dialog {inset:var(--app-half-sheet-top,50dvh) 0 auto!important;width:var(--app-viewport-width,100vw)!important;max-width:none!important;height:var(--app-half-sheet-height,50dvh)!important;max-height:var(--app-half-sheet-height,50dvh)!important;margin:0!important;padding:0!important;border-radius:18px 18px 0 0!important;box-sizing:border-box;overflow:hidden;}
  body dialog.app-capture-dialog[open] {display:flex;flex-direction:column;}
  body dialog.app-capture-dialog>header {display:flex;align-items:center;justify-content:space-between;min-height:44px;height:44px;flex:none;padding:0 12px!important;box-sizing:border-box;}
  body dialog.app-capture-dialog>header h2 {margin:0;font-size:16px;line-height:1.2;}
  body dialog.app-capture-dialog>header button {width:36px;min-width:36px;min-height:36px;height:36px;padding:0;}
  body dialog.app-capture-dialog .ws-content-dialog-body {display:grid;grid-template-columns:minmax(64px,.65fr) minmax(0,2fr);align-content:start;align-items:center;gap:6px 8px;padding:6px 12px;min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;}
  body dialog.app-capture-dialog .ws-content-dialog-body>label,body .app-capture-dataset>label,body .app-capture-media>label {margin:0;font-size:12px;font-weight:500;line-height:1.25;}
  body dialog.app-capture-dialog :is(input:not([type=file]),select) {min-height:34px!important;height:34px!important;padding:4px 8px;border-radius:8px;font-size:16px;}
  body dialog.app-capture-dialog textarea {height:48px;min-height:48px;max-height:120px;padding:5px 8px;border-radius:8px;font-size:16px;resize:vertical;}
  body dialog.app-capture-dialog .ws-content-dialog-body>:is(p,section) {grid-column:1/-1;min-width:0;margin:0;}
  body dialog.app-capture-dialog .ws-content-dialog-body>p {font-size:12px;line-height:1.3;}
  body dialog.app-capture-dialog .ws-content-dialog-body>p:empty {display:none;}
  body .app-capture-dataset {display:grid;grid-template-columns:minmax(64px,.65fr) minmax(0,2fr);align-items:center;gap:6px 8px;border:0;padding:0;}
  body .app-capture-dataset>input {grid-column:2;}
  body .app-capture-media {display:grid;grid-template-columns:minmax(64px,.65fr) minmax(0,2fr);align-items:center;gap:6px 8px;}
  body .app-capture-media>div:first-of-type {display:flex;flex-wrap:nowrap;gap:4px;margin:0;}
  body .app-capture-media button {min-height:36px!important;padding:4px;min-width:0;font-size:11px;font-weight:500;line-height:1.2;}
  body .app-capture-files {grid-column:1/-1;}
  body .app-capture-files:empty {display:none;}
  body dialog.app-capture-dialog>footer {display:flex;align-items:center;justify-content:flex-end;min-height:44px;flex:none;gap:6px;padding:4px 12px max(4px,var(--app-safe-bottom,0px));box-sizing:border-box;}
  body dialog.app-capture-dialog>footer button {min-height:36px;padding:5px 14px;font-size:14px;}
  body #mapExportDialog .app-export-settings-body {padding:6px 10px;gap:5px 8px;}
  body #mapExportDialog .app-export-settings-body>label {font-size:12px;line-height:1.25;gap:3px;margin:0;}
  body #mapExportDialog :is(input:not([type=checkbox]):not([type=radio]),select) {min-height:34px;padding:4px 6px;font-size:16px;}
  body #mapExportDialog .app-export-footer {padding:4px 10px max(4px,var(--app-safe-bottom,0px));gap:6px;}
  body #mapExportDialog .app-export-footer>button {min-height:36px;padding:4px 6px;font-size:13px!important;}
  body #sharePanel {padding:10px 12px;}
  body #sharePanel header {min-height:36px;}
  body #sharePanel h2 {font-size:16px;}
  body #sharePanel .share-actions {margin:6px 0;gap:6px;}
  body #sharePanel button {min-height:36px;padding:5px 8px;font-size:13px;}
  body #sharePanel input {min-height:34px;height:34px;padding:4px 6px;font-size:16px;}
  body #sharePanel .share-url-label {gap:3px;}
  body #sharePanel .share-qr-wrap img {width:96px;height:96px;}
  body #sharePanel :is(.share-help,.share-note) {margin:5px 0;font-size:11px;line-height:1.25;}
  #workspacePanel .ws-mobile-layer .ws-mobile-layer-header {height:40px!important;min-height:40px!important;padding:2px 8px;gap:6px;}
  #workspacePanel .ws-mobile-layer-header .ws-icon-button,#workspacePanel .ws-mobile-layer-header .app-layer-eye {height:34px!important;min-height:34px!important;min-width:34px!important;width:34px;padding:4px;}
  #workspacePanel .ws-mobile-layer-title h3 {font-size:14px;line-height:1.2;}
  #workspacePanel .ws-mobile-layer-count {font-size:10px;line-height:12px;}
  #workspacePanel .ws-mobile-layer .ws-layer-quick-actions {padding:2px 8px;gap:6px;}
  #workspacePanel .ws-mobile-layer .ws-layer-quick-actions button {min-height:32px!important;padding:3px 8px;font-size:12px;}
  #workspacePanel .ws-mobile-layer .ws-mobile-layer-tabs {padding:0 8px;min-height:32px!important;height:32px!important;}
  #workspacePanel .ws-mobile-layer-tabs .ws-layer-tool {height:32px;min-height:32px!important;padding:3px 6px;font-size:13px;}
  #workspacePanel .ws-mobile-layer .ws-inspector-scroll[data-tool] {padding:5px 8px;}
  #workspacePanel .ws-mobile-layer .ws-feature-footer {min-height:40px;padding:3px 8px;gap:6px;}
  #workspacePanel .ws-mobile-layer .ws-feature-footer button {min-height:32px!important;padding:3px 10px;font-size:13px;border-radius:9px;}
  #workspacePanel .ws-mobile-simple-settings {gap:4px;align-content:start;}
  #workspacePanel .ws-mobile-simple-settings .ws-tool-section {margin:0;padding:4px 8px;border-radius:10px;}
  #workspacePanel .ws-mobile-simple-settings .ws-notice {margin:4px 0 0;padding:6px 8px;font-size:12px;line-height:1.3;}
  #workspacePanel .ws-mobile-simple-settings .ws-tool-section h4 {display:none;}
  #workspacePanel .ws-mobile-simple-settings .ws-tool-input {min-height:36px;gap:8px;}
  #workspacePanel .ws-mobile-simple-settings .ws-tool-input>span {font-size:13px;}
  #workspacePanel .ws-mobile-simple-settings input[type=number],#workspacePanel .ws-mobile-simple-settings input[type=color] {min-height:32px!important;height:32px!important;padding:3px 6px;font-size:16px;}
  #workspacePanel .ws-mobile-simple-settings input[type=number] {width:76px;}
  #workspacePanel .ws-mobile-simple-settings input[type=color] {width:44px;}
  #workspacePanel .ws-mobile-records .ws-data-record-head {min-height:32px;padding:0 0 3px!important;gap:4px;}
  #workspacePanel .ws-mobile-records .ws-data-record-head button {min-width:30px;width:30px;height:30px;min-height:30px!important;padding:2px;font-size:20px;}
  #workspacePanel .ws-mobile-records .ws-data-record-head strong {font-size:12px;}
  #workspacePanel .ws-mobile-records .ws-data-record-head small {font-size:10px;}
  #workspacePanel .ws-mobile-records .ws-data-record-fields {gap:3px!important;}
  #workspacePanel .ws-mobile-records .ws-data-record-field {min-height:0!important;padding:2px 0!important;margin:0;gap:3px;font-size:12px;}
  #workspacePanel .ws-mobile-records .ws-record-primary .ws-data-record-field {display:grid!important;grid-template-columns:72px minmax(0,1fr);align-items:center;gap:6px;}
  #workspacePanel .ws-mobile-records .ws-data-record-field :is(input,textarea,select) {min-height:32px!important;padding:3px 6px;font-size:16px;line-height:1.3;border-radius:8px;}
  #workspacePanel .ws-mobile-records .ws-record-name textarea {max-height:104px;}
  #workspacePanel .ws-mobile-records .ws-record-description textarea {max-height:112px;}
  #workspacePanel .ws-mobile-layer .ws-record-coordinates {margin:2px 0 0;padding-top:2px;}
  #workspacePanel .ws-mobile-layer .ws-record-coordinates h4 {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);margin:0;}
  #workspacePanel .ws-mobile-records .ws-data-record-coordinate-row {grid-template-columns:repeat(var(--ws-coordinate-count,3),minmax(0,1fr))!important;gap:6px;}
  #workspacePanel .ws-mobile-records .ws-record-map-actions {margin:3px 0;gap:4px;}
  #workspacePanel .ws-mobile-records .ws-record-map-actions>button {min-height:32px!important;padding:3px 5px;font-size:11px;line-height:1.2;border-radius:8px;}
  #workspacePanel .ws-mobile-records .ws-record-map-actions [hidden] {display:none!important;}
  #workspacePanel .ws-mobile-records .ws-record-section>summary {min-height:24px!important;padding:3px 0;font-size:12px;line-height:18px;}
  #workspacePanel .ws-mobile-records .ws-record-section>summary::after {font-size:18px;line-height:18px;}
  #workspacePanel .ws-mobile-records .ws-data-summary {margin-bottom:3px;}
}
/* Style controls stay content-sized instead of stretching across the half pane. */
html:root:is([data-app-layout=phone],[data-app-layout=tablet]) #workspacePanel {
  .ws-mobile-simple-settings {display:block!important;align-content:start!important;}
  .ws-mobile-simple-settings .ws-tool-section {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;align-items:center;gap:8px;min-height:0!important;height:auto!important;margin:0 0 6px!important;padding:5px 8px!important;}
  .ws-mobile-simple-settings .ws-tool-input {min-width:0;min-height:30px!important;margin:0!important;gap:4px;}
  .ws-mobile-simple-settings .ws-tool-input>span {font-size:12px;line-height:1.15;}
  .ws-mobile-simple-settings input[type=number] {width:52px!important;flex:0 0 52px;min-height:28px!important;height:28px!important;padding:2px 4px!important;}
  .ws-mobile-simple-settings input[type=color] {width:34px!important;flex:0 0 34px;min-height:28px!important;height:28px!important;padding:2px!important;}
  .ws-mobile-layer-header .ws-layer-back {font:24px/1 var(--font-body,sans-serif)!important;background:transparent;}
}
/* Back shares the floating fold control's height above the half sheet. */
html:root:is([data-app-layout=phone],[data-app-layout=tablet]) .app-collection-back {left:12px!important;right:auto!important;}
html:root:is([data-app-layout=phone],[data-app-layout=tablet]) .app-collection-back svg {transform:none!important;}
html:root:is([data-app-layout=phone],[data-app-layout=tablet]) #workspacePanel[data-collection-pane] .ws-layer-back {display:grid!important;place-items:center;width:44px;min-width:44px;min-height:44px!important;height:44px!important;}
html:root:is([data-app-layout=phone],[data-app-layout=tablet]) .app-collection-locate {left:auto!important;right:12px!important;}
html:root:is([data-app-layout=phone],[data-app-layout=tablet]) .app-collection-locate svg {transform:none!important;}
html:root:is([data-app-layout=phone],[data-app-layout=tablet]) #workspacePanel[data-collection-pane] .ws-record-show-map {display:none!important;}
@media(orientation:landscape) {
 html:root:is([data-app-layout=phone],[data-app-layout=tablet]) body:not(.app-collection-pane-folded) .app-collection-locate {right:calc(var(--app-viewport-width,100vw) / 2 + 8px)!important;top:calc(var(--app-safe-top,0px) + 64px);}
}
/* Geometry editing owns map actions until it is finished or cancelled. */
body:has(.app-feature-draw:not([hidden])) :is(.app-collection-back,.app-collection-locate) {display:none!important;}
html:root:is([data-app-layout=phone],[data-app-layout=tablet]) #workspacePanel .ws-record-map-actions>.ws-primary {min-height:44px!important;}
html:root:is([data-app-layout=phone],[data-app-layout=tablet]) #workspacePanel .ws-mobile-layer-header .ws-layer-quick-actions {margin-left:auto;padding:0;border:0;background:transparent;flex:0 1 auto;}
html:root:is([data-app-layout=phone],[data-app-layout=tablet]) #workspacePanel .ws-mobile-layer-header .ws-layer-quick-actions button {white-space:nowrap;padding:3px 9px;}
/* Six direct categories replace the History wrapper on touch. */
/* Individual records give their fields the space previously used by map actions. */
html:root:is([data-app-layout=phone],[data-app-layout=tablet]) #workspacePanel .ws-mobile-layer[data-record-detail=true] {
  .ws-mobile-layer-header {height:48px!important;min-height:48px!important;padding:5px 12px;}
  .ws-mobile-layer-title h3 {font-size:15px;line-height:20px;}
  .ws-mobile-layer-count {font-size:11px;line-height:15px;}
  .ws-record-history {display:flex;align-items:center;flex:none;gap:4px;}
  .ws-record-history .ws-data-history-button {display:grid;place-items:center;flex:none;box-sizing:border-box;width:44px;min-width:44px;height:44px;min-height:44px!important;padding:6px;border:0;border-radius:10px;background:transparent;color:var(--app-accent,#125769);font:20px/1 var(--font-body,sans-serif);}
  .ws-record-history .ws-data-history-button:disabled {color:var(--app-muted,#617783);opacity:.45;}
  .ws-record-history .ws-data-history-button:focus-visible {outline:2px solid var(--app-accent,#125769);outline-offset:-2px;}
  .ws-mobile-layer-count {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .ws-mobile-layer-tabs {height:44px!important;min-height:44px!important;padding:0 12px;}
  .ws-mobile-layer-tabs .ws-layer-tool {height:44px;min-height:44px!important;font-size:14px;}
  .ws-inspector-scroll[data-tool] {padding:8px 12px;}
  .ws-mobile-layer-tabs[hidden] {display:none!important;}
  .ws-record-primary {grid-template-columns:minmax(0,1fr) 56px;gap:0 8px;align-items:start;}
  .ws-record-name {grid-column:1;grid-row:1;}
  .ws-record-description {grid-column:1/-1;grid-row:2;}
  .ws-record-symbol {display:grid;place-items:center;grid-column:2;grid-row:1;box-sizing:border-box;width:56px;height:44px;min-height:44px!important;padding:0;border:0;border-radius:14px;background:transparent;}
  .ws-record-symbol :is(svg,img) {width:56px;height:44px;object-fit:contain;}
  .ws-record-primary textarea[hidden] {display:none!important;}
  .ws-record-primary .ws-record-text-value {display:block;width:100%;box-sizing:border-box;min-height:44px!important;padding:7px 4px;border:0;border-radius:8px;background:transparent;box-shadow:none;text-decoration:none;text-align:left;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--app-ink,#173b48);font:600 20px/1.25 var(--font-body,sans-serif);}
  .ws-record-description .ws-record-text-value {font:400 14px/1.4 var(--font-body,sans-serif);color:var(--app-muted,#617783);}
  .ws-record-primary .ws-record-text-value.is-empty {color:var(--app-muted,#617783);font-weight:400;}
  .ws-record-primary :is(.ws-record-text-value,.ws-record-symbol):focus-visible {outline:2px solid var(--app-accent,#2465aa);outline-offset:-2px;}
  .ws-record-primary .ws-data-record-field {display:flex!important;flex-direction:column;align-items:stretch;gap:4px;padding:0!important;}
  .ws-data-record-field :is(input,textarea,select) {min-height:44px!important;padding:8px 10px;border-radius:11px;}
  .ws-record-primary .ws-data-record-field>span {position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
  .ws-record-primary .ws-data-record-field textarea {min-height:44px!important;padding:7px 4px;border:1px solid transparent;border-radius:8px;background:transparent;resize:none;box-shadow:none;}
  .ws-record-name textarea {max-height:104px;font:600 22px/1.3 var(--font-body,sans-serif);font-size:22px!important;}
  .ws-record-description textarea {max-height:112px;color:var(--app-muted,#617783);font:400 16px/1.4 var(--font-body,sans-serif);}
  .ws-record-primary textarea::placeholder {color:var(--app-muted,#617783);opacity:.8;}
  .ws-record-primary textarea:focus {outline:2px solid var(--app-accent,#2465aa);outline-offset:-2px;background:var(--app-surface,#f4f8f9);color:var(--app-ink,#173b48);}
  .has-source-picker {position:relative;}
  .ws-record-field-source {position:absolute;right:4px;bottom:2px;min-height:44px!important;padding:6px 8px;border:0;border-radius:9px;background:var(--app-raised,#fff);color:var(--app-accent,#2465aa);font:500 12px var(--font-body,sans-serif);}
  .ws-record-field-source[hidden] {display:none!important;}
  .has-source-picker:has(.ws-record-field-source:not([hidden])) textarea {padding-right:96px;}
  .has-source-picker:has(.ws-record-field-source:not([hidden])) .ws-record-text-value {padding-right:96px;}
  .ws-record-coordinates {margin:12px 0 8px;padding:10px 0 0;}
  .ws-record-coordinates h4 {position:static;width:auto;height:auto;overflow:visible;clip-path:none;margin:0 0 6px;font-size:12px;line-height:18px;}
  .ws-data-record-coordinate-row {gap:8px;}
  .ws-data-record-coordinate-row.ws-record-coordinate-pair {display:block!important;}
  .ws-record-coordinate-box {display:flex;align-items:center;min-height:44px;border:1px solid var(--record-line,#d8e4e9);border-radius:11px;background:var(--app-raised,#fff);overflow:hidden;}
  .ws-record-coordinate-box select {box-sizing:border-box;flex:none;width:94px;min-width:0;min-height:44px!important;padding:8px 6px;border:0;border-right:1px solid var(--record-line,#d8e4e9);border-radius:0;background:transparent;color:inherit;font:500 12px var(--font-body,sans-serif);}
  .ws-record-coordinate-box input {box-sizing:border-box;flex:1;min-width:0;width:0;min-height:44px!important;padding:8px;border:0;border-radius:0;background:transparent;color:inherit;font:400 16px var(--font-body,sans-serif);}
  .ws-record-coordinate-box:focus-within {outline:2px solid var(--app-accent,#125769);outline-offset:1px;}
  .ws-record-coordinate-box :is(input,select):focus-visible {outline:none;}
  .ws-record-coordinate-error {margin:5px 0;color:var(--ui-danger,#b33648);font-size:12px;}
  .ws-record-coordinate-error[hidden] {display:none!important;}
  .ws-data-geometry-field input:disabled {opacity:1;color:var(--app-ink,#173b48);-webkit-text-fill-color:var(--app-ink,#173b48);background:var(--app-selected,#eaf3f8);}
  .ws-record-map-actions {align-items:center;flex-wrap:wrap;gap:8px;margin:8px 0;}
  .ws-record-map-actions>button {min-height:44px!important;font-size:13px;padding:8px 10px;border-radius:11px;}
  .ws-record-placement-hint {flex-basis:100%;}
  .ws-record-section>summary {min-height:44px!important;padding:10px 0;font-size:13px;}
  .ws-feature-footer button {min-height:44px!important;}
  .ws-feature-footer:not([hidden]) {display:flex!important;}
}
html:root:is([data-app-layout=phone],[data-app-layout=tablet]) #optionPanel {
 .app-source-tabs,.app-source-extra {display:none!important;}
 .feature-panel-heading {flex:none;grid-template-columns:minmax(0,1fr)!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;}
 .feature-panel-tabs {display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr));gap:1px;padding:5px 42px 5px 5px!important;min-height:44px;}
 .feature-panel-tabs>.feature-panel-tab {display:block!important;min-width:0!important;min-height:36px!important;margin:0!important;padding:4px 1px!important;font-size:11px!important;font-weight:600!important;white-space:nowrap!important;border-radius:10px!important;}
 .feature-panel-tabs>.feature-panel-tab>span {font:inherit!important;}
 .mobile-layers-heading .app-layer-close {top:6px;right:4px;width:34px!important;min-width:34px!important;height:34px!important;min-height:34px!important;padding:6px!important;}
}
/* The map reaches the screen edges; controls still respect the safe areas. */
.app-main-view-toggle {display:none;}
html:root:is([data-app-layout=phone],[data-app-layout=tablet]) {
 #mobileAppShell .app-main-view-toggle {position:fixed;display:flex;align-items:center;justify-content:center;top:calc(var(--app-safe-top) + 64px);right:max(12px,env(safe-area-inset-right));width:48px;min-width:48px;height:44px;min-height:44px;box-sizing:border-box;padding:4px;border:0;border-radius:8px;background:transparent;color:#173d5c;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;text-shadow:0 0 2px #fff,0 0 3px #fff,1px 1px 0 #fff,-1px -1px 0 #fff,1px -1px 0 #fff,-1px 1px 0 #fff;font:750 22px/1 var(--font-body,sans-serif);letter-spacing:-.8px;z-index:1850;}
 #mobileAppShell .app-main-view-toggle strong {font:inherit;}
 #mobileAppShell .app-main-view-toggle:focus-visible {outline:2px solid var(--ui-link);outline-offset:2px;}
 #mobileAppShell .app-main-view-toggle:active {transform:scale(.94);color:#1769d2;}
 #mobileAppShell .app-main-view-toggle:disabled {opacity:.45;}
 body:is(.workspace-open,.mobile-search-open,.flight-sim-active,.is-street-view-open,.hud-hidden,.guru-routing,.mobile-quick-drawing) #mobileAppShell .app-main-view-toggle,
 body[data-app-route]:not([data-app-route=map]) #mobileAppShell .app-main-view-toggle {visibility:hidden;pointer-events:none;}
 .cursor-status-bar #mainScaleBar #mapScaleInput,
 .cursor-status-bar #mainScaleBar #mapScaleInput:focus {font:400 16px/24px var(--ui-map-font)!important;height:24px!important;min-height:24px!important;min-width:0!important;letter-spacing:0!important;transform:scale(.75);transform-origin:left center;margin-inline-end:calc(var(--scale-input-width,64px) * -.25)!important;}
 .cursor-status-bar #mainScaleBar .cursor-scale-prefix {font-size:12px!important;}
 .cursor-status-bar #mainScaleBar .cursor-scale-value {display:inline-flex;align-items:center;gap:0;min-width:0;}
}
