* { margin: 0; padding: 0; box-sizing: border-box; }
html { width: 100%; max-width: 100%; overflow-x: hidden; }

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-tertiary: #242836;
    --bg-hover: #2d3245;
    --accent: #6c5ce7;
    --accent-hover: #7d6ff0;
    --accent-glow: rgba(108, 92, 231, 0.25);
    --text-primary: #e8e9ed;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border: #2d3245;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ========== Buttons ========== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border: none; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: var(--transition); gap: 8px;
}
.btn-primary {
    background: var(--accent); color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-outline {
    background: transparent; color: var(--accent);
    border: 1.5px solid var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-ghost {
    background: transparent; color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-full { width: 100%; }

/* ========== Inputs ========== */
.input {
    width: 100%; padding: 10px 14px;
    background: var(--bg-tertiary); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-family: inherit; font-size: 14px;
    transition: var(--transition); outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input::placeholder { color: var(--text-muted); }

/* ========== Auth Page ========== */
.auth-container {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 20px;
}
.auth-card {
    width: 100%; max-width: 400px; padding: 40px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius);
}
.auth-card h1 {
    font-size: 24px; font-weight: 700; margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-card p { color: var(--text-secondary); margin-bottom: 28px; font-size: 14px; }
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; margin-bottom: 6px;
    font-size: 13px; font-weight: 500; color: var(--text-secondary);
}
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.error-msg { color: var(--danger); font-size: 13px; margin-bottom: 12px; display: none; }

/* ========== Dashboard ========== */
.dashboard {
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    height: 100vh;
    overflow: hidden;
}

/* --- Left Sidebar (Chats) --- */
.sidebar-left {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 16px;
    min-height: 0;
    overflow: hidden;
}
.sidebar-left h2 {
    font-size: 14px; font-weight: 600;
    color: var(--text-secondary); text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 12px;
}
.chat-list {
    flex: 1; overflow-y: auto;
    display: flex; flex-direction: column; gap: 4px;
    min-height: 0;
}
.sidebar-left-bottom {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.report-bug-widget {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.report-bug-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.report-bug-panel[hidden] { display: none !important; }
.report-bug-btn {
    min-height: 42px;
}
.report-bug-textarea {
    width: 100%;
    min-height: 88px;
    resize: vertical;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.45;
    outline: none;
}
.report-bug-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.report-bug-textarea::placeholder {
    color: var(--text-muted);
}
.report-bug-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.report-bug-status {
    min-height: 1.2em;
    font-size: 12px;
    color: var(--text-secondary);
}
.report-bug-status.success { color: var(--success); }
.report-bug-status.error { color: var(--danger); }
.report-bug-send-btn {
    padding: 8px 12px;
    min-height: 34px;
    flex-shrink: 0;
}
.chat-item {
    padding: 10px 12px; border-radius: var(--radius-sm);
    cursor: pointer; transition: var(--transition);
    font-size: 14px; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: space-between; gap: 4px;
}
.chat-title {
    flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0;
}
.chat-actions {
    flex-shrink: 0; gap: 2px; opacity: 0;
    transition: var(--transition);
    display: flex; position: relative; z-index: 2;
}
.chat-rename, .chat-delete {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 16px; padding: 4px 6px; border-radius: 4px;
    transition: var(--transition); line-height: 1;
}
.chat-item:hover .chat-actions { opacity: 1; }
.chat-rename:hover { color: var(--accent); background: rgba(124, 58, 237, 0.15); }
.chat-delete:hover { color: var(--danger); background: rgba(239, 68, 68, 0.15); }
.chat-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.chat-item.active { background: var(--accent); color: #fff; }
.chat-item.active .chat-actions { opacity: 1; }
.chat-item.active .chat-rename, .chat-item.active .chat-delete { color: rgba(255,255,255,0.6); }
.chat-item.active .chat-rename:hover { color: #fff; background: rgba(255,255,255,0.15); }
.chat-item.active .chat-delete:hover { color: #fff; background: rgba(255,255,255,0.15); }

/* --- Chat Area --- */
.chat-area {
    display: flex; flex-direction: column;
    background: var(--bg-primary);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}
.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 16px; font-weight: 600;
    display: flex; align-items: center; gap: 10px;
}
.chat-header .logo-icon {
    width: 28px; height: 28px; border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}
.messages {
    flex: 1; overflow-y: auto;
    padding: 24px; display: flex; flex-direction: column; gap: 16px;
    min-height: 0;
}
.message {
    max-width: 75%; padding: 12px 16px;
    border-radius: var(--radius); font-size: 14px;
    line-height: 1.6; animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.message.user {
    align-self: flex-end;
    background: var(--accent); color: #fff;
    border-bottom-right-radius: 4px;
}
.message.assistant {
    align-self: flex-start;
    background: var(--bg-secondary); color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}
.message-content {
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.message-content > :first-child { margin-top: 0; }
.message-content > :last-child { margin-bottom: 0; }
.message-content p { margin: 0 0 0.85em; }
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.1em 0 0.5em;
    line-height: 1.3;
}
.message-content h1:first-child,
.message-content h2:first-child,
.message-content h3:first-child,
.message-content h4:first-child { margin-top: 0; }
.message-content ol,
.message-content ul {
    margin: 0.35em 0 0.85em;
    padding-left: 1.35em;
}
.message-content li { margin: 0.35em 0; padding-left: 0.15em; }
.message-content li > p { margin: 0.25em 0; }
.message-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.message-content a:hover { opacity: 0.9; }
.message-content code {
    font-family: ui-monospace, monospace;
    font-size: 0.9em;
    background: var(--bg-tertiary);
    padding: 0.12em 0.4em;
    border-radius: 4px;
}
.message-content pre {
    background: var(--bg-tertiary);
    padding: 10px 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0.65em 0;
    font-size: 13px;
    line-height: 1.45;
}
.message-content pre code { padding: 0; background: none; }
.message-content blockquote {
    margin: 0.65em 0;
    padding-left: 12px;
    border-left: 3px solid var(--accent);
    color: var(--text-secondary);
}
.message-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1em 0;
}
.message-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.65em 0;
    font-size: 13px;
}
.message-content th,
.message-content td {
    border: 1px solid var(--border);
    padding: 6px 10px;
    text-align: left;
}
.message-content th { background: var(--bg-tertiary); font-weight: 600; }
.chat-input-area {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex; gap: 10px;
}
.chat-input-area .input { flex: 1; }
.empty-state {
    flex: 1; display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 12px; color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; opacity: 0.5; }

/* --- Right Sidebar (Profile) --- */
.sidebar-right {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 20px;
    min-height: 0;
    overflow-y: auto;
}
.profile-section { margin-bottom: 24px; }
.profile-section h3 {
    font-size: 13px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.profile-email {
    font-size: 14px; font-weight: 500; color: var(--text-primary);
    padding: 10px 12px; background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}
.stat-grid { display: flex; flex-direction: column; gap: 8px; }
.stat-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 12px; background: var(--bg-tertiary);
    border-radius: var(--radius-sm); font-size: 13px;
}
.stat-item .label { color: var(--text-secondary); }
.stat-item .value { font-weight: 600; color: var(--text-primary); }
.stat-item .value.warn { color: var(--warning); }
.stat-item .value.danger { color: var(--danger); }
.plan-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px;
}
.plan-badge.free { background: rgba(107, 114, 128, 0.2); color: var(--text-secondary); }
.plan-badge.basic { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.plan-badge.pro { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }

/* ========== Format converter (dashboard) ========== */
.converter-block {
    padding-bottom: 8px;
}
.converter-intro {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.45;
}
.converter-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
    margin-top: 10px;
}
.converter-label:first-of-type { margin-top: 0; }
.converter-select {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}
.converter-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.converter-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.4;
    min-height: 2.8em;
}
#conv-open-btn { margin-top: 14px; }
.export-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.export-actions .btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
}
.modal-overlay[hidden] { display: none !important; }
.modal-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.modal-box h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.modal-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.45;
}
.converter-file-input {
    width: 100%;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.modal-status {
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-secondary);
    min-height: 1.25em;
}
.conv-download {
    margin-top: 12px;
}
.conv-download[hidden] { display: none !important; }

/* ========== Admin page ========== */
.admin-page {
    min-height: 100vh;
    padding: 32px 24px 48px;
    background:
        radial-gradient(circle at top left, rgba(108, 92, 231, 0.16), transparent 30%),
        linear-gradient(180deg, #0f1117 0%, #131722 100%);
    overflow-y: auto;
}
.admin-header {
    max-width: 1440px;
    margin: 0 auto 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.admin-eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 8px;
}
.admin-header h1 {
    font-size: 32px;
    line-height: 1.1;
    margin-bottom: 8px;
}
.admin-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    max-width: 680px;
}
.admin-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.admin-main {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
}
.admin-stat-card,
.admin-section,
.admin-card,
.admin-empty {
    background: rgba(26, 29, 39, 0.92);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.admin-stat-card {
    padding: 18px;
}
.admin-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 8px;
}
.admin-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}
.admin-section {
    padding: 18px;
}
.admin-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.admin-section h2 {
    font-size: 18px;
    font-weight: 600;
}
.admin-table-note {
    color: var(--text-muted);
    font-size: 12px;
}
.admin-table-wrap {
    overflow: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}
.admin-table th,
.admin-table td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    font-size: 13px;
}
.admin-table th {
    color: var(--text-secondary);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.02);
    position: sticky;
    top: 0;
}
.admin-table tr:last-child td {
    border-bottom: none;
}
.admin-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 20px;
}
.admin-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 640px;
    overflow: auto;
}
.admin-card {
    padding: 14px;
}
.admin-card-meta,
.admin-card-foot {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-secondary);
}
.admin-card-text {
    margin: 10px 0;
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-word;
}
.admin-empty,
.admin-denied {
    max-width: 720px;
    margin: 80px auto;
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
}

@media (max-width: 1280px) {
    .admin-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .admin-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .admin-page {
        padding: 20px 14px 32px;
    }
    .admin-header {
        flex-direction: column;
    }
    .admin-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .admin-section {
        padding: 14px;
    }
}

/* ========== Plans Page ========== */
.plans-container {
    min-height: 100vh; padding: 60px 20px;
    display: flex; flex-direction: column; align-items: center;
}
.plans-container h1 {
    font-size: 32px; font-weight: 700; margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.plans-container .subtitle {
    color: var(--text-secondary); margin-bottom: 48px; font-size: 16px;
}
.plans-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 24px; max-width: 900px; width: 100%;
}
.plan-card {
    background: rgba(26, 29, 39, 0.86); border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius); padding: 32px;
    display: flex; flex-direction: column;
    transition: var(--transition);
}
.plan-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.plan-card.featured {
    border-color: var(--accent);
    box-shadow: 0 4px 24px var(--accent-glow);
    position: relative;
}
.plan-card.featured::before {
    content: 'Популярный';
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--accent); color: #fff;
    padding: 4px 16px; border-radius: 20px;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.plan-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.plan-card .price {
    font-size: 36px; font-weight: 700; margin-bottom: 4px;
}
.plan-card .price span { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.plan-card .period { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.plan-features {
    list-style: none; margin-bottom: 32px; flex: 1;
    display: flex; flex-direction: column; gap: 10px;
}
.plan-features li {
    font-size: 13px; color: var(--text-secondary);
    display: flex; align-items: center; gap: 8px;
}
.plan-features li::before { content: '✓'; color: var(--success); font-weight: 700; }
.plans-back {
    margin-top: 32px; font-size: 14px; color: var(--text-muted);
}

/* ========== Loading ========== */
.typing-indicator {
    display: flex; gap: 4px; padding: 12px 16px;
    align-self: flex-start;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius); border-bottom-left-radius: 4px;
}
.typing-indicator span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite ease-in-out;
}
.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); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ========== Landing Page ========== */
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius); }

.landing-mesh-bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    contain: paint;
    background:
        linear-gradient(180deg, rgba(15, 17, 23, 0.28) 0%, rgba(15, 17, 23, 0.70) 48%, rgba(15, 17, 23, 0.94) 100%),
        radial-gradient(ellipse at 50% 0%, rgba(108, 92, 231, 0.14), transparent 42%),
        var(--bg-primary);
}
.landing-mesh-bg::before,
.landing-mesh-bg::after {
    content: '';
    position: absolute;
    inset: 0;
}
.landing-mesh-bg::before {
    background:
        radial-gradient(ellipse at 50% 14%, rgba(108, 92, 231, 0.18), transparent 34%),
        radial-gradient(ellipse at 62% 20%, rgba(140, 219, 244, 0.10), transparent 24%);
    opacity: 0.95;
}
.landing-mesh-bg::after {
    background:
        linear-gradient(90deg, rgba(15, 17, 23, 0.84), transparent 16%, transparent 84%, rgba(15, 17, 23, 0.88)),
        linear-gradient(180deg, rgba(15, 17, 23, 0.04), transparent 34%, rgba(15, 17, 23, 0.82) 100%);
}
.mesh-plane {
    position: absolute;
    left: 50%;
    top: 4vh;
    width: 138vw;
    height: 140vh;
    transform-origin: center top;
    border-radius: 50%;
    opacity: 0.72;
    background-image: url("/static/landing-grid.svg");
    background-repeat: repeat;
    background-size: 64px 64px;
    will-change: transform, opacity;
}
.mesh-plane-main {
    transform: translateX(-50%) perspective(1080px) rotateX(66deg) rotateZ(-10deg) translate3d(0, 0, 0);
    animation: landingMeshFloat 22s ease-in-out infinite alternate;
    mask-image: linear-gradient(180deg, transparent 0%, #000 10%, #000 72%, transparent 100%);
}
.mesh-plane-shadow {
    top: 16vh;
    transform: translateX(-50%) perspective(1080px) rotateX(68deg) rotateZ(-10deg) translate3d(0, 48px, 0);
    opacity: 0.18;
    animation: landingMeshFloatSoft 28s ease-in-out infinite alternate;
    mask-image: linear-gradient(180deg, transparent 0%, #000 16%, #000 64%, transparent 100%);
}
@keyframes landingMeshFloat {
    0% {
        transform: translateX(-50%) perspective(1080px) rotateX(66deg) rotateZ(-10deg) translate3d(-12px, -8px, 0);
        opacity: 0.72;
    }
    100% {
        transform: translateX(-50%) perspective(1080px) rotateX(65deg) rotateZ(-8deg) translate3d(14px, 12px, 0);
        opacity: 0.82;
    }
}
@keyframes landingMeshFloatSoft {
    0% {
        transform: translateX(-50%) perspective(1080px) rotateX(68deg) rotateZ(-10deg) translate3d(10px, 44px, 0);
        opacity: 0.12;
    }
    100% {
        transform: translateX(-50%) perspective(1080px) rotateX(67deg) rotateZ(-12deg) translate3d(-10px, 60px, 0);
        opacity: 0.20;
    }
}

/* --- Navbar --- */
.landing-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(15, 17, 23, 0.90);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: 1100px; margin: 0 auto;
    padding: 14px 24px;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    font-size: 18px; font-weight: 700; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px;
}
.nav-logo img {
    width: 30px;
    height: 30px;
    display: block;
    flex: 0 0 auto;
}
.nav-logo span {
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-links {
    display: flex; align-items: center; gap: 24px; font-size: 14px;
}
.nav-links a { color: var(--text-secondary); transition: var(--transition); }
.nav-links a:hover { color: var(--text-primary); }
.nav-links .btn { color: #fff; }

/* --- Hero --- */
.hero {
    position: relative; padding: 160px 24px 100px;
    max-width: 100vw;
    text-align: center; overflow: hidden;
}
.hero-glow {
    position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
    width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none; animation: pulse 10s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 0.34; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.52; transform: translateX(-50%) scale(1.04); }
}
.hero-content { position: relative; width: 100%; max-width: 720px; margin: 0 auto; min-width: 0; }
.hero-badge {
    display: inline-block; padding: 6px 16px;
    background: rgba(108, 92, 231, 0.15); border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: 20px; font-size: 13px; color: var(--accent);
    margin-bottom: 24px;
}
.hero h1 {
    font-size: 48px; font-weight: 700; line-height: 1.2; margin-bottom: 20px;
    background: linear-gradient(135deg, #fff, var(--text-secondary));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-desc {
    font-size: 17px; color: var(--text-secondary);
    max-width: 560px; margin: 0 auto 32px; line-height: 1.7;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-bottom: 48px; }
.hero-stats {
    display: flex; justify-content: center; gap: 48px;
}
.hero-stat-value {
    font-size: 28px; font-weight: 700; color: var(--accent);
}
.hero-stat-label {
    font-size: 13px; color: var(--text-muted); margin-top: 2px;
}

/* --- Sections common --- */
.features, .how-it-works, .pricing, .about-project, .contacts-section, .assistant-preview {
    position: relative;
    max-width: 1100px; margin: 0 auto;
    padding: 80px 24px; text-align: center;
}
.features h2, .how-it-works h2, .pricing h2, .about-project h2, .contacts-section h2, .assistant-preview h2 {
    font-size: 32px; font-weight: 700; margin-bottom: 8px;
}
.section-desc {
    color: var(--text-secondary); font-size: 16px; margin-bottom: 48px;
}
.section-kicker {
    display: inline-flex;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

/* --- Features Grid --- */
.features-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 20px; text-align: left;
}
.feature-card {
    padding: 28px; background: rgba(26, 29, 39, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius);
    transition: var(--transition);
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.feature-icon { font-size: 32px; margin-bottom: 16px; }
.feature-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* --- Assistant preview --- */
.assistant-preview {
    text-align: center;
}
.assistant-preview-copy {
    max-width: 720px;
    margin: 0 auto 34px;
}
.assistant-window {
    max-width: 820px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(26, 29, 39, 0.94), rgba(15, 17, 23, 0.94)),
        rgba(26, 29, 39, 0.92);
    box-shadow: 0 26px 86px rgba(0, 0, 0, 0.26);
    text-align: left;
}
.assistant-window-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
}
.assistant-window-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.assistant-window-brand img {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
}
.assistant-window-brand strong,
.assistant-window-brand span {
    display: block;
}
.assistant-window-brand strong {
    font-size: 15px;
    line-height: 1.25;
}
.assistant-window-brand span {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 2px;
}
.assistant-window-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 7px 10px;
    border: 1px solid rgba(16, 185, 129, 0.26);
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.08);
}
.assistant-window-status span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}
.assistant-messages {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 28px;
    background:
        linear-gradient(90deg, rgba(116, 185, 255, 0.04) 1px, transparent 1px),
        linear-gradient(180deg, rgba(116, 185, 255, 0.04) 1px, transparent 1px);
    background-size: 34px 34px;
}
.assistant-bubble {
    max-width: min(78%, 590px);
    padding: 14px 16px 15px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}
.assistant-preview.is-animated .assistant-bubble {
    opacity: 0;
    transform: translateY(24px) scale(0.975);
}
.assistant-preview.is-animated .assistant-bubble.user {
    transform: translate(36px, 24px) scale(0.975);
}
.assistant-preview.is-animated .assistant-bubble.assistant {
    transform: translate(-36px, 24px) scale(0.975);
}
.assistant-preview.is-visible .assistant-bubble {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    transition:
        opacity 0.92s ease,
        transform 0.92s cubic-bezier(0.2, 0.8, 0.2, 1);
    animation: assistantBubbleFocus 1.65s ease-out both;
}
.assistant-preview.is-visible .assistant-bubble.assistant {
    transition-delay: 0.72s;
    animation-delay: 0.72s;
}
.assistant-bubble.user {
    align-self: flex-end;
    color: #fff;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.96), rgba(82, 113, 255, 0.92));
    border-bottom-right-radius: 4px;
}
.assistant-bubble.assistant {
    align-self: flex-start;
    background: rgba(36, 40, 54, 0.94);
    border-bottom-left-radius: 4px;
}
.assistant-bubble-meta {
    margin-bottom: 6px;
    color: rgba(232, 233, 237, 0.68);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.assistant-bubble.user .assistant-bubble-meta {
    color: rgba(255, 255, 255, 0.72);
}
.assistant-bubble p {
    color: inherit;
    font-size: 14px;
    line-height: 1.65;
}
@keyframes assistantBubbleFocus {
    0% {
        border-color: rgba(116, 185, 255, 0.88);
        box-shadow:
            0 0 0 1px rgba(116, 185, 255, 0.62),
            0 0 0 7px rgba(116, 185, 255, 0.16),
            0 18px 46px rgba(0, 0, 0, 0.24);
    }
    58% {
        border-color: rgba(116, 185, 255, 0.42);
        box-shadow:
            0 0 0 1px rgba(116, 185, 255, 0.26),
            0 0 0 13px rgba(116, 185, 255, 0.04),
            0 16px 42px rgba(0, 0, 0, 0.22);
    }
    100% {
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
    }
}

/* --- About project --- */
.about-project {
    text-align: left;
}
.about-project-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: 28px;
    align-items: stretch;
}
.about-project-copy,
.support-card {
    background: rgba(26, 29, 39, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius);
}
.about-project-copy {
    padding: 36px;
}
.about-project-copy p {
    max-width: 680px;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.75;
}
.support-card {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(108, 92, 231, 0.18), rgba(16, 185, 129, 0.08)),
        rgba(26, 29, 39, 0.88);
}
.support-mark {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}
.support-title {
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 8px;
}
.support-text {
    color: var(--text-secondary);
    font-size: 13px;
}

/* --- How it works --- */
.steps-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 24px; text-align: left;
}
.step-card {
    padding: 28px; background: rgba(26, 29, 39, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius);
    position: relative;
}
.step-number {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; margin-bottom: 16px;
}
.step-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.step-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* --- Pricing (on landing) --- */
.pricing .plans-grid { margin: 0 auto; }

/* --- Contacts --- */
.contacts-section {
    text-align: left;
}
.contacts-inner {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
    gap: 28px;
    align-items: stretch;
}
.contacts-copy,
.feedback-card {
    background: rgba(26, 29, 39, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius);
}
.contacts-copy {
    padding: 36px;
}
.contacts-copy p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 28px;
}
.contact-list {
    display: grid;
    gap: 12px;
}
.contact-item {
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-sm);
    background: rgba(15, 17, 23, 0.45);
}
.contact-item span {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 3px;
}
.contact-item strong,
.contact-item a {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 700;
}
.contact-item a:hover {
    color: var(--accent-hover);
}
.feedback-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 32px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.16);
}
.feedback-head h3 {
    font-size: 22px;
    line-height: 1.25;
    margin-bottom: 8px;
}
.feedback-head p {
    color: var(--text-secondary);
    font-size: 14px;
}
.feedback-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.feedback-field span {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}
.feedback-textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.55;
}
.feedback-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.feedback-status {
    min-height: 1.4em;
    color: var(--text-secondary);
    font-size: 13px;
}
.feedback-status.success { color: var(--success); }
.feedback-status.error { color: var(--danger); }

/* --- Footer --- */
.landing-footer {
    position: relative;
    border-top: 1px solid var(--border);
    background: rgba(15, 17, 23, 0.90);
    padding: 40px 24px; text-align: center;
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-logo {
    font-size: 18px; font-weight: 700; margin-bottom: 8px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.footer-logo img {
    width: 28px;
    height: 28px;
    display: block;
}
.footer-text { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.footer-copy { font-size: 12px; color: var(--text-muted); }

@media (max-width: 900px) {
    .mesh-plane {
        width: 168vw;
        height: 132vh;
        top: 0;
        background-size: 58px 58px;
    }
    .nav-inner {
        padding: 14px 18px;
    }
    .nav-links {
        gap: 14px;
    }
    .hero {
        padding: 132px 18px 78px;
    }
    .hero h1 {
        font-size: 38px;
    }
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .assistant-bubble {
        max-width: 86%;
    }
    .about-project-inner,
    .contacts-inner {
        grid-template-columns: 1fr;
    }
    .plans-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .landing-mesh-bg {
        contain: strict;
    }
    .landing-mesh-bg::before {
        opacity: 0.52;
    }
    .mesh-plane {
        width: 172vw;
        height: 104vh;
        top: 10vh;
        opacity: 0.58;
        background-size: 52px 52px;
    }
    .mesh-plane-main {
        transform: translateX(-50%) perspective(760px) rotateX(63deg) rotateZ(-8deg);
        animation: landingMeshFloatMobile 26s ease-in-out infinite alternate;
        mask-image: linear-gradient(180deg, transparent 0%, #000 8%, #000 68%, transparent 100%);
    }
    .mesh-plane-shadow {
        display: none;
    }
    .landing-nav {
        background: rgba(15, 17, 23, 0.92);
    }
    .nav-inner {
        padding: 12px 16px;
    }
    .nav-logo {
        font-size: 16px;
    }
    .nav-links a:not(.btn) {
        display: none;
    }
    .nav-links .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    .hero {
        padding: 116px 24px 68px;
    }
    .hero-content {
        max-width: 342px;
        overflow: hidden;
    }
    .hero-badge {
        font-size: 12px;
        max-width: 100%;
    }
    .hero h1 {
        max-width: 310px;
        margin-left: auto;
        margin-right: auto;
        font-size: 29px;
        line-height: 1.14;
        overflow-wrap: break-word;
    }
    .hero h1 br {
        display: none;
    }
    .hero-desc {
        max-width: 312px;
        margin-left: auto;
        margin-right: auto;
        font-size: 15px;
    }
    .hero-actions {
        flex-direction: column;
        align-items: center;
        margin-bottom: 40px;
    }
    .hero-actions .btn {
        width: min(100%, 320px);
    }
    .hero-stats {
        gap: 22px;
        flex-wrap: wrap;
    }
    .features,
    .how-it-works,
    .pricing,
    .about-project,
    .contacts-section,
    .assistant-preview {
        padding: 64px 24px;
    }
    .section-desc {
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }
    .features-grid,
    .steps-grid {
        grid-template-columns: 1fr;
    }
    .feature-card,
    .step-card,
    .plan-card,
    .assistant-messages,
    .about-project-copy,
    .support-card,
    .contacts-copy,
    .feedback-card {
        padding: 24px;
    }
    .support-card {
        align-items: flex-start;
        flex-direction: column;
    }
    .feedback-actions .btn {
        width: 100%;
    }
    .assistant-window-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .assistant-window-status {
        align-self: flex-start;
    }
    .assistant-bubble {
        max-width: 100%;
    }
}

@keyframes landingMeshFloatMobile {
    0% {
        transform: translateX(-50%) perspective(760px) rotateX(63deg) rotateZ(-8deg) translate3d(-8px, 0, 0);
        opacity: 0.58;
    }
    100% {
        transform: translateX(-50%) perspective(760px) rotateX(62deg) rotateZ(-7deg) translate3d(8px, 8px, 0);
        opacity: 0.68;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mesh-plane-main,
    .mesh-plane-shadow,
    .hero-glow {
        animation: none;
    }
    .assistant-preview.is-animated .assistant-bubble,
    .assistant-preview.is-animated .assistant-bubble.user,
    .assistant-preview.is-animated .assistant-bubble.assistant {
        opacity: 1;
        transform: none;
        transition: none;
        animation: none;
    }
}
