* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Темная тема */
    --bg-primary: #111111;
    --bg-secondary: #13131a;
    --bg-tertiary: #1c1c1c;
    --bg-card: rgba(25, 25, 35, 0.6);
    --bg-input: rgba(30, 30, 40, 0.8);
    
    --text-primary: #ffffff;
    --text-secondary: #e5e5e5;
    --text-tertiary: #6e6e73;
    
    --accent: #a855f7;
    --accent-hover: #9333ea;
    --accent-glow: rgba(168, 85, 247, 0.4);
    
    --gradient-1: #667eea;
    --gradient-2: #764ba2;
    --gradient-3: #f093fb;
    --gradient-4: #a855f7;
    
    --border: rgba(255, 255, 255, 0.08);
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sidebar initially hidden on mobile */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 199;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.app-container {
    display: flex;
    height: 100vh;
    position: relative;
    width: 100%;
}

/* Main Chat Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
 
    overflow: hidden;
    position: relative;
    width: 100%;
}

 

.chat-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    padding: 0 12px;
    backdrop-filter: blur(2px) ;
    -webkit-backdrop-filter: blur(2px)  ;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
    background: linear-gradient(to bottom, #111111 0%, #11111100 100%);
}

.chat-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px
}

.nav-back-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 55px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.nav-back-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-back-btn:hover::before {
    opacity: 1;
}

.nav-back-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
 
}

.nav-back-btn svg {
    position: relative;
    z-index: 1;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.nav-back-btn:hover svg {
    color: var(--accent);
}

.header-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
    pointer-events: none;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.2); }
}

.chat-header .chat-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
    letter-spacing: -0.3px;
}

/* Limits Indicator */
.limits-indicator {
    position: relative;
    width: 24px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.limits-indicator:hover {
    transform: scale(1.1);
}

.progress-ring {
    transform: rotate(-90deg);
    width: 24px;
    height: 24px;
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}

.crown-icon {
    width: 24px;
    height: 24px;
 
    transition: all 0.3s ease;
 
}

.crown-icon:hover {
   
  
    transform: scale(1.05);
}

/* Limits Tooltip */
.limits-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: var(--bg-tertiary);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    min-width: 240px;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
}

.limits-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.tooltip-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-align: center;
}

.tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.tooltip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
}

.tooltip-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.tooltip-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.tooltip-btn {
    width: 100%;
    padding: 12px;
    background: #FFF;
    border: none;
    border-radius: 55px;
    color: var(--bg-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: -0.5px;
    transition: all 0.3s ease;
}

.tooltip-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 80px 12px 100px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 1;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    transition: padding-bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-messages.with-prompt-suggestions {
    padding-bottom: 180px;
}

.chat-messages.with-video-options {
    padding-bottom: 180px;
}

.chat-messages.with-prompt-suggestions.with-video-options {
    padding-bottom: 260px;
}


.chat-messages::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Empty State with Animated Gradient */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-secondary);
    position: relative;
    padding: 0px 20px 96px 20px;
}

 

.empty-icon {
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.empty-icon img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.empty-state h2 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-weight: 700;
    position: relative;
    z-index: 1;
    letter-spacing: -0.5px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

/* Messages */
.message {
    word-wrap: break-word;
    animation: messageAppear 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent), #9333ea);
    color: #ffffff;
    border-radius: 20px 20px 2px 20px;
    max-width: 85%;
    padding: 10px 12px 10px 12px;
 
    position: relative;
}

.message-user::after {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message-user:hover::after {
    opacity: 1;
}

.message-user .message-content {
    font-size: 14px;
    line-height: 1.5;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 8px;

}

.message-retry-btn {
    margin-top: 6px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
}

.message-retry-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.message-retry-btn:active {
    transform: translateY(0);
}

.message-actions {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    margin-left: 8px;
}

.message-action-btn {
    padding: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.message-action-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.message-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.message-action-btn:active {
    transform: translateY(0);
}

.message-image {
    display: block;
    margin-top: 8px;
    border-radius: 8px;
    max-width: 240px;
    max-height: 240px;
    object-fit: cover;
}

.message-assistant {
    align-self: flex-start;
  padding: 12px 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);

    max-width: 90%;
    
     
    position: relative;
    
}

.message-assistant .message-content h3  {

    margin-bottom: 12px;
}

.message-assistant .message-content hr  {

    margin: 12px 0;
    border: 1px solid var(--border);
}

.message-title {
 
    font-size: 14px;
    color: var(--text-primary);
 
  
}

.message-content {
    line-height: 1.5;
    font-size: 14px;
}

.message-assistant .message-content {
    color: var(--text-primary);
}

.message-assistant .message-content p {
    margin-bottom: 12px;
}

.message-assistant .message-content p:last-child {
    margin-bottom: 0;
}

.message-assistant .message-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 14px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 12px 0;
    font-size: 13px;
    border: 1px solid var(--border);
}

.message-assistant .message-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--accent);
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.message-assistant .message-content pre code {
    background: transparent;
    padding: 0;
    color: var(--text-primary);
}

.message-assistant .message-content ul,
.message-assistant .message-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.message-assistant .message-content li {
    margin: 6px 0;
}

/* Loading indicator */
.message.loading {
    background: transparent;
}

.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: typing 1.4s infinite;
    box-shadow: 0 0 8px var(--accent-glow);
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-12px) scale(1.2);
        opacity: 1;
    }
}

/* Prompt Suggestions */
.prompt-suggestions {
     /* position: relative; */
    /* bottom: 100px; */
    /* left: 0; */
    /* right: 0; */
    padding: 12px 12px 2px 12px;
    display: none;
    gap: 8px;
    overflow-x: auto;
    z-index: 90;
    scrollbar-width: none;
    -ms-overflow-style: none;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: calc(100vh - 200px);
    pointer-events: auto;
}

.prompt-suggestions.with-attachments {
    bottom: 172px;
}

.prompt-suggestions.with-video-options {
    bottom: 172px;
}

.prompt-suggestions.with-attachments.with-video-options {
    bottom: 244px;
}

/* Динамическое позиционирование с учетом высоты attached-images-preview */
.prompt-suggestions.with-attachments-dynamic {
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.prompt-suggestions::-webkit-scrollbar {
    display: none;
}

.suggestion-chip {
    flex-shrink: 0;
    min-width: 108px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.01);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: row;
    align-items:  center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    text-align: left;
}

.suggestion-chip::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.suggestion-chip:hover::before {
    left: 100%;
}

.suggestion-chip:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-3px) scale(1.02);
    border-color: var(--border);
}

.suggestion-chip:active {
    transform: translateY(-1px) scale(0.98);
}

.chip-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.9;
    color: var(--text-secondary);
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.2));
}

.chip-text {
    font-weight: 500;
    letter-spacing: -0.2px;
    line-height: 1.3;
    word-wrap: break-word;
    max-width: 100%;
    text-align: left;
    color: var(--text-secondary);
}

.attached-images-preview {
    position: fixed;
    bottom: 142px !important;
    left: 0;
    right: 0;
    padding: 0 24px 8px 24px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    z-index: 95;
    max-height: 240px;
    overflow-y: auto;
}

.attached-image-preview {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    box-shadow: 0 4px 12px var(--shadow);
}

.attached-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attached-image-preview .remove-image {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    transition: all 0.3s ease;
}

.attached-image-preview .remove-image:hover {
    background: #ff3b30;
    transform: scale(1.1);
}

/* Chat Input Container */
.chat-input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background:linear-gradient(to top, #111111 0%, #11111100 100%);
    z-index: 100;
    padding: 12px 12px 12px 12px;
}

/* Динамический padding-bottom в зависимости от платформы */
.platform-ios .chat-input-container {
    padding-bottom: 24px;
}

.platform-android .chat-input-container {
    padding-bottom: 12px;
}

.platform-web .chat-input-container {
    padding-bottom: 12px;
}

/* Кнопка прокрутки к началу/концу чата */
.scroll-to-btn {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(36, 36, 36, 0.8) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #e5e5e5 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 101;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin: 0;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Fallback для браузеров без backdrop-filter */
@supports not (backdrop-filter: blur(24px)) {
    .scroll-to-btn {
        background: rgba(36, 36, 36, 1);
    }
}

.scroll-to-btn.visible {
    opacity: 1;
    pointer-events: all;
}

.scroll-to-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #a855f7;
    transform: scale(1.1);
 
}

.scroll-to-btn:active {
    transform: scale(1);
}

.scroll-to-btn svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    transition: transform 0.3s ease;
    display: block;
    flex-shrink: 0;
}

.scroll-to-btn.scroll-to-top svg {
    transform: rotate(180deg);
}

.chat-input-form {
    width: 100%;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    background: rgb(36 36 36 / 80%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 4px 6px 6px 6px;
    min-height: 52px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    box-shadow: 0 0.5px 0px rgb(255 255 255 / 6%), inset 0 0.5px 0px rgba(255, 255, 255, 0.06);
}

.input-wrapper::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(to bottom right, #b8a1ff8f, #9840ebff);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.input-wrapper:focus-within::before {
    opacity: 0.15;
}

.input-wrapper:focus-within {

    transform: translateY(-2px);
}

.model-icon-btn {
    width: 102px;
    height: 38px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: start;
    border-radius: 55px;
    transition: all 0.3s 
cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    flex-shrink: 0;
    overflow: visible;
    padding: 0 10px;
    gap: 6px;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.model-icon-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 55px;
}

.model-icon-btn:hover::before {
    opacity: 1;
}

.model-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.02);
    
}

.model-icon-btn.compact {
    width: 38px;
    padding: 0;
    border-radius: 55px;
    justify-content: center;
}

.model-icon-btn.compact .model-type-label {
    display: none;
}

.model-icon-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.model-icon-btn svg path {
    fill: var(--text-secondary);
    transition: fill 0.3s ease;
}

.model-icon-btn:hover svg path {
    fill: var(--accent);
}

.model-type-label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    max-width: 80px;
    font-weight: 500;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.input-mode-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-align: center;
    margin-top: 6px;
    padding: 2px 8px;
}

.chat-input-form textarea {
    flex: 1;
    padding: 8px 4px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 200px;
    line-height: 22px;
    -webkit-text-size-adjust: 100%;
}

.chat-input-form textarea::placeholder {
    color: var(--text-tertiary);
}

.chat-input-form textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.attach-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.attach-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.attach-btn:hover::before {
    opacity: 1;
}

.attach-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.1);
   
}

.attach-btn svg {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
}

.attach-btn svg path {
    fill: var(--text-secondary);
    transition: fill 0.3s ease;
}

.attach-btn:hover svg path {
    fill: var(--accent);
}

.send-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: #FFF;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2), inset 0 1px 1px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.send-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.input-wrapper:focus-within .send-btn:not(:disabled)::before {
    transition: none;
}

.send-btn:not(:disabled):hover::before {
    left: 100%;
}

.send-btn:not(:disabled):focus {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(192, 138, 242, 0.2), 0 0 30px rgba(168, 86, 248, 0.2);
}

.send-btn:not(:disabled):active {
    transform: scale(0.95) rotate(5deg);;
}

/* Эффекты когда инпут активен и кнопка отправки тоже активна */
.input-wrapper:focus-within .send-btn:not(:disabled) {
    transform: scale(1.1) rotate(5deg);
  
}

.input-wrapper:focus-within .send-btn:not(:disabled)::before {
    animation: shimmer 0.5s ease-in-out;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: -100%;
    }
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.send-btn svg {
    width: 28px;
    height: 28px;
    position: relative;
    z-index: 1;
}

/* Model Selector Dropdown */
.model-selector-dropdown {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    background: var(--bg-tertiary);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    min-width: 220px;
    max-width: 320px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.model-selector-dropdown.show {
    display: block;
    animation: dropdownAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownAppear {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

 

.dropdown-list {
    padding: 8px;
}

.dropdown-item {
    padding: 12px 12px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    text-align: left;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dropdown-item.active {
    background: rgba(168, 85, 247, 0.2);
    color: var(--accent);
    font-weight: 600;
}

.dropdown-separator {
    padding: 12px 12px 8px 12px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

/* Sidebar Header */
.sidebar-header {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
 
}

.sidebar-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}



.sidebar-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.close-sidebar-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.1);
}

.close-sidebar-btn svg {
    color: var(--text-primary);
}

/* New Chat Button */
.new-chat-btn {
    margin: 12px 12px 0 12px;
    padding: 12px 20px;
    background: #FFF;
    border: none;
    border-radius: 55px;
    color: var(--bg-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.new-chat-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.new-chat-btn:active {
    transform: translateY(0);
}

/* Subscription Section */
.subscription-section {
    padding: 12px 12px 24px 12px;
    flex-shrink: 0;
}

.subscription-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 55px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.subscription-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border);
    transform: translateY(-1px);
}

.subscription-btn:active {
    transform: translateY(0);
}

/* Sidebar nav (список кнопок в сайдбаре, как на вебе) */
.sidebar-nav {
    padding: 2px 16px 16px;
    flex-shrink: 0;
}

.sidebar-nav-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 36px;
    padding: 9px 0;
    border: none;
    border-radius: 55px;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.sidebar-nav-item:hover {
    color: #fff;
}

.sidebar-nav-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.sidebar-nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(229, 229, 229, 1);
}

.sidebar-nav-icon svg {
    width: 18px;
    height: 18px;
}

.sidebar-nav-label {
    flex: 1;
    min-width: 0;
}

.sidebar-nav-plus-btn {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.sidebar-nav-plus-btn:hover {
    opacity: 0.9;
}

.sidebar-nav-plus-btn svg {
    width: 16px;
    height: 16px;
}

.sidebar-nav-badge {
    flex-shrink: 0;
    padding: 2px 5px;
    border-radius: 55px;
    background: rgba(121, 61, 252, 1);
    color: rgba(229, 229, 229, 1);
    font-size: 10px;
    font-weight: 400;
}

.sidebar-nav-divider {
    height: 1px;
    margin: 16px 0;
    background: rgba(255, 255, 255, 0.08);
}

/* Chats Section */
.chats-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 16px;
}

.chats-section-header {
    padding: 12px 0 8px 0;
    flex-shrink: 0;
}

.chats-section-header h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: -0.5px;
    margin: 0;
}

/* Chats List */
.chats-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 12px;
}

.chats-list::-webkit-scrollbar {
    width: 6px;
}

.chats-list::-webkit-scrollbar-track {
    background: transparent;
}

.chats-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.chats-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-item {
    padding: 2px 0px 2px 0px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-item-content {
    flex: 1;
    min-width: 0;
}

.chat-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-item-title:hover {
    color: var(--accent);
 
}

.chat-item-title:active {
    color: var(--accent);
 
}

.chat-item-delete {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-item:hover .chat-item-delete {
    opacity: 1;
}

.chat-item-delete:hover {
    background: rgba(255, 59, 48, 0.15);
}

.chat-item-delete svg {
    color: var(--text-tertiary);
}

.chat-item-delete:hover svg {
    color: #ff3b30;
}


.sidebar-user-block {
    padding: 8px 16px;
    background: var(--bg-primary);
    flex-shrink: 0;
    border-top: 1px solid var(--border);
}

.user-info-content {
    display: flex;
    align-items: center;
    gap: 12px;
  
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.copy-user-id-btn {
    width: 12px;
    height: 12px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

.copy-user-id-btn:hover {
    opacity: 1;
}

.copy-user-id-btn svg {
    width: 12px;
    height: 12px;
    color: var(--text-tertiary);
}

.user-id {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Статус подписки */
.subscription-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.subscription-status-icon:hover {
    transform: scale(1.1);
}


.subscription-status-icon .crown-icon {
    transition: all 0.3s ease;
}

.subscription-status-icon .crown-icon:hover {
    transform: scale(1.05);
}

/* Обертка для статуса подписки */
.subscription-status-wrapper {
    position: relative;
}

/* Тултип подписки в сайдбаре */
.sidebar-subscription-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    left: auto;
    transform-origin: bottom right;
    min-width: 240px;
    max-width: 280px;
    top: auto;
}

.sidebar-subscription-tooltip.show {
    transform: translateY(0) scale(1);
}

@media (max-width: 480px) {
    .sidebar-subscription-tooltip {
        right: 0;
        transform-origin: bottom left;
    }
}

/* Кнопка выхода (иконка) */
.logout-icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    opacity: 0;
}

.logout-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}

.logout-icon-btn:active {
    transform: scale(0.95);
}

.logout-icon-btn svg {
    color: #6e6e73;
}

/* Responsive - убираем все media queries для десктопа */
@media (max-width: 480px) {
    .chat-header {
        padding: 0 12px;
    }
    
    .empty-icon img {
        width: 64px;
        height: 64px;
    }
    
    .empty-state h2 {
        font-size: 20px;
    }
    
    .empty-state p {
        font-size: 14px;
    }
    
 
    
    .suggestion-chip {
        font-size: 11px;
        padding: 10px 10px;
        min-width: 104px;
        gap: 8px;
        align-items: center;
    }
    
    .chip-icon {
        width: 16px;
        height: 16px;
        color: var(--text-secondary);
    }
}

/* Paywall */
.paywall {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.paywall.show {
    opacity: 1;
    visibility: visible;
}

.paywall-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.paywall-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUpFade 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.paywall-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.paywall-close:hover {
    background: rgba(255, 59, 48, 0.2);
    transform: scale(1.1);
}

.paywall-close svg {
    color: var(--text-primary);
}

.paywall-header {
    text-align: center;
    margin-bottom: 32px;
}

.paywall-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

.paywall-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--accent), var(--gradient-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.paywall-header p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Pricing Cards */
.pricing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 32px;
}

.pricing-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.pricing-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 12px 40px rgba(168, 85, 247, 0.3);
}

.pricing-card.popular {
    border-color: var(--accent);
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.2);
}

.card-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.popular-badge {
    background: linear-gradient(135deg, var(--accent), #9333ea);
    color: white;
    border: none;
}

.save-badge {
    background: linear-gradient(135deg, #ff9500, #ff6b35);
    color: white;
    border: none;
}

.pricing-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    margin-top: 8px;
}

.card-price {
    margin-bottom: 24px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.card-price .price {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-price .period {
    font-size: 14px;
    color: var(--text-secondary);
}

.card-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    flex: 1;
}

.card-features li {
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-features li:last-child {
    border-bottom: none;
}

.card-btn {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.card-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.card-btn.primary {
    background: linear-gradient(135deg, var(--accent), #9333ea);
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.card-btn.primary:hover {
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}

.card-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.card-btn.disabled:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.06);
}

/* Промокоды */
.promocode-section {
    margin-top: 32px;
    padding-top: 24px;
}

.promocode-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.promocode-divider::before,
.promocode-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.promocode-divider span {
    padding: 0 16px;
}

.promocode-input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.promocode-input {
    flex: 1;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
}

.promocode-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.promocode-input::placeholder {
    color: var(--text-secondary);
}

.promocode-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent), #9333ea);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
    white-space: nowrap;
}

.promocode-btn:hover {
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
    transform: translateY(-2px);
}

.promocode-btn:active {
    transform: translateY(0);
}

.promocode-message {
    display: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    animation: slideDown 0.3s ease;
}

.promocode-message.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.promocode-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive для пейвола */
@media (max-width: 768px) {
    .paywall-content {
        padding: 24px 16px;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .pricing-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .paywall-header h2 {
        font-size: 24px;
    }
    
    .paywall-icon {
        font-size: 48px;
    }
}

/* Dark mode optimization */
@media (prefers-color-scheme: dark) {
    body {
        background: var(--bg-primary);
    }
}

/* Image Viewer Modal */
.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-viewer.show {
    opacity: 1;
    visibility: visible;
}

.image-viewer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.image-viewer-content {
    position: relative;
    width: 95%;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    animation: imageViewerAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes imageViewerAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.image-viewer-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.image-viewer-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.image-viewer-close svg {
    color: var(--text-primary);
}

#imageViewerImg {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.image-viewer-actions {
    margin-top: 32px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.image-viewer-save {
    padding: 12px 32px;
    background: #FFF;
    border: none;
    border-radius: 55px;
    color: var(--bg-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.image-viewer-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.image-viewer-save:active {
    transform: translateY(0);
}

.image-viewer-save svg {
    width: 20px;
    height: 20px;
}

.image-viewer-download {
    padding: 12px 32px;
    background: #FFF;
    border: none;
    border-radius: 55px;
    color: var(--bg-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.image-viewer-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.image-viewer-download:active {
    transform: translateY(0);
}

.image-viewer-download svg {
    width: 20px;
    height: 20px;
}

.image-viewer-share {
    padding: 12px 32px;
    background: #FFF;
    border: none;
    border-radius: 55px;
    color: var(--bg-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.image-viewer-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.image-viewer-share:active {
    transform: translateY(0);
}

.image-viewer-share svg {
    width: 20px;
    height: 20px;
}

.message-image {
    cursor: pointer;
    transition: all 0.3s ease;
}

.message-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Responsive для просмотра изображений */
@media (max-width: 768px) {
    .image-viewer-close {
        top: 8px;
        width: 36px;
        height: 36px;
    }
    
    #imageViewerImg {
        max-height: 75vh;
    }
    
    .image-viewer-save,
    .image-viewer-download,
    .image-viewer-share {
        padding: 12px 44px;
        font-size: 14px;
    }
}

/* Payment Modal */
.payment-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.payment-modal.show {
    opacity: 1;
    visibility: visible;
}

.payment-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.payment-modal-content {
    position: relative;
    background: #FFF;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUpFade 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.payment-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.payment-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.payment-modal-close svg {
    color: var(--text-primary);
}

.payment-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.payment-modal-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.payment-widget-container {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#payment-form {
    width: 100%;
    min-height: 400px;
}

/* Responsive для payment modal */
@media (max-width: 768px) {
    .payment-modal-content {
        width: 95%;
        padding: 24px 16px;
        max-height: 95vh;
    }
    
    .payment-modal-header h3 {
        font-size: 20px;
    }
    
    .payment-widget-container {
        min-height: 350px;
    }
}

/* Attachment Menu */
.attach-wrapper {
    position: relative;
    display: flex;
}

.attach-menu {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    background: var(--bg-tertiary);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    min-width: 160px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 1000;
}

.attach-menu.show {
    display: flex;
    animation: menuAppear 0.2s ease-out;
}

.attach-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.attach-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.attach-menu-item svg {
    color: var(--text-tertiary);
    transition: color 0.2s ease;
}

.attach-menu-item:hover svg {
    color: var(--accent);
}

/* New Paywall Styles */
.paywall-content-new {
    position: relative;
    background: #000;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 100%;
    width: 100%;
    z-index: 1001;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    animation: paywallSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes paywallSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.paywall:has(.paywall-content-new) {
    align-items: flex-end;
}

.paywall-header-img {
    height: 160px;
    background-size: cover;
    background-position: center;
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex-shrink: 0;
    border-radius: 16px 16px 0px 0px;
}

.paywall-header-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(17,17,17,1));
}

.paywall-content-new .paywall-close {
    position: sticky;
    top: 15px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(5px);
    z-index: 100;
    align-self: flex-end;
    margin: 15px 15px 0 0;
    flex-shrink: 0;
}

.paywall-title-container {
    position: relative;
    z-index: 2;
    text-align: center;
}

.paywall-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.paywall-subtitle {
    font-size: 14px;
    opacity: 0.8;
    margin: 0;
    line-height: 1.4;
    padding: 0 12px;
}

.paywall-body {
    padding: 24px;
    background: #111;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.plan-selectors {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
}

.plan-selector {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.plan-selector.selected {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.plan-selector input[type="radio"] {
    display: none;
}

.plan-selector-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.plan-selector.selected .plan-selector-check {
    background: #fff;
    border-color: #fff;
}

.check-icon {
    color: #000;
    display: none;
}

.plan-selector.selected .check-icon {
    display: block;
}

.plan-selector-info {
    flex: 1;
}

.plan-name {
    display: block;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 2px;
}

.plan-meta {
    display: block;
    font-size: 13px;
    opacity: 0.5;
}

.plan-selector-price {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.price {
    font-size: 16px;
    font-weight: 700;
}

.best-value {
    background: #5500ff;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.plan-features-header {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.plan-features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.plan-features-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.feature-icon {
    color: #fff;
    font-weight: bold;
    flex-shrink: 0;
    width: 14px;
    display: flex;
    justify-content: center;
}

.feature-text {
    opacity: 0.9;
}

/* Промокод в пейволе */
.promocode-input-container {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
}

.promocode-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.promocode-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.promocode-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.promocode-apply-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    border: none;
}

.promocode-apply-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.promocode-apply-btn:active {
    transform: scale(0.98);
}

.promocode-apply-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.promocode-message {
    margin-bottom: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    text-align: center;
    transition: all 0.3s;
}

.promocode-message.success {
    background: rgba(0, 212, 170, 0.15);
    color: #00d4aa;
    border: 1px solid rgba(0, 212, 170, 0.3);
}

.promocode-message.error {
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.promocode-message:empty {
    display: none;
}

.get-access-btn {
    background: #fff;
    color: #000;
    border: none;
    border-radius: 55px;
    padding: 14px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.1s;
    margin-bottom: 20px;
    width: 100%;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    margin-top: auto;
}


.get-access-btn:active {
    transform: scale(0.98);
}

.paywall-footer-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: auto;
    padding-bottom: 12px;
}

.paywall-footer-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}

.paywall-footer-links a:hover {
    color: #fff;
}

.paywall-tokens-note {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
    padding-bottom: 16px;
}

.tokens-note-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tokens-note-list li {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
    padding-left: 12px;
    position: relative;
}

.tokens-note-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: rgba(255, 255, 255, 0.3);
}

@media (min-width: 768px) {
    .paywall:has(.paywall-content-new) {
        align-items: center;
    }
    .paywall-content-new {
        max-width: 400px;
        max-height: 100%;
    }
}

/* ========== ВИДЕО ЭКРАН ========== */
.video-container {
    display: block;
    height: calc(100vh - 0px);
    overflow-y: auto;
    padding: 64px 16px 24px 16px;
}

.video-list-container {
    padding: 0;
}

.video-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.video-list-sentinel {
    grid-column: 1 / -1;
    height: 1px;
    visibility: hidden;
    pointer-events: none;
}

.empty-video-list {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-tertiary);
    font-size: 14px;
}

.video-card {
    background: var(--bg-tertiary);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.video-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    background: var(--bg-tertiary);
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
}

.video-card-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-card-thumb-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2;
    transition: opacity 0.2s ease;
}

.video-card-thumb-loader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.video-card-thumb-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.video-card-play-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 3;
}

.video-card-thumb:hover .video-card-play-icon,
.video-card-thumb:focus-within .video-card-play-icon {
    opacity: 0.9;
}

.video-card-icon-play,
.video-card-icon-pause {
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-card-icon-pause {
    display: none;
}
.video-card-thumb.is-playing .video-card-icon-play {
    display: none;
}
.video-card-thumb.is-playing .video-card-icon-pause {
    display: flex;
}

.video-card-play-icon svg {
    width: 20px;
    height: 20px;
}
.video-card-icon-play svg {
    margin-left: 2px;
}

.video-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.video-card-placeholder--processing .spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.video-card-placeholder--error {
    color: var(--text-tertiary);
}

.video-card-placeholder--error svg,
.video-card-load-error svg {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.video-card-placeholder--error .video-card-placeholder-text,
.video-card-load-error .video-card-placeholder-text {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
    max-width: 90%;
    color: var(--text-tertiary);
}

.video-card-load-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    font-size: 13px;
}

.video-card-placeholder--no-preview svg {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.video-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    min-height: 44px;
}

.video-card-model {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.video-card-download {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-card-download svg {
    width: 24px;
    height: 24px;
}

.video-card-download:hover {
    opacity: 0.9;
}

.video-card-download:active {
    transform: scale(0.98);
}

.video-item {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 16px;
}

.video-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.video-item-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
}

.video-item-prompt {
    margin: 4px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.video-item-date {
    font-size: 12px;
    color: var(--text-tertiary);
}

.video-item-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.video-item-status.processing {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.video-item-status.completed {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.video-item-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.video-share-btn {
    padding: 6px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #ffffff;
    color: var(--bg-primary);
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    white-space: nowrap;
}

.video-share-btn:active {
    opacity: 0.8;
    transform: scale(0.98);
}

.video-item-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.video-item-player {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    margin-top: 12px;
}

.video-processing {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    gap: 12px;
}

.video-processing .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.video-processing p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

.video-error {
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #f87171;
    font-size: 14px;
}

.video-error-with-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 16px;
    color: var(--text-tertiary);
}

.video-error-with-icon svg {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.video-error-text,
.video-load-error .video-error-text {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
    max-width: 90%;
    color: var(--text-tertiary);
}

.video-item-media-wrap {
    position: relative;
    width: 100%;
}

.video-load-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    padding: 16px;
}

.video-load-error svg {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.image-preview {
    position: relative;
    display: inline-block;
    margin-top: 8px;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid var(--border);
}

.image-preview .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 640px) {
    .video-container {
        padding: 44px 8px 8px 8px;
    }
    
    .video-list-container {
        padding: 16px 6px;
    }
}

.video-options-container {
    display: none;
    gap: 24px;
    margin-top: 8px;
    width: 100%;
    padding: 0 8px;
}

.video-option-group {
    flex: 1;
    min-width: 0;
}

.video-option-group label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.video-option-group select {
    width: 100%;
    height: 24px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    padding: 0 12px;
    font-size: 12px;
}

/* Animate Photo Modal (Figma) */
.animate-photo-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
.animate-photo-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.animate-photo-content {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #1b1b1b;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 48px rgba(0,0,0,0.4);
    overflow: hidden;
}
.animate-photo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 24px 16px 24px;
    flex-shrink: 0;
}
.animate-photo-title { margin: 0; font-size: 14px; font-weight: 500; color: #fff; }
.animate-photo-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: background 0.2s;
}
.animate-photo-close:hover { background: rgba(255, 255, 255, 0.25); }
.animate-photo-body {
    padding: 0 16px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.animate-photo-upload {
    position: relative;
    min-height: 200px;
    border-radius: 16px;
    background: #252525;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
}
.animate-photo-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: #6e6e73;
    font-size: 14px;
    font-weight: 400;
    text-align: center;
}
.animate-photo-upload-icon { flex-shrink: 0; }
.animate-photo-media-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #252525;
}
.animate-photo-preview { width: 100%; height: 100%; object-fit: contain; display: block; }
.animate-photo-video { width: 100%; height: 100%; object-fit: contain; display: block; }
.animate-photo-play-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.35); cursor: pointer; }
.animate-photo-play-icon { width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,0.95); color: #101010; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 24px rgba(0,0,0,0.3); }
.animate-photo-play-icon svg { width: 40px; height: 40px; margin-left: 4px; }
.animate-photo-loader {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
    border-radius: 16px;
}
.animate-photo-spinner {
    width: 48px; height: 48px;
    border: 3px solid var(--border); border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.animate-photo-prompts {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
    justify-content: center;
}
.animate-photo-prompt-chip {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    padding: 0;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #252525;
    color: #6e6e73;
    font-size: 11px;
    line-height: 1.2;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}
.animate-photo-prompt-chip img { width: 100%; height: 100%; object-fit: cover; }
.animate-photo-prompt-chip:hover { border-color: rgba(255, 255, 255, 0.2); color: #fff; }
.animate-photo-prompt-label { padding: 4px; }
.animate-photo-input-row {
    flex-shrink: 0;
    padding: 0 16px 16px;
}
.animate-photo-input-wrap {
    position: relative;
    height: 112px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #252525;
    overflow: hidden;
}
.animate-photo-input {
    position: absolute;
    left: 16px;
    right: 56px;
    top: 16px;
    bottom: 16px;
    width: calc(100% - 72px);
    height: calc(100% - 32px);
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 14px;
    outline: none;
    resize: none;
    overflow-y: auto;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.animate-photo-input::placeholder { color: #6e6e73; }
.animate-photo-submit-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #000;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
}
.animate-photo-submit-btn:hover:not(:disabled) { opacity: 0.9; }
.animate-photo-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.animate-photo-submit-btn svg { width: 28px; height: 28px; }
.animate-photo-actions {
    flex-shrink: 0;
    display: flex;
    gap: 12px;
    padding: 0 16px 16px;
}
.animate-photo-action-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, background 0.2s;
}
.animate-photo-action-btn:first-child { background: var(--accent); color: #fff; }
.animate-photo-action-btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); }
.animate-photo-action-btn:hover { opacity: 0.9; }
@media (max-width: 480px) {
    .animate-photo-modal { padding: 12px; align-items: center; justify-content: center; }
    .animate-photo-content { max-height: 85vh; border-radius: 20px; }
    .animate-photo-body { padding: 0 16px; flex: 1; min-height: 0; overflow-y: auto; }
    .animate-photo-upload { min-height: 180px; }
    .animate-photo-input-row { flex-shrink: 0; }
}

 
.edit-photo-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
.edit-photo-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.edit-photo-content { position: relative; width: 100%; max-width: 440px; max-height: 90vh; display: flex; flex-direction: column; background: #1b1b1b; border-radius: 20px; border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 24px 48px rgba(0,0,0,0.4); overflow: hidden; }
.edit-photo-header { display: flex; align-items: center; justify-content: center; position: relative; padding: 24px 16px 24px; flex-shrink: 0; }
.edit-photo-title { margin: 0; font-size: 14px; font-weight: 500; color: #fff; }
.edit-photo-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; padding: 0; border: none; border-radius: 16px; background: rgba(255,255,255,0.15); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.edit-photo-close:hover { background: rgba(255,255,255,0.25); }
.edit-photo-body { padding: 0 16px; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.edit-photo-upload { position: relative; min-height: 200px; border-radius: 16px; background: #252525; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; flex-shrink: 0; }
.edit-photo-upload-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; color: #6e6e73; font-size: 14px; font-weight: 400; text-align: center; }
.edit-photo-upload-icon { flex-shrink: 0; }
.edit-photo-media-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #252525; }
.edit-photo-preview, .edit-photo-result { width: 100%; height: 100%; object-fit: contain; display: block; }
.edit-photo-loader { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); border-radius: 16px; }
.edit-photo-spinner { width: 48px; height: 48px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.edit-photo-prompts-wrap { position: relative; display: flex; align-items: center; gap: 0; flex-shrink: 0; padding-bottom: 16px; }
.edit-photo-prompts-arrow { display: none; }
.edit-photo-prompts { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; overflow-y: hidden; padding: 0 4px; -webkit-overflow-scrolling: touch; flex: 1; min-width: 0; align-items: center; scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; }
.edit-photo-prompts::-webkit-scrollbar { display: none; }
.edit-photo-prompt-chip { flex-shrink: 0; width: 64px; height: 64px; padding: 0; border-radius: 16px; border: 1px solid rgba(255,255,255,0.08); background: #252525; color: #6e6e73; font-size: 11px; line-height: 1.2; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.edit-photo-prompt-chip-icon { padding: 6px 4px; }
.edit-photo-prompt-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.edit-photo-prompt-icon svg { width: 28px; height: 28px; }
.edit-photo-prompt-label { padding: 2px 0 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-photo-prompt-chip img { width: 100%; height: 100%; object-fit: cover; }
.edit-photo-prompt-chip-preview { padding: 0; }
.edit-photo-prompt-chip-preview img { display: block; }
.edit-photo-prompt-chip:hover { border-color: rgba(255,255,255,0.2); color: #fff; }
.edit-photo-prompts-divider { flex-shrink: 0; width: 1px; height: 64px; background: rgba(255,255,255,0.08); margin: 0 4px; }
.edit-photo-input-row { flex-shrink: 0; padding: 0 16px 16px; }
.edit-photo-input-wrap { position: relative; height: 112px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.08); background: #252525; overflow: hidden; }
.edit-photo-input { position: absolute; left: 16px; right: 56px; top: 16px; bottom: 16px; width: calc(100% - 72px); height: calc(100% - 32px); padding: 0; border: none; background: transparent; color: #fff; font-size: 14px; line-height: 1.4; outline: none; resize: none; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; overflow-y: auto; }
.edit-photo-input::placeholder { color: #6e6e73; }
.edit-photo-submit-btn { position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 50%; border: none; background: #fff; color: #000; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.edit-photo-submit-btn:hover:not(:disabled) { opacity: 0.9; }
.edit-photo-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.edit-photo-submit-btn svg { width: 28px; height: 28px; }
.edit-photo-actions { flex-shrink: 0; display: flex; gap: 12px; padding: 0 16px 16px; }
.edit-photo-action-btn { flex: 1; padding: 12px 20px; border-radius: 55px; border: none; font-size: 14px;  letter-spacing: -0.3px; font-weight: 500; cursor: pointer; transition: opacity 0.2s, background 0.2s; }
.edit-photo-action-btn:first-child { background: #fff; color: var(--bg-tertiary); }
.edit-photo-action-btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); }
.edit-photo-action-btn:hover { opacity: 0.9; }
@media (max-width: 480px) {
    .edit-photo-modal { padding: 12px; align-items: center; justify-content: center; }
    .edit-photo-content { max-height: 85vh; border-radius: 20px; }
    .edit-photo-body { padding: 0 16px; flex: 1; min-height: 0; overflow-y: auto; }
    .edit-photo-upload { min-height: 180px; }
    .edit-photo-input-row { flex-shrink: 0; }
}
