.cost-profit-tool {
  max-width: 1180px;
}

body.app-shell .cost-profit-section,
body.app-shell .cost-profit-result,
body.app-shell .cost-profit-ratebar,
body.app-shell .cost-profit-total {
  background: var(--marketing-surface, #fff);
  border-color: var(--marketing-line, #dbe2ec);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(21, 33, 55, 0.03);
}

body.app-shell .cost-profit-section-header {
  border-color: var(--marketing-line, #dbe2ec);
}

body.app-shell .cost-profit-section-header h2 {
  color: var(--marketing-ink, #111827);
  font-size: 1rem;
}

body.app-shell .cost-profit-section-header span {
  color: var(--marketing-muted, #667085);
}

.cost-profit-heading h1 {
  font-size: 1.9rem;
}

.cost-profit-form {
  display: grid;
  gap: 18px;
}

.cost-profit-tabs {
  border-bottom: 1px solid #e4e9ef;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.cost-profit-tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #526173;
  font-weight: 720;
  min-height: 42px;
  padding: 10px 16px;
  white-space: nowrap;
}

.cost-profit-tab.is-active {
  border-bottom-color: var(--admin-primary, #0f766e);
  color: var(--admin-primary, #0f766e);
}

.cost-profit-ratebar {
  align-items: end;
  background: #f8faf9;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  padding: 14px;
}

.cost-profit-market-field {
  display: grid;
  gap: 6px;
}

.cost-profit-market-field .form-label {
  margin: 0;
}

.cost-profit-rate-copy {
  align-items: center;
  color: #526173;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  line-height: 1.5;
  min-height: 38px;
}

.cost-profit-rate-copy strong {
  color: #2457a6;
}

.cost-profit-rate-divider {
  background: #cbd5df;
  display: inline-flex;
  height: 16px;
  margin: 0 6px;
  width: 1px;
}

.cost-profit-rate-time {
  color: #7a8696;
  margin-left: 4px;
}

.cost-profit-grid {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
}

.cost-profit-inputs,
.cost-profit-result,
.cost-profit-section {
  min-width: 0;
}

.cost-profit-inputs {
  display: grid;
  gap: 18px;
}

.cost-profit-section,
.cost-profit-result {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 18px;
}

.cost-profit-section-header {
  align-items: center;
  border-bottom: 1px solid #edf1f6;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
}

.cost-profit-section-header h2 {
  color: #111827;
  font-size: 1rem;
  font-weight: 760;
  margin: 0;
}

.cost-profit-section-header span {
  color: #7a8696;
  font-size: 0.86rem;
}

.cost-profit-field-grid,
.cost-profit-cost-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cost-profit-cost-grid {
  margin-top: 16px;
}

.cost-profit-number {
  min-width: 0;
}

.cost-profit-percent-unit {
  justify-content: center;
  min-width: 74px;
}

.cost-profit-conversion {
  color: #667085;
  display: block;
  font-size: 0.82rem;
  min-height: 18px;
}

.cost-profit-label-with-hint {
  align-items: flex-start;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.cost-profit-label-with-hint > span {
  align-items: center;
  display: inline-flex;
}

.cost-profit-label-with-hint > span::before {
  color: #2563eb;
  content: "↗";
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  margin-right: 4px;
}

.cost-profit-label-with-hint > small {
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.2;
}

.cost-profit-radio-row {
  align-items: center;
  color: #334155;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 10px 0;
}

.cost-profit-radio-row label {
  align-items: center;
  display: inline-flex;
  gap: 5px;
  margin: 0;
}

.cost-profit-radio-row small {
  color: #7a8696;
}

.cost-profit-result {
  background: #fff;
  position: sticky;
  top: 84px;
}

.cost-profit-total {
  background: #f8fbff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 16px;
}

.cost-profit-total > span {
  color: #344054;
  font-weight: 700;
}

.cost-profit-total strong {
  color: #2457a6;
  display: flex;
  flex-wrap: wrap;
  font-size: 1.2rem;
  gap: 6px;
  line-height: 1.25;
}

.cost-profit-rate-result {
  align-items: center;
  border-bottom: 1px solid #edf1f6;
  color: #526173;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.cost-profit-rate-result strong {
  color: #111827;
}

.cost-profit-detail-group {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.cost-profit-detail-group h3 {
  color: #111827;
  font-size: 0.95rem;
  font-weight: 760;
  margin: 0;
}

.cost-profit-line,
.cost-profit-line-emphasis {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(110px, 1fr) minmax(104px, auto) minmax(96px, auto);
  min-height: 30px;
}

.cost-profit-line {
  color: #526173;
  font-size: 0.88rem;
}

.cost-profit-line-emphasis {
  color: #18211f;
  font-weight: 700;
}

.cost-profit-line span,
.cost-profit-line-emphasis span,
.cost-profit-line strong,
.cost-profit-line-emphasis strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.cost-profit-candidates {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.cost-profit-candidate {
  background: #fff;
  border: 1px solid #dbe3ea;
  border-radius: 7px;
  color: #334155;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  text-align: left;
}

.cost-profit-candidate.is-active {
  background: #eef9f6;
  border-color: #78c7ba;
}

.cost-profit-candidate strong {
  color: #2457a6;
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.cost-profit-candidate-title {
  color: #18211f;
  font-weight: 700;
}

.cost-profit-candidate-note {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.cost-profit-sale-summary {
  border-top: 1px solid var(--ui-line, #dbe3ea);
  margin-top: 18px;
}

.cost-profit-sale-summary-row,
.cost-profit-sale-summary-rate {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(110px, 1fr) minmax(104px, auto) minmax(96px, auto);
}

.cost-profit-sale-summary-row {
  min-height: 58px;
  padding: 12px 0;
}

.cost-profit-sale-summary-row + .cost-profit-sale-summary-row {
  border-top: 1px solid var(--ui-line, #edf1f6);
}

.cost-profit-sale-summary-label {
  color: var(--ui-ink, #18211f);
}

.cost-profit-sale-summary-value {
  color: var(--ui-muted, #526173);
  min-width: 0;
  overflow-wrap: anywhere;
}

.cost-profit-sale-summary-value strong {
  color: var(--ui-ink, #18211f);
  font-size: 1.02rem;
}

.cost-profit-sale-summary-row.is-profit .cost-profit-sale-summary-value strong,
.cost-profit-sale-summary-rate strong {
  color: var(--ui-blue, #2457a6);
}

.cost-profit-sale-summary-rate {
  color: var(--ui-muted, #526173);
  font-size: 0.86rem;
  padding: 0 0 14px;
}

.cost-profit-empty-result {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  padding: 10px 12px;
}

@media (max-width: 900px) {
.cost-profit-ratebar,
.cost-profit-grid,
.cost-profit-field-grid,
.cost-profit-cost-grid {
    grid-template-columns: 1fr;
  }

.cost-profit-result {
    position: static;
  }
}

@media (max-width: 720px) {
.cost-profit-form {
    padding: 18px;
  }

.cost-profit-section,
.cost-profit-result {
    padding: 16px;
  }

.cost-profit-rate-copy {
    align-items: flex-start;
    flex-direction: column;
  }

.cost-profit-rate-divider {
    display: none;
  }

.cost-profit-line,
.cost-profit-line-emphasis {
    grid-template-columns: 1fr;
  }

.cost-profit-sale-summary-row {
    gap: 6px;
    grid-template-columns: 1fr;
  }

.cost-profit-sale-summary-rate {
    grid-template-columns: 1fr auto;
  }

.cost-profit-sale-summary-spacer {
    display: none;
  }
}

.cost-profit-heading {
  align-items: flex-end;
  border-bottom: 1px solid var(--ui-line);
  margin-bottom: 22px;
  padding-bottom: 16px;
}

.cost-profit-heading h1 {
  color: var(--ui-ink);
  font-weight: 820;
  line-height: 1.15;
}

.cost-profit-heading p {
  color: var(--ui-muted);
  line-height: 1.7;
}

.cost-profit-section,
.cost-profit-result,
.cost-profit-ratebar {
  background: var(--ui-cream);
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(31, 46, 39, 0.03);
}

.cost-profit-section-header {
  border-bottom: 1px solid var(--ui-line);
  margin-bottom: 16px;
  padding-bottom: 13px;
}

.cost-profit-section-header h2 {
  color: var(--ui-ink);
  font-weight: 780;
}

.cost-profit-section-header span {
  color: var(--ui-muted);
}

.cost-profit-tabs {
  border-bottom-color: var(--ui-line);
}

.cost-profit-tab {
  border-radius: 8px 8px 0 0;
  color: var(--ui-muted);
}

.cost-profit-tab.is-active {
  background: var(--ui-cream);
  border-bottom-color: var(--ui-gold);
  color: var(--ui-teal);
}

.cost-profit-ratebar,
.cost-profit-total {
  background: #f8f2e9;
}

.cost-profit-total {
  border: 1px solid var(--ui-line);
  border-radius: 8px;
}

.cost-profit-total strong,
.cost-profit-rate-copy strong,
.cost-profit-candidate strong {
  color: var(--ui-blue);
}

.cost-profit-candidate {
  background: #fffdf8;
  border-color: var(--ui-line);
  border-radius: 8px;
}

.cost-profit-candidate.is-active {
  background: var(--ui-forest-soft);
  border-color: #9bcfc4;
}

.cost-profit-empty-result {
  border-radius: 8px;
}

@media (max-width: 720px) {
.cost-profit-heading {
    align-items: start;
    flex-direction: column;
  }
}

body[data-theme="classic"] .cost-profit-candidate {
  background-color: #ffffff;
}

body[data-theme="classic"] .cost-profit-ratebar,
body[data-theme="classic"] .cost-profit-total {
  background: #f8fafc;
}

body.admin-body .cost-profit-marketplace-form,
body.admin-body .cost-profit-meta,
body.admin-body .cost-profit-marketplace-list,
body.admin-body .cost-profit-marketplace-section,
body.admin-body .cost-profit-table-wrap {
  min-width: 0;
}

.standalone-settings-form {
  border-top: 1px solid #dde3ea;
  border-radius: 8px;
}
