:root {
            --bg-color: #f0f2f5;
            --app-bg: #f9fbfd;
            --panel-bg: #ffffff;
            --text-main: #2c3e50;
            --text-muted: #7f8c8d;
            --primary: #3498db;
            --msg-user: #e3f2fd;
            --msg-bot: #ffffff;
            --border-radius-large: 24px;
            --app-height: 100vh;
        }

        html, body { margin: 0; padding: 0; height: 100%; }

        body {
            font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            background-color: var(--bg-color);
            color: var(--text-main);
            display: flex;
            justify-content: center;
            height: var(--app-height);
            overflow: hidden;
            font-size: 16px;
            position: fixed;
            width: 100%;
            top: 0;
            left: 0;
        }

        .app-wrapper {
            width: 100%;
            max-width: 450px;
            height: var(--app-height);
            background-color: var(--app-bg);
            position: relative;
            display: flex;
            flex-direction: column;
            box-shadow: 0 0 30px rgba(0,0,0,0.1);
            overflow: hidden;
        }

        .backdrop {
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.45);
            backdrop-filter: blur(2px);
            z-index: 105;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s ease, visibility 0.3s ease;
            pointer-events: none;
        }

        .backdrop.active { opacity: 1; visibility: visible; pointer-events: auto; }
 
        .header {
            padding-top: calc(8px + env(safe-area-inset-top));
            display: flex;
            align-items: center;
            gap: 12px;
            position: absolute;
            top: 0; left: 0; right: 0;
            z-index: 110;
            background: #ffffff82;
            border-radius: 0 0 24px 24px;
            padding: 6px 12px 6px 12px;
        }

        .circle-btn {
            width: 50px; height: 50px;
            border-radius: 50%;
            background-color: #f0f4f8;
            border: 1px solid #e1e8ed;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer;
            color: var(--text-main);
            flex-shrink: 0;
            padding: 0;
            transition: background 0.2s, transform 0.1s;
            box-sizing: border-box;
            box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        }

        .circle-btn:active { background: #e2e8f0; transform: scale(0.95); }

        .profile-pill {
            flex: 1;
            display: flex; align-items: center; gap: 12px;
            height: 50px;
            padding: 0 16px 0 4px;
            background-color: #f0f4f8;
            border-radius: 25px;
            border: 1px solid #e1e8ed;
            cursor: pointer;
            box-sizing: border-box;
            box-shadow: 0 2px 8px rgba(0,0,0,0.04);
            transition: background 0.2s, transform 0.1s;
            min-width: 0;
        }

        .profile-pill:active { background: #e2e8f0; transform: scale(0.98); }

        .profile-info { display: flex; flex-direction: column; min-width: 0; justify-content: center; }
        .profile-name { font-weight: 600; font-size: 1.15rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .profile-sub { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

        .gemini-icon {
            width: 42px; height: 42px;
            background: linear-gradient(135deg, #a8c0ff, #3f2b96);
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            color: white;
            overflow: hidden;
            flex-shrink: 0;
            position: relative;
        }

        .gemini-icon-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
        .gemini-icon-fallback { display: none; }

        .dropdown {
            position: absolute;
            top: 75px;
            background: var(--panel-bg);
            border-radius: 16px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.15);
            padding: 8px 0;
            width: 270px;
            z-index: 110;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px);
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        }

        .dropdown.active { opacity: 1; visibility: visible; }
        .dropdown-left { left: 12px; }
        .dropdown-right { right: 12px; }
        .dropdown-center { left: 50%; transform: translateX(-50%) translateY(-10px); }
        .dropdown-center.active {}

        .menu-item {
            display: flex; align-items: center; gap: 12px;
            padding: 8px 20px;
            cursor: pointer;
            font-size: 1rem;
            color: var(--text-main);
            transition: background 0.2s;
            margin: 6px 8px;
            border-radius: 6px;
            text-decoration:none;
        }
        .menu-item:hover, .menu-item:active { background: #f5f7fa; color: #007aff; }
        .menu-item svg { flex-shrink: 0; width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
        .menu-divider { height: 1px; background: #eee; margin: 5px 0; }

        /* ===== НОВЫЙ БЛОК ПАКЕТА (ВМЕСТО БАЛАНСА) ===== */
        .package-widget {
            margin: 8px 16px 12px;
            padding: 16px 16px 20px;
            background: linear-gradient(135deg, #ffffff, #f8fbfd);
            border-radius: 16px;
            display: flex;
            flex-direction: column;
            align-items: center;
            border: 1px solid #e1e8ed;
            box-shadow: 0 6px 20px rgba(0,0,0,0.04);
        }

        .package-avatar {
            width: 100px;
            height: 100px;
            border-radius: 50%;
			background: white;
            padding: 3px;
            margin-bottom: 12px;
            box-shadow: 0 4px 12px rgba(63, 43, 150, 0.2);
        }

        .package-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
            background-color: var(--panel-bg);
        }

        .package-subtitle {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.8px;
            font-weight: 600;
            margin-bottom: 2px;
        }

        .package-title {
            font-size: 1.25rem;
            font-weight: 800;
            color: var(--text-main);
            margin-bottom: 8px;
            background: linear-gradient(135deg, #3f2b96, #3498db);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .package-dates {
            font-size: 0.8rem;
            color: var(--text-muted);
            background-color: #f0f4f8;
            padding: 4px 12px;
            border-radius: 20px;
            margin-bottom: 16px;
            font-weight: 500;
        }

        .package-stats {
            width: 90%;
            background-color: #ffffff;
            border: 1px solid #f0f4f8;
            padding: 12px;
            border-radius: 12px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.02);
        }

        .package-stats-row {
            display: flex;
            justify-content: space-between;
            font-size: 14px;
            margin-bottom: 8px;
        }

        .package-stats-label { color: var(--text-muted); font-weight: 500; }
        .package-stats-val { color: var(--text-main); font-weight: 700; }

        .package-progress-bg {
            width: 100%;
            height: 6px;
            background-color: #e2e8f0;
            border-radius: 3px;
            overflow: hidden;
        }

        .package-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #3498db, #a8c0ff);
            width: 10%; /* Здесь будет % использованных нейронов (50 из 500 = 10%) */
            border-radius: 3px;
        }
        /* ===== КОНЕЦ НОВОГО БЛОКА ===== */

        .bot-hero { padding: 16px 20px 8px; display: flex; flex-direction: column; align-items: center; text-align: center; }
        .bot-hero-avatar {
            width: 100px; height: 100px;
            border-radius: 50%;
            background: white;
            padding: 3px;
            box-shadow: 0 4px 12px rgba(63, 43, 150, 0.2);
            margin-bottom: 12px;
        }
        .bot-hero-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid white; box-sizing: border-box; background: var(--panel-bg); }
        .bot-hero-name { font-size: 1.25rem; font-weight: 700; color: var(--text-main); margin-bottom: 2px; }
        .bot-hero-sub { font-size: 0.9rem; color: var(--text-muted); }

        .chat-container {
            flex: 1;
            padding: 80px 15px 110px 20px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 16px;
            -webkit-overflow-scrolling: touch;
        }

        .msg {
            max-width: 85%;
            border-radius: 20px;
            line-height: 1.5;
            position: relative;
        }
         p{margin: 12px 0;}
         .bot_answer{margin-bottom: -6px; overflow: auto;}
        .msg-user { background-color: var(--msg-user); align-self: flex-end; border-bottom-right-radius: 3px; padding: 6px 12px 6px 12px;}
        .msg-bot { background-color: var(--msg-bot); align-self: flex-start; border-top-left-radius: 3px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); border: 1px solid #edf2f7; padding: 6px 12px 6px 12px;}

        .msg img { cursor: pointer; border-radius: 12px; transition: opacity 0.15s ease; }
        .msg img:active { opacity: 0.85; }

.msg img,
.lightbox-overlay img,
.lightbox-close {
    -webkit-tap-highlight-color: transparent; 
    -webkit-touch-callout: none;              
    user-select: none;                       
    outline: none;                            
}

        .footer {
            position: absolute;
            bottom: 0; left: 0; right: 0;
            background-color: var(--panel-bg);
            border-radius: var(--border-radius-large) var(--border-radius-large) 0 0;
            box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
            padding: 12px 20px 0 20px;
            padding-bottom: calc(6px + env(safe-area-inset-bottom));
            z-index: 100;
        }

        .input-area { padding: 0 16px; }

        .chat-input {
            width: 100%;
            border: none;
            background: transparent;
            font-size: 1rem;
            outline: none;
            resize: none;
            font-family: inherit;
            color: var(--text-main);
            overflow-y: hidden;
            max-height: 120px;
            line-height: 1.4;
            min-height: 24px;
            display: block;
        }
        .chat-input::placeholder { color: #a0aebc; }
        
.code-container {
    position: relative;
    background: #000000;
    border-radius: 12px;
    margin: 10px 0;
}

.code-container::before {
    content: "code";
    position: absolute;
    top: 10px;
    left: 14px;
    font-size: 11px;
    color: white;
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.msg-code {
    max-height: 180px;
    padding: 38px 12px 16px 12px;
    overflow-y: auto;
    overflow-x: auto;
    display: block;
    background: transparent;
    color: gold;
    font-size: 14px;
    scrollbar-width: thin;
    scrollbar-color: gold #1a1a1a;
} 

.msg-code::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.msg-code::-webkit-scrollbar-thumb {
    background: gold;
    border-radius: 3px;
}
        
        .controls {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-top: 6px;
        }
        
        .controls-left{
        display: flex;
        align-items: center;
        gap: 6px;
        }

        .btn-icon {
            background: transparent;
            border: none;
            padding: 8px;
            cursor: pointer;
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            transition: background 0.2s;
        }
        .btn-icon:active { background: #e2e6ea; }
        .btn-icon svg { width: 24px; height: 24px; fill: var(--text-muted); }
        .btn-send svg { fill: var(--primary); }
        .controls-right { display: flex; gap: 8px; }

.btn-icon2 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--border-radius-large);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    user-select: none;
}

.btn-icon2:hover {
    background: var(--bg-color);
    color: var(--text-main);
}

.btn-mode {
    background: var(--bg-color);
    border: 1px solid transparent;
    border-radius: var(--border-radius-large);
    padding: 0 12px;
    height: 32px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-mode:hover {
    background: var(--bg-color);
    color: var(--text-main);
}

.btn-mode svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-mode.active {
    background: var(--msg-user);
    color: var(--primary);
    border-color: rgba(52, 152, 219, 0.3);
    font-weight: 600;
}

.btn-mode.active svg {
    stroke: var(--primary);
}


        ::-webkit-scrollbar { width: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: #dcdde1; border-radius: 3px; }

        /* ===== LIGHTBOX ===== */
        .lightbox-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.92);
            z-index: 9999;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            visibility: hidden;
            overflow: hidden;
            touch-action: none;
        }

        .lightbox-overlay.active { opacity: 1; visibility: visible; }

        .lightbox-overlay img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            display: block;
            transform: translate(0px, 0px) scale(1);
            transition: transform 0.25s ease;
            touch-action: none;
            -webkit-user-select: none;
            user-select: none;
            cursor: pointer; 
        }

.lightbox-close {
            position: absolute;
            top: 20px;
            top: calc(20px + env(safe-area-inset-top));
            right: 20px;
            width: 44px;
            height: 44px;
            background: rgba(255, 255, 255, 0.15);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            backdrop-filter: blur(4px);
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            -webkit-user-select: none;
            user-select: none;
        }

        .lightbox-close svg {
            width: 24px;
            height: 24px;
            fill: #ffffff;
            transition: transform 0.3s ease;
        }

        .lightbox-close:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.1);
            box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
        }

        .lightbox-close:hover svg {
            transform: rotate(90deg);
        }

        .lightbox-close:active {
            transform: scale(0.95);
        }
        
        
.login-prompt {
    position: absolute;
    bottom: calc(100% + 16px); 
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary);
    color: var(--msg-bot);
    padding: 10px 24px;
    border-radius: var(--border-radius-large);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.35);
    z-index: 101;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.login-prompt:hover {
    background-color: #2980b9;
    transform: translateX(-50%) translateY(-2px);
}

.image-preview-container {
    display: none;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 8px;
    max-width: 100%;
}

.image-preview-item {
    cursor:pointer;
    position: relative;
    flex: 0 0 75px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .remove-file {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    z-index:10;
}

.msg-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.neiro-img{max-width: 100%; border-radius: 8px; display: block; margin-top: 8px;}

.msg-img {
    display: block;
    width: 80px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.msg-cost {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    font-size: 11px;
    color: #8a8a8e;
    margin-top: 2px;
    user-select: none;
    opacity: 0.85;
}
.msg-cost > span:only-child {
    margin-left: auto;
}

.btn-send:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.dots-loader {
display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px 12px 14px;
    margin: 8px auto;
    width: fit-content;
    overflow: hidden;
}

.dots-loader span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #e2e8f0;
  box-shadow: none;
  animation: pulseDot 1.2s infinite ease-in-out;
}

.dots-loader span:nth-child(1) {
  animation-delay: 0s;
}

.dots-loader span:nth-child(2) {
  animation-delay: 0.2s;
}

.dots-loader span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulseDot {
  0%, 100% {
    background-color: #e2e8f0;
    transform: scale(1);
  }
  33% {
    background-color: var(--primary, #3498db);
    transform: scale(1.3);
  }
}

.language-php {
background: #111;
    color: #fff;
    padding: 8px;
    border-radius: 6px;
    position: relative;
    font-size: 13px;
    max-height: 500px;
    display: block;
    overflow: auto;
}

.language-php::-webkit-scrollbar {
    width: 6px;
    height: 6px;
} 
.language-php::-webkit-scrollbar-track {
    background: transparent;
}

.copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgb(0 0 0);
    color: #fff;
    border: 1px solid rgb(255 255 255);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.2s;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.copy-code-btn.copied {
    background: var(--primary);
    border-color: var(--primary);
}

.chat-bold {
    font-weight: 600;
}

  .chat-settings-container {
    width: 100%;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  }

  .settings-pane-header {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
  }

  .settings-group {
    background-color: var(--panel-bg);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
  }

  .settings-label {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-main);
  }

  .settings-input {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    background-color: var(--app-bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease;
  }

  .settings-input:focus {
    border-color: var(--primary);
  }

  .theme-image-preview {
    width: 100%;
    aspect-ratio: 3 / 4;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 4px;
  }

  .theme-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  .theme-option {
    position: relative;
    cursor: pointer;
  }

  .theme-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
  }

  .theme-swatch {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    display: block;
    transition: transform 0.2s ease, border-color 0.2s ease;
  }

  .theme-option input:checked + .theme-swatch {
    border-color: var(--primary);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
  }

  .settings-submit-btn {
    height: 44px;
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 8px;
  }

  .settings-submit-btn:hover {
    opacity: 0.9;
  }

  .chat-back-btn {
    height: 36px;
    padding: 0 12px;
    background-color: var(--panel-bg);
    color: var(--text-main);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
  }

  .chat-back-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
  }

  .chat-back-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
  }

  .chats-notice {
    background-color: rgba(52, 152, 219, 0.08);
    border: 1px solid rgba(52, 152, 219, 0.2);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
  }

  .chats-notice svg {
    width: 22px;
    height: 22px;
    fill: var(--primary);
    flex-shrink: 0;
  }

  .pro-list-group {
    background-color: var(--panel-bg, #ffffff);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
  }

  .pro-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    user-select: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    text-decoration:none;
  }

  .pro-list-item:last-child {
    border-bottom: none;
  }

  .pro-list-item:hover {
    background-color: rgba(0, 0, 0, 0.015);
  }

  .pro-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .pro-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
  }

  .pro-item-icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
  }

  .pro-switch {
    appearance: none;
    width: 38px;
    height: 22px;
    background-color: rgba(0, 0, 0, 0.12);
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s ease;
    margin: 0;
  }

  .pro-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
  }

  .pro-switch:checked {
    background-color: var(--primary);
  }
  .pro-switch:checked::after {
    transform: translateX(16px);
  }

  .pro-switch-danger:checked {
    background-color: #d93838;
  }
  
    .input-area { position: relative; } 
    
    .voice-indicator {
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 13px;
        display: none; 
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
        z-index: 10;
        pointer-events: none;
    }

    .pulse-dot {
        width: 10px; height: 10px;
        background: #ff4444;
        border-radius: 50%;
        animation: pulse-red 1.5s infinite;
    }

    .btn-icon.recording svg {
        fill: #007bff; 
    }

    @keyframes pulse-red {
        0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7); }
        70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 68, 68, 0); }
        100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 68, 68, 0); }
    }
    
    .preview-item {
        position: relative;
        display: inline-block;
        width: 70px;
        height: 70px;
        border-radius: 8px;
        overflow: hidden;
        margin-right: 8px;
        vertical-align: middle;
    }

    .preview-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .remove-btn {
        position: absolute;
        top: 4px;
        right: 4px;
        z-index: 10;
        width: 20px;
        height: 20px;
        background: rgba(0, 0, 0, 0.6);
        color: #fff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 12px;
        line-height: 1;
        transition: background 0.2s ease;
    }

    .remove-btn:hover {
        background: rgba(0, 0, 0, 0.85);
    }

    .upload-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 4;
    }

    .spinner-icon {
        width: 22px;
        height: 22px;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-top-color: #ffffff;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }

    .error-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.65);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 5;
    }

    .error-badge {
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    background: #000000d4;
    padding: 2px 6px;
    border-radius: 4px;
    }

    @keyframes spin { 
        100% { transform: rotate(360deg); } 
    }
    
.new-img {
    width: 250px; 
    display: block; 
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite ease-in-out;
    margin: 8px 0 14px 0;
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.create-container {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    flex-direction: column;
}

#photo-btn, #video-btn {
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none; /* чтобы на iPhone не вылезало системное меню при зажатии */
}