.space-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:22px;margin:26px 0}.space-card{background:#fff;border:1px solid #e1e9f5;border-radius:18px;overflow:hidden;box-shadow:0 5px 20px #244a7e06;transition:transform .2s,box-shadow .2s}.space-card:hover{transform:translateY(-3px);box-shadow:0 12px 30px #244a7e12}.space-cover{aspect-ratio:16/10;background:#f0f5fc;display:grid;place-items:center;position:relative}.space-cover img{position:absolute;width:100%;height:100%;object-fit:cover}.space-cover span{color:#8c9bb1}.space-card-body{padding:18px}.space-card h3{font-size:16px;margin:0 0 10px;color:#223957}.space-card p,.library-heading p,#spaceStatus{color:#8190a7;font-size:13px;line-height:1.6}.card-actions{display:flex;gap:18px;margin-top:18px}.card-actions a{color:#3168ff;font-size:13px;font-weight:600}.library-toolbar button{border:0;background:none;padding:12px;color:#7586a0;cursor:pointer}.library-toolbar button.active{color:#3168ff;border-bottom:2px solid #3168ff}.empty-state{grid-column:1/-1;padding:70px 24px;text-align:center;border:1px dashed #dae4f3;border-radius:20px;background:#ffffff9c}.empty-state h2{font-size:20px}.empty-state p{color:#8190a7}.empty-state .primary{display:inline-block;background:#3168ff;color:white;border:0;border-radius:10px;padding:12px 18px;margin-top:16px;cursor:pointer}#spaceSearch{border:1px solid #dfe7f3;border-radius:10px;background:#fff;padding:12px 16px}button[hidden]{display:none!important}@media(max-width:640px){.space-grid{grid-template-columns:1fr}.library-toolbar{flex-wrap:wrap}}

/* Space library UI refinement */
body.freecreat-v3 .upload-library{max-width:1380px!important;padding-top:42px!important}
body.freecreat-v3 .library-heading{align-items:center!important;padding:0 0 34px!important;border-bottom:1px solid #e4ebf5}
body.freecreat-v3 .library-heading h1{font-size:34px!important;letter-spacing:-.8px!important;color:#1c3558!important}
body.freecreat-v3 .library-heading p{margin-top:8px!important;color:#8495ad!important}
body.freecreat-v3 .library-primary{border-radius:12px!important;padding:13px 21px!important;box-shadow:0 8px 18px rgba(49,104,255,.18)!important}
body.freecreat-v3 .library-toolbar{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:18px!important;margin:26px 0 6px!important;padding:0!important;border:0!important}
body.freecreat-v3 .library-toolbar nav{display:flex;gap:6px;padding:4px;border:1px solid #e1e9f5;border-radius:12px;background:#f7faff}
body.freecreat-v3 .library-toolbar button{height:36px;padding:0 16px!important;border-radius:8px!important;border:0!important;font-size:12px!important}
body.freecreat-v3 .library-toolbar button.active{background:#fff!important;box-shadow:0 3px 10px rgba(39,78,132,.1);border:1px solid #dce7f6!important}
body.freecreat-v3 #spaceSearch{width:240px;height:40px;padding:0 14px!important;outline:0;box-shadow:0 3px 12px rgba(39,78,132,.04)}
body.freecreat-v3 #spaceStatus{margin:22px 0 12px!important;font-size:12px!important;color:#889ab2!important}
body.freecreat-v3 .space-grid{grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:20px;margin-top:12px!important}
body.freecreat-v3 .space-card{border-radius:16px!important;box-shadow:0 7px 22px rgba(36,74,126,.07)!important}
body.freecreat-v3 .space-card:hover{transform:translateY(-5px)!important;box-shadow:0 16px 32px rgba(36,74,126,.14)!important}
body.freecreat-v3 .space-cover{aspect-ratio:16/10!important;background:linear-gradient(135deg,#edf4ff,#e5edfa)!important}
body.freecreat-v3 .space-cover span{display:flex;flex-direction:column;align-items:center;gap:7px;color:#8298b7;font-size:12px;letter-spacing:.2px}
body.freecreat-v3 .space-cover span:before{content:'◇';display:grid;place-items:center;width:42px;height:42px;border-radius:13px;color:#5e86df;background:#fff;font-size:23px;box-shadow:0 5px 14px rgba(55,99,170,.12)}
body.freecreat-v3 .space-card-body{padding:17px 18px 18px!important}
body.freecreat-v3 .space-card h3{margin-bottom:8px!important;font-size:15px!important}
body.freecreat-v3 .space-card p{margin:0!important;font-size:12px!important}
body.freecreat-v3 .card-actions{align-items:center;margin-top:16px!important;padding-top:14px;border-top:1px solid #edf1f7}
body.freecreat-v3 .card-actions a{font-size:12px!important;font-weight:500!important}
body.freecreat-v3 .library-pagination{display:flex;justify-content:center;align-items:center;gap:9px;margin:30px auto 0!important}
body.freecreat-v3 .library-pagination button{min-width:70px;height:36px;border:1px solid #dce6f3;border-radius:9px;background:#fff;color:#5e7598;font-size:12px;cursor:pointer}
body.freecreat-v3 .library-pagination button:disabled{opacity:.45;cursor:not-allowed}
body.freecreat-v3 .library-pagination span{min-width:54px;text-align:center;color:#536b91;font-size:12px}
@media(max-width:640px){body.freecreat-v3 .library-heading{align-items:flex-start!important;gap:18px!important;flex-direction:column!important}body.freecreat-v3 .library-toolbar{align-items:stretch!important;flex-direction:column!important}body.freecreat-v3 #spaceSearch{width:100%!important}}
body.freecreat-v3 .space-status-badge{display:inline-flex;align-items:center;padding:4px 8px;border-radius:6px;font-size:11px}.space-status-badge.is-published{color:#26724e;background:#e6f7ee}.space-status-badge.is-draft{color:#6f7f98;background:#eef3fa}.space-model-count{margin-left:7px;color:#8495ad}
/* Cover alignment: the media surface fills the card edge-to-edge. */
body.freecreat-v3 .space-card{padding:0!important}
body.freecreat-v3 .space-cover{width:100%!important;margin:0!important;border-radius:15px 15px 0 0!important;overflow:hidden!important;display:grid!important;place-items:center!important}
body.freecreat-v3 .space-cover img{inset:0;object-position:50% 50%;background:#edf3fc}
body.freecreat-v3 .space-cover span{width:100%;height:100%;display:flex!important;justify-content:center;align-items:center}

body.freecreat-v3 .space-card-body{display:flex;flex-direction:column;min-height:126px}
body.freecreat-v3 .space-card h3{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans SC","Microsoft YaHei",sans-serif!important;overflow-wrap:anywhere;word-break:break-word}
body.freecreat-v3 .card-actions{margin-top:auto!important;display:flex;align-items:center;gap:8px!important}
body.freecreat-v3 .card-actions a,body.freecreat-v3 .space-view-disabled{display:inline-flex;align-items:center;min-height:32px;padding:7px 11px;border-radius:8px;font-size:11px;font-weight:500;white-space:nowrap}
body.freecreat-v3 .card-actions a{border:1px solid #d7e4ff;background:#f5f8ff;color:#3168ff}
body.freecreat-v3 .card-actions a:hover{background:#eaf1ff}
body.freecreat-v3 .space-view-disabled{color:#96a5b8;background:#f1f4f8}

body.freecreat-v3 #spaceGrid .space-card{height:auto!important;min-height:0!important;display:flex!important;flex-direction:column!important;aspect-ratio:auto!important} body.freecreat-v3 #spaceGrid .space-cover{height:auto!important;flex:none!important} body.freecreat-v3 #spaceGrid .space-card-body{display:flex!important;position:relative!important;visibility:visible!important;opacity:1!important;height:auto!important;min-height:148px!important;overflow:visible!important} body.freecreat-v3 #spaceGrid .card-actions{display:flex!important;gap:8px!important;padding-top:14px!important} body.freecreat-v3 #spaceGrid .card-actions a{flex:1;justify-content:center;text-decoration:none!important;min-height:38px!important} body.freecreat-v3 #spaceGrid .space-edit-action{background:#3168ff!important;color:#fff!important}
