#content.stock-profit-page {
  color: #172033;
}

.stock-profit-page * {
  box-sizing: border-box;
}

.profit-heading {
  margin-bottom: 30px;
}

.profit-eyebrow {
  margin: 0 0 12px;
  color: #087f6d;
  font-size: 14px;
  font-weight: 800;
}

.profit-heading h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.2;
}

.profit-heading > p:last-child {
  max-width: 790px;
  margin: 20px 0 0;
  color: #60708c;
  font-size: 18px;
  line-height: 1.8;
}

.profit-calculator,
.profit-guide {
  overflow: hidden;
  border: 1px solid #d7e0ec;
  border-radius: 8px;
  background: #fff;
}

.profit-calculator {
  margin: 0;
}

.cost-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 20px;
  border-bottom: 1px solid #dfe6ef;
  background: #f7f9fc;
}

.cost-presets button,
.calculate-button,
.secondary-button,
.subtle-button {
  min-height: 48px;
  border: 1px solid #ccd7e6;
  border-radius: 7px;
  background: #fff;
  color: #26364f;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.cost-presets button:hover,
.cost-presets button.active {
  border-color: #0b8a76;
  background: #e6f5f1;
  color: #08705f;
}

.preset-note {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: #6c7890;
  font-size: 13px;
  line-height: 1.6;
}

.profit-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, .92fr);
}

.profit-form,
.profit-result {
  min-width: 0;
  padding: 28px;
}

.profit-form {
  border-right: 1px solid #dfe6ef;
}

.form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.form-head > div {
  flex: 1 1 auto;
  min-width: 0;
}

.profit-form .subtle-button {
  flex: 0 0 auto;
  width: auto;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #ccd7e6;
  background: #eef2f7;
  color: #26364f;
}

.form-head,
.result-head,
.target-head {
  margin-bottom: 22px;
}

.form-head h2,
.result-head h2,
.target-head h2,
.profit-guide h2 {
  margin: 0 0 8px;
  font-size: 25px;
}

.form-head p,
.result-head p,
.target-head p {
  margin: 0;
  color: #718099;
  line-height: 1.65;
}

.field-grid {
  display: grid;
  gap: 16px;
}

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

.cost-fields {
  min-width: 0;
  margin-top: 16px;
  padding: 20px 0 0;
  border: 0;
  padding-top: 20px;
  border-top: 1px solid #e1e7ef;
}

.cost-fields legend {
  padding: 0;
  color: #25344c;
  font-weight: 800;
}

.cost-fields > p {
  margin: 4px 0 14px;
  color: #6c7890;
  font-size: 13px;
  line-height: 1.6;
}

.cost-fields > .field-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid label,
.target-layout label {
  display: block;
  min-width: 0;
  color: #25344c;
  font-size: 14px;
  font-weight: 800;
}

.input-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 56px;
  margin-top: 8px;
  padding: 0 15px;
  border: 1px solid #cdd9e8;
  border-radius: 7px;
  background: #fff;
}

.input-unit:focus-within {
  border-color: #0b8a76;
  box-shadow: 0 0 0 3px rgba(11, 138, 118, .12);
}

.input-unit input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #142036;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
}

.input-unit span,
.input-unit b {
  padding-left: 8px;
  color: #6e7c94;
  font-weight: 500;
  white-space: nowrap;
}

.field-grid small {
  display: block;
  margin-top: 6px;
  color: #8490a4;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.form-message {
  min-height: 22px;
  margin: 14px 0 8px;
  color: #cf4737;
  font-size: 13px;
}

.form-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}

.calculate-button {
  width: 100%;
  border-color: #0b8a76;
  background: #0b8a76;
  color: #fff;
}

.calculate-button:hover {
  background: #076f60;
}

.secondary-button {
  background: #eef2f7;
}

.profit-result {
  background: #f8fafc;
}

.result-hero {
  padding: 22px;
  border: 1px solid #b8ded6;
  border-radius: 8px;
  background: #eaf7f4;
}

.result-hero > span {
  color: #557069;
  font-size: 13px;
  font-weight: 800;
}

.result-hero strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1.15;
}

.result-hero p {
  margin: 10px 0 0;
  color: #546a69;
  line-height: 1.6;
}

.positive {
  color: #087f6d !important;
}

.negative {
  color: #d24838 !important;
}

.neutral {
  color: #172033 !important;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.result-grid > div,
.break-even,
.target-result {
  min-width: 0;
  padding: 16px;
  border: 1px solid #d7e0ec;
  border-radius: 7px;
  background: #fff;
}

.result-grid span,
.break-even span,
.target-result span {
  display: block;
  color: #748198;
  font-size: 12px;
}

.result-grid strong,
.break-even strong,
.target-result strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.break-even {
  margin-top: 10px;
  border-left: 4px solid #e0a11b;
}

.cost-detail {
  margin: 18px 0 0;
  border-top: 1px solid #dbe3ed;
}

.cost-detail div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 2px;
  border-bottom: 1px solid #e4e9f0;
  color: #596780;
  font-size: 14px;
}

.cost-detail strong {
  color: #21314a;
}

.target-calculator {
  margin: 28px 0 0;
  padding: 28px;
  border: 1px solid #d7e0ec;
  border-radius: 8px;
  background: #fff;
}

.target-calculator > header,
.profit-guide > header {
  margin: 0 0 22px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.target-calculator > header > h2,
.profit-guide > header > h2 {
  margin: 0 0 8px;
  color: #172033;
  font-size: 25px;
  line-height: 1.35;
  letter-spacing: 0;
}

.target-calculator > header > p:last-child,
.profit-guide > header > p:last-child {
  max-width: none;
  margin: 0;
  padding: 0;
  color: #66758d;
  font-size: 16px;
  font-style: normal;
  line-height: 1.7;
}

.target-layout {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
  gap: 16px;
  align-items: stretch;
}

.target-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff9ea;
  border-color: #ead69d;
}

.target-result p {
  margin: 8px 0 0;
  color: #7b6941;
  line-height: 1.55;
}

.profit-guide {
  margin: 28px 0 0;
  padding: 30px;
}

.profit-guide > p {
  margin: 0 0 24px;
  color: #66758d;
  line-height: 1.7;
}

.formula-box {
  padding: 22px;
  border-left: 4px solid #0b8a76;
  background: #f0f8f6;
}

.formula-box h3,
.guide-grid h3 {
  margin: 0 0 10px;
  font-size: 19px;
}

.formula-box p,
.guide-grid p {
  margin: 0;
  color: #596b82;
  line-height: 1.75;
}

.formula-box code {
  display: inline-block;
  margin-top: 10px;
  padding: 7px 9px;
  border-radius: 5px;
  background: #dcefeb;
  color: #075f51;
  font-family: inherit;
  font-weight: 800;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 24px;
  background: #dce4ee;
  border: 1px solid #dce4ee;
}

.guide-grid article {
  min-width: 0;
  margin: 0;
  padding: 22px;
  border: 0;
  background: #fff;
}

.formula-box,
.official-note {
  margin-bottom: 0;
}

.formula-box strong {
  display: block;
  margin-top: 14px;
  color: #21314a;
}

.formula-box strong:first-child {
  margin-top: 0;
}

.official-note p {
  margin: 5px 0 8px;
  color: #68582e;
  font-size: 15px;
  line-height: 1.7;
}

.official-note {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid #ead9a9;
  background: #fffaf0;
  color: #68582e;
  line-height: 1.7;
}

.official-note a {
  color: #087f6d;
  font-weight: 800;
}

@media (max-width: 980px) {
  .profit-workspace {
    grid-template-columns: 1fr;
  }

  .profit-form {
    border-right: 0;
    border-bottom: 1px solid #dfe6ef;
  }
}

@media (max-width: 700px) {
  .profit-heading {
    margin-bottom: 22px;
  }

  .profit-heading h1 {
    font-size: 34px;
  }

  .profit-heading > p:last-child {
    font-size: 16px;
  }

  .cost-presets {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .preset-note {
    grid-column: auto;
  }

  .profit-form,
  .profit-result,
  .target-calculator,
  .profit-guide {
    padding: 20px;
  }

  .form-head {
    display: block;
  }

  .profit-form .subtle-button {
    width: 100%;
    margin-top: 14px;
  }

  .primary-fields,
  .cost-fields > .field-grid,
  .target-layout,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .cost-fields {
    gap: 12px;
  }

  .form-actions {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 400px) {
  .result-grid {
    grid-template-columns: 1fr;
  }
}
