.view--nsfw {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.nsfw-studio {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem 1.25rem 1.25rem;
    overflow: hidden;
}

.nsfw-studio__sidebar {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    min-height: 0;
    overflow-y: auto;
}

.nsfw-studio__main {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    min-height: 0;
    overflow-y: auto;
}

.nsfw-modes {
    display: flex;
    gap: .35rem;
    padding: .25rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.nsfw-mode {
    flex: 1;
    padding: .45rem .65rem;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-subtle);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
}

.nsfw-mode--active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.nsfw-source-card,
.nsfw-settings-card {
    padding: .85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
}

.nsfw-source-card__title {
    margin: 0 0 .25rem;
    font-size: .95rem;
    font-weight: 600;
}

.nsfw-source-card__intro {
    margin: 0 0 .65rem;
    font-size: .66rem;
    line-height: 1.45;
    color: var(--text-subtle);
}

.nsfw-source-card__preview {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-md);
    border: 1px dashed rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.35);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nsfw-source-card__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nsfw-source-card__placeholder {
    margin: 0;
    padding: .5rem;
    font-size: .68rem;
    color: var(--text-subtle);
    text-align: center;
}

.nsfw-source-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .65rem;
}

.nsfw-source-picker {
    margin-top: .65rem;
}

.nsfw-source-picker__label {
    margin: 0 0 .4rem;
    font-size: .66rem;
    color: var(--text-subtle);
}

.nsfw-source-picker__strip {
    display: flex;
    gap: .35rem;
    overflow-x: auto;
    padding-bottom: .25rem;
}

.nsfw-source-picker__item {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.nsfw-source-picker__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nsfw-source-picker__item--active {
    border-color: rgba(255, 120, 120, 0.65);
    box-shadow: 0 0 0 1px rgba(255, 120, 120, 0.35);
}

.nsfw-settings-card__label {
    margin: 0 0 .55rem;
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.nsfw-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}

.nsfw-cost-estimate {
    margin: .55rem 0 0;
    font-size: .72rem;
    color: var(--text-subtle);
}

.nsfw-spicy-note {
    margin: 0;
    font-size: .68rem;
    color: rgba(255, 140, 100, 0.9);
}

.nsfw-video-hint {
    margin: 0;
    font-size: .66rem;
    color: var(--text-subtle);
    line-height: 1.45;
}

.nsfw-video-link {
    padding: 0;
    border: none;
    background: none;
    color: var(--text);
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.nsfw-library {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.nsfw-library__section {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.nsfw-library__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .65rem .85rem;
    border: none;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-size: .82rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.nsfw-library__badge {
    font-size: .58rem;
    font-weight: 600;
    padding: .15rem .4rem;
    border-radius: 999px;
    background: rgba(255, 100, 100, 0.15);
    color: rgba(255, 160, 140, 0.95);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.nsfw-library__chevron {
    margin-left: auto;
    font-size: .75rem;
    opacity: .7;
}

.nsfw-library__intro {
    margin: 0;
    padding: 0 .85rem .55rem;
    font-size: .64rem;
    line-height: 1.45;
    color: var(--text-subtle);
}

.nsfw-library__section--collapsed .nsfw-library__intro {
    display: none;
}

.nsfw-library__body {
    padding: 0 .85rem .75rem;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.nsfw-library__group-label {
    margin: 0 0 .35rem;
    font-size: .68rem;
    font-weight: 600;
    color: var(--text-subtle);
}

.nsfw-library__group-hint {
    font-weight: 400;
    opacity: .85;
}

.nsfw-library__chips {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.nsfw-library__chip {
    padding: .35rem .55rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: .66rem;
    line-height: 1.3;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.nsfw-library__chip:hover {
    border-color: rgba(255, 140, 120, 0.35);
    background: rgba(255, 100, 80, 0.08);
}

.nsfw-library__chip--active {
    border-color: rgba(255, 120, 100, 0.55);
    background: rgba(255, 100, 80, 0.16);
    color: #ffd4c8;
}

.nsfw-library__chip--append.nsfw-library__chip--active {
    border-color: rgba(180, 140, 255, 0.5);
    background: rgba(140, 100, 255, 0.12);
    color: #e8d8ff;
}

.nsfw-composer {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: .75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.25);
}

.nsfw-composer textarea {
    width: 100%;
    min-height: 4.5rem;
    resize: vertical;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: .6rem .75rem;
    font: inherit;
    font-size: .82rem;
    line-height: 1.45;
}

.nsfw-composer__row {
    display: flex;
    justify-content: flex-end;
}

.nsfw-generate-btn {
    min-width: 8rem;
}

.nsfw-negative__label {
    display: block;
    margin-bottom: .3rem;
    font-size: .66rem;
    font-weight: 600;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.nsfw-negative textarea {
    width: 100%;
    min-height: 2.5rem;
    resize: vertical;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-subtle);
    padding: .5rem .65rem;
    font: inherit;
    font-size: .72rem;
}

.nsfw-progress {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .5rem .75rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    font-size: .78rem;
}

.nsfw-error {
    margin: 0;
    padding: .5rem .75rem;
    border-radius: var(--radius-md);
    background: rgba(220, 60, 60, 0.12);
    color: #ffb0b0;
    font-size: .75rem;
}

.nsfw-preview {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.nsfw-preview__media {
    aspect-ratio: 16 / 9;
    max-height: 42vh;
    background: rgba(0, 0, 0, 0.35);
}

.nsfw-preview__btn {
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: block;
}

.nsfw-preview__btn img,
.nsfw-preview__btn video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.nsfw-preview__label {
    margin: 0;
    padding: .55rem .75rem;
    font-size: .7rem;
    color: var(--text-subtle);
    line-height: 1.4;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 900px) {
    .nsfw-studio {
        grid-template-columns: 1fr;
    }
}