:root{--blue:#426a82;--sky:#d9edf6;--cream:#fff9eb;--yellow:#f5d995;--ink:#3f5664;--muted:#758b97;--line:#e5e9e5;--shadow:0 12px 32px #5d8ca015}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:radial-gradient(ellipse at 5% 0,#e3f4fb,transparent 42%),radial-gradient(ellipse at 95% 60%,#fff0c9,transparent 38%),#f9fcfb;color:var(--ink);font:15px/1.75 'Be Vietnam Pro',Arial,sans-serif}h1,h2,h3{line-height:1.35;color:#345d76}h1{font-size:clamp(1.9rem,4vw,3rem)}h2{font-size:1.3rem}p{overflow-wrap:anywhere}a{color:inherit;text-decoration:none}a:hover{color:#ba8b31}.top{background:#fffdf8e8;border-bottom:1px solid var(--line);padding:13px max(16px,calc((100vw - 1240px)/2));display:flex;align-items:center;justify-content:space-between;gap:18px;position:relative}.brand{font-size:1.35rem;font-weight:800;color:var(--blue);white-space:nowrap}.nav{display:flex;align-items:center;gap:13px;flex-wrap:wrap}.nav a,.link{font-size:.78rem;font-weight:700;color:#607d8d}.nav form{display:inline}.link{border:0;background:none;cursor:pointer;padding:0}.menu{display:none}.container{width:min(1140px,calc(100% - 28px));margin:35px auto 65px;min-height:72vh}.panel{background:#fffffff2;border:1px solid #e9ece6;border-radius:18px;padding:23px;box-shadow:var(--shadow)}.panel.card{margin-bottom:15px}.grid{display:grid;gap:18px}.two{grid-template-columns:repeat(2,minmax(0,1fr))}.three{grid-template-columns:repeat(3,minmax(0,1fr))}.layout{grid-template-columns:minmax(260px,360px) minmax(0,1fr);align-items:start}.narrow{max-width:530px;margin:40px auto}.spaced{margin-top:20px}.eyebrow{font-size:.75rem;letter-spacing:.12em;color:#bb9242;font-weight:800}.muted,small{color:var(--muted)}small{display:block;font-size:.75rem}.pre{white-space:pre-wrap;overflow-wrap:anywhere}.preview{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden}.hero{text-align:center;background:linear-gradient(130deg,#fff8e8,#e9f6fa);padding:45px 22px;border-radius:25px;border:1px solid #f3e7d1;margin-bottom:22px}.hero h1{margin:10px 0}.hero>p{max-width:670px;margin:10px auto 20px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;max-width:750px;margin:25px auto 10px}.stats>div{background:white;border-radius:13px;padding:16px 8px}.stats strong{display:block;font-size:1.9rem;color:var(--blue)}.stats span{display:block;font-size:.76rem;color:var(--muted)}.item{display:block;border-bottom:1px solid var(--line);padding:12px 0}.item:last-child{border-bottom:0}.item small{margin-top:3px}.flex{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.more{display:inline-block;color:#ab842d;font-weight:700;margin-top:10px}.quick{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-top:20px}.quick a{padding:22px 12px;text-align:center;border-radius:14px;background:#fffdf8;border:1px solid var(--line);font-weight:700}form{margin:0}form label{display:block;margin:13px 0 7px;font-weight:600;font-size:.87rem}input,textarea,select{width:100%;border:1px solid #dbe5e8;border-radius:9px;background:#fcfefd;color:var(--ink);padding:11px 12px;margin-top:6px;font:inherit;min-width:0}textarea{resize:vertical;min-height:100px}button,.btn{display:inline-block;border:0;border-radius:9px;padding:10px 18px;background:#537f96;color:white;font:700 .87rem 'Be Vietnam Pro',Arial,sans-serif;cursor:pointer;margin-top:12px}button:hover,.btn:hover{background:#3b667f;color:white}.secondary{background:#e5f1f5;color:#456b7e}.danger{background:#fbe9e9;color:#a64f58}.inline{display:flex;gap:10px;align-items:end;flex-wrap:wrap}.inline input{flex:1;min-width:160px}.inline button{margin:6px 0 0}.flash{border-radius:10px;padding:10px 15px;margin:12px 0;background:#fff2df}.flash.success{background:#e6f4e6}.flash.error{background:#ffeded;color:#a13d4a}.avatar{width:68px;height:68px;border-radius:50%;display:grid;place-items:center;background:#dceef7;color:#4b7388;font-size:2rem;font-weight:800}.album-card:hover{transform:translateY(-2px)}.album-cover{height:150px;background:linear-gradient(135deg,#e0f2fa,#fff1ce);display:grid;place-items:center;font-size:4rem;border-radius:12px}.photo{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:10px}.letter{text-align:center;max-width:740px;margin:30px auto;padding:45px}.letter .pre{text-align:left;margin:40px 0;font-size:1.08rem;line-height:2}.sun{font-size:5rem}.center{text-align:center}.challenge{font-size:1.4rem;font-weight:700}.login-layout{display:grid;grid-template-columns:1fr 1fr;gap:24px;max-width:1000px;margin:50px auto}.welcome{border-radius:24px;background:linear-gradient(140deg,#e5f4fb,#fff4d8);text-align:center;padding:60px 30px;display:flex;flex-direction:column;justify-content:center}.welcome p{color:#6a8796}.check{display:flex;gap:8px;align-items:center}.check input{width:auto}.controls{display:flex;gap:8px;align-items:end;flex-wrap:wrap}.controls form{display:flex;gap:6px;align-items:end}.controls select{width:auto}footer{text-align:center;padding:25px;color:#91a2a9;font-size:.8rem}@media(max-width:1080px){.top{align-items:flex-start;flex-direction:column}.nav{gap:11px}}@media(max-width:740px){.top{flex-direction:row;align-items:center;flex-wrap:wrap}.menu{display:block;background:#e7f2f7;color:#436a7d;margin:0}.nav{display:none;width:100%;flex-direction:column;align-items:stretch}.nav.open{display:flex}.nav a{padding:5px 0}.two,.three,.layout,.login-layout{grid-template-columns:1fr}.quick{grid-template-columns:repeat(2,1fr)}.stats{grid-template-columns:repeat(2,1fr)}.welcome{padding:25px}.container{margin-top:20px}.panel{padding:18px}}
/* PWA install banner */
.pwa-install{position:fixed;bottom:12px;left:50%;transform:translateX(-50%);z-index:1000;max-width:min(92vw,560px);width:max-content;display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 16px;background:#fff9eb;border:2px solid #b9daea;border-radius:16px;box-shadow:0 6px 28px #365f7730;color:#365f77}
.pwa-install[hidden]{display:none!important}.pwa-install button{cursor:pointer;border:0;background:#b9daea;color:#365f77;padding:8px 12px;border-radius:10px;font-weight:600}
#pwa-install-close{background:transparent;font-size:20px}
@media(max-width:600px){.pwa-install{width:calc(100% - 30px);justify-content:center}}
/* Album viewer — mobile-first gallery */
.gallery-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:22px}.gallery-heading h1{margin:8px 0}.gallery-heading p{margin:6px 0}.gallery-back{color:#678b9d;font-weight:700}.gallery-count{font-size:.85rem;color:#a48850}.gallery-add-btn{margin:0;border-radius:999px;white-space:nowrap}.gallery-upload{margin:0 0 22px}.gallery-upload[hidden],.gallery-lightbox[hidden]{display:none!important}.gallery-upload h2{margin:0}.gallery-close-form{margin:0}.friend-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.gallery-tile{background:#fff;border:1px solid #e9ece6;border-radius:17px;overflow:hidden;position:relative;box-shadow:var(--shadow)}.gallery-photo-button{display:block;width:100%;padding:0;margin:0;background:#e9f3f7;border:0;border-radius:0;cursor:zoom-in;line-height:0}.gallery-photo-button:hover{background:#e9f3f7}.gallery-photo-button img{display:block;width:100%;aspect-ratio:1/1;object-fit:cover;transition:transform .2s}.gallery-photo-button:hover img{transform:scale(1.025)}.gallery-tile-info{display:flex;flex-direction:column;gap:3px;padding:10px 42px 12px 12px;min-height:68px}.gallery-tile-caption{font-weight:650;line-height:1.35;overflow-wrap:anywhere}.gallery-tile-author{font-size:.76rem;color:#8799a2}.gallery-actions{position:absolute;right:8px;bottom:11px;z-index:1}.gallery-actions summary{list-style:none;cursor:pointer;border-radius:50%;background:#eef4f6;width:30px;height:30px;display:grid;place-items:center;font-size:1.3rem;line-height:1;color:#426a82}.gallery-actions summary::-webkit-details-marker{display:none}.gallery-actions form{position:absolute;right:0;bottom:36px;background:white;padding:8px;border-radius:12px;box-shadow:0 4px 20px #294c5b30;min-width:116px}.gallery-actions button{margin:0;white-space:nowrap}.gallery-empty{text-align:center;padding:40px 18px}.gallery-empty>div{font-size:3.5rem}.gallery-lightbox{position:fixed;inset:0;z-index:5000;background:rgba(10,18,27,.97);color:white;display:flex;align-items:center;justify-content:center;touch-action:pan-y}.gallery-modal-open{overflow:hidden}.gallery-lightbox-top{position:absolute;top:0;left:0;right:0;z-index:3;display:flex;align-items:center;justify-content:space-between;padding:calc(10px + env(safe-area-inset-top,0px)) 18px 10px;background:linear-gradient(#0008,transparent);font-size:.9rem}.gallery-lightbox-top button{margin:0;background:#ffffff25;color:white;border-radius:50%;width:42px;height:42px;padding:0;font-size:1.25rem}.gallery-lightbox-stage{position:absolute;inset:62px 54px 115px;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none}.gallery-lightbox-stage img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;user-select:none;-webkit-user-select:none;-webkit-user-drag:none;transform-origin:center;will-change:transform}.gallery-arrow{position:absolute;top:50%;transform:translateY(-50%);z-index:2;border-radius:50%;background:#ffffff25;color:white;font-size:2.5rem;line-height:1;width:44px;height:44px;padding:0;margin:0}.gallery-prev{left:8px}.gallery-next{right:8px}.gallery-lightbox-caption{position:absolute;bottom:0;left:0;right:0;z-index:2;text-align:center;padding:12px 16px calc(16px + env(safe-area-inset-bottom,0px));background:linear-gradient(transparent,#000a);display:flex;flex-direction:column;gap:2px;line-height:1.5}.gallery-lightbox-caption strong{font-size:.96rem}.gallery-lightbox-caption span{font-size:.78rem;color:#d6e0e6}.gallery-zoom-hint{opacity:.75;font-size:.7rem!important}@media(max-width:740px){.friend-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.gallery-tile{border-radius:12px}.gallery-tile-info{padding:9px 36px 10px 9px;min-height:65px}.gallery-tile-caption{font-size:.83rem}.gallery-tile-author{font-size:.7rem}.gallery-heading{align-items:flex-start}.gallery-add-btn{padding:10px 14px}.gallery-lightbox-stage{inset:70px 6px 135px}.gallery-arrow{top:auto;bottom:calc(100px + env(safe-area-inset-bottom,0px));transform:none;width:38px;height:38px;font-size:2rem}.gallery-prev{left:12px}.gallery-next{right:12px}.gallery-lightbox-caption{padding-bottom:calc(16px + env(safe-area-inset-bottom,0px))}}

/* iPhone Photos-inspired gallery v2: scoped, mobile first, no horizontal overflow */
html,body{max-width:100%;overflow-x:hidden}
.gallery-heading{margin:0 0 16px;align-items:flex-end}
.gallery-heading h1{font-size:clamp(1.7rem,5vw,2.3rem);margin:12px 0 4px}
.gallery-heading .gallery-count{margin-top:5px}
.friend-gallery{width:100%;min-width:0;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
.gallery-tile{min-width:0;overflow:visible;box-shadow:none;border:0;border-radius:0;background:transparent}
.gallery-photo-button{width:100%;max-width:100%;aspect-ratio:1;overflow:hidden;border-radius:3px;display:block;line-height:0;touch-action:manipulation}
.gallery-photo-button img{width:100%;height:100%;aspect-ratio:1;object-fit:cover;display:block}
.gallery-tile-info{display:none}
.gallery-actions{bottom:5px;right:5px;z-index:2}
.gallery-actions summary{width:28px;height:28px;background:#101b239c;color:white;font-size:1.1rem}
.gallery-actions form{bottom:34px;z-index:5}
.gallery-lightbox{position:fixed!important;inset:0!important;width:100vw!important;height:100vh!important;height:100dvh!important;max-width:none!important;max-height:none!important;margin:0!important;padding:0!important;z-index:2147483000!important;background:#070707!important;display:block!important;overflow:hidden!important;overscroll-behavior:contain;touch-action:none}
.gallery-lightbox[hidden]{display:none!important}
.gallery-lightbox-top{position:absolute;top:0;left:0;right:0;padding:calc(env(safe-area-inset-top,0px) + 16px) 16px 12px;background:linear-gradient(#000b,transparent);z-index:5;color:white}
.gallery-lightbox-top button{background:#333a!important;color:white!important;width:44px;height:44px;border-radius:50%;font-size:1.2rem}
.gallery-lightbox-stage{position:absolute!important;inset:72px 0 112px!important;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none}
.gallery-lightbox-stage img{display:block;max-width:100%;max-height:100%;width:auto!important;height:auto!important;object-fit:contain!important;transform-origin:center center}
.gallery-lightbox-caption{position:absolute;bottom:0;left:0;right:0;padding:20px 52px calc(env(safe-area-inset-bottom,0px) + 20px);background:linear-gradient(transparent,#000b);z-index:3;min-height:85px;pointer-events:none;color:#fff}
.gallery-lightbox-caption strong{font-size:.9rem}.gallery-lightbox-caption span{font-size:.75rem}
.gallery-arrow{position:absolute;z-index:4;top:50%;bottom:auto;transform:translateY(-50%);width:42px;height:42px;border-radius:50%;margin:0;background:#3339;color:white;font-size:2rem;padding:0}
.gallery-prev{left:8px}.gallery-next{right:8px}
.gallery-modal-open{overflow:hidden!important}
@media(max-width:740px){.container{width:calc(100% - 24px)}.ios-gallery-heading{gap:12px}.friend-gallery{grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}.gallery-heading .gallery-add-btn{font-size:.8rem;padding:10px 12px}.gallery-tile{min-width:0}.gallery-actions summary{width:24px;height:24px;font-size:1rem}.gallery-lightbox-stage{inset:65px 0 115px!important}.gallery-arrow{top:50%;bottom:auto;transform:translateY(-50%);width:36px;height:36px;font-size:1.7rem}.gallery-lightbox-caption{padding-left:45px;padding-right:45px}}

/* Accessible mobile navigation and reset vote */
@media(max-width:740px){.nav.open{display:flex;position:relative;z-index:20;background:#fffdf8;padding:12px 16px;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)}.nav.open a{display:block;padding:8px 0;font-size:.94rem}.nav.open form{width:100%}.nav.open .link{font-size:.94rem;padding:8px 0}}
.vote-reset-form{margin-top:22px;padding-top:15px;border-top:1px solid var(--line)}.vote-reset-form button:disabled{opacity:.45;cursor:not-allowed}.vote-reset-form small{margin-top:8px}
