/* =====================================================================
 * phone.css — Pixel Phone (โมเดิร์น คลีน โปร่งแสง)
 *  --pxp-a   : ความทึบพื้นหลังเครื่อง (ค่าเริ่มต้น 0.6 → rgba(0,0,0,.6))
 *  --pxp-acc : สีหลัก, --pxp-r : ความมนขอบ, --pxp-w : ความกว้าง, --pxp-blur : เบลอพื้นหลัง
 *  (ทั้งหมดปรับได้จาก Admin → Script → Pixel Phone)
 * ===================================================================== */
#pxp { --pxp-a: .6; --pxp-acc: #4fd8ff; --pxp-r: 34px; --pxp-w: 340px; --pxp-blur: 10px;
  position: absolute; right: 18px; bottom: calc(118px * var(--ui, 1)); z-index: 60; width: var(--pxp-w); height: min(640px, calc(100vh - 150px * var(--ui, 1))); pointer-events: auto; color: #fff; font-size: 13px; animation: pxpIn .22s cubic-bezier(.2, .9, .3, 1.2); }
#pxp.hidden { display: none; }
@keyframes pxpIn { from { opacity: 0; transform: translateY(24px) scale(.96); } }
.pxp-frame { position: relative; height: 100%; display: flex; flex-direction: column; border-radius: var(--pxp-r); background: rgba(0, 0, 0, var(--pxp-a)); backdrop-filter: blur(var(--pxp-blur)) saturate(1.2); -webkit-backdrop-filter: blur(var(--pxp-blur)) saturate(1.2); border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .04); overflow: hidden; }
.pxp-status { display: flex; align-items: center; justify-content: space-between; padding: 10px 22px 4px; font-size: 11px; color: rgba(255, 255, 255, .8); }
.pxp-notch { width: 70px; height: 18px; border-radius: 10px; background: rgba(0, 0, 0, .7); }
.pxp-screen { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 14px 8px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.pxp-nav { display: flex; justify-content: space-around; padding: 8px 10px 4px; border-top: 1px solid rgba(255, 255, 255, .08); }
.pxp-nav button { position: relative; width: 44px; height: 38px; border: 0; border-radius: 12px; background: none; color: rgba(255, 255, 255, .55); cursor: pointer; }
.pxp-nav button.on { color: var(--pxp-acc); background: rgba(255, 255, 255, .06); }
.pxp-nav svg, .pxp-app svg, .pxp-ib svg, .pxp-av svg, .pxp-bird svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pxp-nav [data-v=feed] svg, .pxp-bird svg, .pxp-av svg { fill: currentColor; stroke: none; }
.pxp-bar { width: 110px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .5); margin: 6px auto 8px; cursor: pointer; }
.pxp-dot { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #ff4f6d; }
/* home */
.pxp-home { text-align: center; padding-top: 18px; }
.pxp-big { font-size: 54px; font-weight: 200; letter-spacing: 1px; line-height: 1; }
.pxp-date { color: rgba(255, 255, 255, .7); margin: 6px 0 26px; font-size: 12px; }
.pxp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 8px; }
.pxp-app { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; color: #fff; cursor: pointer; font: inherit; font-size: 11px; }
.pxp-app i { width: 56px; height: 56px; border-radius: 17px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--c), color-mix(in srgb, var(--c) 45%, #000)); box-shadow: 0 6px 16px rgba(0, 0, 0, .35); transition: transform .12s; }
.pxp-app:hover i { transform: translateY(-2px) scale(1.04); }
.pxp-app i svg { width: 28px; height: 28px; }
.pxp-app[data-v=feed] i svg { fill: #fff; stroke: none; }
.pxp-n { position: absolute; top: -4px; right: 12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff4f6d; font-size: 10.5px; display: grid; place-items: center; }
.pxp-hint { margin-top: 30px; color: rgba(255, 255, 255, .45); font-size: 11px; }
kbd { background: rgba(255, 255, 255, .12); border-radius: 4px; padding: 0 5px; }
/* ทั่วไป */
.pxp-head { display: flex; align-items: center; gap: 8px; padding: 4px 0 10px; font-size: 17px; }
.pxp-head b { flex: 1; } .pxp-head small { color: rgba(255, 255, 255, .5); font-size: 11px; }
.pxp-head.feed b { flex: none; }
.pxp-bird { color: #1d9bf0; display: grid; }
.pxp-back { border: 0; background: none; color: var(--pxp-acc); font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.pxp-pill { border: 0; border-radius: 999px; padding: 6px 12px; background: var(--pxp-acc); color: #001018; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.pxp-ib { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; display: grid; place-items: center; flex: none; font-size: 15px; }
.pxp-ib:hover { background: rgba(255, 255, 255, .16); }
.pxp-ib svg { width: 17px; height: 17px; }
.pxp-list { display: flex; flex-direction: column; gap: 6px; }
.pxp-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, .04); cursor: default; }
.pxp-row[data-px] { cursor: pointer; } .pxp-row:hover { background: rgba(255, 255, 255, .08); }
.pxp-rt { flex: 1; min-width: 0; } .pxp-rt b { display: block; } .pxp-rt small { color: rgba(255, 255, 255, .55); font-size: 11px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pxp-time { color: rgba(255, 255, 255, .4); font-size: 10px; }
.pxp-row .pxp-n { position: static; }
.pxp-st { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #666; margin-right: 5px; } .pxp-st.on { background: #3ee08f; box-shadow: 0 0 6px #3ee08f; }
.pxp-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; font-style: normal; font-weight: 800; color: #fff; }
.pxp-av.big { width: 48px; height: 48px; }
.pxp-sec { margin: 10px 2px 2px; color: rgba(255, 255, 255, .5); font-size: 11px; letter-spacing: .5px; }
.pxp-empty { color: rgba(255, 255, 255, .5); text-align: center; padding: 18px 6px; font-size: 12px; line-height: 1.6; }
.pxp-seg { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, .06); margin-bottom: 8px; }
.pxp-seg button { flex: 1; border: 0; border-radius: 9px; padding: 7px 4px; background: none; color: rgba(255, 255, 255, .6); font: inherit; font-size: 11.5px; cursor: pointer; }
.pxp-seg button.on { background: rgba(255, 255, 255, .14); color: #fff; }
/* chat / sms */
.pxp-chat { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; padding: 4px 2px 8px; }
.pxp-screen[data-app=sms] .pxp-chat { max-height: none; min-height: 250px; }
.pxp-bub { align-self: flex-start; max-width: 80%; padding: 7px 11px; border-radius: 16px 16px 16px 4px; background: rgba(255, 255, 255, .1); line-height: 1.4; word-break: break-word; }
.pxp-bub.me { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--pxp-acc); color: #001018; }
.pxp-bub b { display: block; font-size: 10.5px; opacity: .7; } .pxp-bub small { display: block; font-size: 9.5px; opacity: .55; text-align: right; }
.pxp-bub em { display: block; font-style: normal; font-weight: 700; }
.pxp-compose { display: flex; gap: 6px; margin-top: 6px; position: sticky; bottom: 0; }
.pxp-compose input { flex: 1; min-width: 0; border: 1px solid rgba(255, 255, 255, .14); border-radius: 18px; padding: 8px 12px; background: rgba(255, 255, 255, .07); color: #fff; font: inherit; outline: none; }
.pxp-compose input:focus { border-color: var(--pxp-acc); }
.pxp-compose button { border: 0; border-radius: 18px; padding: 0 14px; background: var(--pxp-acc); color: #001018; font-weight: 700; cursor: pointer; }
.pxp-ghead { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; } .pxp-ghead b { font-size: 16px; display: block; } .pxp-ghead small { color: rgba(255, 255, 255, .55); }
.pxp-notice { padding: 8px 10px; border-radius: 12px; background: rgba(255, 209, 102, .1); color: #ffe7a6; font-size: 12px; margin-bottom: 8px; }
.pxp-members { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.pxp-members span { padding: 3px 8px; border-radius: 10px; background: rgba(255, 255, 255, .06); font-size: 11px; color: rgba(255, 255, 255, .5); }
.pxp-members span.on { color: #fff; box-shadow: inset 0 0 0 1px rgba(62, 224, 143, .5); }
/* mail */
.pxp-mail { padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .06); }
.pxp-mail.done { opacity: .5; } .pxp-mh b { display: block; } .pxp-mh small { color: rgba(255, 255, 255, .5); font-size: 10.5px; }
.pxp-mail p { margin: 6px 0; color: rgba(255, 255, 255, .8); font-size: 12px; }
.pxp-items { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.pxp-items span { display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px 3px 3px; border-radius: 10px; background: rgba(0, 0, 0, .35); font-size: 11px; }
.pxp-items img { width: 22px; height: 22px; image-rendering: pixelated; }
.pxp-items.pick span { cursor: pointer; } .pxp-items.pick span.on { outline: 2px solid var(--pxp-acc); }
.pxp-ok { color: #7cf6c0; }
.pxp-gift { padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .06); margin-top: 6px; }
/* feed */
.pxp-pin { padding: 8px 10px; border-radius: 12px; background: rgba(29, 155, 240, .14); font-size: 12px; margin-bottom: 8px; }
.pxp-post { padding: 10px; border-radius: 16px; background: rgba(255, 255, 255, .05); margin-bottom: 10px; }
.pxp-post textarea { width: 100%; min-height: 56px; resize: none; border: 0; outline: none; background: none; color: #fff; font: inherit; }
.pxp-pr { display: flex; align-items: center; gap: 6px; } .pxp-pr small { flex: 1; text-align: right; color: rgba(255, 255, 255, .4); font-size: 10.5px; }
.pxp-send { border: 0; border-radius: 999px; padding: 7px 16px; background: #1d9bf0; color: #fff; font-weight: 800; cursor: pointer; }
.pxp-send:disabled { opacity: .45; cursor: not-allowed; }
.pxp-att { position: relative; margin: 6px 0; } .pxp-att img { max-width: 100%; max-height: 120px; border-radius: 10px; display: block; }
.pxp-att button { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 50%; width: 24px; height: 24px; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; }
.pxp-card { display: flex; gap: 10px; padding: 10px 4px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.pxp-cb { flex: 1; min-width: 0; } .pxp-ch { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; } .pxp-ch small { color: rgba(255, 255, 255, .45); font-size: 10.5px; }
.pxp-ch .g9-emb { width: 14px; height: 14px; }
.pxp-cb p { margin: 3px 0 6px; line-height: 1.45; word-break: break-word; white-space: pre-wrap; }
.pxp-img { max-width: 100%; max-height: 200px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .1); display: block; margin-bottom: 6px; }
.pxp-act { display: flex; gap: 14px; } .pxp-act button { border: 0; background: none; color: rgba(255, 255, 255, .5); cursor: pointer; font: inherit; font-size: 12px; padding: 0; }
.pxp-act button.on { color: #ff4f6d; }
/* settings */
.pxp-sw { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); cursor: pointer; }
.pxp-sw span { flex: 1; } .pxp-sw b { display: block; font-weight: 600; } .pxp-sw small { color: rgba(255, 255, 255, .5); font-size: 11px; }
.pxp-sw input { display: none; } .pxp-sw i { width: 42px; height: 24px; border-radius: 12px; background: rgba(255, 255, 255, .2); position: relative; transition: background .15s; flex: none; }
.pxp-sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.pxp-sw input:checked + i { background: #3ee08f; } .pxp-sw input:checked + i::after { transform: translateX(18px); }

/* ---------------- Toast มุมขวาบน ---------------- */
#pxp-toasts { position: absolute; top: 12px; right: 12px; z-index: 70; display: flex; flex-direction: column; gap: 8px; width: min(320px, 70vw); pointer-events: none; }
.pxp-toast { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 16px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .14); color: #fff; box-shadow: 0 10px 26px rgba(0, 0, 0, .35); pointer-events: auto; cursor: pointer; opacity: 0; transform: translateX(24px); transition: opacity .35s ease, transform .35s cubic-bezier(.2, .9, .3, 1.2); }
.pxp-toast.in { opacity: 1; transform: none; } .pxp-toast.out { opacity: 0; transform: translateX(24px); }
.pxp-toast .pxp-av { width: 32px; height: 32px; } .pxp-toast .pxp-av svg { width: 16px; height: 16px; }
.pxp-toast .pxp-av.sms { background: #3ee08f; } .pxp-toast .pxp-av.sms svg { fill: none; stroke: #fff; stroke-width: 2; }
.pxp-tb { flex: 1; min-width: 0; } .pxp-tb b { display: block; font-size: 12px; color: #8fd3ff; } .pxp-toast.sms .pxp-tb b { color: #7cf6c0; }
.pxp-tb span { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pxp-timg { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; }
body:not(.m-mobile) #pxp-toasts { top: 160px; }
body.m-mobile #pxp-toasts { top: calc(100px * var(--ui, 1)); }

/* ---------------- ปุ่มลอย (มือถือ) ---------------- */
#pxp-fab { display: none; position: absolute; left: 10px; top: calc(118px * var(--ui, 1)); z-index: 22; width: 44px; height: 44px; border-radius: 14px; border: 1.5px solid rgba(255, 255, 255, .3); background: rgba(0, 0, 0, .5); backdrop-filter: blur(4px); font-size: 20px; pointer-events: auto; cursor: pointer; }
body.m-mobile #pxp-fab { display: block; }
.pxp-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff4f6d; color: #fff; font: 700 10.5px/18px system-ui, sans-serif; font-style: normal; }
#hud .hx-tile.pxp-has::after { content: ""; position: absolute; top: 5px; left: 6px; width: 7px; height: 7px; border-radius: 50%; background: #ff4f6d; box-shadow: 0 0 6px #ff4f6d; }
/* มือถือ: เต็มความสูง กลางจอ */
body.m-mobile #pxp { right: 50%; transform: translateX(50%); bottom: auto; top: 8px; width: min(var(--pxp-w), 92vw); height: calc(100vh - 16px); animation: none; }

/* ---------------- v15: ปุ่มกลับ/หน้าหลัก/ปิด (เด่น เข้าใจง่าย) ---------------- */
.pxp-foot { display: flex; gap: 6px; padding: 6px 12px 12px; }
.pxp-foot button { flex: 1; height: 36px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.pxp-foot button:hover { background: rgba(255, 255, 255, .16); }
.pxp-foot .pxp-backbtn { flex: 1.3; background: var(--pxp-acc); color: #001018; border-color: transparent; font-size: 14px; }
.pxp-foot .pxp-closebtn { flex: .8; color: #ffb3c0; }
body.m-mobile .pxp-foot button { height: 46px; font-size: 15px; }
.pxp-back { font-size: 15px !important; font-weight: 800; padding: 5px 10px !important; border-radius: 10px !important; background: rgba(255, 255, 255, .1) !important; }
.pxp-rule { display: block; margin: 4px 0; color: #ffe7a6; font-size: 11px; }
.pxp-sp { flex: 1; }
.pxp-toff { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); cursor: pointer; font-size: 13px; }
.pxp-toff:hover { background: rgba(255, 79, 109, .35); }
/* v16 */
.pxp-emo { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; margin: 6px 0; padding: 6px; border-radius: 12px; background: rgba(0, 0, 0, .3); max-height: 132px; overflow-y: auto; }
.pxp-emo button { border: 0; background: none; font-size: 18px; line-height: 1.4; border-radius: 8px; cursor: pointer; color: #fff; font-weight: 800; }
.pxp-emo button:hover { background: rgba(255, 255, 255, .12); }
.pxp-sug { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 10px; } .pxp-sug > small { width: 100%; color: rgba(255, 255, 255, .5); font-size: 11px; }
.pxp-sug button { border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: #fff; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 11.5px; cursor: pointer; }
.pxp-sug button small { opacity: .55; }
.pxp-mine { font-style: normal; font-size: 10.5px; color: #7cf6c0; margin-left: 4px; }
.pxp-head .pxp-pill { margin-left: auto; }
/* v32: ช่องมองภาพกล้องเซลฟี่ ซูมเข้า-ออก */
#pxp-cam { position: absolute; inset: 0; z-index: 80; pointer-events: auto; touch-action: none; }
#pxp-cam .pc-frame { position: absolute; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); border: 2px solid rgba(255, 255, 255, .85); border-radius: 6px; pointer-events: none; transition: width .08s, height .08s; }
#pxp-cam .pc-frame i { position: absolute; width: 18px; height: 18px; border: 3px solid #ff4fa3; }
#pxp-cam .pc-frame i:nth-child(1) { left: -4px; top: -4px; border-right: 0; border-bottom: 0; } #pxp-cam .pc-frame i:nth-child(2) { right: -4px; top: -4px; border-left: 0; border-bottom: 0; }
#pxp-cam .pc-frame i:nth-child(3) { left: -4px; bottom: -4px; border-right: 0; border-top: 0; } #pxp-cam .pc-frame i:nth-child(4) { right: -4px; bottom: -4px; border-left: 0; border-top: 0; }
#pxp-cam .pc-z { position: absolute; left: 50%; top: -30px; transform: translateX(-50%); white-space: nowrap; padding: 3px 10px; border-radius: 10px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; font-weight: 700; }
#pxp-cam .pc-bar { position: absolute; left: 50%; top: calc(var(--sat, 0px) + 58px * var(--ui, 1)); transform: translateX(-50%); width: min(460px, 92vw); padding: 12px 14px; border-radius: 16px; background: rgba(10, 8, 22, .85); border: 1px solid rgba(255, 255, 255, .15); color: #fff; display: grid; grid-template-columns: 40px 1fr 40px; gap: 8px; align-items: center; backdrop-filter: blur(6px); }
#pxp-cam .pc-bar > button { height: 36px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; font-size: 18px; cursor: pointer; }
#pxp-cam .pc-bar input { width: 100%; accent-color: #ff4fa3; }
#pxp-cam .pc-pre, #pxp-cam .pc-act { grid-column: 1 / -1; display: flex; gap: 6px; } #pxp-cam .pc-pre button { flex: 1; padding: 7px 4px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); color: #fff; font: 600 12px/1 inherit; cursor: pointer; }
#pxp-cam .pc-act button { flex: 1; height: 44px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #fff; font: 700 14px/1 inherit; cursor: pointer; }
#pxp-cam .pc-act .snap { flex: 2; background: linear-gradient(135deg, #ff4fa3, #7b2cff); border: 0; font-size: 22px; }
#pxp-cam .pc-bar small { grid-column: 1 / -1; text-align: center; font-size: 10.5px; opacity: .6; }
body.m-mobile #pxp-cam .pc-bar { top: calc(var(--sat, 0px) + 8px); width: min(420px, 60vw); }
