/* Home layout: white canvas, readable navigation and compact category tiles. */
body{background:#fff;color:#303239;font-family:Inter,Arial,sans-serif;overflow-y:scroll;scrollbar-color:#969696 #fafafa;scrollbar-width:thin}
.header{height:64px;padding:0 24px;gap:22px;background:#fff;border-bottom:1px solid #f0f0f0;backdrop-filter:none}
.header .lovia-logo{width:143px;height:50px}
.header .lovia-logo img{width:282.36px!important;height:94.12px!important;left:-27px;top:-21px}
.header-right{gap:12px;flex:none}
.header-right button{padding:9px 14px;border-radius:7px;font-size:13px;font-weight:600;white-space:nowrap}
.vip-button{background:#ffdfbb;color:#74401d}.vip-button svg{vertical-align:-3px;margin-right:4px}
.login-button{background:#f35072;color:#fff}.login-button:hover{background:#df3b60}
.header-right .primary{font-size:13px;padding:10px 14px;border-radius:7px}
#header-search-slot{flex:1;max-width:500px;margin-left:auto;min-width:0}
#search-form.header-search{display:flex;align-items:center;width:100%;margin:0;padding:0 12px;border:1px solid #e5e6e9;border-radius:7px;background:#fff;box-shadow:none}
.header-search>img{width:16px;opacity:.6}.header-search input{flex:1;min-width:0;width:100%;padding:10px;border:0;outline:0;background:transparent;font:14px Inter,Arial,sans-serif;color:#303239}
.search-form-slot{min-height:46px;margin:8px auto 14px;width:min(600px,80%)}
.search-banner .search-form-slot form{width:100%;margin:0}
.sidebar{top:64px;border:0;box-shadow:none;background:#fff}
.sidebar nav>button,.sidebar nav>a{font-weight:500;color:#383b42;font-size:14px;line-height:21px;letter-spacing:0}
.sidebar nav p{color:#74777e;font-size:11px}.sidebar nav img{opacity:.95}
.search-banner{border-radius:8px;min-height:178px;padding:14px 24px 0;background:linear-gradient(110deg,#ffa5b8,#ffb8be 58%,#ffc3b2)}
.search-banner input::placeholder{color:#737781}.format-tabs button{color:#52383e;font-size:12px;font-weight:500}.format-tabs{gap:32px}
.categories{gap:12px;margin:14px 0 28px;padding:2px 0 6px;scrollbar-width:none}.categories::-webkit-scrollbar{display:none}
.category{min-width:156px;max-width:190px;flex:1 0 156px;height:60px;min-height:60px;padding:8px 10px;gap:6px;border:0;border-radius:8px}
.category strong{font-size:12px;font-weight:600;color:#34363c}.category small{font-size:10px;color:#686b73}.category img{width:40px;height:40px;flex-basis:40px}
.section-heading{gap:10px;margin-bottom:14px}.section-heading h2{font-size:18px;color:#292c32}.section-heading p,.section-heading button{font-size:12px;color:#6c7078}
.template-card{border-color:#ececef;border-radius:7px}.template-card .card-meta{color:#60646b;background:#fff}.collection{margin-bottom:36px}
.account-dialog[open]{display:block;width:min(420px,calc(100vw - 32px));padding:30px;border-radius:16px;color:#303239}
.account-dialog h2{font-size:21px;margin:0 24px 16px 0}.account-dialog p{font-size:14px;line-height:1.7;color:#626773}.account-dialog .account-close{position:absolute;right:12px;top:10px;font-size:24px}.account-dialog .account-ok{display:block;margin-top:22px;padding:10px 22px;background:#f35072;color:white;border-radius:7px;font-weight:600}
@media(min-width:901px){.sidebar{width:220px;padding:16px 12px}.sidebar nav>button,.sidebar nav>a{padding:10px;white-space:nowrap}main{width:calc(100% - 268px);max-width:1600px;margin-left:calc(220px + max(24px,(100vw - 1820px)/2));margin-right:24px;padding:18px 0 0;transform:none}.template-row,.wide-row .template-row{grid-auto-columns:calc((100% - 60px)/5);gap:15px}.all-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:15px}}
@media(min-width:1450px){.template-row,.wide-row .template-row{grid-auto-columns:calc((100% - 96px)/7);gap:16px}.all-grid{grid-template-columns:repeat(7,minmax(0,1fr));gap:16px}}
@media(min-width:1900px){.template-row,.wide-row .template-row{grid-auto-columns:calc((100% - 128px)/9)}.all-grid{grid-template-columns:repeat(9,minmax(0,1fr))}}
@media(max-width:1000px){.header{gap:12px;padding:0 16px}.header-right{gap:8px}.header-right button{padding:9px 10px;font-size:12px}.header-right .primary{display:none}}
@media(max-width:600px){.header{padding:0 12px;gap:8px}.header-right .vip-button{display:none}.header-right .login-button{font-size:11px;padding:9px}.header:has(.header-search) .lovia-brand{display:none}#header-search-slot:empty{display:none}.header-search input{font-size:13px;padding:9px 4px}.search-banner{min-height:174px;padding:12px}.search-form-slot{width:94%}.format-tabs{gap:4px}.category{min-width:154px;flex-basis:154px}.section-heading{flex-wrap:wrap}.section-heading h2{font-size:17px}.section-heading p{font-size:11px}.section-heading button{margin-left:auto}.sidebar{top:auto}.account-dialog h2{font-size:19px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
/* Consistent Inter controls and a content scrollbar below the fixed header. */
html,body{height:100%;overflow:hidden}
body,button,input,select{font-family:Inter,Arial,sans-serif}
.header-right button{height:34px;padding:0 16px;font-size:13px;font-weight:500;border-radius:8px;box-shadow:none;transition:background-color .18s ease}
.vip-button{background:#f9d4aa;color:#744326}.vip-button:hover{background:#f5c996}.login-button{background:#f35072}.login-button:hover{background:#e84467}
.home-scroll{position:fixed;inset:64px 0 0 220px;overflow-x:hidden;overflow-y:auto;scrollbar-gutter:stable;scrollbar-width:auto;scrollbar-color:#929292 #fafafa}
.home-scroll::-webkit-scrollbar{width:10px}.home-scroll::-webkit-scrollbar-track{background:#fafafa}.home-scroll::-webkit-scrollbar-thumb{background:#929292;border:2px solid #fafafa;border-radius:8px}
.home-scroll main{width:100%;max-width:2540px;margin:0 auto;padding:18px 28px 0;transform:none}
@media(min-width:901px){.template-row,.wide-row .template-row{grid-auto-columns:clamp(205px,11.5vw,250px);gap:18px}.all-grid{grid-template-columns:repeat(auto-fill,minmax(205px,1fr));gap:18px}}
@media(max-width:900px){.home-scroll{left:68px}.home-scroll main{padding:18px}}
@media(max-width:560px){.home-scroll{left:0;bottom:64px}.home-scroll main{padding:14px}.header-right button{height:32px}}
.library-mode .search-banner,.library-mode .categories{display:none}
.library-filters{padding:8px 0 22px;margin-bottom:12px;border-bottom:1px solid #f1f1f3}
.library-filter-row{display:flex;align-items:flex-start;gap:18px;margin:0 0 12px;font-size:13px}
.library-filter-row>span{flex:0 0 76px;padding-top:8px;color:#777b83}
.library-filter-row>div{display:flex;flex-wrap:wrap;gap:6px 10px}
.library-filter-row button{padding:7px 11px;border-radius:6px;color:#50545b;font-size:13px;font-weight:400}
.library-filter-row button:hover{background:#faf2f4}.library-filter-row button[aria-pressed=true]{background:#f1f2f4;color:#252930;font-weight:600}
.library-mode .all-grid{display:block;columns:230px;column-gap:18px}
.library-mode .all-grid .template-card{display:inline-block;vertical-align:top;width:100%;margin-bottom:18px;break-inside:avoid}
.library-mode .all-grid .reference-cover{display:block;width:100%;height:auto;aspect-ratio:auto;object-fit:contain}
@media(max-width:560px){.library-filter-row{gap:6px}.library-filter-row>span{flex-basis:65px;font-size:12px}.library-filter-row button{font-size:12px;padding:6px 8px}.library-mode .all-grid{columns:2;column-gap:10px}}
/* Original Hunbei icon assets, with their pink shading preserved. */
.format-tabs{gap:48px}
.format-tabs button{min-width:62px;color:#fff;font:500 13px/1.4 Inter,Arial,sans-serif;gap:8px;padding:0 8px 16px}
.format-tabs button>span{width:44px;height:44px;border:2px solid #fff;border-radius:50%;background:#fff;display:grid;place-items:center;box-shadow:none}
.format-tabs button>span>img{width:30px;height:30px;object-fit:contain;filter:none;opacity:1}
.format-tabs button.active>span{background:transparent;border-color:#fff}
.format-tabs button.active>span>img{filter:brightness(0) invert(1)}
.format-tabs button.active:after{border-bottom-color:#fff}
@media(max-width:600px){.format-tabs{gap:5px;justify-content:space-around}.format-tabs button{min-width:0;font-size:11px;padding-inline:3px}.format-tabs button>span{width:38px;height:38px}.format-tabs button>span>img{width:26px;height:26px}}

/* Stable shell and consistent Inter menus from the first paint. */
html.library-route .search-banner,html.library-route .categories{display:none}
.library-filters,.library-filter-row button,.sidebar,.categories,.header-right{font-family:Inter,Arial,sans-serif;-webkit-font-smoothing:antialiased}
.library-filter-row{align-items:center;min-height:38px;gap:20px;margin-bottom:10px}
.library-filter-row>span{color:#606773;font-weight:500;padding-top:0;line-height:20px}
.library-filter-row button{font:500 13px/20px Inter,Arial,sans-serif;color:#414854;padding:7px 12px;white-space:nowrap;border:0}
.library-filter-row button[aria-pressed=true]{font-weight:600;color:#252b34;background:#eef0f3}
#modal-image{position:relative}
.preview-cover-loading{position:absolute;z-index:1;top:12px;left:50%;transform:translateX(-50%);width:auto!important;height:calc(100% - 24px)!important;max-width:100%;object-fit:contain;border-radius:6px;pointer-events:none}
.live-template.preview-loading{opacity:0!important;transition:none!important}
.live-template{transition:opacity .15s ease}
.template-row .template-card{contain:layout style}
@media(prefers-reduced-motion:reduce){.live-template{transition:none}}

.row-wrap{container-type:inline-size}
.template-row,.wide-row .template-row{--visible-columns:1;grid-auto-columns:calc((100% - (var(--visible-columns) - 1)*18px)/var(--visible-columns));gap:18px}
@container (min-width:428px){.template-row{--visible-columns:2}}
@container (min-width:651px){.template-row{--visible-columns:3}}
@container (min-width:874px){.template-row{--visible-columns:4}}
@container (min-width:1097px){.template-row{--visible-columns:5}}
@container (min-width:1320px){.template-row{--visible-columns:6}}
@container (min-width:1543px){.template-row{--visible-columns:7}}
@container (min-width:1766px){.template-row{--visible-columns:8}}
@container (min-width:1989px){.template-row{--visible-columns:9}}
@media(max-width:560px){.template-row,.wide-row .template-row{--visible-columns:2;grid-auto-columns:calc((100% - 12px)/2);gap:12px}}

.library-filter-row button:disabled{opacity:.38;cursor:not-allowed;background:transparent}.library-filter-row .filter-count{font-size:10px;opacity:.6;margin-left:3px;font-weight:400}

/* Reserve the final phone viewport; never enlarge a thumbnail while loading. */
#template-modal.live-modal .preview-cover-loading{box-sizing:border-box;display:grid;place-items:center;width:min(410px,calc(100% - 48px))!important;height:calc(100% - 24px)!important;max-width:none;background:#fff;color:#858b95;font:400 13px/1.5 Inter,Arial,sans-serif;box-shadow:0 4px 20px #20212412}
@media(max-width:540px){#template-modal.live-modal .preview-cover-loading{top:8px;width:min(410px,calc(100% - 16px))!important;height:calc(100% - 16px)!important}}
