/* Professional calculation pages share the same restrained institutional
   palette. Models are distinguished by content, not competing theme colors. */
body[data-tool="density"],
body[data-tool="water"],
body[data-tool="carbon"],
html[data-theme="dark"] body[data-tool="density"],
html[data-theme="dark"] body[data-tool="water"],
html[data-theme="dark"] body[data-tool="carbon"] {
  --workbench-accent: var(--ref-lime, #b7cb8a);
  --workbench-accent-strong: var(--ref-green-deep, #647a66);
  --workbench-accent-soft: var(--ref-green-soft, #edf2e8);
}

body[data-tool] {
  --workbench-max: 1320px;
  --workbench-ease: cubic-bezier(.16, 1, .3, 1);
  --inner-paper: var(--ref-paper, #f7f6f1);
  --inner-paper-2: #f0f2eb;
  --inner-surface: var(--ref-surface, #fffefa);
  --inner-ink: var(--ref-ink, #26352f);
  --inner-ink-2: var(--ref-green-deep, #647a66);
  --inner-muted: var(--ref-text, #495650);
  --inner-faint: var(--ref-muted, #748079);
  --inner-line: var(--ref-line, #dcded6);
  --inner-line-strong: var(--ref-line-strong, #bcc4ba);
  overflow-x: clip;
  color: var(--inner-ink);
  background: var(--inner-paper);
}

body[data-tool] main {
  min-height: 70vh;
  background: var(--inner-paper);
}

.workbench-container {
  width: min(calc(100% - 64px), var(--workbench-max));
  margin-inline: auto;
}

/* Page introduction: compact, useful, and free of decorative hero imagery. */
body[data-tool] .tool-hero {
  position: relative;
  min-height: 0;
  padding: 34px 0 32px;
  overflow: hidden;
  border-bottom: 1px solid var(--inner-line-strong);
  background: var(--inner-surface);
}

body[data-tool] .tool-hero::before {
  display: none;
}

body[data-tool] .tool-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  align-items: center;
  gap: clamp(42px, 6vw, 78px);
}

.workbench-heading {
  max-width: 720px;
}

.workbench-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--inner-faint);
  font-size: 14px;
}

.workbench-breadcrumb a {
  color: var(--inner-muted);
  transition: color 180ms ease;
}

.workbench-breadcrumb a:hover,
.workbench-breadcrumb a:focus-visible {
  color: var(--workbench-accent-strong);
}

.workbench-breadcrumb span[aria-hidden="true"] {
  color: var(--inner-line-strong);
}

body[data-tool] .tool-hero .eyebrow {
  margin: 0 0 12px;
  color: var(--workbench-accent-strong);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: .13em;
  text-transform: uppercase;
}

body[data-tool] .tool-hero h1 {
  max-width: 720px;
  margin: 0;
  color: var(--inner-ink);
  font-size: clamp(36px, 3.7vw, 48px);
  font-weight: 660;
  letter-spacing: -.048em;
  line-height: 1.08;
  text-wrap: balance;
}

.workbench-lead {
  max-width: 650px;
  margin: 16px 0 0;
  color: var(--inner-muted);
  font-size: 15px;
  line-height: 1.75;
}

.model-board {
  position: relative;
  align-self: center;
  min-height: 0;
  padding: 22px 24px;
  border: 1px solid var(--inner-line);
  border-top: 3px solid var(--workbench-accent);
  background: var(--workbench-accent-soft);
}

.model-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--inner-line-strong);
}

.model-board-head span,
.model-board-head b {
  color: var(--inner-muted);
  font-size: 12px;
  font-weight: 680;
  letter-spacing: .08em;
}

.model-board-head b {
  color: var(--workbench-accent-strong);
  font-variant-numeric: tabular-nums;
}

.model-formula {
  display: flex;
  min-height: 80px;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--inner-line);
  color: var(--inner-ink);
  font-family: Georgia, "Times New Roman", serif;
}

.model-formula strong {
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 500;
  font-style: italic;
  line-height: 1;
}

.model-formula i {
  color: var(--workbench-accent-strong);
  font-size: 21px;
  font-style: normal;
}

.model-formula span {
  font-size: clamp(19px, 2.2vw, 26px);
  line-height: 1.3;
}

.model-board dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
}

.model-board dl > div {
  padding: 13px 12px 0 0;
}

.model-board dt {
  margin-bottom: 3px;
  color: var(--workbench-accent-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
}

.model-board dd {
  margin: 0;
  color: var(--inner-muted);
  font-size: 14px;
  line-height: 1.45;
}

.privacy-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 17px 0 0;
  color: var(--inner-muted);
  font-size: 14px;
}

.privacy-line::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--workbench-accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--workbench-accent) 13%, transparent);
  content: "";
}

/* Local tool navigation. */
body[data-tool] .tool-nav {
  position: sticky;
  z-index: 45;
  top: var(--site-header-height, 76px);
  border-bottom: 1px solid var(--inner-line);
  background: color-mix(in srgb, var(--inner-surface) 95%, transparent);
  backdrop-filter: blur(16px) saturate(130%);
}

body[data-tool] .tool-nav-inner {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 29px;
  overflow-x: auto;
  scrollbar-width: none;
}

body[data-tool] .tool-nav-inner::-webkit-scrollbar {
  display: none;
}

body[data-tool] .tool-nav-inner a {
  position: relative;
  display: inline-flex;
  min-height: 52px;
  flex: 0 0 auto;
  align-items: center;
  color: var(--inner-muted);
  font-size: 14px;
  font-weight: 590;
  transition: color 180ms ease;
}

body[data-tool] .tool-nav-inner a:hover,
body[data-tool] .tool-nav-inner a:focus-visible,
body[data-tool] .tool-nav-inner a[aria-current="page"] {
  color: var(--inner-ink);
}

body[data-tool] .tool-nav-inner a[aria-current="page"]::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--workbench-accent);
  content: "";
}

/* Calculation area. */
.workbench-section {
  padding: 44px 0 72px;
}

.workbench-section-head {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(300px, .62fr);
  align-items: start;
  gap: clamp(42px, 6vw, 82px);
  margin-bottom: 24px;
}

.workbench-section-head small {
  display: block;
  margin-bottom: 9px;
  color: var(--workbench-accent-strong);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.workbench-section-head h2 {
  margin: 0;
  color: var(--inner-ink);
  font-size: clamp(27px, 2.7vw, 34px);
  font-weight: 640;
  letter-spacing: -.035em;
  line-height: 1.18;
}

.workbench-section-head > p {
  margin: 0;
  padding-top: 15px;
  border-top: 1px solid var(--inner-line-strong);
  color: var(--inner-muted);
  font-size: 15px;
  line-height: 1.72;
}

body[data-tool] .tool-workspace {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 18px;
  padding: 0;
}

body[data-tool="water"] .tool-workspace {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
}

body[data-tool="carbon"] .tool-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
}

body[data-tool] .tool-panel {
  position: relative;
  min-width: 0;
  padding: clamp(26px, 2.8vw, 36px);
  border: 1px solid var(--inner-line);
  border-radius: 0;
  color: var(--inner-ink);
  background: var(--inner-surface);
  box-shadow: none;
  scroll-margin-top: calc(var(--site-header-height, 76px) + 70px);
}

body[data-tool] form.tool-panel {
  border-top: 3px solid var(--workbench-accent-strong);
}

body[data-tool] .result-panel {
  border-top: 3px solid var(--workbench-accent);
  background: color-mix(in srgb, var(--inner-surface) 76%, var(--workbench-accent-soft));
}

body[data-tool] .panel-kicker {
  margin: 0 0 9px;
  color: var(--workbench-accent-strong);
  font-size: 14px;
  font-weight: 720;
  letter-spacing: .11em;
  text-transform: uppercase;
}

body[data-tool] .tool-panel h2 {
  margin: 0 0 9px;
  color: var(--inner-ink);
  font-size: 25px;
  font-weight: 640;
  letter-spacing: -.025em;
  line-height: 1.25;
}

body[data-tool] .panel-intro {
  max-width: 640px;
  margin: 0 0 30px;
  color: var(--inner-muted);
  font-size: 15px;
  line-height: 1.72;
}

.input-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--inner-line);
}

.input-group-label strong {
  color: var(--inner-ink);
  font-size: 14px;
  font-weight: 650;
}

.input-group-label span {
  color: var(--inner-faint);
  font-size: 14px;
}

body[data-tool] .tool-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 18px;
}

body[data-tool] .field {
  min-width: 0;
}

body[data-tool] .field-full {
  grid-column: 1 / -1;
}

body[data-tool] .field label {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 3px;
  margin: 0 0 8px;
  color: var(--inner-ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

body[data-tool] .field label small {
  margin-left: 5px;
  color: var(--inner-faint);
  font-size: 14px;
  font-weight: 500;
}

body[data-tool] .control-wrap {
  position: relative;
}

body[data-tool] .control {
  width: 100%;
  min-height: 50px;
  padding: 0 13px;
  border: 1px solid var(--inner-line-strong);
  border-radius: 0;
  outline: 0;
  color: var(--inner-ink);
  background: var(--inner-surface);
  font-size: 15px;
  line-height: 1.4;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

body[data-tool] select.control {
  cursor: pointer;
}

body[data-tool] .control.has-unit {
  padding-right: 88px;
}

body[data-tool] .control:hover {
  border-color: var(--inner-ink-2);
  background: var(--inner-surface);
}

body[data-tool] .control:focus {
  border-color: var(--workbench-accent);
  background: var(--inner-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--workbench-accent) 15%, transparent);
}

body[data-tool] .control[aria-invalid="true"] {
  border-color: #a84235;
  box-shadow: 0 0 0 3px color-mix(in srgb, #a84235 13%, transparent);
}

body[data-tool] .control::placeholder {
  color: var(--inner-faint);
}

body[data-tool] .unit {
  position: absolute;
  top: 50%;
  right: 13px;
  color: var(--inner-muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  transform: translateY(-50%);
  pointer-events: none;
}

body[data-tool] .required {
  color: #a84235;
}

body[data-tool] .hint {
  margin: 7px 0 0;
  color: var(--inner-muted);
  font-size: 14px;
  line-height: 1.6;
}

body[data-tool] .advanced {
  margin-top: 26px;
  border: 1px solid var(--inner-line-strong);
  border-radius: 3px;
  background: var(--inner-paper-2);
}

body[data-tool] .advanced summary,
body[data-tool] .formula summary {
  position: relative;
  padding: 16px 50px 16px 18px;
  color: var(--inner-ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  list-style: none;
}

body[data-tool] .advanced summary::-webkit-details-marker,
body[data-tool] .formula summary::-webkit-details-marker {
  display: none;
}

body[data-tool] .advanced summary::after,
body[data-tool] .formula summary::after {
  position: absolute;
  top: 50%;
  right: 18px;
  color: var(--workbench-accent-strong);
  content: "+";
  font-size: 21px;
  font-weight: 400;
  transform: translateY(-52%);
}

body[data-tool] .advanced[open] summary::after,
body[data-tool] .formula[open] summary::after {
  content: "−";
}

body[data-tool] .advanced summary:hover,
body[data-tool] .advanced summary:focus-visible,
body[data-tool] .formula summary:hover,
body[data-tool] .formula summary:focus-visible {
  color: var(--workbench-accent-strong);
  background: var(--workbench-accent-soft);
}

body[data-tool] .advanced-body {
  padding: 5px 18px 20px;
}

body[data-tool] .tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--inner-line);
}

body[data-tool] .tool-actions .button,
body[data-tool] .copy-actions .button {
  min-height: 44px;
  border-radius: 0;
  font-size: 14px;
  box-shadow: none;
}

body[data-tool] .tool-actions .button:first-child {
  border-color: var(--ref-green, #7f9f72);
  color: #fff;
  background: var(--ref-green, #7f9f72);
}

body[data-tool] .tool-actions .button:first-child:hover,
body[data-tool] .tool-actions .button:first-child:focus-visible {
  border-color: var(--workbench-accent-strong);
  color: #fff;
  background: var(--workbench-accent-strong);
}

body[data-tool] .tool-actions .button-light,
body[data-tool] .copy-actions .button {
  border-color: var(--inner-line-strong);
  color: var(--inner-ink);
  background: transparent;
}

body[data-tool] .tool-actions .button-light:hover,
body[data-tool] .tool-actions .button-light:focus-visible,
body[data-tool] .copy-actions .button:hover,
body[data-tool] .copy-actions .button:focus-visible {
  border-color: var(--workbench-accent);
  color: var(--workbench-accent-strong);
  background: var(--workbench-accent-soft);
}

body[data-tool] .form-message {
  min-height: 24px;
  margin: 12px 0 0;
  color: #a84235;
  font-size: 14px;
  line-height: 1.65;
}

body[data-tool] .form-message[data-tone="success"] {
  color: var(--workbench-accent-strong);
}

body[data-tool] .form-message[data-tone="pending"] {
  color: var(--inner-muted);
}

/* Results: quantitative hierarchy instead of floating dashboard cards. */
body[data-tool] .empty-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  border: 1px dashed var(--inner-line-strong);
  border-radius: 0;
  color: var(--inner-ink);
  background: color-mix(in srgb, var(--inner-surface) 58%, transparent);
  text-align: center;
}

body[data-tool] .empty-state > div {
  max-width: 340px;
  padding: 22px;
}

body[data-tool] .empty-state strong,
body[data-tool] .empty-state span {
  display: block;
}

body[data-tool] .empty-state strong {
  margin-bottom: 8px;
  color: var(--inner-ink);
  font-size: 18px;
  font-weight: 630;
}

body[data-tool] .empty-state span {
  color: var(--inner-muted);
  font-size: 14px;
  line-height: 1.7;
}

body[data-tool] .empty-state[hidden],
body[data-tool] #resultContent[hidden],
body[data-tool] [hidden] {
  display: none !important;
}

body[data-tool] .tool-data-visual {
  margin: 0 0 22px;
  padding: 18px 0 20px;
  border-block: 1px solid var(--inner-line-strong);
}

body[data-tool] .tool-data-visual > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  color: var(--inner-muted);
  font-size: 14px;
}

body[data-tool] .tool-data-visual output {
  color: var(--workbench-accent-strong);
  font-size: 14px;
  font-weight: 670;
  font-variant-numeric: tabular-nums;
}

body[data-tool] .tool-data-visual meter {
  display: block;
  width: 100%;
  height: 9px;
  border: 0;
  border-radius: 0;
  background: var(--inner-line);
}

body[data-tool] .tool-data-visual meter::-webkit-meter-bar {
  border: 0;
  border-radius: 0;
  background: var(--inner-line);
}

body[data-tool] .tool-data-visual meter::-webkit-meter-optimum-value {
  border-radius: 0;
  background: var(--workbench-accent);
  transition: width 600ms var(--workbench-ease);
}

body[data-tool] .tool-data-visual meter::-moz-meter-bar {
  border-radius: 0;
  background: var(--workbench-accent);
}

body[data-tool] .visual-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 9px;
  color: var(--inner-faint);
  font-size: 14px;
}

body[data-tool] .result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--inner-line-strong);
  border-left: 1px solid var(--inner-line-strong);
}

body[data-tool] .result-item {
  min-height: 128px;
  padding: 18px;
  border-right: 1px solid var(--inner-line-strong);
  border-bottom: 1px solid var(--inner-line-strong);
  color: var(--inner-ink);
  background: var(--inner-surface);
  transition: background 180ms ease;
}

body[data-tool] .result-item:hover {
  background: color-mix(in srgb, var(--workbench-accent-soft) 55%, var(--inner-surface));
}

body[data-tool] .result-label {
  min-height: 42px;
  margin: 0 0 12px;
  color: var(--inner-muted);
  font-size: 14px;
  line-height: 1.5;
}

body[data-tool] .result-value {
  margin: 0;
  color: var(--inner-ink);
  font-size: clamp(22px, 2.25vw, 31px);
  font-weight: 620;
  letter-spacing: -.035em;
  line-height: 1.2;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

body[data-tool] .result-value small {
  margin-left: 5px;
  color: var(--inner-muted);
  font-size: 13px;
  font-weight: 520;
  letter-spacing: 0;
}

body[data-tool] .result-note {
  margin: 20px 0 0;
  padding: 16px 18px;
  border-left: 3px solid var(--workbench-accent);
  color: var(--inner-muted);
  background: var(--inner-surface);
  font-size: 14px;
  line-height: 1.75;
}

body[data-tool] .copy-actions {
  margin-top: 15px;
}

body[data-tool] .result-panel.is-stale {
  border-top-color: #b67b38;
}

body[data-tool] .result-panel.is-stale::after {
  position: absolute;
  top: 14px;
  right: 18px;
  color: #8f642f;
  content: "输入已更新，请重新计算";
  font-size: 14px;
}

/* Per-model result structures. */
body[data-tool="density"] .result-item:nth-child(-n + 2) {
  min-height: 158px;
}

body[data-tool="density"] .result-item:nth-child(-n + 2) .result-value {
  color: var(--workbench-accent-strong);
  font-size: clamp(29px, 3vw, 40px);
}

body[data-tool="water"] .result-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

body[data-tool="water"] .result-item {
  grid-column: span 3;
}

body[data-tool="water"] .result-item:nth-child(-n + 3) {
  grid-column: span 2;
  min-height: 146px;
}

body[data-tool="water"] .result-item:nth-child(-n + 3) .result-value {
  color: var(--workbench-accent-strong);
}

body[data-tool="carbon"] .result-item:nth-child(3) {
  grid-column: 1 / -1;
  min-height: 160px;
  color: var(--inner-ink);
  background: var(--workbench-accent-soft);
}

body[data-tool="carbon"] .result-item:nth-child(3):hover {
  background: color-mix(in srgb, var(--workbench-accent) 30%, var(--inner-surface));
}

body[data-tool="carbon"] .result-item:nth-child(3) .result-label,
body[data-tool="carbon"] .result-item:nth-child(3) .result-value small {
  color: var(--inner-muted);
}

body[data-tool="carbon"] .result-item:nth-child(3) .result-value {
  color: var(--workbench-accent-strong);
  font-size: clamp(32px, 4vw, 47px);
}

html[data-theme="dark"] body[data-tool="carbon"] .result-item:nth-child(3) {
  background: var(--workbench-accent-soft);
}

/* Methods, caveats, and conversion boundaries. */
body[data-tool] .support-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 20px;
  border: 1px solid var(--inner-line-strong);
  border-radius: 0;
  background: var(--inner-surface);
}

body[data-tool] .support-card {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-tool] .support-card + .support-card {
  border-left: 1px solid var(--inner-line-strong);
}

body[data-tool] .support-card h2 {
  margin: 0;
  padding: 17px 20px;
  border-bottom: 1px solid var(--inner-line);
  color: var(--inner-ink);
  font-size: 17px;
  font-weight: 640;
}

body[data-tool] .formula {
  height: 100%;
}

body[data-tool] .formula summary {
  border-bottom: 1px solid var(--inner-line);
  font-size: 17px;
}

body[data-tool] .formula-lines {
  padding: 12px 20px 20px;
}

body[data-tool] .formula-line {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--inner-line);
  color: var(--inner-muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  line-height: 1.7;
}

body[data-tool] .formula-line:last-child {
  border-bottom: 0;
}

body[data-tool] .bullet-list {
  margin: 0;
  padding: 15px 24px 22px 42px;
  color: var(--inner-muted);
  font-size: 14px;
  line-height: 1.75;
}

body[data-tool] .bullet-list li {
  margin: 8px 0;
  padding-left: 3px;
}

body[data-tool] .tool-consult {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  margin: 52px 0 0;
  padding: 30px 32px;
  border-block: 1px solid var(--inner-line);
  border-radius: 0;
  color: var(--inner-ink);
  background: var(--workbench-accent-soft);
}

body[data-tool] .tool-consult > div {
  max-width: 760px;
}

body[data-tool] .tool-consult h2 {
  margin: 0 0 7px;
  color: var(--inner-ink);
  font-size: 23px;
  font-weight: 630;
  letter-spacing: -.025em;
}

body[data-tool] .tool-consult p {
  margin: 0;
  color: var(--inner-muted);
  font-size: 15px;
  line-height: 1.7;
}

body[data-tool] .tool-consult .button {
  min-height: 46px;
  border-radius: 0;
  border-color: #a9bd79;
  color: var(--inner-ink);
  background: #a9bd79;
  font-size: 14px;
}

body[data-tool] .tool-consult .button:hover,
body[data-tool] .tool-consult .button:focus-visible {
  border-color: #91a867;
  color: var(--inner-ink);
  background: #91a867;
}

/* Water mode receives a more explicit conversion-flow treatment. */
body[data-tool="water"] .mode-field {
  padding: 16px;
  border: 1px solid var(--inner-line);
  background: var(--workbench-accent-soft);
}

body[data-tool="water"] .advanced {
  border-color: color-mix(in srgb, var(--workbench-accent) 36%, var(--inner-line-strong));
}

/* Carbon inputs are grouped like a project ledger. */
body[data-tool="carbon"] .tool-field-grid {
  padding-left: 18px;
  border-left: 3px solid var(--workbench-accent-soft);
}

body[data-tool="carbon"] .field[data-mode-field] {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--inner-line);
}

@media (max-width: 1040px) {
  body[data-tool] .tool-hero-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 46px;
  }

  .model-board {
    padding-left: 24px;
  }

  body[data-tool] .tool-workspace,
  body[data-tool="water"] .tool-workspace,
  body[data-tool="carbon"] .tool-workspace {
    grid-template-columns: 1fr;
  }

  body[data-tool] .result-panel {
    min-height: 0;
  }

  body[data-tool] .empty-state {
    min-height: 250px;
  }
}

@media (max-width: 760px) {
  .workbench-container {
    width: min(calc(100% - 36px), var(--workbench-max));
  }

  body[data-tool] .tool-hero {
    padding: 28px 0 30px;
  }

  body[data-tool] .tool-hero::before {
    display: none;
  }

  body[data-tool] .tool-hero-grid,
  .workbench-section-head {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .workbench-breadcrumb {
    margin-bottom: 23px;
  }

  body[data-tool] .tool-hero h1 {
    font-size: clamp(34px, 10vw, 43px);
  }

  .workbench-lead {
    margin-top: 17px;
    font-size: 15px;
  }

  .model-board {
    min-height: 0;
    padding: 20px;
  }

  .model-formula {
    min-height: 88px;
  }

  body[data-tool] .tool-nav-inner {
    gap: 22px;
  }

  .workbench-section {
    padding: 42px 0 58px;
  }

  .workbench-section-head {
    margin-bottom: 24px;
  }

  .workbench-section-head > p {
    padding-top: 13px;
  }

  body[data-tool] .tool-panel {
    padding: 25px 20px;
  }

  body[data-tool] .tool-field-grid {
    grid-template-columns: 1fr;
  }

  body[data-tool="carbon"] .tool-field-grid {
    padding-left: 13px;
  }

  body[data-tool] .field-full {
    grid-column: auto;
  }

  body[data-tool="water"] .result-grid {
    grid-template-columns: 1fr 1fr;
  }

  body[data-tool="water"] .result-item,
  body[data-tool="water"] .result-item:nth-child(-n + 3) {
    grid-column: auto;
  }

  body[data-tool="water"] .result-item:nth-child(3) {
    grid-column: 1 / -1;
  }

  body[data-tool] .support-grid,
  body[data-tool] .tool-consult {
    grid-template-columns: 1fr;
  }

  body[data-tool] .support-card + .support-card {
    border-top: 1px solid var(--inner-line-strong);
    border-left: 0;
  }

  body[data-tool] .tool-consult {
    align-items: start;
  }

  body[data-tool] .tool-consult .button {
    justify-self: start;
  }
}

@media (max-width: 480px) {
  .workbench-container {
    width: min(calc(100% - 28px), var(--workbench-max));
  }

  .model-board dl {
    grid-template-columns: 1fr;
  }

  .model-board dl > div {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--inner-line);
  }

  .model-board dt {
    margin: 0;
  }

  body[data-tool] .tool-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body[data-tool] .tool-actions .button {
    width: 100%;
  }

  body[data-tool] .result-grid,
  body[data-tool="water"] .result-grid {
    grid-template-columns: 1fr;
  }

  body[data-tool="water"] .result-item:nth-child(3),
  body[data-tool="carbon"] .result-item:nth-child(3) {
    grid-column: auto;
  }

  body[data-tool] .result-item {
    min-height: 112px;
  }

  body[data-tool] .result-panel.is-stale::after {
    position: static;
    display: block;
    margin: -10px 0 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-tool] *,
  body[data-tool] *::before,
  body[data-tool] *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
