.view--gallery {
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
    padding-top: .5rem;
}

.gallery-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.25rem;
    padding: 0 .15rem;
}

.gallery-filters {
    display: flex;
    gap: .12rem;
    padding: .18rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-pill);
}

.gallery-filter {
    border: none;
    background: transparent;
    color: var(--text-subtle);
    padding: .36rem .82rem;
    border-radius: var(--radius-pill);
    font-size: .76rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s var(--ease);
}

.gallery-filter:hover { color: var(--text); }

.gallery-filter--active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
    font-weight: 600;
}

.gallery-refresh svg {
    width: 17px;
    height: 17px;
}

.gallery-page__empty,
.gallery-page__loading,
.gallery-page__error {
    text-align: center;
    color: var(--text-muted);
    padding: 5rem 1rem;
    font-size: .92rem;
}

.gallery-grid {
    width: 100%;
}

.history-card {
    border: none;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: transparent;
    cursor: pointer;
    transition: transform .28s var(--ease);
}

.history-card:hover {
    transform: translateY(-2px);
}

.history-card__thumb {
    position: relative;
    background: #0a0a0a;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.history-card__thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.history-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s var(--ease), filter .3s var(--ease);
}

.history-card:hover .history-card__thumb img {
    transform: scale(1.02);
}

.history-card__thumb--error::after {
    content: '⚠';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.55);
    box-shadow: none;
}

.history-card__play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1;
    pointer-events: none;
}

.history-card__body {
    padding: .45rem .05rem 0;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity .2s var(--ease), max-height .25s var(--ease);
}

.history-card:hover .history-card__body,
.history-card:focus-within .history-card__body {
    opacity: 1;
    max-height: 80px;
}

.history-card__mode {
    display: none;
}

.history-card__prompt {
    margin: 0;
    font-size: .76rem;
    line-height: 1.4;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-card__meta {
    margin: .15rem 0 0;
    font-size: .66rem;
    color: var(--text-subtle);
}

.history-card__edits {
    position: absolute;
    left: .45rem;
    bottom: .45rem;
    z-index: 2;
    padding: .12rem .38rem;
    border-radius: var(--radius-pill);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: .6rem;
    font-weight: 600;
}

.history-card__actions {
    position: absolute;
    top: .4rem;
    right: .4rem;
    z-index: 2;
    display: flex;
    gap: .28rem;
    opacity: 0;
    transition: opacity .2s var(--ease);
}

.history-card:hover .history-card__actions,
.history-card__actions:focus-within {
    opacity: 1;
}

.history-card__action {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: .75rem;
    cursor: pointer;
    transition: background .2s var(--ease), color .2s var(--ease);
}

.history-card__action:hover {
    background: rgba(255, 255, 255, 0.92);
    color: #000;
}