/* One look for controls across the app, admin portal and website.
   Everything here has zero specificity (:where), so a control that is deliberately styled keeps its own look;
   what it fixes is every control that was left unstyled, plus the shared sizes (tokens) new work should use. */
:root{
  --zui-h:44px;          /* height of a normal button, dropdown, input and search box */
  --zui-h-sm:36px;       /* compact (tables, toolbars) */
  --zui-radius:12px;
  --zui-gap:8px;         /* space between neighbouring buttons and fields */
  --zui-pad-x:14px;
  --zui-font:14px;
  --zui-line:#cbd5e1;
  --zui-bg:#fff;
  --zui-text:#0f172a;
  --zui-focus:#0372c0;
}
:root[data-theme="dark"],.dark{--zui-line:#334155;--zui-bg:#0f172a;--zui-text:#e2e8f0;--zui-focus:#7cc4ff}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]):not(.light){--zui-line:#334155;--zui-bg:#0f172a;--zui-text:#e2e8f0;--zui-focus:#7cc4ff}}

/* Controls nobody styled: same height, corners, padding and focus ring everywhere. */
:where(button:not([class]):not([id]):not([style]),select:not([class]):not([id]):not([style]),textarea:not([class]):not([id]):not([style]),
  input:not([class]):not([id]):not([style]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]):not([type=file]):not([type=color])){
  box-sizing:border-box;min-height:var(--zui-h);padding:0 var(--zui-pad-x);border:1px solid var(--zui-line);border-radius:var(--zui-radius);
  background:var(--zui-bg);color:var(--zui-text);font:inherit;font-size:max(var(--zui-font),16px);line-height:1.3;
}
:where(textarea:not([class]):not([id]):not([style])){padding:10px var(--zui-pad-x);min-height:calc(var(--zui-h) * 2)}
:where(button:not([class]):not([id]):not([style])){cursor:pointer;font-size:var(--zui-font);font-weight:600}
:where(button,select,input,textarea):focus-visible{outline:2px solid var(--zui-focus);outline-offset:2px}

/* Neighbouring buttons and fields never touch. zuno-ui.js measures the page and marks controls that sit closer than a few pixels. */
[data-zui-gap="x"]{margin-inline-start:var(--zui-gap) !important}
[data-zui-gap="y"]{margin-top:var(--zui-gap) !important}

/* ---- Same size, corners and focus on the controls that ARE styled (Tailwind fields/buttons in the app, btn-*/field-input in the admin portal).
   Colours are left alone; only height, corner radius and padding are brought onto the shared tokens. ---- */
:is(input,select,textarea).border.rounded-md:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden]),
:is(input,select).field-input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]),
select.zrf-sel,input.mn-input{
  box-sizing:border-box;min-height:var(--zui-h);border-radius:var(--zui-radius);padding-inline:var(--zui-pad-x);
}
select.border.rounded-md,select.field-input{padding-block:0}
textarea.border.rounded-md,textarea.field-input{border-radius:var(--zui-radius);padding:10px var(--zui-pad-x)}
button.rounded-lg.font-semibold,button.btn-primary,button.btn-secondary,a.btn-primary,a.btn-secondary{
  border-radius:var(--zui-radius);min-height:var(--zui-h);
}
button.btn-small{border-radius:var(--zui-radius);min-height:var(--zui-h-sm)}
button.btn-primary,button.btn-secondary,button.btn-small{display:inline-flex;align-items:center;justify-content:center;gap:6px}
@media (max-width:640px){button.btn-primary,button.btn-secondary{min-height:48px}}

/* Standard icon weight, app and website. Outline icons on the 24 grid all follow one setting. Change --zuno-icon-stroke to change every icon. */
:root{--zuno-icon-stroke:1.8}
svg[viewBox="0 0 24 24"][stroke="currentColor"]:not(.zuno-icon){stroke-width:var(--zuno-icon-stroke,1.8);stroke-linecap:round;stroke-linejoin:round}
