/* ================= Trang ba mẹ ================= */
.overlay.parent { background: #FBF7F4; justify-content: flex-start; -webkit-backdrop-filter: none; backdrop-filter: none; z-index: 80; -webkit-user-select: text; user-select: text; }
.p-wrap { display: flex; flex-direction: column; height: 100%; max-width: 640px; width: 100%; margin: 0 auto; }
.p-head { display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-t)) 16px 8px; }
.p-head h1 { margin: 0; font-size: 22px; flex: 1; }
.p-close { height: 40px; padding: 0 16px; border-radius: 20px; background: var(--ink); color: #fff; font-weight: 800; font-size: 16px; }
.p-tabs { display: flex; gap: 6px; padding: 0 12px 10px; overflow-x: auto; }
.p-tabs button { flex: 1 0 auto; height: 40px; padding: 0 14px; border-radius: 20px; background: #F1E9E3; font-weight: 700; font-size: 15px; color: var(--ink-soft); }
.p-tabs button.on { background: var(--pink); color: #fff; }
.p-body { flex: 1; overflow-y: auto; padding: 4px 14px calc(30px + var(--safe-b)); -webkit-overflow-scrolling: touch; }

.p-card { background: #fff; border-radius: 20px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(90,71,67,.06); }
.p-card h3 { margin: 0 0 4px; font-size: 18px; }
.p-card .hint { margin: 0 0 10px; color: var(--ink-soft); font-size: 14px; line-height: 1.4; }
.p-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #F4ECE6; }
.p-row:first-of-type { border-top: 0; }
.p-row .ic { width: 42px; height: 42px; border-radius: 14px; background: #FFF1E4; display: grid; place-items: center; font-size: 24px; flex: 0 0 auto; overflow: hidden; }
.p-row .ic img { width: 100%; height: 100%; object-fit: cover; }
.p-row .tx { flex: 1; min-width: 0; }
.p-row .tx b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-row .tx span { font-size: 13px; color: var(--ink-soft); }
.p-row.off { opacity: .45; }
.ib { width: 38px; height: 38px; border-radius: 12px; background: #F6EEE8; font-size: 16px; flex: 0 0 auto; }
.ib:disabled { opacity: .3; }
.p-btn { height: 44px; padding: 0 16px; border-radius: 14px; background: #F1E9E3; font-weight: 800; font-size: 15px; }
.p-btn.primary { background: var(--pink); color: #fff; }
.p-btn.danger { background: #FFE1E1; color: #B42318; }
.p-btn.block { width: 100%; }
.p-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.seg { display: flex; background: #F1E9E3; border-radius: 14px; padding: 3px; margin-bottom: 10px; }
.seg button { flex: 1; height: 38px; border-radius: 11px; font-weight: 700; font-size: 15px; color: var(--ink-soft); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 40px; padding: 0 12px; border-radius: 20px; background: #F6EEE8; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: #FFE1EC; color: #B23A66; }

.f { display: block; margin-bottom: 12px; }
.f > span { display: block; font-size: 14px; font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; }
.f input[type=text], .f input[type=number], .f input[type=time], .f input[type=url], .f input[type=password], .f select, .f textarea {
  width: 100%; height: 44px; border-radius: 12px; border: 1.5px solid #EADFD7; background: #fff; padding: 0 12px; }
.f textarea { height: 70px; padding: 10px 12px; resize: vertical; line-height: 1.35; }
.f input[type=range] { width: 100%; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--pink); }
.radio { display: flex; gap: 10px; padding: 10px; border-radius: 14px; border: 1.5px solid #EADFD7; margin-bottom: 8px; align-items: flex-start; }
.radio.on { border-color: var(--pink); background: #FFF5F8; }
.radio input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--pink); }
.radio b { display: block; }
.radio span { font-size: 13px; color: var(--ink-soft); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-top: 6px; }
.emoji-grid button { aspect-ratio: 1; border-radius: 10px; font-size: 22px; background: #FBF6F2; }
.photo-row { display: flex; gap: 10px; align-items: center; }
.photo-row .ic { width: 64px; height: 64px; border-radius: 18px; background: #FFF1E4; display: grid; place-items: center; font-size: 36px; overflow: hidden; }
.photo-row .ic img { width: 100%; height: 100%; object-fit: cover; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; }

.days { display: flex; gap: 6px; align-items: flex-end; height: 110px; padding-top: 8px; }
.days div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.days i { width: 100%; max-width: 32px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--yellow), var(--orange)); min-height: 4px; }
.days b { font-size: 13px; color: var(--ink); }
.edit-sheet .sheet h2 { text-align: left; font-size: 22px; margin-bottom: 12px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

.overlay.edit-sheet { z-index: 90; }
