:root {
  --em-yellow: #ffde00;
  --em-yellow-dark: #e0bd00;
  --em-ink: #171717;
  --em-muted: #6b6b70;
  --em-line: #e5e5e7;
  --em-soft: #f6f6f7;
  --em-white: #fff;
}

body.em-calc-locked {
  overflow: hidden;
}

.em-calc-open {
  align-items: center;
  background: var(--em-yellow);
  border: 0;
  border-radius: 4px;
  color: var(--em-ink);
  cursor: pointer;
  display: inline-flex;
  font: 700 14px/1 Arial, sans-serif;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
}

.em-calc-open:hover {
  background: #f3d200;
}

.em-calc-overlay {
  background: rgba(0, 0, 0, 0.66);
  display: none;
  inset: 0;
  padding: 20px;
  position: fixed;
  z-index: 100000;
}

.em-calc-overlay.is-open {
  display: flex;
}

.em-calc-dialog {
  background: var(--em-white);
  border-radius: 6px;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr);
  height: min(900px, calc(100vh - 40px));
  margin: auto;
  max-width: 1280px;
  overflow: hidden;
  width: 100%;
}

.em-calc-header {
  align-items: center;
  border-bottom: 1px solid var(--em-line);
  display: flex;
  gap: 14px;
  grid-column: 1 / -1;
  padding: 0 20px;
}

.em-calc-brand {
  font: 800 18px/1 Arial, sans-serif;
}

.em-calc-brand span {
  background: var(--em-yellow);
  padding: 5px 7px;
}

.em-calc-heading {
  color: var(--em-muted);
  font: 600 14px/1.3 Arial, sans-serif;
}

.em-calc-close {
  background: transparent;
  border: 0;
  color: var(--em-ink);
  cursor: pointer;
  font: 400 32px/1 Arial, sans-serif;
  height: 42px;
  margin-left: auto;
  width: 42px;
}

.em-calc-nav {
  border-right: 1px solid var(--em-line);
  overflow: auto;
  padding: 12px 0 24px;
}

.em-calc-nav-title {
  color: var(--em-muted);
  font: 700 11px/1 Arial, sans-serif;
  letter-spacing: 0;
  margin: 16px 18px 8px;
  text-transform: uppercase;
}

.em-calc-nav-button {
  background: transparent;
  border: 0;
  border-left: 4px solid transparent;
  color: var(--em-ink);
  cursor: pointer;
  display: block;
  font: 600 13px/1.25 Arial, sans-serif;
  min-height: 42px;
  padding: 8px 14px;
  text-align: left;
  width: 100%;
}

.em-calc-nav-button:hover {
  background: var(--em-soft);
}

.em-calc-nav-button.is-active {
  background: #fff9cc;
  border-left-color: var(--em-yellow-dark);
}

.em-calc-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 0;
  overflow: auto;
}

.em-calc-form-wrap {
  padding: 26px 36px 42px;
}

.em-calc-title {
  font: 800 28px/1.2 Arial, sans-serif;
  margin: 0 0 8px;
}

.em-calc-note {
  color: var(--em-muted);
  font: 400 13px/1.45 Arial, sans-serif;
  margin: 0 0 26px;
}

.em-calc-fields {
  border-top: 1px solid var(--em-line);
  display: block;
}

.em-calc-group {
  background: #fafafa;
  border: 1px solid var(--em-line);
  border-radius: 12px;
  padding: 2px 16px;
  margin: 14px 0;
}

.em-calc-group:nth-of-type(even) {
  background: #f2f5f8;
}

.em-calc-group .em-calc-field:last-child {
  border-bottom: none;
}

.em-calc-group-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--em-muted, #8a8f98);
  padding: 14px 0 8px;
}

.em-calc-field {
  align-items: center;
  border-bottom: 1px solid var(--em-line);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.2fr);
  min-width: 0;
  padding: 13px 0;
}

.em-calc-field-wide {
  grid-column: auto;
}

.em-calc-dimensions {
  display: none;
}

.em-calc-dimensions.is-visible {
  display: grid;
}

.em-calc-dimensions > div {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
}

.em-calc-input:disabled {
  background: #eee;
  color: #999;
}

.em-calc-field label,
.em-calc-field legend {
  color: var(--em-ink);
  display: block;
  font: 700 13px/1.3 Arial, sans-serif;
  margin: 0;
}

.em-calc-input,
.em-calc-select {
  background: var(--em-white);
  border: 1px solid #cfcfd2;
  border-radius: 3px;
  box-sizing: border-box;
  color: var(--em-ink);
  font: 400 15px/1.2 Arial, sans-serif;
  height: 44px;
  padding: 0 12px;
  width: 100%;
}

.em-calc-input:focus,
.em-calc-select:focus {
  border-color: #111;
  outline: 2px solid rgba(255, 222, 0, 0.45);
}

.em-calc-checkbox {
  align-items: center;
  border: 1px solid var(--em-line);
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
}

.em-calc-checkbox input {
  accent-color: var(--em-yellow-dark);
  height: 18px;
  width: 18px;
}

.em-calc-checkbox span {
  font: 600 13px/1.25 Arial, sans-serif;
}

.em-calc-summary {
  background: #fafafa;
  border-left: 1px solid var(--em-line);
  padding: 28px 24px;
}

.em-calc-summary-label {
  color: var(--em-muted);
  font: 700 12px/1.2 Arial, sans-serif;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.em-calc-price {
  font: 800 34px/1.1 Arial, sans-serif;
  margin-bottom: 4px;
}

.em-calc-unit-price {
  color: var(--em-muted);
  font: 400 13px/1.4 Arial, sans-serif;
  margin-bottom: 24px;
}

.em-calc-metrics {
  border-bottom: 1px solid var(--em-line);
  border-top: 1px solid var(--em-line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 18px;
}

.em-calc-metrics > div {
  padding: 13px 0;
}

.em-calc-metrics > div + div {
  border-left: 1px solid var(--em-line);
  padding-left: 16px;
}

.em-calc-metrics span {
  color: var(--em-muted);
  display: block;
  font: 600 11px/1.2 Arial, sans-serif;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.em-calc-metrics strong {
  font: 700 15px/1.2 Arial, sans-serif;
}

.em-calc-breakdown {
  border-bottom: 1px solid var(--em-line);
  margin-bottom: 20px;
  padding: 12px 0;
}

.em-calc-breakdown summary {
  cursor: pointer;
  font: 600 12px/1.4 Arial, sans-serif;
  padding: 2px 0 8px;
}

.em-calc-breakdown-row {
  display: flex;
  font: 400 13px/1.4 Arial, sans-serif;
  gap: 10px;
  justify-content: space-between;
  padding: 5px 0;
}

.em-calc-breakdown-row span:last-child {
  font-weight: 700;
  white-space: nowrap;
}

.em-calc-order {
  background: var(--em-yellow);
  border: 0;
  border-radius: 4px;
  color: var(--em-ink);
  cursor: pointer;
  font: 800 15px/1 Arial, sans-serif;
  min-height: 48px;
  padding: 0 18px;
  width: 100%;
}

.em-calc-order:hover {
  background: #f3d200;
}

.em-calc-order-form {
  display: none;
  gap: 10px;
  margin-top: 14px;
}

.em-calc-order-form.is-open {
  display: grid;
}

.em-calc-order-form .em-calc-input {
  background: var(--em-white);
}

.em-calc-order-submit {
  background: var(--em-ink);
  border: 0;
  border-radius: 4px;
  color: var(--em-white);
  cursor: pointer;
  font: 700 14px/1 Arial, sans-serif;
  min-height: 44px;
  padding: 0 14px;
}

.em-calc-order-status {
  color: var(--em-muted);
  font: 400 12px/1.4 Arial, sans-serif;
  margin: 0;
}

.em-calc-disclaimer {
  color: var(--em-muted);
  font: 400 11px/1.45 Arial, sans-serif;
  margin: 12px 0 0;
}

.em-calc-mobile-nav {
  display: none;
}

@media (max-width: 900px) {
  .em-calc-overlay {
    padding: 0;
  }

  .em-calc-dialog {
    border-radius: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: none;
  }

  .em-calc-header {
    flex: 0 0 60px;
  }

  .em-calc-heading,
  .em-calc-nav {
    display: none;
  }

  .em-calc-mobile-nav {
    display: block;
    padding: 12px 16px 0;
  }

  .em-calc-content {
    display: block;
    overflow: auto;
  }

  .em-calc-form-wrap {
    padding: 20px 16px 28px;
  }

  .em-calc-title {
    font-size: 22px;
  }

  .em-calc-fields {
    border-top: 1px solid var(--em-line);
  }

  .em-calc-field,
  .em-calc-dimensions.is-visible {
    display: block;
    padding: 13px 0;
  }

  .em-calc-dimensions:not(.is-visible) {
    display: none;
  }

  .em-calc-field label {
    margin-bottom: 7px;
  }

  .em-calc-summary {
    border-left: 0;
    border-top: 1px solid var(--em-line);
  }
}
