/* ============================================================
   ST Structure Visualizer — styles.css
   Modern Industrial Dark/Light Theme
   Vanilla CSS · No frameworks
   ============================================================ */

/* ===== § 1 · RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* CSS class'larının display değerlerinin [hidden] nitelikliğini ezmesini önle */
[hidden] { display: none !important; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    transition: background var(--theme-tx), color var(--theme-tx);
}

button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
select { font: inherit; }
kbd {
    display: inline-block;
    padding: 1px 6px;
    border-radius: var(--r-xs);
    border: 1px solid var(--border-default);
    background: var(--bg-elevated);
    font-family: var(--font-mono);
    font-size: .85em;
    color: var(--text-secondary);
}
mark.search-highlight {
    background: rgba(250, 204, 21, 0.35);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

/* ===== § 2 · TEMA DEĞİŞKENLERİ ===== */

/* ─── DARK THEME (varsayılan) ─── */
:root {
    /* Arkaplan katmanları */
    --bg-base:        #0d1117;
    --bg-surface:     #161c28;
    --bg-card:        #1c2333;
    --bg-elevated:    #222c40;
    --bg-input:       #0d1117;
    --bg-row-hover:   rgba(56, 189, 248, 0.05);
    --bg-row-alt:     rgba(255, 255, 255, 0.015);

    /* Sınırlar */
    --border-subtle:  #1d2538;
    --border-default: #2a3650;
    --border-strong:  #3b4f6f;
    --border-accent:  rgba(56, 189, 248, 0.3);

    /* Metin */
    --text-primary:   #dde4f0;
    --text-secondary: #8b9ab0;
    --text-muted:     #4f5e78;
    --text-code:      #93c5fd;

    /* Vurgu rengi */
    --accent:         #38bdf8;
    --accent-dim:     rgba(56, 189, 248, 0.14);
    --accent-hover:   rgba(56, 189, 248, 0.08);

    /* BOOL badge'leri */
    --bool-t-color:   #4ade80;
    --bool-t-bg:      rgba(74, 222, 128, 0.12);
    --bool-f-color:   #64748b;
    --bool-f-bg:      rgba(100, 116, 139, 0.14);

    /* Tip renkleri */
    --c-bool:   #4ade80;  --cbg-bool:   rgba(74,  222, 128, 0.10);
    --c-int:    #fbbf24;  --cbg-int:    rgba(251, 191,  36, 0.10);
    --c-real:   #fb923c;  --cbg-real:   rgba(251, 146,  60, 0.10);
    --c-str:    #c084fc;  --cbg-str:    rgba(192, 132, 252, 0.10);
    --c-time:   #2dd4bf;  --cbg-time:   rgba( 45, 212, 191, 0.10);
    --c-arr:    #818cf8;  --cbg-arr:    rgba(129, 140, 248, 0.10);
    --c-struct: #38bdf8;  --cbg-struct: rgba( 56, 189, 248, 0.10);
    --c-byte:   #fbbf24;  --cbg-byte:   rgba(251, 191,  36, 0.10);

    /* Gölgeler */
    --shadow-sm:  0 1px 3px  rgba(0,0,0,.45);
    --shadow-md:  0 4px 16px rgba(0,0,0,.55);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.65);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.04);

    /* Köşe yarıçapları */
    --r-xs: 3px;
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;

    /* Tipografi */
    --font-sans: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Consolas', 'Cascadia Code', 'Monaco', 'Courier New', monospace;

    /* Ağaç */
    --indent-w:   22px;  /* her seviye için girinti genişliği */
    --row-h:      36px;  /* her satırın yüksekliği           */
    --toggle-w:   20px;

    /* Geçişler */
    --theme-tx: 200ms ease;
    --tx:        150ms ease;

    /* Header */
    --header-h: 54px;
}

/* ─── LIGHT THEME ─── */
[data-theme="light"] {
    --bg-base:        #f0f4f8;
    --bg-surface:     #ffffff;
    --bg-card:        #ffffff;
    --bg-elevated:    #f8fafb;
    --bg-input:       #f8fafb;
    --bg-row-hover:   rgba(2, 132, 199, 0.05);
    --bg-row-alt:     rgba(0, 0, 0, 0.018);

    --border-subtle:  #e6edf4;
    --border-default: #d1dbe8;
    --border-strong:  #b8c8da;
    --border-accent:  rgba(2, 132, 199, 0.35);

    --text-primary:   #1a2535;
    --text-secondary: #4a5a72;
    --text-muted:     #8f9fb8;
    --text-code:      #4f6ef5;

    --accent:         #0284c7;
    --accent-dim:     rgba(2, 132, 199, 0.10);
    --accent-hover:   rgba(2, 132, 199, 0.07);

    --bool-t-color:   #16a34a;
    --bool-t-bg:      rgba(22, 163, 74, 0.10);
    --bool-f-color:   #94a3b8;
    --bool-f-bg:      rgba(148, 163, 184, 0.14);

    --c-bool:   #16a34a;  --cbg-bool:   rgba( 22, 163,  74, 0.08);
    --c-int:    #b45309;  --cbg-int:    rgba(180,  83,   9, 0.08);
    --c-real:   #c2410c;  --cbg-real:   rgba(194,  65,  12, 0.08);
    --c-str:    #7c3aed;  --cbg-str:    rgba(124,  58, 237, 0.08);
    --c-time:   #0f766e;  --cbg-time:   rgba( 15, 118, 110, 0.08);
    --c-arr:    #4338ca;  --cbg-arr:    rgba( 67,  56, 202, 0.08);
    --c-struct: #0369a1;  --cbg-struct: rgba(  3, 105, 161, 0.08);
    --c-byte:   #b45309;  --cbg-byte:   rgba(180,  83,   9, 0.08);

    --shadow-sm:  0 1px 3px  rgba(0,0,0,.07);
    --shadow-md:  0 4px 16px rgba(0,0,0,.09);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.11);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.8);
}


/* ===== § 3 · LAYOUT ===== */

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-default);
    box-shadow: var(--shadow-sm);
    gap: 12px;
}

.header-brand { display: flex; align-items: center; gap: 12px; }

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--c-arr) 100%);
    border-radius: var(--r-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.5px;
    flex-shrink: 0;
    box-shadow: 0 0 16px var(--accent-dim);
}

.brand-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -.2px;
    line-height: 1.2;
}

.brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: .2px;
}

.header-nav { display: flex; align-items: center; gap: 6px; }

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    transition: background var(--tx), color var(--tx);
}
.icon-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.icon-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.icon { width: 17px; height: 17px; flex-shrink: 0; }

/* Theme icon visibility */
[data-theme="dark"]  .icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }

.app-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}


/* ===== § 4 · UPLOAD SECTION ===== */

.upload-section {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.upload-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.upload-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    flex-shrink: 0;
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    position: relative;
}

.divider-plus {
    font-size: 22px;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1;
}

.upload-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 20px;
    cursor: pointer;
    transition: background var(--tx);
    min-height: 160px;
}
.upload-zone:hover, .upload-zone:focus-visible {
    background: var(--accent-hover);
    outline: none;
}
.upload-zone:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.upload-zone.zone--drag-over {
    background: var(--accent-dim);
    box-shadow: inset 0 0 0 2px var(--accent);
}

.zone-icon {
    width: 48px;
    height: 48px;
    color: var(--accent);
    opacity: .75;
    margin-bottom: 4px;
}
.zone-icon svg { width: 100%; height: 100%; }

.zone-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.zone-ext { font-size: 11.5px; color: var(--text-secondary); }

.zone-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Hidden native file input */
.file-input {
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0; pointer-events: none;
}

/* Yüklendi göstergesi */
.file-loaded {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(74, 222, 128, 0.06);
    border-top: 1px solid rgba(74, 222, 128, 0.18);
    min-height: 160px;
    justify-content: center;
}

.loaded-check {
    width: 18px; height: 18px;
    color: var(--bool-t-color);
    flex-shrink: 0;
}

.loaded-name {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-primary);
    word-break: break-all;
    flex: 1;
    text-align: center;
}

.remove-btn {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--tx), color var(--tx);
}
.remove-btn:hover { background: rgba(239,68,68,.15); color: #ef4444; }


/* ===== § 5 · TOOLBAR ===== */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Arama kutusu */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 9px;
    width: 14px; height: 14px;
    color: var(--text-muted);
    pointer-events: none;
    flex-shrink: 0;
}

.search-input {
    height: 32px;
    width: 220px;
    padding: 0 30px 0 30px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--r-sm);
    color: var(--text-primary);
    font-size: 12.5px;
    transition: border-color var(--tx), box-shadow var(--tx);
    outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.clear-search-btn {
    position: absolute;
    right: 6px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--tx), color var(--tx);
}
.clear-search-btn:hover { background: var(--border-strong); color: var(--text-primary); }

/* Seçim kutuları */
.select-filter {
    height: 32px;
    padding: 0 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--r-sm);
    color: var(--text-primary);
    font-size: 12.5px;
    cursor: pointer;
    outline: none;
    transition: border-color var(--tx);
}
.select-filter:focus { border-color: var(--accent); }
.select-filter option { background: var(--bg-card); }

.struct-select-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.select-label { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

/* Eylem butonları */
.action-btn {
    height: 32px;
    padding: 0 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    font-size: 12px;
    transition: background var(--tx), color var(--tx), border-color var(--tx);
    white-space: nowrap;
}
.action-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* Birincil eylem butonu (Kaydet) */
.action-btn--primary {
    background: var(--accent-dim);
    border-color: var(--border-accent);
    color: var(--accent);
    font-weight: 600;
}
.action-btn--primary:hover {
    background: var(--accent);
    color: var(--bg-base);
    border-color: var(--accent);
}

/* İstatistik chip */
.stats-chip {
    padding: 4px 10px;
    background: var(--accent-dim);
    border: 1px solid var(--border-accent);
    border-radius: var(--r-xl);
    font-size: 12px;
    color: var(--accent);
    white-space: nowrap;
    font-feature-settings: "tnum";
}


/* ===== § 6 · AĞAÇ GÖRÜNÜMÜ ===== */

.tree-view {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Sütun başlıkları */
.tree-header {
    display: grid;
    grid-template-columns: minmax(180px, 2.2fr) 180px minmax(120px, 1fr);
    align-items: center;
    padding: 0 12px;
    height: 34px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-default);
    box-shadow: var(--shadow-inset);
}

.th {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .6px;
}

.th-name  { padding-left: 4px; }
.th-type  { padding-left: 4px; }
.th-value { padding-left: 4px; }

/* Ağaç kapsayıcısı */
.tree-container { padding: 4px 0; }

/* ─── Her grup (kalanabilir düğüm + çocukları) ─── */
.tree-group { display: flex; flex-direction: column; }

/* ─── Her satır ─── */
.tree-row {
    display: grid;
    grid-template-columns: minmax(180px, 2.2fr) 180px minmax(120px, 1fr);
    align-items: center;
    min-height: var(--row-h);
    padding: 0 12px;
    cursor: default;
    transition: background var(--tx);
    border-bottom: 1px solid transparent;
}

/* Alternatif satır rengi */
.tree-row--leaf:nth-child(even) { background: var(--bg-row-alt); }
.tree-row:hover { background: var(--bg-row-hover); border-bottom-color: var(--border-subtle); }

/* Grup başlık satırı */
.tree-row--group {
    background: rgba(56, 189, 248, 0.03);
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
}
.tree-row--group:hover { background: var(--bg-row-hover); }

/* ─── Hücreler ─── */
.tree-cell {
    display: flex;
    align-items: center;
    padding: 0 4px;
    min-width: 0;
    overflow: hidden;
}

.cell-name {
    gap: 0;
    padding-left: 0;
}

/* ─── Girinti (CSS custom property ile dinamik) ─── */
.tree-indent {
    display: inline-block;
    width: calc(var(--depth, 0) * var(--indent-w));
    flex-shrink: 0;
}

/* Aç/kapat düğmesi */
.tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--toggle-w);
    height: var(--toggle-w);
    border-radius: var(--r-xs);
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 10px;
    transition: color var(--tx), background var(--tx), transform var(--tx);
    line-height: 1;
}
.tree-toggle:hover {
    background: var(--bg-elevated);
    color: var(--accent);
}
.tree-toggle:disabled {
    cursor: default;
    color: transparent;
}
.tree-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* Yaprak nokta göstergesi */
.tree-bullet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--toggle-w);
    flex-shrink: 0;
    color: var(--border-strong);
    font-size: 6px;
}
.tree-bullet::before { content: '◆'; }

/* Değişken adı */
.tree-name {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}

.tree-name--group {
    font-weight: 600;
    color: var(--accent);
}

/* ─── ÇOCUKlar kapsayıcısı ─── */
.tree-children {
    overflow: hidden;
}
/* Animasyon için (isteğe bağlı, sade geçiş) */
/* Tarayıcı desteği kısıtlı olduğu için height animation yerine display toggle kullandık */


/* ===== § 7 · TİP BADGE'LERİ ===== */

.type-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: var(--r-xs);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .3px;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.type-bool   { color: var(--c-bool);   background: var(--cbg-bool);   }
.type-int    { color: var(--c-int);    background: var(--cbg-int);    }
.type-real   { color: var(--c-real);   background: var(--cbg-real);   }
.type-str    { color: var(--c-str);    background: var(--cbg-str);    }
.type-time   { color: var(--c-time);   background: var(--cbg-time);   }
.type-arr    { color: var(--c-arr);    background: var(--cbg-arr);    }
.type-struct { color: var(--c-struct); background: var(--cbg-struct); }
.type-byte   { color: var(--c-byte);   background: var(--cbg-byte);   }
.type-unknown{ color: var(--text-muted); background: var(--bg-elevated); }


/* ===== § 8 · DEĞER HÜCRESİ ===== */

.cell-value { justify-content: flex-start; }

/* BOOL badge */
.bool-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    white-space: nowrap;
}

.bool-true  { color: var(--bool-t-color); background: var(--bool-t-bg); }
.bool-false { color: var(--bool-f-color); background: var(--bool-f-bg); }

.bool-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    /* Aktif = pulse animasyonu */
}

.bool-true .bool-dot {
    box-shadow: 0 0 6px currentColor;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px currentColor; }
    50%       { opacity: .6; box-shadow: 0 0 10px currentColor; }
}

/* Normal değer metni */
.value-text {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Varsayılan değer (italik + soluk) */
.value-default {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-muted);
    font-style: italic;
    white-space: nowrap;
}

/* Değer yok */
.value-empty {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1;
}


/* ===== § 9 · SONUÇ YOK ===== */

.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: var(--text-muted);
}
.no-results p { font-size: 13px; text-align: center; }


/* ===== § 10 · BOŞ DURUM ===== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 48px 20px 56px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-art {
    width: 200px;
    height: 160px;
    color: var(--text-muted);
    opacity: .7;
}
.empty-art svg { width: 100%; height: 100%; }

.empty-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -.3px;
}

.empty-desc {
    font-size: 13px;
    line-height: 1.65;
    max-width: 440px;
}

.empty-tips {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.tip-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--r-md);
    text-align: left;
    max-width: 240px;
    box-shadow: var(--shadow-sm);
}

.tip-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.tip-code {
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre;
}


/* ===== § 11 · TOAST BİLDİRİM ===== */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    max-width: 380px;
    padding: 11px 16px;
    border-radius: var(--r-md);
    font-size: 13px;
    line-height: 1.4;
    box-shadow: var(--shadow-lg);
    transform: translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 280ms ease, transform 280ms ease;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
}

.toast--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast--success { border-left: 3px solid var(--bool-t-color); }
.toast--error   { border-left: 3px solid #f87171; }
.toast--warning { border-left: 3px solid #fbbf24; }
.toast--info    { border-left: 3px solid var(--accent); }


/* ===== § 12 · RESPONSİVE ===== */

@media (max-width: 768px) {
    .app-main { padding: 12px 12px 40px; gap: 12px; }

    .upload-section {
        flex-direction: column;
        border-radius: var(--r-md);
    }

    .upload-divider {
        width: 100%;
        height: 36px;
        border-left: none;
        border-right: none;
        border-top: 1px solid var(--border-subtle);
        border-bottom: 1px solid var(--border-subtle);
    }

    .upload-zone { min-height: 110px; padding: 18px 16px; }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .toolbar-left, .toolbar-right { flex-wrap: wrap; gap: 6px; }
    .search-input { width: 100%; }

    .tree-header,
    .tree-row {
        grid-template-columns: minmax(120px, 1.8fr) 130px minmax(90px, 1fr);
    }
}

@media (max-width: 480px) {
    .brand-sub { display: none; }
    .brand-title { font-size: 14px; }

    .tree-header,
    .tree-row {
        grid-template-columns: minmax(100px, 1.5fr) 110px minmax(70px, 1fr);
    }

    .empty-tips { flex-direction: column; }
    .tip-card { max-width: 100%; }
}


/* ===== § 13 · SCROLL ===== */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }


/* ===== § 14 · EKSİK YAPI TANIMLARI UYARISI ===== */

.missing-alert {
    background: var(--bg-card);
    border: 1px solid rgba(251, 191, 36, 0.30);
    border-left: 3px solid #fbbf24;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    animation: slideDown 260ms ease;
}

[data-theme="light"] .missing-alert {
    border-color: rgba(180, 83, 9, 0.25);
    border-left-color: #d97706;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.missing-alert-inner {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.missing-alert-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.missing-alert-icon {
    width: 22px;
    height: 22px;
    color: #fbbf24;
    flex-shrink: 0;
    margin-top: 1px;
}

[data-theme="light"] .missing-alert-icon { color: #d97706; }

.missing-alert-title {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.missing-alert-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ── Eksik tip etiketleri ── */
.missing-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.missing-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 8px;
    border-radius: var(--r-xl);
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 600;
    background: rgba(251, 191, 36, 0.10);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.30);
    transition: background var(--tx), color var(--tx), border-color var(--tx);
    cursor: default;
}

[data-theme="light"] .missing-tag {
    background: rgba(217, 119, 6, 0.08);
    color: #d97706;
    border-color: rgba(217, 119, 6, 0.25);
}

/* Çözümlenmiş tag */
.missing-tag--resolved {
    background: var(--bool-t-bg);
    color: var(--bool-t-color);
    border-color: rgba(74, 222, 128, 0.30);
    text-decoration: line-through;
    opacity: 0.7;
}

.missing-tag-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* Çözümlenmiş dot farklı görünür */
.missing-tag--resolved .missing-tag-dot {
    background: var(--bool-t-color);
}

/* ── Ek DUT yükleme alanı ── */
.extra-drop-zone {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: var(--bg-surface);
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: border-color var(--tx), background var(--tx), color var(--tx);
    font-size: 12.5px;
    color: var(--text-secondary);
    position: relative;   /* input'u konumlandırmak için */
}

.extra-drop-zone:hover,
.extra-drop-zone:focus-visible {
    border-color: var(--accent);
    background: var(--accent-hover);
    color: var(--text-primary);
    outline: none;
}

.extra-drop-zone.zone--drag-over {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent);
}

.extra-drop-zone > svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--accent);
}

.extra-drop-zone em {
    font-style: normal;
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 4px;
}

/* ── Yüklenen ek dosyalar listesi ── */
.extra-files-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.extra-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: rgba(74, 222, 128, 0.06);
    border: 1px solid rgba(74, 222, 128, 0.15);
    border-radius: var(--r-sm);
    font-size: 12px;
    color: var(--text-secondary);
}

.extra-file-check {
    width: 14px;
    height: 14px;
    color: var(--bool-t-color);
    flex-shrink: 0;
}

.extra-file-name {
    font-family: var(--font-mono);
    font-size: 11.5px;
    flex: 1;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.extra-file-types {
    font-size: 11px;
    color: var(--bool-t-color);
    white-space: nowrap;
    font-family: var(--font-mono);
}

/* ── Alt eylem çubuğu ── */
.missing-alert-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.missing-counter {
    font-size: 11.5px;
    color: var(--text-muted);
}

.missing-counter strong {
    color: #fbbf24;
    font-feature-settings: "tnum";
}

[data-theme="light"] .missing-counter strong { color: #d97706; }

.continue-btn {
    height: 30px;
    padding: 0 14px;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    font-size: 12px;
    transition: background var(--tx), color var(--tx), border-color var(--tx);
    white-space: nowrap;
}

.continue-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--accent);
}

.continue-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ── Sabit uyarısı (mavi/cyan vurgu) ── */
.missing-alert--consts {
    border-color: var(--border-accent);
    border-left-color: var(--accent);
}

.missing-alert--consts .missing-alert-icon { color: var(--accent); }

.missing-alert--consts .missing-tag {
    background: var(--accent-dim);
    color:      var(--accent);
    border-color: var(--border-accent);
}

[data-theme="light"] .missing-alert--consts .missing-tag {
    background: rgba(2, 132, 199, 0.08);
    color:      #0369a1;
    border-color: rgba(2, 132, 199, 0.28);
}

.missing-alert--consts .missing-counter strong {
    color: var(--accent);
}

[data-theme="light"] .missing-alert--consts .missing-counter strong {
    color: #0369a1;
}

/* ── Sabit değer giriş satırları ── */
.const-input-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.const-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-sm);
    transition: border-color var(--tx), background var(--tx);
}

.const-input-row:hover { border-color: var(--border-default); }

/* Çözümlendi durumu */
.const-input-row.const-row--resolved {
    background: rgba(74, 222, 128, 0.05);
    border-color: rgba(74, 222, 128, 0.2);
    opacity: 0.8;
}

.const-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.const-row--resolved .const-dot { background: var(--bool-t-color); }

.const-name-label {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.const-row--resolved .const-name-label {
    color: var(--bool-t-color);
    text-decoration: line-through;
}

[data-theme="light"] .const-name-label          { color: #0369a1; }
[data-theme="light"] .const-row--resolved .const-name-label { color: var(--bool-t-color); }

.const-eq {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.const-value-input {
    width: 96px;
    height: 28px;
    padding: 0 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--r-xs);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    outline: none;
    transition: border-color var(--tx), box-shadow var(--tx);
    flex-shrink: 0;
    /* Chrome number input ok'larını gizle */
    -moz-appearance: textfield;
}
.const-value-input::-webkit-outer-spin-button,
.const-value-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.const-value-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim);
}

.const-value-input.input--error {
    border-color: #f87171;
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.15);
}

.const-value-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.const-apply-btn {
    height: 28px;
    padding: 0 10px;
    background: var(--accent-dim);
    border: 1px solid var(--border-accent);
    border-radius: var(--r-xs);
    color: var(--accent);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background var(--tx), color var(--tx), border-color var(--tx);
}

.const-apply-btn:hover {
    background: var(--accent);
    color: var(--bg-base);
    border-color: var(--accent);
}

.const-apply-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Çözümlenmemiş array boyutu değer göstergesi */
.value-unresolved {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: #fbbf24;
    font-family: var(--font-mono);
    cursor: help;
}

[data-theme="light"] .value-unresolved { color: #d97706; }

.value-unresolved::before {
    content: '⚠';
    font-size: 11px;
}


/* ── ARRAY_UNRESOLVED: satır içi sabit değer girişi ── */

.inline-const-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.inline-const-row {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: default;
}

/* Çözümlendi: soluklaş */
.inline-const-row--done .inline-const-name { color: var(--bool-t-color); }
.inline-const-row--done .inline-const-input { opacity: .55; }

.inline-const-name {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: #fbbf24;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}
[data-theme="light"] .inline-const-name { color: #d97706; }

.inline-const-eq {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.inline-const-input {
    width: 64px;
    height: 22px;
    padding: 0 5px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--r-xs);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    outline: none;
    flex-shrink: 0;
    transition: border-color var(--tx), box-shadow var(--tx);
    -moz-appearance: textfield;
}
.inline-const-input::-webkit-outer-spin-button,
.inline-const-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.inline-const-input:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.18);
}
[data-theme="light"] .inline-const-input:focus { border-color: #d97706; }
.inline-const-input.input--error {
    border-color: #f87171;
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.18);
}
.inline-const-input:disabled { cursor: not-allowed; }

.inline-const-apply {
    width: 22px;
    height: 22px;
    border-radius: var(--r-xs);
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: #fbbf24;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--tx), color var(--tx);
    line-height: 1;
}
.inline-const-apply:hover:not(:disabled) {
    background: #fbbf24;
    color: var(--bg-base);
}
.inline-const-apply:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}
.inline-const-apply:disabled { opacity: .4; cursor: not-allowed; }

[data-theme="light"] .inline-const-apply {
    background: rgba(217, 119, 6, 0.1);
    border-color: rgba(217, 119, 6, 0.3);
    color: #d97706;
}
[data-theme="light"] .inline-const-apply:hover:not(:disabled) {
    background: #d97706;
    color: #fff;
}

/* Boyut aralığı bağlam etiketi: [0..GVL.uiRctSatIcMaxNo] */
.inline-const-dim {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: 2px;
    opacity: .75;
}


/* ===== § 15 · BİNARY MOD GÖSTERGELERİ ===== */

.binary-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(129, 140, 248, 0.07);
    border-top: 1px solid rgba(129, 140, 248, 0.18);
    flex-wrap: wrap;
}

.binary-badge {
    background: var(--c-arr);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: var(--r-xs);
    letter-spacing: .5px;
    flex-shrink: 0;
}

[data-theme="light"] .binary-badge { color: var(--bg-base); }

.binary-label {
    font-size: 11.5px;
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
}

.pack-mode-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.pack-mode-label {
    font-size: 11px;
    color: var(--text-muted);
    cursor: default;
}

.pack-mode-select {
    height: 24px;
    padding: 0 6px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--r-xs);
    color: var(--text-primary);
    font-size: 11px;
    cursor: pointer;
    outline: none;
    transition: border-color var(--tx);
}
.pack-mode-select:focus { border-color: var(--accent); }
.pack-mode-select option { background: var(--bg-card); }


/* Değer hücresi düzenleme input'u */
.value-edit-input {
    width: 100%;
    max-width: 180px;
    height: 22px;
    padding: 0 5px;
    background: var(--bg-input);
    border: 1px solid var(--accent);
    border-radius: var(--r-xs);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-dim);
}


/* ===== § 16 · ODAK / ERİŞİLEBİLİRLİK ===== */

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Seçim rengi */
::selection {
    background: var(--accent-dim);
    color: var(--text-primary);
}
