﻿/* UP 3D Campus Map — all selectors are namespaced with .up3d- / #up3d- */

.up3d-root {
    --up3d-purple: #632d8b;
    --up3d-purple-2: #8e5bb5;
    --up3d-purple-3: #efe7f6;
    --up3d-gold: #f4c542;
    --up3d-ink: #241b2f;
    --up3d-muted: #6b6478;
    --up3d-line: rgba(99, 45, 139, .14);
    --up3d-glass: rgba(255, 255, 255, .9);
    --up3d-shadow: 0 10px 30px rgba(52, 22, 77, .16), 0 2px 6px rgba(52, 22, 77, .08);
    --up3d-radius: 16px;
    --up3d-top-h: 62px;
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #e8eef5;
    color: var(--up3d-ink);
    font-family: 'Sarabun', 'Athiti', 'Leelawadee UI', 'Tahoma', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
.up3d-root *, .up3d-root *::before, .up3d-root *::after { box-sizing: border-box; }
.up3d-root button { font: inherit; color: inherit; }
.up3d-hidden { display: none !important; }

/* ---------- top bar ---------- */
.up3d-top {
    position: relative;
    z-index: 30;
    height: var(--up3d-top-h);
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    background: linear-gradient(100deg, #4a1d6c 0%, var(--up3d-purple) 45%, #7d43a8 100%);
    color: #fff;
    box-shadow: 0 2px 14px rgba(40, 10, 60, .35);
}
.up3d-brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
.up3d-logo {
    width: 44px; height: 44px; flex: 0 0 auto;
    border-radius: 12px; background: #fff; padding: 3px;
    object-fit: contain; box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.up3d-title { min-width: 0; }
.up3d-title h1 {
    margin: 0; font-family: 'Athiti', 'Sarabun', sans-serif; font-weight: 700;
    font-size: 20px; line-height: 1.15; letter-spacing: .2px; white-space: nowrap;
}
.up3d-title h1 span { color: var(--up3d-gold); }
.up3d-title p { margin: 0; font-size: 12.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up3d-top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.up3d-tbtn {
    display: inline-flex; align-items: center; gap: 7px;
    height: 38px; padding: 0 13px; border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .1);
    color: #fff; cursor: pointer; white-space: nowrap; text-decoration: none; font-size: 14px;
    transition: background .2s, border-color .2s;
}
.up3d-tbtn:hover, .up3d-tbtn:focus-visible { background: rgba(255, 255, 255, .22); color: #fff; text-decoration: none; }
.up3d-tbtn.up3d-on { background: var(--up3d-gold); border-color: var(--up3d-gold); color: #3a2400; }
.up3d-tbtn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.up3d-tbtn-panel { display: none; }

/* ---------- main stage ---------- */
.up3d-main { position: relative; flex: 1 1 auto; min-height: 0; }
#up3d-stage { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.up3d-canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; outline: none; }
#up3d-markers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* numbered pins */
.up3d-pin {
    position: absolute; left: 0; top: 0; width: 0; height: 0; padding: 0; margin: 0;
    border: 0; background: none; pointer-events: auto; cursor: pointer; will-change: transform;
}
.up3d-pin-num {
    position: absolute; left: -15px; bottom: 8px; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: #fff; border: 3px solid var(--up3d-gold);
    font-family: 'Athiti', sans-serif; font-weight: 700; font-size: 14px; color: #1d1424;
    box-shadow: 0 3px 8px rgba(30, 10, 50, .35);
    transition: transform .18s ease, background .18s, border-color .18s;
}
.up3d-pin-num::after {
    content: ''; position: absolute; left: 50%; bottom: -11px; margin-left: -6px;
    border: 6px solid transparent; border-top: 8px solid var(--up3d-gold);
}
.up3d-pin-label {
    position: absolute; left: 20px; bottom: 12px; max-width: 260px;
    padding: 4px 10px; border-radius: 8px; background: rgba(36, 18, 52, .92); color: #fff;
    font-size: 13px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; pointer-events: none;
}
.up3d-pin:hover .up3d-pin-num, .up3d-pin:focus-visible .up3d-pin-num, .up3d-pin-hover .up3d-pin-num { transform: scale(1.15); }
.up3d-pin:hover .up3d-pin-label, .up3d-pin:focus-visible .up3d-pin-label, .up3d-pin-hover .up3d-pin-label,
.up3d-pin-active .up3d-pin-label { opacity: 1; transform: none; }
.up3d-pin-active { z-index: 5000 !important; }
.up3d-pin-active .up3d-pin-num {
    background: var(--up3d-purple); color: #fff; transform: scale(1.25);
    animation: up3d-pulse 1.8s ease-out infinite;
}
@keyframes up3d-pulse {
    0% { box-shadow: 0 0 0 0 rgba(244, 197, 66, .75), 0 3px 8px rgba(30, 10, 50, .35); }
    70% { box-shadow: 0 0 0 14px rgba(244, 197, 66, 0), 0 3px 8px rgba(30, 10, 50, .35); }
    100% { box-shadow: 0 0 0 0 rgba(244, 197, 66, 0), 0 3px 8px rgba(30, 10, 50, .35); }
}
.up3d-far .up3d-pin-num { width: 24px; height: 24px; left: -12px; font-size: 12px; border-width: 2px; }

/* POI icons */
.up3d-poi {
    position: absolute; left: 0; top: 0; width: 0; height: 0; padding: 0; border: 0; background: none;
    pointer-events: auto; cursor: pointer; will-change: transform;
}
.up3d-poi svg {
    position: absolute; left: -12px; top: -12px; width: 24px; height: 24px; padding: 4px;
    border-radius: 50%; background: #fff; color: #c2415a; box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    transition: transform .15s;
}
.up3d-poi-food svg { color: #e0622a; }
.up3d-poi-cafe svg { color: #fff; background: #7a4a2a; }
/* minor POI (cafe): small dot, shrinks further when zoomed out; name on hover */
.up3d-poi-cafe svg { left: -7px; top: -7px; width: 14px; height: 14px; padding: 2px; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.up3d-poi-cafe .up3d-poi-label { left: 10px; top: -10px; }
.up3d-far .up3d-poi-cafe:not(.up3d-poi-active) svg { transform: scale(.6); }
.up3d-poi-parking svg { color: #fff; background: #c2415a; }
.up3d-poi-gate svg { color: #fff; background: var(--up3d-purple); }
.up3d-poi-sport svg { color: #fff; background: #4f9a3c; }
.up3d-poi-water svg { color: #fff; background: #3a9cc0; }
.up3d-poi-label {
    position: absolute; left: 16px; top: -12px; padding: 2px 8px; border-radius: 7px;
    background: rgba(36, 18, 52, .9); color: #fff; font-size: 12px; white-space: nowrap;
    opacity: 0; transition: opacity .15s; pointer-events: none;
}
.up3d-poi-gate .up3d-poi-label { opacity: 1; background: rgba(99, 45, 139, .92); }
.up3d-poi:hover svg, .up3d-poi-active svg { transform: scale(1.25); }
.up3d-poi:hover .up3d-poi-label, .up3d-poi-active .up3d-poi-label { opacity: 1; }
.up3d-far .up3d-poi:not(.up3d-poi-gate):not(.up3d-poi-active) svg { transform: scale(.75); }
.up3d-far .up3d-poi-gate .up3d-poi-label { opacity: 0; }
.up3d-far .up3d-poi-gate:hover .up3d-poi-label { opacity: 1; }

/* ---------- glass cards ---------- */
.up3d-card {
    background: var(--up3d-glass);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    backdrop-filter: blur(14px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: var(--up3d-radius);
    box-shadow: var(--up3d-shadow);
}

/* left panel */
.up3d-panel {
    position: absolute; z-index: 20; top: 12px; left: 12px; bottom: 12px; width: 340px;
    display: flex; flex-direction: column; overflow: hidden;
    transform: translateX(calc(-100% - 24px)); transition: transform .26s ease;
}
.up3d-panel-open .up3d-panel { transform: none; }
.up3d-panel-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--up3d-line); }
.up3d-search { position: relative; }
.up3d-search svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--up3d-muted); pointer-events: none; }
.up3d-search input {
    width: 100%; height: 42px; padding: 0 38px 0 38px; border-radius: 12px;
    border: 1px solid var(--up3d-line); background: #fff; color: var(--up3d-ink);
    font: inherit; font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.up3d-search input:focus { border-color: var(--up3d-purple-2); box-shadow: 0 0 0 3px rgba(142, 91, 181, .2); }
.up3d-search-clear {
    position: absolute; right: 6px; top: 50%; margin-top: -15px; width: 30px; height: 30px;
    border: 0; border-radius: 8px; background: none; color: var(--up3d-muted); cursor: pointer; font-size: 18px; line-height: 1;
}
.up3d-search-clear:hover { background: var(--up3d-purple-3); }
.up3d-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.up3d-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
    border-radius: 999px; border: 1px solid var(--up3d-line); background: #fff; cursor: pointer;
    font-size: 13px; color: var(--up3d-ink); transition: background .15s, border-color .15s, color .15s;
}
.up3d-chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.up3d-chip small { color: var(--up3d-muted); font-size: 11.5px; }
.up3d-chip:hover { border-color: var(--up3d-purple-2); }
.up3d-chip-on { background: var(--up3d-purple); border-color: var(--up3d-purple); color: #fff; }
.up3d-chip-on small { color: rgba(255, 255, 255, .8); }
.up3d-list-meta { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px 4px; font-size: 12.5px; color: var(--up3d-muted); }
.up3d-list { list-style: none; margin: 0; padding: 4px 8px 12px; overflow-y: auto; flex: 1 1 auto; overscroll-behavior: contain; }
.up3d-list li { margin: 0; }
.up3d-list-head { padding: 12px 8px 6px; font-size: 12.5px; font-weight: 700; color: var(--up3d-purple); letter-spacing: .3px; }
.up3d-item {
    width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 8px; margin: 1px 0;
    border: 1px solid transparent; border-radius: 12px; background: none; cursor: pointer; text-align: left;
    transition: background .15s, border-color .15s;
}
.up3d-item:hover, .up3d-item:focus-visible { background: var(--up3d-purple-3); outline: none; }
.up3d-active .up3d-item { background: #fff8e1; border-color: var(--up3d-gold); }
.up3d-item-num {
    flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
    color: #fff; font-family: 'Athiti', sans-serif; font-weight: 700; font-size: 14px;
}
.up3d-item-icon { background: #f1edf5; color: #c2415a; }
.up3d-item-icon svg { width: 18px; height: 18px; }
.up3d-item-text { min-width: 0; display: flex; flex-direction: column; }
.up3d-item-text b { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.up3d-item-text small { color: var(--up3d-muted); font-size: 12px; line-height: 1.3; margin-top: 1px; }
.up3d-item-text em { font-style: normal; font-size: 11.5px; color: var(--up3d-purple-2); margin-top: 2px; }
.up3d-empty { padding: 24px 16px; text-align: center; color: var(--up3d-muted); font-size: 14px; }

/* right details */
.up3d-details {
    position: absolute; z-index: 20; top: 12px; right: 12px; width: 370px; max-height: calc(100% - 110px);
    display: flex; flex-direction: column; overflow: hidden;
    transform: translateX(calc(100% + 24px)); opacity: 0; transition: transform .28s ease, opacity .28s;
}
.up3d-details.up3d-open { transform: none; opacity: 1; }
.up3d-details-close {
    position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; z-index: 2;
    border: 0; border-radius: 10px; background: rgba(99, 45, 139, .08); cursor: pointer; font-size: 20px; line-height: 1; color: var(--up3d-purple);
}
.up3d-details-close:hover { background: rgba(99, 45, 139, .16); }
.up3d-details-body { padding: 18px 18px 16px; overflow-y: auto; }
.up3d-d-head { display: flex; gap: 12px; align-items: flex-start; padding-right: 34px; }
.up3d-d-num {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
    color: #fff; font-family: 'Athiti', sans-serif; font-weight: 700; font-size: 22px; box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}
.up3d-d-num svg { width: 24px; height: 24px; }
.up3d-d-cat { font-size: 12.5px; font-weight: 700; letter-spacing: .3px; }
.up3d-d-head h2 { margin: 2px 0 0; font-family: 'Athiti', 'Sarabun', sans-serif; font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--up3d-ink); }
.up3d-d-en { margin: 4px 0 0; font-size: 13px; color: var(--up3d-muted); line-height: 1.35; }
.up3d-d-desc { margin: 14px 0 0; font-size: 14.5px; line-height: 1.65; }
.up3d-d-meta { margin: 14px 0 0; padding: 12px; border-radius: 12px; background: #f7f3fa; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; }
.up3d-d-meta dt { color: var(--up3d-muted); margin: 0; }
.up3d-d-meta dd { margin: 0; word-break: break-word; }
.up3d-d-meta a { color: var(--up3d-purple); }
.up3d-d-note { margin: 12px 0 0; font-size: 12px; color: var(--up3d-muted); line-height: 1.5; }
.up3d-d-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.up3d-btn {
    display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px;
    border-radius: 11px; border: 1px solid var(--up3d-line); background: #fff; cursor: pointer; font-size: 14px; font-weight: 600;
    transition: background .15s, transform .1s;
}
.up3d-btn:hover { background: var(--up3d-purple-3); }
.up3d-btn:active { transform: scale(.97); }
.up3d-btn-primary { background: var(--up3d-purple); border-color: var(--up3d-purple); color: #fff !important; }
.up3d-btn-primary:hover { background: #4f1f72; }

/* bottom dock */
.up3d-dock {
    position: absolute; z-index: 25; left: 50%; bottom: 16px; transform: translateX(-50%);
    display: flex; align-items: center; gap: 4px; padding: 6px;
}
.up3d-dbtn {
    width: 42px; height: 42px; border: 0; border-radius: 12px; background: transparent; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; color: var(--up3d-purple);
    transition: background .15s, transform .1s;
}
.up3d-dbtn:hover, .up3d-dbtn:focus-visible { background: var(--up3d-purple-3); outline: none; }
.up3d-dbtn:active { transform: scale(.92); }
.up3d-dbtn svg { width: 21px; height: 21px; }
.up3d-dbtn.up3d-on { background: var(--up3d-purple); color: #fff; }
.up3d-dsep { width: 1px; height: 26px; background: var(--up3d-line); margin: 0 4px; }
.up3d-compass {
    position: relative; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
    background: radial-gradient(circle at 50% 40%, #fff 0%, #f1ebf6 100%); box-shadow: inset 0 0 0 2px rgba(99, 45, 139, .2);
    margin-left: 2px;
}
.up3d-compass-needle { position: absolute; inset: 4px; transition: transform .08s linear; }
.up3d-compass-needle svg { width: 100%; height: 100%; display: block; }

.up3d-hint {
    position: absolute; z-index: 15; right: 14px; bottom: 18px; padding: 6px 12px; border-radius: 10px;
    background: rgba(36, 18, 52, .72); color: #fff; font-size: 12px; pointer-events: none; max-width: 340px;
}
.up3d-has-details .up3d-hint { display: none; }

/* data attribution (OpenStreetMap ODbL requires visible credit) */
.up3d-attrib {
    position: absolute; z-index: 16; left: 50%; bottom: 0; transform: translateX(-50%);
    padding: 1px 8px; border-radius: 6px 6px 0 0; background: rgba(255, 255, 255, .78);
    font-size: 10.5px; color: #4b4458; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.up3d-attrib a { color: var(--up3d-purple); }

/* 2D plan lightbox */
.up3d-plan {
    position: absolute; inset: 0; z-index: 75; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(20, 8, 30, .62);
}
.up3d-plan-box {
    width: min(1200px, 100%); max-height: 100%; display: flex; flex-direction: column;
    background: #fff; border-radius: var(--up3d-radius); box-shadow: var(--up3d-shadow); overflow: hidden;
}
.up3d-plan-head {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px;
    border-bottom: 1px solid var(--up3d-line);
}
.up3d-plan-head strong { flex: 1 1 auto; font-family: 'Athiti', 'Sarabun', sans-serif; font-size: 18px; color: var(--up3d-purple); }
.up3d-plan-head .up3d-btn { height: 36px; font-size: 13px; text-decoration: none; color: var(--up3d-purple); }
.up3d-plan-close {
    width: 36px; height: 36px; border: 0; border-radius: 10px; background: rgba(99, 45, 139, .08);
    color: var(--up3d-purple); font-size: 22px; line-height: 1; cursor: pointer;
}
.up3d-plan-close:hover { background: rgba(99, 45, 139, .16); }
.up3d-plan-body { overflow: auto; background: #f1f9ea; -webkit-overflow-scrolling: touch; }
.up3d-plan-body img { display: block; width: 100%; height: auto; }
@media (max-width: 820px) {
    .up3d-plan { padding: 0; }
    .up3d-plan-box { height: 100%; border-radius: 0; }
    .up3d-plan-body { flex: 1 1 auto; }
    .up3d-plan-body img { width: 220%; max-width: none; }   /* phones: pan around a readable-size map */
    .up3d-plan-head strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
}

/* loading + fallback + toast */
.up3d-loading {
    position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
    background: radial-gradient(circle at 50% 40%, #7d43a8 0%, #4a1d6c 70%); color: #fff; transition: opacity .35s;
}
.up3d-loading img { width: 84px; height: 84px; border-radius: 22px; background: #fff; padding: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.up3d-loading h2 { margin: 0; font-family: 'Athiti', sans-serif; font-size: 22px; font-weight: 700; color: #fff; }
.up3d-loading-track { width: 220px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .2); overflow: hidden; }
#up3d-loading-bar { height: 100%; width: 5%; background: var(--up3d-gold); border-radius: 6px; transition: width .3s ease; }
#up3d-loading-text { font-size: 14px; opacity: .9; }
.up3d-fallback {
    position: absolute; inset: 0; z-index: 55; overflow: auto; padding: 20px; background: #f5f1f8; text-align: center;
}
.up3d-fallback p { margin: 0 0 14px; font-size: 15px; }
.up3d-fallback img { max-width: 100%; height: auto; border-radius: 12px; box-shadow: var(--up3d-shadow); }
.up3d-toast {
    position: absolute; z-index: 70; left: 50%; top: 14px; transform: translate(-50%, -20px); opacity: 0;
    padding: 10px 18px; border-radius: 999px; background: var(--up3d-purple); color: #fff; font-size: 14px;
    box-shadow: var(--up3d-shadow); transition: opacity .25s, transform .25s; pointer-events: none;
}
.up3d-toast.up3d-show { opacity: 1; transform: translate(-50%, 0); }
.up3d-noscript { position: absolute; inset: 0; z-index: 80; padding: 24px; background: #fff; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .up3d-panel { width: 300px; }
    .up3d-details { width: 330px; }
    .up3d-hint { display: none; }
}

@media (max-width: 820px) {
    .up3d-root { --up3d-top-h: 56px; }
    .up3d-top { gap: 8px; padding: 0 10px; }
    .up3d-logo { width: 38px; height: 38px; border-radius: 10px; }
    .up3d-title h1 { font-size: 17px; }
    .up3d-title p { display: none; }
    .up3d-tbtn { height: 36px; padding: 0 10px; }
    .up3d-tbtn-text { display: none; }
    .up3d-tbtn-panel { display: inline-flex; }
    .up3d-top-actions { gap: 6px; flex: 0 0 auto; }
    .up3d-brand { flex: 1 1 auto; overflow: hidden; }
    .up3d-title h1 { overflow: hidden; text-overflow: ellipsis; }
    .up3d-tbtn-back { display: none; }

    .up3d-panel { top: 0; left: 0; bottom: 0; width: min(88vw, 360px); border-radius: 0 var(--up3d-radius) var(--up3d-radius) 0; z-index: 40; }
    .up3d-panel-open .up3d-main::before {
        content: ''; position: absolute; inset: 0; z-index: 35; background: rgba(20, 8, 30, .35);
    }

    .up3d-details {
        top: auto; right: 0; left: 0; bottom: 0; width: auto; max-height: 56%;
        border-radius: var(--up3d-radius) var(--up3d-radius) 0 0;
        transform: translateY(105%);
    }
    .up3d-details.up3d-open { transform: none; }
    .up3d-details-body { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
    .up3d-details::before {
        content: ''; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: rgba(99, 45, 139, .25);
    }

    .up3d-dock {
        left: auto; right: 10px; top: 10px; bottom: auto; transform: none;
        flex-direction: column; gap: 2px; padding: 5px;
    }
    .up3d-dsep { width: 26px; height: 1px; margin: 3px 0; }
    .up3d-dbtn { width: 40px; height: 40px; }
    .up3d-compass { order: -1; width: 40px; height: 40px; margin: 0 0 4px; }
    .up3d-has-details .up3d-dock .up3d-dbtn-rot { display: none; }
    .up3d-pin-label { max-width: 190px; font-size: 12px; }
}

@media (max-width: 420px) {
    .up3d-top { gap: 6px; padding: 0 8px; }
    .up3d-title h1 { font-size: 15px; }
    .up3d-logo { width: 34px; height: 34px; }
    .up3d-tbtn { padding: 0 7px; }
    .up3d-top-actions { gap: 4px; }
}
@media (max-width: 400px) {
    .up3d-title { display: none; }   /* six header buttons + logo: keep the logo, drop the title */
}

@media (prefers-reduced-motion: reduce) {
    .up3d-root *, .up3d-root *::before, .up3d-root *::after { animation: none !important; transition: none !important; }
}
