/* Tool archive theme
   Carries the standard-record editorial language into every online tool while
   keeping each existing form, canvas, table and script hook intact. */

:where(
  body[data-studio],
  body[data-tool],
  body[data-page="spatial"],
  body[data-page="calculation"],
  body.section-tools
) {
  --tool-archive-ink: #20332d;
  --tool-archive-text: #4d5d57;
  --tool-archive-muted: #74817c;
  --tool-archive-paper: #f6f4ee;
  --tool-archive-surface: #fffdfa;
  --tool-archive-green: #7f9874;
  --tool-archive-green-deep: #536f59;
  --tool-archive-green-soft: #edf2e8;
  --tool-archive-blue: #637f9c;
  --tool-archive-blue-deep: #365a78;
  --tool-archive-blue-soft: #eaf1f6;
  --tool-archive-warm: #bb714c;
  --tool-archive-warm-deep: #955435;
  --tool-archive-warm-soft: #f8eee7;
  --tool-archive-line: #dbe1da;
  --tool-archive-line-strong: #c5cdc4;
  --tool-archive-shadow: 0 20px 60px rgba(47, 59, 52, .075), 0 2px 10px rgba(47, 59, 52, .04);
  --tool-archive-shadow-soft: 0 10px 30px rgba(47, 59, 52, .05);
  --tool-archive-ease: cubic-bezier(.16, 1, .3, 1);
  color: var(--tool-archive-text);
  background: var(--tool-archive-paper);
}

/* Each tool family keeps the same archive layout and materials, but receives
   an accent that describes its job. Carbon is the only deliberately green
   workspace; analysis, plotting, documents, spatial work and calculations no
   longer collapse into one green visual identity. */
body.section-tools {
  --tool-archive-green: #657f98;
  --tool-archive-green-deep: #405e78;
  --tool-archive-green-soft: #eaf0f5;
}

body[data-studio="analysis"] {
  --tool-archive-green: #5f7ea3;
  --tool-archive-green-deep: #365e87;
  --tool-archive-green-soft: #e8f0f7;
}

body[data-studio="plotting"] {
  --tool-archive-green: #7b70a5;
  --tool-archive-green-deep: #584a82;
  --tool-archive-green-soft: #f0edf8;
}

body[data-studio="document"] {
  --tool-archive-green: #b17a43;
  --tool-archive-green-deep: #865425;
  --tool-archive-green-soft: #f8efe3;
}

body[data-page="spatial"] {
  --tool-archive-green: #a26849;
  --tool-archive-green-deep: #7b4930;
  --tool-archive-green-soft: #f7ece5;
}

body[data-page="calculation"] {
  --tool-archive-green: #6b7da4;
  --tool-archive-green-deep: #46587f;
  --tool-archive-green-soft: #edf0f7;
}

body[data-tool="density"] {
  --tool-archive-green: #9e654e;
  --tool-archive-green-deep: #784632;
  --tool-archive-green-soft: #f7ebe6;
}

body[data-tool="water"] {
  --tool-archive-green: #4f7f9f;
  --tool-archive-green-deep: #315e7b;
  --tool-archive-green-soft: #e8f1f7;
}

body[data-tool="carbon"] {
  --tool-archive-green: #557f6d;
  --tool-archive-green-deep: #365f50;
  --tool-archive-green-soft: #e7f1ec;
}

:where(
  body[data-studio] main,
  body[data-tool] main,
  body[data-page="spatial"] main,
  body[data-page="calculation"] main,
  body.section-tools main
) {
  background: var(--tool-archive-paper);
}

/* Archive trail */
.tool-archive-breadcrumb {
  display: flex;
  width: min(calc(100% - 72px), 1340px);
  min-height: 72px;
  align-items: center;
  gap: 10px;
  margin-inline: auto;
  color: var(--tool-archive-muted);
  font-size: 13px;
}

.section-tools .tool-archive-breadcrumb {
  margin-top: var(--site-header-height, 60px);
}

.tool-archive-breadcrumb a {
  color: var(--tool-archive-text);
  font-weight: 580;
  transition: color 180ms ease, transform 240ms var(--tool-archive-ease);
}

.tool-archive-breadcrumb a:hover,
.tool-archive-breadcrumb a:focus-visible {
  color: var(--tool-archive-green-deep);
}

.tool-archive-home {
  display: grid;
  width: 40px;
  height: 40px;
  margin-right: 4px;
  place-items: center;
  border: 1px solid rgba(127, 152, 116, .22);
  border-radius: 13px;
  background: rgba(255, 253, 250, .82);
  box-shadow: 0 8px 20px rgba(47, 59, 52, .04);
}

.tool-archive-home:hover,
.tool-archive-home:focus-visible {
  transform: translateY(-2px);
}

.tool-archive-home img {
  width: 17px;
  height: 17px;
  opacity: .72;
}

.tool-archive-breadcrumb b {
  margin-left: auto;
  color: var(--tool-archive-green-deep);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .16em;
}

/* Shared archive cover */
.tool-archive-hero {
  position: relative;
  width: min(calc(100% - 72px), 1340px) !important;
  min-height: 500px !important;
  margin: 0 auto 26px !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(127, 152, 116, .18) !important;
  border-radius: 32px !important;
  background: var(--tool-archive-surface) !important;
  box-shadow: var(--tool-archive-shadow) !important;
  isolation: isolate;
}

.tool-archive-hero::before,
.tool-archive-hero::after,
.tool-archive-hero > .plot-hero-grid {
  display: none !important;
}

.tool-archive-hero-grid {
  position: relative !important;
  z-index: 1;
  display: grid !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 500px !important;
  grid-template-columns: minmax(0, 1.18fr) minmax(420px, .82fr) !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  align-items: stretch !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.tool-archive-hero-grid > :first-child {
  display: flex;
  min-width: 0;
  max-width: none !important;
  grid-column: 1;
  grid-row: 1;
  flex-direction: column;
  justify-content: center;
  align-self: stretch;
  padding: clamp(46px, 5vw, 68px) clamp(42px, 5vw, 68px) 28px;
}

.tool-archive-hero-grid > :nth-child(2):not(.tool-archive-media) {
  min-width: 0;
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  margin: 0 clamp(42px, 5vw, 68px) clamp(42px, 4.4vw, 58px) !important;
}

.tool-archive-media {
  position: relative;
  min-width: 0;
  grid-column: 2;
  grid-row: 1 / 3;
  margin: 20px 20px 20px 0;
  overflow: hidden;
  border-radius: 24px;
  background: #e7e5dc;
}

.tool-archive-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.015);
  transition: transform 900ms var(--tool-archive-ease), filter 500ms ease;
}

body[data-studio="analysis"] .tool-archive-media > img,
body[data-studio="plotting"] .tool-archive-media > img {
  object-position: 67% center;
}

body[data-studio="document"] .tool-archive-media > img {
  object-position: 72% center;
}

body[data-page="spatial"] .tool-archive-media > img {
  object-position: 45% center;
}

body[data-tool="density"] .tool-archive-media > img {
  object-position: 42% center;
}

body[data-tool="water"] .tool-archive-media > img {
  object-position: 55% center;
}

body[data-tool="carbon"] .tool-archive-media > img {
  object-position: 72% center;
}

.tool-archive-hero:hover .tool-archive-media > img {
  transform: scale(1.04);
}

.tool-archive-media figcaption {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 15px;
  color: #33463f;
  background: rgba(255, 253, 250, .88);
  box-shadow: 0 12px 35px rgba(27, 38, 33, .13);
  backdrop-filter: blur(14px) saturate(130%);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.55;
}

.tool-archive-media figcaption img {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  opacity: .72;
}

.tool-archive-hero :is(
  .studio-kicker,
  .inner-kicker,
  .eyebrow
) {
  margin: 0 0 20px !important;
  color: var(--tool-archive-green-deep) !important;
  font-size: 12px !important;
  font-weight: 720 !important;
  letter-spacing: .13em !important;
}

.tool-archive-hero .studio-kicker span {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  color: var(--tool-archive-green-deep);
  background: var(--tool-archive-green-soft);
}

.tool-archive-hero h1 {
  max-width: 12.5em !important;
  margin: 0 !important;
  color: var(--tool-archive-ink) !important;
  font-family: var(--font-display, system-ui, sans-serif) !important;
  font-size: clamp(45px, 4.4vw, 65px) !important;
  font-weight: 700 !important;
  letter-spacing: -.01em !important;
  line-height: 1.13 !important;
  text-wrap: balance;
}

.tool-archive-hero :is(
  .studio-hero-copy > p:not(.studio-kicker),
  .workbench-lead,
  .inner-hero-summary > p
) {
  max-width: 670px;
  margin: 22px 0 0 !important;
  color: var(--tool-archive-text) !important;
  font-size: 15px !important;
  line-height: 1.78 !important;
}

.tool-archive-hero .studio-primary-link {
  min-height: 44px;
  width: fit-content;
  margin-top: 26px;
  padding: 0 17px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--tool-archive-green-deep);
  box-shadow: 0 10px 24px rgba(83, 111, 89, .16);
}

.tool-archive-hero .studio-primary-link span {
  color: inherit;
}

/* The second block is metadata, not another free-floating card. */
.tool-archive-hero-grid > :is(
  .analysis-snapshot,
  .plot-hero-register,
  .document-flow,
  .inner-hero-summary,
  .model-board
) {
  width: auto !important;
  min-height: 0 !important;
  padding: 16px 18px !important;
  border: 1px solid rgba(127, 152, 116, .16) !important;
  border-top-width: 1px !important;
  border-radius: 17px !important;
  color: var(--tool-archive-text) !important;
  background: rgba(246, 248, 243, .86) !important;
  box-shadow: none !important;
}

.analysis-snapshot-head,
.model-board-head {
  padding-bottom: 11px !important;
  border-color: var(--tool-archive-line) !important;
}

.analysis-snapshot-head :is(span, b),
.model-board-head :is(span, b) {
  color: var(--tool-archive-green-deep) !important;
  font-size: 11px !important;
}

.analysis-snapshot dl {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0 !important;
}

.analysis-snapshot dl > div {
  display: block !important;
  min-width: 0;
  grid-template-columns: 1fr !important;
  gap: 4px !important;
  padding: 13px 12px 3px !important;
  border: 0 !important;
  border-right: 1px solid var(--tool-archive-line) !important;
}

.analysis-snapshot dl > div:last-child {
  border-right: 0 !important;
}

.analysis-snapshot dt,
.analysis-snapshot dd {
  display: block;
  color: var(--tool-archive-text) !important;
  font-size: 11px !important;
  line-height: 1.55 !important;
}

.analysis-snapshot dt {
  margin-bottom: 5px;
  color: var(--tool-archive-ink) !important;
  font-weight: 700;
}

.analysis-snapshot p {
  margin: 11px 0 0 !important;
  color: var(--tool-archive-green-deep) !important;
  font-size: 10px !important;
}

.plot-hero-register {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0 !important;
}

.plot-hero-register > div {
  min-width: 0;
  padding: 4px 13px !important;
  border: 0 !important;
  border-right: 1px solid var(--tool-archive-line) !important;
}

.plot-hero-register > div:last-child {
  border-right: 0 !important;
}

.plot-hero-register dt {
  color: var(--tool-archive-green-deep) !important;
  font-family: var(--font-display, system-ui, sans-serif) !important;
  font-size: 28px !important;
}

.plot-hero-register dd,
.plot-hero-register strong,
.plot-hero-register span {
  color: var(--tool-archive-text) !important;
}

.plot-hero-register strong {
  font-size: 13px !important;
}

.plot-hero-register span {
  font-size: 10px !important;
}

.document-flow {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0 !important;
  list-style: none;
}

.document-flow li {
  min-width: 0;
  padding: 4px 12px !important;
  border: 0 !important;
  border-right: 1px solid var(--tool-archive-line) !important;
}

.document-flow li:last-child {
  border-right: 0 !important;
}

.document-flow li::after {
  display: none !important;
}

.document-flow li > span {
  color: var(--tool-archive-green-deep) !important;
  font-family: var(--font-display, system-ui, sans-serif) !important;
  font-size: 25px !important;
}

.document-flow strong,
.document-flow small {
  color: var(--tool-archive-text) !important;
}

.inner-hero-summary {
  display: block !important;
}

.inner-hero-summary > p {
  margin-top: 0 !important;
  font-size: 13px !important;
}

.tool-archive-hero .inner-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 13px;
}

.tool-archive-hero .inner-facts span {
  color: var(--tool-archive-green-deep);
  font-size: 11px;
  font-weight: 680;
}

.tool-archive-hero .model-formula {
  min-height: 62px !important;
  padding: 10px 0 !important;
  border-color: var(--tool-archive-line) !important;
}

.tool-archive-hero .model-formula strong {
  font-size: clamp(24px, 2.4vw, 34px) !important;
}

.tool-archive-hero .model-formula span {
  font-size: clamp(17px, 1.8vw, 23px) !important;
}

.tool-archive-hero .model-board dl > div {
  padding-top: 10px !important;
}

.tool-archive-hero .model-board :is(dt, dd, .privacy-line) {
  font-size: 11px !important;
}

.tool-archive-hero .workbench-breadcrumb {
  display: none;
}

/* Slim local index — one rail, no second card layer. */
:where(
  body[data-studio] .studio-switcher,
  body[data-tool] .tool-nav,
  body[data-page="spatial"] .inner-local-nav,
  body[data-page="calculation"] .inner-local-nav
) {
  border-top: 1px solid var(--tool-archive-line) !important;
  border-bottom: 1px solid var(--tool-archive-line) !important;
  background: color-mix(in srgb, var(--tool-archive-paper) 92%, transparent) !important;
  box-shadow: none !important;
  backdrop-filter: blur(16px) saturate(125%);
}

/* The studio rail is flow-positioned in its original component; neutralize the
   global sticky offset so it cannot slide over the following section title. */
body[data-studio] .studio-switcher {
  top: 0 !important;
}

:where(
  #analysisWorkspace,
  #plotWorkspace,
  #documentWorkspace,
  #spatialWorkbench,
  #spatialNotes,
  #models,
  #converter,
  #boundary,
  #toolForm
) {
  scroll-margin-top: calc(var(--site-header-height, 60px) + 76px) !important;
}

:where(
  body[data-studio] .studio-switcher > .container,
  body[data-tool] .tool-nav-inner,
  body[data-page="spatial"] .inner-local-row,
  body[data-page="calculation"] .inner-local-row
) {
  width: min(calc(100% - 72px), 1340px) !important;
  min-height: 58px !important;
  margin-inline: auto !important;
}

:where(
  body[data-studio] .studio-switcher a,
  body[data-tool] .tool-nav a,
  body[data-page="spatial"] .inner-local-nav a,
  body[data-page="calculation"] .inner-local-nav a
) {
  color: var(--tool-archive-muted) !important;
}

:where(
  body[data-studio] .studio-switcher a[aria-current],
  body[data-tool] .tool-nav a[aria-current],
  body[data-page="spatial"] .inner-local-nav a[aria-current],
  body[data-page="calculation"] .inner-local-nav a[aria-current]
) {
  color: var(--tool-archive-ink) !important;
}

/* Shared section-paper language */
:where(
  body[data-studio] .analysis-section,
  body[data-studio] .plotting-section,
  body[data-studio] .document-section,
  body[data-tool] .workbench-section
) {
  padding: 40px 0 96px !important;
  background: var(--tool-archive-paper) !important;
}

:where(
  body[data-studio] .analysis-section > .container,
  body[data-studio] .plotting-section > .container,
  body[data-studio] .document-section > .container,
  body[data-tool] .workbench-section > .workbench-container
) {
  width: min(calc(100% - 72px), 1340px) !important;
  max-width: none !important;
  padding: clamp(28px, 4vw, 52px) !important;
  border: 0 !important;
  border-top: 1px solid var(--tool-archive-line-strong) !important;
  border-bottom: 1px solid var(--tool-archive-line) !important;
  border-radius: 0 !important;
  background: var(--tool-archive-surface) !important;
  box-shadow: none !important;
}

:where(.studio-section-heading, .workbench-section-head) {
  position: relative;
  min-height: 96px;
  align-items: center !important;
  gap: 36px !important;
  margin: 0 !important;
  padding: 10px 0 30px 22px !important;
  border-bottom: 1px solid var(--tool-archive-line) !important;
}

:where(.studio-section-heading, .workbench-section-head)::before {
  position: absolute;
  top: 10px;
  bottom: 30px;
  left: 0;
  width: 3px;
  background: var(--tool-archive-green);
  content: "";
}

.studio-section-heading > div > p,
.workbench-section-head small {
  margin: 0 0 8px !important;
  color: var(--tool-archive-green-deep) !important;
  font-family: var(--font-display, system-ui, sans-serif) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: .08em !important;
  line-height: 1.3 !important;
}

:where(.studio-section-heading h2, .workbench-section-head h2) {
  color: var(--tool-archive-ink) !important;
  font-family: var(--font-display, system-ui, sans-serif) !important;
  font-size: clamp(27px, 2.6vw, 34px) !important;
  font-weight: 700 !important;
  letter-spacing: -.01em !important;
}

:where(.studio-section-heading > p, .workbench-section-head > p) {
  padding-top: 13px !important;
  border-top: 1px solid var(--tool-archive-line-strong) !important;
  color: var(--tool-archive-text) !important;
  font-size: 14px !important;
}

/* One continuous work surface instead of separate input/result cards. */
:where(
  body[data-studio] .analysis-workspace,
  body[data-studio] .plot-workspace,
  body[data-studio] .document-desk,
  body[data-tool] .tool-workspace
) {
  gap: 0 !important;
  margin-top: 28px !important;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid var(--tool-archive-line-strong) !important;
  border-radius: 0 !important;
  background: var(--tool-archive-surface) !important;
  box-shadow: none !important;
}

:where(
  body[data-studio] .studio-panel,
  body[data-studio] .analysis-board,
  body[data-studio] .plot-control-panel,
  body[data-studio] .plot-stage,
  body[data-studio] .document-pane,
  body[data-studio] .document-transform-panel,
  body[data-tool] .tool-panel
) {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

:where(
  body[data-studio] .analysis-workspace > :first-child,
  body[data-studio] .plot-workspace > :first-child,
  body[data-studio] .document-desk > :not(:last-child),
  body[data-tool] .tool-workspace > :first-child
) {
  border-right: 1px solid var(--tool-archive-line-strong) !important;
}

body[data-tool] .tool-panel {
  padding: clamp(26px, 2.8vw, 38px) !important;
  background: transparent !important;
}

body[data-tool] .result-panel {
  background: color-mix(in srgb, var(--tool-archive-surface) 79%, var(--tool-archive-green-soft)) !important;
}

body[data-tool] :is(form.tool-panel, .result-panel) {
  border-top: 0 !important;
}

:where(
  .analysis-metrics article,
  .result-item,
  .metric-box,
  .iqr-card,
  .regression-card,
  .identifier-card,
  .support-card
) {
  border-radius: 0 !important;
  box-shadow: none !important;
}

.analysis-lower-grid,
.support-grid {
  gap: 0 !important;
  margin-top: 24px !important;
  overflow: hidden;
  border: 1px solid var(--tool-archive-line) !important;
  border-radius: 0 !important;
  background: var(--tool-archive-surface) !important;
}

.analysis-lower-grid > :first-child,
.support-grid > :first-child {
  border-right: 1px solid var(--tool-archive-line) !important;
}

.analysis-lower-grid > *,
.support-grid > * {
  border: 0 !important;
}

body[data-tool] .tool-consult {
  margin-top: 24px !important;
  border: 0 !important;
  border-top: 1px solid var(--tool-archive-line-strong) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Spatial and calculation directories use the same numbered paper sections. */
body:is([data-page="spatial"], [data-page="calculation"]) .inner-section {
  padding: 40px 0 0 !important;
  border: 0 !important;
  background: var(--tool-archive-paper) !important;
}

body:is([data-page="spatial"], [data-page="calculation"]) .inner-section > .inner-container {
  width: min(calc(100% - 72px), 1340px) !important;
  max-width: none !important;
  padding: clamp(28px, 4vw, 52px) !important;
  border: 0 !important;
  border-top: 1px solid var(--tool-archive-line-strong) !important;
  border-bottom: 1px solid var(--tool-archive-line) !important;
  border-radius: 0 !important;
  background: var(--tool-archive-surface) !important;
  box-shadow: none !important;
}

body:is([data-page="spatial"], [data-page="calculation"]) .inner-section-head {
  position: relative;
  min-height: 96px;
  align-items: center !important;
  margin: 0 0 28px !important;
  padding: 10px 0 30px 22px !important;
  border-bottom: 1px solid var(--tool-archive-line) !important;
}

body:is([data-page="spatial"], [data-page="calculation"]) .inner-section-head::before {
  position: absolute;
  top: 10px;
  bottom: 30px;
  left: 0;
  width: 3px;
  background: var(--tool-archive-green);
  content: "";
}

body:is([data-page="spatial"], [data-page="calculation"]) .inner-section-head .inner-kicker {
  color: var(--tool-archive-green-deep) !important;
}

body:is([data-page="spatial"], [data-page="calculation"]) .inner-section-head h2 {
  color: var(--tool-archive-ink) !important;
  font-family: var(--font-display, system-ui, sans-serif) !important;
  font-weight: 700 !important;
  letter-spacing: -.01em !important;
}

.workbench-shell,
.calc-selector,
.converter-grid {
  overflow: hidden;
  border: 1px solid var(--tool-archive-line-strong) !important;
  border-radius: 0 !important;
  background: var(--tool-archive-surface) !important;
  box-shadow: none !important;
}

.workbench-shell {
  border-top-width: 1px !important;
}

.workbench-controls {
  border-color: var(--tool-archive-line-strong) !important;
  background: var(--tool-archive-green-soft) !important;
}

.calc-selector {
  border-top-width: 1px !important;
}

.calc-selector a {
  border-color: var(--tool-archive-line) !important;
  border-bottom: 0 !important;
  background: transparent !important;
}

.calc-selector a:hover,
.calc-selector a:focus-visible {
  color: var(--tool-archive-ink) !important;
  background: var(--tool-archive-green-soft) !important;
}

.converter-grid {
  border-top-width: 1px !important;
}

body[data-page="calculation"] .callout-band {
  padding-bottom: 92px !important;
}

body[data-page="calculation"] .callout-band > .inner-container {
  color: var(--tool-archive-surface);
  background: var(--tool-archive-ink) !important;
}

body[data-page="calculation"] .callout-band :is(h2, p) {
  color: inherit !important;
}

/* The tool-center hero stays owned by section-portals.css. Only the register
   below it receives the archive/workbench treatment in this stylesheet. */

body.section-tools {
  min-width: 0;
}

.section-tools .sp-tools-register {
  --tool-register-panel: #17382d;
  padding: 72px 0 104px;
  color: var(--theme-text);
  background: var(--theme-paper);
}

.section-tools .sp-tools-register > .sp-shell {
  width: min(calc(100% - 80px), 1280px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.section-tools .sp-tools-register .sp-section-head {
  position: relative;
  min-height: 0;
  align-items: end;
  gap: clamp(48px, 8vw, 112px);
  margin: 0;
  padding: 0 0 36px 22px;
  border-bottom: 1px solid var(--theme-line-strong);
}

.section-tools .sp-tools-register .sp-section-head::before {
  position: absolute;
  top: 4px;
  bottom: 36px;
  left: 0;
  width: 3px;
  background: var(--tool-archive-green);
  content: "";
}

.section-tools .sp-tools-register .sp-section-head h2 {
  color: var(--theme-ink);
  font-family: inherit;
  font-weight: 700;
  letter-spacing: -.01em;
}

.section-tools .sp-tools-register .sp-section-head > p {
  max-width: 390px;
  border-color: var(--theme-line-strong);
  color: var(--theme-text);
}

.section-tools .sp-tool-console {
  display: block;
  min-height: 0;
  margin-top: 34px;
  overflow: hidden;
  border: 1px solid var(--theme-line-strong);
  border-radius: 26px;
  background: var(--theme-surface);
  box-shadow: 0 22px 64px rgba(44, 57, 49, .08);
}

.section-tools .sp-tool-workflows {
  display: block;
  background: var(--theme-surface);
}

.section-tools .sp-tool-flow {
  --tool-flow-accent: var(--tool-archive-green-deep);
  --tool-flow-soft: var(--tool-archive-green-soft);
  display: grid;
  min-height: 164px;
  grid-template-columns: minmax(184px, .64fr) repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--theme-line);
}

.section-tools .sp-tool-flow--analysis {
  --tool-flow-accent: var(--tool-archive-blue-deep);
  --tool-flow-soft: var(--tool-archive-blue-soft);
}

.section-tools .sp-tool-flow--field {
  --tool-flow-accent: var(--tool-archive-warm-deep);
  --tool-flow-soft: var(--tool-archive-warm-soft);
}

.section-tools .sp-tool-flow--cycle {
  --tool-flow-accent: #58715d;
  --tool-flow-soft: #eef2e9;
}

.section-tools .sp-tool-flow-head {
  position: relative;
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 19px;
  padding: 27px 27px 25px 30px;
  overflow: hidden;
  border-right: 1px solid var(--theme-line);
  background: color-mix(in srgb, var(--tool-flow-soft) 64%, var(--theme-surface));
}

.section-tools .sp-tool-flow-head::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--tool-flow-accent);
  content: "";
}

.section-tools .sp-tool-flow-index {
  position: absolute;
  right: 13px;
  bottom: -24px;
  color: color-mix(in srgb, var(--tool-flow-accent) 10%, transparent);
  font: 760 88px/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: -.08em;
  pointer-events: none;
}

.section-tools .sp-tool-flow-head div {
  position: relative;
  z-index: 1;
}

.section-tools .sp-tool-flow-head p,
.section-tools .sp-tool-flow-head small {
  margin: 0;
  color: var(--tool-flow-accent);
  font: 680 9px/1.3 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.section-tools .sp-tool-flow-head h3 {
  margin: 8px 0 0;
  color: var(--theme-ink);
  font-size: 18px;
  font-weight: 690;
  letter-spacing: -.01em;
  line-height: 1.35;
}

.section-tools .sp-tool-flow-head > small {
  position: relative;
  z-index: 1;
  width: fit-content;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--tool-flow-accent) 28%, transparent);
  color: var(--theme-muted);
}

.section-tools .sp-tool-choice {
  --tool-choice-icon: url("./icons/search.svg");
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 164px;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 25px 25px 23px;
  border: 0;
  border-right: 1px solid var(--theme-line);
  color: var(--theme-text);
  background: transparent;
  text-align: left;
  text-decoration: none;
  transition: color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.section-tools .sp-tool-choice:last-child {
  border-right: 0;
}

.section-tools .sp-tool-choice::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--tool-flow-accent);
  content: "";
  opacity: 0;
  transform: scaleX(.35);
  transform-origin: left;
  transition: opacity 220ms ease, transform 360ms var(--tool-archive-ease);
}

.section-tools .sp-tool-choice--document {
  --tool-choice-icon: url("./icons/record/file-text.svg");
}

.section-tools .sp-tool-choice--analysis {
  --tool-choice-icon: url("./icons/database.svg");
}

.section-tools .sp-tool-choice--plot {
  --tool-choice-icon: url("./icons/record/layers-3.svg");
}

.section-tools .sp-tool-choice--spatial {
  --tool-choice-icon: url("./icons/record/landmark.svg");
}

.section-tools .sp-tool-choice--density {
  --tool-choice-icon: url("./icons/record/archive.svg");
}

.section-tools .sp-tool-choice--water {
  --tool-choice-icon: url("./icons/lucide/arrow-up-down.svg");
}

.section-tools .sp-tool-choice--carbon {
  --tool-choice-icon: url("./icons/leaf.svg");
}

.section-tools .sp-tool-choice-icon {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--tool-flow-accent) 16%, transparent);
  border-radius: 15px;
  color: var(--tool-flow-accent);
  background: var(--tool-flow-soft);
  transition: color 220ms ease, background 220ms ease, transform 360ms var(--tool-archive-ease);
}

.section-tools .sp-tool-choice-icon::before {
  width: 23px;
  height: 23px;
  background: currentColor;
  content: "";
  -webkit-mask: var(--tool-choice-icon) center / contain no-repeat;
  mask: var(--tool-choice-icon) center / contain no-repeat;
}

.section-tools .sp-tool-choice-copy {
  display: grid;
  min-width: 0;
  gap: 0;
}

.section-tools .sp-tool-choice-heading {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.section-tools .sp-tool-choice-heading small {
  color: var(--tool-flow-accent);
  font: 680 9px/1.25 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .13em;
}

.section-tools .sp-tool-choice-heading strong {
  color: var(--theme-ink);
  font-size: 19px;
  font-weight: 680;
  letter-spacing: -.012em;
  line-height: 1.35;
}

.section-tools .sp-tool-choice-description {
  display: block;
  max-width: 32em;
  margin-top: 8px;
  color: var(--theme-text);
  font-size: 12.5px;
  line-height: 1.58;
}

.section-tools .sp-tool-choice-io {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px 15px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--theme-line);
  color: var(--theme-muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.section-tools .sp-tool-choice-io span {
  min-width: 0;
}

.section-tools .sp-tool-choice-io b {
  margin-right: 6px;
  color: var(--tool-flow-accent);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: .08em;
}

.section-tools .sp-tool-choice-arrow {
  display: grid;
  min-width: 36px;
  gap: 10px;
  justify-items: center;
  color: var(--theme-muted);
  transition: color 220ms ease, transform 300ms var(--tool-archive-ease);
}

.section-tools .sp-tool-choice-arrow em {
  font: normal 650 9px/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .12em;
  writing-mode: vertical-rl;
}

.section-tools .sp-tool-choice-arrow i {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--theme-line-strong);
  border-radius: 50%;
  font: normal 16px/1 system-ui, sans-serif;
  transition: color 220ms ease, border-color 220ms ease, background 220ms ease, transform 300ms var(--tool-archive-ease);
}

.section-tools .sp-tool-choice:hover {
  color: var(--theme-ink);
  background: color-mix(in srgb, var(--tool-flow-soft) 72%, var(--theme-surface));
}

.section-tools .sp-tool-choice:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

.section-tools .sp-tool-choice:hover .sp-tool-choice-icon {
  color: #fff;
  background: var(--tool-flow-accent);
  transform: translateY(-2px);
}

.section-tools .sp-tool-choice:hover .sp-tool-choice-arrow {
  color: var(--tool-flow-accent);
  transform: translateX(2px);
}

.section-tools .sp-tool-choice:hover .sp-tool-choice-arrow i {
  color: #fff;
  border-color: var(--tool-flow-accent);
  background: var(--tool-flow-accent);
  transform: translateX(2px);
}

.section-tools .sp-tool-choice:focus-visible {
  z-index: 2;
  outline: 0;
  box-shadow: inset 0 0 0 2px var(--tool-archive-blue-deep);
}

.section-tools .sp-tool-direct-note {
  display: grid;
  min-height: 94px;
  grid-template-columns: minmax(200px, .56fr) minmax(0, 1.44fr);
  gap: clamp(26px, 4vw, 58px);
  align-items: center;
  padding: 21px 30px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  background: var(--tool-register-panel);
}

.section-tools .sp-tool-direct-title {
  display: grid;
  gap: 7px;
}

.section-tools .sp-tool-direct-title small {
  color: rgba(255, 255, 255, .6);
  font: 600 10px/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.section-tools .sp-tool-direct-title strong {
  font-size: 18px;
  font-weight: 660;
  letter-spacing: -.01em;
}

.section-tools .sp-tool-direct-note dl {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.section-tools .sp-tool-direct-note dl > div {
  display: grid;
  min-width: 0;
  gap: 7px;
  padding: 2px 20px;
  border-left: 1px solid rgba(255, 255, 255, .16);
}

.section-tools .sp-tool-direct-note dt {
  color: rgba(255, 255, 255, .54);
  font-size: 10px;
  letter-spacing: .08em;
}

.section-tools .sp-tool-direct-note dd {
  margin: 0;
  color: rgba(255, 255, 255, .88);
  font-size: 12.5px;
  font-weight: 620;
  white-space: nowrap;
}

.section-tools .sp-tool-direct-note dd b {
  margin-right: 3px;
  color: #fff;
  font-size: 17px;
}

.section-tools .sp-tool-direct-note dd span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #a8c29e;
  box-shadow: 0 0 0 4px rgba(168, 194, 158, .13);
}

/* Structured ledgers inside the single work surface. These are divided by
   rules instead of floating cards so inputs, results and method notes read as
   one coherent laboratory record. */
:where(.analysis-metrics, .identifier-grid) {
  gap: 0 !important;
  overflow: hidden;
  border: 1px solid var(--tool-archive-line) !important;
  border-radius: 0 !important;
}

:where(.analysis-metrics > *, .identifier-grid > *) {
  margin: 0 !important;
  border: 0 !important;
  border-right: 1px solid var(--tool-archive-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

:where(.analysis-metrics > *, .identifier-grid > *):last-child {
  border-right: 0 !important;
}

body[data-tool] .empty-state {
  min-height: 210px !important;
  border: 0 !important;
  border-top: 1px dashed var(--tool-archive-line-strong) !important;
  border-radius: 0 !important;
  background: transparent !important;
}

body[data-studio="document"] .document-textarea textarea {
  min-height: 320px !important;
}

/* Calculation models become a numbered register rather than three cards. */
body[data-page="calculation"] .calc-selector {
  display: grid !important;
  grid-template-columns: 1fr !important;
}

body[data-page="calculation"] .calc-selector a {
  display: grid !important;
  min-height: 112px;
  grid-template-columns: minmax(150px, .55fr) minmax(220px, .85fr) minmax(280px, 1.5fr) auto;
  align-items: center;
  gap: clamp(18px, 3vw, 44px);
  padding: 24px 28px !important;
  border-right: 0 !important;
  border-bottom: 1px solid var(--tool-archive-line) !important;
}

body[data-page="calculation"] .calc-selector a:last-child {
  border-bottom: 0 !important;
}

body[data-page="calculation"] .calc-selector a > :where(small, h3, p, b) {
  margin: 0 !important;
}

body[data-page="calculation"] .calc-selector a small {
  color: var(--tool-archive-green-deep) !important;
  font-family: var(--font-body, system-ui, sans-serif) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: .06em !important;
}

body[data-page="calculation"] .calc-selector a h3 {
  color: var(--tool-archive-ink) !important;
  font-family: var(--font-display, system-ui, sans-serif) !important;
  font-size: clamp(20px, 2vw, 26px) !important;
  font-weight: 700 !important;
}

body[data-page="calculation"] .calc-selector a p {
  color: var(--tool-archive-text) !important;
  line-height: 1.75 !important;
}

body[data-page="calculation"] .calc-selector a b {
  color: var(--tool-archive-green-deep) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  white-space: nowrap;
}

/* Dark theme retains the same materials and hierarchy. */
html[data-theme="dark"] :where(
  body[data-studio],
  body[data-tool],
  body[data-page="spatial"],
  body[data-page="calculation"],
  body.section-tools
) {
  --tool-archive-ink: #eef3ee;
  --tool-archive-text: #c5cec7;
  --tool-archive-muted: #929f97;
  --tool-archive-paper: #101712;
  --tool-archive-surface: #182019;
  --tool-archive-green: #91aa84;
  --tool-archive-green-deep: #afc7a1;
  --tool-archive-green-soft: #253127;
  --tool-archive-blue-soft: #1f2c36;
  --tool-archive-line: #344139;
  --tool-archive-line-strong: #45534a;
  --tool-archive-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  --tool-archive-shadow-soft: 0 10px 30px rgba(0, 0, 0, .18);
}

html[data-theme="dark"] body.section-tools {
  --tool-archive-green: #8da7bf;
  --tool-archive-green-deep: #b8cde0;
  --tool-archive-green-soft: #202b35;
}

html[data-theme="dark"] body[data-studio="analysis"] {
  --tool-archive-green: #88a9cc;
  --tool-archive-green-deep: #b6d0e8;
  --tool-archive-green-soft: #202c39;
}

html[data-theme="dark"] body[data-studio="plotting"] {
  --tool-archive-green: #a79dce;
  --tool-archive-green-deep: #d1c7e9;
  --tool-archive-green-soft: #2b273b;
}

html[data-theme="dark"] body[data-studio="document"] {
  --tool-archive-green: #d1a06b;
  --tool-archive-green-deep: #edc79c;
  --tool-archive-green-soft: #352a20;
}

html[data-theme="dark"] body[data-page="spatial"] {
  --tool-archive-green: #c88d6c;
  --tool-archive-green-deep: #e5b69b;
  --tool-archive-green-soft: #352720;
}

html[data-theme="dark"] body[data-page="calculation"] {
  --tool-archive-green: #9ba9d0;
  --tool-archive-green-deep: #c6d0eb;
  --tool-archive-green-soft: #272b3b;
}

html[data-theme="dark"] body[data-tool="density"] {
  --tool-archive-green: #c68a72;
  --tool-archive-green-deep: #e3b29f;
  --tool-archive-green-soft: #352621;
}

html[data-theme="dark"] body[data-tool="water"] {
  --tool-archive-green: #7dadd0;
  --tool-archive-green-deep: #acd0e8;
  --tool-archive-green-soft: #202d3a;
}

html[data-theme="dark"] body[data-tool="carbon"] {
  --tool-archive-green: #80ac98;
  --tool-archive-green-deep: #afd0bf;
  --tool-archive-green-soft: #203128;
}

/* Tools landing: restore the working brief above the laboratory photograph.
   The previous image-only override hid the four professional desks entirely. */
.section-tools .sp-tools-hero {
  position: relative;
  display: flex;
  height: auto;
  min-height: clamp(640px, 76svh, 780px) !important;
  align-items: flex-end;
  color: #fff;
  background: #071411;
}

.section-tools .sp-tools-hero::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block !important;
  background:
    linear-gradient(180deg, rgba(3, 12, 10, .42), rgba(3, 12, 10, .04) 28%, rgba(3, 12, 10, .9)),
    linear-gradient(90deg, rgba(3, 12, 10, .14), rgba(3, 12, 10, .8) 72%, rgba(3, 12, 10, .92));
  content: "";
}

.section-tools .sp-tools-hero > img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
}

.section-tools .sp-tools-copy {
  position: relative;
  z-index: 2;
  display: grid !important;
  min-height: clamp(640px, 76svh, 780px);
  grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr);
  gap: clamp(44px, 7vw, 96px);
  align-content: end;
  align-items: end;
  padding-top: 132px;
  padding-bottom: 28px;
}

.section-tools .sp-tools-copy-text {
  grid-column: 2;
  align-self: end;
}

.section-tools .sp-tools-copy .sp-kicker {
  color: #9fe7cf;
}

.section-tools .sp-tools-copy .sp-title {
  max-width: none;
  color: #fff;
}

.section-tools .sp-tools-copy .sp-lead {
  max-width: 760px;
  color: rgba(255, 255, 255, .78);
}

.section-tools .sp-tool-command {
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 30px;
  border-color: rgba(255, 255, 255, .34);
  background: rgba(5, 18, 14, .52);
  backdrop-filter: blur(14px) saturate(120%);
}

.section-tools .sp-tool-command a {
  min-height: 92px;
  border-color: rgba(255, 255, 255, .16);
  color: #fff;
}

.section-tools .sp-tool-command small {
  color: rgba(255, 255, 255, .58);
}

.section-tools .sp-tool-command strong {
  color: #fff;
  font-size: 15px;
}

.section-tools .sp-tool-command a:hover strong {
  color: #9fe7cf;
}

@media (max-width: 960px) {
  .section-tools .sp-tools-copy {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .section-tools .sp-tools-copy-text {
    grid-column: 1;
    max-width: 720px;
  }
}

@media (max-width: 640px) {
  .section-tools .sp-tools-hero,
  .section-tools .sp-tools-copy {
    min-height: 760px !important;
  }

  .section-tools .sp-tools-copy {
    padding-top: 104px;
    padding-bottom: 24px;
  }

  .section-tools .sp-tool-command {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-tools .sp-tool-command a:nth-child(2n) {
    border-right: 0;
  }

  .section-tools .sp-tool-command a:nth-child(-n+2) {
    border-bottom: 1px solid rgba(255, 255, 255, .16);
  }
}

html[data-theme="dark"] .tool-archive-home,
html[data-theme="dark"] .tool-archive-media figcaption {
  color: var(--tool-archive-text);
  background: rgba(24, 32, 25, .9);
}

html[data-theme="dark"] .tool-archive-hero-grid > :is(
  .analysis-snapshot,
  .plot-hero-register,
  .document-flow,
  .inner-hero-summary,
  .model-board
) {
  border-color: var(--tool-archive-line) !important;
  background: color-mix(in srgb, var(--tool-archive-surface) 82%, var(--tool-archive-green-soft)) !important;
}

/* Responsive layout follows the record-detail breakpoints while preserving the
   original tool-specific stacking rules below 920/760px. */
@media (max-width: 1120px) {
  .tool-archive-hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(350px, .72fr) !important;
  }

  .tool-archive-hero-grid > :first-child {
    padding-inline: 44px;
  }

  .tool-archive-hero-grid > :nth-child(2):not(.tool-archive-media) {
    margin-right: 44px !important;
    margin-left: 44px !important;
  }

  .tool-archive-hero h1 {
    font-size: clamp(42px, 5vw, 58px) !important;
  }

}

@media (max-width: 920px) {
  .tool-archive-breadcrumb,
  .tool-archive-hero,
  :where(
    body[data-studio] .studio-switcher > .container,
    body[data-tool] .tool-nav-inner,
    body[data-page="spatial"] .inner-local-row,
    body[data-page="calculation"] .inner-local-row,
    body[data-studio] .analysis-section > .container,
    body[data-studio] .plotting-section > .container,
    body[data-studio] .document-section > .container,
    body[data-tool] .workbench-section > .workbench-container,
    body[data-page="spatial"] .inner-section > .inner-container,
    body[data-page="calculation"] .inner-section > .inner-container,
    .section-tools .sp-tools-register > .sp-shell
  ) {
    width: min(calc(100% - 36px), 1340px) !important;
  }

  .tool-archive-hero {
    min-height: 0 !important;
    border-radius: 26px !important;
  }

  .tool-archive-hero-grid {
    min-height: 0 !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
  }

  .tool-archive-hero-grid > :first-child {
    grid-column: 1;
    grid-row: 1;
    padding: 42px 34px 26px;
  }

  .tool-archive-hero-grid > :nth-child(2):not(.tool-archive-media) {
    grid-column: 1;
    grid-row: 2;
    margin: 0 34px 26px !important;
  }

  .tool-archive-media {
    height: 360px;
    grid-column: 1;
    grid-row: 3;
    margin: 0 16px 16px;
  }

  .studio-section-heading,
  .workbench-section-head,
  body:is([data-page="spatial"], [data-page="calculation"]) .inner-section-head {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  :where(
    body[data-studio] .analysis-workspace > :first-child,
    body[data-studio] .plot-workspace > :first-child,
    body[data-studio] .document-desk > :not(:last-child),
    body[data-tool] .tool-workspace > :first-child
  ) {
    border-right: 0 !important;
    border-bottom: 1px solid var(--tool-archive-line-strong) !important;
  }

  .analysis-lower-grid > :first-child,
  .support-grid > :first-child {
    border-right: 0 !important;
    border-bottom: 1px solid var(--tool-archive-line) !important;
  }

  .section-tools .sp-tool-console {
    display: block;
  }

  .section-tools .sp-tools-register .sp-section-head {
    gap: 28px;
  }

  .section-tools .sp-tool-flow {
    display: grid;
    min-height: 154px;
    grid-template-columns: minmax(146px, .5fr) repeat(2, minmax(0, 1fr));
  }

  .section-tools .sp-tool-flow-head {
    padding: 23px 20px 22px 24px;
  }

  .section-tools .sp-tool-choice {
    min-height: 154px;
    grid-template-columns: 43px minmax(0, 1fr) 31px;
    gap: 14px;
    padding: 23px 18px 21px;
  }

  .section-tools .sp-tool-choice-icon {
    width: 43px;
    height: 43px;
    border-radius: 13px;
  }

  .section-tools .sp-tool-choice-icon::before {
    width: 21px;
    height: 21px;
  }

  .section-tools .sp-tool-choice-io {
    gap: 5px 11px;
  }

  .section-tools .sp-tool-direct-note {
    display: grid;
    grid-template-columns: minmax(170px, .45fr) minmax(0, 1.55fr);
    gap: 24px;
  }

  body[data-page="calculation"] .calc-selector a {
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 12px 24px;
  }

  body[data-page="calculation"] .calc-selector a small,
  body[data-page="calculation"] .calc-selector a p {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .tool-archive-breadcrumb,
  .tool-archive-hero,
  :where(
    body[data-studio] .studio-switcher > .container,
    body[data-tool] .tool-nav-inner,
    body[data-page="spatial"] .inner-local-row,
    body[data-page="calculation"] .inner-local-row,
    body[data-studio] .analysis-section > .container,
    body[data-studio] .plotting-section > .container,
    body[data-studio] .document-section > .container,
    body[data-tool] .workbench-section > .workbench-container,
    body[data-page="spatial"] .inner-section > .inner-container,
    body[data-page="calculation"] .inner-section > .inner-container,
    .section-tools .sp-tools-register > .sp-shell
  ) {
    width: min(calc(100% - 24px), 1340px) !important;
  }

  .tool-archive-breadcrumb {
    min-height: 62px;
    font-size: 12px;
  }

  .tool-archive-breadcrumb b {
    display: none;
  }

  .tool-archive-home {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .tool-archive-hero {
    border-radius: 21px !important;
  }

  .tool-archive-hero-grid > :first-child {
    padding: 34px 22px 22px;
  }

  .tool-archive-hero-grid > :nth-child(2):not(.tool-archive-media) {
    margin: 0 22px 22px !important;
  }

  .tool-archive-hero h1 {
    font-size: clamp(35px, 10vw, 46px) !important;
    line-height: 1.17 !important;
  }

  .tool-archive-hero :is(
    .studio-hero-copy > p:not(.studio-kicker),
    .workbench-lead,
    .inner-hero-summary > p
  ) {
    font-size: 14px !important;
  }

  .analysis-snapshot dl,
  .plot-hero-register,
  .document-flow {
    grid-template-columns: 1fr !important;
  }

  .analysis-snapshot dl > div,
  .plot-hero-register > div,
  .document-flow li {
    padding: 10px 4px !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--tool-archive-line) !important;
  }

  .analysis-snapshot dl > div:last-child,
  .plot-hero-register > div:last-child,
  .document-flow li:last-child {
    border-bottom: 0 !important;
  }

  .tool-archive-media {
    height: 260px;
    margin: 0 10px 10px;
    border-radius: 16px;
  }

  .tool-archive-media figcaption {
    right: 10px;
    bottom: 10px;
    left: 10px;
    min-height: 48px;
    border-radius: 12px;
    font-size: 10px;
  }

  :where(
    body[data-studio] .analysis-section > .container,
    body[data-studio] .plotting-section > .container,
    body[data-studio] .document-section > .container,
    body[data-tool] .workbench-section > .workbench-container,
    body[data-page="spatial"] .inner-section > .inner-container,
    body[data-page="calculation"] .inner-section > .inner-container,
    .section-tools .sp-tools-register > .sp-shell
  ) {
    padding: 22px 18px !important;
    border-radius: 0 !important;
  }

  :where(.studio-section-heading, .workbench-section-head),
  body:is([data-page="spatial"], [data-page="calculation"]) .inner-section-head {
    min-height: 0;
    padding: 6px 2px 20px 18px !important;
  }

  :where(.studio-section-heading, .workbench-section-head)::before,
  body:is([data-page="spatial"], [data-page="calculation"]) .inner-section-head::before {
    top: 6px;
    bottom: 20px;
  }

  :where(
    body[data-studio] .analysis-workspace,
    body[data-studio] .plot-workspace,
    body[data-studio] .document-desk,
    body[data-tool] .tool-workspace,
    .workbench-shell,
    .calc-selector,
    .converter-grid,
    .section-tools .sp-tool-console
  ) {
    border-radius: 0 !important;
  }

  .section-tools .sp-tools-register {
    padding: 56px 0 74px;
  }

  .section-tools .sp-tools-register > .sp-shell {
    width: min(calc(100% - 32px), 1280px) !important;
    padding: 0 !important;
  }

  .section-tools .sp-tools-register .sp-section-head {
    gap: 22px;
    padding: 0 0 28px 18px;
  }

  .section-tools .sp-tools-register .sp-section-head::before {
    top: 4px;
    bottom: 28px;
  }

  .section-tools .sp-tools-register .sp-section-head > p {
    padding-top: 16px;
    font-size: 14px;
  }

  .section-tools .sp-tool-console {
    margin-top: 20px;
    border-radius: 22px !important;
  }

  .section-tools .sp-tool-flow {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .section-tools .sp-tool-flow-head {
    min-height: 76px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-content: center;
    align-items: center;
    gap: 14px;
    padding: 14px 17px 14px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--theme-line);
  }

  .section-tools .sp-tool-flow-index {
    position: static;
    color: var(--tool-flow-accent);
    font-size: 12px;
    font-weight: 720;
    letter-spacing: .04em;
  }

  .section-tools .sp-tool-flow-head p {
    font-size: 8px;
  }

  .section-tools .sp-tool-flow-head h3 {
    margin-top: 4px;
    font-size: 16px;
  }

  .section-tools .sp-tool-flow-head > small {
    padding-top: 0;
    border-top: 0;
    font-size: 8px;
  }

  .section-tools .sp-tool-choice {
    grid-column: 1;
    min-width: 0;
    min-height: 128px;
    grid-template-columns: 42px minmax(0, 1fr) 32px;
    gap: 13px;
    align-items: start;
    padding: 18px 17px;
    border-right: 0;
    border-bottom: 1px solid var(--theme-line);
  }

  .section-tools .sp-tool-choice:last-child {
    border-bottom: 0;
  }

  .section-tools .sp-tool-choice-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .section-tools .sp-tool-choice-icon::before {
    width: 20px;
    height: 20px;
  }

  .section-tools .sp-tool-choice-heading strong {
    display: block;
    font-size: 17px;
  }

  .section-tools .sp-tool-choice-description {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.55;
  }

  .section-tools .sp-tool-choice-io {
    margin-top: 9px;
    padding-top: 8px;
    font-size: 10px;
  }

  .section-tools .sp-tool-choice-arrow em {
    display: none;
  }

  .section-tools .sp-tool-choice-arrow i {
    width: 30px;
    height: 30px;
  }

  .section-tools .sp-tool-direct-note {
    display: grid;
    grid-template-columns: 1fr;
    gap: 19px;
    min-height: 0;
    padding: 22px 20px 24px;
  }

  .section-tools .sp-tool-direct-note dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px 0;
  }

  .section-tools .sp-tool-direct-note dl > div {
    padding: 1px 14px;
  }

  .section-tools .sp-tool-direct-note dl > div:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  :where(.analysis-metrics, .identifier-grid) {
    grid-template-columns: 1fr !important;
  }

  :where(.analysis-metrics > *, .identifier-grid > *) {
    border-right: 0 !important;
    border-bottom: 1px solid var(--tool-archive-line) !important;
  }

  :where(.analysis-metrics > *, .identifier-grid > *):last-child {
    border-bottom: 0 !important;
  }

  body[data-page="calculation"] .calc-selector a {
    min-height: 0;
    grid-template-columns: 1fr auto;
    gap: 10px 18px;
    padding: 24px 20px !important;
  }

  body[data-page="calculation"] .calc-selector a small,
  body[data-page="calculation"] .calc-selector a p {
    grid-column: 1 / -1;
  }
}

@media (max-width: 360px) {
  .section-tools .sp-tool-flow-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .section-tools .sp-tool-flow-head > small {
    display: none;
  }

  .section-tools .sp-tool-choice {
    grid-template-columns: 40px minmax(0, 1fr) 29px;
    gap: 11px;
    padding-right: 14px;
  }

}

@media (max-width: 760px) {
  body[data-tool] .tool-nav {
    position: static !important;
  }

  body[data-tool] .workbench-section {
    scroll-margin-top: calc(var(--site-header-height, 72px) + 12px);
  }

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

@media (prefers-reduced-motion: reduce) {
  .tool-archive-media > img,
  .tool-archive-hero:hover .tool-archive-media > img {
    transform: none;
    transition: none;
  }
}
