:root {
  --enhobim-orange: #c85b31;
  --enhobim-orange-bright: #d86a2d;
  --enhobim-orange-soft: #fcf7f5;
  --enhobim-green: #006c49;
  --enhobim-green-dark: #1d4d34;
  --enhobim-green-soft: #e7f5ed;
  --enhobim-warning: #a95b05;
  --enhobim-warning-soft: #fff4df;
  --enhobim-danger: #d52b3f;
  --enhobim-danger-soft: #fff0f2;
  --enhobim-dark: #1f130f;
  --enhobim-text: #574239;
  --enhobim-muted: #62646d;
  --enhobim-border: #eeeeef;
  --enhobim-surface: #ffffff;
  --enhobim-background: #f9f9fa;
  --enhobim-shadow: 0 10px 35px rgba(31, 19, 15, 0.12);
  --enhobim-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.enhobim-calc-inline,
.enhobim-calc-modal {
  color: var(--enhobim-dark);
  font-family: var(--enhobim-font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.enhobim-calc-inline *,
.enhobim-calc-modal * {
  box-sizing: border-box;
}

.enhobim-calc-inline button,
.enhobim-calc-inline input,
.enhobim-calc-modal button,
.enhobim-calc-modal input {
  color: inherit;
  font: inherit;
}

.enhobim-calc-inline button,
.enhobim-calc-modal button {
  cursor: pointer;
}

.enhobim-calc-modal[hidden] {
  display: none;
}

.enhobim-calc-modal {
  inset: 0;
  position: fixed;
  z-index: 2147483000;
}

.enhobim-calc-overlay {
  align-items: flex-start;
  background: rgba(24, 18, 15, 0.58);
  display: flex;
  inset: 0;
  justify-content: center;
  overflow: auto;
  padding: 24px;
  position: absolute;
}

.enhobim-calc-dialog {
  background: var(--enhobim-background);
  border-radius: 20px;
  box-shadow: var(--enhobim-shadow);
  max-width: 1280px;
  min-height: min(720px, calc(100vh - 48px));
  outline: none;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.enhobim-calc-dialog-scroll {
  max-height: calc(100vh - 48px);
  overflow: auto;
  overscroll-behavior: contain;
}

.enhobim-calc-close {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  display: flex;
  height: 36px;
  justify-content: center;
  padding: 9px;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 36px;
  z-index: 5;
}

.enhobim-calc-close svg,
.enhobim-calc-title-icon svg,
.enhobim-calc-card-icon svg,
.enhobim-calc-help svg,
.enhobim-calc-empty > svg,
.enhobim-calc-scenario > svg {
  fill: none;
  height: 100%;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 100%;
}

.enhobim-calc-close:focus-visible,
.enhobim-calc-tab:focus-visible,
.enhobim-calc-quantity:focus-visible,
.enhobim-calc-inline input:focus-visible,
.enhobim-calc-modal input:focus-visible {
  outline: 3px solid rgba(216, 106, 45, 0.28);
  outline-offset: 2px;
}

.enhobim-calc-app {
  background: var(--enhobim-background);
  margin: 0 auto;
  max-width: 1280px;
  min-width: 0;
  width: 100%;
}

.enhobim-calc-header {
  align-items: center;
  border-bottom: 1px solid var(--enhobim-border);
  display: flex;
  flex-direction: column;
  padding: 24px 64px 18px;
  text-align: center;
}

.enhobim-calc-title-row {
  align-items: center;
  display: flex;
  gap: 8px;
}

.enhobim-calc-title-icon {
  color: var(--enhobim-orange-bright);
  display: block;
  height: 22px;
  width: 22px;
}

.enhobim-calc-title {
  color: var(--enhobim-orange);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 32px;
  margin: 0;
}

.enhobim-calc-subtitle {
  color: var(--enhobim-muted);
  font-size: 12px;
  margin: 2px 0 0;
}

.enhobim-calc-main {
  padding: 24px;
}

.enhobim-calc-tabs {
  background: #f3f3f4;
  border: 1px solid var(--enhobim-border);
  border-radius: 999px;
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 5px;
}

.enhobim-calc-tab {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--enhobim-muted);
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  min-height: 40px;
  padding: 8px 16px;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.enhobim-calc-tab[aria-selected="true"] {
  background: var(--enhobim-orange);
  box-shadow: 0 3px 8px rgba(200, 91, 49, 0.18);
  color: #fff;
}

.enhobim-calc-input-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.enhobim-calc-card {
  background: var(--enhobim-surface);
  border: 1px solid var(--enhobim-border);
  border-radius: 16px;
  min-width: 0;
  padding: 16px;
}

.enhobim-calc-input-card {
  min-height: 154px;
}

.enhobim-calc-card-title,
.enhobim-calc-card-heading {
  align-items: center;
  display: flex;
}

.enhobim-calc-card-title {
  font-size: 16px;
  font-weight: 600;
  gap: 8px;
  line-height: 28px;
  margin: 0;
}

.enhobim-calc-card-heading {
  justify-content: space-between;
}

.enhobim-calc-card-icon {
  align-items: center;
  background: rgba(216, 106, 45, 0.09);
  border-radius: 8px;
  color: var(--enhobim-orange-bright);
  display: inline-flex;
  flex: 0 0 auto;
  height: 34px;
  justify-content: center;
  padding: 8px;
  width: 34px;
}

.enhobim-calc-field {
  display: block;
  margin-top: 12px;
  position: relative;
}

.enhobim-calc-mold-input {
  background: #fff;
  border: 1px solid #f0f0f1;
  border-radius: 12px;
  font-size: 24px !important;
  font-weight: 700 !important;
  height: 56px;
  padding: 10px 58px 10px 14px;
  width: 100%;
}

.enhobim-calc-mold-input::placeholder {
  color: #9ca0a8;
}

.enhobim-calc-unit {
  color: #6b7280;
  font-weight: 700;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.enhobim-calc-help {
  align-items: center;
  color: #6b7280;
  display: flex;
  font-size: 11px;
  gap: 4px;
  justify-content: center;
  margin: 6px 0 0;
}

.enhobim-calc-help svg {
  height: 12px;
  width: 12px;
}

.enhobim-calc-quantities {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 12px;
}

.enhobim-calc-quantity {
  background: #fff;
  border: 1px solid #ddc1b4;
  border-radius: 8px;
  font-size: 14px !important;
  min-width: 0;
  padding: 7px 4px;
}

.enhobim-calc-quantity-active {
  background: rgba(216, 106, 45, 0.06);
  border-color: var(--enhobim-orange-bright);
  color: var(--enhobim-orange-bright) !important;
  font-weight: 700 !important;
}

.enhobim-calc-sale-wrap {
  align-items: baseline;
  color: var(--enhobim-orange-bright);
  display: flex;
  font-weight: 700;
}

.enhobim-calc-sale-input {
  appearance: textfield;
  background: transparent;
  border: 0;
  color: var(--enhobim-orange-bright) !important;
  font-weight: 700 !important;
  max-width: 78px;
  padding: 3px;
  text-align: right;
}

.enhobim-calc-range {
  --enhobim-range-progress: 0%;
  appearance: none;
  background: linear-gradient(to right, var(--enhobim-orange-bright) 0 var(--enhobim-range-progress), #ddc1b4 var(--enhobim-range-progress) 100%);
  border-radius: 8px;
  height: 8px;
  margin: 35px 0 0;
  width: 100%;
}

.enhobim-calc-range::-webkit-slider-thumb {
  appearance: none;
  background: #fff;
  border: 2px solid var(--enhobim-orange-bright);
  border-radius: 50%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.12);
  height: 24px;
  width: 24px;
}

.enhobim-calc-range::-moz-range-thumb {
  background: #fff;
  border: 2px solid var(--enhobim-orange-bright);
  border-radius: 50%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.12);
  height: 20px;
  width: 20px;
}

.enhobim-calc-range-labels {
  color: var(--enhobim-text);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  justify-content: space-between;
  margin-top: 10px;
}

.enhobim-calc-result-intro,
.enhobim-calc-break {
  padding: 17px 8px;
  text-align: center;
}

.enhobim-calc-result-intro h2,
.enhobim-calc-break h2 {
  font-size: 16px;
  margin: 0 0 3px;
}

.enhobim-calc-result-intro p,
.enhobim-calc-break p {
  color: var(--enhobim-text);
  font-size: 14px;
  margin: 0;
}

.enhobim-calc-summary-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

.enhobim-calc-revenue-card > p,
.enhobim-calc-profit-heading > p,
.enhobim-calc-material-copy {
  color: var(--enhobim-text);
  font-size: 14px;
  margin: 14px 0 12px;
}

.enhobim-calc-big-value {
  align-items: center;
  border-radius: 8px;
  display: flex;
  font-size: clamp(25px, 3.2vw, 33px);
  font-weight: 700;
  justify-content: center;
  line-height: 1.15;
  min-height: 78px;
  padding: 12px;
  text-align: center;
}

.enhobim-calc-big-value svg {
  fill: none;
  height: 22px;
  margin-left: 8px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 22px;
}

.enhobim-calc-positive-value {
  background: var(--enhobim-green-soft);
  border: 1px solid #c6e7d6;
  color: var(--enhobim-green);
}

.enhobim-calc-profit-metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: 1.8fr 0.8fr 0.8fr;
  margin-top: 0;
}

.enhobim-calc-profit-metrics > .enhobim-calc-big-value {
  background: var(--enhobim-green-soft);
  border: 1px solid #c6e7d6;
  color: var(--enhobim-green);
}

.enhobim-calc-mini-stat {
  align-items: center;
  background: var(--enhobim-orange-soft);
  border: 1px solid #efd7cd;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px;
  text-align: center;
}

.enhobim-calc-mini-stat span {
  color: var(--enhobim-text);
  font-size: 11px;
  font-weight: 600;
}

.enhobim-calc-mini-stat strong {
  color: var(--enhobim-orange-bright);
  font-size: 21px;
}

.enhobim-calc-profit-loss .enhobim-calc-profit-metrics > .enhobim-calc-big-value {
  background: var(--enhobim-danger-soft);
  border-color: #ffd2d9;
  color: var(--enhobim-danger);
}

.enhobim-calc-profit-loss .enhobim-calc-mini-stat {
  background: var(--enhobim-danger-soft);
  border-color: #ffd2d9;
}

.enhobim-calc-profit-loss .enhobim-calc-mini-stat strong {
  color: var(--enhobim-danger);
}

.enhobim-calc-profit-low .enhobim-calc-profit-metrics > .enhobim-calc-big-value {
  background: var(--enhobim-warning-soft);
  border-color: #f4d59f;
  color: var(--enhobim-warning);
}

.enhobim-calc-scenario {
  align-items: center;
  background: rgba(0, 108, 73, 0.1);
  border: 1px solid rgba(0, 108, 73, 0.2);
  border-radius: 8px;
  color: var(--enhobim-green);
  display: flex;
  gap: 14px;
  margin-top: 16px;
  padding: 20px;
}

.enhobim-calc-scenario-loss {
  background: var(--enhobim-danger-soft);
  border-color: #ffd2d9;
  color: var(--enhobim-danger);
}

.enhobim-calc-scenario-low {
  background: var(--enhobim-warning-soft);
  border-color: #f4d59f;
  color: var(--enhobim-warning);
}

.enhobim-calc-scenario > svg {
  flex: 0 0 25px;
  height: 25px;
}

.enhobim-calc-scenario p {
  font-size: 14px;
  margin: 0;
}

.enhobim-calc-detail-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
}

.enhobim-calc-cost-value {
  background: var(--enhobim-orange-soft);
  border: 1px solid #f0e4df;
  color: var(--enhobim-orange);
  margin-top: 14px;
}

.enhobim-calc-costs {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.enhobim-calc-cost-row {
  align-items: center;
  display: flex;
  font-size: 14px;
  gap: 12px;
  justify-content: space-between;
}

.enhobim-calc-cost-input-wrap {
  align-items: center;
  border: 1px solid var(--enhobim-border);
  border-radius: 5px;
  display: flex;
  flex: 0 0 118px;
  padding-right: 6px;
}

.enhobim-calc-cost-input-wrap input {
  appearance: textfield;
  background: transparent;
  border: 0;
  min-width: 0;
  padding: 5px 2px 5px 6px;
  text-align: right;
  width: 100%;
}

.enhobim-calc-material-copy {
  text-align: center;
}

.enhobim-calc-materials {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}

.enhobim-calc-material {
  background: #f3f3f4;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 76px;
  padding: 14px;
}

.enhobim-calc-material span {
  color: var(--enhobim-orange);
  font-size: 12px;
  font-weight: 600;
}

.enhobim-calc-material strong {
  font-size: 18px;
}

.enhobim-calc-legal {
  color: var(--enhobim-muted);
  font-size: 11px;
  line-height: 1.45;
  padding: 24px 8px 8px;
  text-align: center;
}

.enhobim-calc-empty {
  align-items: center;
  background: #fff8f4;
  border: 1px dashed #ddc1b4;
  border-radius: 12px;
  color: var(--enhobim-orange);
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding: 20px;
}

.enhobim-calc-empty > svg {
  flex: 0 0 24px;
  height: 24px;
}

.enhobim-calc-empty p {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.enhobim-calc-empty span {
  color: var(--enhobim-muted);
  font-size: 12px;
}

.enhobim-calc-sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@media (max-width: 1023px) {
  .enhobim-calc-input-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .enhobim-calc-input-grid > :last-child {
    grid-column: 1 / -1;
  }

}

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

  .enhobim-calc-dialog {
    border-radius: 0;
    min-height: 100vh;
  }

  .enhobim-calc-dialog-scroll {
    max-height: 100vh;
  }

  .enhobim-calc-close {
    height: 32px;
    right: 8px;
    top: 8px;
    width: 32px;
  }

  .enhobim-calc-header {
    padding: 18px 42px 14px;
  }

  .enhobim-calc-title {
    font-size: 20px;
    line-height: 28px;
  }

  .enhobim-calc-title-icon {
    height: 18px;
    width: 18px;
  }

  .enhobim-calc-subtitle {
    line-height: 1.35;
  }

  .enhobim-calc-main {
    padding: 16px 12px;
  }

  .enhobim-calc-tabs {
    margin-bottom: 14px;
  }

  .enhobim-calc-tab {
    font-size: 12px;
    min-height: 34px;
    padding: 6px;
  }

  .enhobim-calc-input-grid,
  .enhobim-calc-summary-grid,
  .enhobim-calc-detail-grid {
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .enhobim-calc-profit-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .enhobim-calc-profit-metrics > .enhobim-calc-big-value {
    grid-column: 1 / -1;
  }

  .enhobim-calc-input-grid > :last-child {
    grid-column: auto;
  }

  .enhobim-calc-card {
    border-radius: 12px;
    padding: 12px;
  }

  .enhobim-calc-input-card {
    min-height: 0;
  }

  .enhobim-calc-card-title {
    font-size: 14px;
  }

  .enhobim-calc-card-icon {
    height: 28px;
    padding: 6px;
    width: 28px;
  }

  .enhobim-calc-quantities {
    margin-top: 10px;
  }

  .enhobim-calc-range {
    margin-top: 24px;
  }

  .enhobim-calc-result-intro,
  .enhobim-calc-break {
    padding: 15px 4px;
  }

  .enhobim-calc-result-intro p,
  .enhobim-calc-break p,
  .enhobim-calc-revenue-card > p,
  .enhobim-calc-profit-heading > p,
  .enhobim-calc-material-copy {
    font-size: 12px;
  }

  .enhobim-calc-profit-metrics {
    gap: 8px;
  }

  .enhobim-calc-big-value {
    font-size: 25px;
    min-height: 64px;
  }

  .enhobim-calc-mini-stat strong {
    font-size: 18px;
  }

  .enhobim-calc-scenario {
    align-items: flex-start;
    margin-top: 12px;
    padding: 14px;
  }

  .enhobim-calc-scenario p {
    font-size: 12px;
  }

  .enhobim-calc-material {
    min-height: 68px;
    padding: 11px;
  }

  .enhobim-calc-material strong {
    font-size: 16px;
  }

  .enhobim-calc-cost-row {
    font-size: 12px;
  }

  .enhobim-calc-cost-input-wrap {
    flex-basis: 108px;
  }

  .enhobim-calc-legal {
    font-size: 9px;
    padding-top: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .enhobim-calc-inline *,
  .enhobim-calc-modal * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
