/* ═══════════════════════════════════════════════════════════════════
   AUDFIX Diff Studio – Complete Stylesheet
   Professional compare workspace with dark-modern aesthetic
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --ds-bg: #0f1117;
    --ds-bg-2: #161822;
    --ds-bg-3: #1c1f2e;
    --ds-bg-4: #242737;
    --ds-surface: #1e2130;
    --ds-border: #2a2d3e;
    --ds-border-light: #363952;
    --ds-text: #e1e4ed;
    --ds-text-2: #a0a4b8;
    --ds-text-3: #6b7089;
    --ds-primary: #6c5ce7;
    --ds-primary-light: #a29bfe;
    --ds-primary-dim: rgba(108, 92, 231, 0.15);
    --ds-accent: #00cec9;
    --ds-accent-dim: rgba(0, 206, 201, 0.15);
    --ds-success: #00b894;
    --ds-success-dim: rgba(0, 184, 148, 0.12);
    --ds-danger: #ff6b6b;
    --ds-danger-dim: rgba(255, 107, 107, 0.12);
    --ds-warning: #feca57;
    --ds-warning-dim: rgba(254, 202, 87, 0.12);
    --ds-info: #54a0ff;
    --ds-info-dim: rgba(84, 160, 255, 0.12);
    --ds-add-bg: rgba(0, 184, 148, 0.12);
    --ds-add-border: #00b894;
    --ds-add-text: #55efc4;
    --ds-del-bg: rgba(255, 107, 107, 0.12);
    --ds-del-border: #ff6b6b;
    --ds-del-text: #fab1a0;
    --ds-radius: 8px;
    --ds-radius-sm: 4px;
    --ds-radius-lg: 12px;
    --ds-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --ds-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --ds-font: 'Inter', 'Segoe UI', -apple-system, sans-serif;
    --ds-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    --ds-transition: 0.2s ease;
}

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

body.ds-hub-body, body.ds-workspace-body {
    font-family: var(--ds-font);
    color: var(--ds-text);
    background: var(--ds-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.ds-workspace-body {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ─── Dark-themed scrollbars ────────────────────────────────── */
.ds-workspace-body ::-webkit-scrollbar { width: 8px; height: 8px; }
.ds-workspace-body ::-webkit-scrollbar-track { background: var(--ds-bg-2); }
.ds-workspace-body ::-webkit-scrollbar-thumb { background: var(--ds-border-light); border-radius: 4px; }
.ds-workspace-body ::-webkit-scrollbar-thumb:hover { background: var(--ds-text-3); }
.ds-workspace-body ::-webkit-scrollbar-corner { background: var(--ds-bg-2); }
.ds-hub-body ::-webkit-scrollbar { width: 8px; height: 8px; }
.ds-hub-body ::-webkit-scrollbar-track { background: var(--ds-bg-2); }
.ds-hub-body ::-webkit-scrollbar-thumb { background: var(--ds-border-light); border-radius: 4px; }
.ds-hub-body ::-webkit-scrollbar-thumb:hover { background: var(--ds-text-3); }

a { color: var(--ds-primary-light); text-decoration: none; }
a:hover { color: var(--ds-primary); }
code { font-family: var(--ds-mono); font-size: 0.875em; background: var(--ds-bg-4); padding: 2px 6px; border-radius: var(--ds-radius-sm); }

/* ═══════════════════════════════════════════════════════════════ */
/* BUTTONS                                                         */
/* ═══════════════════════════════════════════════════════════════ */
.ds-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: none; border-radius: var(--ds-radius);
    font-family: var(--ds-font); font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all var(--ds-transition);
    white-space: nowrap;
}
.ds-btn:hover { transform: translateY(-1px); }
.ds-btn:active { transform: translateY(0); }
.ds-btn-primary { background: var(--ds-primary); color: #fff; }
.ds-btn-primary:hover { background: #5b4bd5; box-shadow: 0 4px 15px rgba(108,92,231,0.4); }
.ds-btn-accent { background: var(--ds-accent); color: #000; }
.ds-btn-accent:hover { background: #00b5b0; }
.ds-btn-ghost { background: transparent; color: var(--ds-text-2); border: 1px solid var(--ds-border); }
.ds-btn-ghost:hover { background: var(--ds-bg-4); color: var(--ds-text); }
.ds-btn-sm { padding: 4px 10px; font-size: 12px; }
.ds-btn-lg { padding: 12px 28px; font-size: 15px; }
.ds-icon-btn {
    background: transparent; border: none; color: var(--ds-text-3); cursor: pointer;
    padding: 4px; border-radius: var(--ds-radius-sm); transition: all var(--ds-transition);
}
.ds-icon-btn:hover { color: var(--ds-text); background: var(--ds-bg-4); }

/* ═══════════════════════════════════════════════════════════════ */
/* INPUTS                                                          */
/* ═══════════════════════════════════════════════════════════════ */
.ds-input {
    background: var(--ds-bg-3); border: 1px solid var(--ds-border);
    color: var(--ds-text); border-radius: var(--ds-radius); padding: 8px 12px;
    font-family: var(--ds-font); font-size: 13px; width: 100%;
    transition: border-color var(--ds-transition);
}
.ds-input:focus { outline: none; border-color: var(--ds-primary); box-shadow: 0 0 0 3px var(--ds-primary-dim); }
.ds-textarea { resize: vertical; min-height: 60px; }
.ds-select {
    background-color: var(--ds-bg-3); border: 1px solid var(--ds-border);
    color: var(--ds-text); border-radius: var(--ds-radius-sm); padding: 4px 8px;
    font-family: var(--ds-font); font-size: 12px; cursor: pointer;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7089' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 6px center; padding-right: 24px;
}
.ds-select:focus { outline: none; border-color: var(--ds-primary); }
.ds-select option { background: var(--ds-bg-3); color: var(--ds-text); }
.ds-check {
    display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ds-text-2);
    cursor: pointer; padding: 3px 0;
}
.ds-check input[type="checkbox"] {
    accent-color: var(--ds-primary); width: 15px; height: 15px; cursor: pointer;
}
.ds-input-group { display: flex; gap: 8px; }
.ds-input-group .ds-input { flex: 1; }
.ds-form-group { margin-bottom: 16px; }
.ds-form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--ds-text-2); margin-bottom: 6px; }

/* ═══════════════════════════════════════════════════════════════ */
/* TOP NAV (Hub)                                                   */
/* ═══════════════════════════════════════════════════════════════ */
.ds-topnav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 24px; background: var(--ds-bg-2); border-bottom: 1px solid var(--ds-border);
    position: sticky; top: 0; z-index: 50;
}
.ds-topnav-back {
    display: flex; align-items: center; gap: 6px; color: var(--ds-text-3); font-size: 13px; font-weight: 500;
    transition: color var(--ds-transition);
}
.ds-topnav-back:hover { color: var(--ds-text); }
.ds-topnav-brand { display: flex; align-items: center; gap: 8px; }
.ds-brand-icon { font-size: 20px; }
.ds-brand-text { font-size: 15px; color: var(--ds-text-2); }
.ds-brand-text strong { color: var(--ds-text); }
.ds-user-badge {
    background: var(--ds-bg-4); color: var(--ds-text-2); padding: 4px 12px;
    border-radius: 20px; font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════ */
/* HUB HERO                                                        */
/* ═══════════════════════════════════════════════════════════════ */
.ds-hub-hero {
    padding: 80px 24px 60px; text-align: center;
    background: linear-gradient(135deg, var(--ds-bg-2) 0%, var(--ds-bg) 50%, var(--ds-bg-3) 100%);
    position: relative; overflow: hidden;
}
.ds-hub-hero::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(108,92,231,0.08) 0%, transparent 70%);
}
.ds-hub-hero-content { position: relative; z-index: 1; }
.ds-hub-hero h1 {
    font-size: 48px; font-weight: 800; letter-spacing: -1px;
    background: linear-gradient(135deg, var(--ds-primary-light), var(--ds-accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; margin-bottom: 12px;
}
.ds-hub-hero-sub { font-size: 18px; color: var(--ds-text-2); margin-bottom: 32px; }
.ds-hub-hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════ */
/* HUB SECTIONS                                                    */
/* ═══════════════════════════════════════════════════════════════ */
.ds-hub-section { padding: 60px 24px; }
.ds-hub-section-alt { background: var(--ds-bg-2); }
.ds-hub-container { max-width: 1200px; margin: 0 auto; }
.ds-section-title {
    font-size: 28px; font-weight: 700; text-align: center; margin-bottom: 12px;
}
.ds-section-sub { text-align: center; color: var(--ds-text-2); margin-bottom: 32px; }

/* Mode Cards */
.ds-mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.ds-mode-card {
    background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg);
    padding: 28px; display: flex; flex-direction: column; gap: 12px;
    transition: all var(--ds-transition); position: relative; overflow: hidden; color: var(--ds-text);
}
.ds-mode-card:hover {
    border-color: var(--ds-primary); transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(108,92,231,0.15); color: var(--ds-text);
}
.ds-mode-icon {
    width: 52px; height: 52px; border-radius: var(--ds-radius);
    display: flex; align-items: center; justify-content: center;
}
.ds-mode-card h3 { font-size: 18px; font-weight: 700; }
.ds-mode-card p { font-size: 14px; color: var(--ds-text-2); line-height: 1.5; flex: 1; }
.ds-mode-tag {
    display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase;
    padding: 3px 10px; border-radius: 20px; background: var(--ds-primary-dim); color: var(--ds-primary-light);
    letter-spacing: 0.5px; align-self: flex-start;
}
.ds-mode-tag-pro { background: var(--ds-accent-dim); color: var(--ds-accent); }

/* Preset Cards */
.ds-preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.ds-preset-card {
    background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius);
    padding: 20px; transition: all var(--ds-transition); color: var(--ds-text);
}
.ds-preset-card:hover { border-color: var(--ds-accent); transform: translateY(-2px); color: var(--ds-text); }
.ds-preset-icon { font-size: 24px; margin-bottom: 8px; }
.ds-preset-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.ds-preset-card p { font-size: 12px; color: var(--ds-text-3); }

/* Sessions */
.ds-sessions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ds-session-card {
    background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius);
    padding: 20px; transition: all var(--ds-transition); color: var(--ds-text);
}
.ds-session-card:hover { border-color: var(--ds-primary); color: var(--ds-text); }
.ds-session-card.ds-pinned { border-left: 3px solid var(--ds-warning); }
.ds-session-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ds-session-header h4 { font-size: 15px; font-weight: 600; }
.ds-session-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ds-tag {
    font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--ds-bg-4); color: var(--ds-text-3);
}
.ds-tag-mode { background: var(--ds-primary-dim); color: var(--ds-primary-light); }
.ds-session-stats { display: flex; justify-content: space-between; font-size: 12px; color: var(--ds-text-3); }
.ds-session-date { color: var(--ds-text-3); }

/* Features */
.ds-features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.ds-feature-item { text-align: center; padding: 24px; }
.ds-feature-icon { font-size: 32px; margin-bottom: 12px; }
.ds-feature-item h4 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.ds-feature-item p { font-size: 14px; color: var(--ds-text-2); }

/* Empty state */
.ds-empty-state {
    display: flex; flex-direction: column; align-items: center; padding: 40px; gap: 12px; color: var(--ds-text-3);
}

/* Loader */
.ds-loader-area { text-align: center; padding: 40px; }
.ds-spinner {
    display: inline-block; width: 28px; height: 28px;
    border: 3px solid var(--ds-border); border-top-color: var(--ds-primary);
    border-radius: 50%; animation: ds-spin 0.8s linear infinite;
}
.ds-spinner-sm {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid var(--ds-border); border-top-color: #fff;
    border-radius: 50%; animation: ds-spin 0.8s linear infinite;
}
@keyframes ds-spin { to { transform: rotate(360deg); } }

/* Footer */
.ds-hub-footer { text-align: center; padding: 24px; color: var(--ds-text-3); font-size: 13px; }

/* ═══════════════════════════════════════════════════════════════ */
/* TOOLBAR (Workspace)                                             */
/* ═══════════════════════════════════════════════════════════════ */
.ds-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px; height: 48px; background: var(--ds-bg-2);
    border-bottom: 1px solid var(--ds-border); z-index: 100;
    flex-wrap: nowrap; overflow-x: auto; flex-shrink: 0;
}
.ds-toolbar-left, .ds-toolbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ds-toolbar-brand {
    display: flex; align-items: center; gap: 6px; color: var(--ds-text); font-size: 14px; font-weight: 600;
}
.ds-toolbar-brand:hover { color: var(--ds-primary-light); }
.ds-toolbar-sep { width: 1px; height: 24px; background: var(--ds-border); margin: 0 8px; }
.ds-toolbar-group { display: flex; align-items: center; gap: 4px; }
.ds-toolbar-label { font-size: 11px; color: var(--ds-text-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.ds-toolbar-btn {
    display: flex; align-items: center; gap: 4px; padding: 4px 10px;
    background: transparent; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-sm);
    color: var(--ds-text-2); font-size: 12px; cursor: pointer; transition: all var(--ds-transition);
}
.ds-toolbar-btn:hover { background: var(--ds-bg-4); color: var(--ds-text); }

/* ═══════════════════════════════════════════════════════════════ */
/* OPTIONS PANEL                                                   */
/* ═══════════════════════════════════════════════════════════════ */
.ds-options-panel {
    background: var(--ds-bg-3); border-bottom: 1px solid var(--ds-border);
    padding: 16px 24px; animation: ds-slideDown 0.2s ease;
    flex-shrink: 0;
}
@keyframes ds-slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.ds-options-inner { display: flex; gap: 48px; flex-wrap: wrap; }
.ds-options-col h4 { font-size: 13px; font-weight: 600; color: var(--ds-text); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ═══════════════════════════════════════════════════════════════ */
/* MAIN LAYOUT (Workspace)                                         */
/* ═══════════════════════════════════════════════════════════════ */
.ds-main {
    display: grid; grid-template-columns: 1fr 1fr;
    flex: 1; min-height: 0;
    overflow: hidden;
}

/* ─── Editors ─────────────────────────────────────────────────── */
.ds-editors-area {
    display: flex; border-right: 1px solid var(--ds-border);
    overflow: hidden; min-height: 0;
}
.ds-editor-pane { flex: 1 1 50%; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.ds-editor-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; background: var(--ds-bg-3); border-bottom: 1px solid var(--ds-border);
    flex-shrink: 0;
}
.ds-editor-title {
    display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ds-text-2);
}
.ds-editor-actions { display: flex; gap: 4px; }
.ds-editor-wrap {
    display: flex; flex: 1; overflow: hidden; position: relative;
}
.ds-line-numbers {
    width: 40px; padding: 12px 8px 12px 0; text-align: right;
    font-family: var(--ds-mono); font-size: 12px; line-height: 1.6;
    color: var(--ds-text-3); background: var(--ds-bg-2); border-right: 1px solid var(--ds-border);
    overflow: hidden; white-space: pre; flex-shrink: 0; user-select: none;
}
.ds-editor {
    flex: 1; border: none; outline: none; resize: none;
    background: var(--ds-bg); color: var(--ds-text);
    font-family: var(--ds-mono); font-size: 13px; line-height: 1.6;
    padding: 12px; white-space: pre-wrap; word-break: break-word;
    overflow: auto; min-height: 0;
}
.ds-editor::placeholder { color: var(--ds-text-3); }
.ds-editor.ds-dragover { background: var(--ds-primary-dim); }
.ds-editor:focus { box-shadow: inset 0 0 0 2px var(--ds-primary-dim); }

/* Resize handle */
.ds-resize-handle {
    width: 6px; cursor: col-resize; background: var(--ds-border);
    transition: background var(--ds-transition); flex-shrink: 0;
}
.ds-resize-handle:hover, .ds-resize-handle.active { background: var(--ds-primary); }

/* ─── Results Area ────────────────────────────────────────────── */
.ds-results-area {
    display: flex; flex-direction: column; overflow: hidden; min-height: 0;
}
.ds-result-tabs {
    display: flex; background: var(--ds-bg-3); border-bottom: 1px solid var(--ds-border);
    flex-shrink: 0;
}
.ds-result-tab {
    padding: 10px 20px; background: transparent; border: none; color: var(--ds-text-3);
    font-size: 13px; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent;
    transition: all var(--ds-transition);
}
.ds-result-tab:hover { color: var(--ds-text); }
.ds-result-tab.active { color: var(--ds-primary-light); border-bottom-color: var(--ds-primary); }

.ds-view-mode {
    display: flex; gap: 4px; padding: 6px 12px; background: var(--ds-bg-3);
    border-bottom: 1px solid var(--ds-border); flex-shrink: 0;
}
.ds-view-btn {
    padding: 4px 8px; background: transparent; border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-sm); color: var(--ds-text-3); cursor: pointer;
    transition: all var(--ds-transition);
}
.ds-view-btn:hover { color: var(--ds-text); }
.ds-view-btn.active { background: var(--ds-primary-dim); color: var(--ds-primary-light); border-color: var(--ds-primary); }

.ds-tab-content { display: none; flex: 1; overflow: auto; padding: 0; }
.ds-tab-content.active { display: flex; flex-direction: column; }

.ds-diff-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex: 1; color: var(--ds-text-3); gap: 16px; text-align: center; padding: 40px;
}
.ds-muted { color: var(--ds-text-3); font-size: 13px; padding: 16px; }

/* ═══════════════════════════════════════════════════════════════ */
/* DIFF OUTPUT                                                     */
/* ═══════════════════════════════════════════════════════════════ */

/* Side-by-side */
.ds-sbs-container { flex: 1; display: flex; flex-direction: column; }
.ds-sbs-header {
    display: grid; grid-template-columns: 1fr 1fr;
    background: var(--ds-bg-3); border-bottom: 1px solid var(--ds-border);
    flex-shrink: 0;
}
.ds-sbs-title {
    padding: 8px 16px; font-size: 12px; font-weight: 600; color: var(--ds-text-2);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.ds-sbs-body { display: grid; grid-template-columns: 1fr 1fr; flex: 1; overflow: hidden; }
.ds-sbs-left, .ds-sbs-right {
    overflow: auto; font-family: var(--ds-mono); font-size: 13px; line-height: 1.6;
}
.ds-sbs-left { border-right: 1px solid var(--ds-border); }

/* Inline */
.ds-inline-container {
    flex: 1; overflow: auto; font-family: var(--ds-mono); font-size: 13px; line-height: 1.6;
}

/* Diff lines */
.ds-diff-line {
    display: flex; white-space: pre-wrap; word-break: break-all; min-height: 22px;
}
.ds-ln {
    width: 44px; text-align: right; padding: 0 8px 0 4px; color: var(--ds-text-3);
    user-select: none; flex-shrink: 0; font-size: 12px;
}
.ds-lp { width: 16px; text-align: center; color: var(--ds-text-3); flex-shrink: 0; }
.ds-lc { flex: 1; padding: 0 8px; }

.ds-line-eq { background: transparent; }
.ds-line-add { background: var(--ds-add-bg); }
.ds-line-add .ds-ln { color: var(--ds-add-text); }
.ds-line-add .ds-lc { color: var(--ds-add-text); }
.ds-line-add .ds-lp { color: var(--ds-add-text); }
.ds-line-del { background: var(--ds-del-bg); }
.ds-line-del .ds-ln { color: var(--ds-del-text); }
.ds-line-del .ds-lc { color: var(--ds-del-text); }
.ds-line-del .ds-lp { color: var(--ds-del-text); }
.ds-line-pad { background: var(--ds-bg-3); min-height: 22px; }

.ds-nav-highlight { outline: 2px solid var(--ds-warning); outline-offset: -2px; border-radius: 2px; }

.ds-collapsed {
    text-align: center; padding: 6px; color: var(--ds-text-3); font-size: 12px;
    background: var(--ds-bg-3); cursor: pointer; user-select: none;
}
.ds-collapsed:hover { background: var(--ds-bg-4); color: var(--ds-text-2); }

/* Unified patch */
.ds-unified-container { flex: 1; overflow: auto; padding: 0; }
.ds-unified-pre { margin: 0; font-family: var(--ds-mono); font-size: 13px; line-height: 1.6; }
.ds-u-header { color: var(--ds-info); font-weight: 700; padding: 2px 12px; }
.ds-u-range { color: var(--ds-primary-light); background: var(--ds-primary-dim); padding: 2px 12px; font-weight: 600; }
.ds-u-add { background: var(--ds-add-bg); color: var(--ds-add-text); padding: 0 12px; }
.ds-u-del { background: var(--ds-del-bg); color: var(--ds-del-text); padding: 0 12px; }
.ds-u-ctx { padding: 0 12px; }

/* ═══════════════════════════════════════════════════════════════ */
/* SUMMARY PANEL                                                   */
/* ═══════════════════════════════════════════════════════════════ */
.ds-summary-area { padding: 20px; overflow: auto; }
.ds-summary-text {
    font-size: 15px; color: var(--ds-text); margin-bottom: 24px;
    padding: 16px; background: var(--ds-bg-3); border-radius: var(--ds-radius);
    border-left: 3px solid var(--ds-primary);
}
.ds-stats-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px;
}
.ds-stat-card {
    background: var(--ds-bg-3); border-radius: var(--ds-radius); padding: 16px; text-align: center;
    border: 1px solid var(--ds-border);
}
.ds-stat-val { font-size: 28px; font-weight: 700; }
.ds-stat-lbl { font-size: 12px; color: var(--ds-text-3); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.ds-stat-add .ds-stat-val { color: var(--ds-success); }
.ds-stat-del .ds-stat-val { color: var(--ds-danger); }
.ds-stat-blk .ds-stat-val { color: var(--ds-warning); }
.ds-stat-sim .ds-stat-val { color: var(--ds-primary-light); }
.ds-stat-orig .ds-stat-val { color: var(--ds-text-2); }
.ds-stat-mod .ds-stat-val { color: var(--ds-text-2); }

.ds-classification { margin-bottom: 20px; }
.ds-classification h4 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.ds-class-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.ds-class-tag {
    font-size: 12px; padding: 4px 12px; border-radius: 20px; font-weight: 600;
}
.ds-class-format { background: var(--ds-info-dim); color: var(--ds-info); }
.ds-class-content { background: var(--ds-warning-dim); color: var(--ds-warning); }
.ds-class-struct { background: var(--ds-danger-dim); color: var(--ds-danger); }
.ds-class-case { background: var(--ds-accent-dim); color: var(--ds-accent); }
.ds-class-ws { background: var(--ds-info-dim); color: var(--ds-info); }
.ds-class-reorder { background: var(--ds-primary-dim); color: var(--ds-primary-light); }
.ds-class-identical { background: var(--ds-success-dim); color: var(--ds-success); }

.ds-analysis-section {
    margin-top: 20px; padding: 16px; background: var(--ds-bg-3); border-radius: var(--ds-radius);
    border: 1px solid var(--ds-border);
}
.ds-analysis-section h4 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.ds-analysis-section p { font-size: 13px; color: var(--ds-text-2); margin-bottom: 6px; }
.ds-key-list { font-size: 12px; color: var(--ds-text-2); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════ */
/* INSIGHTS PANEL                                                  */
/* ═══════════════════════════════════════════════════════════════ */
.ds-insights-area { padding: 16px; overflow: auto; }
.ds-insights-list { display: flex; flex-direction: column; gap: 8px; }
.ds-insight {
    padding: 12px 16px; border-radius: var(--ds-radius); font-size: 13px;
}
.ds-insight-info { background: var(--ds-info-dim); color: var(--ds-info); border-left: 3px solid var(--ds-info); }
.ds-insight-warning { background: var(--ds-warning-dim); color: var(--ds-warning); border-left: 3px solid var(--ds-warning); }
.ds-insight-error { background: var(--ds-danger-dim); color: var(--ds-danger); border-left: 3px solid var(--ds-danger); }

/* ═══════════════════════════════════════════════════════════════ */
/* NAVIGATOR PANEL                                                 */
/* ═══════════════════════════════════════════════════════════════ */
.ds-navigator-area { padding: 16px; overflow: auto; }
.ds-nav-controls { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ds-nav-info { font-size: 13px; color: var(--ds-text-2); }
.ds-nav-buttons { display: flex; align-items: center; gap: 4px; }
.ds-nav-pos { font-size: 12px; color: var(--ds-text-2); padding: 0 8px; min-width: 60px; text-align: center; }
.ds-nav-list { display: flex; flex-direction: column; gap: 6px; }
.ds-nav-item {
    display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px;
    background: var(--ds-bg-3); border-radius: var(--ds-radius); cursor: pointer;
    border: 1px solid transparent; transition: all var(--ds-transition);
}
.ds-nav-item:hover { border-color: var(--ds-border-light); }
.ds-nav-item.active { border-color: var(--ds-primary); background: var(--ds-primary-dim); }
.ds-nav-idx {
    font-size: 11px; font-weight: 700; color: var(--ds-text-3); min-width: 32px;
    padding: 2px 6px; background: var(--ds-bg-4); border-radius: var(--ds-radius-sm); text-align: center;
}
.ds-nav-preview { flex: 1; font-family: var(--ds-mono); font-size: 12px; overflow: hidden; }
.ds-nav-del { color: var(--ds-del-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-nav-add { color: var(--ds-add-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ═══════════════════════════════════════════════════════════════ */
/* BOTTOM PANEL                                                    */
/* ═══════════════════════════════════════════════════════════════ */
.ds-bottom-panel {
    border-top: 1px solid var(--ds-border); background: var(--ds-bg-2);
    height: 140px; display: flex; flex-direction: column; overflow: hidden;
    flex-shrink: 0;
}
.ds-bottom-tabs {
    display: flex; border-bottom: 1px solid var(--ds-border); flex-shrink: 0;
}
.ds-bottom-tab {
    padding: 6px 16px; background: transparent; border: none; color: var(--ds-text-3);
    font-size: 12px; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent;
}
.ds-bottom-tab:hover { color: var(--ds-text); }
.ds-bottom-tab.active { color: var(--ds-primary-light); border-bottom-color: var(--ds-primary); }
.ds-bottom-content { display: none; flex: 1; overflow: auto; padding: 8px 16px; }
.ds-bottom-content.active { display: block; }

.ds-health-items { font-size: 13px; }
.ds-health-ok { color: var(--ds-success); padding: 4px 0; }
.ds-health-warn { color: var(--ds-warning); padding: 4px 0; }
.ds-health-meta { color: var(--ds-text-3); padding: 8px 0; font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════ */
/* MODALS                                                          */
/* ═══════════════════════════════════════════════════════════════ */
.ds-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    animation: ds-fadeIn 0.15s ease;
}
@keyframes ds-fadeIn { from { opacity: 0; } }
.ds-modal {
    background: var(--ds-bg-3); border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg); width: 480px; max-width: 90vw;
    box-shadow: var(--ds-shadow); animation: ds-scaleIn 0.2s ease;
}
@keyframes ds-scaleIn { from { transform: scale(0.95); opacity: 0; } }
.ds-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 16px; border-bottom: 1px solid var(--ds-border);
}
.ds-modal-header h3 { font-size: 18px; font-weight: 700; }
.ds-modal-close {
    background: none; border: none; color: var(--ds-text-3); font-size: 24px;
    cursor: pointer; padding: 0; line-height: 1;
}
.ds-modal-close:hover { color: var(--ds-text); }
.ds-modal-body { padding: 20px 24px; }
.ds-modal-footer { padding: 16px 24px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--ds-border); }

.ds-export-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ds-export-option {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 20px; background: var(--ds-bg-4); border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius); cursor: pointer; transition: all var(--ds-transition);
    color: var(--ds-text);
}
.ds-export-option:hover { border-color: var(--ds-primary); background: var(--ds-primary-dim); }
.ds-export-icon { font-size: 28px; }

/* ═══════════════════════════════════════════════════════════════ */
/* TOAST                                                           */
/* ═══════════════════════════════════════════════════════════════ */
.ds-toast {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(100px);
    padding: 10px 24px; border-radius: var(--ds-radius); font-size: 13px; font-weight: 500;
    z-index: 2000; opacity: 0; transition: all 0.3s ease; pointer-events: none;
    background: var(--ds-bg-4); color: var(--ds-text); border: 1px solid var(--ds-border);
}
.ds-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ds-toast-success { background: var(--ds-success-dim); color: var(--ds-success); border-color: var(--ds-success); }
.ds-toast-error { background: var(--ds-danger-dim); color: var(--ds-danger); border-color: var(--ds-danger); }
.ds-toast-warning { background: var(--ds-warning-dim); color: var(--ds-warning); border-color: var(--ds-warning); }

/* ═══════════════════════════════════════════════════════════════ */
/* RESPONSIVE                                                      */
/* ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .ds-main { grid-template-columns: 1fr; flex: 1; }
    body.ds-workspace-body { height: auto; overflow: auto; }
    .ds-editors-area { flex-direction: column; border-right: none; border-bottom: 1px solid var(--ds-border); min-height: 400px; }
    .ds-resize-handle { display: none; }
    .ds-editor-pane { flex: 1 !important; min-height: 180px; }
    .ds-results-area { min-height: 400px; }
    .ds-sbs-body { grid-template-columns: 1fr; }
    .ds-sbs-header { grid-template-columns: 1fr; }
    .ds-sbs-left { border-right: none; border-bottom: 1px solid var(--ds-border); }
    .ds-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .ds-toolbar { height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
    .ds-toolbar-left, .ds-toolbar-right { flex-wrap: wrap; gap: 6px; }
    .ds-toolbar-sep { display: none; }
    .ds-hub-hero h1 { font-size: 32px; }
    .ds-hub-hero { padding: 40px 16px 32px; }
    .ds-mode-grid { grid-template-columns: 1fr; }
    .ds-preset-grid { grid-template-columns: repeat(2, 1fr); }
    .ds-options-inner { flex-direction: column; gap: 20px; }
    .ds-bottom-panel { height: 120px; }
}

@media (max-width: 480px) {
    .ds-hub-hero h1 { font-size: 28px; }
    .ds-preset-grid { grid-template-columns: 1fr; }
    .ds-stats-grid { grid-template-columns: 1fr; }
    .ds-export-options { grid-template-columns: 1fr; }
}
