/* Shared control finishes. Page composition, copy, handlers and Plan gestures
   stay in their existing components. Tokens are also consumed by lazy CSS. */
:root {
  --ec-control-primary:#294d3f;
  --ec-control-primary-hover:#203e34;
  --ec-control-primary-pressed:#19372c;
  --ec-control-on-primary:#fff;
  --ec-control-secondary:#fff;
  --ec-control-secondary-hover:#f5f6f6;
  --ec-control-field-border:#89968f;
  --ec-control-field-background:#fff;
  --ec-control-text:#294d3f;
  --ec-control-error:#ab352b;
  --ec-control-placeholder:#617267;
  --ec-control-focus:#294d3f;
  --ec-control-radius:8px;
  --ec-control-accent:#294d3f;
  --ec-control-accent-soft:#edf4ee;
  --ec-control-blue:var(--ec-control-accent);
  --ec-control-blue-hover:var(--ec-control-accent-soft);
  --ec-control-texture:linear-gradient(180deg,#ffffff18,#ffffff00 65%,#0d25190a);
  --ec-control-shadow:inset 0 1px 0 #ffffff38,0 2px 3px #153a2314;
  --ec-control-shadow-hover:inset 0 1px 0 #ffffff48,0 3px 8px #153a2320;
  --ec-control-shadow-pressed:inset 0 1px 3px #102c2326;
  --ec-control-font-family:var(--ec-brand-font,Inter,ui-sans-serif,system-ui,sans-serif);
  --ec-surface-paper:#fff;
  --ec-surface-border:#dbe1de;
  --ec-surface-radius:12px;
  --ec-surface-shadow:0 2px 12px #203c2e06;
  --ec-surface-shadow-hover:0 5px 18px #203c2e0d;
  --ec-space-tight:8px;
  --ec-space-content-gap:12px;
  --ec-space-control-block:12px;
  --ec-space-control-inline:16px;
  --ec-space-section-gap:24px;
  --ec-space-page-gap:32px;
  --ec-control-disabled-opacity:.62;
  --ec-control-duration:120ms;
  --ec-control-font-size:14px;
  --ec-control-font-size-compact:13px;
  --ec-control-font-size-prominent:16px;
  --ec-control-field-font-size:16px;
  --ec-control-font-weight:600;
  --ec-control-line-height:1.35;
  --ec-control-min-height:44px;
}
/* Theme tokens are restricted to the app: public marketing keeps its approved
   light surface even when the signed-in app preference is dark. */
html[data-ec-theme=dark] :is(.cc-app,.office-app,.office-entry,.office-workspace,.pk205-panel) {
  --ec-control-secondary:#213a2c;
  --ec-control-secondary-hover:#2b4936;
  --ec-control-field-border:#6b8576;
  --ec-control-placeholder:#b7c7bd;
  --ec-control-focus:#b9dfc3;
  --ec-control-field-background:#101b17;
  --ec-control-text:#f0f5f1;
  --ec-control-error:#e28e87;
  --ec-control-accent:#b9dfc3;
  --ec-control-blue:var(--ec-control-accent);
  --ec-control-accent-soft:#263f30;
  --ec-control-blue-hover:var(--ec-control-accent-soft);
  --ec-control-shadow:inset 0 1px 0 #ffffff24,0 2px 4px #0003;
  --ec-control-shadow-hover:inset 0 1px 0 #ffffff35,0 3px 9px #0004;
  --ec-surface-paper:#172820;
  --ec-surface-border:#425c4e;
  --ec-surface-shadow:none;
  --ec-surface-shadow-hover:none;
}
/* Interaction only on named standard actions; no canvas, transform handle,
   slider, colour swatch, drawing pointer or object-drag target is reset. */
html body :is(.ec-button,.cc-button,.office-button,.ec-a216-button,.ep-button,.ec-offers202-select,.ec-professional-access-primary) {
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation;
  user-select:none;
  -webkit-user-select:none;
  box-sizing:border-box;
  min-height:var(--ec-control-min-height);
  font-family:var(--ec-control-font-family);
  transition:background-color var(--ec-control-duration) ease-out,border-color var(--ec-control-duration) ease-out,color var(--ec-control-duration) ease-out;
}
html body :is(.ec-button,.cc-button,.office-button,.ec-a216-button,.ep-button,.ec-offers202-select,.ec-professional-access-primary):is(:disabled,[aria-disabled=true]) {
  cursor:not-allowed;
  opacity:var(--ec-control-disabled-opacity);
}
html body :is(.ec-button,.cc-button,.office-button,.ec-a216-button,.ep-button,.ec-offers202-select,.ec-professional-access-primary)[aria-busy=true],
html body [aria-busy=true] :is(.cc-button,.office-button):disabled {cursor:wait}
html body :is(.ec-site,.cc-app,.office-app,.office-entry,.admin-shell,.admin-login,.ec-a216-shell) :is(button,a,input,select,textarea,summary):not(.ec258-btn):focus-visible,
html body :is(.ep-button,.ep-public-footer a,.tuto-tool input,.tuto-tool button,.ep-article-search input,.ep-article-search select):focus-visible {
  outline:2px solid var(--ec-control-focus);
  outline-offset:3px;
}
/* Errors follow explicit application validation, not :invalid on empty forms. */
html body :is(.cc-field,.office-form,.office-field,.office-entry-card,.ec-design203,.admin-login,.admin-shell) :is(input,select,textarea)[aria-invalid=true] {
  border-color:var(--ec-control-error);
  outline-color:var(--ec-control-error);
}
html[data-ec-theme=dark] body :is(.cc-app,.office-app,.office-entry,.office-workspace) :is(input,select,textarea)[aria-invalid=true] {
  border-color:var(--ec-control-error);
  outline-color:var(--ec-control-error);
}
html body :is(.cc-field,.office-form,.office-field,.office-entry-card,.admin-login,.admin-shell) :is(input,textarea)::placeholder {
  color:var(--ec-control-placeholder);opacity:1;
}
/* Existing footer grids and links are retained; only the link finish changes. */
:is(.ec-footer nav,.ep-public-footer,.cc-app-footer,.office-footer) a {
  text-decoration-thickness:1px;
  text-underline-offset:.25em;
}
@media(hover:hover) and (pointer:fine) {
  :is(.ec-footer nav,.ep-public-footer,.cc-app-footer,.office-footer) a:hover {text-decoration:underline}
}
@media(pointer:coarse), (max-width:700px) {
  html body :is(.cc-field,.office-form,.office-field,.office-entry-card,.ec-design203,.ec-lead-form,.admin-shell,.admin-login,.tuto-tool,.ep-article-search,.mw-field,.mp-search,.mp244-search,.mp-request-form,.ma203-form,.ma203-filters) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]),select,textarea) {font-size:var(--ec-control-field-font-size)}
}
@media(prefers-reduced-motion:reduce) {
  html body :is(.ec-button,.cc-button,.office-button,.ec-a216-button,.ep-button,.ec-offers202-select,.ec-professional-access-primary) {transition:none;transform:none}
}
@media(forced-colors:active) {
  html body :is(.ec-button,.cc-button,.office-button,.ec-a216-button,.ep-button,.ec-offers202-select,.ec-professional-access-primary) {
    forced-color-adjust:auto;
    border-color:ButtonText;
    box-shadow:none;
  }
  html body :is(button,a,input,select,textarea,summary):not(.ec258-btn):focus-visible {outline-color:Highlight}
}
