/* =========================================================
       GLOBAL RESET — No black focus outlines, no tap highlights
    ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

*:focus,
*:focus-visible,
*:focus-within,
*:active {
    outline: none !important;
    box-shadow: none !important;
}

button,
input,
textarea,
select,
a {
    outline: none !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: none;
    background: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

button:focus,
button:active,
input:focus,
input:active,
textarea:focus,
textarea:active,
a:focus,
a:active {
    outline: 0 !important;
    box-shadow: none !important;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f7f7f8;
    color: #0f172a;
    overflow: hidden;
}

footer {
    display: none !important;
}

.ai-builder-root {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: #f7f7f8;
}

.ai-sidebar {
    width: 300px;
    min-width: 300px;
    background: #ffffff;
    border-right: 1px solid #e8eaed;
    display: flex;
    flex-direction: column;
    height: 100vh;
    z-index: 20;
    overflow: hidden;
}

.sidebar-hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: #f9fafb;
    border: 1px solid #e8eaed !important;
    color: #0f172a;
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 19;
}

@media (max-width: 1024px) {
    .ai-builder-root {
        position: relative;
    }

    .ai-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000 !important;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
        width: 280px;
        min-width: 280px;
        max-width: 85vw;
        background: #ffffff;
    }

    .ai-sidebar.sidebar-open,
    .ai-sidebar.mobile-open {
        transform: translateX(0) !important;
        box-shadow: 0 0 40px rgba(15, 23, 42, 0.25) !important;
        z-index: 1000 !important;
    }

    .sidebar-hamburger-btn {
        display: flex;
    }

    .sidebar-mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 999 !important;
    }

    .sidebar-mobile-overlay.active {
        display: block !important;
    }

    .ai-main-workspace {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .ai-sidebar {
        width: 88vw;
        min-width: 88vw;
        max-width: 88vw;
    }
}

/* Sidebar Logo */
.sidebar-logo {
    padding: 20px 22px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}

.brand-logo-img {
    max-height: 32px;
    max-width: 100%;
    height: auto;
    width: auto;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-logo-label {
    font-size: 19px;
    font-weight: 700;
    color: #18181b;
    letter-spacing: -0.3px;
    white-space: nowrap;
    line-height: 1;
    padding-left: 12px;
    border-left: 1px solid #e2e2e5;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* New Page + Domain Buttons */
.sidebar-action-area {
    padding: 6px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.btn-new-page-sidebar {
    width: 100%;
    background: transparent;
    border: 1px solid transparent !important;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 9px;
    transition: all 0.15s ease;
    text-align: left;
}

.btn-new-page-sidebar:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: transparent !important;
}

.btn-new-page-sidebar .btn-icon {
    width: 22px;
    height: 22px;
    background: #0f172a;
    color: #ffffff;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.15s;
}

.btn-new-page-sidebar:hover .btn-icon {
    background: #0f172a;
    color: #ffffff;
}

.domain-dropdown-wrapper {
    position: relative;
    width: 100%;
}

.btn-domain-sidebar {
    width: 100%;
    background: transparent;
    border: 1px solid transparent !important;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 9px;
    transition: all 0.15s ease;
    text-align: left;
}

.btn-domain-sidebar:hover {
    background: #f8fafc;
    border-color: transparent !important;
    color: #0f172a;
}

.btn-domain-sidebar span:nth-child(2) {
    flex: 1;
}

.domain-dropdown-chevron {
    flex-shrink: 0;
    transition: transform 0.18s ease;
    color: #9ca3af;
}

.domain-dropdown-wrapper.open .btn-domain-sidebar {
    background: #f8fafc;
    border-color: transparent !important;
    color: #0f172a;
}

.domain-dropdown-wrapper.open .domain-dropdown-chevron {
    transform: rotate(180deg);
    color: #ff0087;
}

/* ============================================================
   DOMAIN DROPDOWN PANEL — sidebar quick access
============================================================ */
.domain-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    min-width: 280px;
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 14px;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.14);
    padding: 10px;
    z-index: 500;
    display: none;
    flex-direction: column;
    gap: 10px;
    max-height: 340px;
}

.domain-dropdown-wrapper.open .domain-dropdown-panel {
    display: flex;
    animation: menuPop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.domain-dropdown-add-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 10px;
    border-radius: 9px;
    background: transparent;
    border: 1px dashed #e2e8f0 !important;
    color: #ff0087;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    flex-shrink: 0;
    transition: all 0.12s ease;
}

.domain-dropdown-add-btn:hover {
    background: #fdf2f8;
    border-color: #fbcfe8 !important;
}

.domain-dropdown-add-icon {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: #fdf2f8;
    color: #ff0087;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.12s ease;
    line-height: 1;
}

.domain-dropdown-add-btn:hover .domain-dropdown-add-icon {
    background: #ff0087;
    color: #ffffff;
}

.domain-dropdown-list-label {
    font-size: 10.5px;
    font-weight: 800;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 2px 2px;
}

.domain-dropdown-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.domain-dropdown-item {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    background: #f9fafb;
    border: 1px solid #f1f3f5;
    border-radius: 10px;
    transition: all 0.12s ease;
}

.domain-dropdown-item:hover {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

/* Şu an aktif/seçili domain: nokta yerine tüm satırı çevreleyen belirgin
   bir border ile işaretlenir, böylece hangi domain'in seçili olduğu
   listede tek bakışta net biçimde ayırt edilebilir. */
.domain-dropdown-item.is-current {
    background: #fdf2f8;
    border: 1.5px solid #ff0087;
}

.domain-dropdown-item.is-current:hover {
    background: #fdf2f8;
    border-color: #ff0087;
}

.domain-dropdown-item-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    padding: 10px 4px 10px 12px;
    border-radius: 10px;
    background: transparent;
    border: none !important;
    cursor: pointer;
    text-align: left;
}

.domain-dropdown-item-menu-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin-right: 6px;
    border-radius: 7px;
    background: transparent;
    border: none !important;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s ease;
}

.domain-dropdown-item-menu-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.domain-dropdown-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
}

.domain-dropdown-item-dot.active {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}

.domain-dropdown-item-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.domain-dropdown-item-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.domain-dropdown-item-status {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    line-height: 1.3;
}

.domain-dropdown-item-status.active {
    color: #16a34a;
}

.domain-dropdown-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 4px;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.domain-dropdown-empty-spinner {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    border-top-color: #ff0087;
    flex-shrink: 0;
    animation: domainSpin 0.7s linear infinite;
}

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

/* Section Divider */
.sidebar-divider {
    height: 1px;
    background: #f1f3f5;
    margin: 8px 18px;
}

/* Sidebar Section Label */
.sidebar-section-label {
    font-size: 12px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 12px 22px 8px;
}

/* Pages History List */
.pages-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

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

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

.pages-history-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
    border: 1.5px solid #ffffff;
}

.pages-history-list::-webkit-scrollbar-thumb:hover {
    background: #b0b7c3;
}

.sidebar-page-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.12s ease;
    border: 1px solid transparent !important;
    background: transparent;
    width: 100%;
    text-align: left;
}

.sidebar-page-item:hover {
    background: #f9fafb;
    color: #0f172a;
}

.sidebar-page-item.active {
    background: #fff0f7;
    color: #ff0087;
    font-weight: 600;
    border-color: #fce7f3 !important;
}

.sidebar-page-item::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d1d5db;
    flex-shrink: 0;
    transition: background 0.12s;
}

.sidebar-page-item.active::before {
    background: #ff0087;
}

/* Chat History List (per active page) — visually distinct from pages list */
.chats-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

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

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

.chats-history-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
    border: 1.5px solid #ffffff;
}

.chats-history-list::-webkit-scrollbar-thumb:hover {
    background: #b0b7c3;
}

.sidebar-chat-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.12s ease;
    border: 1px solid transparent !important;
    background: transparent;
    width: 100%;
    text-align: left;
}

.sidebar-chat-item:hover {
    background: #f9fafb;
    color: #0f172a;
}

.sidebar-chat-item.active {
    background: #f5f3ff;
    color: #7c3aed;
    font-weight: 600;
    border-color: #ede9fe !important;
}

.sidebar-chat-item::before {
    content: '💬';
    font-size: 11px;
    flex-shrink: 0;
    opacity: 0.6;
}

.sidebar-chat-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* User Profile Footer (ChatGPT / Claude style) */
.sidebar-user-footer {
    padding: 12px 14px;
    border-top: 1px solid #f1f3f5;
    background: #ffffff;
    position: relative;
    margin-top: auto;
    flex-shrink: 0;
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 11px;
    cursor: pointer;
    width: 100%;
    transition: background 0.15s ease;
    border: 1px solid transparent !important;
}

.user-profile-trigger:hover {
    background: #f9fafb;
}

.user-profile-trigger.active {
    background: #f9fafb;
}

.user-avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 0;
}

.user-avatar-circle:has(img) {
    background: transparent;
}

.user-avatar-circle img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

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

.user-trigger-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.user-trigger-sub {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.user-trigger-arrow {
    color: #9ca3af;
    font-size: 10px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.user-profile-trigger.active .user-trigger-arrow {
    transform: rotate(180deg);
}

/* Profile Dropdown Menu (upward) */
.user-profile-dropdown-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 10px;
    right: 10px;
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 1px;
    z-index: 99999;
    animation: menuUpFade 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes menuUpFade {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.menu-header-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
}

.menu-divider {
    height: 1px;
    background: #f1f3f5;
    margin: 4px 4px;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s;
    border: none !important;
    background: transparent;
    width: 100%;
    text-align: left;
}

.profile-menu-item:hover {
    background: #f9fafb;
    color: #0f172a;
}

.profile-menu-item.highlight-item {
    color: #ff0087;
    font-weight: 600;
}

.profile-menu-item.highlight-item:hover {
    background: #fff0f7;
}

.profile-menu-item.danger-item {
    color: #ef4444;
}

.profile-menu-item.danger-item:hover {
    background: #fef2f2;
}

.menu-item-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Guest Footer */
.guest-footer-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #e8eaed !important;
}

.guest-footer-text {
    flex: 1;
    min-width: 0;
}

.guest-footer-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.guest-footer-sub {
    font-size: 11px;
    color: #9ca3af;
}

.btn-guest-signin {
    background: #ff0087 !important;
    color: #ffffff !important;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 7px;
    cursor: pointer;
    border: none !important;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn-guest-signin:hover {
    background: #e00077 !important;
}

.ai-main-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #f7f7f8;
    min-width: 0;
}

/* Top Bar */
.workspace-top-bar {
    height: 56px;
    padding: 0 24px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
}

.workspace-top-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.current-page-label {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-status-badge {
    font-size: 10px;
    font-weight: 700;
    background: #f0fdf4;
    color: #16a34a;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Layout Toggle Tabs (center of top bar) */
.workspace-layout-toggle {
    display: flex;
    background: #f3f4f6;
    padding: 3px;
    border-radius: 9px;
}

.layout-toggle-btn {
    border: none !important;
    background: transparent;
    padding: 5px 14px;
    border-radius: 7px;
    cursor: pointer;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
    white-space: nowrap;
}

.layout-toggle-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.layout-toggle-btn:hover:not(.active) {
    color: #374151;
}

/* Top Bar Right Actions */
.workspace-top-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-topbar-action {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #e8eaed !important;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn-topbar-action:hover {
    background: #f9fafb;
    border-color: #d1d5db !important;
    color: #0f172a;
}

/* ============================================================
   TOPBAR DOMAIN DROPDOWN — güncel domain gösterimi + geçiş
============================================================ */
.topbar-domain-dropdown-wrapper {
    position: relative;
}

.topbar-domain-chevron {
    flex-shrink: 0;
    color: #9ca3af;
    transition: transform 0.18s ease;
}

.topbar-domain-dropdown-wrapper.open .btn-topbar-action {
    background: #f9fafb;
    border-color: #d1d5db !important;
    color: #0f172a;
}

.topbar-domain-dropdown-wrapper.open .topbar-domain-chevron {
    transform: rotate(180deg);
    color: #ff0087;
}

.topbar-domain-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 14px;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
    padding: 10px;
    z-index: 99999;
    display: none;
    flex-direction: column;
    gap: 10px;
    max-height: 340px;
}

@media (max-width: 640px) {
    .topbar-domain-dropdown-panel {
        left: 0;
        right: auto;
    }
}

.topbar-domain-dropdown-wrapper.open .topbar-domain-dropdown-panel {
    display: flex;
    animation: menuPop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-topbar-token {
    background: #ff0087;
    border-color: #ff0087 !important;
    color: #ffffff;
}

.btn-topbar-token:hover {
    background: #e6007a;
    border-color: #e6007a !important;
    color: #ffffff;
}

.btn-topbar-reset {
    background: transparent;
    border: 1px solid transparent !important;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s ease;
}

.btn-topbar-reset:hover {
    background: #f9fafb;
    color: #374151;
}

.btn-publish {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: none !important;
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.btn-publish:hover {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.28);
    transform: translateY(-1px);
}

.btn-publish.is-published,
.btn-publish[style*="background: rgb(16, 185, 129)"],
.btn-publish[style*="background:#10b981"],
.btn-publish[style*="background: #10b981"] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    color: #ffffff !important;
}

.btn-publish.is-published:hover,
.btn-publish[style*="background: rgb(16, 185, 129)"]:hover,
.btn-publish[style*="background:#10b981"]:hover,
.btn-publish[style*="background: #10b981"]:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.55), 0 0 0 2px rgba(16, 185, 129, 0.3) !important;
    transform: translateY(-1px) scale(1.02) !important;
    color: #ffffff !important;
}

.btn-publish.is-published:active,
.btn-publish[style*="background: rgb(16, 185, 129)"]:active,
.btn-publish[style*="background:#10b981"]:active,
.btn-publish[style*="background: #10b981"]:active {
    transform: translateY(0) scale(0.98) !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4) !important;
}

.workspace-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    height: calc(100vh - 56px);
    position: relative;
}

.ai-chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: #fafafb;
    position: relative;
}

.chat-hero {
    padding: 48px 40px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.chat-hero-badge {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.chat-hero-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chat-hero-badge svg {
    color: #ffffff;
}

.chat-hero-title {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.chat-hero-subtitle {
    font-size: 14px;
    color: #6b7280;
    font-weight: 400;
    max-width: 420px;
    line-height: 1.6;
}

/* Onboarding Card */
.onboarding-card {
    margin: 16px 32px;
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 16px;
    padding: 20px 24px;
}

.onboarding-step-title {
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 12px;
}

.chips-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.onboarding-chip {
    background: #f9fafb;
    border: 1px solid #e8eaed !important;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s ease;
}

.onboarding-chip:hover {
    background: #fff0f7;
    border-color: #ff0087 !important;
    color: #ff0087;
}

.onboarding-chip-noop {
    background: #ffffff;
    border-style: dashed !important;
}

.onboarding-chip-noop:hover {
    background: #f9fafb;
    border-color: #9ca3af !important;
    color: #374151;
}

.onboarding-text-input {
    width: 100%;
    background: #f9fafb;
    border: 1px solid #e8eaed !important;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s ease;
    display: none;
}

.onboarding-text-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.onboarding-text-input:focus {
    background: #ffffff;
    border-color: #ff0087 !important;
}

.chat-stream-box {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 24px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.ai-chat-panel.has-messages .chat-stream-box {
    padding-bottom: 180px;
}

.chat-stream-box::-webkit-scrollbar {
    width: 6px;
}

.chat-stream-box::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.chat-stream-box::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.chat-bubble {
    width: 100%;
    max-width: 800px;
    word-break: break-word;
    margin-top: 14px;
    margin-bottom: 14px;
}

.chat-bubble:first-child {
    margin-top: 0;
}

/* User bubble: column flex so action bar sits BELOW the text bubble, right-aligned */
.user-bubble {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    background: transparent;
    padding: 0;
}

/* Target only the direct message-content div, NOT .msg-action-bar */
.user-bubble > .user-bubble-content {
    background: #f1f5f9;
    color: #0f172a;
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 75%;
    font-size: 14.5px;
    font-weight: 450;
    line-height: 1.55;
    box-shadow: 0 1px 2px rgba(24, 24, 27, 0.06);
    letter-spacing: -0.1px;
    border: 1px solid #e2e8f0;
}

.ai-bubble {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: transparent;
    padding: 0;
    justify-content: flex-start;
    width: 100%;
}

.ai-avatar-badge {
    width: 28px;
    height: 28px;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    border-radius: 8px;
}

.ai-bubble.is-grouped .ai-avatar-badge,
.ai-bubble.is-grouped .ai-sender-name {
    visibility: hidden;
}

.ai-message-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.ai-sender-name {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    margin: 0 0 4px 2px;
    line-height: 1.2;
}

.ai-content {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
    border-radius: 16px !important;
    padding: 12px 16px;
    font-size: 14.5px;
    color: #1e293b;
    line-height: 1.65;
    width: fit-content;
    max-width: 100%;
    letter-spacing: -0.1px;
}

.ai-bubble.is-grouped {
    margin-top: -6px;
}

/* =========================================================
   AI GENERATION & TYPEWRITER STREAMING STYLES
   ========================================================= */

/* Pure Clean Logo Breathing Animation during AI generation (No borders, no colors, no shadows) */
.pulsing-avatar {
    position: relative;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
    animation: logoBreathing 1.4s infinite ease-in-out alternate;
}
@keyframes logoBreathing {
    0% {
        transform: scale(0.92);
        opacity: 0.82;
    }
    100% {
        transform: scale(1.08);
        opacity: 1;
    }
}

/* AI Thinking Status Badge */
.ai-thinking-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #ff0087;
    background: linear-gradient(135deg, rgba(255, 0, 135, 0.08), rgba(224, 0, 120, 0.08));
    border: 1px solid rgba(255, 0, 135, 0.2);
    border-radius: 12px;
    padding: 2px 8px;
    margin-left: 4px;
}

/* Animated Typing Dots — Brand Signature Pink */
.ai-typing-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 2px;
}
.ai-typing-dots span {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff0087, #e00078);
    animation: aiDotBounce 1.2s infinite ease-in-out;
}
.ai-typing-dots span:nth-child(1) { animation-delay: 0s; }
.ai-typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.ai-typing-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes aiDotBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
    40%           { transform: translateY(-6px); opacity: 1; }
}

/* Shimmering Skeleton Lines for Thinking State */
.ai-thinking-content {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 14px rgba(255, 0, 135, 0.08) !important;
    min-width: 40px;
}

.ai-skeleton-line {
    height: 9px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: aiSkeletonShimmer 1.5s infinite;
    margin-bottom: 8px;
}
.ai-skeleton-line.w-80 { width: 85%; }
.ai-skeleton-line.w-60 { width: 60%; }
.ai-skeleton-line.w-40 { width: 40%; margin-bottom: 0; }

@keyframes aiSkeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Typewriter Glowing Cursor — Brand Signature Pink */
.ai-typing-cursor {
    display: inline-block;
    width: 3px;
    height: 15px;
    background: linear-gradient(135deg, #ff0087, #e00078);
    margin-left: 4px;
    vertical-align: text-bottom;
    border-radius: 2px;
    animation: aiCursorBlink 0.6s infinite alternate;
    box-shadow: 0 0 8px rgba(255, 0, 135, 0.7);
}
@keyframes aiCursorBlink {
    0% { opacity: 0.15; transform: scaleY(0.85); }
    100% { opacity: 1; transform: scaleY(1.1); }
}

/* "AI ile Oluşturuldu" Stamp Badge — hidden but kept for compatibility */
.ai-generated-stamp {
    display: none;
}

/* AI Confirm Action Box — Brand Signature Pink Accent */
.ai-confirm-action-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    background: linear-gradient(135deg, rgba(255, 0, 135, 0.04), rgba(224, 0, 120, 0.04));
    border: 1px solid rgba(255, 0, 135, 0.2);
    border-radius: 12px;
    padding: 12px 14px;
    animation: confirmBoxEntrance 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes confirmBoxEntrance {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ai-confirm-desc {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    font-weight: 500;
    line-height: 1.5;
}
.ai-confirm-desc svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: #ff0087;
}
.ai-confirm-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ai-confirm-btn-yes {
    padding: 7px 16px;
    background: linear-gradient(135deg, #ff0087, #e00078);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 2px 8px rgba(255, 0, 135, 0.3);
}
.ai-confirm-btn-yes:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255, 0, 135, 0.4);
}
.ai-confirm-btn-no {
    padding: 7px 14px;
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
}
.ai-confirm-btn-no:hover:not(:disabled) {
    background: #f8fafc;
    color: #374151;
}

/* Entrance Animation for Artifact / Code Card */
.ai-artifact-card-entrance {
    animation: artifactEntrance 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    margin-top: 10px;
}
@keyframes artifactEntrance {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =========================================================
   CHAT MESSAGE HOVER ACTION BAR
   ========================================================= */

/* Action bar: hidden by default, fades in on bubble hover */
.msg-action-bar {
    display: flex;
    align-items: center;
    gap: 1px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
    transform: translateY(-3px);
    margin-top: 4px;
    height: 24px;
}

/* User bubble — action bar right-aligned (matches bubble alignment) */
.user-bubble .msg-action-bar {
    justify-content: flex-end;
}

.msg-timestamp {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    margin-right: 6px;
    margin-left: 2px;
    user-select: none;
    display: inline-flex;
    align-items: center;
}


/* AI bubble — action bar left-aligned, indented past the avatar */
.ai-message-col .msg-action-bar {
    justify-content: flex-start;
    margin-top: 5px;
    padding-left: 2px;
}

/* Show on hover */
.chat-bubble:hover .msg-action-bar,
.ai-bubble:hover .msg-action-bar {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ---- Individual ghost icon button ---- */
.msg-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none !important;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    padding: 0;
    flex-shrink: 0;
}

.msg-action-btn svg {
    flex-shrink: 0;
    pointer-events: none;
}

.msg-action-btn:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #374151;
}

/* Regenerate — purple tint on hover */
.msg-action-btn.btn-regenerate:hover {
    background: rgba(168, 85, 247, 0.08);
    color: #9333ea;
}

/* Copy — blue tint on hover */
.msg-action-btn.btn-copy:hover {
    background: rgba(14, 165, 233, 0.08);
    color: #0284c7;
}

/* Copy success flash */
.msg-action-btn.btn-copy.copied {
    color: #15803d;
    background: rgba(22, 163, 74, 0.08);
}

/* Thumbs up */
.msg-action-btn.btn-like:hover,
.msg-action-btn.btn-like.active {
    background: rgba(22, 163, 74, 0.08);
    color: #15803d;
}

/* Thumbs down */
.msg-action-btn.btn-dislike:hover,
.msg-action-btn.btn-dislike.active {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
}

/* Edit button */
.msg-action-btn.btn-edit:hover {
    background: rgba(245, 158, 11, 0.08);
    color: #b45309;
}

/* =========================================================
   TOP TOAST NOTIFICATION
   ========================================================= */
.ai-top-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #0f172a;
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 99999;
}

.ai-top-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ai-top-toast svg {
    color: #10b981;
}

/* =========================================================
   INLINE MESSAGE EDIT BOX
   ========================================================= */
.inline-edit-box {
    width: 100%;
    min-width: 280px;
    background: #ffffff;
    border: 1.5px solid #6366f1;
    border-radius: 14px;
    padding: 10px 14px;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.inline-edit-textarea {
    width: 100%;
    border: none !important;
    outline: none !important;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    color: #0f172a;
    resize: none;
    line-height: 1.5;
    min-height: 44px;
    max-height: 160px;
    padding: 0;
}

.inline-edit-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
}

.btn-inline-cancel {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    border: none !important;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-inline-cancel:hover {
    background: #e2e8f0;
    color: #334155;
}

.btn-inline-submit {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    background: #6366f1;
    border: none !important;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-inline-submit:hover {
    background: #4f46e5;
}


.ai-content b,
.ai-content strong {
    font-weight: 700;
    color: #0f172a;
}

.ai-content code {
    background: #fdf2f8;
    color: #e11d48;
    border: 1px solid #fbcfe8;
    font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
    font-size: 13px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    margin: 0 2px;
    display: inline-block;
    line-height: 1.4;
}

.ai-stepper-container {
    margin: 0 auto 6px;
    padding: 4px 12px;
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    max-width: 800px;
    width: 100%;
}

.stepper-label {
    font-size: 13px;
    font-weight: 600;
    color: #db2777;
    text-align: center;
}

.attached-files-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.attached-files-container:empty {
    display: none;
}

.attached-file-chip {
    width: 140px;
    height: 140px;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attached-file-chip:hover {
    border-color: #ff0087;
    box-shadow: 0 8px 20px rgba(255, 0, 135, 0.22);
    transform: translateY(-2px);
}

.attached-file-chip img,
.attached-file-chip video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.attached-file-chip .remove-file-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    z-index: 10;
    transition: all 0.15s ease;
}

.attached-file-chip .remove-file-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    transform: scale(1.1);
}
    box-shadow: 0 2px 6px rgba(99,102,241,0.15);
}

.attached-file-chip.text-file-chip span {
    display: inline-flex !important;
    align-items: center !important;
}

.attached-file-chip.text-file-chip .remove-file-btn {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    color: #94a3b8 !important;
    font-size: 16px !important;
    line-height: 1 !important;
    padding: 0 2px !important;
    border-radius: 0 !important;
    backdrop-filter: none !important;
    margin-left: 4px !important;
    transition: color 0.15s ease;
}

.attached-file-chip.text-file-chip .remove-file-btn:hover {
    color: #ef4444 !important;
}

.attached-file-chip .remove-file-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: rgba(15, 23, 42, 0.65) !important;
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    backdrop-filter: blur(2px);
}

.remove-file-btn {
    background: none;
    border: none !important;
    color: #ef4444;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    font-family: sans-serif;
}

/* Center Stage Container */
.chat-center-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 20px;
    flex: 1;
}

.chat-hero {
    width: 100%;
    max-width: 800px;
    padding: 24px 0 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.onboarding-card {
    width: 100%;
    max-width: 800px;
    margin: 16px 0;
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 16px;
    padding: 20px 24px;
}

.chat-input-card {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

#chat-input-area {
    padding: 12px 24px 20px;
    flex-shrink: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: #ffffff;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 20px !important;
    padding: 8px 12px 6px 12px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper:hover {
    border-color: #94a3b8 !important;
}

.input-wrapper:focus-within {
    border-color: #ff0087 !important;
    box-shadow: 0 4px 16px rgba(255, 0, 135, 0.12) !important;
}

.input-wrapper:has(.attached-files-container:not(:empty)) {
    border-radius: 24px;
}

.input-wrapper .attached-files-container {
    padding: 4px 6px 10px;
}

.input-textarea-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 0 6px;
}

.plus-upload-btn {
    background: transparent;
    border: none !important;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.plus-upload-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.plus-upload-btn.gallery-picker-btn {
    background: transparent !important;
    box-shadow: none !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.plus-upload-btn.gallery-picker-btn:hover {
    background: transparent !important;
    box-shadow: none !important;
    color: #ff0087 !important;
    transform: scale(1.08);
}

.plus-upload-btn.gallery-picker-btn.active {
    background: transparent !important;
    box-shadow: none !important;
    color: #ff0087 !important;
    transform: scale(1.08);
}

/* =========================================================
   STORE GALLERY POPOVER (Floating 10px above input, matching width)
   ========================================================= */
.chat-controls-zone {
    position: relative !important;
    overflow: visible !important;
    width: 100%;
}

/* =========================================================
   SLASH COMMAND AUTOCOMPLETE POPOVER
   ========================================================= */
.slash-command-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    box-shadow: 0 -12px 30px -4px rgba(15, 23, 42, 0.12), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
    z-index: 10002;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    animation: slashPopoverFadeIn 0.12s ease-out;
}

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

.slash-popover-list {
    display: flex;
    flex-direction: column;
    padding: 6px;
    background: #ffffff;
    max-height: 200px;
    overflow-y: auto;
    gap: 3px;
}

.slash-command-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.12s ease;
}

.slash-command-item.selected,
.slash-command-item:hover {
    background: #f8fafc;
}

.slash-cmd-badge {
    font-family: 'Fira Code', Consolas, monospace;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2.5px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}

.slash-cmd-badge.tier-pro {
    color: #047857 !important;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
    border: 1px solid #6ee7b7 !important;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.12) !important;
}

.slash-cmd-badge.tier-neutral,
.slash-cmd-badge:not(.tier-pro) {
    color: #64748b !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

.slash-cmd-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5px;
    flex: 1;
    min-width: 0;
}

.slash-cmd-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.slash-cmd-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.store-gallery-popover {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 780px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 16px;
    box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.05);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    animation: sgPopoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sgPopoverFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Inline Edit Box Popover Attachment */
.store-gallery-popover.inline-popover-mode,
.inline-edit-box .store-gallery-popover {
    position: absolute !important;
    bottom: calc(100% + 8px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    margin: 0 !important;
    z-index: 10005 !important;
    animation: sgInlinePopoverFadeIn 0.15s ease-out !important;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.2) !important;
}

@keyframes sgInlinePopoverFadeIn {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.sg-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.sg-popover-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
}

.sg-popover-title svg {
    color: #ff0087;
}

.sg-popover-close {
    background: transparent;
    border: none !important;
    font-size: 20px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 6px;
    padding: 2px 6px;
    transition: all 0.15s ease;
}

.sg-popover-close:hover {
    color: #ef4444;
    background: #e2e8f0;
}

.sg-popover-toolbar {
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

.sg-search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 4px 10px;
    flex: 1;
    min-width: 130px;
    height: 32px;
    box-sizing: border-box;
}

.sg-search-wrap:focus-within {
    background: #ffffff;
    border-color: #ff0087;
    box-shadow: 0 0 0 2px rgba(255, 0, 135, 0.12);
}

.sg-search-wrap svg {
    color: #94a3b8;
    flex-shrink: 0;
}

.sg-search-wrap input {
    border: none !important;
    outline: none !important;
    background: transparent;
    font-size: 11.5px;
    color: #0f172a;
    width: 100%;
}

.sg-filter-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #f1f5f9;
    padding: 2px;
    border-radius: 8px;
}

.sg-filter-chip {
    border: none !important;
    background: transparent;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sg-filter-chip.active {
    background: #ffffff !important;
    color: #ff0087 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.sg-popover-body {
    padding: 10px 12px;
    max-height: 280px;
    min-height: 180px;
    overflow-y: auto;
    background: #fafafa;
    display: flex;
    flex-direction: column;
}

.sg-loading-state,
.sg-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    color: #94a3b8;
    gap: 10px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    width: 100%;
    min-height: 160px;
    margin: auto;
    box-sizing: border-box;
}

.sg-empty-state svg {
    color: #94a3b8;
    margin-bottom: 2px;
    display: block;
}

.sg-empty-state span,
.sg-loading-state span {
    text-align: center;
    max-width: 280px;
    line-height: 1.5;
    color: #64748b;
    font-weight: 500;
}

.sg-popover-footer {
    padding: 8px 14px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 40px;
    box-sizing: border-box;
}

.sg-popover-footer span {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
}

/* PAGINATOR STYLES */
.sg-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
    flex-wrap: wrap;
}

.sg-page-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sg-page-nav-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #ff0087;
    color: #ff0087;
}

.sg-page-nav-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #f8fafc;
    border-color: #e2e8f0;
}

.sg-page-numbers {
    display: flex;
    align-items: center;
    gap: 3px;
}

.sg-page-num-btn {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.sg-page-num-btn:hover:not(.active) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.sg-page-num-btn.active {
    background: #ff0087 !important;
    border-color: #ff0087 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(255, 0, 135, 0.3) !important;
}

.sg-page-dots {
    font-size: 11px;
    color: #94a3b8;
    padding: 0 2px;
}

.sg-page-count-badge {
    font-size: 10.5px;
    font-weight: 600;
    color: #64748b;
    background: #e2e8f0;
    padding: 2px 7px;
    border-radius: 5px;
    white-space: nowrap;
}

.sg-spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid #e2e8f0;
    border-top-color: #ff0087;
    border-radius: 50%;
    animation: sgSpin 0.7s linear infinite;
}

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

/* GUARANTEED GRID: 2 COLUMNS ON MOBILE, EXACTLY 4 COLUMNS ON DESKTOP */
.sg-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 540px) {
    .sg-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 12px;
    }
}

/* ITEM CARD FIXED EQUAL SQUARE SIZE WITH DARK BACKGROUND */
.sg-item-card {
    position: relative;
    background: #0f172a;
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    aspect-ratio: 1 / 1;
    width: 100%;
    height: auto;
    min-height: 0;
    box-sizing: border-box;
}

.sg-item-card:hover {
    border-color: #ff0087;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 28px -4px rgba(255, 0, 135, 0.35);
}

.sg-item-thumb-wrap {
    width: 100%;
    height: 100%;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-radius: inherit;
}

/* Squeeze & Fit Image/Video Nicely Into Square Box */
.sg-item-thumb-wrap img,
.sg-item-thumb-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    display: block;
    border-radius: inherit;
    transition: transform 0.3s ease;
    background: #0f172a;
}

.sg-item-name-tag {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.94) 0%, rgba(15, 23, 42, 0.75) 65%, transparent 100%);
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 600;
    padding: 16px 6px 6px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 2;
    text-align: center;
}

.sg-item-card:hover .sg-item-thumb-wrap img,
.sg-item-card:hover .sg-item-thumb-wrap video {
    transform: scale(1.06);
}

.sg-item-tag {
    display: none !important;
}

/* DARK TRANSLUCENT BLUR HOVER OVERLAY - NO WHITE WASH! */
.sg-item-overlay-badge {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45); /* SLIGHT TRANSLUCENT OVERLAY, NOT OPAQUE WHITE! */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: inherit; /* IDENTICAL BORDER RADIUS AS CARD */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.22s ease;
    color: #ffffff; /* CRISP WHITE TEXT WITH GLOW */
    font-weight: 700;
    font-size: 13px;
    gap: 6px;
    z-index: 3;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.sg-item-card:hover .sg-item-overlay-badge {
    opacity: 1;
}

/* LIGHTBOX CLOSE BUTTON (PERFECTLY CENTERED CIRCLE + RED HOVER / ACTIVE BG) */
#ai-media-lightbox-modal .lightbox-close-btn {
    position: fixed;
    top: 24px;
    right: 28px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    z-index: 1000000 !important;
    padding: 0 !important;
    line-height: 1 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

#ai-media-lightbox-modal .lightbox-close-btn:hover {
    background: #ef4444 !important; /* VIBRANT RED ON HOVER */
    border-color: #ef4444 !important;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}

#ai-media-lightbox-modal .lightbox-close-btn:active {
    background: #dc2626 !important;
    transform: scale(0.94);
}

.sg-item-info {
    padding: 4px 6px;
    background: #ffffff;
    height: 35px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.sg-item-name {
    font-size: 10.5px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.2;
}

.sg-popover-footer {
    padding: 7px 16px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-textarea {
    flex: 1;
    resize: none;
    border: none !important;
    background: transparent;
    font-size: 14px;
    font-weight: 400;
    color: #0f172a;
    line-height: 1.6;
    height: 24px;
    max-height: 140px;
    overflow-y: hidden;
    font-family: 'Inter', -apple-system, sans-serif;
}

.chat-textarea::-webkit-scrollbar {
    width: 6px;
}

.chat-textarea::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.chat-textarea::-webkit-scrollbar-track {
    background: transparent;
}

.chat-textarea::placeholder {
    color: #9ca3af;
}

.chat-textarea:focus {
    outline: none !important;
    box-shadow: none !important;
}

.send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ff0087;
    color: #ffffff;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.send-btn:hover {
    background: #e0007a;
    transform: scale(1.04);
}

.send-btn.btn-stop-mode {
    background: #ef4444;
}

.send-btn.btn-stop-mode:hover {
    background: #dc2626;
}

.input-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 2px 0;
}

.input-hint {
    font-size: 11px;
    color: #9ca3af;
}

.panel-resize-handle {
    width: 6px;
    background: transparent;
    cursor: col-resize;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.panel-resize-handle::after {
    content: '';
    width: 2px;
    height: 40px;
    background: #d1d5db;
    border-radius: 2px;
    transition: all 0.15s;
}

.panel-resize-handle:hover::after,
.panel-resize-handle.resizing::after {
    width: 3px;
    height: 60px;
    background: #ff0087;
}

.ai-canvas-panel {
    height: 100%;
    display: none;
    flex-direction: column;
    background: #ffffff;
    border-left: 1px solid #e8eaed;
    overflow: hidden;
    transition: none;
    min-width: 0;
}

.workspace-body.layout-split .ai-chat-panel {
    flex: 1 1 0%;
    min-width: 280px;
}

.workspace-body.layout-split .ai-canvas-panel {
    width: 60%;
    flex: 0 0 60%;
}

.workspace-body.layout-canvas-only .ai-canvas-panel {
    width: 100% !important;
    flex: 1 1 auto;
}

.workspace-body.layout-chat-only .ai-canvas-panel {
    display: none !important;
}

.workspace-body.is-resizing-panels iframe {
    pointer-events: none !important;
    user-select: none !important;
}

.workspace-body:not(.layout-split) .panel-resize-handle {
    display: none;
}

.ai-canvas-panel.slide-open {
    animation: slideInFromRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInFromRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Canvas Top Bar with Viewport Switcher */
.canvas-top-bar {
    height: auto;
    min-height: 48px;
    background: #ffffff;
    border-bottom: 1px solid #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    flex-shrink: 0;
    gap: 8px;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.viewport-switcher,
.canvas-view-tabs,
.canvas-close-box {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
    height: 32px;
    box-sizing: border-box;
}

.viewport-btn,
.canvas-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: none !important;
    background: transparent;
    height: 26px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.viewport-btn.active,
.canvas-tab-btn.active {
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.viewport-btn:hover:not(.active),
.canvas-tab-btn:hover:not(.active) {
    color: #374151;
}

.btn-close-canvas {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    background: #ffffff !important;
    color: #0f172a !important;
    width: 26px !important;
    height: 26px !important;
    padding: 0 !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.btn-close-canvas:hover {
    color: #ef4444 !important;
    background: #ffffff !important;
    transform: scale(1.05);
}

.viewport-switcher-divider {
    width: 1px;
    height: 18px;
    background: #e2e8f0;
    margin: 0 2px;
    flex-shrink: 0;
}

.viewport-btn-icon-only {
    padding: 5px 7px;
}

/* Canvas iframe area */
.canvas-iframe-container {
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f7f8;
    overflow: auto;
    position: relative;
}

.canvas-iframe-wrapper {
    width: 100%;
    height: 100%;
    max-width: 768px;
    /* Default = Tablet, JS ile dinamik güncellenir */
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    transition: max-width 0.25s ease, width 0.25s ease;
    position: relative;
}

/* Tarayıcı (Desktop/Full) modunda kutu tamamen paneli doldurur */
.canvas-iframe-container:has(.viewport-browser),
.canvas-iframe-container.viewport-browser-active {
    padding: 0;
}

.canvas-iframe-wrapper.viewport-browser {
    max-width: 100%;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
}

.canvas-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* HTML Code Inspector */
.code-editor-container {
    width: 100%;
    height: 100%;
    background: #0f172a;
    color: #f8fafc;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.code-editor-header {
    padding: 10px 16px;
    background: #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    flex-shrink: 0;
}

.btn-copy-code {
    background: #334155;
    color: #ffffff;
    border: none !important;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background 0.2s;
}

.btn-copy-code:hover {
    background: #475569;
}

.btn-copy-code.copy-success {
    background: #10b981;
}

.code-pre-box {
    flex: 1;
    padding: 16px;
    margin: 0;
    overflow: auto;
    font-family: 'Fira Code', Consolas, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #38bdf8;
}

/* Kod editörü — ince, koyu temaya uygun scrollbar (kaba varsayılan yerine) */
.code-pre-box,
.code-edit-box {
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}

.code-pre-box::-webkit-scrollbar,
.code-edit-box::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.code-pre-box::-webkit-scrollbar-track,
.code-edit-box::-webkit-scrollbar-track {
    background: transparent;
}

.code-pre-box::-webkit-scrollbar-thumb,
.code-edit-box::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 8px;
    border: 2px solid #0f172a;
}

.code-pre-box::-webkit-scrollbar-thumb:hover,
.code-edit-box::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.code-pre-box::-webkit-scrollbar-corner,
.code-edit-box::-webkit-scrollbar-corner {
    background: transparent;
}

.custom-modal {
    position: fixed;
    display: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 20px;
    z-index: 99999;
    padding: 28px 32px;
    width: 460px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.custom-modal-title {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
}

.custom-modal-close {
    cursor: pointer;
    font-size: 20px;
    color: #9ca3af;
    border: none !important;
    background: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s;
    font-family: sans-serif;
}

.custom-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.custom-modal-label {
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 8px;
    display: block;
}

.custom-modal-input {
    width: 100%;
    padding: 11px 14px;
    background: #f9fafb;
    border: 1.5px solid #e8eaed !important;
    border-radius: 10px;
    font-size: 13px;
    color: #0f172a;
    font-family: 'Inter', sans-serif;
    margin-bottom: 14px;
    transition: border-color 0.2s;
}

.custom-modal-input:focus {
    border-color: #ff0087 !important;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 0, 135, 0.1) !important;
}

.dns-info-card {
    background: #f9fafb;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.dns-info-title {
    font-size: 11px;
    font-weight: 800;
    color: #374151;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dns-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding: 4px 0;
    border-bottom: 1px solid #f3f4f6;
}

.dns-row:last-of-type {
    border-bottom: none;
}

.dns-label {
    color: #6b7280;
    font-weight: 500;
}

.dns-val {
    color: #0f172a;
    font-family: 'Fira Code', monospace;
    font-weight: 700;
    font-size: 11px;
}

.dns-ssl-badge {
    font-size: 11px;
    color: #16a34a;
    font-weight: 700;
    margin-top: 8px;
}

.custom-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.btn-modal-cancel {
    background: #f9fafb;
    border: 1px solid #e8eaed !important;
    padding: 9px 18px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
}

.btn-modal-cancel:hover {
    background: #f3f4f6;
}

.btn-modal-primary {
    background: #0f172a;
    border: none !important;
    padding: 9px 22px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
}

.btn-modal-primary:hover {
    background: #1e293b;
}

.btn-modal-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pre-Publish Modal Stepper Responsive Styles */
.prepublish-stepper-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 14px;
}

.stepper-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stepper-item.is-completed {
    cursor: pointer;
}

.stepper-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stepper-item.is-completed .stepper-badge {
    background: #10b981;
    color: #ffffff;
}

.stepper-item.is-active .stepper-badge {
    background: #0f172a;
    color: #ffffff;
}

.stepper-item.is-pending {
    opacity: 0.55;
}

.stepper-item.is-pending .stepper-badge {
    background: #cbd5e1;
    color: #475569;
}

.stepper-label {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
}

.stepper-item.is-pending .stepper-label {
    font-weight: 700;
    color: #475569;
}

.stepper-arrow {
    color: #10b981;
    font-weight: 700;
    font-size: 14px;
    padding: 0 4px;
    flex-shrink: 0;
}

.stepper-arrow.is-pending {
    color: #94a3b8;
}

.stepper-text-mobile {
    display: none;
}

@media (max-width: 640px) {
    .prepublish-stepper-header {
        padding: 8px 10px;
        gap: 10px;
    }
    
    .stepper-item {
        gap: 6px;
    }
    
    .stepper-label {
        font-size: 12px;
    }
    
    .stepper-text-full {
        display: none !important;
    }
    
    .stepper-text-mobile {
        display: inline !important;
    }
}

.login-km {
    position: fixed;
    display: none;
    color: #000;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 20px;
    z-index: 99999;
    padding: 28px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
    animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.drag-over {
    background: #fff0f7 !important;
}

.chat-center-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 32px 16px;
    gap: 0;
    width: 100%;
    box-sizing: border-box;
}

.chat-center-stage .chat-hero {
    margin-top: auto;
    padding: 16px 0 20px;
    max-width: 640px;
    width: 100%;
}

.chat-center-stage > div:last-child {
    margin-bottom: auto;
}

.chat-center-stage .onboarding-card {
    max-width: 640px;
    width: 100%;
    margin: 0;
}

.chat-stream-box {
    display: none;
}

.ai-chat-panel.has-messages .chat-stream-box {
    display: flex;
    animation: streamFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-panel.has-messages .chat-center-stage {
    display: none;
}

@keyframes centerStageDismiss {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-32px) scale(0.96);
    }
}

.chat-center-stage.stage-dismissing {
    animation: centerStageDismiss 0.38s cubic-bezier(0.4, 0, 1, 1) forwards;
    pointer-events: none;
    overflow: hidden;
}

@keyframes streamFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-controls-zone {
    flex-shrink: 0;
}

.ai-chat-panel:not(.has-messages) .chat-controls-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 40px 24px;
    width: 100%;
    flex-shrink: 0;
}

.ai-chat-panel:not(.has-messages) #chat-input-area {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 640px;
}

.ai-chat-panel:not(.has-messages) #chat-input-area .input-wrapper {
    max-width: 640px;
    width: 100%;
}

.ai-chat-panel:not(.has-messages) .ai-stepper-container {
    max-width: 640px;
    width: 100%;
    margin: 0 auto 8px;
}

.ai-chat-panel:not(.has-messages) .input-bottom-row {
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
}

.ai-chat-panel:not(.has-messages) .chat-input-card {
    width: 100%;
    max-width: 640px;
}

.ai-chat-panel.has-messages .chat-controls-zone {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: transparent;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 24px 16px;
}

.ai-chat-panel.has-messages .chat-controls-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to bottom, rgba(250, 250, 251, 0) 0%, rgb(250 250 251 / 0%) 28%, rgb(250 250 251 / 0%) 55%, rgb(250 250 251 / 0%) 100%);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: none;
}

.ai-chat-panel.has-messages .chat-controls-zone .chat-input-card,
.ai-chat-panel.has-messages .chat-controls-zone .ai-stepper-container {
    pointer-events: auto;
}

.ai-chat-panel.has-messages #chat-input-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0;
    border-top: none;
    background: transparent;
    pointer-events: none;
}

.ai-chat-panel.has-messages #chat-input-area .input-wrapper {
    max-width: 760px;
    width: 100%;
    pointer-events: auto;
}

.ai-chat-panel.has-messages .input-bottom-row {
    max-width: 760px;
    width: 100%;
    pointer-events: auto;
}

.ai-chat-panel.has-messages .chat-input-card {
    width: 100%;
    max-width: 760px;
    background: transparent;
    pointer-events: auto;
    margin-top: 0;
}

.ai-chat-panel.has-messages .ai-stepper-container {
    max-width: 760px;
    width: 100%;
    margin-bottom: 4px;
}

.tree-pages-container {
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.tree-pages-container::-webkit-scrollbar {
    width: 6px;
}

.tree-pages-container::-webkit-scrollbar-track {
    background: transparent;
}

.tree-pages-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
    border: 1.5px solid #ffffff;
}

.tree-pages-container::-webkit-scrollbar-thumb:hover {
    background: #b0b7c3;
}

.tree-page-group {
    border-radius: 9px;
    transition: background 0.15s ease;
}

.tree-page-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    border: 1px solid transparent !important;
    position: relative;
    transition: all 0.15s ease;
    user-select: none;
    min-height: 42px;
}

.tree-page-header:hover {
    background: #f8fafc;
    color: #0f172a;
}

.tree-page-group.active > .tree-page-header {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 700;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.tree-page-group.active > .tree-page-header::before {
    display: none;
}

.tree-toggle-icon {
    font-size: 10px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.tree-page-group:not(.open) .tree-toggle-icon {
    transform: rotate(-90deg);
}

.tree-page-icon,
.chat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: #64748b;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.tree-page-header:hover .tree-page-icon,
.tree-chat-item:hover .chat-icon {
    color: #0f172a;
}

.tree-page-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-tree-add-chat {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.tree-page-header:hover .btn-tree-add-chat {
    opacity: 1;
}

.btn-tree-add-chat:hover {
    background: #4f46e5;
    color: #ffffff;
}

.tree-chats-sublist {
    margin-left: 20px;
    padding-left: 10px;
    border-left: 1px dashed #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 3px;
    margin-bottom: 7px;
}

.tree-page-group:not(.open) .tree-chats-sublist {
    display: none;
}

.tree-chat-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
    transition: all 0.15s ease;
    min-height: 36px;
}

.tree-standalone-chats-list .tree-chat-item {
    padding: 12px 12px;
    min-height: 40px;
}

.tree-chats-sublist .tree-chat-item {
    padding: 8px 12px;
    min-height: 36px;
}

.tree-chat-item:hover {
    background: #f8fafc;
    color: #0f172a;
}

.tree-chat-item.active {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 700;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.tree-chat-item.active::before {
    display: none;
}

.chat-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#payment-test-modal {
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
}

.btn-tree-menu,
.btn-chat-menu {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    background: transparent;
    border: none !important;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
    letter-spacing: -1px;
    padding: 0;
    margin-left: auto;
}

.tree-page-header:hover .btn-tree-menu,
.tree-chat-item:hover .btn-chat-menu {
    opacity: 1;
}

.btn-tree-menu:hover,
.btn-chat-menu:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.tree-context-menu {
    position: fixed;
    z-index: 999999;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 150px;
    animation: menuPop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes menuPop {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tree-context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    background: transparent;
    border: none !important;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.tree-context-menu-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.tree-context-menu-item.danger-action {
    color: #ef4444;
}

.tree-context-menu-item.danger-action:hover {
    background: #fef2f2;
    color: #dc2626;
}

.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 9998 !important;
    display: none;
    transition: opacity 0.2s ease;
}

.custom-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999 !important;
    display: none;
    width: 90%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .custom-modal {
        width: 92vw;
        max-width: 92vw;
        padding: 20px;
        border-radius: 14px;
        max-height: 88vh;
        top: 50% !important;
        left: 50% !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
    }

    .custom-modal-title {
        font-size: 15px;
    }

    .custom-modal-actions {
        flex-wrap: wrap;
    }

    .btn-modal-cancel,
    .btn-modal-primary {
        flex: 1;
        text-align: center;
        padding: 10px 14px;
    }
}

@media (max-width: 640px) {
    .custom-modal {
        width: 94vw !important;
        max-width: 94vw !important;
        padding: 18px 14px !important;
        border-radius: 16px !important;
        left: 50% !important;
        top: 50% !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
        max-height: 88vh !important;
        box-sizing: border-box !important;
    }

    .custom-modal-title {
        font-size: 15px !important;
    }

    /* Collapse multi-column form grids to 1 column on mobile */
    .custom-modal [style*="grid-template-columns"],
    .modal-grid-row {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .custom-modal-header-sub {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    /* Modal Footer Actions: Vertical stack with primary action on top */
    .custom-modal-actions {
        display: flex !important;
        flex-direction: column-reverse !important;
        gap: 8px !important;
        width: 100% !important;
        margin-top: 14px !important;
        padding-top: 10px !important;
        box-sizing: border-box !important;
    }

    .custom-modal-actions button,
    .custom-modal-actions a,
    .btn-modal-cancel,
    .btn-modal-primary {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 auto !important;
        text-align: center !important;
        justify-content: center !important;
        padding: 11px 16px !important;
        font-size: 13px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }
}

@media (max-width: 480px) {
    .custom-modal {
        width: 95vw !important;
        max-width: 95vw !important;
        padding: 16px 14px !important;
        left: 50% !important;
        top: 50% !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
        max-height: 90vh !important;
        border-radius: 16px !important;
    }

    @keyframes modalPop {
        from {
            opacity: 0;
            transform: translate(-50%, -46%) scale(0.97);
        }

        to {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }
}

@media (max-width: 1024px) {
    .workspace-top-bar {
        padding: 0 12px;
        gap: 8px;
        height: auto;
        min-height: 56px;
        flex-wrap: wrap;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .workspace-top-left {
        order: 1;
    }

    .workspace-layout-toggle {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .layout-toggle-btn {
        flex: 1;
        text-align: center;
        padding: 6px 6px;
        font-size: 11px;
        white-space: normal;
        line-height: 1.2;
    }

    .workspace-top-right {
        order: 2;
        margin-left: auto;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
    }

    .btn-topbar-action,
    .btn-publish {
        font-size: 11px;
        padding: 6px 10px;
        gap: 4px;
    }

    /* Split modda paneller yan yana sığmaz; dikey yığın + resize handle kapalı */
    .workspace-body.layout-split {
        flex-direction: column;
    }

    .workspace-body.layout-split .ai-chat-panel {
        flex: 1 1 50%;
        min-height: 0;
    }

    .workspace-body.layout-split .ai-canvas-panel {
        width: 100% !important;
        flex: 1 1 50%;
        border-left: none;
        border-top: 1px solid #e8eaed;
    }

    .workspace-body.layout-split .panel-resize-handle {
        display: flex !important;
        width: 100% !important;
        height: 18px !important;
        cursor: row-resize !important;
        background: #ffffff !important;
        border-top: 1px solid #e2e8f0 !important;
        border-bottom: none !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        user-select: none !important;
        touch-action: none !important;
        z-index: 10 !important;
        margin: 0 !important;
    }

    .workspace-body.layout-split .panel-resize-handle::after {
        content: '' !important;
        width: 44px !important;
        height: 4px !important;
        border-radius: 4px !important;
        background: #cbd5e1 !important;
        transition: background 0.15s ease, width 0.15s ease !important;
    }

    .workspace-body.layout-split .panel-resize-handle:hover::after,
    .workspace-body.layout-split .panel-resize-handle.resizing::after {
        width: 58px !important;
        height: 5px !important;
        background: #ff0087 !important;
    }

    .workspace-body:not(.layout-split) .panel-resize-handle {
        display: none !important;
    }

    .canvas-top-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 10px;
        gap: 8px;
    }

    .canvas-top-controls {
        order: 1;
        width: 100%;
        justify-content: space-between !important;
        margin-left: 0 !important;
    }

    .viewport-switcher {
        order: 2;
        width: 100%;
        justify-content: center;
    }
}

.mobile-label {
    display: none;
}

.desktop-label {
    display: inline;
}

@media (max-width: 640px) {
    .layout-toggle-btn {
        font-size: 10px;
        padding: 6px 4px;
    }

    .mobile-label {
        display: inline;
    }

    .desktop-label {
        display: none;
    }

    .btn-topbar-action-label {
        display: inline-block;
        font-size: 11px;
    }

    .btn-topbar-action,
    .btn-publish {
        padding: 6px 8px;
        font-size: 11px;
        gap: 4px;
    }

    .btn-publish .btn-topbar-action-label {
        display: inline-block;
    }

    .chat-center-stage {
        padding: 16px 12px 24px !important;
    }

    .chat-hero {
        padding: 16px 12px 12px !important;
    }

    .onboarding-card {
        margin: 0 4px !important;
    }

    .ai-top-toast {
        top: 16px;
        left: 50%;
        transform: translateX(-50%) translateY(-15px);
        width: calc(100vw - 24px) !important;
        max-width: 380px !important;
        padding: 12px 16px !important;
        border-radius: 14px !important;
        font-size: 13px !important;
        line-height: 1.4 !important;
        box-sizing: border-box !important;
        justify-content: flex-start !important;
        box-shadow: 0 12px 32px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
    }

    .ai-top-toast.show {
        transform: translateX(-50%) translateY(0) !important;
    }
}

@media (max-width: 420px) {
    .workspace-top-bar {
        padding: 8px 10px;
        gap: 6px;
    }

    .workspace-top-left {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 6px;
        order: 1;
    }

    .sidebar-hamburger-btn {
        flex-shrink: 0;
    }

    .workspace-top-left .btn-topbar-action,
    .workspace-top-left .btn-site-preview,
    .workspace-top-left #btn-topbar-settings {
        flex: 1;
        min-width: 0;
        justify-content: center;
        text-align: center;
    }

    .workspace-top-right {
        width: 100%;
        display: flex;
        gap: 6px;
        order: 2;
        margin-left: 0 !important;
        margin-top: 2px;
    }

    .workspace-top-right .btn-topbar-action,
    .workspace-top-right .btn-publish {
        flex: 1;
        min-width: 0;
        justify-content: center;
        text-align: center;
    }

    .workspace-layout-toggle {
        order: 3;
        width: 100%;
        margin-top: 2px;
    }
}

@media (max-width: 380px) {
    .workspace-top-left .current-page-label {
        max-width: 90px;
    }

    .layout-toggle-btn {
        font-size: 9px;
        padding: 6px 2px;
    }
}

.clipboard-paste-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(16px);
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0f172a;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.06);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.22s ease, transform 0.22s ease;
    white-space: nowrap;
}

.clipboard-paste-toast svg {
    color: #ff0087;
    flex-shrink: 0;
}

.clipboard-paste-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
    .clipboard-paste-toast {
        bottom: 84px;
        font-size: 12px;
        padding: 9px 14px;
    }
}

/* ============================================================
   DOMAIN MANAGEMENT & DNS STEP-BY-STEP MODAL STYLES
============================================================ */
.domain-stepper-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 18px;
    padding-bottom: 12px;
}

.domain-step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 99px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.domain-step-item .step-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.domain-step-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.domain-step-item.active {
    background: #ff0087;
    color: #ffffff;
    border-color: #ff0087;
}

.domain-step-item.active .step-badge {
    background: #ffffff;
    color: #ff0087;
}

.domain-step-line {
    flex: 1;
    max-width: 60px;
    height: 2px;
    background: #e2e8f0;
    border-radius: 2px;
}

.domain-step-content {
    display: none;
}

.domain-step-content.active {
    display: block;
    animation: streamFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.domain-acquisition-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.domain-acquisition-tab {
    text-align: left;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.domain-acquisition-tab:hover,
.domain-acquisition-tab.active {
    border-color: #ff0087;
    background: #fff7fb;
    box-shadow: 0 6px 18px rgba(255, 0, 135, 0.08);
}

.domain-tab-title {
    display: block;
}

.domain-tab-title {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
}

.domain-entry-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 8px;
}

.domain-entry-row.has-period {
    grid-template-columns: minmax(220px, 1fr) minmax(170px, 210px) auto;
}

.domain-field-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.domain-field-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    line-height: 1.2;
}

.domain-field-label-spacer {
    visibility: hidden;
}

.domain-entry-row .custom-modal-input,
.domain-field-col .custom-modal-input {
    margin-bottom: 0;
    min-height: 48px;
    height: 48px;
    font-size: 14px;
    font-weight: 600;
    flex: 1;
}

.domain-field-col .btn-modal-primary {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Custom "Kayıt/Yenileme süresi" dropdown ---------- */
.domain-period-select {
    position: relative;
    flex: 1;
}

.domain-period-select-trigger {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 14px;
    background: #f9fafb;
    border: 1.5px solid #e8eaed !important;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.domain-period-select-trigger:hover {
    border-color: #d1d5db !important;
}

.domain-period-select.open .domain-period-select-trigger {
    border-color: #ff0087 !important;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 0, 135, 0.1) !important;
}

.domain-period-select-trigger svg {
    flex-shrink: 0;
    color: #94a3b8;
    transition: transform 0.15s;
}

.domain-period-select.open .domain-period-select-trigger svg {
    transform: rotate(180deg);
    color: #ff0087;
}

.domain-period-select-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
    padding: 6px;
    z-index: 40;
    max-height: 260px;
    overflow-y: auto;
}

.domain-period-select.open .domain-period-select-panel {
    display: block;
}

/* Panel body'ye taşındığında (portal) fixed konumlanır — modal'ın
   overflow-y:auto kesme alanının dışında, ekrana göre serbestçe yerleşir.
   Bu durumda artık ".domain-period-select.open" ile ebeveyn-çocuk ilişkisi
   kalmadığından (panel body'nin doğrudan altında), görünürlüğü doğrudan
   bu sınıf üzerinden veriyoruz; JS panel'i portale taşırken bu sınıfı ekliyor. */
.domain-period-select-panel.domain-period-panel-fixed {
    display: block;
    position: fixed;
    z-index: 100000;
}

.domain-period-option {
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.domain-period-option:hover {
    background: #fdf2f8;
    color: #be185d;
}

.domain-period-option.selected {
    background: #ff0087;
    color: #ffffff;
}

.domain-period-option-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 2px;
}

.domain-period-option-custom {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    cursor: default;
}

.domain-period-option-custom > span {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.domain-period-option-custom.selected {
    background: #fdf2f8;
}

.domain-period-option-custom.selected > span {
    color: #be185d;
}

.domain-period-custom-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    border: 1.5px solid #e8eaed;
    border-radius: 8px;
    padding: 6px 10px;
}

.domain-period-custom-input-wrap:focus-within {
    border-color: #ff0087;
    background: #ffffff;
}

.domain-period-custom-input-wrap input {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    font-family: 'Inter', sans-serif;
    padding: 2px 0;
    -moz-appearance: textfield;
}

.domain-period-custom-input-wrap input::-webkit-outer-spin-button,
.domain-period-custom-input-wrap input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.domain-period-custom-input-wrap span {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    flex-shrink: 0;
}

.dns-managed-domain-info {
    background: #eef6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    color: #1e3a8a;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.dns-managed-domain-info strong,
.dns-managed-domain-info span {
    display: block;
}

.dns-empty-state {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
    padding: 12px;
}

.dns-empty-state.compact {
    padding: 8px 10px;
}

.domain-registrar-panel {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    margin-bottom: 14px;
    overflow: hidden;
}

.domain-settings-tabs {
    display: flex;
    gap: 4px;
    padding: 6px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.domain-settings-tab {
    border: 0;
    background: transparent;
    color: #64748b;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 800;
    padding: 7px 12px;
    cursor: pointer;
}

.domain-settings-tab.active,
.domain-settings-tab:hover {
    background: #0f172a;
    color: #ffffff;
}

.domain-settings-panel {
    display: none;
    padding: 12px;
}

.domain-settings-panel.active {
    display: block;
}

.managed-dns-form {
    display: grid;
    grid-template-columns: 86px minmax(90px, 0.7fr) minmax(160px, 1.6fr) 90px auto;
    gap: 8px;
    align-items: center;
}

.managed-dns-form .custom-modal-input,
#domain-nameservers-input {
    margin-bottom: 0;
}

.managed-dns-list {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.managed-dns-row {
    display: grid;
    grid-template-columns: 58px minmax(70px, 0.8fr) minmax(140px, 1.6fr) 62px auto;
    gap: 8px;
    align-items: center;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    padding: 8px;
    font-size: 12px;
}

.managed-dns-row code,
.domain-auth-code-box {
    color: #0f172a;
    font-family: 'Fira Code', monospace;
    word-break: break-all;
}

.btn-modal-primary.compact {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 12px;
}

.domain-transfer-row,
.domain-transfer-code-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.domain-transfer-row span {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
}

.domain-transfer-code-row {
    justify-content: flex-start;
}

.domain-auth-code-box {
    display: block;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    font-size: 12px;
}

.domain-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #f9fafb;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    transition: all 0.15s ease;
}

.domain-item-card:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.domain-item-card.is-primary {
    border-color: #ff0087;
    background: #fff0f7;
}

.domain-name-text {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.primary-badge {
    font-size: 10px;
    font-weight: 800;
    background: #ff0087;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dns-status-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
}

.dns-status-pill.pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.dns-status-pill.active {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.dns-records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.dns-records-table th {
    background: #f8fafc;
    padding: 9px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.dns-records-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

.dns-records-table tr:last-child td {
    border-bottom: none;
}

.dns-type-tag {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    font-weight: 800;
    background: #f1f5f9;
    color: #475569;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
    border: 1px solid #e2e8f0;
}

.dns-type-tag.ssl {
    background: #fdf2f8;
    color: #ff0087;
    border-color: #fbcfe8;
}

.dns-code-text {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #0f172a;
    word-break: break-all;
}

.dns-code-text.highlight {
    color: #475569;
    font-weight: 700;
}

.dns-code-text.small-font {
    font-size: 10px;
}

@media (max-width: 640px) {
    .domain-acquisition-tabs,
    .domain-entry-row,
    .domain-entry-row.has-period,
    .managed-dns-form,
    .managed-dns-row {
        grid-template-columns: 1fr;
    }

    .domain-field-label-spacer {
        display: none;
    }

    .domain-period-select-panel {
        left: 0;
        right: 0;
    }
}

/* ============================================================
   HELP & SUPPORT MODAL — contact channel rows
============================================================ */
.help-contact-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid #e8eaed;
    text-decoration: none;
    color: #0f172a;
    transition: all 0.15s ease;
}

.help-contact-row:hover {
    background: #fdf2f8;
    border-color: #fbcfe8;
}

.help-contact-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.help-contact-row:hover .help-contact-icon {
    border-color: #ff0087;
}

.help-contact-icon.brand-whatsapp {
    color: #25d366;
}

.help-contact-title {
    font-weight: 700;
    font-size: 14px;
    color: #0f172a;
}

.help-contact-value {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.btn-copy-dns-row {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-copy-dns-row:hover {
    background: #ff0087;
    color: #ffffff;
    border-color: #ff0087;
}

/* Tree Section Headers (SOHBETLER & WEB SİTESİ & SAYFALARINIZ) */
.tree-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px 4px 4px;
    margin-top: 4px;
}

.tree-section-title {
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-add-tree-item {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
}

.btn-add-tree-item:hover {
    background: #ff0087;
    color: #ffffff;
    border-color: #ff0087;
}

.tree-standalone-chats-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
    margin-bottom: 12px;
    margin-left: 0 !important;
    padding-left: 0 !important;
    border-left: none !important;
    max-height: 210px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.tree-standalone-chats-list::-webkit-scrollbar {
    width: 4px;
}

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

.tree-standalone-chats-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.tree-standalone-chats-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive Max-Height for Laptop / Tablet / Mobile Screens */
@media (max-height: 800px) {
    .tree-standalone-chats-list {
        max-height: 160px;
    }
}

@media (max-width: 1024px) {
    .tree-standalone-chats-list {
        max-height: 170px;
    }
}


/* ── Floating Brand Slots Widget ─────────────────────────────────────── */

/* ── Floating Brand Slots Widget ─────────────────────────────────────── */

#floating-brand-slots-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    user-select: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 10px 28px -4px rgba(15, 23, 42, 0.12), 0 2px 8px -2px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease;
}

#slot-favicon-badge,
#slot-logo-badge {
    display: none !important;
}

/* Slot buttons: clean minimal look with soft border */
#slot-favicon-btn,
#slot-logo-btn {
    position: relative;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
    transition: all 0.2s ease !important;
}

#slot-favicon-btn:hover,
#slot-logo-btn:hover {
    border-color: #ff0087 !important;
    box-shadow: 0 4px 14px rgba(255, 0, 135, 0.14) !important;
    transform: translateY(-1px) !important;
}

/* Narrow screens: push widget higher so it never sits on chat input row */
@media (max-width: 768px) {
    #floating-brand-slots-widget {
        bottom: 110px !important;
        right: 12px !important;
    }
}

@media (max-width: 540px) {
    #floating-brand-slots-widget {
        bottom: 130px !important;
        right: 8px !important;
    }
}

/* =========================================================
   PRE-PUBLISH AUDIT MODAL BUTTON HOVER STYLES
   ========================================================= */
.btn-audit-toggle-unselected {
    background: #ffffff !important;
    color: #374151 !important;
    border: 1.5px solid #e2e8f0 !important;
    transition: all 0.15s ease !important;
}

.btn-audit-toggle-unselected:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    transform: translateY(-1px);
}

.btn-audit-toggle-selected {
    background: #0f172a !important;
    color: #ffffff !important;
    border: 1.5px solid #0f172a !important;
    transition: all 0.15s ease !important;
}

.btn-audit-toggle-selected:hover {
    background: #1e293b !important;
    border-color: #1e293b !important;
    transform: translateY(-1px);
}

.btn-audit-ai-gradient {
    background: linear-gradient(90deg, #ff0087 0%, #e11d48 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(255, 0, 135, 0.2) !important;
    transition: all 0.15s ease !important;
}

.btn-audit-ai-gradient:hover {
    background: linear-gradient(90deg, #e00077 0%, #be123c 100%) !important;
    box-shadow: 0 4px 14px rgba(255, 0, 135, 0.35) !important;
    transform: translateY(-1px);
}

#btn-link-audit-save-only {
    transition: all 0.15s ease !important;
}

#btn-link-audit-save-only:hover {
    background: #f8fafc !important;
    border-color: #0f172a !important;
    color: #0f172a !important;
    transform: translateY(-1px);
}

#btn-link-audit-next-stage:not(:disabled):hover,
#btn-seo-stage2-publish:hover {
    background: #1e293b !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.28) !important;
    transform: translateY(-1px);
}

#link-audit-modal *,
#seo-audit-modal * {
    text-decoration: none !important;
}


