/* ── dB to Percent Converter ────────────────────────────────────── */

.dbp-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 860px;
  margin: 2rem auto;
  background: #fdf4ff;
  border: 1.5px solid #e879f9;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 32px rgba(168,85,247,0.12);
  color: #3b0764;
  box-sizing: border-box;
}

/* Header */
.dbp__header {
  background: linear-gradient(135deg, #1a0533 0%, #3b0764 35%, #7e22ce 75%, #a21caf 100%);
  padding: clamp(1.4rem, 4vw, 2rem) clamp(1.2rem, 4vw, 2rem);
}
.dbp__header h2 {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 900;
  color: #fff;
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}
.dbp__header p { font-size: 0.9rem; color: #f0abfc; margin: 0; }

/* Body */
.dbp__body { display: flex; align-items: flex-start; }

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

.dbp__card-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #a21caf;
  border-bottom: 2px solid #fae8ff;
  padding-bottom: 0.5rem;
}

.dbp__label { display: block; font-size: 0.82rem; font-weight: 600; color: #3b0764; margin-bottom: 0.35rem; }

.dbp__input-row {
  display: flex;
  align-items: center;
  border: 2px solid #e879f9;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.dbp__input-row:focus-within {
  border-color: #a21caf;
  box-shadow: 0 0 0 3px rgba(162,28,175,0.15);
}
.dbp__input {
  flex: 1; border: none; outline: none;
  padding: 0.68rem 0.85rem;
  font-size: 1.05rem; color: #3b0764;
  background: transparent; font-weight: 600;
  width: 100%; box-sizing: border-box;
}
.dbp__input::placeholder { color: #94a3b8; font-weight: 400; }
.dbp__unit {
  background: #fae8ff; color: #a21caf;
  padding: 0.68rem 0.85rem;
  font-size: 0.85rem; font-weight: 700; white-space: nowrap;
}

/* Presets */
.dbp__preset-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #a21caf; }
.dbp__presets { display: flex; flex-wrap: wrap; gap: 6px; }
.dbp__preset-btn {
  background: #fdf4ff; border: 1.5px solid #e879f9;
  border-radius: 20px; padding: 3px 11px;
  font-size: 0.72rem; color: #7e22ce; font-weight: 700;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.dbp__preset-btn:hover, .dbp__preset-btn.dbp--active {
  background: #a21caf; border-color: #a21caf; color: #fff;
}

.dbp__arrow { text-align: center; font-size: 1.4rem; color: #a21caf; line-height: 1; }

/* Dual result boxes */
.dbp__dual-results { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.dbp__result-box {
  background: #fdf4ff;
  border: 2px solid #e879f9;
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 80px;
}
.dbp__result-box.dbp--has-value { background: #fae8ff; border-color: #c026d3; }

.dbp__result-type {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #9333ea;
}
.dbp__result-main { display: flex; align-items: baseline; gap: 4px; }
.dbp__result-val { font-size: 1.3rem; font-weight: 900; color: #3b0764; line-height: 1; word-break: break-all; }
.dbp__result-box.dbp--has-value .dbp__result-val { color: #86198f; }
.dbp__result-unit { font-size: 0.82rem; font-weight: 700; color: #a21caf; }
.dbp__result-formula { font-size: 0.68rem; color: #94a3b8; margin-top: 2px; }

/* Clear */
.dbp__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;
}
.dbp__clear-btn:hover { border-color: #ef4444; color: #ef4444; background: #fff5f5; }

/* Divider */
.dbp__divider {
  display: flex; align-items: center; justify-content: center;
  width: 48px; min-width: 48px; background: #fdf4ff;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 1px; color: #a21caf;
  border-left: 1px solid #fae8ff; border-right: 1px solid #fae8ff;
}

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

/* Note */
.dbp__note { background: #fdf4ff; border-top: 1.5px solid #e879f9; padding: 0.85rem clamp(1rem, 3vw, 1.5rem); font-size: 0.82rem; color: #3b0764; line-height: 1.6; }

/* Responsive */
@media (max-width: 600px) {
  .dbp__body { flex-direction: column; }
  .dbp__divider { width: 100%; min-width: unset; height: 36px; border-left: none; border-right: none; border-top: 1px solid #fae8ff; border-bottom: 1px solid #fae8ff; }
  .dbp__card { padding: 1rem; }
  .dbp__dual-results { grid-template-columns: 1fr; }
}
