/* ===================================================================
   E-Service — ผังวิทยาลัยแบบสามมิติ (public/content/pages/e-service.html · public/js/campus.js)
   สีของผังเป็นตัวแปร --cm-* ด้านล่าง (โหมดมืด = ภาพกลางคืน หน้าต่างเปิดไฟ ดาวขึ้น)
   =================================================================== */

/* ---------- หัวหน้า ---------- */
.es-hero { padding: clamp(28px, 4vw, 48px) 0 4px; text-align: center; }
.es-hero .breadcrumb { justify-content: center; }
.es-eyebrow { margin: 14px 0 6px; font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; letter-spacing: 0.08em; color: var(--gold-700); }
.es-title { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.2; margin: 0 0 10px; }
.es-title span { display: block; background: linear-gradient(135deg, #D8B24C, #A67F1D); -webkit-background-clip: text; background-clip: text; color: transparent; }
.es-lead { max-width: 640px; margin: 0 auto; color: var(--ink-600); font-size: 1.02rem; }
.es-band { padding: 8px 0 clamp(40px, 6vw, 72px); overflow: hidden; }
.es-note { margin: 10px 0 0; text-align: center; font-size: 0.82rem; color: var(--ink-600); opacity: 0.8; }

/* ---------- สีผัง (กลางวัน) ---------- */
.es-stage {
  --cm-plate: #D3E7C7; --cm-plate-l: #C3D5B4; --cm-plate-r: #A9BE99; --cm-rim: rgba(255, 255, 255, 0.95);
  --cm-plate-shadow: #0D3B35; --cm-grid: rgba(13, 59, 53, 0.07);
  --cm-pave: #F2EEE3; --cm-plaza: #E9DFC8;
  --cm-road: #C4C9D1; --cm-road-line: #FFFFFF;
  --cm-walk: #D69676;
  --cm-field: #A6D696; --cm-field-line: rgba(255, 255, 255, 0.9); --cm-track: #D98D6C;
  --cm-water: #86CDE8; --cm-water-edge: #EDE6D4; --cm-ripple: rgba(255, 255, 255, 0.8);
  --cm-face-l: #FFFFFF; --cm-face-r: #E2E5F3; --cm-top: #F5F6FC; --cm-roof: #E8EAF4; --cm-col: rgba(40, 50, 100, 0.07);
  --cm-edge: rgba(40, 50, 100, 0.16);
  --cm-win: #AEB5DD; --cm-win-r: #979FCB; --cm-lit: #AEB5DD; --cm-door: #7D88BC;
  --cm-shadow: rgba(25, 45, 70, 0.14);
  --cm-tree: #73BD76; --cm-tree-hi: #A8DD92; --cm-trunk: #9B7653;
  --cm-dome-mix: #0E1B3D;
  --cm-cloud: rgba(255, 255, 255, 0.88);
  --cm-star: transparent; --cm-tile: rgba(13, 59, 53, 0.08);
  --cm-card: #FFFFFF;
  position: relative; container-type: inline-size;
}
/* ---------- สีผัง (กลางคืน) ---------- */
:root[data-theme="dark"] .es-stage {
  --cm-plate: #1C3A2F; --cm-plate-l: #132A21; --cm-plate-r: #0D1F18; --cm-rim: rgba(159, 217, 203, 0.32);
  --cm-plate-shadow: #000000; --cm-grid: rgba(159, 217, 203, 0.05);
  --cm-pave: #263830; --cm-plaza: #2E3D34;
  --cm-road: #2B3337; --cm-road-line: rgba(255, 226, 150, 0.55);
  --cm-walk: #6A4232;
  --cm-field: #22503A; --cm-field-line: rgba(255, 255, 255, 0.3); --cm-track: #5B3427;
  --cm-water: #1B5870; --cm-water-edge: #2E3D35; --cm-ripple: rgba(170, 225, 255, 0.4);
  --cm-face-l: #344250; --cm-face-r: #26313C; --cm-top: #3D4B58; --cm-roof: #303C48; --cm-col: rgba(0, 0, 0, 0.18);
  --cm-edge: rgba(0, 0, 0, 0.35);
  --cm-win: #1B2430; --cm-win-r: #161E28; --cm-lit: #FFD27A; --cm-door: #FFC861;
  --cm-shadow: rgba(0, 0, 0, 0.32);
  --cm-tree: #2E6A49; --cm-tree-hi: #3F8661; --cm-trunk: #5B4634;
  --cm-dome-mix: #000000;
  --cm-cloud: rgba(200, 215, 235, 0.14);
  --cm-star: #FFF6D8; --cm-tile: rgba(159, 217, 203, 0.08);
  --cm-card: #13231E;
}

/* ---------- เวที ---------- */
.es-tilt {
  position: relative;
  transform: perspective(1500px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.es-stage.is-map .es-tilt { aspect-ratio: var(--ar, 1200 / 700); }
.es-stage:not(.is-map) .es-map { display: none; }
.es-map { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.es-overlay { position: absolute; inset: 0; pointer-events: none; }

/* ---------- ชิ้นส่วนผัง ---------- */
.es-map polygon, .es-map path { stroke-linejoin: round; }
.plate-top { fill: var(--cm-plate); }
.plate-l { fill: var(--cm-plate-l); }
.plate-r { fill: var(--cm-plate-r); }
.plate-rim { fill: none; stroke: var(--cm-rim); stroke-width: 2; }
.plate-grid { fill: none; stroke: var(--cm-grid); stroke-width: 1; }
.plate-shadow { opacity: 0.32; }
.pave { fill: var(--cm-pave); }
.plaza { fill: var(--cm-plaza); }
.road { fill: var(--cm-road); }
.road-line { fill: none; stroke: var(--cm-road-line); stroke-width: 1.4; stroke-dasharray: 7 7; }
.walk { fill: var(--cm-walk); }
.field { fill: var(--cm-field); }
.field-line { fill: none; stroke: var(--cm-field-line); stroke-width: 1.3; }
.track { fill: none; stroke: var(--cm-track); stroke-width: 5; opacity: 0.85; }
.pond-edge { fill: var(--cm-water-edge); }
.water { fill: var(--cm-water); }
.ripple { fill: none; stroke: var(--cm-ripple); stroke-width: 1.2; transform-box: fill-box; transform-origin: center; animation: es-ripple 4s ease-out infinite; animation-delay: var(--d, 0s); }
.fountain-base { fill: var(--cm-ripple); }
.drop { fill: #E8F7FF; transform-box: fill-box; transform-origin: center; animation: es-drop 1.6s ease-out infinite; animation-delay: var(--d, 0s); }
.shadow { fill: var(--cm-shadow); }

.f-l, .f-r, .f-t, .gable-end, .dome-end { stroke: var(--cm-edge); stroke-width: 0.6; }
.f-l { fill: var(--cm-face-l); }
.f-r, .gable-end { fill: var(--cm-face-r); }
.f-t { fill: var(--cm-top); }
.f-roof { fill: var(--cm-roof); }
.f-col { fill: var(--cm-col); }
.win { fill: var(--cm-win); }
.win-r { fill: var(--cm-win-r); }
.bp.named .win { fill: color-mix(in srgb, var(--acc) 62%, #FFFFFF); }
.bp.named .win-r { fill: color-mix(in srgb, var(--acc) 82%, #1B1F3A); }
.bp.named .f-roof { fill: color-mix(in srgb, var(--acc) 30%, var(--cm-top)); }
.crown { fill: var(--acc) !important; }
.door { fill: var(--cm-door); }
.r-front { fill: var(--roof); stroke: var(--cm-edge); stroke-width: 0.6; }
.r-back { fill: color-mix(in srgb, var(--roof) 72%, #000000); }
.r-ridge { fill: none; stroke: color-mix(in srgb, var(--roof) 55%, #FFFFFF); stroke-width: 1.6; stroke-linecap: round; }
.dome-end { fill: color-mix(in srgb, var(--dome) 58%, var(--cm-dome-mix)); }
.dome-rib { fill: none; stroke: rgba(255, 255, 255, 0.7); stroke-width: 2; }
.solar { fill: #2C4677; stroke: #9DB2DB; stroke-width: 0.5; }
.solar-glint { fill: #FFFFFF; opacity: 0; animation: es-glint 7s ease-in-out infinite; }
.ac-l { fill: #CDD2DE; } .ac-r { fill: #B3B9C8; } .ac-t { fill: #E3E6EE; }
.mast { stroke: #8E97AA; stroke-width: 1.4; }
.flag { fill: var(--acc); transform-box: fill-box; transform-origin: left center; animation: es-flag 2.4s ease-in-out infinite; }

.tree { transform-box: fill-box; transform-origin: 50% 100%; }
.t-trunk { fill: var(--cm-trunk); }
.t-c1 { fill: var(--cm-tree); }
.t-c2 { fill: var(--cm-tree-hi); }
.walker { stroke: #FFFFFF; stroke-width: 0.8; }
.car-body.car-l { fill: var(--car); }
.car-body.car-r { fill: color-mix(in srgb, var(--car) 72%, #000000); }
.car-body.car-t { fill: color-mix(in srgb, var(--car) 78%, #FFFFFF); }
.car-cab.car-l { fill: #DCE6F6; } .car-cab.car-r { fill: #B8C6DE; } .car-cab.car-t { fill: #F4F7FD; }
.cloud path { fill: var(--cm-cloud); }
.cloud { animation: es-cloud var(--t, 80s) linear infinite; animation-delay: var(--d, 0s); }
.star { fill: var(--cm-star); animation: es-twinkle 3.2s ease-in-out infinite; animation-delay: var(--d, 0s); }
.deco-tile { fill: var(--cm-tile); animation: es-bob 6s ease-in-out infinite; animation-delay: var(--d, 0s); }

/* ไฟกลางคืน */
:root[data-theme="dark"] .bp .win, :root[data-theme="dark"] .bp.named .win { fill: var(--cm-win); }
:root[data-theme="dark"] .bp .win-r, :root[data-theme="dark"] .bp.named .win-r { fill: var(--cm-win-r); }
:root[data-theme="dark"] .bp .win.lit { fill: var(--cm-lit); }
:root[data-theme="dark"] .bp .win-r.lit { fill: color-mix(in srgb, var(--cm-lit) 82%, #000000); }
:root[data-theme="dark"] .solar { fill: #1A2A47; stroke: #3A4F78; }
:root[data-theme="dark"] .dome-rib { stroke: rgba(255, 255, 255, 0.3); }

/* อาคารที่มีชื่อ: ชี้แล้วยกขึ้น */
.bp.named { cursor: pointer; }
.es-stage.is-done .bp { transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.es-stage.is-done .bp.is-hot { transform: translateY(-7px); }
.bp.is-hot .f-l, .bp.is-hot .f-r, .bp.is-hot .f-t, .bp.is-hot .r-front { stroke: var(--acc); stroke-width: 1.6; }

/* หมุดอาคาร */
.pin { cursor: pointer; }
.pin-head { fill: var(--acc); stroke: #FFFFFF; stroke-width: 1.8; }
.pin-dot { fill: #FFFFFF; }
.pin-ring { fill: none; stroke: var(--acc); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: es-ring 2.4s ease-out infinite; }
.pin-bob { animation: es-bob 3s ease-in-out infinite; }
.pin.is-hot .pin-head { stroke-width: 3; }

/* ไอคอนบริการลอย */
.fi { cursor: pointer; }
.fi-ring { fill: none; stroke: var(--tone); stroke-width: 1.6; transform-box: fill-box; transform-origin: center; animation: es-ring 3s ease-out infinite; animation-delay: var(--d, 0s); }
.fi-beam { stroke: var(--tone); stroke-width: 1.2; stroke-dasharray: 2 4; opacity: 0.6; }
.fi-bob { animation: es-bob 4s ease-in-out infinite; animation-delay: var(--d, 0s); }
.fi-tile { fill: color-mix(in srgb, var(--tone) 20%, #FFFFFF); stroke: var(--tone); stroke-width: 0.8; }
.fi-side-l { fill: color-mix(in srgb, var(--tone) 55%, #FFFFFF); }
.fi-side-r { fill: color-mix(in srgb, var(--tone) 85%, #000000); }
.fi-badge { fill: #FFFFFF; stroke: var(--tone); stroke-width: 2.2; transition: fill 0.2s; }
.fi-glyph { color: var(--tone); stroke-width: 2; transition: color 0.2s; }
.fi.is-hot .fi-badge { fill: var(--tone); }
.fi.is-hot .fi-glyph { color: #FFFFFF; }
.leader { fill: none; stroke: var(--tone); stroke-width: 1.4; opacity: 0.6; transition: opacity 0.2s, stroke-width 0.2s; }
.leader.is-hot { opacity: 1; stroke-width: 2.4; }
.leader-dot { fill: var(--tone); }

/* ---------- ป้ายบริการ ---------- */
.es-callouts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.es-callout a {
  display: flex; align-items: center; gap: 12px; height: 100%; padding: 10px 14px; border-radius: 14px; text-decoration: none;
  background: var(--cm-card); border: 1px solid color-mix(in srgb, var(--tone, #1F8A78) 28%, transparent);
  box-shadow: 0 10px 26px -12px rgba(13, 40, 50, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.es-callout a:hover, .es-callout a:focus-visible, .es-callout.is-hot a { transform: translateY(-3px); border-color: var(--tone, #1F8A78); box-shadow: 0 16px 30px -12px rgba(13, 40, 50, 0.45); }
.es-callout a:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
.es-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--tone, #1F8A78) 14%, transparent); color: var(--tone, #1F8A78); }
.es-ico .ico { width: 24px; height: 24px; }
.es-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.es-txt strong { font-family: var(--font-display); font-weight: 600; color: var(--ink-title); font-size: 0.98rem; }
.es-txt small { color: var(--ink-600); font-size: 0.8rem; }

/* วางบนผัง (จอกว้าง) — ขนาดตัวอักษรย่อขยายตามความกว้างผัง (cqw) */
.es-stage.is-map .es-callouts { position: absolute; inset: 0; display: block; pointer-events: none; }
.es-stage.is-map .es-callout { position: absolute; width: 19.7%; pointer-events: auto; }
.es-stage.is-map .es-callout a { gap: clamp(8px, 0.9cqw, 12px); padding: clamp(6px, 0.75cqw, 10px) clamp(8px, 1cqw, 14px); }
.es-stage.is-map .es-ico { width: clamp(30px, 3.5cqw, 44px); height: clamp(30px, 3.5cqw, 44px); }
.es-stage.is-map .es-ico .ico { width: clamp(17px, 1.9cqw, 24px); height: clamp(17px, 1.9cqw, 24px); }
.es-stage.is-map .es-txt strong { font-size: clamp(11.5px, 1.22cqw, 15.5px); }
.es-stage.is-map .es-txt small { font-size: clamp(10px, 0.98cqw, 12.5px); }

/* ---------- รายชื่ออาคาร ---------- */
.es-legend { margin-top: 14px; }
.es-legend-title { margin: 0 0 6px; font-family: var(--font-display); font-weight: 600; font-size: 0.86rem; color: var(--gold-700); }
.es-legend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.es-legend button {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 0.86rem; color: var(--ink-title); background: var(--cm-card); border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s;
}
.es-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 25%, transparent); }
.es-legend li.is-hot button, .es-legend button:hover { border-color: var(--gold-500); background: color-mix(in srgb, var(--gold-500) 12%, var(--cm-card)); }
.es-stage.is-map .es-legend {
  position: absolute; width: 19.7%; margin: 0; padding: clamp(8px, 1cqw, 14px); border-radius: 14px;
  background: color-mix(in srgb, var(--cm-card) 88%, transparent); border: 1px solid var(--border);
  box-shadow: 0 10px 26px -14px rgba(13, 40, 50, 0.35); backdrop-filter: blur(6px);
}
.es-stage.is-map .es-legend ul { flex-direction: column; gap: 3px; }
.es-stage.is-map .es-legend button { width: 100%; padding: clamp(3px, 0.4cqw, 6px) clamp(6px, 0.7cqw, 10px); font-size: clamp(10.5px, 1.05cqw, 13.5px); border-color: transparent; background: transparent; }
.es-stage.is-map .es-legend li.is-hot button, .es-stage.is-map .es-legend button:hover { border-color: var(--gold-500); background: color-mix(in srgb, var(--gold-500) 12%, transparent); }
.es-stage.is-map .es-legend-title { font-size: clamp(10.5px, 1.05cqw, 13.5px); }

/* ---------- ป้ายชื่ออาคารบนผัง ---------- */
.es-label {
  position: absolute; transform: translate(-50%, -100%); white-space: nowrap; pointer-events: none;
  padding: 3px 10px 3px 8px; border-radius: 999px; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(10px, 1.02cqw, 13px); color: var(--teal-950); background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 16px -6px rgba(13, 40, 50, 0.45); border: 1.5px solid var(--acc);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s;
}
.es-label::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--acc); vertical-align: 1px; }
.es-label.is-hot { transform: translate(-50%, calc(-100% - 7px)) scale(1.08); background: #FFFFFF; }

/* ---------- ภาพเคลื่อนไหวตอนเปิด ---------- */
.es-stage.is-map:not(.is-in) .lyr-plate, .es-stage.is-map:not(.is-in) .lyr-ground, .es-stage.is-map:not(.is-in) .lyr-shade,
.es-stage.is-map:not(.is-in) .lyr-move, .es-stage.is-map:not(.is-in) .lyr-world > *, .es-stage.is-map:not(.is-in) .lyr-pins,
.es-stage.is-map:not(.is-in) .lyr-float, .es-stage.is-map:not(.is-in) .es-callout, .es-stage.is-map:not(.is-in) .es-legend,
.es-stage.is-map:not(.is-in) .es-label { opacity: 0; }
.es-stage.is-in:not(.is-done) .lyr-plate { animation: es-rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.es-stage.is-in:not(.is-done) .lyr-ground, .es-stage.is-in:not(.is-done) .lyr-shade, .es-stage.is-in:not(.is-done) .lyr-move { animation: es-fade 0.7s 0.35s both; }
.es-stage.is-in:not(.is-done) .lyr-world > .bp, .es-stage.is-in:not(.is-done) .lyr-world > .fountain { animation: es-drop-in 0.75s cubic-bezier(0.25, 1.35, 0.4, 1) both; animation-delay: calc(0.5s + var(--n, 0) * 22ms); }
.es-stage.is-in:not(.is-done) .lyr-world > .tree { animation: es-pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both; animation-delay: calc(0.6s + var(--n, 0) * 22ms); }
.es-stage.is-in:not(.is-done) .lyr-pins { animation: es-drop-in 0.7s 2.1s cubic-bezier(0.25, 1.35, 0.4, 1) both; }
.es-stage.is-in:not(.is-done) .lyr-float { animation: es-fade 0.6s 2.3s both; }
.es-stage.is-in:not(.is-done) .leader { stroke-dasharray: 1; animation: es-draw 0.8s both; animation-delay: calc(2.2s + var(--d, 0s)); }
.es-stage.is-in:not(.is-done) .es-callout { animation: es-slide 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(2s + var(--d, 0s)); }
.es-stage.is-in:not(.is-done) .es-legend, .es-stage.is-in:not(.is-done) .es-label { animation: es-fade 0.6s 2.6s both; }
.es-stage.is-done .lyr-world > .tree { animation: es-sway 5s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }

@keyframes es-rise { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes es-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes es-drop-in { from { opacity: 0; transform: translateY(-70px); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes es-pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: none; } }
@keyframes es-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes es-slide { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes es-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes es-ring { from { transform: scale(0.5); opacity: 0.9; } to { transform: scale(1.9); opacity: 0; } }
@keyframes es-ripple { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(1.5); opacity: 0; } }
@keyframes es-drop { 0% { transform: translate(0, 0); opacity: 1; } 50% { transform: translate(calc(var(--x, 0px) * 0.6), -13px); } 100% { transform: translate(var(--x, 0px), 0); opacity: 0; } }
@keyframes es-sway { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
@keyframes es-flag { 0%, 100% { transform: skewY(0deg) scaleX(1); } 50% { transform: skewY(5deg) scaleX(0.92); } }
@keyframes es-glint { 0%, 70%, 100% { opacity: 0; } 80% { opacity: 0.35; } }
@keyframes es-cloud { from { transform: translateX(-320px); } to { transform: translateX(1380px); } }
@keyframes es-twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* ---------- จอแคบ: ผังเต็มความกว้าง ป้ายบริการเรียงใต้ภาพ ---------- */
@media (max-width: 760px) {
  .es-stage.is-map .es-tilt { aspect-ratio: auto; transform: none; display: flex; flex-direction: column; }
  .es-stage.is-map .es-map { position: relative; inset: auto; height: auto; aspect-ratio: var(--ar); order: 0; }
  .es-overlay { inset: auto; left: 0; top: 0; width: 100%; aspect-ratio: var(--ar); }
  .es-stage.is-map .es-legend { position: static; width: auto; order: 1; margin-top: 12px; padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; }
  .es-stage.is-map .es-legend ul { flex-direction: row; }
  .es-stage.is-map .es-legend button { width: auto; padding: 6px 12px; font-size: 0.84rem; border-color: var(--border); background: var(--cm-card); }
  .es-stage.is-map .es-legend-title { font-size: 0.84rem; }
  .es-stage.is-map .es-callouts { position: static; display: grid; grid-template-columns: 1fr; gap: 10px; order: 2; margin-top: 16px; pointer-events: auto; }
  .es-stage.is-map .es-callout { position: static; width: auto; }
  .es-stage.is-map .es-callout a { padding: 10px 14px; gap: 12px; }
  .es-stage.is-map .es-ico { width: 42px; height: 42px; }
  .es-stage.is-map .es-ico .ico { width: 22px; height: 22px; }
  .es-stage.is-map .es-txt strong { font-size: 0.96rem; }
  .es-stage.is-map .es-txt small { font-size: 0.8rem; }
  .leader, .leader-dot { display: none; }
  .es-label { font-size: 10.5px; padding: 2px 8px 2px 6px; }
  .es-label:not(.is-hot) { opacity: 0 !important; }
}
@media (max-width: 760px) and (min-width: 520px) {
  .es-stage.is-map .es-callouts { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .es-stage *, .es-stage *::before { animation: none !important; transition: none !important; }
  .es-tilt { transform: none !important; }
}

/* ---------- ส่วนบนหน้าแรก (public/index.html #e-service) ---------- */
.es-home { padding: clamp(48px, 6vw, 88px) 0 clamp(40px, 5vw, 64px); }
.es-home .section-head { margin-bottom: clamp(4px, 1vw, 12px); }
.es-home-lead { margin: 6px 0 0; color: var(--ink-600); font-size: 0.98rem; }
.es-home-more { margin: 18px 0 0; text-align: center; }

/* ===================================================================
   แถบห้องในอาคาร — กดอาคารบนผัง (public/js/campus.js · drawPanel)
   รายการห้อง → กดห้อง → รูปห้อง (เลื่อนดู / ปัด / ดูเต็มจอ) · สีหัวแถบ = สีประจำอาคาร (--acc)
   =================================================================== */
.es-panel {
  position: absolute; z-index: 5; right: 0.6%; top: 2%; bottom: 2%; width: 34%; min-width: 320px;
  border-radius: 22px; overflow: hidden; isolation: isolate;
  --acc-deep: color-mix(in srgb, var(--acc, #1F8A78) 60%, #06231E); /* พื้นเข้มพอให้ตัวอักษรขาวอ่านชัด (สีทองอ่อนเกินไป) */
  background: var(--cm-card); border: 1px solid color-mix(in srgb, var(--acc, #1F8A78) 25%, var(--border));
  box-shadow: 0 30px 70px -28px rgba(8, 38, 33, 0.6), 0 2px 6px rgba(8, 38, 33, 0.08);
}
.es-panel[hidden] { display: none; }
.es-pview { position: absolute; inset: 0; display: flex; flex-direction: column; }
.es-pview.is-in { animation: es-pv-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
.es-pview.is-fwd { animation: es-pv-fwd 0.38s cubic-bezier(0.2, 0.8, 0.2, 1); }
.es-pview.is-back { animation: es-pv-back 0.38s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes es-pv-in { from { opacity: 0; transform: translateX(30px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes es-pv-fwd { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
@keyframes es-pv-back { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }

/* หัวแถบ: ไล่สีประจำอาคาร + ลายเส้นตาราง */
.es-ph {
  position: relative; flex: none; display: flex; align-items: center; gap: 14px; padding: 20px 56px 18px 20px; color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(135deg, var(--acc-deep), color-mix(in srgb, var(--acc, #1F8A78) 35%, #06231E));
}
.es-ph::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.18;
  background-image: linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000); mask-image: linear-gradient(90deg, transparent 30%, #000);
}
.es-ph-ico { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: rgba(255, 255, 255, 0.18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.es-ph-ico .ico { width: 28px; height: 28px; stroke-width: 1.8; }
.es-ph-txt { min-width: 0; }
.es-ph-txt p { margin: 0; font-size: 0.74rem; letter-spacing: 0.06em; opacity: 0.85; }
.es-ph-txt h3 { margin: 1px 0 4px; color: #fff; font-size: 1.22rem; line-height: 1.25; }
.es-ph-count { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; background: rgba(255, 255, 255, 0.2); }
.es-ph.is-mini { padding: 12px 56px 12px 10px; }
.es-back {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 4px; min-width: 0; padding: 8px 12px 8px 6px; border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 0.88rem; font-weight: 600; color: #fff; background: rgba(255, 255, 255, 0.16);
}
.es-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.es-back .ico { flex: none; width: 20px; height: 20px; }
.es-back:hover { background: rgba(255, 255, 255, 0.26); }
.es-panel-x {
  position: absolute; z-index: 1; top: 50%; right: 12px; transform: translateY(-50%); display: grid; place-items: center;
  width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer; color: #fff; background: rgba(255, 255, 255, 0.16);
}
.es-panel-x .ico { width: 18px; height: 18px; }
.es-panel-x:hover { background: rgba(255, 255, 255, 0.3); }
.es-panel :focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }

.es-pbody { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 18px; scrollbar-width: thin; }

/* ตัวกรองกลุ่มห้อง */
.es-chips {
  position: sticky; top: 0; z-index: 2; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding: 12px 16px 10px; background: linear-gradient(var(--cm-card) 78%, transparent);
}
.es-chips::-webkit-scrollbar { display: none; }
.es-chips button {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 0.82rem; font-weight: 500; color: var(--ink-title); white-space: nowrap;
  background: color-mix(in srgb, var(--acc) 7%, var(--cm-card)); border: 1px solid color-mix(in srgb, var(--acc) 22%, transparent);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.es-chips button b { font-size: 0.72rem; font-weight: 600; padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, var(--acc) 16%, transparent); }
.es-chips button:hover { border-color: var(--acc); }
.es-chips button[aria-pressed="true"] { color: #fff; background: var(--acc-deep); border-color: var(--acc-deep); }
.es-chips button[aria-pressed="true"] b { background: rgba(255, 255, 255, 0.25); }

/* กลุ่มห้อง */
.es-group { margin-top: 10px; animation: es-rise-s 0.4s both; animation-delay: calc(var(--gi, 0) * 60ms); }
.es-group h4 { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; font-size: 0.92rem; font-weight: 600; color: var(--ink-title); }
.es-group h4 .ico { width: 18px; height: 18px; color: var(--acc); }
.es-group h4 b { margin-left: auto; font-size: 0.74rem; font-weight: 600; color: var(--ink-600); }
.es-room-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.es-room {
  position: relative; display: flex; flex-direction: column; min-width: 0; padding: 0; text-align: left; cursor: pointer; overflow: hidden;
  font: inherit; color: inherit; border-radius: 16px; background: var(--cm-card);
  border: 1px solid color-mix(in srgb, var(--acc) 16%, var(--border));
  box-shadow: 0 8px 18px -14px rgba(13, 40, 50, 0.45);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s, border-color 0.25s;
  animation: es-rise-s 0.4s both; animation-delay: calc(var(--gi, 0) * 60ms + var(--ri, 0) * 30ms);
}
.es-room:hover { transform: translateY(-3px); border-color: var(--acc); box-shadow: 0 16px 28px -16px color-mix(in srgb, var(--acc) 70%, #000000); }
.es-thumb { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: color-mix(in srgb, var(--acc) 10%, var(--cm-card)); }
.es-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.es-room:hover .es-thumb img { transform: scale(1.06); }
.es-thumb-ph {
  position: absolute; inset: 0; display: grid; place-items: center; color: color-mix(in srgb, var(--acc) 65%, transparent);
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--acc) 22%, transparent), transparent 60%),
    repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--acc) 6%, transparent) 10px 11px);
}
.es-thumb-ph .ico { width: 34px; height: 34px; stroke-width: 1.4; }
.es-thumb-n {
  position: absolute; right: 7px; bottom: 7px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 600; color: #fff; background: rgba(8, 25, 22, 0.66); backdrop-filter: blur(4px);
}
.es-thumb-n .ico { width: 12px; height: 12px; }
.es-room-txt { display: flex; flex-direction: column; gap: 2px; padding: 9px 30px 10px 11px; line-height: 1.35; }
.es-room-txt strong { font-family: var(--font-display); font-weight: 500; font-size: 0.86rem; color: var(--ink-title); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.es-room-txt small { font-size: 0.74rem; color: var(--ink-600); }
.es-room-go { position: absolute; right: 8px; bottom: 10px; color: var(--acc); opacity: 0.55; transition: transform 0.2s, opacity 0.2s; }
.es-room-go .ico { width: 16px; height: 16px; }
.es-room:hover .es-room-go { opacity: 1; transform: translateX(2px); }
/* ห้องชุดใหญ่: ป้ายเล็ก 3 คอลัมน์ */
.es-room-grid.is-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.es-room-grid.is-compact .es-room { flex-direction: row; align-items: center; border-radius: 12px; box-shadow: none; }
.es-room-grid.is-compact .es-room-txt { padding: 8px 10px; }
.es-room-grid.is-compact .es-room-txt strong { font-size: 0.8rem; -webkit-line-clamp: 1; }
.es-room-cam { margin-left: auto; padding-right: 8px; color: var(--acc); }
.es-room-cam .ico { width: 14px; height: 14px; }

/* ห้องที่เลือก: รูป + รายละเอียด */
.es-gal { margin: 14px 0 0; }
.es-gal-main {
  position: relative; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; cursor: zoom-in; touch-action: pan-y;
  background: color-mix(in srgb, var(--acc) 10%, var(--cm-card)); box-shadow: 0 18px 34px -22px rgba(8, 38, 33, 0.7);
}
.es-gal-main img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.es-gal-main img.is-swap { animation: es-swap 0.35s ease; }
@keyframes es-swap { from { opacity: 0.25; transform: scale(1.03); } to { opacity: 1; transform: none; } }
.es-gal-main::after { content: ''; position: absolute; inset: auto 0 0; height: 40%; pointer-events: none; background: linear-gradient(transparent, rgba(6, 25, 22, 0.42)); }
.es-gal-nav, .es-gal-zoom {
  position: absolute; z-index: 1; display: grid; place-items: center; border: 0; cursor: pointer; color: #fff;
  background: rgba(8, 25, 22, 0.5); backdrop-filter: blur(6px); transition: background 0.2s;
}
.es-gal-nav { top: 50%; width: 38px; height: 38px; margin-top: -19px; border-radius: 50%; }
.es-gal-nav.is-prev { left: 10px; }
.es-gal-nav.is-next { right: 10px; }
.es-gal-nav .ico { width: 22px; height: 22px; }
.es-gal-zoom { top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 10px; }
.es-gal-zoom .ico { width: 18px; height: 18px; }
.es-gal-nav:hover, .es-gal-zoom:hover { background: var(--acc); }
.es-gal-count { position: absolute; z-index: 1; left: 12px; bottom: 10px; padding: 2px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; color: #fff; background: rgba(8, 25, 22, 0.55); }
.es-gal-thumbs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.es-gal-thumbs button { flex: none; width: 62px; aspect-ratio: 4 / 3; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; opacity: 0.65; background: none; transition: opacity 0.2s, border-color 0.2s; }
.es-gal-thumbs button[aria-current="true"], .es-gal-thumbs button:hover { opacity: 1; border-color: var(--acc); }
.es-gal-thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }
.es-gal.is-empty {
  display: grid; place-items: center; align-content: center; gap: 10px; aspect-ratio: 4 / 3; border-radius: 18px; text-align: center; color: var(--ink-600);
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--acc) 18%, transparent), transparent 62%), color-mix(in srgb, var(--acc) 6%, var(--cm-card));
  border: 1px dashed color-mix(in srgb, var(--acc) 35%, transparent);
}
.es-gal.is-empty span { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; color: var(--acc); background: var(--cm-card); box-shadow: 0 10px 22px -14px rgba(8, 38, 33, 0.6); }
.es-gal.is-empty .ico { width: 32px; height: 32px; stroke-width: 1.5; }
.es-gal.is-empty p { margin: 0; font-size: 0.86rem; }
.es-room-info { padding: 14px 2px 4px; animation: es-rise-s 0.4s 0.08s both; }
.es-room-group { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; color: var(--acc); background: color-mix(in srgb, var(--acc) 12%, transparent); }
.es-room-group .ico { width: 14px; height: 14px; }
.es-room-info h3 { margin: 8px 0 6px; font-size: 1.28rem; line-height: 1.3; }
.es-room-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.es-room-meta span { padding: 3px 10px; border-radius: 8px; font-size: 0.8rem; color: var(--ink-title); background: color-mix(in srgb, var(--ink-600) 9%, transparent); }
.es-room-detail { margin: 6px 0 0; font-size: 0.9rem; line-height: 1.65; color: var(--ink-600); }

/* ปุ่มจองท้ายแถบ */
.es-pfoot { flex: none; padding: 12px 16px 16px; border-top: 1px solid color-mix(in srgb, var(--acc) 14%, var(--border)); background: var(--cm-card); }
.es-book {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-radius: 14px; text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: #fff;
  background: linear-gradient(135deg, var(--acc-deep), color-mix(in srgb, var(--acc) 38%, #06231E));
  box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--acc) 80%, #000000); transition: transform 0.2s, box-shadow 0.2s;
}
.es-book .ico { width: 20px; height: 20px; }
.es-book .ico:last-child { width: 16px; height: 16px; transition: transform 0.2s; }
.es-book:hover { transform: translateY(-2px); color: #fff; }
.es-book:hover .ico:last-child { transform: translateX(3px); }

/* ว่าง / กำลังโหลด */
.es-empty { display: grid; place-items: center; gap: 10px; padding: 46px 16px; text-align: center; color: var(--ink-600); }
.es-empty .ico { width: 40px; height: 40px; stroke-width: 1.4; color: var(--acc); }
.es-empty p { margin: 0; font-size: 0.9rem; }
.es-loading { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding-top: 14px; }
.es-loading span {
  aspect-ratio: 4 / 3.6; border-radius: 16px; background-size: 300% 100%; animation: es-shimmer 1.2s linear infinite;
  background-image: linear-gradient(100deg, color-mix(in srgb, var(--acc) 7%, var(--cm-card)) 30%, color-mix(in srgb, var(--acc) 16%, var(--cm-card)) 50%, color-mix(in srgb, var(--acc) 7%, var(--cm-card)) 70%);
}
@keyframes es-shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@keyframes es-rise-s { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ขณะเปิดแถบ: ซ่อนป้ายบริการฝั่งขวาและรายชื่ออาคารที่อยู่ใต้แถบ */
.es-stage.has-panel .es-callout.es-right, .es-stage.has-panel .es-legend { opacity: 0; pointer-events: none; transition: opacity 0.25s; }

@media (max-width: 760px) {
  .es-stage.is-map .es-panel { position: relative; inset: auto; width: auto; min-width: 0; height: min(78vh, 640px); order: 1; margin-top: 12px; }
  .es-stage.is-map .es-legend { order: 2; }
  .es-stage.is-map .es-callouts { order: 3; }
  .es-stage.has-panel .es-callout.es-right, .es-stage.has-panel .es-legend { opacity: 1; pointer-events: auto; }
  .es-room-grid.is-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .es-pview, .es-group, .es-room, .es-room-info, .es-gal-main img.is-swap { animation: none !important; }
}

/* ===================================================================
   ป้ายชื่ออาคารบนผัง (โยงเส้นไปที่หมุดของตึก) + การ์ดบริการออนไลน์ใต้ผัง
   =================================================================== */
.es-bldgs .es-callout button, .es-svc a {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 100%; padding: 10px 14px; text-align: left;
  font: inherit; color: inherit; text-decoration: none; cursor: pointer; overflow: hidden;
  border-radius: 16px; background: var(--cm-card); border: 1px solid color-mix(in srgb, var(--acc, var(--tone, #1F8A78)) 30%, transparent);
  box-shadow: 0 12px 28px -14px rgba(13, 40, 50, 0.4);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s, box-shadow 0.2s;
}
/* แถบสีประจำอาคารด้านข้างป้าย */
.es-bldgs .es-callout button::before {
  content: ''; position: absolute; top: 10px; bottom: 10px; left: 0; width: 4px; border-radius: 0 4px 4px 0; background: var(--acc);
}
.es-bldgs .es-callout button:hover, .es-bldgs .es-callout.is-hot button, .es-svc a:hover {
  transform: translateY(-3px); border-color: var(--acc, var(--tone)); box-shadow: 0 18px 32px -14px color-mix(in srgb, var(--acc, var(--tone)) 55%, rgba(13, 40, 50, 0.6));
}
.es-bldgs .es-callout.is-hot button { background: color-mix(in srgb, var(--acc) 8%, var(--cm-card)); }
.es-bldgs .es-ico, .es-svc .es-ico { color: var(--acc, var(--tone)); background: color-mix(in srgb, var(--acc, var(--tone)) 14%, transparent); }
.es-bldgs .es-callout.is-hot .es-ico { color: #fff; background: color-mix(in srgb, var(--acc) 60%, #06231E); }
.es-bldgs .es-ico, .es-bldgs .es-ico .ico { transition: color 0.2s, background 0.2s; }
.es-cgo { margin-left: auto; flex: none; color: var(--acc); opacity: 0.6; transition: transform 0.2s, opacity 0.2s; }
.es-cgo .ico { width: 18px; height: 18px; }
.es-bldgs .es-callout button:hover .es-cgo, .es-bldgs .es-callout.is-hot .es-cgo { opacity: 1; transform: translateX(3px); }
.es-bldgs .es-callout button:focus-visible, .es-svc a:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
.es-stage.is-map .es-bldgs .es-callout button { gap: clamp(8px, 0.9cqw, 12px); padding: clamp(7px, 0.8cqw, 11px) clamp(10px, 1.1cqw, 14px) clamp(7px, 0.8cqw, 11px) clamp(12px, 1.3cqw, 16px); }
.es-stage.is-map .es-cgo .ico { width: clamp(14px, 1.4cqw, 18px); height: clamp(14px, 1.4cqw, 18px); }

/* เส้นโยงสีประจำอาคาร */
.leader { stroke: var(--acc, var(--tone)); stroke-dasharray: none; stroke-width: 1.8; opacity: 0.85; }
.es-stage.is-in:not(.is-done) .leader { stroke-dasharray: 1; }
.leader-dot { fill: var(--acc, var(--tone)); }
.leader.is-hot { opacity: 1; stroke-width: 2.6; }
/* เปิดแถบห้องอยู่: ป้ายและเส้นฝั่งขวาถูกแถบบัง ซ่อนไว้ */
.es-stage.has-panel .leader.is-r, .es-stage.has-panel .leader-dot.is-r { opacity: 0; transition: opacity 0.25s; }

/* การ์ดบริการออนไลน์ (ใต้ผัง) */
.es-services { margin-top: clamp(20px, 3vw, 34px); }
.es-services-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1.12rem; }
.es-services-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold-500), transparent); opacity: 0.6; }
.es-svc-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.es-svc[data-tone="teal"] { --tone: #1F8A78; }
.es-svc[data-tone="gold"] { --tone: #B8901F; }
.es-svc[data-tone="indigo"] { --tone: #6C5CE7; }
.es-svc[data-tone="rose"] { --tone: #E2557A; }
.es-svc a { padding: 12px 14px; }
@media (max-width: 1100px) { .es-svc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .es-stage.is-map .es-bldgs { grid-template-columns: 1fr 1fr; gap: 8px; }
  .es-stage.is-map .es-bldgs .es-callout button { padding: 10px 10px 10px 14px; gap: 8px; }
  .es-stage.is-map .es-bldgs .es-ico { width: 34px; height: 34px; }
  .es-stage.is-map .es-bldgs .es-ico .ico { width: 18px; height: 18px; }
  .es-stage.is-map .es-bldgs .es-txt strong { font-size: 0.86rem; }
  .es-stage.is-map .es-bldgs .es-txt small { font-size: 0.72rem; }
  .es-stage.is-map .es-bldgs .es-cgo { display: none; }
  .es-stage.has-panel .es-callout.es-right { opacity: 1; pointer-events: auto; }
}
@media (max-width: 520px) { .es-svc-list { grid-template-columns: 1fr; } }

/* หัวแถบห้องที่มีรูปตึกจริง (data-photo บนป้ายชื่ออาคาร) */
.es-ph.has-photo {
  min-height: 172px; align-items: flex-end; padding-top: 56px;
  background:
    linear-gradient(180deg, rgba(6, 30, 26, 0.05) 0%, rgba(6, 30, 26, 0.25) 40%, color-mix(in srgb, var(--acc-deep) 92%, #000000) 100%),
    var(--ph) var(--ph-pos, center 35%) / cover no-repeat;
}
.es-ph.has-photo::after { display: none; }
.es-ph.has-photo .es-ph-ico { background: rgba(6, 30, 26, 0.35); backdrop-filter: blur(6px); }
.es-ph.has-photo .es-ph-txt h3 { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45); }
.es-ph.has-photo .es-panel-x { top: 14px; transform: none; background: rgba(6, 30, 26, 0.4); backdrop-filter: blur(6px); }
.es-ph.has-photo .es-panel-x:hover { background: rgba(6, 30, 26, 0.6); }
.es-bldgs .es-ico.is-photo { background-size: cover; background-position: center 35%; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--acc) 55%, transparent); }
.es-bldgs .es-ico.is-photo .ico { display: none; }
.es-bldgs .es-callout.is-hot .es-ico.is-photo { background-color: transparent; background-size: cover; background-position: center 35%; box-shadow: inset 0 0 0 2px var(--acc); }

/* ===================================================================
   ตึกตามรูปจริง (public/js/campus.js · facade) + ลานธง + หมุนผัง
   =================================================================== */
/* อาคารนวมินทรารักษ์: ผนังขาว หน้าต่างแถบยาวกระจกเข้ม กรอบชมพู กระเบื้องเขียว */
.bp.st-nava { --cm-face-l: #FBFAF6; --cm-face-r: #E3E0D9; --cm-top: #F2F0EA; --cm-roof: #E6E3DB; --glass: #46566A; --glass-r: #3A4757; --frame: #EDBDB6; --frame-r: #D8A39C; }
/* อาคารวิชญเวศม์: เขียวมิ้นต์ ราวระเบียงขาว เสาขาว */
.bp.st-wich { --cm-face-l: #D3EEE1; --cm-face-r: #B6DAC9; --cm-top: #EAF5EF; --cm-roof: #DCEBE3; --glass: #6F9E90; --glass-r: #5D897C; --rail: #FBFDFC; --rail-r: #DFE9E4; --pillar: #F4FAF7; --pillar-r: #DCE8E2; }
:root[data-theme="dark"] .bp.st-nava { --cm-face-l: #3C4651; --cm-face-r: #2C343D; --cm-top: #444F5A; --cm-roof: #36404A; --glass: #1C2530; --glass-r: #161D26; --frame: #8E6A66; --frame-r: #6E504D; }
:root[data-theme="dark"] .bp.st-wich { --cm-face-l: #2E4A40; --cm-face-r: #223A32; --cm-top: #38554A; --cm-roof: #2D463D; --glass: #1A2A26; --glass-r: #15221F; --rail: #6F8D82; --rail-r: #55706A; --pillar: #5E7A70; --pillar-r: #4A635A; }
.bp.st-nava .f-roof, .bp.st-wich .f-roof { fill: var(--cm-roof); }

.glass { fill: var(--glass, #46566A); }
.glass.g-r { fill: var(--glass-r, #3A4757); }
:root[data-theme="dark"] .glass.lit { fill: var(--cm-lit); }
:root[data-theme="dark"] .glass.g-r.lit { fill: color-mix(in srgb, var(--cm-lit) 80%, #000000); }
.mull { fill: none; stroke: rgba(255, 255, 255, 0.35); stroke-width: 0.6; }
.louver { fill: none; stroke: rgba(255, 255, 255, 0.4); stroke-width: 0.6; }
.rail { fill: var(--rail, #FFFFFF); }
.rail.r-r { fill: var(--rail-r, #E5E5E5); }
.pillar { fill: var(--pillar, #FFFFFF); }
.pillar.p-r { fill: var(--pillar-r, #E5E5E5); }
.core { fill: #7E978E; }
.core.core-r { fill: #6B8379; }
:root[data-theme="dark"] .core { fill: #16211D; }
.slab { fill: var(--rail, #FFFFFF); opacity: 0.9; }
.frame { fill: var(--frame, #EDBDB6); }
.frame.fr-r { fill: var(--frame-r, #D8A39C); }
.mosaic { fill: url(#esMosaic); }
.mosaic.m-r { filter: brightness(0.82); }
.mz-a { fill: #2C8A76; }
.mz-b { fill: #3BA58C; }
:root[data-theme="dark"] .mz-a { fill: #1E5A4E; }
:root[data-theme="dark"] .mz-b { fill: #27705F; }
.wall-sign { fill: #6B4A2B; font-family: 'Prompt', sans-serif; font-weight: 600; letter-spacing: 0.2px; }
:root[data-theme="dark"] .wall-sign { fill: #E9D7A5; }
.wall-logo { pointer-events: none; }

/* ลานหญ้าเคารพธงชาติ + เสาธง */
.lawn { fill: color-mix(in srgb, var(--cm-plate) 70%, #5FAE5A); }
.lawn-edge { fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.2; stroke-dasharray: 3 4; }
.flag-base { fill: #EAD9B0; stroke: #D7C08C; stroke-width: 1; }
.flag-base-in { fill: #F6EBCD; }
:root[data-theme="dark"] .flag-base { fill: #5C523B; stroke: #6E6346; }
:root[data-theme="dark"] .flag-base-in { fill: #6E6346; }
.pole { stroke: #BFC6CF; stroke-width: 1.8; stroke-linecap: round; }
.pole-cap { fill: #D8B24C; }
.thai-flag { transform-box: fill-box; transform-origin: left center; animation: es-flag 2.6s ease-in-out infinite; }
.thai-flag rect { shape-rendering: crispEdges; }
.flag-edge { fill: none; stroke: rgba(0, 0, 0, 0.15); stroke-width: 0.4; }

/* หมุนผัง */
.es-stage.is-map .es-map { cursor: grab; touch-action: pan-y; }
.es-stage.is-rotating .es-map { cursor: grabbing; }
.es-stage.is-rotating .lyr-world *, .es-stage.is-rotating .lyr-pins *, .es-stage.is-rotating .lyr-ground * { animation: none !important; transition: none !important; }
.es-rot {
  position: absolute; z-index: 3; left: 50%; bottom: 1.5%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px;
  background: color-mix(in srgb, var(--cm-card) 88%, transparent); border: 1px solid var(--border);
  box-shadow: 0 10px 26px -14px rgba(13, 40, 50, 0.45); backdrop-filter: blur(6px); white-space: nowrap;
}
.es-rot button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 34px; height: 34px; padding: 0 8px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 0.82rem; color: var(--ink-title); background: transparent; transition: background 0.2s, color 0.2s;
}
.es-rot button:hover { background: color-mix(in srgb, var(--teal-500) 12%, transparent); }
.es-rot button:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 1px; }
.es-rot .ico { width: 18px; height: 18px; }
.es-rot-hint { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; font-size: 0.8rem; color: var(--ink-600); }
.es-rot-hint .ico { width: 16px; height: 16px; }
.es-rot-reset { display: none !important; }
.es-rot.is-turned .es-rot-reset { display: inline-flex !important; color: var(--teal-700) !important; background: color-mix(in srgb, var(--teal-500) 10%, transparent) !important; }
.es-rot.is-turned .es-rot-hint { display: none; }
.es-stage.has-panel .es-rot { left: 33%; }
.es-stage.is-map:not(.is-in) .es-rot { opacity: 0; }
.es-stage.is-in:not(.is-done) .es-rot { animation: es-fade 0.6s 2.6s both; }
@media (max-width: 760px) {
  .es-rot { position: relative; left: auto; bottom: auto; transform: none; order: 0; align-self: center; margin-top: 8px; }
  .es-stage.has-panel .es-rot { left: auto; }
}

/* ตราสัญลักษณ์สีทองบนแผงเขียว ด้านหน้าอาคารนวมินทรารักษ์ */
.wall-emblem { pointer-events: none; }
.em-gold { fill: #E2B640; stroke: #9C7420; stroke-width: 0.5; }
.em-in { fill: #C4932C; }
:root[data-theme="dark"] .em-gold { fill: #B8912F; stroke: #7A5A18; }
:root[data-theme="dark"] .em-in { fill: #93701F; }

/* บ้านดิน: ผนังดินฉาบสีส้ม หลังคาลอนเขียวทะเล ชายคาไม้สีเข้ม */
.bp.st-baandin { --bd-wall-l: #E7AE73; --bd-wall-r: #B57B47; --bd-roof-l: #45BCAE; --bd-roof-r: #2A8A80; --bd-wood: #4A3A2E; }
:root[data-theme="dark"] .bp.st-baandin { --bd-wall-l: #8E6844; --bd-wall-r: #5C432C; --bd-roof-l: #2B7C72; --bd-roof-r: #1C5852; --bd-wood: #2A211B; }
.bd-eave, .bd-gable { fill: var(--bd-wood); }
.bd-corr { fill: none; stroke: rgba(0, 50, 45, 0.28); stroke-width: 0.5; }
.bd-barge { fill: none; stroke: var(--bd-roof-l); stroke-width: 1.2; stroke-linejoin: round; stroke-linecap: round; }
.bd-medal { fill: #A9CDEA; stroke: #FFFFFF; stroke-width: 0.9; }
.bd-medal-in { fill: #3C64A8; }
.bd-logo { fill: #FFFFFF; stroke: #3A8A5A; stroke-width: 0.6; }
.bd-sign { fill: #2F5BB7; font-family: 'Prompt', sans-serif; font-weight: 700; }
.bd-pot-s { fill: #8E4A30; }
.bd-pot { fill: #C26A47; stroke: #8E4A30; stroke-width: 0.5; }
.bd-plant { fill: #4E9A4A; }
:root[data-theme="dark"] .bd-medal { fill: #5D7F9C; stroke: #B9C6D2; }
:root[data-theme="dark"] .bd-sign { fill: #8FB0F0; }
:root[data-theme="dark"] .bd-plant { fill: #2F6B30; }
.bp.is-hot .bd-wall, .bp.is-hot .bd-roof { stroke: var(--acc); stroke-width: 1.2; }
/* โรงเรือนตาข่ายเขียว */
.net-l, .net-r, .net-t { fill: rgba(44, 178, 140, 0.55); stroke: rgba(20, 110, 85, 0.75); stroke-width: 0.6; }
.net-r { fill: rgba(30, 140, 110, 0.62); }
.net-t { fill: rgba(70, 196, 160, 0.5); }

/* ===================================================================
   ทางเดินมีหลังคา (cover way) · รั้ววิทยาลัย (public/js/campus.js — drawCover / drawFence)
   =================================================================== */
.cw { --cw-l: #F0A066; --cw-r: #C9703F; }
:root[data-theme="dark"] .cw { --cw-l: #9A5C39; --cw-r: #6E3F27; }
.cw-roof { fill: var(--c); stroke: var(--c); stroke-width: 0.5; stroke-linejoin: round; }
.cw-end { fill: color-mix(in srgb, var(--cw-r) 78%, #3A1F10); }
.cw-ridge { fill: none; stroke: color-mix(in srgb, var(--cw-l) 62%, #FFFFFF); stroke-width: 1; stroke-linecap: round; }
.cw-post { fill: none; stroke: #F4EEE2; stroke-width: 1.1; stroke-linecap: round; }
:root[data-theme="dark"] .cw-post { stroke: #8D8778; }
:root[data-theme="dark"] .cw-ridge { stroke: color-mix(in srgb, var(--cw-l) 80%, #FFFFFF); }

.fp-l { fill: #F7EFDD; } .fp-r { fill: #DCCFB3; } .fp-t { fill: #FFFAEE; }
.fn-base.fn-l { fill: #4E9A8C; } .fn-base.fn-r { fill: #3A7C70; }
.fn-panel { fill: rgba(31, 138, 120, 0.16); }
.fn-bars { fill: none; stroke: rgba(255, 255, 255, 0.95); stroke-width: 0.7; }
.fn-rail { fill: none; stroke: #D8B24C; stroke-width: 1.4; stroke-linecap: round; }
.fn-lamp { fill: #FFF1C4; stroke: #D8B24C; stroke-width: 0.6; }
.fn-glow { fill: #FFD86B; opacity: 0; pointer-events: none; }
:root[data-theme="dark"] .fp-l { fill: #6E6959; } :root[data-theme="dark"] .fp-r { fill: #4F4B40; } :root[data-theme="dark"] .fp-t { fill: #7D7868; }
:root[data-theme="dark"] .fn-base.fn-l { fill: #24574E; } :root[data-theme="dark"] .fn-base.fn-r { fill: #1A423B; }
:root[data-theme="dark"] .fn-panel { fill: rgba(159, 217, 203, 0.08); }
:root[data-theme="dark"] .fn-bars { stroke: rgba(255, 255, 255, 0.4); }
:root[data-theme="dark"] .fn-lamp { fill: #FFE9A8; stroke: #FFD86B; }
:root[data-theme="dark"] .fn-glow { opacity: 0.3; }
.es-stage.is-in:not(.is-done) .lyr-world > .cw, .es-stage.is-in:not(.is-done) .lyr-world > .fence { animation: es-drop-in 0.75s cubic-bezier(0.25, 1.35, 0.4, 1) both; animation-delay: calc(0.5s + var(--n, 0) * 22ms); }

/* ===================================================================
   หอพักนักศึกษา · บ้านพักอาจารย์ · หลังคาปั้นหยา · ลานกีฬา · อัฒจันทร์ (campus.js — hipRoof / drawHouse)
   =================================================================== */
/* หอพัก: ผนังครีมอุ่น ระเบียงราวขาว หลังคาเทาอ่อน (ปีกท้ายตึกหลังคาฟ้าอ่อน = --hr2) */
.bp.st-dorm { --cm-face-l: #FFF4E6; --cm-face-r: #EBD5BE; --glass: #8C7B8E; --glass-r: #766679; --rail: #FFFFFF; --rail-r: #EADFD6; --pillar: #FFFFFF; --pillar-r: #E9DDD2;
  --hr-l: #EEF2F6; --hr-r: #C4CEDA; --hr2-l: #C4E3F4; --hr2-r: #93C2DC; }
/* บ้านพักอาจารย์: ผนังครีม หลังคาน้ำเงิน */
.bp.st-house { --cm-face-l: #FFF7E8; --cm-face-r: #EADBC0; --hr-l: #70A6EB; --hr-r: #3F74C2; }
:root[data-theme="dark"] .bp.st-dorm { --cm-face-l: #4C3C42; --cm-face-r: #392C32; --glass: #201A23; --glass-r: #19141B; --rail: #8E7F86; --rail-r: #6F6168; --pillar: #7B6C73; --pillar-r: #5E5057;
  --hr-l: #56616D; --hr-r: #3E4853; --hr2-l: #3F6A82; --hr2-r: #2E5167; }
:root[data-theme="dark"] .bp.st-house { --cm-face-l: #4B4739; --cm-face-r: #38352B; --hr-l: #36619D; --hr-r: #24467A; }
.hr { fill: var(--c); stroke: var(--c); stroke-width: 0.5; stroke-linejoin: round; }
.hr-eave { fill: color-mix(in srgb, var(--hr-r) 62%, #27303B); }
.hr-seam { fill: none; stroke: rgba(20, 40, 60, 0.13); stroke-width: 0.5; }
.hr-ridge { fill: none; stroke: color-mix(in srgb, var(--hr-l) 55%, #FFFFFF); stroke-width: 1.1; stroke-linecap: round; }
.bp.is-hot .hr { stroke: var(--acc); stroke-width: 1.2; }
.court { fill: #E9D5A9; }
.court-line { fill: none; stroke: rgba(255, 255, 255, 0.9); stroke-width: 1; }
.stand-l { fill: #F2CE4A; } .stand-r { fill: #D7B02C; } .stand-t { fill: #FBE48C; }
:root[data-theme="dark"] .court { fill: #5A5038; }
:root[data-theme="dark"] .court-line { stroke: rgba(255, 255, 255, 0.4); }
:root[data-theme="dark"] .stand-l { fill: #8E7A2A; } :root[data-theme="dark"] .stand-r { fill: #6E5E1E; } :root[data-theme="dark"] .stand-t { fill: #A28C36; }
.es-stage.is-in:not(.is-done) .lyr-world > .prop { animation: es-drop-in 0.75s cubic-bezier(0.25, 1.35, 0.4, 1) both; animation-delay: calc(0.5s + var(--n, 0) * 22ms); }
