/* Global AMMO form scale. Loaded after page styles to keep controls consistent. */
:root{--ammo-field-font-size:13px;--ammo-field-height:34px;--ammo-field-padding:6px 10px}
body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]):not([type=submit]):not([type=button]):not([type=reset]),body select,body textarea{font-size:var(--ammo-field-font-size);font-weight:400;line-height:1.4;padding:var(--ammo-field-padding);max-width:100%}
body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]):not([type=submit]):not([type=button]):not([type=reset]),body select{height:var(--ammo-field-height);min-height:var(--ammo-field-height)}
body input[name=name],body input[name=first_name],body input[name=last_name]{width:100%;max-width:min(100%,360px)!important}
body textarea{min-height:96px}
@media(pointer:coarse){:root{--ammo-field-font-size:16px;--ammo-field-height:40px}main h4{font-size:max(1rem,16px)}}

/* Search uses the labelled action icon, not Pico's background magnifier. */
body input[type=search]{background-image:none!important;border-radius:6px!important}
body .toolbar form[role=search]{align-items:center;gap:8px}
body .toolbar input,body .toolbar select,body .toolbar button,body .toolbar label{margin-block:0}
body .toolbar button{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:var(--ammo-field-height);min-height:var(--ammo-field-height);padding:6px 10px;font-size:13px;line-height:1.4;white-space:nowrap}
body .toolbar button svg{width:16px;height:16px;display:block}
body .toolbar button [hidden]{display:none}
body .poll-controls,body .poll-interval{align-items:center}

/* AMMO destructive actions use the solid brand red in both themes. */
:root{--danger-action-fill:#ef3340;--danger-action-ink:#160306}
body button.danger,body .button.danger,body .delete-control button:enabled{background:var(--danger-action-fill)!important;color:var(--danger-action-ink)!important;border-color:var(--danger-action-fill)!important}
body .delete-control{border-radius:var(--button-radius)}
body .delete-control input[role=switch]:checked{background-color:var(--danger-action-fill);border-color:var(--danger-action-fill);--pico-switch-checked-background-color:var(--danger-action-fill)}

body .delete-control button:enabled{color:#fff!important}

/* Shared form rhythm: one width for ordinary fields, compact feedback. */
:root{--ammo-field-width:360px;--ammo-field-gap:16px}
body main input:not([type]),body main input[type=text],body main input[type=email],body main input[type=password],body main input[type=url],body main input[type=tel],body main textarea[name=description]{width:100%;max-width:min(100%,var(--ammo-field-width));margin-bottom:var(--ammo-field-gap)}
body main label{margin-bottom:6px}
body main textarea[name=description]{min-height:64px}
body .settings-name-form,body .settings-description-form{max-width:var(--ammo-field-width);margin-bottom:var(--ammo-field-gap)}
body [data-autosave] input,body [data-autosave] textarea{margin-bottom:0}
body .save-feedback{min-height:0;margin-top:4px;font-size:.75rem}
body .save-feedback:has([data-save-status]:empty):has([data-save-retry][hidden]){display:none}
body .settings-resource-groups{grid-template-columns:repeat(2,minmax(0,var(--ammo-field-width)));gap:24px;margin-top:20px}
body .settings-resources .resource-settings-link{display:block;margin-top:6px}
@media(max-width:800px){body .settings-resource-groups{grid-template-columns:minmax(0,1fr);gap:20px}}

:root,[data-theme=light]{--ammo-field-border:#9ba9be}
[data-theme=dark]{--ammo-field-border:#364154}
body input,body textarea,body select{--pico-form-element-border-color:var(--ammo-field-border)}

body a.connection-button{display:inline-flex;align-items:center;gap:6px;flex:none;width:max-content;max-width:100%;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.4;border-radius:var(--button-radius);font-weight:500;text-decoration:none}
body .settings-resources a.connection-button{display:inline-flex;margin-top:8px}
body a.connection-button svg{width:16px;height:16px;color:var(--blue)}
@media(pointer:coarse){body a.connection-button{min-height:44px}}

body .search-field{position:relative;display:block;flex:1;min-width:0}
body .search-field input[type=search]{width:100%;padding-right:36px;margin:0}
body .search-field>svg{position:absolute;right:11px;top:50%;transform:translateY(-50%);width:16px;height:16px;color:var(--muted);pointer-events:none}
body .search-field input::-webkit-search-cancel-button{display:none}
