.model-div,
.position-div {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  height: 46px;
  padding: 5px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background-color: var(--bg-field);
}

.model-button,
.position-button {
  flex: 1;
  height: 100%;
  border: 0;
  border-radius: 4px;
  background-color: var(--bg-field);
  color: var(--primary-text-color);
}

.active-model-btn,
.active-position-btn {
  background-color: var(--primary-color);
}

.position-div {
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

.heatmap-note {
  width: 622px;
  margin: 12px 0 18px;
  color: #b9bdd0;
  font-size: 12px;
  font-weight: 200;
}

.position-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 622px;
  margin-bottom: 18px;
}

.position-summary div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-field);
}

.position-summary span {
  color: #b9bdd0;
  font-size: 11px;
}

.position-summary strong {
  font-size: 14px;
  font-weight: 600;
}

.color-scale {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: 622px;
  margin-top: 12px;
  color: #b9bdd0;
  font-size: 11px;
}

.color-gradient {
  height: 9px;
  border-radius: 20px;
  background: linear-gradient(90deg, hsl(0, 72%, 38%), hsl(35, 60%, 38%), hsl(220, 12%, 28%), hsl(155, 55%, 35%), hsl(120, 58%, 39%));
}

.inner-element-grid {
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.15;
}

.v-plane {
  width: 622px;
  height: 622px;
}

.x {
  width: 622px;
}

.current-scenario {
  outline: 2px solid #fff;
  outline-offset: -3px;
}

.summary-positive {
  color: #63d39b;
}

.summary-negative {
  color: #ff7d7d;
}

.section-label {
  font-weight: 600 !important;
}

.greeks-fields {
  width: 100%;
}

.greeks-grid,
.position-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.greeks-grid label,
.position-grid label {
  font-size: 13px;
  font-weight: 300;
}

.greeks-grid input,
.position-grid input {
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  padding: 0 15px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--bg-field);
  color: var(--primary-text-color);
  font-size: 17px;
}

.greeks-grid input:focus,
.position-grid input:focus {
  border-color: var(--primary-color);
  outline: 0;
}

.position-grid {
  width: 100%;
  margin-top: 20px;
}

.scenario-grid {
  margin-top: 18px;
}

.field-note {
  color: #b9bdd0;
  font-size: 12px !important;
  line-height: 1.4;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.forms {
  box-sizing: border-box;
  flex: 0 0 480px;
  width: 480px;
  padding: 28px;
  gap: 14px;
}

.form-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  width: 100%;
  padding-bottom: 4px;
}

.form-heading span {
  color: #aeb4ca;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.form-heading h2 {
  margin: 5px 0 0;
  font-size: 22px;
  font-weight: 650;
}

.form-heading .form-hint {
  letter-spacing: 0;
  text-transform: none;
}

.control-section {
  box-sizing: border-box;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(30, 32, 48, .48);
}

.control-section-title {
  margin-bottom: 13px;
  color: #cdd1df;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.toggle-grid,
.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  width: 100%;
}

.toggle-group,
.input-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  color: #c3c7d5;
  font-size: 12px;
  font-weight: 450;
}

.model-toggle {
  margin-top: 13px;
}

.model-div,
.position-div,
.option-div {
  width: 100%;
  height: 40px;
  margin: 0;
}

.input-grid input {
  box-sizing: border-box;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background-color: var(--bg-field);
  color: var(--primary-text-color);
  font-family: inherit;
  font-size: 15px;
}

.input-grid input:focus {
  border-color: var(--primary-color);
  outline: 2px solid rgba(99, 102, 241, .16);
}

.input-grid input::placeholder {
  color: #73798e;
}

.full-width {
  grid-column: 1 / -1;
}

.time-div {
  gap: 7px;
  min-width: 0;
}

.time-div input {
  min-width: 0;
}

.forms .calculate-profit-button {
  height: 52px;
  margin-top: 2px;
  border-radius: 9px;
  font-size: 16px;
  font-weight: 650;
}

.greeks-fields {
  width: 100%;
}

.greeks-fields .field-note {
  margin: 12px 0 0;
  padding: 0;
}

@media screen and (max-width: 1360px) {
  .grid-form-container {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }

  .heatmap-full,
  .forms,
  .info-div {
    box-sizing: border-box;
    max-width: 848.6px;
    width: 100%;
  }

  .forms {
    flex-basis: auto;
    width: 100%;
    order: 1;
  }

  .heatmap-full {
    order: 2;
  }
}

@media screen and (max-width: 744px) {
  body {
    overflow-x: clip;
  }

  .heatmap-note {
    width: 90%;
  }

  .position-summary {
    grid-template-columns: 1fr;
    width: 90%;
  }

  .color-scale {
    width: 90%;
  }

  .greeks-grid,
  .position-grid {
    grid-template-columns: 1fr;
  }

  .forms {
    gap: 12px;
    padding: 20px;
  }

  .form-heading {
    align-items: start;
  }

  .form-heading .form-hint {
    display: none;
  }

  .control-section {
    padding: 14px;
  }

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

  .full-width {
    grid-column: auto;
  }

  .heatmap-container,
  .x,
  .v-plane,
  .x-labels {
    min-width: 0;
  }

  .heatmap-container {
    margin-right: 0;
  }

  .x,
  .v-plane {
    max-width: none;
  }

  .x {
    flex: 1 1 auto;
    width: calc(100% - 40px);
  }

  .v-plane {
    width: 100%;
    max-width: 622px;
  }

  .v-plane {
    height: auto;
    aspect-ratio: 1;
  }

  .x-labels {
    width: 100%;
  }

  .x-grid-label {
    flex: 1;
    width: auto;
  }

  .inner-element-grid {
    min-width: 0;
    overflow: hidden;
    font-size: clamp(6px, 2.25vw, 10px) !important;
    line-height: 1.05;
  }

  .x-grid-label,
  .y-grid-label {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
  }
}

@media screen and (max-width: 400px) {
  .title {
    padding: 20px 4px;
    font-size: 24px;
  }

  .heatmap-full,
  .forms {
    border-radius: 20px;
  }

  .heatmap-title {
    font-size: 22px;
  }

  .position-summary,
  .color-scale,
  .display-title,
  .display-button-div {
    width: calc(100% - 32px);
  }

  .heatmap-container {
    width: calc(100% - 8px);
  }

  .x-labels {
    width: 100%;
  }

  .y-labels {
    width: 36px;
    margin-left: 0;
    margin-right: 4px;
    align-items: end;
  }

  .y-box {
    flex: 0 0 36px;
  }
}
