/* ── mg/L to PPM Converter ─────────────────────────────────────── */

.mtp-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 820px;
  margin: 2rem auto;
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 32px rgba(3,105,161,0.10);
  color: #0c4a6e;
  box-sizing: border-box;
}

/* Header */
.mtp__header {
  background: linear-gradient(135deg, #0c2d4a 0%, #0c4a6e 40%, #0369a1 75%, #0284c7 100%);
  padding: clamp(1.4rem, 4vw, 2rem) clamp(1.2rem, 4vw, 2rem);
}
.mtp__header h2 {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 900;
  color: #fff;
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}
.mtp__header p {
  font-size: 0.9rem;
  color: #bae6fd;
  margin: 0;
}

/* Body: two cards side by side */
.mtp__body {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 0;
}

.mtp__card {
  flex: 1;
  padding: clamp(1.2rem, 3vw, 1.75rem);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mtp__card-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #0369a1;
  border-bottom: 2px solid #e0f2fe;
  padding-bottom: 0.5rem;
}

.mtp__label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0c4a6e;
  margin-bottom: 0.4rem;
}

.mtp__input-row {
  display: flex;
  align-items: center;
  gap: 0;
  border: 2px solid #bae6fd;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.mtp__input-row:focus-within {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2,132,199,0.15);
}

.mtp__input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.7rem 0.85rem;
  font-size: 1.05rem;
  color: #0c4a6e;
  background: transparent;
  font-weight: 600;
  width: 100%;
  box-sizing: border-box;
}
.mtp__input::placeholder { color: #94a3b8; font-weight: 400; }

.mtp__unit {
  background: #e0f2fe;
  color: #0369a1;
  padding: 0.7rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.mtp__arrow {
  text-align: center;
  font-size: 1.4rem;
  color: #0284c7;
  line-height: 1;
}

/* Result box */
.mtp__result-box {
  background: #f0f9ff;
  border: 2px solid #bae6fd;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-height: 54px;
}
.mtp__result-box.mtp--has-value {
  background: #e0f9f0;
  border-color: #6ee7b7;
}

.mtp__result-val {
  font-size: 1.5rem;
  font-weight: 900;
  color: #0c4a6e;
  line-height: 1;
}
.mtp__result-box.mtp--has-value .mtp__result-val {
  color: #065f46;
}
.mtp__result-unit {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0369a1;
}
.mtp__result-box.mtp--has-value .mtp__result-unit {
  color: #059669;
}

/* Formula note */
.mtp__formula {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.55;
  background: #f8fafc;
  border-left: 3px solid #bae6fd;
  padding: 0.5rem 0.75rem;
  border-radius: 0 6px 6px 0;
}

/* Clear button */
.mtp__clear-btn {
  align-self: flex-start;
  background: none;
  border: 1.5px solid #cbd5e1;
  border-radius: 7px;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 600;
}
.mtp__clear-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: #fff5f5;
}

/* Divider */
.mtp__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  min-width: 48px;
  background: #f0f9ff;
  position: relative;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #0369a1;
  border-left: 1px solid #e0f2fe;
  border-right: 1px solid #e0f2fe;
}

/* Table section */
.mtp__table-section {
  padding: clamp(1rem, 3vw, 1.5rem);
  background: #fff;
  border-top: 1.5px solid #e0f2fe;
}
.mtp__table-title {
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  font-weight: 800;
  color: #0c4a6e;
  margin: 0 0 0.85rem;
}
.mtp__table-wrap {
  overflow-x: auto;
}
.mtp__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.mtp__table thead tr {
  background: linear-gradient(90deg, #0c4a6e, #0284c7);
}
.mtp__table thead th {
  color: #fff;
  padding: 0.6rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.82rem;
}
.mtp__table tbody tr:nth-child(even) { background: #f0f9ff; }
.mtp__table tbody tr:hover { background: #e0f2fe; }
.mtp__table tbody td {
  padding: 0.5rem 1rem;
  color: #0c4a6e;
  font-weight: 500;
  border-bottom: 1px solid #e0f2fe;
}

/* Note */
.mtp__note {
  background: #f0f9ff;
  border-top: 1.5px solid #bae6fd;
  padding: 0.85rem clamp(1rem, 3vw, 1.5rem);
  font-size: 0.82rem;
  color: #0c4a6e;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 580px) {
  .mtp__body {
    flex-direction: column;
  }
  .mtp__divider {
    width: 100%;
    min-width: unset;
    height: 36px;
    border-left: none;
    border-right: none;
    border-top: 1px solid #e0f2fe;
    border-bottom: 1px solid #e0f2fe;
  }
  .mtp__card { padding: 1rem; }
}
