.stc-calc {
  --stc-red: #9c0000;
  --stc-red-2: #7a0000;
  --stc-red-bright: #ff3030;
  --stc-ink: #1b1d1f;
  --stc-muted: #8a817a;
  --stc-line: #e6e1db;
  --stc-readout: #0e1013;
  --stc-readout-line: #23282f;
  --stc-digit: #ff4d4d;
  font-family: "Josefin Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--stc-ink);
  max-width: 760px;
  margin: 1.75rem auto;
  border: 1px solid var(--stc-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.09);
  overflow: hidden;
}

.stc-calc *,
.stc-calc *::before,
.stc-calc *::after {
  box-sizing: border-box;
}

.stc-calc .stc-head {
  background: linear-gradient(135deg, var(--stc-red), var(--stc-red-2));
  color: #fff;
  padding: 18px 22px;
}

.stc-calc .stc-head h3 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
}

.stc-calc .stc-head p {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
}

.stc-calc .stc-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.stc-calc .stc-inputs {
  padding: 22px;
}

.stc-calc .stc-field {
  margin-bottom: 15px;
}

.stc-calc .stc-field:last-child {
  margin-bottom: 0;
}

.stc-calc .stc-field > label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  color: var(--stc-muted);
  margin-bottom: 6px;
}

.stc-calc .stc-input,
.stc-calc .stc-select {
  width: 100%;
  padding: 11px 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--stc-ink);
  background: #fff;
  border: 1.5px solid var(--stc-line);
  border-radius: 9px;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.stc-calc .stc-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239c0000' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
  cursor: pointer;
}

.stc-calc .stc-input:focus,
.stc-calc .stc-select:focus {
  outline: none;
  border-color: var(--stc-red);
  box-shadow: 0 0 0 3px rgba(156, 0, 0, 0.12);
}

.stc-calc .stc-input::placeholder {
  color: #c4bdb5;
}

.stc-calc .stc-range {
  display: flex;
  align-items: center;
  gap: 11px;
}

.stc-calc .stc-range input[type="range"] {
  flex: 1;
  accent-color: var(--stc-red);
  height: 6px;
  cursor: pointer;
}

.stc-calc .stc-range .stc-range-num {
  width: 78px;
  flex: none;
  text-align: center;
}

.stc-calc .stc-range .stc-pct {
  font-weight: 700;
  color: var(--stc-muted);
}

.stc-calc .stc-readout {
  background: var(--stc-readout);
  color: #fff;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.stc-calc .stc-primary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8b94a0;
  margin-bottom: 8px;
}

.stc-calc .stc-value-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
}

.stc-calc .stc-value {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 38px;
  line-height: 1;
  font-weight: 600;
  color: var(--stc-digit);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(255, 77, 77, 0.28);
  word-break: break-word;
}

.stc-calc .stc-unit {
  font-size: 14px;
  color: #8b94a0;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stc-calc .stc-secondary {
  display: flex;
  flex-direction: column;
  gap: 9px;
  border-top: 1px solid var(--stc-readout-line);
  padding-top: 15px;
}

.stc-calc .stc-sec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
}

.stc-calc .stc-sec-label {
  color: #8b94a0;
}

.stc-calc .stc-sec-val {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color: #e7eaee;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.stc-calc .stc-copy {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #cbd2da;
  background: transparent;
  border: 1px solid var(--stc-readout-line);
  padding: 8px 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.stc-calc .stc-copy:hover {
  border-color: var(--stc-red-bright);
  color: #fff;
}

.stc-calc .stc-copy.is-copied {
  border-color: #46b06a;
  color: #46b06a;
}

.stc-calc .stc-formula {
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px dashed var(--stc-readout-line);
  font-size: 12px;
  color: #6f7884;
}

.stc-calc .stc-formula code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  color: #98a2af;
  background: transparent;
  padding: 0;
}

@media (max-width: 680px) {
  .stc-calc .stc-body {
    grid-template-columns: 1fr;
  }
}
