/* ฟอนต์ภาษาไทย CMU (มหาวิทยาลัยเชียงใหม่ — อนุญาตให้ใช้บนเว็บไซต์และเชิงพาณิชย์ได้ฟรี ห้ามดัดแปลงไฟล์ฟอนต์) */
@font-face { font-family: 'CMU Thai'; src: url('/fonts/CMU-Regular.woff2') format('woff2'), url('/fonts/CMU-Regular.woff') format('woff'); font-weight: 400; font-display: swap; unicode-range: U+0E00-0E7F; }
@font-face { font-family: 'CMU Thai'; src: url('/fonts/CMU-Bold.woff2') format('woff2'), url('/fonts/CMU-Bold.woff') format('woff'); font-weight: 700; font-display: swap; unicode-range: U+0E00-0E7F; }

:root {
  --bg: #000;
  --bg2: #0d0d0d;
  --card: #111;
  --card2: #1a1a1a;
  --text: #fff;
  --muted: #8f8f8f;
  --line: #262626;
  --bad: #ff6b6b;
  --radius: 16px;
  --font: 'Times New Roman MT', 'Times New Roman', Times, 'CMU Thai', Tahoma, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 17px; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--text); }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font); font-weight: 700; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 7vw, 3.8rem); }
h2 { font-size: 1.6rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }

/* header */
.top { padding: 14px 0; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); font-size: 1.4rem; font-weight: 400; }
.logo i { font-style: italic; color: var(--muted); }
.logo .mark { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--text); display: grid; place-items: center; flex: 0 0 auto; }
.logo .mark img { width: 62%; height: auto; }
.foot { padding: 28px 0; color: var(--muted); font-size: .88rem; text-align: center; border-top: 1px solid var(--line); margin-top: 56px; }
.foot a { color: var(--text); }
.msg-ic { width: 1.1em; height: 1.1em; flex: 0 0 auto; }
.found-pop { text-align: center; padding: 8px 4px 2px; }
.found-pop .found-n { font-size: 4.2rem; line-height: 1; font-weight: 400; margin: 6px 0 10px; animation: found-pop .5s cubic-bezier(.2,.8,.3,1.3) both; }
.found-pop h2 { margin: 0 0 8px; }
.found-pop p { margin: 0 0 6px; line-height: 1.6; }
.found-acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.found-acts .btn { border-radius: 999px; min-width: 150px; }
@keyframes found-pop { from { opacity: 0; transform: scale(.6); } }
.contact { text-align: center; }
.contact-a { margin: 72px auto 0; max-width: 860px; padding: 44px 24px 12px; border-top: 1px solid var(--line); }
.contact-a .eyebrow { text-transform: uppercase; letter-spacing: .4em; font-size: .72rem; color: var(--muted); }
.contact-a h2 { font-size: clamp(1.5rem, 4.4vw, 2.1rem); font-weight: 400; margin: 10px 0 8px; line-height: 1.35; }
.contact-a .lead { color: var(--muted); margin: 0 0 26px; }
.contact-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; text-align: left; }
.contact .cc { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; }
.contact .cc h3 { margin: 0 0 8px; font-size: 1.12rem; }
.contact .cc p { color: var(--muted); margin: 0 0 18px; flex: 1; line-height: 1.6; font-size: .95rem; }
.contact .btn { border-radius: 999px; }
.btn.outline { background: transparent; color: var(--text); border-color: var(--text); }
.contact-page { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.contact-page:hover { color: var(--text); }
.contact-b { margin: 30px auto 0; max-width: 460px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.contact-b h3 { margin: 0 0 6px; font-size: 1.15rem; }
.contact-b p { color: var(--muted); margin: 0 0 16px; }
.contact-b .btn { width: 100%; }
@media (max-width: 600px) { .contact-cards { grid-template-columns: 1fr; } .contact-a { padding: 36px 4px 8px; } }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--text); border-radius: 12px; padding: 12px 22px; background: var(--text); color: #000; font: 700 1rem var(--font); cursor: pointer; text-decoration: none; transition: opacity .15s, transform .1s, background .15s; }
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.ghost, .btn.light { background: var(--card2); color: var(--text); border-color: var(--card2); }
.btn.ghost:hover, .btn.light:hover { background: #262626; opacity: 1; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.sm { padding: 7px 14px; font-size: .9rem; border-radius: 10px; }
.btn.big { padding: 16px 28px; font-size: 1.1rem; width: 100%; }
input, select, textarea { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font: inherit; color: var(--text); color-scheme: dark; }
input:focus, select:focus { outline: 2px solid #444; border-color: #666; }
input::placeholder { color: #666; }
label { display: block; font-size: .92rem; color: var(--muted); margin: 10px 0 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.notice { background: var(--card2); border-radius: 12px; padding: 10px 14px; font-size: .94rem; }
.status { font-size: .94rem; color: var(--muted); margin-top: 8px; }
.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .8rem; background: var(--card2); color: var(--muted); font-weight: 400; vertical-align: middle; }
.pill.ok { background: #fff; color: #000; }
.pill.off { background: transparent; color: var(--bad); border: 1px solid var(--bad); }

/* home */
.intro { padding: 56px 0 28px; }
.intro .eyebrow { letter-spacing: .3em; text-transform: uppercase; font-size: .8rem; color: var(--muted); margin-bottom: 14px; }
.intro p { max-width: 600px; margin: 10px 0 0; color: var(--muted); font-size: 1.2rem; }
.steps { display: flex; gap: 22px; flex-wrap: wrap; margin: 24px 0 6px; font-size: 1rem; }
.steps span b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--text); margin-right: 8px; font-size: .85rem; }
.search-ev { max-width: 420px; margin: 18px 0 26px; }
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.ev-card { display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .2s, border-color .2s; }
.ev-card:hover { transform: translateY(-3px); border-color: #555; }
.ev-card .cv { aspect-ratio: 4/3; background: var(--card2); background-size: cover; background-position: center; display: grid; place-items: center; font-size: 2.6rem; color: var(--muted); }
.ev-card .bd { padding: 14px 16px 16px; }
.ev-card h3 { font-size: 1.35rem; margin: 0 0 2px; }
.ev-card .meta { color: var(--muted); font-size: .9rem; }

/* event page */
.ev-hero { position: relative; min-height: 48vh; display: flex; align-items: flex-end; background: var(--bg2); background-size: cover; background-position: center; }
.ev-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .1) 20%, rgba(0, 0, 0, .9) 100%); }
.ev-hero .wrap { position: relative; z-index: 1; width: 100%; padding-bottom: 40px; color: #fff; }
.ev-hero h1 { margin: 0; }
.ev-hero .meta { color: #ccc; }
.scan-card { max-width: 520px; margin: -24px auto 0; position: relative; z-index: 2; text-align: center; }
.scan-card .selfie { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin: 0 auto 10px; border: 2px solid var(--text); }
.scan-card .btns { display: grid; gap: 10px; margin-top: 14px; }
.privacy { font-size: .84rem; color: var(--muted); margin-top: 12px; }
.privacy a { color: var(--muted); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #333; border-top-color: #fff; animation: spin 1s linear infinite; margin: 10px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.res-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 34px 0 12px; }
.res-head h2 { margin: 0; }
.res-head .row > *, .admin-h .row > * { flex: 0 0 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 4px; } }
.ph { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: var(--card2); cursor: pointer; }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.ph:hover img { transform: scale(1.04); }
.ph .badge { position: absolute; left: 6px; top: 6px; background: #fff; color: #000; font-size: .74rem; padding: 0 8px; border-radius: 999px; font-weight: 700; }
.ph .tick { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, .35); color: transparent; display: none; place-items: center; font-size: .9rem; }
.selecting .ph .tick { display: grid; }
.ph.sel .tick { background: #fff; color: #000; }
.ph.sel img { opacity: .7; }
.sub-h { margin: 28px 0 8px; font-size: 1.2rem; }

.newbar { position: fixed; top: 82px; left: 50%; transform: translateX(-50%); z-index: 40; background: #fff; color: #000; border-radius: 999px; padding: 10px 20px; box-shadow: 0 8px 30px rgba(255, 255, 255, .15); cursor: pointer; font-weight: 700; white-space: nowrap; }

.selbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(17, 17, 17, .96); border-top: 1px solid var(--line); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); }
.selbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; }
.lb .lb-img { flex: 1; position: relative; min-height: 0; margin: 0 64px; }
.lb .lb-img img { position: absolute; inset: 0; margin: auto; max-width: calc(100% - 16px); max-height: calc(100% - 16px); object-fit: contain; border-radius: 4px; opacity: 0; transition: opacity .18s; }
.lb .lb-img img.ready { opacity: 1; }
.lb .lb-load { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: rgba(255,255,255,.75); font-size: .95rem; pointer-events: none; }
.lb .lb-load.hidden { display: none; }
.lb .lb-load .spinner { margin: 0; }
.lb .lb-bar { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
/* ปุ่มลูกศร: วางนอกรูปซ้าย/ขวา อยู่ชั้นบนสุด กดได้เสมอ */
.lb .nav { position: absolute; top: 50%; z-index: 3; transform: translateY(-50%); background: rgba(255, 255, 255, .16); border: 1px solid rgba(255,255,255,.3); color: #fff; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; padding: 0; -webkit-tap-highlight-color: transparent; }
.lb .nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.lb .nav:hover { background: rgba(255,255,255,.28); }
.lb .nav:active { transform: translateY(-50%) scale(.92); }
.lb .nav.l { left: -58px; } .lb .nav.r { right: -58px; }
@media (max-width: 600px) {
  .lb .lb-img { margin: 0 46px; }
  .lb .nav { width: 40px; height: 40px; }
  .lb .nav svg { width: 20px; height: 20px; }
  .lb .nav.l { left: -44px; } .lb .nav.r { right: -44px; }
}
/* แถบรูปย่อใต้รูปใหญ่ */
.lb .lb-strip { flex: 0 0 auto; display: flex; gap: 4px; overflow-x: auto; padding: 10px 50%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.lb .lb-strip::-webkit-scrollbar { display: none; }
.lb .lb-strip .st { flex: 0 0 auto; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: #222; opacity: .5; cursor: pointer; transition: opacity .15s, transform .15s; }
.lb .lb-strip .st img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb .lb-strip .st.on { opacity: 1; outline: 2px solid #fff; outline-offset: -2px; transform: scale(1.12); }
@media (min-width: 900px) { .lb .lb-strip .st { width: 58px; height: 58px; } }
.lb .x { position: absolute; top: 12px; right: 14px; background: rgba(255, 255, 255, .12); color: #fff; border: 0; width: 40px; height: 40px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; z-index: 2; }
.lb .count { align-self: center; margin-top: calc(64px + env(safe-area-inset-top)); flex: 0 0 auto; height: 44px; display: inline-flex; align-items: center; gap: 2px; padding: 0 20px; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28); color: #fff; font: 700 1.3rem var(--font); letter-spacing: .04em; }
.lb .count small { font-weight: 400; color: rgba(255, 255, 255, .6); font-size: .85em; margin-left: 4px; }

/* modal */
.modal-bg { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 460px; position: relative; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal.wide { max-width: 760px; }
.modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 1.2rem; cursor: pointer; color: var(--muted); }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.cmp figure { margin: 0; }
.cmp img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--card2); }
.cmp figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; word-break: break-all; }

/* admin */
.admin-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 28px 0 16px; }
.admin-ev { display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; align-items: center; padding: 14px; }
.admin-ev + .admin-ev { margin-top: 12px; }
.admin-ev .cv { width: 120px; aspect-ratio: 4/3; border-radius: 10px; background: var(--card2) center/cover; }
.admin-ev .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .admin-ev { grid-template-columns: 90px 1fr; } .admin-ev .cv { width: 90px; } .admin-ev .acts { grid-column: 1 / -1; justify-content: flex-start; } }
.drop { border: 1.5px dashed #555; border-radius: var(--radius); padding: 28px 16px; text-align: center; cursor: pointer; background: var(--bg2); transition: background .15s, border-color .15s; }
.drop.over, .drop:hover { background: var(--card2); border-color: #fff; }
.progress { height: 8px; background: var(--card2); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: #fff; transition: width .2s; }
.stats { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .92rem; }
.stats b { color: var(--text); font-size: 1.05rem; }
.folder-live { display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); animation: pulse 1.6s infinite; flex: 0 0 auto; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
.admin-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.admin-grid .ph .fc { position: absolute; left: 4px; bottom: 4px; background: rgba(0, 0, 0, .7); color: #fff; font-size: .72rem; padding: 0 6px; border-radius: 6px; }
.qr-box { text-align: center; }
.qr-box canvas { max-width: 100%; height: auto; border-radius: 8px; }
.cover-pick { display: flex; gap: 12px; align-items: center; }
.cover-pick .cv { width: 110px; aspect-ratio: 4/3; border-radius: 10px; background: var(--card2) center/cover; flex: 0 0 auto; display: grid; place-items: center; color: var(--muted); font-size: .8rem; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); margin-top: 14px; }
.check input { width: auto; }
.logo .lt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.logo .l2 { font-size: .74rem; color: var(--muted); letter-spacing: .03em; margin-top: 3px; }
/* ช่องรหัสผ่าน: ใช้ input ธรรมดา + ซ่อนตัวอักษรด้วย CSS (แก้ปัญหาพิมพ์ไม่ได้ในเบราว์เซอร์ของ Messenger/LINE/Facebook) */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-mask { -webkit-text-security: disc; text-security: disc; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font-size: 1.1rem; padding: 8px; cursor: pointer; }
/* QR ของงานในหน้าผู้ดูแล */
.admin-ev { grid-template-columns: 120px 1fr auto auto; }
.admin-ev .qr-mini { width: 96px; height: 96px; border-radius: 10px; background: #fff; padding: 6px; cursor: pointer; display: block; }
.admin-ev .qr-mini canvas { width: 100%; height: 100%; display: block; }
@media (max-width: 640px) { .admin-ev { grid-template-columns: 90px 1fr 80px; } .admin-ev .qr-mini { width: 80px; height: 80px; } }
.qr-head { width: 120px; height: 120px; background: #fff; border-radius: 12px; padding: 8px; cursor: pointer; flex: 0 0 auto; }
.qr-head canvas { width: 100%; height: 100%; display: block; }
/* ช่องรหัสผ่าน: ใช้ฟอนต์ระบบ + สีชัดเจน กันปัญหาตัวอักษรไม่แสดงบน iPhone */
#pw { font-family: -apple-system, system-ui, 'Segoe UI', Arial, sans-serif; font-size: 18px; color: #fff; -webkit-text-fill-color: #fff; caret-color: #fff; background: #1a1a1a; -webkit-user-select: text; user-select: text; color-scheme: normal; }
#pw::placeholder { color: #777; -webkit-text-fill-color: #777; }
/* จำนวนรูปหลังชื่องาน */
.count-pill { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 12px; border: 1px solid rgba(255, 255, 255, .45); border-radius: 999px; font-size: .9rem; font-weight: 400; letter-spacing: .02em; color: #fff; background: rgba(0, 0, 0, .25); white-space: nowrap; position: relative; top: -2px; }
.ev-card .count-pill { font-size: .8rem; padding: 1px 10px; top: -1px; }
.ev-hero .count-pill { font-size: clamp(.85rem, 2.6vw, 1rem); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
/* โลโก้ VANILLAFOTO เป็นลายน้ำพื้นหลังจาง ๆ (ความทึบ 5%) อยู่กลางจอตลอดเวลาที่เลื่อน */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url('/logo-full.png') center 55% / min(78vw, 820px) auto no-repeat; opacity: .05; }
/* จอกว้าง (คอม): ย้ายโลโก้ไปอยู่กลางพื้นที่ว่างฝั่งซ้ายและขวาของเนื้อหา */
@media (min-width: 1600px) {
  body::before {
    --side: calc((100vw - 1120px) / 2);            /* ความกว้างพื้นที่ว่างแต่ละฝั่ง */
    --lw: min(440px, calc(var(--side) - 48px));     /* ขนาดโลโก้ */
    --lx: calc(var(--side) / 2 - var(--lw) / 2);    /* ระยะจากขอบจอให้อยู่กลางพื้นที่ว่าง */
    background:
      url('/logo-full.png') left var(--lx) center / var(--lw) auto no-repeat,
      url('/logo-full.png') right var(--lx) center / var(--lw) auto no-repeat;
  }
}

/* ---------- รูปทั้งหมดในงาน ---------- */
.ev-hero.clickable { cursor: pointer; }
.hero-all { margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .35); color: #fff; font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hero-all:hover { background: rgba(255, 255, 255, .15); }
.scan-card .all-btn { width: 100%; margin-top: 10px; }
/* แบบอัลบั้มรูปใน iPhone */
.allv { position: fixed; inset: 0; z-index: 50; background: #000; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.allv.selecting { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.ios-top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 14px 22px;
  background: linear-gradient(180deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.7) 55%, rgba(0,0,0,0) 100%); margin-bottom: -10px; pointer-events: none; }
.ios-top > * { pointer-events: auto; }
.ios-title { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.15; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.ios-title b { font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; color: #fff; }
.ios-title span { font-size: .85rem; color: rgba(255,255,255,.7); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glass { border: 1px solid rgba(255,255,255,.18); background: rgba(120,120,128,.32); color: #fff; backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 2px 12px rgba(0,0,0,.25); -webkit-tap-highlight-color: transparent; }
.glass:active { transform: scale(.95); }
.glass.circle { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; font-size: 1.7rem; line-height: 1; padding: 0 0 3px; }
.glass.pill { flex: 0 0 auto; height: 40px; padding: 0 18px; border-radius: 999px; font-size: 1rem; }
.glass.hidden { display: none; }
/* ตารางรูปเต็มขอบจอ ช่องว่างบาง ๆ แบบ iPhone */
.ios-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
@media (min-width: 600px) { .ios-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1000px) { .ios-grid { grid-template-columns: repeat(7, 1fr); } }
.ios-grid .ph { border-radius: 0; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.ios-grid .ph:hover img { transform: none; }
.ios-grid .ph .tick { display: none !important; }
.ios-grid .ph::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.22); opacity: 0; transition: opacity .12s; pointer-events: none; }
.ios-grid .ph.sel::after { opacity: 1; }
.ios-grid .ph.sel img { opacity: 1; }
/* เครื่องหมายถูกสีฟ้ามุมขวาล่าง (แสดงเฉพาะรูปที่เลือก) */
.ios-grid .ph.sel::before { content: ''; position: absolute; right: 6px; bottom: 6px; z-index: 1; width: 24px; height: 24px; border-radius: 50%;
  background: #0a84ff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M6.5 12.5l3.5 3.5 7.5-8'/%3E%3C/svg%3E") center/16px no-repeat;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.allv-more { padding: 20px 0; }
/* แถบล่างลอย (แคปซูลกระจกฝ้า) ตอนเลือกรูป */
.ios-bar { position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 55; display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 20px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: rgba(40,40,44,.72);
  backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); box-shadow: 0 8px 30px rgba(0,0,0,.45); max-width: 560px; margin: 0 auto; }
.ios-bar.hidden { display: none; }
.ios-bar-t { flex: 1; font-size: .92rem; color: rgba(255,255,255,.65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ios-bar-t.on { color: #fff; font-weight: 700; font-size: 1rem; }
.ios-save { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: #0a84ff; color: #fff;
  font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ios-save svg { width: 20px; height: 20px; }
.ios-save:disabled { background: rgba(255,255,255,.14); color: rgba(255,255,255,.4); cursor: default; }
.ios-save:not(:disabled):active { transform: scale(.96); }
.allv.selecting .ios-title { visibility: hidden; }
