/* ============================================
   CONTRACTCODE ASİSTANI — DARK & LIGHT THEME CHATBOT
   ============================================ */

/* CSS Custom Properties */
:root {
    /* Dark Theme Colors */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2236;
    --bg-surface: #1e293b;
    --bg-surface-hover: #253347;
    --bg-chat: #0d1320;

    /* Accent Colors */
    --accent-primary: #6c63ff;
    --accent-primary-hover: #7b73ff;
    --accent-secondary: #00d2ff;
    --accent-gradient: linear-gradient(135deg, #6c63ff 0%, #00d2ff 100%);
    --accent-gradient-soft: linear-gradient(135deg, rgba(108,99,255,0.15) 0%, rgba(0,210,255,0.08) 100%);

    /* Text Colors */
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-muted: #475569;

    /* Message Colors */
    --user-bubble: linear-gradient(135deg, #6c63ff 0%, #5a52e0 100%);
    --user-bubble-text: #ffffff;
    --bot-bubble: #1e293b;
    --bot-bubble-text: #e2e8f0;

    /* Border & Shadow */
    --border-color: rgba(148, 163, 184, 0.08);
    --border-color-strong: rgba(148, 163, 184, 0.15);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(108,99,255,0.15);

    /* Source badge colors */
    --mevzuat-color: #10b981;
    --mevzuat-bg: rgba(16, 185, 129, 0.1);
    --emsal-color: #f59e0b;
    --emsal-bg: rgba(245, 158, 11, 0.1);

    /* Layout */
    --sidebar-width: 300px;
    --source-panel-width: 340px;
    --header-height: 64px;
    --input-area-height: auto;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.7rem;
    --font-size-sm: 0.8rem;
    --font-size-base: 0.9rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 50%;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    line-height: 1.6;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    outline: none;
}

button:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

textarea {
    font-family: inherit;
    resize: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.15);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.25);
}

/* ============================================
   BACKGROUND PARTICLES
   ============================================ */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--accent-primary);
    opacity: 0;
    animation: particleFloat 15s infinite;
}

@keyframes particleFloat {
    0% { opacity: 0; transform: translateY(100vh) scale(0); }
    10% { opacity: 0.3; }
    90% { opacity: 0.1; }
    100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* ============================================
   APP CONTAINER
   ============================================ */
.app-container {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-slow), opacity var(--transition-slow);
    z-index: 30;
    flex-shrink: 0;
}

.sidebar.collapsed {
    transform: translateX(-100%);
    position: absolute;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: var(--font-size-md);
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    font-weight: 400;
}

.sidebar-toggle {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.new-chat-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: white;
    font-weight: 600;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-glow);
    margin-bottom: 20px;
}

.new-chat-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(108,99,255,0.25);
}

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

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section-title {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    font-weight: 600;
}

.example-questions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.example-q {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all var(--transition-fast);
    line-height: 1.4;
}

.example-q:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    transform: translateX(4px);
}

.example-q svg {
    flex-shrink: 0;
    opacity: 0.5;
}

.about-card {
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient-soft);
    border: 1px solid var(--border-color);
}

.about-card p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    background: rgba(108,99,255,0.12);
    color: var(--accent-primary);
    border: 1px solid rgba(108,99,255,0.2);
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   CHAT MAIN
   ============================================ */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    background: var(--bg-chat);
}

/* Chat background pattern */
.chat-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(108,99,255,0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0,210,255,0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   CHAT HEADER
   ============================================ */
.chat-header {
    height: var(--header-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
    flex-shrink: 0;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.menu-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.sidebar.collapsed ~ .chat-main .menu-btn {
    display: flex;
}

.chat-title-area {
    display: flex;
    flex-direction: column;
}

.chat-title {
    font-size: var(--font-size-md);
    font-weight: 700;
    line-height: 1.2;
}

.chat-subtitle {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.chat-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
    position: relative;
}

.header-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.source-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: var(--accent-primary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ============================================
   CHAT MESSAGES
   ============================================ */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 1;
    scroll-behavior: smooth;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    padding: 40px 20px;
    animation: welcomeFadeIn 0.8s ease-out;
}

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

.welcome-icon {
    width: 96px;
    height: 96px;
    border-radius: 28px;
    background: var(--accent-gradient-soft);
    border: 1px solid rgba(108,99,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    animation: welcomeIconPulse 3s ease-in-out infinite;
}

@keyframes welcomeIconPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(108,99,255,0.1); }
    50% { box-shadow: 0 0 40px rgba(108,99,255,0.2); }
}

.welcome-title {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.welcome-desc {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    max-width: 460px;
    margin-bottom: 40px;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 640px;
    width: 100%;
}

.feature-card {
    padding: 20px 16px;
    border-radius: var(--radius-lg);
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
    text-align: center;
}

.feature-card:hover {
    border-color: rgba(108,99,255,0.3);
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: var(--accent-primary);
}

.feature-card h3 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 6px;
}

.feature-card p {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* Message Styles */
.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    align-items: flex-end;
}

.message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.bot-message {
    align-self: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar {
    background: var(--accent-gradient);
    color: white;
}

.bot-avatar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color-strong);
    color: var(--accent-primary);
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.user-message .message-content {
    align-items: flex-end;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    line-height: 1.6;
    word-break: break-word;
}

.user-message .message-bubble {
    background: var(--user-bubble);
    color: var(--user-bubble-text);
    border-bottom-right-radius: 4px;
    box-shadow: var(--shadow-glow);
}

.bot-message .message-bubble {
    background: var(--bot-bubble);
    color: var(--bot-bubble-text);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.message-text {
    font-size: var(--font-size-base);
}

/* Markdown styling inside bot messages */
.bot-message .message-text h1,
.bot-message .message-text h2,
.bot-message .message-text h3,
.bot-message .message-text h4 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text-primary);
}

.bot-message .message-text h1 { font-size: 1.3em; }
.bot-message .message-text h2 { font-size: 1.15em; }
.bot-message .message-text h3 { font-size: 1.05em; }

.bot-message .message-text p {
    margin-bottom: 8px;
}

.bot-message .message-text ul,
.bot-message .message-text ol {
    margin: 8px 0;
    padding-left: 20px;
}

.bot-message .message-text li {
    margin-bottom: 4px;
}

.bot-message .message-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.bot-message .message-text em {
    color: var(--accent-secondary);
    font-style: italic;
}

.bot-message .message-text code {
    background: rgba(108,99,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent-primary);
}

.bot-message .message-text blockquote {
    border-left: 3px solid var(--accent-primary);
    padding-left: 12px;
    margin: 8px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.bot-message .message-text hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 12px 0;
}

.message-time {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.message-duration {
    font-size: var(--font-size-xs);
    color: var(--accent-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-duration::before {
    content: '⚡';
    font-size: 10px;
}

/* Typing Indicator */
.typing-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px !important;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: typingBounce 1.4s infinite;
    opacity: 0.5;
}

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

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

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.4; }
    40% { transform: scale(1.2); opacity: 1; }
}

.typing-text {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    font-style: italic;
}

/* Animate In */
.animate-in {
    animation: messageSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   INPUT AREA
   ============================================ */
.chat-input-area {
    padding: 12px 20px 16px;
    z-index: 10;
    background: linear-gradient(to top, var(--bg-chat) 60%, transparent);
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    background: var(--bg-surface);
    border: 1px solid var(--border-color-strong);
    border-radius: var(--radius-lg);
    padding: 8px 8px 8px 18px;
    transition: all var(--transition-fast);
    gap: 8px;
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108,99,255,0.1), var(--shadow-glow);
}

.input-wrapper textarea {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    padding: 6px 0;
    min-height: 24px;
    max-height: 120px;
    line-height: 1.5;
    outline: none;
}

.input-wrapper textarea::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.char-count {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    padding-bottom: 8px;
    min-width: 55px;
    text-align: right;
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

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

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

.disclaimer {
    text-align: center;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 8px;
    opacity: 0.6;
}

/* ============================================
   SOURCE PANEL
   ============================================ */
.source-panel {
    width: var(--source-panel-width);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 25;
    transition: transform var(--transition-slow);
}

.source-panel.open {
    transform: translateX(0);
    box-shadow: -8px 0 32px rgba(0,0,0,0.3);
}

.source-panel-header {
    height: var(--header-height);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.source-panel-header h2 {
    font-size: var(--font-size-md);
    font-weight: 700;
}

.source-close-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.source-close-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.source-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.source-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    gap: 12px;
    color: var(--text-muted);
}

.source-empty p {
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.source-empty span {
    font-size: var(--font-size-xs);
    max-width: 220px;
}

/* Source Cards */
.source-card {
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    transition: all var(--transition-fast);
    animation: sourceSlideIn 0.3s ease-out;
}

@keyframes sourceSlideIn {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}

.source-card:hover {
    border-color: var(--border-color-strong);
    background: rgba(30, 41, 59, 0.5);
}

.source-card.mevzuat {
    border-left: 3px solid var(--mevzuat-color);
}

.source-card.emsal {
    border-left: 3px solid var(--emsal-color);
}

.source-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.source-type-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.source-type-badge.mevzuat {
    background: var(--mevzuat-bg);
    color: var(--mevzuat-color);
}

.source-type-badge.emsal {
    background: var(--emsal-bg);
    color: var(--emsal-color);
}

.source-score {
    margin-left: auto;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.source-card-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 4px;
}

.source-card-date {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.source-group-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 16px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.source-group-label:first-child {
    margin-top: 0;
}

/* ============================================
   ERROR MESSAGE
   ============================================ */
.error-bubble {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

.error-bubble .error-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #ef4444;
    font-weight: 600;
    font-size: var(--font-size-sm);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        position: absolute;
        height: 100%;
        z-index: 40;
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .menu-btn {
        display: flex !important;
    }

    .source-panel {
        width: 100%;
        max-width: 380px;
    }

    .welcome-features {
        grid-template-columns: 1fr;
        max-width: 320px;
    }

    .message {
        max-width: 92%;
    }
}

@media (max-width: 640px) {
    .chat-messages {
        padding: 16px 12px;
    }

    .chat-input-area {
        padding: 8px 12px 12px;
    }

    .welcome-title {
        font-size: var(--font-size-xl);
    }

    .welcome-desc {
        font-size: var(--font-size-sm);
    }

    .message {
        max-width: 95%;
    }

    .message-avatar {
        width: 30px;
        height: 30px;
    }

    .message-bubble {
        padding: 10px 14px;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 35;
    animation: fadeIn 0.2s ease;
}

.sidebar-overlay.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   STREAMING CURSOR
   ============================================ */
.streaming-cursor {
    display: inline-block;
    color: var(--accent-primary);
    animation: cursorBlink 0.8s step-end infinite;
    font-weight: 300;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ============================================
   AGENTIC AI ENHANCEMENTS
   ============================================ */

/* Background Glow Orbs */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
    animation: pulseGlow 10s ease-in-out infinite alternate;
}
.bg-glow-1 {
    top: -100px;
    left: 20%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
}
.bg-glow-2 {
    bottom: -150px;
    right: 15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
}
@keyframes pulseGlow {
    0% { transform: scale(1) translate(0, 0); opacity: 0.12; }
    100% { transform: scale(1.15) translate(20px, -20px); opacity: 0.22; }
}

/* Logo badge & chips */
.logo-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(14, 165, 233, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 2px;
    display: inline-block;
}

.title-with-pill {
    display: flex;
    align-items: center;
    gap: 10px;
}

.agent-chip {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

/* Sidebar Agent Tools Showcase */
.agent-tools-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.tool-badge-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}
.tool-badge-item:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(99, 102, 241, 0.3);
}
.tool-icon {
    font-size: 1.15rem;
}
.tool-info {
    display: flex;
    flex-direction: column;
}
.tool-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}
.tool-desc {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

/* Status Indicator Pulsing */
.status-dot.pulsing {
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: statusPulse 2s infinite;
}
@keyframes statusPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.status-text {
    display: flex;
    flex-direction: column;
}
.status-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}
.status-sub {
    font-size: 0.68rem;
    color: var(--text-tertiary);
}

/* Mode Selector Chips Bar */
.mode-selector-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 24px;
    background: rgba(17, 24, 39, 0.6);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    white-space: nowrap;
    z-index: 5;
}
.mode-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mode-chips {
    display: flex;
    gap: 8px;
}
.mode-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mode-chip:hover {
    background: rgba(45, 60, 85, 0.6);
    color: var(--text-primary);
    border-color: rgba(99, 102, 241, 0.4);
}
.mode-chip.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(14, 165, 233, 0.2));
    border-color: #6366f1;
    color: #e0e7ff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}
.mode-chip .chip-icon {
    font-size: 0.95rem;
}

/* Welcome Screen Updates */
.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #c7d2fe;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.feature-card {
    cursor: pointer;
    transition: all 0.25s ease;
}
.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.feature-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.feature-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-tertiary);
}
.feature-icon.gold { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.feature-icon.blue { background: rgba(14, 165, 233, 0.15); color: #38bdf8; }
.feature-icon.emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.feature-icon.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

/* Live Agent Status Indicator in Input Area */
.agent-live-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #c7d2fe;
    animation: fadeIn 0.2s ease;
}
.agent-live-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.input-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding: 0 4px;
}
.active-mode-indicator {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Agent Steps Accordion Inside Bot Messages */
.agent-steps-accordion {
    margin-bottom: 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s ease;
}
.steps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    background: rgba(30, 41, 59, 0.3);
    user-select: none;
    transition: background 0.15s ease;
}
.steps-header:hover {
    background: rgba(30, 41, 59, 0.6);
}
.steps-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #cbd5e1;
}
.steps-chevron {
    transition: transform 0.2s ease;
    color: var(--text-tertiary);
}
.agent-steps-accordion.open .steps-chevron {
    transform: rotate(180deg);
}
.steps-body {
    display: none;
    padding: 8px 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.08);
}
.agent-steps-accordion.open .steps-body {
    display: block;
}
.steps-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.step-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.step-bullet {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6366f1;
    margin-top: 6px;
    flex-shrink: 0;
}
.step-info {
    display: flex;
    flex-direction: column;
}
.step-item-title {
    font-weight: 600;
    color: #e2e8f0;
}
.step-item-detail {
    color: #94a3b8;
    font-size: 0.7rem;
}

/* Message Toolbar Buttons */
.message-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.msg-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 6px;
    color: var(--text-tertiary);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.msg-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Follow-up Suggestion Chips */
.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.suggestion-chip {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.suggestion-chip:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #ffffff;
    border-color: #6366f1;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    position: relative;
    transition: transform 0.2s ease, background 0.2s ease;
}
.theme-toggle-btn:hover {
    transform: rotate(15deg);
}

/* ============================================
   LIGHT THEME (AYDINLIK MOD)
   ============================================ */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-chat: #f8fafc;

    --accent-primary: #4f46e5;
    --accent-primary-hover: #4338ca;
    --accent-secondary: #0284c7;
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #0284c7 100%);
    --accent-gradient-soft: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(2, 132, 199, 0.05) 100%);

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-tertiary: #64748b;
    --text-muted: #94a3b8;

    --user-bubble: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    --user-bubble-text: #ffffff;
    --bot-bubble: #ffffff;
    --bot-bubble-text: #0f172a;

    --border-color: rgba(15, 23, 42, 0.08);
    --border-color-strong: rgba(15, 23, 42, 0.16);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.08);

    --mevzuat-color: #047857;
    --mevzuat-bg: rgba(4, 120, 87, 0.08);
    --emsal-color: #b45309;
    --emsal-bg: rgba(180, 83, 9, 0.08);
}

[data-theme="light"] body {
    background: #f8fafc;
    color: #0f172a;
}

[data-theme="light"] .sidebar {
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .chat-header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .mode-selector-bar {
    background: rgba(248, 250, 252, 0.95);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .mode-chip {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: #475569;
}

[data-theme="light"] .mode-chip:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: rgba(79, 70, 229, 0.3);
}

[data-theme="light"] .mode-chip.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(2, 132, 199, 0.08));
    border-color: #4f46e5;
    color: #4338ca;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.15);
}

[data-theme="light"] .chat-messages {
    background: #f8fafc;
}

[data-theme="light"] .welcome-badge {
    background: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.2);
    color: #4338ca;
}

[data-theme="light"] .feature-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .feature-card:hover {
    border-color: rgba(79, 70, 229, 0.35);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.08);
}

[data-theme="light"] .tool-badge-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
}
[data-theme="light"] .tool-badge-item:hover {
    background: #f1f5f9;
}

[data-theme="light"] .example-q {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: #334155;
}

[data-theme="light"] .example-q:hover {
    background: #f1f5f9;
    color: #0f172a;
}

[data-theme="light"] .bot-message .message-bubble {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .input-wrapper {
    background: #ffffff;
    border: 1px solid var(--border-color-strong);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] #messageInput {
    color: #0f172a;
}

[data-theme="light"] #messageInput::placeholder {
    color: #94a3b8;
}

[data-theme="light"] .source-panel {
    background: #ffffff;
    border-left: 1px solid var(--border-color);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .source-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
}

[data-theme="light"] .agent-steps-accordion {
    background: #ffffff;
    border: 1px solid var(--border-color);
}

[data-theme="light"] .steps-header {
    background: #f1f5f9;
}

[data-theme="light"] .steps-title {
    color: #334155;
}

[data-theme="light"] .step-item-title {
    color: #1e293b;
}

[data-theme="light"] .step-item-detail {
    color: #64748b;
}

[data-theme="light"] .bg-glow-1 {
    background: radial-gradient(circle, #e0e7ff 0%, transparent 70%);
}

[data-theme="light"] .bg-glow-2 {
    background: radial-gradient(circle, #e0f2fe 0%, transparent 70%);
}

[data-theme="light"] .msg-action-btn {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: #475569;
}

[data-theme="light"] .msg-action-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

[data-theme="light"] .suggestion-chip {
    background: rgba(79, 70, 229, 0.06);
    border: 1px solid rgba(79, 70, 229, 0.2);
    color: #4338ca;
}

[data-theme="light"] .suggestion-chip:hover {
    background: rgba(79, 70, 229, 0.15);
    color: #3730a3;
}

/* ==========================================================================
   WORD-LIKE DOCUMENT & TEMPLATE EDITOR (MATCHING SCREENSHOT)
   ========================================================================== */

.chat-view-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
    position: relative;
}

.word-editor-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
    background: #f8fafc;
    color: #0f172a;
    position: relative;
}

.word-draft-badge {
    background: #22c55e;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
    letter-spacing: 0.5px;
    animation: pulse 1.8s infinite;
}

.word-top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.word-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}

.word-crumb-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.word-crumb-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.word-crumb-sep {
    color: #94a3b8;
    font-size: 0.8rem;
}

.word-crumb-text {
    color: #64748b;
    font-weight: 500;
}

.word-crumb-active {
    color: #0f172a;
    font-weight: 700;
}

.word-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.word-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    border: 1px solid transparent;
}

.word-btn-back {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.word-btn-back:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.word-btn-outline {
    background: #ffffff;
    color: #334155;
    border-color: #cbd5e1;
}

.word-btn-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.word-btn-primary {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 1px 3px rgba(37,99,235,0.25);
}

.word-btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 2px 6px rgba(37,99,235,0.35);
}

.word-scroll-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 24px 70px 24px;
    background: #f1f5f9;
    scroll-behavior: smooth;
}

.word-page-inner {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Key Naming Rules Card (Exact Screenshot Match) */
.word-alert-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    box-shadow: 0 1px 4px rgba(2, 132, 199, 0.05);
}

.word-alert-icon {
    margin-top: 2px;
    flex-shrink: 0;
}

.word-alert-content {
    flex: 1;
}

.word-alert-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0369a1;
    margin-bottom: 4px;
}

.word-alert-check {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0284c7;
    margin-bottom: 6px;
}

.word-alert-list {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
    font-size: 0.83rem;
    color: #334155;
    line-height: 1.5;
}

.word-alert-list li::before {
    content: "• ";
    color: #0284c7;
    font-weight: bold;
}

.word-alert-examples-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 0.82rem;
}

.word-ex-label {
    font-weight: 700;
    color: #0369a1;
    margin-right: 4px;
}

.word-tag-chip {
    background: #ffffff;
    border: 1px solid #bae6fd;
    color: #0284c7;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.word-tag-chip:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    transform: translateY(-1px);
}

/* Leh & Aleyh Analizi ve Değişkenler Kartı */
.word-alert-analysis {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    flex-direction: column;
    gap: 12px;
}

.word-analysis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.word-analysis-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.word-analysis-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #0f172a;
}

.word-analysis-badge {
    background: #e0e7ff;
    color: #4338ca;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.word-analysis-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.word-analysis-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #2563eb;
    color: #ffffff;
    border: 1px solid #1d4ed8;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.word-analysis-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.word-analysis-btn.outline {
    background: #ffffff;
    color: #334155;
    border-color: #cbd5e1;
}

.word-analysis-btn.outline:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Değişkenler Rozet Satırı */
.word-detected-vars-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}

.word-vars-lead {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
}

.word-vars-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.word-var-pill {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.word-var-pill:hover {
    background: #0284c7;
    color: #ffffff;
}

/* Taraflar Leh & Aleyh Dağılımı Grid */
.word-parties-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .word-parties-grid {
        grid-template-columns: 1fr;
    }
}

.party-col {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.party-col-header {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.86rem;
    color: #1e293b;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

.party-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.party-dot.dot-blue { background: #2563eb; }
.party-dot.dot-purple { background: #9333ea; }

.party-section {
    padding: 8px 10px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.party-section.party-leh {
    background: #f0fdf4;
    border-left: 3px solid #16a34a;
}

.party-section.party-aleyh {
    background: #fef2f2;
    border-left: 3px solid #dc2626;
}

.sec-badge {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.sec-badge.green { color: #15803d; }
.sec-badge.red { color: #b91c1c; }

.party-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.78rem;
    color: #334155;
    line-height: 1.45;
}

.party-list li {
    position: relative;
    padding: 8px 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s ease;
}

.party-list li:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

.party-list .quote-sentence {
    font-style: italic;
    color: #0f172a;
    font-weight: 500;
    line-height: 1.4;
}

.party-list .benefit-reason {
    font-weight: 600;
    color: #15803d;
    font-size: 0.76rem;
}

.party-list .risk-reason {
    font-weight: 600;
    color: #b91c1c;
    font-size: 0.76rem;
}

/* Cümle Değiştirme, Silme ve Kabul Etme Buton Grubu */
.clause-item-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding-top: 5px;
    border-top: 1px dashed #e2e8f0;
}

.btn-clause-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-clause-action.accept {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}
.btn-clause-action.accept:hover {
    background: #059669;
    color: #ffffff;
}

.btn-clause-action.edit {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.btn-clause-action.edit:hover {
    background: #2563eb;
    color: #ffffff;
}

.btn-clause-action.delete {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}
.btn-clause-action.delete:hover {
    background: #dc2626;
    color: #ffffff;
}

.clause-status-pill {
    font-size: 0.70rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
}
.clause-status-pill.accepted { background: #d1fae5; color: #065f46; }
.clause-status-pill.edited { background: #dbeafe; color: #1e40af; }
.clause-status-pill.deleted { background: #fee2e2; color: #991b1b; }

.word-balance-summary {
    background: #f8fafc;
    border-left: 3px solid #6366f1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.79rem;
    color: #475569;
    line-height: 1.5;
}

/* Chat Toolbar Word Buttons */
.msg-action-btn.word-send-btn {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.3);
    color: #2563eb;
}

.msg-action-btn.word-send-btn:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
}

.msg-action-btn.word-send-btn:hover svg {
    stroke: #ffffff;
}

.msg-action-btn.word-send-btn:hover .btn-text {
    color: #ffffff !important;
}

.msg-action-btn.word-quick-download-btn {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.3);
    color: #059669;
}

.msg-action-btn.word-quick-download-btn:hover {
    background: #059669;
    color: #ffffff;
    border-color: #047857;
}

.msg-action-btn.word-quick-download-btn:hover svg {
    stroke: #ffffff;
}

.msg-action-btn.word-quick-download-btn:hover span {
    color: #ffffff !important;
}

.word-alert-questions {
    background: #f0f9ff;
    border-color: #bae6fd;
    align-items: center;
}

.word-alert-questions-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
    font-size: 0.85rem;
    color: #0369a1;
    font-weight: 500;
}

.word-questions-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.word-dynamic-questions-title {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0369a1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.word-dynamic-questions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.word-q-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s ease;
    text-align: left;
    border: 1px solid transparent;
}

.word-q-chip.answered {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
    cursor: pointer;
}

.word-q-chip.answered:hover {
    background: #d1fae5;
    border-color: #34d399;
}

.word-q-chip.answered .wq-badge {
    background: #059669;
    color: #ffffff;
    font-size: 0.7rem;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
}

.word-q-chip.pending {
    background: #ffffff;
    border-color: #0284c7;
    color: #0284c7;
    cursor: pointer;
}

.word-q-chip.pending:hover {
    background: #0284c7;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.word-q-chip.pending .wq-action {
    font-weight: 700;
    font-size: 0.74rem;
    background: rgba(2, 132, 199, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
}

.word-q-chip.pending:hover .wq-action {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.word-questions-btn {
    background: #ffffff;
    border: 1px solid #0284c7;
    color: #0284c7;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.word-questions-btn:hover {
    background: #0284c7;
    color: #ffffff;
}

/* Merged clause animation */
.word-merged-clause {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 4px solid #10b981;
    background: #f8fafc;
    border-radius: 0 6px 6px 0;
    transition: background 1.5s ease, border-color 1.5s ease;
}

@keyframes clauseHighlightFade {
    0% {
        background-color: #dcfce7;
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.35);
    }
    100% {
        background-color: #f8fafc;
        box-shadow: none;
    }
}

.word-clause-pulse {
    animation: clauseHighlightFade 3.5s ease-out forwards;
}

/* Zoom Toolbar (Exact Screenshot Match) */
.word-zoom-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.word-zoom-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #22c55e;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.word-zoom-pill:hover {
    background: #16a34a;
}

.word-zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.word-zoom-action-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s;
}

.word-zoom-action-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.word-zoom-range {
    width: 140px;
    accent-color: #22c55e;
    cursor: pointer;
}

.word-zoom-val {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    min-width: 42px;
}

/* Word Editor WYSIWYG Toolbar (Exact Screenshot Match) */
.word-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 10;
}

.wt-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.wt-sep {
    width: 1px;
    height: 20px;
    background: #e2e8f0;
    margin: 0 4px;
}

.wt-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.wt-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.wt-btn.active {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0284c7;
}

.wt-btn-ai {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(2, 132, 199, 0.1));
    border: 1px solid rgba(79, 70, 229, 0.3);
    color: #4f46e5;
    padding: 0 8px;
    gap: 4px;
}

.wt-btn-ai:hover {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(2, 132, 199, 0.2));
    color: #4338ca;
}

.wt-btn-tag {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0284c7;
    padding: 0 8px;
    gap: 4px;
}

.wt-btn-tag:hover {
    background: #e0f2fe;
}

.wt-select {
    height: 30px;
    padding: 0 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #334155;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    cursor: pointer;
    outline: none;
}

.wt-color-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
}

.wt-color-btn:hover {
    background: #f1f5f9;
}

.wt-color-bar {
    width: 16px;
    height: 3px;
    margin-top: 1px;
    border-radius: 1px;
}

.wt-dropdown-wrap {
    position: relative;
}

.wt-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    padding: 6px 0;
    min-width: 270px;
    z-index: 100;
}

.wt-dropdown-menu.show {
    display: block;
}

.wt-dropdown-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    padding: 6px 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wt-dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    background: transparent;
    border: none;
    font-size: 0.83rem;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s;
}

.wt-dropdown-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.wt-dropdown-sep {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

/* Document Paper Canvas (A4 White Sheet) */
.word-canvas-outer {
    display: flex;
    justify-content: center;
    margin: 10px 0 40px 0;
    transform-origin: top center;
    transition: transform 0.15s ease-out;
}

.word-paper-canvas {
    width: 820px;
    min-height: 1160px;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: #ffffff;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 70px 80px;
    color: #0f172a;
    font-family: 'Calibri', 'Times New Roman', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    outline: none;
    box-sizing: border-box;
    transition: box-shadow 0.2s;
}

.word-paper-canvas:focus {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12), 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.word-paper-canvas h1.doc-title, .word-paper-canvas h1 {
    text-align: center;
    font-size: 19px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 10px 0 24px 0;
    color: #0f172a;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 8px;
}

.word-paper-canvas h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 20px 0 10px 0;
    color: #1e293b;
}

.word-paper-canvas h3 {
    font-size: 14.5px;
    font-weight: 700;
    margin: 16px 0 6px 0;
    color: #1e293b;
}

.word-paper-canvas p {
    margin-bottom: 12px;
    text-align: justify;
}

.word-paper-canvas ul, .word-paper-canvas ol {
    margin: 8px 0 14px 24px;
}

.word-paper-canvas li {
    margin-bottom: 5px;
}

.word-paper-canvas table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
}

.word-paper-canvas td, .word-paper-canvas th {
    border: 1px solid #cbd5e1;
    padding: 8px 12px;
    vertical-align: top;
}

.word-paper-canvas .doc-signature-table {
    border: none;
    margin-top: 40px;
    width: 100%;
}

.word-paper-canvas .doc-signature-table td {
    border: none;
    width: 50%;
    text-align: center;
    vertical-align: top;
    padding: 10px 20px;
}

.word-paper-canvas .template-variable {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.88em;
    padding: 1px 6px;
    border-radius: 4px;
    cursor: pointer;
    user-select: all;
    transition: all 0.15s;
}

.word-paper-canvas .template-variable:hover {
    background: #bae6fd;
    color: #0284c7;
}

.word-source-editor {
    width: 820px;
    min-height: 800px;
    background: #0f172a;
    color: #38bdf8;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    padding: 24px;
    border-radius: 6px;
    border: 1px solid #334155;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
}

/* Floating Assistant Button at Bottom Right (Exact Screenshot Match) */
.word-floating-bot-btn {
    position: fixed;
    bottom: 24px;
    right: 28px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #22c55e;
    border: none;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 50;
}

.word-floating-bot-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
}

/* Variable Filler Modal */
.word-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.word-modal-box {
    background: #ffffff;
    border-radius: 14px;
    width: 580px;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    overflow: hidden;
    color: #0f172a;
}

.word-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.word-modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.word-modal-close {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: #64748b;
    cursor: pointer;
}

.word-modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1;
}

.word-modal-desc {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 14px;
}

.word-variables-form-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.word-form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.word-form-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
}

.word-form-field input {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 0.88rem;
    outline: none;
    transition: border 0.15s;
}

.word-form-field input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.word-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Word Auto-Paste Notification Toast */
.word-paste-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 12px 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 150;
    animation: toastSlideUp 0.3s ease-out;
}

@keyframes toastSlideUp {
    from { transform: translate(-50%, 20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toast-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
}

.toast-sub {
    font-size: 0.78rem;
    color: #94a3b8;
}

.toast-open-btn {
    background: #22c55e;
    color: #ffffff;
    border: none;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.toast-open-btn:hover {
    background: #16a34a;
}

.toast-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
}

/* ==========================================================================
   SÖZLEŞME OLUŞTUR BUTONLARI & SÖZLEŞME SİHİRBAZI MODALI (KULLANICI TALEBİ)
   ========================================================================== */

/* Header & Word Toolbar Contract Buttons */
.header-btn.create-contract-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: 1px solid #1e40af;
    border-radius: 20px;
    padding: 7px 15px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-btn.create-contract-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.word-btn.word-btn-contract {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: 1px solid #1e40af;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.word-btn.word-btn-contract:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

/* Chat Input Quick Actions Bar */
.chat-quick-actions-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 4px 2px;
    overflow: hidden;
}

.quick-contract-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    border-radius: 18px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
    transition: all 0.18s ease;
    flex-shrink: 0;
}

.quick-contract-action-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.quick-contract-action-btn .btn-emoji {
    font-size: 0.95rem;
}

.quick-presets-scroll {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
}

.quick-presets-scroll::-webkit-scrollbar {
    display: none;
}

.quick-preset-pill {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    border-radius: 14px;
    padding: 4px 10px;
    font-size: 0.77rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.quick-preset-pill:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1;
    transform: translateY(-1px);
}

/* Contract Creator Wizard Modal */
.contract-creator-modal {
    max-width: 780px !important;
    width: 95% !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25) !important;
}

.contract-creator-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    padding: 18px 24px !important;
}

.contract-creator-header .word-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title-emoji {
    font-size: 1.6rem;
}

.modal-title-main {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.modal-title-sub {
    font-size: 0.78rem;
    color: #bfdbfe;
    margin-top: 2px;
    font-weight: 500;
}

.contract-creator-header .word-modal-close {
    color: #ffffff !important;
    opacity: 0.85;
}

.contract-creator-header .word-modal-close:hover {
    opacity: 1;
}

.contract-creator-body {
    padding: 20px 24px !important;
    max-height: 72vh !important;
    overflow-y: auto !important;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.contract-section-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.contract-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.contract-type-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.contract-type-card:hover {
    background: #f0f7ff;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.contract-type-card.active {
    background: #eff6ff;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb, 0 3px 8px rgba(37, 99, 235, 0.15);
}

.contract-type-card .card-icon {
    font-size: 1.35rem;
    line-height: 1;
    margin-top: 2px;
}

.contract-type-card .card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.contract-type-card .card-meta strong {
    font-size: 0.84rem;
    color: #0f172a;
    line-height: 1.3;
}

.contract-type-card .card-meta span {
    font-size: 0.72rem;
    color: #64748b;
}

.contract-text-input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #1e293b;
    background: #ffffff;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    box-sizing: border-box;
}

.contract-text-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.contract-parties-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.contract-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contract-form-field label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
}

.contract-extra-opts {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.contract-checkboxes-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.contract-chk-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #334155;
    cursor: pointer;
    user-select: none;
}

.contract-chk-label input[type="checkbox"] {
    cursor: pointer;
    accent-color: #2563eb;
}

.contract-creator-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px !important;
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

.contract-submit-glow {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    font-weight: 700 !important;
    padding: 9px 20px !important;
    font-size: 0.9rem !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
}

.contract-submit-glow:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45) !important;
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .contract-parties-row,
    .contract-checkboxes-row {
        grid-template-columns: 1fr;
    }
    .contract-type-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   AJAN 3: INLINE FLOATING SELECTION TOOLBAR & CLAUSE ACTIONS
   ========================================================================== */

/* Floating Selection Popover above selected text in Word Canvas */
.word-selection-toolbar {
    position: fixed;
    display: none;
    align-items: center;
    gap: 4px;
    background: #0f172a;
    color: #ffffff;
    padding: 5px 8px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 300;
    animation: selectionFadeIn 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

@keyframes selectionFadeIn {
    from { opacity: 0; transform: translateY(6px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.word-selection-toolbar::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #0f172a transparent;
    display: block;
    width: 0;
}

.sel-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    padding: 4px 9px;
    border-radius: 5px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.sel-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    transform: translateY(-1px);
}

.sel-btn.edit {
    background: rgba(14, 165, 233, 0.25);
    border-color: #0ea5e9;
    color: #38bdf8;
}
.sel-btn.edit:hover {
    background: #0ea5e9;
    color: #ffffff;
}

.sel-btn.delete {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #fca5a5;
}
.sel-btn.delete:hover {
    background: #ef4444;
    color: #ffffff;
}

.sel-btn.accept {
    background: rgba(34, 197, 94, 0.25);
    border-color: #22c55e;
    color: #86efac;
}
.sel-btn.accept:hover {
    background: #22c55e;
    color: #ffffff;
}

.sel-btn.note {
    background: rgba(168, 85, 247, 0.25);
    border-color: #a855f7;
    color: #d8b4fe;
}
.sel-btn.note:hover {
    background: #a855f7;
    color: #ffffff;
}

.sel-btn.comment {
    background: rgba(245, 158, 11, 0.25);
    border-color: #f59e0b;
    color: #fcd34d;
}
.sel-btn.comment:hover {
    background: #f59e0b;
    color: #ffffff;
}

/* Floating Legal Comment Popover Card */
.word-comment-popover {
    position: fixed;
    width: 380px;
    max-width: 90vw;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.25), 0 3px 10px rgba(0, 0, 0, 0.1);
    border: 1.5px solid #e2e8f0;
    z-index: 310;
    animation: selectionFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    color: #0f172a;
}

.comment-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #ffffff;
}

.comment-popover-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.86rem;
    font-weight: 700;
}

.comment-popover-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
}
.comment-popover-close:hover { opacity: 1; }

.comment-popover-body {
    padding: 12px 14px;
    max-height: 340px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-quote-box {
    background: #f8fafc;
    border-left: 3px solid #2563eb;
    padding: 8px 10px;
    border-radius: 0 6px 6px 0;
}

.comment-quote-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.comment-quote-text {
    font-size: 0.82rem;
    color: #1e293b;
    font-style: italic;
    line-height: 1.35;
    margin: 0;
}

.comment-analysis-content {
    font-size: 0.82rem;
    line-height: 1.5;
    color: #334155;
}

.comment-analysis-content .analysis-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-bottom: 6px;
}
.comment-analysis-content .tag-valid { background: #dcfce7; color: #15803d; }
.comment-analysis-content .tag-risk { background: #fee2e2; color: #b91c1c; }
.comment-analysis-content .tag-advice { background: #fef3c7; color: #b45309; }

.comment-popover-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Clause Item Action Buttons in Leh & Aleyh Cards */
.clause-item-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    list-style: none;
    transition: all 0.18s ease;
}

.clause-item-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.clause-item-card .quote-sentence {
    display: block;
    font-size: 0.84rem;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.45;
    margin-bottom: 4px;
}

.clause-item-card .benefit-reason {
    display: block;
    font-size: 0.74rem;
    color: #15803d;
    font-weight: 600;
    margin-bottom: 6px;
}

.clause-item-card .risk-reason {
    display: block;
    font-size: 0.74rem;
    color: #b91c1c;
    font-weight: 600;
    margin-bottom: 6px;
}

.clause-item-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #f1f5f9;
}

.btn-clause-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.btn-clause-action.accept {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}
.btn-clause-action.accept:hover {
    background: #059669;
    color: #ffffff;
    border-color: #047857;
}

.btn-clause-action.edit {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}
.btn-clause-action.edit:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0369a1;
}

.btn-clause-action.delete {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.btn-clause-action.delete:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #b91c1c;
}

.btn-clause-action.note {
    background: #faf5ff;
    border-color: #e9d5ff;
    color: #6b21a8;
}
.btn-clause-action.note:hover {
    background: #9333ea;
    color: #ffffff;
    border-color: #7e22ce;
}

.clause-status-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    letter-spacing: 0.3px;
}
.clause-status-pill.accepted {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}
.clause-status-pill.edited {
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #7dd3fc;
}
.clause-status-pill.deleted {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}
.clause-status-pill.noted {
    background: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #d8b4fe;
}

/* Negotiation Note inside Word Canvas */
.doc-negotiation-note {
    display: block;
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 8px 12px;
    margin: 8px 0;
    font-size: 0.88em;
    color: #92400e;
    border-radius: 0 6px 6px 0;
    font-style: italic;
}

/* Step-by-Step Questioning Variable Wizard Modal */
.step-wizard-modal {
    max-width: 600px !important;
}

.step-wizard-progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 14px;
}

.step-wizard-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #0284c7);
    width: 0%;
    transition: width 0.3s ease;
}

.step-wizard-question-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
}

.step-wizard-q-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #2563eb;
    background: #dbeafe;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 8px;
}

.step-wizard-q-text {
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
    margin-bottom: 6px;
}

.step-wizard-q-desc {
    font-size: 0.8rem;
    color: #64748b;
}

.step-wizard-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* ==========================================================================
   Kendi Belgeni Düzenle (Sidebar Upload Document Card)
   ========================================================================== */
.upload-doc-sidebar-section {
    margin-bottom: 22px;
}

.upload-doc-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all var(--transition-fast);
}

.upload-doc-card:hover {
    border-color: rgba(34, 197, 94, 0.4);
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.08);
}

.upload-doc-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
    font-weight: 500;
}

.upload-doc-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-choose-file {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1.5px dashed var(--border-color);
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-choose-file:hover {
    background: rgba(34, 197, 94, 0.12);
    border-color: #22c55e;
    color: #16a34a;
}

.upload-file-status {
    font-size: 0.76rem;
    color: #0369a1;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.2s ease;
}

.btn-upload-doc {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    border: none;
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.28);
    transition: all var(--transition-fast);
}

.btn-upload-doc:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.38);
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
}

.btn-upload-doc:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    box-shadow: none;
    transform: none;
}

.upload-doc-formats {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    text-align: center;
    letter-spacing: 0.2px;
}







/* ═══════════════════════════════════════════════════════════════════
   Word Editörü: Sözleşme formu sol dock paneli + belge yan yana düzen
   Form soldan akıcı şekilde açılır, belge sağa kayar (taşma yok).
   ═══════════════════════════════════════════════════════════════════ */
.word-editor-body {
    flex: 1;
    display: flex;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.word-contract-dock {
    flex: 0 0 0;
    width: 0;
    min-width: 0;
    overflow: hidden;
    opacity: 0;
    background: #ffffff;
    border-right: 0 solid #e2e8f0;
    box-shadow: none;
    pointer-events: none;
    transition:
        flex-basis 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.3s ease 0.05s,
        box-shadow 0.45s ease,
        border-right-width 0.2s ease;
    will-change: flex-basis;
}

.word-editor-view.contract-dock-open .word-contract-dock {
    flex-basis: min(46%, 640px);
    opacity: 1;
    border-right-width: 1px;
    box-shadow: 6px 0 24px rgba(15, 23, 42, 0.10);
    pointer-events: auto;
}

/* Belge sütunu kalan alanı doldurur ve küçülebilir; taşma yerine kendi içinde kayar */
.word-editor-body > .word-scroll-container {
    flex: 1 1 0;
    min-width: 0;
    transition: padding 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.word-editor-view.contract-dock-open .word-scroll-container {
    overflow-x: auto;
    padding-left: 16px;
    padding-right: 16px;
}

/* Dock içindeki form: sabit genişlikte içerik, dock açılırken yeniden akmaz */
.word-contract-dock .contract-creator-modal {
    width: 100% !important;
    min-width: 400px;
    max-width: none !important;
    height: 100%;
    max-height: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(-28px);
    transition: opacity 0.35s ease 0.12s, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.05s;
}

.word-editor-view.contract-dock-open .word-contract-dock .contract-creator-modal {
    opacity: 1;
    transform: translateX(0);
}

.word-contract-dock .contract-creator-body {
    flex: 1;
    max-height: none !important;
    min-height: 0;
}

.word-contract-dock .contract-type-grid {
    grid-template-columns: 1fr;
}

.word-contract-dock .contract-footer,
.word-contract-dock .contract-creator-footer {
    flex-shrink: 0;
}

/* Dar ekranlar: form tüm genişliği kaplar, belge geçici olarak gizlenir (taşma olmaz) */
@media (max-width: 1000px) {
    .word-editor-view.contract-dock-open .word-contract-dock {
        flex-basis: 100%;
    }
    .word-editor-view.contract-dock-open .word-scroll-container {
        flex-basis: 0;
        padding-left: 0;
        padding-right: 0;
        overflow: hidden;
    }
    .word-contract-dock .contract-creator-modal {
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .word-contract-dock,
    .word-contract-dock .contract-creator-modal,
    .word-variables-dock,
    .vars-dock-container,
    .word-editor-body > .word-scroll-container {
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   Word Editörü: Değişken Doldurma ve Soru Paneli (Sol Dock)
   Kullanıcı İsteği: Değişkenleri doldur deyince sözleşme sağa yaklaşır,
   sol tarafta sorular açılır, alt alta veya tek tek seçilebilir.
   ═══════════════════════════════════════════════════════════════════ */
.word-variables-dock {
    flex: 0 0 0;
    width: 0;
    min-width: 0;
    overflow: hidden;
    opacity: 0;
    background: #f8fafc;
    border-right: 0 solid #e2e8f0;
    box-shadow: none;
    pointer-events: none;
    transition:
        flex-basis 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.3s ease 0.05s,
        box-shadow 0.45s ease,
        border-right-width 0.2s ease;
    will-change: flex-basis;
    display: flex;
    flex-direction: column;
    z-index: 15;
}

.word-editor-view.variables-dock-open .word-variables-dock {
    flex-basis: min(48%, 540px);
    opacity: 1;
    border-right-width: 1px;
    box-shadow: 6px 0 24px rgba(15, 23, 42, 0.08);
    pointer-events: auto;
}

.word-editor-view.variables-dock-open .word-scroll-container {
    overflow-x: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.vars-dock-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 360px;
    width: 100%;
    background: #ffffff;
}

.vars-dock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.vars-dock-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vars-dock-icon {
    font-size: 24px;
    line-height: 1;
}

.vars-dock-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.vars-dock-subtitle {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 1px;
}

.vars-dock-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vars-dock-count-badge {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}

.vars-dock-close-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.vars-dock-close-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Mod Değiştirme Barı */
.vars-dock-mode-bar {
    padding: 10px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.vars-dock-toggle-group {
    display: flex;
    background: #e2e8f0;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.vars-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vars-mode-btn:hover {
    color: #0f172a;
}

.vars-mode-btn.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* İçerik Alanı */
.vars-dock-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    background: #ffffff;
}

/* Alt Alta Liste Modu */
.vars-list-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.vars-q-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 13px 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.vars-q-card:focus-within {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
}

.vars-q-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.vars-q-num-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    background: #e2e8f0;
    padding: 2px 7px;
    border-radius: 4px;
}

.vars-q-tag {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.76rem;
    font-weight: 700;
    color: #2563eb;
    background: #dbeafe;
    padding: 2px 8px;
    border-radius: 4px;
}

.vars-q-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 3px;
    line-height: 1.4;
}

.vars-q-desc {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 9px;
    line-height: 1.35;
}

.vars-q-input {
    width: 100%;
    padding: 9px 12px;
    font-size: 0.88rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.vars-q-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Tek Tek Modu */
.vars-view-step {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.vars-step-progress-wrap {
    margin-bottom: 16px;
}

.vars-step-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
}

.vars-step-progress-track {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.vars-step-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.vars-step-card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
}

.vars-step-q-tag {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: #2563eb;
    background: #dbeafe;
    padding: 3px 9px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.vars-step-q-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.vars-step-q-desc {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 14px 0;
    line-height: 1.4;
}

.vars-step-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vars-step-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
}

.vars-step-input {
    width: 100%;
    padding: 11px 13px;
    font-size: 0.92rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.vars-step-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.vars-step-nav-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
}

.vars-step-nav-right {
    display: flex;
    gap: 8px;
}

.vars-nav-btn {
    padding: 8px 15px;
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
}

.vars-nav-btn.primary {
    background: #2563eb;
    color: #ffffff;
}

.vars-nav-btn.primary:hover {
    background: #1d4ed8;
}

.vars-nav-btn.outline {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155;
}

.vars-nav-btn.outline:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.vars-nav-btn.text {
    background: transparent;
    color: #64748b;
}

.vars-nav-btn.text:hover {
    color: #0f172a;
}

/* Boş Durum */
.vars-dock-empty {
    text-align: center;
    padding: 36px 16px;
}

.vars-empty-icon {
    font-size: 34px;
    margin-bottom: 10px;
}

.vars-dock-empty h4 {
    font-size: 0.96rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
}

.vars-dock-empty p {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0 0 14px 0;
}

.vars-empty-hint {
    display: inline-block;
    font-size: 0.76rem;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    padding: 8px 12px;
    border-radius: 6px;
    line-height: 1.4;
}

/* Alt Butonlar */
.vars-dock-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 18px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.vars-dock-btn {
    padding: 8px 15px;
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
}

.vars-dock-btn.primary {
    background: #2563eb;
    color: #ffffff;
}

.vars-dock-btn.primary:hover {
    background: #1d4ed8;
}

.vars-dock-btn.secondary {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.vars-dock-btn.secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

@media (max-width: 1000px) {
    .word-editor-view.variables-dock-open .word-variables-dock {
        flex-basis: 100%;
    }
    .word-editor-view.variables-dock-open .word-scroll-container {
        flex-basis: 0;
        padding-left: 0;
        padding-right: 0;
        overflow: hidden;
    }
}
