#nlxh-percent-app {
  --pt-bg: #e3efff;
  --pt-card-bg: #ffffff;
  --pt-accent: #4f46e5;
  --pt-accent-soft: rgba(79, 70, 229, 0.08);
  --pt-text: #020617;   /* đen hơn */
  --pt-muted: #334155;  /* xám đậm hơn */
  --pt-border: #94a3b8;
  --pt-danger: #b91c1c;
  --pt-radius-lg: 16px;
}

#nlxh-percent-app * {
  box-sizing: border-box;
}

#nlxh-percent-app .nlxh-pt-wrapper {
  max-width: 880px;
  margin: 28px auto;
  padding: 24px 20px 32px;
  background: var(--pt-bg);
  border-radius: 20px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.14);
}

/* ================= TITLE & LEAD ================= */
#nlxh-percent-app .nlxh-pt-title {
  font-size: 30px; /* to thêm */
  margin: 0 0 6px;
  text-align: center;
  color: var(--pt-text);
}

#nlxh-percent-app .nlxh-pt-lead {
  text-align: center;
  color: var(--pt-muted);
  margin: 0 0 20px;
  font-size: 15px;
}

/* ================= GRID 1 CỘT ================= */
#nlxh-percent-app .nlxh-pt-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ================= CARD ================= */
#nlxh-percent-app .nlxh-pt-card {
  background: var(--pt-card-bg);
  border-radius: var(--pt-radius-lg);
  padding: 18px 20px 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

#nlxh-percent-app .nlxh-pt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 10px;
}

#nlxh-percent-app .nlxh-pt-card-title {
  font-size: 17px;   /* to hơn 1 cỡ */
  font-weight: 600;
  color: var(--pt-text);
}

#nlxh-percent-app .nlxh-pt-card-badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--pt-accent-soft);
  color: var(--pt-accent);
  white-space: nowrap;
}

#nlxh-percent-app .nlxh-pt-card-desc {
  font-size: 14px;   /* tăng 1 cỡ */
  color: var(--pt-muted);
  margin-bottom: 10px;
}

/* ================= FIELDS / LABELS ================= */
#nlxh-percent-app .nlxh-pt-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 15px;   /* tăng 1 cỡ */
  color: var(--pt-text);
}

#nlxh-percent-app .nlxh-pt-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#nlxh-percent-app .nlxh-pt-field-label {
  font-size: 12px;   /* to hơn, đậm hơn */
  color: var(--pt-muted);
}

/* ================= INPUT ================= */
#nlxh-percent-app input[type="number"] {
  width: 170px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1.5px solid var(--pt-border);
  font: inherit;
  outline: none;
  background: #ffffff;  /* trắng hẳn, nổi hơn */
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06); /* làm nổi ô */
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s,
    transform 0.08s;
}

#nlxh-percent-app input[type="number"]:hover {
  border-color: #64748b;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.09);
}

#nlxh-percent-app input[type="number"]:focus {
  border-color: var(--pt-accent);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.35);
  background: #fefce8; /* hơi vàng nhẹ khi focus */
  transform: translateY(-1px);
}

#nlxh-percent-app input[type="number"]::-webkit-outer-spin-button,
#nlxh-percent-app input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
}

/* ================= SELECT ================= */
#nlxh-percent-app select {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--pt-border);
  font-size: 14px;
  background: #ffffff;
  outline: none;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

#nlxh-percent-app select:focus {
  border-color: var(--pt-accent);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.35);
  background: #fefce8;
}

/* ================= RESULT ================= */
#nlxh-percent-app .nlxh-pt-equal {
  font-weight: 600;
  padding: 0 6px;
  color: var(--pt-text);
}

#nlxh-percent-app .nlxh-pt-result {
  min-width: 170px;
  padding: 8px 11px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1.5px dashed var(--pt-border);
  font-weight: 600;
  text-align: right;
  color: var(--pt-text);
}

#nlxh-percent-app .nlxh-pt-result span {
  white-space: nowrap;
}

/* ================= HINT & ERROR ================= */
#nlxh-percent-app .nlxh-pt-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--pt-muted);
}

#nlxh-percent-app .nlxh-pt-hint strong {
  color: var(--pt-text);
}

#nlxh-percent-app .nlxh-pt-error {
  color: var(--pt-danger);
  font-size: 11px;
  margin-top: 4px;
}

/* ================= BUTTON (khối làm tròn) ================= */
#nlxh-percent-app .nlxh-pt-btn-primary {
  margin-top: 12px;
  padding: 9px 22px;
  border-radius: 999px;
  border: none;
  background: var(--pt-accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.35);
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
}

#nlxh-percent-app .nlxh-pt-btn-primary:hover {
  background: #4338ca;
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.45);
  transform: translateY(-1px);
}

/* ================= KHỐI LÀM TRÒN SỐ ================= */
#nlxh-percent-app .nlxh-pt-round-card {
  padding-bottom: 18px;
}

#nlxh-percent-app .nlxh-pt-round-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#nlxh-percent-app .nlxh-pt-round-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#nlxh-percent-app .nlxh-pt-round-field {
  max-width: 340px;
}

#nlxh-percent-app .nlxh-pt-round-right {
  flex: 1;
  padding: 14px 16px;
  border-radius: 14px;
  background: #e0ebff;
  border: 1px solid rgba(79, 70, 229, 0.25);
}

#nlxh-percent-app .nlxh-pt-round-right-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--pt-muted);
  margin-bottom: 6px;
}

#nlxh-percent-app .nlxh-pt-round-right-value {
  font-size: 27px;
  font-weight: 700;
  color: var(--pt-text);
  margin-bottom: 6px;
  word-break: break-all;
}

#nlxh-percent-app .nlxh-pt-round-right-hint {
  font-size: 12px;
  color: var(--pt-muted);
}

@media (min-width: 720px) {
  #nlxh-percent-app .nlxh-pt-round-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  #nlxh-percent-app .nlxh-pt-round-left {
    max-width: 380px;
  }
}

/* ================= FOOTER ================= */
#nlxh-percent-app .nlxh-pt-footer-note {
  margin-top: 24px;
  font-size: 12px;
  color: var(--pt-muted);
  text-align: center;
}

#nlxh-percent-app .nlxh-pt-footer-note code {
  background: rgba(15, 23, 42, 0.06);
  padding: 2px 5px;
  border-radius: 4px;
}
/* ===== CĂN LẠI 1 DÒNG CHO KHỐI "Tăng hoặc giảm B theo A%" ===== */
#nlxh-percent-app #calc4 .nlxh-pt-fields {
  flex-wrap: nowrap;
  flex-direction: row;
  align-items: flex-end;   /* cho select 'tăng' nằm cùng hàng đáy với các ô nhập */
  column-gap: 10px;
  padding-left: 16px;      /* đẩy cả cụm sang phải một chút */
}

/* Thu gọn width để đủ chỗ trên 1 dòng */
#nlxh-percent-app #calc4 input[type="number"] {
  width: 130px;
}

#nlxh-percent-app #calc4 select#c4-type {
  width: 130px !important;
  max-width: 150px;
  flex: 0 0 auto;
}

/* Mobile: cho phép xuống dòng để không vỡ layout */
@media (max-width: 640px) {
  #nlxh-percent-app #calc4 .nlxh-pt-fields {
    flex-wrap: wrap;
    padding-left: 0;
  }
}
/* ===== CĂN THẲNG HÀNG CHO KHỐI "Tăng hoặc giảm B theo A%" ===== */
#nlxh-percent-app #calc4 .nlxh-pt-fields {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;      /* tất cả group + span cùng “chân” */
  column-gap: 10px;
  padding-left: 12px;         /* đẩy cả cụm sang phải chút */
}

/* group riêng cho select tăng/giảm */
#nlxh-percent-app #calc4 .nlxh-pt-field-group--select .nlxh-pt-field-label {
  visibility: hidden;         /* vẫn giữ chiều cao label nhưng ẩn chữ */
}

/* Giới hạn width để đủ 1 dòng */
#nlxh-percent-app #calc4 input[type="number"],
#nlxh-percent-app #calc4 .nlxh-pt-field-group--select select {
  width: 120px;
}

/* Mobile: cho phép xuống dòng để không bị vỡ */
@media (max-width: 640px) {
  #nlxh-percent-app #calc4 .nlxh-pt-fields {
    flex-wrap: wrap;
    padding-left: 0;
  }
}
/* =======================================================
 * TĂNG CỠ CHỮ TOÀN APP THÊM 1 NẤC
 * ===================================================== */
#nlxh-percent-app .nlxh-pt-title {
  font-size: 32px;           /* trước ~30 */
}

#nlxh-percent-app .nlxh-pt-lead {
  font-size: 16px;
}

#nlxh-percent-app .nlxh-pt-card-title {
  font-size: 18px;
}

#nlxh-percent-app .nlxh-pt-card-desc {
  font-size: 15px;
}

#nlxh-percent-app .nlxh-pt-fields {
  font-size: 16px;
}

#nlxh-percent-app .nlxh-pt-field-label {
  font-size: 13px;
}

#nlxh-percent-app .nlxh-pt-hint {
  font-size: 13px;
}

#nlxh-percent-app .nlxh-pt-footer-note {
  font-size: 13px;
}

/* =======================================================
 * LÀM NỔI BẬT Ô KẾT QUẢ SO VỚI Ô NHẬP
 * ===================================================== */
#nlxh-percent-app .nlxh-pt-result {
  background: #eef2ff; /* tím nhạt khác hẳn ô nhập trắng */
  border: 2px solid rgba(79, 70, 229, 0.6);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.08);
  font-size: 18px;     /* chữ kết quả to hơn */
  font-weight: 700;
  color: #111827;
}

#nlxh-percent-app .nlxh-pt-result span {
  display: block;
  text-align: right;
}

/* Khi hover vào cả card, nhấn nhẹ ô kết quả thêm 1 tí để hút mắt */
#nlxh-percent-app .nlxh-pt-card:hover .nlxh-pt-result {
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.18);
}
