:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-strong: #172026;
  --surface-soft: #e8eef2;
  --ink: #172026;
  --muted: #69777f;
  --line: #d8e0e5;
  --accent: #cf2637;
  --accent-strong: #a81727;
  --blue: #1f6f8f;
  --green: #18764f;
  --amber: #9b6415;
  --shadow: 0 18px 50px rgba(23, 32, 38, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(207, 38, 55, 0.08), transparent 26rem),
    linear-gradient(45deg, rgba(31, 111, 143, 0.09), transparent 28rem),
    var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto 18px;
  padding: 20px 24px;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
  width: clamp(150px, 11vw, 184px);
  height: clamp(44px, 3.4vw, 56px);
  padding: 8px 14px;
  background: #fff;
  border-radius: 6px;
  object-fit: contain;
}

.brandline {
  margin: 0 0 4px;
  color: #ffe8eb;
  font-size: clamp(15px, 1.1vw, 20px);
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 2.8vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.inputs-panel .panel-heading h2 {
  font-size: 34px;
  line-height: 1.1;
}

.topbar-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  gap: 8px;
  padding: 0 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 17px;
  font-weight: 750;
}

.primary-button {
  color: var(--accent);
  background: #fff;
}

.primary-button:hover {
  background: #ffe8eb;
}

.ghost-button {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.ghost-button svg,
.icon-only-button svg,
.contact-link svg {
  display: block;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-only-button {
  flex: 0 0 54px;
  width: 54px;
  min-width: 54px;
  max-width: 54px;
  padding: 0;
  overflow: hidden;
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(216, 224, 229, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contact-panel {
  max-width: 1400px;
  margin: 0 auto 22px;
  overflow: hidden;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px;
  min-width: 0;
  background: var(--surface);
}

.contact-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 360px;
  width: clamp(230px, 22vw, 360px);
  min-width: 0;
  height: 96px;
  padding: 12px;
  background: #f8fafb;
  border: 1px solid rgba(216, 224, 229, 0.95);
  border-radius: var(--radius);
  overflow: hidden;
}

.hamwic-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.contact-details {
  flex: 1 1 auto;
  color: var(--ink);
}

.contact-details h2 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: clamp(22px, 1.5vw, 28px);
}

.contact-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
  font-size: clamp(15px, 1vw, 18px);
  font-weight: 850;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  max-width: 100%;
  padding: 0 14px;
  color: var(--accent);
  background: #fde8eb;
  border-radius: 999px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-link:hover {
  background: #ffe1e6;
  text-decoration: underline;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(380px, 1fr) minmax(330px, 420px);
  gap: 18px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  align-items: start;
  min-width: 0;
}

.inputs-panel {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.result-stack {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  gap: 18px;
  min-width: 0;
}

.right-stack {
  grid-column: 3;
  grid-row: 1;
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 0;
}

.panel-heading p,
.quote-panel p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.status-pill,
.quote-ref,
#tableContext {
  flex: 0 0 auto;
  padding: 7px 9px;
  color: var(--accent);
  background: #fde8eb;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.sizing-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

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

.project-info-grid {
  gap: 16px 14px;
}

.project-name-field {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.pricing-fieldset legend,
.metric-label {
  color: #40505a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.inputs-panel input,
.inputs-panel select {
  padding: 0 10px;
  font-size: 15px;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(207, 38, 55, 0.14);
}

.input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 44px;
  overflow: hidden;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.input-with-unit:focus-within,
.stepper-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(207, 38, 55, 0.14);
}

.input-with-unit input,
.stepper-input input {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.input-with-unit span {
  padding: 0 12px;
  color: var(--muted);
}

.inputs-panel .input-with-unit span {
  padding: 0 8px;
}

.stepper-input {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  overflow: hidden;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.stepper-input input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  text-align: center;
  appearance: textfield;
}

.stepper-input input::-webkit-outer-spin-button,
.stepper-input input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.stepper-input button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  color: var(--accent);
  background: #fff1f2;
  border: 0;
  border-radius: 0;
  font-size: 20px;
  font-weight: 850;
  line-height: 1;
}

.stepper-input button:hover {
  background: #ffe3e7;
}

.pricing-fieldset {
  margin: 4px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pricing-fieldset legend {
  padding: 0 6px;
}

.method-note {
  padding: 11px 12px;
  color: #40505a;
  background: #fff0f2;
  border: 1px solid #f4cbd1;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.45;
}

.is-hidden {
  display: none !important;
}

.zone-list {
  display: grid;
  gap: 12px;
}

.zone-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.zone-core-grid,
.zone-demand-grid {
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.zone-actuator-fields,
.zone-pump-fields,
.zone-handing-fields {
  grid-template-columns: 1fr;
}

.system-accessory-list {
  display: grid;
  gap: 10px;
}

.system-accessory-item {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  grid-template-areas:
    "thumb copy"
    "meta meta";
  align-items: start;
  gap: 12px;
  padding: 12px;
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.system-accessory-copy {
  display: grid;
  grid-area: copy;
  gap: 5px;
  min-width: 0;
}

.system-accessory-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 86px;
  overflow: hidden;
  color: var(--accent);
  background: rgb(203 203 203);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  grid-area: thumb;
}

.system-accessory-copy div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.system-accessory-copy strong {
  font-size: 14px;
}

.system-accessory-copy span {
  padding: 4px 7px;
  color: var(--accent);
  background: #fde8eb;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.system-accessory-copy p,
.empty-accessory-state {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.system-accessory-meta {
  display: grid;
  grid-area: meta;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  justify-items: stretch;
}

.system-accessory-meta > span {
  color: #40505a;
  font-size: 12px;
  font-weight: 850;
}

.accessory-stepper {
  width: 100%;
  max-width: none;
}

.empty-accessory-state {
  padding: 12px;
  background: #fbfcfd;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.zone-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.zone-card-head strong {
  font-size: 15px;
}

.zone-card-head span {
  flex: 0 0 auto;
  padding: 6px 8px;
  color: var(--accent);
  background: #fde8eb;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.zone-type-help {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 6px;
  margin-top: 7px;
}

.tooltip-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  min-width: 0;
  width: 100%;
  padding: 4px 8px;
  color: var(--accent);
  background: #fff4f5;
  border: 1px solid #f4c8ce;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  cursor: help;
}

.tooltip-chip::after {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 8px);
  left: 0;
  width: min(260px, 78vw);
  padding: 9px 10px;
  color: #fff;
  background: #1d232b;
  border-radius: 6px;
  box-shadow: 0 12px 24px rgba(27, 32, 40, 0.22);
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.tooltip-chip:focus {
  outline: 2px solid rgba(199, 45, 57, 0.28);
  outline-offset: 2px;
}

.tooltip-chip:hover::after,
.tooltip-chip:focus::after {
  opacity: 1;
  transform: translateY(0);
}

.zone-actuator-note,
.zone-thermostat-note,
.zone-pump-note,
.zone-accessory-note {
  margin-top: -2px;
  padding: 9px 10px;
}

.add-button {
  min-height: 44px;
  padding: 0 14px;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
}

.add-button:hover {
  background: var(--accent-strong);
}

.recommendation-panel {
  min-height: 285px;
  padding: 22px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(207, 38, 55, 0.92), rgba(23, 32, 38, 0.96)),
    var(--surface-strong);
  border-color: rgba(255, 255, 255, 0.1);
}

.recommendation-panel.enterprise {
  background:
    linear-gradient(135deg, rgba(155, 100, 21, 0.92), rgba(23, 32, 38, 0.96)),
    var(--surface-strong);
}

.product-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin-bottom: 7px;
  color: #ffd9dd;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.product-header h2 {
  margin: 0;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 0.98;
  letter-spacing: 0;
}

.product-image-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 clamp(128px, 28vw, 198px);
  width: clamp(128px, 28vw, 198px);
  aspect-ratio: 4 / 3;
  padding: 7px;
  overflow: hidden;
  background: rgb(203 203 203);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
}

.product-image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.capacity-row,
.demand-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.capacity-row {
  margin-top: 28px;
}

.demand-summary {
  margin-top: 12px;
}

.capacity-row > div,
.demand-summary > div {
  min-height: 90px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
}

.capacity-row strong,
.demand-summary strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.1;
}

.recommendation-panel .metric-label {
  color: #ffc8ce;
}

.callout {
  margin-top: 16px;
  padding: 14px;
  color: #fff;
  background: rgba(0, 0, 0, 0.18);
  border-left: 4px solid #fff;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.45;
}

.buffer-panel,
.pipe-panel,
.schematic-panel,
.quote-panel {
  padding-bottom: 18px;
}

.buffer-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
}

.buffer-metrics > div {
  min-height: 92px;
  padding: 13px;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.buffer-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 21px;
  line-height: 1.15;
}

.zone-load-summary,
.zone-results {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.zone-load-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-bottom: 0;
}

.zone-load-summary > div {
  min-height: 96px;
  padding: 13px;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.zone-load-summary > div.is-fit {
  background: #ecf8f3;
  border-color: rgba(15, 126, 83, 0.26);
}

.zone-load-summary > div.is-short {
  background: #fff4f5;
  border-color: #cf2637;
}

.zone-load-summary strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.15;
}

.zone-load-summary p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.zone-result {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr) minmax(82px, auto);
  gap: 12px;
  align-items: start;
  min-height: 92px;
  padding: 13px;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.zone-result.is-warning {
  background: #fff4f5;
  border-color: #cf2637;
}

.zone-result strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.15;
}

.zone-result p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.quote-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 18px 0;
}

.quote-lines {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.quote-section-heading {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  padding: 10px 12px;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.quote-section-heading:first-child {
  margin-top: 0;
}

.quote-section-heading span {
  color: #111820;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.quote-section-heading p {
  margin: 0;
  color: #40505a;
  font-size: 12px;
  line-height: 1.35;
}

.quote-line {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) minmax(52px, auto) minmax(92px, auto) minmax(100px, auto);
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.quote-line:last-child {
  border-bottom: 0;
}

.quote-line h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.quote-line p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.quote-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  overflow: hidden;
  color: var(--accent);
  background: rgb(203 203 203);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.quote-thumb svg,
.system-accessory-thumb svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-thumb-image {
  display: block;
  width: 100%;
  height: 100%;
  padding: 6px;
  object-fit: contain;
}

.line-code,
.line-qty,
.line-price {
  display: grid;
  gap: 4px;
  justify-items: end;
  text-align: right;
  font-weight: 850;
  white-space: nowrap;
}

.line-code span,
.line-qty span,
.line-price span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.totals {
  display: grid;
  gap: 9px;
  margin: 0 18px;
  padding: 16px;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.totals > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.totals strong {
  color: var(--ink);
}

.totals .grand-total {
  margin-top: 7px;
  padding-top: 12px;
  color: var(--ink);
  border-top: 1px solid var(--line);
  font-size: 17px;
  font-weight: 850;
}

.save-selection-box,
.email-quote {
  display: grid;
  gap: 8px;
  margin: 12px 18px 0;
  padding: 16px;
  background: #fff1f2;
  border: 1px solid #ffcbd2;
  border-radius: var(--radius);
}

.save-selection-box > span {
  color: #40505a;
  font-size: 12px;
  font-weight: 800;
}

.email-quote > span {
  color: #40505a;
  font-size: 12px;
  font-weight: 800;
}

.save-selection-row,
.email-quote-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.save-selection-box p,
.email-quote p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.schematic-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  margin: 18px;
  padding: 14px;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.launch-map {
  width: 100%;
}

.schematic-coming-soon .launch-map {
  filter: blur(6px);
  opacity: 0.42;
  transform: scale(1.02);
}

.coming-soon-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(248, 250, 251, 0.45);
  font-size: clamp(26px, 2.5vw, 38px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  pointer-events: none;
}

.launch-map svg {
  display: block;
  width: 100%;
  height: auto;
}

.map-box {
  stroke: #d1dbe0;
  stroke-width: 2;
}

.map-box.muted {
  fill: #eef3f6;
}

.map-box.warm {
  fill: #fff0f2;
}

.map-box.core {
  fill: #fff;
  stroke: var(--accent);
}

.map-box.app {
  fill: #eaf5f8;
  stroke: var(--blue);
}

.map-box.success {
  fill: #e9f5ef;
  stroke: var(--green);
}

.map-line {
  fill: none;
  stroke-width: 4;
}

.map-line.red,
#arrow path {
  fill: var(--accent);
  stroke: var(--accent);
}

.map-line.blue {
  stroke: var(--blue);
}

.map-line.orange {
  stroke: #f58220;
}

.launch-map text {
  fill: #40505a;
  font-size: 21px;
  font-weight: 900;
  text-anchor: middle;
}

.range-panel {
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 16px 18px 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  overflow-wrap: anywhere;
  white-space: normal;
}

th:nth-child(1),
td:nth-child(1) {
  width: 38%;
}

th:nth-child(2),
td:nth-child(2) {
  width: 30%;
}

th:nth-child(3),
td:nth-child(3) {
  width: 32%;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

tbody tr.selected {
  background: #fff0f2;
}

tbody tr.unavailable {
  color: #9aa5ab;
}

.result-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.result-tag.fit {
  color: var(--green);
  background: #e6f4ee;
}

.result-tag.selected {
  color: var(--accent);
  background: #fde8eb;
}

.result-tag.short {
  color: var(--amber);
  background: #fff2d9;
}

.result-tag.zero {
  color: #69777f;
  background: #eef2f4;
}

@media (max-width: 1280px) {
  .topbar,
  .contact-panel {
    max-width: 880px;
  }

  .workspace {
    max-width: 880px;
    grid-template-columns: minmax(0, 1fr);
  }

  .inputs-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .result-stack {
    grid-column: 1;
    grid-row: auto;
  }

  .right-stack {
    grid-column: 1;
    grid-row: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
}

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

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

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .brand-mark {
    width: 142px;
    height: 44px;
  }

  .topbar-actions,
  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .workspace,
  .field-grid,
  .quote-controls,
  .capacity-row,
    .demand-summary,
    .buffer-metrics,
    .zone-load-summary,
    .zone-result,
  .email-quote-row,
  .save-selection-row {
    grid-template-columns: 1fr;
  }

  .inputs-panel,
  .result-stack,
  .right-stack {
    grid-column: 1;
    grid-row: auto;
  }

  .quote-line {
    grid-template-columns: 1fr;
  }

  .line-code,
  .line-qty,
  .line-price {
    justify-items: start;
    text-align: left;
  }

  .system-accessory-copy p {
    max-width: 100%;
  }

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

  .product-header h2 {
    font-size: 42px;
  }

  .product-image-frame {
    flex-basis: 118px;
    width: 118px;
  }

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

  .contact-logo {
    flex-basis: auto;
  }

  .table-wrap {
    padding: 12px;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tbody tr {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  td {
    display: grid;
    grid-template-columns: minmax(96px, 0.34fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0;
    border-bottom: 0;
  }

  th:nth-child(1),
  td:nth-child(1),
  th:nth-child(2),
  td:nth-child(2),
  th:nth-child(3),
  td:nth-child(3) {
    width: 100%;
  }

  .result-tag {
    justify-self: start;
    min-height: 30px;
    white-space: normal;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
  }
}

@media print {
  body {
    background: #fff;
  }

  .app-shell {
    padding: 0;
  }

  .topbar-actions,
  .inputs-panel,
  .contact-panel,
  .range-panel {
    display: none;
  }

  .topbar,
  .workspace,
  .result-stack {
    display: block;
    max-width: none;
    margin: 0;
  }

  .topbar,
  .panel,
  .recommendation-panel {
    color: #172026;
    background: #fff;
    box-shadow: none;
    border-color: #cfd8dd;
  }

  .recommendation-panel .metric-label,
  .eyebrow,
  .brandline {
    color: #40505a;
  }

  .brand-mark {
    padding-left: 0;
    background: transparent;
  }
}
