/* V1-S1: ordinary D3/D4 panels only. Existing owners retain all state, text,
 * evidence, calculations, focus and navigation. Geometry changes are intentional.
 * G includes application high contrast for typography/targets; C excludes it
 * for palette rules. Order222 reconciles only this C-scope palette with the Universal shell.
 * Root-admitted exceptions: display:grid only for the D3 result dl; content:none
 * only removes decorative status pseudo-markers in HC/forced-colors modes.
 * Root also admits disabled-input palette and disabled control dashed-border
 * importance overrides, within C only. No HC palette is changed; ordinary enabled palette is reconciled in Order222.
 * Native computed contrast, 44px targets and reflow remain separately gated. */

body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) {
  --v1-line: #64748B;
  --v1-rule: #475569;
  --v1-control-line: #64748B;
  --v1-readout: #F8FAFC;
  --v1-hover: #EDF0F3;
  --v1-disabled: #EDF0F3;
  --v1-slate-ink: #334155;
  --v1-slate-soft: #F1F5F9;
  --v1-slate-strong: #475569;
  --v1-amber-ink: #78350F;
  --v1-amber-soft: #FEF3C7;
  --v1-amber-line: #B45309;
  --v1-emerald-ink: #065F46;
  --v1-emerald-soft: #D1FAE5;
  --v1-emerald-line: #059669;
  --v1-crimson-ink: #7F1D1D;
  --v1-crimson-soft: #FEE2E2;
  --v1-cobalt-ink: #1D4ED8;
  --v1-font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, "Noto Sans TC", monospace;
  border-color: var(--v1-line) !important;
  border-top-color: var(--v1-rule) !important;
}

body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) {
  min-width: 0;
  max-width: 100%;
  border-width: 1px;
  border-top-width: 4px;
  border-style: solid;
  border-radius: 12px;
  padding: 24px;
  overflow-wrap: anywhere;
}

body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) h3 {
  font-family: var(--font-sans);
  font-size: 20px;
  line-height: 1.35;
  font-weight: 650;
  margin: 0 0 12px;
}

body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) label {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 600;
  min-width: 0;
}

body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) .enterprise-fineprint {
  font-size: 15px;
  line-height: 1.6;
  max-width: 72ch;
}

body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) .enterprise-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 16px 20px;
}

body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) .enterprise-span-2 {
  grid-column: 1 / -1;
}

body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) .enterprise-action-row {
  gap: 12px;
}

body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) :is(input, select, textarea, button, summary) {
  min-width: 44px;
  max-width: 100%;
}

body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) :is(input, select) {
  min-height: 48px;
}

body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) select[multiple] {
  min-height: 58px;
}

body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) :is(button, summary) {
  min-height: 44px;
}

body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling) button {
  min-height: 48px;
}

body.case-first-workspace:not(.signed-focused-workspace) #enterprise-d4-canvas :is(.d4c-button, .d4c-add) {
  min-height: 44px;
  min-width: 44px;
}

body.case-first-workspace:not(.signed-focused-workspace) #enterprise-d4-canvas .d4c-cause {
  min-height: 44px;
}

body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) input:is([type="date"], [type="number"], [inputmode="numeric"], [id="d3-sampling-lot_reference"]),
body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) textarea[id="cleanpoint-lot_numbers"],
body.case-first-workspace:not(.signed-focused-workspace) #enterprise-d4-canvas .d4c-cause-id {
  font-family: var(--v1-font-mono, "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, "Noto Sans TC", monospace);
  font-variant-numeric: tabular-nums slashed-zero;
}

body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) :is(input, select, textarea, button) {
  border-color: var(--v1-control-line) !important;
}

body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) #enterprise-d4-canvas .d4c-button {
  background-color: var(--surface);
  color: var(--ink);
}

body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) #enterprise-d4-canvas .d4c-cause[aria-pressed="true"] {
  border-color: var(--v1-rule) !important;
  box-shadow: 0 0 0 1px var(--v1-rule);
}

body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) button:hover:not(:disabled) {
  background-color: var(--v1-hover) !important;
  border-color: var(--v1-control-line) !important;
  color: var(--ink) !important;
}

body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) button:disabled {
  background-color: var(--v1-disabled) !important;
  border-color: var(--v1-control-line) !important;
  color: var(--muted) !important;
  border-style: dashed;
  opacity: 1;
}

body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) :is(input, select, textarea):disabled {
  background-color: var(--v1-disabled) !important;
  border-color: var(--v1-control-line) !important;
  color: var(--muted) !important;
  border-style: dashed !important;
  opacity: 1;
}

body.case-first-workspace:not(.signed-focused-workspace) #enterprise-d3-sampling [data-d3-sampling-result] {
  margin-top: 20px;
  padding: 20px;
  border-width: 1px;
  border-style: solid;
  border-radius: 8px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) #enterprise-d3-sampling [data-d3-sampling-result] {
  background-color: var(--v1-readout);
  border-color: var(--v1-line);
}

body.case-first-workspace:not(.signed-focused-workspace) #enterprise-d3-sampling [data-d3-sampling-result] dl {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 12px 20px;
  margin: 16px 0;
}

body.case-first-workspace:not(.signed-focused-workspace) #enterprise-d3-sampling [data-d3-sampling-result] dt {
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
  min-width: 0;
}

body.case-first-workspace:not(.signed-focused-workspace) #enterprise-d3-sampling [data-d3-sampling-result] dd {
  font-family: var(--v1-font-mono, "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, "Noto Sans TC", monospace);
  font-variant-numeric: tabular-nums slashed-zero;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

body.case-first-workspace:not(.signed-focused-workspace) #enterprise-d3-sampling [data-d3-sampling-result] :is(p, ul, li) {
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

body.case-first-workspace:not(.signed-focused-workspace) #enterprise-d3-sampling [data-d3-sampling-result] ul {
  padding-inline-start: 24px;
  margin: 12px 0;
}

body.case-first-workspace:not(.signed-focused-workspace) #enterprise-d3-sampling [data-d3-sampling-result] li {
  margin-block: 8px;
}

body.case-first-workspace:not(.signed-focused-workspace) #enterprise-d3-sampling [data-d3-sampling-result] h4 {
  font-size: 16px;
  line-height: 1.45;
  font-weight: 650;
  margin: 16px 0 8px;
}

body.case-first-workspace:not(.signed-focused-workspace) #enterprise-d3-sampling [data-d3-sampling-result] > p.enterprise-fineprint {
  font-family: var(--v1-font-mono, "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, "Noto Sans TC", monospace);
  font-variant-numeric: tabular-nums slashed-zero;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body.case-first-workspace:not(.signed-focused-workspace) #enterprise-d4-canvas .d4c-status {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 650;
  padding: 6px 10px;
  gap: 8px;
  border-width: 1px;
  border-style: solid;
}

body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) #enterprise-d4-canvas .d4c-status-hypothesis {
  color: var(--v1-slate-ink);
  background-color: var(--v1-slate-soft);
  border-color: var(--v1-control-line);
  border-style: dashed;
}

body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) #enterprise-d4-canvas .d4c-status-pending {
  color: var(--v1-amber-ink);
  background-color: var(--v1-amber-soft);
  border-color: var(--v1-amber-line);
  border-style: solid;
}

body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) #enterprise-d4-canvas .d4c-status-refuted {
  color: var(--v1-slate-strong);
  background-color: var(--v1-slate-soft);
  border-color: var(--v1-control-line);
  border-style: solid;
}

body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) #enterprise-d4-canvas .d4c-status-verified {
  color: var(--v1-emerald-ink);
  background-color: var(--v1-emerald-soft);
  border-color: var(--v1-emerald-line);
  border-style: solid;
}

body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) #enterprise-d4-canvas .d4c-status::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background-color: currentColor;
}

body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) #enterprise-d4-canvas .d4c-status-hypothesis::before {
  background-color: transparent;
  border-style: dashed;
}

body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) #enterprise-d4-canvas .d4c-status-pending::before {
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) #enterprise-d4-canvas .d4c-status-refuted::before {
  border-radius: 0;
}

body.case-first-workspace:not(.signed-focused-workspace).auto8d-high-contrast #enterprise-d4-canvas .d4c-status::before {
  content: none;
}

@media (forced-colors: active) {
  body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) #enterprise-d4-canvas .d4c-status::before {
    content: none;
  }
}

html:lang(zh-Hant) body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas),
body.case-first-workspace:not(.signed-focused-workspace).lang-zh :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) {
  line-height: 1.75;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  font-style: normal;
  line-break: strict;
}

html:lang(zh-Hant) body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) label,
body.case-first-workspace:not(.signed-focused-workspace).lang-zh :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) label {
  font-size: 16px;
  line-height: 1.75;
  font-weight: 500;
}

html:lang(zh-Hant) body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) :is(h3, .d4c-status),
body.case-first-workspace:not(.signed-focused-workspace).lang-zh :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) :is(h3, .d4c-status) {
  line-height: 1.75;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  font-style: normal;
}

html:lang(zh-Hant) body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) .enterprise-fineprint,
body.case-first-workspace:not(.signed-focused-workspace).lang-zh :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) .enterprise-fineprint {
  line-height: 1.75;
  font-weight: 500;
}

html:lang(zh-Hant) body.case-first-workspace:not(.signed-focused-workspace) #enterprise-d3-sampling [data-d3-sampling-result] :is(p, dt, ul, li),
body.case-first-workspace:not(.signed-focused-workspace).lang-zh #enterprise-d3-sampling [data-d3-sampling-result] :is(p, dt, ul, li) {
  line-height: 1.75;
  font-weight: 500;
}

html:lang(zh-Hant) body.case-first-workspace:not(.signed-focused-workspace) #enterprise-d3-sampling [data-d3-sampling-result] :is(dd, h4),
body.case-first-workspace:not(.signed-focused-workspace).lang-zh #enterprise-d3-sampling [data-d3-sampling-result] :is(dd, h4) {
  line-height: 1.75;
  font-weight: 700;
}

@media (max-width: 650px) {
  body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) {
    padding: 16px;
  }
}

@media (max-width: 760px) {
  body.case-first-workspace:not(.signed-focused-workspace) #enterprise-d3-sampling [data-d3-sampling-result] dl {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Explicit zh control leaves override existing font shorthands; inheritance
 * alone cannot change a control's 400/600 weight or 1.4/1.5 line height. */
html:lang(zh-Hant) body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) :is(input, select, textarea),
body.case-first-workspace:not(.signed-focused-workspace).lang-zh :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) :is(input, select, textarea) {
  font-weight: 500;
  line-height: 1.75;
}

html:lang(zh-Hant) body.case-first-workspace:not(.signed-focused-workspace) :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) :is(button, summary),
body.case-first-workspace:not(.signed-focused-workspace).lang-zh :is(#enterprise-cleanpoint, #enterprise-d3-sampling, #enterprise-d4-canvas) :is(button, summary) {
  font-weight: 700;
  line-height: 1.75;
}

/* The old secondary-button border shorthand is important. This exception is
 * disabled-only and limited to the two D3 panels; D4 needs no such override. */
body.case-first-workspace:not(.signed-focused-workspace):not(.auto8d-high-contrast) :is(#enterprise-cleanpoint, #enterprise-d3-sampling) button:disabled {
  border-style: dashed !important;
}
