 /* =========================================
    WORD SEARCH & REPLACE — PREMIUM UI
    ========================================= */
 .da-wrapper {
     --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
     --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
     display: flex;
     justify-content: center;
         padding: clamp(0px, 5vw, 0px) 20px;
 }

 .da-panel {
     position: relative;                
     width: 100%;
     max-width: 1200px;
     border-radius: 28px;
     padding: clamp(28px, 5vw, 56px);
 }

 


 /* ---------- TOOL LAYOUT ---------- */
 .tool-wrap { display: flex; gap: 24px; margin-bottom: 30px; align-items: flex-start; }
 @media(max-width: 992px) { .tool-wrap { flex-direction: column; } }
 
 .editor-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
 .rules-panel { width: 380px; flex-shrink: 0; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.02); }
 @media(max-width: 992px) { .rules-panel { width: 100%; } }

 /* ---------- EDITOR PANEL ---------- */
 .text-panel { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.02); }
 .p-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border-color); background: var(--bg-body); gap: 12px; }
 .p-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--text-main); }
 .p-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
 
 .p-badge { background: var(--bg-body); border: 1px solid var(--border-color); font-size: 11px; font-weight: 700; color: var(--text-muted); padding: 4px 10px; border-radius: 100px; }
 .p-badge.live { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.2); color: #22c55e; }
 .p-badge.match { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.2); color: #ef4444; }

 .view-tabs { display: flex; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 2px; }
 .vt { background: transparent; border: none; padding: 4px 12px; font-size: 11px; font-weight: 800; color: var(--text-muted); border-radius: 6px; cursor: pointer; transition: all 0.2s; }
 .vt.active { background: var(--bg-body); color: var(--text-main); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

 .dir-toggle { display: flex; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 8px; padding: 2px; }
 .dir-btn { background: transparent; border: none; padding: 4px 8px; font-size: 11px; font-weight: 800; color: var(--text-muted); border-radius: 6px; cursor: pointer; transition: all 0.2s; }
 .dir-btn.active { background: var(--card-bg); color: var(--primary-color); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

 .ta { min-height: 400px; width: 100%; background: transparent; border: none; padding: 20px; font-size: 15px; line-height: 1.6; font-family: 'Space Mono', monospace; color: var(--text-main); outline: none; resize: vertical; }
 
 .preview-div { min-height: 400px; padding: 20px; font-size: 15px; line-height: 1.6; font-family: 'Space Mono', monospace; color: var(--text-main); white-space: pre-wrap; word-break: break-word; overflow-y: auto; background: rgba(0,0,0,0.01); }
 .hl-find { background: rgba(239,68,68,0.2); color: #dc2626; border-radius: 2px; padding: 0 2px; border-bottom: 1px dashed #ef4444; cursor: help; }

 .p-footer { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border-color); background: var(--bg-body); }
 .act-btn { flex: 1; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 8px; font-size: 12px; font-weight: 800; color: var(--text-main); display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
 .act-btn:hover { border-color: var(--primary-color); transform: translateY(-2px); }
 .act-btn.danger { color: #ef4444; }
 .act-btn.danger:hover { border-color: #ef4444; background: rgba(239,68,68,0.05); }
 .act-btn.copied { background: #22c55e !important; border-color: #22c55e !important; color: #fff !important; }

 /* ---------- RULES PANEL ---------- */
 .rp-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border-color); background: var(--bg-body); }
 .rp-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--text-main); }
 
 .rule-list { display: flex; flex-direction: column; padding: 16px; gap: 16px; max-height: 450px; overflow-y: auto; }
 
 .rule-card { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; transition: all 0.2s; }
 .rule-card.has-match { border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.02); }
 .rule-card.error { border-color: rgba(245,158,11,0.5); background: rgba(245,158,11,0.02); }
 
 .rc-row { display: flex; align-items: center; gap: 8px; }
 .rc-badge { font-size: 10px; font-weight: 800; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; width: 40px; text-align: center; }
 .rc-badge.find { background: rgba(239,68,68,0.1); color: #ef4444; }
 .rc-badge.repl { background: rgba(34,197,94,0.1); color: #22c55e; }
 
 .rc-input { flex: 1; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 6px; padding: 6px 8px; font-size: 13px; font-family: 'Space Mono', monospace; color: var(--text-main); outline: none; transition: all 0.2s; min-width: 0; }
 .rc-input:focus { border-color: var(--primary-color); }
 
 .rc-remove { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); cursor: pointer; transition: all 0.2s; flex-shrink: 0; }
 .rc-remove:hover { background: rgba(239,68,68,0.1); color: #ef4444; }
 
 .rc-opts { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; padding-left: 48px; }
 .rc-flags { display: flex; gap: 4px; }
 .flag-btn { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 4px; padding: 2px 6px; font-size: 11px; font-weight: 800; font-family: 'Space Mono', monospace; color: var(--text-muted); cursor: pointer; transition: all 0.2s; }
 .flag-btn:hover { border-color: var(--primary-color); color: var(--text-main); }
 .flag-btn.on { background: rgba(var(--primary-color-rgb), 0.1); border-color: var(--primary-color); color: var(--primary-color); }
 
 .rc-stat { font-size: 11px; font-weight: 800; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
 .rc-stat.found { color: #ef4444; }
 .rc-stat.error-txt { color: #f59e0b; }

 .add-rule-btn { margin: 0 16px 16px 16px; background: transparent; border: 1px dashed var(--border-color); border-radius: 12px; padding: 12px; font-size: 13px; font-weight: 800; color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: all 0.2s; }
 .add-rule-btn:hover { border-color: var(--primary-color); color: var(--primary-color); background: rgba(var(--primary-color-rgb), 0.02); }
 
 .run-bar { padding: 16px; border-top: 1px solid var(--border-color); background: var(--bg-body); display: flex; gap: 12px; }
 .run-btn { flex: 1; background: var(--primary-color); border: none; border-radius: 10px; padding: 10px; font-size: 14px; font-weight: 800; color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3); }
 .run-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(var(--primary-color-rgb), 0.4); }

 /* ---------- STATS STRIP ---------- */
 .stats-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
 .sc { background: var(--card-bg); border-radius: 16px; padding: 20px; border: 1px solid var(--border-color); display: flex; flex-direction: column; align-items: center; text-align: center; transition: transform 0.2s; }
 .sc:hover { transform: translateY(-2px); }
 .sc-ico { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
 .sc-ico.red { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
 .sc-ico.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
 .sc-ico.green { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
 .sc-ico.warn { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
 .sc-ico.purple { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
 .sc-val { font-size: 28px; font-weight: 900; color: var(--text-main); line-height: 1; margin-bottom: 4px; transition: transform 0.3s; }
 .sc-lbl { font-size: 11px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
 .sc-val.popped { transform: scale(1.3); color: var(--primary-color); }

 /* ---------- HISTORY PANEL ---------- */
 .history-panel { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; overflow: hidden; margin-bottom: 40px; box-shadow: 0 10px 30px rgba(0,0,0,0.02); }
 .hp-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border-color); background: var(--bg-body); }
 .hp-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--text-main); }
 .hist-list { display: flex; flex-direction: column; max-height: 250px; overflow-y: auto; }
 .hist-empty { padding: 40px; text-align: center; color: var(--text-muted); font-size: 13px; font-weight: 800; font-family: 'Space Mono', monospace; display: flex; flex-direction: column; align-items: center; gap: 8px; }
 .hist-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border-color); font-family: 'Space Mono', monospace; font-size: 13px; }
 .hist-item:last-child { border-bottom: none; }
 .hi-find { color: #ef4444; font-weight: 800; max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
 .hi-arrow { color: var(--text-muted); }
 /* ── Comparison Panel & Analytics ── */
 .comparison-panel {
     background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 24px;
     padding: 28px; margin-top: 32px; box-shadow: 0 10px 30px rgba(0,0,0,0.02); margin-bottom: 40px;
 }
 .cp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
 .cp-title { font-size: 16px; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 10px; }
 .cp-badge { font-size: 12px; font-weight: 800; padding: 6px 14px; border-radius: 100px; }
 .badge-high { background: color-mix(in srgb, var(--success, #10b981) 15%, transparent); color: var(--success, #10b981); border: 1px solid color-mix(in srgb, var(--success, #10b981) 30%, transparent); }

 .cp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
 .cp-card { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
 .cpc-header { display: flex; justify-content: space-between; align-items: center; }
 .cpc-title { font-size: 13.5px; font-weight: 800; color: var(--text-main); }
 .cpc-tag { font-size: 11.5px; font-weight: 800; padding: 4px 10px; border-radius: 6px; }
 .cpc-tag.success { background: color-mix(in srgb, var(--success, #10b981) 15%, transparent); color: var(--success, #10b981); }

 .cpc-body { display: flex; flex-direction: column; gap: 10px; }
 .cpc-stat-row { font-size: 13px; color: var(--text-muted); display: flex; justify-content: space-between; }
 .cpc-stat-row strong { color: var(--text-main); font-weight: 700; }
 .cpc-progress-bar { width: 100%; height: 8px; background: var(--border-color); border-radius: 100px; overflow: hidden; margin-top: 4px; }
 .cpc-progress-fill { height: 100%; background: var(--primary-color); border-radius: 100px; transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
 .cpc-progress-fill.bg-gradient { background: linear-gradient(90deg, var(--primary-color), var(--primary-gradient-end)); }

 /* Zero-Inline Enhancements */
 #bgCv { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
 .rw-hero-badge i { width: 14px; height: 14px; }
 .file-input-hidden { display: none; }
 .btn-sm-fixed { padding: 4px 10px; font-size: 11px; flex: none; }
 .btn-sm-fixed i { width: 12px; height: 12px; }
 .rules-empty-state { text-align: center; padding: 28px 16px; color: var(--text-muted); font-size: 13px; opacity: 0.5; }
 .rules-empty-state i { width: 28px; height: 28px; margin: 0 auto 10px; display: flex; justify-content: center; opacity: 0.4; }
 .rc-idx { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--text-muted); flex-shrink: 0; }
 .rc-remove i { width: 12px; height: 12px; }
 .rc-idx-spacer { width: 28px; flex-shrink: 0; }
 .rc-stat i { width: 12px; height: 12px; }
 .add-rule-btn i { width: 15px; height: 15px; }
 .run-btn i { width: 17px; height: 17px; }
 .btn-square-44 { flex: none; width: 44px; }
 .btn-square-44 i { width: 14px; height: 14px; }
 .sc.border-red { border-top: 2px solid #ef4444; }
 .sc.border-blue { border-top: 2px solid #3b82f6; }
 .sc.border-green { border-top: 2px solid #22c55e; }
 .sc.border-warn { border-top: 2px solid #f59e0b; }
 .sc.border-purple { border-top: 2px solid #a855f7; }
 .sc-ico i { width: 18px; height: 18px; }
 .hp-title i { width: 14px; height: 14px; }
 .hist-empty i { width: 20px; height: 20px; opacity: 0.5; }
 .hi-arrow { width: 14px; height: 14px; }
 .hi-deleted { opacity: 0.5; }
 .info-div-t { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--text-main); margin-bottom: 20px; margin-top: 40px; }
 .info-div-t i { width: 16px; height: 16px; color: var(--primary-color); }