/* ================================================================
 *  AIImageViewer — Full-screen custom image viewer
 *
 *  Uses only --ii-* custom properties from variables.css.
 *  Open/close animations exactly mirror popup.js transitions.
 * ================================================================ */

/* ---- Backdrop ---- */
.ii-viewer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.88);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9990;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    display: none;
}

.ii-viewer-backdrop.is-open {
    opacity: 1;
    pointer-events: all;
}

/* ---- Main container ---- */
.ii-viewer-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%) scale(0.95);
    z-index: 9991;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);

    display: flex;
    width: 92vw;
    max-width: 1360px;
    height: 90svh;
    max-height: 900px;
    border-radius: var(--ii-radius-rounded);
    overflow: hidden;
    background: #0d0e12;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7), 0 8px 24px rgba(0, 0, 0, 0.4);
}

.ii-viewer-container.is-open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* ========================
   LEFT — Image stage
   ======================== */
.ii-viewer-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #0d0e12;
    position: relative;
    overflow: hidden;
}

/* Stage: clipping area for pan/zoom */
.ii-viewer-stage {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    user-select: none;
    /* Let JS own all touch events: prevents browser pinch-zoom / scroll */
    touch-action: none;
}

.ii-viewer-stage.is-dragging {
    cursor: grabbing;
}

.ii-viewer-stage.is-fit {
    cursor: default;
}

/* Image inside stage */
.ii-viewer-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    transform-origin: center center;
    transition: transform 0.22s ease, opacity 0.22s ease;
    will-change: transform;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.ii-viewer-img.is-transitioning {
    opacity: 0;
}

.ii-viewer-stage.is-dragging .ii-viewer-img {
    transition: none;
}

/* Loading skeleton inside stage */
.ii-viewer-img-skeleton {
    position: absolute;
    inset: 20px;
    border-radius: 8px;
    background: linear-gradient(90deg, #1a1c24 25%, #22242f 50%, #1a1c24 75%);
    background-size: 200% 100%;
    animation: iiSkeletonShimmer 1.8s infinite linear;
    display: none;
}

.ii-viewer-img-skeleton.is-visible {
    display: block;
}

/* ---- Zoom controls bar (bottom of left panel) ---- */
.ii-viewer-zoom-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(13, 14, 18, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.ii-viewer-zoom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.ii-viewer-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.ii-viewer-zoom-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.ii-viewer-zoom-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Range track */
.ii-viewer-zoom-range {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    cursor: pointer;
    accent-color: var(--ii-accent, #2563eb);
}

.ii-viewer-zoom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--ii-accent, #2563eb);
    cursor: pointer;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
    transition: transform 0.15s ease;
}

.ii-viewer-zoom-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.ii-viewer-zoom-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--ii-accent, #2563eb);
    border: none;
    cursor: pointer;
}

.ii-viewer-zoom-pct {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.04em;
    min-width: 36px;
    text-align: right;
    flex-shrink: 0;
}

.ii-viewer-zoom-reset {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.ii-viewer-zoom-reset:hover {
    color: rgba(255, 255, 255, 0.75);
}

/* ---- Variant thumbnail strip ---- */
.ii-viewer-variants {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: rgba(13, 14, 18, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    overflow-y: hidden;
    max-height: 120px;
    transition:
        max-height 0.22s ease,
        opacity 0.18s ease,
        padding-top 0.22s ease,
        padding-bottom 0.22s ease;
}

@supports (-moz-appearance: none) {
    .ii-viewer-variants {
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
    }
}

.ii-viewer-variants.is-hidden {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.ii-viewer-variant-thumb {
    width: 56px;
    height: 56px;
    border-radius: 7px;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.05);
}

.ii-viewer-variant-thumb:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

.ii-viewer-variant-thumb.is-active {
    border-color: var(--ii-accent, #2563eb);
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.ii-viewer-variant-label {
    font-size: 9px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-top: 4px;
}

.ii-viewer-variant-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

/* ========================
   RIGHT — Metadata sidebar
   ======================== */
.ii-viewer-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: #13151c;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ii-viewer-sidebar-inner {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

@supports (-moz-appearance: none) {
    .ii-viewer-sidebar-inner {
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
    }
}

/* ---- Sidebar section: Date ---- */
.ii-viewer-meta-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

.ii-viewer-meta-date svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.35);
}

/* ---- Sidebar section: image actions ---- */
.ii-viewer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ii-viewer-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ii-viewer-action-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.ii-viewer-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.ii-viewer-action-btn.is-done {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.08);
}

/* ---- Sidebar divider ---- */
.ii-viewer-sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 0;
    border: none;
}

/* ---- Sidebar section: prompt ---- */
.ii-viewer-prompt-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ii-viewer-actions-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ii-viewer-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ii-viewer-section-label-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ii-viewer-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ii-viewer-icon-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.ii-viewer-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}

.ii-viewer-icon-btn.is-hidden {
    display: none;
}

.ii-viewer-prompt-text-wrap {
    position: relative;
}

.ii-viewer-prompt-text {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
}

.ii-viewer-prompt-text.is-expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
}

.ii-viewer-prompt-show-all {
    display: none;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #60a5fa;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: var(--ii-font-body, Inter, sans-serif);
}

.ii-viewer-prompt-show-all.is-visible {
    display: inline-block;
}

/* ---- Sidebar section: settings badges ---- */
.ii-viewer-settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ii-viewer-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ii-viewer-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    font-family: var(--ii-font-body, Inter, sans-serif);
}

/* ---- Sidebar loading skeleton ---- */
.ii-viewer-sidebar-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

.ii-viewer-skel-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #1e2130 25%, #272a3a 50%, #1e2130 75%);
    background-size: 200% 100%;
    animation: iiSkeletonShimmer 1.8s infinite linear;
}

.ii-viewer-sidebar.is-loading .ii-viewer-sidebar-inner {
    display: none;
}

.ii-viewer-sidebar.is-loading .ii-viewer-sidebar-skeleton {
    display: flex;
}

.ii-viewer-sidebar:not(.is-loading) .ii-viewer-sidebar-skeleton {
    display: none;
}

/* ========================
   Sidebar header row (date + close button)
   ======================== */
.ii-viewer-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

/* ========================
   Close button (inside sidebar header)
   ======================== */
.ii-viewer-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ii-viewer-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
}

.ii-viewer-close svg {
    width: 14px;
    height: 14px;
}

.ii-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(26, 29, 39, 0.75);
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.ii-viewer-nav:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.ii-viewer-nav:disabled,
.ii-viewer-nav[disabled] {
    opacity: 0.2;
    cursor: not-allowed;
    pointer-events: none;
}

.ii-viewer-nav svg {
    width: 16px;
    height: 16px;
}

.ii-viewer-nav-prev {
    left: 14px;
}

.ii-viewer-nav-next {
    /* Keep away from the sidebar border */
    right: 14px;
}


/* ========================
   Responsive
   ======================== */
@media (max-width: 900px) {
    .ii-viewer-container {
        flex-direction: column;
        width: 100vw;
        height: 100svh;
        max-height: 100svh;
        border-radius: 0;
        max-width: 100%;
    }

    .ii-viewer-sidebar {
        width: 100%;
        flex-shrink: 0;
        max-height: 40svh;
        border-left: none;
        border-top: 1px solid var(--ii-border, #e5e7eb);
    }

    .ii-viewer-nav-next {
        right: 14px;
    }
}

.ii-viewer-sidebar .ii-viewer-variants {
    /* Reset any bottom-strip overrides */
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;

    /* 3-per-row wrapping grid */
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;

    /* Spacing inside sidebar */
    padding: 10px 12px !important;
    overflow: visible !important;
    overflow-x: unset !important;

    /* Separator above the variant grid */
    border-top: 1px solid var(--ii-card-border, rgba(255, 255, 255, .10));
    margin-top: 8px;
}

/* ── Individual variant thumbnail ── */
.ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb {
    /* Reset any bottom-strip sizing */
    width: 100% !important;
    height: auto !important;
    flex: none !important;
    flex-shrink: unset !important;

    aspect-ratio: 1 / 1;
    border-radius: var(--ii-radius-sm, 8px);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition:
        border-color 160ms ease,
        transform 160ms ease,
        opacity 160ms ease;
    opacity: 0.65;
    position: relative;
}

.ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb:hover {
    opacity: 0.88;
    transform: scale(1.04);
}

.ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb.is-active,
.ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb[data-active="true"],
.ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb.active {
    border-color: var(--ii-accent, #7c5ef1);
    opacity: 1;
    transform: none;
}

/* The <img> tag inside each thumb */
.ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb img,
.ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb .ii-variant-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
}

/* ── Variant label (V1, V2 …) optional ── */
.ii-viewer-sidebar .ii-viewer-variants .ii-variant-label {
    position: absolute;
    bottom: 3px;
    left: 4px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
    pointer-events: none;
    line-height: 1;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb {
        transition: none;
    }

    .ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb:hover {
        transform: none;
    }
}

/* ── Dark theme adjustments ── */
[data-theme="dark"] .ii-viewer-sidebar .ii-viewer-variants {
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* ── Light theme adjustments ── */
[data-theme="light"] .ii-viewer-sidebar .ii-viewer-variants {
    border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb {
    opacity: 0.72;
}

[data-theme="light"] .ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb:hover {
    opacity: 0.90;
}

[data-theme="light"] .ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb.is-active {
    opacity: 1;
}

.ii-viewer-used-assets {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ii-viewer-used-assets.is-hidden {
    display: none;
}

.ii-viewer-sidebar-divider.is-hidden {
    display: none;
}

.ii-viewer-asset-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

/* Each asset is an <a> linking to zeelproject.com */
.ii-viewer-asset-item {
    display: flex;
    align-items: center;
    position: relative;
    flex-direction: column;
    width: 100%;
    gap: 3px;
    padding: 7px 8px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ii-viewer-asset-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.13);
}

.ii-viewer-asset-item:hover .ii-viewer-asset-ext-icon {
    color: rgba(255, 255, 255, 0.6);
    transform: translate(1px, -1px);
}

.ii-viewer-asset-item.is-custom {
    cursor: default;
}

.ii-viewer-asset-thumb {
    width: 46px;
    height: 46px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.ii-viewer-asset-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.ii-viewer-asset-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ii-viewer-asset-title {
    text-align: center;
    font-size: 11.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    line-height: 1.3;
    -webkit-box-orient: vertical;
}

/* ── Brand/Artist attribution in ImageViewer used-assets sidebar ────────── */
.ii-viewer-asset-brand {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 9px;
    line-height: 1.1;
    font-weight: 500;
    color: rgba(96, 165, 250, 0.85);

    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.3;
    cursor: pointer;
    transition: color 0.15s ease;
}

.ii-viewer-asset-brand:hover {
    color: rgba(147, 197, 253, 1);
    text-decoration: underline;
}

/* External link icon — signals the link opens in a new tab */
.ii-viewer-asset-ext-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.25);
    transition: color 0.15s ease, transform 0.15s ease;
    position: absolute;
    right: 2px;
}

/* ── Author card ──────────────────────────────────────────── */
.ii-viewer-author {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.ii-viewer-author-card {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ii-viewer-author-avatar-wrap {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 100px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ii-viewer-author-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ii-viewer-author-avatar.is-fallback {}

.ii-viewer-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ii-viewer-author-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.ii-viewer-author-username {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.38);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ii-viewer-author-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ii-viewer-author-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 11px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.55);
    background: transparent;
}

.ii-viewer-author-profile-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.82);
    border-color: rgba(255, 255, 255, 0.2);
}

.ii-viewer-author-workspace-btn {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.28);
    color: rgba(147, 185, 255, 0.85);
}

.ii-viewer-author-workspace-btn:hover {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.5);
    color: rgb(147, 185, 255);
}