/* Materials library and upload styles. */

#tab-materials {
    gap: 1.5rem;
}

#tab-materials .materials-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    overflow: hidden;
    padding: clamp(1.4rem, 4vw, 2.2rem);
    border: 1px solid rgba(56, 189, 248, .2);
    min-height: 10rem;
    border-radius: 1.5rem;
    background:
        radial-gradient(circle at 90% 5%, rgba(56, 189, 248, .2), transparent 30%),
        linear-gradient(120deg, #10243a 0%, #111827 58%, #17243b 100%);
    box-shadow: 0 18px 48px rgba(2, 6, 23, .22);
}

#tab-materials .materials-hero-copy,
#tab-materials .materials-hero-art {
    position: relative;
    z-index: 1;
}

#tab-materials .materials-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
    color: #7dd3fc;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

#tab-materials .materials-hero h2 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(1.5rem, 3vw, 2.15rem);
    font-weight: 750;
    letter-spacing: -.035em;
    line-height: 1.35;
}

#tab-materials .materials-hero p {
    max-width: 44rem;
    margin-top: .6rem;
    color: #b6c2d4;
    line-height: 1.75;
}

#tab-materials .materials-hero-art {
    display: grid;
    width: 5.25rem;
    height: 5.25rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(186, 230, 253, .2);
    border-radius: 1.45rem;
    background: linear-gradient(145deg, rgba(14, 165, 233, .3), rgba(37, 99, 235, .1));
    color: #bae6fd;
    font-size: 2.15rem;
    box-shadow: inset 0 1px rgba(255, 255, 255, .1), 0 14px 30px rgba(4, 6, 24, .24);
    transform: rotate(4deg);
}

#tab-materials .materials-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, .7fr);
    align-items: center;
    gap: 1.25rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid rgba(71, 94, 128, .62);
    border-radius: 1.15rem;
    background: linear-gradient(115deg, rgba(18, 29, 47, .98), rgba(13, 21, 36, .96));
    box-shadow: 0 12px 32px rgba(2, 6, 23, .16), inset 0 1px rgba(255, 255, 255, .025);
}

#tab-materials .materials-toolbar-title {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
}

#tab-materials .materials-toolbar-title > span:first-child {
    display: grid;
    width: 2.65rem;
    height: 2.65rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: .85rem;
    background: rgba(14, 165, 233, .13);
    color: #7dd3fc;
    box-shadow: inset 0 1px rgba(255, 255, 255, .05);
}

#tab-materials .materials-toolbar-title h3 {
    margin: 0;
    color: #f1f5f9;
    font-size: .98rem;
    letter-spacing: -.015em;
}

#tab-materials .materials-toolbar-title p {
    line-height: 1.45;
}

#materials-count {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    margin-left: auto;
    border: 1px solid rgba(71, 94, 128, .72);
    border-radius: 999px;
    background: rgba(8, 145, 178, .1);
    color: #bae6fd;
    padding: .4rem .75rem;
    font-size: .78rem;
    font-weight: 650;
}

#materials-search {
    width: 100%;
    min-height: 3rem;
    padding: .7rem 1rem .7rem 2.8rem;
    border: 1px solid #35445d !important;
    border-radius: .9rem !important;
    background-color: rgba(8, 15, 27, .76) !important;
    color: #e5eaf4 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.8'%3E%3Ccircle cx='10.8' cy='10.8' r='6.8'/%3E%3Cpath stroke-linecap='round' d='m16 16 4.2 4.2'/%3E%3C/svg%3E");
    background-position: .8rem center;
    background-repeat: no-repeat;
    background-size: 1.05rem;
}

#materials-search:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, .13), 0 8px 20px rgba(2, 6, 23, .12);
    outline: none;
}

#material-upload-form {
    padding: clamp(1.2rem, 3vw, 1.7rem) !important;
    border: 1px solid rgba(71, 94, 128, .62) !important;
    border-radius: 1.3rem !important;
    background:
        radial-gradient(ellipse at 100% 0, rgba(14, 165, 233, .09), transparent 38%),
        linear-gradient(145deg, #151f31, #101827 72%) !important;
    box-shadow: 0 18px 42px rgba(2, 6, 23, .2), inset 0 1px rgba(255, 255, 255, .025) !important;
}

#material-upload-form .materials-form-heading {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #f1f5f9 !important;
    font-size: 1rem;
    padding-bottom: .95rem;
    border-bottom: 1px solid rgba(71, 94, 128, .38);
}

#material-upload-form .materials-form-heading > span:first-child {
    display: grid;
    width: 2.65rem;
    height: 2.65rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: .85rem;
    background: rgba(14, 165, 233, .13);
    color: #7dd3fc;
}

#material-upload-form .materials-heading-copy {
    display: block;
    width: auto;
    height: auto;
    min-width: 0;
    flex: 1 1 auto;
    background: transparent;
    color: inherit;
}

#material-upload-button {
    min-height: 2.9rem;
    padding: .7rem 1.1rem;
    border: 1px solid rgba(186, 230, 253, .14);
    border-radius: .85rem;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    box-shadow: 0 8px 20px rgba(14, 116, 186, .2);
    transition: filter .18s ease, transform .18s ease, box-shadow .18s ease;
}

#material-upload-button:not(:disabled):hover {
    filter: brightness(1.08);
    box-shadow: 0 12px 26px rgba(14, 116, 186, .32);
    transform: translateY(-1px);
}

#material-upload-form > p {
    line-height: 1.65;
}

#material-upload-form > p:first-of-type {
    padding: .75rem .85rem;
    border: 1px solid rgba(71, 94, 128, .32);
    border-radius: .8rem;
    background: rgba(8, 15, 27, .34);
}

#material-upload-status:not(:empty) {
    padding: .65rem .8rem;
    border: 1px solid rgba(56, 189, 248, .16);
    border-radius: .7rem;
    background: rgba(14, 165, 233, .08);
}

#material-upload-status[class*="text-green"] { color: #86efac !important; }

#material-upload-status[class*="text-red"] { color: #fda4af !important; }

#material-upload-status[class*="text-indigo"] { color: #7dd3fc !important; }

#materials-list {
    overflow: hidden;
    border: 1px solid rgba(71, 94, 128, .62);
    border-radius: 1.2rem;
    background: linear-gradient(145deg, #121c2c, #0f1726);
    box-shadow: 0 16px 40px rgba(2, 6, 23, .2), inset 0 1px rgba(255, 255, 255, .025);
}

#materials-list > details {
    border-color: rgba(71, 94, 128, .38) !important;
}

#materials-list > details > summary {
    min-height: 3.9rem;
    padding: .95rem 1.2rem;
    background: linear-gradient(100deg, rgba(14, 165, 233, .075), transparent 65%);
    color: #f1f5f9 !important;
    font-size: .95rem;
    list-style: none;
}

#materials-list > details > summary::-webkit-details-marker {
    display: none;
}

#materials-list > details > summary::before {
    display: grid;
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #3a4b67;
    border-radius: .5rem;
    background: rgba(8, 15, 27, .62);
    color: #93c5fd;
    content: "+";
    font-size: .95rem;
    line-height: 1;
}

#materials-list > details[open] > summary::before {
    content: "−";
}

#materials-list details summary {
    transition: background-color .16s ease;
}

#materials-list details summary:hover {
    background-color: rgba(30, 41, 59, .48);
}

#materials-list details > div {
    border-color: #293750 !important;
}

#materials-list .material-card {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid rgba(41, 55, 80, .72);
    transition: background-color .18s ease;
}

#materials-list .material-card:last-child {
    border-bottom: 0;
}

#materials-list .material-card:hover {
    background: rgba(30, 41, 59, .45);
}

#materials-list .material-pdf-icon {
    width: 2.8rem;
    height: 2.8rem;
    border: 1px solid rgba(251, 113, 133, .2);
    border-radius: .85rem;
    background: rgba(244, 63, 94, .12) !important;
    color: #fda4af !important;
}

#materials-list .material-download {
    min-height: 2.55rem;
    border: 1px solid #34435d;
    border-radius: .7rem;
    background: #18243a !important;
    color: #dbeafe !important;
}

#materials-list .material-download:hover {
    border-color: #38bdf8;
    background: #0c6b9a !important;
    color: white !important;
}

#materials-list .material-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: 1rem;
    padding: 1rem;
}

#materials-list .material-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    border: 1px solid #293750;
    border-radius: 1rem;
    background: linear-gradient(155deg, #151d2d, #101827 80%);
    box-shadow: 0 10px 26px rgba(2, 6, 23, .18);
}

#materials-list .material-card:hover {
    border-color: #435879;
    background: #151f31;
    transform: translateY(-2px);
}

#materials-list .material-card-preview {
    position: relative;
    display: grid;
    min-height: 10rem;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 45%, rgba(14, 165, 233, .22), transparent 38%),
        linear-gradient(135deg, #0b1322, #172942 58%, #101827);
}

#materials-list .material-card-preview::before,
#materials-list .material-card-preview::after {
    position: absolute;
    width: 10rem;
    height: 10rem;
    border: 1px solid rgba(125, 211, 252, .12);
    border-radius: 2rem;
    content: "";
    transform: rotate(34deg);
}

#materials-list .material-card-preview::after {
    width: 7rem;
    height: 7rem;
    border-color: rgba(129, 140, 248, .16);
    transform: rotate(-24deg);
}

#materials-list .material-preview-mark {
    position: relative;
    z-index: 1;
    display: grid;
    width: 4.5rem;
    height: 5.2rem;
    place-items: center;
    border: 1px solid rgba(254, 202, 202, .4);
    border-radius: .85rem;
    background: linear-gradient(145deg, rgba(244, 63, 94, .95), rgba(190, 24, 93, .86));
    color: white;
    box-shadow: 0 15px 30px rgba(2, 6, 23, .35);
    transform: rotate(-5deg);
}

#materials-list .material-preview-mark i { font-size: 1.8rem; }

#materials-list .material-preview-mark span { font-size: .68rem; font-weight: 800; letter-spacing: .12em; }

#materials-list .material-file-size {
    position: absolute;
    right: .7rem;
    bottom: .65rem;
    z-index: 1;
    padding: .25rem .5rem;
    border-radius: .4rem;
    background: rgba(3, 7, 18, .82);
    color: #e2e8f0;
    font-size: .68rem;
    font-weight: 700;
}

#materials-list .material-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1rem;
}

#materials-list .material-card-heading {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
}

#materials-list .material-uploader-mark {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: #dbeafe;
    color: #2563eb;
    font-size: .75rem;
    font-weight: 800;
}

#materials-list .material-card h4 {
    display: -webkit-box;
    overflow: hidden;
    min-height: 2.7rem;
    color: #eaf0fb;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

#materials-list .material-card-subtitle {
    margin-top: .15rem;
    color: #8fa2bd;
    font-size: .73rem;
}

#materials-list .material-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    margin-top: .8rem;
    color: #a8b5c9;
    font-size: .72rem;
}

#materials-list .material-free-access {
    color: #4ade80;
    font-weight: 700;
}

#materials-list .material-card .material-download {
    display: block;
    width: 100%;
    margin-top: auto;
    padding: .75rem .85rem;
    border: 0;
    border-top: 1px solid #293750;
    border-radius: 0;
    background: transparent !important;
    color: #dbeafe !important;
    text-align: center;
}

#materials-list .material-card .material-download:hover {
    background: #1b2a42 !important;
}

#materials-list .material-folder-contents {
    padding: .15rem;
}

#materials-list details details > .material-folder-contents {
    padding: .35rem .6rem .75rem;
}

#materials-list .materials-empty-state,
#materials-list .materials-error-state {
    padding: 2.25rem 1.5rem;
    color: #aebbd0;
    text-align: center;
}

#materials-list .materials-empty-state i,
#materials-list .materials-error-state i {
    display: grid;
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto .9rem;
    place-items: center;
    border: 1px solid rgba(56, 189, 248, .18);
    border-radius: 1.1rem;
    background: rgba(14, 165, 233, .1);
    color: #7dd3fc;
    font-size: 1.35rem;
}

@media (max-width: 640px) {
    #tab-materials .materials-hero {
        align-items: flex-start;
    }
    #tab-materials .materials-hero-art {
        width: 3.5rem;
        height: 3.5rem;
        border-radius: 1rem;
        font-size: 1.45rem;
    }
    #tab-materials .materials-toolbar {
        align-items: stretch;
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }
    #tab-materials .materials-toolbar-title { flex-wrap: wrap; }
    #materials-count { margin-left: auto; }
    #materials-search {
        width: 100%;
    }
    #material-upload-form > div:first-of-type {
        align-items: stretch;
        flex-direction: column;
    }
    #materials-list .material-card-grid { grid-template-columns: 1fr; }
    #materials-list .material-card-preview { min-height: 8rem; }
}

#tab-materials .materials-hero {
    border-color: rgba(56, 189, 248, .3);
    box-shadow: 0 18px 42px rgba(2, 6, 23, .2), inset 0 1px rgba(255, 255, 255, .035);
}

#tab-materials .materials-hero {
    border-color: rgba(167, 139, 250, .24);
    background:
        radial-gradient(circle at 88% 8%, rgba(139, 92, 246, .22), transparent 32%),
        radial-gradient(circle at 8% 100%, rgba(79, 70, 229, .14), transparent 38%),
        linear-gradient(120deg, #17162f 0%, #111827 58%, #1a1b36 100%);
}

#tab-materials .materials-eyebrow { color: #c4b5fd; }

#tab-materials .materials-hero-art {
    border-color: rgba(196, 181, 253, .24);
    background: linear-gradient(145deg, rgba(139, 92, 246, .3), rgba(79, 70, 229, .15));
    color: #ddd6fe;
}

#tab-materials .materials-upload-card,
#tab-materials .materials-library {
    min-width: 0;
    padding: clamp(1rem, 2.5vw, 1.4rem);
    border: 1px solid rgba(71, 85, 115, .65);
    border-radius: 1.2rem;
    background: rgba(15, 23, 42, .72);
    box-shadow: 0 16px 38px rgba(2, 6, 23, .18), inset 0 1px rgba(255, 255, 255, .025);
    backdrop-filter: blur(14px);
}

#tab-materials .materials-upload-card {
    display: grid;
    gap: 1rem;
}

#tab-materials .materials-upload-heading {
    display: flex;
    align-items: center;
    gap: .8rem;
}

#tab-materials .materials-upload-icon {
    display: grid;
    width: 2.8rem;
    height: 2.8rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(167, 139, 250, .2);
    border-radius: .9rem;
    background: rgba(124, 58, 237, .17);
    color: #c4b5fd;
    font-size: 1.1rem;
}

#tab-materials .materials-upload-heading h3,
#tab-materials .materials-library-heading h3 {
    margin: 0;
    color: #f1f5f9;
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: -.015em;
}

#tab-materials .materials-upload-heading p,
#tab-materials .materials-library-heading p {
    margin: .2rem 0 0;
    color: #94a3b8;
    font-size: .78rem;
    line-height: 1.5;
}

#tab-materials .materials-drop-zone {
    position: relative;
    display: flex;
    min-height: 8.5rem;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border: 1px dashed #475569;
    border-radius: 1rem;
    background:
        radial-gradient(ellipse at 0 0, rgba(124, 58, 237, .12), transparent 54%),
        rgba(8, 15, 27, .48);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

#tab-materials .materials-drop-zone:hover,
#tab-materials .materials-drop-zone.is-dragging,
#tab-materials .materials-drop-zone:focus-within {
    border-color: rgba(167, 139, 250, .8);
    background-color: rgba(76, 29, 149, .14);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .12);
}

#tab-materials #material-file {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

#tab-materials .materials-drop-icon {
    display: grid;
    width: 3rem;
    height: 3rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(248, 113, 113, .2);
    border-radius: .9rem;
    background: rgba(239, 68, 68, .12);
    color: #fca5a5;
    font-size: 1.25rem;
}

#tab-materials .materials-drop-copy {
    display: grid;
    gap: .3rem;
    color: #94a3b8;
    font-size: .8rem;
}

#tab-materials .materials-drop-copy strong {
    color: #e2e8f0;
    font-size: .9rem;
}

#tab-materials .materials-browse-link { color: #c4b5fd; font-weight: 700; }

#tab-materials .materials-file-preview {
    overflow: hidden;
    margin-left: auto;
    color: #94a3b8;
    font-size: .72rem;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#tab-materials .materials-drop-zone.has-file .materials-file-preview { color: #c4b5fd; }

#tab-materials .materials-classification-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8rem;
    padding: 1rem;
    border: 1px solid rgba(71, 85, 115, .55);
    border-radius: .9rem;
    background: rgba(8, 15, 27, .35);
}

#tab-materials .materials-classification-fields.hidden { display: none; }

#tab-materials .materials-classification-fields label {
    display: grid;
    gap: .4rem;
    color: #cbd5e1;
    font-size: .74rem;
    font-weight: 650;
}

#tab-materials .materials-classification-fields select,
#tab-materials .materials-filter select {
    width: 100%;
    min-width: 0;
    min-height: 2.65rem;
    padding: .6rem .75rem;
    border: 1px solid #334155 !important;
    border-radius: .7rem !important;
    background-color: #0b1220 !important;
    color: #e2e8f0 !important;
    font-size: .78rem;
}

#tab-materials .materials-classification-fields select:focus,
#tab-materials .materials-filter select:focus {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .16);
    outline: none;
}

#tab-materials .materials-upload-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

#tab-materials .materials-upload-footer p {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin: 0;
    color: #94a3b8;
    font-size: .72rem;
    line-height: 1.5;
}

#tab-materials .materials-upload-footer p i { margin-top: .15rem; color: #a78bfa; }

#tab-materials #material-upload-button {
    display: inline-flex;
    min-height: 2.7rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .65rem 1rem;
    border: 1px solid rgba(196, 181, 253, .2);
    border-radius: .75rem;
    background: linear-gradient(110deg, #7c3aed, #4f46e5);
    box-shadow: 0 8px 20px rgba(109, 40, 217, .2);
    color: white;
    font-size: .78rem;
    font-weight: 700;
}

#tab-materials #material-upload-button:disabled {
    cursor: not-allowed;
    opacity: .48;
    box-shadow: none;
}

#tab-materials #material-upload-status:empty { display: none; }

#tab-materials #material-upload-status {
    margin: 0;
    border-radius: .7rem;
    background: rgba(139, 92, 246, .08);
    font-size: .76rem;
}

#tab-materials .materials-library { padding: 0; overflow: hidden; }

#tab-materials .materials-library-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.2rem .9rem;
}

#tab-materials .materials-library-heading #materials-count { margin-left: auto; }

#tab-materials .materials-toolbar {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) auto;
    gap: .75rem;
    padding: 0 1.2rem 1rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#tab-materials .materials-search,
#tab-materials .materials-filter {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
}

#tab-materials .materials-search > i,
#tab-materials .materials-filter > i {
    position: absolute;
    left: .85rem;
    z-index: 1;
    color: #94a3b8;
    font-size: .78rem;
    pointer-events: none;
}

#tab-materials #materials-search {
    min-height: 2.8rem;
    padding: .65rem .85rem .65rem 2.4rem;
    border-color: #334155 !important;
    border-radius: .75rem !important;
    background-image: none;
    background-color: rgba(8, 15, 27, .65) !important;
    font-size: .8rem;
}

#tab-materials #materials-search:focus {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .15);
}

#tab-materials .materials-filter-controls {
    display: flex;
    min-width: 0;
    gap: .65rem;
}

#tab-materials .materials-filter select { padding-left: 2.2rem; }

#tab-materials .materials-list {
    overflow: hidden;
    border-top: 1px solid rgba(71, 85, 115, .5);
    background: rgba(8, 15, 27, .25);
}

#tab-materials .material-card-grid { gap: .8rem; padding: .9rem 1.1rem; }

#tab-materials .material-card {
    border-color: #2b354b;
    border-radius: .9rem;
    background: linear-gradient(150deg, rgba(24, 31, 51, .96), rgba(15, 23, 42, .96));
    box-shadow: 0 8px 20px rgba(2, 6, 23, .15);
    transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

#tab-materials .material-card:hover {
    border-color: rgba(167, 139, 250, .55);
    background: #191d35;
    box-shadow: 0 14px 28px rgba(2, 6, 23, .25);
}

#tab-materials .material-card-preview {
    min-height: 7rem;
    background:
        radial-gradient(circle at 50% 45%, rgba(139, 92, 246, .2), transparent 42%),
        linear-gradient(135deg, #101426, #1a1d37 58%, #111827);
}

#tab-materials .material-card-preview::before { border-color: rgba(196, 181, 253, .1); }

#tab-materials .material-preview-mark {
    width: 3.5rem;
    height: 4.1rem;
    border-color: rgba(254, 202, 202, .32);
    border-radius: .7rem;
}

#tab-materials .material-card-body { padding: .85rem; }

#tab-materials .material-card h4 { min-height: 2.4rem; }

#tab-materials .material-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .75rem;
}

#tab-materials .material-tag {
    max-width: 100%;
    overflow: hidden;
    padding: .25rem .5rem;
    border: 1px solid rgba(167, 139, 250, .17);
    border-radius: 999px;
    background: rgba(124, 58, 237, .1);
    color: #c4b5fd;
    font-size: .65rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#tab-materials .material-card .material-download {
    margin-top: .8rem;
    border-top-color: rgba(71, 85, 115, .5);
}

#tab-materials .material-card .material-download:hover {
    background: rgba(124, 58, 237, .14) !important;
    color: #ddd6fe !important;
}

#tab-materials #materials-list > details > summary {
    background: linear-gradient(100deg, rgba(124, 58, 237, .08), transparent 68%);
}

#tab-materials #materials-list > details > summary::before { color: #c4b5fd; }

#tab-materials #materials-list .materials-empty-state i,
#tab-materials #materials-list .materials-error-state i {
    border-color: rgba(167, 139, 250, .2);
    background: rgba(124, 58, 237, .12);
    color: #c4b5fd;
}

#tab-materials .materials-load-more {
    margin-top: 1rem;
    padding: .6rem .9rem;
    border: 1px solid rgba(167, 139, 250, .32);
    border-radius: .7rem;
    background: rgba(124, 58, 237, .14);
    color: #ddd6fe;
    font-size: .76rem;
    font-weight: 700;
}

#tab-materials .materials-load-more:disabled { cursor: wait; opacity: .6; }

@media (max-width: 700px) {
    #tab-materials .materials-toolbar { grid-template-columns: minmax(0, 1fr); }
    #tab-materials .materials-filter-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #tab-materials .materials-classification-fields { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    #tab-materials .materials-drop-zone { flex-wrap: wrap; gap: .75rem; padding: .9rem; }
    #tab-materials .materials-drop-icon { width: 2.6rem; height: 2.6rem; }
    #tab-materials .materials-file-preview { width: 100%; margin-left: 0; text-align: left; }
    #tab-materials .materials-upload-footer { align-items: stretch; flex-direction: column; }
    #tab-materials #material-upload-button { width: 100%; }
    #tab-materials .materials-library-heading { align-items: flex-start; flex-wrap: wrap; padding-inline: .85rem; }
    #tab-materials .materials-library-heading #materials-count { margin-left: auto; }
    #tab-materials .materials-toolbar { padding-inline: .85rem; }
    #tab-materials .material-card-grid { grid-template-columns: 1fr; padding: .75rem; }
}

#tab-materials .materials-hero {
    border-color: rgba(96, 165, 250, .28);
    background:
        radial-gradient(circle at 88% 8%, rgba(37, 99, 235, .2), transparent 32%),
        radial-gradient(circle at 8% 100%, rgba(79, 70, 229, .14), transparent 38%),
        linear-gradient(120deg, #13223a, #111827 58%, #171a36);
}

#tab-materials .materials-eyebrow,
#tab-materials .materials-upload-icon,
#tab-materials .materials-toolbar-title > span:first-child { color: #93c5fd; }

#tab-materials .materials-upload-icon {
    border-color: rgba(96, 165, 250, .22);
    background: rgba(37, 99, 235, .15);
}

#tab-materials .materials-drop-zone {
    background:
        radial-gradient(ellipse at 0 0, rgba(37, 99, 235, .13), transparent 54%),
        rgba(8, 15, 27, .48);
}

#tab-materials .materials-drop-zone:hover,
#tab-materials .materials-drop-zone.is-dragging,
#tab-materials .materials-drop-zone:focus-within {
    border-color: rgba(96, 165, 250, .8);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .14);
}

#tab-materials .materials-browse-link,
#tab-materials .materials-drop-zone.has-file .materials-file-preview { color: #93c5fd; }

#tab-materials .materials-upload-footer p i { color: #60a5fa; }

#tab-materials #material-upload-button {
    border-color: rgba(147, 197, 253, .24);
    background: linear-gradient(110deg, #2563eb, #4f46e5);
    box-shadow: 0 8px 20px rgba(37, 99, 235, .22);
}

#tab-materials .materials-search > i,
#tab-materials .materials-filter > i,
#tab-materials .materials-toolbar-title > span:first-child { color: #60a5fa; }

#tab-materials #materials-search:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .16);
}

#tab-materials .material-card:hover { border-color: rgba(96, 165, 250, .5); }

#tab-materials .material-card-preview {
    background:
        radial-gradient(circle at 50% 45%, rgba(37, 99, 235, .22), transparent 42%),
        linear-gradient(135deg, #101426, #172746 58%, #111827);
}

#tab-materials .material-tag {
    border-color: rgba(96, 165, 250, .2);
    background: rgba(37, 99, 235, .12);
    color: #bfdbfe;
}

#tab-materials .material-card .material-download:hover {
    background: rgba(37, 99, 235, .16) !important;
    color: #bfdbfe !important;
}

#tab-materials #materials-list > details > summary {
    background: linear-gradient(100deg, rgba(37, 99, 235, .09), transparent 68%);
}

#tab-materials #materials-list > details > summary::before { color: #93c5fd; }

#tab-materials .materials-load-more {
    border-color: rgba(96, 165, 250, .3);
    background: rgba(37, 99, 235, .13);
    color: #bfdbfe;
}
