.cost-tool {
  padding-top: 18px;
}

.cost-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.72fr);
  gap: 16px;
  align-items: stretch;
}

.cost-form,
.cost-results,
.cost-detail-panel {
  background: linear-gradient(180deg, rgba(18, 23, 32, 0.94), rgba(10, 12, 18, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 24px 70px rgba(0, 0, 0, 0.22);
}

.cost-form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.cost-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cost-field {
  display: grid;
  gap: 8px;
}

.cost-field span {
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.cost-input,
.cost-select {
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  color: #f7f3ff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  font: 800 0.9rem var(--font, "Inter", sans-serif);
  outline: none;
}

.cost-input:focus,
.cost-select:focus {
  border-color: rgba(196, 122, 245, 0.58);
  box-shadow: 0 0 0 4px rgba(196, 122, 245, 0.14);
}

.cost-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.cost-preset {
  min-height: 36px;
  padding: 8px 11px;
  color: #eadcff;
  background: rgba(196, 122, 245, 0.11);
  border: 1px solid rgba(196, 122, 245, 0.26);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
  cursor: pointer;
}

.cost-preset:hover,
.cost-preset.is-active {
  color: #fff;
  background: rgba(196, 122, 245, 0.2);
  border-color: rgba(196, 122, 245, 0.46);
}

.cost-results {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.cost-result-card {
  display: grid;
  gap: 6px;
  min-height: 80px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
}

.cost-result-card span {
  color: rgba(226, 232, 240, 0.66);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.cost-result-card strong {
  color: #f7f3ff;
  font-family: var(--font-h, "Space Grotesk", sans-serif);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.05;
}

.cost-result-card-primary {
  background: linear-gradient(135deg, rgba(196, 122, 245, 0.18), rgba(63, 120, 255, 0.1));
  border-color: rgba(196, 122, 245, 0.32);
}

.cost-detail-panel {
  margin-top: 16px;
  padding: 20px;
}

.cost-detail-head,
.cost-segment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.cost-detail-head {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.cost-detail-head strong {
  display: block;
  color: #f7f3ff;
  font-size: 1rem;
}

.cost-detail-head span {
  display: block;
  margin-top: 4px;
  color: rgba(226, 232, 240, 0.64);
  font-size: 0.8rem;
}

.cost-source-link {
  color: #eadcff;
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
}

.cost-segments {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.cost-segment-row {
  min-height: 44px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
}

.cost-segment-row span:first-child {
  color: #f7f3ff;
  font-weight: 850;
}

.cost-segment-row span:last-child {
  color: rgba(226, 232, 240, 0.68);
  font-size: 0.84rem;
  text-align: right;
}

.cost-note {
  margin: 14px 0 0;
  color: rgba(226, 232, 240, 0.68);
  font-size: 0.86rem;
  line-height: 1.65;
}

:root[data-theme="light"] .cost-form,
:root[data-theme="light"] .cost-results,
:root[data-theme="light"] .cost-detail-panel {
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(246, 239, 229, 0.96));
  border-color: rgba(60, 52, 42, 0.14);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.85), 0 20px 48px rgba(60, 52, 42, 0.12);
}

:root[data-theme="light"] .cost-field span,
:root[data-theme="light"] .cost-result-card span,
:root[data-theme="light"] .cost-detail-head span,
:root[data-theme="light"] .cost-segment-row span:last-child,
:root[data-theme="light"] .cost-note {
  color: #6b6258;
}

:root[data-theme="light"] .cost-input,
:root[data-theme="light"] .cost-select,
:root[data-theme="light"] .cost-result-card,
:root[data-theme="light"] .cost-segment-row {
  color: #171411;
  background: rgba(255, 255, 255, 0.66);
  border-color: rgba(60, 52, 42, 0.14);
}

:root[data-theme="light"] .cost-result-card strong,
:root[data-theme="light"] .cost-detail-head strong,
:root[data-theme="light"] .cost-segment-row span:first-child {
  color: #171411;
}

:root[data-theme="light"] .cost-preset {
  color: #5e367f;
  background: rgba(123, 79, 168, 0.1);
  border-color: rgba(123, 79, 168, 0.22);
}

:root[data-theme="light"] .cost-preset:hover,
:root[data-theme="light"] .cost-preset.is-active {
  color: #2c153d;
  background: rgba(123, 79, 168, 0.16);
  border-color: rgba(123, 79, 168, 0.36);
}

:root[data-theme="light"] .cost-source-link {
  color: #5e367f;
}

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

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

@media (max-width: 680px) {
  .cost-input-grid,
  .cost-results,
  .cost-detail-head,
  .cost-segment-row {
    grid-template-columns: 1fr;
  }

  .cost-segment-row span:last-child {
    text-align: left;
  }
}
