.acl-resource-grid-public {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)) !important;
    align-items: start !important;
    gap: 24px !important;
}

.acl-resource-grid-public .acl-resource-card {
    position: relative !important;
    display: flex !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 3px solid #050505 !important;
    border-radius: 20px !important;
    background: #fff !important;
    box-shadow: 6px 6px 0 #050505 !important;
    color: #050505 !important;
    transition: transform .18s ease !important;
}

.acl-resource-grid-public .acl-resource-card:hover {
    transform: translateY(-4px) !important;
}

.acl-resource-card__media {
    display: block;
    width: 100%;
    min-height: 210px;
    overflow: hidden;
    border-bottom: 3px solid #050505;
    background: #fff;
    padding: 14px;
    display: grid;
    place-items: center;
}

.acl-resource-card__media img {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 320px !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
}

.acl-resource-grid-public .acl-resource-card__body {
    display: flex !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 22px !important;
}

.acl-resource-grid-public .acl-resource-badge {
    align-self: flex-start !important;
    margin: 0 0 14px !important;
    padding: 6px 12px !important;
    border: 2px solid #050505 !important;
    border-radius: 999px !important;
    background: #d32123 !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important;
}

.acl-resource-grid-public .acl-resource-card h3 {
    margin: 0 0 18px !important;
    color: #050505 !important;
    font-size: 22px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
}

.acl-resource-card__detail-link {
    color: #050505 !important;
    text-decoration: none !important;
}

.acl-resource-actions-public {
    position: relative;
    z-index: 2;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin-top: 0 !important;
}

.acl-resource-primary,
.acl-resource-secondary {
    display: inline-flex !important;
    min-height: 46px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 18px !important;
    border: 2px solid #050505 !important;
    border-radius: 999px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    text-decoration: none !important;
    box-shadow: 3px 3px 0 #050505 !important;
}

.acl-resource-primary {
    flex: 1 1 210px;
    background: #d32123 !important;
    color: #fff !important;
}

.acl-resource-secondary {
    flex: 1 1 150px;
    background: #050505 !important;
    color: #fff !important;
}

.acl-resource-primary:link,
.acl-resource-primary:visited,
.acl-resource-primary:hover,
.acl-resource-primary:focus,
.acl-resource-secondary:link,
.acl-resource-secondary:visited,
.acl-resource-secondary:hover,
.acl-resource-secondary:focus {
    color: #fff !important;
}

.acl-resource-primary:hover,
.acl-resource-secondary:hover {
    transform: translateY(-2px) !important;
}

.acl-resource-empty {
    padding: 28px;
    border: 2px dashed #9ca3af;
    border-radius: 18px;
    background: #fff;
    color: #4b5563;
    font-weight: 700;
    text-align: center;
}

#tab-my-resources .acl-resource-grid-public {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

@media (max-width: 900px) {
    #tab-my-resources .acl-resource-grid-public,
    .acl-resource-grid-public {
        grid-template-columns: 1fr !important;
    }
}

/* Dashboard resource actions v2.2.4: the dashboard/theme has broad anchor
 * color rules, so lock brand buttons and badges to accessible white text. */
html body #tab-my-resources .acl-resource-grid-public .acl-resource-badge,
html body #tab-my-resources .acl-resource-grid-public a.acl-resource-primary,
html body #tab-my-resources .acl-resource-grid-public a.acl-resource-secondary,
html body #tab-my-resources .acl-resource-grid-public a.acl-resource-primary:link,
html body #tab-my-resources .acl-resource-grid-public a.acl-resource-primary:visited,
html body #tab-my-resources .acl-resource-grid-public a.acl-resource-primary:hover,
html body #tab-my-resources .acl-resource-grid-public a.acl-resource-primary:focus,
html body #tab-my-resources .acl-resource-grid-public a.acl-resource-secondary:link,
html body #tab-my-resources .acl-resource-grid-public a.acl-resource-secondary:visited,
html body #tab-my-resources .acl-resource-grid-public a.acl-resource-secondary:hover,
html body #tab-my-resources .acl-resource-grid-public a.acl-resource-secondary:focus {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    text-shadow: none !important;
}

html body #tab-my-resources .acl-resource-grid-public a.acl-resource-primary {
    background: #d32123 !important;
}

html body #tab-my-resources .acl-resource-grid-public a.acl-resource-secondary {
    background: #050505 !important;
}

/* Fallback for dashboard builders that render the same resource cards outside
 * the tab wrapper. These class names belong only to the digital-product module,
 * so the rule cannot recolor course or lesson actions. */
html body .acl-resource-grid-public .acl-resource-badge,
html body .acl-resource-grid-public a.acl-resource-primary,
html body .acl-resource-grid-public a.acl-resource-secondary,
html body .acl-resource-grid-public a.acl-resource-primary:link,
html body .acl-resource-grid-public a.acl-resource-primary:visited,
html body .acl-resource-grid-public a.acl-resource-primary:hover,
html body .acl-resource-grid-public a.acl-resource-primary:focus,
html body .acl-resource-grid-public a.acl-resource-secondary:link,
html body .acl-resource-grid-public a.acl-resource-secondary:visited,
html body .acl-resource-grid-public a.acl-resource-secondary:hover,
html body .acl-resource-grid-public a.acl-resource-secondary:focus {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    text-shadow: none !important;
}

html body .acl-resource-grid-public a.acl-resource-primary {
    background: #d32123 !important;
}

html body .acl-resource-grid-public a.acl-resource-secondary {
    background: #050505 !important;
}

/* 3.8.87 Dark Lime action parity: no red CTA inside the student resource library. */
html body.acl-frontend-pack--legacy_lime .acl-resource-grid-public a.acl-resource-primary,
html body.acl-frontend-pack--legacy_lime .acl-resource-grid-public a.acl-resource-primary:link,
html body.acl-frontend-pack--legacy_lime .acl-resource-grid-public a.acl-resource-primary:visited,
html body.acl-frontend-pack--legacy_lime .acl-resource-grid-public a.acl-resource-primary:hover,
html body.acl-frontend-pack--legacy_lime .acl-resource-grid-public a.acl-resource-primary:focus {
    background: #8fec00 !important;
    border-color: #8fec00 !important;
    color: #0b1301 !important;
    -webkit-text-fill-color: #0b1301 !important;
}
html body.acl-frontend-pack--legacy_lime .acl-resource-grid-public a.acl-resource-primary:hover {
    background: #b7ff3d !important;
    border-color: #b7ff3d !important;
}

/* 3.8.94 Expert Suite Default dashboard parity.
 * Keep digital-product cards on the same visual rhythm and footprint as the
 * "Khóa Học Của Tôi" cards. Dark Lime keeps its own source-faithful skin. */
body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-grid-public {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 20px !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-grid-public .acl-resource-card {
    height: 100% !important;
    min-height: 0 !important;
    border: 1px solid #f1f5f9 !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04) !important;
    overflow: hidden !important;
    transform: none !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-grid-public .acl-resource-card:hover {
    transform: translateY(-4px) !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .09) !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-card__media {
    width: 100% !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 9 !important;
    padding: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    background: #f1f5f9 !important;
    overflow: hidden !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-card__media img {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center !important;
    background: #fff !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-card__media--empty {
    display: grid !important;
    place-items: center !important;
    background: #f1f5f9 !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-card__placeholder {
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    letter-spacing: .08em !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-grid-public .acl-resource-card__body {
    flex: 1 1 auto !important;
    padding: 20px !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-grid-public .acl-resource-badge {
    margin: 0 0 12px !important;
    padding: 4px 9px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: rgba(227, 24, 45, .08) !important;
    color: #e3182d !important;
    -webkit-text-fill-color: #e3182d !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
    box-shadow: none !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-grid-public .acl-resource-card h3 {
    display: -webkit-box !important;
    min-height: 40px !important;
    margin: 0 0 16px !important;
    overflow: hidden !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    color: #1e293b !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-card__detail-link {
    color: #1e293b !important;
    -webkit-text-fill-color: #1e293b !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-actions-public {
    margin-top: auto !important;
    gap: 8px !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-primary,
body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-secondary {
    flex: 1 1 100% !important;
    min-height: 40px !important;
    padding: 9px 12px !important;
    border: 0 !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-primary,
body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-primary:link,
body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-primary:visited {
    background: #e3182d !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-primary:hover,
body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-primary:focus {
    background: #c81e1e !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    opacity: 1 !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-secondary,
body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-secondary:link,
body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-secondary:visited {
    background: #fff !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-secondary:hover,
body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-secondary:focus {
    background: #0f172a !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    border-color: #0f172a !important;
    opacity: 1 !important;
}

body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-count {
    display: inline-flex !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 14px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 999px !important;
    background: #fff !important;
    box-shadow: none !important;
    color: #334155 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

@media (max-width: 1180px) {
    body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-grid-public {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 760px) {
    body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-grid-public {
        grid-template-columns: 1fr !important;
    }
    body.acl-frontend-pack--expert_default #tab-my-resources .acl-resource-card__media {
        aspect-ratio: 16 / 9 !important;
    }
}
