.topbar-nav > button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border: 0;
    background: transparent;
    color: rgb(255 255 255 / 0.5);
    transition: color 0.2s ease;
}

.topbar-nav > button:hover {
    color: #fff;
}

.topbar-nav > button.is-active {
    color: #fff;
    font-weight: 500;
}

.mobile-nav-item {
    cursor: pointer;
    border: 0;
    background: transparent;
    padding: 0;
}

.ms-history-panel {
    position: fixed;
    inset: 0;
    z-index: 130;
    align-items: flex-end;
    justify-content: center;
}

.ms-history-panel:not(.hidden) {
    display: flex;
}

.ms-history-backdrop {
    position: absolute;
    inset: 0;
    background: rgb(2 6 23 / 0.45);
    backdrop-filter: blur(2px);
}

.ms-history-sheet {
    position: relative;
    z-index: 1;
    display: flex;
    max-height: 78vh;
    width: 100%;
    max-width: 760px;
    flex-direction: column;
    border-radius: 28px 28px 0 0;
    background: #fff;
    padding: 1rem 1rem 1rem;
    box-shadow: 0 -20px 60px rgba(15, 23, 42, 0.25);
}

.ms-history-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.ms-history-label {
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #94a3b8;
}

.ms-history-title {
    margin-top: 0.25rem;
    color: #0f172a;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
}

.ms-history-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ms-history-clear,
.ms-history-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ms-history-clear {
    border-radius: 9999px;
    padding: 0.375rem 0.75rem;
    font-size: 11px;
    font-weight: 600;
}

.ms-history-close {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
}

.ms-history-clear:hover,
.ms-history-close:hover {
    border-color: #cbd5e1;
    color: #0f172a;
}

.ms-history-list {
    display: flex;
    max-height: calc(78vh - 120px);
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    padding-right: 0.25rem;
    scrollbar-width: none;
}

.ms-history-list::-webkit-scrollbar {
    display: none;
}

.ms-history-empty:not(.hidden) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3.5rem 0;
    text-align: center;
    color: #94a3b8;
}

.ms-history-card {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #fff;
    padding: 0.5rem;
    transition: border-color 0.2s ease;
}

.ms-history-card:hover {
    border-color: #cbd5e1;
}

.ms-history-card-thumb {
    width: 124px;
    height: 74px;
    flex-shrink: 0;
    border-radius: 0.75rem;
    background-color: #e2e8f0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.ms-history-card-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.ms-history-card-body {
    display: flex;
    width: 100%;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    padding-right: 0.25rem;
}

.ms-history-card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.ms-history-card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 11px;
}

.ms-history-card-ribbon {
    display: inline-flex;
    border-radius: 9999px;
    background: rgb(34 197 94 / 0.1);
    padding: 0.25rem 0.5rem;
    color: #22c55e;
    font-weight: 600;
}

.ms-history-card-meta {
    color: #94a3b8;
}

@media (min-width: 1024px) {
    .ms-history-sheet {
        margin-bottom: 2rem;
        border-radius: 28px;
        padding: 1.25rem 1.5rem 1.5rem;
    }

    .ms-history-title {
        font-size: 28px;
    }
}
