/* ── Trang Phụ huynh (thiết kế lại 18/10/2026) — mobile trước, iPad 2 cột ──────────
   Cấu trúc: tiêu đề → dải chọn con → 4 tab dính đầu trang → các thẻ nội dung.
   Nguyên tắc: một cột trên điện thoại, ô nhập rộng hết, nút chính rộng hết (≥ 48px),
   chữ ≥ 15px, khoảng chạm ≥ 44px; lưới chỉ dùng minmax(0, 1fr) để không bao giờ tràn khung. */

.ph { max-width: 820px; margin: 0 auto; }
.ph .card { padding: 18px 16px; border-radius: 18px; }
.ph .card h2 { font-size: 20px; margin: 0 0 6px; }
.ph-hero { padding: 6px 2px 2px; }
.ph-hero h1 { margin: 2px 0 6px; font-size: 26px; line-height: 1.2; }
.ph-eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }

/* Dải chọn con: cuộn ngang trên điện thoại */
.ph-kids { display: flex; gap: 10px; overflow-x: auto; padding: 8px 2px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ph-kids::-webkit-scrollbar { display: none; }
.ph-kid { position: relative; flex: none; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 16px 6px 6px;
  border-radius: 99px; border: 2px solid var(--line); background: var(--paper); font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.ph-kid span { display: flex; flex-direction: column; line-height: 1.15; }
.ph-kid b { font-size: 16px; }
.ph-kid small { font-size: 13px; color: var(--ink-3); }
.ph-kid.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 2px 10px rgba(47, 111, 143, .15); }
.ph-dot { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: #e5484d; color: #fff;
  font: 800 12px/20px system-ui, sans-serif; font-style: normal; text-align: center; box-shadow: 0 0 0 2px #fff; }

/* Tab: dính đầu trang (dưới thanh trên), 4 nút chia đều */
.ph-tabs { position: sticky; top: 64px; z-index: 5; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px;
  margin: 2px 0 6px; border-radius: 16px; background: rgba(233, 238, 246, .95); backdrop-filter: blur(8px); }
.ph-tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; padding: 6px 2px;
  border: 0; border-radius: 12px; background: transparent; font: inherit; font-size: 13px; font-weight: 800; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.ph-tab span { font-size: 20px; line-height: 1; }
.ph-tab.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(20, 30, 50, .12); }
.ph-tab .ph-dot { top: 2px; right: 8px; }

/* Thẻ nội dung */
.ph-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ph-card-head h2 { margin: 0; }
.ph-block { display: flex; width: 100%; justify-content: center; min-height: 48px; margin-top: 12px; }
.ph-msg { min-height: 1.2em; margin-top: 8px; }
.btn.btn-sm { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.btn.btn-ghost { background: transparent; }
.ph-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Form: một cột trên điện thoại, hai cột trên iPad; KHÔNG để ô nhập đẩy tràn khung */
.ph-form, .acct-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
.ph-form > *, .acct-fields > * { min-width: 0; }
.field input, .field select { width: 100%; min-width: 0; box-sizing: border-box; }
.ph-form .check { grid-column: 1 / -1; }
.ph-span { grid-column: 1 / -1; }
.ph-more { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.ph-more > summary { cursor: pointer; font-weight: 800; color: var(--accent); min-height: 40px; display: flex; align-items: center; }

/* Bộ chọn mục tiêu phút: − [ 20 ] phút + */
.ph-stepper { display: flex; align-items: center; gap: 8px; }
.ph-stepper input { width: 84px !important; text-align: center; font-weight: 800; }
.ph-stepper .btn { min-width: 48px; min-height: 46px; font-size: 22px; padding: 0; }

/* Liên kết dạng thẻ (In đề) */
.ph-link { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.ph-link span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ph-link small { color: var(--ink-3); font-size: 14px; }
.ph-link-ic { font-size: 30px; }
.ph-chev { color: var(--ink-3); font-size: 26px; line-height: 1; transition: transform .2s; }

/* Xu của con + yêu cầu đổi quà */
.ph-coins { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: linear-gradient(135deg, #fff8e1, #fff); }
.ph-coin-n { font-size: 34px; font-weight: 900; line-height: 1.1; }
.ph-coin-n small { font-size: 16px; color: var(--ink-3); font-weight: 700; }
.ph-coin-hist { flex-basis: 100%; }
.ph-reqs { border: 2px solid #ffd27a; background: #fffaf0; }
.ph-req { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #f3e2bd; flex-wrap: wrap; }
.ph-req:first-of-type { border-top: 0; }
.ph-req-ic { font-size: 30px; }
.ph-req-t { flex: 1; min-width: 140px; display: flex; flex-direction: column; }
.ph-req-t small { color: var(--ink-3); }
.ph-req-act { display: flex; gap: 8px; }
.ph-req-act .btn { min-height: 44px; }

/* Danh sách quà: [icon][tên][🗑] / [giá xu] trên điện thoại; một hàng trên iPad */
.gifts { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 2px; }
.gift { display: grid; grid-template-columns: 52px minmax(0, 1fr) 48px; grid-template-areas: "icon name del" "price price price"; gap: 8px;
  padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fafbfd; }
.gift input { min-height: 46px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 17px; width: 100%; min-width: 0; box-sizing: border-box; }
.gift-icon { grid-area: icon; text-align: center; padding: 0 !important; }
.gift-name { grid-area: name; }
.gift-price { grid-area: price; display: flex; align-items: center; gap: 8px; }
.gift-price input { max-width: 140px; font-weight: 800; }
.gift-price span { color: var(--ink-3); font-weight: 700; }
.gift-del { grid-area: del; min-width: 0; min-height: 46px; padding: 0; }

/* Thẻ của ba mẹ */
.ph-cards { margin: 10px 0 4px; }

/* Các con: thẻ thu gọn, bấm để sửa */
.kcard { border: 1px solid var(--line); border-radius: 16px; margin: 10px 0; background: var(--paper); overflow: hidden; }
.kcard > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 64px; cursor: pointer; }
.kcard > summary::-webkit-details-marker { display: none; }
.kcard[open] > summary { border-bottom: 1px solid var(--line); background: #f7f9fc; }
.kcard[open] .ph-chev { transform: rotate(90deg); }
.kid-sum { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.kid-sum b { font-size: 17px; }
.kid-sum small { color: var(--ink-3); font-size: 13.5px; overflow-wrap: anywhere; }
.kid-body { padding: 4px 12px 14px; }
.kid-add > summary { color: var(--accent); }
.kid-add-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); font-size: 24px; font-weight: 900; }
.ph-sub { margin-top: 16px; padding: 12px; border-radius: 12px; background: #f5f7fb; }
.ph-sub-t { font-weight: 800; }
.ph-sub .pin-set { margin: 8px 0 0; }
.ph-del { margin-top: 14px; }

/* iPad / máy tính */
@media (min-width: 640px) {
  .ph .card { padding: 22px 24px; }
  .ph-hero h1 { font-size: 30px; }
  .ph-form, .acct-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ph-tab { flex-direction: row; gap: 8px; font-size: 15px; min-height: 50px; }
  .ph-tab span { font-size: 18px; }
  .gift { grid-template-columns: 56px minmax(0, 1fr) 150px 48px; grid-template-areas: "icon name price del"; align-items: center; }
  .ph-block { width: auto; display: inline-flex; padding-left: 28px; padding-right: 28px; }
  .ph-block + .ph-block { margin-left: 8px; }
  .kcard .ph-block, .ob-tip .ph-block { width: auto; }
}
@media (max-width: 380px) {
  .ph-tab { font-size: 12px; }
  .ph-hero h1 { font-size: 23px; }
}
.acct-fields > .row-btns, .acct-fields > .small { grid-column: 1 / -1; }

/* Báo cáo: bài kiểm tra dạng danh sách (bảng cũ quá chật trên điện thoại) */
.rp-exams { list-style: none; padding: 0; margin: 8px 0 0; }
.rp-exams li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.rp-exams li:first-child { border-top: 0; }
.rp-ex-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rp-ex-t small { color: var(--ink-3); font-size: 14px; }
.rp-ex-sc { flex: none; min-width: 64px; text-align: center; padding: 6px 10px; border-radius: 12px; font-weight: 900; font-size: 20px; background: #f1f4f8; }
.rp-ex-sc small { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.rp-ex-sc.good { background: #e6f7ee; color: #1e8a50; }
.rp-ex-sc.mid { background: #fff5dc; color: #9a6a00; }
.rp-ex-sc.bad { background: #fde9ea; color: #c4383d; }
.ph [data-report] .rp > .card { padding: 18px 16px; }

.rp-warn { background: #fff4e0; border: 1px solid #f1c27d; border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; font-size: 15px; line-height: 1.45; }

/* Câu con báo sai + nhận định của AI */
.rp-opts { margin: 6px 0; padding-left: 22px; font-size: 14px; }
.rp-opts .rp-right { color: var(--good); font-weight: 700; }
.rp-ai { margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: #f3f5f8; border-left: 3px solid #b8c2cf; }
.rp-ai.ok { background: #e8f6ee; border-left-color: var(--good); }
.rp-ai.bad { background: #fff1e6; border-left-color: #e08a2e; }
.rp-reports .rp-opts li { border: 0; padding: 1px 0; }
