/* repotoprompt.com — Main CSS File (pure CSS) */
/* ---------- 1. Tokenlar ---------- */
:root {
    --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --font-geist-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --font-commit-mono: "CommitMono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --shadow: 0 1px 2px 0 rgba(0, 0, 0, .05);
    --blue: #3b82f6;
    --red: #ef4444;
    --surface: #fff;
    --surface-2: #fff;
    --surface-alt: #f9fafb;
    --border: #e5e7eb;
    --tint: #e5e7eb;
    --text: #1f2937;
    --text-2: #374151;
    --text-3: #4b5563;
    --muted: #6b7280;
    --faint: #9ca3af;
    --accent: #2563eb;
    --green: #059669;
    --sb-track: #f9fafb;
    --sb-thumb: #cbd5e1;
    --sb-thumb-hover: #94a3b8;
}

.dark {
    --surface: #111827;
    --surface-2: #1f2937;
    --surface-alt: #111827;
    --border: #1f2937;
    --tint: #374151;
    --text: #e5e7eb;
    --text-2: #d1d5db;
    --text-3: #9ca3af;
    --muted: #9ca3af;
    --faint: #6b7280;
    --accent: #60a5fa;
    --green: #34d399;
    --sb-track: #030712;
    --sb-thumb: #1f2937;
    --sb-thumb-hover: #374151;
}

/* ---------- 2. Temel ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    font: 16px/1.5 var(--font-sans);
    background: #f9fafb;
    color: #111827;
    -webkit-font-smoothing: antialiased;
    transition: background-color .3s, color .3s;
}

.dark body {
    background: #030712;
    color: #e5e7eb;
}

h1, h2, p, pre {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input {
    font: inherit;
}

button {
    color: inherit;
    margin: 0;
}

svg {
    display: block;
}

::selection {
    background: #2563eb;
    color: #fff;
}

.btn:focus, .theme-btn:focus, .link-btn:focus, .settings-toggle:focus, .file-remove:focus,
.tag-close:focus, .tag-field:focus, .file-nav-item:focus, .model-option:focus, .output-area:focus, .file-action-btn:focus {
    outline: none;
}

.badge svg, .model-option svg, .model-icon, .model-caret, .file-dot, .file-remove,
.divider-text, .logo-badge, .file-nav, .file-drag-handle {
    flex-shrink: 0;
}

.icon-2xs { width: .625rem; height: .625rem; }
.icon-xs  { width: .75rem;  height: .75rem; }
.icon-sm  { width: .875rem; height: .875rem; }
.icon-md  { width: 1rem;    height: 1rem; }
.icon-lg  { width: 2rem;    height: 2rem; }
.icon-xl  { width: 2.5rem;  height: 2.5rem; }

/* Yardimci Siniflar */
.flex-center { display: flex; align-items: center; justify-content: center; }
.mr-1 { margin-right: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.opacity-50 { opacity: 0.5; }
.cursor-not-allowed { cursor: not-allowed; }

/* Kapat Butonu Tonu: Chip arkaplanı var(--tint) ile tam uyumlu */
.btn-chip-match {
    background-color: var(--tint) !important;
    color: var(--text-2) !important;
    border: 1px solid #d1d5db !important;
}
.dark .btn-chip-match {
    border-color: #4b5563 !important;
}
.btn-chip-match:hover {
    opacity: 0.8;
}

/* Toast Bildirimi */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    /* background-color: #10b981; */
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s, transform 0.3s, background-color 0.3s;
}
.toast.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    display: block !important;
}
.toast-green { background-color: #10b981; }
.toast-blue { background-color: #3b82f6; }
.toast-red { background-color: #ef4444; }

/* Özel Tooltip (Dosya Yolu) */
.custom-tooltip {
    position: fixed;
    z-index: 3000;
    max-width: 420px;
    padding: 0.5rem 0.75rem;
    background: var(--text);
    color: var(--surface);
    font-family: var(--font-geist-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    word-break: break-all;
    white-space: normal;
    direction: ltr;
    text-align: left;
}

.dark .custom-tooltip {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}

/* ---------- 3. Tema düğmesi ---------- */
.theme-toggle {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 50;
}

.theme-toggle-group {
    display: flex;
    align-items: center;
    padding: .375rem;
    border: 1px solid var(--border);
    border-radius: 9999px;
    background: rgba(255, 255, 255, .8);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: background-color .3s, border-color .3s;
}

.dark .theme-toggle-group {
    background: rgba(17, 24, 39, .8);
}

.theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .375rem;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all .2s;
}

.theme-btn.is-active {
    background: var(--surface-2);
    color: #111827;
    box-shadow: var(--shadow);
}

.theme-btn:hover {
    color: #111827;
}

.dark .theme-btn.is-active {
    color: #f3f4f6;
}

.dark .theme-btn:hover {
    color: #d1d5db;
}

/* ---------- 4. Yerleşim ---------- */
.main {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem;
}

.app-layout {
    width: 100%;
    max-width: 42rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    transition: max-width .7s ease-in-out, grid-template-columns .7s ease-in-out;
}

.app-layout.is-expanded {
    max-width: 80rem;
}

.input-panel {
    grid-column: span 1 / span 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-panel.is-narrow {
    height: 90vh;
}

.output-panel {
    grid-column: span 1 / span 1;
    flex-direction: column;
    height: 90vh;
}

/* ---------- 5. Başlık ---------- */
.app-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: .5rem;
    transition: all .5s;
}

.title-row {
    display: flex;
    align-items: center;
    gap: .875rem;
    margin-bottom: .5rem;
}

.title-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.logo-badge {
    padding: .875rem;
    border-radius: 1rem;
    background-image: linear-gradient(to bottom right, #2563eb, #3b82f6);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, .25), 0 4px 6px -4px rgba(59, 130, 246, .25);
}

.logo-badge svg {
    color: #fff;
}

.app-title {
    margin-bottom: .375rem;
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 800;
    letter-spacing: -.025em;
    color: #111827;
}

.dark .app-title {
    color: #fff;
}

.app-subtitle {
    font-size: .875rem;
    font-weight: 500;
    color: var(--muted);
}

.app-description {
    margin-top: .25rem;
    font-size: .875rem;
    color: var(--text-3);
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin: 1rem 0 .75rem;
    }

.badge {
    width: 320px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    padding: .375rem .75rem;
    border: 1px solid transparent;
    border-radius: 9999px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow);
}

.badge-strong { font-weight: 700; }
.fade-badge { transition: opacity .5s; }

.badge-green {
    background: #ecfdf5;
    color: var(--green);
    border-color: #a7f3d0;
}

.dark .badge-green {
    background: rgba(16, 185, 129, .1);
    border-color: rgba(16, 185, 129, .2);
}

.badge-blue {
    background: #eff6ff;
    color: var(--accent);
    border-color: #bfdbfe;
}

.dark .badge-blue {
    background: rgba(59, 130, 246, .1);
    border-color: rgba(59, 130, 246, .2);
}

.meta-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
    font-size: .75rem;
    font-weight: 500;
    color: var(--faint);
}

.meta-sep { color: #d1d5db; }
.dark .meta-sep { color: #374151; }

.link-blue { color: var(--blue); }
.link-blue:hover { text-decoration: underline; }

.meta-link {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    transition: color .2s;
}

.meta-link:hover { color: #374151; }
.dark .meta-link:hover { color: #e5e7eb; }

/* ---------- 6. Kart + yükleme alanı ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: .75rem;
    box-shadow: var(--shadow);
    transition: background-color .3s, border-color .3s;
}

.upload-card { padding: 1.25rem; }

.drop-zone {
    padding: 1.25rem;
    text-align: center;
    border: 2px dashed #d1d5db;
    border-radius: .75rem;
    background: var(--surface-alt);
    transition: border-color .2s, background-color .2s;
}

.dark .drop-zone { border-color: #374151; }

.drop-zone:hover {
    border-color: var(--blue);
    background: #eff6ff;
}

.dark .drop-zone:hover { background: rgba(59, 130, 246, .05); }

.drop-icon {
    margin: 0 auto .5rem;
    color: #9ca3af;
    transition: color .2s, transform .2s;
}

.drop-zone:hover .drop-icon { color: var(--blue); }

.drop-title {
    margin-bottom: .25rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-2);
}

.divider {
    position: relative;
    display: flex;
    align-items: center;
    padding: .5rem 0;
    margin-top: .75rem;
}

.divider-line {
    flex-grow: 1;
    border-top: 1px solid var(--tint);
}

.divider-text {
    margin: 0 1rem;
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .05em;
    color: var(--faint);
}

.upload-actions {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin-top: .75rem;
}

/* ---------- 7. Butonlar ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    padding: .5rem 1rem;
    font-size: .875rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: .5rem;
    cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { padding: .375rem .75rem; }

.btn-exit {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

.btn-exit:hover:not(:disabled) { background: #dc2626; }

.dark .btn-exit {
    background: var(--red);
    color: #fff;
}

.dark .btn-exit:hover:not(:disabled) { background: #dc2626; }

.btn-secondary {
    background: #ecfdf5;
    color: var(--green);
    border-color: #a7f3d0;
}

.btn-secondary:hover:not(:disabled) { 
    background: #d1fae5; 
}

.dark .btn-secondary {
    background: rgba(6, 78, 59, .3);
    border-color: rgba(6, 95, 70, .5);
}

.dark .btn-secondary:hover:not(:disabled) { 
    background: rgba(6, 78, 59, .5); 
}

.btn-soft {
    background: #eff6ff;
    color: var(--accent);
    border-color: #bfdbfe;
}

.btn-soft:hover:not(:disabled) { background: #dbeafe; }

.dark .btn-soft {
    background: rgba(30, 58, 138, .3);
    border-color: rgba(30, 64, 175, .5);
}

.dark .btn-soft:hover:not(:disabled) { background: rgba(30, 58, 138, .5); }

.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1d4ed8; }

.link-btn {
    padding: 0;
    border: 0;
    background: none;
    font-size: .75rem;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
    transition: color .2s;
}

.link-btn:hover { color: var(--blue); }

/* ---------- 8. Dahil edilen dosyalar ---------- */
.included-files {
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
    padding: 1.25rem;
}

.included-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}

.included-title {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text);
}

.included-list {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: .5rem;
}

.included-list > * + * { margin-top: .25rem; }

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .375rem;
    padding-right: 5.2rem; /* <-- BU SATIRI EKLE (Butonların kapladığı alan kadar sağdan boşluk bırakır) */
    border: 1px solid transparent;
    border-radius: .375rem;
    position: relative;     /* <-- BU SATIRI EKLE */
    transition: background-color .2s, border-color .2s, opacity .2s, padding .2s, transform .2s;
}

.file-item:hover {
    background: #f9fafb;
    border-color: var(--tint);
}

.dark .file-item:hover { background: rgba(31, 41, 55, .5); }

/* Drag and Drop Effects */

/* Listede kendi halinde bekleyen asıl parçanın stili. Sürüklerken tamamen görünmez olur. */
.file-item.is-dragging {
    opacity: 0; /* Sürüklenen orijinal kutucuk TAMAMEN KAYBOLUR */
}

/* Sürükleme esnasında farenin ucunda beliren ufak kopyanın (ghost) stili */
.drag-ghost-style {
    width: max-content !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 9999px !important;
    padding: 0.25rem 0.75rem 0.25rem 0.5rem !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2) !important;
}
.drag-ghost-style .file-item-actions,
.drag-ghost-style .file-drag-handle {
    display: none !important; /* Butonları ve kaydırma ikonunu gizler */
}
.dark .drag-ghost-style {
    background: var(--surface-2) !important;
    border-color: var(--tint) !important;
}
/* Satır Üstüne Bırakma Göstergesi */
.file-item.drag-over-top {
    border-top-color: var(--blue);
    box-shadow: 0 -2px 0 var(--blue);
    background: #eff6ff;
}
.dark .file-item.drag-over-top {
    background: rgba(59, 130, 246, 0.1);
}

/* Satır Altına Bırakma Göstergesi */
.file-item.drag-over-bottom {
    border-bottom-color: var(--blue);
    box-shadow: 0 2px 0 var(--blue);
    background: #eff6ff;
}
.dark .file-item.drag-over-bottom {
    background: rgba(59, 130, 246, 0.1);
}

.file-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    cursor: grab;
    padding-right: 0.25rem;
    opacity: 0.3;
    transition: opacity 0.2s, color 0.2s;
}

.file-item:hover .file-drag-handle {
    opacity: 1;
}

.file-drag-handle:hover {
    color: var(--text);
}

.file-drag-handle:active {
    cursor: grabbing;
}


.file-item-main {
    display: flex;
    align-items: center;
    gap: .5rem;
    overflow: hidden;
    flex: 1 1 auto;      /* BUNU EKLE */
    min-width: 0;        /* BUNU EKLE */
}

.file-dot {
    width: .625rem;
    height: .625rem;
    border-radius: 9999px;
    transition: opacity 0.2s;
}

.file-name {
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-2);

    font-family: var(--font-geist-mono);   /* Geist Mono */
    /* font-size: .8125rem; */

    display: block;
    overflow: hidden;
    white-space: nowrap;
    /* text-overflow: ellipsis; */

    /* direction: rtl;
    unicode-bidi: plaintext; */
    text-align: left;

    flex: 1 1 auto;   /* Kalan tüm alanı kapla */
    width: 100%;
    min-width: 0;     /* Flex küçülmesine izin ver */
}

/* 3 BUTONUN KAPSAYICISI (Görünmezlik burada kontrol ediliyor) */
.file-item-actions {
    position: absolute;   /* <-- relative yerine absolute yap */
    right: 0.5rem;        /* <-- Sağa sabitle */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

/* Hover veya klavye ile gezinildiğinde butonları görünür yap */
.file-item:hover .file-item-actions,
.file-item-actions:focus-within {
    opacity: 1;
    visibility: visible;
}

.file-action-btn,
.file-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    min-width: 1.2rem;    
    min-height: 1.2rem;    
    box-sizing: border-box;  
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: var(--muted);
    color: var(--surface);   
    opacity: 1;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}

.file-action-btn:hover {
    background: var(--green);
    color: var(--surface);
}

.file-remove:hover {
    background: var(--red);
    color: var(--surface);
}

.dark .file-remove:hover {
    background: var(--red);
    color: var(--surface);
}

/* Checkbox Yuvarlağı CSS - Radio Tarzı */
.file-toggle-cb {
    appearance: none;
    -webkit-appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;    
    min-height: 1.25rem;    
    box-sizing: border-box;  
    padding: 0;
    margin: 0;
    border: 2px solid var(--muted);
    border-radius: 50%;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.file-toggle-cb:hover {
    border-color: var(--blue);
}

.file-toggle-cb:checked {
    border-color: var(--muted);
}

.file-toggle-cb:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.88rem;          
    height: 0.88rem;         
    background-color: var(--muted);
    border-radius: 50%;
    transition: background-color 0.2s;
}

.file-toggle-cb:checked:hover {
    border-color: var(--blue);
}

.file-toggle-cb:checked:hover::after {
    background-color: var(--blue);
}

.file-toggle-cb:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.file-item.is-excluded .file-name,
.file-item.is-excluded .file-dot {
    opacity: 0.4;
}
.file-item.is-excluded .file-name {
    text-decoration: line-through;
}

/* ---------- 9. Ayarlar ---------- */
.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .5rem 0;
    border: 0;
    background: none;
    font-size: .875rem;
    color: var(--muted);
    cursor: pointer;
    transition: color .2s;
}

.settings-toggle:hover { color: var(--text); }
.settings-panel { padding: 1.25rem; }
.settings-panel > * + * { margin-top: 1rem; }

.field-label {
    display: block;
    margin-bottom: .375rem;
    font-size: .75rem;
    font-weight: 500;
    color: var(--text-3);
}

.field-label-lg { margin-bottom: .5rem; }

.field-hint {
    margin-top: .25rem;
    font-size: .625rem;
    color: var(--muted);
}

.tag-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem;
    padding: .375rem;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: .5rem;
    cursor: text;
    transition: border-color .2s, box-shadow .2s;
    /* Uzun input listeleri için eklendi */
    max-height: 120px;
    overflow-y: auto;
}

.dark .tag-input-wrapper {
    background: #030712;
    border-color: #1f2937;
}

.tag-input-wrapper:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 1px var(--blue);
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
}

.tag-field {
    flex-grow: 1;
    min-width: 120px;
    padding: 0 .25rem;
    border: 0;
    background: transparent;
    font-size: .875rem;
    color: var(--text);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding-top: .75rem;
    border-top: 1px solid var(--border);
}

.radio-grid {
    display: grid;
    /* 2 Sütunluk Grid Kaldırıldı, Alt Alta Dizilecek (1 Sütun) */
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: .5rem;
}

.radio-stack > * + * { margin-top: .5rem; }

.radio-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: var(--text-2);
    cursor: pointer;
    transition: color .2s;
}

.radio-option:hover { color: var(--blue); }

.radio {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--blue);
    cursor: pointer;
}

.radio:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

/* ---------- 10. Etiketler (chip) ---------- */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .25rem .625rem;
    font-size: .75rem;
    font-weight: 600;
    border: 1px solid #d1d5db;
    border-radius: .375rem;
    background: var(--tint);
    color: var(--text-2);
}

.dark .tag-chip { border-color: #4b5563; }

.tag-close {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 0;
    border-radius: 50%;
    background: #9ca3af;
    color: #fff;
    cursor: pointer;
    transition: background-color .2s;
}

.dark .tag-close { background: #6b7280; }
.tag-close:hover, .dark .tag-close:hover { background: var(--red); }

/* ---------- 11. Çıktı paneli ---------- */
.output-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
    transition: background-color .3s, border-color .3s;
}

.toolbar-stats { flex-grow: 1; max-width: 40rem; }
.toolbar-actions { display: flex; align-items: center; gap: .5rem; }

/* .stat-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: .5rem;
    font-size: .75rem;
} */

/* Ayrı olan .stat-row kaldirildi. Sadece margin ayarlari iptal edildi, .stat siniflari asagida kullanilmaya devam ediyor. */

.stat { 
    font-weight: 500; 
    color: var(--muted); 
    cursor: default; 
    white-space: nowrap;
    display: inline-block; /* Genişlik verebilmek için eklendi */
}

/* Rakamların piksel genişliklerini sabit ve eşit hale getirir */
.stat-value, .stat-value-accent { 
    font-weight: 700; 
    font-variant-numeric: tabular-nums; 
}

.stat-value { color: var(--text); }
.stat-value-accent { color: var(--accent); }

/* Her bir bloğa sabit bir alan ayırarak yanındakini itmesini engelliyoruz */
.progress-text-overlay .stat:nth-child(1) { min-width: 3rem; } /* Dosya kısmı */
.progress-text-overlay .stat:nth-child(2) { min-width: 5rem; }   /* Context kısmı */
.progress-text-overlay .stat:nth-child(3) { min-width: 6rem; } /* Token kısmı */

/* Progress bar ve Model seçim alanını yan yana hizalamak için */
.progress-and-model-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.progress-track {
    /* flex-grow: 1; kısmını siliyoruz */
    width: 17rem; /* Genişliği sabitliyoruz. Gözüne göre 20rem ile 26rem arası bir değer verebilirsin */
    flex-shrink: 0; /* Ekran küçüldüğünde çubuğun ezilmesini engeller */
    
    height: 2.125rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: .5rem;
    position: relative;
    overflow: hidden;
}

.progress-text-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 1rem;
    gap: 0.75rem; /* Boşluklar daraltıldı */
    font-size: .75rem;
    z-index: 5;
    white-space: nowrap; 
}

/* Model ismini ~15 karakterle sınırlar ve taşan kısmı ... yapar */
#custom-model-text {
    max-width: 15ch; 
    display: inline-block;
    vertical-align: middle;
}

.model-select-wrapper {
    flex-shrink: 0;
    width: max-content; /* Kapsayıcı artık sadece içindeki elemanlar kadar yer kaplayacak */
    display: flex;
    gap: 0.375rem;
}

.model-select {
    position: relative;
    width: 11.5rem; /* Sabit genişliğimiz (gözüne göre 10rem - 12rem arası ayarlayabilirsin) */
    flex: none; /* Genişleme ve daralma özelliğini tamamen kapattık */
}

/* Custom moduna geçildiğinde kutunun kelimeye göre daralmaya devam etmesi için sabit genişliği iptal ediyoruz */
.model-select-wrapper.is-custom .model-select {
    width: auto; 
}

.model-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .25rem;
    width: 100%;
    padding: .375rem .75rem; /* Sağdaki butonlarla birebir aynı yükseklik boşluğu */
    font-size: .875rem; /* Yazı büyüklüğü diğer butonlarla eşitlendi (14px) */
    font-weight: 500;
    color: var(--text-2);
    background: var(--surface-2);
    border: 1px solid var(--tint);
    border-radius: .5rem; /* Kavisler diğer butonlarla uyumlu hale getirildi */
    box-shadow: var(--shadow);
    cursor: pointer;
    /* height: 100%; <--- SİLİNDİ (Sıkışmaya sebep olan satır) */
}

.model-btn:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--blue);
}

.model-btn-label {
    display: flex;
    align-items: center;
    gap: .375rem;
    overflow: hidden;
}

.model-icon { display: flex; align-items: center; justify-content: center; }
.model-caret { color: var(--faint); }

.model-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 50;
    width: 100%;
    margin-top: .25rem;
    padding: .25rem 0;
    background: var(--surface-2);
    border: 1px solid var(--tint);
    border-radius: .375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
}

.model-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .5rem .75rem; /* Daha rahat tıklama alanı için padding eklendi */
    text-align: left;
    font-size: .875rem; /* Menü içi font boyutu butonla eşitlendi */
    font-weight: 500;
    color: var(--text-2);
    background: none;
    border: 0;
    cursor: pointer;
}

.model-option:hover { background: #f9fafb; }
.dark .model-option:hover { background: #374151; }

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

/* CUSTOM MODU STİLLERİ */
#custom-context-input-wrapper {
    display: none;
}
/* Custom modu aktifken kapsayıcının 11rem'lik minimum genişlik kısıtlamasını kaldır */
.model-select-wrapper.is-custom {
    min-width: 6ch; 
}

/* Custom seçildiğinde sadece "Custom" yazısı sığacak kadar daralt */
/* .model-select-wrapper.is-custom #custom-model-text {
    max-width: 6ch; 
} */
/* .model-select-wrapper.is-custom .model-select {
    flex: 0 0 auto; 
} */
.model-select-wrapper.is-custom #custom-context-input-wrapper {
    display: block;
    flex: 0 0 auto; /* Flex 1 iptal edildi, kutu sadece içeriği kadar yer kaplayacak */
}
.model-select-wrapper.is-custom .model-menu {
    width: max-content;
    min-width: 100%; /* Seçenek daralınca menü de çok daralmasın diye */
}

/* Custom Context Select Box (Tarayıcı stilini ezme) */
#custom-context-select {
    appearance: none;
    -webkit-appearance: none;
    width: 4.1rem;
    height: 100%;
    padding: .375rem 1.5rem .375rem .5rem !important; /* Ok ikonu için sağdan ekstra boşluk */
    /* Soldaki menünün ok ikonunu SVG formatında direkt arka plana gömüyoruz */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%239ca3af' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.375rem center;
    background-size: 0.75rem; /* icon-xs boyutu */
}

/* Koyu mod için ok ikonunun rengini uyarla */
.dark #custom-context-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236b7280' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

.progress-bar {
    width: 0;
    height: 100%;
    /* İçindeki yazının karanlıkta ve aydınlıkta okunabilmesi için tam dolguyu saydamlaştırdık */
    background: rgba(59, 130, 246, 0.3); 
    transition: width .5s, background-color .5s;
}

.dark .progress-bar { background: rgba(59, 130, 246, 0.4); }

.progress-bar-safe { background: rgba(16, 185, 129, 0.4); }
.dark .progress-bar-safe { background: rgba(16, 185, 129, 0.5); }

.progress-bar-warn { background: rgba(234, 179, 8, 0.4); }
.dark .progress-bar-warn { background: rgba(234, 179, 8, 0.5); }

.progress-bar-orange { background: rgba(249, 115, 22, 0.4); }
.dark .progress-bar-orange { background: rgba(249, 115, 22, 0.5); }

.progress-bar-danger { background: rgba(239, 68, 68, 0.5); }
.dark .progress-bar-danger { background: rgba(239, 68, 68, 0.6); }

.progress-bar-over { 
    background: rgba(225, 29, 72, 0.6); 
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.15) 10px, rgba(255,255,255,0.15) 20px);
}
.dark .progress-bar-over { 
    background: rgba(225, 29, 72, 0.7); 
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.15) 10px, rgba(255,255,255,0.15) 20px);
}

.output-body {
    position: relative;
    flex-grow: 1;
    display: flex;
    overflow: hidden;
    background: #fff;
    border-top: 1px solid var(--border);
    transition: background-color .3s, border-color .3s;
}

.dark .output-body { background: #030712; }

.file-nav {
    display: none;
    flex-direction: column;
    gap: .25rem;
    width: 1.5rem;
    height: 100%;
    padding: .25rem;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background: rgba(249, 250, 251, .5);
}

.dark .file-nav { background: rgba(17, 24, 39, .5); }

.file-nav-item {
    width: 100%;
    min-height: 4px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, .05);
    border-radius: 9999px;
    cursor: pointer;
    transition: opacity .2s;
}

.dark .file-nav-item { border-color: rgba(255, 255, 255, .1); }
.file-nav-item:hover { opacity: .7; }

.code-wrapper { position: relative; flex-grow: 1; overflow: hidden; }

.output-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: .875rem;
    color: var(--faint);
    pointer-events: none;
    transition: opacity .3s;
}

.output-area {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 1rem;
    background: transparent;
    color: var(--text-2);
    font-family: var(--font-mono);
    font-size: .875rem;
    line-height: 1.625;
    overflow-y: auto;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: break-word;
    scroll-behavior: smooth;
    transition: opacity .3s;
}

.file-block { scroll-margin-top: 1rem; }

.loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .8);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.dark .loading-overlay { background: rgba(3, 7, 18, .8); }

.loading-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spinner {
    margin-bottom: .75rem;
    color: var(--blue);
    animation: spin 1s linear infinite;
}

.spinner-track { opacity: .25; }
.spinner-head { opacity: .75; }

.loading-text {
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-2);
}

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

/* ---------- 12. Sözdizimi vurguları (app.js üretir) ---------- */
.hl-blue { color: var(--accent); font-weight: 700; }
.hl-green { color: var(--green); font-weight: 700; }
.hl-purple { color: #9333ea; font-weight: 700; }
.dark .hl-purple { color: #c084fc; }
.hl-dim { color: #9ca3af; }
.dark .hl-dim { color: #4b5563; }

/* ---------- 13. Scrollbar ---------- */
.custom-scrollbar::-webkit-scrollbar { width: 10px; height: 10px; }
.custom-scrollbar::-webkit-scrollbar-track { background: var(--sb-track); border-radius: 8px; }

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--sb-thumb);
    border-radius: 8px;
    border: 2px solid var(--sb-track);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--sb-thumb-hover); }

/* ---------- 14. Durumlar ---------- */
.drag-active {
    border-color: #3b82f6 !important;
    background-color: rgba(59, 130, 246, .05) !important;
}

.dark .drag-active { background-color: rgba(59, 130, 246, .1) !important; }

.drag-active svg {
    color: #3b82f6 !important;
    transform: scale(1.1);
    transition: transform .2s ease;
}

.btn-success {
    background-color: #059669 !important;
    color: #fff !important;
    border-color: #059669 !important;
}

.btn-success:hover:not(:disabled) {
    background-color: #047857 !important;
    border-color: #047857 !important;
}

/* ---------- 15. Responsive ---------- */
@media (min-width: 640px) {
    .theme-toggle { bottom: 1.5rem; right: 1.5rem; }
    .main { padding: 1.5rem; }
    .badge-row { gap: .75rem; }
    .included-files { padding: 1.5rem; }
    .file-nav { display: flex; width: 2rem; padding: .375rem; }
}

@media (min-width: 1024px) {
    .app-layout.is-expanded { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .input-panel.is-narrow { grid-column: span 4 / span 4; }
    .output-panel { grid-column: span 8 / span 8; }
}

/* ---------- 16. JS'in kullandığı yardımcılar (en sonda) ---------- */
.flex { display: flex !important; }
.hidden { display: none !important; }
.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }