/* หน้าแรก #ai-build · ปุ่ม "ดูเพิ่มเติม" + หน้าต่างรายละเอียดโปรแกรม (more.js) · v3 (29-11-2026)
   ใช้คู่กับ site-421.css (โทเคน --ink --muted --blue --ok) และ ai-build-v2/build-r2.css (.build-rank) */

/* ── ปุ่มในแถว ── */
.build-rank li.has-more { cursor:pointer;border-radius:12px;transition:background-color .15s }
.build-rank li.has-more:hover { background:#f7f9fc }
.build-rank li.has-more:hover b { color:var(--blue) }
.build-rank li.has-more .days { grid-row:1 / span 3 }
.build-rank .build-more { grid-column:2;justify-self:start;margin-top:8px;display:inline-flex;align-items:center;gap:5px;padding:3px 12px 3px 13px;border:1px solid #cfe0f6;border-radius:999px;background:#f3f8ff;color:var(--blue);font:500 12.5px/1.65 "IBM Plex Sans Thai",system-ui,sans-serif;cursor:pointer;transition:background-color .15s,border-color .15s }
.build-rank .build-more span { font-size:15px;line-height:1;margin-top:-1px }
.build-rank .build-more:hover { background:#e6f0fd;border-color:#b5cff1 }

/* ── หน้าต่าง (ทับสไตล์ dialog สีเข้มของ site-421.css) ── */
#prog-dialog { width:min(980px,calc(100vw - 32px));max-width:none;max-height:min(880px,calc(100dvh - 32px));padding:0;border:0;border-radius:24px;background:#fff;color:var(--ink);box-shadow:0 30px 90px #0b122059;overflow:hidden }
#prog-dialog[open] { display:flex;flex-direction:column }
#prog-dialog::backdrop { background:#0b1220b3;backdrop-filter:blur(8px) }
#prog-dialog h2, #prog-dialog h3 { font-family:Anuphan,system-ui,sans-serif;letter-spacing:-.01em }
.pd-head { display:flex;align-items:flex-start;gap:14px;padding:20px 22px 16px 26px;border-bottom:1px solid #ececf0 }
.pd-rank { flex:none;width:34px;height:34px;border-radius:50%;background:#edf4ff;color:var(--blue);font:600 15px/34px Anuphan,system-ui,sans-serif;text-align:center;margin-top:2px }
.pd-ttl { flex:1;min-width:0 }
.pd-ttl h2 { margin:0;font-size:22px;font-weight:600;line-height:1.35;outline:none }
.pd-sub { margin:4px 0 0;font-size:13px;line-height:1.7;color:var(--muted) }
.pd-sub .who { display:inline-block;margin-right:8px;padding:1px 8px;border-radius:999px;font-size:11px;font-weight:600;line-height:1.6;vertical-align:1px }
.pd-sub .who-s { background:#e8f6ee;color:#147a43 }
.pd-sub .who-t { background:#edf4ff;color:#1d5fae }
.pd-per { margin-left:8px;color:#8e8e93;white-space:nowrap }
.pd-x { flex:none;width:36px;height:36px;border:0;border-radius:50%;background:#f2f2f5;color:#3a3a3f;font-size:14px;cursor:pointer }
.pd-x:hover { background:#e6e6ea }

.pd-body { flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;display:grid;grid-template-columns:minmax(0,350px) minmax(0,1fr);gap:34px;align-items:start;padding:24px 30px 28px 26px }
.pd-shots { position:sticky;top:0 }
.pd-frame { position:relative;height:clamp(400px,64vh,640px);border-radius:20px;background:#eef1f5;overflow:hidden }
.pd-track { display:flex;height:100%;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;outline:none }
.pd-track::-webkit-scrollbar { display:none }
.pd-track:focus-visible { box-shadow:inset 0 0 0 3px #268dff;border-radius:20px }
.pd-slide { flex:0 0 100%;height:100%;margin:0;scroll-snap-align:center;display:flex;justify-content:center;align-items:flex-start;padding:12px;overflow:hidden }
.pd-slide img { height:100%;width:auto;max-width:100%;object-fit:contain;object-position:top center;border-radius:12px;box-shadow:0 6px 22px #1830571f;background:#fff;cursor:zoom-in }
.pd-frame.zoom .pd-slide { overflow-y:auto;overscroll-behavior:contain }
.pd-frame.zoom .pd-slide img { height:auto;width:100%;max-width:none;cursor:zoom-out }
.pd-zoom { position:absolute;right:10px;bottom:10px;display:inline-flex;align-items:center;gap:5px;border:0;border-radius:999px;background:#101113d1;color:#fff;padding:5px 12px 5px 10px;font:500 12px/1.5 "IBM Plex Sans Thai",system-ui,sans-serif;cursor:pointer;box-shadow:0 4px 14px #0003 }
.pd-zoom:hover { background:var(--blue) }
.pd-arr { position:absolute;top:50%;transform:translateY(-50%);width:36px;height:36px;border:0;border-radius:50%;background:#ffffffeb;color:var(--ink);font-size:22px;line-height:34px;box-shadow:0 4px 14px #0002;cursor:pointer;transition:opacity .15s }
.pd-prev { left:8px } .pd-next { right:8px }
.pd-arr:disabled { opacity:0;pointer-events:none }
.pd-one .pd-arr, .pd-one .pd-dots { display:none }
.pd-cap { margin:10px 2px 0;font-size:13px;line-height:1.6;color:#3a3a3f;min-height:3.2em }
.pd-dots { display:flex;justify-content:center;gap:6px;margin-top:6px }
.pd-dots span { width:7px;height:7px;border-radius:50%;background:#d2d6de;transition:background-color .2s,width .2s }
.pd-dots span.on { width:18px;border-radius:4px;background:var(--blue) }

.pd-sec + .pd-sec { margin-top:24px }
.pd-sec h3 { margin:0 0 8px;font-size:13px;font-weight:600;color:var(--blue);letter-spacing:.04em }
.pd-who { margin:0;font-size:18px;font-weight:600;line-height:1.5;font-family:Anuphan,system-ui,sans-serif }
.pd-how { margin:2px 0 0;font-size:13px;color:var(--muted) }
.pd-tl { list-style:none;margin:14px 0 0;padding:0 }
.pd-tl li { position:relative;padding:0 0 14px 22px }
.pd-tl li::before { content:"";position:absolute;left:4px;top:7px;width:9px;height:9px;border-radius:50%;background:var(--blue);box-shadow:0 0 0 3px #edf4ff }
.pd-tl li:not(:last-child)::after { content:"";position:absolute;left:8px;top:20px;bottom:2px;width:1px;background:#dbe3ee }
.pd-tl time { display:block;font-size:12px;font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums }
.pd-tl p { margin:2px 0 0;font-size:14.5px;line-height:1.65 }
.pd-done { display:inline-block;margin-top:5px;padding:1px 9px;border-radius:999px;background:#e8f6ee;color:#147a43;font-size:12px;font-weight:600 }
.pd-can { margin:0;padding:0;list-style:none }
.pd-can li { position:relative;padding:7px 0 7px 26px;font-size:14.5px;line-height:1.65;border-top:1px solid #f0f0f3 }
.pd-can li:first-child { border-top:0 }
.pd-can li::before { content:"";position:absolute;left:3px;top:14px;width:12px;height:7px;border-left:2px solid var(--ok,#178047);border-bottom:2px solid var(--ok,#178047);transform:rotate(-45deg) }
.pd-note { margin:22px 0 0;padding:10px 13px;border-radius:12px;background:#f5f5f7;font-size:12px;line-height:1.65;color:var(--muted) }

.pd-foot { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px calc(12px + env(safe-area-inset-bottom));border-top:1px solid #ececf0;background:#fbfbfd }
.pd-foot button { border:1px solid #dcdce2;border-radius:999px;background:#fff;color:var(--ink);padding:7px 16px;font:500 13px/1.5 "IBM Plex Sans Thai",system-ui,sans-serif;cursor:pointer }
.pd-foot button:hover { border-color:var(--blue);color:var(--blue) }
.pd-pos { font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums }

/* ── มือถือ: แผ่นเลื่อนขึ้นจากด้านล่าง · ภาพเลื่อนซ้ายขวาเห็นภาพถัดไปนิดหนึ่ง ── */
@media (max-width:719px) {
  #prog-dialog { width:100%;max-width:100%;height:auto;max-height:94dvh;margin:auto 0 0;border-radius:22px 22px 0 0 }
  .pd-head { padding:16px 14px 12px 16px;gap:11px }
  .pd-rank { width:30px;height:30px;font-size:13px;line-height:30px }
  .pd-ttl h2 { font-size:19px }
  .pd-body { grid-template-columns:minmax(0,1fr);gap:18px;padding:16px 16px 22px }
  .pd-shots { position:static }
  .pd-frame { height:min(62dvh,540px);margin:0 -16px;border-radius:0;background:#eef1f5 }
  .pd-track:focus-visible { border-radius:0 }
  .pd-slide { flex-basis:84%;padding:12px 6px }
  .pd-slide:first-child { margin-left:8% } .pd-slide:last-child { margin-right:8% }
  .pd-arr { display:none }
  .pd-cap { min-height:0 }
  .pd-who { font-size:17px }
  .pd-tl p, .pd-can li { font-size:14px }
}
@media (prefers-reduced-motion:reduce) {
  .build-rank li.has-more, .pd-dots span, .pd-arr { transition:none }
}
