.td-library-header {
    display: flex;
    gap: 32px;
    align-items: flex-end;
    justify-content: space-between;
    padding: 42px 0 28px;
    border-bottom: 1px solid var(--td-line);
}

.td-library-back {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--td-muted);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.td-library-back:hover,
.td-library-back:focus {
    color: var(--td-rose-dark);
    text-decoration: none;
}

.td-library-header h1 {
    margin: 8px 0 0;
    font-size: 38px;
    font-weight: 900;
    line-height: 1.3;
}

.td-library-header p {
    margin: 10px 0 0;
    color: var(--td-muted);
    font-size: 15px;
    font-weight: 700;
}

.td-library-header-actions {
    display: grid;
    gap: 9px;
    justify-items: center;
}

.td-library-legacy-link {
    color: var(--td-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.td-library-legacy-link:hover,
.td-library-legacy-link:focus {
    color: var(--td-rose-dark);
}

.td-library-controls {
    display: grid;
    gap: 4px;
    padding: 28px 0 16px;
    border-bottom: 1px solid var(--td-line);
}

.td-template-search {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    width: min(100%, 720px);
    min-height: 52px;
    align-items: center;
    overflow: hidden;
    border: 1px solid #ccd6df;
    border-radius: 9px;
    background: #fff;
}

.td-template-search i {
    color: #738393;
    padding-left: 18px;
    font-size: 17px;
}

.td-template-search input {
    min-width: 0;
    height: 50px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--td-ink);
    padding: 0 14px;
    font-size: 15px;
    font-weight: 700;
}

.td-template-search button {
    height: 42px;
    margin-right: 5px;
    border: 1px solid var(--td-rose);
    border-radius: 7px;
    background: var(--td-rose);
    color: #fff;
    padding: 0 19px;
    font-weight: 900;
}

.td-template-search button:hover,
.td-template-search button:focus {
    border-color: var(--td-rose-dark);
    background: var(--td-rose-dark);
}

.td-library-results {
    padding-top: 30px;
}

.td-library-results-heading h2 {
    margin: 0 0 20px;
    font-size: 24px;
    font-weight: 900;
}

@media (max-width: 720px) {
    .td-library-header {
        display: grid;
        align-items: start;
    }
    .td-library-header h1 {
        font-size: 31px;
    }
    .td-library-header .td-button {
        justify-self: start;
    }
    .td-library-header-actions {
        justify-items: start;
    }
}

@media (max-width: 480px) {
    .td-template-search {
        grid-template-columns: auto minmax(0, 1fr);
    }
    .td-template-search button {
        grid-column: 1 / -1;
        width: calc(100% - 10px);
        margin: 0 5px 5px;
    }
}
