/* Workbench palette unification for engineering.html.
   The generic service-page skin (service-home-ux.css:90-105, specificity 0,3,2) repaints the
   workbench's panels #1f1f1f with #565656 borders and #999 text, and ~15 legacy component
   families keep their own greens. This layer gives them the hub's graphite surfaces, readable
   text and WCAG 1.4.11 control borders. It changes colour, borders and type only, never layout.
   Root selector (0,4,1): body.tt-home-aligned.tt-service-page.tt-engineering */
body.tt-engineering {
  --wb-bg: #0a0c0f;
  --wb-s1: #111419;
  --wb-s2: #151a20;
  --wb-s3: #1b2128;
  --wb-line: rgba(220, 235, 245, 0.1);
  --wb-line-2: rgba(220, 235, 245, 0.16);
  --wb-control: #6a7482;          /* >= 3:1 against every workbench surface */
  --wb-control-hover: #8b97a4;
  --wb-text: #e8edf1;
  --wb-text-2: #b6c0c9;
  --wb-text-3: #8f9ba7;
  --wb-accent: #34e39d;
  --wb-link: #5fd4ff;
  color-scheme: dark;              /* native selects, scrollbars and spinners render dark */
}

/* Panels and cards */
body.tt-home-aligned.tt-service-page.tt-engineering :is(.eng-panel, .eng-tool-grid article, .eng-dash-card, .eng-dash-sidebar, .eng-dash-main, .eng-dash-intro, .eng-dash-stats > div) {
  background: var(--wb-s1);
  border-color: var(--wb-line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 32px -18px rgba(0, 0, 0, 0.7);
}
body.tt-home-aligned.tt-service-page.tt-engineering .eng-dash-card:hover { border-color: rgba(52, 227, 157, 0.4); background: var(--wb-s2); }
body.tt-home-aligned.tt-service-page.tt-engineering .eng-notice {
  background: rgba(245, 200, 75, 0.06);
  border-color: rgba(245, 200, 75, 0.24);
}
body.tt-home-aligned.tt-service-page.tt-engineering :is(.eng-panel, .eng-notice, .eng-head) :is(p, li) { color: var(--wb-text-2); }
body.tt-home-aligned.tt-service-page.tt-engineering :is(.eng-panel, .eng-head) :is(h2, h3, h4, strong) { color: var(--wb-text); }

/* Legacy component families that kept their own greens */
body.tt-home-aligned.tt-service-page.tt-engineering :is(.eng-modeling-dock, .eng-proc-graph, .eng-dag-map, .eng-fab-checks, .eng-sim-kpis > *, .eng-sim-plot-wrap, .eng-sim-limitations, .eng-cad-specs > *, .eng-cad-source-details, .eng-circuit-fab-bridge, .eng-fab-plan-grid > div, .eng-fab-credit, .eng-fab-choice, .eng-fab-parametric) {
  background: var(--wb-s2);
  border-color: var(--wb-line);
  color: var(--wb-text);
}
body.tt-home-aligned.tt-service-page.tt-engineering :is(.eng-proc-node, .eng-dag-node) { background: var(--wb-s3); border-color: var(--wb-line-2); color: var(--wb-text); }
body.tt-home-aligned.tt-service-page.tt-engineering :is(.eng-fab-checks pre, #eng-brep-status, .eng-code) { background: #0d1014; border-color: var(--wb-line); color: var(--wb-text-2); }
body.tt-home-aligned.tt-service-page.tt-engineering :is(.eng-sim-kpis, .eng-cad-specs) :is(span, small, dt) { color: var(--wb-text-3); }
body.tt-home-aligned.tt-service-page.tt-engineering :is(.eng-sim-kpis, .eng-cad-specs) :is(strong, b, dd) { color: var(--wb-text); }
body.tt-home-aligned.tt-service-page.tt-engineering .eng-sim-limitations :is(li, p, summary) { color: var(--wb-text-2); }
/* 35 modeling buttons fell back to Arial */
body.tt-home-aligned.tt-service-page.tt-engineering .eng-modeling-dock :is(button, select, input, label) { font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; }
body.tt-home-aligned.tt-service-page.tt-engineering .eng-modeling-dock button {
  background: var(--wb-s3); border-color: var(--wb-line-2); color: var(--wb-text);
}
body.tt-home-aligned.tt-service-page.tt-engineering .eng-modeling-dock button:hover { border-color: var(--wb-control-hover); background: #222a32; }
body.tt-home-aligned.tt-service-page.tt-engineering .eng-modeling-dock button[aria-pressed="true"] { border-color: var(--wb-accent); color: #d8fbe9; background: rgba(52, 227, 157, 0.12); }

/* Form controls: visible boundaries (WCAG 1.4.11) */
body.tt-home-aligned.tt-service-page.tt-engineering #eng-dashboard :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]), select, textarea) {
  border-color: var(--wb-control);
  background: #0d1014;
}
body.tt-home-aligned.tt-service-page.tt-engineering #eng-dashboard :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]), select, textarea):hover { border-color: var(--wb-control-hover); }
body.tt-home-aligned.tt-service-page.tt-engineering #eng-dashboard :is(input, select, textarea):focus-visible { border-color: #38d3ff; }
body.tt-home-aligned.tt-service-page.tt-engineering #eng-dashboard .tt-svc-button:not(.primary) { border-color: #5c6873; }
body.tt-home-aligned.tt-service-page.tt-engineering #eng-dashboard .tt-svc-button:not(.primary):hover { border-color: var(--wb-control-hover); }

/* Links that were left as browser defaults (e.g. JupyterLite, 1.87:1) */
body.tt-home-aligned.tt-service-page.tt-engineering #eng-dashboard :is(p, li, small, .eng-fine) a:not(.tt-svc-button) { color: var(--wb-link); text-underline-offset: 3px; }

/* The site's fixed menu button sits over the sticky stepper below 1100 px (top-right),
   and top-left from 700 px down. Keep the stage buttons clear of it. */
@media (max-width: 1099px) {
  body.tt-home-aligned.tt-service-page.tt-engineering .eng-pipeline-stage-nav { padding-right: 78px; }
}
@media (max-width: 700px) {
  body.tt-home-aligned.tt-service-page.tt-engineering .eng-pipeline-stage-nav { padding-right: 5px; padding-left: 78px; }
  /* iOS zooms into fields smaller than 16 px */
  body.tt-home-aligned.tt-service-page.tt-engineering #eng-dashboard :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea),
  body.tt-engineering .cd :is(input[type="number"], select) { font-size: 16px; }
}
@media (pointer: coarse) {
  body.tt-home-aligned.tt-service-page.tt-engineering #eng-dashboard :is(.tt-svc-button, .eng-modeling-dock button, .eng-pipeline-stage-nav button) { min-height: 44px; }
}

/* Skip link */
.eng-skip {
  position: absolute; left: 12px; top: -80px; z-index: 5000;
  padding: 10px 16px; border-radius: 10px; background: #eaf1f4; color: #0a0f13; font: 600 15px Inter, system-ui, sans-serif; text-decoration: none;
}
.eng-skip:focus { top: 12px; }

/* Smooth in-page scrolling (isp-shop-pages.css) must respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
}

/* Co-design controls out-rank the page-wide accent-color and label rules */
body.tt-engineering .cd .cd-disc .cd-field input[type="range"] { accent-color: var(--accent); }
body.tt-engineering .cd .cd-field .cd-field__label { color: var(--cd-ink-2); font-size: 13px; font-weight: 600; }
body.tt-engineering .cd :is(.cd-num, .cd-field select) { border-color: var(--wb-control); }
body.tt-engineering .cd :is(.cd-num, .cd-field select):hover { border-color: var(--wb-control-hover); }
