:root {
  color-scheme: light;
  --graphite: #111318;
  --titanium: #f6f7f9;
  --precision: #007a8a;
  --ink: var(--graphite);
  --ink-soft: #333842;
  --muted: #707783;
  --quiet: #9aa2ad;
  --line: #dde3e9;
  --line-strong: #c4ccd5;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --field: var(--titanium);
  --field-strong: #edf1f5;
  --page: var(--titanium);
  --accent: var(--precision);
  --accent-deep: #075462;
  --gold: #d69a1f;
  --gold-soft: rgba(214, 154, 31, 0.18);
  --copper: var(--precision);
  --blue: var(--precision);
  --warn: #a95f00;
  --danger: #a02c2c;
  --ok: #166a52;
  --shadow: 0 24px 70px rgba(22, 29, 37, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% -12%, rgba(0, 122, 138, 0.14), transparent 34rem),
    radial-gradient(circle at 8% 48%, rgba(17, 19, 24, 0.055), transparent 32rem),
    linear-gradient(180deg, #fbfcfd 0%, var(--titanium) 44%, #eef2f4 100%);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(17, 19, 24, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 19, 24, 0.028) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 82%);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    url("data:image/svg+xml,%3Csvg width='430' height='430' viewBox='0 0 430 430' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round' font-family='Arial, sans-serif'%3E%3Cg stroke='%23111318' stroke-opacity='.5' stroke-width='1.6'%3E%3Ccircle cx='216' cy='214' r='118'/%3E%3Ccircle cx='216' cy='214' r='82'/%3E%3Ccircle cx='216' cy='214' r='50'/%3E%3Ccircle cx='216' cy='214' r='24'/%3E%3Cpath d='M216 44v340M46 214h340M90 318l252-208M92 110l250 206'/%3E%3Ccircle cx='216' cy='86' r='13'/%3E%3Ccircle cx='216' cy='342' r='13'/%3E%3Ccircle cx='88' cy='214' r='13'/%3E%3Ccircle cx='344' cy='214' r='13'/%3E%3Ccircle cx='126' cy='124' r='12'/%3E%3Ccircle cx='306' cy='124' r='12'/%3E%3Ccircle cx='126' cy='304' r='12'/%3E%3Ccircle cx='306' cy='304' r='12'/%3E%3Cpath d='M78 368h276M78 350v36M354 350v36M110 372l-20-8M110 372l-20 8M322 372l20-8M322 372l20 8'/%3E%3Cpath d='M378 80h-82l-44 68M248 142l-10 22M386 96h-80'/%3E%3Cpath d='M78 58h72v30H78zM306 42h92v30h-92zM306 84h76v30h-76z'/%3E%3C/g%3E%3Cg stroke='%23d69a1f' stroke-opacity='.74' stroke-width='1.8'%3E%3Cpath d='M70 32h142M70 32l18-10M70 32l18 10M212 32l-18-10M212 32l-18 10'/%3E%3Cpath d='M62 388h308'/%3E%3C/g%3E%3Cg fill='%23111318' fill-opacity='.48' font-size='15'%3E%3Ctext x='86' y='78'%3EØ 0.10 A%3C/text%3E%3Ctext x='314' y='62'%3E8X Ø7.9%3C/text%3E%3Ctext x='314' y='104'%3EØ86%3C/text%3E%3Ctext x='160' y='406'%3EØ57.6 / 56.6%3C/text%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg width='480' height='360' viewBox='0 0 480 360' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round' font-family='Arial, sans-serif'%3E%3Cg stroke='%23111318' stroke-opacity='.48' stroke-width='1.5'%3E%3Cpath d='M44 198h128l34-42h68l30 42h124'/%3E%3Cpath d='M76 96h74v206H76zM150 126h46v146h-46M196 150h86v98h-86M282 126h58v146h-58'/%3E%3Cpath d='M80 112l-30 30M80 140l-30 30M80 168l-30 30M80 196l-30 30M80 224l-30 30M80 252l-30 30M340 132l-42 42M340 160l-42 42M340 188l-42 42M340 216l-42 42'/%3E%3Cpath d='M38 316h374M78 292v42M340 292v42M90 320l-18-8M90 320l-18 8M328 320l18-8M328 320l18 8'/%3E%3Cpath d='M30 86h112M30 86v48M142 86v48M54 94l-18-8M54 94l-18 8M118 94l18-8M118 94l18 8'/%3E%3Cpath d='M352 82h78l-44 54M368 92h56M364 148h74M360 148l-38 52'/%3E%3Cpath d='M24 58h74v28H24zM320 44h96v28h-96zM366 148h80v28h-80z'/%3E%3C/g%3E%3Cg stroke='%23d69a1f' stroke-opacity='.72' stroke-width='1.8'%3E%3Cpath d='M138 342h160M138 342l18-12M138 342l18 12M298 342l-18-12M298 342l-18 12'/%3E%3Cpath d='M406 188l36-42'/%3E%3C/g%3E%3Cg fill='%23111318' fill-opacity='.48' font-size='14'%3E%3Ctext x='34' y='77'%3E⊥ Ø0.08 A%3C/text%3E%3Ctext x='330' y='63'%3EM42 X 1.5%3C/text%3E%3Ctext x='374' y='168'%3E0.1 B%3C/text%3E%3Ctext x='178' y='338'%3E41.3 / 41.1%3C/text%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(circle at 92% 10%, rgba(214, 154, 31, 0.16), transparent 14rem),
    radial-gradient(circle at 4% 88%, rgba(214, 154, 31, 0.12), transparent 14rem);
  background-size: min(430px, 34vw) auto, min(480px, 38vw) auto, auto, auto;
  background-position: right 32px top 118px, left 22px bottom 40px, right top, left bottom;
  background-repeat: no-repeat;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.home-shell {
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(100%, 1640px);
  max-width: 1640px;
  margin: 0 auto;
  padding: 14px 18px 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 36px rgba(22, 29, 37, 0.08);
  backdrop-filter: blur(22px);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid #cfd7df;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.brand-mark strong {
  display: block;
  font-size: clamp(0.92rem, 1.4vw, 1rem);
  line-height: 1.1;
}

.brand-mark small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: min(560px, 48vw);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
}

.topnav a {
  flex: 1 1 0;
  min-width: 104px;
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 800;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.topnav a:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.topnav a[aria-current="page"] {
  background: var(--panel-solid);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(22, 29, 37, 0.08);
}

.home-hero,
.engineer-section {
  width: 100%;
  max-width: 1640px;
  margin: 0 auto;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  gap: 18px;
  align-items: stretch;
}

.hero-copy,
.hero-instrument,
.engineer-section {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 520px;
  padding: clamp(28px, 5vw, 72px);
}

.hero-copy h1 {
  max-width: 850px;
  font-size: clamp(3rem, 7vw, 6.8rem);
  line-height: 0.95;
}

.hero-copy .lede {
  max-width: 680px;
  margin-top: 22px;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  text-decoration: none;
  font-weight: 850;
}

.primary-link {
  background: linear-gradient(180deg, #177895, #0c617a);
  color: #fff;
  border-color: #0c617a;
  box-shadow: 0 14px 28px rgba(15, 111, 140, 0.22);
}

.secondary-link {
  background: linear-gradient(180deg, #ffffff, #edf2f6);
  color: var(--ink);
}

.hero-instrument {
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  min-height: 520px;
}

.instrument-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.instrument-top span,
.instrument-grid span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.instrument-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.instrument-grid > div {
  padding: 18px;
  background: rgba(255, 255, 255, 0.84);
}

.instrument-grid strong {
  margin-top: 8px;
  font-size: clamp(1.35rem, 2.2vw, 2.2rem);
}

.instrument-diagram {
  position: relative;
  min-height: 300px;
  background:
    linear-gradient(rgba(22, 29, 37, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 29, 37, 0.04) 1px, transparent 1px),
    #f8fafc;
  background-size: 28px 28px;
}

.instrument-diagram .rail,
.instrument-diagram .drop,
.instrument-diagram .curve,
.instrument-diagram .node {
  position: absolute;
  display: block;
}

.instrument-diagram .rail {
  left: 12%;
  right: 10%;
  top: 28%;
  height: 5px;
  background: #9baaa4;
}

.instrument-diagram .drop {
  left: 24%;
  top: 28%;
  width: 4px;
  height: 45%;
  background: repeating-linear-gradient(to bottom, #98a2ac 0, #98a2ac 7px, transparent 7px, transparent 13px);
}

.instrument-diagram .curve {
  left: 24%;
  top: 28%;
  width: 58%;
  height: 48%;
  border-left: 5px solid transparent;
  border-bottom: 5px solid var(--accent);
  border-radius: 0 0 78% 0;
  transform: skewX(-16deg);
  transform-origin: left top;
}

.instrument-diagram .node {
  width: 14px;
  height: 14px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 8px 18px rgba(22, 29, 37, 0.22);
}

.instrument-diagram .anchor {
  left: calc(24% - 7px);
  top: calc(28% - 7px);
}

.instrument-diagram .socket {
  left: calc(48% - 7px);
  top: calc(56% - 7px);
  background: var(--blue);
}

.instrument-diagram .floor {
  left: calc(80% - 7px);
  top: calc(75% - 7px);
  background: var(--accent);
}

.engineer-section {
  padding: clamp(20px, 3vw, 34px);
}

.section-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 14px;
}

.section-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 86px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--precision), transparent);
  transform-origin: left center;
  transition: width 420ms ease, opacity 420ms ease;
}

.section-heading h2 {
  margin: 0;
  color: #101318;
  font-size: clamp(1.7rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.engineer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.engineer-card {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.engineer-card.is-featured {
  border-color: rgba(15, 111, 140, 0.38);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(236, 248, 250, 0.9));
  box-shadow: inset 3px 0 0 var(--accent);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card-index,
.card-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 900;
}

.card-index {
  justify-content: center;
  width: 42px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--accent-deep);
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.card-status {
  padding: 0 9px;
  border: 1px solid rgba(214, 154, 31, 0.34);
  background: linear-gradient(180deg, rgba(255, 249, 225, 0.92), rgba(255, 232, 168, 0.54));
  color: #7b4b00;
  transition: background 220ms ease, border-color 220ms ease;
}

.engineer-card h3 {
  margin: 0;
  color: #101318;
  font-size: 1.35rem;
  line-height: 1.08;
}

.engineer-card p {
  margin: 12px 0 18px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.calculator-list {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.calculator-row {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: inherit;
  text-decoration: none;
}

.calculator-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--precision);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 260ms ease;
}

.calculator-row.is-live {
  border-color: rgba(15, 111, 140, 0.32);
  background: #ffffff;
}

.calculator-row.is-live b {
  border-color: rgba(15, 111, 140, 0.28);
  background: rgba(15, 111, 140, 0.08);
  color: var(--accent-deep);
}

.calculator-row strong {
  font-size: 0.95rem;
}

.calculator-row small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.3;
}

.calculator-row b {
  flex: 0 0 auto;
  color: #7b4b00;
  font-size: 0.78rem;
  padding: 5px 8px;
  border: 1px solid rgba(214, 154, 31, 0.3);
  border-radius: 8px;
  background: rgba(255, 246, 219, 0.72);
  transition: transform 220ms ease, color 220ms ease;
}

.home-topbar {
  position: sticky;
  top: 18px;
  z-index: 10;
}

.hero-stage {
  position: relative;
  display: grid;
  align-items: end;
  min-height: clamp(640px, 86vh, 860px);
  width: 100%;
  max-width: 1640px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(17, 19, 24, 0.94), rgba(17, 19, 24, 0.78)),
    radial-gradient(circle at 72% 18%, rgba(0, 122, 138, 0.42), transparent 34rem),
    var(--graphite);
  box-shadow: var(--shadow);
  isolation: isolate;
  transition: transform 420ms ease, box-shadow 420ms ease, border-color 420ms ease;
}

.hero-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(246, 247, 249, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 247, 249, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1), transparent 92%);
  animation: blueprintDrift 24s linear infinite;
}

.hero-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(17, 19, 24, 0.96), transparent 42%),
    linear-gradient(112deg, transparent 18%, rgba(246, 247, 249, 0.08), transparent 34%);
  opacity: 0.82;
  transform: translateX(-18%);
  transition: transform 900ms ease, opacity 900ms ease;
  pointer-events: none;
}

.hero-stage:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 122, 138, 0.36);
  box-shadow: 0 30px 90px rgba(17, 19, 24, 0.18);
}

.hero-stage:hover::after {
  opacity: 1;
  transform: translateX(18%);
}

.hero-stage:hover .scene-line {
  animation-duration: 3.8s;
}

.hero-stage:hover .scene-node {
  transform: scale(1.14);
  animation-duration: 2.2s;
}

.hero-stage:hover .scene-readout {
  border-color: rgba(0, 122, 138, 0.42);
  background: rgba(0, 122, 138, 0.12);
}

.blueprint-scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.96;
}

.scene-line,
.scene-node,
.scene-readout {
  position: absolute;
  display: block;
}

.scene-line {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(246, 247, 249, 0.8), rgba(0, 122, 138, 0.96));
  box-shadow: 0 0 28px rgba(0, 122, 138, 0.34);
  transform-origin: left center;
  animation: lineTrace 7s ease-in-out infinite;
}

.scene-line-a {
  width: 48%;
  left: 18%;
  top: 28%;
  transform: rotate(0deg);
}

.scene-line-b {
  width: 42%;
  left: 28%;
  top: 34%;
  transform: rotate(46deg);
  animation-delay: -1.6s;
}

.scene-line-c {
  width: 38%;
  right: 9%;
  top: 72%;
  transform: rotate(0deg);
  animation-delay: -3s;
}

.scene-node {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(246, 247, 249, 0.86);
  border-radius: 50%;
  background: var(--precision);
  box-shadow: 0 0 0 0 rgba(0, 122, 138, 0.42);
  transition: transform 260ms ease, background 260ms ease;
  animation: nodePulse 3.8s ease-in-out infinite;
}

.scene-node-a {
  left: 18%;
  top: calc(28% - 8px);
}

.scene-node-b {
  left: 50%;
  top: calc(56% - 8px);
  animation-delay: -1.1s;
}

.scene-node-c {
  right: 14%;
  top: calc(72% - 8px);
  animation-delay: -2s;
}

.scene-readout {
  padding: 8px 10px;
  border: 1px solid rgba(246, 247, 249, 0.16);
  border-radius: 8px;
  background: rgba(246, 247, 249, 0.08);
  color: rgba(246, 247, 249, 0.86);
  font-size: 0.78rem;
  font-weight: 900;
  backdrop-filter: blur(16px);
  transition: border-color 260ms ease, background 260ms ease, transform 260ms ease;
  animation: readoutFloat 6s ease-in-out infinite;
}

.readout-a {
  left: 15%;
  top: 18%;
}

.readout-b {
  left: 51%;
  top: 45%;
  animation-delay: -2s;
}

.readout-c {
  right: 9%;
  top: 61%;
  animation-delay: -3.8s;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  padding: clamp(28px, 6vw, 88px);
  color: var(--titanium);
}

.hero-content .eyebrow {
  color: #7be1ed;
}

.hero-content h1 {
  max-width: 900px;
  color: var(--titanium);
  font-size: clamp(3.2rem, 8vw, 7.4rem);
  line-height: 0.92;
}

.hero-content .lede {
  max-width: 680px;
  color: rgba(246, 247, 249, 0.76);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
}

.hero-metrics {
  position: absolute;
  right: clamp(18px, 4vw, 58px);
  bottom: clamp(18px, 4vw, 58px);
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(246, 247, 249, 0.16);
  border-radius: 8px;
  background: rgba(246, 247, 249, 0.14);
  backdrop-filter: blur(22px);
}

.hero-metrics > div {
  padding: 16px;
  background: rgba(246, 247, 249, 0.08);
}

.hero-metrics span {
  display: block;
  color: rgba(246, 247, 249, 0.62);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-metrics strong {
  margin-top: 8px;
  color: var(--titanium);
  font-size: 1.7rem;
}

.discipline-section {
  position: relative;
  overflow: hidden;
  scroll-margin-top: 112px;
  width: 100%;
  max-width: 1640px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px);
  transition: border-color 340ms ease, box-shadow 340ms ease, transform 340ms ease;
}

.calculator-reference {
  position: relative;
  overflow: hidden;
  width: min(100%, 1640px);
  max-width: 1640px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px);
  transition: transform 340ms ease, border-color 340ms ease, box-shadow 340ms ease;
}

.calculator-reference::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(0, 122, 138, 0.08), transparent),
    linear-gradient(rgba(17, 19, 24, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 19, 24, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 34px 34px, 34px 34px;
  opacity: 0;
  transform: translateX(-10%);
  transition: opacity 420ms ease, transform 700ms ease;
  pointer-events: none;
}

.calculator-reference:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 122, 138, 0.28);
  box-shadow: 0 26px 76px rgba(17, 19, 24, 0.14);
}

.calculator-reference:hover::before {
  opacity: 1;
  transform: translateX(10%);
}

.calculator-reference:hover .section-heading::after {
  width: min(280px, 45vw);
}

.reference-layout,
.input-reference-grid {
  position: relative;
  z-index: 1;
}

.reference-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.reference-panel,
.input-reference-grid article {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(246, 247, 249, 0.72)),
    var(--panel-solid);
  transition: transform 260ms ease, border-color 260ms ease, box-shadow 260ms ease;
}

.reference-panel {
  min-height: 240px;
  padding: clamp(18px, 3vw, 28px);
}

.reference-panel::before,
.input-reference-grid article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--precision);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 260ms ease;
}

.reference-panel:hover,
.input-reference-grid article:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 122, 138, 0.36);
  box-shadow: 0 14px 34px rgba(17, 19, 24, 0.08);
}

.reference-panel:hover::before,
.input-reference-grid article:hover::before {
  transform: scaleY(1);
}

.reference-panel h3,
.input-reference-grid h3 {
  margin: 14px 0 10px;
  color: #101318;
  font-size: 1.08rem;
  line-height: 1.15;
}

.reference-panel p,
.input-reference-grid p,
.formula-list {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.reference-panel p {
  margin: 0 0 12px;
}

.formula-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding-left: 18px;
}

.formula-list strong {
  display: inline;
  font-size: inherit;
}

.input-reference-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.input-reference-grid article {
  min-height: 150px;
  padding: 16px;
}

.input-reference-grid h3 {
  font-size: 0.98rem;
}

.input-reference-grid p {
  margin: 0;
}

.method-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(0, 122, 138, 0.24), transparent 34rem),
    rgba(17, 19, 24, 0.58);
  color: var(--ink);
  backdrop-filter: blur(12px);
}

.method-dialog.is-open {
  display: grid;
}

.method-dialog-panel {
  position: relative;
  overflow: auto;
  width: min(1180px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(rgba(17, 19, 24, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 19, 24, 0.025) 1px, transparent 1px),
    rgba(255, 255, 255, 0.94);
  background-size: 34px 34px;
  box-shadow: 0 34px 110px rgba(17, 19, 24, 0.28);
}

body.modal-open {
  overflow: hidden;
}

.method-dialog-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0, 122, 138, 0.08), transparent);
  pointer-events: none;
}

.method-dialog-header,
.method-heading,
.method-dialog .reference-layout,
.method-dialog .input-reference-grid {
  position: relative;
  z-index: 1;
}

.method-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.method-dialog-header h2 {
  margin: 0;
  color: #101318;
  font-size: clamp(2rem, 5vw, 4.3rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.method-heading h2 {
  font-size: clamp(1.2rem, 2vw, 2rem);
}

.discipline-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(0, 122, 138, 0.08), transparent),
    linear-gradient(rgba(17, 19, 24, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 19, 24, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 34px 34px, 34px 34px;
  opacity: 0;
  transform: translateX(-10%);
  transition: opacity 420ms ease, transform 700ms ease;
  pointer-events: none;
}

.discipline-section:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 122, 138, 0.28);
  box-shadow: 0 26px 76px rgba(17, 19, 24, 0.14);
}

.discipline-section:hover::before {
  opacity: 1;
  transform: translateX(10%);
}

.discipline-section:hover .section-heading::after {
  width: min(280px, 45vw);
}

.discipline-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.discipline-index {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 8px;
}

.discipline-index a {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  text-decoration: none;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.discipline-index a:hover,
.discipline-index a[aria-current="page"] {
  transform: translateY(-2px);
  border-color: rgba(0, 122, 138, 0.42);
  background: #ffffff;
  color: var(--ink);
}

.discipline-index span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--accent-deep);
  font-size: 0.76rem;
  font-weight: 900;
}

.discipline-index strong {
  font-size: 0.95rem;
}

.discipline-stack {
  display: grid;
  gap: 12px;
}

.discipline-panel {
  position: relative;
  overflow: hidden;
  scroll-margin-top: 112px;
  min-height: 310px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(246, 247, 249, 0.72)),
    var(--panel-solid);
  transition: transform 300ms ease, border-color 300ms ease, box-shadow 300ms ease, background 300ms ease;
}

.discipline-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(0, 122, 138, 0.1), transparent);
  transform: translateX(-120%);
  transition: transform 700ms ease;
}

.discipline-panel::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 96px;
  height: 96px;
  border-right: 2px solid rgba(0, 122, 138, 0.22);
  border-bottom: 2px solid rgba(0, 122, 138, 0.22);
  opacity: 0;
  transform: translate(10px, 10px);
  transition: opacity 300ms ease, transform 300ms ease;
  pointer-events: none;
}

.discipline-panel:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 122, 138, 0.38);
  box-shadow: 0 18px 46px rgba(17, 19, 24, 0.1);
}

.discipline-panel:hover::before {
  transform: translateX(120%);
}

.discipline-panel:hover::after {
  opacity: 1;
  transform: translate(0, 0);
}

.discipline-panel:hover .card-index {
  transform: translateY(-2px) scale(1.04);
  border-color: rgba(0, 122, 138, 0.36);
  animation: indexTick 900ms ease both;
}

.discipline-panel:hover .card-status {
  background: rgba(0, 122, 138, 0.12);
  border-color: rgba(0, 122, 138, 0.3);
}

.discipline-panel:hover .calculator-row:nth-child(1) {
  transform: translateX(4px);
}

.discipline-panel:hover .calculator-row:nth-child(2) {
  transform: translateX(8px);
}

.discipline-panel:hover .calculator-row:nth-child(3) {
  transform: translateX(12px);
}

.discipline-panel.is-featured {
  border-color: rgba(0, 122, 138, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 247, 249, 0.9)),
    var(--panel-solid);
  box-shadow: inset 3px 0 0 var(--precision);
}

.panel-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.panel-header > div {
  display: grid;
  gap: 12px;
}

.discipline-panel h3 {
  margin: 0;
  color: #101318;
  font-size: clamp(1.55rem, 2.6vw, 2.4rem);
  line-height: 1;
}

.discipline-panel p,
.discipline-panel .calculator-list {
  position: relative;
  z-index: 1;
}

.discipline-panel p {
  max-width: 720px;
  margin: 14px 0 24px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.calculator-row {
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.calculator-row:hover {
  transform: translateX(4px);
  border-color: rgba(0, 122, 138, 0.38);
  box-shadow: 0 10px 24px rgba(17, 19, 24, 0.08);
}

.calculator-row:hover::before {
  transform: scaleY(1);
}

.calculator-row:hover b {
  transform: translateX(3px);
}

.calculator-row > span,
.calculator-row b {
  position: relative;
  z-index: 1;
}

.primary-link,
.secondary-link,
.primary-button,
.secondary-button,
.icon-button {
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, border-color 180ms ease;
}

.primary-link:hover,
.secondary-link:hover,
.primary-button:hover,
.secondary-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.reveal-up {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes blueprintDrift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 88px 44px, 88px 44px;
  }
}

@keyframes lineTrace {
  0%,
  100% {
    opacity: 0.42;
    clip-path: inset(0 100% 0 0);
  }
  42%,
  72% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes nodePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 122, 138, 0.36);
  }
  52% {
    box-shadow: 0 0 0 18px rgba(0, 122, 138, 0);
  }
}

@keyframes readoutFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes indexTick {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 122, 138, 0);
  }
  42% {
    box-shadow: 0 0 0 8px rgba(0, 122, 138, 0.1);
  }
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  max-width: 1640px;
  min-height: calc(100vh - 104px);
  margin: 0 auto;
}

.controls,
.visual-panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px);
  transition: transform 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.controls:hover,
.visual-panel:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 122, 138, 0.28);
  box-shadow: 0 26px 76px rgba(17, 19, 24, 0.14);
}

.visual-panel:hover canvas {
  border-color: rgba(0, 122, 138, 0.3);
}

.controls:hover .library-item.is-active {
  transform: translateX(4px);
}

.controls {
  padding: 20px;
  overflow: auto;
}

.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.tool-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #101318;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.lede {
  max-width: 33rem;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #edf2f6);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.05rem;
  box-shadow: 0 7px 18px rgba(22, 29, 37, 0.08);
}

.icon-button:hover {
  border-color: rgba(15, 111, 140, 0.55);
  color: var(--accent);
}

.tool-actions .method-button {
  border-color: rgba(230, 151, 0, 0.68);
  background: linear-gradient(180deg, #fff8d7, #ffd86b);
  color: #6d3a00;
  font-size: 1.18rem;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(212, 128, 0, 0.28), 0 0 0 3px rgba(255, 216, 107, 0.28);
}

.tool-actions .method-button:hover {
  border-color: rgba(15, 111, 140, 0.72);
  background: linear-gradient(180deg, #e7fbff, #55c9dd);
  color: #073f4a;
  box-shadow: 0 12px 28px rgba(15, 111, 140, 0.28), 0 0 0 4px rgba(85, 201, 221, 0.25);
}

.calculator-library {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.library-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  text-align: left;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.library-item.is-active {
  border-color: rgba(15, 111, 140, 0.35);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(235, 246, 249, 0.92));
  box-shadow: inset 3px 0 0 var(--accent), 0 10px 22px rgba(22, 29, 37, 0.07);
}

.library-item:disabled {
  opacity: 0.62;
}

.library-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--accent-deep);
  font-size: 0.76rem;
  font-weight: 900;
}

.library-item strong {
  display: block;
  font-size: 0.93rem;
  line-height: 1.15;
}

.library-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.input-grid {
  display: grid;
  gap: 13px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  color: var(--ink);
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.check-row span {
  font-size: 0.9rem;
}

.input-row,
.field-select {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(246, 248, 250, 0.9);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.input-row:focus-within,
.field-select:focus {
  outline: 3px solid rgba(15, 111, 140, 0.16);
  border-color: rgba(15, 111, 140, 0.72);
}

input,
select {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
}

input {
  min-width: 0;
  padding: 11px 10px 11px 12px;
}

select {
  padding: 0 12px;
}

.unit-select {
  width: 82px;
  align-self: stretch;
  flex: 0 0 82px;
  padding: 0 8px;
  border-left: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
}

.unit-select:focus {
  outline: 3px solid rgba(15, 111, 140, 0.16);
  outline-offset: -3px;
}

.input-row span {
  padding: 0 12px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  white-space: nowrap;
}

.input-row.is-disabled {
  opacity: 0.58;
}

.hidden {
  display: none;
}

.visual-panel {
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-self: start;
  min-width: 0;
  overflow: hidden;
}

.result-strip,
.details-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.result-strip {
  border-bottom: 1px solid var(--line);
}

.details-grid {
  border-top: 1px solid var(--line);
}

.result-strip > div,
.details-grid > div {
  min-width: 0;
  padding: 17px 16px;
  background: rgba(255, 255, 255, 0.82);
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-marker {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 0.68rem;
  line-height: 1;
  vertical-align: 1px;
}

.marker-a {
  background: #2a64c7;
}

.marker-b {
  background: #176b5b;
}

.marker-c {
  background: #b45d00;
}

.marker-d {
  background: #9b4aa0;
}

.marker-e {
  background: #a02c2c;
}

.marker-f {
  background: #007a8a;
}

strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.22rem;
  line-height: 1.15;
}

.result-strip strong {
  font-size: 1.34rem;
}

.result-value {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.result-value strong {
  min-width: 0;
}

.result-unit {
  width: 64px;
  min-height: 32px;
  flex: 0 0 64px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.contact-shell {
  gap: 18px;
}

.contact-page {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
  width: min(100%, 1640px);
  max-width: 1640px;
  margin: 0 auto;
  align-items: start;
}

.contact-intro,
.contact-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 54px rgba(22, 29, 37, 0.08);
}

.contact-intro {
  min-height: 360px;
  padding: clamp(24px, 4vw, 46px);
}

.contact-intro h1 {
  max-width: 680px;
}

.contact-form {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 30px);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.contact-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 760;
}

.contact-form input,
.contact-form select {
  min-height: 44px;
  padding: 0 12px;
}

.contact-form textarea {
  min-height: 170px;
  padding: 12px;
  resize: vertical;
  line-height: 1.45;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: 3px solid rgba(15, 111, 140, 0.16);
  border-color: rgba(15, 111, 140, 0.72);
}

.contact-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.contact-actions .primary-button {
  min-width: 180px;
  padding: 0 18px;
}

.contact-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.contact-status.success {
  color: var(--ok);
}

.contact-status.error {
  color: var(--danger);
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 5px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  font-weight: 850;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(180deg, #177895, #0c617a);
  color: #fff;
  border-color: #0c617a;
  box-shadow: 0 12px 24px rgba(15, 111, 140, 0.22);
}

.secondary-button {
  background: linear-gradient(180deg, #ffffff, #edf2f6);
  color: var(--ink);
}

.primary-button:hover,
.secondary-button:hover {
  filter: brightness(0.97);
}

.secondary-button.compact {
  min-height: 34px;
  padding: 0 12px;
}

.saved-panel {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.saved-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.saved-table-wrap {
  overflow: auto;
  max-height: 220px;
}

.saved-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.saved-table th,
.saved-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.saved-table th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.delete-row-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #f0c4bd;
  border-radius: 8px;
  background: #fff5f3;
  color: var(--danger);
  font-weight: 800;
  cursor: pointer;
}

.status-banner {
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(22, 106, 82, 0.1), rgba(42, 100, 199, 0.08));
  border-bottom: 1px solid var(--line);
  color: var(--ok);
  font-weight: 850;
  line-height: 1.35;
}

.status-banner.warn {
  background: #fff6e7;
  color: var(--warn);
}

.status-banner.danger {
  background: #fff0ed;
  color: var(--danger);
}

.canvas-wrap {
  height: clamp(420px, 52vh, 560px);
  min-height: 0;
  padding: 12px;
  background:
    linear-gradient(rgba(22, 29, 37, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 29, 37, 0.035) 1px, transparent 1px),
    #f8fafc;
  background-size: 28px 28px;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 396px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

@media (max-width: 1080px) {
  .hero-stage {
    min-height: 780px;
  }

  .hero-metrics {
    left: clamp(18px, 4vw, 58px);
    right: clamp(18px, 4vw, 58px);
  }

  .discipline-layout {
    grid-template-columns: 1fr;
  }

  .reference-layout {
    grid-template-columns: 1fr;
  }

  .input-reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .discipline-index {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .home-hero {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-instrument {
    min-height: auto;
  }

  .engineer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .controls {
    overflow: visible;
  }

  .calculator-library {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .hero-stage {
    min-height: 820px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .contact-page {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .discipline-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topnav {
    min-width: 0;
    width: 100%;
    overflow-x: auto;
  }

  .topnav a {
    min-width: 96px;
  }

  .calculator-library,
  .result-strip,
  .details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-copy {
    padding: 26px;
  }

  .hero-copy h1 {
    font-size: clamp(2.65rem, 13vw, 4.4rem);
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 10px;
  }

  .topbar {
    margin-bottom: 10px;
  }

  .topnav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
  }

  .topnav a {
    min-width: 0;
    padding: 8px 6px;
    font-size: 0.78rem;
  }

  .calculator-reference {
    padding: 16px;
  }

  .method-dialog {
    padding: 10px;
  }

  .method-dialog-panel {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .method-dialog-header {
    align-items: flex-start;
  }

  .input-reference-grid {
    grid-template-columns: 1fr;
  }

  .home-shell {
    gap: 10px;
  }

  .home-topbar {
    top: 10px;
  }

  .hero-stage {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 720px;
  }

  .hero-content {
    align-self: start;
    padding: 26px;
  }

  .hero-content h1 {
    font-size: clamp(2.75rem, 13vw, 4.2rem);
  }

  .hero-content .lede {
    color: rgba(246, 247, 249, 0.82);
  }

  .hero-metrics {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: auto;
    margin: 0 16px 16px;
  }

  .hero-metrics > div {
    padding: 12px 9px;
  }

  .hero-metrics span {
    font-size: 0.62rem;
  }

  .hero-metrics strong {
    font-size: 1.25rem;
  }

  .blueprint-scene {
    opacity: 0.5;
  }

  .scene-readout {
    display: none;
  }

  .scene-line-a {
    width: 72%;
    left: 12%;
    top: 46%;
  }

  .scene-line-b {
    width: 62%;
    left: 18%;
    top: 52%;
  }

  .scene-line-c {
    width: 64%;
    right: 9%;
    top: 74%;
  }

  .readout-a {
    left: 10%;
    top: 38%;
  }

  .readout-b {
    left: 44%;
    top: 59%;
  }

  .readout-c {
    right: 9%;
    top: 68%;
  }

  .hero-actions {
    flex-direction: column;
  }

  .primary-link,
  .secondary-link {
    width: 100%;
  }

  .instrument-grid,
  .engineer-grid {
    grid-template-columns: 1fr;
  }

  .instrument-diagram {
    min-height: 240px;
  }

  .engineer-section {
    padding: 16px;
  }

  .engineer-card {
    min-height: auto;
  }

  .discipline-section {
    padding: 16px;
  }

  .discipline-index {
    grid-template-columns: 1fr;
  }

  .panel-header {
    flex-direction: column;
  }

  .workspace {
    min-height: calc(100vh - 20px);
    gap: 10px;
  }

  .controls {
    padding: 16px;
  }

  .brand-row {
    align-items: flex-start;
  }

  .calculator-library,
  .result-strip,
  .details-grid,
  .action-row {
    grid-template-columns: 1fr;
  }

  .result-strip strong,
  strong {
    font-size: 1.08rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal-up {
    opacity: 1;
    transform: none;
  }
}
