:root{color-scheme:light;--bg:#fff;--panel:#fff;--text:#171717;--muted:#666;--accent:#004d00;--accent2:#00b300;--line:rgba(0,0,0,.10);--nav-height:70px;--header-height:62px}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text)}body{overflow:hidden}.app-header{height:var(--header-height);position:fixed;z-index:20;inset:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding:0 clamp(16px,4vw,32px);background:#fff;border-bottom:1px solid var(--line);backdrop-filter:blur(16px)}.brand{display:flex;align-items:center;gap:11px;color:#171717;text-decoration:none}.brand-mark{width:36px;height:36px;display:grid;place-items:center;border-radius:11px;background:linear-gradient(135deg,#00b300,var(--accent2));box-shadow:0 5px 18px #00b30033;color:white;font-size:14px}.brand-name{font-size:21px;font-weight:800;letter-spacing:-.7px}.brand-name span{color:#00b300}.header-actions{display:flex;gap:10px}.icon-button{width:40px;height:40px;border:1px solid var(--line);border-radius:50%;background:#f5f5f5;color:#171717;font-size:16px;cursor:pointer;transition:background .2s,transform .2s}.icon-button:hover{background:#ffffff16}.icon-button:active,.nav-item:active{transform:scale(.94)}.app-main{position:absolute;inset:0 0 var(--nav-height)}.viewer{position:relative;width:100%;height:100%;background:#fff}.viewer iframe{display:block;width:100%;height:100%;border:0;background:#fff}.loading-state,.error-state{position:absolute;z-index:2;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:13px;background:#fff;color:var(--muted);font-size:14px;text-align:center;padding:24px}.spinner{width:34px;height:34px;border:3px solid #ffffff20;border-top-color:#00b300;border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.error-state{color:var(--text)}.error-state>i{font-size:28px;color:#fbbf24}.error-state span{max-width:330px;color:var(--muted);line-height:1.5}.retry-button,.primary-button{border:0;border-radius:12px;background:var(--accent);color:white;padding:11px 18px;font-weight:700;cursor:pointer}.search-back-button{position:fixed;z-index:30;top:10px;left:12px;width:40px;height:40px;border:1px solid var(--line);border-radius:50%;background:#171a27;color:white;cursor:pointer;box-shadow:0 5px 18px #0005}.search-back-button[hidden],.app-header[hidden],.promo[hidden],.ad-overlay[hidden],.loading-state[hidden],.error-state[hidden]{display:none}.bottom-nav{position:fixed;z-index:20;inset:auto 0 0;height:calc(var(--nav-height) + env(safe-area-inset-bottom));padding:7px 8px env(safe-area-inset-bottom);display:flex;align-items:center;justify-content:space-around;background:#fff;border-top:1px solid var(--line);backdrop-filter:blur(18px)}.nav-item{min-width:0;flex:1;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;border:0;background:transparent;color:#777;font-size:10px;font-weight:600;letter-spacing:.1px;cursor:pointer;transition:color .2s,transform .2s}.nav-item i{font-size:18px}.nav-item.active{color:#004d00}.nav-item.active i{filter:drop-shadow(0 0 8px #00b30055)}.promo{position:fixed;z-index:40;left:50%;bottom:calc(var(--nav-height) + 16px);transform:translateX(-50%);width:min(92%,440px);display:flex;align-items:center;gap:11px;padding:12px 13px;background:#191d2b;border:1px solid #ffffff12;border-radius:16px;box-shadow:0 14px 40px #0008;animation:rise .35s ease-out}.promo-icon{width:38px;height:38px;flex:none;display:grid;place-items:center;background:#00b30026;border-radius:11px;color:#004d00}.promo p{flex:1;margin:0;font-size:12px;line-height:1.4;color:#e9eaf1}.promo-open{border:0;background:transparent;color:#00b300;font-weight:800;text-transform:uppercase;font-size:11px;cursor:pointer}.promo-close,.dialog-close{border:0;background:transparent;color:#9da3b2;cursor:pointer;padding:5px}.ad-overlay{position:fixed;z-index:100;inset:0;display:grid;place-items:center;padding:20px;background:#05060acc;backdrop-filter:blur(10px)}.ad-dialog{position:relative;width:min(100%,390px);padding:30px 24px 24px;text-align:center;border:1px solid #ffffff14;border-radius:22px;background:linear-gradient(155deg,#1b2030,#10121c);box-shadow:0 24px 80px #0009}.dialog-close{position:absolute;top:13px;right:14px;font-size:17px}.ad-symbol{width:54px;height:54px;margin:0 auto 16px;display:grid;place-items:center;border-radius:17px;background:#00b30026;color:#00b300;font-size:24px}.ad-dialog h2{margin:0 0 9px;font-size:20px}.ad-dialog p{margin:0 auto 22px;max-width:290px;color:var(--muted);font-size:13px;line-height:1.6}.dialog-actions{display:flex;gap:10px}.dialog-actions button{flex:1;padding:12px;border-radius:12px;font-weight:700;cursor:pointer}.secondary-button{border:1px solid var(--line);background:#f5f5f5;color:#171717}.primary-button{border:0}.search-mode .app-main{inset:0 0 var(--nav-height)}
@keyframes rise{from{opacity:0;transform:translate(-50%,12px)}to{opacity:1;transform:translate(-50%,0)}}
@media(min-width:900px){:root{--nav-height:76px;--header-height:68px}.brand-name{font-size:23px}.nav-item{font-size:11px}.nav-item i{font-size:20px}.bottom-nav{padding-left:max(18px,calc((100vw - 620px)/2));padding-right:max(18px,calc((100vw - 620px)/2))}}
@media(max-width:420px){:root{--nav-height:64px;--header-height:56px}.brand-mark{width:32px;height:32px}.brand-name{font-size:19px}.nav-item{font-size:9px;gap:5px}.nav-item i{font-size:17px}.promo{bottom:calc(var(--nav-height) + 10px)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}

/* The provider loads behind the native MovieGram header, which masks its own header. */
.app-header{z-index:20}

/* Single banner placement: fixed above the bottom navigation. */
.ad-banner{position:fixed;z-index:19;left:50%;bottom:calc(var(--nav-height) + env(safe-area-inset-bottom) + 6px);transform:translateX(-50%);width:320px;height:50px;max-width:calc(100vw - 16px);display:flex;align-items:center;justify-content:center;overflow:hidden;background:#fff;}
.ad-banner:empty{display:none}

/* Header menu */
.header-actions{position:relative}
.app-menu{position:fixed;z-index:60;top:calc(var(--header-height) - 2px);right:12px;width:min(260px,calc(100vw - 24px));padding:7px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 12px 36px #0002}
.app-menu[hidden]{display:none}
.menu-item{width:100%;display:flex;align-items:center;gap:12px;padding:13px 12px;border:0;border-radius:10px;background:transparent;color:var(--text);font:600 14px inherit;text-align:left;cursor:pointer}
.menu-item:hover,.menu-item:focus-visible{background:#f4f1ff;outline:none}
.menu-item i{width:18px;color:var(--accent);text-align:center}

/* Native MovieGram pages: privacy policy and terms */
.local-page{position:absolute;inset:0 0 0;overflow-y:auto;background:#fff;color:#171717;padding:24px 18px 36px;z-index:3}
.local-page[hidden]{display:none}
.local-page-inner{width:min(100%,760px);margin:0 auto;padding:8px 0 30px}
.local-page h1{font-size:25px;line-height:1.25;margin:0 0 12px;font-weight:800;letter-spacing:-.5px}
.local-page p{font-size:14px;line-height:1.7;color:#454545;margin:0 0 14px}
.local-page .policy-updated{font-size:12px;color:#777;margin-bottom:20px}
.policy-section{padding:15px 0;border-top:1px solid #eee}
.policy-section h2{font-size:16px;margin:0 0 8px;font-weight:750}
.policy-section p:last-child{margin-bottom:0}
