.yhc-wrap {
  --yhc-text: #151515;
  --yhc-muted: #5a5a5a;
  --yhc-line: rgba(21, 21, 21, 0.14);
  --yhc-bg: #ffffff;
  --yhc-input-bg: #ffffff;
  --yhc-accent: #1e5bb8;
  --yhc-accent-soft: rgba(30, 91, 184, 0.1);
  --yhc-gold: #b8922a;
  --yhc-silver: #6f7b8a;
  --yhc-total: #123a2c;

  box-sizing: border-box;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 1.2rem 1.25rem 1.3rem;
  color: var(--yhc-text);
  background:
    linear-gradient(180deg, rgba(30, 91, 184, 0.05), transparent 46%),
    var(--yhc-bg);
  border: 1px solid var(--yhc-line);
  border-radius: 2px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  box-shadow: 0 16px 36px rgba(16, 24, 40, 0.08);
}

.yhc-wrap *,
.yhc-wrap *::before,
.yhc-wrap *::after {
  box-sizing: border-box;
}

.yhc-wrap[data-metal="gold"] {
  --yhc-metal: var(--yhc-gold);
}

.yhc-wrap[data-metal="silver"] {
  --yhc-metal: var(--yhc-silver);
  background:
    linear-gradient(180deg, rgba(111, 123, 138, 0.08), transparent 46%),
    var(--yhc-bg);
}

.yhc-title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-align: center;
}

.yhc-metal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 0.95rem;
  padding: 0.28rem;
  background: rgba(21, 21, 21, 0.04);
}

.yhc-metal-btn {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0.62rem 0.7rem;
  background: transparent;
  color: var(--yhc-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.yhc-metal-btn:hover {
  color: var(--yhc-text);
}

.yhc-metal-btn.is-active {
  background: #fff;
  color: var(--yhc-text);
  box-shadow: inset 0 -2px 0 var(--yhc-metal, var(--yhc-accent));
}

.yhc-metal-btn:focus-visible {
  outline: 2px solid var(--yhc-accent);
  outline-offset: 2px;
}

.yhc-form {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr 0.9fr;
  gap: 0.6rem;
  margin-bottom: 0.95rem;
}

.yhc-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

/* Keep only the active grade field: Karat for gold, Purity for silver */
.yhc-field-grade[hidden],
.yhc-wrap[data-metal="gold"] .yhc-field-grade[data-mode="silver"],
.yhc-wrap[data-metal="silver"] .yhc-field-grade[data-mode="gold"] {
  display: none !important;
}

.yhc-field label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--yhc-muted);
}

.yhc-field input,
.yhc-field select {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--yhc-line);
  border-radius: 2px;
  background: var(--yhc-input-bg);
  color: var(--yhc-text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.2;
}

.yhc-field input:focus,
.yhc-field select:focus {
  outline: 2px solid var(--yhc-accent);
  outline-offset: 1px;
  border-color: transparent;
}

.yhc-results {
  display: grid;
  gap: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--yhc-line);
}

.yhc-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.yhc-label {
  font-size: 0.92rem;
  color: var(--yhc-muted);
}

.yhc-value {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.yhc-row-total {
  margin-top: 0.1rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--yhc-line);
}

.yhc-row-total .yhc-label {
  color: var(--yhc-text);
  font-weight: 700;
}

.yhc-row-total .yhc-value {
  color: var(--yhc-total);
  font-size: 1.25rem;
}

.yhc-status {
  margin: 0.7rem 0 0;
  font-size: 0.85rem;
  color: #8a1f1f;
}

.yhc-status[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  .yhc-wrap {
    max-width: none;
    padding: 1rem;
  }

  .yhc-form {
    grid-template-columns: 1fr 1fr;
  }

  .yhc-field:first-child {
    grid-column: 1 / -1;
  }

  .yhc-row-total .yhc-value {
    font-size: 1.12rem;
  }
}
