/* ═══════════════════════════════════════════════════════════════════
   OVERRIDES: neutralise inline style="" in js/app.js templates (stylesheet !important beats inline).
   Scoped to #cnt (page content) and .mo-bx (dialogs) only. Replaces the old MutationObserver "normFields".
   Every rule here can go away once the app.js templates are cleaned up (Wave 3 list in the Wave 2 report).
   ═══════════════════════════════════════════════════════════════════ */

/* 1. fonts: one font stack, no monospace / Segoe UI / Arial from templates */
#cnt [style*="font-family"], .mo-bx [style*="font-family"], #cnt .mono, .mo-bx .mono { font-family: var(--ft) !important; }
#cnt [style*="monospace"], .mo-bx [style*="monospace"] { font-variant-numeric: tabular-nums; }

/* 2. weights: Odoo uses 500 for emphasis, 700 only for totals */
#cnt [style*="font-weight:600"], #cnt [style*="font-weight:700"], .mo-bx [style*="font-weight:600"], .mo-bx [style*="font-weight:700"],
#cnt [style*="font-weight: 600"], #cnt [style*="font-weight: 700"] { font-weight: 500 !important; }
#cnt [style*="font-weight:800"], .mo-bx [style*="font-weight:800"], #cnt [style*="font-weight: 800"] { font-weight: 700 !important; }
#cnt [style*="letter-spacing"], .mo-bx [style*="letter-spacing"] { letter-spacing: 0 !important; }

/* 3. hairlines are 1px (templates use 1.5px / 2px) */
#cnt [style*="1.5px"], .mo-bx [style*="1.5px"] { border-width: 1px !important; }

/* 4. boxed inline-styled fields -> Odoo flat fields (was normFields in shell.js) */
#cnt input[style*="border"]:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]):not([placeholder*="earch"]):not(.iet *, .bom-t *, .pm-table *, .osb-wrap *),
#cnt select[style*="border"]:not(.tag),
#cnt textarea[style*="border"],
.mo-bx input[style*="border"]:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]),
.mo-bx select[style*="border"]:not(.tag),
.mo-bx textarea[style*="border"],
#login-screen input[style*="border"] {
  border: 0 !important; border-bottom: 1px solid var(--o-border-input) !important; border-radius: 0 !important; background-color: transparent !important; box-shadow: none; padding-left: 0 !important; padding-right: 0 !important; }
#cnt select[style*="border"]:not(.tag), .mo-bx select[style*="border"]:not(.tag) { padding-right: 20px !important; }
#cnt input[style*="border"]:focus, #cnt select[style*="border"]:focus, #cnt textarea[style*="border"]:focus,
.mo-bx input[style*="border"]:focus, .mo-bx select[style*="border"]:focus, .mo-bx textarea[style*="border"]:focus { border-bottom-color: var(--o-action) !important; box-shadow: 0 1px 0 0 var(--o-action) !important; }
/* select in a flex row without an explicit width: size to content (was normFields) */
#cnt :is(.flex, .act-btns, [style*="display:flex"]) > select:not([style*="width"]):not([style*="flex"]):not(.tag),
.mo-bx :is(.flex, .act-btns, [style*="display:flex"]) > select:not([style*="width"]):not([style*="flex"]):not(.tag) { width: auto; min-width: 130px; }

/* 5. search inputs in page toolbars = Odoo search box (396 x 36.5, pill) */
#cnt input[placeholder*="earch"]:not(.iet *, .bom-t *, .pm-table *, .osb-wrap *) {
  width: min(396px, 100%) !important; max-width: 100%; min-height: 36.5px; padding: 4px 16px !important; font-size: 14px !important; line-height: 21px;
  background-color: var(--o-surface) !important; border: 1px solid var(--o-border-btn) !important; border-radius: 800px !important;
  background-image: none; flex: 0 1 396px !important; }
#cnt .mod-search input[placeholder*="earch"] { padding-left: 36px !important; }
#cnt input[placeholder*="earch"]:focus { border-color: #68A9AF !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--o-action) 35%, transparent) !important; }

/* 6. top toolbar rows in pages (search + filter buttons + counts) sit on the page like a control-panel row */
#cnt .fin > .flex.ic.g2.mb3:first-child, #cnt .fin > .flex.ic.jb.mb3:first-child { margin-bottom: 16px; }
#cnt .fin > .flex.ic.g2.mb3 .sm { height: 32.3px; }

/* 7. inline-styled card-like blocks keep the Odoo corner radius */
#cnt [style*="border-radius:var(--r2)"], #cnt [style*="border-radius:var(--ui-r2)"], #cnt [style*="border-radius:10px"], #cnt [style*="border-radius:12px"] { border-radius: var(--r3) !important; }
#cnt [style*="border-radius:var(--r)"], #cnt [style*="border-radius:5px"], #cnt [style*="border-radius:6px"], #cnt [style*="border-radius:7px"] { border-radius: var(--r) !important; }
#cnt [style*="box-shadow"]:not(.o-app-ico):not(kbd):not(.osb-wrap) { box-shadow: none !important; }

/* 9. wizard / form containers that were inline-padded cards */
#cnt .step-content { animation: fadeIn .18s var(--ease-out) both; }

/* 10. phones: 16px fields so iOS does not zoom on focus (beats inline font-size) */
@media (max-width: 767.98px) {
  #cnt input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]), #cnt select, #cnt textarea,
  .mo-bx input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]), .mo-bx select, .mo-bx textarea,
  .osb-wrap input, #osearchInput, #cmd-input, #o-home-q, #login-pin, #note-text { font-size: 16px !important; }
}

/* 11. touch screens and phones: search boxes and status pills reach the 40px minimum too (QA 4 Q4-19) */
@media (pointer: coarse), (max-width: 768px) {
  #cnt input[placeholder*="earch"]:not(.iet *, .bom-t *, .pm-table *, .osb-wrap *) { min-height: 40px; }
  #cnt select.tag { min-height: 40px; }
}
